From d784b5f91868161eb3be7e392dcf29e1079ad50b Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Wed, 20 Jun 2018 02:06:58 -0700 Subject: Bazel binary size: add a regression test Add a regression test for the size of the Bazel binary, by asserting the number of embedded tools. Sudden, unexpectedly large changes in the number of embedded tools can be indicative of an unintentional addition/removal of embedded tools and unexpected growth/shrinkage of the Bazel binary. Fixes https://github.com/bazelbuild/bazel/issues/5378 Change-Id: I7880f4544c560eb627ef5fb8a55ff1b377ec156b Closes #5399. Change-Id: I10c8cdcd5e675cbc0bac43003741a8af27248992 PiperOrigin-RevId: 201318396 --- src/BUILD | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/BUILD') diff --git a/src/BUILD b/src/BUILD index 4b96719a74..551e23b258 100644 --- a/src/BUILD +++ b/src/BUILD @@ -1,6 +1,7 @@ # Packaging load(":embedded_tools.bzl", "srcsfile") +load(":rule_size_test.bzl", "rule_size_test") md5_cmd = "set -e -o pipefail && cat $(SRCS) | sort | %s | awk '{ print $$1; }' > $@" @@ -182,6 +183,16 @@ py_binary( "_nojdk", ]] +rule_size_test( + name = "embedded_tools_size_test", + src = ":embedded_tools_srcs", + # WARNING: Only adjust the number in `expect` if you are intentionally + # adding or removing embedded tools. Know that the more embedded tools there + # are in Bazel, the bigger the binary becomes and the slower Bazel starts. + expect = 503, + margin = 5, # percentage +) + filegroup( name = "embedded_jdk", srcs = select({ -- cgit v1.2.3