Emacs emacs-disable-jit-compilation.patch prevents native compilation of packages installed outside of Guix?

  • Open
  • quality assurance status badge
Details
2 participants
  • Adam Porter
  • Liliana Marie Prikler
Owner
unassigned
Submitted by
Adam Porter
Severity
normal
A
A
Adam Porter wrote on 23 Jun 01:31 +0200
(address . bug-guix@gnu.org)
49f7c34f-38ff-4b4d-be57-1d35c5871df6@alphapapa.net
Hello,

I've been installing and running Emacs through Guix as a foreign distro
for a few years now, and since native compilation was added in Emacs 28
(before it was even released), I've enjoyed using it to the full,
including having Elisp packages which are installed directly inside
Emacs (i.e. not through Guix) be native compiled on-demand.

I just noticed the patch file "emacs-disable-jit-compilation.patch",
which was added to the Emacs package definition fairly recently, and
disables the option `native-comp-jit-compilation' by default. The patch
includes this warning in the docstring:

"Notably, Guix removes the hashes that prevent inadvertent shadowing
frm the file names of compiled libraries in order to facilitate grafts.
Enable at your own risk!"

So, 1. I would ask that this warning be expanded and clarified. For
those of us users who aren't experts in all aspects of Guix, I don't
understand exactly what this means. (I do understand what grafts are,
and I understand how Emacs's ELN files are named to facilitate loading
correct libraries, but I don't know what Guix is doing with the
filenames, and I don't know the implications of that.)

For example, if I enable this variable in my configuration so that
packages not installed through Guix are native-compiled, is that now
expected to break something? Before the patch and accompanying changes
were added, I experienced no problems using native-compilation,
including making use of built-in, ahead-of-time native-compiled
libraries, as well as JIT native-compiled libraries installed with
Emacs's package system.

While I admire Guix's end goal of encompassing everything, I don't want
to install Elisp packages via Guix. (For one, being a developer of
them, it would be impractical. Even otherwise, not every library is
going to be available or up-to-date in Guix, and I don't want to have to
give up native-compilation for them.) I also don't want to be
restricted from using native compilation for non-built-in libraries.

Also, 2. I would ask, if indeed enabling that option is now expected to
break something, that this be remedied in some way. To expect Guix
Emacs users to forego native compilation for Elisp packages installed
from within Emacs would be...well, it would simply be impractical,
because, as I said, it's not practical (or even desirable) to install
all Elisp packages with Guix.

To impose such a limitation on users would be reason enough to abandon
installing Emacs through Guix, even for serious Guix users. And that
would be a shame, because this is one of Guix's great strengths, to
provide up-to-date software, regardless of the underlying system, with
simplicity and reliability. If I were to have to go back to building
and installing Emacs manually, what a regression that would be.

I do want to express my appreciation for the work that was done to get
to this point. I looked through, e.g.
https://issues.guix.gnu.org/67260, and I realize that it took a lot of
hard work to thoroughly integrate Guix with Emacs's native compilation
features. Nevertheless, while the current packaging may be ideal for
the most dedicated Guix users, it seems to have regressed for those of
us who are less "pure" Guix users, who need more flexibility, and who
have enjoyed such in the past.

Thanks,
Adam Porter
L
L
Liliana Marie Prikler wrote on 23 Jun 12:27 +0200
cd42faca4e9cd0805561c0c0ccf6614957ea88f7.camel@gmail.com
Hello,

Am Samstag, dem 22.06.2024 um 18:31 -0500 schrieb Adam Porter:
Toggle quote (7 lines)
> […T]he patch file "emacs-disable-jit-compilation.patch" […]
> disables the option `native-comp-jit-compilation' by default [and]
> includes this warning in the docstring:
>
> "Notably, Guix removes the hashes that prevent inadvertent shadowing
> frm the file names of compiled libraries in order to facilitate
> grafts. Enable at your own risk!"
Well, that's a typo I didn't notice before.

Toggle quote (14 lines)
> So, 1. I would ask that this warning be expanded and clarified.  For
> those of us users who aren't experts in all aspects of Guix, I don't
> understand exactly what this means.  (I do understand what grafts
> are, and I understand how Emacs's ELN files are named to facilitate
> loading correct libraries, but I don't know what Guix is doing with
> the filenames, and I don't know the implications of that.)
>
> For example, if I enable this variable in my configuration so that
> packages not installed through Guix are native-compiled, is that now
> expected to break something?  Before the patch and accompanying
> changes were added, I experienced no problems using native-
> compilation, including making use of built-in, ahead-of-time native-
> compiled libraries, as well as JIT native-compiled libraries
> installed with Emacs's package system.
Well, the short answer is "I don't know". The long answer is "Even
without disabling this flag, we use the fact that the same file name
points somewhere else for security updates. Thus, there is a
legitimate use case, but I don't know what specific mess you sign
yourself up to if you do enable this flag on your machine." In short,
enable this at your own risk.

Toggle quote (7 lines)
> While I admire Guix's end goal of encompassing everything, I don't
> want to install Elisp packages via Guix.  (For one, being a developer
> of them, it would be impractical.  Even otherwise, not every library
> is going to be available or up-to-date in Guix, and I don't want to
> have to give up native-compilation for them.)  I also don't want to
> be restricted from using native compilation for non-built-in
> libraries.
That's understandable, but why do you then need Emacs itself from
Guix???
If you want to do traditional package management, there ought to be
enough to serve your purpose, perhaps even on your foreign distro. If
not, you can use an .scm file to define an Emacs without this patch. I
don't know whether that's desirable for your use case – for us as Guix
the expectation is rather that our own packages work as expected, i.e.
with graftable native-compilation.

Toggle quote (14 lines)
> Also, 2. I would ask, if indeed enabling that option is now expected
> to break something, that this be remedied in some way.  To expect
> Guix Emacs users to forego native compilation for Elisp packages
> installed from within Emacs would be...well, it would simply be
> impractical, because, as I said, it's not practical (or even
> desirable) to install all Elisp packages with Guix.
>
> To impose such a limitation on users would be reason enough to
> abandon installing Emacs through Guix, even for serious Guix users. 
> And that would be a shame, because this is one of Guix's great
> strengths, to provide up-to-date software, regardless of the
> underlying system, with simplicity and reliability.  If I were to
> have to go back to building and installing Emacs manually, what a
> regression that would be.
Sorry, but none of that follows. We have an importer and updater for
Elisp, so even the packages that are not yet in Guix or out-of-date
ought to be easy to use regardless. Even outside of Emacs, we have
this whole "Build it with Guix" thing going on – you might want to
consider using a guix.scm for your Emacs packages, particularly if you
need newer versions of things that are not yet in Guix. Or
contributing.

Cheers
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 71725@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71725
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch