[Reproducible-builds] Bug#791815: libxslt: please support timestamps from environment
Source: libxslt Version: 1.1.28-2 Severity: wishlist Tags: patch User: reproducible-builds@lists.alioth.debian.org Usertags: toolchain timestamps Hi! While working on the “reproducible builds” effort [1], we have noticed that libxslt embeds timestamps when generating documentation. We have a proposal for using a deterministic timestamp [2] (based on the latest debian/changelog entry) which is contained in the environment variable SOURCE_DATE_EPOCH (currently exported by debhelper in our experimental framework). The attached patch proposes a way to use this variable to get reproducible timestamps when generating docs, if the variable has been set (if not, it falls back to the old behavior). [1]: https://wiki.debian.org/ReproducibleBuilds [2]: https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal Regards, -- Dhole diff -Nru libxslt-1.1.28/debian/changelog libxslt-1.1.28/debian/changelog --- libxslt-1.1.28/debian/changelog 2015-07-01 12:00:21.0 +0200 +++ libxslt-1.1.28/debian/changelog 2015-07-08 15:19:03.0 +0200 @@ -1,9 +1,14 @@ -libxslt (1.1.28-2.0~reproducible3) UNRELEASED; urgency=low +libxslt (1.1.28-2.0~reproducible4) UNRELEASED; urgency=low + [ Jérémy Bobbio ] * Add a patch from Daniel Veillard to make generate-id() provide stable IDs to make its output reproducible. - -- Jérémy Bobbio Wed, 01 Jul 2015 11:49:58 +0200 + [ Eduard Sanou ] + * Add support for reproducible builds by using $SOURCE_DATE_EPOCH as the +date when processing docs (when using the var $date). + + -- Dhole Wed, 08 Jul 2015 15:05:07 +0200 libxslt (1.1.28-2) unstable; urgency=low diff -Nru libxslt-1.1.28/debian/patches/0010-Replace-timestamp-with-SOURCE_DATE_EPOCH libxslt-1.1.28/debian/patches/0010-Replace-timestamp-with-SOURCE_DATE_EPOCH --- libxslt-1.1.28/debian/patches/0010-Replace-timestamp-with-SOURCE_DATE_EPOCH 1970-01-01 01:00:00.0 +0100 +++ libxslt-1.1.28/debian/patches/0010-Replace-timestamp-with-SOURCE_DATE_EPOCH 2015-07-08 15:18:26.0 +0200 @@ -0,0 +1,65 @@ +Description: Replace date timestamp by SOURCE_DATE_EPOCH env var +Author: Dhole + +--- + +--- libxslt-1.1.28.orig/libexslt/date.c libxslt-1.1.28/libexslt/date.c +@@ -46,6 +46,7 @@ + #include "exslt.h" + + #include ++#include + + #ifdef HAVE_MATH_H + #include +@@ -747,21 +748,46 @@ static exsltDateValPtr + exsltDateCurrent (void) + { + struct tm localTm, gmTm; ++struct tm *tb = NULL; + time_t secs; + int local_s, gm_s; + exsltDateValPtr ret; ++char *source_date_epoch; + + ret = exsltDateCreateDate(XS_DATETIME); + if (ret == NULL) + return NULL; + +-/* get current time */ + secs= time(NULL); ++/* ++ * Allow the date and time to be set externally by an exported ++ * environment variable to enable reproducible builds. ++ */ ++source_date_epoch = getenv("SOURCE_DATE_EPOCH"); ++if (source_date_epoch) { ++ errno = 0; ++ secs = (time_t) strtol (source_date_epoch, NULL, 10); ++ if (errno == 0) { ++ tb = gmtime(&secs); ++ if (tb == NULL) { ++ /* SOURCE_DATE_EPOCH is not a valid date */ ++ return NULL; ++ } else { ++ localTm = *tb; ++ } ++ } else { ++ /* SOURCE_DATE_EPOCH is not a valid number */ ++ return NULL; ++ } ++} else { ++ /* get current time */ + #if HAVE_LOCALTIME_R +-localtime_r(&secs, &localTm); ++ localtime_r(&secs, &localTm); + #else +-localTm = *localtime(&secs); ++ localTm = *localtime(&secs); + #endif ++} ++ + + /* get real year, not years since 1900 */ + ret->value.date.year = localTm.tm_year + 1900; diff -Nru libxslt-1.1.28/debian/patches/series libxslt-1.1.28/debian/patches/series --- libxslt-1.1.28/debian/patches/series2015-07-01 12:00:21.0 +0200 +++ libxslt-1.1.28/debian/patches/series2015-07-08 15:13:19.0 +0200 @@ -7,3 +7,4 @@ 0007-EXSLT-function-str-replace-is-broken-as-is.patch 0008-Fix-quoting-of-xlocale-test-program-in-configure.in.patch 0009-Make-generate-id-deterministic.patch +0010-Replace-timestamp-with-SOURCE_DATE_EPOCH signature.asc Description: OpenPGP digital signature ___ Reproducible-builds mailing list Reproducible-builds@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds
Re: [Reproducible-builds] Bug#791815: libxslt: please support timestamps from environment
Hi, not replying to the bug on purpose... On Mittwoch, 8. Juli 2015, Dhole wrote: > We have a proposal for using a deterministic timestamp [2] (based on > the latest debian/changelog entry) which is contained in the environment > variable SOURCE_DATE_EPOCH (currently exported by debhelper in our > experimental framework). If I would read this as a maintainer, I would probably think "this should at least wait til its used by debhelper in unstable"... also I'd be curious about the bug number for this feature in debhelper. cheers, Holger signature.asc Description: This is a digitally signed message part. ___ Reproducible-builds mailing list Reproducible-builds@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds
Re: [Reproducible-builds] Bug#791815: libxslt: please support timestamps from environment
On 07/08/2015 06:44 PM, Dhole wrote: > Source: libxslt > Version: 1.1.28-2 > Severity: wishlist > Tags: patch > User: reproducible-builds@lists.alioth.debian.org > Usertags: toolchain timestamps > > Hi! > > While working on the “reproducible builds” effort [1], we have noticed > that libxslt embeds timestamps when generating documentation. > > We have a proposal for using a deterministic timestamp [2] (based on > the latest debian/changelog entry) which is contained in the environment > variable SOURCE_DATE_EPOCH (currently exported by debhelper in our > experimental framework). > > The attached patch proposes a way to use this variable to get > reproducible timestamps when generating docs, if the variable has been > set (if not, it falls back to the old behavior). > > > [1]: https://wiki.debian.org/ReproducibleBuilds > [2]: https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal > The submitted bug for the mentioned feature in debhelper can be found at: https://bugs.debian.org/791823 Regards, -- Dhole signature.asc Description: OpenPGP digital signature ___ Reproducible-builds mailing list Reproducible-builds@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds
Re: [Reproducible-builds] Bug#791815: libxslt: please support timestamps from environment
Control: block -1 by 791823 On Wed, 08 Jul 2015 20:01:57 +0200 Dhole wrote: > The submitted bug for the mentioned feature in debhelper can be found > at: https://bugs.debian.org/791823 and added some bug metadata :) signature.asc Description: signature ___ Reproducible-builds mailing list Reproducible-builds@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds
Re: [Reproducible-builds] Bug#791815: libxslt: please support timestamps from environment
control: forwarded -1 https://bugzilla.gnome.org/show_bug.cgi?id=751621 control: tags -1 + upstream fixed-upstream On Wed, Jul 08, 2015 at 06:44:00PM +0200, Dhole wrote: > While working on the “reproducible builds” effort [1], we have noticed > that libxslt embeds timestamps when generating documentation. > > We have a proposal for using a deterministic timestamp [2] (based on > the latest debian/changelog entry) which is contained in the environment > variable SOURCE_DATE_EPOCH (currently exported by debhelper in our > experimental framework). > > The attached patch proposes a way to use this variable to get > reproducible timestamps when generating docs, if the variable has been > set (if not, it falls back to the old behavior). The attached here patch was NACK'ed by upstream, though he came up with another one, which was tested during the last 2 months by us. Let me set some bug metadata (for easier tracking of this) :) -- regards, Mattia Rizzolo GPG Key: 66AE 2B4A FCCF 3F52 DA18 4D18 4B04 3FCD B944 4540 .''`. more about me: http://mapreri.org : :' : Launchpad user: https://launchpad.net/~mapreri `. `'` Debian QA page: https://qa.debian.org/developer.php?login=mattia `- signature.asc Description: PGP signature ___ Reproducible-builds mailing list Reproducible-builds@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds
Re: [Reproducible-builds] Bug#791815: libxslt: please support timestamps from environment
control: forwarded -1 https://bugzilla.gnome.org/show_bug.cgi?id=758148 I have just forwarded patch upstream. Cheers, Dhole signature.asc Description: OpenPGP digital signature ___ Reproducible-builds mailing list Reproducible-builds@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds