Skip to contentSkip to conversation

ruby: bump version to 2.4.0

PATCH New Vicente Olivert Riera 5 participants 7 messages Jan 9, 2017 – Feb 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ruby: bump version to 2.4.0

The problem addressed by 0001 patch has been fixed upstream and is that fix is included in this release:
https://github.com/ruby/ruby/commit/aa107497cd379b713eba8cecdb9a882bb1e0dd89

---
 ...-process.c-fix-rb_spawn_process-for-nommu.patch | 34 ----------------------
 package/ruby/ruby.hash                             |  4 +--
 package/ruby/ruby.mk                               |  6 ++--
 3 files changed, 5 insertions(+), 39 deletions(-)
 delete mode 100644 package/ruby/0001-process.c-fix-rb_spawn_process-for-nommu.patch
package/ruby/0001-process.c-fix-rb_spawn_process-for-nommu.patch deleted +0 -34
deleted file mode 100644
index 701c105..0000000
@@ -1,34 +0,0 @@
-From 24e6d5bcf791a5c3f46191e544731420ff8b1312 Mon Sep 17 00:00:00 2001
-From: Gustavo Zacarias <[email protected]>
-Date: Thu, 19 May 2016 11:10:02 -0300
-Subject: [PATCH] process.c: fix rb_spawn_process() for nommu
-
-rb_spawn_process() in process.c tries different solutions for when fork
-and/or spawnv are/aren't available.
-The last resort when both aren't is to use the system() call which
-stores the value in the status variable, which isn't declared.
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
----
-Patch status: reported https://bugs.ruby-lang.org/issues/12398
-
- process.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/process.c b/process.c
-index e196639..40967f7 100644
---- a/process.c
-+++ b/process.c
-@@ -3897,6 +3897,9 @@ rb_spawn_process(struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
-     VALUE prog;
-     struct rb_execarg sarg;
- #endif
-+#if !defined HAVE_WORKING_FORK || !USE_SPAWNV
-+    int status;
-+#endif
- 
- #if defined HAVE_WORKING_FORK && !USE_SPAWNV
-     pid = rb_fork_async_signal_safe(NULL, rb_exec_atfork, eargp, eargp->redirect_fds, errmsg, errmsg_buflen);
--- 
-2.7.3
-
package/ruby/ruby.hash +2 -2
index 8182e2c..19722a3 100644
@@ -1,2 +1,2 @@
-# From https://www.ruby-lang.org/en/news/2016/11/21/ruby-2-3-3-released/
-sha256 1a4fa8c2885734ba37b97ffdb4a19b8fba0e8982606db02d936e65bac07419dc  ruby-2.3.3.tar.xz
+# From https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/
+sha256 3a87fef45cba48b9322236be60c455c13fd4220184ce7287600361319bb63690  ruby-2.4.0.tar.xz
package/ruby/ruby.mk +3 -3
index b8e03ac..4c6459b 100644
@@ -4,9 +4,9 @@
 #
 ################################################################################
 
-RUBY_VERSION_MAJOR = 2.3
-RUBY_VERSION = $(RUBY_VERSION_MAJOR).3
-RUBY_VERSION_EXT = 2.3.0
+RUBY_VERSION_MAJOR = 2.4
+RUBY_VERSION = $(RUBY_VERSION_MAJOR).0
+RUBY_VERSION_EXT = 2.4.0
 RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR)
 RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz
 RUBY_DEPENDENCIES = host-pkgconf host-ruby
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/1 ruby: bump version to 2.4.0

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vicente" == Vicente Olivert Riera <[email protected]> writes:

The problem addressed by 0001 patch has been fixed upstream and is that fix is included in this release:
https://github.com/ruby/ruby/commit/aa107497cd379b713eba8cecdb9a882bb1e0dd89

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 ruby: bump version to 2.4.0

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"Peter" == Peter Korsgaard <[email protected]> writes:

"Vicente" == Vicente Olivert Riera <[email protected]> writes:

The problem addressed by 0001 patch has been fixed upstream and is that fix is included in this release:
https://github.com/ruby/ruby/commit/aa107497cd379b713eba8cecdb9a882bb1e0dd89

Committed, thanks.

This seems to cause a number of build issues. Care to take a look?

http://autobuild.buildroot.net/?reason=ruby-2.4.0

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 ruby: bump version to 2.4.0

Am Sun, 22 Jan 2017 22:07:21 +0100 schrieb Peter Korsgaard:

Quoted 3 lines

This seems to cause a number of build issues. Care to take a look?

http://autobuild.buildroot.net/?reason=ruby-2.4.0

Hi,

apparantly configure has problems detecting math functions of uClibc:

http://autobuild.buildroot.net/
results/2aa/2aa668247b6925ff1290182a67092156b5bcc1b2//build-end.log

checking for finite... no
[...]
checking for isinf... no
checking for isnan... no

http://autobuild.buildroot.net/
results/2aa/2aa668247b6925ff1290182a67092156b5bcc1b2//ruby-2.4.0/ config.log

configure:20069: checking for finite
configure:20069: /home/test/autobuild/run/instance-1/output/host/usr/bin/ m68k-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - D_FILE_OFFSET_BITS=64 -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - D_FILE_OFFSET_BITS=64 conftest.c -lgmp -ldl -lcrypt -lm >&5 conftest.c:238:6: warning: conflicting types for built-in function 'finite'

 char finite ();
      ^

/tmp/ccip45ij.o: In function `main':
conftest.c:(.text.startup+0x6): undefined reference to `finite'
collect2: error: ld returned 1 exit status

although uClibc supports these functions.

Hacking ruby.mk like this

RUBY_CONF_ENV += \
       ac_cv_func_finite=yes \
       ac_cv_func_isinf=yes \
       ac_cv_func_isnan=yes

endif

fixes the build:

checking for finite... (cached) yes
[...]
checking for isinf... (cached) yes
checking for isnan... (cached) yes

Shall I send a patch with this hack?

Regards, Bernd

#4 lore raw

PATCH 1/1 ruby: bump version to 2.4.0

Hi,
Bernd Kuhls wrote,

Quoted 9 lines

Am Sun, 22 Jan 2017 22:07:21 +0100 schrieb Peter Korsgaard:

Quoted 3 lines

This seems to cause a number of build issues. Care to take a look?

http://autobuild.buildroot.net/?reason=ruby-2.4.0

Hi,

apparantly configure has problems detecting math functions of uClibc:

Because configure checks for functions, but isfinite, isinf and isnan are implemented as macros. For Dragonfly they explicitely set isinf/isnan as available:
https://github.com/ruby/ruby/blob/trunk/configure.in#L1278

Shouldn't this be reported upstream?
I think this is an autotool detection bug.

Quoted 5 lines

m68k-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - D_FILE_OFFSET_BITS=64 -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE - D_FILE_OFFSET_BITS=64 conftest.c -lgmp -ldl -lcrypt -lm >&5 conftest.c:238:6: warning: conflicting types for built-in function 'finite'

Quoted 7 lines
 char finite ();
      ^

/tmp/ccip45ij.o: In function `main':
conftest.c:(.text.startup+0x6): undefined reference to `finite'
collect2: error: ld returned 1 exit status

although uClibc supports these functions.

finite seems obsoleted and isfinite should be used.

It appears musl implements finite as function for backward compatibility. Therefore the check does not fail for musl toolchains.
https://git.musl-libc.org/cgit/musl/tree/src/math/finite.c

For glibc the check fails and the replacement functions for finite, isinf and isnan are used.

For uclibc-ng the check fails, but the replacement functions cannot be used, because finite is already defined as macro for backward compatibility. (added a while ago for inetd..)

Quoted 7 lines

Hacking ruby.mk like this

RUBY_CONF_ENV += \
       ac_cv_func_finite=yes \
       ac_cv_func_isinf=yes \
       ac_cv_func_isnan=yes

endif

I think this is the best thing todo inside buildroot.

I think ruby's configure script should detect isfinite (function or macro) and only fallback trying to detect finite otherwise.

best regards
Waldemar

#5 lore raw

PATCH 1/1 ruby: bump version to 2.4.0

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Waldemar" == Waldemar Brodkorb <[email protected]> writes:

Hi,

Quoted 18 lines
Quoted 1 line

apparantly configure has problems detecting math functions of uClibc:

Because configure checks for functions, but isfinite, isinf and isnan are implemented as macros. For Dragonfly they explicitely set isinf/isnan as available:
https://github.com/ruby/ruby/blob/trunk/configure.in#L1278

Shouldn't this be reported upstream?
I think this is an autotool detection bug.

Quoted 1 line

although uClibc supports these functions.

finite seems obsoleted and isfinite should be used.

It appears musl implements finite as function for backward compatibility. Therefore the check does not fail for musl toolchains.
https://git.musl-libc.org/cgit/musl/tree/src/math/finite.c

Quoted 6 lines

For glibc the check fails and the replacement functions for finite, isinf and isnan are used.

For uclibc-ng the check fails, but the replacement functions cannot be used, because finite is already defined as macro for backward compatibility. (added a while ago for inetd..)

Indeed, finite is a function on musl. On my glibc version they are also (weakly) defined (and configure correctly finds them):

nm -D /lib/x86_64-linux-gnu/libc.so.6|grep -wE 'finite|isinf|isnan' 0000000000032310 W finite
00000000000322a0 W isinf
00000000000322e0 W isnan

I'm not sure what the spec (if any exists) for these legacy BSD functions say about if the unprefixed symbols really need to be available, but it is certainly a difference between uClibc-ng and glibc/musl.

Quoted 9 lines
Quoted 7 lines

Hacking ruby.mk like this

RUBY_CONF_ENV += \
ac_cv_func_finite=yes \
ac_cv_func_isinf=yes \
ac_cv_func_isnan=yes
endif

I think this is the best thing todo inside buildroot.

Yes, that might be the way to go. Notice that musl implements isinf / isnan as macros, so the detection fails. The reason why it doesn't cause linker errors is that include/ruby/missing.h checks if isnan is a macro before providing a local declaration:

#ifndef isnan

# ifndef HAVE_ISNAN
RUBY_EXTERN int isnan(double);
# endif
#endif

vs:

#ifndef HAVE_FINITE
RUBY_EXTERN int finite(double);
#endif

So another solution is to add an #ifndef finite around it. That fix could probably be upstreamed as they already do it for a number of other functions.

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw

PATCH 1/1 ruby: bump version to 2.4.0

Hello,

Quoted 13 lines · Peter Korsgaard

Yes, that might be the way to go. Notice that musl implements isinf / isnan as macros, so the detection fails. The reason why it doesn't cause linker errors is that include/ruby/missing.h checks if isnan is a macro before providing a local declaration:

#ifndef isnan

# ifndef HAVE_ISNAN
RUBY_EXTERN int isnan(double);
# endif
#endif

vs:

Quoted 7 lines

#ifndef HAVE_FINITE
RUBY_EXTERN int finite(double);
#endif

So another solution is to add an #ifndef finite around it. That fix could probably be upstreamed as they already do it for a number of other functions.

Vicente, since you provided the patch bumping ruby to 2.4.0, could you provide a patch that fixes the build issues, as suggested by Peter?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com