Skip to content

Commit

Permalink
Remove sandboxed attr
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinh Tran committed Oct 30, 2023
1 parent d34afde commit 849c6c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 4 additions & 9 deletions rust/private/rustc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,7 @@ def construct_arguments(
use_json_output = False,
build_metadata = False,
force_depend_on_objects = False,
skip_expanding_rustc_env = False,
sandboxed = True):
skip_expanding_rustc_env = False):
"""Builds an Args object containing common rustc flags
Args:
Expand Down Expand Up @@ -820,7 +819,6 @@ def construct_arguments(
build_metadata (bool): Generate CLI arguments for building *only* .rmeta files. This requires use_json_output.
force_depend_on_objects (bool): Force using `.rlib` object files instead of metadata (`.rmeta`) files even if they are available.
skip_expanding_rustc_env (bool): Whether to skip expanding CrateInfo.rustc_env_attr
sandboxed (bool): Whether the action using the constructed arguments is sandboxed
Returns:
tuple: A tuple of the following items
Expand Down Expand Up @@ -967,12 +965,9 @@ def construct_arguments(
if linker_script:
rustc_flags.add(linker_script, format = "--codegen=link-arg=-T%s")

if sandboxed:
if hasattr(ctx.attr, "_experimental_toolchain_generated_sysroot"):
if ctx.attr._experimental_toolchain_generated_sysroot[BuildSettingInfo].value == True:
rustc_flags.add("--sysroot", toolchain.sysroot)
else:
rustc_flags.add(toolchain.sysroot_short_path, format = "--sysroot=${{pwd}}/%s")
if hasattr(ctx.attr, "_experimental_toolchain_generated_sysroot"):
if ctx.attr._experimental_toolchain_generated_sysroot[BuildSettingInfo].value == True:
rustc_flags.add("--sysroot", toolchain.sysroot)

# Tell Rustc where to find the standard library (or libcore)
rustc_flags.add_all(toolchain.rust_std_paths, before_each = "-L", format_each = "%s")
Expand Down
2 changes: 0 additions & 2 deletions rust/private/rustdoc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ def rustdoc_compile_action(
rustdoc = True,
force_depend_on_objects = is_test,
skip_expanding_rustc_env = True,
# rustdoc tests compile tests outside of the sandbox
sandboxed = not is_test,
)

# Because rustdoc tests compile tests outside of the sandbox, the sysroot
Expand Down

0 comments on commit 849c6c6

Please sign in to comment.