From e7430e66d6e51def2a88f0b66fdab62b0d9492c1 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Thu, 7 Sep 2023 11:36:01 -0700 Subject: [PATCH] [bazel] Fix disallowing dylibs on darwin (#1180) Since this bazel commit https://github.com/bazelbuild/bazel/commit/ec5553352f2f661d39ac4cf665dd9b3c779e614c building dylibs like the ones in this rule on darwin platforms has been unsupported. This feature is a default C++ toolchain feature to indicate this. In bazel 7.x these dylibs will fail to link if they are still built. As far as I can tell in the tests even if they are built they are never used on macOS. Co-authored-by: Adam Cozzette --- bazel/upb_proto_library.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl index 941249d17e..9c4f85be36 100644 --- a/bazel/upb_proto_library.bzl +++ b/bazel/upb_proto_library.bzl @@ -153,7 +153,7 @@ def _cc_library_func(ctx, name, hdrs, srcs, copts, includes, dep_ccinfos): cc_toolchain = toolchain, compilation_outputs = compilation_outputs, linking_contexts = linking_contexts, - disallow_dynamic_library = cc_common.is_enabled(feature_configuration = feature_configuration, feature_name = "targets_windows"), + disallow_dynamic_library = cc_common.is_enabled(feature_configuration = feature_configuration, feature_name = "targets_windows") or not cc_common.is_enabled(feature_configuration = feature_configuration, feature_name = "supports_dynamic_linker"), ) return CcInfo(