Skip to content

Delete experimental_toolchain_generated_sysroot #2848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions rust/private/rustc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,7 @@ def construct_arguments(
))

# Ensure the sysroot is set for the target platform
if toolchain._experimental_toolchain_generated_sysroot:
rustc_flags.add(toolchain.sysroot, format = "--sysroot=%s")
rustc_flags.add(toolchain.sysroot, format = "--sysroot=%s")

if toolchain._rename_first_party_crates:
env["RULES_RUST_THIRD_PARTY_DIR"] = toolchain._third_party_dir
Expand Down
8 changes: 0 additions & 8 deletions rust/settings/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
load("//rust/private:unpretty.bzl", "rust_unpretty_flag")
load(":incompatible.bzl", "incompatible_flag")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -85,13 +84,6 @@ bool_flag(
build_setting_default = True,
)

# A flag to set rustc --sysroot flag to the sysroot generated by rust_toolchain
incompatible_flag(
name = "experimental_toolchain_generated_sysroot",
build_setting_default = True,
issue = "https://github.com/bazelbuild/rules_rust/issues/2039",
)

# A flag to control whether to link libstd dynamically.
bool_flag(
name = "experimental_link_std_dylib",
Expand Down
9 changes: 0 additions & 9 deletions rust/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ load(
"is_std_dylib",
"make_static_lib_symlink",
)
load("//rust/settings:incompatible.bzl", "IncompatibleFlagInfo")

rust_analyzer_toolchain = _rust_analyzer_toolchain
rustfmt_toolchain = _rustfmt_toolchain
Expand Down Expand Up @@ -697,7 +696,6 @@ def _rust_toolchain_impl(ctx):
_experimental_use_cc_common_link = _experimental_use_cc_common_link(ctx),
_experimental_use_global_allocator = experimental_use_global_allocator,
_experimental_use_coverage_metadata_files = ctx.attr._experimental_use_coverage_metadata_files[BuildSettingInfo].value,
_experimental_toolchain_generated_sysroot = ctx.attr._experimental_toolchain_generated_sysroot[IncompatibleFlagInfo].enabled,
_no_std = no_std,
)
return [
Expand Down Expand Up @@ -872,13 +870,6 @@ rust_toolchain = rule(
"_cc_toolchain": attr.label(
default = Label("@bazel_tools//tools/cpp:current_cc_toolchain"),
),
"_experimental_toolchain_generated_sysroot": attr.label(
default = Label("//rust/settings:experimental_toolchain_generated_sysroot"),
doc = (
"Label to a boolean build setting that lets the rule knows wheter to set --sysroot to rustc" +
"This flag is only relevant when used together with --@rules_rust//rust/settings:experimental_toolchain_generated_sysroot."
),
),
"_experimental_use_coverage_metadata_files": attr.label(
default = Label("//rust/settings:experimental_use_coverage_metadata_files"),
),
Expand Down
2 changes: 0 additions & 2 deletions test/toolchain/toolchain_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ toolchain_adds_rustc_flags_lib_test = analysistest.make(
_toolchain_adds_rustc_flags_lib_impl,
config_settings = {
str(Label("//:extra_rustc_flags")): [CONFIG_FLAG],
str(Label("//rust/settings:experimental_toolchain_generated_sysroot")): True,
},
)

toolchain_adds_rustc_flags_shared_lib_test = analysistest.make(
_toolchain_adds_rustc_flags_shared_lib_impl,
config_settings = {
str(Label("//:extra_rustc_flags")): [CONFIG_FLAG],
str(Label("//rust/settings:experimental_toolchain_generated_sysroot")): True,
},
)

Expand Down
Loading