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

Recognize the override file rust-toolchain #21

Closed
foriequal0 opened this issue Oct 22, 2019 · 5 comments · Fixed by #35
Closed

Recognize the override file rust-toolchain #21

foriequal0 opened this issue Oct 22, 2019 · 5 comments · Fixed by #35

Comments

@foriequal0
Copy link

foriequal0 commented Oct 22, 2019

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?

@svartalf
Copy link
Member

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.

@foriequal0
Copy link
Author

Thank you so much!

@phil-opp
Copy link
Contributor

@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.

@thomaseizinger
Copy link
Contributor

@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 would you accept a PR that reads from rust-toolchain file and only if not given fails if toolchain is not specified?

@svartalf
Copy link
Member

@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.

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

Successfully merging a pull request may close this issue.

4 participants