File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -965,9 +965,8 @@ def construct_arguments(
965
965
if linker_script :
966
966
rustc_flags .add (linker_script , format = "--codegen=link-arg=-T%s" )
967
967
968
- if hasattr (ctx .attr , "_experimental_toolchain_generated_sysroot" ):
969
- if ctx .attr ._experimental_toolchain_generated_sysroot [BuildSettingInfo ].value == True :
970
- rustc_flags .add ("--sysroot" , toolchain .sysroot )
968
+ if attr ._experimental_toolchain_generated_sysroot [BuildSettingInfo ].value == True :
969
+ rustc_flags .add ("--sysroot" , toolchain .sysroot )
971
970
972
971
# Tell Rustc where to find the standard library (or libcore)
973
972
rustc_flags .add_all (toolchain .rust_std_paths , before_each = "-L" , format_each = "%s" )
@@ -1042,6 +1041,9 @@ def construct_arguments(
1042
1041
data_paths ,
1043
1042
))
1044
1043
1044
+ # Ensure the sysroot is set for the target platform
1045
+ env ["SYSROOT" ] = toolchain .sysroot
1046
+
1045
1047
if toolchain ._rename_first_party_crates :
1046
1048
env ["RULES_RUST_THIRD_PARTY_DIR" ] = toolchain ._third_party_dir
1047
1049
Original file line number Diff line number Diff line change @@ -321,6 +321,13 @@ rust_doc = rule(
321
321
"_error_format" : attr .label (
322
322
default = Label ("//:error_format" ),
323
323
),
324
+ "_experimental_toolchain_generated_sysroot" : attr .label (
325
+ default = Label ("//rust/settings:experimental_toolchain_generated_sysroot" ),
326
+ doc = (
327
+ "Label to a boolean build setting that lets the rule knows wheter to set --sysroot to rustc" +
328
+ "This flag is only relevant when used together with --@rules_rust//rust/settings:experimental_toolchain_generated_sysroot."
329
+ ),
330
+ ),
324
331
"_process_wrapper" : attr .label (
325
332
doc = "A process wrapper for running rustdoc on all platforms" ,
326
333
default = Label ("@rules_rust//util/process_wrapper" ),
You can’t perform that action at this time.
0 commit comments