haskell / haskell/cabal

Command line flags should override freeze file flags.

Open
#10,441 2 comments 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**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 https://github.com/haskell/cabal/issues/10439

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.