You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cabal freeze qualifies all package constraints with any #9799
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.
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"
Activity
philderbeast commentedon Mar 11, 2024
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"Add tests for haskell#9799
Add tests for haskell#9799
Add tests for haskell#9799
Fix qualifiers in cabal freeze
Fix qualifiers in cabal freeze
Fix qualifiers in cabal freeze
Fix qualifiers in cabal freeze
Add tests for haskell#9799
Add tests for haskell#9799
Add tests for haskell#9799
Add tests for haskell#9799
Add tests for haskell#9799
Merge pull request #9805 from alt-romes/wip/romes/9799-2