diff --git a/.aspect/workflows/config.yaml b/.aspect/workflows/config.yaml index 56cff568..1dd06420 100644 --- a/.aspect/workflows/config.yaml +++ b/.aspect/workflows/config.yaml @@ -17,14 +17,14 @@ tasks: # rm .bazelversion # echo "USE_BAZEL_VERSION=last_green" > .bazeliskrc - - test: - name: test-os:linux-bzl:latest - queue: aspect-large - hooks: - - type: before_task - command: | - rm .bazelversion - echo "USE_BAZEL_VERSION=latest" > .bazeliskrc + #- test: + # name: test-os:linux-bzl:latest + # queue: aspect-large + # hooks: + # - type: before_task + # command: | + # rm .bazelversion + # echo "USE_BAZEL_VERSION=latest" > .bazeliskrc - test: name: test-os:linux-bzl:8 @@ -33,7 +33,8 @@ tasks: - type: before_task command: | rm .bazelversion - echo "USE_BAZEL_VERSION=8.4.0" > .bazeliskrc + # Tip of https://github.com/bazelbuild/bazel/commits/release-8.5.1/ + echo "USE_BAZEL_VERSION=8bfa1e20a896356d0bac1276723210191141329d" > .bazeliskrc - finalization: queue: aspect-small diff --git a/.bazelrc b/.bazelrc index de624e78..498f0cd4 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,8 +1,7 @@ import %workspace%/bazel/defaults.bazelrc -common --enable_bzlmod - common --test_output=errors +common --incompatible_disallow_empty_glob=False # Define value used by tests common --define=SOME_VAR=SOME_VALUE @@ -11,16 +10,16 @@ common --define=SOME_VAR=SOME_VALUE common --@pypi//venv=default common --incompatible_enable_cc_toolchain_resolution +common --@toolchains_llvm_bootstrapped//config:experimental_stub_libgcc_s +common --@rules_cc//cc/toolchains/args/archiver_flags:use_libtool_on_macos=false # TODO(bzlmod): Don't break proto common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT -# Don't try and auto detect the cc toolchain, as we use our own gcc toolchains. +# Don't try and auto detect the cc toolchain, as we use our own llvm toolchains. common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 - -# Don't link against libunwind on macos as it causes linking failures (https://github.com/bazel-contrib/toolchains_llvm/pull/346) -common:macos --@toolchains_llvm//toolchain/config:libunwind=False +common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1 common:ci --toolchain_resolution_debug='@@bazel_tools//tools/cpp:toolchain_type' @@ -30,10 +29,6 @@ common:release --compilation_mode=opt common:release --@rules_rust//rust/settings:lto=fat common:release --@rules_rust//:extra_rustc_flags=-Cpanic=abort -# Speed up local development by using the non-hermetic CPP toolchain. -common:nollvm --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0 -common:nollvm --noincompatible_enable_cc_toolchain_resolution - # Load any settings specific to the current user. # .bazelrc.user should appear in .gitignore so that settings are not shared with team members # This needs to be last statement in this diff --git a/.bazelversion b/.bazelversion index 3e5d3bf9..c92e2ee1 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1,4 +1,4 @@ -8.4.0 +8.5.0 # The first line of this file is used by Bazelisk and Bazel to be sure # the right version of Bazel is used to build and test this repo. # This also defines which version is used on CI. diff --git a/.bcr/patches/remove_dev_deps.patch b/.bcr/patches/remove_dev_deps.patch index e3eef832..8c922920 100644 --- a/.bcr/patches/remove_dev_deps.patch +++ b/.bcr/patches/remove_dev_deps.patch @@ -1,6 +1,6 @@ ---- a/MODULE.bazel 2025-12-11 15:32:06.556883760 -0800 -+++ b/MODULE.bazel 2025-12-11 15:32:06.556900451 -0800 -@@ -51,537 +51,3 @@ +--- a/MODULE.bazel 2025-12-16 08:26:57 ++++ b/MODULE.bazel 2025-12-16 08:26:57 +@@ -58,253 +58,3 @@ # HACK: In prod the includer's patch inserts the use_repo for multitool. This # solves the problem of needing a use_repo here in prod and below in dev. @@ -36,327 +36,43 @@ -# from bazel/include/llvm.MODULE.bazel -# LLVM configuration - --bazel_dep(name = "toolchains_llvm", version = "1.4.0") --single_version_override( -- module_name = "toolchains_llvm", +-bazel_dep(name = "toolchains_llvm_bootstrapped", version = "0.2.5", dev_dependency = True) +-archive_override( +- module_name = "toolchains_llvm_bootstrapped", +- integrity = "sha256-+nddimV34BYO8YExiKLYG2kMoA2Sv+5ZoMRPQLJxNfE=", +- strip_prefix = "toolchains_llvm_bootstrapped-121c8419394e76b5652c161369743c564799b2e3", +- urls = ["https://github.com/cerisier/toolchains_llvm_bootstrapped/archive/121c8419394e76b5652c161369743c564799b2e3/master.tar.gz"], - patch_strip = 1, - patches = [ -- "//bazel/patches:toolchains_llvm.patch", +- "//bazel/patches:llvm_darwin_sysroot.patch", - ], -) - --llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) -- --execution_oses = [ -- "macos", -- "linux", --] -- --execution_cpus = [ -- "aarch64", -- "x86_64", --] -- --[ -- [ -- llvm.toolchain( -- name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), -- exec_arch = exec_cpu, -- exec_os = exec_os if exec_os != "macos" else "darwin", -- llvm_version = "20.1.2", -- ), -- llvm.sysroot( -- name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), -- label = "@org_chromium_sysroot_linux_x86_64//:sysroot", -- targets = ["linux-x86_64"], -- ), -- llvm.sysroot( -- name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), -- label = "@org_chromium_sysroot_linux_arm64//:sysroot", -- targets = ["linux-aarch64"], -- ), -- llvm.sysroot( -- name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), -- label = "@sysroot_darwin_universal//:sysroot", -- targets = [ -- "darwin-aarch64", -- "darwin-x86_64", -- ], -- ), -- use_repo(llvm, "llvm_toolchain_{}_{}".format(exec_os, exec_cpu)), -- ] -- for exec_os in execution_oses -- for exec_cpu in execution_cpus --] -- --http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -- --_SYSROOT_LINUX_BUILD_FILE = """\ --filegroup( -- name = "sysroot", -- srcs = glob(["*/**"]), -- visibility = ["//visibility:public"], --) --""" -- --http_archive( -- name = "org_chromium_sysroot_linux_arm64", -- build_file_content = _SYSROOT_LINUX_BUILD_FILE, -- sha256 = "b199942a0bd9c34800e8d7b669778ef45f2054b9f106039439383dd66efcef31", -- urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_arm64_sysroot.tar.xz"], --) -- --http_archive( -- name = "org_chromium_sysroot_linux_x86_64", -- build_file_content = _SYSROOT_LINUX_BUILD_FILE, -- sha256 = "b279dd2926e7d3860bb4e134997a45df5106f680e160a959b945580ba4ec755f", -- urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_amd64_sysroot.tar.xz"], --) -- --http_archive( -- name = "sysroot_darwin_universal", -- build_file_content = """ --filegroup( -- name = "sysroot", -- srcs = glob( -- include = ["**"], -- exclude = ["**/*:*"], -- ), -- visibility = ["//visibility:public"], --) --""", -- integrity = "sha256-9qzGIJ251Wtn/K+R7B3v5Ici6esT3CH7kc/s6xSJ5X4=", -- # The ruby header has an infinite symlink that we need to remove. -- patch_cmds = ["rm System/Library/Frameworks/Ruby.framework/Versions/Current/Headers/ruby/ruby"], -- strip_prefix = "MacOSX14.5.sdk", -- urls = ["https://github.com/alexey-lysiuk/macos-sdk/releases/download/14.5/MacOSX14.5.tar.xz"], +-register_toolchains( +- "@toolchains_llvm_bootstrapped//toolchain:all", -) - --target_oses = [ -- "macos", -- "linux", --] -- --target_cpus = [ -- "aarch64", -- "x86_64", --] -- --platforms = [ -- { -- "exec_os": exec_os, -- "exec_cpu": exec_cpu, -- "tgt_os": tgt_os, -- "tgt_cpu": tgt_cpu, -- } -- for exec_os in execution_oses -- for exec_cpu in execution_cpus -- for tgt_os in target_oses -- for tgt_cpu in target_cpus --] -- --[register_toolchains("//bazel/platforms/toolchains:{}_{}_{}_{}_llvm".format( -- p["exec_os"], -- p["exec_cpu"], -- p["tgt_os"], -- p["tgt_cpu"], --)) for p in platforms] -- -######################################## -# from bazel/include/rust.MODULE.bazel -# Rust configuration - --bazel_dep(name = "rules_rust", version = "0.67.0") -- --RUST_EDITION = "2024" -- --RUST_VERSION = "1.88.0" +-bazel_dep(name = "rules_rust", version = "0.68.1") - -rust = use_extension( - "@rules_rust//rust:extensions.bzl", - "rust", -) -- --# These override the default rust_repository_sets created by rust_register_toolchain. They must be named exactly as follows. --# NB: The first call for a particular name may set the `edition`, `exec_triple`, and `versions` attributes, the subsequent calls should not set it or else Bazel will fail with, --# "Error in fail: You must only set edition on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" --# "Error in fail: You must only set exec_triple on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" --# "Error in fail: You must only set versions on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" -- --# Execution platform : linux x86 (x86_64-unknown-linux-gnu) --# -> linux x86_64 (gnu) --rust.repository_set( -- name = "rust_linux_x86_64", -- edition = RUST_EDITION, # "edition" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) -- exec_triple = "x86_64-unknown-linux-gnu", # "exec_triple" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:x86_64", -- "@platforms//os:linux", -- ], -- target_triple = "x86_64-unknown-linux-gnu", -- versions = [RUST_VERSION], # "versions" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) --) -- --# -> linux x86_64 (musl) --rust.repository_set( -- name = "rust_linux_x86_64", -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:x86_64", -- "@platforms//os:linux", -- ], -- target_triple = "x86_64-unknown-linux-musl", --) -- --# -> linux arm (musl) --rust.repository_set( -- name = "rust_linux_x86_64", -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:arm64", -- "@platforms//os:linux", -- ], -- target_triple = "aarch64-unknown-linux-musl", --) -- --# -> darwin x86 --rust.repository_set( -- name = "rust_linux_x86_64", -- target_compatible_with = [ -- "@platforms//cpu:x86_64", -- "@platforms//os:macos", -- ], -- target_triple = "x86_64-apple-darwin", --) -- --# -> darwin arm --rust.repository_set( -- name = "rust_linux_x86_64", -- target_compatible_with = [ -- "@platforms//cpu:arm64", -- "@platforms//os:macos", -- ], -- target_triple = "aarch64-apple-darwin", --) -- --# Execution platform : linux arm (aarch64-unknown-linux-gnu) --# -> linux arm (gnu) --rust.repository_set( -- name = "rust_linux_aarch64", -- edition = RUST_EDITION, # "edition" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) -- exec_triple = "aarch64-unknown-linux-gnu", # "exec_triple" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:aarch64", -- "@platforms//os:linux", -- ], -- target_triple = "aarch64-unknown-linux-gnu", -- versions = [RUST_VERSION], # "versions" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) --) -- --# -> linux arm (musl) --rust.repository_set( -- name = "rust_linux_aarch64", -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:aarch64", -- "@platforms//os:linux", -- ], -- target_triple = "aarch64-unknown-linux-musl", --) -- --# Execution platform : darwin x86 (x86_64-apple-darwin) --# -> linux x86 (musl) --rust.repository_set( -- name = "rust_darwin_x86_64", -- edition = RUST_EDITION, # "edition" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) -- exec_triple = "x86_64-apple-darwin", # "exec_triple" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:x86_64", -- "@platforms//os:linux", -- ], -- target_triple = "x86_64-unknown-linux-musl", -- versions = [RUST_VERSION], # "versions" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) --) -- --# -> linux arm (musl) --rust.repository_set( -- name = "rust_darwin_x86_64", -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:arm64", -- "@platforms//os:linux", -- ], -- target_triple = "aarch64-unknown-linux-musl", --) -- --# -> darwin x86 --rust.repository_set( -- name = "rust_darwin_x86_64", -- target_compatible_with = [ -- "@platforms//cpu:x86_64", -- "@platforms//os:macos", -- ], -- target_triple = "x86_64-apple-darwin", --) -- --# -> darwin arm --rust.repository_set( -- name = "rust_darwin_x86_64", -- target_compatible_with = [ -- "@platforms//cpu:arm64", -- "@platforms//os:macos", -- ], -- target_triple = "aarch64-apple-darwin", --) -- --# Execution platform : darwin arm (aarch64-apple-darwin) --# -> linux x86 (musl) --rust.repository_set( -- name = "rust_darwin_aarch64", -- edition = RUST_EDITION, # "edition" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) -- exec_triple = "aarch64-apple-darwin", # "exec_triple" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:x86_64", -- "@platforms//os:linux", -- ], -- target_triple = "x86_64-unknown-linux-musl", -- versions = [RUST_VERSION], # "versions" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) --) -- --# -> linux arm (musl) --rust.repository_set( -- name = "rust_darwin_aarch64", -- target_compatible_with = [ -- "//bazel/platforms/linkers:unknown", -- "@platforms//cpu:arm64", -- "@platforms//os:linux", -- ], -- target_triple = "aarch64-unknown-linux-musl", --) -- --# -> darwin x86 --rust.repository_set( -- name = "rust_darwin_aarch64", -- target_compatible_with = [ -- "@platforms//cpu:x86_64", -- "@platforms//os:macos", +-rust.toolchain( +- edition = "2024", +- versions = ["1.88.0"], +- extra_target_triples = [ +- "aarch64-apple-darwin", +- "x86_64-apple-darwin", +- "aarch64-unknown-linux-musl", +- "x86_64-unknown-linux-musl", - ], -- target_triple = "x86_64-apple-darwin", -) - --# -> darwin arm --rust.repository_set( -- name = "rust_darwin_aarch64", -- target_compatible_with = [ -- "@platforms//cpu:arm64", -- "@platforms//os:macos", -- ], -- target_triple = "aarch64-apple-darwin", --) -use_repo(rust, "rust_toolchains") - -register_toolchains("@rust_toolchains//:all") @@ -369,7 +85,7 @@ -bazel_dep(name = "xz", version = "5.4.5.bcr.5") -bazel_dep(name = "zstd", version = "1.5.7") -bazel_dep(name = "bzip2", version = "1.0.8.bcr.3") --bazel_dep(name = "rules_rs", version = "0.0.7") +-bazel_dep(name = "rules_rs", version = "0.0.16") - -crate = use_extension( - "@rules_rs//rs:extensions.bzl", @@ -381,9 +97,9 @@ - cargo_toml = "//:Cargo.toml", - platform_triples = [ - "aarch64-apple-darwin", -- "aarch64-unknown-linux-gnu", +- "aarch64-unknown-linux-musl", - "x86_64-apple-darwin", -- "x86_64-unknown-linux-gnu", +- "x86_64-unknown-linux-musl", - ], -) -crate.annotation( diff --git a/MODULE.bazel b/MODULE.bazel index 957ed25b..0fe76b03 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -19,6 +19,13 @@ bazel_dep(name = "tar.bzl", version = "0.5.5") bazel_lib_toolchains = use_extension("@tar.bzl//tar:extensions.bzl", "toolchains") use_repo(bazel_lib_toolchains, "bsd_tar_toolchains") +single_version_override( + module_name = "rules_cc", + patch_strip = 1, + patches = ["//bazel/patches:rules_cc_visibility.patch"], + version = "0.2.11", +) + tools = use_extension("//py:extensions.bzl", "py_tools") tools.rules_py_tools() use_repo(tools, "rules_py_tools") @@ -83,326 +90,41 @@ use_repo(tel, "aspect_tools_telemetry_report") # from bazel/include/llvm.MODULE.bazel # LLVM configuration -bazel_dep(name = "toolchains_llvm", version = "1.4.0") -single_version_override( - module_name = "toolchains_llvm", +bazel_dep(name = "toolchains_llvm_bootstrapped", version = "0.2.5", dev_dependency = True) +archive_override( + module_name = "toolchains_llvm_bootstrapped", + integrity = "sha256-+nddimV34BYO8YExiKLYG2kMoA2Sv+5ZoMRPQLJxNfE=", patch_strip = 1, patches = [ - "//bazel/patches:toolchains_llvm.patch", + "//bazel/patches:llvm_darwin_sysroot.patch", ], + strip_prefix = "toolchains_llvm_bootstrapped-121c8419394e76b5652c161369743c564799b2e3", + urls = ["https://github.com/cerisier/toolchains_llvm_bootstrapped/archive/121c8419394e76b5652c161369743c564799b2e3/master.tar.gz"], ) -llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) - -execution_oses = [ - "macos", - "linux", -] - -execution_cpus = [ - "aarch64", - "x86_64", -] - -[ - [ - llvm.toolchain( - name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), - exec_arch = exec_cpu, - exec_os = exec_os if exec_os != "macos" else "darwin", - llvm_version = "20.1.2", - ), - llvm.sysroot( - name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), - label = "@org_chromium_sysroot_linux_x86_64//:sysroot", - targets = ["linux-x86_64"], - ), - llvm.sysroot( - name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), - label = "@org_chromium_sysroot_linux_arm64//:sysroot", - targets = ["linux-aarch64"], - ), - llvm.sysroot( - name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), - label = "@sysroot_darwin_universal//:sysroot", - targets = [ - "darwin-aarch64", - "darwin-x86_64", - ], - ), - use_repo(llvm, "llvm_toolchain_{}_{}".format(exec_os, exec_cpu)), - ] - for exec_os in execution_oses - for exec_cpu in execution_cpus -] - -http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -_SYSROOT_LINUX_BUILD_FILE = """\ -filegroup( - name = "sysroot", - srcs = glob(["*/**"]), - visibility = ["//visibility:public"], -) -""" - -http_archive( - name = "org_chromium_sysroot_linux_arm64", - build_file_content = _SYSROOT_LINUX_BUILD_FILE, - sha256 = "b199942a0bd9c34800e8d7b669778ef45f2054b9f106039439383dd66efcef31", - urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_arm64_sysroot.tar.xz"], -) - -http_archive( - name = "org_chromium_sysroot_linux_x86_64", - build_file_content = _SYSROOT_LINUX_BUILD_FILE, - sha256 = "b279dd2926e7d3860bb4e134997a45df5106f680e160a959b945580ba4ec755f", - urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_amd64_sysroot.tar.xz"], -) - -http_archive( - name = "sysroot_darwin_universal", - build_file_content = """ -filegroup( - name = "sysroot", - srcs = glob( - include = ["**"], - exclude = ["**/*:*"], - ), - visibility = ["//visibility:public"], -) -""", - integrity = "sha256-9qzGIJ251Wtn/K+R7B3v5Ici6esT3CH7kc/s6xSJ5X4=", - # The ruby header has an infinite symlink that we need to remove. - patch_cmds = ["rm System/Library/Frameworks/Ruby.framework/Versions/Current/Headers/ruby/ruby"], - strip_prefix = "MacOSX14.5.sdk", - urls = ["https://github.com/alexey-lysiuk/macos-sdk/releases/download/14.5/MacOSX14.5.tar.xz"], +register_toolchains( + "@toolchains_llvm_bootstrapped//toolchain:all", ) -target_oses = [ - "macos", - "linux", -] - -target_cpus = [ - "aarch64", - "x86_64", -] - -platforms = [ - { - "exec_os": exec_os, - "exec_cpu": exec_cpu, - "tgt_os": tgt_os, - "tgt_cpu": tgt_cpu, - } - for exec_os in execution_oses - for exec_cpu in execution_cpus - for tgt_os in target_oses - for tgt_cpu in target_cpus -] - -[register_toolchains("//bazel/platforms/toolchains:{}_{}_{}_{}_llvm".format( - p["exec_os"], - p["exec_cpu"], - p["tgt_os"], - p["tgt_cpu"], -)) for p in platforms] - ######################################## # from bazel/include/rust.MODULE.bazel # Rust configuration -bazel_dep(name = "rules_rust", version = "0.67.0") - -RUST_EDITION = "2024" - -RUST_VERSION = "1.88.0" +bazel_dep(name = "rules_rust", version = "0.68.1") rust = use_extension( "@rules_rust//rust:extensions.bzl", "rust", ) - -# These override the default rust_repository_sets created by rust_register_toolchain. They must be named exactly as follows. -# NB: The first call for a particular name may set the `edition`, `exec_triple`, and `versions` attributes, the subsequent calls should not set it or else Bazel will fail with, -# "Error in fail: You must only set edition on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" -# "Error in fail: You must only set exec_triple on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" -# "Error in fail: You must only set versions on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" - -# Execution platform : linux x86 (x86_64-unknown-linux-gnu) -# -> linux x86_64 (gnu) -rust.repository_set( - name = "rust_linux_x86_64", - edition = RUST_EDITION, # "edition" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) - exec_triple = "x86_64-unknown-linux-gnu", # "exec_triple" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_triple = "x86_64-unknown-linux-gnu", - versions = [RUST_VERSION], # "versions" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) -) - -# -> linux x86_64 (musl) -rust.repository_set( - name = "rust_linux_x86_64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_triple = "x86_64-unknown-linux-musl", -) - -# -> linux arm (musl) -rust.repository_set( - name = "rust_linux_x86_64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:arm64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-musl", -) - -# -> darwin x86 -rust.repository_set( - name = "rust_linux_x86_64", - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:macos", - ], - target_triple = "x86_64-apple-darwin", -) - -# -> darwin arm -rust.repository_set( - name = "rust_linux_x86_64", - target_compatible_with = [ - "@platforms//cpu:arm64", - "@platforms//os:macos", - ], - target_triple = "aarch64-apple-darwin", -) - -# Execution platform : linux arm (aarch64-unknown-linux-gnu) -# -> linux arm (gnu) -rust.repository_set( - name = "rust_linux_aarch64", - edition = RUST_EDITION, # "edition" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) - exec_triple = "aarch64-unknown-linux-gnu", # "exec_triple" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:aarch64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-gnu", - versions = [RUST_VERSION], # "versions" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) -) - -# -> linux arm (musl) -rust.repository_set( - name = "rust_linux_aarch64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:aarch64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-musl", -) - -# Execution platform : darwin x86 (x86_64-apple-darwin) -# -> linux x86 (musl) -rust.repository_set( - name = "rust_darwin_x86_64", - edition = RUST_EDITION, # "edition" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) - exec_triple = "x86_64-apple-darwin", # "exec_triple" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_triple = "x86_64-unknown-linux-musl", - versions = [RUST_VERSION], # "versions" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) -) - -# -> linux arm (musl) -rust.repository_set( - name = "rust_darwin_x86_64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:arm64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-musl", -) - -# -> darwin x86 -rust.repository_set( - name = "rust_darwin_x86_64", - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:macos", - ], - target_triple = "x86_64-apple-darwin", -) - -# -> darwin arm -rust.repository_set( - name = "rust_darwin_x86_64", - target_compatible_with = [ - "@platforms//cpu:arm64", - "@platforms//os:macos", - ], - target_triple = "aarch64-apple-darwin", -) - -# Execution platform : darwin arm (aarch64-apple-darwin) -# -> linux x86 (musl) -rust.repository_set( - name = "rust_darwin_aarch64", - edition = RUST_EDITION, # "edition" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) - exec_triple = "aarch64-apple-darwin", # "exec_triple" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_triple = "x86_64-unknown-linux-musl", - versions = [RUST_VERSION], # "versions" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) -) - -# -> linux arm (musl) -rust.repository_set( - name = "rust_darwin_aarch64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:arm64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-musl", -) - -# -> darwin x86 -rust.repository_set( - name = "rust_darwin_aarch64", - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:macos", - ], - target_triple = "x86_64-apple-darwin", -) - -# -> darwin arm -rust.repository_set( - name = "rust_darwin_aarch64", - target_compatible_with = [ - "@platforms//cpu:arm64", - "@platforms//os:macos", +rust.toolchain( + edition = "2024", + extra_target_triples = [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "aarch64-unknown-linux-musl", + "x86_64-unknown-linux-musl", ], - target_triple = "aarch64-apple-darwin", + versions = ["1.88.0"], ) use_repo(rust, "rust_toolchains") @@ -416,7 +138,7 @@ register_toolchains("@rust_toolchains//:all") bazel_dep(name = "xz", version = "5.4.5.bcr.5") bazel_dep(name = "zstd", version = "1.5.7") bazel_dep(name = "bzip2", version = "1.0.8.bcr.3") -bazel_dep(name = "rules_rs", version = "0.0.7") +bazel_dep(name = "rules_rs", version = "0.0.16") crate = use_extension( "@rules_rs//rs:extensions.bzl", @@ -428,9 +150,9 @@ crate.from_cargo( cargo_toml = "//:Cargo.toml", platform_triples = [ "aarch64-apple-darwin", - "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", "x86_64-apple-darwin", - "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", ], ) crate.annotation( diff --git a/bazel/include/cargo.MODULE.bazel b/bazel/include/cargo.MODULE.bazel index 6de9e851..50a63450 100644 --- a/bazel/include/cargo.MODULE.bazel +++ b/bazel/include/cargo.MODULE.bazel @@ -4,7 +4,7 @@ bazel_dep(name = "xz", version = "5.4.5.bcr.5") bazel_dep(name = "zstd", version = "1.5.7") bazel_dep(name = "bzip2", version = "1.0.8.bcr.3") -bazel_dep(name = "rules_rs", version = "0.0.7") +bazel_dep(name = "rules_rs", version = "0.0.16") crate = use_extension( "@rules_rs//rs:extensions.bzl", @@ -16,9 +16,9 @@ crate.from_cargo( cargo_toml = "//:Cargo.toml", platform_triples = [ "aarch64-apple-darwin", - "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", "x86_64-apple-darwin", - "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", ], ) crate.annotation( diff --git a/bazel/include/e2e.MODULE.bazel b/bazel/include/e2e.MODULE.bazel index 6b05bf45..dd3833e5 100644 --- a/bazel/include/e2e.MODULE.bazel +++ b/bazel/include/e2e.MODULE.bazel @@ -1,6 +1,5 @@ # FIXME: These are really the prod deps. Should be includeable. bazel_dep(name = "bazel_features", version = "1.38.0") -bazel_dep(name = "aspect_bazel_lib", version = "2.21.2") bazel_dep(name = "bazel_skylib", version = "1.4.2") bazel_dep(name = "bazel_lib", version = "3.0.0") bazel_dep(name = "platforms", version = "1.0.0") diff --git a/bazel/include/llvm.MODULE.bazel b/bazel/include/llvm.MODULE.bazel index 85c54bae..3f74fada 100644 --- a/bazel/include/llvm.MODULE.bazel +++ b/bazel/include/llvm.MODULE.bazel @@ -1,127 +1,17 @@ # LLVM configuration -bazel_dep(name = "toolchains_llvm", version = "1.4.0") -single_version_override( - module_name = "toolchains_llvm", +bazel_dep(name = "toolchains_llvm_bootstrapped", version = "0.2.5", dev_dependency = True) +archive_override( + module_name = "toolchains_llvm_bootstrapped", + integrity = "sha256-+nddimV34BYO8YExiKLYG2kMoA2Sv+5ZoMRPQLJxNfE=", patch_strip = 1, patches = [ - "//bazel/patches:toolchains_llvm.patch", + "//bazel/patches:llvm_darwin_sysroot.patch", ], + strip_prefix = "toolchains_llvm_bootstrapped-121c8419394e76b5652c161369743c564799b2e3", + urls = ["https://github.com/cerisier/toolchains_llvm_bootstrapped/archive/121c8419394e76b5652c161369743c564799b2e3/master.tar.gz"], ) -llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True) - -execution_oses = [ - "macos", - "linux", -] - -execution_cpus = [ - "aarch64", - "x86_64", -] - -[ - [ - llvm.toolchain( - name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), - exec_arch = exec_cpu, - exec_os = exec_os if exec_os != "macos" else "darwin", - llvm_version = "20.1.2", - ), - llvm.sysroot( - name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), - label = "@org_chromium_sysroot_linux_x86_64//:sysroot", - targets = ["linux-x86_64"], - ), - llvm.sysroot( - name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), - label = "@org_chromium_sysroot_linux_arm64//:sysroot", - targets = ["linux-aarch64"], - ), - llvm.sysroot( - name = "llvm_toolchain_{}_{}".format(exec_os, exec_cpu), - label = "@sysroot_darwin_universal//:sysroot", - targets = [ - "darwin-aarch64", - "darwin-x86_64", - ], - ), - use_repo(llvm, "llvm_toolchain_{}_{}".format(exec_os, exec_cpu)), - ] - for exec_os in execution_oses - for exec_cpu in execution_cpus -] - -http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -_SYSROOT_LINUX_BUILD_FILE = """\ -filegroup( - name = "sysroot", - srcs = glob(["*/**"]), - visibility = ["//visibility:public"], -) -""" - -http_archive( - name = "org_chromium_sysroot_linux_arm64", - build_file_content = _SYSROOT_LINUX_BUILD_FILE, - sha256 = "b199942a0bd9c34800e8d7b669778ef45f2054b9f106039439383dd66efcef31", - urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_arm64_sysroot.tar.xz"], -) - -http_archive( - name = "org_chromium_sysroot_linux_x86_64", - build_file_content = _SYSROOT_LINUX_BUILD_FILE, - sha256 = "b279dd2926e7d3860bb4e134997a45df5106f680e160a959b945580ba4ec755f", - urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_amd64_sysroot.tar.xz"], -) - -http_archive( - name = "sysroot_darwin_universal", - build_file_content = """ -filegroup( - name = "sysroot", - srcs = glob( - include = ["**"], - exclude = ["**/*:*"], - ), - visibility = ["//visibility:public"], -) -""", - integrity = "sha256-9qzGIJ251Wtn/K+R7B3v5Ici6esT3CH7kc/s6xSJ5X4=", - # The ruby header has an infinite symlink that we need to remove. - patch_cmds = ["rm System/Library/Frameworks/Ruby.framework/Versions/Current/Headers/ruby/ruby"], - strip_prefix = "MacOSX14.5.sdk", - urls = ["https://github.com/alexey-lysiuk/macos-sdk/releases/download/14.5/MacOSX14.5.tar.xz"], +register_toolchains( + "@toolchains_llvm_bootstrapped//toolchain:all", ) - -target_oses = [ - "macos", - "linux", -] - -target_cpus = [ - "aarch64", - "x86_64", -] - -platforms = [ - { - "exec_os": exec_os, - "exec_cpu": exec_cpu, - "tgt_os": tgt_os, - "tgt_cpu": tgt_cpu, - } - for exec_os in execution_oses - for exec_cpu in execution_cpus - for tgt_os in target_oses - for tgt_cpu in target_cpus -] - -[register_toolchains("//bazel/platforms/toolchains:{}_{}_{}_{}_llvm".format( - p["exec_os"], - p["exec_cpu"], - p["tgt_os"], - p["tgt_cpu"], -)) for p in platforms] diff --git a/bazel/include/rust.MODULE.bazel b/bazel/include/rust.MODULE.bazel index 09c7de30..3a20dc51 100644 --- a/bazel/include/rust.MODULE.bazel +++ b/bazel/include/rust.MODULE.bazel @@ -1,195 +1,20 @@ # Rust configuration -bazel_dep(name = "rules_rust", version = "0.67.0") - -RUST_EDITION = "2024" - -RUST_VERSION = "1.88.0" +bazel_dep(name = "rules_rust", version = "0.68.1") rust = use_extension( "@rules_rust//rust:extensions.bzl", "rust", ) - -# These override the default rust_repository_sets created by rust_register_toolchain. They must be named exactly as follows. -# NB: The first call for a particular name may set the `edition`, `exec_triple`, and `versions` attributes, the subsequent calls should not set it or else Bazel will fail with, -# "Error in fail: You must only set edition on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" -# "Error in fail: You must only set exec_triple on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" -# "Error in fail: You must only set versions on the first call to repository_set for a particular name but it was set multiple times for rust_linux_x86_64" - -# Execution platform : linux x86 (x86_64-unknown-linux-gnu) -# -> linux x86_64 (gnu) -rust.repository_set( - name = "rust_linux_x86_64", - edition = RUST_EDITION, # "edition" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) - exec_triple = "x86_64-unknown-linux-gnu", # "exec_triple" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_triple = "x86_64-unknown-linux-gnu", - versions = [RUST_VERSION], # "versions" only set in first instance of "rust_linux_x86_64" repository_set (see comment above) -) - -# -> linux x86_64 (musl) -rust.repository_set( - name = "rust_linux_x86_64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_triple = "x86_64-unknown-linux-musl", -) - -# -> linux arm (musl) -rust.repository_set( - name = "rust_linux_x86_64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:arm64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-musl", -) - -# -> darwin x86 -rust.repository_set( - name = "rust_linux_x86_64", - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:macos", - ], - target_triple = "x86_64-apple-darwin", -) - -# -> darwin arm -rust.repository_set( - name = "rust_linux_x86_64", - target_compatible_with = [ - "@platforms//cpu:arm64", - "@platforms//os:macos", - ], - target_triple = "aarch64-apple-darwin", -) - -# Execution platform : linux arm (aarch64-unknown-linux-gnu) -# -> linux arm (gnu) -rust.repository_set( - name = "rust_linux_aarch64", - edition = RUST_EDITION, # "edition" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) - exec_triple = "aarch64-unknown-linux-gnu", # "exec_triple" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:aarch64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-gnu", - versions = [RUST_VERSION], # "versions" only set in first instance of "rust_linux_aarch64" repository_set (see comment above) -) - -# -> linux arm (musl) -rust.repository_set( - name = "rust_linux_aarch64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:aarch64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-musl", -) - -# Execution platform : darwin x86 (x86_64-apple-darwin) -# -> linux x86 (musl) -rust.repository_set( - name = "rust_darwin_x86_64", - edition = RUST_EDITION, # "edition" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) - exec_triple = "x86_64-apple-darwin", # "exec_triple" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_triple = "x86_64-unknown-linux-musl", - versions = [RUST_VERSION], # "versions" only set in first instance of "rust_darwin_x86_64" repository_set (see comment above) -) - -# -> linux arm (musl) -rust.repository_set( - name = "rust_darwin_x86_64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:arm64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-musl", -) - -# -> darwin x86 -rust.repository_set( - name = "rust_darwin_x86_64", - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:macos", - ], - target_triple = "x86_64-apple-darwin", -) - -# -> darwin arm -rust.repository_set( - name = "rust_darwin_x86_64", - target_compatible_with = [ - "@platforms//cpu:arm64", - "@platforms//os:macos", - ], - target_triple = "aarch64-apple-darwin", -) - -# Execution platform : darwin arm (aarch64-apple-darwin) -# -> linux x86 (musl) -rust.repository_set( - name = "rust_darwin_aarch64", - edition = RUST_EDITION, # "edition" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) - exec_triple = "aarch64-apple-darwin", # "exec_triple" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:x86_64", - "@platforms//os:linux", - ], - target_triple = "x86_64-unknown-linux-musl", - versions = [RUST_VERSION], # "versions" only set in first instance of "rust_darwin_aarch64" repository_set (see comment above) -) - -# -> linux arm (musl) -rust.repository_set( - name = "rust_darwin_aarch64", - target_compatible_with = [ - "//bazel/platforms/linkers:unknown", - "@platforms//cpu:arm64", - "@platforms//os:linux", - ], - target_triple = "aarch64-unknown-linux-musl", -) - -# -> darwin x86 -rust.repository_set( - name = "rust_darwin_aarch64", - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:macos", - ], - target_triple = "x86_64-apple-darwin", -) - -# -> darwin arm -rust.repository_set( - name = "rust_darwin_aarch64", - target_compatible_with = [ - "@platforms//cpu:arm64", - "@platforms//os:macos", +rust.toolchain( + edition = "2024", + extra_target_triples = [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "aarch64-unknown-linux-musl", + "x86_64-unknown-linux-musl", ], - target_triple = "aarch64-apple-darwin", + versions = ["1.88.0"], ) use_repo(rust, "rust_toolchains") diff --git a/bazel/patches/llvm_darwin_sysroot.patch b/bazel/patches/llvm_darwin_sysroot.patch new file mode 100644 index 00000000..45c6170b --- /dev/null +++ b/bazel/patches/llvm_darwin_sysroot.patch @@ -0,0 +1,27 @@ +diff --git a/MODULE.bazel b/MODULE.bazel +index b631904..31042c1 100644 +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -103,18 +103,12 @@ use_repo(musl, "musl_libc") + mingw = use_extension("//runtimes/mingw/extension:mingw.bzl", "mingw") + use_repo(mingw, "mingw") + +-http_pkg_archive = use_repo_rule("//:http_pkg_archive.bzl", "http_pkg_archive") +- +-http_pkg_archive( ++http_archive( + name = "macosx15.4.sdk", ++ urls = ["https://github.com/hexops-graveyard/sdk-macos-11.3/archive/ccbaae84cc39469a6792108b24480a4806e09d59.tar.gz"], ++ integrity = "sha256-EYcKSj04K3g0mGEIEmSSG7iDRAp+Cz3UoAc3PYcySjg=", + build_file = "//third_party/macosx.sdk:BUILD.MacOSX15.4.sdk.tpl", +- sha256 = "ba3453d62b3d2babf67f3a4a44e8073d6555c85f114856f4390a1f53bd76e24a", +- strip_files = [ +- "Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk/System/Library/Frameworks/Ruby.framework/Versions/Current/Headers/ruby", +- ], +- strip_prefix = "Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk", +- # urls = ["https://swcdn.apple.com/content/downloads/10/32/082-12052-A_AHPGDY76PT/1a419zaf3vh8o9t3c0usblyr8eystpnsh5/CLTools_macOSNMOS_SDK.pkg"], +- urls = ["https://swcdn.apple.com/content/downloads/52/01/082-41241-A_0747ZN8FHV/dectd075r63pppkkzsb75qk61s0lfee22j/CLTools_macOSNMOS_SDK.pkg"], ++ strip_prefix = "sdk-macos-11.3-ccbaae84cc39469a6792108b24480a4806e09d59/root", + ) + + glibc = use_extension("//runtimes/glibc/extension:glibc.bzl", "glibc") diff --git a/bazel/patches/rules_cc_visibility.patch b/bazel/patches/rules_cc_visibility.patch new file mode 100644 index 00000000..6ac37aea --- /dev/null +++ b/bazel/patches/rules_cc_visibility.patch @@ -0,0 +1,12 @@ +diff --git a/cc/toolchains/args/archiver_flags/BUILD b/cc/toolchains/args/archiver_flags/BUILD +index 1d4f6c5..860ef16 100644 +--- a/cc/toolchains/args/archiver_flags/BUILD ++++ b/cc/toolchains/args/archiver_flags/BUILD +@@ -14,6 +14,7 @@ config_setting( + name = "use_libtool_on_macos_setting", + constraint_values = ["@platforms//os:macos"], + flag_values = {":use_libtool_on_macos": "true"}, ++ visibility = ["//visibility:public"], + ) + + cc_feature( diff --git a/bazel/patches/toolchains_llvm.patch b/bazel/patches/toolchains_llvm.patch deleted file mode 100644 index 8211a1cd..00000000 --- a/bazel/patches/toolchains_llvm.patch +++ /dev/null @@ -1,88 +0,0 @@ -diff --git a/toolchain/cc_toolchain_config.bzl b/toolchain/cc_toolchain_config.bzl -index 3a66da7..3f5acc4 100644 ---- a/toolchain/cc_toolchain_config.bzl -+++ b/toolchain/cc_toolchain_config.bzl -@@ -192,11 +192,18 @@ def cc_toolchain_config( - archive_flags = [] - - # Linker flags: -- if exec_os == "darwin" and not is_xcompile: -- # lld is experimental for Mach-O, so we use the native ld64 linker. -- # TODO: How do we cross-compile from Linux to Darwin? -- use_lld = False -+ ld = "ld.lld" -+ if target_os == "darwin": -+ use_lld = True -+ -+ ld = "ld64.lld" -+ ld_path = toolchain_path_prefix + "/bin/" + ld -+ compile_flags.append("-mmacosx-version-min=12.0") -+ - link_flags.extend([ -+ "-mmacosx-version-min=12.0", -+ "-Wl,-platform_version,macos,12.0,12.0", -+ "--ld-path=" + ld_path, - "-headerpad_max_install_names", - "-fobjc-link-runtime", - ]) -@@ -219,7 +226,9 @@ def cc_toolchain_config( - # not an option because it is not a cross-linker, so lld is the - # only option. - use_lld = True -+ ld_path = toolchain_path_prefix + "/bin/" + ld - link_flags.extend([ -+ "--ld-path=" + ld_path, - "-fuse-ld=lld", - "-Wl,--build-id=md5", - "-Wl,--hash-style=gnu", -@@ -252,10 +261,6 @@ def cc_toolchain_config( - if use_lld: - # For single-platform builds, we can statically link the bundled - # libraries. -- link_flags.extend([ -- "-l:libc++.a", -- "-l:libc++abi.a", -- ]) - compiler_rt_link_flags = ["-rtlib=compiler-rt"] - libunwind_link_flags = [ - "-l:libunwind.a", -@@ -306,10 +311,6 @@ def cc_toolchain_config( - "-std=" + cxx_standard, - "-stdlib=libstdc++", - ] -- -- link_flags.extend([ -- "-l:libstdc++.a", -- ]) - elif stdlib == "libc": - cxx_flags = [ - "-std=" + cxx_standard, -@@ -347,7 +348,7 @@ def cc_toolchain_config( - "dwp": tools_path_prefix + "llvm-dwp", - "gcc": wrapper_bin_prefix + "cc_wrapper.sh", - "gcov": tools_path_prefix + "llvm-profdata", -- "ld": tools_path_prefix + "ld.lld" if use_lld else "/usr/bin/ld", -+ "ld": tools_path_prefix + ld if use_lld else "/usr/bin/ld", - "llvm-cov": tools_path_prefix + "llvm-cov", - "llvm-profdata": tools_path_prefix + "llvm-profdata", - "nm": tools_path_prefix + "llvm-nm", -diff --git a/toolchain/internal/common.bzl b/toolchain/internal/common.bzl -index b5d8e57..7da2734 100644 ---- a/toolchain/internal/common.bzl -+++ b/toolchain/internal/common.bzl -@@ -34,6 +34,7 @@ _toolchain_tools = { - "clang-tidy", - "clangd", - "ld.lld", -+ "ld64.lld", - "llvm-ar", - "llvm-dwp", - "llvm-profdata", -@@ -251,6 +252,5 @@ def attr_dict(attr): - - def toolchain_tools(os): - tools = dict(_toolchain_tools) -- if os == "darwin": -- tools.update(_toolchain_tools_darwin) -+ tools.update(_toolchain_tools_darwin) - return tools diff --git a/bazel/platforms/BUILD.bazel b/bazel/platforms/BUILD.bazel index edafb2c5..67469d7a 100644 --- a/bazel/platforms/BUILD.bazel +++ b/bazel/platforms/BUILD.bazel @@ -28,3 +28,16 @@ alias( actual = ":linux_aarch64", visibility = ["//visibility:public"], ) + +platform( + name = "rbe", + constraint_values = [ + "@platforms//cpu:x86_64", + "@platforms//os:linux", + "@bazel_tools//tools/cpp:clang", + ], + exec_properties = { + "container-image": "docker://ubuntu:22.04", + "OSFamily": "Linux", + }, +) diff --git a/bazel/rust/multi_platform_rust_binaries.bzl b/bazel/rust/multi_platform_rust_binaries.bzl index bd0e69d6..a124fbe9 100644 --- a/bazel/rust/multi_platform_rust_binaries.bzl +++ b/bazel/rust/multi_platform_rust_binaries.bzl @@ -7,8 +7,8 @@ load("@rules_pkg//pkg:pkg.bzl", "pkg_tar", "pkg_zip") load("//bazel/release:hashes.bzl", "hashes") TARGET_TRIPLES = [ - ("x86_64_unknown_linux_gnu", "linux_x86_64"), - ("aarch64_unknown_linux_gnu", "linux_aarch64"), + ("x86_64_unknown_linux_musl", "linux_x86_64"), + ("aarch64_unknown_linux_musl", "linux_aarch64"), ("x86_64_apple_darwin", "macos_x86_64"), ("aarch64_apple_darwin", "macos_aarch64"), ] diff --git a/e2e/cases/interpreter-version-541/BUILD.bazel b/e2e/cases/interpreter-version-541/BUILD.bazel index cc647601..5d53cb5d 100644 --- a/e2e/cases/interpreter-version-541/BUILD.bazel +++ b/e2e/cases/interpreter-version-541/BUILD.bazel @@ -1,6 +1,6 @@ -load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template") load("@aspect_rules_py//py:defs.bzl", "py_test") load("@aspect_rules_py//py/unstable:defs.bzl", "py_venv_test") +load("@bazel_lib//lib:expand_template.bzl", "expand_template") [ [ diff --git a/e2e/cases/uv-deps-650/crossbuild/BUILD.bazel b/e2e/cases/uv-deps-650/crossbuild/BUILD.bazel index 03cab11a..7fb83e49 100644 --- a/e2e/cases/uv-deps-650/crossbuild/BUILD.bazel +++ b/e2e/cases/uv-deps-650/crossbuild/BUILD.bazel @@ -1,7 +1,7 @@ -load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") load("@aspect_rules_py//py:defs.bzl", "py_image_layer") load("@aspect_rules_py//py/tests/py_image_layer:asserts.bzl", "assert_tar_listing") load("@aspect_rules_py//py/unstable:defs.bzl", "py_venv_binary") +load("@bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index") platform( diff --git a/py/tests/py_venv_image_layer/my_app_amd64_layers_listing.yaml b/py/tests/py_venv_image_layer/my_app_amd64_layers_listing.yaml index 469cf47e..dc8c3c57 100644 --- a/py/tests/py_venv_image_layer/my_app_amd64_layers_listing.yaml +++ b/py/tests/py_venv_image_layer/my_app_amd64_layers_listing.yaml @@ -2521,9 +2521,9 @@ files: - drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/ - drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/ - -rwxr-xr-x 0 0 0 2503 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/activate - - -rwxr-xr-x 0 0 0 799896 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python - - -rwxr-xr-x 0 0 0 799896 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python3 - - -rwxr-xr-x 0 0 0 799896 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python3.9 + - -rwxr-xr-x 0 0 0 830912 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python + - -rwxr-xr-x 0 0 0 830912 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python3 + - -rwxr-xr-x 0 0 0 830912 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python3.9 - drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/lib/ - drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/ - -rwxr-xr-x 0 0 0 348 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/pyvenv.cfg diff --git a/py/tests/py_venv_image_layer/my_app_arm64_layers_listing.yaml b/py/tests/py_venv_image_layer/my_app_arm64_layers_listing.yaml index 90e9c70d..da5c7f2c 100644 --- a/py/tests/py_venv_image_layer/my_app_arm64_layers_listing.yaml +++ b/py/tests/py_venv_image_layer/my_app_arm64_layers_listing.yaml @@ -2502,9 +2502,9 @@ files: - drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/ - drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/ - -rwxr-xr-x 0 0 0 2503 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/activate - - -rwxr-xr-x 0 0 0 871208 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python - - -rwxr-xr-x 0 0 0 871208 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python3 - - -rwxr-xr-x 0 0 0 871208 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python3.9 + - -rwxr-xr-x 0 0 0 837744 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python + - -rwxr-xr-x 0 0 0 837744 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python3 + - -rwxr-xr-x 0 0 0 837744 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/bin/python3.9 - drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/lib/ - drwxr-xr-x 0 0 0 0 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/lib/python3.9/ - -rwxr-xr-x 0 0 0 349 Jan 1 2023 ./py/tests/py_venv_image_layer/my_app_bin.runfiles/_main/py/tests/py_venv_image_layer/.my_app_bin/pyvenv.cfg