From 04e4dfa26e7fe4a000c9bf67bd099cad495d5892 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Thu, 24 Aug 2023 23:19:30 -0700 Subject: [PATCH] Use ninja rspfile for list of provenance metadata file of modules, in case there are many provenance metadata files and the list might exceed the command line length limit. Bug: 297350341 Test: CIs & manual test Change-Id: Iff4da6de019d62d7ce8545241b3a289cff0f33de --- provenance/provenance_singleton.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/provenance/provenance_singleton.go b/provenance/provenance_singleton.go index 5d27c0cf4..97345afc3 100644 --- a/provenance/provenance_singleton.go +++ b/provenance/provenance_singleton.go @@ -38,7 +38,9 @@ var ( Command: `rm -rf $out && ` + `echo "# proto-file: build/soong/provenance/proto/provenance_metadata.proto" > $out && ` + `echo "# proto-message: ProvenanceMetaDataList" >> $out && ` + - `for file in $in; do echo '' >> $out; echo 'metadata {' | cat - $$file | grep -Ev "^#.*|^$$" >> $out; echo '}' >> $out; done`, + `cat $out.rsp | tr ' ' '\n' | while read -r file || [ -n "$$file" ]; do echo '' >> $out; echo 'metadata {' | cat - $$file | grep -Ev "^#.*|^$$" >> $out; echo '}' >> $out; done`, + Rspfile: `$out.rsp`, + RspfileContent: `$in`, }) )