unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44813: 28.0.50; [feature/native-comp] Recent change to native-compile-async
@ 2020-11-23  4:39 Andrew Whatson
  2020-11-23  8:44 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Whatson @ 2020-11-23  4:39 UTC (permalink / raw)
  To: 44813

Hi,

The change to the treatment of the load parameter of
native-compile-async in commit 6781cd67 has exposed some problems with
how native compilation has been handled by the `straight.el` package
manager.

Straight calls `(native-compile-async path-to-pkg 'recursively 'late)`
to trigger compilation of packages, and relies on
`comp-deferred-compilation-black-list` to prevent compilation of
packages when requested by the user.

The reasoning behind using the late is two-fold:

1) When compilation is requested, the package has not been loaded.
Once async compilation has finished, it may have been loaded.  We want
to load the native elisp if the package has been loaded, but otherwise
not force the package to load.

It seems that `late` loading provided this behaviour thanks to
`comp--late-register-subr` checking `comp-deferred-pending-h` before
loading the native definition.  The hash entry will be missing for
packages where we requested compilation but were never loaded.

Relying on undocumented behaviour of the `late` flag like is obviously
fragile and naughty, but I believe this is a valid use-case.  What do
you think about adding official support for this kind of "lazy"
loading?

2) The `comp-deferred-compilation-black-list` is the only way that a
user can prevent compilation of an elisp file, and this blacklist is
only checked when compilation is requested with `late` loading.

While what straight.el (and now package.el) are doing is not
technically "deferred" compilation, I think it's useful to have a
single blacklist to prevent compilation of a file regardless of how
that compilation is requested.

Thanks & Cheers,
Andrew





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

end of thread, other threads:[~2020-11-24  8:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23  4:39 bug#44813: 28.0.50; [feature/native-comp] Recent change to native-compile-async Andrew Whatson
2020-11-23  8:44 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-23  9:30   ` Andrew Whatson
2020-11-23 10:02     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-23 10:29       ` Andrew Whatson
2020-11-23 10:58         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-23 19:29         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-24  3:52           ` Andrew Whatson
2020-11-24  8:25             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).