guix-devel
[Top][All Lists]
Advanced

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

Re: Updating mumi on berlin


From: Thiago Jung Bauermann
Subject: Re: Updating mumi on berlin
Date: Sat, 04 Jun 2022 19:36:47 -0300

Hello Ludo,

Ludovic Courtès <ludo@gnu.org> writes:

> Thiago Jung Bauermann <bauermann@kolabnow.com> skribis:
>
>> I tried the latter a couple of weeks ago and it didn't work either,
>> though it's highly likely that I did something wrong in my Scheme code.
>> I also didn't use the 1-second timer hack so perhaps that was it.
>>
>> I just tested this (adapted from the mutter package) and it worked:
>>
>> @@ -4137,6 +4142,26 @@ (define-public public-inbox
>>               ;; the builder.
>>               (substitute* "t/httpd-unix.t"
>>                 (("^SKIP: \\{") "SKIP: { skip('Guix');"))))
>> +         (replace 'check
>> +           (lambda* (#:key target
>> +                     (tests? (not target)) (test-flags '())
>> +                     #:allow-other-keys)
>> +             (if tests?
>> +                 (match (primitive-fork)
>> +                   (0                     ;child process
>> +                    (set-child-subreaper!)
>> +                    ;; Use tini so that signals are properly handled and
>> +                    ;; doubly-forked processes get reaped; otherwise,
>> +                    ;; lei-daemon is kept as a zombie and the testsuite
>> +                    ;; fails thinking that it didn't quit as it should.
>> +                    (apply execlp "tini" "--"
>> +                           "make" "check" test-flags))
>
> How does a basic SIGCHLD handler fare?
>
>   (sigaction SIGCHLD
>     (lambda _ (false-if-exception (waitpid WAIT_ANY WNOHANG))))

I finally had a chance to try this, but it didn't work. I didn't try the
changes suggested by Maxime though.

Here's the full ‘check’ phase I tried:

--8<---------------cut here---------------start------------->8---
(replace 'check
  (lambda* (#:key target
            (tests? (not target)) (test-flags '())
            #:allow-other-keys)
    (if tests?
        (match (primitive-fork)
          (0                     ;child process
            (set-child-subreaper!)

            ;; lei tests build UNIX domain sockets in the temporary
            ;; directory, but the path of those sockets can be at most
            ;; 108 chars and Guix' default value for the variables
            ;; below already use 47 chars. Use the shortest temporary
            ;; path possible to avoid hitting the limit.
            (setenv "TEMP" "/tmp")
            (setenv "TEMPDIR" "/tmp")
            (setenv "TMP" "/tmp")
            (setenv "TMPDIR" "/tmp")

            (sigaction SIGCHLD
              (lambda _ (false-if-exception (waitpid WAIT_ANY WNOHANG))))
            (exit (status:exit-val
                    (apply system* "make" "check" test-flags))))
          (pid
            (match (waitpid pid)
              ((_ . status)
                (unless (zero? status)
                  (error "`make check' exited with status" status))))))
        (format #t "test suite not run~%"))))
--8<---------------cut here---------------end--------------->8---

-- 
Thanks
Thiago



reply via email to

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