Open jasagredo opened 4 years ago
This is still an issue, just encountered it on Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f x86_64 hpack-0.34.4
. Also #5301 appears to be the same issue
Confirmed this is happening in Version 2.13.1, Git revision 8102bb8afce90fc954f48efae38b87f37cabc988 x86_64 hpack-0.36.0
.
General summary/comments
When having local packages that have cabal flags and setting them either with the cli
--flag PACKAGE:[-]FLAG
argument or on the stack.yaml file, the flag is not changed. It works properly for remote packages.Steps to reproduce
I created a sample project that has an internal sub-project and a remote dependency. To observe this behavior, the inner package has to have a flag defined and so must the remote dependency. Setting a value for the local flag doesn't change the behavior.
sample.zip
For instance, in this example we have:
sample
project which depends oncryptonite
andothersample
.cryptonite
has a bunch of flags and for the example I am usingsupport_deepseq
which by default isTrue
. I will set it toFalse
on the stack.yaml file.othersample
has a flaghello
that isFalse
by default. I will set it toTrue
both by adding it in the stack.yaml file and providing the cli argument.The
sample/stack.yaml
file has these fields defined:I also created a
cabal.project
file in order to check that Cabal did the right thing, with these contents:(Note that in order to force recompile of
cryptonite
deleting~/.stack/snapshot
and~/.cabal/store
might be needed)Expected
I would have expected that the flag was overridden also for the local package.
Actual
See the line with the number 4 and the line with number 1646. As shown, the
hello
flag has not been overridden but thesupport_deepseq
flag has been:Note that with the mentioned
cabal.project
file I'm able to do:Stack version
Method of installation
get.haskellstack.org