Subject: Re: [bug#73842] [PATCH v5 2/3] pack: Add support for AppImage pack format.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 23 Nov 2024 17:01:56 +0100

Hey Noé,

Pushed as 8d6389b866d91a72569ecf50ddf313c17430d34b!

Thank you, and thanks for your patience!

Of course, only after pushing and thinking through the FUSE issue did I
realize that something must be wrong with the tests because we cannot
rely on ‘fusermount3’ or FUSE in general in the build environment.
Indeed, those tests were not building anything at all because the
‘check’ derivation has zero outputs.

So I tried the change below, but that leads to a failing test:

--8<---------------cut here---------------start------------->8---
Failed to run /tmp/guix-build-check-appimage.drv-0/appimage_extracted_b74cb93b3ec3113d87e0f1da08dcd973/AppRun: No such file or directory
builder for `/gnu/store/jxvrfa81m60zwwdrj55x0npmfbgblfv6-check-appimage.drv' failed with exit code 127
--8<---------------cut here---------------end--------------->8---

Could you or Sebastian take a look?  No rush, but it’s best to have
working tests for features like this.  (Please open a new issue to
follow up on this.)

Thanks,
Ludo’.

diff --git a/tests/pack.scm b/tests/pack.scm
index 1c1e312557..c395f3935f 100644
--- a/tests/pack.scm
+++ b/tests/pack.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017-2021, 2023 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2017-2021, 2023, 2024 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2018 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2021, 2023 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2023 Oleg Pykhalov <[email-masked]>
@@ -356,8 +356,18 @@ (define rpm-for-tests
                                            (list #:relocatable? #t)))
          (check   (gexp->derivation
                    "check-appimage"
-                   #~(invoke #$image))))
-      (built-derivations (list check))))
+                   (with-imported-modules '((guix build utils))
+                     #~(begin
+                         (use-modules (ice-9 popen)
+                                      (guix build utils))
+
+                         (let ((pipe (open-pipe* OPEN_READ
+                                                 #$image "--appimage-extract-and-run")))
+                           (call-with-output-file #$output
+                             (lambda (port)
+                               (dump-port pipe port)))
+                           (exit (status:exit-val (close-pipe pipe)))))))))
+      (built-derivations (list (pk 'APPIMAGE-drv check)))))
 
   (unless store (test-skip 1))
   (test-assertm "appimage + localstatedir"
@@ -374,6 +384,7 @@ (define rpm-for-tests
                                            (list #:relocatable? #t)))
          (check   (gexp->derivation
                    "check-appimage"
+                   ;; FIXME: Do something as above.
                    #~(begin
                        (invoke #$image)))))
       (built-derivations (list check))))