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 --dry-run build check of cabal.project.release #9610

Merged
merged 3 commits into from
Mar 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/quick-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,24 @@ jobs:
- uses: actions/checkout@v4
- name: Are buildinfo docs up to date?
run: make doc/buildinfo-fields-reference.rst
release-project:
name: Check Release Project
runs-on: ubuntu-latest
steps:
- name: Set PATH
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: ghcup
run: |
ghcup --version
ghcup config set cache true
ghcup install ghc --set recommended
ghcup install cabal --set latest
- name: Update Hackage Index
run: cabal v2-update
- uses: actions/checkout@v4
- name: Check Release with Pinned Hackage
run: cabal build all --dry-run --project-file=cabal.project.release
- name: Check Release with Latest Hackage
run: cabal build all --dry-run --project-file=cabal.project.release --index-state="hackage.haskell.org HEAD"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is very minor now but still: HEAD is the default value for --index-state (see the docs). We don't have a convention of explicitly reinforcing defaults in these workflows, I believe. So, doing it in one place looks confusing. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That one I put there intentionally to override the --index-state from the project.

index-state: hackage.haskell.org 2024-02-13T10:16:13Z

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For CI we want to test with HEAD and bump the timestamp in the project when cutting a release, wouldn't we?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see... This is maybe a matter of preference but I think if you want to test cabal.project.release, it seems strange to override anything in it. But I can see someone arguing that testing the release config against the current Hackage state may be worthy.

At the very least, please, add a comment there why this index-state flag is needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Mikolaj in making a release should we be making mention of cabal.project.release and when to set its index-state? Do you think testing with HEAD but fixing index-state at release is the right way to go?

Copy link
Collaborator

@chreekat chreekat Mar 18, 2024

Choose a reason for hiding this comment

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

Second, as a post-release step, the release manager could bump the index state

That has the big advantage of not blocking the release. Or is this a disadvantage? Let's discuss.

The index-state that is used to build releases can afford to be more conservative. The only constraint on the process is, presumably, that others can verifiably build their own version of the release using precisely the same dependency versions (if they so desire).

Stepping back a second, @Mikolaj I think you understood what I wrote perfectly and I find no fault in your analysis. In particular, I agree you do want to test Cabal against the latest Haskell universe, so you get a heads up of problems with newer dependencies.

Dealing with such breakage during regular pull request CI is a suboptimal time, but I agree it's better than "never". Dealing with it at the start of the release process, however, seems unnecessary. The index-state should be fixed for a release, and whether or not it's fixed at the beginning of the release, or immediately after the previous release, makes little difference to the release in the long run. Doing it after, however, means fixing breakage is not the release manager's responsibility. And there would be plenty of time to get the build working again should anything break.

Copy link
Member

@Mikolaj Mikolaj Mar 18, 2024

Choose a reason for hiding this comment

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

After a thought, I agree, bumping the index after a release is best, since it makes the already exhausting release process lighter. I've added the point to our release checklist. The counter-argument is that our releases often sync with a new GHC and we want to know if the toolchain builds with all the new versions of libraries prepared for the GHC just released on Hackage. However, our CI is almost never updated to include the new GHC (pre-alpha; so we'd need head.hackage for that) in time for the release, because too many problems emerge (so syncing with a GHC is partially decoupled with the release proper, with its own ticket for tracking the tasks, e.g., see #9729). So it's impossible to early test in CI all the new versions of packages, because we can't even test the new base. So the conservative index is just fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

First, Cabal needs to implement tests in release CI.

@Mikolaj and @chreekat, are we going to enable tests in cabal.project.release?

tests: False

Copy link
Member

@Mikolaj Mikolaj Mar 18, 2024

Choose a reason for hiding this comment

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

I think @chreekat wants to do that on gitlab CI eventually. Given that our GHA CI takes very long already, maybe it's too much [edit: to enable on GHA] until we are ready to review our CI and trim down some other non-essential or near-duplicate jobs.

Copy link
Member

Choose a reason for hiding this comment

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

After a thought, I agree, bumping the index after a release is best

I'm not so sure any more. We've just had a serious release issue due to that policy. Let's move the discussion to #9819.


Loading