Ruby 2.6.0

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

Ruby 2.6.0

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

Some highlights:

* Significant performance improvements
* JIT Compiler
* Endless Ranges
* Function Composition Operators for Procs
* One-shot coverage
* Bundler now included

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

Thanks,
Jeremy

ruby26.tar.gz (309K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

vtamara
Thank you!

IMHO it is necessary to change in the file pkg/MESSAGE-main

  ln -sf ${PREFIX}/bin/bundle26 ${PREFIX}/bin/gem
  ln -sf ${PREFIX}/bin/bundler26 ${PREFIX}/bin/gem

for

  ln -sf ${PREFIX}/bin/bundle26 ${PREFIX}/bin/bundle
  ln -sf ${PREFIX}/bin/bundler26 ${PREFIX}/bin/bundler



Happy christmas.
Blessings.



El 2018-12-25 11:34, Jeremy Evans escribió:

> Ruby 2.6.0 was released today.  Release announcement is at
> https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/
>
> Some highlights:
>
> * Significant performance improvements
> * JIT Compiler
> * Endless Ranges
> * Function Composition Operators for Procs
> * One-shot coverage
> * Bundler now included
>
> Tested on amd64, for about 9 months starting with the first preview
> release. OK to import?
>
> Thanks,
> Jeremy

--
Dios, gracias por tu amor infinito.
--
   Vladimir Támara Patiño.  http://vtamara.pasosdeJesus.org/
   http://www.pasosdejesus.org/dominio_publico_colombia.html

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Jeremy Evans-5
On 12/26 03:06, vtamara wrote:

> Thank you!
>
> IMHO it is necessary to change in the file pkg/MESSAGE-main
>
>  ln -sf ${PREFIX}/bin/bundle26 ${PREFIX}/bin/gem
>  ln -sf ${PREFIX}/bin/bundler26 ${PREFIX}/bin/gem
>
> for
>
>  ln -sf ${PREFIX}/bin/bundle26 ${PREFIX}/bin/bundle
>  ln -sf ${PREFIX}/bin/bundler26 ${PREFIX}/bin/bundler

Good catch, I've made that change locally so it will be fixed when
imported.

Thanks,
Jeremy

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Jeremy Evans-5
In reply to this post by Jeremy Evans-5
On 12/25 08:34, Jeremy Evans wrote:

> Ruby 2.6.0 was released today.  Release announcement is at
> https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/
>
> Some highlights:
>
> * Significant performance improvements
> * JIT Compiler
> * Endless Ranges
> * Function Composition Operators for Procs
> * One-shot coverage
> * Bundler now included
>
> Tested on amd64, for about 9 months starting with the first preview
> release. OK to import?

Still looking for an OK to import ruby 2.6.  A couple changes since I sent
the tarball.  To the Makefile, add:

PATCHFILES =            7602/patch-random_c:0
MASTER_SITES0 =         https://bugs.ruby-lang.org/attachments/download/

This is an upstream patch I wrote to fix getting random data in a
chroot.

And MESSAGE-main had a fix for the bundler lines, which now use:

 ln -sf ${PREFIX}/bin/bundle26 ${PREFIX}/bin/bundle
 ln -sf ${PREFIX}/bin/bundler26 ${PREFIX}/bin/bundler

Thanks,
Jeremy

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Jeremie Courreges-Anglas-2
In reply to this post by Jeremy Evans-5
On Tue, Dec 25 2018, Jeremy Evans <[hidden email]> wrote:
> Ruby 2.6.0 was released today.  Release announcement is at
> https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/
>
> Some highlights:
>
> * Significant performance improvements
> * JIT Compiler

A bit scary at first, but it looks like the approach is reasonably
portable: dump C code to disk, compile it, and load the resulting
object.

> * Endless Ranges
> * Function Composition Operators for Procs
> * One-shot coverage
> * Bundler now included
>
> Tested on amd64, for about 9 months starting with the first preview
> release. OK to import?

You could import it but, as is, it's not ready to be hooked up.  It
doesn't build using base-gcc (on sparc64, but you can test on amd64).
You need to either force C99 support, or use the diff below.

make test on sparc64:

  Finished tests in 7349.921578s, 2.7481 tests/s, 310.4749 assertions/s.
  20198 tests, 2281966 assertions, 65 failures, 18 errors, 113 skips

Lots of errors due to missing symbol '__guard_local' in the JIT tests.
Thoughts?



patches/patch-addr2line_c
--8<--
$OpenBSD$

Index: addr2line.c
--- addr2line.c.orig
+++ addr2line.c
@@ -1207,7 +1207,8 @@ di_find_abbrev(DebugInfoReader *reader, uint64_t abbre
         uint64_t form = uleb128(&p);
         if (!at && !form) break;
     }
-    for (uint64_t n = uleb128(&p); abbrev_number != n; n = uleb128(&p)) {
+    uint64_t n;
+    for (n = uleb128(&p); abbrev_number != n; n = uleb128(&p)) {
         if (n == 0) {
             fprintf(stderr,"%d: Abbrev Number %"PRId64" not found\n",__LINE__, abbrev_number);
             exit(1);
@@ -1555,7 +1556,8 @@ debug_info_read(DebugInfoReader *reader, int num_trace
         }
         /* ranges_inspect(reader, &ranges); */
         /* fprintf(stderr,"%d:%tx: %x ",__LINE__,diepos,die.tag); */
-        for (int i=offset; i < num_traces; i++) {
+ int i;
+        for (i=offset; i < num_traces; i++) {
             uintptr_t addr = (uintptr_t)traces[i];
             uintptr_t offset = addr - reader->obj->base_addr + reader->obj->vmaddr;
             uintptr_t saddr = ranges_include(reader, &ranges, offset);
-->8--


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

ruby26-test-sparc64.log.gz (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Stuart Henderson
Missing __guard_local... Are they using ld not cc to link?

--
Sent from a phone, apologies for poor formatting.


On 11 January 2019 18:48:10 Jeremie Courreges-Anglas <[hidden email]> wrote:

> On Tue, Dec 25 2018, Jeremy Evans <[hidden email]> wrote:
>> Ruby 2.6.0 was released today.  Release announcement is at
>> https://www.ruby-lang.org/en/news/2018/12/25/ruby-2-6-0-released/
>>
>> Some highlights:
>>
>> * Significant performance improvements
>> * JIT Compiler
>
> A bit scary at first, but it looks like the approach is reasonably
> portable: dump C code to disk, compile it, and load the resulting
> object.
>
>> * Endless Ranges
>> * Function Composition Operators for Procs
>> * One-shot coverage
>> * Bundler now included
>>
>> Tested on amd64, for about 9 months starting with the first preview
>> release. OK to import?
>
> You could import it but, as is, it's not ready to be hooked up.  It
> doesn't build using base-gcc (on sparc64, but you can test on amd64).
> You need to either force C99 support, or use the diff below.
>
> make test on sparc64:
>
>  Finished tests in 7349.921578s, 2.7481 tests/s, 310.4749 assertions/s.
>  20198 tests, 2281966 assertions, 65 failures, 18 errors, 113 skips
>
> Lots of errors due to missing symbol '__guard_local' in the JIT tests.
> Thoughts?
>
>
>
>
> ----------
> patches/patch-addr2line_c
> --8<--
> $OpenBSD$
>
> Index: addr2line.c
> --- addr2line.c.orig
> +++ addr2line.c
> @@ -1207,7 +1207,8 @@ di_find_abbrev(DebugInfoReader *reader, uint64_t abbre
>         uint64_t form = uleb128(&p);
>         if (!at && !form) break;
>     }
> -    for (uint64_t n = uleb128(&p); abbrev_number != n; n = uleb128(&p)) {
> +    uint64_t n;
> +    for (n = uleb128(&p); abbrev_number != n; n = uleb128(&p)) {
>         if (n == 0) {
>             fprintf(stderr,"%d: Abbrev Number %"PRId64" not found\n",__LINE__,
>             abbrev_number);
>             exit(1);
> @@ -1555,7 +1556,8 @@ debug_info_read(DebugInfoReader *reader, int num_trace
>         }
>         /* ranges_inspect(reader, &ranges); */
>         /* fprintf(stderr,"%d:%tx: %x ",__LINE__,diepos,die.tag); */
> -        for (int i=offset; i < num_traces; i++) {
> + int i;
> +        for (i=offset; i < num_traces; i++) {
>             uintptr_t addr = (uintptr_t)traces[i];
>             uintptr_t offset = addr - reader->obj->base_addr + reader->obj->vmaddr;
>             uintptr_t saddr = ranges_include(reader, &ranges, offset);
> -->8--
>
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

George Koehler-2
In reply to this post by Jeremie Courreges-Anglas-2
On Fri, 11 Jan 2019 19:38:31 +0100
Jeremie Courreges-Anglas <[hidden email]> wrote:

> make test on sparc64:
>
>   Finished tests in 7349.921578s, 2.7481 tests/s, 310.4749 assertions/s.
>   20198 tests, 2281966 assertions, 65 failures, 18 errors, 113 skips
>
> Lots of errors due to missing symbol '__guard_local' in the JIT tests.
> Thoughts?

On my powerpc:

Finished tests in 6145.605596s, 3.2864 tests/s, 371.8192 assertions/s.        
20197 tests, 2285054 assertions, 64 failures, 16 errors, 112 skips            

I built the port with the patch-random_c and MESSAGE-main changes and
JCA's patch-addr2line_c.  The build used base-gcc.  There are some
usual test failures like webrick failing basic auth (no DES crypt in
crypt(3)) and SSLv3 failing (no SSLv3 in LibreSSL), but most failures
are from TestJIT because of "undefined symbol '__guard_local'".

The JIT is experimental and I don't need it.  I was running Ruby trunk
on amd64 but not enabling the JIT.

I find that --jit-verbose=2 shows the cc commands.  I also need
--jit-wait, or 'puts 123' would finish without using the JIT.  Notice
that Ruby is running /usr/ports/pobj/ruby-2.6.0/bin/cc, but this cc
won't exist after I clean the build, or when I pkg_add ruby%2.6
without using ports.

ghostborough$ arch  
OpenBSD.powerpc
ghostborough$ ruby26 --jit-verbose=2 --jit-wait -e 'puts 123'                  
MJIT: CC defaults to /usr/ports/pobj/ruby-2.6.0/bin/cc                        
MJIT: tmp_dir is /tmp                                                          
Creating precompiled header                                                    
Starting process: /usr/ports/pobj/ruby-2.6.0/bin/cc /usr/ports/pobj/ruby-2.6.0/b
in/cc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_hp40346u0.
h.gch /usr/local/include/ruby-2.6/powerpc-openbsd/rb_mjit_min_header-2.6.0.h  
start compilation: block in <module:RbConfig>@/usr/local/lib/ruby/2.6/powerpc-op
enbsd/rbconfig.rb:275 -> /tmp/_ruby_mjit_p40346u0.c                            
Starting process: /usr/ports/pobj/ruby-2.6.0/bin/cc /usr/ports/pobj/ruby-2.6.0/b
in/cc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p40346u0.o
 /tmp/_ruby_mjit_p40346u0.c -c -L/usr/local/lib -nostartfiles -nodefaultlibs -no
stdlib                                                                        
Starting process: /usr/ports/pobj/ruby-2.6.0/bin/cc /usr/ports/pobj/ruby-2.6.0/b
in/cc -shared -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p4034
6u0.so /tmp/_ruby_mjit_p40346u0.o -L/usr/local/lib -nostartfiles -nodefaultlibs
-nostdlib                                                                      
ruby26:/tmp/_ruby_mjit_p40346u0.so: undefined symbol '__guard_local'          
MJIT warning: failure in loading code from '/tmp/_ruby_mjit_p40346u0.so': Cannot
 load specified object                                                        
...
(It enters an infinite loop trying to compile the object.)

--
George Koehler <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Jeremy Evans-5
On 01/12 08:13, George Koehler wrote:

> On Fri, 11 Jan 2019 19:38:31 +0100
> Jeremie Courreges-Anglas <[hidden email]> wrote:
>
> > make test on sparc64:
> >
> >   Finished tests in 7349.921578s, 2.7481 tests/s, 310.4749 assertions/s.
> >   20198 tests, 2281966 assertions, 65 failures, 18 errors, 113 skips
> >
> > Lots of errors due to missing symbol '__guard_local' in the JIT tests.
> > Thoughts?
>
> On my powerpc:
>
> Finished tests in 6145.605596s, 3.2864 tests/s, 371.8192 assertions/s.        
> 20197 tests, 2285054 assertions, 64 failures, 16 errors, 112 skips            
>
> I built the port with the patch-random_c and MESSAGE-main changes and
> JCA's patch-addr2line_c.  The build used base-gcc.  There are some
> usual test failures like webrick failing basic auth (no DES crypt in
> crypt(3)) and SSLv3 failing (no SSLv3 in LibreSSL), but most failures
> are from TestJIT because of "undefined symbol '__guard_local'".
>
> The JIT is experimental and I don't need it.  I was running Ruby trunk
> on amd64 but not enabling the JIT.
>
> I find that --jit-verbose=2 shows the cc commands.  I also need
> --jit-wait, or 'puts 123' would finish without using the JIT.  Notice
> that Ruby is running /usr/ports/pobj/ruby-2.6.0/bin/cc, but this cc
> won't exist after I clean the build, or when I pkg_add ruby%2.6
> without using ports.
>
> ghostborough$ arch  
> OpenBSD.powerpc
> ghostborough$ ruby26 --jit-verbose=2 --jit-wait -e 'puts 123'                  
> MJIT: CC defaults to /usr/ports/pobj/ruby-2.6.0/bin/cc                        
> MJIT: tmp_dir is /tmp                                                          
> Creating precompiled header                                                    
> Starting process: /usr/ports/pobj/ruby-2.6.0/bin/cc /usr/ports/pobj/ruby-2.6.0/b
> in/cc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_hp40346u0.
> h.gch /usr/local/include/ruby-2.6/powerpc-openbsd/rb_mjit_min_header-2.6.0.h  
> start compilation: block in <module:RbConfig>@/usr/local/lib/ruby/2.6/powerpc-op
> enbsd/rbconfig.rb:275 -> /tmp/_ruby_mjit_p40346u0.c                            
> Starting process: /usr/ports/pobj/ruby-2.6.0/bin/cc /usr/ports/pobj/ruby-2.6.0/b
> in/cc -w -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p40346u0.o
>  /tmp/_ruby_mjit_p40346u0.c -c -L/usr/local/lib -nostartfiles -nodefaultlibs -no
> stdlib                                                                        
> Starting process: /usr/ports/pobj/ruby-2.6.0/bin/cc /usr/ports/pobj/ruby-2.6.0/b
> in/cc -shared -Wfatal-errors -fPIC -shared -w -pipe -O3 -o /tmp/_ruby_mjit_p4034
> 6u0.so /tmp/_ruby_mjit_p40346u0.o -L/usr/local/lib -nostartfiles -nodefaultlibs
> -nostdlib                                                                      
> ruby26:/tmp/_ruby_mjit_p40346u0.so: undefined symbol '__guard_local'          
> MJIT warning: failure in loading code from '/tmp/_ruby_mjit_p40346u0.so': Cannot
>  load specified object                                                        
> ...
> (It enters an infinite loop trying to compile the object.)

Thank you very much for the testing and analysis.  I can confirm the JIT
compilation problems on amd64 because it uses the cached cc path (before
it would even get to the __guard_local issues on gcc).

Below is a new Makefile that will use dist patches pulled from Ruby's
SVN to handle the random.c and addr2line.c issues, as well as an
additional significant regression.  I tested that it also builds with
CC=/usr/bin/gcc.

I will keep working on the JIT issues to see if I can fix them and get
something that works with both base clang and gcc.

Thanks,
Jeremy

# $OpenBSD: Makefile,v 1.4 2018/03/31 21:12:45 jeremy Exp $

VERSION = 2.6.0
DISTNAME = ruby-${VERSION}
SHARED_LIBS = ruby26 0.0
NEXTVER = 2.7

MASTER_SITES0 = https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_2_6/
PATCHFILES = ruby26-lib-net-protocol.patch{lib/net/protocol.rb?r1=66799\&r2=66798\&pathrev=66799\&view=patch}:0 \
                        ruby26-addr2line.patch{addr2line.c?r1=66800\&r2=66799\&pathrev=66800\&view=patch}:0 \
                        ruby26-random.patch{random.c?r1=66729\&r2=66728\&pathrev=66729\&view=patch}:0
PATCH_DIST_STRIP = -p2

PSEUDO_FLAVORS= no_ri_docs bootstrap
# Do not build the RI docs on slow arches
.if ${MACHINE_ARCH:Malpha} || ${MACHINE_ARCH:Marm} || ${MACHINE_ARCH:Mhppa}
FLAVOR?= no_ri_docs bootstrap
.else
FLAVOR?=
.endif

MULTI_PACKAGES = -main -gdbm -ri_docs
.include <bsd.port.arch.mk>

.if ${BUILD_PACKAGES:M-ri_docs}
ALL_TARGET += rdoc
INSTALL_TARGET += install-doc
.endif

# Remove after 2.6.1
BUILD_DEPENDS = archivers/gtar
TAR = gtar

WANTLIB-main += curses

post-extract:
        ${POST_EXTRACT}

pre-configure:
        ${FIX_RIPPER}

pre-install:
        ${PRE_INSTALL}

post-install:
        ${FIX_RBCONFIG}

# 20197 tests, 2280714 assertions, 4 failures, 4 errors, 75 skips
do-test:
        -cd ${WRKSRC} && make test-sample
        -cd ${WRKSRC} && make btest-ruby
        -cd ${WRKSRC} && make test-spec SPECOPTS="-f s"
        cd ${WRKSRC} && make test-all TESTOPTS="-v -q"

.include <bsd.port.mk>

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Jeremy Evans-5
On 01/12 07:50, Jeremy Evans wrote:

> Thank you very much for the testing and analysis.  I can confirm the JIT
> compilation problems on amd64 because it uses the cached cc path (before
> it would even get to the __guard_local issues on gcc).
>
> Below is a new Makefile that will use dist patches pulled from Ruby's
> SVN to handle the random.c and addr2line.c issues, as well as an
> additional significant regression.  I tested that it also builds with
> CC=/usr/bin/gcc.
>
> I will keep working on the JIT issues to see if I can fix them and get
> something that works with both base clang and gcc.

I think was able to fix both JIT issues.  Here's an updated Makefile as
well as a new patch to mjit_worker.c.  I've tested this with both base
clang and base gcc on amd64, same results on both.

I would appreciate testing to see if this fixes the issues identified,
and if so, OKs to import and hookup.  Assuming the mjit_worker.c patch
fixes the JIT issues on gcc, I'll try to get it upstreamed.

Thanks,
Jeremy

lang/ruby/2.6/Makefile:

# $OpenBSD: Makefile,v 1.4 2018/03/31 21:12:45 jeremy Exp $

VERSION = 2.6.0
DISTNAME = ruby-${VERSION}
SHARED_LIBS = ruby26 0.0
NEXTVER = 2.7

MASTER_SITES0 = https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_2_6/
PATCHFILES = ruby26-lib-net-protocol.patch{lib/net/protocol.rb?r1=66799\&r2=66798\&pathrev=66799\&view=patch}:0 \
                        ruby26-addr2line.patch{addr2line.c?r1=66800\&r2=66799\&pathrev=66800\&view=patch}:0 \
                        ruby26-random.patch{random.c?r1=66729\&r2=66728\&pathrev=66729\&view=patch}:0
PATCH_DIST_STRIP = -p2

PSEUDO_FLAVORS= no_ri_docs bootstrap
# Do not build the RI docs on slow arches
.if ${MACHINE_ARCH:Malpha} || ${MACHINE_ARCH:Marm} || ${MACHINE_ARCH:Mhppa}
FLAVOR?= no_ri_docs bootstrap
.else
FLAVOR?=
.endif

MULTI_PACKAGES = -main -gdbm -ri_docs
.include <bsd.port.arch.mk>

.if ${BUILD_PACKAGES:M-ri_docs}
ALL_TARGET += rdoc
INSTALL_TARGET += install-doc
.endif

# Remove after 2.6.1
BUILD_DEPENDS = archivers/gtar
TAR = gtar

# Fix path for JIT compiler to not use shims in ports obj bin dir
CONFIGURE_ENV += ac_cv_path_MJIT_CC=`which ${CC}`

WANTLIB-main += curses

post-extract:
        ${POST_EXTRACT}

pre-configure:
        ${FIX_RIPPER}

pre-install:
        ${PRE_INSTALL}

post-install:
        ${FIX_RBCONFIG}

# 20197 tests, 2280013 assertions, 12 failures, 15 errors, 76 skips
do-test:
        -cd ${WRKSRC} && make test-sample
        -cd ${WRKSRC} && make btest-ruby
        -cd ${WRKSRC} && make test-spec SPECOPTS="-f s"
        cd ${WRKSRC} && make test-all TESTOPTS="-v -q"

.include <bsd.port.mk>

lang/ruby/2.6/patches/patch-mjit_worker_c:

$OpenBSD$

Fix JIT compilation when using base gcc.

Index: mjit_worker.c
--- mjit_worker.c.orig
+++ mjit_worker.c
@@ -258,7 +258,7 @@ static const char *const CC_OPTIMIZE_ARGS[] = {MJIT_OP
 static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED GCC_PIC_FLAGS NULL};
 static const char *const CC_DLDFLAGS_ARGS[] = {
     MJIT_DLDFLAGS
-#if defined __GNUC__ && !defined __clang__
+#if defined __GNUC__ && !defined __clang__ && !defined(__OpenBSD__)
     "-nostartfiles",
 # if !defined(_WIN32) && !defined(__CYGWIN__) && !defined(_AIX)
     "-nodefaultlibs", "-nostdlib",

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Jeremie Courreges-Anglas-2
On Sat, Jan 12 2019, Jeremy Evans <[hidden email]> wrote:

> On 01/12 07:50, Jeremy Evans wrote:
>> Thank you very much for the testing and analysis.  I can confirm the JIT
>> compilation problems on amd64 because it uses the cached cc path (before
>> it would even get to the __guard_local issues on gcc).
>>
>> Below is a new Makefile that will use dist patches pulled from Ruby's
>> SVN to handle the random.c and addr2line.c issues, as well as an
>> additional significant regression.  I tested that it also builds with
>> CC=/usr/bin/gcc.
>>
>> I will keep working on the JIT issues to see if I can fix them and get
>> something that works with both base clang and gcc.
>
> I think was able to fix both JIT issues.  Here's an updated Makefile as
> well as a new patch to mjit_worker.c.  I've tested this with both base
> clang and base gcc on amd64, same results on both.
>
> I would appreciate testing to see if this fixes the issues identified,
> and if so, OKs to import and hookup.  Assuming the mjit_worker.c patch
> fixes the JIT issues on gcc, I'll try to get it upstreamed.

I'd gladly test with your fixes, but an inline Makefile plus an inline
patch make testing harder than needed.  For new ports it's much more
convenient to propose an updated, standalone tarball.

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

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Jeremy Evans-5
On 01/13 05:35, Jeremie Courreges-Anglas wrote:

> On Sat, Jan 12 2019, Jeremy Evans <[hidden email]> wrote:
> > On 01/12 07:50, Jeremy Evans wrote:
> >> Thank you very much for the testing and analysis.  I can confirm the JIT
> >> compilation problems on amd64 because it uses the cached cc path (before
> >> it would even get to the __guard_local issues on gcc).
> >>
> >> Below is a new Makefile that will use dist patches pulled from Ruby's
> >> SVN to handle the random.c and addr2line.c issues, as well as an
> >> additional significant regression.  I tested that it also builds with
> >> CC=/usr/bin/gcc.
> >>
> >> I will keep working on the JIT issues to see if I can fix them and get
> >> something that works with both base clang and gcc.
> >
> > I think was able to fix both JIT issues.  Here's an updated Makefile as
> > well as a new patch to mjit_worker.c.  I've tested this with both base
> > clang and base gcc on amd64, same results on both.
> >
> > I would appreciate testing to see if this fixes the issues identified,
> > and if so, OKs to import and hookup.  Assuming the mjit_worker.c patch
> > fixes the JIT issues on gcc, I'll try to get it upstreamed.
>
> I'd gladly test with your fixes, but an inline Makefile plus an inline
> patch make testing harder than needed.  For new ports it's much more
> convenient to propose an updated, standalone tarball.
Sure, tarball attached. I thought about doing that originally, but
decided against it as the tarball is rather large for a port due to the
ri_docs PLIST.

Thanks,
Jeremy

ruby26.tar.gz (310K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

George Koehler-2
In reply to this post by Jeremy Evans-5
On Sat, 12 Jan 2019 21:33:53 -0800
Jeremy Evans <[hidden email]> wrote:

> I think was able to fix both JIT issues.

Your new tarball from Sun, 13 Jan, fixes the JIT problems on my
powerpc machine.  "MJIT: CC defaults to /usr/bin/cc"

Old result, broken JIT:
  Finished tests in 6145.605596s, 3.2864 tests/s, 371.8192 assertions/s.
  20197 tests, 2285054 assertions, 64 failures, 16 errors, 112 skips
New result, fixed JIT:
  Finished tests in 6827.563384s, 2.9582 tests/s, 334.5004 assertions/s.
  20197 tests, 2283823 assertions, 14 failures, 15 errors, 111 skips

(I failed to clean my old ruby26 binary and the TEST_DEPENDS
reinstalled the old one.  The JIT tests passed, so they must have been
testing the new binary, not the old one.)

I saw 2 failures that weren't DES crypt or SSL:

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

I looked at test/fiddle/test_import.rb and it declares Timeval with
"long tv_sec", which has the correct 64 bits on amd64 and the wrong
32 bits on powerpc.  I typically run the tests on amd64, so I didn't
see this failure until now.  The test is wrong so we can ignore it.

 12) Failure:                                                                  
TestEnumerable#test_sum [/usr/ports/pobj/ruby-2.6.0/ruby-2.6.0/test/ruby/test_en
um.rb:1065]:                                                                  
<Infinity> expected but was                                                    
<NaN>.                                                                        

test/ruby/test_enum.rb does `k.new(+Float::INFINITY, 0.0).sum` where
k#each yields Float::INFINITY then 0.0.  I can reproduce the wrong NaN
in both irb25 and irb26 on powerpc:

irb(main):045:0> Enumerator.new{|y| y << Float::INFINITY << 0.0}.sum
=> NaN
irb(main):046:0> Enumerator.new{|y| y << Float::INFINITY << 0.0}.reduce(:+)
=> Infinity
irb(main):047:0> Enumerator.new{|y| y << Float::INFINITY << 0.0}.to_a.sum
=> Infinity

Trying the same 3 lines on amd64: irb25 gives NaN, Infinity, NaN;
irb from ruby 2.7.0dev (2019-01-13 trunk 66808) gives the correct
Infinity, Infinity, Infinity.  Therefore, Enumerable#sum has some
Float problem on powerpc, but Ruby 2.6 isn't worse than 2.5.

--
George Koehler <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

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

> On 01/13 05:35, Jeremie Courreges-Anglas wrote:
>> On Sat, Jan 12 2019, Jeremy Evans <[hidden email]> wrote:
>> > On 01/12 07:50, Jeremy Evans wrote:
>> >> Thank you very much for the testing and analysis.  I can confirm the JIT
>> >> compilation problems on amd64 because it uses the cached cc path (before
>> >> it would even get to the __guard_local issues on gcc).
>> >>
>> >> Below is a new Makefile that will use dist patches pulled from Ruby's
>> >> SVN to handle the random.c and addr2line.c issues, as well as an
>> >> additional significant regression.  I tested that it also builds with
>> >> CC=/usr/bin/gcc.
>> >>
>> >> I will keep working on the JIT issues to see if I can fix them and get
>> >> something that works with both base clang and gcc.
>> >
>> > I think was able to fix both JIT issues.  Here's an updated Makefile as
>> > well as a new patch to mjit_worker.c.  I've tested this with both base
>> > clang and base gcc on amd64, same results on both.
>> >
>> > I would appreciate testing to see if this fixes the issues identified,
>> > and if so, OKs to import and hookup.  Assuming the mjit_worker.c patch
>> > fixes the JIT issues on gcc, I'll try to get it upstreamed.
>>
>> I'd gladly test with your fixes, but an inline Makefile plus an inline
>> patch make testing harder than needed.  For new ports it's much more
>> convenient to propose an updated, standalone tarball.
>
> Sure, tarball attached. I thought about doing that originally, but
> decided against it as the tarball is rather large for a port due to the
> ri_docs PLIST.
On sparc64:

  Finished tests in 10910.027767s, 1.8513 tests/s, 209.1314 assertions/s.
  20198 tests, 2281629 assertions, 17 failures, 23 errors, 114 skips

so this looks nicer.  Note I had not uninstalled the old ruby26 package
so I'm restarting tests now.

That's the first time I notice patches served by viewvc in a port, but
hey, if it works... :)

Nits:
- patches/patch-lib_fileutils_rb looks like a systrace leftover (also
  present in other ruby ports)
- the tarball ships a "plist" directory, make sure you don't import that

I was concerned by the JIT issues but with your fixes this looks ready
to import now.  ok jca@


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

ruby26-test-sparc64.log.gz (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Ruby 2.6.0

Jeremy Evans-5
On 01/14 04:58, Jeremie Courreges-Anglas wrote:
> I was concerned by the JIT issues but with your fixes this looks ready
> to import now.  ok jca@

Thanks for your review and testing.  I've imported it and hooked it up
to the build.  The next step is allowing building of ruby26-* packages
for ruby ports.  Here's a diff for ruby.port.mk to allow that.  I'll
commit this in a couple days unless i hear objections.

This includes a small fix for JRuby to fix MODRUBY_SITEDIR and
MODRUBY_LIBREV, which I should have made when upgrading JRuby to 9.2.
This doesn't currently affect anything in ports, since nothing that
uses either variable currently builds with JRuby.

After this goes in, I'll update ruby-module(5).

Thanks,
Jeremy

Index: ruby.port.mk
===================================================================
RCS file: /cvs/ports/lang/ruby/ruby.port.mk,v
retrieving revision 1.95
diff -u -p -r1.95 ruby.port.mk
--- ruby.port.mk 26 Oct 2018 16:12:24 -0000 1.95
+++ ruby.port.mk 14 Jan 2019 16:21:02 -0000
@@ -24,7 +24,7 @@ MODRUBY_HANDLE_FLAVORS ?= No
 # If ruby.pork.mk should handle FLAVORs, define a separate FLAVOR
 # for each ruby interpreter
 .    if !defined(FLAVORS)
-FLAVORS= ruby24 ruby25
+FLAVORS= ruby24 ruby25 ruby26
 .      if !${CONFIGURE_STYLE:L:Mext}
 FLAVORS+= jruby
 .      endif
@@ -52,11 +52,12 @@ FLAVOR = ruby25
 
 # Check for conflicting FLAVORs and set MODRUBY_REV appropriately based
 # on the FLAVOR.
-.    for i in ruby24 ruby25 jruby
+.    for i in ruby24 ruby25 ruby26 jruby
 .      if ${FLAVOR:M$i}
 MODRUBY_REV = ${i:C/ruby([0-9])/\1./}
 .        if ${FLAVOR:N$i:Mruby24} || \
             ${FLAVOR:N$i:Mruby25} || \
+            ${FLAVOR:N$i:Mruby26} || \
     ${FLAVOR:N$i:Mjruby}
 ERRORS += "Fatal: Conflicting flavors used: ${FLAVOR}"
 .        endif
@@ -86,9 +87,9 @@ MODRUBY_BIN_RSPEC = ${RUBY} -S rspec
 MODRUBY_BIN_TESTRB = ${RUBY} -S testrb
 MODRUBY_FLAVOR = jruby
 MODRUBY_LIBDIR= ${LOCALBASE}/jruby/lib/ruby
-MODRUBY_LIBREV = 2.3.0
+MODRUBY_LIBREV = 2.5
 MODRUBY_SITEARCHDIR = ${MODRUBY_SITEDIR}/java
-MODRUBY_SITEDIR = jruby/lib/ruby/site_ruby/${MODRUBY_LIBREV}
+MODRUBY_SITEDIR = jruby/lib/ruby/${MODRUBY_LIBREV}/site_ruby
 RAKE= ${RUBY} -S rake
 RSPEC= ${RUBY} -S spec
 RUBY= ${LOCALBASE}/jruby/bin/jruby