From patchwork Thu Dec 12 21:59:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 34849 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E125727BBEA; Thu, 12 Dec 2024 22:00:43 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6092827BBEB for ; Thu, 12 Dec 2024 22:00:41 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLrE9-0000Pv-TK; Thu, 12 Dec 2024 17:00:09 -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 1tLrE3-0000Pg-TM for guix-patches@gnu.org; Thu, 12 Dec 2024 17:00:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLrE3-0003oq-Lo for guix-patches@gnu.org; Thu, 12 Dec 2024 17:00:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=LsYtjaKozU0lSI/faQkP3e8MzgqR9itQeMSZbZG9xVk=; b=iV7QTAp29OXTNe9KwJyT4Lf0+QjNop0lBA7MMLRMS5oLeZL+8wsmEuP3HoTlq5p3a/5Ujt6Vk769umy4c0ldFl/ACvaW2EISXxzBYKVXcoDIjjaayfNuTDnGypknefhpv0+K1rD6is5VImdl3UN9t8A04zaLP/KS5Lh+3U3ZmezImbi4dtlYwqXWeo4pHyjoNPCly37b6mYsNRsown8L+197s1xfsXgeyM0APm+4bH4Z8xvVKvfMMDRItFcP7Y0bcYKweGSOnl4O/IUJxnerBQ3mikjGVT51PLNlFhaGhwo8Hm5fogORgJfKYmmOvAgZjt2ckEPbLcu2c2SmR9nTZg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLrE3-0003Ze-7I for guix-patches@gnu.org; Thu, 12 Dec 2024 17:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74670] [PATCH] tests: pack: Fix AppImage tests. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Dec 2024 22:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74670 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: =?utf-8?q?No=C3=A9?= Lopez Cc: 74670@debbugs.gnu.org Received: via spool by 74670-submit@debbugs.gnu.org id=B74670.173404078113654 (code B ref 74670); Thu, 12 Dec 2024 22:00:03 +0000 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: Ludovic =?utf-8?q?Court=C3=A8s?= In-Reply-To: <3f75445c04184678b357e777bfbc5eb751b9f363.1733238317.git.noelopez@free.fr> (" =?utf-8?q?No=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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hi Noé, Noé Lopez skribis: > 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. 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 ‘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? Thanks, Ludo’. 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"