aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Jakob Buchgraber <buchgr@google.com>2017-04-28 16:10:37 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-04-28 17:23:58 +0200
commit6e36984927234ad3dd7a4b11b251cf4f3cf882d5 (patch)
treebdf181f908b1ca5d8c0c4a21ad9e0dff32dfc3f5 /src/main
parent6fa172100becb4bf60cd47b1c753e9dfa44c963f (diff)
Fix 'Argument list too long' error in :merge_licenses genrule
We pass every file in //third_party:srcs to merge_licenses.sh and when trying to update protobuf that list grew too large and caused errors on macOS. With xargs we can split the list of files into smaller chunks. Change-Id: I402813f14e35ca6dac393112ff4f3c963e789536 PiperOrigin-RevId: 154536807
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/BUILD4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/BUILD b/src/main/java/com/google/devtools/build/lib/BUILD
index 12f8867e45..6e0fb14e40 100644
--- a/src/main/java/com/google/devtools/build/lib/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/BUILD
@@ -1130,7 +1130,9 @@ genrule(
"//third_party:srcs",
],
outs = ["runtime/commands/LICENSE"],
- cmd = "$(location merge_licenses.sh) $(SRCS) > \"$@\"",
+ # Use xargs to avoid the shell script complaining that is has been passed too many arguments.
+ # xargs calls the script multiple times with at most 1000 arguments per call.
+ cmd = "echo \"$(SRCS)\" | xargs -n1000 $(location merge_licenses.sh) > \"$@\"",
tools = ["merge_licenses.sh"],
)