You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-28Lines changed: 42 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# The Rust Programming Language
2
2
3
-
This is the main source code repository for [Rust]. It contains the compiler, standard library,
4
-
and documentation.
3
+
This is the main source code repository for [Rust]. It contains the compiler,
4
+
standard library, and documentation.
5
5
6
6
[Rust]: https://www.rust-lang.org
7
7
@@ -64,37 +64,37 @@ build.
64
64
65
65
#### MinGW
66
66
67
-
[MSYS2](http://msys2.github.io/) can be used to easily build Rust on Windows:
67
+
[MSYS2][msys2] can be used to easily build Rust on Windows:
68
68
69
-
1. Grab the latest MSYS2 installer and go through the installer.
69
+
msys2: https://msys2.github.io/
70
70
71
-
2. From the MSYS2 terminal, install the `mingw64` toolchain and other required
72
-
tools.
71
+
1. Grab the latest [MSYS2 installer][msys2] and go through the installer.
73
72
74
-
```sh
75
-
# Update package mirrors (may be needed if you have a fresh install of MSYS2)
76
-
$ pacman -Sy pacman-mirrors
77
-
```
73
+
2. Run `mingw32_shell.bat` or `mingw64_shell.bat` from wherever you installed
74
+
MSYS2 (i.e. `C:\msys64`), depending on whether you want 32-bit or 64-bit
75
+
Rust. (As of the latest version of MSYS2 you have to run `msys2_shell.cmd
76
+
-mingw32` or `msys2_shell.cmd -mingw64` from the command line instead)
78
77
79
-
Download [MinGW from
80
-
here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
81
-
`version=4.9.x,threads=win32,exceptions=dwarf/seh` flavor when installing. Also, make sure to install to a path without spaces in it. After installing,
82
-
add its `bin` directory to your `PATH`. This is due to [#28260](https://github.com/rust-lang/rust/issues/28260), in the future,
83
-
installing from pacman should be just fine.
78
+
3. From this terminal, install the required tools:
84
79
85
80
```sh
86
-
# Make git available in MSYS2 (if not already available on path)
87
-
$ pacman -S git
81
+
# Update package mirrors (may be needed if you have a fresh install of MSYS2)
82
+
$ pacman -Sy pacman-mirrors
88
83
89
-
$ pacman -S base-devel
84
+
# Install build tools needed for Rust. If you're building a 32-bit compiler,
85
+
# then replace "x86_64" below with "i686". If you've already got git, python,
86
+
# or CMake installed and in PATH you can remove them from this list. Note
87
+
# that it is important that the `python2` and `cmake` packages **not** used.
88
+
# The build has historically been known to fail with these packages.
89
+
$ pacman -S git \
90
+
make \
91
+
diffutils \
92
+
mingw-w64-x86_64-python2 \
93
+
mingw-w64-x86_64-cmake \
94
+
mingw-w64-x86_64-gcc
90
95
```
91
96
92
-
3. Run `mingw32_shell.bat` or `mingw64_shell.bat` from wherever you installed
93
-
MSYS2 (i.e. `C:\msys`), depending on whether you want 32-bit or 64-bit Rust.
94
-
(As of the latest version of MSYS2 you have to run `msys2_shell.cmd -mingw32`
95
-
or `msys2_shell.cmd -mingw64` from the command line instead)
96
-
97
-
4. Navigate to Rust's source code, configure and build it:
97
+
4. Navigate to Rust's source code (or clone it), then configure and build it:
98
98
99
99
```sh
100
100
$ ./configure
@@ -114,12 +114,25 @@ $ ./configure
114
114
$ make && make install
115
115
```
116
116
117
+
#### MSVC with rustbuild
118
+
119
+
For those who don't want the hassle of MSYS or MinGW, you can invoke rustbuild
120
+
directly. All you need are Python 2, CMake, and Git in your PATH (make sure you
121
+
do __not__ use the ones from MSYS!). You'll also need Visual Studio 2013 or
122
+
newer with the C++ tools. Then all you need to do is invoke the appropriate
123
+
vcvars bat file and kick off rustbuild.
124
+
125
+
```bat
126
+
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
127
+
python .\src\bootstrap\bootstrap.py
128
+
```
129
+
117
130
## Building Documentation
118
131
119
132
If you’d like to build the documentation, it’s almost the same:
120
133
121
134
```sh
122
-
./configure
135
+
$ ./configure
123
136
$ make docs
124
137
```
125
138
@@ -154,8 +167,8 @@ Snapshot binaries are currently built and tested on several platforms:
154
167
You may find that other platforms work, but these are our officially
155
168
supported build environments that are most likely to work.
156
169
157
-
Rust currently needs between 600MiB and 1.5GiB to build, depending on platform. If it hits
158
-
swap, it will take a very long time to build.
170
+
Rust currently needs between 600MiB and 1.5GiB to build, depending on platform.
171
+
If it hits swap, it will take a very long time to build.
159
172
160
173
There is more advice about hacking on Rust in [CONTRIBUTING.md].
161
174
@@ -192,4 +205,5 @@ Rust is primarily distributed under the terms of both the MIT license
192
205
and the Apache License (Version 2.0), with portions covered by various
193
206
BSD-like licenses.
194
207
195
-
See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and [COPYRIGHT](COPYRIGHT) for details.
208
+
See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and
0 commit comments