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:
|
ghc-options: -j -Werror -Wall -fwarn-identities |
|
-fno-spec-constr -optP-Wno-nonportable-include-path |
|
ghc-options: -j -threaded -rtsopts "-with-rtsopts=-N -I0 -qg" |
|
-O2 -Werror -Wall -fwarn-identities |
|
-fno-spec-constr -optP-Wno-nonportable-include-path |
Duplicated language extensions:
|
default-language: Haskell2010 |
|
default-extensions: OverloadedStrings |
|
NoImplicitPrelude |
|
NumericUnderscores |
|
default-extensions: OverloadedStrings |
|
QuasiQuotes |
|
NoImplicitPrelude |
|
NumericUnderscores |
... and more.
Also discussed in #5139 (comment)
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.
Problem
Right now there is a lot of duplication in
postgrest.cabalbetween different project components. This includes common build information,ghc-options, default language extensions and more.Duplicated flags:
postgrest/postgrest.cabal
Lines 176 to 177 in ca4a6d9
postgrest/postgrest.cabal
Lines 205 to 207 in ca4a6d9
Duplicated language extensions:
postgrest/postgrest.cabal
Lines 41 to 44 in ca4a6d9
postgrest/postgrest.cabal
Lines 221 to 224 in ca4a6d9
... and more.
Also discussed in #5139 (comment)
Solution
We can use common stanzas to group these options and reuse in different places.
It would look something like:
Notes
We should discuss how to group these effectively, the above is just an example.