bug-guix
[Top][All Lists]
Advanced

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

bug#38359: Guix 1.0.1-10.41b4b71 test fails on armhf


From: Ludovic Courtès
Subject: bug#38359: Guix 1.0.1-10.41b4b71 test fails on armhf
Date: Mon, 09 Dec 2019 18:07:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Mathieu,

Sorry for the delay!

Mathieu Othacehe <address@hidden> skribis:

>> Mmmh, I get what's going on in tests/processes.scm. It's an issue in
>> (guix scripts processes) where argv0 is checked for "guix-daemon".
>>
>> When using --system my-system, argv0 is "qemu-my-system". So we need to
>> check both argv0 and argv1 for "guix-daemon".
>>
>> I'll propose a patch.

Good catch!  When “transparent” emulation is no longer transparent…

> Here it is. Please tell me what you think. Another solution would be to
> accept that (guix process) is broken when guix-daemon is run via binfmt
> and disable the tests in that case. However, I don't know how to detect
> it properly for the test suite.

It’s kinda ugly, but I’d be tempted to go for that second solution:
detecting in tests/processes.scm that we’re under binfmt_misc and
skipping tests.

The reason is that while your patch looks great to me, it would break
when new “guix processes” is used with an old daemon.  There are other
details, like “guix/PID” is not as nice as “guix-daemon PID” (or
similar) for grepping purposes, but “guix-daemon PID” might hit the
limit on command name length.  Tricky!

As for the detection, this appears to work:

  (define (binfmt-misc?)
    (let ((pid (getpid))
          (cmdline (call-with-input-file "/proc/self/cmdline" get-string-all)))
      (match (primitive-fork)
        (0 (dynamic-wind
             (const #t)
             (lambda ()
               (exit (not (equal? (call-with-input-file (format #f 
"/proc/~a/cmdline" pid)
                                    get-string-all)
                                  cmdline))))
             (const #t)))
        (x (zero? (pk (cdr (waitpid x))))))))

WDYT?

Thanks,
Ludo’.





reply via email to

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