diff options
author | Lukacs Berki <lberki@google.com> | 2015-11-10 15:28:00 +0000 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2015-11-11 13:06:37 +0000 |
commit | c4e74d1e531b06d2c8be2fd7c265a14abbd2fc4f (patch) | |
tree | b4e943736e788db81088743bc32b271e6f8f91dd /src | |
parent | 8a3622e2595a6e728ed52c0a2d80c75e46916078 (diff) |
Make building Bazel more hermetic.
The -X option removes UID/GID information from the zip file, which of course is non-hermetic. There is still some weirdness with install_base_key, but I couldn't figure out what that is: the files that are checksummed are always the same and they are in the same order.
--
MOS_MIGRATED_REVID=107484288
Diffstat (limited to 'src')
-rw-r--r-- | src/BUILD | 2 | ||||
-rwxr-xr-x | src/create_embedded_tools.sh | 2 | ||||
-rwxr-xr-x | src/package-bazel.sh | 2 |
3 files changed, 3 insertions, 3 deletions
@@ -1,6 +1,6 @@ # Packaging -md5_cmd = "set -e -o pipefail && cat $(SRCS) | %s | awk '{ print $$1; }' > $@" +md5_cmd = "set -e -o pipefail && cat $(SRCS) | sort | %s | awk '{ print $$1; }' > $@" # TODO(bazel-team): find a better way to handle dylib extensions. filegroup( diff --git a/src/create_embedded_tools.sh b/src/create_embedded_tools.sh index 89375fc97c..2abd269a54 100755 --- a/src/create_embedded_tools.sh +++ b/src/create_embedded_tools.sh @@ -39,4 +39,4 @@ for i in $(find "${PACKAGE_DIR}" -name BUILD.tools); do mv "$i" "$(dirname "$i")/BUILD" done find "${PACKAGE_DIR}" -exec touch -t 198001010000.00 '{}' ';' -(cd "${PACKAGE_DIR}" && zip -qrD "${OUTPUT}" *) +(cd "${PACKAGE_DIR}" && find . -type f | sort | zip -qDX@ "${OUTPUT}") diff --git a/src/package-bazel.sh b/src/package-bazel.sh index 9181d812d2..27d0f5e06c 100755 --- a/src/package-bazel.sh +++ b/src/package-bazel.sh @@ -42,4 +42,4 @@ if [[ ${EMBEDDED_TOOLS} != "" ]]; then (cd ${PACKAGE_DIR}/embedded_tools && unzip -q ${WORKDIR}/${EMBEDDED_TOOLS}) fi -(cd ${PACKAGE_DIR}; zip -qrD ${WORKDIR}/${OUT} *) +(cd ${PACKAGE_DIR} && find . -type f | sort | zip -qDX@ ${WORKDIR}/${OUT}) |