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 not respecting rust-toolchain.toml #2413

Closed
skull-squadron opened this issue Aug 19, 2023 · 4 comments
Closed

rust not respecting rust-toolchain.toml #2413

skull-squadron opened this issue Aug 19, 2023 · 4 comments

Comments

@skull-squadron
Copy link

Problem

The rust prompt doesn't show the correct version.

image

MCE
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal -y  --no-modify-path
source ~/.cargo/env
rustup toolchain install nightly --profile minimal
cd $(mktemp -d) && cargo init --name deleteme
print '[toolchain]\nchannel = "nightly"' > rust-toolchain.toml

+Expected vs. -actual

- Shows the stable version `1.71.1`
+ Shows the nightly version `1.73.0-nightly (a6f8aa5a0 2023-08-11)`

Attempted resolution(s)

Resolution methodology

Somewhere after if (( $+commands[rustup] )); then, the simplest way to get the current toolchain for a given directory and environment is rustup show active-toolchain -v | tail -1. I've verified this command always works with complicated workspace crates. It was unclear to me how to modify internal/p10k.zsh so I was unable to cut a PR.

@romkatv
Copy link
Owner

romkatv commented Aug 19, 2023

rustup has added two things since I implemented rust_version segment in p10k:

  1. rust-toolchain can now be in TOML format. The old format is still supported.
  2. If rust-toolchain is missing, rust-toolchain.toml is used.

Powerlevel10k needs to be modified to support these. Details: https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file

No ETA.

@skull-squadron
Copy link
Author

skull-squadron commented Aug 20, 2023 via email

@skull-squadron skull-squadron closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2023
@romkatv romkatv reopened this Aug 20, 2023
@desbma
Copy link

desbma commented Sep 14, 2023

I am having a similar issue:

➜ rustc -V
rustc 1.72.0 (5680fa18f 2023-08-23)
➜ rustup show
Default host: x86_64-unknown-linux-gnu
...

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
beta-x86_64-unknown-linux-gnu
nightly-2022-11-01-x86_64-unknown-linux-gnu
nightly-2022-11-02-x86_64-unknown-linux-gnu
nightly-2022-11-27-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.47.0-x86_64-unknown-linux-gnu
1.61.0-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

x86_64-apple-darwin
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.72.0 (5680fa18f 2023-08-23)

Yet the prompt shows 1.74.0-nightly.

@romkatv
Copy link
Owner

romkatv commented Oct 23, 2023

This is fixed. Sorry that it took so long.

@steakknife If you don't mind my asking, which alternative have you moved to?

@romkatv romkatv closed this as completed Nov 7, 2023
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

No branches or pull requests

3 participants