-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix aarch64 macos release builds #6504
Conversation
The 'dtolnay/rust-toolchain' action ignores the rust-toolchain.toml file, but the installed 'cargo' respects it. This can create a version mismatch if the MSRV is different from the stable rust version. Any additional targets installed by rustup like aarch64-darwin might not be installed for the correct version. To fix this, we remove the rust-toolchain.toml file before calling 'cargo'.
This step without the '-p' works fine for regular releases but it can fail if the CI is running when this file changes or on a branch matching 'patch/ci-release-*'.
# The rust-toolchain action ignores rust-toolchain.toml files. | ||
# Removing this before building with cargo ensures that the rust-toolchain | ||
# is considered the same between installation and usage. | ||
- name: Remove the rust-toolchain.toml file | ||
run: rm rust-toolchain.toml | ||
|
||
- name: Install ${{ matrix.rust }} toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to force this to MSRV (1.65
) instead of stable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we control the runners doing the building here I think it's ok to use a newer Rust. We could definitely pin this at the MSRV though to reduce the chances that a future Rust would give compilation errors for code that is valid when compiled by the MSRV. What do you think @archseer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to ripgrep we want to build with the latest nightly to get as many optimizations as we can. The MSRV is just there for backwards compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #6495
See the dry-run https://github.com/helix-editor/helix/actions/runs/4576449372
This could be solved instead by using
rustup target add ${{ matrix.target }}
but that would be papering over the problem: we do install stable-aarch64-apple-darwin but that's for the wrong Rust version.cargo
looks to use 1.65 because of therust-toolchain.toml
file butdtolnay/rust-toolchain
installs it for stable which is 1.68.2 currently.