diff mbox series

[bug#49577] Add python-pmbootstrap

Message ID R_J3VIodlpluXe4-_dQhbwDxpNLstpfXuz7NsCxhcv8vOhn24R9w5LbxnqaCymTU3jmu_CfDqGYqWN5YfNMueVQO8VFoce4UhLy4RIOQpV8=@protonmail.com
State New
Headers show
Series [bug#49577] Add python-pmbootstrap | expand

Commit Message

phodina Dec. 15, 2022, 9:51 p.m. UTC
Hi Maxim,

here's update of the package. I moved to git repo as it has test suite packaged.

However, currently 44 tests fail, 80 pass.

The reason is they require network connectivity (mostly git tests, can be added to list of dependencies), then some require chroot (that might be dropped and run in guix isolated environment), sudo (again remove and use TMP location).

The tool is able to produce working PostmarketOS image which can be run on mobile device.

Not sure about the time it will take to patch all the tests. What do you think?

----
Petr

Comments

Maxim Cournoyer Dec. 16, 2022, 4:52 a.m. UTC | #1
Hi Petr,

phodina <phodina@protonmail.com> writes:

> Hi Maxim,
>
> here's update of the package. I moved to git repo as it has test suite packaged.

Thank you!

> However, currently 44 tests fail, 80 pass.
>
> The reason is they require network connectivity (mostly git tests, can
> be added to list of dependencies), then some require chroot (that
> might be dropped and run in guix isolated environment), sudo (again
> remove and use TMP location).

Oh.  That's more than half the tests failing.  I guess the whole test
suite could be disabled with a comment, if possible with a link
requesting upstream to make it easy to skip network-requiring tests via
a flag or something.
Maxim Cournoyer May 25, 2023, 12:16 a.m. UTC | #2
tags 49577 +moreinfo
quit

Hi Jorge,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi Petr,
>
> phodina <phodina@protonmail.com> writes:
>
>> Hi Maxim,
>>
>> here's update of the package. I moved to git repo as it has test suite packaged.
>
> Thank you!
>
>> However, currently 44 tests fail, 80 pass.
>>
>> The reason is they require network connectivity (mostly git tests, can
>> be added to list of dependencies), then some require chroot (that
>> might be dropped and run in guix isolated environment), sudo (again
>> remove and use TMP location).
>
> Oh.  That's more than half the tests failing.  I guess the whole test
> suite could be disabled with a comment, if possible with a link
> requesting upstream to make it easy to skip network-requiring tests via
> a flag or something.

The status is unchanged; the ball is in Petr's camp, or someone
interested enough in the patch to make the changes suggested.

I'm using this opportunity to gently ping Petr :-).
diff mbox series

Patch

From 5443a12dc08936a7facab4b1b85953624a29df24 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Sun, 18 Jul 2021 12:33:07 +0200
Subject: [PATCH v4] gnu: Add pmbootstrap.

* gnu/packages/python-xyz.scm (pmbootstrap): New variable.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 17fbd9de9e..7f409cf118 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -153,6 +153,7 @@  (define-module (gnu packages python-xyz)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages adns)
+  #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages attr)
   #:use-module (gnu packages backup)
@@ -1458,6 +1459,56 @@  (define-public python-shortuuid
 module and then similar looking characters are removed.")
     (license license:bsd-3)))
 
+(define-public pmbootstrap
+  (package
+    (name "pmbootstrap")
+    (version "1.50.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.com/postmarketOS/pmbootstrap")
+                    (commit version)))
+              (sha256
+               (base32
+                "0n26zbpw7nhyh9gq0ydgij7m4pgv2n5wlmyc7g2sr7gqhqv04j2j"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:tests? #f ; TODO: many test fail
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'install 'fix-paths
+                          (lambda* _
+                            (let ((git (string-append #$git "/bin/"))
+                                  (procps (string-append #$procps "/bin"))
+                                  (openssl (string-append #$openssl "/bin"))
+                                  (sudo "/run/setuid-programs"))
+                              (wrap-program (string-append #$output
+                                                           "/bin/pmbootstrap")
+                                            `("PATH" ":" suffix
+                                              ,(list git procps openssl sudo))))))
+                        (replace 'check
+                          (lambda* (#:key tests? #:allow-other-keys)
+                            (when tests?
+                              (invoke "pytest")))))))
+    (native-inputs (list python-pytest python-pyopenssl))
+    (inputs (list git procps openssl sudo))
+    (home-page "https://postmarketos.org")
+    (synopsis "Build and flash tool for postmarketOS")
+    (description
+     "Bootstrap program that abstracts everything in chroots and therefore
+basically runs on top of any Linux distribution. Features:
+@enumerate
+@item chroot setup (distro-independent QEMU user emulation
+@item clean chroot shutdown (umount) and zapping
+@item build software as packages
+@item cross-compile all armhf-packages
+@item effective caching out of the box (survives chroot zaps)
+@item installation targets
+@item flasher abstractions
+@item logging
+@item security
+@end enumerate")
+    (license license:gpl3+)))
+
 (define-public python-logwrap
   (package
     (name "python-logwrap")
-- 
2.37.2