Commit 9af08ccb authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[gcmole] Make packaging more deterministic

Tar and Gzip would include timestamps for files in the gcmole package,
which meant that they weren't deterministic across multiple builds. Now
we strip out the timestamps (as well as owner/group information) to make
the packaging more deterministic.

Change-Id: Iec3195ede4150c1603927fec748455329a8da677
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3245112Reviewed-by: 's avatarLiviu Rau <liviurau@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77539}
parent cfee5e88
...@@ -33,9 +33,17 @@ mkdir -p "${PACKAGE_DIR}/lib" ...@@ -33,9 +33,17 @@ mkdir -p "${PACKAGE_DIR}/lib"
cp -r "${BUILD_DIR}/lib/clang" "${PACKAGE_DIR}/lib" cp -r "${BUILD_DIR}/lib/clang" "${PACKAGE_DIR}/lib"
cp "${THIS_DIR}/libgcmole.so" "${PACKAGE_DIR}" cp "${THIS_DIR}/libgcmole.so" "${PACKAGE_DIR}"
# Generate the archive # Generate the archive. Set some flags on tar to make the output more
# deterministic (e.g. not dependent on timestamps by using the timestamp of
# gcmole.cc for all files)
cd "$(dirname "${PACKAGE_DIR}")" cd "$(dirname "${PACKAGE_DIR}")"
tar -c -z -f "${PACKAGE_FILE}" "$(basename "${PACKAGE_DIR}")" tar \
--sort=name \
--owner=root:0 \
--group=root:0 \
--mtime="${THIS_DIR}/gcmole.cc" \
--create \
"$(basename "${PACKAGE_DIR}")" | gzip --no-name >"${PACKAGE_FILE}"
# Generate checksum # Generate checksum
sha1sum "${PACKAGE_FILE}" | awk '{print $1}' > "${PACKAGE_SUM}" sha1sum "${PACKAGE_FILE}" | awk '{print $1}' > "${PACKAGE_SUM}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment