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

Conversation

philderbeast
Copy link
Collaborator

Fixes #9601. Add a build --dry-run quick job for lightweight checking cabal.project.release. Increases duplication in workflows/quick-jobs.yml.

Template Β: This PR does not modify cabal behaviour (documentation, tests, refactoring, etc.)

Include the following checklist in your PR:

Copy link
Member

@andreasabel andreasabel left a comment

Choose a reason for hiding this comment

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

Thanks for the workflow!

.github/workflows/quick-jobs.yml Outdated Show resolved Hide resolved
.github/workflows/quick-jobs.yml Outdated Show resolved Hide resolved
@ulysses4ever
Copy link
Collaborator

@philderbeast are you planning to work on this? No rush, of course.

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.

Since actions/runner-images#7061 is closed, the workaround shouldn't be duplicated yet again.

@philderbeast
Copy link
Collaborator Author

Yes I am, @ulysses4ever, but have been putting all my focus on #9578, trying to get that one over the line ;-)

@philderbeast philderbeast force-pushed the test/release-dry-run-9601 branch 3 times, most recently from 5e101ce to 5bc17c3 Compare March 3, 2024 01:36
@philderbeast
Copy link
Collaborator Author

Since actions/runner-images#7061 is closed, the workaround shouldn't be duplicated yet again.

@ulysses4ever I removed the workaround. Could you please take another look at this?

@philderbeast philderbeast force-pushed the test/release-dry-run-9601 branch 2 times, most recently from 335fe77 to 4b69d63 Compare March 5, 2024 11:20
@philderbeast
Copy link
Collaborator Author

@Mikolaj this could be ready to go but needs one more reviewer to approve.

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.

I'm sorry for the slow turnaround: I have been overwhelmed recently.

cabal.project.release Outdated Show resolved Hide resolved
@philderbeast philderbeast force-pushed the test/release-dry-run-9601 branch 2 times, most recently from cf2a4d0 to b9856d5 Compare March 6, 2024 12:17
run: cabal v2-update
- uses: actions/checkout@v4
- name: Check release project
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.

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

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

LGTM

- Cache of ~/.cabal/store not needed for --dry-run
- Remove workaround for the new job only
The release project disables tests and benchmarks.
@philderbeast
Copy link
Collaborator Author

Got a segfault running workflow Validate macos-latest ghc-8.8.4. I'll rerun it.

Configuring test suite 'rpmvercmp' for Cabal-tests-3..
Warning: Packages using 'cabal-version: >= 1.10' and before 'cabal-version:
3.4' must specify the 'default-language' field for each component (e.g.
Haskell98 or Haskell2010). If a component uses different languages in
different modules then list the other ones in the 'other-languages' field.
Preprocessing test suite 'rpmvercmp' for Cabal-tests-3..
Building test suite 'rpmvercmp' for Cabal-tests-3..
[1 of 1] Compiling Main             ( tests/RPMVerCmp.hs, /Users/runner/work/cabal/cabal/dist-newstyle-validate-ghc-8.8.4/build/x86_64-osx/ghc-8.8.4/Cabal-tests-3/t/rpmvercmp/build/rpmvercmp/rpmvercmp-tmp/Main.o )
Linking /Users/runner/work/cabal/cabal/dist-newstyle-validate-ghc-8.8.4/build/x86_64-osx/ghc-8.8.4/Cabal-tests-3/t/rpmvercmp/build/rpmvercmp/rpmvercmp ...
Error: cabal: Failed to build cabal-install-3.11.0.0 (which is required by
test:unit-tests from cabal-install-3.11.0.0, test:mem-use-tests from
cabal-install-3.11.0.0 and others). The build process segfaulted (i.e.
SIGSEGV).

@philderbeast
Copy link
Collaborator Author

Label merge+no rebase is necessary when the pull request is from an organisation.

@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Mar 16, 2024
@mergify mergify bot merged commit b3840d2 into haskell:master Mar 16, 2024
54 checks passed
@Kleidukos
Copy link
Member

@Mergifyio backport 3.12

Copy link
Contributor

mergify bot commented May 13, 2024

backport 3.12

✅ Backports have been created

mergify bot added a commit that referenced this pull request May 14, 2024
Add a --dry-run build check of cabal.project.release (backport #9610)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge+no rebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a CI check of cabal.project.release?
7 participants