diff --git a/Cargo.Bazel.json.lock b/Cargo.Bazel.json.lock index 4a023d0aa87..2f160cddcea 100644 --- a/Cargo.Bazel.json.lock +++ b/Cargo.Bazel.json.lock @@ -1,5 +1,5 @@ { - "checksum": "0f968bb13a23433173eea3d49515a1711cc6e4731fba155d32bf7a6bc949d3e7", + "checksum": "48649a7946d4c66d40482e351dabdafcfef5e5a4fca240019e226c6cd6eee10e", "crates": { "abnf 0.12.0": { "name": "abnf", @@ -70445,10 +70445,12 @@ "**" ], "data": { - "common": [ - "@jemalloc//:libjemalloc" - ], - "selects": {} + "common": [], + "selects": { + "x86_64-unknown-linux-gnu": [ + "@jemalloc//:libjemalloc" + ] + } }, "data_glob": [ "**" @@ -70463,10 +70465,12 @@ "selects": {} }, "build_script_env": { - "common": { - "JEMALLOC_OVERRIDE": "$(location @jemalloc//:libjemalloc)" - }, - "selects": {} + "common": {}, + "selects": { + "x86_64-unknown-linux-gnu": { + "JEMALLOC_OVERRIDE": "$(location @jemalloc//:libjemalloc)" + } + } }, "links": "jemalloc" }, diff --git a/MODULE.bazel b/MODULE.bazel index 85f0037194d..602f5c5c4de 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -21,7 +21,6 @@ bazel_dep(name = "rules_foreign_cc", version = "0.12.0") register_toolchains( "@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain", "@rules_foreign_cc//toolchains:preinstalled_make_toolchain", - "@rules_foreign_cc//toolchains:preinstalled_autoconf_toolchain", ) # use HEAD to include diff --git a/bazel/external_crates.bzl b/bazel/external_crates.bzl index c04a9659f96..5328c72fa9c 100644 --- a/bazel/external_crates.bzl +++ b/bazel/external_crates.bzl @@ -76,12 +76,24 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable "tikv-jemalloc-sys": [crate.annotation( # TODO: fix wording, we _are_ indeed building from source but not from the crate's build.rs # Avoid building jemalloc from source (in part bc it creates builder-specific config files) - build_script_data = [ - "@jemalloc//:libjemalloc", - ], - build_script_env = { - "JEMALLOC_OVERRIDE": "$(location @jemalloc//:libjemalloc)", - }, + + build_script_data = crate.select([], { + "x86_64-unknown-linux-gnu": + [ + "@jemalloc//:libjemalloc", + ], + }), + build_script_env = crate.select({}, + { + "x86_64-unknown-linux-gnu": + { "JEMALLOC_OVERRIDE": "$(location @jemalloc//:libjemalloc)" }, + }), + #build_script_data = [ + # "@jemalloc//:libjemalloc", + #], + #build_script_env = { + # "JEMALLOC_OVERRIDE": "$(location @jemalloc//:libjemalloc)", + #}, )], "cranelift-isle": [crate.annotation( # Patch for determinism issues diff --git a/bazel/rules_rust.patch b/bazel/rules_rust.patch index c86050d6321..90dde932582 100644 --- a/bazel/rules_rust.patch +++ b/bazel/rules_rust.patch @@ -14,3 +14,31 @@ index 2dab3578..b5bb4fca 100644 .unwrap_or_else(|_| panic!("Unable to write file {:?}", stderr_path)); let CompileAndLinkFlags { +diff --git a/crate_universe/private/crate.bzl b/crate_universe/private/crate.bzl +index c493e9a6..ad317abf 100644 +--- a/crate_universe/private/crate.bzl ++++ b/crate_universe/private/crate.bzl +@@ -230,7 +230,22 @@ def _stringify_label(value): + def _stringify_list(values): + if not values: + return values +- return [str(x) for x in values] ++ ++ if type(values) == "list": ++ return [str(x) for x in values] ++ ++ ++ ++ ++ if type(values) == "struct" and type(values.selects) != "NoneType": ++ new_selects = {} ++ ++ for k, v in values.selects.items(): ++ new_selects[k] = [str(x) for x in values.selects[k]] ++ ++ return struct(common = [str(x) for x in values.common], selects = new_selects) ++ ++ fail("Cannot stringify unknown type for list '{}'".format(values)) + + def _select(common, selects): + """A Starlark Select for `crate.annotation()`. diff --git a/bin/bazel-pin.sh b/bin/bazel-pin.sh index 02b1efefb73..d5ec55d0923 100755 --- a/bin/bazel-pin.sh +++ b/bin/bazel-pin.sh @@ -80,7 +80,7 @@ fi if [ "${CRATES:-}" == "" ]; then echo "Repinning all crates" CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index - SANITIZERS_ENABLED=1 CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index + #SANITIZERS_ENABLED=1 CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index else echo "Repinning ${#CRATES[@]} crates" for crate in "${CRATES[@]}"; do