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

Use cargo hack in release process #804

Merged
merged 5 commits into from
Mar 30, 2024
Merged

Conversation

IanManske
Copy link
Member

@IanManske IanManske commented Mar 28, 2024

This PR adds two cargo hack commands to the release process to check for errors due to combination of features. The first one will run cargo check on each crate multiple times over, toggling different combinations of features each time. This is to check for compilation errors regarding missing imports, etc. The second command will run cargo build for each crate separately (with default features) to check for build errors (from build.rs or whatever).

Using the error from the 0.90.0 publishing as a test, the first command does indeed find the compilation error.

In the future, we should probably put these commands into a manually triggered CI job so that they will be run on multiple platforms.

Also, this PR cleans up nu_release.nu a little bit.

@IanManske IanManske marked this pull request as ready for review March 30, 2024 01:51
@IanManske IanManske marked this pull request as draft March 30, 2024 14:14
@IanManske IanManske changed the title Edit nu_release to dry run publishing beforehand Use cargo hack in release process Mar 30, 2024
@IanManske IanManske marked this pull request as ready for review March 30, 2024 15:23
Copy link
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

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

LGTM


log warning "publishing the first wave of crates"
for crate in $subcrates_wave_1 {
cargo publish -p $crate
Copy link
Member

Choose a reason for hiding this comment

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

Ah that's nicer than accidentally ending up in the wrong directory on failure which we encountered in the past. (shouldn't be a problem with the current script due to def scoping, and is nicer anyway.

Comment on lines +28 to +37
- [ ] then, ensure there are no compilation errors with any combination of features by running:
```nushell
cargo hack --all --feature-powerset --skip default-no-clipboard,stable,wasi,mimalloc check
```
(this will take a while...)
- [ ] check for build errors by running:
```nushell
cargo hack --all build
```
(this will build each crate with default features)
Copy link
Member

Choose a reason for hiding this comment

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

In my eye that is a slightly different step than the mechanical version bumping (with a cargo check to not miss it in the Cargo.lock) but should do the trick.

@IanManske IanManske merged commit a2929c0 into nushell:main Mar 30, 2024
1 check passed
@IanManske IanManske deleted the dry-run-publish branch May 27, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants