From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +DFnAEIhz2JbtgAAbAwnHQ (envelope-from ) for ; Wed, 13 Jul 2022 21:47:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id UCgaO0Ehz2KgDAAAG6o9tA (envelope-from ) for ; Wed, 13 Jul 2022 21:47:13 +0200 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 996962894E for ; Wed, 13 Jul 2022 21:47:13 +0200 (CEST) Received: from localhost ([::1]:37442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBiKG-0003oN-Au for larch@yhetil.org; Wed, 13 Jul 2022 15:47:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBiK6-0003mq-EB for bug-guix@gnu.org; Wed, 13 Jul 2022 15:47:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBiK6-0003Xa-3Y for bug-guix@gnu.org; Wed, 13 Jul 2022 15:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oBiK5-0006CD-Uw for bug-guix@gnu.org; Wed, 13 Jul 2022 15:47:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#56503: Poor error message on missing file using substitute* Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 13 Jul 2022 19:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56503 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Daniel =?UTF-8?Q?Mei=C3=9Fner?= , Maxim Cournoyer Cc: 56503@debbugs.gnu.org Received: via spool by 56503-submit@debbugs.gnu.org id=B56503.165774160523789 (code B ref 56503); Wed, 13 Jul 2022 19:47:01 +0000 Received: (at 56503) by debbugs.gnu.org; 13 Jul 2022 19:46:45 +0000 Received: from localhost ([127.0.0.1]:47801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBiJo-0006Bd-Pw for submit@debbugs.gnu.org; Wed, 13 Jul 2022 15:46:45 -0400 Received: from mail-ej1-f68.google.com ([209.85.218.68]:45981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBiJn-0006BR-41 for 56503@debbugs.gnu.org; Wed, 13 Jul 2022 15:46:43 -0400 Received: by mail-ej1-f68.google.com with SMTP id t1so5938519ejd.12 for <56503@debbugs.gnu.org>; Wed, 13 Jul 2022 12:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=2mT4BdpVN3uTHTsaAR01FdXrzYJnWgDLjjTo4Lc98Hg=; b=kPZzbX96eyvziATN16UMaSfgXNz0btYltP2TeT+NVDvG97Jpj7au2zeWFMfblSTRAm Z2Vckf5LbnmCTqukc6/wtrgNXUZB4zlrMCdO/ACxRnW9a7ZJqXjtFfedBIv3MJjtxJ0f 16lDgRf7++wmuMxGCx37LUcZlq6d7Ym8+AHDmRXLLtFFTQ0Eb2xqe0SE+j1ht5N+pRio n11IVXsaghrdCx3JahVijDZFIZ4sftDFvq6IaJJIG5IT7uGnYJhlbL4VaPGTnPcA7wXm VS06ofUkSpsXdfWA7w0VhCAv7iu809Mib6cUbTXg7Hc6oR5StWJoRYGF64l/kIpljnhA 6dxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=2mT4BdpVN3uTHTsaAR01FdXrzYJnWgDLjjTo4Lc98Hg=; b=Myv+VZ4LKVG1IM+fzl5dDh02PwsaB0R4xLkR/WhyFPMNbLBQWFortQoB2WdA4E8Ukx Rxhh1HTwMuVcrLvMAAJ9+aT6njQqRv6rIS/CTXWueIP/LDbZYBTHiUe5C3iCBAxwMzub IqG75QM/O61tWT2L6H/B8ewduyHUYTLvEwu5T1w8cnfKXI85AcmYRvNBRGlS2SQgUIgw 3Pj82mOXMEdZyvoq5G9Q4wOmwN99eAd35qBzmqdxr5M596L73yBQFNgC0rwpCocWWK2u l9i8vu8n/ZujKzHu+unkSSDFc+2q5f+M9TbsP9046SoDslHxRqeFRj1pVgI2fuCRcP9g nKaA== X-Gm-Message-State: AJIora9Yq1rJfIrZAKM/X7BoexKirMCN91s4wqg+4+z0nqbCCpk39ZqM eWOXy8JvxrjmWwcEBUB+p0g= X-Google-Smtp-Source: AGRyM1u7rb/ujEuIODs9Wm7eVNOmcLBB7gIjVtaarUnJvzZvGkiBtoy2C9CZKuO+ocizL27DNFss0A== X-Received: by 2002:a17:906:6d98:b0:715:76eb:9e33 with SMTP id h24-20020a1709066d9800b0071576eb9e33mr5292412ejt.729.1657741597293; Wed, 13 Jul 2022 12:46:37 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id s10-20020a170906354a00b00705cdfec71esm5341038eja.7.2022.07.13.12.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 12:46:36 -0700 (PDT) Message-ID: <92fd1571a14de00c9c1deaf2138187ba0530c7eb.camel@gmail.com> From: Liliana Marie Prikler Date: Wed, 13 Jul 2022 21:46:35 +0200 In-Reply-To: <8735f51fbw.fsf@ruhr-uni-bochum.de> References: <87r12r9txi.fsf@gmail.com> <8735f51fbw.fsf@ruhr-uni-bochum.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657741633; 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=2mT4BdpVN3uTHTsaAR01FdXrzYJnWgDLjjTo4Lc98Hg=; b=Ov3vLRz/pq2N00epBYFjJf+k9zbY1XLeoFILl7RwQu8iAZGh2qfWrYFPwjdQG+pc8ItLJY z1yhdkDarh1DqRNIBvLelvzrCRS4IMo9JIXwPFPKIEhRsFwh1uvK/rhzflQJKw6mHyBe+G 1FxpROHTnJ3cwQR9lCe03aHAIYFUm4+0uNwTJPK22Us+PsKfcBgJVhXm1O48TuBdz4vYm6 53EEbc93NDVpPhyKbZUrqIHsKQzYbTHqIXPMIeObsCoAmZp557ko3eBJUAQbGgG1tMwhna b6A8uDpYajjK93t9/nzOaHMHDGN+fCQ6ojJoTgLfT3BJO+B1B+s4fuxRHoQJgQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657741633; a=rsa-sha256; cv=none; b=IQvw8+Ij1axqCvLadM1R0WunR0wrbLf+ArbKkmEYzNi9ppznpYt2qP8myWjFPOoosnceQ8 8/gG19JulmbISSM09WfZ3RRaez7uMB2bLDYozdZwsQdu7om7t4zrmSFYslsy3XPEV+RHJu iIOMHkfIrBaMzUjXRXfMoXhHBTfnPEgHm68mbVj19OyktegeBE/0GYP7kuk1JHQb5g/Nvo b/Wj6/vjquWzdMiPMoeam+KHt72mEY2jAzfOePRGdMmFkNieHHdQrnJHa7QyLzFSR2LJEK X1zSRrjmI6LInpu4wtzDUMT91PhCuHuh6TEqQKoRcDAFw4FJvyTSaMc1+gC5XA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=kPZzbX96; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 5.26 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=kPZzbX96; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: 996962894E X-Spam-Score: 5.26 X-Migadu-Scanner: scn0.migadu.com X-TUID: czL8fXORa4vR Am Mittwoch, dem 13.07.2022 um 12:23 +0200 schrieb Daniel Meißner: > Hi, > > Maxim Cournoyer writes: > > > When substitute* encounters a nonexistent file, the error is > > reported > > to the guix CLI like so: > > > > [...] > > > > The main error message, "system-error "mkstemp" "~A" ("No such file > > or > > directory") (2)" is malformed and doesn't report the actual file > > which > > is missing; one must decipher the backtrace for clues as to which > > file > > caused the error. > > > > We should improve it :-). > > I am Guix and Guile newbie but looking at the definition of the > procedure ‘with-atomic-file-replacement’ I think we have to catch the > (possible) exception of the call to ‘mkstemp!’ and provide a custom > error message. > > This is because the exception thrown by ‘mkstemp!’ does not contain > any > information about which file was tried.  Try this snippet in a Guile > REPL: > > --8<---------------cut here---------------start------------->8--- > (with-exception-handler (lambda (x) (write x) (newline)) >   (lambda () >     (mkstemp! "/non/existing/path/foo.XXXXXX"))) > --8<---------------cut here---------------end--------------->8--- > > It prints: > > --8<---------------cut here---------------start------------->8--- > #<&compound-exception components: (#<&external-error> #<&origin > origin: "mkstemp"> #<&message message: "~A"> #<&irritants irritants: > ("Datei oder Verzeichnis nicht gefunden")> #<&exception-with-kind- > and-args kind: system-error args: ("mkstemp" "~A" ("Datei oder > Verzeichnis nicht gefunden") (2))>)> > --8<---------------cut here---------------end--------------->8--- > > So maybe this is a bug in Guile? Shouldn’t ‘mkstemp!’ list the path > in the irritants? IMHO this matters little, as one can let-bind the filename or (as we do it) take it as argument. The reason Guile does not report it is probably because it's converted from a POSIX errno, which lacks that context :) What's a little more confusing is that a throw-handler is installed directly after mkstemp!, which re-raises the exception. This is an alternative way of failing when the file does not exist, as it wraps call-with-input-file. Cheers