feat(extraction): generate build metadata kzip in bazel-extractor docker image
@@ -86,5 +86,13 @@ fi
mkdir -p "$KYTHE_OUTPUT_DIRECTORY"
find bazel-out/*/extra_actions/external/kythe_release -name '*.kzip' | \
xargs -r /kythe/tools/kzip merge --append --encoding "$KYTHE_KZIP_ENCODING" --output "$KYTHE_OUTPUT_DIRECTORY/compilations.kzip"
+
+# Record the timestamp of the git commit in a metadata kzip.
+/kythe/tools/kzip create_metadata \
+ --output buildmetadata.kzip \
+ --corpus "$KYTHE_CORPUS" \
+ --commit_timestamp "$(git log --pretty='%ad' -n 1 HEAD)"
+/kythe/tools/kzip merge --append --encoding "$KYTHE_KZIP_ENCODING" --output "$KYTHE_OUTPUT_DIRECTORY/compilations.kzip" buildmetadata.kzip
+
/kythe/fix_permissions.sh "$KYTHE_OUTPUT_DIRECTORY"
test -f "$KYTHE_OUTPUT_DIRECTORY/compilations.kzip"
