GNU bug report logs -
#75812
29.2.50; Support native-compiling package-install from batch Emacs
Previous Next
Full log
Message #42 received at 75812 <at> debbugs.gnu.org (full text, mbox):
> From: Spencer Baugh <sbaugh <at> janestreet.com>
> Cc: app-emacs-dev <at> janestreet.com, acorallo <at> gnu.org,
> stefankangas <at> gmail.com, 75812 <at> debbugs.gnu.org, shipmints <at> gmail.com
> Date: Tue, 29 Apr 2025 14:05:38 -0400
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
> >> > Or why not install a native-comp-async-all-done-hook that will notice
> >> > when compilations are done and allow the batch job to exit? All you
> >> > need is a means to wait until all the async compilations are finished,
> >> > no?
> >>
> >> How do you propose to do that? I guess I could call kill-emacs from the
> >> hook, but I have more code I want to run after the native compilation is
> >> finished, and I can't move it all into the hook.
> >
> > Then don't call kill-emacs from the hook; instead, use 'throw', or run
> > the rest of the code from the hook directly.
>
> So a function like this?
>
> (defun native-comp-async-wait-for-all-done ()
> (unless (zerop (comp--async-runnings))
> (catch 'native-comp-done
> (let ((native-comp-async-all-done-hook (list (lambda () (throw 'native-comp-done)))))
> (while (sit-for 999))))))
>
> Could we add that?
Why do we need to add it? Can't you just use it in your code?
> Yes, it's a matter of compiling each package separately in parallel,
> which is annoying to do if they all write files to a single directory as
> a side-effect.
>
> But, I think what I could do is compile each package with a different
> directory prepended to native-comp-eln-load-path, and then once all the
> packages are compiled, merge those directories into one omnibus
> directory, which is bundled with my installed Emacs.
I still don't understand what you are trying to achieve, but the above
should work.
> Would it be reasonable to merge those directories into the last entry of
> native-comp-eln-load-path? (e.g. /usr/lib/emacs/30.1.50/native-lisp)
No! The last directory is in many cases not writable by users, and it
includes preloaded files, see the doc string of the variable. The
last directory should be left alone. Instead, add another directory
to the default value, between the user's eln-cache and the last
member, and have your local packages' *.eln files there.
This bug report was last modified 46 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.