help-guix
[Top][All Lists]
Advanced

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

Re: Help with DBus Tests Failing for Python Package


From: Jaft
Subject: Re: Help with DBus Tests Failing for Python Package
Date: Thu, 29 Dec 2022 09:32:34 +0000 (UTC)

 On Tuesday, December 27, 2022 at 11:49:31 AM CST, Maxim Cournoyer 
<maxim.cournoyer@gmail.com> wrote: 
> I bet this is because of the expectation of python-dbus on the processes
> being reaped by PID 1 instead of staying around as zombies, as currently
> happens in the Guix build container (see:
> https://issues.guix.gnu.org/30948).
>
> The current workaround currently used in Guix involves the use of tini
> and of a forked process... it's not very pretty (see 'guix edit mutter'
> for such an example).

Thanks a ton for the pointer, Maxim.

Unfortunately, I still seem to be getting the same result. At first, I tried a 
simple approach of ~(execlp "tini" "--" "python" "setup.py" "test")~; I think 
it wound up still requiring the =dbus= package, to run.

That failing, I decided to try something closer to what =mutter= was doing with

> (arguments (list #:imported-modules
>                  `(,@%python-build-system-modules
>                    (guix build syscalls))
>                  #:modules
>                  '((guix build python-build-system)
>                    (guix build syscalls)
>                    (guix build utils)
>                    (ice-9 match))
>                  #:phases
>                  #~(modify-phases %standard-phases
>                      (replace 'check
>                        (lambda* (#:key tests? #:allow-other-keys)
>                          (when tests?
>                            ;; Setup (see the 'test-mutter' CI target at
>                            ;; 
>https://gitlab.gnome.org/GNOME/mutter/-/raw/main/.gitlab-ci.yml).
>                            (setenv "HOME" "/tmp")
>                            (setenv "XDG_RUNTIME_DIR" (string-append (getcwd)
>                                                                     
>"/runtime-dir"))
>                            (mkdir (getenv "XDG_RUNTIME_DIR"))
>                            (chmod (getenv "XDG_RUNTIME_DIR") #o700)
>
>                            (setenv "GSETTINGS_SCHEMA_DIR" "data")
>                            (setenv "MUTTER_DEBUG_DUMMY_MODE_SPECS" 
>"800x600@10.0")
>                            ;; (setenv "PIPEWIRE_DEBUG" "2")
>                            ;; (setenv "PIPEWIRE_LOG" 
>"meson-logs/pipewire.log")
>                            (setenv "XVFB_SERVER_ARGS" "+iglx -noreset")
>                            (setenv "G_SLICE" "always-malloc")
>                            (setenv "MALLOC_CHECK" "3")
>                            (setenv "NO_AT_BRIDGE" "1")
>                            ;; This is needed, otherwise the 
>"mutter:core+mutter/unit /
>                            ;; anonymous-file" test would fail (see:
>                            ;; 
>https://gitlab.gnome.org/GNOME/mutter/-/issues/2017).
>                            (setenv "CI_JOB_ID" "1")
>
>                            ;; (invoke "glib-compile-schemas" (getenv 
>"GSETTINGS_SCHEMA_DIR"))
>                            (mkdir-p (getenv "XDG_RUNTIME_DIR"))
>                            (chmod (getenv "XDG_RUNTIME_DIR") #o755)
>                            ;; (invoke "pipewire" "--version") ;check for 
>pipewire
>                            ;; (system "pipewire &")   ;always returns 0 due 
>to forking
>
>                            (match (primitive-fork)
>                              (0                    ;child process
>                               (set-child-subreaper!)
>                               ;; XXX: Tini provides proper PID1-like signal 
>handling that
>                               ;; reaps zombie processes, necessary for the
>                               ;; 'test_shutdown_subprocesses' test to pass.
>
>                               ;; TODO: Complete 
>https://issues.guix.gnu.org/30948.
>                               ;; (execlp "tini" "--" "python" "setup.py" 
>"test")
>                               (execlp "tini" "--"
>                                       "dbus-run-session" "--"
>                                       "xvfb-run" "-a" "-s" (getenv 
>"XVFB_SERVER_ARGS")
>                                       "python" "setup.py" "test"))
>                              (pid
>                               (match (waitpid pid)
>                                 ((_ . status)
>                                  (unless (zero? status)
>                                    (error "`pytest' exited with status"
>                                           status))))))))))))

I know some bits there are definitely not relevant; I figured I could clean it 
up, after, if things worked but I'm still getting the exact same errors.

Just to make sure /I'm/ not doing something incorrectly, is this within what 
you meant? Or did I do anything that's obviously not correct, in this setup?


reply via email to

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