Skip to content

Commit 78dc623

Browse files
capickettfacebook-github-bot
authored andcommitted
Add RUSTC_BOOTSTRAP=1 to rustdoc action
Summary: After D63564424, our fbcode toolchain now acts similarly to stable and rejects nightly / unstable flags by default. Without this, our rustdoc actions were failing with ``` error: the option `Z` is only accepted on the nightly compiler error: the option `generate-link-to-definition` is only accepted on the nightly compiler help: consider switching to a nightly toolchain: `rustup default nightly` note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html> note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features> error: 2 nightly options were parsed ``` Reviewed By: dtolnay Differential Revision: D63649185 fbshipit-source-id: 902e4ce81fc60574022754cd0be09a6154dcd303
1 parent f7c31c8 commit 78dc623

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

prelude/rust/build.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def generate_rustdoc(
187187
subdir = common_args.subdir + "-rustdoc"
188188
output = ctx.actions.declare_output(subdir)
189189

190-
plain_env, path_env = process_env(compile_ctx, ctx.attrs.env, exec_is_windows)
190+
plain_env, path_env = process_env(compile_ctx, toolchain_info.rustdoc_env | ctx.attrs.env, exec_is_windows)
191191
plain_env["RUSTDOC_BUCK_TARGET"] = cmd_args(str(ctx.label.raw_target()))
192192

193193
rustdoc_cmd = cmd_args(

prelude/rust/rust_toolchain.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ rust_toolchain_attrs = {
5353
# FIXME(JakobDegen): Can't use `list[str]` here, because then the default is wrong, but can't
5454
# use a non-empty list as the default because lists are mutable
5555
"rustc_coverage_flags": provider_field(typing.Any, default = ("-Cinstrument-coverage",)),
56+
# Extra env variables that should be made available to the rustdoc executable.
57+
"rustdoc_env": provider_field(dict[str, typing.Any], default = {}),
5658
# Extra flags for rustdoc invocations
5759
"rustdoc_flags": provider_field(list[typing.Any], default = []),
5860
# When you `buck test` a library, also compile and run example code in its

0 commit comments

Comments
 (0)