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

Command line flags should override freeze file flags. #10441

Open
bgohla opened this issue Oct 8, 2024 · 0 comments
Open

Command line flags should override freeze file flags. #10441

bgohla opened this issue Oct 8, 2024 · 0 comments

Comments

@bgohla
Copy link

bgohla commented Oct 8, 2024

Describe the feature request
A simple description of what you would like to be added to Cabal.

Given a project as follows:

$ cat cabal-freeze-bug.cabal
cabal-version:      3.0
name:               cabal-freeze-bug
version:            0.1.0.0
synopsis:           n
-- description:
license:            BSD-2-Clause
license-file:       LICENSE
author:             Björn Gohla
maintainer:         bjorn.gohla@scrive.com
-- copyright:
category:           Testing
build-type:         Simple
extra-doc-files:    CHANGELOG.md
-- extra-source-files:

flag some-flag
     description: a flag that does nothing
     default: True
   
common warnings
    ghc-options: -Wall

executable cabal-freeze-bug
    import:           warnings
    main-is:          Main.hs
    -- other-modules:
    -- other-extensions:
    build-depends:    base ^>=4.18.2.1
    hs-source-dirs:   app
    default-language: Haskell2010
$ cat cabal.project.freeze 
active-repositories: hackage.haskell.org:merge
constraints: any.base ==4.18.2.1,
             cabal-freeze-bug +some-flag,
             any.ghc-bignum ==1.3,
             any.ghc-prim ==0.10.0,
             any.rts ==1.0.2
index-state: hackage.haskell.org 2024-06-14T08:17:16Z

running

cabal build -f-some-flag

should build the cabal-freeze-bug package with the flag turned off, instead of failing with a resolution conflict.

(Likewise for cabal build -c"cabal-freeze-bug -some-flag")

Additional context
Related to #10439

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