Skip to content
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

cabal.project ghc-options are not in plan.json #6343

Open
hamishmack opened this issue Nov 13, 2019 · 1 comment
Open

cabal.project ghc-options are not in plan.json #6343

hamishmack opened this issue Nov 13, 2019 · 1 comment

Comments

@hamishmack
Copy link
Collaborator

Describe the bug
It would be useful to have the ghc-options that are specified in a cabal.project file included in the plan.json. We use the plan.json to build nix expressions for building with nix and currently users who specify ghc-options for packages in the cabal.project file must also specify them in their nix expressions to get the same results. This is in contrast to flags specified in the cabal.project file which do wind up in the plan.json file.

To Reproduce
Add something like this to cabal.project

package test-ghc-options
  ghc-options: -DTEST_GHC_OPTION

Run

$ cabal v2-configure

Observe that the ghc-options are not in the plan.json generated, though they will be used when cabal v2-build test-ghc-options is run.

Example code here and the nix based work around we currently use is here.

@phadej
Copy link
Collaborator

phadej commented Nov 13, 2019

If we are going this way, we should specify all data which may affect ~/.cabal/store hashes in plan.json.

That will be IMHO very welcome.


FWIW: ghc-options: -DTEST_GHC_OPTIONS is wrong, you should use cpp-options: -DTEST_GHC_OPTIONS e.g. so only providing ghc-options in plan.json would be incomplete solution.


EDIT: until then cabal.project is an input to v2-build etc. So simply copying data from cabal.project to plan.json doesn't make sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants