[Mono-dev] making mono builds reproducible (xamarin bz #26842)

Daniel Kahn Gillmor dkg at fifthhorseman.net
Mon Feb 16 22:19:42 UTC 2015


Hi Mono folks--

some good discussion has come up on the xamarin bugtracker about being
able to make builds using the mono toolchain reproducible:

   https://bugzilla.xamarin.com/show_bug.cgi?id=26842

Jo Shields offered a one-liner fix to PEWriter.cs to allow the use of an
environment variable to fix the timestamp epoch, but made it clear that
more feedback is needed, so i'm raising it here:

from:

   public DWORD TimeDateStamp = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;

to:

   public DWORD TimeDateStamp = Environment.GetEnvironmentVariable("IKVM_WRITER_TIMESTAMP_EPOCH") != null ?
                                uint.Parse(Environment.GetEnvironmentVariable("IKVM_WRITER_TIMESTAMP_EPOCH")) :
                                (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;

(i'm not sure whether the integer number of seconds is the best form for
the environment variable, or whether it would be better to parse a
standard date string -- from debian's perspective, we can deal with
either, of course)

And this still doesn't solve the secondary issue of the assembly GUID,
as Jo noted.

Any thoughts about how to best enable binary-reproducible builds from
the mono toolchain if the invoker requests them?

Regards,

        --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 948 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20150216/98ca6fb2/attachment.pgp>


More information about the Mono-devel-list mailing list