From unknown Thu Jun 19 13:56:32 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#73842 <73842@debbugs.gnu.org> To: bug#73842 <73842@debbugs.gnu.org> Subject: Status: [PATCH] pack: Add support for AppImage pack format. Reply-To: bug#73842 <73842@debbugs.gnu.org> Date: Thu, 19 Jun 2025 20:56:32 +0000 retitle 73842 [PATCH] pack: Add support for AppImage pack format. reassign 73842 guix-patches submitter 73842 No=C3=A9 Lopez severity 73842 normal tag 73842 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 16 17:51:18 2024 Received: (at submit) by debbugs.gnu.org; 16 Oct 2024 21:51:19 +0000 Received: from localhost ([127.0.0.1]:60741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1BvJ-0007NQ-J6 for submit@debbugs.gnu.org; Wed, 16 Oct 2024 17:51:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:38528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1BvG-0007NG-MU for submit@debbugs.gnu.org; Wed, 16 Oct 2024 17:51:15 -0400 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 1t1Buw-0002lh-56 for guix-patches@gnu.org; Wed, 16 Oct 2024 17:50:54 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1But-0004LA-5H for guix-patches@gnu.org; Wed, 16 Oct 2024 17:50:53 -0400 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:990:a960:b4f3:8f44:ec4:5af5]) by smtp1-g21.free.fr (Postfix) with ESMTP id BE2B4B0053E; Wed, 16 Oct 2024 23:50:43 +0200 (CEST) From: =?UTF-8?q?No=C3=A9=20Lopez?= To: guix-patches@gnu.org Subject: [PATCH] pack: Add support for AppImage pack format. Date: Wed, 16 Oct 2024 23:51:30 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Maxim Cournoyer , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=212.27.42.1; envelope-from=noelopez@free.fr; helo=smtp1-g21.free.fr X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?No=C3=A9=20Lopez?= , =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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.6 (--) From: Sebastian Dümcke * guix/scripts/pack.scm: Add Appimage format. * gnu/packages/appimage.scm (gnu packages appimage): New module. (fuse-for-appimage, squashfuse-for-appimage) (appimage-type2-runtime): New variables. * doc/guix.texi: Document AppImage pack. Co-authored-by: Noé Lopez Change-Id: I09f1241dfb9b267f94dce59914dea527d35ac60e --- Hi, This patch adds a new AppImage export format to « guix pack ». This enables guix users to easily share packets or environments with their peers that don’t have guix via a statically linked, runs-everywhere executable. Sebastian and I co-authored this patch, I did the runtime packaging and Sebastian did the actual command. I’ve personally tested the generated AppImages with my friend’s various distros, they work great! Here are some cool examples to try (in ./pre-inst-env): guix pack -f appimage -R --entry-point=bin/hello hello guix pack -f appimage -R --entry-point=bin/openttd openttd guix pack -f appimage -R --entry-point=bin/torbrowser torbrowser Keep in mind the generated AppImage files don’t have execution permission, so you need to copy them and chmod it :) Have a great day, Noé Lopez doc/guix.texi | 56 +++++++++++- gnu/packages/appimage.scm | 179 ++++++++++++++++++++++++++++++++++++++ guix/scripts/pack.scm | 100 ++++++++++++++++++++- 3 files changed, 333 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/appimage.scm diff --git a/doc/guix.texi b/doc/guix.texi index b91d229d7c..327876c92f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6949,6 +6949,18 @@ Invoking guix pack environment}, using commands like @command{singularity shell} or @command{singularity exec}. +@cindex AppImage, create an AppImage file with guix pack +Another format internally based on SquashFS is +@uref{https://appimage.org/, AppImage}. An AppImage file can be made +executable and run without any special privileges: + +@example +guix pack -f appimage --entry-point=bin/guile guile +cp @var{file} . && chmod u+x $(basename @var{file}) +./$(basename @var{file}) --help +@end example +where @var{file} is the image returned by @command{guix pack}. + Several command-line options allow you to customize your pack: @table @code @@ -7065,6 +7077,48 @@ Invoking guix pack installation or other, non-rpm packs. @end quotation +@item appimage +@cindex AppImage, create an AppImage file with guix pack +This produces an AppImage file with the @samp{.AppImage} extension. +AppImage is a SquashFS volume prefixed with a runtime that mounts the +SquashFS file system and executes the binary provided with +@option{--entry-point}. This results in a self-contained archive that +bundles the software and all its requirements into a single file. When +the file is made executable it runs the packaged software. + +@example +guix pack -f appimage --entry-point=bin/vlc vlc +@end example + +The runtime used by AppImages makes use of libfuse to mount the image +quickly. If libfuse is not available, the AppImage can still be started +using the @option{--appimage-extract-and-run} flag. + +@quotation Warning +Unless @option{--relocatable} is used, the software will contain +references to items inside the guix store, which are not present on +systems without Guix. It is recommended to use @option{--relocatable} +when distributing software to 3rd parties. A warning is printed when +this option is not used. +@end quotation + +@example +guix pack -f appimage --entry-point=bin/hello --relocatable hello +@end example + +@quotation Note +The resulting AppImage does not conform to the complete standard as it +currently does not contain a @code{.DirIcon} file. This does not impact +functionality of the AppImage itself, but possibly that of software used +to manage AppImages. +@end quotation + +@quotation Note +As the generated AppImage packages the complete dependency graph, it +will be larger than comparable AppImage files found online, which depend +on host system libraries. +@end quotation + @end table @cindex relocatable binaries @@ -7155,7 +7209,7 @@ Invoking guix pack @cindex entry point, for Docker and Singularity images @item --entry-point=@var{command} Use @var{command} as the @dfn{entry point} of the resulting pack, if the pack -format supports it---currently @code{docker} and @code{squashfs} (Singularity) +format supports it---currently @code{docker}, @code{appimage} and @code{squashfs} (Singularity) support it. @var{command} must be relative to the profile contained in the pack. diff --git a/gnu/packages/appimage.scm b/gnu/packages/appimage.scm new file mode 100644 index 0000000000..3bf9d84181 --- /dev/null +++ b/gnu/packages/appimage.scm @@ -0,0 +1,179 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Noé Lopez +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages appimage) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages file-systems) + #:use-module (gnu packages linux) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages)) + +(define fuse-for-appimage + (package + (inherit fuse) + (name "fuse") + (version "3.15.0") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/libfuse/libfuse/releases/" + "download/fuse-" + version + "/fuse-" + version + ".tar.xz")) + (sha256 + (base32 "181cx8g40ki8m85j0pjw50kv4h733g08c769db6przqwbvyrqn3h")))) + (arguments + `(#:configure-flags ,#~(list (string-append "-Dudevrulesdir=" + #$output "/udev/rules.d") + "-Duseroot=false" "--default-library=static") + #:tests? #f + #:phases ,#~(modify-phases %standard-phases + (add-after 'unpack 'set-file-names + (lambda* (#:key inputs #:allow-other-keys) + ;; libfuse calls out to mount(8) and umount(8). Make sure + ;; it refers to the right ones. + (substitute* '("lib/mount_util.c") + (("/bin/(u?)mount" _ maybe-u) + (search-input-file inputs + (string-append "bin/" maybe-u + "mount")))) + (substitute* '("util/mount.fuse.c") + (("/bin/sh") + (search-input-file inputs "/bin/sh"))) + + ;; This hack leads libfuse to search for 'fusermount' in + ;; $PATH, where it may find a setuid-root binary, instead of + ;; trying solely $out/sbin/fusermount and failing because + ;; it's not setuid. + (substitute* "lib/meson.build" + (("-DFUSERMOUNT_DIR=[[:graph:]]+") + "-DFUSERMOUNT_DIR=\"/var/empty\"'")))) + (add-after 'unpack 'fix-install + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("util/meson.build") + (("install_helper.sh") + "true")) + (substitute* '("util/meson.build") + (("fuseconf_path = .*") + "fuseconf_path = '/etc/fuse.conf'")))) + (add-before 'configure 'set-paths + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((dummy-init.d (string-append (getcwd) + "/etc/init.d"))) + (setenv "MOUNT_FUSE_PATH" + (string-append #$output "/sbin")) + (setenv "UDEV_RULES_PATH" + (string-append #$output "/lib/udev/rules.d")))))))))) + +(define squashfuse-for-appimage + (let ((revision "0") + (commit "e51978cd6bb5c4d16fae9eee43d0b258f570bb0f")) + (package + (inherit squashfuse) + (name "squashfuse") + (version (git-version "0.1.104" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/vasi/squashfuse") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "02421zsgcvbip5ff999ci4c748zxsc34yycjfp7rq8afrlnlvl29")))) + (arguments + (list + #:configure-flags #~'("CFLAGS=-ffunction-sections -fdata-sections -Os -no-pie" + "LDFLAGS=-static") + #:phases #~(modify-phases %standard-phases + (add-after 'install 'install-private-headers + (lambda _ + (install-file "fuseprivate.h" + (string-append #$output + "/include/squashfuse/"))))))) + (inputs (list fuse-for-appimage + `(,zstd "lib") + `(,zstd "static") + `(,zlib "out") + `(,zlib "static")))))) + +(define-public appimage-type2-runtime + (let ((revision "0") + (commit "47b665594856b4e8928f8932adcf6d13061d8c30")) + (package + (name "appimage-type2-runtime") + (version (git-version "continuous" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/AppImage/type2-runtime") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0954crhlbapxis96g1s0vfpf78ybr64zvjalak387ksxj560g44x")))) + (arguments + (list + #:make-flags #~(list "-Csrc/runtime" "runtime-fuse3" + (string-append "CFLAGS=" + "-I" + #$fuse-2 + "/include/fuse/" + " -DGIT_COMMIT='\"" + "guix-" + #$version + "\"'" + " -D_FILE_OFFSET_BITS=64" + " -static")) + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (replace 'install + (lambda _ + (install-file "src/runtime/runtime-fuse3" + (string-append #$output "/bin")))) + ;; must be after all elf reliant phases + (add-after 'make-dynamic-linker-cache 'set-magic-bytes + (lambda _ + (use-modules (ice-9 binary-ports)) + (let ((port (open (string-append #$output + "/bin/runtime-fuse3") + (logior O_WRONLY)))) + (seek port 8 SEEK_SET) + (put-bytevector port #vu8(#x41 #x49 #x02)) + (close-port port))))) + #:disallowed-references (list squashfuse-for-appimage + fuse-for-appimage zstd zlib))) + ;; only needed at build time + (inputs (list squashfuse-for-appimage fuse-for-appimage + `(,zstd "static") + `(,zlib "static"))) + (build-system gnu-build-system) + (home-page "https://github.com/AppImage/type2-runtime") + (synopsis "Runtime for AppImages") + (description "The runtime is the executable part of every AppImage. It +mounts the payload via FUSE and executes the entrypoint.") + (license license:expat)))) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7c5fe76fe0..f517100fcf 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -10,6 +10,8 @@ ;;; Copyright © 2022 Alex Griffin ;;; Copyright © 2023 Graham James Addis ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Sebastian Dümcke +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -56,6 +58,7 @@ (define-module (guix scripts pack) #:use-module ((gnu packages compression) #:hide (zip)) #:use-module (gnu packages guile) #:use-module (gnu packages base) + #:autoload (gnu packages appimage) (appimage-type2-runtime) #:autoload (gnu packages gnupg) (guile-gcrypt) #:autoload (gnu packages guile) (guile2.0-json guile-json) #:use-module (srfi srfi-1) @@ -64,6 +67,7 @@ (define-module (guix scripts pack) #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:use-module (ice-9 match) + #:use-module (ice-9 optargs) #:export (symlink-spec-option-parser self-contained-tarball @@ -71,6 +75,7 @@ (define-module (guix scripts pack) rpm-archive docker-image squashfs-image + self-contained-appimage %formats guix-pack)) @@ -974,8 +979,96 @@ (define* (rpm-archive name profile (gexp->derivation (string-append name ".rpm") build #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; AppImage format +;;; +(define* (self-contained-appimage name profile + #:key target + (profile-name "guix-profile") + entry-point + (compressor "zstd") + localstatedir? + (symlinks '()) + (archiver tar) + (extra-options '())) + "Return a self-contained AppImage containing a store initialized with the +closure of PROFILE, a derivation. The AppImage contains /gnu/store unless +RELOCATABLE option is used; if LOCALSTATEDIR? is true, it also contains +/var/guix, including /var/guix/db with a properly initialized store database. + +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." + (unless entry-point + (leave (G_ "entry-point must be provided in the '~a' format~%") + 'appimage)) + (let-keywords extra-options #f ((relocatable? #f)) + (unless relocatable? + (warning (G_ "AppImages should be built with the --relocatable flag~%")))) + + (define runtime-package appimage-type2-runtime) + (define runtime-path "bin/runtime-fuse3") + (define %valid-compressors '("gzip" "zstd")) + + (let ((compressor-name (compressor-name compressor))) + (unless (member compressor-name %valid-compressors) + (leave (G_ "~a is not a valid squashfs archive compressor used in +generating the AppImage. Valid compressors are: ~a~%") + compressor-name + %valid-compressors))) - + (define builder + (with-extensions (list guile-gcrypt) + (with-imported-modules (source-module-closure + '((guix build store-copy) + (guix build utils)) + #:select? not-config?) + #~(begin + (use-modules (guix build utils) + (guix build store-copy) + (rnrs io ports) + (srfi srfi-1) + (srfi srfi-26)) + + (define (concatenate result file1 file2) + (let ((p (open-file-output-port result)) + (f1 (open-file-input-port file1)) + (f2 (open-file-input-port file2))) + (put-bytevector p (get-bytevector-all f1)) + (close-port f1) + (put-bytevector p (get-bytevector-all f2)) + (close-port f2) + (close-port p))) + + (let* ((appdir "AppDir") + (squashfs "squashfs") + (profile-items (map store-info-item + (call-with-input-file "profile" read-reference-graph))) + (profile-path (find (cut (file-name-predicate "profile$") <> #f) profile-items))) + (mkdir-p appdir) + ;; copy all store items from the profile to the AppDir + (for-each (lambda (f) + (copy-store-item f appdir)) profile-items) + ;; symlink the provided entry-point to AppDir/AppRun + (symlink (string-append "." profile-path "/" #$entry-point) + (string-append appdir "/AppRun")) + ;; create .desktop file as required by the spec + (make-desktop-entry-file + (string-append appdir "/" #$name ".desktop") + #:name #$name + #:exec #$entry-point) + ;; compress the AppDir + (invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir + squashfs "-root-owned" "-noappend" + "-comp" #+(compressor-name compressor)) + ;; append runtime and squashFS into file AppImage + (concatenate #$output + #$(file-append runtime-package "/" runtime-path) + squashfs)))))) + (gexp->derivation (string-append name ".AppImage") builder + #:target target + #:references-graphs `(("profile" ,profile)))) + ;;; ;;; Compiling C programs. ;;; @@ -1311,6 +1404,7 @@ (define %formats (squashfs . ,squashfs-image) (docker . ,docker-image) (deb . ,debian-archive) + (appimage . ,self-contained-appimage) (rpm . ,rpm-archive))) (define (show-formats) @@ -1327,6 +1421,8 @@ (define (show-formats) deb Debian archive installable via dpkg/apt")) (display (G_ " rpm RPM archive installable via rpm/yum")) + (display (G_ " + appimage AppImage self-contained and executable format")) (newline)) (define (required-option symbol) @@ -1694,6 +1790,8 @@ (define-command (guix-pack . args) (process-file-arg opts 'preun-file) #:postun-file (process-file-arg opts 'postun-file))) + ('appimage + (list #:relocatable? relocatable?)) (_ '()))) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) base-commit: d95588242c605fbb72e25fe36a0903a1538e9018 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 08:21:13 2024 Received: (at 73842) by debbugs.gnu.org; 18 Oct 2024 12:21:13 +0000 Received: from localhost ([127.0.0.1]:37352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1lyi-0004cD-TR for submit@debbugs.gnu.org; Fri, 18 Oct 2024 08:21:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1lyf-0004bx-W0 for 73842@debbugs.gnu.org; Fri, 18 Oct 2024 08:21:10 -0400 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 1t1ly9-00056K-UH; Fri, 18 Oct 2024 08:20:38 -0400 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=FZig0L6nBWXB0UEtObhE8Ki2ZR29UOb0h4fJ2FLmdSY=; b=OfiN5lXbvfhI+IB5xnMX C10KDcpcK9EwBJi9MDM9JEd6e618d0jLpJb+oSzF9YM92A80n6A80lgZZKsJv8KqDAnh3WTXfvCR8 DeVIl811bRJf0pBn8JAJ0xRBR3LMOqAzZqOf6nmogkUsKyjcf1aqWTfQrMFB0tQJG1KA3V0ZdJZWV naoXYnFrSaGDGIeyMRQdY/iM24tmaxggtVKsshbCwSlcx/4MIc6smwLo6lHOKlvWOaJtC4CMWFfAD O5ms9vaPobc1+uPMFO0gho4VNdbKkV0swX5yUcyNdCdR1z1+/INHNO0r51fPOFoQ8KivJS+WiQkGW AeX+0uDeH7K79w==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH] pack: Add support for AppImage pack format. In-Reply-To: (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Wed, 16 Oct 2024 23:51:30 +0200") References: Date: Fri, 18 Oct 2024 14:20:33 +0200 Message-ID: <877ca5r4a6.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: 73842 Cc: Josselin Poiret , 73842@debbugs.gnu.org, Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Sebastian =?utf-8?Q?D=C3=BCmcke?= , Christopher Baines 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 & Sebastian, No=C3=A9 Lopez skribis: > From: Sebastian D=C3=BCmcke > > * guix/scripts/pack.scm: Add Appimage format. > * gnu/packages/appimage.scm > (gnu packages appimage): New module. > (fuse-for-appimage, squashfuse-for-appimage) > (appimage-type2-runtime): New variables. > * doc/guix.texi: Document AppImage pack. > > Co-authored-by: No=C3=A9 Lopez > Change-Id: I09f1241dfb9b267f94dce59914dea527d35ac60e [...] > This patch adds a new AppImage export format to =C2=AB=C2=A0guix pack=C2= =A0=C2=BB. This > enables guix users to easily share packets or environments with their > peers that don=E2=80=99t have guix via a statically linked, runs-everywhe= re > executable. > > Sebastian and I co-authored this patch, I did the runtime packaging > and Sebastian did the actual command. I=E2=80=99ve personally tested the > generated AppImages with my friend=E2=80=99s various distros, they work g= reat! Nice work! Overall looks great to me. What follows are pretty minor suggestions. > +@cindex AppImage, create an AppImage file with guix pack s/guix pack/@command{guix pack}/ > +Another format internally based on SquashFS is > +@uref{https://appimage.org/, AppImage}. An AppImage file can be made ^ Nitpick: please leave two spaces after end-of-sentence periods throughout this patch. > +The resulting AppImage does not conform to the complete standard as it > +currently does not contain a @code{.DirIcon} file. This does not impact s/@code/@file/ > +@quotation Warning > +Unless @option{--relocatable} is used, the software will contain > +references to items inside the guix store, which are not present on > +systems without Guix. It is recommended to use @option{--relocatable} > +when distributing software to 3rd parties. A warning is printed when > +this option is not used. I would it perhaps more upfront, like: When building an AppImage, always @emph{pass} the @option{--relocatable} option (or @option{-R}, or @option{-RR}) to make sure the image can be used on systems where Guix is not installed. In practice, if Guix is installed but the image=E2=80=99s dependencies are = not in the store, it won=E2=80=99t work either. So I think the =E2=80=9Calways= =E2=80=9D bit is not exaggerated. WDYT? > +++ b/gnu/packages/appimage.scm Could you add this file as a separate commit, before the one adding AppImage support to =E2=80=98guix pack=E2=80=99? > + (arguments > + `(#:configure-flags ,#~(list (string-append "-Dudevrulesdir=3D" > + #$output "/udev/rules.d= ") > + "-Duseroot=3Dfalse" "--default-library= =3Dstatic") > + #:tests? #f Please add a short comment explaining why tests are skipped. > + #:phases ,#~(modify-phases %standard-phases The recommended style is to avoid quasiquote/unquote and instead write: (arguments (list #:configure-flags =E2=80=A6 #:phases #~(=E2=80=A6))) > + (add-before 'configure 'set-paths > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let ((dummy-init.d (string-append (getcwd) > + "/etc/init.d= "))) > + (setenv "MOUNT_FUSE_PATH" > + (string-append #$output "/sbin")) > + (setenv "UDEV_RULES_PATH" > + (string-append #$output "/lib/udev/ru= les.d")))))))))) Maybe call this phase =E2=80=98set-fuse+udev+paths=E2=80=99, to avoid confu= sion with the standard =E2=80=98set-paths=E2=80=99 phase. > +(define squashfuse-for-appimage > + (let ((revision "0") > + (commit "e51978cd6bb5c4d16fae9eee43d0b258f570bb0f")) > + (package > + (inherit squashfuse) > + (name "squashfuse") > + (version (git-version "0.1.104" revision commit)) Can you add a comment explaining why this specific commit is needed? That way, our future selves will know when =E2=80=98squashfuse-for-appimage= =E2=80=99 can be removed. > +(define-public appimage-type2-runtime > + (let ((revision "0") > + (commit "47b665594856b4e8928f8932adcf6d13061d8c30")) > + (package > + (name "appimage-type2-runtime") Likewise. > + #:phases #~(modify-phases %standard-phases > + (delete 'configure) > + (delete 'check) > + (replace 'install > + (lambda _ > + (install-file "src/runtime/runtime-fuse3" > + (string-append #$output "/bin")))) > + ;; must be after all elf reliant phases > + (add-after 'make-dynamic-linker-cache 'set-magic-by= tes > + (lambda _ > + (use-modules (ice-9 binary-ports)) Please do not use =E2=80=98use-modules=E2=80=99 in a non-top-level context;= it=E2=80=99s not guaranteed to work in that context. Instead use #:modules (check the repo for examples). > + (home-page "https://github.com/AppImage/type2-runtime") > + (synopsis "Runtime for AppImages") > + (description "The runtime is the executable part of every AppImage= . It Please make it a full sentence, as per . > + (define (concatenate result file1 file2) Please add a short comment below =E2=80=98define=E2=80=99 explaining what i= t does, similar to docstrings. > + (let ((p (open-file-output-port result)) Rather: (call-with-output-file result (lambda (output) =E2=80=A6)) > + (f1 (open-file-input-port file1)) > + (f2 (open-file-input-port file2))) > + (put-bytevector p (get-bytevector-all f1)) > + (close-port f1) > + (put-bytevector p (get-bytevector-all f2)) To avoid loading it all in memory, rather use: (call-with-input-file file1 (lambda (input) (dump-port input output))) Same with FILE2. > + (let* ((appdir "AppDir") > + (squashfs "squashfs") > + (profile-items (map store-info-item > + (call-with-input-file "profile" r= ead-reference-graph))) > + (profile-path (find (cut (file-name-predicate "profil= e$") <> #f) profile-items))) s/-path// Also, rather: (find (lambda (item) (string-suffix? "-profile" item)) items) > + (mkdir-p appdir) > + ;; copy all store items from the profile to the AppDir > + (for-each (lambda (f) > + (copy-store-item f appdir)) profile-items) I believe you could write: (populate-store '("profile") appdir) > + ;; symlink the provided entry-point to AppDir/AppRun=20 > + (symlink (string-append "." profile-path "/" #$entry-point) > + (string-append appdir "/AppRun")) > + ;; create .desktop file as required by the spec > + (make-desktop-entry-file > + (string-append appdir "/" #$name ".desktop") > + #:name #$name > + #:exec #$entry-point) > + ;; compress the AppDir > + (invoke #+(file-append squashfs-tools "/bin/mksquashfs") a= ppdir > + squashfs "-root-owned" "-noappend" > + "-comp" #+(compressor-name compressor)) > + ;; append runtime and squashFS into file AppImage > + (concatenate #$output > + #$(file-append runtime-package "/" runtime-pa= th) > + squashfs)))))) And you can finish with: (chmod #$output #o555). (Then you can remove the doc that says to =E2=80=9Cchmod +x=E2=80=9D the re= sult.) It looks like this procedure ignores its #:symlinks argument. Could you add support for it? Could you send an updated patch? At any rate, kudos for this new backend! This had been suggested many times, so I=E2=80=99m sure it=E2=80=99ll find some good use. Thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 08:23:04 2024 Received: (at 73842) by debbugs.gnu.org; 18 Oct 2024 12:23:04 +0000 Received: from localhost ([127.0.0.1]:37361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1m0W-0004g5-0p for submit@debbugs.gnu.org; Fri, 18 Oct 2024 08:23:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1m0U-0004fT-Ez for 73842@debbugs.gnu.org; Fri, 18 Oct 2024 08:23:02 -0400 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 1t1m02-0005FC-AX; Fri, 18 Oct 2024 08:22:34 -0400 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=mBmd3eYvMtRb19pMLpgg9EJqJwC+gP4do1MArHnEZSY=; b=Y/myYNswE0yy+Q4Vbgb+ tx3ukir/5kfKwSwcniEoXBCI3GBLF93TboDeb0bwizStMrjvaSpOvE/ezxRVt5nvwHt+cJvlysJdL j9FmhY9Ww/QxaN3OLrJMcp9HUQBze8STpHazrhMlftQnA1lfoadVEnQ/5t7+LLFnXHbne1jdKWQvb CXpt4Ay/wx9aOODRogHLJ0S8QqiZha/23SwainC46dy5OR1bA56WA1H3vV1n9eY9PCWIG62ki83X6 S/RgFjGV3lDmcx4lQ5ZqKaEG+lkdyXQ4TkugRhHBuBJAmRvWSgNrha/cLJTS5WAG5xghM8hUeW7V/ 8ul5N7+zsSbDAw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH] pack: Add support for AppImage pack format. In-Reply-To: (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Wed, 16 Oct 2024 23:51:30 +0200") References: Date: Fri, 18 Oct 2024 14:22:31 +0200 Message-ID: <87zfn1ppmg.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: 73842 Cc: Josselin Poiret , 73842@debbugs.gnu.org, Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Sebastian =?utf-8?Q?D=C3=BCmcke?= , Christopher Baines 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 (---) Oh, I forgot one thing: could you add a followup commit adding a news entry in =E2=80=98etc/news.scm=E2=80=99? Make sure the synopsis is intelligible to the Guix user base at large and that the target audience is clear. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 18 16:34:44 2024 Received: (at 73842) by debbugs.gnu.org; 18 Oct 2024 20:34:44 +0000 Received: from localhost ([127.0.0.1]:40224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1tgK-0002vM-0R for submit@debbugs.gnu.org; Fri, 18 Oct 2024 16:34:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t1tgH-0002v9-F1 for 73842@debbugs.gnu.org; Fri, 18 Oct 2024 16:34:42 -0400 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 1t1tfm-0001fj-TJ; Fri, 18 Oct 2024 16:34:10 -0400 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=AzfacNZQB6rh7oMubdYGUi9BcFZ+AQwzOdFzuEP4P9c=; b=M5y1PSI+XwybgYVAVAYa N27cLy2jmoodG8qfoJykMyk8fJJShAQTFJl8ZZYEHd3+N9kI1EVfVpEXnW4KYBnYSzGuFg+6vGJRy ixmhlr7iKNpF+8z6uEf6OmhHmTbv6K3cAeyAVWnMd/j/DtQiCf3mfvtRPzaiYzYZQUGqoG9j5GHui 27bIARZLC+v0IIz3kFd6bLDjAE6j+NcuWSdGG1qcXwKA9z1wVrAdwTPDF1YwkUxXszfYUX6P+t0E6 IC4+QdFBl58R6g3oDw7A21nldoRdvaWZIi0g98YEOn2D72bfxVBbQS5FHrpmQNpRBMYo3VqM5nnc7 PGUlsVK4nMDYbg==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH] pack: Add support for AppImage pack format. In-Reply-To: (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Wed, 16 Oct 2024 23:51:30 +0200") References: Date: Fri, 18 Oct 2024 22:34:06 +0200 Message-ID: <871q0dp2v5.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: 73842 Cc: Josselin Poiret , 73842@debbugs.gnu.org, Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Sebastian =?utf-8?Q?D=C3=BCmcke?= , Christopher Baines 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 (---) No=C3=A9 Lopez skribis: > From: Sebastian D=C3=BCmcke > > * guix/scripts/pack.scm: Add Appimage format. > * gnu/packages/appimage.scm > (gnu packages appimage): New module. > (fuse-for-appimage, squashfuse-for-appimage) > (appimage-type2-runtime): New variables. > * doc/guix.texi: Document AppImage pack. > > Co-authored-by: No=C3=A9 Lopez > Change-Id: I09f1241dfb9b267f94dce59914dea527d35ac60e One last thing: could you add a test? Since such a test needs to build a whole bunch of things, it would only be executed when a connection to a =E2=80=9Creal=E2=80=9D store is availabl= e. See the examples in =E2=80=98tests/pack.scm=E2=80=99 and =E2=80=98tests/guix-pack-r= elocatable.sh=E2=80=99. I guess a test could go in either of these two files, or in a third one similar to =E2=80=98guix-pack-relocatable.sh=E2=80=99. Let me know what you think! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 26 13:48:13 2024 Received: (at 73842) by debbugs.gnu.org; 26 Oct 2024 17:48:13 +0000 Received: from localhost ([127.0.0.1]:42492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4ktY-0001P0-Qv for submit@debbugs.gnu.org; Sat, 26 Oct 2024 13:48:13 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:38392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4ktV-0001Oo-W4 for 73842@debbugs.gnu.org; Sat, 26 Oct 2024 13:48:11 -0400 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:990:a960:b4f3:8f44:ec4:5af5]) by smtp1-g21.free.fr (Postfix) with ESMTP id E5429B00572; Sat, 26 Oct 2024 19:47:31 +0200 (CEST) From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v2 2/3] pack: Add support for AppImage pack format. Date: Sat, 26 Oct 2024 19:28:10 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 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 , Maxim Cournoyer , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= , =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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: Sebastian Dümcke * guix/scripts/pack.scm: Add Appimage format. * doc/guix.texi: Document AppImage pack. Co-authored-by: Noé Lopez Change-Id: I33ebfec623cff1cfcd6f029d2d3054c23ab1949a --- doc/guix.texi | 55 +++++++++++++++++++++- guix/scripts/pack.scm | 104 +++++++++++++++++++++++++++++++++++++++++- tests/pack.scm | 41 ++++++++++++++++- 3 files changed, 197 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index ac3a7adef0..18edf8e550 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6949,6 +6949,18 @@ Invoking guix pack environment}, using commands like @command{singularity shell} or @command{singularity exec}. +@cindex AppImage, create an AppImage file with @command{guix pack} +Another format internally based on SquashFS is +@uref{https://appimage.org/, AppImage}. An AppImage file can be made +executable and run without any special privileges: + +@example +guix pack -f appimage --entry-point=bin/guile guile +cp @var{file} . && chmod u+x $(basename @var{file}) +./$(basename @var{file}) --help +@end example +where @var{file} is the image returned by @command{guix pack}. + Several command-line options allow you to customize your pack: @table @code @@ -7065,6 +7077,47 @@ Invoking guix pack installation or other, non-rpm packs. @end quotation +@item appimage +@cindex AppImage, create an AppImage file with @command{guix pack} +This produces an AppImage file with the @samp{.AppImage} extension. +AppImage is a SquashFS volume prefixed with a runtime that mounts the +SquashFS file system and executes the binary provided with +@option{--entry-point}. This results in a self-contained archive that +bundles the software and all its requirements into a single file. When +the file is made executable it runs the packaged software. + +@example +guix pack -f appimage --entry-point=bin/vlc vlc +@end example + +The runtime used by AppImages makes use of libfuse to mount the image +quickly. If libfuse is not available, the AppImage can still be started +using the @option{--appimage-extract-and-run} flag. + +@quotation Warning + When building an AppImage, always @emph{pass} the +@option{--relocatable} option (or @option{-R}, or @option{-RR}) to make +sure the image can be used on systems where Guix is not installed. A +warning is printed when this option is not used. +@end quotation + +@example +guix pack -f appimage --entry-point=bin/hello --relocatable hello +@end example + +@quotation Note +The resulting AppImage does not conform to the complete standard as it +currently does not contain a @file{.DirIcon} file. This does not impact +functionality of the AppImage itself, but possibly that of software used +to manage AppImages. +@end quotation + +@quotation Note +As the generated AppImage packages the complete dependency graph, it +will be larger than comparable AppImage files found online, which depend +on host system libraries. +@end quotation + @end table @cindex relocatable binaries @@ -7155,7 +7208,7 @@ Invoking guix pack @cindex entry point, for Docker and Singularity images @item --entry-point=@var{command} Use @var{command} as the @dfn{entry point} of the resulting pack, if the pack -format supports it---currently @code{docker} and @code{squashfs} (Singularity) +format supports it---currently @code{docker}, @code{appimage} and @code{squashfs} (Singularity) support it. @var{command} must be relative to the profile contained in the pack. diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7c5fe76fe0..95b40a743b 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -10,6 +10,8 @@ ;;; Copyright © 2022 Alex Griffin ;;; Copyright © 2023 Graham James Addis ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Sebastian Dümcke +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -56,6 +58,7 @@ (define-module (guix scripts pack) #:use-module ((gnu packages compression) #:hide (zip)) #:use-module (gnu packages guile) #:use-module (gnu packages base) + #:autoload (gnu packages appimage) (appimage-type2-runtime) #:autoload (gnu packages gnupg) (guile-gcrypt) #:autoload (gnu packages guile) (guile2.0-json guile-json) #:use-module (srfi srfi-1) @@ -64,6 +67,7 @@ (define-module (guix scripts pack) #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:use-module (ice-9 match) + #:use-module (ice-9 optargs) #:export (symlink-spec-option-parser self-contained-tarball @@ -71,6 +75,7 @@ (define-module (guix scripts pack) rpm-archive docker-image squashfs-image + self-contained-appimage %formats guix-pack)) @@ -974,8 +979,100 @@ (define* (rpm-archive name profile (gexp->derivation (string-append name ".rpm") build #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; AppImage format +;;; +(define* (self-contained-appimage name profile + #:key target + (profile-name "guix-profile") + entry-point + (compressor (lookup-compressor "zstd")) + localstatedir? + (symlinks '()) + (archiver tar) + (extra-options '())) + "Return a self-contained AppImage containing a store initialized with the +closure of PROFILE, a derivation. The AppImage contains /gnu/store unless +RELOCATABLE option is used; if LOCALSTATEDIR? is true, it also contains +/var/guix, including /var/guix/db with a properly initialized store database. + +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." + (unless entry-point + (leave (G_ "entry-point must be provided in the '~a' format~%") + 'appimage)) + (let-keywords extra-options #f ((relocatable? #f)) + (unless relocatable? + (warning (G_ "AppImages should be built with the --relocatable flag~%")))) + + (define runtime-package appimage-type2-runtime) + (define runtime-path "bin/runtime-fuse3") + (define %valid-compressors '("gzip" "zstd")) + + (let ((compressor-name (compressor-name compressor))) + (unless (member compressor-name %valid-compressors) + (leave (G_ "~a is not a valid squashfs archive compressor used in +generating the AppImage. Valid compressors are: ~a~%") + compressor-name + %valid-compressors))) - + (define builder + (with-extensions (list guile-gcrypt) + (with-imported-modules (source-module-closure + '((guix build store-copy) + (guix build utils)) + #:select? not-config?) + #~(begin + (use-modules (guix build utils) + (guix build store-copy) + (rnrs io ports) + (srfi srfi-1) + (srfi srfi-26)) + + (define (concatenate-files result file1 file2) + "Creates a new file RESULT containing FILE1 followed by FILE2." + (call-with-output-file result + (lambda (output) + (call-with-input-file file1 + (lambda (input) + (dump-port input output))) + (call-with-input-file file2 + (lambda (input) + (dump-port input output)))))) + + (let* ((appdir "AppDir") + (squashfs "squashfs") + (profile-items (map store-info-item + (call-with-input-file "profile" read-reference-graph))) + (profile (find (lambda (item) + (string-suffix? "-profile" item)) + profile-items))) + (mkdir-p appdir) + ;; copy all store items from the profile to the AppDir + (populate-store '("profile") appdir) + ;; symlink the provided entry-point to AppDir/AppRun + (symlink (string-append "." profile "/" #$entry-point) + (string-append appdir "/AppRun")) + ;; create .desktop file as required by the spec + (make-desktop-entry-file + (string-append appdir "/" #$name ".desktop") + #:name #$name + #:exec #$entry-point) + ;; compress the AppDir + (invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir + squashfs "-root-owned" "-noappend" + "-comp" #+(compressor-name compressor)) + ;; append runtime and squashFS into file AppImage + (concatenate-files #$output + #$(file-append runtime-package "/" runtime-path) + squashfs) + ;; add execution permission + (chmod #$output #o555)))))) + (gexp->derivation (string-append name ".AppImage") builder + #:target target + #:references-graphs `(("profile" ,profile)))) + ;;; ;;; Compiling C programs. ;;; @@ -1311,6 +1408,7 @@ (define %formats (squashfs . ,squashfs-image) (docker . ,docker-image) (deb . ,debian-archive) + (appimage . ,self-contained-appimage) (rpm . ,rpm-archive))) (define (show-formats) @@ -1327,6 +1425,8 @@ (define (show-formats) deb Debian archive installable via dpkg/apt")) (display (G_ " rpm RPM archive installable via rpm/yum")) + (display (G_ " + appimage AppImage self-contained and executable format")) (newline)) (define (required-option symbol) @@ -1694,6 +1794,8 @@ (define-command (guix-pack . args) (process-file-arg opts 'preun-file) #:postun-file (process-file-arg opts 'postun-file))) + ('appimage + (list #:relocatable? relocatable?)) (_ '()))) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) diff --git a/tests/pack.scm b/tests/pack.scm index f8a9e09c28..6ac9a966af 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,7 +33,8 @@ (define-module (test-pack) #:use-module (guix utils) #:use-module ((guix build utils) #:select (%store-directory)) #:use-module (gnu packages) - #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target)) + #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target + hello)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) @@ -340,6 +342,43 @@ (define rpm-for-tests (mkdir #$output)))))))) (built-derivations (list check)))) + (unless store (test-skip 1)) + (test-assertm "appimage" + (mlet* %store-monad + ((guile (set-guile-for-build (default-guile))) + (profile -> (profile + (content (packages->manifest (list %bootstrap-guile hello))) + (hooks '()) + (locales? #f))) + (image (self-contained-appimage "hello-appimage" profile + #:entry-point "bin/hello" + #:extra-options + (list #:relocatable? #t))) + (check (gexp->derivation + "check-appimage" + #~(begin + (invoke #$image))))) + (built-derivations (list 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))) + (hooks '()) + (locales? #f))) + (image (self-contained-appimage "hello-appimage" profile + #:entry-point "bin/hello" + #:localstatedir? #t + #:extra-options + (list #:relocatable? #t))) + (check (gexp->derivation + "check-appimage" + #~(begin + (invoke #$image))))) + (built-derivations (list check)))) + (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" (mlet* %store-monad -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 26 13:48:19 2024 Received: (at 73842) by debbugs.gnu.org; 26 Oct 2024 17:48:19 +0000 Received: from localhost ([127.0.0.1]:42495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4kte-0001PM-PN for submit@debbugs.gnu.org; Sat, 26 Oct 2024 13:48:19 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:39290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4ktd-0001PF-2u for 73842@debbugs.gnu.org; Sat, 26 Oct 2024 13:48:17 -0400 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:990:a960:b4f3:8f44:ec4:5af5]) by smtp1-g21.free.fr (Postfix) with ESMTP id C8EFFB00579; Sat, 26 Oct 2024 19:47:09 +0200 (CEST) From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v2 0/3] pack: Add support for AppImage pack format. Date: Sat, 26 Oct 2024 19:28:08 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 X-Debbugs-CC: Sebastian Dümcke , Ludovic Courtès MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Florian Pelz , Julien Lepiller Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 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 (-) Hi Ludovic, Thank you for the complete review, here is a new version of the patch containing the changes you asked for. Sebastian did the news entry in three languages (!!!) while I made the tests and git magic. Can you explain why you want support for symlinks? I can’t think of a use for it since AppImages are only meant to be ran through their entrypoint, not unpacked. A summary of changes since previous patch: – Improved package definition for [squash]fuse-for-appimage and bumped versions; – Added news entry; – Added tests; – Applied code suggestions from review: – Don’t use (use-modules) on non-toplevel; – Change -R warning in documentation, and ensure two spaces after dots; – Change appimage-type2-runtime synopsis and description; – Document and improve (concatenate-files) – Use better lambdas for `profile' and populating the store. – chmod 555 the resulting AppImage Have a wonderful week-end, Noé Lopez Noé Lopez (1): gnu: appimage: New packages for the appimage runtime. Sebastian Dümcke (2): pack: Add support for AppImage pack format. news: Add entry for guix pack’s AppImage format doc/guix.texi | 55 +++++++++++++++- etc/news.scm | 38 +++++++++++ gnu/packages/appimage.scm | 133 ++++++++++++++++++++++++++++++++++++++ guix/scripts/pack.scm | 104 ++++++++++++++++++++++++++++- tests/pack.scm | 41 +++++++++++- 5 files changed, 368 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/appimage.scm base-commit: df666602c7936f7d87354374b148ef6269844c01 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 26 13:48:29 2024 Received: (at 73842) by debbugs.gnu.org; 26 Oct 2024 17:48:29 +0000 Received: from localhost ([127.0.0.1]:42498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4ktp-0001Pm-4K for submit@debbugs.gnu.org; Sat, 26 Oct 2024 13:48:29 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:40286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4ktn-0001Pe-L6 for 73842@debbugs.gnu.org; Sat, 26 Oct 2024 13:48:28 -0400 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:990:a960:b4f3:8f44:ec4:5af5]) by smtp1-g21.free.fr (Postfix) with ESMTP id 5F427B00565; Sat, 26 Oct 2024 19:47:21 +0200 (CEST) From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v2 1/3] gnu: appimage: New packages for the appimage runtime. Date: Sat, 26 Oct 2024 19:28:09 +0200 Message-ID: <0f3279bf893470c70bdd535b81cd95fd108d5d5f.1729963690.git.noelopez@free.fr> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 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 (-) * gnu/packages/appimage.scm (gnu packages appimage): New module. (fuse-for-appimage, squashfuse-for-appimage) (appimage-type2-runtime): New variables. Change-Id: I857a8eb5399a6a493e52db70b6c8cf0c71360930 --- gnu/packages/appimage.scm | 133 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 gnu/packages/appimage.scm diff --git a/gnu/packages/appimage.scm b/gnu/packages/appimage.scm new file mode 100644 index 0000000000..028b59ab30 --- /dev/null +++ b/gnu/packages/appimage.scm @@ -0,0 +1,133 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Noé Lopez +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages appimage) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages file-systems) + #:use-module (gnu packages linux) + #:use-module (gnu packages) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils)) + +(define fuse-for-appimage + (package + (inherit fuse) + (name "fuse") + (version "3.16.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/libfuse/libfuse/releases/" + "download/fuse-" + version + "/fuse-" + version + ".tar.gz")) + (sha256 + (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp")))) + (arguments + (substitute-keyword-arguments (package-arguments fuse) + ((#:configure-flags original-flags #~(list)) + #~(append #$original-flags '("--default-library=static"))))))) + +(define squashfuse-for-appimage + (package + (inherit squashfuse) + (arguments + (list + #:configure-flags #~'("CFLAGS=-ffunction-sections -fdata-sections -Os -no-pie" + "LDFLAGS=-static") + #:phases #~(modify-phases %standard-phases + (add-after 'install 'install-private-headers + (lambda _ + (install-file "fuseprivate.h" + (string-append #$output + "/include/squashfuse/"))))))) + (inputs (list fuse-for-appimage + `(,zstd "lib") + `(,zstd "static") + `(,zlib "out") + `(,zlib "static"))))) + +(define-public appimage-type2-runtime + (let ((revision "0") + ;; No releases, just the latest commit. + (commit "47b665594856b4e8928f8932adcf6d13061d8c30")) + (package + (name "appimage-type2-runtime") + (version (git-version "continuous" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/AppImage/type2-runtime") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0954crhlbapxis96g1s0vfpf78ybr64zvjalak387ksxj560g44x")))) + (arguments + (list + #:make-flags #~(list "-Csrc/runtime" "runtime-fuse3" + (string-append "CFLAGS=" + "-I" + #$fuse-2 + "/include/fuse/" + " -DGIT_COMMIT='\"" + "guix-" + #$version + "\"'" + " -D_FILE_OFFSET_BITS=64" + " -static")) + #:modules + `((guix build gnu-build-system) + (guix build utils) + (ice-9 binary-ports)) + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (delete 'check) ; No tests. + (replace 'install + (lambda _ + (install-file "src/runtime/runtime-fuse3" + (string-append #$output "/bin")))) + ;; must be after all elf reliant phases + (add-after 'make-dynamic-linker-cache 'set-magic-bytes + (lambda _ + (let ((port (open (string-append #$output + "/bin/runtime-fuse3") + (logior O_WRONLY)))) + (seek port 8 SEEK_SET) + (put-bytevector port #vu8(#x41 #x49 #x02)) + (close-port port))))) + #:disallowed-references (list squashfuse-for-appimage + fuse-for-appimage zstd zlib))) + ;; only needed at build time + (inputs (list squashfuse-for-appimage fuse-for-appimage + `(,zstd "static") + `(,zlib "static"))) + (build-system gnu-build-system) + (home-page "https://github.com/AppImage/type2-runtime") + (synopsis "Runtime for executing AppImages") + (description "The runtime is the executable part of every AppImage, it mounts +the payload via FUSE and executes the entrypoint.") + (license license:expat)))) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 26 13:48:45 2024 Received: (at 73842) by debbugs.gnu.org; 26 Oct 2024 17:48:45 +0000 Received: from localhost ([127.0.0.1]:42501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4ku4-0001QM-NV for submit@debbugs.gnu.org; Sat, 26 Oct 2024 13:48:45 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:42698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t4ku2-0001QC-9o for 73842@debbugs.gnu.org; Sat, 26 Oct 2024 13:48:43 -0400 Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:990:a960:b4f3:8f44:ec4:5af5]) by smtp1-g21.free.fr (Postfix) with ESMTP id 0DA98B00563; Sat, 26 Oct 2024 19:47:36 +0200 (CEST) From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v2 3/3] =?UTF-8?q?news:=20Add=20entry=20for=20guix=20pack?= =?UTF-8?q?=E2=80=99s=20AppImage=20format?= Date: Sat, 26 Oct 2024 19:28:11 +0200 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Florian Pelz , Julien Lepiller Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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: Sebastian Dümcke * etc/news.scm: Add entry. Change-Id: If37b3b578517c15c2868239998975f7718f7d689 --- etc/news.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/etc/news.scm b/etc/news.scm index 4929fa2a9a..59fdd94dd8 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -25,6 +25,7 @@ ;; Copyright © 2024 Vivien Kraus ;; Copyright © 2024 Guillaume Le Vaillant ;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;; Copyright © 2024 Sebastian Dümcke ;; ;; Copying and distribution of this file, with or without modification, are ;; permitted in any medium without royalty provided the copyright notice and @@ -32,6 +33,43 @@ (channel-news (version 0) + (entry (commit "ea1fe6e106f2abc9fce5cf7e686227c0c1f9e9e1") + (title + (de "Neues Format @samp{AppImage} für den Befehl @command{guix pack}") + (en "New @samp{AppImage} format for the @command{guix pack} command") + (fr "Nouveau format @samp{AppImage} pour la commande @command{guix pack}")) + (body + (de "@command{guix pack} kann nun AppImage Dateien erstellen. Das +AppImage Dateiformat erlaubt es in einer einzelnen Datei Software zu verteilen. Die +AppImage Datei lässt sich ohne besondere Benutzerrechte ausführen. Hier ist +ein Beispiel: + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +Siehe @command{info \"(guix.de) Aufruf von guix pack\"} für mehr +Informationen.") + (en "@command{guix pack} can now produce AppImage a single file, +self-contained software archive. AppImage files are easily distributed and can +be run with user privileges. Here is an example for the @code{hello} package: + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +See @command{info \"(guix) Invoking guix pack\"} for more information.") + (fr "@command{guix pack} peut désormais produire un fichier +AppImage. AppImage est une manière de distribuer les logiciels en un seul +fichier, qui peut être executer avec des droits d’utilisateur. Voici un +exemple pour le paquet @code{hello} : + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +Consultez @command{info \"(guix.fr) Invoquer guix pack\"} pour plus +d’informations."))) (entry (commit "5966e0fdc78771c562e0f484a22f381a77908be0") (title -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 27 09:38:36 2024 Received: (at 73842) by debbugs.gnu.org; 27 Oct 2024 13:38:37 +0000 Received: from localhost ([127.0.0.1]:44298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t53TY-0006rE-7g for submit@debbugs.gnu.org; Sun, 27 Oct 2024 09:38:36 -0400 Received: from relay.yourmailgateway.de ([188.68.63.102]:57617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t53TU-0006r1-EU for 73842@debbugs.gnu.org; Sun, 27 Oct 2024 09:38:34 -0400 Received: from mors-relay-2502.netcup.net (localhost [127.0.0.1]) by mors-relay-2502.netcup.net (Postfix) with ESMTPS id 4XbyJN32sTz638Z; Sun, 27 Oct 2024 14:37:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pelzflorian.de; s=key2; t=1730036276; bh=Y4Ut7iNtnWg5fRgbvz5IGhkzz5guoU9u61+1bR5wdvo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bhypusuwLoKmUwBJiIvjgvTEKHgC5sKDvrdZHAdCvrXmv+TBcuVZzH8KWaEMgmkHx AJ2WS6KGzhQKhDr2P94e+GqD3tzIXXfE6QmAXEx6DwrrqnR5cjM9jl0RWtAErbt1N6 +ecnXXHZXniovqXi7F8cpXJorXurhzGN6ALtD2ZmNE+vRw1gKrJlWJATSZJhEvQiL0 K8pY5szURfI4JQmVdjrM5TRtBym0AXek/UprRWdcxO1JFvJRt0n+PvRoKNlak2cXWi 5DVo20bWKjYyVCzEjg/wvfEnUmM5mfu/MYaYqfl+SFUDSJqG63BNa1lgzSX/XmOivY reycrQCVBTq8g== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-2502.netcup.net (Postfix) with ESMTPS id 4XbyJN2JwHz4wdZ; Sun, 27 Oct 2024 14:37:56 +0100 (CET) Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4XbyJM6wjBz8sZP; Sun, 27 Oct 2024 14:37:55 +0100 (CET) Received: from florianhp (ipb218687b.dynamic.kabel-deutschland.de [178.24.104.123]) by mxe217.netcup.net (Postfix) with ESMTPSA id 776B083A99; Sun, 27 Oct 2024 14:37:48 +0100 (CET) From: "pelzflorian (Florian Pelz)" To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v2 3/3] news: Add entry for guix =?utf-8?Q?pack=E2=80=99s?= AppImage format In-Reply-To: (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sat, 26 Oct 2024 19:28:11 +0200") References: Date: Sun, 27 Oct 2024 14:38:05 +0100 Message-ID: <877c9t3buq.fsf@pelzflorian.de> 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-Rspamd-Queue-Id: 776B083A99 X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: 32Eery5Il401iqSM4wtrm3B4FvL57OTtBmfCWxXB7CenViH2WcOpJs58 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: Julien Lepiller , 73842@debbugs.gnu.org, Sebastian =?utf-8?Q?D=C3=BCmcke?= 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 (-) Thank you No=C3=A9 and Sebastian for not only the command but also including German news. Some minor suggestions: No=C3=A9 Lopez writes: > + (body > + (de "@command{guix pack} kann nun AppImage Dateien erstellen. D= as > +AppImage Dateiformat erlaubt es in einer=20 comma: erlaubt es, in einer To avoid , please put in hyphens: AppImage-Dateien, AppImage-Dateiformat, > einzelnen Datei Software zu verteilen. Die > +AppImage Datei l=C3=A4sst sich ohne besondere Benutzerrechte ausf=C3=BCh= ren. Hier ist > +ein Beispiel: AppImage-Datei > + > +@example > +guix pack --format=3Dappimage --entry-point=3Dbin/hello hello > +@end example > + > +Siehe @command{info \"(guix.de) Aufruf von guix pack\"} f=C3=BCr mehr > +Informationen.") Regards, Florian From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 09:20:44 2024 Received: (at 73842) by debbugs.gnu.org; 1 Nov 2024 13:20:44 +0000 Received: from localhost ([127.0.0.1]:49447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6rZz-0000ho-0b for submit@debbugs.gnu.org; Fri, 01 Nov 2024 09:20:44 -0400 Received: from mail-il1-f182.google.com ([209.85.166.182]:54491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6rZv-0000hd-4e for 73842@debbugs.gnu.org; Fri, 01 Nov 2024 09:20:41 -0400 Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3a394418442so6972925ab.0 for <73842@debbugs.gnu.org>; Fri, 01 Nov 2024 06:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730467178; x=1731071978; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Kwf3IQyY5SDG/KrS8S6gexSvRPZa2sM8ArGX/YQvVWo=; b=bwjWW5C38S/0Kf2Z5HFWD5ba/e166599J+cv2QtojmA0A4Ah0ZishZkkBOWwGp8R3X tfgWJ00YrAHrdp3YuQD28+k7wtMyI13B2bm0sqPSrcG11dr9KDBCkvRiJvqbBpBKxHyd o34N34hVf8oASJsHH8xptEPT+1kbRbDWWFbrbChpl73tZkt2zr0YdEhKtD3UjWHkECvn 6LZV6Vx4/GU9g8IoaekT/TWd1Ox22e8GWM4xLRLRXiLdmM/uvtfTFIA8fvqXPiUJ5xga 5cq7FFMY7A5/DDRvThx6Z2J5Wh7anuwCbQ2zlKl6kowz9C921bTIsTeNlJWaLH8979U4 pJiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730467178; x=1731071978; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Kwf3IQyY5SDG/KrS8S6gexSvRPZa2sM8ArGX/YQvVWo=; b=icRorw//bmLkxj9j//qDyTg17eQClhK+0NO5A79Vo8dQS8z8Tm+p9fiHW9xUZeF3h5 tdUwIeDOJ35O90jkPkS372oUIFyWAdaKObu6+l+C9fjcCszc+M61YTcS6n5f4aznvHbN YdJd2dv0RqrjPTOE88enYrQ+t7cl64+OzlLhKe8R91U1QsA2tJMv+PwYcNmXkJ0r4oj+ n1I7c44LbVFv4y2zF3Ny+7i7bjw40yzHS+GJ/v68wjbxJzFk4pJtDskbHRKWUVA9EGCR abs8G6oJmdcTRjM/SbkeuHZTBEdSAioriXSc6RfDB3XfzTloIyNsViAKHt3Q1gWM2Fta cTIg== X-Gm-Message-State: AOJu0Yz6Jd9MijQGj5/oRDUq8rJgdylKIfy1lxH/jwH/2POPRdNFp8+D /q0Jdtgx/JqDiUPNoVrbWc3/vdIjOvA9N+SjFaabW+JLMZAWypJx X-Google-Smtp-Source: AGHT+IELnTD5vQwKcq/RKvbjeHQLVVPl4eAan0PZCQVwcSfZ5c+tTTSzVA1bo9Z4Gt/Hi8yFOS6rNQ== X-Received: by 2002:a92:ca4a:0:b0:3a5:e1f5:1572 with SMTP id e9e14a558f8ab-3a6b03b37e0mr35781445ab.22.1730467178126; Fri, 01 Nov 2024 06:19:38 -0700 (PDT) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ee45a0f4e3sm2438846a12.87.2024.11.01.06.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 06:19:37 -0700 (PDT) From: Maxim Cournoyer To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v2 2/3] pack: Add support for AppImage pack format. In-Reply-To: (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sat, 26 Oct 2024 19:28:10 +0200") References: Date: Fri, 01 Nov 2024 22:19:32 +0900 Message-ID: <87frob147v.fsf@gmail.com> 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: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: Josselin Poiret , 73842@debbugs.gnu.org, Simon Tournier , Mathieu Othacehe , Ludovic =?utf-8?Q?Court=C3=A8s?= , Tobias Geerinckx-Rice , Sebastian =?utf-8?Q?D=C3=BCmcke?= , Christopher Baines 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 (-) Hi, No=C3=A9 Lopez writes: > From: Sebastian D=C3=BCmcke > > * guix/scripts/pack.scm: Add Appimage format. > * doc/guix.texi: Document AppImage pack. > > Co-authored-by: No=C3=A9 Lopez Thanks for this great addition. > Change-Id: I33ebfec623cff1cfcd6f029d2d3054c23ab1949a > --- > doc/guix.texi | 55 +++++++++++++++++++++- > guix/scripts/pack.scm | 104 +++++++++++++++++++++++++++++++++++++++++- > tests/pack.scm | 41 ++++++++++++++++- > 3 files changed, 197 insertions(+), 3 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index ac3a7adef0..18edf8e550 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -6949,6 +6949,18 @@ Invoking guix pack > environment}, using commands like @command{singularity shell} or > @command{singularity exec}. > > +@cindex AppImage, create an AppImage file with @command{guix pack} > +Another format internally based on SquashFS is > +@uref{https://appimage.org/, AppImage}. An AppImage file can be made > +executable and run without any special privileges: > + > +@example > +guix pack -f appimage --entry-point=3Dbin/guile guile > +cp @var{file} . && chmod u+x $(basename @var{file}) > +./$(basename @var{file}) --help > +@end example > +where @var{file} is the image returned by @command{guix pack}. The chmod is no longer needed in this v2. Also, it could be nicer perhaps to capture the output file in a real variable: @example file=3D$(guix pack -f appimage --entry-point=3Dbin/guile guile) $file @end example > + > Several command-line options allow you to customize your pack: > > @table @code > @@ -7065,6 +7077,47 @@ Invoking guix pack > installation or other, non-rpm packs. > @end quotation > > +@item appimage > +@cindex AppImage, create an AppImage file with @command{guix pack} > +This produces an AppImage file with the @samp{.AppImage} extension. > +AppImage is a SquashFS volume prefixed with a runtime that mounts the > +SquashFS file system and executes the binary provided with > +@option{--entry-point}. This results in a self-contained archive that > +bundles the software and all its requirements into a single file. When > +the file is made executable it runs the packaged software. > + > +@example > +guix pack -f appimage --entry-point=3Dbin/vlc vlc > +@end example > + > +The runtime used by AppImages makes use of libfuse to mount the image > +quickly. If libfuse is not available, the AppImage can still be started > +using the @option{--appimage-extract-and-run} flag. > + > +@quotation Warning > + When building an AppImage, always @emph{pass} the > +@option{--relocatable} option (or @option{-R}, or @option{-RR}) to make > +sure the image can be used on systems where Guix is not installed. A > +warning is printed when this option is not used. Instead of a warning, could we just make it always -RR by default and document that these are always relocatable, by design? The no relocatable flags would be treated as an implicit -RR, and otherwise a single -R would be treated as a single -R (and -RR as -RR, eh). > +@end quotation > + > +@example > +guix pack -f appimage --entry-point=3Dbin/hello --relocatable hello > +@end example > + > +@quotation Note > +The resulting AppImage does not conform to the complete standard as it > +currently does not contain a @file{.DirIcon} file. This does not impact > +functionality of the AppImage itself, but possibly that of software used > +to manage AppImages. > +@end quotation Are there plans to add support for .DirIcon in the future? > +@quotation Note > +As the generated AppImage packages the complete dependency graph, it > +will be larger than comparable AppImage files found online, which depend > +on host system libraries. > +@end quotation > + > @end table > > @cindex relocatable binaries > @@ -7155,7 +7208,7 @@ Invoking guix pack > @cindex entry point, for Docker and Singularity images > @item --entry-point=3D@var{command} > Use @var{command} as the @dfn{entry point} of the resulting pack, if the= pack > -format supports it---currently @code{docker} and @code{squashfs} (Singul= arity) > +format supports it---currently @code{docker}, @code{appimage} and @code{= squashfs} (Singularity) > support it. @var{command} must be relative to the profile contained in = the > pack. > > diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm > index 7c5fe76fe0..95b40a743b 100644 > --- a/guix/scripts/pack.scm > +++ b/guix/scripts/pack.scm > @@ -10,6 +10,8 @@ > ;;; Copyright =C2=A9 2022 Alex Griffin > ;;; Copyright =C2=A9 2023 Graham James Addis > ;;; Copyright =C2=A9 2023 Oleg Pykhalov > +;;; Copyright =C2=A9 2024 Sebastian D=C3=BCmcke > +;;; Copyright =C2=A9 2024 No=C3=A9 Lopez > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -56,6 +58,7 @@ (define-module (guix scripts pack) > #:use-module ((gnu packages compression) #:hide (zip)) > #:use-module (gnu packages guile) > #:use-module (gnu packages base) > + #:autoload (gnu packages appimage) (appimage-type2-runtime) > #:autoload (gnu packages gnupg) (guile-gcrypt) > #:autoload (gnu packages guile) (guile2.0-json guile-json) > #:use-module (srfi srfi-1) > @@ -64,6 +67,7 @@ (define-module (guix scripts pack) > #:use-module (srfi srfi-35) > #:use-module (srfi srfi-37) > #:use-module (ice-9 match) > + #:use-module (ice-9 optargs) > #:export (symlink-spec-option-parser > > self-contained-tarball > @@ -71,6 +75,7 @@ (define-module (guix scripts pack) > rpm-archive > docker-image > squashfs-image > + self-contained-appimage > > %formats > guix-pack)) > @@ -974,8 +979,100 @@ (define* (rpm-archive name profile > (gexp->derivation (string-append name ".rpm") build > #:target target > #:references-graphs `(("profile" ,profile)))) > + > +;;; > +;;; AppImage format > +;;; > +(define* (self-contained-appimage name profile > + #:key target > + (profile-name "guix-profile") > + entry-point > + (compressor (lookup-compressor "zstd")) > + localstatedir? > + (symlinks '()) > + (archiver tar) > + (extra-options '())) > + "Return a self-contained AppImage containing a store initialized with = the > +closure of PROFILE, a derivation. The AppImage contains /gnu/store unle= ss > +RELOCATABLE option is used; if LOCALSTATEDIR? is true, it also contains > +/var/guix, including /var/guix/db with a properly initialized store data= base. > + > +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks t= o be > +added to the pack." > + (unless entry-point > + (leave (G_ "entry-point must be provided in the '~a' format~%") > + 'appimage)) > + (let-keywords extra-options #f ((relocatable? #f)) > + (unless relocatable? > + (warning (G_ "AppImages should be built with the --relocatable fla= g~%")))) > + > + (define runtime-package appimage-type2-runtime) > + (define runtime-path "bin/runtime-fuse3") > + (define %valid-compressors '("gzip" "zstd")) > + > + (let ((compressor-name (compressor-name compressor))) > + (unless (member compressor-name %valid-compressors) > + (leave (G_ "~a is not a valid squashfs archive compressor used in > +generating the AppImage. Valid compressors are: ~a~%") > + compressor-name > + %valid-compressors))) > > - > + (define builder > + (with-extensions (list guile-gcrypt) > + (with-imported-modules (source-module-closure > + '((guix build store-copy) > + (guix build utils)) > + #:select? not-config?) > + #~(begin > + (use-modules (guix build utils) > + (guix build store-copy) > + (rnrs io ports) > + (srfi srfi-1) > + (srfi srfi-26)) > + > + (define (concatenate-files result file1 file2) > + "Creates a new file RESULT containing FILE1 followed by FI= LE2." > + (call-with-output-file result > + (lambda (output) > + (call-with-input-file file1 > + (lambda (input) > + (dump-port input output))) > + (call-with-input-file file2 > + (lambda (input) > + (dump-port input output)))))) > + > + (let* ((appdir "AppDir") > + (squashfs "squashfs") > + (profile-items (map store-info-item > + (call-with-input-file "profile" r= ead-reference-graph))) > + (profile (find (lambda (item) > + (string-suffix? "-profile" item)) > + profile-items))) > + (mkdir-p appdir) > + ;; copy all store items from the profile to the AppDir > + (populate-store '("profile") appdir) > + ;; symlink the provided entry-point to AppDir/AppRun > + (symlink (string-append "." profile "/" #$entry-point) > + (string-append appdir "/AppRun")) > + ;; create .desktop file as required by the spec > + (make-desktop-entry-file > + (string-append appdir "/" #$name ".desktop") > + #:name #$name > + #:exec #$entry-point) > + ;; compress the AppDir > + (invoke #+(file-append squashfs-tools "/bin/mksquashfs") a= ppdir > + squashfs "-root-owned" "-noappend" > + "-comp" #+(compressor-name compressor)) > + ;; append runtime and squashFS into file AppImage > + (concatenate-files #$output > + #$(file-append runtime-package "/" runt= ime-path) > + squashfs) > + ;; add execution permission Standalone comments (those starting on their own line with ;;) should be fully punctuated (complete sentence), e.g.: "Add execution permission." for the last one. > + (chmod #$output #o555)))))) > + (gexp->derivation (string-append name ".AppImage") builder > + #:target target > + #:references-graphs `(("profile" ,profile)))) > + > ;;; > ;;; Compiling C programs. > ;;; > @@ -1311,6 +1408,7 @@ (define %formats > (squashfs . ,squashfs-image) > (docker . ,docker-image) > (deb . ,debian-archive) > + (appimage . ,self-contained-appimage) > (rpm . ,rpm-archive))) > > (define (show-formats) > @@ -1327,6 +1425,8 @@ (define (show-formats) > deb Debian archive installable via dpkg/apt")) > (display (G_ " > rpm RPM archive installable via rpm/yum")) > + (display (G_ " > + appimage AppImage self-contained and executable format")) > (newline)) > > (define (required-option symbol) > @@ -1694,6 +1794,8 @@ (define-command (guix-pack . args) > (process-file-arg opts 'preun= -file) > #:postun-file > (process-file-arg opts 'postu= n-file))) > + ('appimage > + (list #:relocatable? relocatable?)) > (_ '()))) > (target (assoc-ref opts 'target)) > (bootstrap? (assoc-ref opts 'bootstrap?)) > diff --git a/tests/pack.scm b/tests/pack.scm > index f8a9e09c28..6ac9a966af 100644 > --- a/tests/pack.scm > +++ b/tests/pack.scm > @@ -3,6 +3,7 @@ > ;;; Copyright =C2=A9 2018 Ricardo Wurmus > ;;; Copyright =C2=A9 2021, 2023 Maxim Cournoyer > ;;; Copyright =C2=A9 2023 Oleg Pykhalov > +;;; Copyright =C2=A9 2024 No=C3=A9 Lopez > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -32,7 +33,8 @@ (define-module (test-pack) > #:use-module (guix utils) > #:use-module ((guix build utils) #:select (%store-directory)) > #:use-module (gnu packages) > - #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-targ= et)) > + #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-targ= et > + hello)) > #:use-module (gnu packages bootstrap) > #:use-module ((gnu packages package-management) #:select (rpm)) > #:use-module ((gnu packages compression) #:select (squashfs-tools)) > @@ -340,6 +342,43 @@ (define rpm-for-tests > (mkdir #$output)))))))) > (built-derivations (list check)))) > > + (unless store (test-skip 1)) > + (test-assertm "appimage" > + (mlet* %store-monad > + ((guile (set-guile-for-build (default-guile))) > + (profile -> (profile > + (content (packages->manifest (list %bootstrap-guil= e hello))) > + (hooks '()) > + (locales? #f))) > + (image (self-contained-appimage "hello-appimage" profile > + #:entry-point "bin/hello" > + #:extra-options > + (list #:relocatable? #t))) > + (check (gexp->derivation > + "check-appimage" > + #~(begin > + (invoke #$image))))) > + (built-derivations (list 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-guil= e hello))) > + (hooks '()) > + (locales? #f))) > + (image (self-contained-appimage "hello-appimage" profile > + #:entry-point "bin/hello" > + #:localstatedir? #t > + #:extra-options > + (list #:relocatable? #t))) > + (check (gexp->derivation > + "check-appimage" > + #~(begin > + (invoke #$image))))) > + (built-derivations (list check)))) > + > (unless store (test-skip 1)) > (test-assertm "deb archive with symlinks and control files" > (mlet* %store-monad The rest looks good to me, from a quick read. If you could send a v3, I'll then give it a real try. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 09:25:21 2024 Received: (at 73842) by debbugs.gnu.org; 1 Nov 2024 13:25:21 +0000 Received: from localhost ([127.0.0.1]:49486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6reS-0000yo-Jp for submit@debbugs.gnu.org; Fri, 01 Nov 2024 09:25:21 -0400 Received: from mail-pf1-f179.google.com ([209.85.210.179]:48129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6reQ-0000pt-E7 for 73842@debbugs.gnu.org; Fri, 01 Nov 2024 09:25:19 -0400 Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-720d14c8dbfso498825b3a.0 for <73842@debbugs.gnu.org>; Fri, 01 Nov 2024 06:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730467452; x=1731072252; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u8GT3HNyjt3EPlQvlbL6gJRs1OKb+ovMfacSNJtIx3Y=; b=YjYUogWR8O10Iq9FcgwWPySYI8AzrO1vWOvE0sdrGLDKz3lSUjTZiyhmMF/32uickj fUSLYd+f+6h8+8n8IcdU+L3B6+eUB3r9aa85gHi2euzZGJ8YdKeSjMe2Y+AtKXlg8Zeh uq4Hc4c9IifNRPFGT00QGxX5Q899Ye/DjoDQU7QbCsPb7VYGgoAbrxniVHckk6HEDVHk iArz/96dZZpq5fCbT4ntB7RjRLcnTcpxVM9bdRMe7v2VFoT+1jSxWRJ8YCv+jF/J12hN jjXL+9LRoGjznjwVQ/xbYZFw4c/JOml0yU5Rdqa3+R47Ml8ZrGNSqf5BI4pkZ6HFj4Ky jDrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730467452; x=1731072252; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=u8GT3HNyjt3EPlQvlbL6gJRs1OKb+ovMfacSNJtIx3Y=; b=pcse8gyeW162kp6P+fl8Nz+iCFcgh0WFs4lRZMEOcJKEUn1zby0lj1DoLrBxldJxmp LZFA22v8zsOAZwLqjPkdx88F3OoORUIoCexwJbRk38g5r15nuiekbByX/1uW69qiGNmD It8q0UEgr675rPPEQ7H3bn3lliGibpi7ZncxbN1go+I3eMoaeLVJnNTt0cetYBw7FuRa B6M2HuuG9EJi12Mvhq3N96np8iOrlSaYVabSF4J6/CWi3wTmURIU+jHo6/W+naoE8E+J +4OBEuAuiZB+6PHAgXXqvJhYlm7QvGXENh0mavXgGJQZo407IiKco8TgFTbe0zeJazuO jKpw== X-Gm-Message-State: AOJu0YwLZZksD7Pv2SpQxIZ4O7DLf0OqGkUtDpj2zauEQf7lZFeG6J3E GWaeiAwvbsbuV+80ZXRkI9ujjMsW/FSfKwY58VF03uDAcYDPim9O X-Google-Smtp-Source: AGHT+IFpnilg2dmWRrzv8j5uvpLjMN9UKV/oZnCByt8/CjAdvM0tv7lNm/quqrExjuq502ad7aeRzw== X-Received: by 2002:a05:6a20:c998:b0:1d9:857a:585c with SMTP id adf61e73a8af0-1db91d89bc3mr8505017637.19.1730467452410; Fri, 01 Nov 2024 06:24:12 -0700 (PDT) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-720bc2c47f1sm2610122b3a.107.2024.11.01.06.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 06:24:11 -0700 (PDT) From: Maxim Cournoyer To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v2 1/3] gnu: appimage: New packages for the appimage runtime. In-Reply-To: <0f3279bf893470c70bdd535b81cd95fd108d5d5f.1729963690.git.noelopez@free.fr> (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sat, 26 Oct 2024 19:28:09 +0200") References: <0f3279bf893470c70bdd535b81cd95fd108d5d5f.1729963690.git.noelopez@free.fr> Date: Fri, 01 Nov 2024 22:24:08 +0900 Message-ID: <87bjyz1407.fsf@gmail.com> 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: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?utf-8?Q?Ludovic_Court=C3=A8s?= , 73842@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: -1.0 (-) Hi, No=C3=A9 Lopez writes: [...] > +(define squashfuse-for-appimage > + (package > + (inherit squashfuse) > + (arguments > + (list > + #:configure-flags #~'("CFLAGS=3D-ffunction-sections -fdata-secti= ons -Os -no-pie" > + "LDFLAGS=3D-static") > + #:phases #~(modify-phases %standard-phases > + (add-after 'install 'install-private-headers > + (lambda _ > + (install-file "fuseprivate.h" > + (string-append #$output > + "/include/squashfu= se/"))))))) > + (inputs (list fuse-for-appimage > + `(,zstd "lib") > + `(,zstd "static") > + `(,zlib "out") > + `(,zlib "static"))))) > Some lines are a bit too long (our coding style says 80 columns max); you could place the gexps starting with #~ on the line below to make things a bit easier. > + > +(define-public appimage-type2-runtime > + (let ((revision "0") > + ;; No releases, just the latest commit. > + (commit "47b665594856b4e8928f8932adcf6d13061d8c30")) > + (package > + (name "appimage-type2-runtime") > + (version (git-version "continuous" revision commit)) > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/AppImage/type2-runtime") > + (commit commit))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 "0954crhlbapxis96g1s0vfpf78ybr64zvjalak387ksxj560g44x"= )))) > + (arguments > + (list > + #:make-flags #~(list "-Csrc/runtime" "runtime-fuse3" > + (string-append "CFLAGS=3D" > + "-I" > + #$fuse-2 > + "/include/fuse/" > + " -DGIT_COMMIT=3D'\"" > + "guix-" > + #$version > + "\"'" > + " -D_FILE_OFFSET_BITS=3D64" > + " -static")) This feels cramped; start on a new line to give yourself a bit more horizontal width. > + #:modules > + `((guix build gnu-build-system) > + (guix build utils) > + (ice-9 binary-ports)) > + #:phases #~(modify-phases %standard-phases > + (delete 'configure) > + (delete 'check) ; No tests. > + (replace 'install > + (lambda _ > + (install-file "src/runtime/runtime-fuse3" > + (string-append #$output "/bin")))) > + ;; must be after all elf reliant phases > + (add-after 'make-dynamic-linker-cache 'set-magic-by= tes > + (lambda _ > + (let ((port (open (string-append #$output > + "/bin/runtime-fuse3") The indentation is off here. Try running it with 'guix style' or the old Emacs-based indenter to see. > + (logior O_WRONLY)))) > + (seek port 8 SEEK_SET) > + (put-bytevector port #vu8(#x41 #x49 #x02)) > + (close-port port))))) > + #:disallowed-references (list squashfuse-for-appimage > + fuse-for-appimage zstd zlib))) > + ;; only needed at build time As mentioned earlier, please use complete sentences for standalone comments. > + (inputs (list squashfuse-for-appimage fuse-for-appimage > + `(,zstd "static") > + `(,zlib "static"))) > + (build-system gnu-build-system) > + (home-page "https://github.com/AppImage/type2-runtime") > + (synopsis "Runtime for executing AppImages") > + (description "The runtime is the executable part of every AppImage= , it mounts > +the payload via FUSE and executes the entrypoint.") > + (license license:expat)))) --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 09:29:05 2024 Received: (at 73842) by debbugs.gnu.org; 1 Nov 2024 13:29:05 +0000 Received: from localhost ([127.0.0.1]:49506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6ri4-00013r-LU for submit@debbugs.gnu.org; Fri, 01 Nov 2024 09:29:05 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:47561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6ri2-00013l-3l for 73842@debbugs.gnu.org; Fri, 01 Nov 2024 09:29:03 -0400 Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-7eb0bc007edso1167501a12.3 for <73842@debbugs.gnu.org>; Fri, 01 Nov 2024 06:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730467681; x=1731072481; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bSy12NCk+ut9kjIfLe1B//6Gqh+wcaWqg/EqAHaknAs=; b=YaDzXceTK2Zo7uKUvB6Y3AtWN5MxTiw0WTEDTXeQQKZ62npHgZQJf3cIEWE8pPirrY z0U4YvBlruwXxK7mfluhpp9qeNvLVnpwgPrm9ORnHF3ry5OISbpdq7fylCUX2szZnqqM EYlpdp3IXd9duXQ/vM7KAqil2M7d/XSrP9TexVB9jXyDw+9POD+aYG7uBMbvugI8Hvn9 SLzhdAR7/dLku5kae9AI5rgdDL3Lip9bX47LVHpIZiJdqMd+L1myZNRqhNHvlCNPqDTN mWLVVrINumLlqyMNH+e3ualAZb6TVUIbmynryqY98vM+UIyl3hk5ycnOAOnAzNbSAuIC KZjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730467681; x=1731072481; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bSy12NCk+ut9kjIfLe1B//6Gqh+wcaWqg/EqAHaknAs=; b=tnWTkO1mnM2LPPITRvrRd/LS+bwDFLTZ/NzpA5QcPETjGLK6gS+FaowWspoB/+EP/h ForZu42Ic7TnYOYwkF+Q+9KwY0eul9bsaVtAWjq2pJwqnN0LENgoxFgPH+obLq6B/3eH cqEhnQ8lm5S7ASXvcCKOfxunYj6YgF4TA+faTL+BnOQPUH5Z1vuNfxp2pmUi/k9jTpVl QW1LOehvCS/DA3hWb8iR60qAYAiC463Rq5K39VTK2RuDNBXeXH7FhAxff1TqmY/Osk60 8yfs4i7G7xi3kvrnp/TSlHVEzlrqeewX9nb0e0MALHAtvqd/UCA/MsqNYQyyEGH4sOdu On7A== X-Gm-Message-State: AOJu0YzTIRzuesytYLg/4cQgRXcOSq0Wj8bjwrEoSQveC3qYgknGbyuD t0t/p3zU7rosAs1154g/zl1AQa57JZzSdqG/08JGmUnDuX3Ovj+slB+WB3yGHDQ= X-Google-Smtp-Source: AGHT+IFjt1pmYTYBb3bUT6DRp/ZscknQguVv3CeStkNot48G0sRiw3bATZjZiEXPPAxMv9L6URqLzg== X-Received: by 2002:a17:90b:2e4f:b0:2e2:c64c:a1c9 with SMTP id 98e67ed59e1d1-2e93c1a6611mr9261213a91.24.1730467681379; Fri, 01 Nov 2024 06:28:01 -0700 (PDT) Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211056edec1sm21317895ad.50.2024.11.01.06.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 06:28:00 -0700 (PDT) From: Maxim Cournoyer To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v2 3/3] news: Add entry for guix =?utf-8?Q?pack=E2=80=99s?= AppImage format In-Reply-To: (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sat, 26 Oct 2024 19:28:11 +0200") References: Date: Fri, 01 Nov 2024 22:27:56 +0900 Message-ID: <877c9n13tv.fsf@gmail.com> 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: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: Julien Lepiller , 73842@debbugs.gnu.org, Florian Pelz , Sebastian =?utf-8?Q?D=C3=BCmcke?= 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 (-) Hi, No=C3=A9 Lopez writes: > From: Sebastian D=C3=BCmcke > > * etc/news.scm: Add entry. > > Change-Id: If37b3b578517c15c2868239998975f7718f7d689 > --- > etc/news.scm | 38 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) > > diff --git a/etc/news.scm b/etc/news.scm > index 4929fa2a9a..59fdd94dd8 100644 > --- a/etc/news.scm > +++ b/etc/news.scm > @@ -25,6 +25,7 @@ > ;; Copyright =C2=A9 2024 Vivien Kraus > ;; Copyright =C2=A9 2024 Guillaume Le Vaillant > ;; Copyright =C2=A9 2024 Zheng Junjie <873216071@qq.com> > +;; Copyright =C2=A9 2024 Sebastian D=C3=BCmcke > ;; > ;; Copying and distribution of this file, with or without modification, = are > ;; permitted in any medium without royalty provided the copyright notice= and > @@ -32,6 +33,43 @@ >=20=20 > (channel-news > (version 0) > + (entry (commit "ea1fe6e106f2abc9fce5cf7e686227c0c1f9e9e1") > + (title > + (de "Neues Format @samp{AppImage} f=C3=BCr den Befehl @command{= guix pack}") > + (en "New @samp{AppImage} format for the @command{guix pack} com= mand") > + (fr "Nouveau format @samp{AppImage} pour la commande @command{g= uix pack}")) > + (body > + (de "@command{guix pack} kann nun AppImage Dateien erstellen. D= as > +AppImage Dateiformat erlaubt es in einer einzelnen Datei Software zu ver= teilen. Die > +AppImage Datei l=C3=A4sst sich ohne besondere Benutzerrechte ausf=C3=BCh= ren. Hier ist > +ein Beispiel: > + > +@example > +guix pack --format=3Dappimage --entry-point=3Dbin/hello hello > +@end example > + > +Siehe @command{info \"(guix.de) Aufruf von guix pack\"} f=C3=BCr mehr > +Informationen.") > + (en "@command{guix pack} can now produce AppImage a single file, > +self-contained software archive. AppImage files are easily distributed a= nd can > +be run with user privileges. Here is an example for the @code{hello} pac= kage: > + > +@example > +guix pack --format=3Dappimage --entry-point=3Dbin/hello hello > +@end example > + > +See @command{info \"(guix) Invoking guix pack\"} for more information.") > + (fr "@command{guix pack} peut d=C3=A9sormais produire un fichier > +AppImage. AppImage est une mani=C3=A8re de distribuer les logiciels en u= n seul > +fichier, qui peut =C3=AAtre executer avec des droits d=E2=80=99utilisate= ur. Voici un s/executer/ex=C3=A9cut=C3=A9/ I believe double spacing should be used in this patch as well between sentences. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 11:21:25 2024 Received: (at 73842) by debbugs.gnu.org; 1 Nov 2024 15:21:25 +0000 Received: from localhost ([127.0.0.1]:50117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6tSn-0004hL-I9 for submit@debbugs.gnu.org; Fri, 01 Nov 2024 11:21:25 -0400 Received: from smtp.domeneshop.no ([194.63.252.55]:53881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6tSj-0004hD-Ln for 73842@debbugs.gnu.org; Fri, 01 Nov 2024 11:21:24 -0400 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:In-Reply-To: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=MBzi53V6YUWwx7WFlKJsGWvqFlPYhq32Y8ZzlQBe7JE=; b=0 irbx7g+AosAuaH/uAn8sdIftzPAZxZxS+rbdWw9rYFz2lne3wSv7r4jKzHwtxtZMgq0asAIWogQ6V I9Hyr0AxSk4rQ+Pvjf3dFu1qGFAIBRHeHhvoitEdCmqwtviHBZ2V7dEqSEp2LCDQwqJoubQ+CHwAc HLCrL6OcOGSlI6ClB9d8oPMhr9iQF6jotTuLFWS1hZB2Wde9fyCz4Ui81GkG5cstnb3hJ81rfzS+T dZ43XsjCm1ooYsaVqXpdltq8UDJuCIg565ba3MK4BebEYyV4+LRNwiO4DqXCyIG8sgTegbQ1d/Kkj wtAnYCWsOIpL/q7D6xUPBZ24dhhj5ORYA==; Received: from [2a01:e0a:990:a960:b4f3:8f44:ec4:5af5] (port=35616 helo=lignux) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t6tSd-00411V-7m; Fri, 01 Nov 2024 16:21:15 +0100 From: =?utf-8?Q?No=C3=A9_Lopez?= To: Maxim Cournoyer Subject: Re: [bug#73842] [PATCH v2 2/3] pack: Add support for AppImage pack format. In-Reply-To: <87frob147v.fsf@gmail.com> (message from Maxim Cournoyer on Fri, 01 Nov 2024 22:19:32 +0900) Date: Fri, 01 Nov 2024 16:22:17 +0100 Message-ID: <87r07vou6u.fsf@xn--no-cja.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: dev@jpoiret.xyz, 73842@debbugs.gnu.org, zimon.toutoune@gmail.com, othacehe@gnu.org, noelopez@free.fr, me@tobias.gr, code@sam-d.com, guix@cbaines.net, ludo@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: -1.0 (-) Maxim Cournoyer writes: > Instead of a warning, could we just make it always -RR by default and > document that these are always relocatable, by design? The no > relocatable flags would be treated as an implicit -RR, and otherwise a > single -R would be treated as a single -R (and -RR as -RR, eh). I think it would be confusing to have default options change between pack formats, additionaly I=E2=80=99m not sure the -RR option has any effect compared to -R as we already use a runtime that requires fuse. The command will output a warning when the -R option is not used though: =C2=AB guix pack: warning: AppImages should be built with the --relocatable flag =C2=BB > Are there plans to add support for .DirIcon in the future? It was originally planned but with the added complexity it was kept for a later version. Notably, you need a full XDG icon structure inside your AppImage for the specification, that means multiple resolutions of your image and other icon stuff I don=E2=80=99t know about. It=E2=80=99s w= orth retrying though, as a single 256x256 png might work. > The rest looks good to me, from a quick read. If you could send a v3, > I'll then give it a real try. I=E2=80=99ve applied the rest of your suggestions, sending the v3 just after this. Thanks for reviewing, No=C3=A9 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 13:48:46 2024 Received: (at 73842) by debbugs.gnu.org; 1 Nov 2024 17:48:46 +0000 Received: from localhost ([127.0.0.1]:50927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6vlO-0000c9-5h for submit@debbugs.gnu.org; Fri, 01 Nov 2024 13:48:46 -0400 Received: from smtp.domeneshop.no ([194.63.252.55]:46609) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6vlM-0000c3-8Y for 73842@debbugs.gnu.org; Fri, 01 Nov 2024 13:48:45 -0400 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=8lm4iDohk5UjbwzufNyAFQfO7z7U7+vQhxlAt2Qs8f4=; b=PLDvbeuuVpKN1RCu8t5pfqdkFI /kovEa88aFlxPp54Zj0iZ7GAQYqVgd6sIDUip9JH9k4xSkyjwmePuYCc/OtZornQpQULDo+ygg/Z2 xI3FJ4a9Kn5SxfAxBIG0jTFrW0glkzRaTOZNoeb4I2ZbLszCni/zBXyzUAe2bUzpUFgA592ApfIaX AC8QorEWl+F0Dlx9MVSrZfbgDAi6yA35kf1/LBl+PG+UjygYJJVHpM3Z59fpdkIdeJgcVPKUsKFk+ 4ZBxOgo/FKK5dRfFvzYVotbJHd4pu25EvzGNZquEeQTh9Janbuw4pJm9ptIh30BQvbICI1ssyODgW 4Trwo/Mw==; Received: from [2a01:e0a:990:a960:b4f3:8f44:ec4:5af5] (port=57852 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t6vlG-004dQR-JZ; Fri, 01 Nov 2024 18:48:38 +0100 From: noe@xn--no-cja.eu To: 73842@debbugs.gnu.org Subject: [PATCH v3 1/3] gnu: appimage: New packages for the appimage runtime. Date: Fri, 1 Nov 2024 18:49:34 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 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 * gnu/packages/appimage.scm (gnu packages appimage): New module. (fuse-for-appimage, squashfuse-for-appimage) (appimage-type2-runtime): New variables. Change-Id: I857a8eb5399a6a493e52db70b6c8cf0c71360930 --- gnu/packages/appimage.scm | 126 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 gnu/packages/appimage.scm diff --git a/gnu/packages/appimage.scm b/gnu/packages/appimage.scm new file mode 100644 index 0000000000..df17be214e --- /dev/null +++ b/gnu/packages/appimage.scm @@ -0,0 +1,126 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Noé Lopez +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages appimage) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages file-systems) + #:use-module (gnu packages linux) + #:use-module (gnu packages) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils)) + +(define fuse-for-appimage + (package + (inherit fuse) + (name "fuse") + (version "3.16.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/libfuse/libfuse/releases/" + "download/fuse-" version "/fuse-" version ".tar.gz")) + (sha256 + (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp")))) + (arguments + (substitute-keyword-arguments (package-arguments fuse) + ((#:configure-flags original-flags #~(list)) + #~(append #$original-flags '("--default-library=static"))))))) + +(define squashfuse-for-appimage + (package + (inherit squashfuse) + (arguments + (list + #:configure-flags + #~'("CFLAGS=-ffunction-sections -fdata-sections -Os -no-pie" + "LDFLAGS=-static") + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'install-private-headers + (lambda _ + (install-file "fuseprivate.h" + (string-append #$output + "/include/squashfuse/"))))))) + (inputs (list fuse-for-appimage + `(,zstd "lib") + `(,zstd "static") + `(,zlib "out") + `(,zlib "static"))))) + +(define-public appimage-type2-runtime + (let ((revision "0") + ;; No releases, just the latest commit. + (commit "47b665594856b4e8928f8932adcf6d13061d8c30")) + (package + (name "appimage-type2-runtime") + (version (git-version "continuous" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/AppImage/type2-runtime") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0954crhlbapxis96g1s0vfpf78ybr64zvjalak387ksxj560g44x")))) + (arguments + (list + #:make-flags + #~(list "-Csrc/runtime" "runtime-fuse3" + (string-append "CFLAGS=" "-I" #$fuse-2 "/include/fuse/" + " -DGIT_COMMIT='\"" "guix-" #$version "\"'" + " -D_FILE_OFFSET_BITS=64" + " -static")) + #:modules + `((guix build gnu-build-system) + (guix build utils) + (ice-9 binary-ports)) + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (delete 'check) ; No tests. + (replace 'install + (lambda _ + (install-file "src/runtime/runtime-fuse3" + (string-append #$output "/bin")))) + ;; Must be after all elf reliant phases. + (add-after 'make-dynamic-linker-cache 'set-magic-bytes + (lambda _ + (let ((port (open (string-append #$output + "/bin/runtime-fuse3") + (logior O_WRONLY)))) + (seek port 8 SEEK_SET) + (put-bytevector port #vu8(#x41 #x49 #x02)) + (close-port port))))) + #:disallowed-references (list squashfuse-for-appimage + fuse-for-appimage zstd zlib))) + ;; Only needed at build time. + (inputs (list squashfuse-for-appimage fuse-for-appimage + `(,zstd "static") + `(,zlib "static"))) + (build-system gnu-build-system) + (home-page "https://github.com/AppImage/type2-runtime") + (synopsis "Runtime for executing AppImages") + (description "The runtime is the executable part of every AppImage, it +mounts the payload via FUSE and executes the entrypoint.") + (license license:expat)))) base-commit: 870b7d69b4b06d01cdf6bfca71bcc161c0b832bf -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 13:48:56 2024 Received: (at 73842) by debbugs.gnu.org; 1 Nov 2024 17:48:56 +0000 Received: from localhost ([127.0.0.1]:50931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6vlX-0000cP-Pn for submit@debbugs.gnu.org; Fri, 01 Nov 2024 13:48:56 -0400 Received: from smtp.domeneshop.no ([194.63.252.55]:48175) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6vlV-0000cI-L9 for 73842@debbugs.gnu.org; Fri, 01 Nov 2024 13:48:54 -0400 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=1YmN/FFKjYJuJkAECpzuoyo28QjM4rIvPKnB7m2HzDE=; b=L M/b2H7jDRi1XumFqlcA3IK8jEm6UGxK9F2Yv5T8fSO8+/hSb4uWh/ldO/IFnXSkZSvv5Rq5QEBmOJ sGkNJ/JC+v6vc0BBminvXp2fMVjxHB6X0nefRRmExNj1BgJhq4uAvUMDAQjcCAm9Kb+/2ddNmkXwL 4Wd1RQevk8jq/XAbsVI7uDGo6GjL9JWpKSaxhLoBkhdNsWeZo/X3RZNf8P0siwSmxKqEKx2Va4zqd h2CVJ3yYariAikEI+9LWYN/t1lJ+eTQZDCqITILFSQBiGzqAtj69fmHPT6QP4GofMi7DTz3u1wwzG N4j9f8zvau+5n5cRxrfVBw76ztHZZGI7A==; Received: from [2a01:e0a:990:a960:b4f3:8f44:ec4:5af5] (port=57852 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t6vlQ-004dQR-02; Fri, 01 Nov 2024 18:48:48 +0100 From: noe@xn--no-cja.eu To: 73842@debbugs.gnu.org Subject: [PATCH v3 2/3] pack: Add support for AppImage pack format. Date: Fri, 1 Nov 2024 18:49:35 +0100 Message-ID: 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 , Maxim Cournoyer , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= , =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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: Sebastian Dümcke * guix/scripts/pack.scm: Add Appimage format. * doc/guix.texi: Document AppImage pack. Co-authored-by: Noé Lopez Change-Id: I33ebfec623cff1cfcd6f029d2d3054c23ab1949a --- doc/guix.texi | 53 ++++++++++++++++++++- guix/scripts/pack.scm | 104 +++++++++++++++++++++++++++++++++++++++++- tests/pack.scm | 41 ++++++++++++++++- 3 files changed, 195 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 187bae6898..46108dc3f1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6949,6 +6949,16 @@ Invoking guix pack environment}, using commands like @command{singularity shell} or @command{singularity exec}. +@cindex AppImage, create an AppImage file with @command{guix pack} +Another format internally based on SquashFS is +@uref{https://appimage.org/, AppImage}. An AppImage file can be created +and executed without any special privileges: + +@example +file=$(guix pack -f appimage --entry-point=bin/guile guile) +$file --help +@end example + Several command-line options allow you to customize your pack: @table @code @@ -7065,6 +7075,47 @@ Invoking guix pack installation or other, non-rpm packs. @end quotation +@item appimage +@cindex AppImage, create an AppImage file with @command{guix pack} +This produces an AppImage file with the @samp{.AppImage} extension. +AppImage is a SquashFS volume prefixed with a runtime that mounts the +SquashFS file system and executes the binary provided with +@option{--entry-point}. This results in a self-contained archive that +bundles the software and all its requirements into a single file. When +the file is made executable it runs the packaged software. + +@example +guix pack -f appimage --entry-point=bin/vlc vlc +@end example + +The runtime used by AppImages makes use of libfuse to mount the image +quickly. If libfuse is not available, the AppImage can still be started +using the @option{--appimage-extract-and-run} flag. + +@quotation Warning + When building an AppImage, always @emph{pass} the +@option{--relocatable} option (or @option{-R}, or @option{-RR}) to make +sure the image can be used on systems where Guix is not installed. A +warning is printed when this option is not used. +@end quotation + +@example +guix pack -f appimage --entry-point=bin/hello --relocatable hello +@end example + +@quotation Note +The resulting AppImage does not conform to the complete standard as it +currently does not contain a @file{.DirIcon} file. This does not impact +functionality of the AppImage itself, but possibly that of software used +to manage AppImages. +@end quotation + +@quotation Note +As the generated AppImage packages the complete dependency graph, it +will be larger than comparable AppImage files found online, which depend +on host system libraries. +@end quotation + @end table @cindex relocatable binaries @@ -7155,7 +7206,7 @@ Invoking guix pack @cindex entry point, for Docker and Singularity images @item --entry-point=@var{command} Use @var{command} as the @dfn{entry point} of the resulting pack, if the pack -format supports it---currently @code{docker} and @code{squashfs} (Singularity) +format supports it---currently @code{docker}, @code{appimage} and @code{squashfs} (Singularity) support it. @var{command} must be relative to the profile contained in the pack. diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7c5fe76fe0..26ba80b80d 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -10,6 +10,8 @@ ;;; Copyright © 2022 Alex Griffin ;;; Copyright © 2023 Graham James Addis ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Sebastian Dümcke +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -56,6 +58,7 @@ (define-module (guix scripts pack) #:use-module ((gnu packages compression) #:hide (zip)) #:use-module (gnu packages guile) #:use-module (gnu packages base) + #:autoload (gnu packages appimage) (appimage-type2-runtime) #:autoload (gnu packages gnupg) (guile-gcrypt) #:autoload (gnu packages guile) (guile2.0-json guile-json) #:use-module (srfi srfi-1) @@ -64,6 +67,7 @@ (define-module (guix scripts pack) #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:use-module (ice-9 match) + #:use-module (ice-9 optargs) #:export (symlink-spec-option-parser self-contained-tarball @@ -71,6 +75,7 @@ (define-module (guix scripts pack) rpm-archive docker-image squashfs-image + self-contained-appimage %formats guix-pack)) @@ -974,8 +979,100 @@ (define* (rpm-archive name profile (gexp->derivation (string-append name ".rpm") build #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; AppImage format +;;; +(define* (self-contained-appimage name profile + #:key target + (profile-name "guix-profile") + entry-point + (compressor (lookup-compressor "zstd")) + localstatedir? + (symlinks '()) + (archiver tar) + (extra-options '())) + "Return a self-contained AppImage containing a store initialized with the +closure of PROFILE, a derivation. The AppImage contains /gnu/store unless +RELOCATABLE option is used; if LOCALSTATEDIR? is true, it also contains +/var/guix, including /var/guix/db with a properly initialized store database. + +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." + (unless entry-point + (leave (G_ "entry-point must be provided in the '~a' format~%") + 'appimage)) + (let-keywords extra-options #f ((relocatable? #f)) + (unless relocatable? + (warning (G_ "AppImages should be built with the --relocatable flag~%")))) + + (define runtime-package appimage-type2-runtime) + (define runtime-path "bin/runtime-fuse3") + (define %valid-compressors '("gzip" "zstd")) + + (let ((compressor-name (compressor-name compressor))) + (unless (member compressor-name %valid-compressors) + (leave (G_ "~a is not a valid squashfs archive compressor used in +generating the AppImage. Valid compressors are: ~a~%") + compressor-name + %valid-compressors))) - + (define builder + (with-extensions (list guile-gcrypt) + (with-imported-modules (source-module-closure + '((guix build store-copy) + (guix build utils)) + #:select? not-config?) + #~(begin + (use-modules (guix build utils) + (guix build store-copy) + (rnrs io ports) + (srfi srfi-1) + (srfi srfi-26)) + + (define (concatenate-files result file1 file2) + "Creates a new file RESULT containing FILE1 followed by FILE2." + (call-with-output-file result + (lambda (output) + (call-with-input-file file1 + (lambda (input) + (dump-port input output))) + (call-with-input-file file2 + (lambda (input) + (dump-port input output)))))) + + (let* ((appdir "AppDir") + (squashfs "squashfs") + (profile-items (map store-info-item + (call-with-input-file "profile" read-reference-graph))) + (profile (find (lambda (item) + (string-suffix? "-profile" item)) + profile-items))) + (mkdir-p appdir) + ;; Copy all store items from the profile to the AppDir. + (populate-store '("profile") appdir) + ;; Symlink the provided entry-point to AppDir/AppRun. + (symlink (string-append "." profile "/" #$entry-point) + (string-append appdir "/AppRun")) + ;; Create .desktop file as required by the spec. + (make-desktop-entry-file + (string-append appdir "/" #$name ".desktop") + #:name #$name + #:exec #$entry-point) + ;; Compress the AppDir. + (invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir + squashfs "-root-owned" "-noappend" + "-comp" #+(compressor-name compressor)) + ;; Append runtime and squashFS into file AppImage. + (concatenate-files #$output + #$(file-append runtime-package "/" runtime-path) + squashfs) + ;; Add execution permission. + (chmod #$output #o555)))))) + (gexp->derivation (string-append name ".AppImage") builder + #:target target + #:references-graphs `(("profile" ,profile)))) + ;;; ;;; Compiling C programs. ;;; @@ -1311,6 +1408,7 @@ (define %formats (squashfs . ,squashfs-image) (docker . ,docker-image) (deb . ,debian-archive) + (appimage . ,self-contained-appimage) (rpm . ,rpm-archive))) (define (show-formats) @@ -1327,6 +1425,8 @@ (define (show-formats) deb Debian archive installable via dpkg/apt")) (display (G_ " rpm RPM archive installable via rpm/yum")) + (display (G_ " + appimage AppImage self-contained and executable format")) (newline)) (define (required-option symbol) @@ -1694,6 +1794,8 @@ (define-command (guix-pack . args) (process-file-arg opts 'preun-file) #:postun-file (process-file-arg opts 'postun-file))) + ('appimage + (list #:relocatable? relocatable?)) (_ '()))) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) diff --git a/tests/pack.scm b/tests/pack.scm index f8a9e09c28..6ac9a966af 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,7 +33,8 @@ (define-module (test-pack) #:use-module (guix utils) #:use-module ((guix build utils) #:select (%store-directory)) #:use-module (gnu packages) - #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target)) + #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target + hello)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) @@ -340,6 +342,43 @@ (define rpm-for-tests (mkdir #$output)))))))) (built-derivations (list check)))) + (unless store (test-skip 1)) + (test-assertm "appimage" + (mlet* %store-monad + ((guile (set-guile-for-build (default-guile))) + (profile -> (profile + (content (packages->manifest (list %bootstrap-guile hello))) + (hooks '()) + (locales? #f))) + (image (self-contained-appimage "hello-appimage" profile + #:entry-point "bin/hello" + #:extra-options + (list #:relocatable? #t))) + (check (gexp->derivation + "check-appimage" + #~(begin + (invoke #$image))))) + (built-derivations (list 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))) + (hooks '()) + (locales? #f))) + (image (self-contained-appimage "hello-appimage" profile + #:entry-point "bin/hello" + #:localstatedir? #t + #:extra-options + (list #:relocatable? #t))) + (check (gexp->derivation + "check-appimage" + #~(begin + (invoke #$image))))) + (built-derivations (list check)))) + (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" (mlet* %store-monad -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 13:49:04 2024 Received: (at 73842) by debbugs.gnu.org; 1 Nov 2024 17:49:04 +0000 Received: from localhost ([127.0.0.1]:50935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6vlf-0000d7-Rx for submit@debbugs.gnu.org; Fri, 01 Nov 2024 13:49:04 -0400 Received: from smtp.domeneshop.no ([194.63.252.55]:54491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6vlc-0000cO-Av for 73842@debbugs.gnu.org; Fri, 01 Nov 2024 13:49:02 -0400 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=wPb/I1KtjnrIljfpNdm2CTH3CL1AejEtFfDJLGApGGo=; b=u lt7uNUYQvSK9S0eV8Ss/tvd+gEKmUyopJ4FqIgQ7bBXLiuorA51tH9vwMQJaTONj8s99E5eW73WmA Mp1U2A3fh3IYOF18DuWGUhmRf8ZkocCXgKfMglUhcMfsIs+woRXfzKeKmq9URelYwNmynsP5YzETb G7tlsUHhyWeB5rOJuKgnO82OgbYumu433samMFllocc6j1z9MWIy/9BBVphEudV3vMqeHE3hS4174 EkwoOnE/0C6kKP1RGYB40A0P3YEQYyN3xHkwrF1LBpdFmKTaLUSyDA9AcDt/jjsRuH1HRpQKMfAdv Ij5KYSEkKC9yVGWOkNZ189tNDXAYNOusw==; Received: from [2a01:e0a:990:a960:b4f3:8f44:ec4:5af5] (port=57852 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t6vlW-004dQR-Ff; Fri, 01 Nov 2024 18:48:54 +0100 From: noe@xn--no-cja.eu To: 73842@debbugs.gnu.org Subject: [PATCH v3 3/3] =?UTF-8?q?news:=20Add=20entry=20for=20guix=20pack?= =?UTF-8?q?=E2=80=99s=20AppImage=20format?= Date: Fri, 1 Nov 2024 18:49:36 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Florian Pelz , Julien Lepiller Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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: Sebastian Dümcke * etc/news.scm: Add entry. Change-Id: If37b3b578517c15c2868239998975f7718f7d689 --- etc/news.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/etc/news.scm b/etc/news.scm index 4929fa2a9a..4b9f768d8e 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -25,6 +25,7 @@ ;; Copyright © 2024 Vivien Kraus ;; Copyright © 2024 Guillaume Le Vaillant ;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;; Copyright © 2024 Sebastian Dümcke ;; ;; Copying and distribution of this file, with or without modification, are ;; permitted in any medium without royalty provided the copyright notice and @@ -32,6 +33,43 @@ (channel-news (version 0) + (entry (commit "e6534c6ba947d3edbdcb090ae4a410cd9b5ef1c1") + (title + (de "Neues Format @samp{AppImage} für den Befehl @command{guix pack}") + (en "New @samp{AppImage} format for the @command{guix pack} command") + (fr "Nouveau format @samp{AppImage} pour la commande @command{guix pack}")) + (body + (de "@command{guix pack} kann nun AppImage Dateien erstellen. Das +AppImage Dateiformat erlaubt es in einer einzelnen Datei Software zu verteilen. Die +AppImage Datei lässt sich ohne besondere Benutzerrechte ausführen. Hier ist +ein Beispiel: + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +Siehe @command{info \"(guix.de) Aufruf von guix pack\"} für mehr +Informationen.") + (en "@command{guix pack} can now produce AppImage a single file, +self-contained software archive. AppImage files are easily distributed and can +be run with user privileges. Here is an example for the @code{hello} package: + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +See @command{info \"(guix) Invoking guix pack\"} for more information.") + (fr "@command{guix pack} peut désormais produire un fichier +AppImage. AppImage est une manière de distribuer les logiciels en un seul +fichier, qui peut être executé avec des droits d’utilisateur. Voici un +exemple pour le paquet @code{hello} : + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +Consultez @command{info \"(guix.fr) Invoquer guix pack\"} pour plus +d’informations."))) (entry (commit "5966e0fdc78771c562e0f484a22f381a77908be0") (title -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 03 17:39:15 2024 Received: (at 73842) by debbugs.gnu.org; 3 Nov 2024 22:39:16 +0000 Received: from localhost ([127.0.0.1]:35348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7jFb-0008L1-IU for submit@debbugs.gnu.org; Sun, 03 Nov 2024 17:39:15 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:59657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7jFY-0008Kg-Da for 73842@debbugs.gnu.org; Sun, 03 Nov 2024 17:39:13 -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=J8XWjGcd/5MonCMBMyV5KXtbEYGtcClePSXqjoelMks=; b=J6CPMk8WlvLGhT/yIrDjSMzC9H m2Zv0X0Tfxi3qpKYzsbX9VfUikdysCkE8Lg1EV+C5iVEsRQh6uvyQ4V4qvJALkGuTd+4FsJoGK7Aw BNLu5I8Od+ro1t3ZA1anQ5J6E3f0N0CoBYRbB1DsKeKDdu6YTviI4gg8pUj6WxhFIZ3HVkbbFaY5o hkDhUVkMWbqyWDqtwbh7PWdPd+TYdnPWXyoIv3xsHuAYrrqWyHZFSceBK9SwZtu9tPbEzL71d5Ui0 D7cUkNCUR5NSB2AZkNXy04rREQzF6iibe3XSkrSMTw+4teroBAvmILH3KklMhgwHFhpE2MKNA8xcq fdFRNZbQ==; Received: from [2a01:e0a:990:a960:b4f3:8f44:ec4:5af5] (port=40286 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t7jDL-00ETWw-5K; Sun, 03 Nov 2024 23:36:55 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v4 0/3] pack: Add support for AppImage pack format. Date: Sun, 3 Nov 2024 23:37:18 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Noé Lopez , Ludovic Courtès , pelzflorian , Maxim Cournoyer , Noé Lopez , noe@xn--no-cja.eu, Florian Pelz , Julien Lepiller Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 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, I forgot to apply Sebastian’s patch for the german news entry following Florian’s suggestions. Here is a new version. Good evening, Noé Lopez Noé Lopez (1): gnu: appimage: New packages for the appimage runtime. Sebastian Dümcke (2): pack: Add support for AppImage pack format. news: Add entry for guix pack’s AppImage format doc/guix.texi | 53 +++++++++++++++- etc/news.scm | 38 ++++++++++++ gnu/packages/appimage.scm | 126 ++++++++++++++++++++++++++++++++++++++ guix/scripts/pack.scm | 104 ++++++++++++++++++++++++++++++- tests/pack.scm | 41 ++++++++++++- 5 files changed, 359 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/appimage.scm base-commit: 870b7d69b4b06d01cdf6bfca71bcc161c0b832bf -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 03 17:39:16 2024 Received: (at 73842) by debbugs.gnu.org; 3 Nov 2024 22:39:16 +0000 Received: from localhost ([127.0.0.1]:35350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7jFb-0008L7-WA for submit@debbugs.gnu.org; Sun, 03 Nov 2024 17:39:16 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:51461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7jFY-0008Kf-D5 for 73842@debbugs.gnu.org; Sun, 03 Nov 2024 17:39:14 -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=UFCcYj1OP5skWdMhj6nBWA/reQcWasC95MQaOn+pfwc=; b=r lV7YqD/wyTnu4tmp34yn32no/0/E3MjmHWScNS95elHiw4/2iBvQVk6r4jH9qAz6UMAP77FSASsy3 YcBr6dEIE0RyyyABGBhbzNkQGyNjLLxgqjsIujJ2GaiBi0JhVLu4LI8cDChXglRCSxYWhrNoQaVEi pYSpwIqcYl4DbBIWS3703JmUl2eaBuAfjnODfHpsNRIizTgUnaiSWHfgNLUqC+1WJ2AXi3yzBzMYg euIk9735OHpotYv8mcyN8rGA+Fa2LWJ8P9CGG0w8mCNYIv7qCw3e9dgZ0qwc6F3Brxg6aEl1U4znB c/pgslo6g5otYuN5FNCJbWDtLn7odHGdQ==; Received: from [2a01:e0a:990:a960:b4f3:8f44:ec4:5af5] (port=40286 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t7jDM-00ETWw-4t; Sun, 03 Nov 2024 23:36:56 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v4 1/3] gnu: appimage: New packages for the appimage runtime. Date: Sun, 3 Nov 2024 23:37:19 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Noé Lopez , Ludovic Courtès , pelzflorian , Maxim Cournoyer , Noé Lopez , noe@xn--no-cja.eu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 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 * gnu/packages/appimage.scm (gnu packages appimage): New module. (fuse-for-appimage, squashfuse-for-appimage) (appimage-type2-runtime): New variables. Change-Id: I857a8eb5399a6a493e52db70b6c8cf0c71360930 --- gnu/packages/appimage.scm | 126 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 gnu/packages/appimage.scm diff --git a/gnu/packages/appimage.scm b/gnu/packages/appimage.scm new file mode 100644 index 0000000000..df17be214e --- /dev/null +++ b/gnu/packages/appimage.scm @@ -0,0 +1,126 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Noé Lopez +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages appimage) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages file-systems) + #:use-module (gnu packages linux) + #:use-module (gnu packages) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils)) + +(define fuse-for-appimage + (package + (inherit fuse) + (name "fuse") + (version "3.16.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/libfuse/libfuse/releases/" + "download/fuse-" version "/fuse-" version ".tar.gz")) + (sha256 + (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp")))) + (arguments + (substitute-keyword-arguments (package-arguments fuse) + ((#:configure-flags original-flags #~(list)) + #~(append #$original-flags '("--default-library=static"))))))) + +(define squashfuse-for-appimage + (package + (inherit squashfuse) + (arguments + (list + #:configure-flags + #~'("CFLAGS=-ffunction-sections -fdata-sections -Os -no-pie" + "LDFLAGS=-static") + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'install-private-headers + (lambda _ + (install-file "fuseprivate.h" + (string-append #$output + "/include/squashfuse/"))))))) + (inputs (list fuse-for-appimage + `(,zstd "lib") + `(,zstd "static") + `(,zlib "out") + `(,zlib "static"))))) + +(define-public appimage-type2-runtime + (let ((revision "0") + ;; No releases, just the latest commit. + (commit "47b665594856b4e8928f8932adcf6d13061d8c30")) + (package + (name "appimage-type2-runtime") + (version (git-version "continuous" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/AppImage/type2-runtime") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0954crhlbapxis96g1s0vfpf78ybr64zvjalak387ksxj560g44x")))) + (arguments + (list + #:make-flags + #~(list "-Csrc/runtime" "runtime-fuse3" + (string-append "CFLAGS=" "-I" #$fuse-2 "/include/fuse/" + " -DGIT_COMMIT='\"" "guix-" #$version "\"'" + " -D_FILE_OFFSET_BITS=64" + " -static")) + #:modules + `((guix build gnu-build-system) + (guix build utils) + (ice-9 binary-ports)) + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (delete 'check) ; No tests. + (replace 'install + (lambda _ + (install-file "src/runtime/runtime-fuse3" + (string-append #$output "/bin")))) + ;; Must be after all elf reliant phases. + (add-after 'make-dynamic-linker-cache 'set-magic-bytes + (lambda _ + (let ((port (open (string-append #$output + "/bin/runtime-fuse3") + (logior O_WRONLY)))) + (seek port 8 SEEK_SET) + (put-bytevector port #vu8(#x41 #x49 #x02)) + (close-port port))))) + #:disallowed-references (list squashfuse-for-appimage + fuse-for-appimage zstd zlib))) + ;; Only needed at build time. + (inputs (list squashfuse-for-appimage fuse-for-appimage + `(,zstd "static") + `(,zlib "static"))) + (build-system gnu-build-system) + (home-page "https://github.com/AppImage/type2-runtime") + (synopsis "Runtime for executing AppImages") + (description "The runtime is the executable part of every AppImage, it +mounts the payload via FUSE and executes the entrypoint.") + (license license:expat)))) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 03 17:39:18 2024 Received: (at 73842) by debbugs.gnu.org; 3 Nov 2024 22:39:19 +0000 Received: from localhost ([127.0.0.1]:35352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7jFd-0008LM-K0 for submit@debbugs.gnu.org; Sun, 03 Nov 2024 17:39:18 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:41077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7jFZ-0008Kh-3q for 73842@debbugs.gnu.org; Sun, 03 Nov 2024 17:39:15 -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=1YmN/FFKjYJuJkAECpzuoyo28QjM4rIvPKnB7m2HzDE=; b=V arR70Xm29cxhRb8Zp0i+YXOdaQzi64VYwNmWYJGGl1hklPW5SGA2Jurh0GJB31bHLQF/fBTjVgjYh yYuteNikx5C7yVd18cgkHMrK+L1oMpPR5/VwmfiSKyYQs47qiti4mzAnX5XHcxtR8AE4ll8eiwBPO xICgUvXpVhngN4zcWpUoM+cW745fNU+m+iCR5WyuNNjlH8zsv7LqKDYasaKAe2oo4GLrn92TYZmgJ gBdECqcDMZVUQNbKAGZ7FdrzmPxfSEeiVN6GOJcv0QHekfx021lXT8Y22DbD4pvxhHJkgUOjKdT3X 1XFDEFco+za0xn6GXdKPZ1Y74xVudiRpQ==; Received: from [2a01:e0a:990:a960:b4f3:8f44:ec4:5af5] (port=40286 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t7jDN-00ETWw-Nn; Sun, 03 Nov 2024 23:36:57 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v4 2/3] pack: Add support for AppImage pack format. Date: Sun, 3 Nov 2024 23:37:20 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Noé Lopez , Ludovic Courtès , pelzflorian , Maxim Cournoyer , Noé Lopez , noe@xn--no-cja.eu, Christopher Baines , Josselin Poiret , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= , =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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: Sebastian Dümcke * guix/scripts/pack.scm: Add Appimage format. * doc/guix.texi: Document AppImage pack. Co-authored-by: Noé Lopez Change-Id: I33ebfec623cff1cfcd6f029d2d3054c23ab1949a --- doc/guix.texi | 53 ++++++++++++++++++++- guix/scripts/pack.scm | 104 +++++++++++++++++++++++++++++++++++++++++- tests/pack.scm | 41 ++++++++++++++++- 3 files changed, 195 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 187bae6898..46108dc3f1 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6949,6 +6949,16 @@ Invoking guix pack environment}, using commands like @command{singularity shell} or @command{singularity exec}. +@cindex AppImage, create an AppImage file with @command{guix pack} +Another format internally based on SquashFS is +@uref{https://appimage.org/, AppImage}. An AppImage file can be created +and executed without any special privileges: + +@example +file=$(guix pack -f appimage --entry-point=bin/guile guile) +$file --help +@end example + Several command-line options allow you to customize your pack: @table @code @@ -7065,6 +7075,47 @@ Invoking guix pack installation or other, non-rpm packs. @end quotation +@item appimage +@cindex AppImage, create an AppImage file with @command{guix pack} +This produces an AppImage file with the @samp{.AppImage} extension. +AppImage is a SquashFS volume prefixed with a runtime that mounts the +SquashFS file system and executes the binary provided with +@option{--entry-point}. This results in a self-contained archive that +bundles the software and all its requirements into a single file. When +the file is made executable it runs the packaged software. + +@example +guix pack -f appimage --entry-point=bin/vlc vlc +@end example + +The runtime used by AppImages makes use of libfuse to mount the image +quickly. If libfuse is not available, the AppImage can still be started +using the @option{--appimage-extract-and-run} flag. + +@quotation Warning + When building an AppImage, always @emph{pass} the +@option{--relocatable} option (or @option{-R}, or @option{-RR}) to make +sure the image can be used on systems where Guix is not installed. A +warning is printed when this option is not used. +@end quotation + +@example +guix pack -f appimage --entry-point=bin/hello --relocatable hello +@end example + +@quotation Note +The resulting AppImage does not conform to the complete standard as it +currently does not contain a @file{.DirIcon} file. This does not impact +functionality of the AppImage itself, but possibly that of software used +to manage AppImages. +@end quotation + +@quotation Note +As the generated AppImage packages the complete dependency graph, it +will be larger than comparable AppImage files found online, which depend +on host system libraries. +@end quotation + @end table @cindex relocatable binaries @@ -7155,7 +7206,7 @@ Invoking guix pack @cindex entry point, for Docker and Singularity images @item --entry-point=@var{command} Use @var{command} as the @dfn{entry point} of the resulting pack, if the pack -format supports it---currently @code{docker} and @code{squashfs} (Singularity) +format supports it---currently @code{docker}, @code{appimage} and @code{squashfs} (Singularity) support it. @var{command} must be relative to the profile contained in the pack. diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7c5fe76fe0..26ba80b80d 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -10,6 +10,8 @@ ;;; Copyright © 2022 Alex Griffin ;;; Copyright © 2023 Graham James Addis ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Sebastian Dümcke +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -56,6 +58,7 @@ (define-module (guix scripts pack) #:use-module ((gnu packages compression) #:hide (zip)) #:use-module (gnu packages guile) #:use-module (gnu packages base) + #:autoload (gnu packages appimage) (appimage-type2-runtime) #:autoload (gnu packages gnupg) (guile-gcrypt) #:autoload (gnu packages guile) (guile2.0-json guile-json) #:use-module (srfi srfi-1) @@ -64,6 +67,7 @@ (define-module (guix scripts pack) #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:use-module (ice-9 match) + #:use-module (ice-9 optargs) #:export (symlink-spec-option-parser self-contained-tarball @@ -71,6 +75,7 @@ (define-module (guix scripts pack) rpm-archive docker-image squashfs-image + self-contained-appimage %formats guix-pack)) @@ -974,8 +979,100 @@ (define* (rpm-archive name profile (gexp->derivation (string-append name ".rpm") build #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; AppImage format +;;; +(define* (self-contained-appimage name profile + #:key target + (profile-name "guix-profile") + entry-point + (compressor (lookup-compressor "zstd")) + localstatedir? + (symlinks '()) + (archiver tar) + (extra-options '())) + "Return a self-contained AppImage containing a store initialized with the +closure of PROFILE, a derivation. The AppImage contains /gnu/store unless +RELOCATABLE option is used; if LOCALSTATEDIR? is true, it also contains +/var/guix, including /var/guix/db with a properly initialized store database. + +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." + (unless entry-point + (leave (G_ "entry-point must be provided in the '~a' format~%") + 'appimage)) + (let-keywords extra-options #f ((relocatable? #f)) + (unless relocatable? + (warning (G_ "AppImages should be built with the --relocatable flag~%")))) + + (define runtime-package appimage-type2-runtime) + (define runtime-path "bin/runtime-fuse3") + (define %valid-compressors '("gzip" "zstd")) + + (let ((compressor-name (compressor-name compressor))) + (unless (member compressor-name %valid-compressors) + (leave (G_ "~a is not a valid squashfs archive compressor used in +generating the AppImage. Valid compressors are: ~a~%") + compressor-name + %valid-compressors))) - + (define builder + (with-extensions (list guile-gcrypt) + (with-imported-modules (source-module-closure + '((guix build store-copy) + (guix build utils)) + #:select? not-config?) + #~(begin + (use-modules (guix build utils) + (guix build store-copy) + (rnrs io ports) + (srfi srfi-1) + (srfi srfi-26)) + + (define (concatenate-files result file1 file2) + "Creates a new file RESULT containing FILE1 followed by FILE2." + (call-with-output-file result + (lambda (output) + (call-with-input-file file1 + (lambda (input) + (dump-port input output))) + (call-with-input-file file2 + (lambda (input) + (dump-port input output)))))) + + (let* ((appdir "AppDir") + (squashfs "squashfs") + (profile-items (map store-info-item + (call-with-input-file "profile" read-reference-graph))) + (profile (find (lambda (item) + (string-suffix? "-profile" item)) + profile-items))) + (mkdir-p appdir) + ;; Copy all store items from the profile to the AppDir. + (populate-store '("profile") appdir) + ;; Symlink the provided entry-point to AppDir/AppRun. + (symlink (string-append "." profile "/" #$entry-point) + (string-append appdir "/AppRun")) + ;; Create .desktop file as required by the spec. + (make-desktop-entry-file + (string-append appdir "/" #$name ".desktop") + #:name #$name + #:exec #$entry-point) + ;; Compress the AppDir. + (invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir + squashfs "-root-owned" "-noappend" + "-comp" #+(compressor-name compressor)) + ;; Append runtime and squashFS into file AppImage. + (concatenate-files #$output + #$(file-append runtime-package "/" runtime-path) + squashfs) + ;; Add execution permission. + (chmod #$output #o555)))))) + (gexp->derivation (string-append name ".AppImage") builder + #:target target + #:references-graphs `(("profile" ,profile)))) + ;;; ;;; Compiling C programs. ;;; @@ -1311,6 +1408,7 @@ (define %formats (squashfs . ,squashfs-image) (docker . ,docker-image) (deb . ,debian-archive) + (appimage . ,self-contained-appimage) (rpm . ,rpm-archive))) (define (show-formats) @@ -1327,6 +1425,8 @@ (define (show-formats) deb Debian archive installable via dpkg/apt")) (display (G_ " rpm RPM archive installable via rpm/yum")) + (display (G_ " + appimage AppImage self-contained and executable format")) (newline)) (define (required-option symbol) @@ -1694,6 +1794,8 @@ (define-command (guix-pack . args) (process-file-arg opts 'preun-file) #:postun-file (process-file-arg opts 'postun-file))) + ('appimage + (list #:relocatable? relocatable?)) (_ '()))) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) diff --git a/tests/pack.scm b/tests/pack.scm index f8a9e09c28..6ac9a966af 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,7 +33,8 @@ (define-module (test-pack) #:use-module (guix utils) #:use-module ((guix build utils) #:select (%store-directory)) #:use-module (gnu packages) - #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target)) + #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target + hello)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) @@ -340,6 +342,43 @@ (define rpm-for-tests (mkdir #$output)))))))) (built-derivations (list check)))) + (unless store (test-skip 1)) + (test-assertm "appimage" + (mlet* %store-monad + ((guile (set-guile-for-build (default-guile))) + (profile -> (profile + (content (packages->manifest (list %bootstrap-guile hello))) + (hooks '()) + (locales? #f))) + (image (self-contained-appimage "hello-appimage" profile + #:entry-point "bin/hello" + #:extra-options + (list #:relocatable? #t))) + (check (gexp->derivation + "check-appimage" + #~(begin + (invoke #$image))))) + (built-derivations (list 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))) + (hooks '()) + (locales? #f))) + (image (self-contained-appimage "hello-appimage" profile + #:entry-point "bin/hello" + #:localstatedir? #t + #:extra-options + (list #:relocatable? #t))) + (check (gexp->derivation + "check-appimage" + #~(begin + (invoke #$image))))) + (built-derivations (list check)))) + (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" (mlet* %store-monad -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 03 17:39:20 2024 Received: (at 73842) by debbugs.gnu.org; 3 Nov 2024 22:39:20 +0000 Received: from localhost ([127.0.0.1]:35354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7jFg-0008LT-0A for submit@debbugs.gnu.org; Sun, 03 Nov 2024 17:39:20 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:44089) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t7jFb-0008Ki-59 for 73842@debbugs.gnu.org; Sun, 03 Nov 2024 17:39:16 -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=Y843SjcD3j/jaibBTbxS/zPCIEO8jyAiTlkhNg63z9c=; b=T VmPMIZTd5DyP9a/J5FMPTcbvmt23OkS5+cdTpkp0NKFEai7PKzKo+S1Z9kUlO+trOiw2pN4i/cXLh 29w1h7EPeUgQ3rEsnLiKe8sxzytiRCV/8DqGbkmsITrruDpDAvad1LPsNeubTk7WzCzCJW9/OW1Ja BkZI/y3t6kjAxSSm0O9CZgDFCwGf7X3+rH8GdTTrHgJqFBeJnTWacRXx7QxdJGMJz8AREP4lgljIe QpbqpCgmaggbyRKItLoflseMds+k6zdrIRJ28E60UjvNpguvkEF7dFr7cvB6t0wz+unVlHCzxG29o lUwa8D4cFteG7ygJzSpBqzq6HEy3SCkTA==; Received: from [2a01:e0a:990:a960:b4f3:8f44:ec4:5af5] (port=40286 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t7jDO-00ETWw-SH; Sun, 03 Nov 2024 23:36:58 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v4 3/3] =?UTF-8?q?news:=20Add=20entry=20for=20guix=20pack?= =?UTF-8?q?=E2=80=99s=20AppImage=20format?= Date: Sun, 3 Nov 2024 23:37:21 +0100 Message-ID: <6215f728ad5651476412d043d640d52aa51b2179.1730673402.git.noelopez@free.fr> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Noé Lopez , Ludovic Courtès , pelzflorian , Maxim Cournoyer , Noé Lopez , noe@xn--no-cja.eu, Florian Pelz , Julien Lepiller Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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: Sebastian Dümcke * etc/news.scm: Add entry. Change-Id: If37b3b578517c15c2868239998975f7718f7d689 --- etc/news.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/etc/news.scm b/etc/news.scm index 4929fa2a9a..30d907f2ed 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -25,6 +25,7 @@ ;; Copyright © 2024 Vivien Kraus ;; Copyright © 2024 Guillaume Le Vaillant ;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;; Copyright © 2024 Sebastian Dümcke ;; ;; Copying and distribution of this file, with or without modification, are ;; permitted in any medium without royalty provided the copyright notice and @@ -32,6 +33,43 @@ (channel-news (version 0) + (entry (commit "e6534c6ba947d3edbdcb090ae4a410cd9b5ef1c1") + (title + (de "Neues Format @samp{appimage} für den Befehl @command{guix pack}") + (en "New @samp{AppImage} format for the @command{guix pack} command") + (fr "Nouveau format @samp{AppImage} pour la commande @command{guix pack}")) + (body + (de "@command{guix pack} kann nun AppImage-Dateien erstellen. Das +AppImage-Dateiformat erlaubt es, in einer einzelnen Datei Software zu verteilen. Die +AppImage-Datei lässt sich ohne besondere Benutzerrechte ausführen. Hier ist +ein Beispiel: + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +Siehe @command{info \"(guix.de) Aufruf von guix pack\"} für mehr +Informationen.") + (en "@command{guix pack} can now produce AppImage a single file, +self-contained software archive. AppImage files are easily distributed and can +be run with user privileges. Here is an example for the @code{hello} package: + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +See @command{info \"(guix) Invoking guix pack\"} for more information.") + (fr "@command{guix pack} peut désormais produire un fichier +AppImage. AppImage est une manière de distribuer les logiciels en un seul +fichier, qui peut être executé avec des droits d’utilisateur. Voici un +exemple pour le paquet @code{hello} : + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +Consultez @command{info \"(guix.fr) Invoquer guix pack\"} pour plus +d’informations."))) (entry (commit "5966e0fdc78771c562e0f484a22f381a77908be0") (title -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 09:25:17 2024 Received: (at 73842) by debbugs.gnu.org; 5 Nov 2024 14:25:17 +0000 Received: from localhost ([127.0.0.1]:43976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8KUe-0000uj-C6 for submit@debbugs.gnu.org; Tue, 05 Nov 2024 09:25:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8KUa-0000kj-1r for 73842@debbugs.gnu.org; Tue, 05 Nov 2024 09:25:14 -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 1t8KSL-0004rU-73; Tue, 05 Nov 2024 09:22:53 -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=EOW0tJo5s0iKaOHB+q7KOdqjmoeLcKHOVwB5UoUXmpw=; b=PPY+uOb3HtQ/p4u6JT0R GKRRJY7znAwhwyynEl5nxDOXfqBJlgC3R7ge95oLqhFQ7n+OLZWf5SGajCa814PzW8mTkoTbSdd3z IO/nHX1cHJ6zJ9HZA67aFxyzF6n+shFDmZOLVyiC3LJIbTVFFmS/2YxHN9tmyy2RlJ9xXhssgCo/Q rhnGVbkLsEK8nnCpdNw/JIEP9eGmefKgL5Qsi9fEJlLJ9rJivw9Qq3p5rvnB2AauxoZqoUPIRBfn+ 7c/7Z4gPcItbftvYN+mheLGxCTfg3pyJceZXzAMi12S1F3mGlVMCpV2kS3h6MZbplAAORRBNvnt0W vDSMioENY5u0Gw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v4 1/3] gnu: appimage: New packages for the appimage runtime. In-Reply-To: (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sun, 3 Nov 2024 23:37:19 +0100") References: Date: Tue, 05 Nov 2024 15:22:50 +0100 Message-ID: <87r07pyd39.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: 73842 Cc: =?utf-8?Q?No=C3=A9?= Lopez , 73842@debbugs.gnu.org, pelzflorian , Maxim Cournoyer 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 Lopez skribis: > From: No=C3=A9 Lopez > > * gnu/packages/appimage.scm > (gnu packages appimage): New module. > (fuse-for-appimage, squashfuse-for-appimage) > (appimage-type2-runtime): New variables. > > Change-Id: I857a8eb5399a6a493e52db70b6c8cf0c71360930 > --- > gnu/packages/appimage.scm | 126 ++++++++++++++++++++++++++++++++++++++ Please add this file to =E2=80=98gnu/local.mk=E2=80=99. > +(define fuse-for-appimage > + (package > + (inherit fuse) Due to restrictions having to do with circular module dependencies, this package must be defined in the same file as =E2=80=98fuse=E2=80=99 itself (= apologies for overlooking it!). You could add the =E2=80=98hidden?=E2=80=99 property if = needed, but IMO it perhaps not even necessary to hide it. > +(define squashfuse-for-appimage > + (package > + (inherit squashfuse) Likewise, this should be in the same file as =E2=80=98squashfuse=E2=80=99. > + (arguments > + (list > + #:make-flags > + #~(list "-Csrc/runtime" "runtime-fuse3" > + (string-append "CFLAGS=3D" "-I" #$fuse-2 "/include/fuse/" Rather: #$(this-package-input "fuse"). > + " -DGIT_COMMIT=3D'\"" "guix-" #$version "= \"'" > + " -D_FILE_OFFSET_BITS=3D64" > + " -static")) You may need to add =E2=80=9C-O2 -g=E2=80=9D here, or the code might be com= piled as with =E2=80=9C-O0 -g0=E2=80=9D. > + ;; Must be after all elf reliant phases. > + (add-after 'make-dynamic-linker-cache 'set-magic-by= tes > + (lambda _ > + (let ((port (open (string-append #$output > + "/bin/runtime-fuse3") > + (logior O_WRONLY)))) > + (seek port 8 SEEK_SET) > + (put-bytevector port #vu8(#x41 #x49 #x02)) > + (close-port port))))) What=E2=80=99s the story with magic bytes here? :-) Could you add a comment explaining what the phase does and why it=E2=80=99s necessary? > + #:disallowed-references (list squashfuse-for-appimage > + fuse-for-appimage zstd zlib))) > + ;; Only needed at build time. > + (inputs (list squashfuse-for-appimage fuse-for-appimage > + `(,zstd "static") > + `(,zlib "static"))) It should probably be =E2=80=98native-inputs=E2=80=99, then. Also, in #:disallowed-references, I think you need: `(,zstd "static") `(,zlib "static") > + (synopsis "Runtime for executing AppImages") > + (description "The runtime is the executable part of every AppImage= , it > +mounts the payload via FUSE and executes the entrypoint.") Please make that a full sentence, as per . From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 09:27:34 2024 Received: (at 73842) by debbugs.gnu.org; 5 Nov 2024 14:27:34 +0000 Received: from localhost ([127.0.0.1]:43981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8KWs-0000xU-7o for submit@debbugs.gnu.org; Tue, 05 Nov 2024 09:27:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8KWq-0000xJ-EI for 73842@debbugs.gnu.org; Tue, 05 Nov 2024 09:27:33 -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 1t8KWh-0005XE-GL; Tue, 05 Nov 2024 09:27:23 -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=nH7nHg3cyUVa1s8UFPzPEQoWuYi6Uf0pNegZ/nd/ebw=; b=YsIKvU0iLrMvtADs032I dAal/SFtb21aoXWoA182WfHShBkvJZelXoY9mPn8j9N8qVdbsF0RJaFbiimaxRahFAiDqa9TZKpvT p6MvZP326a/A/ZZOLUNiqp7KyH9ehOYPoMP7HkRcmQsDdgX/O/pqWQGX2/BSnJHEMZOKGyMFsFStx 1KCUWaa+QJdpnid44CP1C36uEJ2yvdOs6QPyA20kpCOEx73oWDSr5b51z6BEnKQDyY1eB2e2up7G8 9E+TNjCb+9a8QAApswoIbzd0LgQHXOkbzTh1P/ehJ5GKDdP36IqlubTPKSabou3YQF34/ZqtRMlAg RUvPZlzfYNnodQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v4 2/3] pack: Add support for AppImage pack format. In-Reply-To: (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sun, 3 Nov 2024 23:37:20 +0100") References: Date: Tue, 05 Nov 2024 15:27:17 +0100 Message-ID: <87msidycvu.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: 0.7 (/) X-Debbugs-Envelope-To: 73842 Cc: Josselin Poiret , 73842@debbugs.gnu.org, Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , =?utf-8?Q?No=C3=A9?= Lopez , Tobias Geerinckx-Rice , pelzflorian , Sebastian =?utf-8?Q?D=C3=BCmcke?= , Christopher Baines 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: -0.3 (/) No=C3=A9 Lopez skribis: > From: Sebastian D=C3=BCmcke > > * guix/scripts/pack.scm: Add Appimage format. > * doc/guix.texi: Document AppImage pack. > > Co-authored-by: No=C3=A9 Lopez > Change-Id: I33ebfec623cff1cfcd6f029d2d3054c23ab1949a Please mention =E2=80=98tests/pack.scm=E2=80=99 in the log. > +@cindex AppImage, create an AppImage file with @command{guix pack} > +This produces an AppImage file with the @samp{.AppImage} extension. s/AppImage file/@uref{https://appimage.org/, AppImage file}/ > -format supports it---currently @code{docker} and @code{squashfs} (Singul= arity) > +format supports it---currently @code{docker}, @code{appimage} and @code{= squashfs} (Singularity) Nitpick: s/ and/, and/ > + (check (gexp->derivation > + "check-appimage" > + #~(begin > + (invoke #$image))))) #~(invoke #$image) From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 05 09:28:50 2024 Received: (at 73842) by debbugs.gnu.org; 5 Nov 2024 14:28:50 +0000 Received: from localhost ([127.0.0.1]:43986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8KY5-0000y8-Qk for submit@debbugs.gnu.org; Tue, 05 Nov 2024 09:28:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8KY3-0000y2-Rj for 73842@debbugs.gnu.org; Tue, 05 Nov 2024 09:28:48 -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 1t8KXw-0005es-9V; Tue, 05 Nov 2024 09:28:40 -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=JRJmtqX4wboMnvssXT0dF747oPf0gs1WUoF+rMdxLI4=; b=FkEBNqezf3pVmXzuutXB 0Bv3GapmbCb/6kyiN3rG3N+ZZSXLK8lxhAwYrie3mEKjX0OJte/mZOwOc/KX8cQ84GrBN8iZBVa2T CVRzRFNMxVAVFOHTmdV+3X1FWvyDil02xAqcok9oo29wEXftS2y1ZPbWk2VC/5WTweBMb38qGmhav 5O2UwETtMTxDX0clj6JiS4cCMrL2FCoDk49Gdj8mTfiNnYjD8Iu70QeRRPTxwWJtOCw1SXx/Uya8p 0me625MnRNtMNgdsP2zY2d0W0CQSjXlavZKstOt5gzYY9gw5drT8VEsFGf5SOJeZALa3oLDhy7ueZ sGGDbYJBrNdumw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v4 3/3] news: Add entry for guix =?utf-8?Q?pack=E2=80=99s?= AppImage format In-Reply-To: <6215f728ad5651476412d043d640d52aa51b2179.1730673402.git.noelopez@free.fr> (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sun, 3 Nov 2024 23:37:21 +0100") References: <6215f728ad5651476412d043d640d52aa51b2179.1730673402.git.noelopez@free.fr> Date: Tue, 05 Nov 2024 15:28:22 +0100 Message-ID: <87ikt1ycu1.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: 73842 Cc: Julien Lepiller , 73842@debbugs.gnu.org, Maxim Cournoyer , =?utf-8?Q?No=C3=A9?= Lopez , pelzflorian , Sebastian =?utf-8?Q?D=C3=BCmcke?= 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 (---) No=C3=A9 Lopez skribis: > From: Sebastian D=C3=BCmcke > > * etc/news.scm: Add entry. > > Change-Id: If37b3b578517c15c2868239998975f7718f7d689 Perfect! As you can see, these comments are mostly nitpicking, so hopefully v5 will be the final one. Great job, thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 07 11:51:29 2024 Received: (at 73842) by debbugs.gnu.org; 7 Nov 2024 16:51:29 +0000 Received: from localhost ([127.0.0.1]:49382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t95jE-0000MS-UF for submit@debbugs.gnu.org; Thu, 07 Nov 2024 11:51:29 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:52325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t95jA-0000M9-Ss for 73842@debbugs.gnu.org; Thu, 07 Nov 2024 11:51:27 -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=QU5zlWTpVbok833TCkSLp0wrG7uQScPm+kixCECKjXY=; b=tBkyrsNnJFFhVPwHBnAtv56lCj X0laWlXqAWwBUsq+RdghbMKCzBOCI1PKjZNUUMHc/7nSXdM8zG2EnECaoBjxIWswULrzU6vL5aydP 1hMIp+gc3omLdf/6Ms9QJs3b1a6OxfaYsvEZnknQC3A2DNgDnFS4oiY4ZijeS0T0k2uOvv+OwhFLl 3j8dxM12LQfavUs5jwjOm4KTXxJDrHG8BNlEHqVYO7BH3C2cxSm0YC6kgDE3e6BW8UIYlwbtD1+iK L+BYyJ0rKMLQTUZlLC3vCmdqsc3FZIuTzHJXx3IDjSlXqxtTyzCwvjyxE4kxPgJcxJMnTq7IaCmCq T2HmfjNA==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1t95gy-006LVO-R4; Thu, 07 Nov 2024 17:49:08 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v5 1/3] gnu: appimage: New packages for the appimage runtime. Date: Thu, 7 Nov 2024 17:50:03 +0100 Message-ID: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> MIME-Version: 1.0 X-Debbugs-Cc: Noé Lopez , Ludovic Courtès , pelzflorian , Maxim Cournoyer , Noé Lopez , noe@xn--no-cja.eu, Leo Famulari , Wilko Meyer Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 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 * gnu/packages/appimage.scm (gnu packages appimage): New module. (appimage-type2-runtime): New variable. * gnu/packages/file-systems.scm (squashfuse-for-appimage): New variable. * gnu/packages/linux.scm (fuse-for-appimage): New variable. Change-Id: I857a8eb5399a6a493e52db70b6c8cf0c71360930 --- gnu/local.mk | 2 + gnu/packages/appimage.scm | 97 +++++++++++++++++++++++++++++++++++ gnu/packages/file-systems.scm | 21 ++++++++ gnu/packages/linux.scm | 17 ++++++ 4 files changed, 137 insertions(+) create mode 100644 gnu/packages/appimage.scm diff --git a/gnu/local.mk b/gnu/local.mk index 945d89d550..0deab9065f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -67,6 +67,7 @@ # Copyright © 2024 David Elsing # Copyright © 2024 Ashish SHUKLA # Copyright © 2024 Fabio Natali +# Copyright © 2024 Noé Lopez # # This file is part of GNU Guix. # @@ -139,6 +140,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/apl.scm \ %D%/packages/apple.scm \ %D%/packages/apparmor.scm \ + %D%/packages/appimage.scm \ %D%/packages/apr.scm \ %D%/packages/arcan.scm \ %D%/packages/aspell.scm \ diff --git a/gnu/packages/appimage.scm b/gnu/packages/appimage.scm new file mode 100644 index 0000000000..1d0caada46 --- /dev/null +++ b/gnu/packages/appimage.scm @@ -0,0 +1,97 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Noé Lopez +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages appimage) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages file-systems) + #:use-module (gnu packages linux) + #:use-module (gnu packages) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix utils)) + +(define-public appimage-type2-runtime + (let ((revision "0") + ;; No releases, just the latest commit. + (commit "47b665594856b4e8928f8932adcf6d13061d8c30")) + (package + (name "appimage-type2-runtime") + (version (git-version "continuous" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/AppImage/type2-runtime") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0954crhlbapxis96g1s0vfpf78ybr64zvjalak387ksxj560g44x")))) + (arguments + (list + #:make-flags + #~(list "-Csrc/runtime" "runtime-fuse3" + (string-append + "CFLAGS=" "-I" #$(this-package-input "fuse") "/include/fuse/" + " -DGIT_COMMIT='\"" "guix-" #$version "\"'" + " -D_FILE_OFFSET_BITS=64" + " -static")) + #:modules + `((guix build gnu-build-system) + (guix build utils) + (ice-9 binary-ports)) + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (delete 'check) ; No tests. + (replace 'install + (lambda _ + (install-file "src/runtime/runtime-fuse3" + (string-append #$output "/bin")))) + ;; Must be after all elf reliant phases. Used to identify the + ;; executable as an AppImage as per the specification. + (add-after 'make-dynamic-linker-cache 'set-magic-bytes + (lambda _ + (let ((port (open (string-append #$output + "/bin/runtime-fuse3") + (logior O_WRONLY)))) + (seek port 8 SEEK_SET) + (put-bytevector port #vu8(#x41 #x49 #x02)) + (close-port port))))) + #:disallowed-references (list squashfuse-for-appimage + fuse-for-appimage + (gexp-input zstd "static") + (gexp-input zlib "static")))) + ;; Only needed at build time. + (inputs (list squashfuse-for-appimage + fuse-for-appimage + `(,zstd "static") + `(,zlib "static"))) + (build-system gnu-build-system) + (home-page "https://github.com/AppImage/type2-runtime") + (synopsis "Runtime for executing AppImages") + (description "The runtime is the executable part of every AppImage. It mounts +the payload via @acronym{FUSE} and executes the entrypoint, allowing users to run +applications in a portable manner without the need for installation. This runtime +ensures that the AppImage can access its bundled libraries and resources seamlessly, +providing a consistent environment across different Linux distributions. In the +absence of @acronym{FUSE}, the AppImage can still be started using the +@option{--appimage-extract-and-run} flag.") + (license license:expat)))) diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index 059bdf67a9..e36751e774 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -2059,6 +2059,27 @@ (define-public squashfuse memory-efficient.") (license license:bsd-2))) +(define-public squashfuse-for-appimage + (package + (inherit squashfuse) + (arguments + (list + #:configure-flags + #~'("CFLAGS=-ffunction-sections -fdata-sections -Os -no-pie" + "LDFLAGS=-static") + #:phases + #~(modify-phases %standard-phases + (add-after 'install 'install-private-headers + (lambda _ + (install-file "fuseprivate.h" + (string-append #$output + "/include/squashfuse/"))))))) + (inputs (list fuse-for-appimage + `(,zstd "lib") + `(,zstd "static") + `(,zlib "out") + `(,zlib "static"))))) + (define-public tmsu (package (name "tmsu") diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 992790188a..58403c5b17 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -4100,6 +4100,23 @@ (define-public fuse-2 (("-DFUSERMOUNT_DIR=[[:graph:]]+") "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))))))))) +(define-public fuse-for-appimage + (package + (inherit fuse) + (name "fuse") + (version "3.16.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/libfuse/libfuse/releases/" + "download/fuse-" version "/fuse-" version ".tar.gz")) + (sha256 + (base32 "11yfl2w2a445hllyzlakq97n32g06972vxpmh7lpbclnj9fhb5zp")))) + (arguments + (substitute-keyword-arguments (package-arguments fuse) + ((#:configure-flags original-flags #~(list)) + #~(append #$original-flags '("--default-library=static"))))))) + (define-public unionfs-fuse (package (name "unionfs-fuse") base-commit: ba9466481d10992d35f09d010166d616fdb6a637 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 07 11:51:35 2024 Received: (at 73842) by debbugs.gnu.org; 7 Nov 2024 16:51:36 +0000 Received: from localhost ([127.0.0.1]:49385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t95jK-0000Mk-LF for submit@debbugs.gnu.org; Thu, 07 Nov 2024 11:51:35 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:34641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t95jI-0000MH-6H for 73842@debbugs.gnu.org; Thu, 07 Nov 2024 11:51:33 -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=E1s3x9EBSwA4ULaEoBmyRKpVCJlr4ikfZtQKb9Asbtc=; b=t Ud3svgR+ijo5uLzAaSjn3x0ypVTz2dSNL+tpGA8InxS30ONN0On7p6pgICFdNOSJ+afw38vwYJUNN 4C6tXQtFfcTNlPhC8ww843Y3XeSNemID7Lp1CghIVJMZ+EoXXvU0b9rO8b1WW7+0REGKUJJgE5mPM aPD4p73j3Vh0WcYKLWMOwYe6WsjJDOaAVpZ1ZtyJjEDEGjOMuuGiZin8pph7ZoeO2kVAEyXK7Z6XG RwiedHGrxAkHv2sStkvFAB3sz1NngaYCuGPg49aoYAKZ2tRMw5jGLGLJGHmgW6Eqz9/4txspcItqu ij59HtbwAS8AkY3wyC8pIAB6UZiJMyk1g==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1t95h5-006LVO-As; Thu, 07 Nov 2024 17:49:15 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v5 2/3] pack: Add support for AppImage pack format. Date: Thu, 7 Nov 2024 17:50:04 +0100 Message-ID: <7507b2c56ffbbd8bc051937c5c88bb8c0e3ae8f3.1730998051.git.noelopez@free.fr> In-Reply-To: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> References: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Noé Lopez , Ludovic Courtès , pelzflorian , Maxim Cournoyer , Noé Lopez , noe@xn--no-cja.eu, Christopher Baines , Josselin Poiret , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?UTF-8?q?No=C3=A9=20Lopez?= , =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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: Sebastian Dümcke * guix/scripts/pack.scm: Add Appimage format. * doc/guix.texi: Document AppImage pack. * tests/pack.scm: New AppImage tests. Co-authored-by: Noé Lopez Change-Id: I33ebfec623cff1cfcd6f029d2d3054c23ab1949a --- doc/guix.texi | 59 ++++++++++++++++++++++-- guix/scripts/pack.scm | 104 +++++++++++++++++++++++++++++++++++++++++- tests/pack.scm | 40 +++++++++++++++- 3 files changed, 197 insertions(+), 6 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 151fcd89ac..a1435ceece 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6949,6 +6949,16 @@ Invoking guix pack environment}, using commands like @command{singularity shell} or @command{singularity exec}. +@cindex AppImage, create an AppImage file with @command{guix pack} +Another format internally based on SquashFS is +@uref{https://appimage.org/, AppImage}. An AppImage file can be created +and executed without any special privileges: + +@example +file=$(guix pack -f appimage --entry-point=bin/guile guile) +$file --help +@end example + Several command-line options allow you to customize your pack: @table @code @@ -7065,6 +7075,47 @@ Invoking guix pack installation or other, non-rpm packs. @end quotation +@item appimage +@cindex AppImage, create an AppImage file with @command{guix pack} +This produces an @uref{https://appimage.org/, AppImage file} with the +@samp{.AppImage} extension. AppImage is a SquashFS volume prefixed with +a runtime that mounts the SquashFS file system and executes the binary +provided with @option{--entry-point}. This results in a self-contained +archive that bundles the software and all its requirements into a single +file. When the file is made executable it runs the packaged software. + +@example +guix pack -f appimage --entry-point=bin/vlc vlc +@end example + +The runtime used by AppImages makes use of libfuse to mount the image +quickly. If libfuse is not available, the AppImage can still be started +using the @option{--appimage-extract-and-run} flag. + +@quotation Warning + When building an AppImage, always @emph{pass} the +@option{--relocatable} option (or @option{-R}, or @option{-RR}) to make +sure the image can be used on systems where Guix is not installed. A +warning is printed when this option is not used. +@end quotation + +@example +guix pack -f appimage --entry-point=bin/hello --relocatable hello +@end example + +@quotation Note +The resulting AppImage does not conform to the complete standard as it +currently does not contain a @file{.DirIcon} file. This does not impact +functionality of the AppImage itself, but possibly that of software used +to manage AppImages. +@end quotation + +@quotation Note +As the generated AppImage packages the complete dependency graph, it +will be larger than comparable AppImage files found online, which depend +on host system libraries. +@end quotation + @end table @cindex relocatable binaries @@ -7154,10 +7205,10 @@ Invoking guix pack @cindex entry point, for Docker and Singularity images @item --entry-point=@var{command} -Use @var{command} as the @dfn{entry point} of the resulting pack, if the pack -format supports it---currently @code{docker} and @code{squashfs} (Singularity) -support it. @var{command} must be relative to the profile contained in the -pack. +Use @var{command} as the @dfn{entry point} of the resulting pack, if the +pack format supports it---currently @code{docker}, @code{appimage}, and +@code{squashfs} (Singularity) support it. @var{command} must be +relative to the profile contained in the pack. The entry point specifies the command that tools like @code{docker run} or @code{singularity run} automatically start by default. For example, you can diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7c5fe76fe0..26ba80b80d 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -10,6 +10,8 @@ ;;; Copyright © 2022 Alex Griffin ;;; Copyright © 2023 Graham James Addis ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Sebastian Dümcke +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -56,6 +58,7 @@ (define-module (guix scripts pack) #:use-module ((gnu packages compression) #:hide (zip)) #:use-module (gnu packages guile) #:use-module (gnu packages base) + #:autoload (gnu packages appimage) (appimage-type2-runtime) #:autoload (gnu packages gnupg) (guile-gcrypt) #:autoload (gnu packages guile) (guile2.0-json guile-json) #:use-module (srfi srfi-1) @@ -64,6 +67,7 @@ (define-module (guix scripts pack) #:use-module (srfi srfi-35) #:use-module (srfi srfi-37) #:use-module (ice-9 match) + #:use-module (ice-9 optargs) #:export (symlink-spec-option-parser self-contained-tarball @@ -71,6 +75,7 @@ (define-module (guix scripts pack) rpm-archive docker-image squashfs-image + self-contained-appimage %formats guix-pack)) @@ -974,8 +979,100 @@ (define* (rpm-archive name profile (gexp->derivation (string-append name ".rpm") build #:target target #:references-graphs `(("profile" ,profile)))) + +;;; +;;; AppImage format +;;; +(define* (self-contained-appimage name profile + #:key target + (profile-name "guix-profile") + entry-point + (compressor (lookup-compressor "zstd")) + localstatedir? + (symlinks '()) + (archiver tar) + (extra-options '())) + "Return a self-contained AppImage containing a store initialized with the +closure of PROFILE, a derivation. The AppImage contains /gnu/store unless +RELOCATABLE option is used; if LOCALSTATEDIR? is true, it also contains +/var/guix, including /var/guix/db with a properly initialized store database. + +SYMLINKS must be a list of (SOURCE -> TARGET) tuples denoting symlinks to be +added to the pack." + (unless entry-point + (leave (G_ "entry-point must be provided in the '~a' format~%") + 'appimage)) + (let-keywords extra-options #f ((relocatable? #f)) + (unless relocatable? + (warning (G_ "AppImages should be built with the --relocatable flag~%")))) + + (define runtime-package appimage-type2-runtime) + (define runtime-path "bin/runtime-fuse3") + (define %valid-compressors '("gzip" "zstd")) + + (let ((compressor-name (compressor-name compressor))) + (unless (member compressor-name %valid-compressors) + (leave (G_ "~a is not a valid squashfs archive compressor used in +generating the AppImage. Valid compressors are: ~a~%") + compressor-name + %valid-compressors))) - + (define builder + (with-extensions (list guile-gcrypt) + (with-imported-modules (source-module-closure + '((guix build store-copy) + (guix build utils)) + #:select? not-config?) + #~(begin + (use-modules (guix build utils) + (guix build store-copy) + (rnrs io ports) + (srfi srfi-1) + (srfi srfi-26)) + + (define (concatenate-files result file1 file2) + "Creates a new file RESULT containing FILE1 followed by FILE2." + (call-with-output-file result + (lambda (output) + (call-with-input-file file1 + (lambda (input) + (dump-port input output))) + (call-with-input-file file2 + (lambda (input) + (dump-port input output)))))) + + (let* ((appdir "AppDir") + (squashfs "squashfs") + (profile-items (map store-info-item + (call-with-input-file "profile" read-reference-graph))) + (profile (find (lambda (item) + (string-suffix? "-profile" item)) + profile-items))) + (mkdir-p appdir) + ;; Copy all store items from the profile to the AppDir. + (populate-store '("profile") appdir) + ;; Symlink the provided entry-point to AppDir/AppRun. + (symlink (string-append "." profile "/" #$entry-point) + (string-append appdir "/AppRun")) + ;; Create .desktop file as required by the spec. + (make-desktop-entry-file + (string-append appdir "/" #$name ".desktop") + #:name #$name + #:exec #$entry-point) + ;; Compress the AppDir. + (invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir + squashfs "-root-owned" "-noappend" + "-comp" #+(compressor-name compressor)) + ;; Append runtime and squashFS into file AppImage. + (concatenate-files #$output + #$(file-append runtime-package "/" runtime-path) + squashfs) + ;; Add execution permission. + (chmod #$output #o555)))))) + (gexp->derivation (string-append name ".AppImage") builder + #:target target + #:references-graphs `(("profile" ,profile)))) + ;;; ;;; Compiling C programs. ;;; @@ -1311,6 +1408,7 @@ (define %formats (squashfs . ,squashfs-image) (docker . ,docker-image) (deb . ,debian-archive) + (appimage . ,self-contained-appimage) (rpm . ,rpm-archive))) (define (show-formats) @@ -1327,6 +1425,8 @@ (define (show-formats) deb Debian archive installable via dpkg/apt")) (display (G_ " rpm RPM archive installable via rpm/yum")) + (display (G_ " + appimage AppImage self-contained and executable format")) (newline)) (define (required-option symbol) @@ -1694,6 +1794,8 @@ (define-command (guix-pack . args) (process-file-arg opts 'preun-file) #:postun-file (process-file-arg opts 'postun-file))) + ('appimage + (list #:relocatable? relocatable?)) (_ '()))) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) diff --git a/tests/pack.scm b/tests/pack.scm index f8a9e09c28..1c1e312557 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2023 Oleg Pykhalov +;;; Copyright © 2024 Noé Lopez ;;; ;;; This file is part of GNU Guix. ;;; @@ -32,7 +33,8 @@ (define-module (test-pack) #:use-module (guix utils) #:use-module ((guix build utils) #:select (%store-directory)) #:use-module (gnu packages) - #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target)) + #:use-module ((gnu packages base) #:select (libc-utf8-locales-for-target + hello)) #:use-module (gnu packages bootstrap) #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) @@ -340,6 +342,42 @@ (define rpm-for-tests (mkdir #$output)))))))) (built-derivations (list check)))) + (unless store (test-skip 1)) + (test-assertm "appimage" + (mlet* %store-monad + ((guile (set-guile-for-build (default-guile))) + (profile -> (profile + (content (packages->manifest (list %bootstrap-guile hello))) + (hooks '()) + (locales? #f))) + (image (self-contained-appimage "hello-appimage" profile + #:entry-point "bin/hello" + #:extra-options + (list #:relocatable? #t))) + (check (gexp->derivation + "check-appimage" + #~(invoke #$image)))) + (built-derivations (list 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))) + (hooks '()) + (locales? #f))) + (image (self-contained-appimage "hello-appimage" profile + #:entry-point "bin/hello" + #:localstatedir? #t + #:extra-options + (list #:relocatable? #t))) + (check (gexp->derivation + "check-appimage" + #~(begin + (invoke #$image))))) + (built-derivations (list check)))) + (unless store (test-skip 1)) (test-assertm "deb archive with symlinks and control files" (mlet* %store-monad -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 07 11:51:41 2024 Received: (at 73842) by debbugs.gnu.org; 7 Nov 2024 16:51:41 +0000 Received: from localhost ([127.0.0.1]:49388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t95jQ-0000N7-U3 for submit@debbugs.gnu.org; Thu, 07 Nov 2024 11:51:41 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:42087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t95jO-0000Md-Ar for 73842@debbugs.gnu.org; Thu, 07 Nov 2024 11:51:40 -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=YQf1kle6/VebuNyaPqlwvFlR++WPDlbtpotdI4Lfi5g=; b=R wyO/SRpUHxEPdyfh9Y6hu4kV+ohWLTi4u0b8VGVmmzY81/Fv5bw8nsTIsElBwrGNI3Fu2VfH08zGB +O9YSj16mcAvCfpn5insUSskoWoZtR3VrIaetnoyyknvCa8+Ee86pouTQM3guSOW90ccLUDzE0izm gnU3gKr4r8hKy5u31xLo2yqtjm9EU4cjjHwQsUCHtafm32vG7sDaJ9EVrLoJWvxceY2oOvZXwlgQC zTRA2kiOoayv+9L7eNac3xeadw7IxEG1lPMwTEIirswhMZiCRMsyPUr6xOa0Ykwg3ezTz1GXkoAmz ysQUcBlWYp2Y9hxVa9dQaHeeC/TP2seTg==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1t95hC-006LVO-FE; Thu, 07 Nov 2024 17:49:22 +0100 From: =?UTF-8?q?No=C3=A9=20Lopez?= To: 73842@debbugs.gnu.org Subject: [PATCH v5 3/3] =?UTF-8?q?news:=20Add=20entry=20for=20guix=20pack?= =?UTF-8?q?=E2=80=99s=20AppImage=20format?= Date: Thu, 7 Nov 2024 17:50:05 +0100 Message-ID: In-Reply-To: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> References: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Debbugs-Cc: Noé Lopez , Ludovic Courtès , pelzflorian , Maxim Cournoyer , Noé Lopez , noe@xn--no-cja.eu, Florian Pelz , Julien Lepiller Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: =?UTF-8?q?Sebastian=20D=C3=BCmcke?= 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: Sebastian Dümcke * etc/news.scm: Add entry. Change-Id: If37b3b578517c15c2868239998975f7718f7d689 --- etc/news.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/etc/news.scm b/etc/news.scm index 4929fa2a9a..4911ee65ee 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -25,6 +25,7 @@ ;; Copyright © 2024 Vivien Kraus ;; Copyright © 2024 Guillaume Le Vaillant ;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;; Copyright © 2024 Sebastian Dümcke ;; ;; Copying and distribution of this file, with or without modification, are ;; permitted in any medium without royalty provided the copyright notice and @@ -32,6 +33,43 @@ (channel-news (version 0) + (entry (commit "9e96056bf40591cc9439d60c4c5bae5aa0f0b2f8") + (title + (de "Neues Format @samp{appimage} für den Befehl @command{guix pack}") + (en "New @samp{AppImage} format for the @command{guix pack} command") + (fr "Nouveau format @samp{AppImage} pour la commande @command{guix pack}")) + (body + (de "@command{guix pack} kann nun AppImage-Dateien erstellen. Das +AppImage-Dateiformat erlaubt es, in einer einzelnen Datei Software zu verteilen. Die +AppImage-Datei lässt sich ohne besondere Benutzerrechte ausführen. Hier ist +ein Beispiel: + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +Siehe @command{info \"(guix.de) Aufruf von guix pack\"} für mehr +Informationen.") + (en "@command{guix pack} can now produce AppImage a single file, +self-contained software archive. AppImage files are easily distributed and can +be run with user privileges. Here is an example for the @code{hello} package: + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +See @command{info \"(guix) Invoking guix pack\"} for more information.") + (fr "@command{guix pack} peut désormais produire un fichier +AppImage. AppImage est une manière de distribuer les logiciels en un seul +fichier, qui peut être executé avec des droits d’utilisateur. Voici un +exemple pour le paquet @code{hello} : + +@example +guix pack --format=appimage --entry-point=bin/hello hello +@end example + +Consultez @command{info \"(guix.fr) Invoquer guix pack\"} pour plus +d’informations."))) (entry (commit "5966e0fdc78771c562e0f484a22f381a77908be0") (title -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 09 12:33:52 2024 Received: (at 73842) by debbugs.gnu.org; 9 Nov 2024 17:33:52 +0000 Received: from localhost ([127.0.0.1]:54358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9pLM-0006oP-EH for submit@debbugs.gnu.org; Sat, 09 Nov 2024 12:33:52 -0500 Received: from mail-am0eur02olkn2066.outbound.protection.outlook.com ([40.92.49.66]:15617 helo=EUR02-AM0-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9pLK-0006oB-8C for 73842@debbugs.gnu.org; Sat, 09 Nov 2024 12:33:50 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QN4oDXs03wl7eQxafWStVaf+cVCknjbq09mgZvyxavzgydNdCPLiYfKLZHwQavDHiLrj5vt4EzBWCB9ZUK6JmoV/HnMwgH7zcXaR4GOsaWytXAKqXmj1bo8GV+8oDnXIHrZnc5c35UbqzTXJr9kLwZ0GZDBNyKWmozNMFtfhKvehVJTma0PC3vV8jxq8nVV3mSjg9qr2ALAcGHz0q6uggiqPkqPCDLGsqbFJ5bssFz7c+0hu0/nDAOfnx1h1LVaHOH2F99uOgnYRIpY02BDq1Hjhet92QN4/FGBLVmwd8e1SDHuqXjoeJSWu/6jNYV2fLP3g/B6wB49CtjmVMIBFaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ihwE/Vl7rGCcYF7R8XlZxqol+FC/dfaFtYKuUQ4lJd0=; b=AjQvyZ4ib9wD+IrKmMj9aUZGDfJeNOSpK5IODUDh9+8ZP1rQKpRuYR/PB+9cy8HyVNJEqo0wqmPSJvwCQcd0G4xSMKzoy0KtEbLIrBMDyjih/PyJCYJOwY62mxN+gTqenx2Gor4s99gYl9fp5M+3Lb9jrXG/5+lXoLU5cVpdEkYRx7pJ8bMbzAvP92X9+6YKl4lPQ6IvsYQzyaao8vPXm7KLFL5dIdRNI1WoDM6Y0qmiqH8MdgZs1nbImoEaRLFnikHH2Zx2OIMYjVrirGGl8QxGsufz32fhqNgcAwEB7jjw6HB+V9bH1RsbFo2TO3zLt8HeKi1CCjrbb3cPVOJSog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=OUTLOOK.FR; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ihwE/Vl7rGCcYF7R8XlZxqol+FC/dfaFtYKuUQ4lJd0=; b=avWRasiDXaW/o+z5K+RMGLSvZIHi/dxAHkpL8kSs7Y+rT5ZQgK5695vzAsXTRzKJ0zWOfPCvq8RCATfAil+RTDy964PE5hRjQSS6cYjxYLCC3y+nKvfxGvWGt7YKuyZlnFd/NbFlrqNrGkN5diU4h8SaIQQDCABDLY8Sn2iFlE1Nube+zwKju9DYVd0ezyN907JPmD0hVFD6oPBlAlMnNSnPh8N1lyYbooGNVAdiRUdeQ2IgHZdKsXj9hthP91m6WiCiDUOwu2BrsLlbHPlIthXTWf6t+PRiS7Htbq4hOZZZwAwsyqOW2Mi73cTpsCXbl+uXA2WKcle661EEQdIUug== Received: from AS8P251MB0854.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:526::9) by AM9P251MB0176.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:3dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.21; Sat, 9 Nov 2024 17:33:30 +0000 Received: from AS8P251MB0854.EURP251.PROD.OUTLOOK.COM ([fe80::bebf:d3d4:fc0b:68fd]) by AS8P251MB0854.EURP251.PROD.OUTLOOK.COM ([fe80::bebf:d3d4:fc0b:68fd%5]) with mapi id 15.20.8137.021; Sat, 9 Nov 2024 17:33:30 +0000 From: outlook user To: "ludo@gnu.org" , "bug-guix@gnu.org" , "73842@debbugs.gnu.org" <73842@debbugs.gnu.org> Subject: RE: bug#21142: Sshfs-fuse requires fuse Thread-Topic: bug#21142: Sshfs-fuse requires fuse Thread-Index: AQHbMr76jgnRGzcSWEeoRDazsWQSlrKvHxXKgAAWEa0= Date: Sat, 9 Nov 2024 17:33:30 +0000 Message-ID: References: In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS8P251MB0854:EE_|AM9P251MB0176:EE_ x-ms-office365-filtering-correlation-id: 627a895c-d331-4964-1bcb-08dd00e4a0b0 x-microsoft-antispam: BCL:0; ARA:14566002|461199028|8060799006|15080799006|7092599003|19110799003|8062599003|15030799003|440099028|3412199025|102099032; x-microsoft-antispam-message-info: =?iso-8859-1?Q?z45qeLWfHlddJwnsgvinNnuBfML+NykaxIVEHAPUpz3SvJUfP3dB8Crnw4?= =?iso-8859-1?Q?qu96G4WnoojC5IUhq6l9/x30Zm5oB0V5dGcJPYKZo9wBac2R4lMW98lhsC?= =?iso-8859-1?Q?QT0uLYc91yYkArq/P8POxDqGzVG55YpRG+WI6iCwpolr/awxQwRArgQ2gS?= =?iso-8859-1?Q?+oeKI9IZxta8m8Oqii1vHcWxd6F8Qqfg45Vtuj8ULwKFbyPoecrGksQw1E?= =?iso-8859-1?Q?2otcPcMpy59/R09NR9TSdidWAdsVVHaNtwdgsQcV8uomgc9eqrdFbU/r8u?= =?iso-8859-1?Q?2yxu0FkrAs65q4Q45y1y2nr0Sctv2rG8W1NiXCbrGO0JYbLUdoCF6V8cbw?= =?iso-8859-1?Q?+nA9seVbOZ+L4LtoeG7uHsnLl9tnOp64BXatIIG5a7VYvixPqBbQobeDaT?= =?iso-8859-1?Q?Q1fI1IcS/18jVSNnpgec3KKhlY+xJ1SwUATHRCCaR4tzL6vMOAofIptYNr?= =?iso-8859-1?Q?FyJXzeiradRCHjUcuw9gpXyJpXevjKnvzF8mSLK/nfQbVyo+e1/h/FHdXH?= =?iso-8859-1?Q?wJZY7aZmWoO6A8r9MkibyMbW9vwPVfQTnuZIpv02P9ZU9oKDcLZkuoI2Pl?= =?iso-8859-1?Q?lGoCai7dLDSFWl9hGmPTImxHw7ayadpXUEy+n6EZOiU5tlnSNnlzQVgDlP?= =?iso-8859-1?Q?1Whcd6wdjLs1pk8YLku3cxIlrdsFFzUNoQ8CN3j7AborodFFpKKzkbE34A?= =?iso-8859-1?Q?yo6OD2PeTzM7uFKCFMuTOb0++DzA+RYdkgj9zWGi/7B6g7h6wY+ivdy4OI?= =?iso-8859-1?Q?KPnctKFHhqqENlLt5imfvgPQPvnvBV3a1XpjQLnpxSkXvD8he653ApFQkE?= =?iso-8859-1?Q?ZV3YlVmC2pFSSpkNwHZ/onLfp8LLdFd+vfOGQOSfOFKmp3/biRY4BdRUxg?= =?iso-8859-1?Q?ngXoTHDktmNtldZUaHAABin8flqB68dbuH5i9PSe55a4apvdhzjydGn1nI?= =?iso-8859-1?Q?y0DSPbwDG8IML4N7t2U0UoAmzQJRkkR2KBXP+YlWltmHbRBFIMNSQoTDh2?= =?iso-8859-1?Q?QAzMPvIg87Zz0WTF0XmBrV3U09GBFVrylipT6yg49d2bFI+GuWanSjA1Dx?= =?iso-8859-1?Q?GCqRR1c7vbTuc4s2LACrM+ejnAU1tUjf/FbuoZL0PzHO?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?DIitWTxjgnHqae8mvB6UVgpzeq/Ed6SmbpDVey0Do4d0WSPvpNggM7DCxE?= =?iso-8859-1?Q?Y4c4r7rdoz2z9lJ5mJgy0xMWtiJGVTGKLSDtdaJ24qPSumsnT6Otf1KYqz?= =?iso-8859-1?Q?dFk7vVyDiNN3tVUSP68dYGQCwbjeVi/JFq2ZbYjgo7Hp/wOVBkdkTTSd/9?= =?iso-8859-1?Q?tAbN2llJL/5SyViTu6+wDplGdQm5f1uha5jaFnY7nOmfQ1exTIqY3AKEEN?= =?iso-8859-1?Q?jXf44yuC23ftQQQ3m9iLj1jpGa3nkDmydLzO04trTXiwV33Q4PkqvfcGLm?= =?iso-8859-1?Q?veaTNtzoMQa8GsIWZCDDgMXsN1SEDhkUpuZcwwLY7q9bH2nzZrMUqlqwHp?= =?iso-8859-1?Q?7LYyA0RoGcaVoLZcal08xByrWTS5AzEo7MZ3bi7lBqlupVV0qFcVGzI6SS?= =?iso-8859-1?Q?pcNDtf2kUH4WlVd+j/KB0LfyN0Pj454cz2xay+27aRtf86yr4TmtSsxNER?= =?iso-8859-1?Q?zo+qZexC03vDk30j+6xmdoXB7obdoUQaKPzlGo5CJve1KNFKpylqd8kBq6?= =?iso-8859-1?Q?4ufzDTGitccwSU2yhxLrBtPn+LtGRA70mXSRXh1V9sv+9ES1LdT45DgV4H?= =?iso-8859-1?Q?WE8VplHj++zUxeVZolavRHCaYN1wHBrdUPUMOZD3n/ir8Q48H3wWsNsP6a?= =?iso-8859-1?Q?ZfIaIVHiD0vdkeXRr8uGzCQsWKTRT6IfGffI3cnXX7KtBYE1U/DGlnQWyN?= =?iso-8859-1?Q?IF824deI7FF3K/2FMZXdLB7xvuiEKKbSg3z1iiDyWtAsB1oDSYJAu+MEyQ?= =?iso-8859-1?Q?2a1FGo5Q/dwJu1286DcsRksinPbe/BttduvW9yCOVvraq7D5mbBuw9neKw?= =?iso-8859-1?Q?VXZjRwVmaUhwu845yjl4ud5VWU99numgJt7nyRhNd2qx+QV2wNz4lDO1eL?= =?iso-8859-1?Q?iIbIBIPoQNO7/argIto9exk7fpHQEbD+3cJAlQQFhzQQoBP3eKqb6BhqYy?= =?iso-8859-1?Q?gfctyyqqD+Y36ApuXhOgQn4l8GdcycUeQKzCqA5Kdb+/T8bbvgtB9yZKi6?= =?iso-8859-1?Q?DBf/h6melk5EN6YpnR124eR5v/2t/X/d7uQYUIwO4DBSjUD1O+onDPmj81?= =?iso-8859-1?Q?jrxqykOf1AXyuBEmar8/JpBbODW47se4382siW5eMSc07E9GzGYT0QW90b?= =?iso-8859-1?Q?tTfFAdto2gmMnOZLdDcdCXaprIuNE4eWIXiZ9YjoyitqOxfAg5i+wWGt3t?= =?iso-8859-1?Q?/FXEF3Ubx+wdrjfrWmJzdpQKQu6Q/8325vrlSZtEvCUNRUTy7ppkH3fBht?= =?iso-8859-1?Q?N0yhTTN/cHaFBIFRZTnHI5IXvjAST7p+CG/ART6w8=3D?= Content-Type: multipart/alternative; boundary="_000_AS8P251MB08540FEAB2CBBE1C3EC883C6975E2AS8P251MB0854EURP_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7741-18-msonline-outlook-53ebb.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8P251MB0854.EURP251.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 627a895c-d331-4964-1bcb-08dd00e4a0b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2024 17:33:30.4437 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P251MB0176 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 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 (-) --_000_AS8P251MB08540FEAB2CBBE1C3EC883C6975E2AS8P251MB0854EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable That workaround worked in 2014, but now "libfuse" seems to search under "/u= sr/bin" and not "/run/setuid-programs". The `DFUSERMOUNT_DIR` modification = doesn't seem to work anymore. I think to reproduce all what is needed is `s= trace` with follow forks to see the software seeking "/usr/bin." And person= ally, I use an "AppImage" to invoke fuse that will seek for `fusermount3` The author of libfuse will push an update in the future for libfuse to give= up upon searching binaries by itself and only relying on $PATH simply, but= that's not for now... --_000_AS8P251MB08540FEAB2CBBE1C3EC883C6975E2AS8P251MB0854EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
That workaround worked in 2014, but now "libfuse" seems to search= under "/usr/bin" and not "/run/setuid-programs". The `= DFUSERMOUNT_DIR` modification doesn't seem to work anymore. I think to repr= oduce all what is needed is `strace` with follow forks to see the software seeking "/usr/bin." And personally, I use an "= AppImage" to invoke fuse that will seek for `fusermount3`

The author of libfuse will push an update in the future for libfuse to give= up upon searching binaries by itself and only relying on $PATH simply, but= that's not for now...
--_000_AS8P251MB08540FEAB2CBBE1C3EC883C6975E2AS8P251MB0854EURP_-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 15 12:02:23 2024 Received: (at 73842) by debbugs.gnu.org; 15 Nov 2024 17:02:23 +0000 Received: from localhost ([127.0.0.1]:50700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBziA-0006Ee-H9 for submit@debbugs.gnu.org; Fri, 15 Nov 2024 12:02:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBzi8-0006ER-HH for 73842@debbugs.gnu.org; Fri, 15 Nov 2024 12:02:21 -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 1tBzhz-000596-Ds; Fri, 15 Nov 2024 12:02:11 -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=NyoMzOU6JYzwP4gQzeSDBk/J/6NvcydJAC0DVgi2oM4=; b=cy4W24lnC3PejL+yopsB MWC/Tq1gYy9gwS8OiZ7z05Q36A1Z4KkVM/aWYO0U0KKY+QiTcMXQ2QeQqEiVROrFAewBcLrIwLvPE qt7F18RgWiwJznzW18+fMgwdXm4iUw+pdY2czs+mbLNQ43wvJaciqu32Smy7xiJszkjI5B5W01BXT eCYp5Muzkqj268nOhEI8Ew1eFL2HF2VQYWPaYwyDiRngFI6VqNAsMhVHo9ZEbmfm8F75p9FT+7wcM MHiMTi1hSAH7bz9YojhOnC8WpwQUqbLj4ECiQZWWEa9V5hLUUwmm0XmJuh9weWNSLZIvONbuIVKmD TXmQzNJ5e566ug==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v5 2/3] pack: Add support for AppImage pack format. In-Reply-To: <7507b2c56ffbbd8bc051937c5c88bb8c0e3ae8f3.1730998051.git.noelopez@free.fr> (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Thu, 7 Nov 2024 17:50:04 +0100") References: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> <7507b2c56ffbbd8bc051937c5c88bb8c0e3ae8f3.1730998051.git.noelopez@free.fr> Date: Fri, 15 Nov 2024 18:02:07 +0100 Message-ID: <87h688l9bk.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: 0.7 (/) X-Debbugs-Envelope-To: 73842 Cc: Josselin Poiret , 73842@debbugs.gnu.org, Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , =?utf-8?Q?No=C3=A9?= Lopez , Tobias Geerinckx-Rice , pelzflorian , Sebastian =?utf-8?Q?D=C3=BCmcke?= , Christopher Baines 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: -0.3 (/) Hello No=C3=A9, The patch series LGTM, and tests pass: we=E2=80=99re all set! But=E2=80=A6 one thing I noticed when trying it out is that the resulting AppImage would fail to run on relatively bare-bones non-Guix systems: --8<---------------cut here---------------start------------->8--- $ ./2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImage=20 fuse: failed to exec fusermount3: No such file or directory Cannot mount AppImage, please check your FUSE setup. You might still be able to extract the contents of this AppImage=20 if you run it with the --appimage-extract option.=20 See https://github.com/AppImage/AppImageKit/wiki/FUSE=20 for more information open dir error: No such file or directory --8<---------------cut here---------------end--------------->8--- I wonder if there=E2=80=99s something that can be done on our side about it= or if it=E2=80=99s a limitation of the approach (I expect the latter: =E2=80= =98fusermount=E2=80=99 has to be available and setuid root), in which case we could just add a warning in the manual. WDYT? Interestingly, it works on my Guix System laptop, except if I strace it: --8<---------------cut here---------------start------------->8--- $ /gnu/store/2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImage= =20 Hello, world! $ strace -f -o /tmp/log.strace -s 500 /gnu/store/2i2l6irl2n8q24aimfmidvlgll= lc4s8z-hello-appimage-pack.AppImage=20 fusermount3: mount failed: Operation not permitted Cannot mount AppImage, please check your FUSE setup. You might still be able to extract the contents of this AppImage=20 if you run it with the --appimage-extract option.=20 See https://github.com/AppImage/AppImageKit/wiki/FUSE=20 for more information open dir error: No such file or directory $ grep 'mount(' /tmp/log.strace=20 17569 mount("2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImage"= , "/tmp/.mount_2i2l6iLZ8WYZ", "fuse.2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-= appimage-pack.AppImage", MS_RDONLY|MS_NOSUID|MS_NODEV, "fd=3D5,rootmode=3D4= 0000,user_id=3D1000,group_id=3D998") =3D -1 EPERM (Operation not permitted) 17570 mount("2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImage"= , ".", "fuse.2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImage"= , MS_RDONLY|MS_NOSUID|MS_NODEV, "fd=3D6,rootmode=3D40000,user_id=3D1000,gro= up_id=3D998") =3D -1 EPERM (Operation not permitted) 17571 mount("/dev/fuse", ".", "fuse", MS_RDONLY|MS_NOSUID|MS_NODEV, "fd=3D6= ,rootmode=3D40000,user_id=3D1000,group_id=3D998") =3D -1 EPERM (Operation n= ot permitted) --8<---------------cut here---------------end--------------->8--- Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 17 11:27:05 2024 Received: (at 73842) by debbugs.gnu.org; 17 Nov 2024 16:27:05 +0000 Received: from localhost ([127.0.0.1]:58236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCi77-0002Cs-38 for submit@debbugs.gnu.org; Sun, 17 Nov 2024 11:27:05 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:51805) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCi73-0002CL-SL for 73842@debbugs.gnu.org; Sun, 17 Nov 2024 11:27:03 -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:References: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=wUQzzO36hegOYzqWr2FN4/TgaNHpU4PgI74iJRz8+LU=; b=n zcyqqwEgwWlKG6IeA7kDeu3jRMWUu3UdQ1Aa0eznywfKHtNG4gMuBzcvru/do5e11TagJgHNmfdGK IQbswK38dxgBBKwkZGGuq5wpUz7nkrKbZl2DGNRhO0t/EGbLAO6MVpQDVSwJ9gQGAwNMb4/qAgtEK 3MDC5RuiSMf0tja2Ku7QsOUBjDYiDer60aO7yFrOo2cxgfkBHVnzFuiA4bVIuwqYthm4XqAKzcJNS ASjNga/+3Ysdkd40corGVm4wdI/eBjQwlxkyiLAHiEoVT8/ql68StO1DEusEaO2iEEZ9L3wMlyiKH rxsC0uGNo+S8Yk/hY1aJMITQyk4g+du3A==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tCi4r-00C0Nw-MY; Sun, 17 Nov 2024 17:24:45 +0100 From: =?utf-8?Q?No=C3=A9_Lopez?= To: 73842@debbugs.gnu.org Subject: =?utf-8?Q?=5BNo=C3=A9?= Lopez] Re: [bug#73842] [PATCH v5 2/3] pack: Add support for AppImage pack format. References: <87ttc5q1b3.fsf@xn--no-cja.eu> Date: Sun, 17 Nov 2024 17:25:53 +0100 Message-ID: <87mshxq12m.fsf@xn--no-cja.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: Josselin Poiret , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , =?utf-8?Q?No=C3=A9?= Lopez , Tobias Geerinckx-Rice , pelzflorian , Sebastian =?utf-8?Q?D?= =?utf-8?Q?=C3=BCmcke?= , Christopher Baines 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 (-) Forwarding here since I replied instead of replied to all :/ -------------------- Start of forwarded message -------------------- From: No=C3=A9 Lopez To: Ludovic Court=C3=A8s Subject: Re: [bug#73842] [PATCH v5 2/3] pack: Add support for AppImage pack format. Date: Sun, 17 Nov 2024 17:20:48 +0100 Hi Ludovic, Ludovic Court=C3=A8s writes: > Hello No=C3=A9, > > The patch series LGTM, and tests pass: we=E2=80=99re all set! > Great! Thanks a lot for the time you spent reviewing. > But=E2=80=A6 one thing I noticed when trying it out is that the resulting > AppImage would fail to run on relatively bare-bones non-Guix systems: > > --8<---------------cut here---------------start------------->8--- > $ ./2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImage=20 > fuse: failed to exec fusermount3: No such file or directory > > Cannot mount AppImage, please check your FUSE setup. > You might still be able to extract the contents of this AppImage=20 > if you run it with the --appimage-extract option.=20 > See https://github.com/AppImage/AppImageKit/wiki/FUSE=20 > for more information > open dir error: No such file or directory > --8<---------------cut here---------------end--------------->8--- > > I wonder if there=E2=80=99s something that can be done on our side about = it or > if it=E2=80=99s a limitation of the approach (I expect the latter: =E2=80= =98fusermount=E2=80=99 > has to be available and setuid root), in which case we could just add a > warning in the manual. > > WDYT? This is an expected error from the AppImage runtime, as said in the output the runtime depends on FUSE=C2=A03 to mount the AppImage. The AppImage can still be ran using --appimage-extract-and-run, which I believe we noted in the documentation: >The runtime used by AppImages makes use of libfuse to mount the image >quickly. If libfuse is not available, the AppImage can still be started >using the @option{--appimage-extract-and-run} flag. As for things that can be done from our side, we could change runtime to one that uses other technologies just like supported by =E2=80=9C-RR=E2=80= =9D. > > Interestingly, it works on my Guix System laptop, except if I strace it: > > --8<---------------cut here---------------start------------->8--- > $ /gnu/store/2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImag= e=20 > Hello, world! > $ strace -f -o /tmp/log.strace -s 500 /gnu/store/2i2l6irl2n8q24aimfmidvlg= lllc4s8z-hello-appimage-pack.AppImage=20 > fusermount3: mount failed: Operation not permitted > > Cannot mount AppImage, please check your FUSE setup. > You might still be able to extract the contents of this AppImage=20 > if you run it with the --appimage-extract option.=20 > See https://github.com/AppImage/AppImageKit/wiki/FUSE=20 > for more information > open dir error: No such file or directory > $ grep 'mount(' /tmp/log.strace=20 > 17569 mount("2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImag= e", "/tmp/.mount_2i2l6iLZ8WYZ", "fuse.2i2l6irl2n8q24aimfmidvlglllc4s8z-hell= o-appimage-pack.AppImage", MS_RDONLY|MS_NOSUID|MS_NODEV, "fd=3D5,rootmode= =3D40000,user_id=3D1000,group_id=3D998") =3D -1 EPERM (Operation not permit= ted) > 17570 mount("2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImag= e", ".", "fuse.2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImag= e", MS_RDONLY|MS_NOSUID|MS_NODEV, "fd=3D6,rootmode=3D40000,user_id=3D1000,g= roup_id=3D998") =3D -1 EPERM (Operation not permitted) > 17571 mount("/dev/fuse", ".", "fuse", MS_RDONLY|MS_NOSUID|MS_NODEV, "fd= =3D6,rootmode=3D40000,user_id=3D1000,group_id=3D998") =3D -1 EPERM (Operati= on not permitted) > --8<---------------cut here---------------end--------------->8--- > > Ludo=E2=80=99. I=E2=80=99m pretty sure a process attached with ptrace can=E2=80=99t exec S= UID programs, for security reasons (ptrace allows you to change the code of the attached program so its a privilege escalation). I think you can run it with =E2=80=9Csudo -E strace -f -o /tmp/log.strace -= s 500 /gnu/store/2i2l6irl2n8q24aimfmidvlglllc4s8z-hello-appimage-pack.AppImage=E2= =80=9D. Have a nice day, No=C3=A9 -------------------- End of forwarded message -------------------- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 20 07:05:24 2024 Received: (at 73842) by debbugs.gnu.org; 20 Nov 2024 12:05:25 +0000 Received: from localhost ([127.0.0.1]:45631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDjSW-0000VL-Gs for submit@debbugs.gnu.org; Wed, 20 Nov 2024 07:05:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDjSV-0000SZ-C9 for 73842@debbugs.gnu.org; Wed, 20 Nov 2024 07:05:23 -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 1tDjSP-0001F2-TE; Wed, 20 Nov 2024 07:05:17 -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=6CSA7m1rj919SMgL9G39SZiXXAG5LcMn7bkBmiNlxrY=; b=PNViVgjMCJIjv07MDpdR cTWe5NXw5nZE8g86XdRKZX+MKtoIFmJ5fK6U98xAPHXpXQt/N9mt7lcmmftQJAO1M5UkvmHOi+N4E S1o9VzSwHqiYxd8Q/CfRLNmUpnkww76tb9SVDo0Xe8E/FanwTyhQMUGmp4mXyMY8pLMSOwNIpSL9D lnCXpnVdXRNFDfFAjFludumJRZNz7w9QjCVsRVCEiOyrT54kpJ4g5b4MMaAfNarBfjwPKJE00IJOi BiI61vGMtVolwia8i47Yf5TC0BA66JOkAa29opZvnIzwg/VFQzVYT6MTi/IS45Z++Sa9ioU+pAuXu YgOUYk/kwaTSig==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v5 2/3] pack: Add support for AppImage pack format. In-Reply-To: <87ttc5q1b3.fsf@xn--no-cja.eu> (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sun, 17 Nov 2024 17:20:48 +0100") References: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> <7507b2c56ffbbd8bc051937c5c88bb8c0e3ae8f3.1730998051.git.noelopez@free.fr> <87h688l9bk.fsf@gnu.org> <87ttc5q1b3.fsf@xn--no-cja.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 30 Brumaire an 233 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Rouleau X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 20 Nov 2024 13:05:15 +0100 Message-ID: <87ed36xg90.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: 73842 Cc: 73842@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, (+Cc: issue.) No=C3=A9 Lopez skribis: > This is an expected error from the AppImage runtime, as said in the > output the runtime depends on FUSE=C2=A03 to mount the AppImage. > > The AppImage can still be ran using --appimage-extract-and-run, which I > believe we noted in the documentation: > >>The runtime used by AppImages makes use of libfuse to mount the image >>quickly. If libfuse is not available, the AppImage can still be started >>using the @option{--appimage-extract-and-run} flag. Oh right. Perhaps we can tweak it to explicitly mention that =E2=80=98fusermount3=E2=80=99 must be in $PATH (as opposed to referring to = =E2=80=9Clibfuse=E2=80=9D). WDYT? (If you prefer I can make this change and push the whole thing; it=E2=80=99s just a fine point.) > As for things that can be done from our side, we could change runtime to > one that uses other technologies just like supported by =E2=80=9C-RR=E2= =80=9D. Yup. The two techniques are definitely close to one another! > I=E2=80=99m pretty sure a process attached with ptrace can=E2=80=99t exec= SUID programs, > for security reasons (ptrace allows you to change the code of the > attached program so its a privilege escalation). Yes, that makes sense. Thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 08:42:00 2024 Received: (at 73842) by debbugs.gnu.org; 23 Nov 2024 13:42:00 +0000 Received: from localhost ([127.0.0.1]:57173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEqOe-0007ep-30 for submit@debbugs.gnu.org; Sat, 23 Nov 2024 08:42:00 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:34763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEqOc-0007ec-2D for 73842@debbugs.gnu.org; Sat, 23 Nov 2024 08:41:59 -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:References:In-Reply-To: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=3fkIKm7SgMt6vqCqOuOZUeNkZVbTxn0jbBhmenrPFWI=; b=T gqdm6v6cSFFOuucZNgHG3eCXy3s/9wM3eqKUnTo2SxZvK+IkU2SFXuDXCoDnvYGJlTaRaiAmb1uSB 7L3pwaP6ACGFivV9iVcev9Pd6UQgFMjan0lhRF8TY+FY2nK2jTYOUwsqaYbUvpca6VFcvJ+c/gh6T tnCoaV5/ATWQqXZ5ydK2Z7ZeutXJCRdTSze+0b434wSo/HBbg5iOWQaYZW1j9vEoHDQoh1lo6HKlI nt3yndh9fBNIzgtwq2/HGyTRlyXJKBUmYAl2PLEv+WQEme8yBD2dLlMdBOZLTcc5PEePCas63Sc+e VlnnQ1fohdgmD32MolK0R5RTfkhMSjOXw==; Received: from smtp by smtp.domeneshop.no with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) id 1tEqMQ-00GEjB-3s; Sat, 23 Nov 2024 14:39:42 +0100 From: =?utf-8?Q?No=C3=A9?= Lopez To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#73842] [PATCH v5 2/3] pack: Add support for AppImage pack format. In-Reply-To: <87ed36xg90.fsf@gnu.org> References: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> <7507b2c56ffbbd8bc051937c5c88bb8c0e3ae8f3.1730998051.git.noelopez@free.fr> <87h688l9bk.fsf@gnu.org> <87ttc5q1b3.fsf@xn--no-cja.eu> <87ed36xg90.fsf@gnu.org> Date: Sat, 23 Nov 2024 14:40:53 +0100 Message-ID: <871pz2kqze.fsf@xn--no-cja.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73842 Cc: 73842@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: -1.0 (-) Hi, Ludovic Court=C3=A8s writes: > Hi, > > (+Cc: issue.) > > No=C3=A9 Lopez skribis: > >> This is an expected error from the AppImage runtime, as said in the >> output the runtime depends on FUSE=C2=A03 to mount the AppImage. >> >> The AppImage can still be ran using --appimage-extract-and-run, which I >> believe we noted in the documentation: >> >>>The runtime used by AppImages makes use of libfuse to mount the image >>>quickly. If libfuse is not available, the AppImage can still be started >>>using the @option{--appimage-extract-and-run} flag. > > Oh right. Perhaps we can tweak it to explicitly mention that > =E2=80=98fusermount3=E2=80=99 must be in $PATH (as opposed to referring t= o =E2=80=9Clibfuse=E2=80=9D). > WDYT? > > (If you prefer I can make this change and push the whole thing; it=E2=80= =99s > just a fine point.) > That would be the easiest, thanks! >> As for things that can be done from our side, we could change runtime to >> one that uses other technologies just like supported by =E2=80=9C-RR=E2= =80=9D. > > Yup. The two techniques are definitely close to one another! > >> I=E2=80=99m pretty sure a process attached with ptrace can=E2=80=99t exe= c SUID programs, >> for security reasons (ptrace allows you to change the code of the >> attached program so its a privilege escalation). > > Yes, that makes sense. > > Thank you! > > Ludo=E2=80=99. Thank you :) No=C3=A9 From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 11:02:09 2024 Received: (at 73842) by debbugs.gnu.org; 23 Nov 2024 16:02:10 +0000 Received: from localhost ([127.0.0.1]:58722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEsaH-00069D-Go for submit@debbugs.gnu.org; Sat, 23 Nov 2024 11:02:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEsaD-00068T-Jm for 73842@debbugs.gnu.org; Sat, 23 Nov 2024 11:02:07 -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 1tEsa7-0002wJ-Fn; Sat, 23 Nov 2024 11:01:59 -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=KFPPWKDLY+FMg0ZEW6eFsd+o3aPctTNi2ovkRocMCvY=; b=Qc5HRvLwgvaNxcn0HnBx dZR109S2rIrthpICdbNdlN/880V6seJg5OPMiflU9k48yKzODwfkoDKwFZElqJ5l005xUTe3TsFTE P/eEtRcOE07+sGAvWXXgwzJMXoRJOB5kdMDOOo0P47hnZydJ86OOpIm7VBDmxc3ej8wkirjBLvNlG HEoYnsbKbFh1Lsn2yCYepPpT6wC4d7tDvkyOwjwa829kl/xtNtqok5P1fUOM3/mdOnPtUBebd/mpS pvY1ZJu3h7UnMkeV8lSGGMkMLAdI2xmP+2Mt2/B8W0CLy1FXSEZXwtNkfOojKDBkFSN8ZnqIMHnhB bE9ylyyiim+yqA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?No=C3=A9?= Lopez Subject: Re: [bug#73842] [PATCH v5 2/3] pack: Add support for AppImage pack format. In-Reply-To: <871pz2kqze.fsf@xn--no-cja.eu> (=?utf-8?Q?=22No=C3=A9?= Lopez"'s message of "Sat, 23 Nov 2024 14:40:53 +0100") References: <4a7795be82c20d9476dbefcbaf3c380dcb61581e.1730998051.git.noelopez@free.fr> <7507b2c56ffbbd8bc051937c5c88bb8c0e3ae8f3.1730998051.git.noelopez@free.fr> <87h688l9bk.fsf@gnu.org> <87ttc5q1b3.fsf@xn--no-cja.eu> <87ed36xg90.fsf@gnu.org> <871pz2kqze.fsf@xn--no-cja.eu> Date: Sat, 23 Nov 2024 17:01:56 +0100 Message-ID: <87ttbyos5n.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: 73842 Cc: 73842@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 Hey No=C3=A9, 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 =E2=80=98fusermount3=E2=80=99 or FUSE in general in the build envir= onment. Indeed, those tests were not building anything at all because the =E2=80=98check=E2=80=99 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_b74cb= 93b3ec3113d87e0f1da08dcd973/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=E2=80=99s best to have working tests for features like this. (Please open a new issue to follow up on this.) Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =C2=A9 2017-2021, 2023 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2017-2021, 2023, 2024 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2018 Ricardo Wurmus ;;; Copyright =C2=A9 2021, 2023 Maxim Cournoyer ;;; Copyright =C2=A9 2023 Oleg Pykhalov @@ -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-extra= ct-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))))) =20 (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)))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 11:02:18 2024 Received: (at control) by debbugs.gnu.org; 23 Nov 2024 16:02:18 +0000 Received: from localhost ([127.0.0.1]:58726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEsaQ-00069c-0c for submit@debbugs.gnu.org; Sat, 23 Nov 2024 11:02:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEsaK-000695-8g for control@debbugs.gnu.org; Sat, 23 Nov 2024 11:02:12 -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 1tEsaF-0002xE-31 for control@debbugs.gnu.org; Sat, 23 Nov 2024 11:02:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=OgJrGYy0TLQKYyrtDDeykmRhRjg7sBmcVfkaSFO9raA=; b=EEpICwkjTO4KDN 4B4ay9SAkJGjPfNyLNlW5VZGVtCOCN7JPNE7xjF4iGaUHww7GgXfycSnQXQ2rnbyTnmQmUQZqI41F GMm01+xGhVPRvE3fFK7jKehM0RlBSP9CqhLbM38411c1hlfabmq1ly9dxskwZijhdeYHLRhs+KQ5u zWgkgWm0aOKnEbTthIx1aPz6vy+oNa8gE9Kdq2jaSe3nZ0kd1l6YymMJ7PY5AdbvJ6K2pn4u8Zm2K eDD/yGVKAAhJ69IBtE71m8gOu6jk69HvsOXR6lQyfj/gaRVJ9c6oBkqp3oFVs7C9gmN6Uu2Mbl3Km RhVzIprl7B/7sZ0UUkSw==; Date: Sat, 23 Nov 2024 17:02:05 +0100 Message-Id: <87serios5e.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #73842 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) close 73842 quit From unknown Thu Jun 19 13:56:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 22 Dec 2024 12:24:09 +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