[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnu-prog-discuss] Reproducible builds

From: Stefan Monnier
Subject: Re: [gnu-prog-discuss] Reproducible builds
Date: Mon, 21 Dec 2015 22:32:47 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

BTW, in https://reproducible.debian.net/index_issues.html I fail to see
one issue that should affect Emacs: the result depends on ordering of
independent commands.

So in sequential builds, this does not manifest itself, but in parallel
builds the result becomes non-deterministic.

The way this shows up in Emacs is that depending on how the
byte-compilations get ordered, all the (require '<foo>) will either load
the corresponding <foo>.el or the <foo>.elc.

In many cases, the end result is 100% identical, but if <foo>.el
includes functions defined with defsubst then the result can be
different because in one case the defsubst's source will be inlined and
in the other the defsubst's byte-code will be inlined.

The easiest way to solve this problem is probably to get rid of the
"source-level inlining".  IIRC this is already partly the case for
lexical-binding reasons: we can't inline (at the source-level)
lexical-binding code in dynamic-binding code (nor vice versa), so when
the binding style disagrees we forcefully byte-compile the defsubst to
make sure the inlining is done on the byte-code (where the binding-style
is not a problem any more).  So we could simply always forcefully
byte-compile the defsubst, even when the binding styles agree.

Of course, there can be other differences depending on all kinds of
weird tings you can do with eval-when-compile and friends, but in
practice this should hopefully never be an issue.  Still, it would be
good to *test* that there aren't other such issues.

We could also reduce/eliminate those problems by adding dependencies in
the makefile so that (require '<foo>) always gets the .elc file, but
this would reduce the available parallelism during compilation, and it's
hard to do in general: many packages have circular requires.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]