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

Allow overriding the toolchain file #26

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

Twey
Copy link
Contributor

@Twey Twey commented Oct 31, 2023

Sometimes we have a toolchain file but want to override it in some specific cases. For example, in a current project, we want to use nightly rustfmt, so our linter step uses nightly Rust even though our main build uses stable Rust.

This PR changes (and documents) the behaviour of the action in the case in which both a toolchain file and a toolchain input are present, preferring the toolchain input.

@Twey Twey force-pushed the allow-overriding-toolchain-file branch from 80e2a95 to 5ea736b Compare November 1, 2023 09:39
Twey added a commit to Twey/linera-protocol that referenced this pull request Nov 1, 2023
Since we use nightly Rust tooling for our linting, we want to override
our usual toolchain for the linting step.  Upstream
`setup-rust-toolchain` currently doesn't allow this.  I have submitted
a PR at
actions-rust-lang/setup-rust-toolchain#26 to
add the functionality, but until then this commit points to a branch
on my personal repository at
https://github.com/Twey/setup-rust-toolchain/.  We should revert it
once the PR is merged.
Twey added a commit to linera-io/linera-protocol that referenced this pull request Nov 1, 2023
* Switch GitHub actions to actions-rust-lang/setup-toolchain

Removes explicit reference to Swatinem/rust-cache as
actions-rust-lang/setup-rust-toolchain automatically uses this action
to enable caching (unless we set `cache: false`).

Also switches our toolchain environment to be the same as the build
environment, as the `rust-toolchain.toml` file overrides it anyway.
This is undesirable: nightly rustfmt has some additional options we
would like to keep.

* Use my branch to allow overriding the toolchain file

Since we use nightly Rust tooling for our linting, we want to override
our usual toolchain for the linting step.  Upstream
`setup-rust-toolchain` currently doesn't allow this.  I have submitted
a PR at
actions-rust-lang/setup-rust-toolchain#26 to
add the functionality, but until then this commit points to a branch
on my personal repository at
https://github.com/Twey/setup-rust-toolchain/.  We should revert it
once the PR is merged.
Copy link
Contributor

@robjtede robjtede left a comment

Choose a reason for hiding this comment

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

thanks, looks good 👍🏻

@robjtede robjtede merged commit bb3f6a1 into actions-rust-lang:main Jan 11, 2024
15 checks passed
@jonasbb
Copy link
Member

jonasbb commented Jan 11, 2024

Thanks for the PR @Twey. It is included now in v1.7.0

@Twey
Copy link
Contributor Author

Twey commented Jan 16, 2024

Thanks for the review folks! Hope it helps :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Unable to test project with multiple Rust versions if rust-toolchain.toml file is present
3 participants