Skip to content
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

Add a workflow to dry run cabal-install #10740

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

philderbeast
Copy link
Collaborator

@philderbeast philderbeast commented Jan 12, 2025

Fixes #10738. Adds a dry run check of cabal install cabal-install and then fixes the casing of extra-source-files in Cabal-hooks.

Here's a failing run, https://github.com/haskell/cabal/actions/runs/12736390756/job/35496224194.


  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have something very similar in purpose: https://github.com/haskell/cabal/blob/master/.github/workflows/check-sdist.yml Could you instead look why that one didn't help and possibly improve it? Maybe, ask the author @geekosaur if necessary. Otherwise, I'm worried about proliferation of small workflows: it's quickly becoming unmanageable!

@philderbeast
Copy link
Collaborator Author

philderbeast commented Jan 12, 2025

@ulysses4ever on the description of #10738, I mentioned why the existing workflow doesn't catch this problem.

We have .github/workflows/check-sdist.yml but this does less, creating a cabal sdist cabal-install and then installing that.

Also the existing workflow runs on a matrix whereas this one runs only on the latest GHC and I think that would be sufficient to catch these kinds of errors.

ghc:
["9.12.1", "9.10.1", "9.8.1", "9.6.1"]

I've requested a review from @geekosaur, knowing that he's been involved in maintaining the GitHub workflows.

@geekosaur
Copy link
Collaborator

Could you instead look why that one didn't help and possibly improve it?

It didn't help because it only runs on released versions, not master because it can never trigger the specific problem check-sdist is looking for (inability to build with the Cabal bundled with a released ghc). A general dry run makes sense.

As to "out of hand", we have a lot of moving parts; we should not be surprised that a lot of things need to be checked. And combining them to shrink the checks list causes other problems, especially if the checks aren't very related. check-sdist could probably be changed to do this by skipping the actual build if the "do we match Cabal major version?" check fails instead of not running at all, but would need a dry-run build added before that check. It's not clear if this makes logical sense to someone trying to diagnose CI, though.

@ulysses4ever
Copy link
Collaborator

We have .github/workflows/check-sdist.yml but this does less, creating a cabal sdist cabal-install and then installing that.

Great, let’s make it do more! How about that?

the existing workflow runs on a matrix whereas this one runs only on the latest GHC and I think that would be sufficient to catch these kinds of errors.

Fair, but let’s just add the new stuff under an if conditional.

Copy link
Collaborator

@geekosaur geekosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also see my mainline comment about check-sdist; that may make sense to merge with this, but it'll need a bit of an overhaul including removing the docs hack as mentioned in the first comment.

strategy:
matrix:
ghc:
["9.12.1"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to run this on more than just 9.12.1? For example, if 3.12 is still considered LTS, we probably want to backport this to 3.12 and add 9.10.1 to the checks.

- "*/changelog.md"
- "release-notes/**"
pull_request:
paths-ignore:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you ignore these, you don't catch the README.md problem also fixed in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case then wouldn't keeping this as a separate workflow be simpler?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler, but if Artem's annoyed about having lots of little checks then you may get pushed into it anyway, in which case the combined check needs to always run instead of using the docs hack.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's the other way around, and the previous, "sdist" workflow shouldn't have used these ignore-paths?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check-sdist wants to verify that a build works by going from an sdist as the closest it can get to "installing from Hackage". It's specifically looking for ABI breaks, so doc-only changes make no sense for it.

@ulysses4ever
Copy link
Collaborator

ulysses4ever commented Jan 12, 2025

it only runs on released versions, not master

Why does it say on:push:branches:master then? It'd be good to have a documentation as to what exactly it does...

@geekosaur
Copy link
Collaborator

geekosaur commented Jan 12, 2025

Leftover from debugging (I removed similar things from the release branch but apparently missed that one on master).

@philderbeast philderbeast force-pushed the add/dry-run-cabal-install branch from a08c662 to 0aa7d62 Compare January 13, 2025 14:44
@philderbeast philderbeast force-pushed the add/dry-run-cabal-install branch from 0aa7d62 to 293e517 Compare January 20, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Casing of extra-source-files in Cabal-hooks
3 participants