[Soc-coordination] GSoC 2015 Week 6: Move forward reproducible builds

Dhole dhole at openmailbox.org
Mon Jul 6 00:33:37 UTC 2015


Hi,

This week I have been working on patching toolchain packages in relation
to the proposed timestamp standardization.

I have patched gcc to read the SOURCE_DATE_EPOCH environment variable
and in case it is set, change the behavior of the macro __DATE__ and
__TIME__ substitution: instead of writing the local date/time, the one
provided by the env variable is used. I also wrote a patch to replace
the behavior of the __TIMESTAMP__ macro (which embeds the source file
mtime during the preprocessing step) to use the timestamp from
SOURCE_DATE_EPOCH only if it is older than the file mtime (that is,
clamping the timestamp). The later patch has not been sent yet as it
feels more intrusive.

I sent the patch for __DATE__ and __TIME__ to the gcc upstream mailing
list (gcc-patches):

https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02210.html

There's been some discussion and some ideas from the gcc people, but no
maintainer has replied yet (only maintainers can decide if a patch gets
accepted or not).

Since other other people in the project are adopting the use of
SOURCE_DATE_EPOCH to normalize timestamps, I wrote a patch for debhelper
(a Debian package used during package builds) to export the
SOURCE_DATE_EPOCH with the latests debian/changelog entry timestamp. I
also added a change to debhelper to help reproducible builds which
consists on setting TZ=UTC (that is setting the exported variable
defining the timezone to UTC so that during bluilds a normalized
timezone is found).

The debhelper commit can be found here:
https://anonscm.debian.org/cgit/reproducible/debhelper.git/commit/?h=pu/reproducible_builds&id=005841b88b715a29a2279265f2fc2b31d3389344

After committing the change, I built the package and uploaded it to the
reproducible repository so that it can be used in our custom toolchain
and test it on jenkins.

I updated two wiki entries:
- info about gcc patch regarding the C timestamp macro issue:
    https://wiki.debian.org/ReproducibleBuilds/TimestampsFromCPPMacros
- info about debhelp update
    https://wiki.debian.org/ReproducibleBuilds/ExperimentalToolchain

For next week I plan on continue looking at toolchain packages that
could implement the use of SOURCE_DATE_EPOCH (mostly documentation
generators such as docbook-xsl) and write patches for them

Best regards,
Dhole

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/soc-coordination/attachments/20150706/f5d15b0c/attachment.sig>


More information about the Soc-coordination mailing list