-
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
PackageInfo functionality is not guarded behind cabal-version
.
#9331
Comments
What can we do to prevent this kind of mistakes? The only things I can think of are:
|
For each feature request / pull request you (= maintainers) should always answer the question "is this a change which should be guarded by (c.f. GHC folks ask themselves "does this need a GHC proposal"). Either it's clearly doesn't need to, or if someone is unsure, they should discuss. This kind of mistakes are very bad. IMO they also should be the highest priority to fix (or revert) - at least before Hackage starts using the affected |
I understand that these mistakes are bad; and that's why I am thinking how to prevent them. And we need to fix this of course. |
In #9329 (comment) @phadej suggests that the criterion could be whether we touch Cabal-syntax |
FWIW this change https://github.com/haskell/cabal/pull/8534/files#diff-2979e1782cdde6333d50cf4ca6922117186875cafbd01007575535482b33a344 should have given away the problem ... |
Embarrassing. How do we fix it? Move the feature behind |
Sounds sensible to me. |
👍 it can be done quickly in a patch release right? Edit: Ah, lol, no 😭 To fix this we need to add |
I had a go at fixing this, see the PR above. |
As I wrote in #9374 (comment), I propose the following:
Since we can't introduce cabal-version 3.10 this seems like the only viable option other than completely deprecating the entire 3.10 series |
This is what I would do.. The sooner the 3.10 release with "reverted" change is on Hackage, the sooner hackage-server can start use new |
Note that even with the reversion, I don't think any package using this will be rejected anyway? Up until |
That's sadly true. You can have autogen-modules: Whatever
exposed-modules: Whatever and The |
So what's the conclusion? It's broken, but it was as badly broken even before the offending PR? So we should fix it (by guarding stuff with |
I don't think reversion helps much. A PR to add an ad-hoc check directly to hackage server for this seems like the best approach. |
Ok, you are saying that no features are necessary to guard behind That is dumb. |
That would perhaps be dumb! Good think I'm not saying that, and I'd urge you to be less rude and more charitable in your interpretations of people's comments. I'm saying we can add a cabal check to the next version of cabal, and in the meantime we can patch hackage server to have an ad-hoc check doing the same thing in the deployed version of hackage server. I don't think reverting the existing feature will actually solve the problem we want -- which is to prevent the hackage index from getting packages making use of these files but lacking the correct cabal version constraints. |
Please be very explicit. Your first message gave me impression that nothing needs to be done in Especially as an answer to @Mikolaj question
I'm unsure what we'll happen with I'm sorry I wasted your time by opening this issue. |
Its a worthwhile issue, and I'm glad you brought it up. Everyone is welcome to open tickets and it is much appreciated. I just wish you would not be so rude in your interactions -- it makes it harder to take full advantage of your knowledge and thoughtfulness. |
I don't see anything rude in my message.
Well, over past few years I have felt that my "knowledge" is not appreciated essentially every time I tried to contribute to |
I think for now we don't need to worry about making the check reusable -- we can eventually use the cabal check in the future on hackage. I agree we should patch cabal 3.12 as described. I don't think a backport to 3.10 is possible because of the cabal-version issue. |
Is it impossible for both parts, guarding stuff and I agree that the "guarding stuff" is impossible in 3.10, because we don't want to suddenly define a new |
I just don't see what purpose reverting serves. We already have a cabal shipped with ghc that allows it. The most we can do is guard against it hitting hackage. |
Thank you. Let me draft a plan. No dependencies between the steps.
Comments? |
re: |
Actually, I think #9374 is step 3., though perhaps there's a tiny overlap with 2. |
Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests.
Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests.
Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests.
just wanted to point out that the above linked hackage pr means that hackage server now has a very basic ad hoc check on PackageInfo functionality, so packages won't make their way to hackage that use it. |
Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests.
Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests.
Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests.
- `cabal check`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests. - `cabal build`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” test.
- `cabal check`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests. - `cabal build`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” test.
- `cabal check`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests. - `cabal build`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” test.
* Add `cabal-version` 3.12 * Add test for #9331 - `cabal check`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests. - `cabal build`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” test. * Guard PackageInfo behind cabal-version ≥ 3.12 --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Add test for haskell#9331 Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests. * check: guard PackageInfo behind cabal-version ≥ 3.12 Note we do not actually check for ≥ 3.12, since it is not possible to introduce constructors in point release. Instead the check always fires with PackageInfo_* is present, and suggests an upgrade path. * Fix testsuite * Add changelog
Add test for #9331 Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests. * check: guard PackageInfo behind cabal-version ≥ 3.12 Note we do not actually check for ≥ 3.12, since it is not possible to introduce constructors in point release. Instead the check always fires with PackageInfo_* is present, and suggests an upgrade path. * Fix testsuite * Add changelog Co-authored-by: Mikolaj <[email protected]>
I think this is now done. Thank you all and especially @ffaf1, who redesigned and implemented steps 2 and 3 of the plan. Please re-open if anything crops up. |
* Add `cabal-version` 3.12 * Add test for haskell#9331 - `cabal check`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” and “succeed” tests. - `cabal build`: Guard Paths_* behind `cabal-version: 3.12` or higher, “fail” test. * Guard PackageInfo behind cabal-version ≥ 3.12 --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Given a package with just
foo.cabal
:cabal-install-3.10.1.0
check
doesn't complaint, andcabal build
succeeds:However older
cabal-install
s, or if I change tobuild-type: Custom
(and use say GHC-9.2.7) fails.Older cabal-install (note, you need to clear
dist-newstyle
in between so autogenerated left-overs are removed):or with
build-type: Custom
:Features changing
cabal_macros.h
,Paths_pkgname.hs
etc SHOULD be guarded behindcabal-version
.The text was updated successfully, but these errors were encountered: