NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.98k stars 14k forks source link

A possible bug with setting flags for Haskell packages #84337

Closed mrkkrp closed 4 years ago

mrkkrp commented 4 years ago

Describe the bug

Here I enabled the dev flag:

https://github.com/tweag/ormolu/blob/master/default.nix#L18

I know for a fact that current master must fail with this flag because there are warnings and it sets -Werror. I confirmed it by building the package with stack and Cabal locally. Now if we look at the logs:

https://buildkite.com/tweag-1/ormolu/builds/34#cccf6dbf-960c-4dde-974c-3c3a3a685d76/14-64

It says: Flags chosen: dev=True and yet the build succeeds!

What is going on with it?

mrkkrp commented 4 years ago

It looks like even if I edit the Cabal file to make the flag always enabled:

flag dev
  description:        Turn on development settings.
  manual:             True
  default:            True

The build still succeeds. Maybe there is something wrong with callCabal2nix, maybe it ignores the flags somehow? For now I can't spend more time on this one, but that's a surprising behavior.

mrkkrp commented 4 years ago

It was my mistake actually, because strangely the warnings about redundant modules are not reported with ghc865 unlike ghc883 which I used locally with Stack. Closing.