Skip to content

Doc how to install an unofficial nightly for Windows

Kang Seonghoon edited this page Jan 18, 2014 · 1 revision

WARNING: Every nightly snapshot mentioned in this document is unofficial and not maintained by the Rust core team. You are fully responsible for any problems due to the use of nightly snapshots.

Using with MinGW

Download and run the MinGW installer and follow the instructions. There is a checkbox for whether to install the graphical user interface, which we will not use but nevertheless may be useful.

TIP: You can install the GUI later using mingw-get install mingw-get-gui.

MinGW, by default, does not append itself to the PATH environment variable. Since running rustc anywhere requires this environment variable, you should append a path to the MinGW executables to PATH in the control panel. (In the default settings, the path would be C:\MinGW\bin.)

Turn the Command Prompt on and type the following.

> mingw-get install mingw32-base

TIP: This would install the C compiler. If you don't want it, use mingw-get install gcc instead.

Install Chocolatey by copying the command line in the website and pasting it into the Command Prompt.

> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

Then install Rust using Chocolatey. We will use the NuGet Rust package maintained by Heather. It would take some time as it weighs about 120 MB.

> cinst Rust

TIP: If you get the "Unable to read package from path" error shortly after cinst, you have the incomplete NuGet package cache. Delete everything starting with Rust in %AppData%\Local\NuGet\Cache and try again.

cinst would install C:\Chocolatey\lib\Rust.VERSION\bin\rustc.exe and so on. Try rustc -v out in the Command Prompt and check if it installs the correct version.

You can update the Rust installation using Chocolatey later.

> cup Rust

Using with MSYS

MinGW has a subsystem named MSYS which emulates a conventional Unix shell. This subsystem is required for projects depending on Unix build systems like make, and it's a must for building the Rust compiler.

Follow all the instructions for MinGW, then type the following in order to install MSYS.

> mingw-get install msys-base

Then run msys\1.0\msys.bat in the MinGW directory.

TIP: Installing MSYS does not automatically generate a shortcut to it. You are recommended to make a shortcut for msys.bat.

TIP: If you've installed MSYS in your own way, and especially if you don't have a path to MinGW in PATH, then you need to run /postinstall/pi.sh in the MSYS shell and follow the instructions. (You normally don't need that, however.)

rustc installed via Chocolatey works well with MSYS, but you can't directly run it since the MSYS shell (currently) can't run batch files generated by Chocolatey. You need to make the following files in the MinGW directory by hand...

  • msys\1.0\bin\rustc
  • msys\1.0\bin\rustdoc
  • msys\1.0\bin\rustpkg

...with the following contents.

#!/bin/sh
cmd //c $(basename "$0") "$@" 

You can now use rustc directly in the MSYS shell.

All Categories:

Clone this wiki locally