bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52181: [core-update-frozen] many rust package can't build because th


From: Z572
Subject: bug#52181: [core-update-frozen] many rust package can't build because them source file-name use ".crate" suffix.
Date: Mon, 29 Nov 2021 22:31:48 +0800
User-agent: mu4e 1.6.10; emacs 29.0.50

hello,

many rust package can't build in core-update-frozen because them
source file-name use ".crate" suffix.

core-update-frozen change unpack phase:
see guix/build/gnu-build-system.scm unpack phase:

#+BEGIN_SRC diff
@@ -156,13 +157,25 @@
         ;; Preserve timestamps (set to the Epoch) on the copied tree so that
         ;; things work deterministically.
         (copy-recursively source "."
-                          #:keep-mtime? #t))
+                          #:keep-mtime? #t)
+        ;; Make the source checkout files writable, for convenience.
+        (for-each (lambda (f)
+                    (false-if-exception (make-file-writable f)))
+                  (find-files ".")))
       (begin
-        (if (string-suffix? ".zip" source)
-            (invoke "unzip" source)
-            (invoke "tar" "xvf" source))
-        (chdir (first-subdirectory "."))))
-  #t)
+        (cond
+         ((string-suffix? ".zip" source)
+          (invoke "unzip" source))
+         ((tarball? source)
+          (invoke "tar" "xvf" source))
+         (else
+          (let ((name (strip-store-file-name source))
+                (command (compressor source)))
+            (copy-file source name)
+            (when command
+              (invoke command "--decompress" name)))))
+        ;; Attempt to change into child directory.
+        (and=> (first-subdirectory ".") chdir))))

#+END_SRC

and guix/build/utils.scm:

#+BEGIN_SRC scheme
(define (tarball? file-name)
  "True when FILE-NAME has a tar file extension."
  (string-match "\\.(tar(\\..*)?|tgz|tbz)$" file-name))
#+END_SRC

".crate" no match it.

so

#+BEGIN_SRC bash
$ ls /tmp/guix-build-rust-pkg-config-0.3.19.drv-0/
environment-variables  rust-pkg-config-0.3.19.crate
#+END_SRC

I think have 2 option:

 1. change suffix from ".crate" to ".tar.gz".
 2. maybe let "tarball?" check file like command-line program "file", no
 just check filename suffix.

-- 
over





reply via email to

[Prev in Thread] Current Thread [Next in Thread]