-
Notifications
You must be signed in to change notification settings - Fork 199
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
Require top-level build-depends
when it occurs in all branches of a conditional
#984
Comments
build-depends
when it occurs in all branches of a conditional
I think I was mistaken, content of conditionals can be revised. However, conditionals cannot be added or deleted. The OP looks like this:
Such a bound cannot be added to an existing conditional in this case. We need a new conditional:
If new conditionals could be added if they do not introduce new dependencies (proposal!), then the discipline
would help revisability. |
The current policies for revisions and their motivations are described at: https://github.com/haskell-infra/hackage-trustees/blob/master/revisions-information.md I believe the policies should allow us to add new conditionals that do not introduce dependencies (or flags!). If the codebase does not, I would be open to a PR permitting it, with a corresponding update to clarify this in the policies. |
A simpler example: To allow
as suggested in https://hackage.haskell.org/package/bytestring-0.11.0.0/changelog. Reconstruction of the case (not all faithful---no sensible revision): |
Good example. I'd be fine allowing this. |
FWIW, adding of conditionals with The problem is that someone have to implement it. (And maybe specify it a bit more formally, to ensure that revisions can be undone). The naive approach of testing all combinations wouldn't work well, as e.g. https://hackage.haskell.org/package/semigroups-0.20 or https://hackage.haskell.org/package/transformers-compat-0.7.1 have over dozen of conditionals, and these are legit use cases. |
I think it would be fine to allow new conditionals to mention any dependencies which occur in any existing branch. |
I forgot to mention that it would be good that specification is not only revertible but also transitive: I can think of revision path like: -- 1
build-depends: foo -- 2
build-depends: foo
if someConditional
build-depends: foo -- 3
if someConditional
build-depends: foo That doesn't seem right. My concern is that revisions shouldn't add any new dependencies in any possible configurations, they just relax or tighten the constraints. If above is allowed (i.e. adding conditionals with dependencies which are not already there) then revisions could introduce new dependencies for some people. There are flags which disable/enable/select between different things, like I would like the revision from 2 to 3 (and reverse) to be forbidden. 1 <-> 2 are fine. |
Fair enough. A good first cut would then be that new conditionals can be added iff they only place constraints on dependencies already listed at the top level, which seems close to the original intent of this ticket. |
Agreed. This should be coupled with the policy stated in the title
|
This is the companion issue of haskell/cabal#7768.
See e.g. jvranish/Lenses#3.
Currently hackage does not allow revision of conditionals, and it does not allow new
build-depends
in a revision.In the situation (1)
the constraints for
B
cannot be revised.Thus, the better practice is to put a top-level
B
with extra constraints in the conditional (2):hackage uploads could be required to add a top-level
build-depends
if it appears in all branches. So (1) would be rejected, and a suggestion of addingB
to the top-level dependencies could be given:Enforcing this discipline would help with revisions on hackage that tighten constraints.
The text was updated successfully, but these errors were encountered: