unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Jaft <jaft.r@outlook.com>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: Jaft via <help-guix@gnu.org>
Subject: Re: Help with DBus Tests Failing for Python Package
Date: Thu, 29 Dec 2022 09:32:34 +0000 (UTC)	[thread overview]
Message-ID: <BN8PR07MB70279243511287A1C721EDB699F39@BN8PR07MB7027.namprd07.prod.outlook.com> (raw)
In-Reply-To: <87tu1g68k8.fsf@gmail.com>

 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	other threads:[~2022-12-29  9:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <871524398.4432753.1672114559997.ref@mail.yahoo.com>
2022-12-27  4:15 ` Help with DBus Tests Failing for Python Package Jaft
2022-12-27  8:46   ` Jaft
2022-12-27 11:08     ` Csepp
2022-12-27 17:49     ` Maxim Cournoyer
2022-12-29  9:32       ` Jaft [this message]
2022-12-29 14:56         ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN8PR07MB70279243511287A1C721EDB699F39@BN8PR07MB7027.namprd07.prod.outlook.com \
    --to=jaft.r@outlook.com \
    --cc=help-guix@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).