Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Oct 2021 19:06:56 GMT
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 8abf3fd74456 - main - devel/bazel: fix build on powerpc*
Message-ID:  <202110121906.19CJ6uum020032@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8abf3fd74456a955857e83bb337184d62d27a90c

commit 8abf3fd74456a955857e83bb337184d62d27a90c
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2021-10-12 18:37:02 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2021-10-12 18:37:02 +0000

    devel/bazel: fix build on powerpc*
    
    bazel uses a bundled abseil. To build on powerpc*, abseil requires a trivial
    patch.
    
    In file included from external/com_google_absl/absl/base/internal/unscaledcycleclock.cc:27:
    /usr/include/sys/sysctl.h:1185:25: error: unknown type name 'u_int'
    int     sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
                                ^
    external/com_google_absl/absl/base/internal/unscaledcycleclock.cc:91:10: error: unknown type name 'once_flag'
      static once_flag init_timebase_frequency_once;
             ^
    external/com_google_absl/absl/base/internal/unscaledcycleclock.cc:93:18: error: no member named 'LowLevelCallOnce' in namespace 'absl::lts_2020_02_25::base_internal'
      base_internal::LowLevelCallOnce(&init_timebase_frequency_once, [&]() {
      ~~~~~~~~~~~~~~~^
    
    PR:     259056
    Approved by:    ehlig@linta.de (maintainer)
---
 devel/bazel/Makefile                                       |  5 +++++
 .../extra-patch-absl_base_internal_unscaledcycleclock.cc   | 14 ++++++++++++++
 devel/bazel/files/extra-patch-bazel_grpc__deps.bzl         | 10 ++++++++++
 devel/bazel/files/patch-WORKSPACE                          | 14 ++++++++++++++
 4 files changed, 43 insertions(+)

diff --git a/devel/bazel/Makefile b/devel/bazel/Makefile
index 4c28f2a03c49..834f332f1f40 100644
--- a/devel/bazel/Makefile
+++ b/devel/bazel/Makefile
@@ -49,6 +49,11 @@ FINALRC=	2
 EXTRA_PATCHES+=	${FILESDIR}/extra-i386_tools_cpp_BUILD.static.bsd
 .endif
 
+pre-patch:
+	@${CP} ${FILESDIR}/extra-patch-absl_base_internal_unscaledcycleclock.cc \
+		${FILESDIR}/extra-patch-bazel_grpc__deps.bzl \
+		${WRKSRC}/third_party/grpc/
+
 # Have the location of the system-wide rc file reside ${ETCDIR}.
 # Also adapt the sample file to disable persistent java workers as they
 # do not work reliably on FreeBSD.
diff --git a/devel/bazel/files/extra-patch-absl_base_internal_unscaledcycleclock.cc b/devel/bazel/files/extra-patch-absl_base_internal_unscaledcycleclock.cc
new file mode 100644
index 000000000000..d13abc1bd9de
--- /dev/null
+++ b/devel/bazel/files/extra-patch-absl_base_internal_unscaledcycleclock.cc
@@ -0,0 +1,14 @@
+--- absl/base/internal/unscaledcycleclock.cc.orig	2020-08-09 20:09:49 UTC
++++ absl/base/internal/unscaledcycleclock.cc
+@@ -24,8 +24,10 @@
+ #ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
+ #elif defined(__FreeBSD__)
+-#include <sys/sysctl.h>
++#include "absl/base/call_once.h"
+ #include <sys/types.h>
++#include <sys/sysctl.h>
++#include <threads.h>
+ #endif
+ #endif
+ 
diff --git a/devel/bazel/files/extra-patch-bazel_grpc__deps.bzl b/devel/bazel/files/extra-patch-bazel_grpc__deps.bzl
new file mode 100644
index 000000000000..b3a648e5ff2c
--- /dev/null
+++ b/devel/bazel/files/extra-patch-bazel_grpc__deps.bzl
@@ -0,0 +1,10 @@
+--- a/bazel/grpc_deps.bzl.orig	2021-10-11 15:54:07.083144000 +0200
++++ b/bazel/grpc_deps.bzl	2021-10-11 16:02:48.722952000 +0200
+@@ -239,6 +239,7 @@
+     if "com_google_absl" not in native.existing_rules():
+         http_archive(
+             name = "com_google_absl",
++            patches = ["//third_party/grpc:extra-patch-absl_base_internal_unscaledcycleclock.cc"],
+             sha256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a",
+             strip_prefix = "abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d",
+             urls = [
diff --git a/devel/bazel/files/patch-WORKSPACE b/devel/bazel/files/patch-WORKSPACE
new file mode 100644
index 000000000000..314316c3579d
--- /dev/null
+++ b/devel/bazel/files/patch-WORKSPACE
@@ -0,0 +1,14 @@
+--- WORKSPACE.orig	2021-10-11 09:54:26 UTC
++++ WORKSPACE
+@@ -1232,7 +1232,10 @@ register_toolchains("//src/main/res:empty_rc_toolchain
+ http_archive(
+     name = "com_github_grpc_grpc",
+     patch_args = ["-p1"],
+-    patches = ["//third_party/grpc:grpc_1.33.1.patch"],
++    patches = [
++	"//third_party/grpc:grpc_1.33.1.patch",
++	"//third_party/grpc:extra-patch-bazel_grpc__deps.bzl",
++    ],
+     sha256 = "58eaee5c0f1bd0b92ebe1fa0606ec8f14798500620e7444726afcaf65041cb63",
+     strip_prefix = "grpc-1.33.1",
+     urls = [



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110121906.19CJ6uum020032>