Edit

IABSD.fr/ports/lang/guile3/patches/patch-test-suite_tests_posix_test

Branch :

  • Show log

    Commit

  • Author : op
    Date : 2023-02-03 08:27:31
    Hash : f8042ea1
    Message : update lang/guile3 to 3.0.9 announce: https://www.gnu.org/software/guile/news/gnu-guile-309-released.html The new `spawn' and existing functions like `system*', `open-pipe' and `pipeline' are now implemented via posix_spawn, except that the way they run on non-linux OSes is wrong. The closing of _all_ file descriptors in the 3...RLIMIT_NOFILE is scheduled via posix_spawn_file_actions_addclose and, since not all the fds in that range are valid, close(2) fails and aborts posix_spawn. Add an ugly hack to close only in the 3...getdtablecount() range, testing each fd with fstat(2) to see if it's 'live'. Bug filed upstream, waiting for an official fix.

  • lang/guile3/patches/patch-test-suite_tests_posix_test
  •  - wc pads the result with blanks, trim its output
     - use "seq 3" rather than assuming /proc is available
     - fix nonsensical crypt invocation, use examples from manpage
    
    Index: test-suite/tests/posix.test
    --- test-suite/tests/posix.test.orig
    +++ test-suite/tests/posix.test
    @@ -411,7 +411,7 @@
           (display "Hello world.\n" (cdr a+b))
           (close-port (cdr a+b))
     
    -      (let ((str (get-string-all (car c+d))))
    +      (let ((str (string-trim (get-string-all (car c+d)))))
             (close-port (car c+d))
             (waitpid pid)
             str)))
    @@ -428,18 +428,16 @@
             (waitpid pid)
             str)))
     
    -  (pass-if-equal "ls /proc/self/fd"
    -      "0\n1\n2\n3\n"                     ;fourth FD is for /proc/self/fd
    -    (if (file-exists? "/proc/self/fd")   ;Linux
    -        (let* ((input+output (pipe))
    -               (pid (spawn "ls" '("ls" "/proc/self/fd")
    -                           #:output (cdr input+output))))
    -          (close-port (cdr input+output))
    -          (let ((str (get-string-all (car input+output))))
    -            (close-port (car input+output))
    -            (waitpid pid)
    -            str))
    -        (throw 'unresolved)))
    +  (pass-if-equal "seq 3"
    +      "1\n2\n3\n"
    +    (let* ((input+output (pipe))
    +           (pid (spawn "seq" '("seq" "3")
    +                       #:output (cdr input+output))))
    +      (close-port (cdr input+output))
    +      (let ((str (get-string-all (car input+output))))
    +        (close-port (car input+output))
    +        (waitpid pid)
    +        str)))
     
       (pass-if-equal "file not found"
           ENOENT
    @@ -459,7 +457,8 @@
       (pass-if "basic usage"
         (if (not (defined? 'crypt))
             (throw 'unsupported)
    -        (string? (crypt "pass" "abcdefg"))))
    +        (string? (crypt "OrpheanBeholderScryDoubt"
    +                        "$2b$12$FPWWO2RJ3CK4FINTw0Hi8OiPKJcX653gzSS.jqltHFMxyDmmQ0Hqq"))))
     
       (pass-if "crypt invalid salt on glibc"
         (begin