From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CHspOizBDWR6wgAASxT56A (envelope-from ) for ; Sun, 12 Mar 2023 13:10:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kPkyOSzBDWSnPwEAG6o9tA (envelope-from ) for ; Sun, 12 Mar 2023 13:10:20 +0100 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 7594C10597 for ; Sun, 12 Mar 2023 13:10:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbKWk-0001iM-JV; Sun, 12 Mar 2023 08:10:14 -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 ) id 1pbA0J-0007aU-1Q for bug-guix@gnu.org; Sat, 11 Mar 2023 19:56:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pbA0I-0000hW-OI for bug-guix@gnu.org; Sat, 11 Mar 2023 19:56:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pbA0I-0005n6-DG for bug-guix@gnu.org; Sat, 11 Mar 2023 19:56:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#62134: guix substitute crashes, instead of printing a useful error message, when the only substitutes on offer use unsupported compression Resent-From: "Zack Weinberg" Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 12 Mar 2023 00:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62134 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 62134@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167858256022250 (code B ref -1); Sun, 12 Mar 2023 00:56:02 +0000 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" 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 12 Mar 2023 08:10:11 -0400 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 ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=owlfolio.org header.s=fm1 header.b=Gyq9lGHT; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=rhkwjxgB; 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)" header.from=owlfolio.org (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678623020; a=rsa-sha256; cv=none; b=oms57mrpL+b0LpQ4NK9My+YfDfss7EmYtSsJTFws3rnAh8wRsoznOXUyfkQiLuBpH1oSFs OLldcrhv3sN4hP6Q3qBydaVK+zUPfcf2EkktMGByR9sWXpqFeRG+sp1mBtKrIXvUyjTfTq /zVg64S2Oe1qrcBV8uVQz339x7x8YEOh9fT9weihvjq8pb2RVoZJeDTLVPOirbiWx5gRar AciepYfPgErDYK9oE1ERrJClTQwa99mS+ozzLY+GMFc0XVWaib6mfS0T6bLES5tNajWxH0 jt6TKvIcsIbwv035FArm4Fo2eX0V4kxsGknDMhMd5SNFmNR+jqqQ9/Q8Rz3rOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678623020; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=meSozmhtJExpE1APIpfq6ZNHMU2gcex6CZGjb2d6MDU=; b=s4w4WTEwQ/6WpQ1nnvJz+xX4JxluEE2SOUbRRKJ+9W897vqAbpN5Oz9dILRvNXzYSUk7Vb s+gPnbYgf0MRY7SfqWvFh2wBTixDOmTfrgK2AhOWQkwqiJJtaC5/trWqvjYh3joH8uURVE A+cHsxOVWFLXxeRx9fhVQCAXvgGBX7FJ1YtNrt1CME1Y+DBIEkeG0F6RUUFjRMS5jQBeBc AuxMdwF9GXxVLTU+1mtFjBMKnchIFHTP5w/rE9gRSd0jAGxMsfjGoRVw86X3I1GuqHKPT6 fviEb8S2cyI5/TzSoG7q4Oy7ru2sxmVFWRJMFZKkgPGglW+xy3wCMTwn6W/+xg== X-Migadu-Spam-Score: -1.90 X-Spam-Score: -1.90 X-Migadu-Queue-Id: 7594C10597 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=owlfolio.org header.s=fm1 header.b=Gyq9lGHT; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=rhkwjxgB; 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)" header.from=owlfolio.org (policy=none) X-TUID: puHlcBZL9Fq0 `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