Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

building doesn't work on windows when using wsl as integrated terminal #286

Closed
tinaun opened this issue Jun 21, 2017 · 10 comments · Fixed by #315
Closed

building doesn't work on windows when using wsl as integrated terminal #286

tinaun opened this issue Jun 21, 2017 · 10 comments · Fixed by #315

Comments

@tinaun
Copy link

tinaun commented Jun 21, 2017

Version of VSCode: 1.13.1
Version of the extension: 0.4.0
OS: Windows 10

when running the cargo build task, it tries to run the commands on the integrated terminal as if it was cmd, using windows style path seperators and looking for a pc-windows-msvc build of rust, both of which error out. previous versions would just run cargo build, which worked the same on both terminals.

Output of the "Rust logging" channel:

DEBUG: Rustup: updateToolchains: this.toolchains=[{"channel":"stable","host":"x86_64-pc-windows-msvc","isDefault":false},{"channel":"nightly","host":"x86_64-pc-windows-msvc","isDefault":true}]
DEBUG: Rustup: updateComponents(nightly-x86_64-pc-windows-msvc): components=["cargo-x86_64-pc-windows-msvc (default)","rls-x86_64-pc-windows-msvc (installed)","rust-analysis-x86_64-pc-windows-msvc (installed)","rust-docs-x86_64-pc-windows-msvc (default)","rust-src (installed)","rust-std-aarch64-apple-ios","rust-std-aarch64-linux-android","rust-std-aarch64-unknown-fuchsia","rust-std-aarch64-unknown-linux-gnu","rust-std-arm-linux-androideabi","rust-std-arm-unknown-linux-gnueabi","rust-std-arm-unknown-linux-gnueabihf","rust-std-arm-unknown-linux-musleabi","rust-std-arm-unknown-linux-musleabihf","rust-std-armv7-apple-ios","rust-std-armv7-linux-androideabi","rust-std-armv7-unknown-linux-gnueabihf","rust-std-armv7-unknown-linux-musleabihf","rust-std-armv7s-apple-ios","rust-std-asmjs-unknown-emscripten","rust-std-i386-apple-ios","rust-std-i586-pc-windows-msvc","rust-std-i586-unknown-linux-gnu","rust-std-i686-apple-darwin","rust-std-i686-linux-android","rust-std-i686-pc-windows-gnu","rust-std-i686-pc-windows-msvc","rust-std-i686-unknown-freebsd","rust-std-i686-unknown-linux-gnu","rust-std-i686-unknown-linux-musl","rust-std-mips-unknown-linux-gnu","rust-std-mips-unknown-linux-musl","rust-std-mips64-unknown-linux-gnuabi64","rust-std-mips64el-unknown-linux-gnuabi64","rust-std-mipsel-unknown-linux-gnu","rust-std-mipsel-unknown-linux-musl","rust-std-powerpc-unknown-linux-gnu","rust-std-powerpc64-unknown-linux-gnu","rust-std-powerpc64le-unknown-linux-gnu","rust-std-s390x-unknown-linux-gnu","rust-std-sparc64-unknown-linux-gnu","rust-std-wasm32-unknown-emscripten","rust-std-x86_64-apple-darwin","rust-std-x86_64-apple-ios","rust-std-x86_64-linux-android","rust-std-x86_64-pc-windows-gnu","rust-std-x86_64-pc-windows-msvc (default)","rust-std-x86_64-rumprun-netbsd","rust-std-x86_64-unknown-freebsd","rust-std-x86_64-unknown-fuchsia","rust-std-x86_64-unknown-linux-gnu","rust-std-x86_64-unknown-linux-musl","rust-std-x86_64-unknown-netbsd","rustc-x86_64-pc-windows-msvc (default)",""]
DEBUG: activate: getNightlyToolchain: There is only one nightly toolchain
DEBUG: RlsMode: start: enter
DEBUG: RlsMode: start: User decided to use rustfmt
DEBUG: RlsMode: start: rlsPath=C:\Users\tinaun\.cargo\bin\rustup.EXE 
DEBUG: RlsMode: start: env={"RUST_SRC_PATH":"C:\\Users\\tinaun\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\src\\rust\\src"} 
DEBUG: Rustup: isRlsInstalled: getNightlyToolchain: There is only one nightly toolchain
DEBUG: RlsMode: start: args=["run","nightly","rls","run","nightly","rls"] 
DEBUG: RlsMode: start: revealOutputChannelOn=3 
DEBUG: RlsMode: start: Language Client Manager: start
DEBUG: RlsMode: start: Language Client Manager: stop
DEBUG: RlsMode: start: Language Client Manager: start

@KalitaAlexey
Copy link
Member

@tinaun,
I didn't know WSL can be used that way.
Could you give me a link to a tutorial or explain it to me here please?

@Gordon-F
Copy link

Gordon-F commented Jun 21, 2017

@KalitaAlexey I think you can set "terminal.integrated.shell.windows": path to bash.exe.

"terminal.integrated.shell.windows": C:\\Windows\\System32\\bash.exe

Output from Cargo Check:

cd c:\Dev\RustProjects\three-rs
rustup run nightly-x86_64-pc-windows-msvc cargo check
devusr@DESKTOP-1482QIG:/mnt/c/Dev/RustProjects/three-rs$ cd c:\Dev\RustProjects\three-rs
bash: cd: c:DevRustProjectsthree-rs: No such file or directory
devusr@DESKTOP-1482QIG:/mnt/c/Dev/RustProjects/three-rs$ rustup run nightly-x86_64-pc-windows-msvc cargo check
rustup: command not found
devusr@DESKTOP-1482QIG:/mnt/c/Dev/RustProjects/three-rs$

@tinaun
Copy link
Author

tinaun commented Jun 21, 2017

yeah, thats what ive been doing. in previous versions of the plugin, i could use build tasks to build the windows version and the integrated terminal to build a linux version all from within vscode! very convenient

@KalitaAlexey
Copy link
Member

I have opened the issue to fulfill what you want.
I would be glad to hear your opinion.

@KalitaAlexey
Copy link
Member

@tinaun,
I have just understood what doesn't work.
It will be very hard to fix.

@KalitaAlexey
Copy link
Member

The extension couldn't do anything about rustup: command not found.
rustup should be available in WSL.

@KalitaAlexey
Copy link
Member

I can't use bash.

The terminal process command `C:\Windows\System32\bash.exe` failed to launch (exit code: 3221225477)

If I run bash from cmd it works.
What do I do wrong?

@tinaun
Copy link
Author

tinaun commented Jun 30, 2017

see this vscode issue: microsoft/vscode#6579 (comment)

using C:\Windows\sysnative\bash.exe as the path should work

@KalitaAlexey
Copy link
Member

Thanks. I'll try that.

@KalitaAlexey
Copy link
Member

Everyone who is interested, please look at #315

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

Successfully merging a pull request may close this issue.

3 participants