all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Z572 via Bug reports for GNU Guix <bug-guix@gnu.org>
To: 52181@debbugs.gnu.org
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	[thread overview]
Message-ID: <tencent_F82CC43F0E9DD3F29392EF5AE24D9CD48307@qq.com> (raw)
Message-ID: <87o863owrp.fsf@qq.com> (raw)


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	other threads:[~2021-11-29 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 14:31 Z572 via Bug reports for GNU Guix [this message]
2021-11-29 14:31 ` bug#52181: [core-update-frozen] many rust package can't build because them source file-name use ".crate" suffix Z572 via Bug reports for GNU Guix
2021-11-29 19:16 ` Maxime Devos
2021-11-29 19:34   ` Maxime Devos
2021-11-30 13:45 ` Efraim Flashner
2021-12-01 13:15   ` Z572 via Bug reports for GNU Guix
2021-12-01 13:15     ` Z572 via Bug reports for GNU Guix
2021-12-02  8:36     ` Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_F82CC43F0E9DD3F29392EF5AE24D9CD48307@qq.com \
    --to=bug-guix@gnu.org \
    --cc=52181@debbugs.gnu.org \
    --cc=873216071@qq.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.