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

Ignored flags from cabal.project #10767

Open
hsyl20 opened this issue Jan 29, 2025 · 0 comments
Open

Ignored flags from cabal.project #10767

hsyl20 opened this issue Jan 29, 2025 · 0 comments

Comments

@hsyl20
Copy link
Collaborator

hsyl20 commented Jan 29, 2025

Describe the bug
If there is more than one flags: ... stanza in a cabal.project file, only one of them is taken into account.

To Reproduce

> cat foo.cabal
cabal-version:  3.0
name:           foo
version:        0.1
license:        BSD-3-Clause
build-type:     Simple

flag bar
  default: True
  manual: True

flag baz
  default: True
  manual: True

Library
    if flag(bar) || flag (baz)
      buildable: false

> cat cabal.project
packages: .

package foo
  flags: -bar
  flags: -baz
  -- flags: -bar -baz -- this works

> cabal build
Error: [Cabal-7127]
Cannot build the package foo-0.1 because none of the components are available to build: the library is marked as 'buildable: False'

If we set all the flags at once (i.e. uncomment the last line in cabal.project) then it works.

Expected behavior
I would expect flags to be merged. Or at least a warning that some flags stanza has been ignored.

System information

  • cabal: 3.12.1.0 and HEAD
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

1 participant