Skip to content

Commit

Permalink
feat(docker_extract): support selecting encoding for kzip generation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysachs committed Aug 5, 2019
1 parent f717a0f commit 154cec5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kythe/extractors/bazel/extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# command so we avoid silent failures.
set -ex

: ${KYTHE_OUTPUT_DIRECTORY:?Missing output directory}
: "${KYTHE_OUTPUT_DIRECTORY:?Missing output directory}" "${KYTHE_KZIP_ENCODING:=JSON}"

if [[ -n "$KYTHE_SYSTEM_DEPS" ]]; then
echo "Installing $KYTHE_SYSTEM_DEPS"
Expand Down Expand Up @@ -82,6 +82,6 @@ fi
# Collect any extracted compilations.
mkdir -p "$KYTHE_OUTPUT_DIRECTORY"
find bazel-out/*/extra_actions/external/kythe_release -name '*.kzip' | \
xargs -r /kythe/tools/kzip merge --append --output "$KYTHE_OUTPUT_DIRECTORY/compilations.kzip"
xargs -r /kythe/tools/kzip merge --append --encoding "$KYTHE_KZIP_ENCODING" --output "$KYTHE_OUTPUT_DIRECTORY/compilations.kzip"
/kythe/fix_permissions.sh "$KYTHE_OUTPUT_DIRECTORY"
test -f "$KYTHE_OUTPUT_DIRECTORY/compilations.kzip"
5 changes: 3 additions & 2 deletions kythe/go/extractors/cmd/gotool/analyze_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
# Download, build, and extract a set of Go packages. Resulting compilations
# will be merged into a single .kzip archive in the "$OUTPUT" directory.

: "${TMPDIR:=/tmp}" "${OUTPUT:=/output}"
: "${TMPDIR:=/tmp}" "${OUTPUT:=/output}" "${KYTHE_KZIP_ENCODING:=JSON}"


FLAGS=()
PACKAGES=()
Expand Down Expand Up @@ -58,5 +59,5 @@ if [[ -f "$OUT" ]]; then
OUT="$(mktemp -p "$OUTPUT/" compilations.XXXXX.kzip)"
fi
echo "Merging compilations into $OUT" >&2
kzip merge --output "$OUT" "$TMPDIR"/out.*.kzip
kzip merge --encoding "$KYTHE_KZIP_ENCODING" --output "$OUT" "$TMPDIR"/out.*.kzip
fix_permissions.sh "$OUTPUT"

0 comments on commit 154cec5

Please sign in to comment.