Example: $ guix repl moocrr_guix_jupyter/installed-dependencies.scm Backtrace: 1 (primitive-load-path "./moocrr_guix_jupyter/installed-d…") In ice-9/boot-9.scm: 1669:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1669:16: In procedure raise-exception: In procedure primitive-load-path: Unable to find file "./moocrr_guix_jupyter/installed-dependencies.scm" in load path But the file is there: $ ls -l moocrr_guix_jupyter/installed-dependencies.scm -rw-r--r-- 1 hinsen users 783 Sep 11 12:43 moocrr_guix_jupyter/installed-dependencies.scm And when given the absolute path, guix finds it as well: $ guix repl `pwd`/moocrr_guix_jupyter/installed-dependencies.scm 122 packages: cairo@1.16.0 expat@2.2.9 ...
* guix/scripts/repl.scm (guix-repl): Replace "." by (getcwd) --- guix/scripts/repl.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm index 3c79e89f8d..80bf1460e9 100644 --- a/guix/scripts/repl.scm +++ b/guix/scripts/repl.scm @@ -178,7 +178,7 @@ call THUNK." (lambda () (set-program-arguments script) (set-user-module) - (load-in-vicinity "." (car script))))) + (load-in-vicinity (getcwd) (car script))))) (when (null? script) ;; Start REPL -- 2.28.0
The patch that I just submitted fixes the problem. However, I don't really know what the cause of the bug is, given that load-in-vicinity is undocumented and I don't fully understand its implementation. So maybe there is a better way to fix this. Konrad.
Hi Konrad, It sounds similar to the recent #42543 [1]. I proposed the fix [2] using 'canonicalize-path' but Ludo was not fine with it and then committed d10474c38d58bdc676e64336769dc2e00cdfa8ed [3]. [1] http://issues.guix.gnu.org/42543 [2] http://issues.guix.gnu.org/42543#3 [3] https://git.savannah.gnu.org/cgit/guix.git/commit/?id=d10474c38d58bdc676e64336769dc2e00cdfa8ed Does it make sense? Cheers, simon
Hi Simon,
> It sounds similar to the recent #42543 [1]. I proposed the fix [2]
> using 'canonicalize-path' but Ludo was not fine with it and then
> committed d10474c38d58bdc676e64336769dc2e00cdfa8ed [3].
Thanks for the references, all that happened while I was on vacation.
There is indeed some parallel, but also an important difference:
the -L option requires searching LOADPATH plus following local relative
filenames. "guix repl" does not search LOADPATH.
But I am happy I didn't use 'canonicalize-path' in my patch ;-)
Cheers,
Konrad.
Hi,
Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:
> * guix/scripts/repl.scm (guix-repl): Replace "." by (getcwd)
> ---
> guix/scripts/repl.scm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm
> index 3c79e89f8d..80bf1460e9 100644
> --- a/guix/scripts/repl.scm
> +++ b/guix/scripts/repl.scm
> @@ -178,7 +178,7 @@ call THUNK."
> (lambda ()
> (set-program-arguments script)
> (set-user-module)
> - (load-in-vicinity "." (car script)))))
> + (load-in-vicinity (getcwd) (car script)))))
I added a test and a comment and applied.
Thank you!
Ludo’.