@@ -6,11 +6,7 @@ standard library, and documentation.
66[ Rust ] : https://www.rust-lang.org
77
88** Note: this README is for _ users_ rather than _ contributors_ .
9- If you wish to _ contribute_ to the compiler, you should read the
10- [ Getting Started] [ gettingstarted ] section of the rustc-dev-guide instead.
11- You can ask for help in the [ #new members Zulip stream] [ new-members ] .**
12-
13- [ new-members ] : https://rust-lang.zulipchat.com/#narrow/stream/122652-new-members
9+ If you wish to _ contribute_ to the compiler, you should read [ CONTRIBUTING.md] ( CONTRIBUTING.md ) instead.
1410
1511## Quick Start
1612
@@ -48,20 +44,37 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
4844[ gettingstarted ] : https://rustc-dev-guide.rust-lang.org/getting-started.html
4945[ rustcguidebuild ] : https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html
5046
51- ### Building on a Unix-like system
52- 1 . Make sure you have installed the dependencies:
47+ ### Dependencies
48+
49+ Make sure you have installed the dependencies:
5350
54- * ` g++ ` 5.1 or later or ` clang++ ` 3.5 or later
5551 * ` python ` 3 or 2.7
56- * GNU ` make ` 3.81 or later
57- * ` cmake ` 3.13.4 or later
58- * ` ninja `
59- * ` curl `
6052 * ` git `
61- * ` ssl ` which comes in ` libssl-dev ` or ` openssl-devel `
53+ * A C compiler (when building for the host, ` cc ` is enough; cross-compiling may need additional compilers)
54+ * ` curl ` (not needed on Windows)
6255 * ` pkg-config ` if you are compiling on Linux and targeting Linux
56+ * ` libiconv ` (already included with glibc on Debian-based distros)
57+
58+ To build cargo, you'll also need OpenSSL (` libssl-dev ` or ` openssl-devel ` on most Unix distros).
59+
60+ If building LLVM from source, you'll need additional tools:
61+
62+ * ` g++ ` , ` clang++ ` , or MSVC with versions listed on
63+ [ LLVM's documentation] ( https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library )
64+ * ` ninja ` , or GNU ` make ` 3.81 or later (ninja is recommended, especially on Windows)
65+ * ` cmake ` 3.13.4 or later
66+ * ` libstdc++-static ` may be required on some Linux distributions such as Fedora and Ubuntu
6367
64- 2 . Clone the [ source] with ` git ` :
68+ On tier 1 or tier 2 with host tools platforms, you can also choose to download LLVM by setting ` llvm.download-ci-llvm = true ` .
69+ Otherwise, you'll need LLVM installed and ` llvm-config ` in your path.
70+ See [ the rustc-dev-guide for more info] [ sysllvm ] .
71+
72+ [ sysllvm ] : https://rustc-dev-guide.rust-lang.org/building/new-target.html#using-pre-built-llvm
73+
74+
75+ ### Building on a Unix-like system
76+
77+ 1 . Clone the [ source] with ` git ` :
6578
6679 ``` sh
6780 git clone https://github.com/rust-lang/rust.git
@@ -70,38 +83,49 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
7083
7184[ source ] : https://github.com/rust-lang/rust
7285
73- 3 . Configure the build settings:
86+ 2 . Configure the build settings:
7487
7588 The Rust build system uses a file named ` config.toml ` in the root of the
7689 source tree to determine various configuration settings for the build.
77- Copy the default ` config.toml.example ` to ` config.toml ` to get started.
90+ Set up the defaults intended for distros to get started. You can see a full list of options
91+ in ` config.toml.example ` .
7892
7993 ``` sh
80- cp config.toml.example config.toml
94+ printf ' profile = "user" \nchangelog-seen = 2 \n ' > config.toml
8195 ```
8296
8397 If you plan to use ` x.py install` to create an installation, it is recommended
8498 that you set the ` prefix` value in the ` [install]` section to a directory.
8599
86- Create an install directory if you are not installing in the default directory.
87-
88- 4. Build and install:
100+ 3. Build and install:
89101
90102 ` ` ` sh
91103 ./x.py build && ./x.py install
92104 ` ` `
93105
94106 When complete, ` ./x.py install` will place several programs into
95107 ` $PREFIX /bin` : ` rustc` , the Rust compiler, and ` rustdoc` , the
96- API-documentation tool. This install does not include [Cargo],
97- Rust' s package manager. To build and install Cargo, you may
98- run `./x.py install cargo` or set the `build.extended` key in
99- `config.toml` to `true` to build and install all tools.
108+ API-documentation tool. If you' ve set `profile = "user"` or `build.extended = true`, it will
109+ also include [Cargo], Rust' s package manager.
100110
101111[Cargo]: https://github.com/rust-lang/cargo
102112
103113# ## Building on Windows
104114
115+ On Windows, we suggest using [winget] to install dependencies by running the following in a terminal:
116+
117+ ` ` ` powershell
118+ winget install -e Python.Python.3
119+ winget install -e Kitware.CMake
120+ winget install -e Git.Git
121+ ` ` `
122+
123+ Then edit your system' s `PATH` variable and add: `C:\Program Files\CMake\bin`. See
124+ [this guide on editing the system `PATH`](https://www.java.com/en/download/help/path.html) from the
125+ Java documentation.
126+
127+ [winget]: https://github.com/microsoft/winget-cli
128+
105129There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by
106130Visual Studio and the GNU ABI used by the GCC toolchain. Which version of Rust
107131you need depends largely on what C/C++ libraries you want to interoperate with.
@@ -190,7 +214,7 @@ Windows build triples are:
190214 - ` x86_64-pc-windows-msvc `
191215
192216The build triple can be specified by either specifying ` --build=<triple> ` when
193- invoking ` x.py` commands, or by copying the ` config.toml` file (as described
217+ invoking ` x.py ` commands, or by creating a ` config.toml ` file (as described
194218in [ Installing From Source] ( #installing-from-source ) ), and modifying the
195219` build ` option under the ` [build] ` section.
196220
@@ -204,9 +228,7 @@ configure script and makefile (the latter of which just invokes `x.py`).
204228make && sudo make install
205229```
206230
207- When using the configure script, the generated `config.mk` file may override the
208- `config.toml` file. To go back to the `config.toml` file, delete the generated
209- `config.mk` file.
231+ ` configure ` generates a ` config.toml ` which can also be used with normal ` x.py ` invocations.
210232
211233## Building Documentation
212234
@@ -227,41 +249,20 @@ precompiled "snapshot" version of itself (made in an earlier stage of
227249development). As such, source builds require an Internet connection to
228250fetch snapshots, and an OS that can execute the available snapshot binaries.
229251
230- Snapshot binaries are currently built and tested on several platforms:
231-
232- | Platform / Architecture | x86 | x86_64 |
233- |---------------------------------------------|-----|--------|
234- | Windows (7, 8, 10, ...) | ✓ | ✓ |
235- | Linux (kernel 3.2, glibc 2.17 or later) | ✓ | ✓ |
236- | macOS (10.7 Lion or later) | (\*) | ✓ |
237-
238- (\*): Apple dropped support for running 32-bit binaries starting from macOS 10.15 and iOS 11.
239- Due to this decision from Apple, the targets are no longer useful to our users.
240- Please read [our blog post][macx32] for more info.
241-
242- [macx32]: https://blog.rust-lang.org/2020/01/03/reducing-support-for-32-bit-apple-targets.html
252+ See https://doc.rust-lang.org/nightly/rustc/platform-support.html for a list of supported platforms.
253+ Only "host tools" platforms have a pre-compiled snapshot binary available; to compile for a platform
254+ without host tools you must cross-compile.
243255
244256You may find that other platforms work, but these are our officially
245257supported build environments that are most likely to work.
246258
247259## Getting Help
248260
249- The Rust community congregates in a few places:
250-
251- * [Stack Overflow] - Direct questions about using the language.
252- * [users.rust-lang.org] - General discussion and broader questions.
253- * [/r/rust] - News and general discussion.
254-
255- [Stack Overflow]: https://stackoverflow.com/questions/tagged/rust
256- [/r/rust]: https://reddit.com/r/rust
257- [users.rust-lang.org]: https://users.rust-lang.org/
261+ See https://www.rust-lang.org/community for a list of chat platforms and forums.
258262
259263## Contributing
260264
261- If you are interested in contributing to the Rust project, please take a look
262- at the [Getting Started][gettingstarted] guide in the [rustc-dev-guide].
263-
264- [rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org
265+ See [ CONTRIBUTING.md] ( CONTRIBUTING.md ) .
265266
266267## License
267268
0 commit comments