-
Notifications
You must be signed in to change notification settings - Fork 247
Conflicting definitions for flag overrides for cabal projects #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Project flags (from stack.yaml and plan.json) are exported in a modules attribute by stack-to-nix and plan-to-nix, but are not currently used. This change updates `mkStackPkgSet` and `mkCabalProjectPkgSet` so that the modules attribute is used (if present) and includes tests to check they are. This commit makes `stdenv.lib.mkOverride` necessary for setting flags in `mkCabalProjectPkgSet` modules, however it also means that you can set them in `cabal.project` instead (see #254).
Can't we just use |
Oh, that would be nicer. Would it be surprising to anyone that when a flag is set in both Should we change |
Yeah, I think we should do something like:
|
* Use mkOverride 900 for project flags. See input-output-hk/haskell.nix#254
This was fixed by #258 |
* Use mkOverride 900 for project flags. See input-output-hk#254
#253 allows flags to be specified in
stack.yaml
orcabal.project
andhaskell.nix
will use the values specified as the default. This works well forstack.yaml
where we add overrides only for the flags explicitly listed in thestack.yaml
file.For
cabal.project
we read theplan.json
file that includes the values of all the flags (not just the ones that were explicitly set).For instance if we try to override mypackage flags with:
We might get an error that says:
There are two quite good work arounds for this:
We can specify the flag in the
cabal.project
file instead with:Alternatively we can use
stdenv.lib.mkOverride
A possible fix to this might be to patch the cabal to include which flags were explicitly set in
cabal.project
and which were not in theplan.json
.The text was updated successfully, but these errors were encountered: