PostgREST / PostgREST/postgrest
Share common ghc options and other fields in `postgrest.cabal`
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 27.7k
- Forks
- 1.2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 54
Description
Problem
Right now there is a lot of duplication in postgrest.cabal between different project components. This includes common build information, ghc-options, default language extensions and more.
Duplicated flags:
Duplicated language extensions:
... and more.
Also discussed in https://github.com/PostgREST/postgrest/pull/5139#discussion_r3699864634
Solution
We can use common stanzas to group these options and reuse in different places.
It would look something like:
common common-lang-edition
default-language: Haskell2010
common common-exts
default-extensions: OverloadedStrings
NoImplicitPrelude
NumericUnderscores
common common-ghc-options
ghc-options: -j -Werror -Wall -fwarn-identities
-fno-spec-constr -optP-Wno-nonportable-include-path
.
.
.
library
import: common-lang-edition, common-exts, common-ghc-options
...
executable postgrest
import: common-lang-edition, common-exts, common-ghc-options
...
test-suite spec
import: common-lang-edition, common-exts, common-ghc-options
default-extensions: QuasiQuotes
...
Notes
We should discuss how to group these effectively, the above is just an example.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in postgrest.cabal at the duplicated build fields, GHC options, and language extensions linked in the issue. Read the Cabal common stanza documentation and the discussion in pull request #5139 before deciding how to group the shared settings. Done means the relevant library, executable, and test-suite sections reuse common stanzas without duplicated options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100