all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [gnu-prog-discuss] Reproducible builds
       [not found]   ` <87r3ifkepm.fsf@gnu.org>
@ 2015-12-22  3:32     ` Stefan Monnier
  2015-12-22 16:39       ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2015-12-22  3:32 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: emacs-devel

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.


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gnu-prog-discuss] Reproducible builds
  2015-12-22  3:32     ` [gnu-prog-discuss] Reproducible builds Stefan Monnier
@ 2015-12-22 16:39       ` Ludovic Courtès
  2015-12-23  1:08         ` John Wiegley
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2015-12-22 16:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> skribis:

> 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.

Guile works similarly, so depending on ordering, when a file is
compiled, you might be evaluating dependent modules or running a
compiled version thereof.  In practice, it doesn’t matter since both are
semantically equivalent.

> 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.

So the .elc file itself can contain inlined source in some cases?

(In Guile ‘define-inlinable’ is implemented as a macro, there’s no magic
taking place.)

> 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.

It would be important to make inlining works the same regardless of
whether the defsubst-providing module is being evaluated or not, indeed.

Thanks,
Ludo’.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gnu-prog-discuss] Reproducible builds
  2015-12-22 16:39       ` Ludovic Courtès
@ 2015-12-23  1:08         ` John Wiegley
  0 siblings, 0 replies; 3+ messages in thread
From: John Wiegley @ 2015-12-23  1:08 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Stefan Monnier, emacs-devel

>>>>> Ludovic Courtès <ludo@gnu.org> writes:

> It would be important to make inlining works the same regardless of whether
> the defsubst-providing module is being evaluated or not, indeed.

Agreed.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-23  1:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1450695354.3591.18.camel@invergo.net>
     [not found] ` <1450710479.31597.40.camel@Renee-desktop.suse>
     [not found]   ` <87r3ifkepm.fsf@gnu.org>
2015-12-22  3:32     ` [gnu-prog-discuss] Reproducible builds Stefan Monnier
2015-12-22 16:39       ` Ludovic Courtès
2015-12-23  1:08         ` John Wiegley

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.