all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mekeor Melire <mekeor@posteo.de>
To: 66864@debbugs.gnu.org
Cc: dev@jpoiret.xyz, cox.katherine.e+guix@gmail.com,
	liliana.prikler@gmail.com, andrew@trop.in
Subject: bug#66864: emacs-build-system builds .eln-files with mismatching path-hashes
Date: Tue, 31 Oct 2023 23:49:49 +0000	[thread overview]
Message-ID: <8734xq48dd.fsf@posteo.de> (raw)

BUG EXPLANATION

Emacs's natively-compiled .eln-files have a basename following the pattern "{feature-name}-{path-hash}-{content-hash}.eln". [0]

Guix' emacs-build-system is used to build Emacs-related packages. By 
 default, it uses the "emacs-minimal" package during build, which 
 does not support native-compilation. But if you replace the 
 "emacs-minimal" input with "emacs-no-x", e.g. by using 
 --with-input=emacs-minimal=emacs-no-x, then emacs-build-system 
 will make use of emacs-no-x' support of native-compilation [1]: 
 The build will contain .eln-files.

Hereby I'd like to report the bug that consists of mismatched path-hashes in the .eln-files that builds of Emacs-related packages contain when build with emacs-no-x (or any other Emacs that supports native compilation).

BUG REPRODUCTION

To reproduce this bug follow the following steps. Please note that guix-shell seems to leak .eln-files. (This should be reported as 
another bug.) That why the reproduction steps avoid guix-shell. 
Instead, we'll work with the current user profile.

Delete Emacs' eln-cache (so that we can later see if new 
.eln-files have been generated):

	rm -rf ~/.emacs.d/eln-cache

Remove all Emacs- and Emacs-related packages from Guix profile:

	guix package -I | cut -f 4 | grep emacs | xargs guix remove

Install Emacs and emacs-unfill, as exemplary package, while 
replacing input "emacs-minimal" with "emacs", so that .eln-files 
are generated during the build:

	guix install emacs emacs-unfill 
	--with-input=emacs-minimal=emacs

Launch the freshly installed Emacs and load the "unfill" package. 
If the .eln-files that the emacs-unfill package provides match 
Emacs' expectations (path- and content-hash), it'll use it; 
otherwise, Emacs will compile a new .eln-file and save it into 
~/.emacs.d/eln-cache/*/unfill-{path-hash}-{content-hash}.eln.

	emacs -q --eval "(require 'unfill)"

Close Emacs after some seconds. Now determine the path-hash from 
Guix' build:

	basename 
	~/.guix-profile/lib/emacs/native-site-lisp/*/unfill-*.eln \
	  | cut -d - -f 2

Determine the path-hash from Emacs' native-compilation, which 
apparently has happened:

	basename ~/.emacs.d/eln-cache/*/unfill*.eln \
	  | cut -d - -f 2

The path-hashes from the last two steps are not equal.

BUG SOLUTION HINTS

In the #guix:libera.chat IRC channel, jpoiret pointed out: "the .eln file hash problem is due to grafts, grafts change the 
final output name, but they can't also update the file hashes... 
we'd need to modify emacs' behavior for this to work".

CITATIONS

[0]: Emacs' source code documents the meaning of the two hashes here: https://git.sv.gnu.org/cgit/emacs.git/tree/src/comp.c?h=194a8f5c1406dd7e762376bdfde78d1b7d01b6b1#n4405

[1]: Here you can see that emacs-no-x supports native-compilation unlike emacs-minimal: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/emacs.scm?h=92913703448c8e1a488ab066f60741262cdbf923#n294




             reply	other threads:[~2023-11-01  0:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 23:49 Mekeor Melire [this message]
2023-11-01 11:52 ` bug#66864: emacs-build-system builds .eln-files with mismatching path-hashes Liliana Marie Prikler
2023-11-01 13:03   ` Mekeor Melire
2023-11-01 14:16     ` Liliana Marie Prikler
2023-11-02  8:13       ` Mekeor Melire
2023-11-09 10:54         ` Liliana Marie Prikler
2023-11-09 11:21           ` Josselin Poiret via Bug reports for GNU Guix
2023-11-09 12:03             ` Liliana Marie Prikler

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=8734xq48dd.fsf@posteo.de \
    --to=mekeor@posteo.de \
    --cc=66864@debbugs.gnu.org \
    --cc=andrew@trop.in \
    --cc=cox.katherine.e+guix@gmail.com \
    --cc=dev@jpoiret.xyz \
    --cc=liliana.prikler@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/guix.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.