rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.14k stars 884 forks source link

Command-line-friendly way to rustup on windows #1426

Open vors opened 6 years ago

vors commented 6 years ago

Projects that are building on windows in CI need a one-liner to install and run the rustup. The same way it works on unix and mac. Example of a script that people use at the moment in CI https://github.com/rust-onig/rust-onig/blob/68393b487c679c789ee8a762e77f568e75a3128a/appveyor_rust_install.ps1

This script is not a very good because it uses appveyor-specific calls. A better one may look something like

$client = new-object System.Net.WebClient
$client.DownloadFile('https://win.rustup.rs', "$pwd\rustup-init.exe")
.\rustup-init.exe

This is a powershell script, powershell ships inbox on all windows machines. Bells and whisles to pass channels and other parameters could be added.

By hosting it on the ps1.rustup.rs, there would be a simple copy-pastable one-liner, like in choco https://chocolatey.org/install

It can be then put on https://rustup.rs/ under windows tab.

vors commented 6 years ago

Related #912

Diggsey commented 6 years ago

Seems like a good idea, although would only really be an improvement for automated systems, so the executable should still be the primary install method.

It might make more sense to save to a temporary directory, or the downloads directory instead of the current directory, and to include -y and the toolchain selector.

@rust-lang-nursery/rustup-rs-owners thoughts?

vors commented 6 years ago

Not only for automated systems. Here I'm running windows containers on mac, and all I have is a command line. So the "download this installer" is pretty cumbersome way to go. This is just how I'm able to build on both mac and windows locally and rsync things.

image

workingjubilee commented 3 years ago

@rustbot label: +O-windows