From 9dabbb12f3dbccf4919662979d36438ca2863768 Mon Sep 17 00:00:00 2001 From: buchgr Date: Mon, 2 Jul 2018 07:32:26 -0700 Subject: [PATCH] reduce the size of bazel's embedded jdk The JDK9 compressed binary size increased to ~200MiB from ~85MiB in JDK8. We built a JDK reduced in size to ~50MiB, that still ships with a full set of APIs. See https://docs.google.com/document/d/1Igmv-2GfXkoVFWTXvBYPeniQom8nLAwzqzridDlBIS4 for more details. Commands to build the Linux JDK: curl https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz -o zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz tar -xf zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz cd zulu9.0.7.1-jdk9.0.7-linux_x64/ ./bin/jlink --module-path ./jmods/ --add-modules java.activation,java.base,java.compiler,java.corba,java.datatransfer,java.desktop,java.instrument,java.logging,java.management,java.management.rmi,java.naming,java.prefs,java.rmi,java.scripting,java.se,java.se.ee,java.security.jgss,java.security.sasl,java.smartcardio,java.sql,java.sql.rowset,java.transaction,java.xml,java.xml.bind,java.xml.crypto,java.xml.ws,java.xml.ws.annotation,jdk.accessibility,jdk.aot,jdk.attach,jdk.charsets,jdk.compiler,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.dynalink,jdk.editpad,jdk.hotspot.agent,jdk.httpserver,jdk.incubator.httpclient,jdk.internal.ed,jdk.internal.jvmstat,jdk.internal.le,jdk.internal.opt,jdk.internal.vm.ci,jdk.internal.vm.compiler,jdk.jartool,jdk.javadoc,jdk.jcmd,jdk.jconsole,jdk.jdeps,jdk.jdi,jdk.jdwp.agent,jdk.jlink,jdk.jshell,jdk.jsobject,jdk.jstatd,jdk.localedata,jdk.management,jdk.management.agent,jdk.naming.dns,jdk.naming.rmi,jdk.net,jdk.pack,jdk.policytool,jdk.rmic,jdk.scripting.nashorn,jdk.scripting.nashorn.shell,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.xml.bind,jdk.xml.dom,jdk.xml.ws,jdk.zipfs --vm=server --strip-debug --no-man-pages --output zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules cp DISCLAIMER readme.txt zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules/ GZIP=-9 tar -zcf ./zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules.tar.gz zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules RELNOTES: None PiperOrigin-RevId: 202948182 --- WORKSPACE | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 015e37f8e17cab..c7e97888c48b65 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -117,31 +117,25 @@ distdir_tar( # OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK. http_file( name = "openjdk_linux", - sha256 = "45f2dfbee93b91b1468cf81d843fc6d9a47fef1f831c0b7ceff4f1eb6e6851c8", + sha256 = "f27cb933de4f9e7fe9a703486cf44c84bc8e9f138be0c270c9e5716a32367e87", urls = [ - "https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz", - "https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz", + "https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64-allmodules.tar.gz", ], ) http_file( name = "openjdk_macos", - sha256 = "5a5b3225b86d3fdb51e9add5335f43cc19c6b2d9b8b5558e72b52d7b2ce9162e", + sha256 = "7a1e769a433948b3d1215911730c17fc2f2710348df18aa966b38c39e4cfe444", urls = [ - "https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz", - "https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz", - "https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz", + "https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-macosx_x64-allmodules.tar.gz", ], ) http_file( name = "openjdk_win", - sha256 = "75f76c53c6a1f12b1a571b86bd9708ab75adf582d689dddc94fdd77dcc0f3f5c", + sha256 = "e738829017f107e7a7cd5069db979398ec3c3f03ef56122f89ba38e7374f63ed", urls = [ - "https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-win_x64.zip", - "https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-win_x64.zip", - "https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-win_x64.zip", + "https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-win_x64-allmodules.zip", ], )