From 9350d1f8f8f252aaa63ad4588a4102f3fb3a078b Mon Sep 17 00:00:00 2001 From: Kirill Timofeev Date: Sun, 16 Aug 2026 20:08:03 +0000 Subject: [PATCH] [build] Prepare workerd for explicit libc++ linkage Edgeworker now supplies libc++ through link_extra_libs. For "rust_" targets it is supplied via "@@//deps:rust_runtime". Also disable helloworld_compile_test for debug builds, because it doesn't work with $ORIGIN relative libc++.so RUNPATH. Release note: None --- BUILD.bazel | 1 + src/rust/cxx/BUILD.bazel | 2 ++ src/workerd/server/tests/compile-tests/BUILD.bazel | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/BUILD.bazel b/BUILD.bazel index 6acb6a77353..9fcd55d5f3e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -140,6 +140,7 @@ selects.config_setting_group( ":fast_build", ":opt_build", ], + visibility = ["//visibility:public"], ) selects.config_setting_group( diff --git a/src/rust/cxx/BUILD.bazel b/src/rust/cxx/BUILD.bazel index 65d1018afb6..c0894953e57 100644 --- a/src/rust/cxx/BUILD.bazel +++ b/src/rust/cxx/BUILD.bazel @@ -8,6 +8,7 @@ rust_library( link_deps = [ ":core", "//src/rust/cxx/third-party:runtime", + "@@//deps:rust_runtime", ], proc_macro_deps = [ ":cxxbridge-macro", @@ -82,6 +83,7 @@ rust_binary( srcs = glob(["gen/cmd/src/*.rs"]), compile_data = ["include/cxx.h"], edition = "2024", + link_deps = ["@@//deps:rust_runtime"], target_compatible_with = select({ "@//build/config:no_build": ["@platforms//:incompatible"], "//conditions:default": [], diff --git a/src/workerd/server/tests/compile-tests/BUILD.bazel b/src/workerd/server/tests/compile-tests/BUILD.bazel index 8434af9e65a..b4912386e3d 100644 --- a/src/workerd/server/tests/compile-tests/BUILD.bazel +++ b/src/workerd/server/tests/compile-tests/BUILD.bazel @@ -16,4 +16,8 @@ sh_test( "//src/workerd/server:workerd", ], tags = ["no-qemu"], + target_compatible_with = select({ + "//:not_dbg_build": [], + "//conditions:default": ["@platforms//:incompatible"], + }), )