From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id YJJnFF6gVmeVOAEAqHPOHw:P1 (envelope-from ) for ; Mon, 09 Dec 2024 07:46:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id YJJnFF6gVmeVOAEAqHPOHw (envelope-from ) for ; Mon, 09 Dec 2024 08:46:38 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=NrEQozoU; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=key1 header.b=mBpKnZHN; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733730398; a=rsa-sha256; cv=none; b=gfZOseGNY1nRqDe1cLXUal3F6vcZEvwcrjwJxQVGGpKiNrPJ1WNr9JmARjiPZlOAKherwa a5nlbC7VitrZXmvFnza109JZbUrVJYicU0E8xhVfWBPNBQwH4DK2AKzwmOabz2USXLbRVd SePGpoCnkKtE2MYF+bdm5oHunzUQWcq4bhqeCFbHuvNOJhAsikpjunVLxJGRIMNCa1bsJ3 /8ZbfZJymRlBcT+Vlzn1pJxWrrb7GF4kudHXcBrVvcLsnIl6yYKBxQZKU8miOOFHOTy/FR h+gjqk3gMcS2dSLpLpq93b1xTVFWh0D4SE63va5/sbutCUQK/S6xZPdedK6GNg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=NrEQozoU; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=key1 header.b=mBpKnZHN; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733730398; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=naozM5MVLhW+mAO+as57SPHTfWbqdHhtvZj4GKpAHM0=; b=bcjrYVLZzlYuR62z59zhy7w2M6a7QF+eK1UNDXWCAcUt26z+1jLTCY+vZEUsdP/U/ZXV50 WFS1nqUvDc+UCIQWH7eZ4JEOaUV08Wsl4Y7DmiY+s1ZW0FsutsJ7rjYOtz148QO8nT7en3 vA7xpVAdiHpIXld2/70qfkK4flmK0S7F3qXApwB6Voy41cCv/GNfPl2/k02q91nhX3N16J Cid+MQN3PeNykETBZ7ltNnKMRdL9UdwE+sXy8l+/xA05YpQEOfV+Iz17HilHYbiG2ovtI0 8ZnC0tJrt8Jdz86CasnHV3QDQF/2HQS4Oi8j1AhPkOkUKoh7fNGVvMCk63wEPg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B75E51F6E5 for ; Mon, 09 Dec 2024 08:46:37 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKYT5-0000hL-Dz; Mon, 09 Dec 2024 02:46:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKYSw-0000gr-Uv for bug-guix@gnu.org; Mon, 09 Dec 2024 02:46:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKYSw-0001Hb-Kx for bug-guix@gnu.org; Mon, 09 Dec 2024 02:46:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=naozM5MVLhW+mAO+as57SPHTfWbqdHhtvZj4GKpAHM0=; b=NrEQozoUlYNCGenDUWBc/RAMxutAycPm3F49MzwOvV2jXtUHRyBxw8adgy1KkYkgJvSHJ0W0C6l09PiGv8bS3S5MltW59zQBIMYe+ycsSnqMDUPf7TVscsKb/XTYwjHvDLrjvKRC3LafbxRNWJ4Gq9tNfdGXDepQIJzMjW7ve5k+YLYlF/c0wTmaasZiSVK0swP1WqimRKz9Hw+XUQ7jAicCuMGom2rCfHt2wFdRfTeJ/wGAHVIX4/0duGh9r/JtESiJP8pBK44Qqwgcctg8zxn+4g5k/4kbw/d7v9BB1WjIALJDigLOqLt2s7cuughHtP0kzzTwgHQHQ55KTMzhZA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKYSw-0005H2-FP for bug-guix@gnu.org; Mon, 09 Dec 2024 02:46:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#67292: [PATCH] gnu: emacs: Pin natively compiled packages. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 09 Dec 2024 07:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67292 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Liliana Marie Prikler , 67292@debbugs.gnu.org Cc: Mekeor Melire , cox.katherine.e+guix@gmail.com, Maxime Devos , liliana.prikler@gmail.com, Simon Tournier Received: via spool by 67292-submit@debbugs.gnu.org id=B67292.173373036220268 (code B ref 67292); Mon, 09 Dec 2024 07:46:02 +0000 Received: (at 67292) by debbugs.gnu.org; 9 Dec 2024 07:46:02 +0000 Received: from localhost ([127.0.0.1]:52769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKYSv-0005Gm-80 for submit@debbugs.gnu.org; Mon, 09 Dec 2024 02:46:01 -0500 Received: from out-177.mta1.migadu.com ([95.215.58.177]:12943) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKYSs-0005GU-Ie for 67292@debbugs.gnu.org; Mon, 09 Dec 2024 02:46:00 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=key1; t=1733730321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=naozM5MVLhW+mAO+as57SPHTfWbqdHhtvZj4GKpAHM0=; b=mBpKnZHNuDD5+CNLvEo10KkgZoO+ewnYB+spawTZDZdzjryV8QlEQ4BYFFoS7O2fGRG9hK lUntWUP16jRtUJSx+6hBv9eSMqhYxyBVWtcrqFVEr+XjZnPp+CwPxhjdJtUOM4uqC6A9wR rauq61jlgZf0ATI5wbbidBnlpyEuhgoOUwNdp3HVr7dK9y2OYLrcjaocl3HREqRh7fI/y2 hxAISus7oKzaqAn6B2RFUZy0cEx5a1wByMoAhAHs36q93RctHRUIuLMOWE31UIXxxdyy1m BtcNDp7mm+xgUKKcT/9NhKpGxBCjwBztDcxdvpnZgzRiTokeiRc0JSDMrCJWQg== In-Reply-To: <01f9481f9ab86a21bc85e82a6f2a7e3457d2709e.1733679675.git.liliana.prikler@gmail.com> References: <5b74251c-e6ab-bb39-7892-3a792ed6854d@telenet.be> <01f9481f9ab86a21bc85e82a6f2a7e3457d2709e.1733679675.git.liliana.prikler@gmail.com> Date: Mon, 09 Dec 2024 11:45:13 +0400 Message-ID: <87h67db8qe.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Andrew Tropin From: Andrew Tropin via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.16 X-Spam-Score: -4.16 X-Migadu-Queue-Id: B75E51F6E5 X-Migadu-Scanner: mx10.migadu.com X-TUID: Q6jTwEUZwHE6 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2024-12-08 18:30, Liliana Marie Prikler wrote: > * gnu/packages/patches/emacs-native-comp-pin-packages.patch: New patch. > * gnu/local.mk (dist_patch_DATA): Register it here. > * gnu/packages/emacs.scm (emacs)[source]: Use it here. > [#:phases]: Remove =E2=80=98disable-native-compilation=E2=80=99. > > Fixes: Emacs native-comp collisions > --- > Hi Guix > > I finally got around to fixing this issue. The fix is actually quite sim= ple: > it checks that the candidate eln file resides under the same prefix as th= e elc > file it was generated from. With this change applied > > * `guix shell emacs` will allow emacs to load its own natively-compiled > transient, assuming a previously clean environment > * `guix shell emacs emacs-transient` will instead load the byte-compiled > transient from emacs-transient > * `guix shell emacs emacs-transient --with-input=3Demacs-minimal=3Demacs`= will > load the native-compiled emacs > > We still have to find a better way to enable native compilation for every= thing, > but this will give us the best performance possible while avoiding similar > issues in the future (side-eyeing org-mode, cc-mode et al. for possible > breakages). > > Cheers > > gnu/local.mk | 1 + > gnu/packages/emacs.scm | 11 +----- > .../emacs-native-comp-pin-packages.patch | 39 +++++++++++++++++++ > 3 files changed, 41 insertions(+), 10 deletions(-) > create mode 100644 gnu/packages/patches/emacs-native-comp-pin-packages.p= atch > > diff --git a/gnu/local.mk b/gnu/local.mk > index a02745d59c..652a6c1748 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -1195,6 +1195,7 @@ dist_patch_DATA =3D \ > %D%/packages/patches/emacs-lispy-fix-thread-last-test.patch \ > %D%/packages/patches/emacs-native-comp-driver-options.patch \ > %D%/packages/patches/emacs-native-comp-fix-filenames.patch \ > + %D%/packages/patches/emacs-native-comp-pin-packages.patch \ > %D%/packages/patches/emacs-next-exec-path.patch \ > %D%/packages/patches/emacs-next-native-comp-driver-options.patch \ > %D%/packages/patches/emacs-pasp-mode-quote-file-names.patch \ > diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm > index 8140f61882..b0690fc4fb 100644 > --- a/gnu/packages/emacs.scm > +++ b/gnu/packages/emacs.scm > @@ -117,6 +117,7 @@ (define-public emacs-minimal > "emacs-fix-scheme-indent-function= .patch" > "emacs-native-comp-driver-options= .patch" > "emacs-native-comp-fix-filenames.= patch" > + "emacs-native-comp-pin-packages.p= atch" > "emacs-pgtk-super-key-fix.patch")) > (modules '((guix build utils))) > (snippet > @@ -233,16 +234,6 @@ (define-public emacs-minimal > (("\\(tramp-compat-process-running-p \"(.*)\"\\)" all pr= ocess) > (format #f "(or ~a (tramp-compat-process-running-p ~s))" > all (string-append "." process "-real")))))) > - (add-after 'unpack 'disable-native-compilation > - (lambda _ > - ;; Temporary workaround to prevent the behaviour discussed= in > - ;; . > - ;; Please remove once the native-compilation for Emacs pac= kages > - ;; is fully supported. > - (substitute* "lisp/transient.el" > - ((";; End:") > - ";; no-native-compile: t > -;; End:")))) > (add-before 'configure 'fix-/bin/pwd > (lambda _ > ;; Use `pwd', not `/bin/pwd'. > diff --git a/gnu/packages/patches/emacs-native-comp-pin-packages.patch b/= gnu/packages/patches/emacs-native-comp-pin-packages.patch > new file mode 100644 > index 0000000000..dc328f03a8 > --- /dev/null > +++ b/gnu/packages/patches/emacs-native-comp-pin-packages.patch > @@ -0,0 +1,39 @@ > +Index: emacs-29.4/src/lread.c > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +--- emacs-29.4.orig/src/lread.c > ++++ emacs-29.4/src/lread.c > +@@ -1668,9 +1668,34 @@ directories, make sure the PREDICATE fun > +=20 > + #ifdef HAVE_NATIVE_COMP > + static bool > ++permit_swap_for_eln (Lisp_Object src_name, Lisp_Object eln_name) > ++{ > ++ char *src =3D SSDATA (src_name), *eln =3D SSDATA (eln_name); > ++ size_t eln_ln =3D strlen (eln); > ++ > ++ while (*src && *eln && *src =3D=3D *eln) > ++ { > ++ ++src; ++eln; --eln_ln; > ++ } > ++ > ++ /* After stripping common prefixes, the first directory should be > ++ * "lib/" (inside the Guix store) or "native-lisp" (inside Emacs buil= d). > ++ * Alternatively, if eln contains "eln-cache", it's likely the user's > ++ * cache, which we will also permit. */ > ++ > ++ return > ++ (eln_ln > 4 && !strncmp (eln, "lib/", 4)) || > ++ (eln_ln > 12 && !strncmp (eln, "native-lisp/", 12)) || > ++ strstr (eln, "eln-cache") !=3D NULL; > ++} > ++ > ++static bool > + maybe_swap_for_eln1 (Lisp_Object src_name, Lisp_Object eln_name, > + Lisp_Object *filename, int *fd, struct timespec mtime) > + { > ++ if (!permit_swap_for_eln (src_name, eln_name)) > ++ return false; > ++ > + struct stat eln_st; > + int eln_fd =3D emacs_open (SSDATA (ENCODE_FILE (eln_name)), O_RDONLY,= 0); > +=20 > > base-commit: 17d86ac9df841deca4f2f5e173f50bd2461fe680 Hi Liliana! I didn't try this patch, but the approach looks reasonable. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmdWoAkACgkQIgjSCVjB 3rCG8g/+Mb/9h1LjeiGd+QWxwafzzZCm5dWOaKjSayZtYMC5XTQVKGr/iZLWlyDC U32/TuLnwWejDyhl31YZ2pNCzhFQM3tt8XvHNstn0SwIXHBOE4mlmbgHc1AOpoyS DOnQBA9h9aYevgmVdZq/rqVDw3joy2nURqz8fQmB0GY6oBxR3e/NPOrRLJM4SO70 viMm7Iu9DmYw12JzJuWU8MxJQFZRJNpup4QkS3tMoYN/LvD2Dumt8ROz8hFY6wlr 0Fo2FxC+vnhH4QWqKXtPUBnLQnZhojFG/fvxXwjTfNvZddvKnYmv0wmPXW8OE5xr O0TmtmA0Afki20YHCTyN4XJekip8tuHKXVTtEP4ahL5XE1/aWkX18lIDzpnv4rp3 LDreRq8f++ruz1xU5CnyULCZcqpUzM/xOZHU2I/E/d30SF9EJPz0qCx+Ianwc7oL IRIJFfaRQunARCM51Ov83DJCNRRCOdAwdmj7TfOCHpbLaGHijLyy7/YWhVPQwu8F Kio7GF/YkalIy4xvIX08eO/d7ehpQTUNSoTR5eLYuDhIiaDuklnxKj/DFfvGLAfh 0XH0I73y5DgBbtj+pbQVcmJpPOGf2r9KkNo0OjmSlwV3xleWUl8jY0GB/13lnp5Q DB687Vexo9G/hXyxJUD8kJm/zgLq77EOSdX6exOQkTrwqJeSjIw= =nt+Z -----END PGP SIGNATURE----- --=-=-=--