Skip to content

Commit 7dae1b0

Browse files
committed
Add detail about dependencies from the dev-guide
The goal is to remove this altogether from the dev-guide once this PR is merged.
1 parent a06e5de commit 7dae1b0

File tree

1 file changed

+42
-13
lines changed

1 file changed

+42
-13
lines changed

README.md

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,37 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
4444
[gettingstarted]: https://rustc-dev-guide.rust-lang.org/getting-started.html
4545
[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html
4646

47-
### Building on a Unix-like system
48-
1. Make sure you have installed the dependencies:
47+
### Dependencies
48+
49+
Make sure you have installed the dependencies:
4950

50-
* `g++` 5.1 or later or `clang++` 3.5 or later
5151
* `python` 3 or 2.7
52-
* GNU `make` 3.81 or later
53-
* `cmake` 3.13.4 or later
54-
* `ninja`
55-
* `curl`
5652
* `git`
57-
* `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)
5855
* `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
67+
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+
5974

60-
2. Clone the [source] with `git`:
75+
### Building on a Unix-like system
76+
77+
1. Clone the [source] with `git`:
6178

6279
```sh
6380
git clone https://github.com/rust-lang/rust.git
@@ -66,7 +83,7 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
6683

6784
[source]: https://github.com/rust-lang/rust
6885

69-
3. Configure the build settings:
86+
2. Configure the build settings:
7087

7188
The Rust build system uses a file named `config.toml` in the root of the
7289
source tree to determine various configuration settings for the build.
@@ -79,9 +96,7 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
7996
If you plan to use `x.py install` to create an installation, it is recommended
8097
that you set the `prefix` value in the `[install]` section to a directory.
8198

82-
Create an install directory if you are not installing in the default directory.
83-
84-
4. Build and install:
99+
3. Build and install:
85100

86101
```sh
87102
./x.py build && ./x.py install
@@ -98,6 +113,20 @@ by running it with the `--help` flag or reading the [rustc dev guide][rustcguide
98113
99114
### Building on Windows
100115
116+
On Windows, we suggest using [winget] to install dependencies by running the following in a terminal:
117+
118+
```powershell
119+
winget install -e Python.Python.3
120+
winget install -e Kitware.CMake
121+
winget install -e Git.Git
122+
```
123+
124+
Then edit your system's `PATH` variable and add: `C:\Program Files\CMake\bin`. See
125+
[this guide on editing the system `PATH`](https://www.java.com/en/download/help/path.html) from the
126+
Java documentation.
127+
128+
[winget]: https://github.com/microsoft/winget-cli
129+
101130
There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by
102131
Visual Studio and the GNU ABI used by the GCC toolchain. Which version of Rust
103132
you need depends largely on what C/C++ libraries you want to interoperate with.

0 commit comments

Comments
 (0)