Skip to content

Commit 328470d

Browse files
committed
Ensure that file modified time is set correctly
Commit e435bc6 introduced behavior in creating the source-dist archive that sets the file modification time to the same time as the most recent `git` commit. This facilitates reproducible builds, but it also has an issue. The code sets `TZ=`, which means that on systems running in time zones which aren't UTC, the modification time will be in the future (or past). Up until recently, this only resulted in GNU make printing warnings about modification times being in the future. However, with recent changes in how escripts are built, this results in an "infinite make loop" that is described in #14440 and #14443 The solution is to _not_ hard-code the `TZ` value when calculating the time of the most recent `git` commit. These changes also update the arguments passed to `tar` to use full arguments that are easier to understand, as well as removes the need for the `xzcat` command, as all build enviroments should have `xz` support built into GNU `tar`. Remove `TZ=` as it is the root cause of #14440
1 parent 81caabc commit 328470d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ $(1): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
189189
$${gen_verbose} $${RSYNC} $(2) ./ $$@/
190190
$${verbose} echo "$(PROJECT_DESCRIPTION) $(PROJECT_VERSION)" > $$@/git-revisions.txt
191191
$${verbose} echo "$(PROJECT) $$$$(git rev-parse HEAD) $$$$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)" >> $$@/git-revisions.txt
192-
$${verbose} echo "$$$$(TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')" > $$@.git-times.txt
192+
$${verbose} echo "$$$$(git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')" > $$@.git-times.txt
193193
$${verbose} cat packaging/common/LICENSE.head > $$@/LICENSE
194194
$${verbose} mkdir -p $$@/deps/licensing
195195
$${verbose} set -e; for dep in $$$$(cat $(ERLANG_MK_RECURSIVE_DEPS_LIST) | LC_COLLATE=C sort); do \
@@ -216,7 +216,7 @@ $(1): $(ERLANG_MK_RECURSIVE_DEPS_LIST)
216216
echo "$$$$(basename "$$$$dep") $$$$(git rev-parse HEAD) $$$$(git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)") \
217217
>> "$$@/git-revisions.txt"; \
218218
! test -d $$$$dep/.git || (cd $$$$dep; \
219-
echo "$$$$(env TZ= git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')") \
219+
echo "$$$$(git --no-pager log -n 1 --format='%cd' --date='format-local:%Y%m%d%H%M.%S')") \
220220
>> "$$@.git-times.txt"; \
221221
done
222222
$${verbose} cat packaging/common/LICENSE.tail >> $$@/LICENSE

packaging/generic-unix/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dist:
3838
@elixir --version
3939
@echo '--------------------------------------------------'
4040
@echo
41-
xzcat $(SOURCE_DIST_FILE) | tar -xf -
41+
tar --xz --extract --file $(SOURCE_DIST_FILE)
4242

4343
# web-manpages are not used by generic-unix but by `make release` in the
4444
# Umbrella. Those manpages are copied to www.rabbitmq.com

0 commit comments

Comments
 (0)