unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] test-system-cmds: use sh -c instead of guile -c
@ 2023-01-28 10:17 Omar Polo
  2023-01-28 15:43 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Omar Polo @ 2023-01-28 10:17 UTC (permalink / raw)
  To: guile-devel

Hello,

I'm not sure this patch is palatable as-is, but I'm adding it to the
OpenBSD port to have less failures in the regress suite.

The main issue is that "guile" may not be available at test time for
various reasons.  (the install prefix is not in $PATH, the executable
may be renamed --program-suffix, etc...)

The comment about windows however makes me think that neither sh may
be available.  Using meta/guile then is better, other tests are doing
that, but I haven't found the right incantation to do so.


Thanks,

Omar Polo

From 177f7dfa68ff47d448c7a8ac0cb4834eefef8dce Mon Sep 17 00:00:00 2001
From: Omar Polo <op@omarpolo.com>
Date: Sat, 28 Jan 2023 09:58:35 +0000
Subject: [PATCH] test-system-cmds: use sh -c instead of guile -c

---
 test-suite/standalone/test-system-cmds | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test-suite/standalone/test-system-cmds b/test-suite/standalone/test-system-cmds
index 8c590835d..098808201 100755
--- a/test-suite/standalone/test-system-cmds
+++ b/test-suite/standalone/test-system-cmds
@@ -12,7 +12,7 @@ exec guile -q -s "$0" "$@"
 
   ;; Note: Use double quotes since simple quotes are not supported by
   ;; `cmd.exe' on Windows.
-  (let ((rs (status:exit-val (system "guile -c \"(exit 42)\""))))
+  (let ((rs (status:exit-val (system "sh -c \"exit 42\""))))
     (if (not (= 42 rs))
         (begin
           (simple-format
@@ -22,7 +22,7 @@ exec guile -q -s "$0" "$@"
           (exit 1)))))
 
 (define (test-system*-cmd)
-  (let ((rs (status:exit-val (system* "guile" "-c" "(exit 42)"))))
+  (let ((rs (status:exit-val (system* "sh" "-c" "exit 42"))))
     (if (not (= 42 rs))
         (begin
           (simple-format
-- 
2.39.0





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

* Re: [PATCH] test-system-cmds: use sh -c instead of guile -c
  2023-01-28 10:17 [PATCH] test-system-cmds: use sh -c instead of guile -c Omar Polo
@ 2023-01-28 15:43 ` Eli Zaretskii
  2023-01-30 15:44   ` Omar Polo
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2023-01-28 15:43 UTC (permalink / raw)
  To: Omar Polo; +Cc: guile-devel

> Date: Sat, 28 Jan 2023 11:17:07 +0100
> From: Omar Polo <op@omarpolo.com>
> 
> I'm not sure this patch is palatable as-is, but I'm adding it to the
> OpenBSD port to have less failures in the regress suite.
> 
> The main issue is that "guile" may not be available at test time for
> various reasons.  (the install prefix is not in $PATH, the executable
> may be renamed --program-suffix, etc...)

the intent of the test is to test the just-produced Guile binary, so
if that binary is not on PATH, the test suite should be fixed so that
it is on PATH.

> The comment about windows however makes me think that neither sh may
> be available.  Using meta/guile then is better, other tests are doing
> that, but I haven't found the right incantation to do so.

I'm responsible for that comment, so when I ran the test suite, it did
find the Guile binary in the build tree.  Maybe something happened in
the meantime that it doesn't now, but the right fix is IMO definitely
not to replace Guile with sh, as relying on sh being available is not
going to work on Windows.

Please instead try to figure out why guile is not on PATH.  Running
meta/guile might be better, but isn't that a shell script that
requires sh as well?



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

* Re: [PATCH] test-system-cmds: use sh -c instead of guile -c
  2023-01-28 15:43 ` Eli Zaretskii
@ 2023-01-30 15:44   ` Omar Polo
  0 siblings, 0 replies; 3+ messages in thread
From: Omar Polo @ 2023-01-30 15:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: guile-devel

On 2023/01/28 17:43:42 +0200, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sat, 28 Jan 2023 11:17:07 +0100
> > From: Omar Polo <op@omarpolo.com>
> > 
> > I'm not sure this patch is palatable as-is, but I'm adding it to the
> > OpenBSD port to have less failures in the regress suite.
> > 
> > The main issue is that "guile" may not be available at test time for
> > various reasons.  (the install prefix is not in $PATH, the executable
> > may be renamed --program-suffix, etc...)
> 
> the intent of the test is to test the just-produced Guile binary, so
> if that binary is not on PATH, the test suite should be fixed so that
> it is on PATH.

my understanding is that it's using the just-produced Guile binary and
testing wether `system' and `system*' are able spawn executables and
return their exit code.

Anyway, I have to apologise, I can't reproduce the issue anymore.  It
was probably something wrong while I was trying to understand
bug#61095[0].

Consider the patch dropped, the test suite correctly sets up the $PATH
as the README describe.

Sorry for the noise.

Omar Polo

[0]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61095




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

end of thread, other threads:[~2023-01-30 15:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-28 10:17 [PATCH] test-system-cmds: use sh -c instead of guile -c Omar Polo
2023-01-28 15:43 ` Eli Zaretskii
2023-01-30 15:44   ` Omar Polo

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