summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-11-24 02:19:47 +0000
committerSam James <sam@gentoo.org>2021-11-24 02:19:47 +0000
commitac00d0d8ce29825d65b1ecfbb894e9d0310eedd3 (patch)
tree793f6af56b078835028e2cd59a59935dc2ce1692 /dev-util/bazel
parentdev-cpp/cpp-taskflow: add missing doctest test dependency; fix double KEYWORDS (diff)
downloadgentoo-ac00d0d8ce29825d65b1ecfbb894e9d0310eedd3.tar.gz
gentoo-ac00d0d8ce29825d65b1ecfbb894e9d0310eedd3.tar.bz2
gentoo-ac00d0d8ce29825d65b1ecfbb894e9d0310eedd3.zip
dev-util/bazel: add upstream musl patch
Closes: https://bugs.gentoo.org/815907 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/bazel')
-rw-r--r--dev-util/bazel/bazel-3.7.2-r1.ebuild1
-rw-r--r--dev-util/bazel/files/bazel-3.7.2-musl-temp-failure-retry.patch34
2 files changed, 35 insertions, 0 deletions
diff --git a/dev-util/bazel/bazel-3.7.2-r1.ebuild b/dev-util/bazel/bazel-3.7.2-r1.ebuild
index 2575046bfcb7..db3f1fbbb8c0 100644
--- a/dev-util/bazel/bazel-3.7.2-r1.ebuild
+++ b/dev-util/bazel/bazel-3.7.2-r1.ebuild
@@ -66,6 +66,7 @@ src_prepare() {
addpredict /proc
eapply "${FILESDIR}/${PN}-3.2.0-include-limits-for-gcc-11.patch"
+ eapply "${FILESDIR}/${PN}-3.7.2-musl-temp-failure-retry.patch"
}
src_compile() {
diff --git a/dev-util/bazel/files/bazel-3.7.2-musl-temp-failure-retry.patch b/dev-util/bazel/files/bazel-3.7.2-musl-temp-failure-retry.patch
new file mode 100644
index 000000000000..4c8648bb639f
--- /dev/null
+++ b/dev-util/bazel/files/bazel-3.7.2-musl-temp-failure-retry.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/815907
+https://github.com/bazelbuild/bazel/commit/bcce6dd026e90336e80616a8c1004a79a2f8640c
+
+From: philwo <philwo@google.com>
+Date: Thu, 20 May 2021 08:13:09 -0700
+Subject: [PATCH] Add the TEMP_FAILURE_RETRY macro to linux-sandbox-pid1.cc.
+
+This allows us to build Bazel on Linux systems which use a C standard library that does not include this macro, like Alpine Linux (which uses musl).
+
+Fixes #12460.
+
+PiperOrigin-RevId: 374873483
+--- a/src/main/tools/linux-sandbox-pid1.cc
++++ b/src/main/tools/linux-sandbox-pid1.cc
+@@ -49,6 +49,19 @@
+ #include <linux/fs.h>
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++// Some C standard libraries like musl do not define this macro, so we'll
++// include our own version for compatibility.
++#define TEMP_FAILURE_RETRY(exp) \
++ ({ \
++ decltype(exp) _rc; \
++ do { \
++ _rc = (exp); \
++ } while (_rc == -1 && errno == EINTR); \
++ _rc; \
++ })
++#endif // TEMP_FAILURE_RETRY
++
+ #include "src/main/tools/linux-sandbox-options.h"
+ #include "src/main/tools/linux-sandbox.h"
+ #include "src/main/tools/logging.h"