Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

rustup command not found using WSL #570

Closed
chbdetta opened this issue Apr 11, 2019 · 3 comments
Closed

rustup command not found using WSL #570

chbdetta opened this issue Apr 11, 2019 · 3 comments
Labels
wsl Issue related to WSL - Windows Subsystem for Linux

Comments

@chbdetta
Copy link

chbdetta commented Apr 11, 2019

output in vscode

[Error - 6:14:11 PM] Starting client failed
Error: Command failed: wsl rustup toolchain list
/bin/bash: rustup: command not found

	at ChildProcess.exithandler (child_process.js:303:12)
	at ChildProcess.emit (events.js:182:13)
	at maybeClose (internal/child_process.js:961:16)
	at Socket.ChildProcess.spawn.stream.socket.on (internal/child_process.js:380:11)
	at Socket.emit (events.js:182:13)
	at Pipe.Socket._destroy._handle.close [as _onclose] (net.js:596:12)

wsl rustup ends up with a command not found error, it seems wsl won't load ~/.profile using the aforementioned command.
However, wsl bash -ic "rustup" works if rust path is set in .bashrc.

The wsl current behavior is confirmed by another user here:
https://www.reddit.com/r/bashonubuntuonwindows/comments/9tsrym/default_shell_is_zsh_running_wsl_some_command/

and by a wsl member:
microsoft/WSL#2816 (comment)

It seems .profile is always ignored and in order for wsl to parse .zhsrc / .bashrc you need commands like wsl bash -ic rustup.

@lewisboon
Copy link

lewisboon commented May 12, 2019

I added the following to my settings.json and it fixed it.

"rust-client.rustupPath": "/home/me/.cargo/bin/rustup"

I then stumbled across this issue.

VS Code 1.33.1
Rust (rls) plugin 0.6.1
rustup --version rustup 1.18.2 (a0bf3c9cb 2019-05-02)

Edit: Just tried to build via VS Code and I now have the same problem with cargo.

> Executing task: cargo build <
/bin/bash: cargo: command not found

@TheDan64
Copy link

I'm getting a similar error:

> Executing task: wsl /home/dkolsoi/.cargo/bin/rustup component add rust-analysis --toolchain nightly-2019-04-12-x86_64-unknown-linux-gnu <

/bin/bash: wsl: command not found

@Xanewok Xanewok added the wsl Issue related to WSL - Windows Subsystem for Linux label Jun 27, 2019
@Xanewok
Copy link
Member

Xanewok commented Jun 30, 2019

We deprecated the WSL support in-extension, please try out the Remote - WSL extension, instead (should fix all the path-related issues)

@Xanewok Xanewok closed this as completed Jun 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wsl Issue related to WSL - Windows Subsystem for Linux
Projects
None yet
Development

No branches or pull requests

4 participants