-
Notifications
You must be signed in to change notification settings - Fork 183
/
bazel.spec
41 lines (32 loc) · 1.63 KB
/
bazel.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
### RPM external bazel 5.3.0
## INCLUDE cpp-standard
Source: https://github.com/bazelbuild/bazel/releases/download/%{realversion}/bazel-%{realversion}-dist.zip
BuildRequires: java-env python3 python-python3
# For some build steps, bazel uses a process-wrapper that is executed in an empty environment.
# Therefore, the wrapper is linked to the system library /lib64/libstdc++.so.6, and complains about
# a missing GLIBCXX_3.4.21 version when (e.g.) used during the compilation of tensorflow python
# modules invoked via swig. This mechanism of bazel is actually only useful in combination with its
# remote compilation features. When disabling the process-wrapper, the local environment is taken
# into account which is the desired behavior for us. For example, see:
# - https://github.com/bazelbuild/bazel/issues/4137
# - https://github.com/bazelbuild/bazel/issues/4510
# - https://github.com/tensorflow/tensorboard/issues/1611
# configuration issue
# https://github.com/bazelbuild/bazel/issues/9392
Patch0: bazel-3.7.0-patches
Patch1: bazel-absl
%prep
%setup -q -c -n bazel-%{realversion}
%patch0 -p1
%patch1 -p1
%build
export EXTRA_BAZEL_ARGS="--define=ABSOLUTE_JAVABASE=${JAVA_HOME} --jobs %{compiling_processes}"
export BAZEL_CXXOPTS="-std=c++%{cms_cxx_standard}"
${JAVA_HOME}/bin/java -version 2>&1 | grep -E -i 'openjdk version "[1-9]'
if [ $(${JAVA_HOME}/bin/java -version 2>&1 | grep -E -i 'openjdk version "[1-9]' | sed -E 's|.* "([0-9]+)[.].*|\1|') -ge 17 ] ; then
export JNI_FLAGS="--add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED"
fi
bash ./compile.sh
%install
mkdir %{i}/bin
cp output/bazel %{i}/bin/.