GNU bug report logs -
#33755
error: execlp: No such file or directory from guix environment
Previous Next
Reported by: swedebugia <at> riseup.net
Date: Sat, 15 Dec 2018 07:10:01 UTC
Severity: normal
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 33755 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Bah! I goofed on the attachment. Sorry for the trouble. Here it is
again.
[0001-environment-Print-command-name-on-execlp-error.patch (text/x-patch, inline)]
From e88baf0363607d4e072f5a29a2cd01ededfa00d2 Mon Sep 17 00:00:00 2001
From: Timothy Sample <samplet <at> ngyro.com>
Date: Sat, 15 Dec 2018 12:57:52 -0500
Subject: [PATCH] environment: Print command name on execlp error.
Fixes <https://bugs.gnu.org/33755>.
* guix/scripts/environment.scm: When execlp raises ENOENT, print a
clear error message and exit with status 127 (like a shell would).
---
guix/scripts/environment.scm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 5965e3426..27483acb2 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -389,7 +389,15 @@ variables are cleared before setting the new ones."
(create-environment profile manifest #:pure? pure?)
(match command
((program . args)
- (apply execlp program program args))))
+ (catch 'system-error
+ (lambda ()
+ (apply execlp program program args))
+ (lambda args
+ (if (= ENOENT (system-error-errno args))
+ (begin
+ (report-error (G_ "~a: command not found~%") program)
+ (exit 127))
+ (apply throw args)))))))
(define* (launch-environment/fork command profile manifest #:key pure?)
"Run COMMAND in a new process with an environment containing PROFILE, with
--
2.20.0
[Message part 3 (text/plain, inline)]
Timothy Sample <samplet <at> ngyro.com> writes:
> Hi,
>
> Julien Lepiller <julien <at> lepiller.eu> writes:
>
>> Hi, this is because we have a -- option. "guix environment guix --
>> ad-hoc libgit2" means you want to run "ad-hoc libgit2" in a guix
>> environment. The error message tells you that it can't find an ad-hoc
>> executable in that environment. There is no "ad-hoc" package involved
>> here…
>
> This is true, but I would argue that the error message is not quite as
> clear as you say. Specifically, it does not mention “ad-hoc” at all.
> I’ve attached a patch that so that the command
>
> $ guix environment guix -- ad-hoc
>
> prints
>
> guix environment: error: ad-hoc: command not found
>
> and exits with status 127. (In imitation of “bash -c 'ad-hoc'”.)
>
> Thoughts?
>
>> Le 15 décembre 2018 08:09:37 GMT+01:00, swedebugia <at> riseup.net a écrit :
>>>Hi
>>>
>>>Is this a bug?
>>>
>>>sdb <at> antelope ~/src/guix$ guix environment guix -- ad-hoc libgit2
>>>texinfo
>>>guix environment: error: execlp: No such file or directory
>>>
>>>I meant to type:
>>>sdb <at> antelope ~/src/guix$ guix environment guix --ad-hoc libgit2 texinfo
>>>
>>>I would have liked an error saying "error: package ad-hoc not found -
>>>cannot add it to the environment"
>
>
> -- Tim
This bug report was last modified 6 years and 240 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.