File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed
examples/toolchain-to-rebuild-std Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,7 @@ build --@rules_rust//rust/settings:experimental_toolchain_generated_sysroot=True
4
4
# enable toolchain debugging by default
5
5
build --toolchain_resolution_debug='@rules_rust//rust:toolchain_type'
6
6
7
+ # for toolchain debugging purposes
7
8
build:beta --@rules_rust//rust/toolchain/channel:channel=beta
8
9
build:stable --@rules_rust//rust/toolchain/channel:channel=stable
9
10
build:nightly --@rules_rust//rust/toolchain/channel:channel=nightly
10
-
11
- build:apple --platforms=//:aarch64-apple-darwin
12
- build:wasi --platforms=//:wasm32-wasi
Original file line number Diff line number Diff line change 1
1
2
+ This directory demonstrates an example of how to rebuild the standard library
3
+ for an arbitrary platform and custom configurations.
4
+
5
+ TODO: Write up on how the toolchain bootrapping process works.
6
+
7
+ To build an end-user rust_library target for specific target, run
8
+
9
+ ```
10
+ bazel build //hello_lib --platforms=//:aarch64-apple-darwin
11
+ ```
12
+
13
+ for `aarch64-apple-darwin` or
14
+
15
+ ```
16
+ bazel build //hello_lib --platforms=//:wasm32-wasi
17
+ ```
18
+
19
+ for `wasm32-wasi`.
20
+
21
+ The toolchains orderly registered in WORKSPACE and _beta_channel_transition ensure
22
+ that the standard library is rebuilt for the given platform.
23
+
24
+ To only rebuild std, run
25
+
26
+ ```
27
+ bazel build @stdlbs//:std --platforms=//:aarch64-apple-darwin
28
+ ```
29
+
30
+ or
2
31
3
32
```
4
- bazel build //hello_lib --config=apple
5
- bazel build //hello_lib --config=wasi
33
+ bazel build @stdlbs//:std --platforms=//:wasm32-wasi
6
34
```
You can’t perform that action at this time.
0 commit comments