Skip to content

Commit

Permalink
Add RUSTC_BOOTSTRAP=1 to rustdoc action
Browse files Browse the repository at this point in the history
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
  • Loading branch information
capickett authored and facebook-github-bot committed Sep 30, 2024
1 parent f7c31c8 commit 78dc623
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion prelude/rust/build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def generate_rustdoc(
subdir = common_args.subdir + "-rustdoc"
output = ctx.actions.declare_output(subdir)

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

rustdoc_cmd = cmd_args(
Expand Down
2 changes: 2 additions & 0 deletions prelude/rust/rust_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ rust_toolchain_attrs = {
# FIXME(JakobDegen): Can't use `list[str]` here, because then the default is wrong, but can't
# use a non-empty list as the default because lists are mutable
"rustc_coverage_flags": provider_field(typing.Any, default = ("-Cinstrument-coverage",)),
# Extra env variables that should be made available to the rustdoc executable.
"rustdoc_env": provider_field(dict[str, typing.Any], default = {}),
# Extra flags for rustdoc invocations
"rustdoc_flags": provider_field(list[typing.Any], default = []),
# When you `buck test` a library, also compile and run example code in its
Expand Down

0 comments on commit 78dc623

Please sign in to comment.