public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/bazel/files/, dev-util/bazel/
Date: Wed, 24 Nov 2021 02:24:50 +0000 (UTC)	[thread overview]
Message-ID: <1637720387.ac00d0d8ce29825d65b1ecfbb894e9d0310eedd3.sam@gentoo> (raw)

commit:     ac00d0d8ce29825d65b1ecfbb894e9d0310eedd3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 24 02:19:47 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 24 02:19:47 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac00d0d8

dev-util/bazel: add upstream musl patch

Closes: https://bugs.gentoo.org/815907
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/bazel/bazel-3.7.2-r1.ebuild               |  1 +
 .../bazel-3.7.2-musl-temp-failure-retry.patch      | 34 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

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"


             reply	other threads:[~2021-11-24  2:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24  2:24 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-07  1:58 [gentoo-commits] repo/gentoo:master commit in: dev-util/bazel/files/, dev-util/bazel/ Jason Zaman
2021-11-22 15:08 David Seifert
2021-09-19  1:38 Sam James
2019-12-09  6:29 Zac Medico
2019-12-09  5:55 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1637720387.ac00d0d8ce29825d65b1ecfbb894e9d0310eedd3.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox