-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cabal freeze qualifies all package constraints with any #9799
Comments
I was surprised by the many anys in the freeze file the first time I saw them. There's very little written about these qualifiers in the docs, just a small note and example; tools. To explicitly apply a constraint to a setup or build
tool dependency, you can add a qualifier ``setup`` or ``any``
to the constraint as follows:
::
# Example use of the 'any' qualifier. This constraint
# applies to package bar anywhere in the dependency graph.
$ cabal install --constraint="any.bar == 1.0"
::
# Example uses of 'setup' qualifiers.
# This constraint applies to package bar when it is a
# dependency of any Setup.hs script.
$ cabal install --constraint="setup.bar == 1.0"
# This constraint applies to package bar when it is a
# dependency of the Setup.hs script of package foo.
$ cabal install --constraint="foo:setup.bar == 1.0"
.. TODO: Uncomment this example once we decide on a syntax for 'exe'.
.. # Example use of the 'exe' (executable build tool)
# qualifier. This constraint applies to package baz when it
# is a dependency of the build tool bar being used to
# build package foo.
$ cabal install --constraint="foo:bar:exe.baz == 1.0" |
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Mar 14, 2024
Add tests for haskell#9799 about freeze qualifying all packages with 'any' constraint scope.
Merged
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Mar 14, 2024
Add tests for haskell#9799 about freeze qualifying all packages with 'any' constraint scope.
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Mar 14, 2024
Add tests for haskell#9799 about freeze qualifying all packages with 'any' constraint scope.
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Mar 15, 2024
Qualifiers in the cabal freeze should definitely not always be "any". (it can cause inconsistencies, such as `cabal freeze --constraint=... && cabal build` being different from `cabal build --constraint=...` ) In this commit we propagate information on the scopes in which each package was solved to be able to generate a proper freeze file where each package solved is constrained in the scope it was solved in. Fixes haskell#9799
5 tasks
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Mar 15, 2024
Qualifiers in the cabal freeze should definitely not always be "any". (it can cause inconsistencies, such as `cabal freeze --constraint=... && cabal build` being different from `cabal build --constraint=...` ) In this commit we propagate information on the scopes in which each package was solved to be able to generate a proper freeze file where each package solved is constrained in the scope it was solved in. Fixes haskell#9799
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Mar 15, 2024
Qualifiers in the cabal freeze should definitely not always be "any". (it can cause inconsistencies, such as `cabal freeze --constraint=... && cabal build` being different from `cabal build --constraint=...` ) In this commit we propagate information on the scopes in which each package was solved to be able to generate a proper freeze file where each package solved is constrained in the scope it was solved in. Fixes haskell#9799
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Mar 15, 2024
Qualifiers in the cabal freeze should definitely not always be "any". (it can cause inconsistencies, such as `cabal freeze --constraint=... && cabal build` being different from `cabal build --constraint=...` ) In this commit we propagate information on the scopes in which each package was solved to be able to generate a proper freeze file where each package solved is constrained in the scope it was solved in. Fixes haskell#9799
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Apr 15, 2024
Add tests for haskell#9799 about freeze qualifying all packages with 'any' constraint scope.
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Apr 15, 2024
Add tests for haskell#9799 about freeze qualifying all packages with 'any' constraint scope.
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Apr 15, 2024
Add tests for haskell#9799 about freeze qualifying all packages with 'any' constraint scope.
alt-romes
added a commit
to alt-romes/cabal
that referenced
this issue
Apr 15, 2024
Add tests for haskell#9799 about freeze qualifying all packages with 'any' constraint scope.
Mikolaj
pushed a commit
to alt-romes/cabal
that referenced
this issue
Apr 17, 2024
Add tests for haskell#9799 about freeze qualifying all packages with 'any' constraint scope.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was trying to add private-dependencies (#4035, wip at #9743) support to
cabal freeze
.It looks like the constraints populating the freeze file for every package always use the
any
qualifier. Here's an example of a package in the testsuite:I think that this design is incompatible with private dependencies, because
any
qualified package constraints will apply to all scopes (be them the top-level scope, setup-component scopes, independent goals, or private scopes...).Is there any reason for this being so?
I believe the right way forward here is to properly qualify the packages in the freeze file according to their qualifier in the package. This would allow private dependencies to introduce qualified constraints on packages for packages in a specific private scope, and would ensure top-level constraints do not apply unnecessarily to private scopes.
cc @grayjay
The text was updated successfully, but these errors were encountered: