1 |
commit: ac00d0d8ce29825d65b1ecfbb894e9d0310eedd3 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 24 02:19:47 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 24 02:19:47 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac00d0d8 |
7 |
|
8 |
dev-util/bazel: add upstream musl patch |
9 |
|
10 |
Closes: https://bugs.gentoo.org/815907 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
dev-util/bazel/bazel-3.7.2-r1.ebuild | 1 + |
14 |
.../bazel-3.7.2-musl-temp-failure-retry.patch | 34 ++++++++++++++++++++++ |
15 |
2 files changed, 35 insertions(+) |
16 |
|
17 |
diff --git a/dev-util/bazel/bazel-3.7.2-r1.ebuild b/dev-util/bazel/bazel-3.7.2-r1.ebuild |
18 |
index 2575046bfcb7..db3f1fbbb8c0 100644 |
19 |
--- a/dev-util/bazel/bazel-3.7.2-r1.ebuild |
20 |
+++ b/dev-util/bazel/bazel-3.7.2-r1.ebuild |
21 |
@@ -66,6 +66,7 @@ src_prepare() { |
22 |
addpredict /proc |
23 |
|
24 |
eapply "${FILESDIR}/${PN}-3.2.0-include-limits-for-gcc-11.patch" |
25 |
+ eapply "${FILESDIR}/${PN}-3.7.2-musl-temp-failure-retry.patch" |
26 |
} |
27 |
|
28 |
src_compile() { |
29 |
|
30 |
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 |
31 |
new file mode 100644 |
32 |
index 000000000000..4c8648bb639f |
33 |
--- /dev/null |
34 |
+++ b/dev-util/bazel/files/bazel-3.7.2-musl-temp-failure-retry.patch |
35 |
@@ -0,0 +1,34 @@ |
36 |
+https://bugs.gentoo.org/815907 |
37 |
+https://github.com/bazelbuild/bazel/commit/bcce6dd026e90336e80616a8c1004a79a2f8640c |
38 |
+ |
39 |
+From: philwo <philwo@××××××.com> |
40 |
+Date: Thu, 20 May 2021 08:13:09 -0700 |
41 |
+Subject: [PATCH] Add the TEMP_FAILURE_RETRY macro to linux-sandbox-pid1.cc. |
42 |
+ |
43 |
+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). |
44 |
+ |
45 |
+Fixes #12460. |
46 |
+ |
47 |
+PiperOrigin-RevId: 374873483 |
48 |
+--- a/src/main/tools/linux-sandbox-pid1.cc |
49 |
++++ b/src/main/tools/linux-sandbox-pid1.cc |
50 |
+@@ -49,6 +49,19 @@ |
51 |
+ #include <linux/fs.h> |
52 |
+ #endif |
53 |
+ |
54 |
++#ifndef TEMP_FAILURE_RETRY |
55 |
++// Some C standard libraries like musl do not define this macro, so we'll |
56 |
++// include our own version for compatibility. |
57 |
++#define TEMP_FAILURE_RETRY(exp) \ |
58 |
++ ({ \ |
59 |
++ decltype(exp) _rc; \ |
60 |
++ do { \ |
61 |
++ _rc = (exp); \ |
62 |
++ } while (_rc == -1 && errno == EINTR); \ |
63 |
++ _rc; \ |
64 |
++ }) |
65 |
++#endif // TEMP_FAILURE_RETRY |
66 |
++ |
67 |
+ #include "src/main/tools/linux-sandbox-options.h" |
68 |
+ #include "src/main/tools/linux-sandbox.h" |
69 |
+ #include "src/main/tools/logging.h" |