Skip to content

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
- 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 0ddde8d to 4142036 Compare February 2, 2026 02:48
@philderbeast philderbeast marked this pull request as draft February 3, 2026 12:09
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