[Mono-dev] making mono builds reproducible (xamarin bz #26842)
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 signature.asc Description: PGP signature ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] making mono builds reproducible (xamarin bz #26842)
I'd always store time in epochs. Seconds since 1/1/1970 GMT. The use of textual date strings instead of a epochs is one of the worst things I've seen from the C# way of doing things. I had often wondered why so many programs could have so much trouble with handling dates and times correctly.. Sent from my iPad On Feb 16, 2015, at 4:19 PM, Daniel Kahn Gillmor d...@fifthhorseman.net wrote: 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 ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] making mono builds reproducible (xamarin bz #26842)
Hey guys, I assume this is related to the unique identifier generated on each ECMA assembly? The issue here is that this goes against the requirements of the spec. What exactly is being proposed here? On Mon, Feb 16, 2015 at 7:06 PM, Daniel Kahn Gillmor d...@fifthhorseman.net wrote: On Mon 2015-02-16 18:17:53 -0500, Michael McGlothlin wrote: I'd always store time in epochs. Seconds since 1/1/1970 GMT. The use of textual date strings instead of a epochs is one of the worst things I've seen from the C# way of doing things. I had often wondered why so many programs could have so much trouble with handling dates and times correctly.. I agree that silly standards like RFC 822 timestamps are crazy and should not be used anywhere we can avoid them. However, the ISO-8601 date/timestamp format is both human- and machine-parseable, whereas most humans can't look at a UNIX epoch timestamp and know even whether it's in the past or the future. That said, i really care more about reproducibility than i do about any particular timestamp format. if folks are fine with UNIX epoch timestamps and with the environment variable interfacfe Jo proposes, i'll be happy with that. Is this something that could be adopted upstream? --dkg ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] making mono builds reproducible (xamarin bz #26842)
On Mon 2015-02-16 18:17:53 -0500, Michael McGlothlin wrote: I'd always store time in epochs. Seconds since 1/1/1970 GMT. The use of textual date strings instead of a epochs is one of the worst things I've seen from the C# way of doing things. I had often wondered why so many programs could have so much trouble with handling dates and times correctly.. I agree that silly standards like RFC 822 timestamps are crazy and should not be used anywhere we can avoid them. However, the ISO-8601 date/timestamp format is both human- and machine-parseable, whereas most humans can't look at a UNIX epoch timestamp and know even whether it's in the past or the future. That said, i really care more about reproducibility than i do about any particular timestamp format. if folks are fine with UNIX epoch timestamps and with the environment variable interfacfe Jo proposes, i'll be happy with that. Is this something that could be adopted upstream? --dkg ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list