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

Maybe: work around rustup#3036 #159

Closed
CAD97 opened this issue Jul 25, 2022 · 3 comments · Fixed by #160
Closed

Maybe: work around rustup#3036 #159

CAD97 opened this issue Jul 25, 2022 · 3 comments · Fixed by #160

Comments

@CAD97
Copy link

CAD97 commented Jul 25, 2022

context: rust-lang/rustup#3036 rust-lang/rustup#3035

As of rustup 1.25, cargo-expand doesn't work when run from stable:

〉main:pegcel〉$env.CARGO
Error: nu::shell::name_not_found (link)

  × Name not found
   ╭─[entry #27:1:1]
 1$env.CARGO
   ·      ──┬──
   ·        ╰── did you mean 'Path'?
   ╰────

〉main:pegcel〉rustup -vV
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.62.1 (e092d0b6b 2022-07-16)`
〉main:pegcel〉cargo +nightly expand --version
cargo-expand 1.0.27
〉main:pegcel〉cargo expand --example item
error: no such subcommand: `+nightly`
〉main:pegcel〉

AIUI 1.25.1 reverted (perhaps temporarily?) the change to set $RUSTC so that cargo +toolchain could function when run from a cargo invocation. However, there's a separate change that also impacts Windows that leads to the toolchain cargo being selected instead of the rustup shim.

I'm honestly not exactly certain what the correct behavior w.r.t. rust-lang/rustup#3036 is. Perhaps the correct option is to use rustup run nightly cargo instead of cargo +nightly?

@dtolnay
Copy link
Owner

dtolnay commented Jul 25, 2022

Would you be able to confirm whether #160 fixes this? I don't have access to Windows.

cargo install --git https://github.com/dtolnay/cargo-expand --branch rustuprun --force

@CAD97
Copy link
Author

CAD97 commented Jul 25, 2022

I can confirm that #160 fixes this 🎉

@dtolnay
Copy link
Owner

dtolnay commented Jul 25, 2022

Thanks, great. Published in 1.0.28.

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

Successfully merging a pull request may close this issue.

2 participants