From bc0c5aec5ca113f97a0d9b86d03e844cb4c553fb Mon Sep 17 00:00:00 2001 From: Jonathan Springer Date: Fri, 24 Jan 2020 07:28:53 +0000 Subject: [PATCH 1/2] Add s390x and make zip -d step more resilient --- third_party/BUILD | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/third_party/BUILD b/third_party/BUILD index e936781c77d7fb..56abafd5edd567 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -469,11 +469,12 @@ UNNECESSARY_DYNAMIC_LIBRARIES = select({ "//src/conditions:arm": "*.so *.jnilib *.dll", "//src/conditions:linux_aarch64": "*.so *.jnilib *.dll", "//src/conditions:linux_ppc": "*.so *.jnilib *.dll", - "//src/conditions:freebsd": "*.so *.jnilib *.dll", - "//src/conditions:openbsd": "*.so *.jnilib *.dll", - # Play it safe -- better have a big binary than a slow binary - # zip -d does require an argument. Supply something bogus. - "//conditions:default": "*.bogusextension", + "//src/conditions:linux_s390x": "*.so *.jnilib *.dll", + # Default is to play it safe -- better have a big binary than a slow binary + # The empty string means nothing is to be removed from the library; + # the rule command tests for the empty string explictly to avoid + # zip erroring when it finds nothing to remove. + "//conditions:default": "", }) # Remove native libraries that are for a platform different from the one we are @@ -482,7 +483,10 @@ genrule( name = "filter_netty_dynamic_libs", srcs = ["netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar"], outs = ["netty_tcnative/netty-tcnative-filtered.jar"], - cmd = "cp $< $@ && zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES, + cmd = "cp $< $@ && " + + # End successfully if there is nothing to be deleted from the archive + "if [ -n '" + UNNECESSARY_DYNAMIC_LIBRARIES + "' ]; then " + + "zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES + "; fi", ) java_import( From 2011acdabfb027cead26b6d8c7c2f77043b790f0 Mon Sep 17 00:00:00 2001 From: Jonathan Springer Date: Mon, 17 Feb 2020 13:58:43 +0000 Subject: [PATCH 2/2] Restore freebsd and openbsd to third_party/BUILD --- third_party/BUILD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/third_party/BUILD b/third_party/BUILD index 56abafd5edd567..7693866074ed1b 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -470,6 +470,8 @@ UNNECESSARY_DYNAMIC_LIBRARIES = select({ "//src/conditions:linux_aarch64": "*.so *.jnilib *.dll", "//src/conditions:linux_ppc": "*.so *.jnilib *.dll", "//src/conditions:linux_s390x": "*.so *.jnilib *.dll", + "//src/conditions:freebsd": "*.so *.jnilib *.dll", + "//src/conditions:openbsd": "*.so *.jnilib *.dll", # Default is to play it safe -- better have a big binary than a slow binary # The empty string means nothing is to be removed from the library; # the rule command tests for the empty string explictly to avoid