[SDFAB-1196] Build ONOS with Bazel 6.0.0 pre-release
This was a quite big jump (3.7.2 -> 6.x.x) and we had
to face the deprecation of several components.
- javabase/host_javabase -> java_language_version and
java_runtime_version
- java_toolchain/host_java_toolchain -> java_language_version
and java_runtime_version
- Turnedoff "ReturnValueIgnored" related to ErrorProne
- Moved to bazelisk v1.11.0
- patched again the grpc code due to the deprecation of host_javabase
as java_toolcahin contains already this information.
- resource_jars are also handled as resources because java constructs
do not accept them anymore.
- Use the OSGIWrapper to fix the path of the resource_hars and untar them.
Additionally clean up the code and enable/disable logging through a param.
- Fix absolute_javabase in the Dockerfile by providing the absolute
path of the local jvm through local_java_repository. The latter is
appended to the WORKSPACE file on demand inside the Dockerfile.
Change-Id: I96e06fe52b3b49a1a34f01443eec583a95347323
(cherry picked from commit 846c8b167f3e3aa8086b3eab3df94154a75dc423)
diff --git a/tools/dev/Dockerfile-yourkit b/tools/dev/Dockerfile-yourkit
index d54460e..176c3b3 100644
--- a/tools/dev/Dockerfile-yourkit
+++ b/tools/dev/Dockerfile-yourkit
@@ -41,7 +41,7 @@
# Install Bazelisk, which will download the version of bazel specified in
# .bazelversion
-RUN curl -L -o bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.5.0/bazelisk-linux-amd64
+RUN curl -L -o bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64
RUN chmod +x bazelisk && mv bazelisk /usr/bin
# Build-stage environment variables
@@ -56,16 +56,15 @@
# Build ONOS using the JDK pre-installed in the base image, instead of the
# Bazel-provided remote one. By doing wo we make sure to build with the most
# updated JDK, including bug and security fixes, independently of the Bazel
-# version.
+# version. NOTE that WORKSPACE-docker file defines dockerjdk
ARG JOBS
ARG JAVA_PATH
ARG PROFILE
-RUN bazelisk build onos \
+RUN cat WORKSPACE-docker >> WORKSPACE && bazelisk build onos \
--jobs ${JOBS} \
--verbose_failures \
- --javabase=@bazel_tools//tools/jdk:absolute_javabase \
- --host_javabase=@bazel_tools//tools/jdk:absolute_javabase \
- --define=ABSOLUTE_JAVABASE=${JAVA_PATH} \
+ --java_runtime_version=dockerjdk_11 \
+ --tool_java_runtime_version=dockerjdk_11 \
--define profile=${PROFILE}
# We extract the tar in the build environment to avoid having to put the tar in