all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rsw@gnu.org, rswgnu@gmail.com, 55305@debbugs.gnu.org, akrl@sdf.org
Subject: bug#55305: 28.0.50: With async nativecomp, package manager fails to load hyperbole-autoloads.el before compilation
Date: Sun, 15 May 2022 16:12:48 -0400	[thread overview]
Message-ID: <jwvr14ud0yp.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83a6bik9vi.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 15 May 2022 20:01:53 +0300")

>> So in order for the compilation to happen correctly, our async workers
>> need to mimic to some extent the currently running Emacs session.
> That was never the way byte-compilation worked in Emacs.

It has never been officially documented, you're right.

But all the files bundled in Emacs are byte-compiled in an Emacs session
where `lisp/loaddefs.el` has already been loaded and many packages rely
on that to minimize the amount of explicit `require` they use (and to
break some cyclic dependencies).

In ELPA packages, that translates into an assumption that the package's
`<pkg>-autoloads.el` has already been loaded (which is indeed the case
during `package-install` and is also the case when compiled via the code
in GNU ELPA's `elpa-admin.el`).

> We have all those 'require' and 'eval-when-compile' things precisely
> so a file can tell the compiler what is needed for the compilation.
> And we _need_ a way to make the compilation be completely independent
> of any local customizations or installed packages.

When a package uses some other package's macro, it necessarily depends on
the locally installed packages to be compiled correctly.

Until now `comp.el` limits the support for "local customizations or
installed packages" to the act of propagating the current session's
`load-path`.  In theory, it could be sufficient.  But this is not the
same as what has been provided for the last ten years when compiling
ELPA packages, so it will inevitably bump into packages for which it
breaks compilation (such as Hyperbole).

I'm not claiming that calling `package-activate-all` is right for
reasons of principle.  We sadly never clearly defined what it is that
a package can count on. In practice ELPA packages have been able to
count on the fact that their autoloads (and their dependencies's
autoloads) have all been loaded (which also implies that all those
packages have been added to the `load-path`).

> I'm firmly against doing this.

OK.

>> AFAIK the only way to make async compilation work reliably is to make it
>> generate the `.eln` file without using the `.el` file (i.e. using the
>> `.elc` file instead, which can be compiled without having to load any
>> user-installed file, expand any macro, or run any user-installed
>> function).  That will also save us from mis-compiling file and from
>> (re)emitting compilation warnings.
> This is unrelated,

I firmly disagree with this, but I agree that it's a side discussion
because we haven't yet found anyone motivated to tackle this problem in
our native-comp pipeline.  So in the mean time we have to paper over the
consequences.


        Stefan






  parent reply	other threads:[~2022-05-15 20:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-07 20:05 bug#55305: 28.0.50: With async nativecomp, package manager fails to load hyperbole-autoloads.el before compilation Robert Weiner
2022-05-08  5:09 ` Eli Zaretskii
2022-05-12  5:14   ` Robert Weiner
2022-05-12  5:51     ` Eli Zaretskii
2022-05-12  6:21       ` Robert Weiner
2022-05-12  7:22         ` Eli Zaretskii
2022-05-14 14:47           ` Robert Weiner
2022-05-14 15:05             ` Eli Zaretskii
2022-05-14 22:40               ` Robert Weiner
2022-05-15  5:15                 ` Eli Zaretskii
2022-05-15 15:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-15 16:17   ` Eli Zaretskii
2022-05-15 16:22     ` Eli Zaretskii
2022-05-15 16:47       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-15 17:01         ` Eli Zaretskii
2022-05-15 17:15           ` Eli Zaretskii
2022-05-15 20:12           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-05-16  2:31             ` Eli Zaretskii
2022-05-16 16:40               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-16 16:57                 ` Eli Zaretskii
2022-05-16 17:17                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-15 20:39           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-16  2:33             ` Eli Zaretskii
2022-05-16  9:34   ` Andrea Corallo
2022-05-16 16:42     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-16 16:59       ` Eli Zaretskii
2022-05-16 22:27         ` Robert Weiner
2022-05-17  2:27           ` Eli Zaretskii
2023-06-07 21:36             ` Andrea Corallo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr14ud0yp.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=55305@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rsw@gnu.org \
    --cc=rswgnu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.