summaryrefslogtreecommitdiff
path: root/build_kzip.bash
diff options
context:
space:
mode:
author Sasha Smundak <asmundak@google.com> 2022-08-08 17:31:06 -0700
committer Alexander Smundak <asmundak@google.com> 2022-08-09 17:55:47 +0000
commit8df2a5c2fb2b9360862d5f7fd9b6b56bb9bf0b55 (patch)
treed5acc11f21f32b9f54b0df80573bc9d5deb03c4c /build_kzip.bash
parentaaf4f5ec8a57ad03ca34b6c4469ac883d95f3955 (diff)
Go extractor should succeed
Test: treehugger Fixes: 241561896 Change-Id: I182ae375be33f355275d1c2fd54e2cb1ac913354
Diffstat (limited to 'build_kzip.bash')
-rwxr-xr-xbuild_kzip.bash9
1 files changed, 6 insertions, 3 deletions
diff --git a/build_kzip.bash b/build_kzip.bash
index fa616b94d..eeef7d4de 100755
--- a/build_kzip.bash
+++ b/build_kzip.bash
@@ -45,11 +45,13 @@ declare -r go_root=$(realpath prebuilts/go/linux-x86)
declare -r source_root=$PWD
# For the Go code, we invoke the extractor directly. The two caveats are that
-# the extractor's rewrite rules are generated on the fly as they depend on the XREF_CORPUS
-# value, and that the name of the kzip file is derived from the directory name
-# by replacing '/' with '_'.
+# the extractor's rewrite rules are generated on the fly as they depend on the
+# value of XREF_CORPUS, and that the name of the kzip file is derived from the
+# directory name by replacing '/' with '_'.
+# Go extractor should succeed.
declare -ar go_modules=(build/blueprint build/soong
build/make/tools/canoninja build/make/tools/compliance build/make/tools/rbcrun)
+set -e
for dir in "${go_modules[@]}"; do
(cd "$dir";
outfile=$(echo "$dir" | sed -r 's|/|_|g;s|(.*)|\1.go.kzip|');
@@ -58,6 +60,7 @@ for dir in "${go_modules[@]}"; do
--canonicalize_package_corpus --output "${abspath_out}/soong/$outfile" ./...
)
done
+set +e
declare -r kzip_count=$(find "$out" -name '*.kzip' | wc -l)
(($kzip_count>100000)) || { printf "Too few kzip files were generated: %d\n" $kzip_count; exit 1; }