Skip to content

Commit 297e396

Browse files
committed
Merge upstream/master: Fix a weird bug
2 parents 451af79 + 731d375 commit 297e396

File tree

185 files changed

+3610
-2101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+3610
-2101
lines changed

README.md

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The Rust Programming Language
22

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.
55

66
[Rust]: https://www.rust-lang.org
77

@@ -64,37 +64,37 @@ build.
6464
6565
#### MinGW
6666
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:
6868
69-
1. Grab the latest MSYS2 installer and go through the installer.
69+
msys2: https://msys2.github.io/
7070
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.
7372
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)
7877
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:
8479
8580
```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
8883
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
9095
```
9196
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:
9898
9999
```sh
100100
$ ./configure
@@ -114,12 +114,25 @@ $ ./configure
114114
$ make && make install
115115
```
116116
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+
117130
## Building Documentation
118131
119132
If you’d like to build the documentation, it’s almost the same:
120133
121134
```sh
122-
./configure
135+
$ ./configure
123136
$ make docs
124137
```
125138
@@ -154,8 +167,8 @@ Snapshot binaries are currently built and tested on several platforms:
154167
You may find that other platforms work, but these are our officially
155168
supported build environments that are most likely to work.
156169
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.
159172
160173
There is more advice about hacking on Rust in [CONTRIBUTING.md].
161174
@@ -192,4 +205,5 @@ Rust is primarily distributed under the terms of both the MIT license
192205
and the Apache License (Version 2.0), with portions covered by various
193206
BSD-like licenses.
194207
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
209+
[COPYRIGHT](COPYRIGHT) for details.

0 commit comments

Comments
 (0)