From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id oGwWGRLdVWdeNwEA62LTzQ:P1 (envelope-from ) for ; Sun, 08 Dec 2024 17:53:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id oGwWGRLdVWdeNwEA62LTzQ (envelope-from ) for ; Sun, 08 Dec 2024 18:53:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=bLhlpd+z; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=AHuy9pfq; 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"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733680402; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=TdFSc2xtkuWlcThhNyAiCd/Eg5aT1V6HwxQDVIJRkHA=; b=ban2ZEr7tXPz4piDf5hLBEwfbDF5GqJstOKhcBVIBb8psWyaYZIv1B0nwMhtjTUbxkAC2/ jxuTJFMLnUEovefeIflYmpz+I9eltp0VCL7o9MUZE3QGzLi2DsAFV3tZhGXKHwAUq4Aqdz W0l7H6Kzd2hkkpJr5qeEHrt/mATw5bup4JANNdcBuoHGJnfjOdKXh4uX+6O+WZOl7Owzgs ENIye8odFokLFDjwHsLbqzoiL9aWKrYH0MpP2SZW+PhgMavtiYOn+VIdyqUSCM93JHO1d8 6NiCqL5R2SXCrZQslKXAjM5XstmwWQKLHmUfb8sLMZa/6yJelY+X5TZBEQMRjA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=bLhlpd+z; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=AHuy9pfq; 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"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733680402; a=rsa-sha256; cv=none; b=Y+uAhcOL49ZSIrf84Ri5ChNLTGGLZ5PDZ+dc0ty459ZqQWzabnUAW963fzH1zMHm4j0rro YKNiTdgK2LerGIP/4WENVHYYpNxXxRN3/tIoaPaqxb73HV/OR4huhLYQEjARQrcw6bLoPF ah1eAVTx+FSTPchQlIJstZlLhJ/edjK9EMQk+lxCdvrqKzL3Z3MZML6gg5UWY+i5OTsMOF zORJvjeI46yDFg5Oy6ilLavdKBNm7JVK+y4DwJQPgn3HWJjLwSY18oVdvjV63ufglvuWNC SU1o+x2MzF1k/3WkN4++5utxt4PuRlVjrcVm8zisKS3j/wlkAgFo2/s1t5Jfqw== 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 0730180CBC for ; Sun, 08 Dec 2024 18:53:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKLSs-000598-2X; Sun, 08 Dec 2024 12:53:06 -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 1tKLSq-000590-Po for bug-guix@gnu.org; Sun, 08 Dec 2024 12:53:04 -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 1tKLSq-0001Ge-A9 for bug-guix@gnu.org; Sun, 08 Dec 2024 12:53:04 -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:From:To:In-Reply-To:References:Subject; bh=TdFSc2xtkuWlcThhNyAiCd/Eg5aT1V6HwxQDVIJRkHA=; b=bLhlpd+zhydh8kYdD7Yr4576Fk9p3h95viUQb+h8i44WcLwzhGRyVuES19pzyl5kbi/ARIGjucIozP+0kpRh8eck8rc6TLBy4fvR6XMOvtspDmxpRknMl3Gm/JnRhv6Goe3kjjTitnIyg0aQupNfsTnU5+yWKKlgCnQ8gI3Ln15tKAU9pOwvxUlkLgCxY3f0Ye8or2cPM9hDZwVH6PPv+SSHwRKyZsVGx1ugI2DlOiRsMsp793Vb5LCGKiWtCrvS55ZtI7cJSroJ7D0uTI/Mynwr1buxZ6W+n3uRpFmfQvqD+8rY5qnF66TrnzOaug1gS+HR3YC/1BLnlz87RjlC0A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKLSo-00063a-8a; Sun, 08 Dec 2024 12:53:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#67292: [PATCH] gnu: emacs: Pin natively compiled packages. References: <5b74251c-e6ab-bb39-7892-3a792ed6854d@telenet.be> In-Reply-To: <5b74251c-e6ab-bb39-7892-3a792ed6854d@telenet.be> Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com, bug-guix@gnu.org Resent-Date: Sun, 08 Dec 2024 17:53: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: 67292@debbugs.gnu.org Cc: Mekeor Melire , Maxime Devos , Simon Tournier , andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com X-Debbugs-Original-Xcc: andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com Received: via spool by 67292-submit@debbugs.gnu.org id=B67292.173368037123250 (code B ref 67292); Sun, 08 Dec 2024 17:53:02 +0000 Received: (at 67292) by debbugs.gnu.org; 8 Dec 2024 17:52:51 +0000 Received: from localhost ([127.0.0.1]:51620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKLSc-00062v-Lk for submit@debbugs.gnu.org; Sun, 08 Dec 2024 12:52:51 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:53396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKLSZ-00062c-I1 for 67292@debbugs.gnu.org; Sun, 08 Dec 2024 12:52:48 -0500 Received: by mail-wr1-f65.google.com with SMTP id ffacd0b85a97d-38633b5dbcfso1250775f8f.2 for <67292@debbugs.gnu.org>; Sun, 08 Dec 2024 09:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733680301; x=1734285101; darn=debbugs.gnu.org; h=cc:to:content-transfer-encoding:mime-version:subject:date:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=TdFSc2xtkuWlcThhNyAiCd/Eg5aT1V6HwxQDVIJRkHA=; b=AHuy9pfqPtSCf0kpivuUNOPQ02Nd4YMibq0JtwwEW/OThe2Y5h4H442eM6uOaYU/OX YE7h5YbzVZcnpeqQ8OdUYv0dMyFv/tyZUzG1XMShlRza7bHEdhZsCsKHWfbpN79JYfYp 5VL6LSBGASgxPqGqyLORS/EUZa6UvQnNJ7jI9eZ+2/yv9yN6AL1Lw50T38+6i/k7LSTE nst9oKdIe0XN/TjHF9NYTsrFphRjTzmZzcX2o1Ii1eeVrDtuYalW4FqceGdJNezqe+xd lXDVP6A99jNjASnsoCPHplZH/DcPhNK+a4X2Oy1OSFJ6GbDCBSdChu+nX8Yke7wwDEU7 kYQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733680301; x=1734285101; h=cc:to:content-transfer-encoding:mime-version:subject:date:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TdFSc2xtkuWlcThhNyAiCd/Eg5aT1V6HwxQDVIJRkHA=; b=uUaeuOWfjA+2JjfyD5I6crKhBBFMeDQNAXPIsIpnJkxuTMDnTxM/EJq58QA1tVgmfa Go2XSlAaIIxEl563GUf7lCFtxndWfS7wFK93ql68RWbHSnefBhRpjb7CNfeUw/GdC8WS SpKAbsxgQNHXxrglXzHNQBNokyzqP5L3HkaD0HEH1+JjJTZiqpLht9P4Epk18mrL2X+X ENQthfIFGA2HaSHICKvKn+UsyBgcUptx1hGCGLZSu3lS3+P0tYSOoOVJSwhVEtC78uCH bJHt2Uemm5WrYx8UOUn8xNER5Mhb8RSjKniD6MYFn1v+da/e7Xu1BdjshLJiJZ4Drrci SSrw== X-Gm-Message-State: AOJu0Yx0h+5v6LGjVYiXL0ZZZ4v+Rl9UZ/5vHluC/Vrd/l3pcHExEelW RSQUDMLyWNmmBHzHrkrF3GKXq0XKL2nbRKe15Nky87N7XsE4nNUzaty9fNvg X-Gm-Gg: ASbGncuPhC3zLxK+se3omhebF4iQaVXkxgSgym72QAg2MUScFvM+JXRKK2gYKkzYq1k 5e2k2jmcA3FgMX8m6B5Zc2JKcdT8VrMyQHJKnZcUndsgxxWZ6wF8MohBm/qPhY5YXCmANt9j2oc t17XWa7b+6WW+AptA8qnLBWiByTsGQZfxrhDBFDMFNSeE/4ZHDzjiQM0LJYQJq8ElHCrjn4wryE JRDVcRmAOk1llpBdPAPDAHKG2zx1/GcDv2q15IhoolGiJs+2dUk0f8HpH2ptho1gHIZUlVzgBnP dRXUBRyhpC1sz9exeKyyfxV6Ew== X-Google-Smtp-Source: AGHT+IFdXSEbwdvGEfTg6eYzqbPpd/16FKZFYEjPfQyAiCEQJ8YgjY+yI+oF35XHW7sNbFgSBKnaDA== X-Received: by 2002:a5d:6d0e:0:b0:385:fabf:13d5 with SMTP id ffacd0b85a97d-3862b36ac65mr8699466f8f.25.1733680301175; Sun, 08 Dec 2024 09:51:41 -0800 (PST) Received: from lumine.fritz.box (85-127-114-32.dsl.dynamic.surfer.at. [85.127.114.32]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434f44eaac7sm25859115e9.42.2024.12.08.09.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2024 09:51:40 -0800 (PST) Message-ID: <01f9481f9ab86a21bc85e82a6f2a7e3457d2709e.1733679675.git.liliana.prikler@gmail.com> From: Liliana Marie Prikler Date: Sun, 8 Dec 2024 18:30:54 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: , 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-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 3.24 X-Spam-Score: 3.24 X-Migadu-Queue-Id: 0730180CBC X-TUID: 9sVgnT/hcFck * 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 ‘disable-native-compilation’. Fixes: Emacs native-comp collisions --- Hi Guix I finally got around to fixing this issue. The fix is actually quite simple: it checks that the candidate eln file resides under the same prefix as the 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=emacs-minimal=emacs` will load the native-compiled emacs We still have to find a better way to enable native compilation for everything, 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.patch 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 = \ %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.patch" "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 process) (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 packages - ;; 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 +=================================================================== +--- emacs-29.4.orig/src/lread.c ++++ emacs-29.4/src/lread.c +@@ -1668,9 +1668,34 @@ directories, make sure the PREDICATE fun + + #ifdef HAVE_NATIVE_COMP + static bool ++permit_swap_for_eln (Lisp_Object src_name, Lisp_Object eln_name) ++{ ++ char *src = SSDATA (src_name), *eln = SSDATA (eln_name); ++ size_t eln_ln = strlen (eln); ++ ++ while (*src && *eln && *src == *eln) ++ { ++ ++src; ++eln; --eln_ln; ++ } ++ ++ /* After stripping common prefixes, the first directory should be ++ * "lib/" (inside the Guix store) or "native-lisp" (inside Emacs build). ++ * 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") != 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 = emacs_open (SSDATA (ENCODE_FILE (eln_name)), O_RDONLY, 0); + base-commit: 17d86ac9df841deca4f2f5e173f50bd2461fe680 -- 2.46.0