Skip to content

reject-unconstrained-dependencies=eq #11468

@philderbeast

Description

@philderbeast

Please also mention that while cabal.project.freeze restricts specified dependency versions, it does NOT prevent from including future dependencies unless reject-unconstrained-dependencies=all is specified

Originally posted by @LaurentRDC in #9984

I had a look at --reject-unconstrained-dependencies=all and this only requires that there is some version constraint on each dependency. Could we add another value to this flag that requires version equality constraints?

$ git diff HEAD~3 HEAD~2
diff --git a/doc/cabal-project-description-file.rst b/doc/cabal-project-description-file.rst
index fa6b22960..5b7e4d332 100644
--- a/doc/cabal-project-description-file.rst
+++ b/doc/cabal-project-description-file.rst
@@ -790,8 +790,8 @@ The following settings control the behavior of the dependency solver:
       active-repositories: :none
 
 
-.. cfg-field:: reject-unconstrained-dependencies: all, none
-               --reject-unconstrained-dependencies=[all|none]
+.. cfg-field:: reject-unconstrained-dependencies: eq, all, none
+               --reject-unconstrained-dependencies=[eq|all|none]
    :synopsis: Restrict the solver to packages that have constraints on them.
 
    :default: none
@@ -801,9 +801,11 @@ The following settings control the behavior of the dependency solver:
    aware of in a build plan. If you wish to restrict the build plan to
    a closed set of packages (e.g., from a freeze file), use this flag.
 
-   When set to `all`, all non-local packages that aren't goals must be
-   explicitly constrained. When set to `none`, the solver will
-   consider all packages.
+   When set to `eq` or `all`, all non-local packages that aren't goals must be
+   explicitly constrained, where `all` accepts any version constraint and `eq`
+   accepts version ranges that normalise to an equality constraint.
+
+   When set to `none`, the solver will consider all packages.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions