diff --git a/devel/bazel/Makefile b/devel/bazel/Makefile index fc40c6b3f5bd..4e577936eadc 100644 --- a/devel/bazel/Makefile +++ b/devel/bazel/Makefile @@ -1,89 +1,89 @@ # Created by: Klaus Aehlig # $FreeBSD$ PORTNAME= bazel -DISTVERSION= 3.5.0 +DISTVERSION= 3.6.0 CATEGORIES= devel java MASTER_SITES= https://storage.googleapis.com/bazel/${PORTVERSION}/rc${FINALRC}/ DISTNAME= bazel-${PORTVERSION}rc${FINALRC}-dist MAINTAINER= aehlig@linta.de COMMENT= Fast and correct build system LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE BROKEN_aarch64= fails to build: java.lang.OutOfMemoryError: Java heap space BROKEN_armv6= fails to package: cp: bazel: No such file or directory BROKEN_armv7= fails to package: cp: bazel: No such file or directory BROKEN_FreeBSD_11_powerpc64= fails to compile: Action failed to execute: java.io.IOException: Cannot run program /usr/bin/clang BROKEN_FreeBSD_12_powerpc64= fails to compile: Action failed to execute: java.io.IOException: Cannot run program /usr/bin/clang BUILD_DEPENDS= bash:shells/bash \ zip:archivers/zip USES= python:3.3+ shebangfix zip:infozip CONFLICTS_INSTALL= bazel029 # 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= 4 SHEBANG_REGEX= .*(sh|txt|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so) USE_JAVA= yes JAVA_VENDOR= openjdk JAVA_VERSION= 1.8 JAVA_BUILD= yes JAVA_RUN= yes NO_WRKSUBDIR= YES # The bazel binary is also a zip archive (extracted by the elf part), it must not be stripped STRIP= .include .if ${ARCH} == "i386" EXTRA_PATCHES+= ${FILESDIR}/extra-i386_tools_cpp_BUILD.static.freebsd .endif # Have the location of the system-wide rc file reside ${ETCDIR}. # Also adapt the sample file to disable persistent java workers as they # do not work reliably on FreeBSD. post-patch: @${REINPLACE_CMD} \ -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 --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|' \ ${WRKSRC}/tools/python/pywrapper_template.txt @${REINPLACE_CMD} \ -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' \ ${WRKSRC}/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java do-build: @${MKDIR} ${WRKDIR}/bazel_tmp (if [ -z "$${SOURCE_DATE_EPOCH}" ] ; \ then SOURCE_DATE_EPOCH=`grep TIMESTAMP ${DISTINFO_FILE} \ | ${SED} -e 's/[^0-9]//g'`; \ fi ; \ cd ${WRKSRC} && \ ${SETENV} BAZEL_SH=${LOCALBASE}/bin/bash \ TMPDIR=${WRKDIR}/bazel_tmp \ EMBED_LABEL='${PORTVERSION}' \ PATH=${LOCALBASE}/bin:$$PATH \ SOURCE_DATE_EPOCH=$${SOURCE_DATE_EPOCH} \ EXTRA_BAZEL_ARGS=--host_javabase=@local_jdk//:jdk \ ${LOCALBASE}/bin/bash ./compile.sh) do-install: ${INSTALL_PROGRAM} ${WRKSRC}/output/bazel ${STAGEDIR}${PREFIX}/bin @${MKDIR} ${STAGEDIR}${ETCDIR} ${INSTALL_DATA} ${WRKSRC}/scripts/packages/bazel.bazelrc ${STAGEDIR}${ETCDIR}/bazel.bazelrc.sample .include diff --git a/devel/bazel/distinfo b/devel/bazel/distinfo index 2d7d8b796819..d65428a1e66d 100644 --- a/devel/bazel/distinfo +++ b/devel/bazel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1597999971 -SHA256 (bazel-3.5.0rc4-dist.zip) = d54edb7f42ce282c05150da4844430644f5eb27483ed685ef0f3b2e13e3e53b3 -SIZE (bazel-3.5.0rc4-dist.zip) = 307976110 +TIMESTAMP = 1601660539 +SHA256 (bazel-3.6.0rc4-dist.zip) = a99e64c5efc3df19595309ec9c7e7bea1ebfba65dd9a351bf2cfead941ae7467 +SIZE (bazel-3.6.0rc4-dist.zip) = 308423486 diff --git a/devel/bazel/files/patch-scripts_bootstrap_bootstrap.sh b/devel/bazel/files/patch-scripts_bootstrap_bootstrap.sh index 2fe060abacc3..76d7ca9ec5d6 100644 --- a/devel/bazel/files/patch-scripts_bootstrap_bootstrap.sh +++ b/devel/bazel/files/patch-scripts_bootstrap_bootstrap.sh @@ -1,11 +1,11 @@ ---- scripts/bootstrap/bootstrap.sh.orig 2019-08-06 08:04:56.534744000 +0000 -+++ scripts/bootstrap/bootstrap.sh 2019-08-06 08:05:20.598434000 +0000 -@@ -35,7 +35,7 @@ - --host_java_toolchain=//src/java_tools/buildjar:bootstrap_toolchain \ - --spawn_strategy=standalone \ +--- scripts/bootstrap/bootstrap.sh.orig 2020-10-07 21:26:37 UTC ++++ scripts/bootstrap/bootstrap.sh +@@ -33,7 +33,7 @@ fi + + _BAZEL_ARGS="--spawn_strategy=standalone \ --nojava_header_compilation \ - --strategy=Javac=worker --worker_quit_after_build --ignore_unsupported_sandboxing \ + --strategy=Javac=standalone --ignore_unsupported_sandboxing --curses=no \ --compilation_mode=opt \ --distdir=derived/distdir \ - ${EXTRA_BAZEL_ARGS:-}" + --java_toolchain=//src/java_tools/buildjar:bootstrap_toolchain \ diff --git a/devel/bazel/files/patch-scripts_bootstrap_buildenv.sh b/devel/bazel/files/patch-scripts_bootstrap_buildenv.sh index c1a1d5202b89..e7dbf357e0f4 100644 --- a/devel/bazel/files/patch-scripts_bootstrap_buildenv.sh +++ b/devel/bazel/files/patch-scripts_bootstrap_buildenv.sh @@ -1,11 +1,11 @@ ---- scripts/bootstrap/buildenv.sh.orig 1979-12-31 23:00:00 UTC +--- scripts/bootstrap/buildenv.sh.orig 2020-10-07 21:26:37 UTC +++ scripts/bootstrap/buildenv.sh -@@ -215,7 +215,7 @@ function clear_log() { +@@ -230,7 +230,7 @@ function clear_log() { rm -f ${phasefile} } -LEAVES="\xF0\x9F\x8D\x83" +LEAVES="[LEAVES]" INFO="\033[32mINFO\033[0m:" WARNING="\033[31mWARN\033[0m:" diff --git a/devel/bazel/files/patch-src__main__tools__procress-tools-linux.cc b/devel/bazel/files/patch-src__main__tools__procress-tools-linux.cc deleted file mode 100644 index 72c5defeec56..000000000000 --- a/devel/bazel/files/patch-src__main__tools__procress-tools-linux.cc +++ /dev/null @@ -1,10 +0,0 @@ ---- src/main/tools/process-tools-linux.cc.orig 2020-06-02 21:33:22.556035000 +0200 -+++ src/main/tools/process-tools-linux.cc 2020-06-02 21:34:05.346824000 +0200 -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - - #include "src/main/tools/process-tools.h" - 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 a597855ac87d..2ebf468c71b4 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,14 +1,14 @@ ---- src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java.orig 2020-07-03 15:30:52.313535000 +0200 -+++ src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java 2020-07-03 15:31:54.048865000 +0200 -@@ -247,9 +247,9 @@ +--- 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 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 pythonShebang = "#!/usr/bin/env " + pythonExecutableName; + String pythonShebang = "#!" + pythonExecutableName; ruleContext.registerAction( new SpawnAction.Builder() .addInput(zipFile) diff --git a/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt b/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt index 1d806bde79f0..b06dcd7a6f52 100644 --- a/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt +++ b/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt @@ -1,11 +1,11 @@ ---- src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt.orig 2019-11-13 08:37:00 UTC +--- src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt.orig 2020-10-07 21:26:37 UTC +++ src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt -@@ -52,7 +52,7 @@ +@@ -58,7 +58,7 @@ if IsWindows() and not HasWindowsExecuta def SearchPath(name): """Finds a file in a given search path.""" - search_path = os.getenv('PATH', os.defpath).split(os.pathsep) + search_path = os.getenv('PATH', os.defpath + ':/usr/local/bin').split(os.pathsep) for directory in search_path: if directory: path = os.path.join(directory, name) diff --git a/devel/bazel/files/patch-src_main_tools_process-tools-linux.cc b/devel/bazel/files/patch-src_main_tools_process-tools-linux.cc new file mode 100644 index 000000000000..916ff8de5c2b --- /dev/null +++ b/devel/bazel/files/patch-src_main_tools_process-tools-linux.cc @@ -0,0 +1,10 @@ +--- src/main/tools/process-tools-linux.cc.orig 1979-12-31 23:00:00 UTC ++++ src/main/tools/process-tools-linux.cc +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include "src/main/tools/process-tools.h" + diff --git a/devel/bazel/files/patch-src_tools_singlejar_port.h b/devel/bazel/files/patch-src_tools_singlejar_port.h index 2010e26857f6..92fd5f40f22b 100644 --- a/devel/bazel/files/patch-src_tools_singlejar_port.h +++ b/devel/bazel/files/patch-src_tools_singlejar_port.h @@ -1,14 +1,14 @@ ---- src/tools/singlejar/port.h.orig 2018-09-18 16:02:23.430634000 +0200 -+++ src/tools/singlejar/port.h 2018-09-18 16:03:58.961047000 +0200 +--- src/tools/singlejar/port.h.orig 1979-12-31 23:00:00 UTC ++++ src/tools/singlejar/port.h @@ -28,6 +28,11 @@ #include #include +#ifndef _OFF64_T_DECLARED +typedef off_t off64_t; +#define _OFF64_T_DECLARED +#endif + #if defined(__APPLE__) typedef off_t off64_t; #elif defined(_WIN32) diff --git a/devel/bazel/files/patch-tools__jdk__default_java_toolchain.bzl b/devel/bazel/files/patch-tools__jdk__default_java_toolchain.bzl index 8df02576ee41..70f9eb61ef37 100644 --- a/devel/bazel/files/patch-tools__jdk__default_java_toolchain.bzl +++ b/devel/bazel/files/patch-tools__jdk__default_java_toolchain.bzl @@ -1,37 +1,37 @@ ---- tools/jdk/default_java_toolchain.bzl.orig 2020-02-14 20:56:31.911758000 +0100 -+++ tools/jdk/default_java_toolchain.bzl 2020-02-14 20:57:09.531875000 +0100 -@@ -21,25 +21,6 @@ +--- tools/jdk/default_java_toolchain.bzl.orig 1979-12-31 23:00:00 UTC ++++ tools/jdk/default_java_toolchain.bzl +@@ -21,25 +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.code=ALL-UNNAMED", - "--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED", - "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", - "--add-exports=jdk.compiler/com.sun.tools.javac.main=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.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 = [ -@@ -63,7 +44,7 @@ +@@ -63,7 +44,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"],