[bug#34385,v2,3/3] guix: ruby-build-system: Fix removal of extension related files.

Message ID 20190208195642.4057-3-mail@cbaines.net
State Accepted
Headers show
Series Ruby build system improvements | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied

Commit Message

Christopher Baines Feb. 8, 2019, 7:56 p.m. UTC
This functionality was broken, possibly to do with the vendor related changes
in the ruby build system. These changes restore the file removal functionality
at the end of the install phase.

* guix/build/ruby-build-system.scm (install): Fix removal of files related to
native extensions.
---
 guix/build/ruby-build-system.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Björn Höfling Feb. 13, 2019, 8:48 p.m. UTC | #1
On Fri,  8 Feb 2019 19:56:42 +0000
Christopher Baines <mail@cbaines.net> wrote:

> This functionality was broken, possibly to do with the vendor related
> changes in the ruby build system. These changes restore the file
> removal functionality at the end of the install phase.
> 
> * guix/build/ruby-build-system.scm (install): Fix removal of files
> related to native extensions.

LGTM.

In particular, the ruby-idn-ruby package is now reproducible.

Thanks,

Björn
Christopher Baines Feb. 14, 2019, 7:30 p.m. UTC | #2
Björn Höfling <bjoern.hoefling@bjoernhoefling.de> writes:

> On Fri,  8 Feb 2019 19:56:42 +0000
> Christopher Baines <mail@cbaines.net> wrote:
>
>> This functionality was broken, possibly to do with the vendor related
>> changes in the ruby build system. These changes restore the file
>> removal functionality at the end of the install phase.
>>
>> * guix/build/ruby-build-system.scm (install): Fix removal of files
>> related to native extensions.
>
> LGTM.
>
> In particular, the ruby-idn-ruby package is now reproducible.

Great, I've pushed these patches to staging now. Thanks for taking a
look :)

Patch

diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index 64b4400f1a..ba0de1259e 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -139,7 +139,8 @@  GEM-FLAGS are passed to the 'gem' invokation, if present."
          (gem-file-basename (basename gem-file))
          (gem-name (substring gem-file-basename
                               0
-                              (- (string-length gem-file-basename) 4))))
+                              (- (string-length gem-file-basename) 4)))
+         (gem-dir (string-append vendor-dir "/gems/" gem-name)))
     (setenv "GEM_VENDOR" vendor-dir)
 
     (or (zero?
@@ -165,7 +166,7 @@  GEM-FLAGS are passed to the 'gem' invokation, if present."
     ;; For gems with native extensions, several Makefile-related files
     ;; are created that contain timestamps or other elements making
     ;; them not reproducible.  They are unnecessary so we remove them.
-    (when (file-exists? (string-append vendor-dir "/ext"))
+    (when (file-exists? (string-append gem-dir "/ext"))
       (for-each (lambda (file)
                   (log-file-deletion file)
                   (delete-file file))
@@ -174,7 +175,7 @@  GEM-FLAGS are passed to the 'gem' invokation, if present."
                              "page-Makefile.ri")
                  (find-files (string-append vendor-dir "/extensions")
                              "gem_make.out")
-                 (find-files (string-append vendor-dir "/ext")
+                 (find-files (string-append gem-dir "/ext")
                              "Makefile"))))
 
     #t))