Date: Mon, 24 Jan 2022 11:18:52 GMT From: =?utf-8?Q?Fernando Apestegu=C3=ADa?= <fernape@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 1a6fab9f7b21 - main - devel/bazel: update to 5.0.0 Message-ID: <202201241118.20OBIqJY091794@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/ports/commit/?id=1a6fab9f7b2135d4f045da293eb73e5dfc511843 commit 1a6fab9f7b2135d4f045da293eb73e5dfc511843 Author: Klaus Aehlig <aehlig@linta.de> AuthorDate: 2022-01-21 08:18:59 +0000 Commit: Fernando ApesteguĂa <fernape@FreeBSD.org> CommitDate: 2022-01-24 11:17:06 +0000 devel/bazel: update to 5.0.0 ChangeLog: https://blog.bazel.build/2022/01/19/bazel-5.0.html PR: 261363 Reported by: aehlig@linta.de (maintainer) --- devel/bazel/Makefile | 17 +++++++--- devel/bazel/distinfo | 6 ++-- devel/bazel/files/extra-patch-bazel_build_defs.bzl | 10 ++++++ devel/bazel/files/extra-patch-bazel_grpc__deps.bzl | 20 +++++++---- devel/bazel/files/patch-WORKSPACE | 14 -------- devel/bazel/files/patch-distdir_deps.bzl | 10 ++++++ .../files/patch-scripts_bootstrap_BUILD.bootstrap | 13 ++++++++ .../files/patch-src_main_cpp_blaze_util_bsd.cc | 11 ++++++ ...ib_bazel_rules_python_BazelPythonSemantics.java | 12 +++---- .../patch-tools__jdk__default_java_toolchain.bzl | 39 ---------------------- 10 files changed, 79 insertions(+), 73 deletions(-) diff --git a/devel/bazel/Makefile b/devel/bazel/Makefile index cd1a9a740744..0e405b26d3ee 100644 --- a/devel/bazel/Makefile +++ b/devel/bazel/Makefile @@ -1,7 +1,7 @@ # Created by: Klaus Aehlig <aehlig@linta.de> PORTNAME= bazel -DISTVERSION= 4.2.1 +DISTVERSION= 5.0.0 CATEGORIES= devel java MASTER_SITES= https://storage.googleapis.com/bazel/${PORTVERSION}/rc${FINALRC}/ DISTNAME= bazel-${PORTVERSION}rc${FINALRC}-dist @@ -25,7 +25,7 @@ SHEBANG_REGEX= .*(sh|txt|_stub|stub_.*|bazel|get_workspace_status|protobuf_suppo CPE_VENDOR= google USE_JAVA= yes -JAVA_VERSION= 1.8 +JAVA_VERSION= 11 JAVA_VENDOR= openjdk JAVA_BUILD= yes JAVA_RUN= yes @@ -40,7 +40,7 @@ NO_WRKSUBDIR= YES # In bazel, a release is always code-wise identical to the final release candidate. # Hence we can also download that one and so have a simple way to also test earlier release # candidates. -FINALRC= 2 +FINALRC= 4 .include <bsd.port.pre.mk> @@ -55,6 +55,7 @@ BAZEL_JAVAC_OPTS+= "-J-Xmx1g -J-Xms128m" pre-patch: @${CP} ${FILESDIR}/extra-patch-absl_base_internal_unscaledcycleclock.cc \ ${FILESDIR}/extra-patch-bazel_grpc__deps.bzl \ + ${FILESDIR}/extra-patch-bazel_build_defs.bzl \ ${WRKSRC}/third_party/grpc/ # Have the location of the system-wide rc file reside ${ETCDIR}. @@ -65,7 +66,8 @@ post-patch: -e "s|/etc/bazel.bazelrc|${ETCDIR}/bazel.bazelrc|" \ ${WRKSRC}/src/main/cpp/BUILD @${ECHO_CMD} build --strategy=Javac=standalone >> ${WRKSRC}/scripts/packages/bazel.bazelrc - @${ECHO_CMD} build --host_javabase=@local_jdk//:jdk >> ${WRKSRC}/scripts/packages/bazel.bazelrc + @${ECHO_CMD} build --java_runtime_version=${JAVA_VERSION} >> ${WRKSRC}/scripts/packages/bazel.bazelrc + @${ECHO_CMD} build --tool_java_runtime_version=${JAVA_VERSION} >> ${WRKSRC}/scripts/packages/bazel.bazelrc @${ECHO_CMD} build --action_env=PATH=/bin:/usr/bin/:${LOCALBASE}/bin >> ${WRKSRC}/scripts/packages/bazel.bazelrc @${REINPLACE_CMD} \ -e 's|^\(PYTHON_BIN=.*\)|if [ "%VERSION%" = "3" ] ; then PYTHON_BIN=${PYTHON_CMD}; else \1 ; fi|' \ @@ -73,6 +75,9 @@ post-patch: @${REINPLACE_CMD} \ -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' \ ${WRKSRC}/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java + @${REINPLACE_CMD} \ + -e 's|%%JAVA_HOME%%|${JAVA_HOME}|' \ + ${WRKSRC}/src/main/cpp/blaze_util_bsd.cc do-build: @${MKDIR} ${WRKDIR}/bazel_tmp @@ -82,12 +87,14 @@ do-build: fi ; \ cd ${WRKSRC} && \ ${SETENV} BAZEL_SH=${LOCALBASE}/bin/bash \ + JAVA_HOME=${JAVA_HOME} \ + JAVA_VERSION=${JAVA_VERSION} \ TMPDIR=${WRKDIR}/bazel_tmp \ EMBED_LABEL='${PORTVERSION}' \ PATH=${LOCALBASE}/bin:$$PATH \ SOURCE_DATE_EPOCH=$${SOURCE_DATE_EPOCH} \ BAZEL_JAVAC_OPTS=${BAZEL_JAVAC_OPTS} \ - EXTRA_BAZEL_ARGS=--host_javabase=@local_jdk//:jdk \ + EXTRA_BAZEL_ARGS='--host_javabase=@local_jdk//:jdk --tool_java_runtime_version=local_jdk --java_language_version=${JAVA_VERSION} --tool_java_language_version=${JAVA_VERSION}' \ ${LOCALBASE}/bin/bash ./compile.sh) do-install: diff --git a/devel/bazel/distinfo b/devel/bazel/distinfo index a9c4c74f8cff..68b431ac3f58 100644 --- a/devel/bazel/distinfo +++ b/devel/bazel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1630150517 -SHA256 (bazel-4.2.1rc2-dist.zip) = d92998f7503a74e9e4f8aef5c81d85849abfed51d9d8fb622103c4eb5d1330a7 -SIZE (bazel-4.2.1rc2-dist.zip) = 279265298 +TIMESTAMP = 1642256198 +SHA256 (bazel-5.0.0rc4-dist.zip) = c077713b8ee63691b0d5a658ddb6daf879f6082d3cbdd6d610d79f250675350b +SIZE (bazel-5.0.0rc4-dist.zip) = 235869975 diff --git a/devel/bazel/files/extra-patch-bazel_build_defs.bzl b/devel/bazel/files/extra-patch-bazel_build_defs.bzl new file mode 100644 index 000000000000..2bcce02b3eae --- /dev/null +++ b/devel/bazel/files/extra-patch-bazel_build_defs.bzl @@ -0,0 +1,10 @@ +--- bazel/build_defs.bzl.orig 2022-01-20 13:04:32.306692000 +0100 ++++ bazel/build_defs.bzl 2022-01-20 13:05:02.002057000 +0100 +@@ -35,6 +35,7 @@ + # "-Wshorten-64-to-32", # not in GCC (and my Kokoro images doesn't have Clang) + "-Werror", + "-Wno-long-long", ++ "-Wno-deprecated-copy", + # copybara:strip_end + ], + }) diff --git a/devel/bazel/files/extra-patch-bazel_grpc__deps.bzl b/devel/bazel/files/extra-patch-bazel_grpc__deps.bzl index b3a648e5ff2c..57f805f1992c 100644 --- a/devel/bazel/files/extra-patch-bazel_grpc__deps.bzl +++ b/devel/bazel/files/extra-patch-bazel_grpc__deps.bzl @@ -1,10 +1,18 @@ ---- a/bazel/grpc_deps.bzl.orig 2021-10-11 15:54:07.083144000 +0200 -+++ b/bazel/grpc_deps.bzl 2021-10-11 16:02:48.722952000 +0200 -@@ -239,6 +239,7 @@ - if "com_google_absl" not in native.existing_rules(): +--- a/bazel/grpc_deps.bzl ++++ b/bazel/grpc_deps.bzl +@@ -284,6 +284,7 @@ http_archive( name = "com_google_absl", + sha256 = "35f22ef5cb286f09954b7cc4c85b5a3f6221c9d4df6b8c4a1e9d399555b366ee", + patches = ["//third_party/grpc:extra-patch-absl_base_internal_unscaledcycleclock.cc"], - sha256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a", - strip_prefix = "abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d", + strip_prefix = "abseil-cpp-997aaf3a28308eba1b9156aa35ab7bca9688e9f6", urls = [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz", +@@ -339,6 +340,7 @@ + http_archive( + name = "upb", + sha256 = "6a5f67874af66b239b709c572ac1a5a00fdb1b29beaf13c3e6f79b1ba10dc7c4", ++ patches = ["//third_party/grpc:extra-patch-bazel_build_defs.bzl"], + strip_prefix = "upb-2de300726a1ba2de9a468468dc5ff9ed17a3215f", + urls = [ + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz", diff --git a/devel/bazel/files/patch-WORKSPACE b/devel/bazel/files/patch-WORKSPACE deleted file mode 100644 index 314316c3579d..000000000000 --- a/devel/bazel/files/patch-WORKSPACE +++ /dev/null @@ -1,14 +0,0 @@ ---- WORKSPACE.orig 2021-10-11 09:54:26 UTC -+++ WORKSPACE -@@ -1232,7 +1232,10 @@ register_toolchains("//src/main/res:empty_rc_toolchain - http_archive( - name = "com_github_grpc_grpc", - patch_args = ["-p1"], -- patches = ["//third_party/grpc:grpc_1.33.1.patch"], -+ patches = [ -+ "//third_party/grpc:grpc_1.33.1.patch", -+ "//third_party/grpc:extra-patch-bazel_grpc__deps.bzl", -+ ], - sha256 = "58eaee5c0f1bd0b92ebe1fa0606ec8f14798500620e7444726afcaf65041cb63", - strip_prefix = "grpc-1.33.1", - urls = [ diff --git a/devel/bazel/files/patch-distdir_deps.bzl b/devel/bazel/files/patch-distdir_deps.bzl new file mode 100644 index 000000000000..5abae024a874 --- /dev/null +++ b/devel/bazel/files/patch-distdir_deps.bzl @@ -0,0 +1,10 @@ +--- distdir_deps.bzl.orig 1979-12-31 23:00:00 UTC ++++ distdir_deps.bzl +@@ -130,6 +130,7 @@ DIST_DEPS = { + "patch_args": ["-p1"], + "patches": [ + "//third_party/grpc:grpc_1.41.0.patch", ++ "//third_party/grpc:extra-patch-bazel_grpc__deps.bzl", + ], + "used_in": [ + "additional_distfiles", diff --git a/devel/bazel/files/patch-scripts_bootstrap_BUILD.bootstrap b/devel/bazel/files/patch-scripts_bootstrap_BUILD.bootstrap new file mode 100644 index 000000000000..9b5836b099aa --- /dev/null +++ b/devel/bazel/files/patch-scripts_bootstrap_BUILD.bootstrap @@ -0,0 +1,13 @@ +--- scripts/bootstrap/BUILD.bootstrap.orig 1979-12-31 23:00:00 UTC ++++ scripts/bootstrap/BUILD.bootstrap +@@ -16,8 +16,8 @@ default_java_toolchain( + "-XX:TieredStopAtLevel=1", + ], + singlejar = ["//src/tools/singlejar:singlejar"], +- source_version = "8", ++ source_version = "11", + tags = ["manual"], +- target_version = "8", ++ target_version = "11", + visibility = ["//visibility:public"], + ) diff --git a/devel/bazel/files/patch-src_main_cpp_blaze_util_bsd.cc b/devel/bazel/files/patch-src_main_cpp_blaze_util_bsd.cc new file mode 100644 index 000000000000..2effc8c23604 --- /dev/null +++ b/devel/bazel/files/patch-src_main_cpp_blaze_util_bsd.cc @@ -0,0 +1,11 @@ +--- src/main/cpp/blaze_util_bsd.cc.orig 1979-12-31 23:00:00 UTC ++++ src/main/cpp/blaze_util_bsd.cc +@@ -14,7 +14,7 @@ + + #if defined(__FreeBSD__) + # define HAVE_PROCSTAT +-# define STANDARD_JAVABASE "/usr/local/openjdk8" ++# define STANDARD_JAVABASE "%%JAVA_HOME%%" + #elif defined(__OpenBSD__) + # define STANDARD_JAVABASE "/usr/local/jdk-1.8.0" + #else diff --git a/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_BazelPythonSemantics.java b/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_BazelPythonSemantics.java index 2ebf468c71b4..cbbdd1a9c28b 100644 --- a/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_BazelPythonSemantics.java +++ b/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_BazelPythonSemantics.java @@ -1,13 +1,13 @@ --- src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java.orig 1979-12-31 23:00:00 UTC +++ src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java -@@ -247,9 +247,9 @@ public class BazelPythonSemantics implem +@@ -238,9 +238,8 @@ + + if (OS.getCurrent() != OS.WINDOWS) { PathFragment shExecutable = ShToolchain.getPathOrError(ruleContext); - // TODO(#8685): Remove this special-case handling as part of making the proper shebang a - // property of the Python toolchain configuration. -- String pythonExecutableName = OS.getCurrent() == OS.OPENBSD ? "python3" : "python"; -+ String pythonExecutableName = "%%PYTHON_CMD%%"; - // NOTE: keep the following line intact to support nix builds +- String pythonExecutableName = "python3"; +- // NOTE: keep the following line intact to support nix builds - String pythonShebang = "#!/usr/bin/env " + pythonExecutableName; ++ String pythonExecutableName = "%%PYTHON_CMD%%"; + String pythonShebang = "#!" + pythonExecutableName; ruleContext.registerAction( new SpawnAction.Builder() diff --git a/devel/bazel/files/patch-tools__jdk__default_java_toolchain.bzl b/devel/bazel/files/patch-tools__jdk__default_java_toolchain.bzl deleted file mode 100644 index 9f6ee5fef2d4..000000000000 --- a/devel/bazel/files/patch-tools__jdk__default_java_toolchain.bzl +++ /dev/null @@ -1,39 +0,0 @@ ---- tools/jdk/default_java_toolchain.bzl.orig 1979-12-31 23:00:00 UTC -+++ tools/jdk/default_java_toolchain.bzl -@@ -21,27 +21,6 @@ JDK8_JVM_OPTS = [ - ] - - JDK9_JVM_OPTS = [ -- # Allow JavaBuilder to access internal javac APIs. -- "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", -- "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED", -- "--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED", -- "--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED", -- "--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED", -- "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", -- "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", -- "--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED", -- "--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED", -- "--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", -- -- # override the javac in the JDK. -- "--patch-module=java.compiler=$(location @bazel_tools//tools/jdk:java_compiler_jar)", -- "--patch-module=jdk.compiler=$(location @bazel_tools//tools/jdk:jdk_compiler_jar)", -- -- # quiet warnings from com.google.protobuf.UnsafeUtil, -- # see: https://github.com/google/protobuf/issues/3781 -- # and: https://github.com/bazelbuild/bazel/issues/5599 -- "--add-opens=java.base/java.nio=ALL-UNNAMED", -- "--add-opens=java.base/java.lang=ALL-UNNAMED", - ] - - DEFAULT_JAVACOPTS = [ -@@ -67,7 +46,7 @@ DEFAULT_TOOLCHAIN_CONFIGURATION = { - "javac_supports_workers": 1, - "jvm_opts": select({ - "@bazel_tools//src/conditions:openbsd": JDK8_JVM_OPTS, -- "//conditions:default": JDK9_JVM_OPTS, -+ "//conditions:default": JDK8_JVM_OPTS, - }), - "misc": DEFAULT_JAVACOPTS, - "singlejar": ["@bazel_tools//tools/jdk:singlejar"],
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202201241118.20OBIqJY091794>