@@ -22,6 +22,8 @@ Read ["Installation"] from [The Book].
22
22
23
23
The Rust build system uses a Python script called ` x.py ` to build the compiler,
24
24
which manages the bootstrapping process. It lives at the root of the project.
25
+ It also uses a file named ` config.toml ` to determine various configuration settings for the build.
26
+ You can see a full list of options in ` config.example.toml ` .
25
27
26
28
The ` x.py ` command can be run directly on most Unix systems in the following
27
29
format:
@@ -85,6 +87,8 @@ See [the rustc-dev-guide for more info][sysllvm].
85
87
86
88
### Building on a Unix-like system
87
89
90
+ #### Build steps
91
+
88
92
1 . Clone the [ source] with ` git ` :
89
93
90
94
``` sh
@@ -96,18 +100,13 @@ See [the rustc-dev-guide for more info][sysllvm].
96
100
97
101
2 . Configure the build settings:
98
102
99
- The Rust build system uses a file named ` config.toml ` in the root of the
100
- source tree to determine various configuration settings for the build.
101
- Set up the defaults intended for distros to get started. You can see a full
102
- list of options in ` config.example.toml ` .
103
-
104
103
``` sh
105
- printf ' profile = "user" \nchangelog-seen = 2 \n ' > config.toml
104
+ ./configure
106
105
```
107
106
108
107
If you plan to use ` x.py install ` to create an installation, it is
109
108
recommended that you set the ` prefix ` value in the ` [install] ` section to a
110
- directory.
109
+ directory: ` ./configure --set install.prefix=<path> `
111
110
112
111
3 . Build and install:
113
112
@@ -117,12 +116,25 @@ See [the rustc-dev-guide for more info][sysllvm].
117
116
118
117
When complete, ` ./x.py install ` will place several programs into
119
118
` $PREFIX/bin ` : ` rustc ` , the Rust compiler, and ` rustdoc ` , the
120
- API-documentation tool. If you've set ` profile = "user" ` or
121
- ` build.extended = true ` , it will also include [ Cargo] , Rust's package
122
- manager.
119
+ API-documentation tool. By default, it will also include [ Cargo] , Rust's package manager.
120
+ You can disable this behavior by passing ` --set build.extended=false ` to ` ./configure ` .
123
121
124
122
[ Cargo ] : https://github.com/rust-lang/cargo
125
123
124
+ #### Configure and Make
125
+
126
+ This project provides a configure script and makefile (the latter of which just invokes ` x.py ` ).
127
+ ` ./configure ` is the recommended way to programatically generate a ` config.toml ` . ` make ` is not
128
+ recommended (we suggest using ` x.py ` directly), but it is supported and we try not to break it
129
+ unnecessarily.
130
+
131
+ ``` sh
132
+ ./configure
133
+ make && sudo make install
134
+ ```
135
+
136
+ ` configure ` generates a ` config.toml ` which can also be used with normal ` x.py ` invocations.
137
+
126
138
### Building on Windows
127
139
128
140
On Windows, we suggest using [ winget] to install dependencies by running the
@@ -186,7 +198,7 @@ toolchain.
186
198
4 . Navigate to Rust's source code (or clone it), then build it:
187
199
188
200
``` sh
189
- ./ x.py build && ./ x.py install
201
+ python x.py setup user && python x.py build && python x.py install
190
202
```
191
203
192
204
#### MSVC
@@ -204,6 +216,7 @@ With these dependencies installed, you can build the compiler in a `cmd.exe`
204
216
shell with:
205
217
206
218
``` sh
219
+ python x.py setup user
207
220
python x.py build
208
221
```
209
222
@@ -232,21 +245,7 @@ Windows build triples are:
232
245
233
246
The build triple can be specified by either specifying ` --build=<triple> ` when
234
247
invoking ` x.py ` commands, or by creating a ` config.toml ` file (as described in
235
- [ Installing from Source] ( #installing-from-source ) ), and modifying the ` build `
236
- option under the ` [build] ` section.
237
-
238
- ### Configure and Make
239
-
240
- While it's not the recommended build system, this project also provides a
241
- configure script and makefile (the latter of which just invokes ` x.py ` ).
242
-
243
- ``` sh
244
- ./configure
245
- make && sudo make install
246
- ```
247
-
248
- ` configure ` generates a ` config.toml ` which can also be used with normal ` x.py `
249
- invocations.
248
+ [ Building on a Unix-like system] ( #building-on-a-unix-like-system ) ), and passing ` --set build.build=<triple> ` to ` ./configure ` .
250
249
251
250
## Building Documentation
252
251
0 commit comments