Hello,

Efraim Flashner <efr...@flashner.co.il> writes:

> On Sun, Jan 21, 2024 at 10:33:37AM +0100, Janneke Nieuwenhuizen wrote:
>> Hi!
>> 
>> On core-updates, running
>> 
>>     ./pre-inst-env guix build --system=i586-gnu -e '(@@ (gnu packages 
>> commencement) gnu-make-boot0)'
>> 
>> fails for me with
>> 
>>     sh: zstd: command not found
>> 
>> See log below.  FWIW, using --system=i686-linux for example, works fine.

I don't know what it'd only affect non-x86 systems, but I've noticed one
bug in my recent "default to zstd" repack logic, which would name a xz
tarball as .tar.zst.  Perhaps tar then try to use zstd to decompress it,
even if it's really a xz compressed archive?

I have the following commit that fixes this, haven't pushed it yet (it's
a world rebuild).

--8<---------------cut here---------------start------------->8---
modified   guix/packages.scm
@@ -949,10 +949,7 @@ (define* (patch-and-repack source patches
          (bzip2   (lookup-input "bzip2"))
          (lzip    (lookup-input "lzip"))
          (xz      (lookup-input "xz"))
-         (zstd    (or (lookup-input "zstd")
-                      ;; Fallback to xz in case zstd is not available, such as
-                      ;; for bootstrap packages.
-                      xz))
+         (zstd    (lookup-input "zstd"))
          (patch   (lookup-input "patch"))
          (comp    (and=> (compressor source-file-name) lookup-input))
          (patches (map instantiate-patch patches)))
@@ -1033,10 +1030,16 @@ (define* (patch-and-repack source patches
                           locale (system-error-errno args)))))
 
             (setenv "PATH"
-                    (string-append #+zstd "/bin"
-                                   (if #+comp
-                                       (string-append ":" #+comp "/bin")
-                                       "")))
+                    (string-join (fold (lambda (x path)
+                                         (if (and x (not (member x path)))
+                                             (cons x path)
+                                             path))
+                                       '()
+                                       ;; Fallback to xz in case zstd is
+                                       ;; not available, such as for
+                                       ;; bootstrap packages.
+                                       (list #+zstd #+xz #+comp))
+                                 ":"))
 
             (setenv "ZSTD_NBTHREADS" (number->string (parallel-job-count)))
--8<---------------cut here---------------end--------------->8---

-- 
Thanks,
Maxim

Reply via email to