From 0783b9e81328729353cfad7ec25391c03d7f772a Mon Sep 17 00:00:00 2001 From: László Csomor Date: Fri, 11 Aug 2017 10:28:36 +0200 Subject: Rewrite //:combine_distfiles.sh in Python It can only pack to zip for now (packing to tar is not trivial and I haven't figured it out yet). This allows building //:bazel-distfile on Windows. Previously it was either timing out or taking so long that it was unbearable (over 10 minutes). I never waited long enough to see it build. The new Python version runs under just a few seconds. Change-Id: I3264eb7132dd58c581c4216e5bbab035a79d716d PiperOrigin-RevId: 164954162 --- BUILD | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'BUILD') diff --git a/BUILD b/BUILD index e4064a44cb..3c506215c8 100644 --- a/BUILD +++ b/BUILD @@ -68,6 +68,13 @@ pkg_tar( visibility = ["//:__subpackages__"], ) +py_binary( + name = "combine_distfiles", + srcs = ["combine_distfiles.py"], + visibility = ["//visibility:private"], + deps = ["//src:create_embedded_tools_lib"], +) + genrule( name = "bazel-distfile", srcs = [ @@ -75,8 +82,8 @@ genrule( "//src:derived_java_srcs", ], outs = ["bazel-distfile.zip"], - cmd = "$(location :combine_distfiles.sh) $@ $(SRCS)", - tools = ["combine_distfiles.sh"], + cmd = "$(location :combine_distfiles) $@ $(SRCS)", + tools = [":combine_distfiles"], # Public but bazel-only visibility. visibility = ["//:__subpackages__"], ) @@ -88,8 +95,8 @@ genrule( "//src:derived_java_srcs", ], outs = ["bazel-distfile.tar"], - cmd = "env USE_TAR=YES $(location :combine_distfiles.sh) $@ $(SRCS)", - tools = ["combine_distfiles.sh"], + cmd = "$(location :combine_distfiles_to_tar.sh) $@ $(SRCS)", + tools = ["combine_distfiles_to_tar.sh"], # Public but bazel-only visibility. visibility = ["//:__subpackages__"], ) -- cgit v1.2.3