You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
the sample project which depends on cryptonite and othersample.
cryptonite has a bunch of flags and for the example I am using support_deepseq which by default is True. I will set it to False on the stack.yaml file.
othersample has a flag hello that is False by default. I will set it to True both by adding it in the stack.yaml file and providing the cli argument.
The sample/stack.yaml file has these fields defined:
extra-deps: [ ./othersample ]
# Override default flag values for local packages and extra-deps
flags:
othersample:
hello: True
cryptonite:
support_deepseq: False
I also created a cabal.project file in order to check that Cabal did the right thing, with these contents:
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
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
The text was updated successfully, but these errors were encountered: