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

Nushell environment script (env.nu) is using the wrong string #4242

Open
2 tasks done
alluring-mushroom opened this issue Mar 8, 2025 · 2 comments
Open
2 tasks done
Labels

Comments

@alluring-mushroom
Copy link

Verification

Problem

I just installed rustup via curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

I use nushell, so when I next opened nushell it was very broken and both nushell/env.nu and nushell/config.nu contained source "$HOME/.cargo/env.nu

I fixed this with a source ~/.cargo/env.nu. You could equally use something like source ($nu.home-path | join .cargo/env.nu)`

cargo still couldn't be found, and I noticed the .cargo/env.nu was this:

if ("$HOME/.cargo/bin" not-in ($env.Path | split row (char esep))) {
  $env.Path = ($env.Path | prepend "$HOME/.cargo/bin")
}

Which resulted in a path of PATH=/home/user/$HOME/.cargo/bin:/home/user/.local/bin: ...

I haven't investigated what has caused this yet, but I would be happy to do so a bit later

Steps

  1. Prepare a system with nushell but not cargo
  2. Install cargo via rustip (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)
  3. Open nushell and observe its errors

Possible Solution(s)

I assume some string interpolation has changed somewhere?

Notes

No response

Rustup version

rustup 1.28.1 (f9edccde0 2025-03-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.87.0-nightly (b74da9613 2025-03-06)`

Installed toolchains

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/user/.rustup

installed toolchains
--------------------
nightly-x86_64-unknown-linux-gnu (active, default)

active toolchain
----------------
name: nightly-x86_64-unknown-linux-gnu
active because: it's the default toolchain
installed targets:
  x86_64-unknown-linux-gnu

OS version

ubuntu 24.04
@rami3l
Copy link
Member

rami3l commented Mar 8, 2025

Will be closed by #4230.

@alluring-mushroom
Copy link
Author

I apologise, my searching wasn't successful it seems

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

No branches or pull requests

2 participants