cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Add upper bound check to all

Open jappeace opened this issue 3 years ago • 15 comments

reacration of https://github.com/haskell/cabal/pull/8339

fixes https://github.com/haskell/cabal/issues/8291 presumably this will make it nag at anyone for forgetting to add upper bounds to their packages.

I tested this by running cabal check on yesod-auth-simple (which has no upper bounds) then added said upper bounds with cabal gen-bounds, and now it works.

I also added a test public-multilib-3.cabal and public-multilib-3.check which expects the output. Furthermore an upper bound was added to public-multilib-2.cabal to assert it's not emmiting a warning.


Please include the following checklist in your PR:

jappeace avatar Aug 11 '22 11:08 jappeace

:warning: The sha of the head commit of this PR conflicts with #8339. Mergify cannot evaluate rules on this PR. :warning:

mergify[bot] avatar Aug 11 '22 11:08 mergify[bot]

@mergify refresh

Mikolaj avatar Aug 11 '22 11:08 Mikolaj

refresh

✅ Pull request refreshed

mergify[bot] avatar Aug 11 '22 11:08 mergify[bot]

Perhaps mergify is ~not~ now mollified after the old PR has been closed. We'll see. :)

Mikolaj avatar Aug 11 '22 11:08 Mikolaj

CI is acting up, so let me rebase to include the our CI workaround.

Mikolaj avatar Aug 17 '22 13:08 Mikolaj

@mergify rebase

Mikolaj avatar Aug 17 '22 13:08 Mikolaj

rebase

✅ Branch has been successfully rebased

mergify[bot] avatar Aug 17 '22 13:08 mergify[bot]

If nobody has anything else to review, please merge?

jappeace avatar Aug 31 '22 08:08 jappeace

@andreasabel: could you re-review?

Mikolaj avatar Aug 31 '22 17:08 Mikolaj

If nobody has anything else to review, please merge?

jappeace avatar Oct 05 '22 17:10 jappeace

I have added a small comment, also there are some failures in CI, do you need help with those (doctest, etc)?

ffaf1 avatar Oct 05 '22 18:10 ffaf1

Just to mention that often I do not "forget" but deliberately omit upper bound. Enforcing it sometimes makes sense, and sometimes absolutely doesn't.

mouse07410 avatar Oct 12 '22 14:10 mouse07410

@mouse07410 this should be implemented as just a warning. It shouldn't block (unless I did it wrong).

jappeace avatar Oct 12 '22 15:10 jappeace

@ffaf1 yes I've no idea why the doctests are failing, it doesn't seem to be related to my changes

jappeace avatar Oct 12 '22 16:10 jappeace

Seems a connection timed out, not your fault. There are compilation erros in your patch tho, fix those and you should be fine.

ffaf1 avatar Oct 12 '22 17:10 ffaf1

Actually, CI was corrupted at that time and it's now fixed, so let me rebase and see if CI passes now.

Mikolaj avatar Oct 17 '22 12:10 Mikolaj

@mergify rebase

Mikolaj avatar Oct 17 '22 12:10 Mikolaj

rebase

✅ Branch has been successfully rebased

mergify[bot] avatar Oct 17 '22 12:10 mergify[bot]

CI passes! What now?

Mikolaj avatar Oct 17 '22 15:10 Mikolaj

Please merge if reviewers are happy with the changes :relaxed:

jappeace avatar Oct 19 '22 15:10 jappeace

@andreasabel seems to be busy, so let me dimiss his blockage. Anybody else objects to merging? @jappeace: anything else you'd lke to address or improve before the merge? If that's it, I'm going to set label squash+merge_me (unless you prefer no squash) RSN.

Mikolaj avatar Nov 11 '22 19:11 Mikolaj

@mergify rebase

Mikolaj avatar Nov 11 '22 19:11 Mikolaj

rebase

✅ Branch has been successfully rebased

mergify[bot] avatar Nov 11 '22 19:11 mergify[bot]

@jappeace: I'm afraid a test fails after rebasing, probably because it was added independently and the captured output doesn't contain the bounds warnings. Would you amend it?

Mikolaj avatar Nov 11 '22 19:11 Mikolaj

I don’t want to argue one way or another, but I feel like some people will get upset about this change: after all, PVP doesn’t have universal support (in this part, at least), and there are Hackage authors who don’t put upper bounds purposefully. Given that it’s a mere warning (is it, btw?), I guess, they will survive. Still, I think, it may be nicer to at least supply a flag that turns the check off. Future work, perhaps…

Also, I’d hope for a more coherent explanation of the change in the commit message. Preferably, an explanation from the end user’s perspective.

ulysses4ever avatar Nov 11 '22 19:11 ulysses4ever

I am totally with those who do not put upper bounds in purposefully.

So, as long as this PR results only in warning in such cases, I agree to live with it, though I personally find the idea silly.

mouse07410 avatar Nov 11 '22 22:11 mouse07410

In light of this, I still believe a warning PackageDistSuspiciousWarn is a sensible thing to print. Third party tools (and cabal-install) can then filter out what they don’t fancy, but first thing first!

ffaf1 avatar Nov 12 '22 06:11 ffaf1

If this is controversial, we don't have to release it in 3.10 yet, but let's merge so that there's something to argue about and test in the field. It's bad style to let a PR slip. Let it go up in flames if unavoidable.

@ulysses4ever: if we are squash-merging, then indeed a good single commit message would be required instead of the default list of squashed commits. Is the changelog entry good enough? If so, perhaps copy it? If not, amend it?

@ffaf1: could you open a ticket about PackageDistSuspiciousWarn and/or a flag? It's fine if it refers to a yet unmerged PR.

Mikolaj avatar Nov 12 '22 08:11 Mikolaj

As I said, I'm not against merging it, so, by all means…

Squash is the next level: presently, even the first commit message (which I usually expect to have some explanation no matter what) is kinda dense. Copying the changelog to the first commit message is an option (if the changelog has a decent explanation).

By the way, Mergify allows several approaches to forming the commit message on squash. We use the default one when it concatenates all messages. Another option is to take the first commit's message. I was wondering if the latter would be a better default. But this is off-topic here, perhaps...

ulysses4ever avatar Nov 12 '22 08:11 ulysses4ever

PackageDistSuspiciousWarn is what will happen with this patch, if tools fancy it, they can filter it. I will open a ticket for a possible flag. (done!)

ffaf1 avatar Nov 12 '22 08:11 ffaf1