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

Conditionals in project files, processed in order or not? #10706

Open
phadej opened this issue Jan 3, 2025 · 2 comments
Open

Conditionals in project files, processed in order or not? #10706

phadej opened this issue Jan 3, 2025 · 2 comments

Comments

@phadej
Copy link
Collaborator

phadej commented Jan 3, 2025

If I have

packages:   indexed-traversable
packages:   indexed-traversable-instances
if impl(ghc <9.12)
  tests: False
  packages: indexed-traversable-benchmarks

tests:      True
benchmarks: True

it seems that with GHC-9.10 (i.e. when conditional is true), the tests are turned off, even lexically tests: True comes later.

This is consistent with how conditionals work in .cabal files (conditional sections processed as if they appear last), but it's undocumented in https://cabal.readthedocs.io/en/3.12/cabal-project-description-file.html#conditionals-and-imports so I report this as a bug.

@Vekhir
Copy link

Vekhir commented Jan 4, 2025

if impl(ghc <9.12)

should to be false with GHC 9.12, shouldn't it?
Given the rest of the description, I'd expect if impl(ghc >=9.12) is meant.

@phadej
Copy link
Collaborator Author

phadej commented Jan 4, 2025

Edited: with GHC-9.10

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

3 participants