all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
@ 2016-04-28  4:06 Rob Syme
  2016-04-28  5:19 ` Ricardo Wurmus
  0 siblings, 1 reply; 9+ messages in thread
From: Rob Syme @ 2016-04-28  4:06 UTC (permalink / raw)
  To: guix-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 3494 bytes --]

* gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix issue #1448.
* gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink patch.

---
 gnu/packages/patches/ruby-symlinkfix.patch | 53
++++++++++++++++++++++++++++++
 gnu/packages/ruby.scm                      |  5 +--
 2 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/ruby-symlinkfix.patch

diff --git a/gnu/packages/patches/ruby-symlinkfix.patch
b/gnu/packages/patches/ruby-symlinkfix.patch
new file mode 100644
index 0000000..16beecc
--- /dev/null
+++ b/gnu/packages/patches/ruby-symlinkfix.patch
@@ -0,0 +1,53 @@
+Fix symlinks to '..' to fix rubygems improperly expanding symlinked
+paths. Without this fix, some gems fail to install. This patch is applied
in
+rubygems 2.5.2, but ruby version 2.3.1 bundles an older version of rubygems
+(2.5.1).
+
+--- a/lib/rubygems/package.rb
++++ b/lib/rubygems/package.rb
+@@ -383,7 +383,7 @@ def extract_tar_gz io, destination_dir, pattern = "*"
# :nodoc:
+           FileUtils.chmod entry.header.mode, destination
+         end if entry.file?
+
+-        File.symlink(install_location(entry.header.linkname,
destination_dir), destination) if entry.symlink?
++        File.symlink(entry.header.linkname, destination) if entry.symlink?
+
+         verbose destination
+       end
+diff --git a/test/rubygems/test_gem_package.rb
b/test/rubygems/test_gem_package.rb
+index 7848bc2..f287bd3 100644
+--- a/test/rubygems/test_gem_package.rb
++++ b/test/rubygems/test_gem_package.rb
+@@ -428,19 +428,25 @@ def test_extract_tar_gz_absolute
+                  "#{@destination} is not allowed", e.message)
+   end
+
+-  def test_extract_tar_gz_symlink_absolute
++  def test_extract_tar_gz_symlink_relative_path
++    skip 'symlink not supported' if Gem.win_platform?
++
+     package = Gem::Package.new @gem
+
+     tgz_io = util_tar_gz do |tar|
+-      tar.add_symlink 'code.rb', '/absolute.rb', 0644
++      tar.add_file    'relative.rb', 0644 do |io| io.write 'hi' end
++      tar.mkdir       'lib',         0755
++      tar.add_symlink 'lib/foo.rb', '../relative.rb', 0644
+     end
+
+-    e = assert_raises Gem::Package::PathError do
+-      package.extract_tar_gz tgz_io, @destination
+-    end
++    package.extract_tar_gz tgz_io, @destination
+
+-    assert_equal("installing into parent path /absolute.rb of " +
+-                 "#{@destination} is not allowed", e.message)
++    extracted = File.join @destination, 'lib/foo.rb'
++    assert_path_exists extracted
++    assert_equal '../relative.rb',
++                 File.readlink(extracted)
++    assert_equal 'hi',
++                 File.read(extracted)
+   end
+
+   def test_extract_tar_gz_directory
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index bafa7e3..b8a6d01 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -46,7 +46,7 @@
 (define-public ruby
   (package
     (name "ruby")
-    (version "2.3.0")
+    (version "2.3.1")
     (source
      (origin
        (method url-fetch)
@@ -55,8 +55,9 @@
                            "/ruby-" version ".tar.xz"))
        (sha256
         (base32
-         "15s0dsb5ynf3d2w5gzawnszq5594fqvapv2y7a0qw16przq5l4kh"))
+         "0f3395q7pd2hrl2gv26bib80038sjawxgmhl9zn22fjs9m9va9b7"))
        (modules '((guix build utils)))
+       (patches (search-patches "ruby-symlinkfix.patch"))
        (snippet `(begin
                    ;; Remove bundled libffi
                    (delete-file-recursively
--
2.7.4

[-- Attachment #2: Type: text/html, Size: 4223 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
  2016-04-28  4:06 [PATCH] Upgrade ruby to 2.3.1 (including symlink patch) Rob Syme
@ 2016-04-28  5:19 ` Ricardo Wurmus
  2016-04-28  5:26   ` Ben Woodcroft
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2016-04-28  5:19 UTC (permalink / raw)
  To: Rob Syme; +Cc: guix-devel@gnu.org


Rob Syme <rob.syme@gmail.com> writes:

> * gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix issue #1448.
> * gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink patch.

Thank you!  The patch also needs to be registered in dist_patch_DATA in
“gnu/local.mk”.  I can do this later when applying the patch in the
office, unless there are other objections to this patch.

~~ Ricardo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
  2016-04-28  5:19 ` Ricardo Wurmus
@ 2016-04-28  5:26   ` Ben Woodcroft
  2016-04-28  6:06     ` Rob Syme
  2016-04-28  6:27     ` Ricardo Wurmus
  0 siblings, 2 replies; 9+ messages in thread
From: Ben Woodcroft @ 2016-04-28  5:26 UTC (permalink / raw)
  To: Ricardo Wurmus, Rob Syme; +Cc: guix-devel@gnu.org



On 28/04/16 15:19, Ricardo Wurmus wrote:
> Rob Syme <rob.syme@gmail.com> writes:
>
>> * gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix issue #1448.
>> * gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink patch.
> Thank you!  The patch also needs to be registered in dist_patch_DATA in
> “gnu/local.mk”.  I can do this later when applying the patch in the
> office, unless there are other objections to this patch.

Do you mind holding off for a bit (no more than ~10 hours)? I wouldn't 
mind having a play with this myself.

This will require all ruby packages to be rebuilt, but my vote is to 
bung it on master given that it doesn't take too long to rebuild the 
ruby packages.
ben

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
  2016-04-28  5:26   ` Ben Woodcroft
@ 2016-04-28  6:06     ` Rob Syme
  2016-04-28  6:27     ` Ricardo Wurmus
  1 sibling, 0 replies; 9+ messages in thread
From: Rob Syme @ 2016-04-28  6:06 UTC (permalink / raw)
  To: Ben Woodcroft, Ricardo Wurmus; +Cc: guix-devel@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 1008 bytes --]

I'm no expert, so please take as long as you need to look over this. I've
attached a patch that includes the addition of the patch path to
dist_patch_DATA.
-r

On Thu, 28 Apr 2016 at 13:26 Ben Woodcroft <woodibe@gmail.com> wrote:

>
>
> On 28/04/16 15:19, Ricardo Wurmus wrote:
> > Rob Syme <rob.syme@gmail.com> writes:
> >
> >> * gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix issue
> #1448.
> >> * gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink patch.
> > Thank you!  The patch also needs to be registered in dist_patch_DATA in
> > “gnu/local.mk”.  I can do this later when applying the patch in the
> > office, unless there are other objections to this patch.
>
> Do you mind holding off for a bit (no more than ~10 hours)? I wouldn't
> mind having a play with this myself.
>
> This will require all ruby packages to be rebuilt, but my vote is to
> bung it on master given that it doesn't take too long to rebuild the
> ruby packages.
> ben
>

[-- Attachment #1.2: Type: text/html, Size: 1481 bytes --]

[-- Attachment #2: 0001-Upgraded-ruby-to-2.3.1-and-fixed-rubygems-symlinks.patch --]
[-- Type: text/x-patch, Size: 4154 bytes --]


* gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix issue #1448.
* gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink patch.
* gnu/local.mk (dist_patch_DATA): Add patch to dist_patch_DATA variable

---
 gnu/local.mk                               |  1 +
 gnu/packages/patches/ruby-symlinkfix.patch | 53 ++++++++++++++++++++++++++++++
 gnu/packages/ruby.scm                      |  5 +--
 3 files changed, 57 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/ruby-symlinkfix.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3cdf5e4..6265792 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -712,6 +712,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/readline-link-ncurses.patch		\
   gnu/packages/patches/ripperx-missing-file.patch		\
   gnu/packages/patches/rsem-makefile.patch			\
+  gnu/packages/patches/ruby-symlinkfix.patch                    \
   gnu/packages/patches/sed-hurd-path-max.patch			\
   gnu/packages/patches/scheme48-tests.patch			\
   gnu/packages/patches/scotch-test-threading.patch		\
diff --git a/gnu/packages/patches/ruby-symlinkfix.patch b/gnu/packages/patches/ruby-symlinkfix.patch
new file mode 100644
index 0000000..16beecc
--- /dev/null
+++ b/gnu/packages/patches/ruby-symlinkfix.patch
@@ -0,0 +1,53 @@
+Fix symlinks to '..' to fix rubygems improperly expanding symlinked
+paths. Without this fix, some gems fail to install. This patch is applied in
+rubygems 2.5.2, but ruby version 2.3.1 bundles an older version of rubygems
+(2.5.1).
+
+--- a/lib/rubygems/package.rb
++++ b/lib/rubygems/package.rb
+@@ -383,7 +383,7 @@ def extract_tar_gz io, destination_dir, pattern = "*" # :nodoc:
+           FileUtils.chmod entry.header.mode, destination
+         end if entry.file?
+
+-        File.symlink(install_location(entry.header.linkname, destination_dir), destination) if entry.symlink?
++        File.symlink(entry.header.linkname, destination) if entry.symlink?
+
+         verbose destination
+       end
+diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb
+index 7848bc2..f287bd3 100644
+--- a/test/rubygems/test_gem_package.rb
++++ b/test/rubygems/test_gem_package.rb
+@@ -428,19 +428,25 @@ def test_extract_tar_gz_absolute
+                  "#{@destination} is not allowed", e.message)
+   end
+
+-  def test_extract_tar_gz_symlink_absolute
++  def test_extract_tar_gz_symlink_relative_path
++    skip 'symlink not supported' if Gem.win_platform?
++
+     package = Gem::Package.new @gem
+
+     tgz_io = util_tar_gz do |tar|
+-      tar.add_symlink 'code.rb', '/absolute.rb', 0644
++      tar.add_file    'relative.rb', 0644 do |io| io.write 'hi' end
++      tar.mkdir       'lib',         0755
++      tar.add_symlink 'lib/foo.rb', '../relative.rb', 0644
+     end
+
+-    e = assert_raises Gem::Package::PathError do
+-      package.extract_tar_gz tgz_io, @destination
+-    end
++    package.extract_tar_gz tgz_io, @destination
+
+-    assert_equal("installing into parent path /absolute.rb of " +
+-                 "#{@destination} is not allowed", e.message)
++    extracted = File.join @destination, 'lib/foo.rb'
++    assert_path_exists extracted
++    assert_equal '../relative.rb',
++                 File.readlink(extracted)
++    assert_equal 'hi',
++                 File.read(extracted)
+   end
+
+   def test_extract_tar_gz_directory
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index bafa7e3..b8a6d01 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -46,7 +46,7 @@
 (define-public ruby
   (package
     (name "ruby")
-    (version "2.3.0")
+    (version "2.3.1")
     (source
      (origin
        (method url-fetch)
@@ -55,8 +55,9 @@
                            "/ruby-" version ".tar.xz"))
        (sha256
         (base32
-         "15s0dsb5ynf3d2w5gzawnszq5594fqvapv2y7a0qw16przq5l4kh"))
+         "0f3395q7pd2hrl2gv26bib80038sjawxgmhl9zn22fjs9m9va9b7"))
        (modules '((guix build utils)))
+       (patches (search-patches "ruby-symlinkfix.patch"))
        (snippet `(begin
                    ;; Remove bundled libffi
                    (delete-file-recursively
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
  2016-04-28  5:26   ` Ben Woodcroft
  2016-04-28  6:06     ` Rob Syme
@ 2016-04-28  6:27     ` Ricardo Wurmus
  2016-04-28 11:56       ` Ben Woodcroft
  1 sibling, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2016-04-28  6:27 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel@gnu.org


Ben Woodcroft <woodibe@gmail.com> writes:

> On 28/04/16 15:19, Ricardo Wurmus wrote:
>> Rob Syme <rob.syme@gmail.com> writes:
>>
>>> * gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix issue #1448.
>>> * gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink patch.
>> Thank you!  The patch also needs to be registered in dist_patch_DATA in
>> “gnu/local.mk”.  I can do this later when applying the patch in the
>> office, unless there are other objections to this patch.
>
> Do you mind holding off for a bit (no more than ~10 hours)? I wouldn't 
> mind having a play with this myself.

No problem.  I can also apply this tomorrow if your tests find no
problems.  Thanks!

~~ Ricardo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
  2016-04-28  6:27     ` Ricardo Wurmus
@ 2016-04-28 11:56       ` Ben Woodcroft
  2016-04-29 23:52         ` Ben Woodcroft
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Woodcroft @ 2016-04-28 11:56 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel@gnu.org



On 28/04/16 16:27, Ricardo Wurmus wrote:
> Ben Woodcroft <woodibe@gmail.com> writes:
>
>> On 28/04/16 15:19, Ricardo Wurmus wrote:
>>> Rob Syme <rob.syme@gmail.com> writes:
>>>
>>>> * gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix issue #1448.
>>>> * gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink patch.
>>> Thank you!  The patch also needs to be registered in dist_patch_DATA in
>>> “gnu/local.mk”.  I can do this later when applying the patch in the
>>> office, unless there are other objections to this patch.
>> Do you mind holding off for a bit (no more than ~10 hours)? I wouldn't
>> mind having a play with this myself.
> No problem.  I can also apply this tomorrow if your tests find no
> problems.  Thanks!

Ruby-hashery now fails a unit test, but since that is a higher level 
package and ruby-ansi works I think it might be good to apply the patch 
here anyway. Would you mind please?

Thanks both,
ben

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
  2016-04-28 11:56       ` Ben Woodcroft
@ 2016-04-29 23:52         ` Ben Woodcroft
  2016-04-30  6:32           ` Ricardo Wurmus
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Woodcroft @ 2016-04-29 23:52 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel@gnu.org



On 28/04/16 21:56, Ben Woodcroft wrote:
>
>
> On 28/04/16 16:27, Ricardo Wurmus wrote:
>> Ben Woodcroft <woodibe@gmail.com> writes:
>>
>>> On 28/04/16 15:19, Ricardo Wurmus wrote:
>>>> Rob Syme <rob.syme@gmail.com> writes:
>>>>
>>>>> * gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix 
>>>>> issue #1448.
>>>>> * gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink 
>>>>> patch.
>>>> Thank you!  The patch also needs to be registered in 
>>>> dist_patch_DATA in
>>>> “gnu/local.mk”.  I can do this later when applying the patch in the
>>>> office, unless there are other objections to this patch.
>>> Do you mind holding off for a bit (no more than ~10 hours)? I wouldn't
>>> mind having a play with this myself.
>> No problem.  I can also apply this tomorrow if your tests find no
>> problems.  Thanks!
>
> Ruby-hashery now fails a unit test, but since that is a higher level 
> package and ruby-ansi works I think it might be good to apply the 
> patch here anyway. Would you mind please?

I've just pushed a slightly modified version of Rob's patch and a patch 
for ruby-hashery to master; I believe all the packages in 
gnu/packages/ruby.scm build now.

ben

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
  2016-04-29 23:52         ` Ben Woodcroft
@ 2016-04-30  6:32           ` Ricardo Wurmus
  2016-04-30  6:35             ` Rob Syme
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2016-04-30  6:32 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel@gnu.org


Ben Woodcroft <donttrustben@gmail.com> writes:

> On 28/04/16 21:56, Ben Woodcroft wrote:
>>
>>
>> On 28/04/16 16:27, Ricardo Wurmus wrote:
>>> Ben Woodcroft <woodibe@gmail.com> writes:
>>>
>>>> On 28/04/16 15:19, Ricardo Wurmus wrote:
>>>>> Rob Syme <rob.syme@gmail.com> writes:
>>>>>
>>>>>> * gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix 
>>>>>> issue #1448.
>>>>>> * gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink 
>>>>>> patch.
>>>>> Thank you!  The patch also needs to be registered in 
>>>>> dist_patch_DATA in
>>>>> “gnu/local.mk”.  I can do this later when applying the patch in the
>>>>> office, unless there are other objections to this patch.
>>>> Do you mind holding off for a bit (no more than ~10 hours)? I wouldn't
>>>> mind having a play with this myself.
>>> No problem.  I can also apply this tomorrow if your tests find no
>>> problems.  Thanks!
>>
>> Ruby-hashery now fails a unit test, but since that is a higher level 
>> package and ruby-ansi works I think it might be good to apply the 
>> patch here anyway. Would you mind please?
>
> I've just pushed a slightly modified version of Rob's patch and a patch 
> for ruby-hashery to master; I believe all the packages in 
> gnu/packages/ruby.scm build now.

Thanks Ben, and thanks Rob for the patch!

~~ Ricardo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Upgrade ruby to 2.3.1 (including symlink patch)
  2016-04-30  6:32           ` Ricardo Wurmus
@ 2016-04-30  6:35             ` Rob Syme
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Syme @ 2016-04-30  6:35 UTC (permalink / raw)
  To: Ricardo Wurmus, Ben Woodcroft; +Cc: guix-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

Glad to help! It's an absolute delight to `guix environment -l guix.scm`
for every workflow and know that its gong to work.

On Sat, 30 Apr 2016 at 14:32 Ricardo Wurmus <rekado@elephly.net> wrote:

>
> Ben Woodcroft <donttrustben@gmail.com> writes:
>
> > On 28/04/16 21:56, Ben Woodcroft wrote:
> >>
> >>
> >> On 28/04/16 16:27, Ricardo Wurmus wrote:
> >>> Ben Woodcroft <woodibe@gmail.com> writes:
> >>>
> >>>> On 28/04/16 15:19, Ricardo Wurmus wrote:
> >>>>> Rob Syme <rob.syme@gmail.com> writes:
> >>>>>
> >>>>>> * gnu/packages/patches/ruby-symlinkfix.patch: New patch to fix
> >>>>>> issue #1448.
> >>>>>> * gnu/packages/ruby.scm (ruby): Update to 2.3.1 including symlink
> >>>>>> patch.
> >>>>> Thank you!  The patch also needs to be registered in
> >>>>> dist_patch_DATA in
> >>>>> “gnu/local.mk”.  I can do this later when applying the patch in the
> >>>>> office, unless there are other objections to this patch.
> >>>> Do you mind holding off for a bit (no more than ~10 hours)? I wouldn't
> >>>> mind having a play with this myself.
> >>> No problem.  I can also apply this tomorrow if your tests find no
> >>> problems.  Thanks!
> >>
> >> Ruby-hashery now fails a unit test, but since that is a higher level
> >> package and ruby-ansi works I think it might be good to apply the
> >> patch here anyway. Would you mind please?
> >
> > I've just pushed a slightly modified version of Rob's patch and a patch
> > for ruby-hashery to master; I believe all the packages in
> > gnu/packages/ruby.scm build now.
>
> Thanks Ben, and thanks Rob for the patch!
>
> ~~ Ricardo
>
>

[-- Attachment #2: Type: text/html, Size: 2502 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-04-30  6:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28  4:06 [PATCH] Upgrade ruby to 2.3.1 (including symlink patch) Rob Syme
2016-04-28  5:19 ` Ricardo Wurmus
2016-04-28  5:26   ` Ben Woodcroft
2016-04-28  6:06     ` Rob Syme
2016-04-28  6:27     ` Ricardo Wurmus
2016-04-28 11:56       ` Ben Woodcroft
2016-04-29 23:52         ` Ben Woodcroft
2016-04-30  6:32           ` Ricardo Wurmus
2016-04-30  6:35             ` Rob Syme

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.