From 849c6c6f563cfc4e6e93991f7b42558253edfc7d Mon Sep 17 00:00:00 2001 From: Vinh Tran Date: Mon, 30 Oct 2023 23:17:43 +0000 Subject: [PATCH] Remove sandboxed attr --- rust/private/rustc.bzl | 13 ++++--------- rust/private/rustdoc.bzl | 2 -- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl index d7c14be6d8..5823a5a4a6 100644 --- a/rust/private/rustc.bzl +++ b/rust/private/rustc.bzl @@ -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: @@ -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 @@ -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") diff --git a/rust/private/rustdoc.bzl b/rust/private/rustdoc.bzl index 4c6e0ab115..5fa82b8144 100644 --- a/rust/private/rustdoc.bzl +++ b/rust/private/rustdoc.bzl @@ -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