-
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
package-constraints
by package file
#9462
Conversation
29c217f
to
6390c0c
Compare
I requested reviews from some devs, feel free to dismiss otherwise, thanks! (I don't really know who in particular I should request a review from) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This a very visible new feature that will be used by all so, I think, on top of a technical review of the implementation (and the discussion of the design in the original ticket), it would be good to ask the prospective users (RFC somewhere?). I think mentioning this on the fortnightly devs chat may be a good start.
Alternatively, mark it as experimental for one major version, gather feedback from that and change at will (since it's experimental).
86a3070
to
e22b925
Compare
default-constraints
by package filepackage-constraints
by package file
Back to draft because it doesn't work in the presence of conditionals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the note I have left in the RFC.
In terms of implementation, this should be done in the solver, not in the parser. We should keep the parser faithful to what is written (and we already fail to do so) and the solver already has logic to traverse the GPD and merge the component dependencies toghether (see convCondTree
in Distribution.Solver.Modular.IndexConversion
).
I don't tend to think this should be done in the solver, because that is complex enough as is, and this need not be done there. I would prefer this were kept in the syntax tree as-is, but applied/simplified before sent to the solver. (edit: ah -- i see, you mean done not in the midst of solving, but as part of how the solver processes cabal files in building up its tree. that seems a tad more reasonable, though i'd need to think through this more carefully..) |
@gbaz yes, I meant in the cabal/cabal-install-solver/src/Distribution/Solver/Modular/IndexConversion.hs Lines 325 to 359 in dea70fb
|
Ah I understand your point. I would need some guidance on where to put this and how to carry the constraints all the way there, but yeah, seems reasonable. |
e22b925
to
e50d082
Compare
e50d082
to
d0338a8
Compare
@@ -795,6 +795,49 @@ describe the package as a whole: | |||
additional hooks, such as the scheme described in the section on | |||
`system-dependent parameters`_. | |||
|
|||
.. pkg-field:: package-constraints: library list | |||
:since: 3.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 3.12.
.. pkg-field:: package-constraints: library list | ||
:since: 3.11 | ||
|
||
Starting with **Cabal 3.11**, a new section ``package-constraints`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the same here.
@@ -19,6 +19,13 @@ relative to the respective preceding *published* version. | |||
versions of the ``Cabal`` library denote unreleased development | |||
branches which have no stability guarantee. | |||
|
|||
``cabal-version: 3.11`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
@jasagredo I shared my thoughts in the RFC #9477 (comment) |
Obsoleted by #9570 |
Solves #8912 #9477
Manual QA
By adding a field
package-constraints
in a cabal file and a list of dependencies with version ranges, for each of those dependencies, any dependency declaration that was unbounded will be set to the one ondefault-constraints
:Should be understood as:
If the stanza is omitted, then nothing changes wrt previous version.
Notice this should not influence:
build-tool-depends
pkgconfig-depends