From unknown Tue Jun 17 03:39:59 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#74670 <74670@debbugs.gnu.org> To: bug#74670 <74670@debbugs.gnu.org> Subject: Status: [PATCH] tests: pack: Fix AppImage tests. Reply-To: bug#74670 <74670@debbugs.gnu.org> Date: Tue, 17 Jun 2025 10:39:59 +0000 retitle 74670 [PATCH] tests: pack: Fix AppImage tests. reassign 74670 guix-patches submitter 74670 No=C3=A9 Lopez severity 74670 normal tag 74670 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 03 10:12:48 2024 Received: (at submit) by debbugs.gnu.org; 3 Dec 2024 15:12:48 +0000 Received: from localhost ([127.0.0.1]:60816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIUa0-0003jP-3h for submit@debbugs.gnu.org; Tue, 03 Dec 2024 10:12:48 -0500 Received: from lists.gnu.org ([209.51.188.17]:52172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIUZx-0003jF-M5 for submit@debbugs.gnu.org; Tue, 03 Dec 2024 10:12:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIUZq-0005nx-Cs for guix-patches@gnu.org; Tue, 03 Dec 2024 10:12:40 -0500 Received: from smtp.domeneshop.no ([2a01:5b40:0:3006::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIUZo-0005yy-49 for guix-patches@gnu.org; Tue, 03 Dec 2024 10:12:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=p42QqMtA+5s/J8FUnTtwRI1bEtnMV8cXjawPSHAUQV0=; b=JHCiPWrJkcRZMmcYjQkH7yFZ30 /J2zep7yU38HSudrF334IJNp7dLol+nSh5BwszS3jpYQQXaeTAl/sw+xSMQDjxf5VuImrvNBSGtE1 wblQhm9LXyctULr/ZNbnPdunOhOaFekQpDFsnPZD1CvkjAAasYIIVz4ffFgVDYrmG6OZUsRT/O1GU MRyUwC7IwOBC4qVOs6zffDl2cuOYaQupTDtltQnuPnfp2Uu5wcOSx0J4hQtKC2IxDI+rmzwRrCWro Q1SVaAAIb8Pwqrob9IMqC2O0o1frn9/G+B1oLsRbF2QFhgALTy8ItLqYv8C+5c+R0IQ2AMwU0j9fm uugwiSHA==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tIUZj-006sVB-96; Tue, 03 Dec 2024 16:12:31 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: guix-patches@gnu.org Subject: [PATCH] tests: pack: Fix AppImage tests. Date: Tue, 3 Dec 2024 16:13:24 +0100 Message-ID: <3f75445c04184678b357e777bfbc5eb751b9f363.1733238317.git.noelopez@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-CC: Ludovic Courtès Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:5b40:0:3006::1; envelope-from=noe@xn--no-cja.eu; helo=smtp.domeneshop.no X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) From: Noé Lopez * tests/pack.scm: Add glibc to AppImage tests’ profiles. Change-Id: I7890b902f65a2944ae8fa03db8a964deda3c725c --- Hi, This patch fixes the tests failing for AppImage pack. I believe the issue was that without the AppImage runtime (--appimage-extract-and-run), the glibc is not available to the AppRun binary, causing a file not found error. This is an issue caused because AppRun is built using the relocatable runtime, which requires (or at least is built with) the glibc. This is not an issue when using the AppImage runtime with FUSE, since it correctly mounts the store payload before starting the AppRun. Have a nice day, Noé tests/pack.scm | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/tests/pack.scm b/tests/pack.scm index 1c1e312557..2cb643f136 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 +;;; Copyright © 2017-2021, 2023, 2024 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2023 Oleg Pykhalov @@ -34,7 +34,7 @@ (define-module (test-pack) #:use-module ((guix build utils) #:select (%store-directory)) #:use-module (gnu packages) #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target - hello)) + hello glibc)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) @@ -347,36 +347,53 @@ (define rpm-for-tests (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello))) + (content (packages->manifest (list %bootstrap-guile hello glibc))) (hooks '()) (locales? #f))) (image (self-contained-appimage "hello-appimage" profile #:entry-point "bin/hello" #:extra-options - (list #:relocatable? #t))) + '(#: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" (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello))) + (content (packages->manifest (list %bootstrap-guile hello glibc))) (hooks '()) (locales? #f))) (image (self-contained-appimage "hello-appimage" profile #:entry-point "bin/hello" #:localstatedir? #t #:extra-options - (list #:relocatable? #t))) + '(#:relocatable? #t))) (check (gexp->derivation "check-appimage" - #~(begin - (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 "deb archive with symlinks and control files" base-commit: bb8a6f0ac47296d3a18e1e0a26ea3a833eb77c4a -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 12 16:59:40 2024 Received: (at 74670) by debbugs.gnu.org; 12 Dec 2024 21:59:40 +0000 Received: from localhost ([127.0.0.1]:40692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLrDf-0003Xz-LD for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:59:40 -0500 Received: from [209.51.188.92] (port=36856 helo=eggs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLrDc-0003X3-1V for 74670@debbugs.gnu.org; Thu, 12 Dec 2024 16:59:37 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLrDI-0003Zi-5s; Thu, 12 Dec 2024 16:59:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=LsYtjaKozU0lSI/faQkP3e8MzgqR9itQeMSZbZG9xVk=; b=HWBUgGRA7NPqJf2N0WrJ N5yHAXjRmcs7cBCHoqxtUoe59CzNvak/jCSH6hVE1q3A8of1HoyEjTMvU1wXaBrsC6LnMKbDqFWc5 vFlhemDarSlmG3DOLPe2EE8JTsasG6LXvoyiMt1rktd0rY+6o+b9dqT4S29pR7OirJKlmEz1VPrk5 lNmEJ9nAlvYydlq9aSBKuOnrsBc/8JxXQd0eFElZnfBmV5yi/atin2Xs2UiR9xGCVqw+w/0D3kBpT Inl6SCViAhRP85Xd/rsv0mG0maIjn0p3kMcqDkiatKZkp2UOpexg6vjKKT+9GJJNDXIayvCVP7vHB PyryQ3R30qlxmQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#74670] [PATCH] tests: pack: Fix AppImage tests. In-Reply-To: <3f75445c04184678b357e777bfbc5eb751b9f363.1733238317.git.noelopez@free.fr> (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Tue, 3 Dec 2024 16:13:24 +0100") References: <3f75445c04184678b357e777bfbc5eb751b9f363.1733238317.git.noelopez@free.fr> Date: Thu, 12 Dec 2024 22:58:28 +0100 Message-ID: <87pllw5zsr.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: 74670 Cc: 74670@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi No=C3=A9, No=C3=A9 Lopez skribis: > From: No=C3=A9 Lopez > > * tests/pack.scm: Add glibc to AppImage tests=E2=80=99 profiles. > > Change-Id: I7890b902f65a2944ae8fa03db8a964deda3c725c > --- > Hi, > > This patch fixes the tests failing for AppImage pack. I believe the issu= e was > that without the AppImage runtime (--appimage-extract-and-run), the glibc= is > not available to the AppRun binary, causing a file not found error. > > This is an issue caused because AppRun is built using the relocatable run= time, > which requires (or at least is built with) the glibc. Hmm, that further limits the applicability of AppImage, but OK. (Not our fault!) I noticed that the tests were not going very far, so I tried the patch below to: (1) check the output of =E2=80=98hello=E2=80=99 in the first test= , (2) change the second test to check for the existence of /var/guix/db/db.sqlite. The second test doesn=E2=80=99t work though, because where=E2=80=99s that f= ile supposed to live? The image is apparently extracted in an unguessable directory, so cannot tell where it is. Am I right? Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/tests/pack.scm b/tests/pack.scm index 2cb643f136..7fcae1ec1f 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -39,9 +39,10 @@ (define-module (test-pack) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) #:use-module ((gnu packages debian) #:select (dpkg)) - #:use-module ((gnu packages guile) #:select (guile-sqlite3)) + #:use-module ((gnu packages guile) #:select (guile-sqlite3 guile-3.0)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module ((gnu packages linux) #:select (fakeroot)) + #:use-module ((ice-9 textual-ports) #:select (get-string-all)) #:use-module (srfi srfi-64)) (define %store @@ -347,7 +348,9 @@ (define rpm-for-tests (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello glibc))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list hello glibc))) (hooks '()) (locales? #f))) (image (self-contained-appimage "hello-appimage" profile @@ -366,34 +369,46 @@ (define rpm-for-tests (lambda (port) (dump-port pipe port))) (exit (status:exit-val (close-pipe pipe))))))))) - (built-derivations (list (pk 'APPIMAGE-drv check))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello, world!\n"))))) (unless store (test-skip 1)) (test-assertm "appimage + localstatedir" (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello glibc))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list guile-3.0 glibc))) (hooks '()) (locales? #f))) - (image (self-contained-appimage "hello-appimage" profile - #:entry-point "bin/hello" + (image (self-contained-appimage "guile-appimage" profile + #:entry-point "bin/guile" #:localstatedir? #t #:extra-options '(#:relocatable? #t))) (check (gexp->derivation - "check-appimage" - (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))))) + "check-appimage-with-localstatedir" + #~(begin + (system* #$image "--appimage-extract-and-run" "-c" + (object->string + `(call-with-output-file #$output + (lambda (port) + (display "Hello from Guile!\n" + port))))) + (execl #$image #$image "--appimage-extract-and-run" "-c" + (object->string + '(exit + (pk 'db? (getcwd) + (file-exists? "var/guix/db/db.sqlite"))))))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello from Guile!\n"))))) (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 12 16:59:41 2024 Received: (at 74670) by debbugs.gnu.org; 12 Dec 2024 21:59:41 +0000 Received: from localhost ([127.0.0.1]:40694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLrDg-0003Y8-BQ for submit@debbugs.gnu.org; Thu, 12 Dec 2024 16:59:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLrDO-0003X1-MD for 74670@debbugs.gnu.org; Thu, 12 Dec 2024 16:59:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLrDH-0003Zb-QU; Thu, 12 Dec 2024 16:59:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=LsYtjaKozU0lSI/faQkP3e8MzgqR9itQeMSZbZG9xVk=; b=JQTFtbb9y7ie+MSZop1C r0aH47A2yBlnf4VFZQZrHOINkXo/zJ4VrK4QrlI9alYQFpqb+vBkJ4tr6aqP2QBdQ130/jCShVJyh I9iHp4JLG7LQ1blke59nfncSRMjN2wBKn+SuyHpUnEcC8hUPaESmDjeEAxCQdTstWZHQxe2qq1T3v vt9/WiLKxGlRajcycxbOnUhuxPcQg0S/ThAFDlVTloGDGLRSPBZ9imssK2xxt3HDqsbXx+5ZW+zph 8Rpq4u8hJHwCC5pfggzS+yPy4pmoIDQSGZTbrnQeSecKVflTCl6wQCsupz4mq1ZtK20jOfbyDyH7t 9LJf6QOweZm+sw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#74670] [PATCH] tests: pack: Fix AppImage tests. In-Reply-To: <3f75445c04184678b357e777bfbc5eb751b9f363.1733238317.git.noelopez@free.fr> (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Tue, 3 Dec 2024 16:13:24 +0100") References: <3f75445c04184678b357e777bfbc5eb751b9f363.1733238317.git.noelopez@free.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Thu, 12 Dec 2024 22:59:03 +0100 Message-ID: <87o71g5zrs.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74670 Cc: 74670@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi No=C3=A9, No=C3=A9 Lopez skribis: > From: No=C3=A9 Lopez > > * tests/pack.scm: Add glibc to AppImage tests=E2=80=99 profiles. > > Change-Id: I7890b902f65a2944ae8fa03db8a964deda3c725c > --- > Hi, > > This patch fixes the tests failing for AppImage pack. I believe the issu= e was > that without the AppImage runtime (--appimage-extract-and-run), the glibc= is > not available to the AppRun binary, causing a file not found error. > > This is an issue caused because AppRun is built using the relocatable run= time, > which requires (or at least is built with) the glibc. Hmm, that further limits the applicability of AppImage, but OK. (Not our fault!) I noticed that the tests were not going very far, so I tried the patch below to: (1) check the output of =E2=80=98hello=E2=80=99 in the first test= , (2) change the second test to check for the existence of /var/guix/db/db.sqlite. The second test doesn=E2=80=99t work though, because where=E2=80=99s that f= ile supposed to live? The image is apparently extracted in an unguessable directory, so cannot tell where it is. Am I right? Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/tests/pack.scm b/tests/pack.scm index 2cb643f136..7fcae1ec1f 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -39,9 +39,10 @@ (define-module (test-pack) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) #:use-module ((gnu packages debian) #:select (dpkg)) - #:use-module ((gnu packages guile) #:select (guile-sqlite3)) + #:use-module ((gnu packages guile) #:select (guile-sqlite3 guile-3.0)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module ((gnu packages linux) #:select (fakeroot)) + #:use-module ((ice-9 textual-ports) #:select (get-string-all)) #:use-module (srfi srfi-64)) (define %store @@ -347,7 +348,9 @@ (define rpm-for-tests (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello glibc))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list hello glibc))) (hooks '()) (locales? #f))) (image (self-contained-appimage "hello-appimage" profile @@ -366,34 +369,46 @@ (define rpm-for-tests (lambda (port) (dump-port pipe port))) (exit (status:exit-val (close-pipe pipe))))))))) - (built-derivations (list (pk 'APPIMAGE-drv check))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello, world!\n"))))) (unless store (test-skip 1)) (test-assertm "appimage + localstatedir" (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello glibc))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list guile-3.0 glibc))) (hooks '()) (locales? #f))) - (image (self-contained-appimage "hello-appimage" profile - #:entry-point "bin/hello" + (image (self-contained-appimage "guile-appimage" profile + #:entry-point "bin/guile" #:localstatedir? #t #:extra-options '(#:relocatable? #t))) (check (gexp->derivation - "check-appimage" - (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))))) + "check-appimage-with-localstatedir" + #~(begin + (system* #$image "--appimage-extract-and-run" "-c" + (object->string + `(call-with-output-file #$output + (lambda (port) + (display "Hello from Guile!\n" + port))))) + (execl #$image #$image "--appimage-extract-and-run" "-c" + (object->string + '(exit + (pk 'db? (getcwd) + (file-exists? "var/guix/db/db.sqlite"))))))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello from Guile!\n"))))) (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 18 18:59:23 2024 Received: (at 74670) by debbugs.gnu.org; 18 Dec 2024 23:59:23 +0000 Received: from localhost ([127.0.0.1]:36479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO3wo-0000wT-VM for submit@debbugs.gnu.org; Wed, 18 Dec 2024 18:59:23 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:50123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO3wk-0000w5-UW for 74670@debbugs.gnu.org; Wed, 18 Dec 2024 18:59:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HRPsQVDQCdm8Sm8odUKj6aH+pB9nMFPO2g4UhKo+ML8=; b=bvfMz2pexM5q2bR0jikoWXZjPM S7rZC12O9BPT4OXrLY+rZ8AShZJXfeQUE4KDySey013yD1hFOT6tUeRgvSHSCVHIwWiIsZudhCrlu 8qACJm7Fs1F+saMFCjVxtzsi4QLNHcDkkies9XllqjFh3v0am208jPP71tZhFIVbWQUv8CN089G1F jOJqksAVtGfTjZamQtDEFP6DGe1MRtuAR3lspUSLv3R8OLllmdUjY3b8JKsqkGSu+wjQe0IVVznbh 6j+ZQbSHSxN4PdRGnWkCb2k4Hie2y2yTalGs8zhC1pfyw3vngGBAQ5YOSh2+XFApUAJpd+DuIhuxu DdiYYmig==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tO3uX-00CMKi-0H; Thu, 19 Dec 2024 00:57:01 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74670 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Noé Lopez Hi, Thanks you very much for working on the tests, I should have spent more time on them myself. > I noticed that the tests were not going very far, so I tried the patch > below to: (1) check the output of ‘hello’ in the first test, (2) change > the second test to check for the existence of /var/guix/db/db.sqlite. > > The second test doesn’t work though, because where’s that file supposed > to live? The image is apparently extracted in an unguessable directory, > so cannot tell where it is. Am I right? Yes, --appimage-extract-and-run uses a temporary directory but you can use --appimage-extract which always places the contents in ./squashfs-root. The other reason the test did not work is because the localstatedir option wasn’t supported to begin with, this is an oversight that I could have avoided. I’m sending a second version with the localstatedir support and your updated tests. Thanks, Noé Noé Lopez (2): pack: Support localstatedir in AppImage format. build: pack: Fix unexpected type in assert-utf8-local. guix/build/pack.scm | 2 +- guix/scripts/pack.scm | 13 ++++++++++- tests/pack.scm | 51 ++++++++++++++++++++++++++++--------------- 3 files changed, 46 insertions(+), 20 deletions(-) base-commit: bb8a6f0ac47296d3a18e1e0a26ea3a833eb77c4a prerequisite-patch-id: f3798629973582541e158d322c1a461038c657b8 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 18 19:00:49 2024 Received: (at 74670) by debbugs.gnu.org; 19 Dec 2024 00:00:50 +0000 Received: from localhost ([127.0.0.1]:36489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO3yD-00016t-EW for submit@debbugs.gnu.org; Wed, 18 Dec 2024 19:00:49 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:56275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO3yB-00016d-Qy for 74670@debbugs.gnu.org; Wed, 18 Dec 2024 19:00:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=q3phKICaYVo+VkNOI0zbut4jpHPWsvJy3+SCbDLOjLw=; b=P /l2BlW8IUfdIv8dfKdJz0NLh08p8EMTh+x8E/xoFKorOaYBniKPpRps81eT6FO33eyik6ZLTj4oXI 7zAqgma0GmgzLDIF9Yoxaj0xPJnQWuCG4jNjFWwWE+TjMBkn9gLqxo28nKg/DAkNNoVpHMFbhlb5D 6PCJ6+gQWxHC4n9vZa10LZC1SwZytrm0eyusIKhi+iJ7GvswWM4JSIlM9fyvHJygAEH/8s8/M4Zzg 6QTmJbdQuSayPwXQErrcDMk2b8dU4j4MfQnQBmFhz234NtgJwE0QqvRUh464ukAaYxvvgLCgyb1pK xkDyvn8PHOJoGbnc6jxuLBrGpXOLUS5pw==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tO3vz-00CMYy-QK; Thu, 19 Dec 2024 00:58:31 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74670 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Noé Lopez From: Noé Lopez * guix/scripts/pack.scm (self-contained-appimage): Support localstatedir option. * tests/pack.scm: Update tests. Change-Id: Ibf4758db890b2db0cff4b663fed6564015e347d1 --- guix/scripts/pack.scm | 13 ++++++++++- tests/pack.scm | 51 ++++++++++++++++++++++++++++--------------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 58cd55b129..61e2da12e7 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -1018,15 +1018,22 @@ (define* (self-contained-appimage name profile compressor-name %valid-compressors))) + (define database + (and localstatedir? + (file-append (store-database (list profile)) + "/db/db.sqlite"))) + (define builder (with-extensions (list guile-gcrypt) (with-imported-modules (source-module-closure '((guix build store-copy) - (guix build utils)) + (guix build utils) + (gnu build install)) #:select? not-config?) #~(begin (use-modules (guix build utils) (guix build store-copy) + (gnu build install) (rnrs io ports) (srfi srfi-1) (srfi srfi-26)) @@ -1060,6 +1067,10 @@ (define* (self-contained-appimage name profile (string-append appdir "/" #$name ".desktop") #:name #$name #:exec #$entry-point) + ;; Install database and gc roots. + (when #+database + ;; Initialize /var/guix. + (install-database-and-gc-roots appdir #+database profile)) ;; Compress the AppDir. (invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir squashfs "-root-owned" "-noappend" diff --git a/tests/pack.scm b/tests/pack.scm index 2cb643f136..00a8e250ed 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -39,9 +39,10 @@ (define-module (test-pack) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) #:use-module ((gnu packages debian) #:select (dpkg)) - #:use-module ((gnu packages guile) #:select (guile-sqlite3)) + #:use-module ((gnu packages guile) #:select (guile-sqlite3 guile-3.0)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module ((gnu packages linux) #:select (fakeroot)) + #:use-module ((ice-9 textual-ports) #:select (get-string-all)) #:use-module (srfi srfi-64)) (define %store @@ -347,7 +348,9 @@ (define rpm-for-tests (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello glibc))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list hello glibc))) (hooks '()) (locales? #f))) (image (self-contained-appimage "hello-appimage" profile @@ -366,34 +369,46 @@ (define rpm-for-tests (lambda (port) (dump-port pipe port))) (exit (status:exit-val (close-pipe pipe))))))))) - (built-derivations (list (pk 'APPIMAGE-drv check))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello, world!\n"))))) (unless store (test-skip 1)) (test-assertm "appimage + localstatedir" (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello glibc))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list guile-3.0 glibc))) (hooks '()) (locales? #f))) - (image (self-contained-appimage "hello-appimage" profile - #:entry-point "bin/hello" + (image (self-contained-appimage "guile-appimage" profile + #:entry-point "bin/guile" #:localstatedir? #t #:extra-options '(#:relocatable? #t))) (check (gexp->derivation - "check-appimage" - (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))))) + "check-appimage-with-localstatedir" + #~(begin + (system* #$image "--appimage-extract-and-run" "-c" + (object->string + `(call-with-output-file #$output + (lambda (port) + (display "Hello from Guile!\n" + port))))) + (execl #$image #$image "--appimage-extract" "-c" + (object->string + '(exit + (pk 'db? (getcwd) + (file-exists? "squashfs-root/var/guix/db/db.sqlite"))))))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello from Guile!\n"))))) (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 18 19:22:02 2024 Received: (at 74670) by debbugs.gnu.org; 19 Dec 2024 00:22:02 +0000 Received: from localhost ([127.0.0.1]:36528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO4Ij-0002BO-Eq for submit@debbugs.gnu.org; Wed, 18 Dec 2024 19:22:02 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:59327) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO4Ig-0002B1-VX for 74670@debbugs.gnu.org; Wed, 18 Dec 2024 19:22:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=F6j2OenFbnCBkoMRfn6itYHoHriW7kr0pzkt9pbZE8A=; b=OL1/ronUtappJYPCtryYN5Eb2V vG8T8sMss04siOrZn/sIOojqG2tIGAbGWsl/b7+LdWfTlgzJ7NH3FJwqpK9PlNpciYso4ex3Bn/Fc L+vG2IlQOFuFq6ShVFo2k/0Q1i3N61v2xHnCIZU/Kf5FsDmq5J49vcqeSP1oWBPL40EwdzTZP9YUw w8nD7E14IiP09b7t0fXHwJKbbcWYAbJM8M45xRWaMUX8bVHR4uf9DxgKBA7nEm8FRGt4EXCVBBC36 3CBLaGK2nTvxamohA3jF0O96UVD17OVZg4CNVREgyc3+TqRV9ZLQf5KXxHwJHesOIbNDRgk4qdo6p yFzwa43g==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tO4Ib-00CPhh-1f; Thu, 19 Dec 2024 01:21:53 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 74670@debbugs.gnu.org Subject: [PATCH v3 0/2] tests: pack: Fix AppImage tests. Date: Thu, 19 Dec 2024 01:23:01 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-CC: Ludovic Courtès Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74670 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Noé Lopez (messed up git in v2) Hi, Thanks you very much for working on the tests, I should have spent more time on them myself. > I noticed that the tests were not going very far, so I tried the patch > below to: (1) check the output of ‘hello’ in the first test, (2) change > the second test to check for the existence of /var/guix/db/db.sqlite. > > The second test doesn’t work though, because where’s that file supposed > to live? The image is apparently extracted in an unguessable directory, > so cannot tell where it is. Am I right? Yes, --appimage-extract-and-run uses a temporary directory but you can use --appimage-extract which always places the contents in ./squashfs-root. The other reason the test did not work is because the localstatedir option wasn’t supported to begin with, this is an oversight that I could have avoided by knowing what I was doing. I’m sending a second version with the localstatedir support and your updated tests. Thanks, Noé Noé Lopez (2): pack: Support localstatedir in AppImage format. tests: pack: Improve AppImage tests. guix/scripts/pack.scm | 13 +++++++++- tests/pack.scm | 60 +++++++++++++++++++++++++++++++++---------- 2 files changed, 58 insertions(+), 15 deletions(-) base-commit: 1a62f687e504c67f26693f3bc60a90e503ab4ea9 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 18 19:22:07 2024 Received: (at 74670) by debbugs.gnu.org; 19 Dec 2024 00:22:07 +0000 Received: from localhost ([127.0.0.1]:36531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO4Ip-0002C2-2z for submit@debbugs.gnu.org; Wed, 18 Dec 2024 19:22:07 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:41233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO4In-0002BD-H3 for 74670@debbugs.gnu.org; Wed, 18 Dec 2024 19:22:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=7MpDuXpGYIEpbbqNG1QCrmCNBR+PKZUG5gD02OD9aLQ=; b=n oqeHkeKAZySEYRHad22VYOJk6fR1il3xRWB2D7Iennd7mqx/lHqajOQJmLbiyY+/wSJW3+7tUSJpW KKhkpgUZWZbYZhGuw/EKOKUX0d7Hf3VAMI/QJNWewotVCAuh7ckgkk70VczRBqfjoBa3Ni3wvQJYT RGsCO6+xzJ79eS2NGxEU15ir5K7Cj4yYfL0DTYM1pF1QLR3mjQDimkb+mjerWu1FryuMWWm13zeQs ccfLUX1zfhXcs8dwpTZJ3vKxajgxU62icUjW861fQu14ldQKcxV7puM9FmBV7csshQdYp3o0ofoqE hGTWZCImwDjyRFWMkUtV351q6gZVjwhyg==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tO4Ih-00CPhh-FZ; Thu, 19 Dec 2024 01:21:59 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 74670@debbugs.gnu.org Subject: [PATCH v3 1/2] pack: Support localstatedir in AppImage format. Date: Thu, 19 Dec 2024 01:23:02 +0100 Message-ID: <91137c795a6d4ac347893a7388fba240962225ef.1734566923.git.noelopez@free.fr> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-CC: Ludovic Courtès X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74670 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Noé Lopez * guix/scripts/pack.scm (self-contained-appimage): Support localstatedir option. Change-Id: I296b3d3e442aa90f36de62a9b23aba4a2c3de9a0 --- guix/scripts/pack.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index d0e66c3013..7f5a5f2aa7 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -1018,15 +1018,22 @@ (define* (self-contained-appimage name profile compressor-name %valid-compressors))) + (define database + (and localstatedir? + (file-append (store-database (list profile)) + "/db/db.sqlite"))) + (define builder (with-extensions (list guile-gcrypt) (with-imported-modules (source-module-closure '((guix build store-copy) - (guix build utils)) + (guix build utils) + (gnu build install)) #:select? not-config?) #~(begin (use-modules (guix build utils) (guix build store-copy) + (gnu build install) (rnrs io ports) (srfi srfi-1) (srfi srfi-26)) @@ -1060,6 +1067,10 @@ (define* (self-contained-appimage name profile (string-append appdir "/" #$name ".desktop") #:name #$name #:exec #$entry-point) + ;; Install database and gc roots. + (when #+database + ;; Initialize /var/guix. + (install-database-and-gc-roots appdir #+database profile)) ;; Compress the AppDir. (invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir squashfs "-root-owned" "-noappend" -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 18 19:22:13 2024 Received: (at 74670) by debbugs.gnu.org; 19 Dec 2024 00:22:13 +0000 Received: from localhost ([127.0.0.1]:36534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO4Iu-0002CK-DY for submit@debbugs.gnu.org; Wed, 18 Dec 2024 19:22:12 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:45471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO4Ip-0002Bc-CQ for 74670@debbugs.gnu.org; Wed, 18 Dec 2024 19:22:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=nDMMbeuBcHQ7jtu87PmbEm7tUXhID5o/acnNvAP3uE4=; b=o RI4ueF45mlF3Jh8n9dU95WTTG6NHAd5x2uuNoBXWl34FoC8zcv73emx5TnF7oKv43EHU24Std0WB0 E0NSg3FLLU16V5Tq0LgqZlxcPI+0kWKctrQ+tKZ4Dfu37qEr067xzAZRWGebbS+Ev6ruXPWq3pKqj 37ZNfRrIfbxNlHI+8oA3JfUH5lxIF9OpmWyOVbbdYAuNvddkYSV4IqabO7J1XkAxJgnhLFloaE3yR RDuSFlvcBXbtxL2NDjNCOjGeeP5HM9vMhz/cWYX0UJ0H5D8GkhdEOabmeASJxPQty7Wx7O0bnKRuq Jnv6krLxflceN2S8R3AN0XkJVJSLmAbKg==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tO4Ij-00CPhh-N2; Thu, 19 Dec 2024 01:22:01 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 74670@debbugs.gnu.org Subject: [PATCH v3 2/2] tests: pack: Improve AppImage tests. Date: Thu, 19 Dec 2024 01:23:03 +0100 Message-ID: <7faf45d433e43621cbf3194f306e0177d21679f2.1734566923.git.noelopez@free.fr> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-CC: Ludovic Courtès Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74670 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) From: Noé Lopez * tests/pack.scm: Improve AppImage tests. Change-Id: I7890b902f65a2944ae8fa03db8a964deda3c725c --- tests/pack.scm | 60 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/tests/pack.scm b/tests/pack.scm index 1c1e312557..4eac98fbdd 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 +;;; Copyright © 2017-2021, 2023, 2024 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2023 Oleg Pykhalov @@ -34,14 +34,15 @@ (define-module (test-pack) #:use-module ((guix build utils) #:select (%store-directory)) #:use-module (gnu packages) #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target - hello)) + hello glibc)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) #:use-module ((gnu packages debian) #:select (dpkg)) - #:use-module ((gnu packages guile) #:select (guile-sqlite3)) + #:use-module ((gnu packages guile) #:select (guile-sqlite3 guile-3.0)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module ((gnu packages linux) #:select (fakeroot)) + #:use-module ((ice-9 textual-ports) #:select (get-string-all)) #:use-module (srfi srfi-64)) (define %store @@ -347,36 +348,67 @@ (define rpm-for-tests (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list hello glibc))) (hooks '()) (locales? #f))) (image (self-contained-appimage "hello-appimage" profile #:entry-point "bin/hello" #:extra-options - (list #:relocatable? #t))) + '(#: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))))))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello, world!\n"))))) (unless store (test-skip 1)) (test-assertm "appimage + localstatedir" (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list guile-3.0 glibc))) (hooks '()) (locales? #f))) - (image (self-contained-appimage "hello-appimage" profile - #:entry-point "bin/hello" + (image (self-contained-appimage "guile-appimage" profile + #:entry-point "bin/guile" #:localstatedir? #t #:extra-options - (list #:relocatable? #t))) + '(#:relocatable? #t))) (check (gexp->derivation - "check-appimage" + "check-appimage-with-localstatedir" #~(begin - (invoke #$image))))) - (built-derivations (list check)))) + (system* #$image "--appimage-extract-and-run" "-c" + (object->string + `(call-with-output-file #$output + (lambda (port) + (display "Hello from Guile!\n" + port))))) + (execl #$image #$image "--appimage-extract" + (object->string + '(exit + (pk 'db? (getcwd) + (file-exists? "squashfs-root/var/guix/db/db.sqlite"))))))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello from Guile!\n"))))) (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 23 13:37:45 2024 Received: (at 74670) by debbugs.gnu.org; 23 Dec 2024 18:37:46 +0000 Received: from localhost ([127.0.0.1]:56177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPnJJ-0003mA-KJ for submit@debbugs.gnu.org; Mon, 23 Dec 2024 13:37:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPnJH-0003lw-9o for 74670@debbugs.gnu.org; Mon, 23 Dec 2024 13:37:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPnJB-00042s-Ji; Mon, 23 Dec 2024 13:37:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=ZJPKI+XdLC2W6VtOcEmAR7bCscUaIrgYikeI+J20FG0=; b=rNPaer63eSIfRV5N2+B6 axM8ALI4SmJP9g0DVrf5LleD/c52UrSzORXSJ9Ku0XgAH6QvlSonzky9uyHX8JXc6+VeTzNx46cA0 ovgtxAy+4dHam8cIT/oazgWtx9Vp4DQY9nVtVJnIBsTBdxAX4s/69NELLIjyyyHBHDST7EFV9VaR3 zvvKdkl2x7IRa/R+z5b7c9x3kQlg6puvbOu+MApLKCoOcUwSImBtscJ0WX5npuMe9L4rtojYcY621 oKs7OC7Rp3QLbzB48LYfR2FwFPGmSDCYJ8A9q5mzPQSX3D/XP1HzvPF/CeBwgy6eTHgKsNeAix/7w fu6BPHTneFkoTA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#74670] [PATCH v3 2/2] tests: pack: Improve AppImage tests. In-Reply-To: <7faf45d433e43621cbf3194f306e0177d21679f2.1734566923.git.noelopez@free.fr> (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Thu, 19 Dec 2024 01:23:03 +0100") References: <7faf45d433e43621cbf3194f306e0177d21679f2.1734566923.git.noelopez@free.fr> Date: Mon, 23 Dec 2024 19:37:34 +0100 Message-ID: <87bjx26ya9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74670 Cc: 74670@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi No=C3=A9, No=C3=A9 Lopez skribis: > From: No=C3=A9 Lopez > > * tests/pack.scm: Improve AppImage tests. > > Change-Id: I7890b902f65a2944ae8fa03db8a964deda3c725c [...] > + (system* #$image "--appimage-extract-and-run" "-c" > + (object->string > + `(call-with-output-file #$output > + (lambda (port) > + (display "Hello from Guile!\n" > + port))))) > + (execl #$image #$image "--appimage-extract" > + (object->string > + '(exit > + (pk 'db? (getcwd) > + (file-exists? "squashfs-root/var/gu= ix/db/db.sqlite"))))))))) The second part here does nothing: you can place any other file name and it still exits successfully. Looking at an strace, I think =E2=80=98--appimage-extract=E2=80=99 does nex= t to nothing: essentially it reads /proc/self/exe, create an empty =E2=80=9Csquashfs-root= =E2=80=9D directory, and exits. Could you check exactly what=E2=80=99s happening? We=E2=80=99re getting really close! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 23 15:25:12 2025 Received: (at 74670) by debbugs.gnu.org; 23 Jan 2025 20:25:12 +0000 Received: from localhost ([127.0.0.1]:42534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tb3lH-0002nb-T2 for submit@debbugs.gnu.org; Thu, 23 Jan 2025 15:25:12 -0500 Received: from smtp.domeneshop.no ([2a01:5b40:0:3006::1]:34496) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tb3lE-0002h8-DK for 74670@debbugs.gnu.org; Thu, 23 Jan 2025 15:25:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vVWM/joJbozUIX3p7ymG3cBVosLo8zHN9UqYKLqIEPs=; b=iiJ5OMm897e7xq5oukCY4XP/hh uf/yEg7A0NuvOdXJTXcd4srvlXJRlJYb6Mgarj5FOVHX+YFDXGK6uJZcoCOMSy7Q8kYFfZ18q0g4w pE4K1TJ0oJWBQOKf3FSnvVVRWfd+RGHhauP0lI0VC16YKLo36NnQbfJJFO2phHiHStYn1WiA9X/Wo S9lb8q2MiLauSTlZR0J6RmOSe1eAgRNB/pwPnfEPiHtWzP6/EbTDcRM7NiAY6E7DkrcOpuecXpvum 34U/aqDctJgh5xw3A11u1NpWLa4DhM3D+bf7MJ3W5NtyUiVf2UJIwRRUyVHY3ZY03Rdj7Q2bePy8S aIOPd27A==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tb3l5-00GLpR-LT; Thu, 23 Jan 2025 21:24:59 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 74670@debbugs.gnu.org Subject: [PATCH v4 0/2] tests: pack: Fix AppImage tests. Date: Thu, 23 Jan 2025 21:26:23 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Ludovic Courtès Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 74670 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) From: Noé Lopez Hi, Here is a working version of the tests, though I don’t really understand why the tests are GEXPs? What is the point of using #$output and checking outside of the gexp instead of just using assert? And why do I need to use #$output in order for the test to run? Thanks, Noé Noé Lopez (2): pack: Support localstatedir in AppImage format. tests: pack: Improve AppImage tests. guix/scripts/pack.scm | 13 +++++++++- tests/pack.scm | 58 ++++++++++++++++++++++++++++++++----------- 2 files changed, 56 insertions(+), 15 deletions(-) base-commit: 1a62f687e504c67f26693f3bc60a90e503ab4ea9 -- 2.47.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 23 15:25:19 2025 Received: (at 74670) by debbugs.gnu.org; 23 Jan 2025 20:25:20 +0000 Received: from localhost ([127.0.0.1]:42537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tb3lP-0002o7-Gt for submit@debbugs.gnu.org; Thu, 23 Jan 2025 15:25:19 -0500 Received: from smtp.domeneshop.no ([2a01:5b40:0:3006::1]:42060) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tb3lN-0002nZ-Cs for 74670@debbugs.gnu.org; Thu, 23 Jan 2025 15:25:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=MPfqXGh/LK4msJSM9od0Gd9M4Pkhar23Kwj5PfUNDl8=; b=L HLZ9woVVfnZ9wZvx7l2Ihv354sJwhBweuNvX+uOdASS97DCmeVZbnF1sQ7EDUeo2MhygWcXLvCCKW 6GPSn/QPUt4snvm44CNfQMJ4rlIHb07Yf45/bhMz0XB6ncT7a9jVL9U/3l+vzMzo0Vws2IStE5KPQ aeC8b5ZgxMOIwUPHilbznhKFy1GYGNNPvGOe+YMQ8gE2MduQNNh+733ZJyhEEdJh7/RBJ+q3M25eI /+1fHZDYKqk676ZpxOw9VFMSy5ywev9Fwafa2PWeZR8kfGKDaqOvuPCC2BBp1nJYjZzboqYEp3lHk uYNZhAZtjNG5f4RPHzlgMrfHoK8JnMrMg==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tb3lH-00GLpR-8r; Thu, 23 Jan 2025 21:25:11 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 74670@debbugs.gnu.org Subject: [PATCH v4 1/2] pack: Support localstatedir in AppImage format. Date: Thu, 23 Jan 2025 21:26:24 +0100 Message-ID: <91137c795a6d4ac347893a7388fba240962225ef.1737663530.git.noelopez@free.fr> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Ludovic Courtès X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 74670 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) From: Noé Lopez * guix/scripts/pack.scm (self-contained-appimage): Support localstatedir option. Change-Id: I296b3d3e442aa90f36de62a9b23aba4a2c3de9a0 --- guix/scripts/pack.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index d0e66c3013..7f5a5f2aa7 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -1018,15 +1018,22 @@ (define* (self-contained-appimage name profile compressor-name %valid-compressors))) + (define database + (and localstatedir? + (file-append (store-database (list profile)) + "/db/db.sqlite"))) + (define builder (with-extensions (list guile-gcrypt) (with-imported-modules (source-module-closure '((guix build store-copy) - (guix build utils)) + (guix build utils) + (gnu build install)) #:select? not-config?) #~(begin (use-modules (guix build utils) (guix build store-copy) + (gnu build install) (rnrs io ports) (srfi srfi-1) (srfi srfi-26)) @@ -1060,6 +1067,10 @@ (define* (self-contained-appimage name profile (string-append appdir "/" #$name ".desktop") #:name #$name #:exec #$entry-point) + ;; Install database and gc roots. + (when #+database + ;; Initialize /var/guix. + (install-database-and-gc-roots appdir #+database profile)) ;; Compress the AppDir. (invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir squashfs "-root-owned" "-noappend" -- 2.47.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 23 15:25:25 2025 Received: (at 74670) by debbugs.gnu.org; 23 Jan 2025 20:25:25 +0000 Received: from localhost ([127.0.0.1]:42540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tb3lU-0002oS-V9 for submit@debbugs.gnu.org; Thu, 23 Jan 2025 15:25:25 -0500 Received: from smtp.domeneshop.no ([2a01:5b40:0:3006::1]:42068) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tb3lP-0002np-NN for 74670@debbugs.gnu.org; Thu, 23 Jan 2025 15:25:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xn--no-cja.eu; s=ds202402; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=MYBBMMkX2Z5pIkS6y8e8hkgB+PZymmFet5NATy3Y+fI=; b=1 UoTJ2Fv8XBHPl4TsiZfbU5B6WmdoK65iVBJXne2tp/HNAqi38114FBF53BKJCLQpdte9Lpl4A6tDW qPCMuo5ECnU+cDqF1UDDaBL6w8uu3fcFr6PFAmWpEwaao7skdcM82PiEQ9q1Z4dxw2VZBM0Tf2WpL p/ktLXcKOJxAEN2pRCaaWltd/zQ0Ysl7KO5rYYlHJmVwPfBk+RJ6i2Zkv8LBjjNkI2nAapGg2OiHO YS5It8+su2R3TG8V5ZLOxjMrQEXK32m5CsftoOb8BneWDkdULWko5YI7p8iCtsYPbj+VYMyo8Nxvn NFX3Bs2Qt3lXkEve/7RIsT2rsQTn2Vp/w==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tb3lJ-00GLpR-Ic; Thu, 23 Jan 2025 21:25:13 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 74670@debbugs.gnu.org Subject: [PATCH v4 2/2] tests: pack: Improve AppImage tests. Date: Thu, 23 Jan 2025 21:26:25 +0100 Message-ID: <69864d44556801ee3bbf636425be69e2346a78ae.1737663530.git.noelopez@free.fr> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Ludovic Courtès Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 74670 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) From: Noé Lopez * tests/pack.scm: Improve AppImage tests. Change-Id: I7890b902f65a2944ae8fa03db8a964deda3c725c --- tests/pack.scm | 58 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/tests/pack.scm b/tests/pack.scm index 1c1e312557..1651fa4440 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 +;;; Copyright © 2017-2021, 2023, 2024 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2023 Oleg Pykhalov @@ -34,14 +34,15 @@ (define-module (test-pack) #:use-module ((guix build utils) #:select (%store-directory)) #:use-module (gnu packages) #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target - hello)) + hello glibc)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) #:use-module ((gnu packages debian) #:select (dpkg)) - #:use-module ((gnu packages guile) #:select (guile-sqlite3)) + #:use-module ((gnu packages guile) #:select (guile-sqlite3 guile-3.0)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) #:use-module ((gnu packages linux) #:select (fakeroot)) + #:use-module ((ice-9 textual-ports) #:select (get-string-all)) #:use-module (srfi srfi-64)) (define %store @@ -347,36 +348,65 @@ (define rpm-for-tests (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list hello glibc))) (hooks '()) (locales? #f))) (image (self-contained-appimage "hello-appimage" profile #:entry-point "bin/hello" #:extra-options - (list #:relocatable? #t))) + '(#: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))))))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello, world!\n"))))) (unless store (test-skip 1)) (test-assertm "appimage + localstatedir" (mlet* %store-monad ((guile (set-guile-for-build (default-guile))) (profile -> (profile - (content (packages->manifest (list %bootstrap-guile hello))) + ;; When using '--appimage-extract-and-run', the dynamic + ;; linker is necessary, hence glibc below. + (content (packages->manifest (list guile-3.0 glibc))) (hooks '()) (locales? #f))) - (image (self-contained-appimage "hello-appimage" profile - #:entry-point "bin/hello" + (image (self-contained-appimage "guile-appimage" profile + #:entry-point "bin/guile" #:localstatedir? #t #:extra-options - (list #:relocatable? #t))) + '(#:relocatable? #t))) (check (gexp->derivation - "check-appimage" + "check-appimage-with-localstatedir" #~(begin - (invoke #$image))))) - (built-derivations (list check)))) + (use-modules (rnrs base)) + (system* #$image "--appimage-extract-and-run" "-c" + (object->string + `(call-with-output-file #$output + (lambda (port) + (display "Hello from Guile!\n" + port))))) + (system* #$image "--appimage-extract") + (assert (file-exists? "squashfs-root/var/guix/db/db.sqlite")))))) + (mbegin %store-monad + (built-derivations (list (pk 'APPIMAGE-drv check))) + (return (string=? (call-with-input-file (derivation->output-path check) + get-string-all) + "Hello from Guile!\n"))))) (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" -- 2.47.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 24 17:52:49 2025 Received: (at 74670-done) by debbugs.gnu.org; 24 Jan 2025 22:52:49 +0000 Received: from localhost ([127.0.0.1]:47398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tbSXh-0008Se-1n for submit@debbugs.gnu.org; Fri, 24 Jan 2025 17:52:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54616) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tbSXe-0008SN-Hg for 74670-done@debbugs.gnu.org; Fri, 24 Jan 2025 17:52:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbSXX-0006A2-48; Fri, 24 Jan 2025 17:52:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=0ifhQxcfQz4iULv4hQyelZbmyT1tlt4vxrXOUFVNMVE=; b=g+4T/oBrhszOH9vfdtuS MzvJsmfTDWyGkFW3y4zu7rb6j7bSvON+yGvVqsrTjHwxNQTEbgzI1iteK5qgFBMrZbwM1jLE0CbGX VzVOlpHKPZd4IfKCRoT1aicb7695q8lUBSzodPdAkLMOhoatZH08pFH28UavJrmP7wxgGY65knPFx wZN/RwHoQto8GL9RN589eT66iJO+05aDvXn3lWmrvuxz5R6eC9enfVaOvEXHtuqM3dkJk40Hz7/zh Ed5FlgSIDGQISOOzcsR6Hg1g82Q6GHPszBPCHMsYAYq+bSwMfQE9AQ8haNKhCEz/NYHEurpJr9qCc SqZI/ql3I8mvcw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#74670] [PATCH v4 0/2] tests: pack: Fix AppImage tests. In-Reply-To: (=?utf-8?Q?=22No?= =?utf-8?Q?=C3=A9?= Lopez"'s message of "Thu, 23 Jan 2025 21:26:23 +0100") References: <3f75445c04184678b357e777bfbc5eb751b9f363.1733238317.git.noelopez@free.fr> Date: Fri, 24 Jan 2025 23:52:35 +0100 Message-ID: <87cygbddu4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74670-done Cc: 74670-done@debbugs.gnu.org, =?utf-8?Q?No=C3=A9?= Lopez X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, No=C3=A9 Lopez skribis: > Here is a working version of the tests, though I don=E2=80=99t really und= erstand why > the tests are GEXPs? The tests build derivations, each of which runs Guile code; that Guile code is represented as gexps because it is staged to be executed when those derivations get built. > What is the point of using #$output and checking outside of the gexp inst= ead > of just using assert? And why do I need to use #$output in order for the = test > to run? If you do (gexp->derivation "foo" #~(display "hi!")), you end up with a derivation with zero outputs. In that case, its builder is never executed because we know in advance that it won=E2=80=99t produce anything. If you do (gexp->derivation "bar" #~(pk #$output)), then the resulting derivation has one output, =E2=80=9Cout=E2=80=9D. > pack: Support localstatedir in AppImage format. > tests: pack: Improve AppImage tests. Applied with the cosmetic change below. Thanks! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/tests/pack.scm b/tests/pack.scm index 1651fa4440..9c7e0a50ba 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -393,7 +393,6 @@ (define rpm-for-tests (check (gexp->derivation "check-appimage-with-localstatedir" #~(begin - (use-modules (rnrs base)) (system* #$image "--appimage-extract-and-run" "-c" (object->string `(call-with-output-file #$output @@ -401,7 +400,7 @@ (define rpm-for-tests (display "Hello from Guile!\n" port))))) (system* #$image "--appimage-extract") - (assert (file-exists? "squashfs-root/var/guix/db/db.sqlite")))))) + (exit (file-exists? "squashfs-root/var/guix/db/db.sqlite")))))) (mbegin %store-monad (built-derivations (list (pk 'APPIMAGE-drv check))) (return (string=? (call-with-input-file (derivation->output-path check) --=-=-=-- From unknown Tue Jun 17 03:39:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 22 Feb 2025 12:24:31 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator