haskell / haskell/cabal

reject-unconstrained-dependencies=eq

Open
#11,468 9 comments 0 reactions 0 assignees View on GitHub
cabal-install: solver type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

> 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](https://github.com/haskell/cabal/pull/9984/changes#r1948174969)_

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?

```diff
$ 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.
```

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.