@@ -22,6 +22,8 @@ Read ["Installation"] from [The Book].
2222
2323The Rust build system uses a Python script called ` x.py ` to build the compiler,
2424which 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 ` .
2527
2628The ` x.py ` command can be run directly on most Unix systems in the following
2729format:
@@ -85,6 +87,8 @@ See [the rustc-dev-guide for more info][sysllvm].
8587
8688### Building on a Unix-like system
8789
90+ #### Build steps
91+
88921 . Clone the [ source] with ` git ` :
8993
9094 ``` sh
@@ -96,18 +100,13 @@ See [the rustc-dev-guide for more info][sysllvm].
96100
971012 . Configure the build settings:
98102
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-
104103 ``` sh
105- printf ' profile = "user" \nchangelog-seen = 2 \n ' > config.toml
104+ ./configure
106105 ```
107106
108107 If you plan to use ` x.py install ` to create an installation, it is
109108 recommended that you set the ` prefix ` value in the ` [install] ` section to a
110- directory.
109+ directory: ` ./configure --set install.prefix=<path> `
111110
1121113 . Build and install:
113112
@@ -117,12 +116,25 @@ See [the rustc-dev-guide for more info][sysllvm].
117116
118117 When complete, ` ./x.py install ` will place several programs into
119118 ` $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 ` .
123121
124122[ Cargo ] : https://github.com/rust-lang/cargo
125123
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+
126138### Building on Windows
127139
128140On Windows, we suggest using [ winget] to install dependencies by running the
@@ -186,7 +198,7 @@ toolchain.
1861984 . Navigate to Rust's source code (or clone it), then build it:
187199
188200 ``` sh
189- ./ x.py build && ./ x.py install
201+ python x.py setup user && python x.py build && python x.py install
190202 ```
191203
192204#### MSVC
@@ -204,6 +216,7 @@ With these dependencies installed, you can build the compiler in a `cmd.exe`
204216shell with:
205217
206218``` sh
219+ python x.py setup user
207220python x.py build
208221```
209222
@@ -232,21 +245,7 @@ Windows build triples are:
232245
233246The build triple can be specified by either specifying ` --build=<triple> ` when
234247invoking ` 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 ` .
250249
251250## Building Documentation
252251
0 commit comments