GNU bug report logs - #63716
30.0.50; Unable to install external packages with Nix after recent native-compilation changes

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Brian Leung <leungbk@HIDDEN>; merged with #63679, #63681, #63710, #63742; dated Thu, 25 May 2023 11:48:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Merged 63679 63681 63710 63716 63742. Request was from Andrea Corallo <acorallo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Merged 63679 63681 63710 63716 63742. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 May 2023 11:47:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 25 07:47:45 2023
Received: from localhost ([127.0.0.1]:46169 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q29RY-0003SP-On
	for submit <at> debbugs.gnu.org; Thu, 25 May 2023 07:47:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:54498)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leungbk@HIDDEN>) id 1q29RW-0003S5-Iw
 for submit <at> debbugs.gnu.org; Thu, 25 May 2023 07:47:43 -0400
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 <leungbk@HIDDEN>)
 id 1q29RQ-0006pj-L7
 for bug-gnu-emacs@HIDDEN; Thu, 25 May 2023 07:47:41 -0400
Received: from mout01.posteo.de ([185.67.36.65])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <leungbk@HIDDEN>)
 id 1q29RO-0004o3-C9
 for bug-gnu-emacs@HIDDEN; Thu, 25 May 2023 07:47:36 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id A39FE240028
 for <bug-gnu-emacs@HIDDEN>; Thu, 25 May 2023 13:47:30 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1685015250; bh=aWmUkUeb5Vn07G4GJi3ah6NlcVoJeBbnivxMy+PARL8=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From;
 b=ZoKtib6X9t++O258bLIudrcNuUhHL7oarHA1euzNiJ3FSyVUdZOMAQk1EzBH4I+so
 gLeitf4bXRjbbNJPAE1igW6GDelNwUbSDpDeYAnzfxgzUhMY3MjMg134he0Uy83aMx
 YaMpTWBF9//Y/dpJSH5UFrVh1bhUhMGwF7GG8ur2fzYuPDQnjOfFfDYmNo3O044K7n
 rvCN2XKMM0UbBXAcHAWlnIGH6+uD+FrNz81zes3zy+Iiy7io/5HuYvIDB7qg5ErUY0
 cKXOB3rJu+5BqYnAOOuq1saQZObb48K29G3kY4HYzMjeRsWNu47sgAjZllmhnb6uc7
 Wtm+x1vWZtwew==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4QRmWP3Rw0z9rxV;
 Thu, 25 May 2023 13:47:29 +0200 (CEST)
From: Brian Leung <leungbk@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; Unable to install external packages with Nix after recent
 native-compilation changes
Date: Thu, 25 May 2023 11:12:58 +0000
Message-ID: <878rdcab04.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
Received-SPF: pass client-ip=185.67.36.65; envelope-from=leungbk@HIDDEN;
 helo=mout01.posteo.de
X-Spam_score_int: -33
X-Spam_score: -3.4
X-Spam_bar: ---
X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HEXHASH_WORD=1,
 RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Andrea Corallo <akrl@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


Starting with the recent batch of native-comp commits ending with 
and including Emacs commit 
b2b2be98da5825e6bc130999ffe38f5ed615586a, using the Nix package 
manager I cannot install an Emacs containing natively-compiled 
external packages. (I have no problems on Emacs commit 
f4de81af8fc54ef278cdb76fbc5885ed7d05b2d7, which is the commit 
immediately preceding the first of the recent native-comp commits)

Building core Emacs (with native compilation) is successful, but I 
encounter problems upon running 
(https://github.com/nixos/nixpkgs/blob/8fbdc4e6114795323ad2b74d13e1c842c5618b78/pkgs/build-support/emacs/melpa.nix#L99-L102):

>    emacs --batch -Q \
>        -l "$elpa2nix" \
>        -f elpa2nix-install-package \
>        "$archive" "$out/share/emacs/site-lisp/elpa"

This fails when trying to run package-tar-file-info 
(https://github.com/nixos/nixpkgs/blob/8fbdc4e6114795323ad2b74d13e1c842c5618b78/pkgs/build-support/emacs/elpa2nix.el#L14-L15). The 
full backtrace is here:

>    Error: error ("Can't find define-package in 
>    vterm-20230417.424/vterm-pkg.el")
>    mapbacktrace(#f(compiled-function (evald func args flags) 
>    #<bytecode -0xe76c55f6510e41>))
>    debug-early-backtrace()
>    debug-early(error (error "Can't find define-package in 
>    vterm-20230417.424/vterm-pkg.el"))
>    error("Can't find define-package in %s" 
>    "vterm-20230417.424/vterm-pkg.el")
>    package-tar-file-info()
>    (if (derived-mode-p 'tar-mode) (package-tar-file-info) 
>    (package-buffer-info))
>    (let ((pkg-desc (if (derived-mode-p 'tar-mode) 
>    (package-tar-file-info) (package-buffer-info)))) 
>    (package-unpack pkg-desc) pkg-desc)
>    elpa2nix-install-from-buffer()
>    (progn (if is-tar (insert-file-contents-literally file) 
>    (insert-file-contents file)) (if is-tar (progn (tar-mode))) 
>    (elpa2nix-install-from-buffer))
>    (unwind-protect (progn (if is-tar 
>    (insert-file-contents-literally file) (insert-file-contents 
>    file)) (if is-tar (progn (tar-mode))) 
>    (elpa2nix-install-from-buffer)) (and (buffer-name 
>    temp-buffer) (kill-buffer temp-buffer)))
>    (save-current-buffer (set-buffer temp-buffer) (unwind-protect 
>    (progn (if is-tar (insert-file-contents-literally file) 
>    (insert-file-contents file)) (if is-tar (progn (tar-mode))) 
>    (elpa2nix-install-from-buffer)) (and (buffer-name 
>    temp-buffer) (kill-buffer temp-buffer))))
>    (let ((temp-buffer (generate-new-buffer " *temp*" t))) 
>    (save-current-buffer (set-buffer temp-buffer) (unwind-protect 
>    (progn (if is-tar (insert-file-contents-literally file) 
>    (insert-file-contents file)) (if is-tar (progn (tar-mode))) 
>    (elpa2nix-install-from-buffer)) (and (buffer-name 
>    temp-buffer) (kill-buffer temp-buffer)))))
>    (let ((is-tar (string-match "\\.tar\\'" file))) (let 
>    ((temp-buffer (generate-new-buffer " *temp*" t))) 
>    (save-current-buffer (set-buffer temp-buffer) (unwind-protect 
>    (progn (if is-tar (insert-file-contents-literally file) 
>    (insert-file-contents file)) (if is-tar (progn (tar-mode))) 
>    (elpa2nix-install-from-buffer)) (and (buffer-name 
>    temp-buffer) (kill-buffer temp-buffer))))))
>    elpa2nix-install-file("/build/packages/vterm-20230417.424.tar")
>    (progn (setq package-user-dir elpa) (elpa2nix-install-file 
>    archive))
>    (let ((archive x0) (elpa x2)) (progn (setq package-user-dir 
>    elpa) (elpa2nix-install-file archive)))
>    (if (null x3) (let ((archive x0) (elpa x2)) (progn (setq 
>    package-user-dir elpa) (elpa2nix-install-file archive))))
>    (let* ((x2 (car-safe x1)) (x3 (cdr-safe x1))) (if (null x3) 
>    (let ((archive x0) (elpa x2)) (progn (setq package-user-dir 
>    elpa) (elpa2nix-install-file archive)))))
>    (if (consp x1) (let* ((x2 (car-safe x1)) (x3 (cdr-safe x1))) 
>    (if (null x3) (let ((archive x0) (elpa x2)) (progn (setq 
>    package-user-dir elpa) (elpa2nix-install-file archive))))))
>    (let* ((x0 (car-safe command-line-args-left)) (x1 (cdr-safe 
>    command-line-args-left))) (if (consp x1) (let* ((x2 (car-safe 
>    x1)) (x3 (cdr-safe x1))) (if (null x3) (let ((archive x0) 
>    (elpa x2)) (progn (setq package-user-dir elpa) 
>    (elpa2nix-install-file archive)))))))
>    (if (consp command-line-args-left) (let* ((x0 (car-safe 
>    command-line-args-left)) (x1 (cdr-safe 
>    command-line-args-left))) (if (consp x1) (let* ((x2 (car-safe 
>    x1)) (x3 (cdr-safe x1))) (if (null x3) (let ((archive x0) 
>    (elpa x2)) (progn (setq package-user-dir elpa) 
>    (elpa2nix-install-file archive))))))))
>    elpa2nix-install-package()
>    command-line-1(("-l" 
>    "/nix/store/4jj63z4v1xp13rh2md053dccq920hd45-elpa2nix.el" 
>    "-f" "elpa2nix-install-package" 
>    "/build/packages/vterm-20230417.424.tar" 
>    "/nix/store/rf3rsbn6sa1l5v8pbsk02g0nrm5a7pnr-emacs-vterm-20230417.424/share/emacs/site-lisp/elpa"))
>    command-line()
>    normal-top-level()

I do not encounter any problems if I do not native-compile, or if 
I use an earlier commit as I mentioned.

Unlike the possibly-related and unresolved bug#63288, the error I 
am now getting appears to be consistently reproducible when I 
revert ea9831bb3cb4878273f6f848051c9b8c3c76d5f1, which in a Nix 
sandbox would non-deterministically cause external packages to 
fail during native compilation. I have also noticed the same error 
occurring when I leave ea9831bb3cb4878273f6f848051c9b8c3c76d5f1 
unreverted, though I haven't tested this latter scenario often 
enough to be sure that ea9831bb3cb4878273f6f848051c9b8c3c76d5f1 
has no impact since I was worried that the non-determinism would 
complicate things.

CCing Andrea Corallo.




Acknowledgement sent to Brian Leung <leungbk@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#63716; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 28 May 2023 18:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.