Message ID | 34915f43ed2e8b7ae99c3fe2fd65e7b97ff8f57b.1712437365.git.janneke@gnu.org |
---|---|
State | New |
Headers | show |
Series | Reproducible `make dist' tarball in defiance of Autotools and Gettext | expand |
Hello Jan, Janneke Nieuwenhuizen <janneke@gnu.org> writes: > diff --git a/doc/local.mk b/doc/local.mk > index 5f014b9c3d..017686137a 100644 > --- a/doc/local.mk > +++ b/doc/local.mk > @@ -224,6 +224,9 @@ gen_man = \ > $(HELP2MANFLAGS) > > HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME) > +# help2man reproducibility > +SOURCE_DATE_EPOCH = $(shell git show HEAD --format=%ct --no-patch 2>/dev/null || echo 0) > +export SOURCE_DATE_EPOCH > > $(srcdir)/%D%/guix.1: scripts/guix.in $(sub_commands_mans) > -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1` Do I interpret correctly that “echo 0” is a fallback timestamp? Looking at the now gone instructions from “git show 83c60bb0622440afe98930820186ddfa1e6e8b2f”, at that time, a timestamp of 1 was used for the tarball; I do not remember why. In guix/scripts/pack.scm, 1 is used for squashfs and docker images. Is 1 a better timestamp than 0? Regards, Florian
pelzflorian (Florian Pelz) writes: Hello Florian, > Janneke Nieuwenhuizen <janneke@gnu.org> writes: >> diff --git a/doc/local.mk b/doc/local.mk >> +SOURCE_DATE_EPOCH = $(shell git show HEAD --format=%ct --no-patch 2>/dev/null || echo 0) >> +export SOURCE_DATE_EPOCH > > Do I interpret correctly that “echo 0” is a fallback timestamp? Yes. > Looking at the now gone instructions from “git show > 83c60bb0622440afe98930820186ddfa1e6e8b2f”, at that time, a timestamp of > 1 was used for the tarball; I do not remember why. In > guix/scripts/pack.scm, 1 is used for squashfs and docker images. That's probably because of build dependencies. > Is 1 a better timestamp than 0? For files, using 1 is preferrable if it's not a source file. We use 1 for .go files, and 0 for .scm files, iirc. SOURCE_DATE_EPOCH is (only) used for the date in the document. Without git, 0 is as good a guess for a reproducible date for use in a document as any, I think. Greetings, Janneke
Janneke Nieuwenhuizen <janneke@gnu.org> writes: > pelzflorian (Florian Pelz) writes: >> Is 1 a better timestamp than 0? > > For files, using 1 is preferrable if it's not a source file. We use 1 > for .go files, and 0 for .scm files, iirc. SOURCE_DATE_EPOCH is (only) > used for the date in the document. Without git, 0 is as good a guess > for a reproducible date for use in a document as any, I think. > > Greetings, > Janneke Thank you for explaining. So this SOURCE_DATE_EPOCH applies to all the generated files in doc/ but still 0 is fine, because noone warns if they are not later than source files, IIUC. Regards, Florian
Hello, "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis: > Looking at the now gone instructions from “git show > 83c60bb0622440afe98930820186ddfa1e6e8b2f”, at that time, a timestamp of > 1 was used for the tarball; I do not remember why. In > guix/scripts/pack.scm, 1 is used for squashfs and docker images. In the store, a timestamp of 1 (not 0) is used. This is because there are tools (among which ‘make’ IIRC) that behave differently when mtime is zero. For consistency and to be on the safe side, it’s probably a good idea to do the same (as the fallback in this case). Ludo’.
Ludovic Courtès writes: Hi, > "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis: > >> Looking at the now gone instructions from “git show >> 83c60bb0622440afe98930820186ddfa1e6e8b2f”, at that time, a timestamp of >> 1 was used for the tarball; I do not remember why. In >> guix/scripts/pack.scm, 1 is used for squashfs and docker images. > > In the store, a timestamp of 1 (not 0) is used. This is because there > are tools (among which ‘make’ IIRC) that behave differently when mtime > is zero. > > For consistency and to be on the safe side, it’s probably a good idea to > do the same (as the fallback in this case). Okay, will change for v3.
diff --git a/doc/local.mk b/doc/local.mk index 5f014b9c3d..017686137a 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -224,6 +224,9 @@ gen_man = \ $(HELP2MANFLAGS) HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME) +# help2man reproducibility +SOURCE_DATE_EPOCH = $(shell git show HEAD --format=%ct --no-patch 2>/dev/null || echo 0) +export SOURCE_DATE_EPOCH $(srcdir)/%D%/guix.1: scripts/guix.in $(sub_commands_mans) -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`