gnu: python-dbusmock: Remove dependency on (guix build syscalls).

Having a dependency on (guix build syscalls) this deep in the stack
would make it much harder to change syscalls.scm.

* gnu/packages/python-xyz.scm (python-dbusmock)[native-inputs]: Remove TINY.
[arguments]: Remove #:imported-modules, and remove (guix build syscalls)
from #:modules.  Rewrite ‘check’ phase to reap processes from the build
process itself.
This commit is contained in:
Ludovic Courtès 2023-10-13 16:25:02 +02:00
parent 5a3b712ad7
commit 9a23dd54ee
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -27165,12 +27165,10 @@ for YAML and JSON.")
"1nwl0gzzds2g1w1gfxfzlgrkb5hr1rrdyn619ml25c6b1rjyfk3g")))) "1nwl0gzzds2g1w1gfxfzlgrkb5hr1rrdyn619ml25c6b1rjyfk3g"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:imported-modules (,@%python-build-system-modules `(#:modules ((guix build python-build-system)
(guix build syscalls))
#:modules ((guix build python-build-system)
(guix build syscalls)
(guix build utils) (guix build utils)
(ice-9 match)) (ice-9 match))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'patch-paths (add-after 'unpack 'patch-paths
@ -27186,20 +27184,20 @@ for YAML and JSON.")
(when tests? (when tests?
(match (primitive-fork) (match (primitive-fork)
(0 ;child process (0 ;child process
(set-child-subreaper!) (execlp "pytest" "pytest" "-vv"))
;; Use tini so that signals are properly handled and (pytest-pid
;; doubly-forked processes get reaped; otherwise, (let loop ()
;; python-dbusmock would waste time polling for the dbus ;; Reap child processes; otherwise, python-dbusmock would
;; processes it spawns to be reaped, in vain. ;; waste time polling for the dbus processes it spawns to
(execlp "tini" "--" "pytest" "-vv")) ;; be reaped, in vain.
(pid (match (waitpid WAIT_ANY)
(match (waitpid pid) ((pid . status)
((_ . status) (if (= pid pytest-pid)
(unless (zero? status) (unless (zero? status)
(error "`pytest' exited with status" (error "`pytest' exited with status" status))
status)))))))))))) (loop)))))))))))))
(native-inputs (native-inputs
(list dbus python-pytest tini which)) (list dbus python-pytest which))
(inputs (inputs
(list dbus)) (list dbus))
(propagated-inputs (propagated-inputs