Skip to content

Commit b15175b

Browse files
author
Vinh Tran
committed
Add README
1 parent 960c70a commit b15175b

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

examples/toolchain-to-rebuild-std/.bazelrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ build --@rules_rust//rust/settings:experimental_toolchain_generated_sysroot=True
44
# enable toolchain debugging by default
55
build --toolchain_resolution_debug='@rules_rust//rust:toolchain_type'
66

7+
# for toolchain debugging purposes
78
build:beta --@rules_rust//rust/toolchain/channel:channel=beta
89
build:stable --@rules_rust//rust/toolchain/channel:channel=stable
910
build:nightly --@rules_rust//rust/toolchain/channel:channel=nightly
10-
11-
build:apple --platforms=//:aarch64-apple-darwin
12-
build:wasi --platforms=//:wasm32-wasi
Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
11

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
231

332
```
4-
bazel build //hello_lib --config=apple
5-
bazel build //hello_lib --config=wasi
33+
bazel build @stdlbs//:std --platforms=//:wasm32-wasi
634
```

0 commit comments

Comments
 (0)