Recognize the override file `rust-toolchain`
foriequal0 opened this issue · comments
rustup show
automatically installs an overridden toolchain if you have an override file rust-toolchain
(Is it a bug? or a feature?).
This unexpected feature(?) of rust show
makes toolchain
action installs toolchains twice for the example in the README.md if you have the override file. An overridden toolchain is installed on rustup show
and an nightly toolchain is installed after that.
It take 35 seconds per toolchain. I know it is not a large amount of time, but it bothers me when there's a short task like rustfmt
(It takes < 3 seconds for my project).
CHANGE: I found that it doesn't call 'rustup show` anymore on the master branch.
Also, I think it is duplicated to put toolchain
in the workflow's input when you have the override file.
Can we automatically recognize the override file to fix this?
Hey, @foriequal0, sorry for not getting back to you earlier.
Yes, rust-toolchain
file is not supported yet, mostly because it is rarely used and was out of scope for first versions. I'm not sure if it would a breaking change to add it, so I added it into #16 list, it needs to be investigated.
Thank you so much!
@svartalf How about making the toolchain
argument optional and falling back to the rust-toolchain
file if it is not given? There should be no breakage this way.
Also, we could default to stable
if neither a toolchain
argument nor a rust-toolchain
file is given.
@svartalf How about making the
toolchain
argument optional and falling back to therust-toolchain
file if it is not given? There should be no breakage this way.Also, we could default to
stable
if neither atoolchain
argument nor arust-toolchain
file is given.
@svartalf would you accept a PR that reads from rust-toolchain
file and only if not given fails if toolchain
is not specified?
@thomaseizinger of course! I'm a bit short on a time right now, so any PRs would be really appreciated!
Your flow of rust-toolchain -> toolchain input -> error
seems to be best option here and it will also maintain the backwards compatibility, which is great.