mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-18 20:57:12 -05:00
gnu: python-dbusmock: Update to 0.25.0 and reap terminated processes.
It was reported by abrenon and zimoun in #guix that python-dbusmock would fail to build on their systems. * gnu/packages/python-xyz.scm (python-dbusmock) [imported-modules, modules]: New arguments. [native-inputs]: Use new style. [phases]{check}: Override phase to run it via a dumb init that can handle signals and reap dead processes correctly. This prevents test suite failures in some cases (though it is still unknown why it was working on some systems and not on others before the change).
This commit is contained in:
parent
5ed33b0d05
commit
719deaa881
1 changed files with 29 additions and 8 deletions
|
@ -52,7 +52,7 @@
|
||||||
;;; Copyright © 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
;;; Copyright © 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||||
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
|
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
|
||||||
;;; Copyright © 2018, 2019, 2021 Clément Lassieur <clement@lassieur.org>
|
;;; Copyright © 2018, 2019, 2021 Clément Lassieur <clement@lassieur.org>
|
||||||
;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
;;; Copyright © 2018, 2019, 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
|
;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
|
||||||
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
|
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
|
||||||
;;; Copyright © 2015, 2018 Pjotr Prins <pjotr.guix@thebird.nl>
|
;;; Copyright © 2015, 2018 Pjotr Prins <pjotr.guix@thebird.nl>
|
||||||
|
@ -24101,17 +24101,23 @@ (define-public python-pykwalify
|
||||||
(define-public python-dbusmock
|
(define-public python-dbusmock
|
||||||
(package
|
(package
|
||||||
(name "python-dbusmock")
|
(name "python-dbusmock")
|
||||||
(version "0.24.1")
|
(version "0.25.0")
|
||||||
(source
|
(source
|
||||||
(origin
|
(origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (pypi-uri "python-dbusmock" version))
|
(uri (pypi-uri "python-dbusmock" version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0kvjwn5sdp3rqcbclvxljkmk988l12dvppzfn3ldy3jxbyyn1mjn"))))
|
"1nwl0gzzds2g1w1gfxfzlgrkb5hr1rrdyn619ml25c6b1rjyfk3g"))))
|
||||||
(build-system python-build-system)
|
(build-system python-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:phases
|
`(#: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
|
(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'patch-paths
|
(add-after 'unpack 'patch-paths
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
@ -24120,11 +24126,26 @@ (define-public python-dbusmock
|
||||||
(substitute* "dbusmock/testcase.py"
|
(substitute* "dbusmock/testcase.py"
|
||||||
(("'dbus-daemon'")
|
(("'dbus-daemon'")
|
||||||
(string-append "'" (assoc-ref inputs "dbus")
|
(string-append "'" (assoc-ref inputs "dbus")
|
||||||
"/bin/dbus-daemon'"))))))))
|
"/bin/dbus-daemon'")))))
|
||||||
|
(replace 'check
|
||||||
|
(lambda* (#:key tests? #:allow-other-keys)
|
||||||
|
(when 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,
|
||||||
|
;; python-dbusmock would waste time polling for the dbus
|
||||||
|
;; processes it spawns to be reaped, in vain.
|
||||||
|
(execlp "tini" "--" "pytest" "-vv"))
|
||||||
|
(pid
|
||||||
|
(match (waitpid pid)
|
||||||
|
((_ . status)
|
||||||
|
(unless (zero? status)
|
||||||
|
(error "`pytest' exited with status"
|
||||||
|
status))))))))))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list ;; For tests.
|
(list dbus python-pytest tini which))
|
||||||
dbus ; for dbus-daemon
|
|
||||||
python-nose which))
|
|
||||||
(inputs
|
(inputs
|
||||||
(list dbus))
|
(list dbus))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
|
|
Loading…
Reference in a new issue