Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/bazel/files/, dev-util/bazel/
Date: Mon, 07 Feb 2022 01:58:14
Message-Id: 1644199002.35e2f095892a9534e967edb8ae3b285041647c28.perfinion@gentoo
1 commit: 35e2f095892a9534e967edb8ae3b285041647c28
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 6 01:22:42 2022 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 7 01:56:42 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35e2f095
7
8 dev-util/bazel: bump 4.2.2
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
12
13 dev-util/bazel/Manifest | 1 +
14 dev-util/bazel/bazel-4.2.2.ebuild | 96 ++++++++++++++++++++++
15 .../files/bazel-4.2.2-absl_numeric_limits.patch | 41 +++++++++
16 3 files changed, 138 insertions(+)
17
18 diff --git a/dev-util/bazel/Manifest b/dev-util/bazel/Manifest
19 index a8c02affdac3..987213efe6b9 100644
20 --- a/dev-util/bazel/Manifest
21 +++ b/dev-util/bazel/Manifest
22 @@ -1 +1,2 @@
23 DIST bazel-3.7.2-dist.zip 313677756 BLAKE2B cd6363762c68d25739a6bf6c13f10e191302a10b6fb7d97455effbc678d4f0b644c76115cad478aad7c09f703d9e594f4bdb8669ed6ab97d6a559a27723c510c SHA512 e8746ef5ec22feb95e9dbbddb3fb56cf8f49c80f326fc2a4e0ce2619607826fac22f46bfb995daee55bf9ffabb9d646b8454be2bce7b479da5cf2a7e5b3be62b
24 +DIST bazel-4.2.2-dist.zip 279304631 BLAKE2B 2a32838e50b63c4b6400aced10085c6c9aacf28641ea555a44b9c4ed8991fc29658b4d420b26179e8eed0e00cfe7391e8eec84c7851f17493c74d1c5682427af SHA512 123f73dc87053e37705bb729f82bd722d6d2799fe106f79c51cf5566fb2771d824108cbe275aad55ae590b970c549008b433704cbf1245394769e950796eb8db
25
26 diff --git a/dev-util/bazel/bazel-4.2.2.ebuild b/dev-util/bazel/bazel-4.2.2.ebuild
27 new file mode 100644
28 index 000000000000..41553e6c87d4
29 --- /dev/null
30 +++ b/dev-util/bazel/bazel-4.2.2.ebuild
31 @@ -0,0 +1,96 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +inherit bash-completion-r1 bazel java-pkg-2 multiprocessing
38 +
39 +DESCRIPTION="Fast and correct automated build system"
40 +HOMEPAGE="https://bazel.build/"
41 +
42 +SRC_URI="https://github.com/bazelbuild/bazel/releases/download/${PV}/${P}-dist.zip"
43 +
44 +LICENSE="Apache-2.0"
45 +SLOT="0"
46 +KEYWORDS="~amd64"
47 +IUSE="examples tools"
48 +# strip corrupts the bazel binary
49 +# test fails with network-sandbox: An error occurred during the fetch of repository 'io_bazel_skydoc' (bug 690794)
50 +RESTRICT="strip test"
51 +RDEPEND=">=virtual/jdk-1.8:*"
52 +DEPEND="${RDEPEND}
53 + app-arch/unzip
54 + app-arch/zip"
55 +
56 +S="${WORKDIR}"
57 +PATCHES=(
58 + "${FILESDIR}/${PN}-3.2.0-include-limits-for-gcc-11.patch"
59 + "${FILESDIR}/${PN}-4.2.2-absl_numeric_limits.patch"
60 +)
61 +
62 +pkg_setup() {
63 + if has ccache ${FEATURES}; then
64 + ewarn "${PN} usually fails to compile with ccache, you have been warned"
65 + fi
66 + java-pkg-2_pkg_setup
67 +}
68 +
69 +src_unpack() {
70 + # Only unpack the main distfile
71 + unpack ${P}-dist.zip
72 +}
73 +
74 +src_prepare() {
75 + default
76 +
77 + # F: fopen_wr
78 + # S: deny
79 + # P: /proc/self/setgroups
80 + # A: /proc/self/setgroups
81 + # R: /proc/24939/setgroups
82 + # C: /usr/lib/systemd/systemd
83 + addpredict /proc
84 +}
85 +
86 +src_compile() {
87 + export EXTRA_BAZEL_ARGS="--jobs=$(makeopts_jobs) $(bazel_get_flags) --host_javabase=@local_jdk//:jdk"
88 + VERBOSE=yes ./compile.sh || die
89 +
90 + ./scripts/generate_bash_completion.sh \
91 + --bazel=output/bazel \
92 + --output=bazel-complete.bash \
93 + --prepend=scripts/bazel-complete-header.bash \
94 + --prepend=scripts/bazel-complete-template.bash
95 +}
96 +
97 +src_test() {
98 + output/bazel test \
99 + --verbose_failures \
100 + --spawn_strategy=standalone \
101 + --genrule_strategy=standalone \
102 + --verbose_test_summary \
103 + examples/cpp:hello-success_test || die
104 + output/bazel shutdown
105 +}
106 +
107 +src_install() {
108 + dobin output/bazel
109 + newbashcomp bazel-complete.bash ${PN}
110 + bashcomp_alias ${PN} ibazel
111 + insinto /usr/share/zsh/site-functions
112 + doins scripts/zsh_completion/_bazel
113 +
114 + if use examples; then
115 + docinto examples
116 + dodoc -r examples/*
117 + docompress -x /usr/share/doc/${PF}/examples
118 + fi
119 + # could really build tools but I don't know which ones
120 + # are actually used
121 + if use tools; then
122 + docinto tools
123 + dodoc -r tools/*
124 + docompress -x /usr/share/doc/${PF}/tools
125 + docompress -x /usr/share/doc/${PF}/tools/build_defs/pkg/testdata
126 + fi
127 +}
128
129 diff --git a/dev-util/bazel/files/bazel-4.2.2-absl_numeric_limits.patch b/dev-util/bazel/files/bazel-4.2.2-absl_numeric_limits.patch
130 new file mode 100644
131 index 000000000000..c120255bf383
132 --- /dev/null
133 +++ b/dev-util/bazel/files/bazel-4.2.2-absl_numeric_limits.patch
134 @@ -0,0 +1,41 @@
135 + third_party/grpc/absl.patch | 11 +++++++++++
136 + third_party/grpc/grpc_1.33.1.patch | 12 ++++++++++++
137 + 2 files changed, 23 insertions(+)
138 +
139 +diff --git a/third_party/grpc/absl.patch b/third_party/grpc/absl.patch
140 +new file mode 100644
141 +index 0000000000..aeb6916c6f
142 +--- /dev/null
143 ++++ b/third_party/grpc/absl.patch
144 +@@ -0,0 +1,11 @@
145 ++diff -ur abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d_orig/absl/synchronization/internal/graphcycles.cc abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d/absl/synchronization/internal/graphcycles.cc
146 ++--- abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d_orig/absl/synchronization/internal/graphcycles.cc 2020-03-04 12:57:37.000000000 -0800
147 +++++ abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d/absl/synchronization/internal/graphcycles.cc 2022-01-28 12:27:26.588456815 -0800
148 ++@@ -35,6 +35,7 @@
149 ++
150 ++ #include "absl/synchronization/internal/graphcycles.h"
151 ++
152 +++#include <limits>
153 ++ #include <algorithm>
154 ++ #include <array>
155 ++ #include "absl/base/internal/hide_ptr.h"
156 +diff --git a/third_party/grpc/grpc_1.33.1.patch b/third_party/grpc/grpc_1.33.1.patch
157 +index dda6fc177e..f426d02b63 100644
158 +--- a/third_party/grpc/grpc_1.33.1.patch
159 ++++ b/third_party/grpc/grpc_1.33.1.patch
160 +@@ -120,3 +120,15 @@ index c047f0c515..7c24fbc617 100644
161 + ":windows": "@com_github_grpc_grpc//third_party/cares:config_windows/ares_config.h",
162 + ":android": "@com_github_grpc_grpc//third_party/cares:config_android/ares_config.h",
163 + "//conditions:default": "@com_github_grpc_grpc//third_party/cares:config_linux/ares_config.h",
164 ++diff -ur grpc-1.33.1/bazel/grpc_deps.bzl grpc-1.33.1/bazel/grpc_deps.bzl
165 ++--- grpc-1.33.1/bazel/grpc_deps.bzl 2022-02-05 16:50:14.780031906 -0800
166 +++++ grpc-1.33.1/bazel/grpc_deps.bzl 2022-02-05 16:51:56.670953159 -0800
167 ++@@ -241,6 +241,8 @@
168 ++ name = "com_google_absl",
169 ++ sha256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a",
170 ++ strip_prefix = "abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d",
171 +++ patch_args = ["-p1"],
172 +++ patches = ["@io_bazel//third_party/grpc:absl.patch"],
173 ++ urls = [
174 ++ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz",
175 ++ "https://github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz",