gnu: proot: Update to 5.2.0-alpha-0.a70023a and fix version string.

* gnu/packages/linux.scm (proot): Update to 5.2.0-alpha-0.a70023a.
[tests?]: Reinstate tests for the aarch64-linux architecture.
[phases]{patch-sources}: Reinstate the test-ssssssss.c test, fixed upstream.
Set the VERSION Make variable, which is normally derived from invoking git.
Delete the new test-docker.sh test file.  Delete the known-to-be-failing
test-cdd39012.sh and test-d92b57ca.sh test files.
{check}: No longer set the PROOT_NO_SECCOMP environment variable as the
upstream issue appears to have been resolved.
[native-inputs]: Use the current coreutils package.
This commit is contained in:
Maxim Cournoyer 2021-10-01 13:41:22 -04:00
parent 8827ef8a50
commit 7dbd06a13b
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -6973,143 +6973,141 @@ (define-public nftables
(license license:gpl2))) (license license:gpl2)))
(define-public proot (define-public proot
(package (let ((revision "0")
(name "proot") (commit "a70023ab3db47d011265451b99a1abef7b9d7afc"))
;; The last stable release was made in 2015, and fails to build for (package
;; the aarch64 platform. (name "proot")
(version "5.2.0-alpha") ;; The last stable release was made in 2015, and fails to build for the
(source ;; aarch64 platform. Use the latest commit, which includes fixes for
(origin ;; the supported ARM architectures and the test suite, among others.
(method git-fetch) (version (git-version "5.2.0-alpha" revision commit))
(uri (git-reference (source
(url "https://github.com/proot-me/PRoot") (origin
(commit (string-append "v" version)))) (method git-fetch)
(file-name (git-file-name name version)) (uri (git-reference
(sha256 (url "https://github.com/proot-me/PRoot")
(base32 "09vp806y4hqfq2fn2hpi873rh4j6a3c572ph4mkirx1n32wj8srl")))) (commit (string-append commit))))
(build-system gnu-build-system) (file-name (git-file-name name version))
;; The powerpc64le-linux and mips64el-linux architectures are not (sha256
;; supported (see: (base32 "1kmry3rb967phxnxjfnx310gy1d4gpmjd6fp3hbm9v9jciysxy4z"))))
;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51). (build-system gnu-build-system)
(supported-systems '("x86_64-linux" "i686-linux" ;; The powerpc64le-linux and mips64el-linux architectures are not
"armhf-linux" "aarch64-linux" "i586-gnu")) ;; supported (see:
(arguments ;; https://github.com/proot-me/proot/blob/master/src/arch.h#L51).
;; Disable the test suite on ARM platforms, as there are too many (supported-systems '("x86_64-linux" "i686-linux"
;; failures to keep track of (see for example: "armhf-linux" "aarch64-linux" "i586-gnu"))
;; https://github.com/proot-me/proot/issues/263). (arguments
`(#:tests? ,(not (string-match "^(arm|aarch64)" ;; Disable the test suite on armhf-linux, as there are too many
(or (%current-target-system) ;; failures to keep track of (see for example:
(%current-system)))) ;; https://github.com/proot-me/proot/issues/286).
#:make-flags '("-C" "src") `(#:tests? ,(not (string-prefix? "armhf"
#:phases (modify-phases %standard-phases (or (%current-target-system)
(add-after 'unpack 'patch-sources (%current-system))))
(lambda* (#:key inputs #:allow-other-keys) #:make-flags '("-C" "src")
(substitute* (find-files "src" "\\.[ch]$") #:phases (modify-phases %standard-phases
(("\"/bin/sh\"") (add-after 'unpack 'patch-sources
(string-append "\"" (assoc-ref inputs "bash") (lambda* (#:key inputs #:allow-other-keys)
"/bin/sh\""))) (substitute* (find-files "src" "\\.[ch]$")
(("\"/bin/sh\"")
(string-append "\"" (assoc-ref inputs "bash")
"/bin/sh\"")))
(substitute* "src/GNUmakefile" (substitute* "src/GNUmakefile"
(("/bin/echo") (which "echo"))) (("/bin/echo") (which "echo"))
(("^VERSION = .*")
(string-append "VERSION := " ,version "\n")))
(substitute* (find-files "test" "\\.sh$") (substitute* (find-files "test" "\\.sh$")
;; Some of the tests try to "bind-mount" /bin/true. ;; Some of the tests try to "bind-mount" /bin/true.
(("-b /bin/true:") (("-b /bin/true:")
(string-append "-b " (which "true") ":")) (string-append "-b " (which "true") ":"))
;; Likewise for /bin. ;; Likewise for /bin.
(("-b /bin:") "-b /gnu:") (("-b /bin:") "-b /gnu:")
;; Others try to run /bin/sh. ;; Others try to run /bin/sh.
(("/bin/sh") (which "sh")) (("/bin/sh") (which "sh"))
;; Others assume /etc/fstab exists. ;; Others assume /etc/fstab exists.
(("/etc/fstab") "/etc/passwd")) (("/etc/fstab") "/etc/passwd"))
(substitute* "test/GNUmakefile" (substitute* "test/GNUmakefile"
(("-b /bin:") "-b /gnu:")) (("-b /bin:") "-b /gnu:"))
(substitute* "test/test-c6b77b77.mk" (substitute* "test/test-c6b77b77.mk"
(("/bin/bash") (which "bash")) (("/bin/bash") (which "bash"))
(("/usr/bin/test") (which "test"))) (("/usr/bin/test") (which "test")))
(substitute* "test/test-16573e73.c" (substitute* "test/test-16573e73.c"
(("/bin/([a-z-]+)" _ program) (("/bin/([a-z-]+)" _ program)
(which program))) (which program)))
(substitute* "test/test-d2175fc3.sh" (substitute* "test/test-d2175fc3.sh"
(("\\^/bin/true\\$") "$(which true)")) (("\\^/bin/true\\$") "$(which true)"))
(substitute* "test/test-5467b986.sh" (substitute* "test/test-5467b986.sh"
(("-w /usr") "-w /gnu") (("-w /usr") "-w /gnu")
(("-w usr") "-w gnu") (("-w usr") "-w gnu")
(("/usr/share") "/gnu/store") (("/usr/share") "/gnu/store")
(("share") "store")) (("share") "store"))
(substitute* "test/test-092c5e26.sh" (substitute* "test/test-092c5e26.sh"
(("-q echo ") (("-q echo ")
"-q $(which echo) ")) "-q $(which echo) "))
;; The following tests are known to fail (see: ;; The following tests are known to fail (see:
;; https://github.com/proot-me/proot/issues/184). ;; https://github.com/proot-me/proot/issues/184).
(delete-file "test/test-0228fbe7.sh") (delete-file "test/test-0228fbe7.sh")
(delete-file "test/test-2db65cd2.sh") (delete-file "test/test-2db65cd2.sh")
(delete-file "test/test-cdd39012.sh")
(delete-file "test/test-d92b57ca.sh")
;; This one fails with "bind: Address already in use" ;; This one fails on a waitpid call that returns 1 (see:
;; (see: https://github.com/proot-me/proot/issues/260). ;; https://github.com/proot-me/proot/issues/261).
(delete-file "test/test-ssssssss.c") (delete-file "test/test-ptrace01.c")
;; This one fails on a waitpid call that returns 1 (see: ;; XXX: This test fails in an obscure corner case, just
;; https://github.com/proot-me/proot/issues/261). ;; skip it.
(delete-file "test/test-ptrace01.c") (delete-file "test/test-kkkkkkkk.c")
;; XXX: This test fails in an obscure corner case, just ;; This one requires Docker.
;; skip it. (delete-file "test/test-docker.sh")
(delete-file "test/test-kkkkkkkk.c")
;; The socket tests requires networking. ;; The socket tests requires networking.
(for-each delete-file (for-each delete-file
(find-files "test" "test-socket.*\\.sh$")))) (find-files "test" "test-socket.*\\.sh$"))))
(delete 'configure) (delete 'configure)
(add-after 'build 'build-manpage (add-after 'build 'build-manpage
(lambda _ (lambda _
(with-directory-excursion "doc" (with-directory-excursion "doc"
(invoke "make" "proot/man.1" "SUFFIX=.py")))) (invoke "make" "proot/man.1" "SUFFIX=.py"))))
(replace 'check (replace 'check
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(when tests? (when tests?
(let ((n (parallel-job-count))) (let ((n (parallel-job-count)))
;; There are lots of segfaults with seccomp support ;; Most of the tests expect "/bin" to be in $PATH so
;; (x86_64, Linux-libre 4.11.0) (see: ;; they can run things that live in $ROOTFS/bin.
;; https://github.com/proot-me/proot/issues/106). (setenv "PATH"
(setenv "PROOT_NO_SECCOMP" "1") (string-append (getenv "PATH") ":/bin"))
;; Most of the tests expect "/bin" to be in $PATH so (invoke "make" "check" "-C" "test"
;; they can run things that live in $ROOTFS/bin. ;;"V=1"
(setenv "PATH" "-j" (number->string n))))))
(string-append (getenv "PATH") ":/bin")) (replace 'install
(invoke "make" "check" "-C" "test" (lambda* (#:key outputs #:allow-other-keys)
;;"V=1" ;; The 'install' rule does nearly nothing.
"-j" (number->string n)))))) (let* ((out (assoc-ref outputs "out"))
(replace 'install (man1 (string-append out "/share/man/man1")))
(lambda* (#:key outputs #:allow-other-keys) ;; TODO: 'make install-care' (does not even
;; The 'install' rule does nearly nothing. ;; build currently.)
(let* ((out (assoc-ref outputs "out")) (invoke "make" "-C" "src" "install"
(man1 (string-append out "/share/man/man1"))) (string-append "PREFIX=" out))
;; TODO: 'make install-care' (does not even (mkdir-p man1)
;; build currently.) (copy-file "doc/proot/man.1"
(invoke "make" "-C" "src" "install" (string-append man1 "/proot.1"))))))))
(string-append "PREFIX=" out)) (native-inputs `(("which" ,which)
(mkdir-p man1) ;; For 'mcookie', used by some of the tests.
(copy-file "doc/proot/man.1" ("util-linux" ,util-linux)
(string-append man1 "/proot.1")))))))) ("coreutils" ,coreutils)
(native-inputs `(("which" ,which) ("pkg-config" ,pkg-config)
;; For 'mcookie', used by some of the tests. ;; For rst2man, used to generate the manual page.
("util-linux" ,util-linux) ("python-docutils" ,python-docutils)))
;; XXX: Choose the old coreutils because its 'stat' (inputs `(("libarchive" ,libarchive)
;; program does not use statx(2) when running 'stat -c ("talloc" ,talloc)))
;; %a' or similar, which PRoot doesn't properly support (home-page "https://github.com/proot-me/PRoot")
;; (see: https://github.com/proot-me/proot/issues/262). (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
("coreutils-old" ,coreutils-8.30) (description
("pkg-config" ,pkg-config) "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
;; For rst2man, used to generate the manual page.
("python-docutils" ,python-docutils)))
(inputs `(("libarchive" ,libarchive)
("talloc" ,talloc)))
(home-page "https://github.com/proot-me/PRoot")
(synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
(description
"PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
and @code{binfmt_misc}. This means that users don't need any privileges or and @code{binfmt_misc}. This means that users don't need any privileges or
setup to do things like using an arbitrary directory as the new root setup to do things like using an arbitrary directory as the new root
file system, making files accessible somewhere else in the file system file system, making files accessible somewhere else in the file system
@ -7118,7 +7116,7 @@ (define-public proot
generic process instrumentation engine thanks to its extension mechanism. generic process instrumentation engine thanks to its extension mechanism.
Technically PRoot relies on @code{ptrace}, an unprivileged system-call Technically PRoot relies on @code{ptrace}, an unprivileged system-call
available in the kernel Linux.") available in the kernel Linux.")
(license license:gpl2+))) (license license:gpl2+))))
(define-public proot-static (define-public proot-static
(package (package