From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id YIbfKukoSGfAXwAAe85BDQ:P1 (envelope-from ) for ; Thu, 28 Nov 2024 08:25:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id YIbfKukoSGfAXwAAe85BDQ (envelope-from ) for ; Thu, 28 Nov 2024 09:25:13 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=FdNtJTsR; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=RALs6G2T; dmarc=fail reason="SPF not aligned (relaxed), DKIM 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732782313; a=rsa-sha256; cv=none; b=EPdHvYCksrHjzcbR6ic3+tiKaoBSkm7NBLROgOXl2oQbDCKK0dNOxQUCpx/AafWRcCK0mV gwHegV6LybU0n3P6w+5w1dQnWLzErYXxk98gZm+A3SSXFladRhS9Z1Mdo4h9bs8e6D4BeI 9EZIQZ2bKy+ADrd9kYlveRm9HJUTKDPBRNg/atmKvR0OGpfAy641AD4Fxj6wJ1P7UY1er2 BZaK+dgIKLh5XURJxmSWNXbJkk0oGt4jZHfX9bC1dnHArpRXURUlKvIdHRfcvzlGuj9ZRU tnezAN6ORXc61XK5o1Dub3wyWvlu3s3SJcvw7rKesFaIabpg22kIK5fsx1zyVg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=FdNtJTsR; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=RALs6G2T; dmarc=fail reason="SPF not aligned (relaxed), DKIM 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732782313; 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:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=HD3x/OPA1yQRB2q9esFkdVZ7Zey5UbCwf11XXgDiKjs=; b=laxAcLgsfyaklDwXDwyxmeBXcrF4ZZOC2QQniBfLu80822jIdXbkL41mYkOk+KheIw2qvv pAJdZYiUmuSjS/oX7hvfItuz1EcgkvCwrraHCr/XVJZW0qwa39xJtdLyRVDRC0F3sxQ08y cAtfb10V/S8onF8X2lfOU6GxSMCqt/BWDrs2Qbz8WFqcg/LPWuRyUO9k9WWKWOUWqxuueW kYhbSEWSHr0SVtU2e8Y9wYXE5siPgwD2iQW8aNSVJX1sM+FSgpMaItLzN8aEE32rgIchNY lnkPrkhYQlqhkQ0RrZGyldl2NCET0hj7045wgOokRGW9khx3pB1n2TSlqVJQng== 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 E44AD7F0C6 for ; Thu, 28 Nov 2024 09:25:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGZph-0006cA-MW; Thu, 28 Nov 2024 03:25:05 -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 1tGZpf-0006bh-AI for bug-guix@gnu.org; Thu, 28 Nov 2024 03:25:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGZpe-00070t-UL for bug-guix@gnu.org; Thu, 28 Nov 2024 03:25:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=HD3x/OPA1yQRB2q9esFkdVZ7Zey5UbCwf11XXgDiKjs=; b=FdNtJTsRrpv3AMrof9MMQJ/huslr5bkv6nD29DOiZoBorVkc0dyjuYl4d0JQVBXtGa+xv3yFjUDOEPeoPJPEYEpTV+XlOXqFMmzBbnfDsuJu99slFoiF69GQDkrCH+WnIrgKGGkRqsAr+RXVReYnzANfAOlA2wNiP4r6Bu0u0Vd0M+mCNjAhtPBRCRb4Zh14thqUo2lLaw2zkPINJtK3ld5q8HRM59YB/tfZ/4XHwc2/f1qMF3GfpLaVW3LP0lQQvSy4ZRrmgJ2D4MKjHWmtxxh7KzjqzTx0mitl0McaCRSqJ0TwkoDM7njZDoKcTnX/y3JWrU9d7xLU2Blekoq8gw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tGZpe-0002zG-Cp for bug-guix@gnu.org; Thu, 28 Nov 2024 03:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#74584: wrong pull/time-machine message when channels.scm does not exit Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 28 Nov 2024 08:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74584 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 74584@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173278229411459 (code B ref -1); Thu, 28 Nov 2024 08:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Nov 2024 08:24:54 +0000 Received: from localhost ([127.0.0.1]:36501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGZpV-0002yk-Ec for submit@debbugs.gnu.org; Thu, 28 Nov 2024 03:24:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:38826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGZpS-0002ya-Pf for submit@debbugs.gnu.org; Thu, 28 Nov 2024 03:24:52 -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 1tGZpS-0006aQ-H9 for bug-guix@gnu.org; Thu, 28 Nov 2024 03:24:50 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGZpQ-0006r7-If for bug-guix@gnu.org; Thu, 28 Nov 2024 03:24:50 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-434a1833367so3119785e9.1 for ; Thu, 28 Nov 2024 00:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732782287; x=1733387087; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=HD3x/OPA1yQRB2q9esFkdVZ7Zey5UbCwf11XXgDiKjs=; b=RALs6G2TujGoY/VHZjCKrGbKxcIKRgp6jwI8DDUt0lh7VswuL+G9HrmxE280z8yZKB 7L+XxRpmVgCv9Fo0jBoEUQPy3VoImSXaky5u+nfQ8irMey7Quijuas5GIPrK5tk9VGC4 eiimfO17frKv8BqcmAD32lMaR3KtEhvu0LCB+Z8uO0R93pnBYySf+TzaxdftwxwDnzci V1LM92cYxWQRKh6N5iAH+8z5gQ7VMJC4gNLNpe3mhZALVhQ+Ojq9bBADPns8yV82MNdn v9f5iWGKAF/khWKhmawoVZIRis6J6uaalhM1fhJdW2XvXMSNEqg5+wFIA23jA51CxoRW Ft3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732782287; x=1733387087; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HD3x/OPA1yQRB2q9esFkdVZ7Zey5UbCwf11XXgDiKjs=; b=DxkcoFQ65oGMa95NgLKvxeRXnDqWrmhRaV89T1K8QYzfy8TCjNjk9UgWf4yItBFAgf vDMw027H8dJF4hvgZIZzLYgMhmynCrQOtC4UxmIU76wSL71OAV7nAP6PSbiNFwdJf4RQ f0solk24hHULt2/2Ezi8D5x8kK9JjbN+i+BQ4b0CwbgUcHDRbPy76DUfGTtTeK0DLUTv L0hbxojTRyc5V6puiYhwSr8g0m5kHvqnsO8SrFbb0dpvV9yQOMk9BURMak6oL3ENU1A7 IYcV5kTbCzPkML8vmCkNtvJmS8UXQV5ySf7I5xAehrHUQLWT7M+cgtNNKr+SuWsSA9OH SoZw== X-Gm-Message-State: AOJu0YzWstGgBSItmDg719TuZK+cA5CQk0iHLjZY+sBX2zRO+HtxsbII FCEsgr3f31KuMS2WpfMekdJB6i2gic2AQF6tQ8JIWyJQQ81WazpZmHiFVg== X-Gm-Gg: ASbGncvIvTpaVlXFI0KbHHby6ktCYnok4OcZq8+WdW+C742umvkFbIyeHAyFZsGdB1b 1JEO3uD9tI6EOlCXkliOwQJ6WOpilLcTkJmJqKXbUge+TuRqhptTjZ7nG9BNgLnViy4JExKGNx8 TGPmbTHXCjrGGhffXK8nVwSa9+OwOgTAqr7k9k93bcBlfpO3axcZ1BkKstR+4DTyXcjf2WnAc7x tECR5RV7zsowBFdjU4POZkVMAK9DKcYwIlhYU4r1R/TGY0q X-Google-Smtp-Source: AGHT+IGVm9t6Hrrnb5zB/eows6ba/1tGfJUcXscxRrdj7lViNRzN2kR3jrEvxI89GSgrCxV2bMq1bQ== X-Received: by 2002:a05:600c:198e:b0:434:9cf6:a2a5 with SMTP id 5b1f17b1804b1-434afb9ecc7mr19172645e9.8.1732782286521; Thu, 28 Nov 2024 00:24:46 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:59d1:7e1d:65bd:62e3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434b0dbfaf6sm14279745e9.18.2024.11.28.00.24.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 00:24:45 -0800 (PST) From: Simon Tournier Date: Thu, 28 Nov 2024 02:26:16 +0100 Message-ID: <874j3sf8sn.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.53 X-Spam-Score: -2.53 X-Migadu-Queue-Id: E44AD7F0C6 X-Migadu-Scanner: mx10.migadu.com X-TUID: G3zDrVzkPRTB --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, The =E2=80=9Cbug=E2=80=9C: --8<---------------cut here---------------start------------->8--- $ ls channels.scm ls: cannot access 'channels.scm': No such file or directory $ guix time-machine -q -C channels.scm -- help guix time-machine: error: 'channels.scm' did not return a list of channels --8<---------------cut here---------------end--------------->8--- That=E2=80=99s incorrect. What I expect is something as: --8<---------------cut here---------------start------------->8--- $ ls foo.scm ls: cannot access 'foo.scm': No such file or directory $ guix time-machine -q -C foo.scm -- help guix time-machine: error: failed to load 'foo.scm': ice-9/boot-9.scm:2190:9: In procedure primitive-load-path: Unable to find f= ile "guix/foo.scm" in load path --8<---------------cut here---------------end--------------->8--- Although the second part can be confusing for regular user. And although I think the message is also incorrect. Well, the story is about =E2=80=99load*=E2=80=99 from module (guix ui). Us= ing this trivial patch with some =E2=80=99pk=E2=80=99. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=p.patch Content-Description: trivial.patch diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 58d3cd7e83..d294df4f37 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -752,6 +752,7 @@ (define (channel-list opts) (define (load-channels file) (let ((result (load* file (make-user-module '((guix channels)))))) + (pk 'load-channels result) (if (and (list? result) (every channel? result)) result (leave (G_ "'~a' did not return a list of channels~%") file)))) diff --git a/guix/ui.scm b/guix/ui.scm index eba12c8616..651cea4ff7 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -250,7 +250,11 @@ (define* (load* file user-module ;; 'primitive-load', so that FILE is compiled, which then allows ;; us to provide better error reporting with source line numbers. (without-compiler-optimizations - (load (try-canonicalize-path file)))) + (begin + (pk 'file file) + (pk 'try-canonicalize-path (try-canonicalize-path file)) + (pk 'load-file (load file)) + (load (try-canonicalize-path file))))) (const #f)))))) (lambda _ ;; XXX: Errors are reported from the pre-unwind handler below, but @@ -262,6 +266,7 @@ (define* (load* file user-module (let* ((stack (make-stack #t handle-error tag)) (frame (last-frame-with-source stack))) + (pk 'let-raise-error) (report-load-error file args frame) (case on-error --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable It reads: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix time-machine -q -C channels.scm -- help ;;; (file "channels.scm") ;;; (try-canonicalize-path "channels.scm") ;;; (load-file #) ;;; (load-channels #) guix time-machine: error: 'channels.scm' did not return a list of channels --8<---------------cut here---------------end--------------->8--- In other words, instead of raising an error, it returns # and thus because =E2=80=99load-channels=E2=80=99 tests against =E2=80=99lis= t?=E2=80=99 which # is obviously not then bang! Bah the easy fix is to check with =E2=80=99unspecified?=E2=80=99 directly in =E2=80=99load-channels=E2=80=99. But that does not really fix the issue, I= MHO. The issue is that because a file named channels.scm is around in load-path. For instance, let say the non-existent file is named =E2=80=99packages.scm=E2=80=99: --8<---------------cut here---------------start------------->8--- $ ls packages.scm ls: cannot access 'packages.scm': No such file or directory $ guix time-machine -q -C packages.scm -- help guix time-machine: error: 'packages.scm' did not return a list of channels --8<---------------cut here---------------end--------------->8--- In other words, is the comment accurate ;; Give 'load' an absolute file name so that it doesn't try = to ;; search for FILE in %LOAD-PATH. ? Well, since I am not sure to get the use case of =E2=80=99try-canonicalize-path=E2=80=99, then I don=E2=80=99t know what cou= ld be the best fix. But I guess =E2=80=99canonicalize-path=E2=80=99 is not doing what we expect= , right? Cheers, simon --=-=-=--