packcheck
packcheck copied to clipboard
Provide a way to specify different ghc options for dependencies
If I do
sh packcheck.sh cabal-new GHCVER=8.4.3 GHC_OPTIONS="-O0 -Werror -Wall"
then the build fails because of warnings compiling some of the dependencies. I'd like to be able to specify -Werror
for the local build only, and not for the dependencies. This would require a two-phase build, first with cabal new-build --dependencies-only
, and the ability to specify different options for the dependencies and the local build. (Or is there another way to work around this?)
(Great project, by the way! Aside from this issue, it is what I have been dreaming of.)
@jgm thanks for raising the issue and for the feedback. I am aware of this issue, this shows only in cabal-new
build, stack build does not have this issue as stack does not pass the ghc options to all dependencies by default. This is annoying, and I do not pass -Werror
to cabal builds because of this.
This would require a two-phase build, first with cabal new-build --dependencies-only, and the ability to specify different options for the dependencies and the local build. (Or is there another way to work around this?)
I can try what you suggested. It would be nice if cabal itself supported a flag that passes ghc options only to the local packages and not dependencies. I am not really familiar with all of cabal's options. @hvr would you have an idea how to solve this in a nice way?
@jgm using --only-dependencies
in the first phase of a two-phase build does not solve this issue. cabal still rebuilds all dependencies if a different GHC flag is specified in the second build phase. I think this can only be solved once haskell/cabal#3883 gets resolved.
@jgm #21 implements CABAL_PROJECT
environment option to specify a custom cabal project file to solve this problem as suggested in the cabal issue mentioned above.
Seems tedious to have to maintain two separate cabal.project files, one for local builds and one for CI.
See #43 , that might solve this in a better way.