Ruby portability question

Hello!

I'm a Debian Developer and maintainer for old and obscure architectures. For that,
I'm also working on the ruby interpreter package in Debian from time to time to
fix portability issues.

Ruby 3.0 builds and works fine on most architectures in Debian, with the exception
of alpha, ia64, powerpc and x32.

This week, I started hacking on ruby on powerpc (32-bit) and I noticed a number of
testsuite failures. In total, I had to skip 67 tests of the "test-all" target to get
the testsuite to pass.

However, I noticed that the situation improved quite a lot with ruby 3.1.0 when
building with --with-coroutine=pthread which was just recently introduced in [1]
with tests passing now.

I assume this is a result of pthreads being much more portable than the previous
approach for coroutines and I was wondering whether there would be any chance to
get ruby to build on ia64 again as well after support for it was removed in the
past [2].

I have already tried building ruby from git on ia64 on Debian unstable but miniruby
still crashes. I assume the garbage collector needs to know about the dual-stack on
ia64.

FWIW, OpenJDK alleviates the compatibility issues on ia64 by just reducing the stack
size in half and ignoring the register backing store [3]. Would such an approach be
possible on ruby as well or does the ruby interpreter perform garbage collection
in native code as well so that it needs to know about register contents?

Thanks,
Adrian

···

[1] Replace copy coroutine with pthread implementation. · ruby/ruby@42130a6 · GitHub
[2] Remove IA64 support. · ruby/ruby@d17344c · GitHub
[3] https://github.com/openjdk/jdk/blob/0f31d0fb2c0d5db305e75e1d61bcc44de3e77839/src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp#L248

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

Hi

Again I see there are many undocumented methodes, features and also
commandline-options.

Is this described anywhere, or do we have to look into the source-code?

What (type of contentn) can I search for on
Ruby-Doc.org: Documenting the Ruby Language ???

looks like nothing is found, indpendent of input ?

thanks Opti

Careful, in dynamic languages you have to assume undocumented is a way to
say private. Even if you look at the source code and see something, it
doesn't mean you can use it.

I'm a Debian Developer and maintainer for old and obscure
architectures. For that, I'm also working on the ruby interpreter package
in Debian from time to time to fix portability issues.

... I was wondering whether there would be any chance to get ruby to
build on ia64 again as well after support for it was removed in the past
[2].

Apparently it was mainly removed due to a lack of resources for testing:

"The main motivation for me personally is I want to simplify and
improve fiber implementation. But it's impossible for me to test IA64
architecture." [4]

I have already tried building ruby from git on ia64 on Debian unstable
but miniruby still crashes. I assume the garbage collector needs to know
about the dual-stack on ia64.

A previous issue: "IA64 ruby 2.4 miniruby segfault" [5]

* "fix crash on register stack mark/sweep pass [thread_pthread.c]"
* "What finally worked for me was to run the build without stack limits"

[2] Remove IA64 support. · ruby/ruby@d17344c · GitHub
[4] Feature #15894: Remove support for IA64 - Ruby master - Ruby Issue Tracking System
[5] Bug #13284: IA64 ruby 2.4 miniruby segfault - Ruby master - Ruby Issue Tracking System

···

On 11/10/21, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:

Hi!
No, I mean really undocumented ( e.g: --with-coroutine=pthread )
or "0x10".oct # to name just a few.

But maybe private meths are a common mistake.

···

Am 10.11.21 um 12:40 schrieb Xavier Noria:

Careful, in dynamic languages you have to assume undocumented is a way
to say private. Even if you look at the source code and see something,
it doesn't mean you can use it.

Hello Frank!

Thanks a lot for the elaborate answer!

Apparently it was mainly removed due to a lack of resources for testing:

"The main motivation for me personally is I want to simplify and
improve fiber implementation. But it's impossible for me to test IA64
architecture." [4]

Aha, I didn't see that. FWIW, a number of people are maintaining so-called
porterboxes at the GCC compile farm [1] and in Debian [2] which provides
access for exactly this purpose.

For the GCC compile farm, anyone can request access. For Debian machines,
obtaining a guest account is possible through the help of a Debian Developer
[3].

Currently, we have one fast ia64 porterbox in Debian. I'm planning to add
another porterbox to the GCC compile farm as I will get some additional
ia64 hardware in the near future.

I have already tried building ruby from git on ia64 on Debian unstable
but miniruby still crashes. I assume the garbage collector needs to know
about the dual-stack on ia64.

A previous issue: "IA64 ruby 2.4 miniruby segfault" [5]

* "fix crash on register stack mark/sweep pass [thread_pthread.c]"
* "What finally worked for me was to run the build without stack limits"

[2] Remove IA64 support. · ruby/ruby@d17344c · GitHub
[4] Feature #15894: Remove support for IA64 - Ruby master - Ruby Issue Tracking System
[5] Bug #13284: IA64 ruby 2.4 miniruby segfault - Ruby master - Ruby Issue Tracking System

Thanks, I'll try removing the stack limits although I would guess the main
problem is the weird stack layout on ia64. Maybe Samuel has some hints how
to re-add minimal ia64 support. It doesn't have to be merged upstream, we
could carry a patch in Debian.

Thanks,
Adrian

···

On 11/10/21 14:48, Frank J. Cameron wrote:

[1] CompileFarm - GCC Wiki
[2] Debian Project -- debian.org Developer Machines
[3] https://dsa.debian.org/doc/guest-account/

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

I see there are many undocumented methodes, features and also
commandline-options.

"See a bug or omission in the API docs? Visit documenting-ruby.org" [1]

"...we offer a support system geared towards making it easy to prepare
and submit documentation patches." [2] :slight_smile:

"Only about 75% of Ruby is adequately documented" [2] :frowning:

"0x10".oct

$ ruby -e 'p "0x10".oct'
16

"Treats leading characters of str as a string of octal digits... If str
starts with 0, radix indicators are honored. See Kernel#Integer." [3]

"radix indicators (0, 0b, and 0x) are honored" [4]

[1] https://ruby-doc.org/
[2] http://documenting-ruby.org/
[3] Class: String (Ruby 3.0.2)
[4] Module: Kernel (Ruby 3.0.2)

···

On 11/10/21, Die Optimisten <inform@die-optimisten.net> wrote: