Issue #16234 has been updated by jaruga (Jun Aruga).


> There is one issue on the Travis arm32 environment. I added it as allow_failures.

I sent a PR to fix the issue on the Travis arm32 environment.
https://github.com/ruby/ruby/pull/2686

Let me explain about the issue and why this happened.
The issue happens at following line.

ruby/test/fiddle/test_import.rb:17:in `<module:LIBC>'

```
...
begin
  require_relative 'helper'
  require 'fiddle/import'
rescue LoadError
end
...
    extern "void *strcpy(char*, char*)" <= This line.
```

In the `helper.rb`, `Fiddle::LIBC_SO` and `Fiddle::LIBM_SO` were still `nil` in Travis arm32 case.

test/fiddle/helper.rb

```
Fiddle::LIBC_SO = libc_so
Fiddle::LIBM_SO = libm_so
...
    def setup
      @libc = Fiddle.dlopen(LIBC_SO)
      @libm = Fiddle.dlopen(LIBM_SO)
    end 
...
```

Because seeing following page about libc deb packages information for each CPU architecture in Ubuntu, in case of i686 (Intel 32-bit), the package is installed to `/lib32`, but in case of armhf (ARM 32-bit) it's not installed to `/lib32`, but only installed to `/lib/arm-linux-gnueabihf`.

Ubuntu: libc deb packages information for each CPU architecture
https://packages.ubuntu.com/search?mode=filename&suite=xenial&section=all&arch=any&keywords=libc.so.6&searchon=contents

Also `ldd #{ruby}` outputs "not a dynamic executable" message not printing shared library dependencies information.

```
$ ldd ruby
not a dynamic executable

$ setarch linux32 --verbose --32bit ldd ruby
Switching on ADDR_LIMIT_32BIT.
not a dynamic executable
```

Because `ldd` command can output the message when the checked binary is 32-bit and the host is 64-bit. In Travis arm32 case, the `#{ruby}` is 32-bit binary, and the host is 64-bit.

Ref: https://unix.stackexchange.com/questions/75054/ldd-tells-me-my-app-is-not-a-dynamic-executable

So, `libc_so` and `libm_so` are not set in this step too.

I also checked Drone CI arm32 environment (Debian) too about the issue.
For the Drone arm32 environment, the the `ldd` command is succeeded. Because the host is 32-bit, and the checked binary is 32-bit.

We can check the libc document here.

Debian: libc deb packages information for each CPU architecture
https://packages.debian.org/search?searchon=contents&keywords=libc.so.6

So, summarizing it.

* Travis i686 case (host: x86_64)
  * OS: Ubuntu
  * `RUBY_PLATFORM: i686-linux`
  * Used libc: `libc6:i386` (I have not checked it)
  * Installed directory: `/lib32`

* Travis arm32 case (host: arm64)
  * OS: Ubuntu
  * `RUBY_PLATFORM: armv8l-linux-eabihf`
  * Used libc: `libc6:armhf`
  * Installed directory: `/lib/arm-linux-gnueabihf`

* Drone arm32
  * OS: Debian
  * `RUBY_PLATFORM: armv8l-linux-eabi`
  * Used libc: `libc6:armel` 
  * Installed directory: `/lib/arm-linux-gnueabi`

I think we can refactor `test/fiddle/helper.rb` later.

* `Fiddle::LIBC_SO` or `Fiddle::LIBM_SO` is still `nil` before `Fiddle.dlopen` is executed in the `helper.rb`, can we raise an error or output a warning?
* Can we check the command exit status for `ldd #{ruby}`?






----------------------------------------
Misc #16234: Enabling ARM 64/32-bit cases by Drone CI
https://bugs.ruby-lang.org/issues/16234#change-82749

* Author: jaruga (Jun Aruga)
* Status: Closed
* Priority: Normal
* Assignee: 
----------------------------------------
Currently ruby project has 4 CIs on GitHub.

1. Travis CI: linux cases with flags and compilers.
2. GitHub Actions: macros, windows, ubuntu
3. Wercker: Ruby JIT cases
4. Appveyor: windows

I like to suggest 5th CI: Drone CI for ARM 64/32-bit cases.
Drone CI supports native the ARM 64/32 bit environments.
Have you used Drone CI?

I tried to use both Drone CI and Shippable CI supporting ARM.
My impression for Drone CI is quite good. Great user experience and user interface.
Shippable CI was not so good for some reasons.

Drone CI have not only linux ARM 64/32 bit environments on DockerRunner mode (= using container for CI like Wercker), but also freebsd, netbsd, openbsd, dragonfly (?) and solaris environments on ExecRunner (= maybe running commands directly without container) mode according to the following documents.
* https://exec-runner.docs.drone.io/configuration/platform/
* https://docker-runner.docs.drone.io/configuration/platform/

Is it exciting isn't it?
We can check ARM issue at a pull-request timing.

Here is the example. The content is almost same with wercker.yml except JIT option.
"ruby/3" is failed on the latest master branch, but "ruby/2" arm64 case is succeeded on old master branch.
https://cloud.drone.io/junaruga/ruby/3
https://github.com/junaruga/ruby/blob/feature/ci-arm/.drone.yml
https://cloud.drone.io/junaruga/ruby/2
Here is the pull-request as an example.
https://github.com/ruby/ruby/pull/2520

.drone.yml is the file to manage the CI cases.
But when you see most of the YAML parts between ARM 64-bit and 32-bit cases in .drone.yml is same. In case of .traivs.yml, we are using YAML anchor (&) and reference (*) feature effectively. But in case of .drone.yml I am not sure we can still use it beyond the "---" separator. Luckily Drone CI started providing the alternative .drone.star file by Starlark language.
https://docs.drone.io/starlark/overview/
https://blog.drone.io/create-pipelines-using-starlark/

Enabling Drone CI is quite simple.
Just go to https://drone.io/ , then register and enable target repository. UI is quite good.

Pros

* We can check ARM 64/32-bit cases, and possibly freebsd and solaris cases too.
* It's for free.
* Each developer can debug ARM cases on their forked repository.
* Customize easily. I see .travis.yml is used effectively.

Cons

* Have to manage additonal file .drone.yml or .drone.star.

But first, I want to ask you. Are you interested in using Drone CI for Ruby project?




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>