-
Notifications
You must be signed in to change notification settings - Fork 25
Drop the requirement of specifying upper bounds #51
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
at least specifying lower bounds. You **SHALL* at least specify upper | ||
bounds if there are known incompatibilities. | ||
It is **NOT REQUIRED** to set an upper bound if all currently known | ||
versions of a dependency are compatible, although it is **RECOMMENDED**. |
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.
We could also talk about the caret operator here, but I think that is for another PR and a different discussion.
Of course, this is invasive, potentially controversial and possibly needs pvp spec version bump. I consider this discussion stage. |
I strongly disagree. We could at some point, as caret semantics are pinned down, put those in the PVP. But bounds of some sort (caret or otherwise) are core to the pvp for good reason. There's a lot of prior debate and discussion on these, throughout various community fora over many years, and nothing fundamentally has changed to make those considerations vanish. The best arguments for maintaining them, most mainly unaddressed in that discussion, which was not fundamentally over keeping upper bounds at all, are in fact in the sections of text this PR deletes. |
Well, the current text fails to mention anything about the caret operator and in light of the caret operator, it doesn't make any sense anymore.
Additionally, the section that attempts to explain why automation is not sufficient is somewhat ridiculous, since it disregards that you can run a test suite during CI and absolutely test semantics. |
do not follow this convention. The aim is that before this happens, we | ||
will put in place tool support that makes it easier to follow the | ||
convention and less painful when dependencies are updated. | ||
at least specifying lower bounds. You **SHALL* at least specify upper |
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.
Missing *
The solution is to in down the caret operator and add it to the pvp, and then require either caret-upper-bounds or caretless-upper-bounds, not eliminate upper-bounds requirements altogether. |
That is an option. But as I find the reasoning about CI automation being insufficient totally wrong, I think expressing that possibility by downgrading the requirement to a recommendation is the right decision. A later PR can then introduce the caret operator in the spec. This PR does not attempt this and will not. |
What reasoning about CI and automation? Please link to it. |
Lines 108 to 119 in c633fe8
Specifically "This assumes that compile-success is equivalent to semantic correctness." which seems to indicate they didn't realize you can run tests in CI, e.g. https://discourse.haskell.org/t/a-github-action-to-bump-your-cabal-dependencies/6919 |
Ah gotcha. I agree that language can be improved, but I think an argument still stands -- it just needs to be more detailed. First, for package maintainers they must have excellent test-cases to catch any possible dependency-induced regressions. In my experience, even a very good test-suite can often miss things if they were considered invariants inherited from dependencies. Second, for package consumers this doesn't help, regardless. If I'm using But also, I agree that the text you pointed out doesn't really address most of that. |
I agree that The huge amount of time and effort wasted bumping and waiting for trivial upperbounds bumps of dependencies to be made in the ecosystem makes me very sad. Maybe at the time of heavy cabal dependency hell conservative upperbounds made more sense, but we have better CI, Stackage, Hackage notifications to help us now. I think it's better to have optimistic or no upperbounds and just impose them as revisions when the need actually arises. So yes I am generally against having mandatory upperbounds. |
If we add a further version number, so that we have X.Y.Z and X.Y, then the above describes exactly the bounds practices the PVP recommends! In particular, that conservative upperbounds only apply to the major (two digit) component of a package version, and strict bounds only be put in place on the third digit when there is a known problem. So perhaps some of the discomfort here is just expectation mismatch between the two-major-component practice of the PVP vs the one-major-component practice of semver. On another note:
Stackage notifications only occur when new stackages are released -- which means all users who are ahead of stackage gain no benefit from them. In fact, stackage maintainers themselves reap large net benefits from good bounds practices making stackage solving itself more practical and ergonomic. On Hackage notifications, which I was involved in the design of -- these are designed precisely to make the process of managing conservative upperbounds more ergonomic, because they can notify you exactly when a new dependency is released which begins to violate said bounds, so that you can test and revise to bump bounds. The alternative notifications which are available necessarily alert you on all new releases of any dependency -- which would amount to line noise in your inbox. So having good upperbounds is what makes good, meaningful hackage notifications even possible. |
As I said on the corresponding Discourse thread, please don't do this. The cleanup from the
This is one of the reasons I consider stack extremely rude: stackage derives a lot of benefit from package bounds, because they make it easier to build a working package set. But then stack-the-tool instantiates templates which guide people away from contributing well-bounded packages back to Hackage. |
my five cents: I don't believe in One could argue that
That would be great, but I don't believe it works. Consider: There is a package version Is it enough? No, it isn't. The maintainer should also make a revision to
Turning caret versions into strict versions would most likely be never ending job for Hackage Trustees. The idea is great, and would work in setup where there are only few maintainers, which are all expects. Maybe it could be made work. For example if Stackage Nightly builds were always run with caret versions relaxed, so the revisions could be made (by maintainers or trustees).
So I think that |
Addition to previous:
A "good" thing about |
I don't agree. How do these things get caught otherwise in the wild? People usually try to build packages with relaxed upper bounds and run their test-suite (if you are lucky), then create a PR to relax the bounds. It's as if we're assuming some magic happens when maintainers or end-users get stuck with overly restrictive upper bounds. But that's not the case. You're setting higher standards for automation and assume people do more than the absolute minimum anyway when they do it manually. Instead of waiting for manual human intervention, we can just do what those maintainers do when they realize there's an upper bound issue: build and run tests. There are ways to automate that on a platform like hackage via release candidates, automatic CI builds and notifications. PVP shouldn't be concerned with those things. And that's an entirely different topic. |
I get your point and I must admit I also never have considered updating Following that, I guess practically speaking Isn't that another argument to relax the requirement of upper bounds to a recommendation, so that active maintainers have a way to opt out of constant bounds bumping? |
"loose base bounds" I guess |
Corrected, thank you. |
No. PVP is setup so if no-one does anything, nothing breaks. If there are no upper bounds and stuff breaks, someone have to do emergency revisions, most likely Hackage Trustees. Are you willing to be on duty, dropping anything else to do revisions? As Hackage Trustee making these emergency revisions right after truly widely breaking releases was not fun. Lately there weren't as many "disasters", let's keep it that way. |
This is a sign that our current model is already broken. |
I disagree with the proposal. IMHO the essence of upper bounds is this: being able to compile an old unmaintained package should be a no-op. Of course using a newer GHC might not be possible, but with upper bound one is guaranteed to have a build plan that works. As a test, someone tell me what dependency versions I need to make wai-middleware-auth work. It's not a trick, I did spend a couple of days trying to figure it out and gave up 😊 |
Set the hackage index state to the date the package was added. Done. This worked well: cabal unpack wai-middleware-auth
cd wai-middleware-auth-0.2.6.0/
# index state is when the last revision was made
cabal build -w ghc-8.10.7 --index-state=2022-07-21T10:20:17Z |
😂 true, that works |
Yes, but it's not enforced by the spec. An ecosystem could decide to handle rolling release in a different way than hackage (e.g. through enforced CI builds, release candidates, sign-off phases etc.) instead of absolute anarchy (like on hackage). I don't see why the spec should be tied to hackage's historical decisions. Hackage can be stricter than the spec (and probably just should). I want to remove this odd dependency between hackage and PVP spec. |
I'd remind you, @hasufell, that PVP is the versioning policy used on Hackage now. And the readme clearly says
So if you want to make changes as if PVP were independent, you first need to make PVP and Hackage independent of each other, and only then propose your changes to non-Hackage versioning policy. As I commented on other issue, PVP is the Hackage versioning policy. If you want/need a policy for non-Hackage, you are free to make your own. (That would cause less confusion than repurposing PVP). |
I don't think so. PVP is versioned. Hackage will depend on the legacy version and then is free to update to the more slimmed down version, adding its own policies to it. |
I agree with what @phadej says. There is no anarchy on Hackage, Hackage has a policy which is PVP. An ecosystem outside of Hackage can have a different policy. |
That's not true - Stackage has to deal with all the upperbounds breakage day by day and we report issues frequently both in our issue tracker which alerts maintainers and sometimes also to upstream. I would say Stackage contributes significantly to fixing upperbounds issues, also thanks no little to our active contributors. Also noting I was not writing with my Stackage hat on. |
I disagree:
|
I agree that situation (whom both you and I are passinate to improve) is far from optimal. I don't understand how dropping the requirement of specifying upper bounds is meant to improve it. Let's work on something productive:
None of this has to be built from scratch. There's plenty of prior art: pvp checkers, tools to manipulate cabal files, nightly builders, notification workflows, etc, etc. 💪 |
I'm sorry, but are you saying working on the spec is not productive? I don't see why we can't have a productive discussion about:
These are the questions I'm posing here. I'm trying to resolve questions about the spec, its scope and a bit broader "what should hackage be", but that can't fully be resolved in this ticket. If you want to work on hackage-matrix-builder, Cabal or PVP tools, you're free to do so and gather volunteers e.g. on discourse. But please let's stay ontopic. |
That's not the message I intended to convey :-/ I would be happy to continue our discussion in private if you like. |
Following some discussion from https://discourse.haskell.org/t/the-operator-in-cabal-files/6938