cabal: fix upload to hackage (#1532)
When doing: ``` cabal upload dist-newstyle/sdist/postgrest-7.0.1.tar.gz ``` The following error is shown: ``` Error: Invalid package 'ghc-options: -Wall -Werror' makes the package very easy to break with future GHC versions because new GHC versions often add new warnings. Use just 'ghc-options: -Wall' instead. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. ``` Put -Werror in a cabal flag to work around this restriction.
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ let
|
|||||||
|
|
||||||
# Base dynamic derivation for the PostgREST package.
|
# Base dynamic derivation for the PostgREST package.
|
||||||
drv =
|
drv =
|
||||||
pkgs.haskellPackages.callCabal2nix name src {};
|
lib.enableCabalFlag (pkgs.haskellPackages.callCabal2nix name src {}) "FailOnWarn";
|
||||||
|
|
||||||
# Static derivation for the PostgREST executable.
|
# Static derivation for the PostgREST executable.
|
||||||
drvStatic =
|
drvStatic =
|
||||||
|
|||||||
+14
-5
@@ -19,10 +19,10 @@ source-repository head
|
|||||||
type: git
|
type: git
|
||||||
location: git://github.com/PostgREST/postgrest.git
|
location: git://github.com/PostgREST/postgrest.git
|
||||||
|
|
||||||
flag ci
|
flag FailOnWarn
|
||||||
default: False
|
default: False
|
||||||
manual: True
|
manual: True
|
||||||
description: No warnings allowed in continuous integration
|
description: No warnings allowed
|
||||||
|
|
||||||
library
|
library
|
||||||
exposed-modules: PostgREST.ApiRequest
|
exposed-modules: PostgREST.ApiRequest
|
||||||
@@ -88,8 +88,12 @@ library
|
|||||||
default-extensions: OverloadedStrings
|
default-extensions: OverloadedStrings
|
||||||
QuasiQuotes
|
QuasiQuotes
|
||||||
NoImplicitPrelude
|
NoImplicitPrelude
|
||||||
ghc-options: -O2 -Werror -Wall -fwarn-identities
|
if flag(FailOnWarn)
|
||||||
-fno-spec-constr -optP-Wno-nonportable-include-path
|
ghc-options: -O2 -Werror -Wall -fwarn-identities
|
||||||
|
-fno-spec-constr -optP-Wno-nonportable-include-path
|
||||||
|
else
|
||||||
|
ghc-options: -O2 -Wall -fwarn-identities
|
||||||
|
-fno-spec-constr -optP-Wno-nonportable-include-path
|
||||||
-- -fno-spec-constr may help keep compile time memory use in check,
|
-- -fno-spec-constr may help keep compile time memory use in check,
|
||||||
-- see https://gitlab.haskell.org/ghc/ghc/issues/16017#note_219304
|
-- see https://gitlab.haskell.org/ghc/ghc/issues/16017#note_219304
|
||||||
-- -optP-Wno-nonportable-include-path
|
-- -optP-Wno-nonportable-include-path
|
||||||
@@ -120,9 +124,14 @@ executable postgrest
|
|||||||
default-extensions: OverloadedStrings
|
default-extensions: OverloadedStrings
|
||||||
QuasiQuotes
|
QuasiQuotes
|
||||||
NoImplicitPrelude
|
NoImplicitPrelude
|
||||||
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I2"
|
if flag(FailOnWarn)
|
||||||
|
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I2"
|
||||||
-O2 -Werror -Wall -fwarn-identities
|
-O2 -Werror -Wall -fwarn-identities
|
||||||
-fno-spec-constr -optP-Wno-nonportable-include-path
|
-fno-spec-constr -optP-Wno-nonportable-include-path
|
||||||
|
else
|
||||||
|
ghc-options: -threaded -rtsopts "-with-rtsopts=-N -I2"
|
||||||
|
-O2 -Wall -fwarn-identities
|
||||||
|
-fno-spec-constr -optP-Wno-nonportable-include-path
|
||||||
|
|
||||||
if !os(windows)
|
if !os(windows)
|
||||||
build-depends: unix
|
build-depends: unix
|
||||||
|
|||||||
+4
-1
@@ -1,8 +1,11 @@
|
|||||||
# stack is used for circleci and appveyor CI builds
|
# stack is used for circleci and appveyor CI builds
|
||||||
resolver: lts-15.8
|
resolver: lts-15.8
|
||||||
|
flags:
|
||||||
|
postgrest:
|
||||||
|
FailOnWarn: true
|
||||||
nix:
|
nix:
|
||||||
packages: [pcre, pkgconfig, postgresql, zlib]
|
packages: [pcre, pkgconfig, postgresql, zlib]
|
||||||
# disable pure by default so that the test enviroment can be passed
|
# disable pure by default so that the test enviroment can be passed
|
||||||
pure: false
|
pure: false
|
||||||
extra-deps:
|
extra-deps:
|
||||||
- configurator-pg-0.2.2@sha256:8f3f7c66dd4a53852283c70806ebc101a7219f8b01c3e80c5130e9749c998dc8,2987
|
- configurator-pg-0.2.2@sha256:8f3f7c66dd4a53852283c70806ebc101a7219f8b01c3e80c5130e9749c998dc8,2987
|
||||||
|
|||||||
Reference in New Issue
Block a user