Two different ways to install at Win 10


#1

What are the differences in installing Rust at Win10 using bash or using rustup-init.exe

I was able to install rust either by opening powershell and running the below:

PS C:\Users\Hasan Yousef> bash
hyousef@DESKTOP-KPD1Q5Q:/mnt/c/Users/Hasan Yousef> curl https://sh.rustup.rs -sSf | sh

As will as by double-cliking the rustup-init.exe or opening powershell and running the below:

PS D:\downloads> ./rustup-init

What could be the differences and/or impacts between the 2 different ways!


#2

I just noticed that using:

PS C:\Users\Hasan Yousef> bash
hyousef@DESKTOP-KPD1Q5Q:/mnt/c/Users/Hasan Yousef> curl https://sh.rustup.rs -sSf | sh

is installing:

default host triple: x86_64-unknown-linux-gnu

While using:

PS D:\downloads> ./rustup-init

is installing:

default host triple: x86_64-pc-windows-msvc

Where can I find the /home/hyousef/.cargo/bin created using the bash?


#3

It looks like in your first example, you might have installed Rust via WSL. That’d explain why you ended up with the Linux toolchain.

This StackOverflow answer might help you figure out where the binaries ended up: https://stackoverflow.com/questions/50586535/make-rustc-cargo-rustup-rustdoc-commands-work-without-sudo-inside-the-windows


#4

The Bash you’re using is a Linux emulator. It’s not just Bash, it’s the whole Ubuntu system run under Windows, so it uses Linux binaries and everything run there may think it’s running on a real Linux machine.

There’s also msys bash (e.g. comes with msys git for Windows) which is a Windows port that runs programs on Windows natively. You can use that if you want just a terminal with bash, but not a whole Linux emulator.