Skip to content

Reject unconstrained dependency = none|all|eq#11470

Draft
philderbeast wants to merge 25 commits intohaskell:masterfrom
cabalism:add/constrain-eq-version
Draft

Reject unconstrained dependency = none|all|eq#11470
philderbeast wants to merge 25 commits intohaskell:masterfrom
cabalism:add/constrain-eq-version

Conversation

@philderbeast
Copy link
Collaborator

@philderbeast philderbeast commented Feb 2, 2026

Fixes #11468. Adds an eq option for --reject-unconstrained-dependencies. Extends the solving failure reason message to include =all or =eq.

Manual QA

With this repository, cabal freeze.

Edit cabal.project.freeze commenting out the line for the pretty dependency.

-             any.pretty ==1.1.3.6,
+          -- any.pretty ==1.1.3.6,

Now cabal build cabal-install-solver --reject-unconstrained-dependencies=? will only build when ? is none.

Edit cabal.project.freeze changing the line for the pretty dependency.

-             any.pretty ==1.1.3.6,
+             any.pretty >0,

Now cabal build --reject-unconstrained-dependencies=? will build when ? is none|all but won't build when ? is eq.

$ cabal build cabal-install-solver --reject-unconstrained-dependencies=eq
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: Cabal-3.17.0.0 (user goal)
[__1] next goal: pretty (dependency of Cabal)
[__1] fail (not a user-provided goal nor mentioned as a constraint,
  but reject-unconstrained-dependencies=eq was set)
[__1] fail (backjumping, conflict set: Cabal, pretty)
After searching the rest of the dependency tree exhaustively,
  these were the goals I've had most trouble fulfilling: Cabal, pretty

Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@philderbeast philderbeast changed the title Add/constrain eq version Reject unconstrained dependency = none|all|eq Feb 2, 2026
@philderbeast philderbeast force-pushed the add/constrain-eq-version branch from 0ddde8d to 4142036 Compare February 2, 2026 02:48
@philderbeast philderbeast marked this pull request as draft February 3, 2026 12:09
@philderbeast philderbeast force-pushed the add/constrain-eq-version branch 4 times, most recently from 8b84ba1 to 4027553 Compare February 6, 2026 19:59
- Update test for == constraint check
- Add OnlyConstrainedEq
- Test --reject-unconstrained-dependencies=eq
- Add haddocks for eq option
- Remove pkgIsExplicit
- One-line keepNonEmpty
- Use pattern guard
- Top level filterThisVersion
- Name tests
@philderbeast philderbeast force-pushed the add/constrain-eq-version branch from a12abc2 to c0117b5 Compare February 6, 2026 22:03
@philderbeast philderbeast force-pushed the add/constrain-eq-version branch 2 times, most recently from 4d58984 to 151bb3f Compare February 7, 2026 17:15
- Use onlyConstrainedAll in solver unit tests
- Add unit tests for =eq and =none
- Add whenNone, whenAll and whenEq
- Enhance the failure message expectation
@philderbeast philderbeast force-pushed the add/constrain-eq-version branch from 151bb3f to ebf288a Compare February 7, 2026 20:50
@philderbeast philderbeast force-pushed the add/constrain-eq-version branch from 7dd37ba to 3fb1ada Compare February 9, 2026 20:23
@philderbeast philderbeast force-pushed the add/constrain-eq-version branch from 517e233 to 8edde84 Compare February 10, 2026 16:21
@philderbeast philderbeast force-pushed the add/constrain-eq-version branch from 8edde84 to c5d436a Compare February 10, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reject-unconstrained-dependencies=eq

1 participant