unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#52828] [PATCH] Fix Disarchive fallback on Guix System
@ 2021-12-27 18:39 Timothy Sample
  2022-01-05 20:54 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Timothy Sample @ 2021-12-27 18:39 UTC (permalink / raw)
  To: 52828

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

Hi everyone,

I noticed recently that Disarchive fallback does not work on Guix
System.  This is because the ‘(guix swh)’ module shells out to ‘tar’ to
extract the tarball that it downloads from SWH.  However, when used as
part of ‘guix perform-download’ via the daemon, ‘tar’ is not available.
AFAICS, that the daemon is run with no ‘PATH’ at all.

You can confirm this by running (on Guix System):

    $ GUIX_DOWNLOAD_FALLBACK_TEST=disarchive-mirrors \
          guix build --check -S python-flask

You should see:

    [...]
    Downloading [...] from Software Heritage...
    In procedure fport_write: Broken pipe
    [...]

This patch adds ‘tar’ and ‘gzip’ to the daemon’s ‘PATH’.  To me, this is
the most straight-forward way to fix the issue, but there are others.
Any opinions?


-- Tim


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-guix-Add-tar-and-gzip-to-PATH.patch --]
[-- Type: text/x-patch, Size: 2202 bytes --]

From 2893252c16f3e447eccd0f8d216bfb44b1965c43 Mon Sep 17 00:00:00 2001
From: Timothy Sample <samplet@ngyro.com>
Date: Thu, 23 Dec 2021 22:32:07 -0500
Subject: [PATCH] services: guix: Add tar and gzip to PATH.

* gnu/services/base.scm (guix-shepherd-service): Add the PATH
environment-variable and populate it with tar and gzip.
---
 gnu/services/base.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 88869e40d2..2fad07097b 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -55,7 +55,8 @@ (define-module (gnu services base)
                 #:select (alsa-utils crda eudev e2fsprogs fuse gpm kbd lvm2 rng-tools))
   #:use-module (gnu packages bash)
   #:use-module ((gnu packages base)
-                #:select (coreutils glibc glibc-utf8-locales))
+                #:select (coreutils glibc glibc-utf8-locales tar))
+  #:use-module ((gnu packages compression) #:select (gzip))
   #:autoload   (gnu packages guile-xyz) (guile-netlink)
   #:autoload   (gnu packages hurd) (hurd)
   #:use-module (gnu packages package-management)
@@ -1709,7 +1710,14 @@ (define (guix-shepherd-service config)
                                  (string-append "GUIX_LOCPATH="
                                                 #$glibc-utf8-locales
                                                 "/lib/locale")
-                                 "LC_ALL=en_US.utf8")
+                                 "LC_ALL=en_US.utf8"
+                                 ;; Make 'tar' and 'gzip' available so
+                                 ;; that 'guix perform-download' can use
+                                 ;; them when downloading from Software
+                                 ;; Heritage via '(guix swh)'.
+                                 (string-append "PATH="
+                                                #$(file-append tar "/bin") ":"
+                                                #$(file-append gzip "/bin")))
                            (if proxy
                                (list (string-append "http_proxy=" proxy)
                                      (string-append "https_proxy=" proxy))
-- 
2.34.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-17 14:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-27 18:39 [bug#52828] [PATCH] Fix Disarchive fallback on Guix System Timothy Sample
2022-01-05 20:54 ` Ludovic Courtès
2022-01-15 15:33   ` [bug#52828] [PATCH v2] swh: Do not rely on $PATH for tar and gzip Timothy Sample
2022-01-15 21:33     ` [bug#52828] [PATCH] Fix Disarchive fallback on Guix System Ludovic Courtès
2022-01-17  1:00       ` bug#52828: " Timothy Sample
2022-01-17 13:11         ` [bug#52828] " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).