guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 04/04: Adjust 'spawn' tests to accept 'LD_ORIGIN_PATH' o


From: Ludovic Courtès
Subject: [Guile-commits] 04/04: Adjust 'spawn' tests to accept 'LD_ORIGIN_PATH' on GNU/Hurd.
Date: Sun, 2 Apr 2023 09:41:46 -0400 (EDT)

civodul pushed a commit to branch main
in repository guile.

commit e93525e549ba4d5ec52ec90aaf051f546d854cea
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Apr 2 15:37:00 2023 +0200

    Adjust 'spawn' tests to accept 'LD_ORIGIN_PATH' on GNU/Hurd.
    
    Fixes <https://bugs.gnu.org/62501>.
    
    * test-suite/tests/posix.test ("spawn")["env with #:environment
    and #:output"]: Add workaround for GNU/Hurd.
    * NEWS: Update.
---
 NEWS                        | 2 ++
 test-suite/tests/posix.test | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index ce8d4e120..a63b0aa25 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,8 @@ the compiler reports it as "possibly unused".
    (<https://bugs.gnu.org/62290>)
 ** Fix invalid use of 'posix_spawn' on non-glibc systems
    (<https://bugs.gnu.org/61095>)
+** Adjust 'spawn' test for GNU/Hurd
+   (<https://bugs.gnu.org/62501>)
 ** Hashing of UTF-8 symbols with non-ASCII characters avoids corruption
    (<https://bugs.gnu.org/56413>)
 
diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
index f20e04453..d5cf47cda 100644
--- a/test-suite/tests/posix.test
+++ b/test-suite/tests/posix.test
@@ -431,7 +431,13 @@
       (let ((str (get-string-all (car input+output))))
         (close-port (car input+output))
         (waitpid pid)
-        str)))
+
+        ;; On GNU/Hurd, the exec server prepends 'LD_ORIGIN_PATH' for
+        ;; every program: <https://bugs.gnu.org/62501>.  Strip it.
+        (if (and (string=? "GNU" (utsname:sysname (uname)))
+                 (string-prefix? "LD_ORIGIN_PATH=" str))
+            (string-drop str (+ 1 (string-index str #\newline)))
+            str))))
 
   (pass-if-equal "ls /proc/self/fd"
       "0\n1\n2\n3\n"                     ;fourth FD is for /proc/self/fd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]