gnu: proot: Make the check phase honor the tests? argument.

* gnu/packages/linux.scm: Remove duplicate copyright line.
(proot): Delete trailing #t.
[phases]{check}: Skip when TESTS? is #f.
This commit is contained in:
Maxim Cournoyer 2021-07-08 12:50:39 -04:00
parent 3af31bc25a
commit 2d69073245
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -33,7 +33,7 @@
;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com> ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de> ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com> ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com> ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re> ;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re>
@ -47,7 +47,6 @@
;;; Copyright © 2020 John Soo <jsoo1@asu.edu> ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com> ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com> ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com> ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2020 David Dashyan <mail@davie.li> ;;; Copyright © 2020 David Dashyan <mail@davie.li>
@ -6825,7 +6824,6 @@ (define-public proot
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:make-flags '("-C" "src") '(#:make-flags '("-C" "src")
#:phases (modify-phases %standard-phases #:phases (modify-phases %standard-phases
(delete 'configure) (delete 'configure)
(add-before 'build 'set-shell-file-name (add-before 'build 'set-shell-file-name
@ -6834,8 +6832,7 @@ (define-public proot
(("\"/bin/sh\"") (("\"/bin/sh\"")
(string-append "\"" (string-append "\""
(assoc-ref inputs "bash") (assoc-ref inputs "bash")
"/bin/sh\""))) "/bin/sh\"")))))
#t))
(add-before 'check 'fix-fhs-assumptions-in-tests (add-before 'check 'fix-fhs-assumptions-in-tests
(lambda _ (lambda _
(substitute* "tests/test-c6b77b77.mk" (substitute* "tests/test-c6b77b77.mk"
@ -6861,24 +6858,23 @@ (define-public proot
;; XXX: This test fails in an obscure corner case, just ;; XXX: This test fails in an obscure corner case, just
;; skip it. ;; skip it.
(delete-file "tests/test-kkkkkkkk.c") (delete-file "tests/test-kkkkkkkk.c")))
#t))
(replace 'check (replace 'check
(lambda _ (lambda* (#:key tests? #:allow-other-keys)
(let ((n (parallel-job-count))) (when tests?
;; For some reason we get lots of segfaults with (let ((n (parallel-job-count)))
;; seccomp support (x86_64, Linux-libre 4.11.0). ;; For some reason we get lots of segfaults with
(setenv "PROOT_NO_SECCOMP" "1") ;; seccomp support (x86_64, Linux-libre 4.11.0).
(setenv "PROOT_NO_SECCOMP" "1")
;; Most of the tests expect "/bin" to be in $PATH so ;; Most of the tests expect "/bin" to be in $PATH so
;; they can run things that live in $ROOTFS/bin. ;; they can run things that live in $ROOTFS/bin.
(setenv "PATH" (setenv "PATH"
(string-append (getenv "PATH") ":/bin")) (string-append (getenv "PATH") ":/bin"))
(invoke "make" "check" "-C" "tests" (invoke "make" "check" "-C" "tests"
;;"V=1" ;;"V=1"
"-j" (number->string n))))) "-j" (number->string n))))))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; The 'install' rule does nearly nothing. ;; The 'install' rule does nearly nothing.
@ -6891,8 +6887,7 @@ (define-public proot
(mkdir-p man1) (mkdir-p man1)
(copy-file "doc/proot/man.1" (copy-file "doc/proot/man.1"
(string-append man1 "/proot.1")) (string-append man1 "/proot.1"))))))))
#t))))))
(native-inputs `(("which" ,which) (native-inputs `(("which" ,which)
;; For 'mcookie', used by some of the tests. ;; For 'mcookie', used by some of the tests.