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

ci: add rust-toolchain.toml #1361

Merged
merged 1 commit into from
Jun 22, 2024
Merged

ci: add rust-toolchain.toml #1361

merged 1 commit into from
Jun 22, 2024

Conversation

bitwalker
Copy link
Contributor

This PR adds a rust-toolchain.toml file, which ensures that default Rust toolchain commands use the configured toolchain, rather than whatever the global toolchain on your machine happens to be. In this case, I've configured to use 1.78 explicitly.

So when you run, say, cargo check, this will ensure that the given Rust toolchain is installed, along with the configured targets and components, and will use that toolchain to run the given command. This applies to all Rust toolchain binaries, e.g. rustc, clippy, and so on.

If you wish to compile with nightly, simply run cargo +nightly check or whatever.

This also ensures that when CI runs, it uses the same toolchain as we are using locally (again, unless explicitly overridden, such as when specifying nightly as the toolchain via the GitHub Actions config). The result is less instability in CI as new releases drop.

@phklive I'm cc'ing you on this, since I know you've been making various CI-related changes, in case you have any opinions/thoughts on this.

@bitwalker bitwalker self-assigned this Jun 21, 2024
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left one question inline.

Another question: in other repos we've been using just a simple rust-toolchain file. Is the rust-toolchain.toml approach preferred to this?

rust-toolchain.toml Show resolved Hide resolved
@bitwalker
Copy link
Contributor Author

Another question: in other repos we've been using just a simple rust-toolchain file. Is the rust-toolchain.toml approach preferred to this?

Without the file extension, you don't get syntax highlighting, but just rust-toolchain apparently is also valid (just checked the docs). I prefer to be more explicit for that reason alone, but whatever the preference is for this repo is fine.

@bobbinth
Copy link
Contributor

Without the file extension, you don't get syntax highlighting, but just rust-toolchain apparently is also valid (just checked the docs). I prefer to be more explicit for that reason alone, but whatever the preference is for this repo is fine.

Agreed! @phklive let's propagate rust-toolchain.toml approach (as in this PR) to other repos as well.

@bobbinth bobbinth merged commit 107142d into next Jun 22, 2024
15 checks passed
@bobbinth bobbinth deleted the bitwalker/explicit-toolchain branch June 22, 2024 19:28
@phklive
Copy link

phklive commented Jun 24, 2024

Without the file extension, you don't get syntax highlighting, but just rust-toolchain apparently is also valid (just checked the docs). I prefer to be more explicit for that reason alone, but whatever the preference is for this repo is fine.

Agreed! @phklive let's propagate rust-toolchain.toml approach (as in this PR) to other repos as well.

Yes I can, will propagate that to other repos.

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.

None yet

3 participants