Fix Bazel issue caused by msopenjdk-17 update (#8381)

This commit is contained in:
Riken Maharjan 2024-03-13 11:03:34 -07:00 коммит произвёл GitHub
Родитель c755e6fa58
Коммит 22409a3593
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -0,0 +1,11 @@
diff -urN a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
--- a/scripts/bootstrap/compile.sh 1980-01-01 00:00:00.000000000 -0800
+++ b/scripts/bootstrap/compile.sh 2024-03-11 15:10:12.241266121 -0700
@@ -447,6 +447,7 @@
-XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Dfile.encoding=ISO-8859-1 \
-XX:HeapDumpPath=${OUTPUT_DIR} \
-Djava.util.logging.config.file=${OUTPUT_DIR}/javalog.properties \
+ --add-opens java.base/java.lang=ALL-UNNAMED \
${JNI_FLAGS} \
-jar ${ARCHIVE_DIR}/libblaze.jar \
--batch \

Просмотреть файл

@ -12,6 +12,7 @@ URL: https://bazel.io/
# do not use the github tar.gz use the ...-dist.zip instead
Source0: https://github.com/bazelbuild/%{name}/releases/download/%{version}/%{name}-%{version}-dist.zip
Patch0: fix-bazel-version-check.patch
Patch1: 0001-JDK17.patch
BuildRequires: build-essential
BuildRequires: libstdc++
BuildRequires: libstdc++-devel
@ -31,9 +32,10 @@ A fast, scalable, multi-language and extensible build system.
%autosetup -p1 -c -n %{name}-%{version}
%build
export JAVA_HOME=$(find %{_libdir}/jvm -name "msopenjdk*")
ln -s %{_bindir}/python3 %{_bindir}/python
EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk --remote_download_minimal" ./compile.sh
EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk --tool_java_runtime_version=local_jdk --remote_download_minimal" ./compile.sh
%install
mkdir -p %{buildroot}/%{_bindir}
@ -46,8 +48,9 @@ cp ./scripts/packages/bazel.sh %{buildroot}/%{_bindir}/bazel
%attr(0755,root,root) %{_bindir}/bazel-real
%changelog
* Tue Mar 05 2024 Riken Maharjan <rmaharjan@microsoft.com> - 6.5.0
* Tue Mar 05 2024 Riken Maharjan <rmaharjan@microsoft.com> - 6.5.0-1
- Upgrade to 6.5.0
- Added msopenjdk-17 patch
* Fri Dec 09 2022 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.3.2-1
- Auto-upgrade to 5.3.2 - CVE-2022-3474