From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 8F+7JuYrMmD9cgAA0tVLHw (envelope-from ) for ; Sun, 21 Feb 2021 09:46:14 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EJmYIuYrMmDYHAAA1q6Kng (envelope-from ) for ; Sun, 21 Feb 2021 09:46:14 +0000 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 aspmx2.migadu.com (Postfix) with ESMTPS id 2A4DD1CA59 for ; Sun, 21 Feb 2021 10:46:14 +0100 (CET) Received: from localhost ([::1]:60934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDlJd-0005ud-3Y for larch@yhetil.org; Sun, 21 Feb 2021 04:46:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDlJS-0005tR-EL for guix-devel@gnu.org; Sun, 21 Feb 2021 04:46:02 -0500 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]:42012) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDlJQ-00056d-J4 for guix-devel@gnu.org; Sun, 21 Feb 2021 04:46:02 -0500 Received: by mail-il1-x135.google.com with SMTP id z18so8303285ile.9 for ; Sun, 21 Feb 2021 01:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=vOt5QyxpkLRiEBftLvv47qBj6ZqIIIFoqagYQTApBKo=; b=sY2jQzk4UFlcmi5hTHqN2N/brHlpd5c5ZD+lep4GSpSOM+KMIVpM5zyydMIq0SlqM7 609Lv6AwJHkJ+BrCytUgSWk615uywhVG14i4EOf2FkRsv3hEEezbbLSpqIlfqp43Suwm CP4+oo3sYQCiZwuwEM92Yx/Z8KBUc8v+0BJuCGQUWIQOXJMNMdEXWG54wiUpROka0VFZ 9JtQ5dojcJFTSnxm4teYy69vyju7Rq3SYCAAKcpX8I8dBvH/k+7Ct0fJkQxlG+ha56TZ nkc5TAfhla1G5MxqMeCqAnRYsRrE0+fnChbFRhMiAnbuglONBT2mApiYgQTzxmXwxSTI kN1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vOt5QyxpkLRiEBftLvv47qBj6ZqIIIFoqagYQTApBKo=; b=GiPzkQ4ltYFLFqn6gz8ZuAY4IePsg9BxC9QuiHYjAhLl3Jc67r6VQDGN265nWTQz7L Wbcv8OYZ6KU4xUa5Y5AfMdL7mgYUR1YBXr2ueeKNxLFMRM1pLQkQU0nzBqrlWox8tC3/ MweT6YOHqxXfFqaKb4/qhIpLcHG6iLhcWO0cHo6zfupiuKcLRP3nb7cHgXMBzNFcOAXc AvwP5fAlB9DTnAoWk+jKe5dCy1/CIv+ozddEt3RdKIZXpR90zEU5Ur19cpYfwivFLpcq JupimzHGWi9pe7k1DmhErh1+RqNTnuA1Isx6T8Fm4FdX545DEcxk651zNh03s3kWHb2/ zLWw== X-Gm-Message-State: AOAM531h21CiD4hQ1/ylRlfTYCNKoBJIarhDwy7EeMuoKER/FBYvrSl1 pM0lH10BoUymRNwbsg1fZN1Zitrv9hOL1rmqP62/T8EQx0U= X-Google-Smtp-Source: ABdhPJxA3lHfBl+H8qQMZ912pp/bLNN3SQ80APvUK7Zjc/un/8Zsh+IsotwiFpo0ZCwuXiNDbLb1YefVwZWk9WFO4Us= X-Received: by 2002:a05:6e02:c88:: with SMTP id b8mr7868838ile.135.1613900758934; Sun, 21 Feb 2021 01:45:58 -0800 (PST) MIME-Version: 1.0 From: Rovanion Luckey Date: Sun, 21 Feb 2021 10:45:33 +0100 Message-ID: Subject: Confusing error messages from guix when loading a user scheme file that fails to load another file To: guix-devel@gnu.org Content-Type: multipart/mixed; boundary="00000000000070b49c05bbd58d37" Received-SPF: pass client-ip=2607:f8b0:4864:20::135; envelope-from=rovanion.luckey@gmail.com; helo=mail-il1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.17 Authentication-Results: aspmx2.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=sY2jQzk4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx2.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 2A4DD1CA59 X-Spam-Score: -0.17 X-Migadu-Scanner: scn1.migadu.com X-TUID: 44uSy49EKA6e --00000000000070b49c05bbd58d37 Content-Type: multipart/alternative; boundary="00000000000070b49b05bbd58d35" --00000000000070b49b05bbd58d35 Content-Type: text/plain; charset="UTF-8" Hi, Today I encountered an issue with Guix's user interface. I was trying to load a Scheme file defining a development environment with `guix environment --ad-hoc --load=file.scm`, but Guix kept telling me that the file did not exist even though I could swear it did: > $ head -n 1 development-environment.scm > (use-modules (gnu packages) > $ guix environment --ad-hoc --load=development-environment.scm > guix environment: error: failed to load 'development-environment.scm': No such file or directory After pulling my hair out for a while and then turning to `strace` I figured out that it was not actually that the file `development-environment.scm` did not exist, the issue was that the Scheme code in that file tried to load a file that did not exist. I set up a couple of different test cases to see if all errors were reported equally and to understand the issue better. Running a file that contains a syntax error indicates that there is an error in the file itself > $ guix environment --ad-hoc --load=syntax-error.scm > syntax-error.scm:2:1: missing closing parenthesis The same goes for when the code in the file being run throws an exception: > $ guix environment --ad-hoc --load=throw-exception.scm > guix environment: error: failed to load 'throw-exception.scm': > throw-exception.scm:1:0: banana But when the code in turn tries to load another file which does not exist it is reported as if the file itself is missing: > $ guix environment --ad-hoc --load=load-non-existing-file.scm > guix environment: error: failed to load 'load-non-existing-file.scm': No such file or directory I was able to find the source of the error message in `guix/ui.scm:378` and patched it to output the following message that makes more sense in this failure case: > $ ./pre-inst-env guix environment --ad-hoc --load=load-non-existing-file.scm > guix environment: error: failed to evaluate 'load-non-existing-file.scm', it raised the error: No such file or directory So here comes my questions: 1. Why is the file and line number not reported when the user provided scheme file fails to load another file? 2. Is it possible to modify guix so that it is? 3. If not, is the code path that I patched also used for other failures making the modification I demonstrated above a bad idea? 4. If so, is there a better way? I have attached the three small Scheme source code files used in the above examples. --00000000000070b49b05bbd58d35 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
Today I encountered an issue with Guix&= #39;s user interface. I was trying to load a Scheme file defining a develop= ment environment with `guix environment --ad-hoc --load=3Dfile.scm`, but Gu= ix kept telling me that the file did not exist even though I could swear it= did:

> $ head -n 1 development-environment.scm=
> (use-modules (gnu packages)
> $ guix environment = --ad-hoc --load=3Ddevelopment-environment.scm
> guix environment: er= ror: failed to load 'development-environment.scm': No such file or = directory

After pulling my hair out for a while an= d then turning to `strace` I figured out that it was not actually that the = file `development-environment.scm` did not exist, the issue was that the Sc= heme code in that file tried to load a file that did not exist.
<= br>
I set up a couple of different test cases to see if all error= s were reported equally and to understand the issue better. Running a file = that contains a syntax error indicates that there is an error in the file i= tself

> $ guix environment --ad-hoc --load=3Dsyntax-error.scm
= > syntax-error.scm:2:1: missing closing parenthesis


The same = goes for when the code in the file being run throws an exception:

&g= t; $ guix environment --ad-hoc --load=3Dthrow-exception.scm
> guix en= vironment: error: failed to load 'throw-exception.scm':
> thr= ow-exception.scm:1:0: banana


But when the code in turn tries to = load another file which does not exist it is reported as if the file itself= is missing:

> $ guix environment --ad-hoc --load=3Dload-non-exis= ting-file.scm
> guix environment: error: failed to load 'load-non= -existing-file.scm': No such file or directory


I was able to= find the source of the error message in `guix/ui.scm:378` and patched it t= o output the following message that makes more sense in this failure case:<= br>
> $ ./pre-inst-env guix environment --ad-hoc --load=3Dload-non-ex= isting-file.scm
> guix environment: error: failed to evaluate 'lo= ad-non-existing-file.scm', it raised the error: No such file or directo= ry


So here comes my questions:

1. Why is the file and lin= e number not reported when the user provided scheme file fails to load anot= her file?
2. Is it possible to modify guix so that it is?
3. If not, = is the code path that I patched also used for other failures making the mod= ification I demonstrated above a bad idea?
4. If so, is there a b= etter way?

I have attached the three small Sch= eme source code files used in the above examples.
--00000000000070b49b05bbd58d35-- --00000000000070b49c05bbd58d37 Content-Type: text/x-scheme; charset="US-ASCII"; name="load-non-existing-file.scm" Content-Disposition: attachment; filename="load-non-existing-file.scm" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kleypwst2 KHVzZS1tb2R1bGVzIChpY2UtOSByZGVsaW0pKQoKKHdpdGgtaW5wdXQtZnJvbS1maWxlICJub24t ZXhpc3RhbnQiIHJlYWQtc3RyaW5nKQo= --00000000000070b49c05bbd58d37 Content-Type: text/x-scheme; charset="US-ASCII"; name="throw-exception.scm" Content-Disposition: attachment; filename="throw-exception.scm" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kleypwsa0 KGVycm9yICJiYW5hbmEiKQo= --00000000000070b49c05bbd58d37 Content-Type: text/x-scheme; charset="US-ASCII"; name="syntax-error.scm" Content-Disposition: attachment; filename="syntax-error.scm" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_kleypwsn1 KAo= --00000000000070b49c05bbd58d37--