Skip to content

Commit

Permalink
Default to bazel with minimal embedded JDK.
Browse files Browse the repository at this point in the history
This will save ~22MB of the final bazel binary and ~120MB in the
install_base.

RELNOTES[INC]: //src:bazel uses the minimal embedded JDK, if you want to
avoid the extra steps of minimizing the JDK, use //src:bazel-dev
instead.

Closes #7049, part of #6314.

PiperOrigin-RevId: 228299644
  • Loading branch information
meisterT authored and Copybara-Service committed Jan 8, 2019
1 parent 9ebd779 commit c7bb751
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,14 @@ filegroup(
"_nojdk",
]]

genrule(
name = "bazel-bin",
srcs = [":bazel-bin_jdk_allmodules"],
outs = ["bazel"],
[genrule(
name = "bazel-bin" + suffix,
srcs = [":bazel-bin" + jdk],
outs = ["bazel" + suffix],
# In msys, a file path without .exe suffix(say foo), refers to a file with .exe
# suffix(say foo.exe), if foo.exe exists and foo doesn't. So, on windows, we
# need to remove bazel.exe first, so that cat to bazel won't fail.
cmd = "rm -f $@; cp $(location :bazel-bin_jdk_allmodules) $@",
cmd = "rm -f $@; cp $(location :bazel-bin" + jdk + ") $@",
executable = 1,
output_to_bindir = 1,
visibility = [
Expand All @@ -365,7 +365,10 @@ genrule(
"//src/java:__subpackages__", # For command line reference generation
"//src/test:__subpackages__", # For integration tests
],
)
) for suffix, jdk in [
("-dev", "_jdk_allmodules"),
("", "_jdk_minimal"),
]]

# Build an executable named `bazel.exe`.
# Works on all platforms but only makes sense on Windows.
Expand Down

0 comments on commit c7bb751

Please sign in to comment.