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

RUST_VERSION and RUST_CHANNEL may disagree in presence of rust-toolchain.toml #67

Closed
imp opened this issue Nov 17, 2021 · 5 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@imp
Copy link

imp commented Nov 17, 2021

RUST_VERSION is computed by running rustc -V, while RUST_CHANNEL by running rustup default
In presence of rust-toolchain.toml these may disagree.
Example: I have nightly configured by default (hence rustup default reports nightly channel), however in my crate I have

rust-toolchain.toml

[toolchain]
channel = "stable"

So, rustc -V reports the current stable version (as installed).
Understanding the discrepancy when these are reported by the running binary may be a tough exercise

@baoyachi
Copy link
Owner

Sorry,I haven't thought about this before. Thank for you report.

I'm try edit it.

@baoyachi
Copy link
Owner

It will be fix next version

@imp
Copy link
Author

imp commented Nov 18, 2021

Thanks so much!

@baoyachi baoyachi self-assigned this Nov 19, 2021
@baoyachi baoyachi added the bug Something isn't working label Nov 19, 2021
baoyachi added a commit that referenced this issue Nov 19, 2021
@baoyachi
Copy link
Owner

baoyachi commented Nov 19, 2021

fix reference: https://rust-lang.github.io/rustup/overrides.html#toolchain-override-shorthand

Unexpected cause e.g

  • cargo +nightly [option]
  • cargo +stable [option]
  • use rust-toolchain.toml file redefine channel

how to fix

  • get std::env::vars("RUSTUP_TOOLCHAIN") in shadow-rs

@imp

@baoyachi
Copy link
Owner

It's fixed with new version

[dependencies]
shadow-rs = "0.8.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants