View | Details | Raw Unified | Return to bug 261363 | Differences between
and this patch

Collapse All | Expand All

(-)bazel/Makefile (-5 / +12 lines)
Lines 1-7 Link Here
1
# Created by: Klaus Aehlig <aehlig@linta.de>
1
# Created by: Klaus Aehlig <aehlig@linta.de>
2
2
3
PORTNAME=	bazel
3
PORTNAME=	bazel
4
DISTVERSION=	4.2.1
4
DISTVERSION=	5.0.0
5
CATEGORIES=	devel java
5
CATEGORIES=	devel java
6
MASTER_SITES=	https://storage.googleapis.com/bazel/${PORTVERSION}/rc${FINALRC}/
6
MASTER_SITES=	https://storage.googleapis.com/bazel/${PORTVERSION}/rc${FINALRC}/
7
DISTNAME=	bazel-${PORTVERSION}rc${FINALRC}-dist
7
DISTNAME=	bazel-${PORTVERSION}rc${FINALRC}-dist
Lines 25-31 Link Here
25
CPE_VENDOR=	google
25
CPE_VENDOR=	google
26
26
27
USE_JAVA=	yes
27
USE_JAVA=	yes
28
JAVA_VERSION=	1.8
28
JAVA_VERSION=	11
29
JAVA_VENDOR=	openjdk
29
JAVA_VENDOR=	openjdk
30
JAVA_BUILD=	yes
30
JAVA_BUILD=	yes
31
JAVA_RUN=	yes
31
JAVA_RUN=	yes
Lines 40-46 Link Here
40
# In bazel, a release is always code-wise identical to the final release candidate.
40
# In bazel, a release is always code-wise identical to the final release candidate.
41
# Hence we can also download that one and so have a simple way to also test earlier release
41
# Hence we can also download that one and so have a simple way to also test earlier release
42
# candidates.
42
# candidates.
43
FINALRC=	2
43
FINALRC=	4
44
44
45
.include <bsd.port.pre.mk>
45
.include <bsd.port.pre.mk>
46
46
Lines 55-60 Link Here
55
pre-patch:
55
pre-patch:
56
	@${CP} ${FILESDIR}/extra-patch-absl_base_internal_unscaledcycleclock.cc \
56
	@${CP} ${FILESDIR}/extra-patch-absl_base_internal_unscaledcycleclock.cc \
57
		${FILESDIR}/extra-patch-bazel_grpc__deps.bzl \
57
		${FILESDIR}/extra-patch-bazel_grpc__deps.bzl \
58
		${FILESDIR}/extra-patch-bazel_build_defs.bzl \
58
		${WRKSRC}/third_party/grpc/
59
		${WRKSRC}/third_party/grpc/
59
60
60
# Have the location of the system-wide rc file reside ${ETCDIR}.
61
# Have the location of the system-wide rc file reside ${ETCDIR}.
Lines 65-71 Link Here
65
	-e "s|/etc/bazel.bazelrc|${ETCDIR}/bazel.bazelrc|" \
66
	-e "s|/etc/bazel.bazelrc|${ETCDIR}/bazel.bazelrc|" \
66
	${WRKSRC}/src/main/cpp/BUILD
67
	${WRKSRC}/src/main/cpp/BUILD
67
	@${ECHO_CMD} build --strategy=Javac=standalone >> ${WRKSRC}/scripts/packages/bazel.bazelrc
68
	@${ECHO_CMD} build --strategy=Javac=standalone >> ${WRKSRC}/scripts/packages/bazel.bazelrc
68
	@${ECHO_CMD} build --host_javabase=@local_jdk//:jdk >> ${WRKSRC}/scripts/packages/bazel.bazelrc
69
	@${ECHO_CMD} build --java_runtime_version=${JAVA_VERSION} >> ${WRKSRC}/scripts/packages/bazel.bazelrc
70
	@${ECHO_CMD} build --tool_java_runtime_version=${JAVA_VERSION} >> ${WRKSRC}/scripts/packages/bazel.bazelrc
69
	@${ECHO_CMD} build --action_env=PATH=/bin:/usr/bin/:${LOCALBASE}/bin >> ${WRKSRC}/scripts/packages/bazel.bazelrc
71
	@${ECHO_CMD} build --action_env=PATH=/bin:/usr/bin/:${LOCALBASE}/bin >> ${WRKSRC}/scripts/packages/bazel.bazelrc
70
	@${REINPLACE_CMD} \
72
	@${REINPLACE_CMD} \
71
	-e 's|^\(PYTHON_BIN=.*\)|if [ "%VERSION%" = "3" ] ; then PYTHON_BIN=${PYTHON_CMD}; else \1 ; fi|' \
73
	-e 's|^\(PYTHON_BIN=.*\)|if [ "%VERSION%" = "3" ] ; then PYTHON_BIN=${PYTHON_CMD}; else \1 ; fi|' \
Lines 73-78 Link Here
73
	@${REINPLACE_CMD} \
75
	@${REINPLACE_CMD} \
74
	-e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' \
76
	-e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' \
75
	${WRKSRC}/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
77
	${WRKSRC}/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
78
	@${REINPLACE_CMD} \
79
	-e 's|%%JAVA_HOME%%|${JAVA_HOME}|' \
80
	${WRKSRC}/src/main/cpp/blaze_util_bsd.cc
76
81
77
do-build:
82
do-build:
78
	@${MKDIR} ${WRKDIR}/bazel_tmp
83
	@${MKDIR} ${WRKDIR}/bazel_tmp
Lines 82-93 Link Here
82
	fi ; \
87
	fi ; \
83
	cd ${WRKSRC} && \
88
	cd ${WRKSRC} && \
84
	${SETENV} BAZEL_SH=${LOCALBASE}/bin/bash \
89
	${SETENV} BAZEL_SH=${LOCALBASE}/bin/bash \
90
	JAVA_HOME=${JAVA_HOME} \
91
	JAVA_VERSION=${JAVA_VERSION} \
85
	TMPDIR=${WRKDIR}/bazel_tmp \
92
	TMPDIR=${WRKDIR}/bazel_tmp \
86
	EMBED_LABEL='${PORTVERSION}' \
93
	EMBED_LABEL='${PORTVERSION}' \
87
	PATH=${LOCALBASE}/bin:$$PATH \
94
	PATH=${LOCALBASE}/bin:$$PATH \
88
	SOURCE_DATE_EPOCH=$${SOURCE_DATE_EPOCH} \
95
	SOURCE_DATE_EPOCH=$${SOURCE_DATE_EPOCH} \
89
	BAZEL_JAVAC_OPTS=${BAZEL_JAVAC_OPTS} \
96
	BAZEL_JAVAC_OPTS=${BAZEL_JAVAC_OPTS} \
90
	EXTRA_BAZEL_ARGS=--host_javabase=@local_jdk//:jdk \
97
	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}' \
91
	${LOCALBASE}/bin/bash ./compile.sh)
98
	${LOCALBASE}/bin/bash ./compile.sh)
92
99
93
do-install:
100
do-install:
(-)bazel/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1630150517
1
TIMESTAMP = 1642256198
2
SHA256 (bazel-4.2.1rc2-dist.zip) = d92998f7503a74e9e4f8aef5c81d85849abfed51d9d8fb622103c4eb5d1330a7
2
SHA256 (bazel-5.0.0rc4-dist.zip) = c077713b8ee63691b0d5a658ddb6daf879f6082d3cbdd6d610d79f250675350b
3
SIZE (bazel-4.2.1rc2-dist.zip) = 279265298
3
SIZE (bazel-5.0.0rc4-dist.zip) = 235869975
(-)bazel/files/extra-patch-bazel_build_defs.bzl (+10 lines)
Line 0 Link Here
1
--- bazel/build_defs.bzl.orig	2022-01-20 13:04:32.306692000 +0100
2
+++ bazel/build_defs.bzl	2022-01-20 13:05:02.002057000 +0100
3
@@ -35,6 +35,7 @@
4
         # "-Wshorten-64-to-32",  # not in GCC (and my Kokoro images doesn't have Clang)
5
         "-Werror",
6
         "-Wno-long-long",
7
+        "-Wno-deprecated-copy",
8
         # copybara:strip_end
9
     ],
10
 })
(-)bazel/files/extra-patch-bazel_grpc__deps.bzl (-6 / +14 lines)
Lines 1-10 Link Here
1
--- a/bazel/grpc_deps.bzl.orig	2021-10-11 15:54:07.083144000 +0200
1
--- a/bazel/grpc_deps.bzl
2
+++ b/bazel/grpc_deps.bzl	2021-10-11 16:02:48.722952000 +0200
2
+++ b/bazel/grpc_deps.bzl
3
@@ -239,6 +239,7 @@
3
@@ -284,6 +284,7 @@
4
     if "com_google_absl" not in native.existing_rules():
5
         http_archive(
4
         http_archive(
6
             name = "com_google_absl",
5
             name = "com_google_absl",
6
             sha256 = "35f22ef5cb286f09954b7cc4c85b5a3f6221c9d4df6b8c4a1e9d399555b366ee",
7
+            patches = ["//third_party/grpc:extra-patch-absl_base_internal_unscaledcycleclock.cc"],
7
+            patches = ["//third_party/grpc:extra-patch-absl_base_internal_unscaledcycleclock.cc"],
8
             sha256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a",
8
             strip_prefix = "abseil-cpp-997aaf3a28308eba1b9156aa35ab7bca9688e9f6",
9
             strip_prefix = "abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d",
10
             urls = [
9
             urls = [
10
                 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/997aaf3a28308eba1b9156aa35ab7bca9688e9f6.tar.gz",
11
@@ -339,6 +340,7 @@
12
         http_archive(
13
             name = "upb",
14
             sha256 = "6a5f67874af66b239b709c572ac1a5a00fdb1b29beaf13c3e6f79b1ba10dc7c4",
15
+            patches = ["//third_party/grpc:extra-patch-bazel_build_defs.bzl"],
16
             strip_prefix = "upb-2de300726a1ba2de9a468468dc5ff9ed17a3215f",
17
             urls = [
18
                 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/2de300726a1ba2de9a468468dc5ff9ed17a3215f.tar.gz",
(-)bazel/files/patch-WORKSPACE (-14 lines)
Lines 1-14 Link Here
1
--- WORKSPACE.orig	2021-10-11 09:54:26 UTC
2
+++ WORKSPACE
3
@@ -1232,7 +1232,10 @@ register_toolchains("//src/main/res:empty_rc_toolchain
4
 http_archive(
5
     name = "com_github_grpc_grpc",
6
     patch_args = ["-p1"],
7
-    patches = ["//third_party/grpc:grpc_1.33.1.patch"],
8
+    patches = [
9
+	"//third_party/grpc:grpc_1.33.1.patch",
10
+	"//third_party/grpc:extra-patch-bazel_grpc__deps.bzl",
11
+    ],
12
     sha256 = "58eaee5c0f1bd0b92ebe1fa0606ec8f14798500620e7444726afcaf65041cb63",
13
     strip_prefix = "grpc-1.33.1",
14
     urls = [
(-)bazel/files/patch-distdir_deps.bzl (+10 lines)
Line 0 Link Here
1
--- distdir_deps.bzl.orig	2022-01-20 19:08:32.519912000 +0100
2
+++ distdir_deps.bzl	2022-01-20 19:09:15.892216000 +0100
3
@@ -130,6 +130,7 @@
4
         "patch_args": ["-p1"],
5
         "patches": [
6
             "//third_party/grpc:grpc_1.41.0.patch",
7
+            "//third_party/grpc:extra-patch-bazel_grpc__deps.bzl",
8
         ],
9
         "used_in": [
10
             "additional_distfiles",
(-)bazel/files/patch-scripts_bootstrap_BUILD.bootstrap (+13 lines)
Line 0 Link Here
1
--- scripts/bootstrap/BUILD.bootstrap.orig	2021-11-21 10:05:34.725756000 +0100
2
+++ scripts/bootstrap/BUILD.bootstrap	2021-11-21 10:05:52.216389000 +0100
3
@@ -16,8 +16,8 @@
4
         "-XX:TieredStopAtLevel=1",
5
     ],
6
     singlejar = ["//src/tools/singlejar:singlejar"],
7
-    source_version = "8",
8
+    source_version = "11",
9
     tags = ["manual"],
10
-    target_version = "8",
11
+    target_version = "11",
12
     visibility = ["//visibility:public"],
13
 )
(-)bazel/files/patch-src_main_cpp_blaze_util_bsd.cc (+11 lines)
Line 0 Link Here
1
--- ./src/main/cpp/blaze_util_bsd.cc.orig	2021-12-27 19:03:17.978454000 +0100
2
+++ ./src/main/cpp/blaze_util_bsd.cc	2021-12-27 19:04:07.874550000 +0100
3
@@ -14,7 +14,7 @@
4
 
5
 #if defined(__FreeBSD__)
6
 # define HAVE_PROCSTAT
7
-# define STANDARD_JAVABASE "/usr/local/openjdk8"
8
+# define STANDARD_JAVABASE "%%JAVA_HOME%%"
9
 #elif defined(__OpenBSD__)
10
 # define STANDARD_JAVABASE "/usr/local/jdk-1.8.0"
11
 #else
(-)bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_BazelPythonSemantics.java (-6 / +6 lines)
Lines 1-13 Link Here
1
--- src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java.orig	1979-12-31 23:00:00 UTC
1
--- src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java.orig	1979-12-31 23:00:00 UTC
2
+++ src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
2
+++ src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
3
@@ -247,9 +247,9 @@ public class BazelPythonSemantics implem
3
@@ -238,9 +238,8 @@
4
 
5
       if (OS.getCurrent() != OS.WINDOWS) {
4
         PathFragment shExecutable = ShToolchain.getPathOrError(ruleContext);
6
         PathFragment shExecutable = ShToolchain.getPathOrError(ruleContext);
5
         // TODO(#8685): Remove this special-case handling as part of making the proper shebang a
7
-        String pythonExecutableName = "python3";
6
         // property of the Python toolchain configuration.
8
-        // NOTE: keep the following line intact to support nix builds
7
-        String pythonExecutableName = OS.getCurrent() == OS.OPENBSD ? "python3" : "python";
8
+        String pythonExecutableName = "%%PYTHON_CMD%%";
9
         // NOTE: keep the following line intact to support nix builds
10
-        String pythonShebang = "#!/usr/bin/env " + pythonExecutableName;
9
-        String pythonShebang = "#!/usr/bin/env " + pythonExecutableName;
10
+        String pythonExecutableName = "%%PYTHON_CMD%%";
11
+        String pythonShebang = "#!" + pythonExecutableName;
11
+        String pythonShebang = "#!" + pythonExecutableName;
12
         ruleContext.registerAction(
12
         ruleContext.registerAction(
13
             new SpawnAction.Builder()
13
             new SpawnAction.Builder()
(-)bazel/files/patch-tools__jdk__default_java_toolchain.bzl (-39 lines)
Lines 1-39 Link Here
1
--- tools/jdk/default_java_toolchain.bzl.orig	1979-12-31 23:00:00 UTC
2
+++ tools/jdk/default_java_toolchain.bzl
3
@@ -21,27 +21,6 @@ JDK8_JVM_OPTS = [
4
 ]
5
 
6
 JDK9_JVM_OPTS = [
7
-    # Allow JavaBuilder to access internal javac APIs.
8
-    "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
9
-    "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
10
-    "--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
11
-    "--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
12
-    "--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
13
-    "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
14
-    "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
15
-    "--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
16
-    "--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
17
-    "--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
18
-
19
-    # override the javac in the JDK.
20
-    "--patch-module=java.compiler=$(location @bazel_tools//tools/jdk:java_compiler_jar)",
21
-    "--patch-module=jdk.compiler=$(location @bazel_tools//tools/jdk:jdk_compiler_jar)",
22
-
23
-    # quiet warnings from com.google.protobuf.UnsafeUtil,
24
-    # see: https://github.com/google/protobuf/issues/3781
25
-    # and: https://github.com/bazelbuild/bazel/issues/5599
26
-    "--add-opens=java.base/java.nio=ALL-UNNAMED",
27
-    "--add-opens=java.base/java.lang=ALL-UNNAMED",
28
 ]
29
 
30
 DEFAULT_JAVACOPTS = [
31
@@ -67,7 +46,7 @@ DEFAULT_TOOLCHAIN_CONFIGURATION = {
32
     "javac_supports_workers": 1,
33
     "jvm_opts": select({
34
         "@bazel_tools//src/conditions:openbsd": JDK8_JVM_OPTS,
35
-        "//conditions:default": JDK9_JVM_OPTS,
36
+        "//conditions:default": JDK8_JVM_OPTS,
37
     }),
38
     "misc": DEFAULT_JAVACOPTS,
39
     "singlejar": ["@bazel_tools//tools/jdk:singlejar"],

Return to bug 261363