You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Doc] Improve documentation on toolchain registration with bzlmod (#3430)
Hi, this is referencing issue #2973 , i'm sorry i kinda forgot this was
open too. Let me know if it is clear or if it needs modification.
Parallelly, i removed refernces to a no longer existing file
`flatten.md`. Is this correct, or do you want to open a separate
issue/pr? Thanks!
As well as an exact version, `versions` can accept `nightly/{iso_date}` and `beta/{iso_date}` strings for toolchains from different release channels, as in
67
+
68
+
```python
69
+
rust.toolchain(
70
+
edition="2021",
71
+
versions= [ "nightly/1.85.0" ],
72
+
)
73
+
```
74
+
75
+
By default, a `stable` and `nightly` toolchain will be registered if no `toolchain` method is called (and thus no specific versions are registered). However, if only 1 version is passed and it is from the `nightly` or `beta` release channels (i.e. __not__`stable`), then the following build setting flag must be present, either on the command line or set in the project's `.bazelrc` file:
Failure to do so will result in rules attempting to match a `stable` toolchain when one was not registered, thus raising an error.
82
+
83
+
### WORKSPACE
84
+
85
+
To build with a particular version of the Rust compiler when using a WORKSPACE file, pass that version to `rust_register_toolchains`:
55
86
56
87
```python
57
88
rust_register_toolchains(
@@ -62,7 +93,7 @@ rust_register_toolchains(
62
93
)
63
94
```
64
95
65
-
As well as an exact version, `versions` can accept `nightly/{iso_date}` and `beta/{iso_date}` strings for toolchains from different release channels.
96
+
Like in the Bzlmod approach, as well as an exact version, `versions` can accept `nightly/{iso_date}` and `beta/{iso_date}` strings for toolchains from different release channels.
66
97
67
98
```python
68
99
rust_register_toolchains(
@@ -73,15 +104,15 @@ rust_register_toolchains(
73
104
)
74
105
```
75
106
76
-
By default, a `stable` and `nightly` toolchain will be registered if no versions are passed to `rust_register_toolchains`. However,
77
-
if only 1 version is passed and it is from the `nightly` or `beta` release channels (i.e. __not__`stable`), then a build setting must
78
-
also be set in the project's `.bazelrc` file.
107
+
Here too a `stable` and `nightly` toolchain will be registered by default if no versions are passed to `rust_register_toolchains`. However,
108
+
if only 1 version is passed and it is from the `nightly` or `beta` release channels (i.e. __not__`stable`), then the following build setting flag must
109
+
also be set either in the command line or in the project's `.bazelrc` file.
Copy file name to clipboardExpand all lines: docs/src/rules.md
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,3 @@
17
17
-[rust_prost](rust_prost.md): rules for generating [protobuf](https://developers.google.com/protocol-buffers) and [gRPC](https://grpc.io) stubs using [prost](https://github.com/tokio-rs/prost).
18
18
-[rust_protobuf](rust_protobuf.md): rules for generating [protobuf](https://developers.google.com/protocol-buffers) and [gRPC](https://grpc.io) stubs with [rust-protobuf](https://github.com/stepancheg/rust-protobuf/)
19
19
-[rust_wasm_bindgen](rust_wasm_bindgen.md): rules for generating [WebAssembly](https://www.rust-lang.org/what/wasm) bindings.
20
-
21
-
## Full API
22
-
23
-
You can also browse the [full API in one page](flatten.md).
0 commit comments