Skip to content

Commit

Permalink
gzip: use --no-name to avoid saving timestamp
Browse files Browse the repository at this point in the history
Another source of non-reproducible builds!
  • Loading branch information
justinsb committed Feb 15, 2020
1 parent 721ed47 commit 2586d6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ protokube-image: protokube-build-in-docker
.PHONY: protokube-export
protokube-export: protokube-image
docker save protokube:${PROTOKUBE_TAG} > ${IMAGES}/protokube.tar
gzip --force --best ${IMAGES}/protokube.tar
gzip --no-name --force --best ${IMAGES}/protokube.tar
tools/sha1 ${IMAGES}/protokube.tar.gz ${IMAGES}/protokube.tar.gz.sha1
tools/sha256 ${IMAGES}/protokube.tar.gz ${IMAGES}/protokube.tar.gz.sha256

Expand Down Expand Up @@ -739,7 +739,7 @@ bazel-kops-controller-export:
mkdir -p ${BAZELIMAGES}
DOCKER_REGISTRY="" DOCKER_IMAGE_PREFIX="kope/" KOPS_CONTROLLER_TAG=${KOPS_CONTROLLER_TAG} bazel build ${BAZEL_CONFIG} --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/kops-controller:image-bundle.tar
cp -fp bazel-bin/cmd/kops-controller/image-bundle.tar ${BAZELIMAGES}/kops-controller.tar
gzip --force --fast ${BAZELIMAGES}/kops-controller.tar
gzip --no-name --force --fast ${BAZELIMAGES}/kops-controller.tar
tools/sha1 ${BAZELIMAGES}/kops-controller.tar.gz ${BAZELIMAGES}/kops-controller.tar.gz.sha1
tools/sha256 ${BAZELIMAGES}/kops-controller.tar.gz ${BAZELIMAGES}/kops-controller.tar.gz.sha256

Expand All @@ -748,7 +748,7 @@ bazel-dns-controller-export:
mkdir -p ${BAZELIMAGES}
DOCKER_REGISTRY="" DOCKER_IMAGE_PREFIX="kope/" DNS_CONTROLLER_TAG=${DNS_CONTROLLER_TAG} bazel build ${BAZEL_CONFIG} --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //dns-controller/cmd/dns-controller:image-bundle.tar
cp -fp bazel-bin/dns-controller/cmd/dns-controller/image-bundle.tar ${BAZELIMAGES}/dns-controller.tar
gzip --force --fast ${BAZELIMAGES}/dns-controller.tar
gzip --no-name --force --fast ${BAZELIMAGES}/dns-controller.tar
tools/sha1 ${BAZELIMAGES}/dns-controller.tar.gz ${BAZELIMAGES}/dns-controller.tar.gz.sha1
tools/sha256 ${BAZELIMAGES}/dns-controller.tar.gz ${BAZELIMAGES}/dns-controller.tar.gz.sha256

Expand Down
2 changes: 1 addition & 1 deletion tools/gzip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def _impl(ctx):
basename = ctx.attr.src.label.name
out_file = ctx.actions.declare_file("%s.gz" % basename)

cmd = "gzip -c '%s' > '%s'" % (in_file.path, out_file.path)
cmd = "gzip --no-name -c '%s' > '%s'" % (in_file.path, out_file.path)

ctx.actions.run_shell(
outputs = [out_file],
Expand Down

0 comments on commit 2586d6d

Please sign in to comment.