GNU bug report logs - #52181
[core-update-frozen] many rust package can't build because them source file-name use ".crate" suffix.

Previous Next

Package: guix;

Reported by: Z572 <873216071 <at> qq.com>

Date: Mon, 29 Nov 2021 15:08:01 UTC

Severity: normal

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#52181: closed ([core-update-frozen] many rust package can't
 build because them source file-name use ".crate" suffix.)
Date: Thu, 02 Dec 2021 08:38:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 2 Dec 2021 10:36:51 +0200
with message-id <YaiFo37RUduwI3wM <at> 3900XT>
and subject line Re: bug#52181: [core-update-frozen] many rust package can't build because them source file-name use ".crate" suffix.
has caused the debbugs.gnu.org bug report #52181,
regarding [core-update-frozen] many rust package can't build because them source file-name use ".crate" suffix.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
52181: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52181
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Z572 <873216071 <at> qq.com>
To: bug-guix <at> gnu.org
Subject: [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
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


[Message part 3 (message/rfc822, inline)]
From: Efraim Flashner <efraim <at> flashner.co.il>
To: 52181-done <at> debbugs.gnu.org
Subject: Re: bug#52181: [core-update-frozen] many rust package can't build
 because them source file-name use ".crate" suffix.
Date: Thu, 2 Dec 2021 10:36:51 +0200
[Message part 4 (text/plain, inline)]
Thanks for the patch. Patch pushed!

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.