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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Vitaliy Shatrov" <guix.vits <at> disroot.org>
Subject: bug#43736: closed (Re: bug#43736: The local-file()'s error
 message is misleading.)
Date: Fri, 02 Oct 2020 06:16:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#43736: The local-file()'s error message is misleading.

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 43736 <at> debbugs.gnu.org.

-- 
43736: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43736
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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’.

[Message part 3 (message/rfc822, inline)]
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 4 (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)]

This bug report was last modified 4 years and 229 days ago.

Previous Next


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