aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/BUILD
diff options
context:
space:
mode:
authorGravatar Philipp Wollermann <philwo@google.com>2017-03-17 15:11:58 +0000
committerGravatar Yue Gan <yueg@google.com>2017-03-20 11:35:58 +0000
commit9504827b21217aaa28a248ce499dd25c6a415d6e (patch)
tree5eb03b2cd0318d7dc3cb067e1898fd1678ac01e5 /src/BUILD
parent6b2d8b8c63938d200848618b847da96d54f22d72 (diff)
Build a version of Bazel with a bundled OpenJDK inside the binary.
We're using Azul Systems, Inc.'s ZuluĀ® OpenJDK build[1], as it's a good vanilla build of OpenJDK available for our three most important platforms: zulu8.20.0.5-jdk8.0.121-linux_x64.tar.gz zulu8.20.0.5-jdk8.0.121-macosx_x64.zip zulu8.20.0.5-jdk8.0.121-win_x64.zip You can build & run a Bazel binary with an embedded JDK by simple doing: bazel build //src:bazel_with_jdk bazel-bin/src/bazel_with_jdk info The "bazel license" command prints the license of the embedded OpenJDK. We mirror the binaries and sources of the OpenJDK used for bundling on this website: https://bazel-mirror.storage.googleapis.com/openjdk/index.html RELNOTES: Bazel can now be built with a bundled version of the OpenJDK. This makes it possible to use Bazel on systems without a JDK, or where the installed JDK is too old. [1] http://www.azul.com/downloads/zulu/ -- PiperOrigin-RevId: 150440467 MOS_MIGRATED_REVID=150440467
Diffstat (limited to 'src/BUILD')
-rw-r--r--src/BUILD35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/BUILD b/src/BUILD
index fb39187996..416ffb04fb 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -40,6 +40,7 @@ filegroup(
}),
) for suffix, embedded_tools in {
"": [":embedded_tools"],
+ "_with_jdk": [":embedded_tools_with_jdk"],
"_notools": [],
}.items()]
@@ -127,8 +128,8 @@ filegroup(
],
)
-genrule(
- name = "embedded_tools",
+[genrule(
+ name = "embedded_tools" + suffix,
srcs = [
":create_embedded_tools.sh",
"//tools:embedded_tools_srcs",
@@ -171,14 +172,33 @@ genrule(
"//conditions:default": [
"//src/java_tools/buildjar/java/com/google/devtools/build/java/turbine:turbine_deploy.jar",
],
- }),
- outs = ["embedded_tools.zip"],
+ }) + (select({
+ ":darwin": [
+ "@openjdk_macos//file",
+ ],
+ ":darwin_x86_64": [
+ "@openjdk_macos//file",
+ ],
+ ":windows": [
+ "@openjdk_win//file",
+ ],
+ ":windows_msvc": [
+ "@openjdk_win//file",
+ ],
+ "//conditions:default": [
+ "@openjdk_linux//file",
+ ],
+ }) if (suffix == "_with_jdk") else []),
+ outs = ["embedded_tools" + suffix + ".zip"],
cmd = "$(location :create_embedded_tools.sh) $@ $(SRCS)",
-)
+) for suffix in [
+ "",
+ "_with_jdk",
+]]
[genrule(
name = "package-zip" + suffix,
- srcs = ([":embedded_tools.zip"] if embed else []) + [
+ srcs = ([":embedded_tools" + suffix + ".zip"] if embed else []) + [
# The script assumes that the embedded tools zip (if exists) is the
# first item here, the deploy jar the second and install base key is the
# third
@@ -199,6 +219,7 @@ genrule(
) for suffix, embed in [
("", True),
("_notools", False),
+ ("_with_jdk", True),
]]
[genrule(
@@ -223,6 +244,7 @@ genrule(
) for suffix in [
"",
"_notools",
+ "_with_jdk",
]]
# Build an executable named `bazel.exe`.
@@ -243,6 +265,7 @@ genrule(
) for suffix in [
"",
"_notools",
+ "_with_jdk",
]]
config_setting(