Skip to content

Commit

Permalink
ci: fix build issue on m1 (#33227)
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <[email protected]>
  • Loading branch information
zirain authored Mar 31, 2024
1 parent 80a9a12 commit 58bd2ef
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,13 @@ def _rules_ruby():
external_http_archive("rules_ruby")

def _foreign_cc_dependencies():
external_http_archive("rules_foreign_cc")
external_http_archive(
name = "rules_foreign_cc",
# This patch is needed to fix build on macos with xcode 15.3.
# remove this when https://github.com/bazelbuild/rules_foreign_cc/issues/1186 fixed.
patch_args = ["-p1"],
patches = ["@envoy//bazel:rules_foreign_cc.patch"],
)

def _com_github_maxmind_libmaxminddb():
external_http_archive(
Expand Down
25 changes: 25 additions & 0 deletions bazel/rules_foreign_cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/foreign_cc/built_tools/pkgconfig_build.bzl b/foreign_cc/built_tools/pkgconfig_build.bzl
index 64cb677..9a8c62c 100644
--- a/foreign_cc/built_tools/pkgconfig_build.bzl
+++ b/foreign_cc/built_tools/pkgconfig_build.bzl
@@ -9,6 +9,10 @@ load(
"built_tool_rule_impl",
)
load("//toolchains/native_tools:tool_access.bzl", "get_make_data")
+load(
+ "//foreign_cc/private/framework:platform.bzl",
+ "os_name",
+)

def _pkgconfig_tool_impl(ctx):
make_data = get_make_data(ctx)
@@ -18,6 +22,9 @@ def _pkgconfig_tool_impl(ctx):
"%s install" % make_data.path,
]

+ if os_name(ctx) == "macos":
+ script[0] = "CFLAGS=-Wno-int-conversion CXXFLAGS=-Wno-int-conversion ./configure --with-internal-glib --prefix=$$INSTALLDIR$$"
+
additional_tools = depset(transitive = [make_data.target.files])

return built_tool_rule_impl(

0 comments on commit 58bd2ef

Please sign in to comment.