[PATCH] Specify native search path for all ruby packages

  • Done
  • quality assurance status badge
Details
3 participants
  • Ben Woodcroft
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal
C
C
Christopher Baines wrote on 21 Jun 2017 08:36
(address . guix-patches@gnu.org)
0c3c92c6-05ca-bb36-2f24-69077033e91f@cbaines.net
Without specifying this explicitly in each definition, the GEM_PATH is
inherited and the version is that of the inherited package.
Attachment: signature.asc
C
C
Christopher Baines wrote on 21 Jun 2017 08:38
[PATCH 1/3] gnu: ruby-1.8: Fix search path specification.
(address . 27438@debbugs.gnu.org)
20170621063836.840-1-mail@cbaines.net
* gnu/packages/ruby.scm (ruby-1.8)[native-search-paths]: Specify the native
search path, such that the version included in the path is 1.8, rather than
the inherited version.
---
gnu/packages/ruby.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Toggle diff (21 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 7680f4eae..d9eb93643 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -197,7 +197,13 @@ a focus on simplicity and productivity.")
"lib/mkmf.rb"
"process.c")
(("/bin/sh") (which "sh"))))
- %standard-phases)))))
+ %standard-phases)))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "GEM_PATH")
+ (files (list (string-append "lib/ruby/gems/"
+ (version-major+minor version)
+ ".0"))))))))
(define-public ruby-hoe
(package
--
2.13.1
C
C
Christopher Baines wrote on 21 Jun 2017 08:38
[PATCH 2/3] gnu: ruby-2.2: Fix search path specification.
(address . 27438@debbugs.gnu.org)
20170621063836.840-2-mail@cbaines.net
* gnu/packages/ruby.scm (ruby-2.2)[native-search-paths]: Specify the native
search path, such that the version included in the path is 2.2, rather than
the inherited version.
---
gnu/packages/ruby.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Toggle diff (21 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index d9eb93643..098024fc0 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -134,7 +134,13 @@ a focus on simplicity and productivity.")
"/ruby-" version ".tar.xz"))
(sha256
(base32
- "0lyb7gnbbhs3a3v9grsjgbaixm20wxz6x3h0czyrxnj3cpp8lk13"))))))
+ "0lyb7gnbbhs3a3v9grsjgbaixm20wxz6x3h0czyrxnj3cpp8lk13"))))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "GEM_PATH")
+ (files (list (string-append "lib/ruby/gems/"
+ (version-major+minor version)
+ ".0"))))))))
(define-public ruby-2.1
(package (inherit ruby)
--
2.13.1
C
C
Christopher Baines wrote on 21 Jun 2017 08:38
[PATCH 3/3] gnu: ruby-2.3: Fix search path specification.
(address . 27438@debbugs.gnu.org)
20170621063836.840-3-mail@cbaines.net
* gnu/packages/ruby.scm (ruby-2.3)[native-search-paths]: Specify the native
search path, such that the version included in the path is 2.3, rather than
the inherited version.
---
gnu/packages/ruby.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Toggle diff (21 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 098024fc0..69835a771 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -120,7 +120,13 @@ a focus on simplicity and productivity.")
(snippet `(begin
;; Remove bundled libffi
(delete-file-recursively "ext/fiddle/libffi-3.2.1")
- #t))))))
+ #t))))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "GEM_PATH")
+ (files (list (string-append "lib/ruby/gems/"
+ (version-major+minor version)
+ ".0"))))))))
(define-public ruby-2.2
(package (inherit ruby)
--
2.13.1
B
B
Ben Woodcroft wrote on 21 Jun 2017 13:47
Re: [bug#27438] [PATCH] Specify native search path for all ruby packages
bed7e0fa-4c03-ae62-86d1-b4cd4d04b150@uq.edu.au
Hi Chris,


On 21/06/17 16:36, Christopher Baines wrote:
Toggle quote (3 lines)
> Without specifying this explicitly in each definition, the GEM_PATH is
> inherited and the version is that of the inherited package.
>
I'm not sure if this is by design, but the version of the gems folder is
embedded in the build of each rubygem e.g. 'ruby-hoe' includes
/gnu/store/d867l5i2dqd5qnq4qlsrcwwb0x3443fl-ruby-hoe-3.16.0/lib/ruby/gems/2.4.0

So, in this environment, "require 'hoe'" fails after applying your patch
./pre-inst-env guix environment -C --ad-hoc ruby@2.2 ruby-hoe

Having said that, the gems bundled with each ruby are in a directory
with the actual version e.g. ruby@2.2 has this path
/gnu/store/f43dirk254lfhmgjs3sf515cpfl8d46q-ruby-2.2.7/lib/ruby/gems/2.2.0

This isn't ideal, any ideas on what we should do? Specify both paths maybe?
Thanks,
ben
L
L
Ludovic Courtès wrote on 21 Jun 2017 15:10
(name . Christopher Baines)(address . mail@cbaines.net)(address . 27438@debbugs.gnu.org)
87d19xij0m.fsf@gnu.org
Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (3 lines)
> Without specifying this explicitly in each definition, the GEM_PATH is
> inherited and the version is that of the inherited package.

All 3 patches LGTM, thank you!

Ludo’.
L
L
Ludovic Courtès wrote on 21 Jun 2017 15:12
(name . Ben Woodcroft)(address . b.woodcroft@uq.edu.au)
878tkliix9.fsf@gnu.org
Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:

Toggle quote (8 lines)
> On 21/06/17 16:36, Christopher Baines wrote:
>> Without specifying this explicitly in each definition, the GEM_PATH is
>> inherited and the version is that of the inherited package.
>>
> I'm not sure if this is by design, but the version of the gems folder
> is embedded in the build of each rubygem e.g. 'ruby-hoe' includes
> /gnu/store/d867l5i2dqd5qnq4qlsrcwwb0x3443fl-ruby-hoe-3.16.0/lib/ruby/gems/2.4.0

Or should the search path spec include both lib/ruby/gems/2.2.0 and
lib/ruby/gems/2.4.0, in this order?

Ludo’, who has no experience with Ruby.
B
B
Ben Woodcroft wrote on 22 Jun 2017 07:27
(name . Ludovic Courtès)(address . ludo@gnu.org)
a7ff03f7-fbb0-cb01-26cc-e48409b2670d@uq.edu.au
On 21/06/17 23:12, Ludovic Courtès wrote:
Toggle quote (11 lines)
> Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:
>
>> On 21/06/17 16:36, Christopher Baines wrote:
>>> Without specifying this explicitly in each definition, the GEM_PATH is
>>> inherited and the version is that of the inherited package.
>>>
>> I'm not sure if this is by design, but the version of the gems folder
>> is embedded in the build of each rubygem e.g. 'ruby-hoe' includes
>> /gnu/store/d867l5i2dqd5qnq4qlsrcwwb0x3443fl-ruby-hoe-3.16.0/lib/ruby/gems/2.4.0
> Or should the search path spec include both lib/ruby/gems/2.2.0 and
> lib/ruby/gems/2.4.0, in this order?
Exactly.

Chris, what is your experience? Did you propose the patch because you
ran into a particular issue?

Ta, ben.
C
C
Christopher Baines wrote on 22 Jun 2017 07:40
(address . 27438@debbugs.gnu.org)
6a666d6f-f2c2-d786-8fda-422ab28867ca@cbaines.net
On 22/06/17 06:27, Ben Woodcroft wrote:
Toggle quote (18 lines)
> On 21/06/17 23:12, Ludovic Courtès wrote:
>> Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:
>>
>>> On 21/06/17 16:36, Christopher Baines wrote:
>>>> Without specifying this explicitly in each definition, the GEM_PATH is
>>>> inherited and the version is that of the inherited package.
>>>>
>>> I'm not sure if this is by design, but the version of the gems folder
>>> is embedded in the build of each rubygem e.g. 'ruby-hoe' includes
>>> /gnu/store/d867l5i2dqd5qnq4qlsrcwwb0x3443fl-ruby-hoe-3.16.0/lib/ruby/gems/2.4.0
>>>
>> Or should the search path spec include both lib/ruby/gems/2.2.0 and
>> lib/ruby/gems/2.4.0, in this order?
> Exactly.
>
> Chris, what is your experience? Did you propose the patch because you
> ran into a particular issue?

Yep, I ran in to problems trying to use the guix ruby-2.3 package with
the guix bundler package, when I build bundler with ruby-2.3.

Ben's email got me thinking about how this works in Debian, and it looks
like Debian uses a different location /usr/lib/ruby/vendor_ruby/ .

I think there might be benefits from doing similarly, but this needs a
bit of thought and testing, as I'm unsure how this might work,
especially in cases where libraries include native code that links
against ruby.

I've got a patch for the ruby-build-system to make a change roughly like
this, and I'll send that up soon. Relating this back to the issue at
hand, moving to a version independent directory would mean that the
GEM_PATH wouldn't be version specific.

Thanks,

Chris
Attachment: signature.asc
C
C
Christopher Baines wrote on 16 Jul 2017 19:37
(address . 27438@debbugs.gnu.org)
20170716183705.18b5025e@cbaines.net
On Thu, 22 Jun 2017 06:40:17 +0100
Christopher Baines <mail@cbaines.net> wrote:

Toggle quote (36 lines)
> On 22/06/17 06:27, Ben Woodcroft wrote:
> > On 21/06/17 23:12, Ludovic Courtès wrote:
> >> Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:
> >>
> >>> On 21/06/17 16:36, Christopher Baines wrote:
> >>>> Without specifying this explicitly in each definition, the
> >>>> GEM_PATH is inherited and the version is that of the inherited
> >>>> package.
> >>> I'm not sure if this is by design, but the version of the gems
> >>> folder is embedded in the build of each rubygem e.g. 'ruby-hoe'
> >>> includes /gnu/store/d867l5i2dqd5qnq4qlsrcwwb0x3443fl-ruby-hoe-3.16.0/lib/ruby/gems/2.4.0
> >>>
> >> Or should the search path spec include both lib/ruby/gems/2.2.0 and
> >> lib/ruby/gems/2.4.0, in this order?
> > Exactly.
> >
> > Chris, what is your experience? Did you propose the patch because
> > you ran into a particular issue?
>
> Yep, I ran in to problems trying to use the guix ruby-2.3 package with
> the guix bundler package, when I build bundler with ruby-2.3.
>
> Ben's email got me thinking about how this works in Debian, and it
> looks like Debian uses a different
> location /usr/lib/ruby/vendor_ruby/ .
>
> I think there might be benefits from doing similarly, but this needs a
> bit of thought and testing, as I'm unsure how this might work,
> especially in cases where libraries include native code that links
> against ruby.
>
> I've got a patch for the ruby-build-system to make a change roughly
> like this, and I'll send that up soon. Relating this back to the
> issue at hand, moving to a version independent directory would mean
> that the GEM_PATH wouldn't be version specific.

So... I kind of forgot about this, sorry about that. But I'll send up
the patch shortly.

As an example of what this change means, here is a example of loading
ruby gems with different versions of ruby, with the current and
alternative situations.

I think arel doesn't use native extensions, whereas nokogiri does.
Also, ruby@2.1 is used, as the search path for the guix package
reflects the version of ruby (whereas many others don't).

* Current

** With the version of ruby used to build the gem

→ guix environment --pure --ad-hoc ruby-arel ruby -- ruby -e "puts require 'arel'"
true

(I'm pretty sure the "true" means that it worked)

→ guix environment --pure --ad-hoc ruby-nokogiri ruby -- ruby -e "puts require 'nokogiri'"
true

** With a different version of ruby

→ guix environment --pure --ad-hoc ruby-arel ruby@2.1 -- ruby -e "puts require 'arel'"
/gnu/store/gdg5m75axmrciwh3zhfnsc038q349ymg-ruby-2.1.10/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- arel (LoadError)
from /gnu/store/gdg5m75axmrciwh3zhfnsc038q349ymg-ruby-2.1.10/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'

→ guix environment --pure --ad-hoc ruby-arel ruby@2.1 -- ruby -e "puts require 'nokogiri'"
/gnu/store/gdg5m75axmrciwh3zhfnsc038q349ymg-ruby-2.1.10/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- nokogiri (LoadError)
from /gnu/store/gdg5m75axmrciwh3zhfnsc038q349ymg-ruby-2.1.10/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'


* Alternative

** With the version of ruby used to build the gem

→ guix environment --pure --ad-hoc ruby-arel ruby -- ruby -e "puts require 'arel'"
true

→ guix environment --pure --ad-hoc ruby-nokogiri ruby -- ruby -e "puts require 'nokogiri'"
true

** With a different version of ruby

→ guix environment --pure --ad-hoc ruby-arel ruby@2.1 -- ruby -e "puts require 'arel'"
true

→ guix environment --pure --ad-hoc ruby-nokogiri ruby@2.1 -- ruby -e "puts require 'nokogiri'"
/gnu/store/gdg5m75axmrciwh3zhfnsc038q349ymg-ruby-2.1.10/lib/ruby/2.1.0/fileutils.rb:250:in `mkdir': Read-only file system @ dir_s_mkdir - /gnu/store/jxmi5lr8dbll3pzlzwkafpd9mj1wwxma-profile/lib/ruby/vendor_ruby/extensions/x86_64-linux/2.1.0-static (Errno::EROFS)
from /gnu/store/gdg5m75axmrciwh3zhfnsc038q349ymg-ruby-2.1.10/lib/ruby/2.1.0/fileutils.rb:250:in `fu_mkdir'
...


So, putting the gems in a single location regardless of the version of
ruby they were built with means that a different version of ruby will
at least see them, however, it may still fail to load them.

I think this is an improvement, but I'm very uncertain about ruby. Does
anyone else have opinions on this?
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAllrpEFfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xeqog/+KDNrA/My2SYrvejv5McInH58TORCiqPpQqOxuwUfEGNELF/0JyPFoDfM
W9zVHaXKU3RcxYGlfVC/yXp9K7nNGFl9zABNfmCo1wsbgcofJAyYPqXHKsShOWe7
y6WCnybBCvgcDrUAXJAMary1Ox211DQofGJxf+wCEHkDVW1zNkCAZZ/B5YKTrqhE
C7GRjY5s5MzarqnxoSu4X+TFLMeEO/5b8dtWDtHEgvmmuLO+t3su+6X+LNPrP+ip
AgtT1idgLAzc/2zE+kFtQZo+LPR6qycfMkMems+xJRYVEDR5m2JhucKzMsccn9H4
UE7nZU1TJvtMSVs8MeyjlmyW2SBsLs6oYdSO/8S7gSzFykSHoD4svsu2CmQA8b5l
Ef9mmX29SefLLPUu49IZnctywjiBVOYLaduIk7q6cTUkk+LDEbaKfRXXlrQ258gz
R3a56LdVyeQr7+1bj9VeUEjFugzxvQBofILdchQlnjiuOr+T1LN0n1+cu+xQl1/8
TmlY8sq93FQDtrUXuQobuYyIBwuCHC12SBBBcjy2HwbdE0m5KuNQ9bE0LmWTtiD3
b5tO+blw+D/o+6iuJicoaI6uEtMAa+1UV+QI8lWTmzx8Sbor+EfDejTKG0ZLe8pX
FNRL0dXD2yof5mtIgUWbQS3IJwCA+dMJmrQF4c4kpgusGBolP9k=
=EPDc
-----END PGP SIGNATURE-----


C
C
Christopher Baines wrote on 16 Jul 2017 19:40
[PATCH] guix: build: ruby-build-system: Install to the vendor directory
(address . 27438@debbugs.gnu.org)
20170716174014.21859-1-mail@cbaines.net
From: Christopher Baines <christopher.baines@digital.cabinet-office.gov.uk>

* guix/build/ruby-build-system.scm (install): Install gems to the vendor
directory, rather than the GEM_HOME. The vendor directory does not include
the version of ruby used to install the gem in the path, which makes it
easier to add it to the GEM_PATH for all versions of ruby to use.
* gnu/packages/ruby.scm (ruby,ruby-2.1)[native-search-paths]: Switch to
lib/ruby/vendor_ruby.
---
gnu/packages/ruby.scm | 12 ++----------
guix/build/ruby-build-system.scm | 38 +++++++++++++++++++++++---------------
2 files changed, 25 insertions(+), 25 deletions(-)

Toggle diff (100 lines)
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 7eba68444..f634d5e71 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -93,9 +93,7 @@
(native-search-paths
(list (search-path-specification
(variable "GEM_PATH")
- (files (list (string-append "lib/ruby/gems/"
- (version-major+minor version)
- ".0"))))))
+ (files (list (string-append "lib/ruby/vendor_ruby"))))))
(synopsis "Programming language interpreter")
(description "Ruby is a dynamic object-oriented programming language with
a focus on simplicity and productivity.")
@@ -159,13 +157,7 @@ a focus on simplicity and productivity.")
"lib/mkmf.rb"
"process.c")
(("/bin/sh") (which "sh"))))
- %standard-phases)))
- (native-search-paths
- (list (search-path-specification
- (variable "GEM_PATH")
- (files (list (string-append "lib/ruby/gems/"
- (version-major+minor version)
- ".0"))))))))
+ %standard-phases)))))
(define-public ruby-1.8
(package (inherit ruby)
diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index c2d276627..f4ce2e5d8 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -129,40 +129,48 @@ GEM-FLAGS are passed to the 'gem' invokation, if present."
(assoc-ref inputs "ruby"))
1))
(out (assoc-ref outputs "out"))
- (gem-home (string-append out "/lib/ruby/gems/" ruby-version ".0"))
+ (vendor-dir (string-append out "/lib/ruby/vendor_ruby"))
(gem-file (first-matching-file "\\.gem$"))
(gem-file-basename (basename gem-file))
(gem-name (substring gem-file-basename
0
- (- (string-length gem-file-basename) 4)))
- (gem-directory (string-append gem-home "/gems/" gem-name)))
- (setenv "GEM_HOME" gem-home)
- (mkdir-p gem-home)
- (and (apply system* "gem" "install" gem-file
- "--local" "--ignore-dependencies"
- ;; Executables should go into /bin, not /lib/ruby/gems.
- "--bindir" (string-append out "/bin")
- gem-flags)
+ (- (string-length gem-file-basename) 4))))
+ (setenv "GEM_VENDOR" vendor-dir)
+ (and (let ((install-succeeded?
+ (zero?
+ (apply system* "gem" "install" gem-file
+ "--local" "--ignore-dependencies" "--vendor"
+ ;; Executables should go into /bin, not
+ ;; /lib/ruby/gems.
+ "--bindir" (string-append out "/bin")
+ gem-flags))))
+ (or install-succeeded?
+ (begin
+ (simple-format #t "installation failed\n")
+ (let ((failed-output-dir (string-append (getcwd) "/out")))
+ (mkdir failed-output-dir)
+ (copy-recursively out failed-output-dir))
+ #f)))
(begin
;; Remove the cached gem file as this is unnecessary and contains
;; timestamped files rendering builds not reproducible.
- (let ((cached-gem (string-append gem-home "/cache/" gem-file)))
+ (let ((cached-gem (string-append vendor-dir "/cache/" gem-file)))
(log-file-deletion cached-gem)
(delete-file cached-gem))
;; 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.
- (if (file-exists? (string-append gem-directory "/ext"))
+ (if (file-exists? (string-append vendor-dir "/ext"))
(begin
(for-each (lambda (file)
(log-file-deletion file)
(delete-file file))
(append
- (find-files (string-append gem-home "/doc")
+ (find-files (string-append vendor-dir "/doc")
"page-Makefile.ri")
- (find-files (string-append gem-home "/extensions")
+ (find-files (string-append vendor-dir "/extensions")
"gem_make.out")
- (find-files (string-append gem-directory "/ext")
+ (find-files (string-append vendor-dir "/ext")
"Makefile")))))
#t))))
--
2.13.1
B
B
Ben Woodcroft wrote on 20 Jul 2017 01:39
Re: [bug#27438] [PATCH] Specify native search path for all ruby packages
(address . 27438@debbugs.gnu.org)
cd64e36f-2e18-ad95-c4f1-aadd76884431@uq.edu.au
Hi Chris,


On 17/07/17 03:37, Christopher Baines wrote:
Toggle quote (45 lines)
> On Thu, 22 Jun 2017 06:40:17 +0100
> Christopher Baines <mail@cbaines.net> wrote:
>
>> On 22/06/17 06:27, Ben Woodcroft wrote:
>>> On 21/06/17 23:12, Ludovic Courtès wrote:
>>>> Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:
>>>>
>>>>> On 21/06/17 16:36, Christopher Baines wrote:
>>>>>> Without specifying this explicitly in each definition, the
>>>>>> GEM_PATH is inherited and the version is that of the inherited
>>>>>> package.
>>>>> I'm not sure if this is by design, but the version of the gems
>>>>> folder is embedded in the build of each rubygem e.g. 'ruby-hoe'
>>>>> includes /gnu/store/d867l5i2dqd5qnq4qlsrcwwb0x3443fl-ruby-hoe-3.16.0/lib/ruby/gems/2.4.0
>>>>>
>>>> Or should the search path spec include both lib/ruby/gems/2.2.0 and
>>>> lib/ruby/gems/2.4.0, in this order?
>>> Exactly.
>>>
>>> Chris, what is your experience? Did you propose the patch because
>>> you ran into a particular issue?
>> Yep, I ran in to problems trying to use the guix ruby-2.3 package with
>> the guix bundler package, when I build bundler with ruby-2.3.
>>
>> Ben's email got me thinking about how this works in Debian, and it
>> looks like Debian uses a different
>> location /usr/lib/ruby/vendor_ruby/ .
>>
>> I think there might be benefits from doing similarly, but this needs a
>> bit of thought and testing, as I'm unsure how this might work,
>> especially in cases where libraries include native code that links
>> against ruby.
>>
>> I've got a patch for the ruby-build-system to make a change roughly
>> like this, and I'll send that up soon. Relating this back to the
>> issue at hand, moving to a version independent directory would mean
>> that the GEM_PATH wouldn't be version specific.
> [..]
>
> So, putting the gems in a single location regardless of the version of
> ruby they were built with means that a different version of ruby will
> at least see them, however, it may still fail to load them.
>
> I think this is an improvement, but I'm very uncertain about ruby. Does
> anyone else have opinions on this?
Thanks for working on this. A few thoughts:

What happens to the default gems that come bundled with ruby itself? I'm
interpreting from your patch that these will not be available?

In general, except for some special circumstances, we don't support old
versions of software. To fix the issue that you are encountering
properly with nokogiri probably requires new package definitions using
"package-with-ruby-2.3" or similar to be made, I suppose. Ludo did some
nice work making this easier (see
but I worry in general about the resources required to support older
Ruby versions. WDYT?

The gem-home procedure in ruby-build-system will now return an incorrect
path, I think.

Perhaps I'm slow, but what are the advantages of the "vendor_ruby"
method over exporting multiple GEM_PATHs as Ludo and I suggested?
Changing the directory seems like a heavier touch and so more likely to
misbehave. WDYT?

Apologies if this comes across a little negative, I'm just trying to
consider all the issues. Thanks again for your efforts on this.
ben
C
C
Christopher Baines wrote on 22 Jul 2017 12:06
(name . Ben Woodcroft)(address . b.woodcroft@uq.edu.au)
20170722110630.19b5fce0@cbaines.net
On Thu, 20 Jul 2017 09:39:13 +1000
Ben Woodcroft <b.woodcroft@uq.edu.au> wrote:

Toggle quote (54 lines)
> Hi Chris,
>
>
> On 17/07/17 03:37, Christopher Baines wrote:
> > On Thu, 22 Jun 2017 06:40:17 +0100
> > Christopher Baines <mail@cbaines.net> wrote:
> >
> >> On 22/06/17 06:27, Ben Woodcroft wrote:
> >>> On 21/06/17 23:12, Ludovic Courtès wrote:
> >>>> Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:
> >>>>
> >>>>> On 21/06/17 16:36, Christopher Baines wrote:
> >>>>>> Without specifying this explicitly in each definition, the
> >>>>>> GEM_PATH is inherited and the version is that of the inherited
> >>>>>> package.
> >>>>> I'm not sure if this is by design, but the version of the gems
> >>>>> folder is embedded in the build of each rubygem e.g. 'ruby-hoe'
> >>>>> includes /gnu/store/d867l5i2dqd5qnq4qlsrcwwb0x3443fl-ruby-hoe-3.16.0/lib/ruby/gems/2.4.0
> >>>>>
> >>>> Or should the search path spec include both lib/ruby/gems/2.2.0
> >>>> and lib/ruby/gems/2.4.0, in this order?
> >>> Exactly.
> >>>
> >>> Chris, what is your experience? Did you propose the patch because
> >>> you ran into a particular issue?
> >> Yep, I ran in to problems trying to use the guix ruby-2.3 package
> >> with the guix bundler package, when I build bundler with ruby-2.3.
> >>
> >> Ben's email got me thinking about how this works in Debian, and it
> >> looks like Debian uses a different
> >> location /usr/lib/ruby/vendor_ruby/ .
> >>
> >> I think there might be benefits from doing similarly, but this
> >> needs a bit of thought and testing, as I'm unsure how this might
> >> work, especially in cases where libraries include native code that
> >> links against ruby.
> >>
> >> I've got a patch for the ruby-build-system to make a change roughly
> >> like this, and I'll send that up soon. Relating this back to the
> >> issue at hand, moving to a version independent directory would mean
> >> that the GEM_PATH wouldn't be version specific.
> > [..]
> >
> > So, putting the gems in a single location regardless of the version
> > of ruby they were built with means that a different version of ruby
> > will at least see them, however, it may still fail to load them.
> >
> > I think this is an improvement, but I'm very uncertain about ruby.
> > Does anyone else have opinions on this?
> Thanks for working on this. A few thoughts:
>
> What happens to the default gems that come bundled with ruby itself?
> I'm interpreting from your patch that these will not be available?

They seem to be:

→ guix environment --container --ad-hoc ruby -- irb
...
for 1 packages... done in 0.028 s
irb(main):001:0> ENV
=> {"PS1"=>"\\u@\\h \\w [env]\\$ ", "TMPDIR"=>"/tmp",
"TEMPDIR"=>"/tmp", "TMP"=>"/tmp", "TEMP"=>"/tmp",
"HOME"=>"/home/chris",
"PATH"=>"/gnu/store/2dh34pi9yjq17qf1bw3dmgcdpri20fjs-profile/bin",
"GEM_PATH"=>"/gnu/store/2dh34pi9yjq17qf1bw3dmgcdpri20fjs-profile/lib/ruby/vendor_ruby",
"GUIX_ENVIRONMENT"=>"/gnu/store/2dh34pi9yjq17qf1bw3dmgcdpri20fjs-profile",
"LINES"=>"76", "COLUMNS"=>"190"}
irb(main):003:0> require 'rake'
=> true
irb(main):004:0> require 'minitest'
=> true


Toggle quote (9 lines)
> In general, except for some special circumstances, we don't support
> old versions of software. To fix the issue that you are encountering
> properly with nokogiri probably requires new package definitions
> using "package-with-ruby-2.3" or similar to be made, I suppose. Ludo
> did some nice work making this easier (see
> https://lists.gnu.org/archive/html/guix-patches/2017-04/msg00126.html),
> but I worry in general about the resources required to support older
> Ruby versions. WDYT?

I'm not aware of any particular problems if you are working with the
package definitions in Guile, as it should be possible to make them use
the single ruby version that you want.

With the guix environment command I posted:

guix environment --pure --ad-hoc ruby-nokogiri ruby@2.1 -- ruby -e
"puts require 'nokogiri'"

It would be ideal if there was some way of telling guix environment to
rewrite the package definitions of all packages to use ruby@2.1 in
place of whatever ruby they might be using.

Toggle quote (3 lines)
> The gem-home procedure in ruby-build-system will now return an
> incorrect path, I think.

Good spot. I'll have a look at that.

Toggle quote (5 lines)
> Perhaps I'm slow, but what are the advantages of the "vendor_ruby"
> method over exporting multiple GEM_PATHs as Ludo and I suggested?
> Changing the directory seems like a heavier touch and so more likely
> to misbehave. WDYT?

I agree that it is heavier in some sense, but I like the simplicity of
getting rid of the version from the path.

The best documentation I've found for this is the NEWS of the release
where it was added [1]. While Guix blurs the lines between the "package
system" and the "user", using this vendor directory might come in
useful.


Toggle quote (3 lines)
> Apologies if this comes across a little negative, I'm just trying to
> consider all the issues. Thanks again for your efforts on this.

No need to apologise, I too think its important to consider the
details of the support for ruby, which is not something I'm
particularly knowledgeable on.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAllzI6ZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XfeXA/8ChoAjDCFmIRZi9hpXC491LayHkMyA8VUSdnDgQndpbvpbxGTSToUp2BB
uFdZIZWGeTsdyshZD+3joXgrHok7Zia8K7FO1kdU44hxMqkBvT+4lRQSKnxVQqdi
U1gSFBAELgWS39zo/WAX5bobssBkR5fUqQpAdLOV/iigFamDOy09RbislSgDzr9P
OWnGz5odYTHza8ED8/rWMiROtnviRKxCCzifWkTKP61c86TOoSXf/9J9QXgOne2k
eyVWyIwcKE7FPNPYJQAFHim1EwCyTS7NEqYMOEWR0avgwq0fs1DX6I8sTT+CxpCy
++VhGX7z/vatNOlImYsHqzuiLlbXXzpTKoPXtMcXr0FTuTOX9qBe480YkOO8XdJ7
LEFthBfUa+YVJlQYVcvZZjynV19rRUC6yOvwy/o+x2+mr/ghnib4WO0FSjon3661
aGzC20ToVQ/ZKhV0AfZGjuSx7XzhY7BJaa03rCQVm1ZSvXbp/53n/ffbuY/kL0De
AXT0PbNZF7BLJPPyBC0Y72OI864GylO/JQC8haOEjWTGtmP8a1AUrjAPnQUiJJZO
tVHI1mET0eef4zs0E44NDfWq7ffBVq1HovT1ReZoz/71LkbR7S1Wj5qUwWTQWiJ0
outgu2rBrfh0sYNCiLG9pxQUscsidiPruEx0VeuaWDhbG6SEP04=
=xTQ7
-----END PGP SIGNATURE-----


B
B
Ben Woodcroft wrote on 5 Aug 2017 05:59
(name . Christopher Baines)(address . mail@cbaines.net)
794765de-67a1-040b-3877-a19bfe83183f@uq.edu.au
Hi Chris, sorry for the delay on this.


On 22/07/17 20:06, Christopher Baines wrote:
Toggle quote (11 lines)
> On Thu, 20 Jul 2017 09:39:13 +1000
> Ben Woodcroft <b.woodcroft@uq.edu.au> wrote:
>
>> Hi Chris,
>>
>>
>> [..]
>>
>> What happens to the default gems that come bundled with ruby itself?
>> I'm interpreting from your patch that these will not be available?
> They seem to be:
OK, excellent.

Toggle quote (20 lines)
>> In general, except for some special circumstances, we don't support
>> old versions of software. To fix the issue that you are encountering
>> properly with nokogiri probably requires new package definitions
>> using "package-with-ruby-2.3" or similar to be made, I suppose. Ludo
>> did some nice work making this easier (see
>> https://lists.gnu.org/archive/html/guix-patches/2017-04/msg00126.html),
>> but I worry in general about the resources required to support older
>> Ruby versions. WDYT?
> I'm not aware of any particular problems if you are working with the
> package definitions in Guile, as it should be possible to make them use
> the single ruby version that you want.
>
> With the guix environment command I posted:
>
> guix environment --pure --ad-hoc ruby-nokogiri ruby@2.1 -- ruby -e
> "puts require 'nokogiri'"
>
> It would be ideal if there was some way of telling guix environment to
> rewrite the package definitions of all packages to use ruby@2.1 in
> place of whatever ruby they might be using.
Is "package-mapping" sufficient?

[..]

Toggle quote (13 lines)
>> Perhaps I'm slow, but what are the advantages of the "vendor_ruby"
>> method over exporting multiple GEM_PATHs as Ludo and I suggested?
>> Changing the directory seems like a heavier touch and so more likely
>> to misbehave. WDYT?
> I agree that it is heavier in some sense, but I like the simplicity of
> getting rid of the version from the path.
>
> The best documentation I've found for this is the NEWS of the release
> where it was added [1]. While Guix blurs the lines between the "package
> system" and the "user", using this vendor directory might come in
> useful.
>
> 1: http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS
Ah, OK. I hadn't realised there was support for this baked into Ruby
itself. Seems obvious in hindsight.

If all Ruby dependencies build with this change, then the change seems
reasonable to me, details aside.
ben
C
C
Christopher Baines wrote on 5 Aug 2017 23:55
(name . Ben Woodcroft)(address . b.woodcroft@uq.edu.au)
20170805225552.19c95c6d@cbaines.net
On Sat, 5 Aug 2017 13:59:56 +1000
Ben Woodcroft <b.woodcroft@uq.edu.au> wrote:

Toggle quote (2 lines)
> Hi Chris, sorry for the delay on this.

No problem :)

Toggle quote (37 lines)
> On 22/07/17 20:06, Christopher Baines wrote:
> > On Thu, 20 Jul 2017 09:39:13 +1000
> > Ben Woodcroft <b.woodcroft@uq.edu.au> wrote:
> >
> >> Hi Chris,
> >>
> >>
> >> [..]
> >>
> >> What happens to the default gems that come bundled with ruby
> >> itself? I'm interpreting from your patch that these will not be
> >> available?
> > They seem to be:
> OK, excellent.
>
> >> In general, except for some special circumstances, we don't support
> >> old versions of software. To fix the issue that you are
> >> encountering properly with nokogiri probably requires new package
> >> definitions using "package-with-ruby-2.3" or similar to be made, I
> >> suppose. Ludo did some nice work making this easier (see
> >> https://lists.gnu.org/archive/html/guix-patches/2017-04/msg00126.html),
> >> but I worry in general about the resources required to support
> >> older Ruby versions. WDYT?
> > I'm not aware of any particular problems if you are working with the
> > package definitions in Guile, as it should be possible to make them
> > use the single ruby version that you want.
> >
> > With the guix environment command I posted:
> >
> > guix environment --pure --ad-hoc ruby-nokogiri ruby@2.1 -- ruby
> > -e "puts require 'nokogiri'"
> >
> > It would be ideal if there was some way of telling guix environment
> > to rewrite the package definitions of all packages to use ruby@2.1
> > in place of whatever ruby they might be using.
> Is "package-mapping" sufficient?

I don't think so. The ruby used is in the case of the ruby-build-system
is an argument to the build system, so you need to traverse part of the
dependency graph, altering the arguments of packages using the
ruby-build-system.

Or, perhaps do the transformation at a lower level abstraction than the
package record...

Toggle quote (19 lines)
> >> Perhaps I'm slow, but what are the advantages of the "vendor_ruby"
> >> method over exporting multiple GEM_PATHs as Ludo and I suggested?
> >> Changing the directory seems like a heavier touch and so more
> >> likely to misbehave. WDYT?
> > I agree that it is heavier in some sense, but I like the simplicity
> > of getting rid of the version from the path.
> >
> > The best documentation I've found for this is the NEWS of the
> > release where it was added [1]. While Guix blurs the lines between
> > the "package system" and the "user", using this vendor directory
> > might come in useful.
> >
> > 1: http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS
> Ah, OK. I hadn't realised there was support for this baked into Ruby
> itself. Seems obvious in hindsight.
>
> If all Ruby dependencies build with this change, then the change
> seems reasonable to me, details aside.

Ok, does anyone know a good process for testing if lots of packages
build? I think I've heard of Hydra building branches?
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmGPuhfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdVKg/+Lj1EDfiYAoRN8+SrvmbJ7a+jAkfILbxFHcm9n99tD7IgGGcTApTun/is
TKCoLZs+rcVtdhS4GToU4QCKaoAyAg5BbWT2r/lumpy7YP5g9DRKQOQzgy0EcXvK
66MHoat524tzQqBrEj1gQsSy41ia+0ABb1VVqWgC2JAlv5gZ3n1UFfpc+MghzCQv
vWzZahd9E1l8PfBDAFr4QTiU0WEoX4uIL2EGly+pi9lVkePSY24YzIxXyTPs+9xM
Fj0ul4cfGnfqDNTcG5lrRJ9IOmxl5W3Si1VDMXIVcmrZaBWJyDbYId2VCD4xqnlB
7uCoTNubHrlIVgStym5nnJ5nE+PKx/cKa7QXwWiy6F9Fx8wgixBa2jKMNbJYir1k
hFRAgtx4X1h0+foFU+4W2JWFWsn5gO0QWJwDPXmJ25Y+jRgkdkjkCXHlcnDfwid9
6EBZdPu/gHinLfroUt6NCbH60mdS/d3OUZWCMnG3FG6rm2IVxEqtzaUtBPhRxkAR
toHhrnzXvvFfzT1k/vuiwN6FcJVKmFMqJ6EWBINGIbBAk8sa6t3uZvvvmHOK7nEF
hf9W5hoFVa+qtTMGywTxD2YnDEvflt2gdSEL2DJhGrfkdELgIYq0XoSu3Nr11bq1
jAH/5lUzRbE0dgeoGCIqS9LLAH5QCouhtZUJd0xOknP4e24NBCk=
=nuhU
-----END PGP SIGNATURE-----


B
B
Ben Woodcroft wrote on 6 Aug 2017 09:17
(name . Christopher Baines)(address . mail@cbaines.net)
41bc2718-29ea-cf3c-e409-b1f7705b11f1@uq.edu.au
Hi,

[..]
Toggle quote (28 lines)
>>>> In general, except for some special circumstances, we don't support
>>>> old versions of software. To fix the issue that you are
>>>> encountering properly with nokogiri probably requires new package
>>>> definitions using "package-with-ruby-2.3" or similar to be made, I
>>>> suppose. Ludo did some nice work making this easier (see
>>>> https://lists.gnu.org/archive/html/guix-patches/2017-04/msg00126.html),
>>>> but I worry in general about the resources required to support
>>>> older Ruby versions. WDYT?
>>> I'm not aware of any particular problems if you are working with the
>>> package definitions in Guile, as it should be possible to make them
>>> use the single ruby version that you want.
>>>
>>> With the guix environment command I posted:
>>>
>>> guix environment --pure --ad-hoc ruby-nokogiri ruby@2.1 -- ruby
>>> -e "puts require 'nokogiri'"
>>>
>>> It would be ideal if there was some way of telling guix environment
>>> to rewrite the package definitions of all packages to use ruby@2.1
>>> in place of whatever ruby they might be using.
>> Is "package-mapping" sufficient?
> I don't think so. The ruby used is in the case of the ruby-build-system
> is an argument to the build system, so you need to traverse part of the
> dependency graph, altering the arguments of packages using the
> ruby-build-system.
>
> Or, perhaps do the transformation at a lower level abstraction than the
> package record...
For most compiled gems, I think it should be possible to write some
procedure so that this would provide you with what you want:

guix environment --ad-hoc ruby@2.1
--environment='(package-with-explicit-ruby ruby-2.1 ruby-nokogiri)'

For this specific case though, ruby-2.1 might not be the best example,
since it is explicitly not supported any more.
Toggle quote (4 lines)
>> If all Ruby dependencies build with this change, then the change
>> seems reasonable to me, details aside.
> Ok, does anyone know a good process for testing if lots of packages
> build? I think I've heard of Hydra building branches?
I believe we can go by the old standby "guix refresh -l ruby", so 659
packages are rebuilt. Given this it would be appropriate for the staging
branch, due to be merged after core-updates.

ben
C
C
Christopher Baines wrote on 17 Dec 2017 15:19
[bug#27438] [PATCH] guix: build: ruby-build-system: Install to the vendor directory
(address . 27438@debbugs.gnu.org)
87shc9tp1i.fsf@cbaines.net
Hey,

It's been a while since I looked at this, but I think it's still
relevant.

As a reminder, currently the search paths for the Ruby packages in Guix
are a bit off [1], which makes it difficult to use Ruby gems with
different versions of Ruby.

Rubygems by default installs gems to directories specific to the version
of Ruby, and this can be helpful when managing multiple versions of Ruby
and different sets of gem packages in a shared directory, but with Guix,
this isn't necessary, as the store can be used.

Ruby/Rubygems supports installing gems in to a vendor directory, which
is for gems installed by the package system [2]. While Guix blurs the
lines between the "package system" and the "user", using this vendor
directory might come in useful.

I've attached an updated patch, and successfully built every Ruby
package [3], as well as all of the packages that were changed in the
patch. The only failure was ruby-pg, which failed to build before this
patch.

Ideally when using specific versions of ruby, any gems that need to be
build with that version of ruby, would be. While this change doesn't do
that, it does simplify the search paths of ruby packages and the
packages for ruby gems.

Reading the bug report again, I think there was nearly consensus about
merging this, but I wanted to check if anyone has any comments or
experience with Ruby/Rubygems before merging this?

Thanks,

Chris

1:
scheme@(guile-user)> (use-modules (gnu packages) (guix packages) (guix search-paths) (ice-9 match))
scheme@(guile-user)> (map (lambda (ruby) (cons (package-version ruby) (match (package-native-search-paths ruby) (() #f) ((($ <search-path-specification> _ files)) files)))) (find-packages-by-name "ruby"))
$1 = (("2.4.3" "lib/ruby/gems/2.4.0") ("2.4.2" "lib/ruby/gems/2.4.0") ("2.3.6" "lib/ruby/gems/2.4.0") ("2.2.9" "lib/ruby/gems/2.4.0") ("2.1.10" "lib/ruby/gems/2.1.0") ("1.8.7-p374" . #f))


3: guix build --keep-going $(guix package -s ruby- | recsel -P name | tr '\n' ' ')
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlo2fPlfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdCFQ/9F0RSHlMCxsIMA2MmDeArtQ40Pa5JtF5R7OsecQe0MJzzO3dXsU0qGqBt
IgnJvyFANJqbGCYhKItFCpcZgDpSAzK8o8SlGsYvfKhooEMP815juUrfv1YOAQkY
mg+kdUiz2CfzNxczXU2/5IeP+n6qs8QnI9KXEKYaFhS1rlc6VDWkaxDlBTbAAd2c
2trdgfFkCMWI6a5mzCxZclUGlBlZoeosdPyVZFs9fPaYcDe1eu3BVr4Fl52H4bcA
Miu81amoj7i0PyAJ8nPF2jsjgwJuO2xkffkZZFMAMuQTLCAQhZbeXgLZlQGOZ42g
8s7lD3iFv9f7xgG848RPk+JU41axq8K5eBMXgsf+JrWs5VM79TqhDWpf5ztkCtTA
SBPfdb17LRfZW7zUNo1U7mAEPVYbYc4EXbhj4vt9Z5eUWxoHaP72M1p2uWj0CJ0S
ekZHVH2q0dk10jmvhiY1j+WEMcUduJ6cqm/C8UYHjPuJ3FjOTn7iLIXrp8AAc0hu
y14SAQqev9p3foq4dQa9JYDEyXSkr6noRX3+u/nWStnzAJXOomHGovhhq+WDlrdG
6gOH6leaSVlWSHxuLvJp6i0F7t22xUjo7Udow/+jlGacK13yTl0IouXmMu5PoNup
k79MSS9goQhFbEYn3ZHMkSDquYndyIBpduDRvsFjWQ3Gdla/AqI=
=yVcD
-----END PGP SIGNATURE-----

B
B
Ben Woodcroft wrote on 12 Jan 2018 08:17
6dfe3202-85bf-0739-bd12-819f2d6c9e90@uq.edu.au
Hi Chris,


On 18/12/17 00:19, Christopher Baines wrote:
Toggle quote (32 lines)
> Hey,
>
> It's been a while since I looked at this, but I think it's still
> relevant.
>
> As a reminder, currently the search paths for the Ruby packages in Guix
> are a bit off [1], which makes it difficult to use Ruby gems with
> different versions of Ruby.
>
> Rubygems by default installs gems to directories specific to the version
> of Ruby, and this can be helpful when managing multiple versions of Ruby
> and different sets of gem packages in a shared directory, but with Guix,
> this isn't necessary, as the store can be used.
>
> Ruby/Rubygems supports installing gems in to a vendor directory, which
> is for gems installed by the package system [2]. While Guix blurs the
> lines between the "package system" and the "user", using this vendor
> directory might come in useful.
>
> I've attached an updated patch, and successfully built every Ruby
> package [3], as well as all of the packages that were changed in the
> patch. The only failure was ruby-pg, which failed to build before this
> patch.
>
> Ideally when using specific versions of ruby, any gems that need to be
> build with that version of ruby, would be. While this change doesn't do
> that, it does simplify the search paths of ruby packages and the
> packages for ruby gems.
>
> Reading the bug report again, I think there was nearly consensus about
> merging this, but I wanted to check if anyone has any comments or
> experience with Ruby/Rubygems before merging this?
I think go ahead with this one. It will be useful particularly when we
update ruby to 2.5.

ben
C
C
Christopher Baines wrote on 14 Jan 2018 23:24
(name . Ben Woodcroft)(address . b.woodcroft@uq.edu.au)
87efmst6y6.fsf@cbaines.net
Ben Woodcroft <b.woodcroft@uq.edu.au> writes:

Toggle quote (39 lines)
> Hi Chris,
>
>
> On 18/12/17 00:19, Christopher Baines wrote:
>> Hey,
>>
>> It's been a while since I looked at this, but I think it's still
>> relevant.
>>
>> As a reminder, currently the search paths for the Ruby packages in Guix
>> are a bit off [1], which makes it difficult to use Ruby gems with
>> different versions of Ruby.
>>
>> Rubygems by default installs gems to directories specific to the version
>> of Ruby, and this can be helpful when managing multiple versions of Ruby
>> and different sets of gem packages in a shared directory, but with Guix,
>> this isn't necessary, as the store can be used.
>>
>> Ruby/Rubygems supports installing gems in to a vendor directory, which
>> is for gems installed by the package system [2]. While Guix blurs the
>> lines between the "package system" and the "user", using this vendor
>> directory might come in useful.
>>
>> I've attached an updated patch, and successfully built every Ruby
>> package [3], as well as all of the packages that were changed in the
>> patch. The only failure was ruby-pg, which failed to build before this
>> patch.
>>
>> Ideally when using specific versions of ruby, any gems that need to be
>> build with that version of ruby, would be. While this change doesn't do
>> that, it does simplify the search paths of ruby packages and the
>> packages for ruby gems.
>>
>> Reading the bug report again, I think there was nearly consensus about
>> merging this, but I wanted to check if anyone has any comments or
>> experience with Ruby/Rubygems before merging this?
> I think go ahead with this one. It will be useful particularly when we
> update ruby to 2.5.

Great, I've pushed this along with the other ruby build system change.

Thanks for reviewing,

Chris
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlpb2JFfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdLzQ/8CB1OZdM4ZkehHiv4S7OsNltMkZn7U6Tq3x3R2GRXzh0mHrlxxQI12w9/
0ebAYWXniJ84xEWkmNTSZF9UtKstfqho+2ELBr/zDT9N/FLLwaDKJhl6nPoJoEhR
fy/d/7VQLBzqwMo1+O5OiXOrYNubrZOkV7kfh+VyoOOplXM8KEUfCwT//K2AZUzw
E88xCX7J8m6iPFzrqdU8OBZZMeHEmltacG4Uh4mQV5xFDDAKST9DQOxDGlcoBSm5
TlFEG7448oX06IYCkftDIfV6+TKiypfI6RHH44esJMfe3cH1/qZbgwK2twgvnfK4
OOhuzMY/cWUpeszQoEgLappXUEYZ9Q4s6kmV5hjIA1fxgHfxkeeb+jIt04K0G7si
znDBRKusakZn7KVw23vIdJ/YBqrkO+8K/jQd5vgPowesOnXurteaaegmkOOPRwbW
Mt0L21kKjh/DXK1xwlO6tfvavaQNcW/B8ZQ0YoBgOPm9MILCBPeggvZumqyWOKIX
spcPr6IQ/njIR04YLU+S1OnD7Ed+Yaj1FVTdYM+MWVvKUNVZ5bjyErc0sAxgsTBo
XeLspaZCB3kDJZiLC2eShHVYRipY75IZlQNQed64p2o1nlyP84W7gW1mukhxB7nf
BBlzHptm6J591OWQ03aFIWgJW9CdMVaPffYf/E15a5G5IbrTY+8=
=GX5b
-----END PGP SIGNATURE-----

Closed
?