Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Add support for rust-toolchain.toml #209

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zephraph
Copy link

@zephraph zephraph commented Jan 8, 2022

Fixes #208

This matches the behavior in rustup's docs namely:

the toolchain can be named in the project's directory in a file called rust-toolchain.toml or rust-toolchain. If both files are present in a directory, the latter is used for backwards compatibility.


The previous implementation only supported a rust-toolchain file that included only the name. This is largely considered a legacy format at this point. I added fast-toml in order to be able to parse out the channel value. Technically channel is mutually exclusive with path that can also be specified to point to a file that contains the toolchain value somewhere else, but I've left that out of this implementation.


If folks stumble across this PR and need this functionality you can use @oxidecomputer's fork at https://github.com/oxidecomputer/actions-rs_toolchain until this is merged.

Comment on lines +23 to 33
const toolchainPath = existsSync(overrideFile)
? overrideFile
: existsSync(`${overrideFile}.toml`)
? `${overrideFile}.toml`
: undefined;

if (!toolchainPath) {
throw new Error(
"toolchain input was not given and repository does not have a rust-toolchain file"
);
}
Copy link

@boozook boozook Jan 28, 2022

Choose a reason for hiding this comment

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

Need warn if both files existing.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry for the delay on this, I'll address it today.

boozook added a commit to pontem-network/pontem that referenced this pull request Feb 8, 2022
@boozook
Copy link

boozook commented Feb 8, 2022

Tested there, works 👍

borispovod pushed a commit to pontem-network/pontem that referenced this pull request Feb 8, 2022
* CI: use rust-toolchain in toml format,
do not parse file and trust rustup & gh-action.

* remove old rust-toolchain file

* fix typo

* temporarily using gh-action fork zephraph/toolchain with path actions-rs/toolchain#209
@JasonShin
Copy link

Hi, it would be good to get this merged, is there anything that I can help to move it forward?

the-mikedavis added a commit to the-mikedavis/helix that referenced this pull request May 22, 2022
We've forked actions-rs/toolchain and merged
actions-rs/toolchain#209
so we can take advantage of full support of `rust-toolchain.toml`.
Without that PR, the action fails because the `rustup` version
built into the runners by default is too old. helix-editor#2528 covers switching
back to the upstream when it includes those changes.
the-mikedavis added a commit to the-mikedavis/helix that referenced this pull request May 23, 2022
We've forked actions-rs/toolchain and merged
actions-rs/toolchain#209
so we can take advantage of full support of `rust-toolchain.toml`.
Without that PR, the action fails because the `rustup` version
built into the runners by default is too old. helix-editor#2528 covers switching
back to the upstream when it includes those changes.
the-mikedavis added a commit to the-mikedavis/helix that referenced this pull request May 23, 2022
We've forked actions-rs/toolchain and merged
actions-rs/toolchain#209
so we can take advantage of full support of `rust-toolchain.toml`.
Without that PR, the action fails because the `rustup` version
built into the runners by default is too old. helix-editor#2528 covers switching
back to the upstream when it includes those changes.
archseer pushed a commit to helix-editor/helix that referenced this pull request May 23, 2022
We've forked actions-rs/toolchain and merged
actions-rs/toolchain#209
so we can take advantage of full support of `rust-toolchain.toml`.
Without that PR, the action fails because the `rustup` version
built into the runners by default is too old. #2528 covers switching
back to the upstream when it includes those changes.
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 15, 2022
We've forked actions-rs/toolchain and merged
actions-rs/toolchain#209
so we can take advantage of full support of `rust-toolchain.toml`.
Without that PR, the action fails because the `rustup` version
built into the runners by default is too old. helix-editor#2528 covers switching
back to the upstream when it includes those changes.
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 15, 2022
We've forked actions-rs/toolchain and merged
actions-rs/toolchain#209
so we can take advantage of full support of `rust-toolchain.toml`.
Without that PR, the action fails because the `rustup` version
built into the runners by default is too old. helix-editor#2528 covers switching
back to the upstream when it includes those changes.
yvt added a commit to r3-os/r3 that referenced this pull request Aug 14, 2022
This fork includes [actions-rs/toolchain#209][1], the PR that would add
support for TOML-style rustup toolchain files but has been left unmerged
for seven months.

[1]: actions-rs/toolchain#209
@mateimicu
Copy link

Hello,

I am also interested in this change. I can help if something is blocking it.

Copy link

@mateimicu mateimicu left a comment

Choose a reason for hiding this comment

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

LGTM

@smallstepman
Copy link

@mateimicu see #216

yvt added a commit to r3-os/actions-rust-toolchain that referenced this pull request Nov 12, 2022
atodorov added a commit to gluwa/creditcoin3 that referenced this pull request Oct 10, 2023
b/c actions-rs/toolchain doesn't support rust-toolchain.toml, see
actions-rs/toolchain#209
atodorov added a commit to gluwa/creditcoin3 that referenced this pull request Oct 10, 2023
b/c actions-rs/toolchain doesn't support rust-toolchain.toml, see
actions-rs/toolchain#209
atodorov added a commit to gluwa/creditcoin3 that referenced this pull request Oct 11, 2023
b/c actions-rs/toolchain doesn't support rust-toolchain.toml, see
actions-rs/toolchain#209
atodorov added a commit to gluwa/creditcoin3 that referenced this pull request Oct 11, 2023
b/c actions-rs/toolchain doesn't support rust-toolchain.toml, see
actions-rs/toolchain#209
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support for rust-toolchain.toml
5 participants