Ruby 2.7.0

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Ruby 2.7.0

Jeremy Evans-5
Ruby 2.7.0 was released today.  Release announcement is at
https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/

Some highlights:

* Pattern matching
* Improvements to irb (multiline, syntax highlighting)
* Compacting garbage collector
* Separation of keyword and positional arguments
* Numbered parameters

Tested on amd64, for about 9 months starting with the first preview
release. OK to import?

Thanks,
Jeremy

ruby-2.7.0.tar.gz (168K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

Jeremie Courreges-Anglas-2
On Wed, Dec 25 2019, Jeremy Evans <[hidden email]> wrote:

> Ruby 2.7.0 was released today.  Release announcement is at
> https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/
>
> Some highlights:
>
> * Pattern matching
> * Improvements to irb (multiline, syntax highlighting)
> * Compacting garbage collector
> * Separation of keyword and positional arguments
> * Numbered parameters
>
> Tested on amd64, for about 9 months starting with the first preview
> release. OK to import?
This fails on sparc64, log attached.  It *seems* that the configure
tests are picky because of APIWARN and libgmp.  And indeed the build
fails similarly on amd64 with USE_LLD=No (only ld.bfd warns about unsafe
functions, ld.lld does not).

--8<--
configure:18665: checking for function name string predefined identifier
configure:18696: cc -std=gnu99 -o conftest -O2 -pipe -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -DOPENSSL_NO_STATIC_ENGINE -I/usr/local/include -L/usr/local/lib -fstack-protector-strong conftest.c -lgmp -lm  >&5
/usr/local/lib/libgmp.so.10.0: warning: vsprintf() is often misused, please use vsnprintf()
configure:18696: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define RUBY_SYMBOL_EXPORT_BEGIN _Pragma("GCC visibility push(default)")
| #define RUBY_SYMBOL_EXPORT_END _Pragma("GCC visibility pop")
| #define HAVE_STMT_AND_DECL_IN_EXPR 1
| #define HAVE_DIRENT_H 1
| #define HAVE__BOOL 1
| #define HAVE_STDBOOL_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_A_OUT_H 1
| #define HAVE_GRP_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_IEEEFP_H 1
| #define HAVE_LANGINFO_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_PWD_H 1
| #define HAVE_SYS_FCNTL_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_SYSCALL_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TIMES_H 1
| #define HAVE_SYS_UIO_H 1
| #define HAVE_TIME_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_GMP_H 1
| #define HAVE_LIBGMP 1
| #define WORDS_BIGENDIAN 1
| #define HAVE_TYPEOF 1
| #define restrict __restrict__
| #define HAVE_LONG_LONG 1
| #define HAVE_OFF_T 1
| #define SIZEOF_INT 4
| #define SIZEOF_SHORT 2
| #define SIZEOF_LONG 8
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF___INT64 0
| #define SIZEOF___INT128 0
| #define SIZEOF_OFF_T 8
| #define SIZEOF_VOIDP 8
| #define SIZEOF_FLOAT 4
| #define SIZEOF_DOUBLE 8
| #define SIZEOF_TIME_T 8
| #define SIZEOF_CLOCK_T 8
| #define PACKED_STRUCT(x) x __attribute__((packed))
| #define USE_UNALIGNED_MEMBER_ACCESS 1
| #define PRI_LL_PREFIX "ll"
| #define HAVE_PID_T 1
| #define rb_pid_t pid_t
| #define SIGNEDNESS_OF_PID_T -1
| #define PIDT2NUM(v) INT2NUM(v)
| #define NUM2PIDT(v) NUM2INT(v)
| #define PRI_PIDT_PREFIX PRI_INT_PREFIX
| #define HAVE_UID_T 1
| #define rb_uid_t uid_t
| #define SIGNEDNESS_OF_UID_T +1
| #define UIDT2NUM(v) UINT2NUM(v)
| #define NUM2UIDT(v) NUM2UINT(v)
| #define PRI_UIDT_PREFIX PRI_INT_PREFIX
| #define HAVE_GID_T 1
| #define rb_gid_t gid_t
| #define SIGNEDNESS_OF_GID_T +1
| #define GIDT2NUM(v) UINT2NUM(v)
| #define NUM2GIDT(v) NUM2UINT(v)
| #define PRI_GIDT_PREFIX PRI_INT_PREFIX
| #define HAVE_TIME_T 1
| #define rb_time_t time_t
| #define SIGNEDNESS_OF_TIME_T -1
| #define TIMET2NUM(v) LL2NUM(v)
| #define NUM2TIMET(v) NUM2LL(v)
| #define PRI_TIMET_PREFIX PRI_LL_PREFIX
| #define HAVE_DEV_T 1
| #define rb_dev_t dev_t
| #define SIGNEDNESS_OF_DEV_T -1
| #define DEVT2NUM(v) INT2NUM(v)
| #define NUM2DEVT(v) NUM2INT(v)
| #define PRI_DEVT_PREFIX PRI_INT_PREFIX
| #define HAVE_MODE_T 1
| #define rb_mode_t mode_t
| #define SIGNEDNESS_OF_MODE_T +1
| #define MODET2NUM(v) UINT2NUM(v)
| #define NUM2MODET(v) NUM2UINT(v)
| #define PRI_MODET_PREFIX PRI_INT_PREFIX
| #define HAVE_RLIM_T 1
| #define rb_rlim_t rlim_t
| #define SIGNEDNESS_OF_RLIM_T +1
| #define RLIM2NUM(v) ULL2NUM(v)
| #define NUM2RLIM(v) NUM2ULL(v)
| #define PRI_RLIM_PREFIX PRI_LL_PREFIX
| #define HAVE_OFF_T 1
| #define rb_off_t off_t
| #define SIGNEDNESS_OF_OFF_T -1
| #define OFFT2NUM(v) LL2NUM(v)
| #define NUM2OFFT(v) NUM2LL(v)
| #define PRI_OFFT_PREFIX PRI_LL_PREFIX
| #define HAVE_CLOCKID_T 1
| #define rb_clockid_t clockid_t
| #define SIGNEDNESS_OF_CLOCKID_T -1
| #define CLOCKID2NUM(v) INT2NUM(v)
| #define NUM2CLOCKID(v) NUM2INT(v)
| #define PRI_CLOCKID_PREFIX PRI_INT_PREFIX
| #define HAVE_PROTOTYPES 1
| #define TOKEN_PASTE(x,y) x##y
| #define STRINGIZE(expr) STRINGIZE0(expr)
| #define HAVE_STDARG_PROTOTYPES 1
| #define HAVE_VA_ARGS_MACRO 1
| #define RUBY_ALIGNAS(x) __attribute__((__aligned__(x)))
| #define RUBY_ALIGNOF __alignof
| #define CONSTFUNC(x) __attribute__ ((__const__)) x
| #define PUREFUNC(x) __attribute__ ((__pure__)) x
| #define NORETURN(x) __attribute__ ((__noreturn__)) x
| #define DEPRECATED(x) __attribute__ ((__deprecated__)) x
| #define DEPRECATED_TYPE(mesg,x) __attribute__ ((__deprecated__ mesg)) x
| #define NOINLINE(x) __attribute__ ((__noinline__)) x
| #define ALWAYS_INLINE(x) __attribute__ ((__always_inline__)) x
| #define WARN_UNUSED_RESULT(x) __attribute__ ((__warn_unused_result__)) x
| #define MAYBE_UNUSED(x) __attribute__ ((__unused__)) x
| #define WEAK(x) __attribute__ ((__weak__)) x
| #define HAVE_FUNC_WEAK 1
| #define HAVE_ATTRIBUTE_FUNCTION_ALIAS 1
| #define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) type prot __attribute__((alias(#name)));
| #define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)
| #define HAVE_GCC_SYNC_BUILTINS 1
| #define RUBY_FUNC_EXPORTED __attribute__ ((__visibility__("default"))) extern
| #define RUBY_FUNC_NONNULL(n,x) __attribute__ ((__nonnull__(n))) x
| /* end confdefs.h.  */
| #include <stdio.h>
| int
| main ()
| {
| puts(__func__);
|   ;
|   return 0;
| }
configure:18696: cc -std=gnu99 -o conftest -O2 -pipe -Wall -Wextra -Wdeprecated-declarations -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -DOPENSSL_NO_STATIC_ENGINE -I/usr/local/include -L/usr/local/lib -fstack-protector-strong conftest.c -lgmp -lm  >&5
/usr/local/lib/libgmp.so.10.0: warning: vsprintf() is often misused, please use vsnprintf()
configure:18696: $? = 0
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define RUBY_SYMBOL_EXPORT_BEGIN _Pragma("GCC visibility push(default)")
| #define RUBY_SYMBOL_EXPORT_END _Pragma("GCC visibility pop")
| #define HAVE_STMT_AND_DECL_IN_EXPR 1
| #define HAVE_DIRENT_H 1
| #define HAVE__BOOL 1
| #define HAVE_STDBOOL_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_A_OUT_H 1
| #define HAVE_GRP_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_IEEEFP_H 1
| #define HAVE_LANGINFO_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_PWD_H 1
| #define HAVE_SYS_FCNTL_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_SYSCALL_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TIMES_H 1
| #define HAVE_SYS_UIO_H 1
| #define HAVE_TIME_H 1
| #define HAVE_UTIME_H 1
| #define HAVE_GMP_H 1
| #define HAVE_LIBGMP 1
| #define WORDS_BIGENDIAN 1
| #define HAVE_TYPEOF 1
| #define restrict __restrict__
| #define HAVE_LONG_LONG 1
| #define HAVE_OFF_T 1
| #define SIZEOF_INT 4
| #define SIZEOF_SHORT 2
| #define SIZEOF_LONG 8
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF___INT64 0
| #define SIZEOF___INT128 0
| #define SIZEOF_OFF_T 8
| #define SIZEOF_VOIDP 8
| #define SIZEOF_FLOAT 4
| #define SIZEOF_DOUBLE 8
| #define SIZEOF_TIME_T 8
| #define SIZEOF_CLOCK_T 8
| #define PACKED_STRUCT(x) x __attribute__((packed))
| #define USE_UNALIGNED_MEMBER_ACCESS 1
| #define PRI_LL_PREFIX "ll"
| #define HAVE_PID_T 1
| #define rb_pid_t pid_t
| #define SIGNEDNESS_OF_PID_T -1
| #define PIDT2NUM(v) INT2NUM(v)
| #define NUM2PIDT(v) NUM2INT(v)
| #define PRI_PIDT_PREFIX PRI_INT_PREFIX
| #define HAVE_UID_T 1
| #define rb_uid_t uid_t
| #define SIGNEDNESS_OF_UID_T +1
| #define UIDT2NUM(v) UINT2NUM(v)
| #define NUM2UIDT(v) NUM2UINT(v)
| #define PRI_UIDT_PREFIX PRI_INT_PREFIX
| #define HAVE_GID_T 1
| #define rb_gid_t gid_t
| #define SIGNEDNESS_OF_GID_T +1
| #define GIDT2NUM(v) UINT2NUM(v)
| #define NUM2GIDT(v) NUM2UINT(v)
| #define PRI_GIDT_PREFIX PRI_INT_PREFIX
| #define HAVE_TIME_T 1
| #define rb_time_t time_t
| #define SIGNEDNESS_OF_TIME_T -1
| #define TIMET2NUM(v) LL2NUM(v)
| #define NUM2TIMET(v) NUM2LL(v)
| #define PRI_TIMET_PREFIX PRI_LL_PREFIX
| #define HAVE_DEV_T 1
| #define rb_dev_t dev_t
| #define SIGNEDNESS_OF_DEV_T -1
| #define DEVT2NUM(v) INT2NUM(v)
| #define NUM2DEVT(v) NUM2INT(v)
| #define PRI_DEVT_PREFIX PRI_INT_PREFIX
| #define HAVE_MODE_T 1
| #define rb_mode_t mode_t
| #define SIGNEDNESS_OF_MODE_T +1
| #define MODET2NUM(v) UINT2NUM(v)
| #define NUM2MODET(v) NUM2UINT(v)
| #define PRI_MODET_PREFIX PRI_INT_PREFIX
| #define HAVE_RLIM_T 1
| #define rb_rlim_t rlim_t
| #define SIGNEDNESS_OF_RLIM_T +1
| #define RLIM2NUM(v) ULL2NUM(v)
| #define NUM2RLIM(v) NUM2ULL(v)
| #define PRI_RLIM_PREFIX PRI_LL_PREFIX
| #define HAVE_OFF_T 1
| #define rb_off_t off_t
| #define SIGNEDNESS_OF_OFF_T -1
| #define OFFT2NUM(v) LL2NUM(v)
| #define NUM2OFFT(v) NUM2LL(v)
| #define PRI_OFFT_PREFIX PRI_LL_PREFIX
| #define HAVE_CLOCKID_T 1
| #define rb_clockid_t clockid_t
| #define SIGNEDNESS_OF_CLOCKID_T -1
| #define CLOCKID2NUM(v) INT2NUM(v)
| #define NUM2CLOCKID(v) NUM2INT(v)
| #define PRI_CLOCKID_PREFIX PRI_INT_PREFIX
| #define HAVE_PROTOTYPES 1
| #define TOKEN_PASTE(x,y) x##y
| #define STRINGIZE(expr) STRINGIZE0(expr)
| #define HAVE_STDARG_PROTOTYPES 1
| #define HAVE_VA_ARGS_MACRO 1
| #define RUBY_ALIGNAS(x) __attribute__((__aligned__(x)))
| #define RUBY_ALIGNOF __alignof
| #define CONSTFUNC(x) __attribute__ ((__const__)) x
| #define PUREFUNC(x) __attribute__ ((__pure__)) x
| #define NORETURN(x) __attribute__ ((__noreturn__)) x
| #define DEPRECATED(x) __attribute__ ((__deprecated__)) x
| #define DEPRECATED_TYPE(mesg,x) __attribute__ ((__deprecated__ mesg)) x
| #define NOINLINE(x) __attribute__ ((__noinline__)) x
| #define ALWAYS_INLINE(x) __attribute__ ((__always_inline__)) x
| #define WARN_UNUSED_RESULT(x) __attribute__ ((__warn_unused_result__)) x
| #define MAYBE_UNUSED(x) __attribute__ ((__unused__)) x
| #define WEAK(x) __attribute__ ((__weak__)) x
| #define HAVE_FUNC_WEAK 1
| #define HAVE_ATTRIBUTE_FUNCTION_ALIAS 1
| #define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) type prot __attribute__((alias(#name)));
| #define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)
| #define HAVE_GCC_SYNC_BUILTINS 1
| #define RUBY_FUNC_EXPORTED __attribute__ ((__visibility__("default"))) extern
| #define RUBY_FUNC_NONNULL(n,x) __attribute__ ((__nonnull__(n))) x
| /* end confdefs.h.  */
| #include <stdio.h>
| int
| main ()
| {
| puts(__FUNCTION__);
|   ;
|   return 0;
| }
configure:18717: result: no
-->8--


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

ruby27-sparc64.log.gz (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

George Koehler-2
On Thu, 26 Dec 2019 21:58:36 +0100
Jeremie Courreges-Anglas <[hidden email]> wrote:

> On Wed, Dec 25 2019, Jeremy Evans <[hidden email]> wrote:
> > Tested on amd64, for about 9 months starting with the first preview
> > release. OK to import?
>
> This fails on sparc64, log attached.  It *seems* that the configure
> tests are picky because of APIWARN and libgmp.  And indeed the build
> fails similarly on amd64 with USE_LLD=No (only ld.bfd warns about unsafe
> functions, ld.lld does not).

I built ruby-2.7.0 on macppc/powerpc with the diff below.

The ld.bfd warning from libgmp broke the configure test for __func__, so
RUBY_FUNCTION_NAME_STRING went missing.  This test might have been
broken for a long time, but RUBY_FUNCTION_NAME_STRING was optional until
Nov 17 [1], so it didn't break the build before 2.7.0.  Some other tests
in my config.log get the same warning from libgmp, but seem to ignore
the warning.  For upstream Ruby, I suggest to check if __func__ can
become an allowed C99 feature [2].  If so, Ruby can remove this
configure test and always use __func__.

I got another error where coroutine/copy/Context.h included <alloca.h>,
so I deleted the include.  OpenBSD (except amd64, i386) is the only
system where Ruby enables --with-coroutine=copy by default, so this code
is mostly for OpenBSD, but didn't work on OpenBSD, because we have no
<alloca.h>!  I don't check HAVE_ALLOCA_H because the coroutine code
doesn't include the Ruby header for HAVE_ALLOCA_H.

I have not reported these bugs to https://bugs.ruby-lang.org/ but might
report them tomorrow.  --George

[1] https://github.com/ruby/ruby/commit/57cd462
[2] https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/C99

--- patches/patch-configure.orig Thu Dec 19 19:35:50 2019
+++ patches/patch-configure Thu Dec 26 20:49:24 2019
@@ -1,5 +1,8 @@
 $OpenBSD: patch-configure,v 1.2 2019/02/01 16:24:59 jeremy Exp $
 
+Ignore ".../libgmp.so.*: warning: vsprintf() is often misused..."
+from ld.bfd when trying __func__.
+
 Set correct shared library name.
 
 Override the arch setting to remove OpenBSD version from it,
@@ -8,6 +11,15 @@
 Index: configure
 --- configure.orig
 +++ configure
+@@ -18679,7 +18679,7 @@ else
+   unset rb_c_werror_flag
+
+ fi
+-ac_c_werror_flag=yes
++unset ac_c_werror_flag
+
+ for func in __func__ __FUNCTION__; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 @@ -28712,7 +28712,7 @@ fi
  ;; #(
    openbsd*|mirbsd*) :
--- /dev/null Thu Dec 26 22:49:53 2019
+++ patches/patch-coroutine_copy_Context_h Thu Dec 26 21:07:11 2019
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: coroutine/copy/Context.h
+--- coroutine/copy/Context.h.orig
++++ coroutine/copy/Context.h
+@@ -12,7 +12,6 @@
+ #include <setjmp.h>
+ #include <string.h>
+ #include <stdlib.h>
+-#include <alloca.h>
+
+ #define COROUTINE __attribute__((noreturn)) void
+

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

Jeremy Evans-5
On 12/26 11:38, George Koehler wrote:

> On Thu, 26 Dec 2019 21:58:36 +0100
> Jeremie Courreges-Anglas <[hidden email]> wrote:
>
> > On Wed, Dec 25 2019, Jeremy Evans <[hidden email]> wrote:
> > > Tested on amd64, for about 9 months starting with the first preview
> > > release. OK to import?
> >
> > This fails on sparc64, log attached.  It *seems* that the configure
> > tests are picky because of APIWARN and libgmp.  And indeed the build
> > fails similarly on amd64 with USE_LLD=No (only ld.bfd warns about unsafe
> > functions, ld.lld does not).
>
> I built ruby-2.7.0 on macppc/powerpc with the diff below.
>
> The ld.bfd warning from libgmp broke the configure test for __func__, so
> RUBY_FUNCTION_NAME_STRING went missing.  This test might have been
> broken for a long time, but RUBY_FUNCTION_NAME_STRING was optional until
> Nov 17 [1], so it didn't break the build before 2.7.0.  Some other tests
> in my config.log get the same warning from libgmp, but seem to ignore
> the warning.  For upstream Ruby, I suggest to check if __func__ can
> become an allowed C99 feature [2].  If so, Ruby can remove this
> configure test and always use __func__.
>
> I got another error where coroutine/copy/Context.h included <alloca.h>,
> so I deleted the include.  OpenBSD (except amd64, i386) is the only
> system where Ruby enables --with-coroutine=copy by default, so this code
> is mostly for OpenBSD, but didn't work on OpenBSD, because we have no
> <alloca.h>!  I don't check HAVE_ALLOCA_H because the coroutine code
> doesn't include the Ruby header for HAVE_ALLOCA_H.
>
> I have not reported these bugs to https://bugs.ruby-lang.org/ but might
> report them tomorrow.  --George

Thank you very much to both Jeremie for the report and George for the
analysis and patch.  Jeremie, does the diff below work for sparc64?  If
so, is it OK to import?

I'll fix both issues upstream and mark them for backporting, so they
hopefully will be fixed in Ruby 2.7.1.

Thanks,
Jeremy

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

Jeremy Evans-5
On 12/27 12:58, Jeremy Evans wrote:

> On 12/26 11:38, George Koehler wrote:
> > On Thu, 26 Dec 2019 21:58:36 +0100
> > Jeremie Courreges-Anglas <[hidden email]> wrote:
> >
> > > On Wed, Dec 25 2019, Jeremy Evans <[hidden email]> wrote:
> > > > Tested on amd64, for about 9 months starting with the first preview
> > > > release. OK to import?
> > >
> > > This fails on sparc64, log attached.  It *seems* that the configure
> > > tests are picky because of APIWARN and libgmp.  And indeed the build
> > > fails similarly on amd64 with USE_LLD=No (only ld.bfd warns about unsafe
> > > functions, ld.lld does not).
> >
> > I built ruby-2.7.0 on macppc/powerpc with the diff below.
> >
> > The ld.bfd warning from libgmp broke the configure test for __func__, so
> > RUBY_FUNCTION_NAME_STRING went missing.  This test might have been
> > broken for a long time, but RUBY_FUNCTION_NAME_STRING was optional until
> > Nov 17 [1], so it didn't break the build before 2.7.0.  Some other tests
> > in my config.log get the same warning from libgmp, but seem to ignore
> > the warning.  For upstream Ruby, I suggest to check if __func__ can
> > become an allowed C99 feature [2].  If so, Ruby can remove this
> > configure test and always use __func__.
> >
> > I got another error where coroutine/copy/Context.h included <alloca.h>,
> > so I deleted the include.  OpenBSD (except amd64, i386) is the only
> > system where Ruby enables --with-coroutine=copy by default, so this code
> > is mostly for OpenBSD, but didn't work on OpenBSD, because we have no
> > <alloca.h>!  I don't check HAVE_ALLOCA_H because the coroutine code
> > doesn't include the Ruby header for HAVE_ALLOCA_H.
> >
> > I have not reported these bugs to https://bugs.ruby-lang.org/ but might
> > report them tomorrow.  --George
>
> Thank you very much to both Jeremie for the report and George for the
> analysis and patch.  Jeremie, does the diff below work for sparc64?  If
> so, is it OK to import?

I accidentally deleted the diff George sent when replying, but that's
the diff I was referring to.

> I'll fix both issues upstream and mark them for backporting, so they
> hopefully will be fixed in Ruby 2.7.1.

I fixed the copy coroutine issue upstream.  For the other issue, it may
be easier to work around with rb_cv_function_name_string=__func__ added
to CONFIGURE_ENV, instead of patching configure.  I haven't figured out
how to fix that properly upstream in configure.ac yet. Once I can
recreate the issue in a development environment, I'll work on that.

Thanks,
Jeremy

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

George Koehler-2
On Fri, 27 Dec 2019 15:56:58 -0800
Jeremy Evans <[hidden email]> wrote:

> I fixed the copy coroutine issue upstream.  For the other issue, it may
> be easier to work around with rb_cv_function_name_string=__func__ added
> to CONFIGURE_ENV, instead of patching configure.  I haven't figured out
> how to fix that properly upstream in configure.ac yet. Once I can
> recreate the issue in a development environment, I'll work on that.

Might need to delete the RUBY_WERROR_FLAG call around the __func__ check
in configure.ac.  The called macro is in tool/m4/ruby_werror_flag.m4.

I did a "make test" in /usr/ports/lang/ruby/2.7 on powerpc.  Results are
better than ever: I saw 2 failures, 2 errors.  The early tests (before
the big ./test/runner.rb) all pass.  I feared that ./test/runner.rb got
stuck in an infinite loop, but it wasn't stuck: it runs thousands of
tests without output.  If I let it run for a few hours, it finishes.

I'm pasting the end of "make test" output for powerpc.  --George

ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [powerpc-openbsd]
exec ./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- -
-disable-gems "./test/runner.rb" --ruby="./miniruby -I./lib -I. -I.ext/common  .
/tool/runruby.rb --extout=.ext  -- --disable-gems" --excludes-dir=./test/exclude
s --name=!/memory_leak/
generate_index tests are being skipped.  Install builder gem.
Gem::Indexer tests are being skipped.  Install builder gem.
Run options: "--ruby=./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --e
xtout=.ext  -- --disable-gems" --excludes-dir=./test/excludes --name=!/memory_le
ak/

# Running tests:

Leaked thread: DRbTests::TestDRbTCP#test_immediate_close: #<Thread:0xecc2be58 /u
sr/ports/pobj/ruby-2.7.0/ruby-2.7.0/lib/drb/drb.rb:1722 sleep>

  1) Failure:
Fiddle::TestImport#test_gettimeofday [/usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/test
/fiddle/test_import.rb:126]:
Failed assertion, no message given.

  2) Failure:
TestFiber#test_stack_size [/usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/test/ruby/test_
fiber.rb:389]:
Expected 17 to be >= 18.

  3) Error:
TestRefinement#test_prepend_after_refine_wb_miss:
Timeout::Error: execution of assert_normal_exit expired timeout (30 sec)
pid 43213 exit 1
| -:38:in `block in <main>': NameError
|       from -:3:in `times'
|       from -:3:in `<main>'
|

    /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/test/ruby/test_refinement.rb:913:in `t
est_prepend_after_refine_wb_miss'

  4) Error:
TestWEBrickSSLServer#test_slow_connect:
Timeout::Error: execution expired
    /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/.ext/common/openssl/ssl.rb:235:in `add
r'
    /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/.ext/common/openssl/ssl.rb:235:in `add
r'
    /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/lib/webrick/server.rb:110:in `initiali
ze'
    /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/test/webrick/utils.rb:56:in `new'
    /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/test/webrick/utils.rb:56:in `block in
start_server'

Finished tests in 9608.291331s, 2.1812 tests/s, 283.6097 assertions/s.
20958 tests, 2725005 assertions, 2 failures, 2 errors, 72 skips

ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [powerpc-openbsd]
*** Error 4 in /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0 (Makefile:1470 'yes-test-al
l')
*** Error 1 in . (Makefile:43 'do-test')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2919 '/usr/ports/pobj
/ruby-2.7.0/.test_done')
*** Error 1 in /usr/ports/lang/ruby/2.7 (/usr/ports/infrastructure/mk/bsd.port.m
k:2556 'test')

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

Jeremie Courreges-Anglas-2
In reply to this post by Jeremy Evans-5
On Fri, Dec 27 2019, Jeremy Evans <[hidden email]> wrote:

> On 12/27 12:58, Jeremy Evans wrote:
>> On 12/26 11:38, George Koehler wrote:
>> > On Thu, 26 Dec 2019 21:58:36 +0100
>> > Jeremie Courreges-Anglas <[hidden email]> wrote:
>> >
>> > > On Wed, Dec 25 2019, Jeremy Evans <[hidden email]> wrote:
>> > > > Tested on amd64, for about 9 months starting with the first preview
>> > > > release. OK to import?
>> > >
>> > > This fails on sparc64, log attached.  It *seems* that the configure
>> > > tests are picky because of APIWARN and libgmp.  And indeed the build
>> > > fails similarly on amd64 with USE_LLD=No (only ld.bfd warns about unsafe
>> > > functions, ld.lld does not).
>> >
>> > I built ruby-2.7.0 on macppc/powerpc with the diff below.
>> >
>> > The ld.bfd warning from libgmp broke the configure test for __func__, so
>> > RUBY_FUNCTION_NAME_STRING went missing.  This test might have been
>> > broken for a long time, but RUBY_FUNCTION_NAME_STRING was optional until
>> > Nov 17 [1], so it didn't break the build before 2.7.0.  Some other tests
>> > in my config.log get the same warning from libgmp, but seem to ignore
>> > the warning.  For upstream Ruby, I suggest to check if __func__ can
>> > become an allowed C99 feature [2].  If so, Ruby can remove this
>> > configure test and always use __func__.
>> >
>> > I got another error where coroutine/copy/Context.h included <alloca.h>,
>> > so I deleted the include.  OpenBSD (except amd64, i386) is the only
>> > system where Ruby enables --with-coroutine=copy by default, so this code
>> > is mostly for OpenBSD, but didn't work on OpenBSD, because we have no
>> > <alloca.h>!  I don't check HAVE_ALLOCA_H because the coroutine code
>> > doesn't include the Ruby header for HAVE_ALLOCA_H.
>> >
>> > I have not reported these bugs to https://bugs.ruby-lang.org/ but might
>> > report them tomorrow.  --George
>>
>> Thank you very much to both Jeremie for the report and George for the
>> analysis and patch.  Jeremie, does the diff below work for sparc64?  If
>> so, is it OK to import?

The diff did fix the build and packaging.  make test fails, though:

--8<--
[...]
exec ./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems "./bootstraptest/runner.rb" --ruby="ruby27 -I./lib --disable-gems" -q
test_attr.rb             ..
test_autoload.rb         ........
test_block.rb            ..........................................................
test_class.rb            ................................................
test_env.rb              ..
test_eval.rb             .....................................
test_exception.rb        ..................................
test_fiber.rb            [BUG] Bus Error at 0x0000007f196a6a38
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [sparc64-openbsd]

-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]


-- Other runtime information -----------------------------------------------

* Loaded script: bootstraptest.tmp.rb

* Loaded features:

    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 ruby2_keywords.rb
    5 /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/.ext/sparc64-openbsd/enc/encdb.so
    6 /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/.ext/sparc64-openbsd/enc/trans/transdb.so

./bootstraptest/runner.rb:456:in `get_result_string': core dumped (CoreDumpError)
        from ./bootstraptest/runner.rb:267:in `show_limit'
        from /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/bootstraptest/test_fiber.rb:1:in `<top (required)>'
        from ./bootstraptest/runner.rb:196:in `load'
        from ./bootstraptest/runner.rb:196:in `block in exec_test'
        from ./bootstraptest/runner.rb:188:in `each'
        from ./bootstraptest/runner.rb:188:in `exec_test'
        from ./bootstraptest/runner.rb:169:in `block in main'
        from ./bootstraptest/runner.rb:509:in `block (2 levels) in in_temporary_working_directory'
        from ./bootstraptest/runner.rb:508:in `chdir'
        from ./bootstraptest/runner.rb:508:in `block in in_temporary_working_directory'
        from /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0/lib/tmpdir.rb:89:in `mktmpdir'
        from ./bootstraptest/runner.rb:507:in `in_temporary_working_directory'
        from ./bootstraptest/runner.rb:168:in `main'
        from ./bootstraptest/runner.rb:530:in `<main>'
*** Error 1 in /usr/ports/pobj/ruby-2.7.0/ruby-2.7.0 (Makefile:1439 'yes-btest-ruby')
*** Error 1 in . (Makefile:43 'do-test')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2919 '/usr/ports/pobj/ruby-2.7.0/.test_done')
*** Error 1 in /usr/ports/lang/ruby/2.7 (/usr/ports/infrastructure/mk/bsd.port.mk:2556 'test')
-->8--

I removed test_fiber.rb and am now running the tests again, trying to
sort out why I'm hitting resource exhaustion...

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

Jeremie Courreges-Anglas-2
On Sat, Dec 28 2019, Jeremie Courreges-Anglas <[hidden email]> wrote:

[...]

> I removed test_fiber.rb and am now running the tests again, trying to
> sort out why I'm hitting resource exhaustion...

Build restarted with DEBUG=-g.

I guess there's no point delaying import for a sparc64-specific problem,
but if it's not fixed soon you should keep it in mind before making
ruby27 the default.  ok jca@ to import

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

Christian Weisgerber
In reply to this post by Jeremie Courreges-Anglas-2
On 2019-12-26, Jeremie Courreges-Anglas <[hidden email]> wrote:

> /usr/local/lib/libgmp.so.10.0: warning: vsprintf() is often misused, please use vsnprintf()

On a side note, this warning is unfixable.  gmp_sprintf() and
gmp_vsprintf() are part of the GMP API and inherently have to use
vsprintf().

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.7.0

Jeremie Courreges-Anglas-2
In reply to this post by Jeremie Courreges-Anglas-2
On Sat, Dec 28 2019, Jeremie Courreges-Anglas <[hidden email]> wrote:
> On Sat, Dec 28 2019, Jeremie Courreges-Anglas <[hidden email]> wrote:
>
> [...]
>
>> I removed test_fiber.rb and am now running the tests again, trying to
>> sort out why I'm hitting resource exhaustion...
>
> Build restarted with DEBUG=-g.

Back to this test_fiber.rb problem.  Looks like sparc register windows
handling has been fragile for some time in ruby land:

  https://redmine.ruby-lang.org/issues/5244

The source code mentions a discussion with David Miller:

  https://marc.info/?l=linux-sparc&m=131914569320660&w=2

I have tried to use "ta 0x03" instead of "flushw [....%o7]" in
coroutine_flush_register_windows(), it didn't help.

I couldn't find a core dump for test_fiber.rb, pointers for proper
debugging welcome.  Instead, here's a simple reproducer.

Let me know if you need more input.


--8<--
billy $ egdb --args ruby27 -e 'Fiber.new{Fiber.yield}.resume'
[...]
Reading symbols from ruby27...done.
(gdb) r
Starting program: /usr/local/bin/ruby27 -e Fiber.new\{Fiber.yield\}.resume
[New thread 126043]

Thread 1 received signal SIGBUS, Bus error.
0x00000018329daa38 in coroutine_save_stack (context=<optimized out>) at coroutine/copy/Context.c:64
64      }
(gdb) bt
#0  0x00000018329daa38 in coroutine_save_stack (context=<optimized out>) at coroutine/copy/Context.c:64
#1  0x515fc14d280fde77 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) l
59              context->used = size;
60          }
61
62          // Save registers / restore point:
63          return _setjmp(context->state);
64      }
65
66      __attribute__((noreturn, noinline))
67      static void coroutine_restore_stack_padded(struct coroutine_context *context, void * buffer) {
68          void *stack_pointer = &stack_pointer;
(gdb) disas
Dump of assembler code for function coroutine_save_stack:
   0x00000018329da9a0 <+0>:     save  %sp, -208, %sp
   0x00000018329da9a4 <+4>:     sethi  %hi(0x17c00), %g1
   0x00000018329da9a8 <+8>:     ldx  [ %i0 ], %g4
   0x00000018329da9ac <+12>:    add  %fp, 0x7df, %g2
   0x00000018329da9b0 <+16>:    sethi  %hi(0x432c00), %l7
   0x00000018329da9b4 <+20>:    call  0x18329da7b0
   0x00000018329da9b8 <+24>:    add  %l7, 0x2e4, %l7    ! 0x432ee4
   0x00000018329da9bc <+28>:    or  %g1, 0x2f0, %g1
   0x00000018329da9c0 <+32>:    stx  %g2, [ %fp + 0x7df ]
   0x00000018329da9c4 <+36>:    ldx  [ %l7 + %g1 ], %g3
   0x00000018329da9c8 <+40>:    ldx  [ %g3 ], %g1
   0x00000018329da9cc <+44>:    stx  %g1, [ %fp + 0x7e7 ]
   0x00000018329da9d0 <+48>:    clr  %g1
   0x00000018329da9d4 <+52>:    brz,pn   %g4, 0x18329daa8c <coroutine_save_stack+236>
   0x00000018329da9d8 <+56>:    sethi  %hi(0x17800), %g1
   0x00000018329da9dc <+60>:    ldx  [ %i0 + 0x18 ], %g1
   0x00000018329da9e0 <+64>:    brz,pn   %g1, 0x18329daab4 <coroutine_save_stack+276>
   0x00000018329da9e4 <+68>:    sethi  %hi(0x17800), %g1
   0x00000018329da9e8 <+72>:    call  0x18329da7a0 <coroutine_flush_register_windows>
   0x00000018329da9ec <+76>:    nop
   0x00000018329da9f0 <+80>:    ldx  [ %i0 + 0x18 ], %o2
   0x00000018329da9f4 <+84>:    ldx  [ %fp + 0x7df ], %o1
   0x00000018329da9f8 <+88>:    cmp  %o2, %o1
   0x00000018329da9fc <+92>:    bgu  %xcc, 0x18329daa5c <coroutine_save_stack+188>
   0x00000018329daa00 <+96>:    ldx  [ %i0 + 8 ], %g1
   0x00000018329daa04 <+100>:   sub  %o1, %o2, %l0
   0x00000018329daa08 <+104>:   cmp  %l0, %g1
   0x00000018329daa0c <+108>:   bgu,pn   %xcc, 0x18329daadc <coroutine_save_stack+316>
   0x00000018329daa10 <+112>:   mov  %o2, %o1
   0x00000018329daa14 <+116>:   ldx  [ %i0 ], %o0
   0x00000018329daa18 <+120>:   call  0x1832cfdf00 <memcpy@plt>
   0x00000018329daa1c <+124>:   mov  %l0, %o2
   0x00000018329daa20 <+128>:   stx  %l0, [ %i0 + 0x10 ]
   0x00000018329daa24 <+132>:   call  0x1832d059e0 <_setjmp@plt>
   0x00000018329daa28 <+136>:   add  %i0, 0x20, %o0
   0x00000018329daa2c <+140>:   sra  %o0, 0, %i0
   0x00000018329daa30 <+144>:   sethi  %hi(0x17c00), %g1
   0x00000018329daa34 <+148>:   or  %g1, 0x2f0, %g1     ! 0x17ef0
=> 0x00000018329daa38 <+152>:   ldx  [ %l7 + %g1 ], %g2
   0x00000018329daa3c <+156>:   ldx  [ %fp + 0x7e7 ], %g3
   0x00000018329daa40 <+160>:   ldx  [ %g2 ], %g1
   0x00000018329daa44 <+164>:   xor  %g3, %g1, %g3
   0x00000018329daa48 <+168>:   clr  %g1
   0x00000018329daa4c <+172>:   brnz,pn   %g3, 0x18329daa80 <coroutine_save_stack+224>
   0x00000018329daa50 <+176>:   sethi  %hi(0x17400), %g1
   0x00000018329daa54 <+180>:   rett  %i7 + 8
   0x00000018329daa58 <+184>:   nop
   0x00000018329daa5c <+188>:   sub  %o2, %o1, %l0
   0x00000018329daa60 <+192>:   cmp  %l0, %g1
   0x00000018329daa64 <+196>:   bgu,pn   %xcc, 0x18329dab08 <coroutine_save_stack+360>
   0x00000018329daa68 <+200>:   sethi  %hi(0x17800), %g1
   0x00000018329daa6c <+204>:   ldx  [ %i0 ], %o0
   0x00000018329daa70 <+208>:   call  0x1832cfdf00 <memcpy@plt>
   0x00000018329daa74 <+212>:   mov  %l0, %o2
---Type <return> to continue, or q <return> to quit---
-->8--


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE