Open HenkPoley opened 4 months ago
Yeah, this is an issue of Topgrade, not cargo-update
, it is related to shell, I guess Topgrade spawns a login shell rather than an interactive shell so that you $PATH
is not fully set, I will take a closer look at this in my Windows machine.
Erroneous Behavior
Under Windows, when you have topgrade update cargo packages under WSL, it doesn't (fully?) load
.bashrc
nor.profile
, socargo-install-update
cannot find~/.cargo/bin/cargo
.Expected Behavior
/home/<username>/.cargo/bin/:
is prended toPATH
, or.bashrc
or.profile
are sourced beforecargo-install-update
is executed.Steps to reproduce
Install topgrade under Windows Install rustup / cargo / etc. under WSL Install an older cargo package, e.g.
cargo install fd-find@10.0.0
See also: https://github.com/nabijaczleweli/cargo-update/issues/262
Possible Cause (Optional)
PATH is not fully initialized.
Problem persists without calling from topgrade
cargo-install-update under WSL works fine from the (s)hell option after the error. Since it sets the full PATH.
Did you run topgrade through
Remote Execution
If yes, does the issue still occur when you run topgrade directly in your remote host
cargo-install-update under WSL works fine from the (s)hell option after the error. Since it sets the full PATH.
Configuration file (Optional)
Additional Details
Operation System/Version Windows 11 Ubuntu 22.04 / 20/04 in WSL1 and WSL2
Installation Installed with
cargo install topgrade
under Windows and WSL.Topgrade version (
topgrade -V
) Topgrade 15.0.0 on Windows and Ubuntu.Verbose Output (
topgrade -v
)cargo-install-update moved out of the way and replaced with this shell script to strace command executions:
Note from the output of
env
that/home/henk/.cargo/bin
is not included inHOME=