unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43331: guix repl doesn't find the script to execute
@ 2020-09-11 11:06 Konrad Hinsen
  2020-09-11 11:13 ` bug#43331: [PATCH] repl: Look for script files in (getcwd) Konrad Hinsen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Konrad Hinsen @ 2020-09-11 11:06 UTC (permalink / raw)
  To: 43331

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
...





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43331: [PATCH] repl: Look for script files in (getcwd).
  2020-09-11 11:06 bug#43331: guix repl doesn't find the script to execute Konrad Hinsen
@ 2020-09-11 11:13 ` Konrad Hinsen
  2020-09-16 13:35   ` Ludovic Courtès
  2020-09-11 11:15 ` bug#43331: Patch Konrad Hinsen
  2020-09-11 11:18 ` bug#43331: guix repl doesn't find the script to execute zimoun
  2 siblings, 1 reply; 6+ messages in thread
From: Konrad Hinsen @ 2020-09-11 11:13 UTC (permalink / raw)
  To: 43331

* 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





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#43331: Patch
  2020-09-11 11:06 bug#43331: guix repl doesn't find the script to execute Konrad Hinsen
  2020-09-11 11:13 ` bug#43331: [PATCH] repl: Look for script files in (getcwd) Konrad Hinsen
@ 2020-09-11 11:15 ` Konrad Hinsen
  2020-09-11 11:18 ` bug#43331: guix repl doesn't find the script to execute zimoun
  2 siblings, 0 replies; 6+ messages in thread
From: Konrad Hinsen @ 2020-09-11 11:15 UTC (permalink / raw)
  To: 43331

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.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43331: guix repl doesn't find the script to execute
  2020-09-11 11:06 bug#43331: guix repl doesn't find the script to execute Konrad Hinsen
  2020-09-11 11:13 ` bug#43331: [PATCH] repl: Look for script files in (getcwd) Konrad Hinsen
  2020-09-11 11:15 ` bug#43331: Patch Konrad Hinsen
@ 2020-09-11 11:18 ` zimoun
  2020-09-11 15:31   ` Konrad Hinsen
  2 siblings, 1 reply; 6+ messages in thread
From: zimoun @ 2020-09-11 11:18 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 43331

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43331: guix repl doesn't find the script to execute
  2020-09-11 11:18 ` bug#43331: guix repl doesn't find the script to execute zimoun
@ 2020-09-11 15:31   ` Konrad Hinsen
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Hinsen @ 2020-09-11 15:31 UTC (permalink / raw)
  To: 43331

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.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#43331: [PATCH] repl: Look for script files in (getcwd).
  2020-09-11 11:13 ` bug#43331: [PATCH] repl: Look for script files in (getcwd) Konrad Hinsen
@ 2020-09-16 13:35   ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2020-09-16 13:35 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 43331-done

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’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-16 13:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 11:06 bug#43331: guix repl doesn't find the script to execute Konrad Hinsen
2020-09-11 11:13 ` bug#43331: [PATCH] repl: Look for script files in (getcwd) Konrad Hinsen
2020-09-16 13:35   ` Ludovic Courtès
2020-09-11 11:15 ` bug#43331: Patch Konrad Hinsen
2020-09-11 11:18 ` bug#43331: guix repl doesn't find the script to execute zimoun
2020-09-11 15:31   ` Konrad Hinsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).