From unknown Tue Jun 17 21:50:26 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#62134 <62134@debbugs.gnu.org> To: bug#62134 <62134@debbugs.gnu.org> Subject: Status: guix substitute crashes, instead of printing a useful error message, when the only substitutes on offer use unsupported compression Reply-To: bug#62134 <62134@debbugs.gnu.org> Date: Wed, 18 Jun 2025 04:50:26 +0000 retitle 62134 guix substitute crashes, instead of printing a useful error m= essage, when the only substitutes on offer use unsupported compression reassign 62134 guix submitter 62134 "Zack Weinberg" severity 62134 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 11 19:56:00 2023 Received: (at submit) by debbugs.gnu.org; 12 Mar 2023 00:56:00 +0000 Received: from localhost ([127.0.0.1]:58841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbA0F-0005mo-JN for submit@debbugs.gnu.org; Sat, 11 Mar 2023 19:56:00 -0500 Received: from lists.gnu.org ([209.51.188.17]:45618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbA0D-0005mf-NP for submit@debbugs.gnu.org; Sat, 11 Mar 2023 19:55:58 -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 1pbA0D-0007aB-E5 for bug-guix@gnu.org; Sat, 11 Mar 2023 19:55:57 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbA0B-0000h1-EU for bug-guix@gnu.org; Sat, 11 Mar 2023 19:55:57 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 67CF85C0085 for ; Sat, 11 Mar 2023 19:55:52 -0500 (EST) Received: from imap45 ([10.202.2.95]) by compute1.internal (MEProxy); Sat, 11 Mar 2023 19:55:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=owlfolio.org; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to; s=fm1; t=1678582552; x=1678668952; bh=me SozmhtJExpE1APIpfq6ZNHMU2gcex6CZGjb2d6MDU=; b=Gyq9lGHTTgfmER+R/t lYo8Kt+cornExd6wKQGBbiy2nflZ0p2E5ktsR0WNGobyEp43w41vSJBG4tIZJztr ZEk2TOz3l+wYC/RFZEGZgpEfxI4mT5WuE1+ZjakcmiBTs9DherSvZHOX8/oDTVMT AmRKiKP/HbBq/LQw+13Z0KFdIVdJjfHUz6feegqMNalL9OFLyfe+5XY1WEWI4Yuf 3V68nv07VdJrRE1nfoD1LPcFRz2M7H4hmQNEQB/tALGLRqzNIehKGbcVXeOVSGlA Ul2VN+Gw1ln2yopW0ePp+r2/Bclf74vmW63xIj81Bl36ogxsSDgw+ePwpa+s5gRW eszQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1678582552; x=1678668952; bh=meSozmhtJExpE 1APIpfq6ZNHMU2gcex6CZGjb2d6MDU=; b=rhkwjxgBVpsWe5zJwrMk3jHapf2B4 HmQP9186mAvIvMD5FKAXG7BF/gg+9dvQFr8icIBmfCz1Gi//Hiavg9RI0LsdBM4s RzW5xufIQIiKRmRjEEtCLbM7M5/+OeYD8PPvvlbSPiKFqHgrQY2KjPgSQ3KOz4VM CjnpsIK1clla0kDrAPhJEPF9fYHJBLJqLF2UuLQQ4tAg5ldjChajNzwA9LDmI2Os ZLDn0h5ium7ylWn4lZV8F19IzotbouC36zhMWnQ68L3vuTm9l59LDl+uYFXQu3M9 hnX8oemqyKy9T9EFc+RkEB2FQabtyaHjr3Ph4Zs20kMO8oq6hfHfZOGXg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddvuddgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtgfesthhqre dtreerjeenucfhrhhomhepfdgkrggtkhcuhggvihhnsggvrhhgfdcuoeiirggtkhesohif lhhfohhlihhordhorhhgqeenucggtffrrghtthgvrhhnpeduieeghfdtvefgjedtueefke evhffgtdduveekkefgkeefheelieffteduhfetkeenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpeiirggtkhesohiflhhfohhlihhordhorhhg X-ME-Proxy: Feedback-ID: i876146a2:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 017F3272007A; Sat, 11 Mar 2023 19:55:52 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-206-g57c8fdedf8-fm-20230227.001-g57c8fded Mime-Version: 1.0 Message-Id: Date: Sat, 11 Mar 2023 19:55:31 -0500 From: "Zack Weinberg" To: bug-guix@gnu.org Subject: guix substitute crashes, instead of printing a useful error message, when the only substitutes on offer use unsupported compression Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=66.111.4.28; envelope-from=zack@owlfolio.org; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) `narinfo-best-uri` ends with ``` (match (sort choices (if fast-decompression? (negate speed) substitute: In ice-9/boot-9.scm: substitute: 724:2 15 (call-with-prompt _ _ #) substitute: In ice-9/eval.scm: substitute: 619:8 14 (_ #(#(#))) substitute: In guix/ui.scm: substitute: 2275:7 13 (run-guix . _) substitute: 2238:10 12 (run-guix-command _ . _) substitute: In ice-9/boot-9.scm: substitute: 1752:10 11 (with-exception-handler _ _ #:unwind? _ # _) substitute: 1752:10 10 (with-exception-handler _ _ #:unwind? _ # _) substitute: In guix/scripts/substitute.scm: substitute: 842:18 9 (_) substitute: 352:7 8 (process-query # _ #:cache-urls= _ #:acl _) substitute: In srfi/srfi-1.scm: substitute: 634:9 7 (for-each # =E2=80=A6) substitute: In guix/scripts/substitute.scm: substitute: 297:13 6 (_ #< path: "/gnu/store/=E2=80=A6>) substitute: In guix/narinfo.scm: substitute: 346:2 5 (narinfo-best-uri _ #:fast-decompression? _) substitute: In ice-9/boot-9.scm: substitute: 1685:16 4 (raise-exception _ #:continuable? _) substitute: 1685:16 3 (raise-exception _ #:continuable? _) substitute: 1780:13 2 (_ #<&compound-exception components: (#<&error>= #<&orig=E2=80=A6>) substitute: 1685:16 1 (raise-exception _ #:continuable? _) substitute: 1685:16 0 (raise-exception _ #:continuable? _) substitute: substitute: ice-9/boot-9.scm:1685:16: In procedure raise-exception: substitute: Throw to key `match-error' with args `("match" "no matching = pattern" ())'. guix package: error: `/usr/bin/guix substitute' died unexpectedly ``` The strongest clue to what is actually wrong is ``` Throw to key `match-error' with args `("match" "no matching pattern" ()) ``` and you have to know that that () at the end of the error message means = `match` was passed an empty list. OK, so when can the choices list be empty for a package? Simply, when t= he only substitutes on offer for that package have been compressed with = compression methods that the *Guix daemon*'s Guile installation does not= support -- for instance, zstd, if the (zstd) module is not available. = narinfo-best-uri intentionally filters those URIs out of the choices lis= t, but is not prepared for the possibility that nothing will be left. I tripped over this with a somewhat heterodox configuration; a third-par= ty substitute server that only offers zstd-compressed nars, plus Guix as= foreign package manager on Debian, with the daemon installed from *Debi= an's* package, which doesn't have a dependency on guile-zstd (*Guix's* p= ackage of guix does depend on guile-zstd). Still, I feel that the princ= iple "externally supplied data, no matter how malformed, should never ca= use a crash" applies. The requested change, then, is for `guix substitute` to *not* crash if t= he filtered choices list is empty. Probably narinfo-best-uri should ret= urn (values nil nil nil) in that case, and then scripts/substitute.scm s= hould also be changed to error out gracefully and/or fall back to local = building when it gets that result from narinfo-best-uri. zw