GNU bug report logs - #43736
The local-file()'s error message is misleading.

Previous Next

Package: guix;

Reported by: "Vitaliy Shatrov" <guix.vits <at> disroot.org>

Date: Thu, 1 Oct 2020 04:57:01 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43736 in the body.
You can then email your comments to 43736 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#43736; Package guix. (Thu, 01 Oct 2020 04:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Vitaliy Shatrov" <guix.vits <at> disroot.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 01 Oct 2020 04:57:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Vitaliy Shatrov" <guix.vits <at> disroot.org>
To: "Das Guixen" <bug-guix <at> gnu.org>
Subject: The local-file()'s error message is misleading.
Date: Thu, 01 Oct 2020 04:56:08 +0000
[Message part 1 (text/plain, inline)]
Hello there.
I ran in bash shell:



pwd
--> /home/vits

conf=~/guix/configuration/configuration.scm

ls $conf   # file exists
--> ~/guix/configuration/configuration.scm

guix system build $conf
--> guix system: error: failed to load
'/home/vits/guix/configuration/configuration.scm': No such file or directory



The commands above will result in a successfull build if i
`cd guix/configuration` before doing `guix system build`
(both with rel. and abs. names).

Attached is WORKING config.scm.  Error was caused by local-file()
used with _relative_ paths.  Those were commented out, and this
config.scm works from any directory.

#guix:
> ... error message is very misleading.

Better of course if the offending file will be print out:
"failed to load (...) /home/vits/auto-login:  no such file or directory"

---
Thanks for attention, Vitaliy.
[config.scm (application/octet-stream, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 02 Oct 2020 06:16:02 GMT) Full text and rfc822 format available.

Notification sent to "Vitaliy Shatrov" <guix.vits <at> disroot.org>:
bug acknowledged by developer. (Fri, 02 Oct 2020 06:16:02 GMT) Full text and rfc822 format available.

Message #10 received at 43736-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: "Vitaliy Shatrov" <guix.vits <at> disroot.org>
Cc: 43736-done <at> debbugs.gnu.org
Subject: Re: bug#43736: The local-file()'s error message is misleading.
Date: Fri, 02 Oct 2020 08:14:56 +0200
Hi,

"Vitaliy Shatrov" <guix.vits <at> disroot.org> skribis:

> ;; (define (custom-local-file str)              ; shorthand, preserves permissions
> ;;   (let* ((file (local-file str #:recursive? #t))
> ;;       (dir (dirname (local-file-absolute-file-name file))))
> ;;     (display (string-append "loading local file '" str "' from " dir "...\n"))
> ;;     file))

[...]

> ;;      (auto-login (custom-local-file "auto-login"))
> ;;      (syslog.conf (custom-local-file "syslog.conf")))

This will not have the desired effect.  ‘local-file’ is special syntax:
it captures the source directory so that at run time it can resolve file
names relative to the source directory.

The ‘custom-local-file’ procedure does not do that.  Consequently, file
names get resolved relative to $PWD instead.

Commit f43ffee90882c2d61b46d69728daa7432be297e4 improves on that by
emitting a warning at run time when ‘local-file’ is passed a non-literal
relative file name.

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#43736; Package guix. (Fri, 02 Oct 2020 06:55:01 GMT) Full text and rfc822 format available.

Message #13 received at 43736 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <mail <at> brendan.scot>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 43736 <at> debbugs.gnu.org
Subject: I think f43ffee... broke guix pull
Date: Fri, 2 Oct 2020 06:54:23 +0000
[Message part 1 (text/plain, inline)]
I just got this running guix pull building guix-system-tests. looks 
kinda related to your patch since it mentions local-file



[  6/ 54] loading...	 22.2% of 27 filesrandom seed for tests: 1601620953
[ 10/ 54] loading...	 37.0% of 27 filesBacktrace:
In ice-9/eval.scm:
    163:9 19 (_ #(#(#<directory (gnu tests install) 7fffeda39640>) #<<operating-system> kernel: #<package linux-libre <at> 5.8.12 gnu/packages/linux.scm:721 7fffe91d3c80> kernel-loadable-modules: ()?> ?))
   173:47 18 (_ #(#(#(#<directory (gnu tests install) 7fffeda39640>) #<<operating-system> kernel: #<package linux-libre <at> 5.8.12 gnu/packages/linux.scm:721 7fffe91d3c80> kernel-loadable-module?> ?) ?))
    159:9 17 (_ #(#(#(#<directory (gnu tests install) 7fffeda39640>) #<<operating-system> kernel: #<package linux-libre <at> 5.8.12 gnu/packages/linux.scm:721 7fffe91d3c80> kernel-loadable-module?> ?) ?))
    159:9 16 (_ #(#(#(#<directory (gnu tests install) 7fffeda39640>) #<<operating-system> kernel: #<package linux-libre <at> 5.8.12 gnu/packages/linux.scm:721 7fffe91d3c80> kernel-loadable-module?> ?) ?))
   293:34 15 (_ #(#(#<directory (gnu tests install) 7fffeda39640>) #<<operating-system> kernel: #<package linux-libre <at> 5.8.12 gnu/packages/linux.scm:721 7fffe91d3c80> kernel-loadable-modules: () ?>))
In srfi/srfi-1.scm:
   586:29 14 (map1 (#<<service> type: #<service-type virtual-terminal 7fffe95c6300> value: #t> #<<service> type: #<service-type kmscon 7fffe95d4d00> value: #<<kmscon-configuration> kmscon: #<pa?> ?))
   586:29 13 (map1 (#<<service> type: #<service-type kmscon 7fffe95d4d00> value: #<<kmscon-configuration> kmscon: #<package kmscon <at> 0.0.0-1.01dd0a2 gnu/packages/terminals.scm:256 7fffeac0d320> v?> ?))
   586:29 12 (map1 (#<<service> type: #<service-type login 7fffe95c6240> value: #<<login-configuration> motd: #<<plain-file> name: "motd" content: "\n\x1b[1;37mWelcome to the installation of GN?> ?))
   586:29 11 (map1 (#<<service> type: #<service-type documentation 7fffe68542c0> value: "tty2"> #<<service> type: #<service-type configuration-template 7fffe6854180> value: #t> #<<service> type?> ?))
   586:29 10 (map1 (#<<service> type: #<service-type configuration-template 7fffe6854180> value: #t> #<<service> type: #<service-type mingetty 7fffe95c61c0> value: #<<mingetty-configuration> mi?> ?))
   586:29  9 (map1 (#<<service> type: #<service-type mingetty 7fffe95c61c0> value: #<<mingetty-configuration> mingetty: #<package mingetty <at> 1.08 gnu/packages/admin.scm:701 7fffe931bdc0> tty: "tt?> ?))
   586:29  8 (map1 (#<<service> type: #<service-type mingetty 7fffe95c61c0> value: #<<mingetty-configuration> mingetty: #<package mingetty <at> 1.08 gnu/packages/admin.scm:701 7fffe931bdc0> tty: "tt?> ?))
   586:29  7 (map1 (#<<service> type: #<service-type mingetty 7fffe95c61c0> value: #<<mingetty-configuration> mingetty: #<package mingetty <at> 1.08 gnu/packages/admin.scm:701 7fffe931bdc0> tty: "tt?> ?))
   586:29  6 (map1 (#<<service> type: #<service-type mingetty 7fffe95c61c0> value: #<<mingetty-configuration> mingetty: #<package mingetty <at> 1.08 gnu/packages/admin.scm:701 7fffe931bdc0> tty: "tt?> ?))
   586:29  5 (map1 (#<<service> type: #<service-type syslog 7fffe95c6140> value: #<<syslog-configuration> syslogd: #<file-append #<package inetutils <at> 1.9.4 gnu/packages/admin.scm:598 7fffe931bf0?> ?))
   586:17  4 (map1 (#<<service> type: #<service-type guix 7fffe95c6040> value: #<<guix-configuration> guix: #<package guix <at> 1.1.0-27.1c21468 gnu/packages/package-management.scm:135 7fffead81e60>?> ?))
In ice-9/eval.scm:
   196:43  3 (_ #(#(#(#<directory (gnu tests install) 7fffeda39640>) #<<service> type: #<service-type guix 7fffe95c6040> value: #<<guix-configuration> guix: #<package guix <at> 1.1.0-27.1c21468 gn?>) #))
   293:34  2 (_ #(#(#(#<directory (gnu tests install) 7fffeda39640>) #<<service> type: #<service-type guix 7fffe95c6040> value: #<<guix-configuration> guix: #<package guix <at> 1.1.0-27.1c21468 gn?>) #))
In gnu/packages/package-management.scm:
   549:20  1 (_)
In guix/gexp.scm:
    405:0  0 (%local-file _ _ _ #:literal? _ #:location _ #:recursive? _ #:select? _)

guix/gexp.scm:405:0: In procedure %local-file:
Invalid keyword: "guix-current"

[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#43736; Package guix. (Sat, 03 Oct 2020 09:26:02 GMT) Full text and rfc822 format available.

Message #16 received at 43736-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Brendan Tildesley <mail <at> brendan.scot>
Cc: 43736-done <at> debbugs.gnu.org
Subject: Re: I think f43ffee... broke guix pull
Date: Sat, 03 Oct 2020 11:25:42 +0200
Hi,

Brendan Tildesley <mail <at> brendan.scot> skribis:

> In gnu/packages/package-management.scm:
>    549:20  1 (_)
> In guix/gexp.scm:
>     405:0  0 (%local-file _ _ _ #:literal? _ #:location _ #:recursive? _ #:select? _)
>
> guix/gexp.scm:405:0: In procedure %local-file:
> Invalid keyword: "guix-current"

Indeed.  Fixed in 9471aea76ace5c0998d889fc5fbde7a6bcafc654, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 31 Oct 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 181 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.