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


I sent a PR to add arm32 case on Travis CI now.
https://github.com/ruby/ruby/pull/2673

Let me explain the summary.

First, gcc-8-multilib deb package does not exist in the xenial (and bionic) arm64 tool chain repository.

Ref: 

```
$ wget http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/dists/xenial/main/binary-arm64/Packages.gz
$ gunzip Packages.gz
```

So, I tried to create ARM 32-bit case without using the tool chain on ARM 64-bit.
I think it is fine for the initial ARM 32-bit test case.

I used this deb package.
https://packages.ubuntu.com/xenial/crossbuild-essential-armhf

As a note, there is "-m32" flag for aarch64 gcc.
http://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html

In Travis x86_64 environment, here is the initial setting for architectures.

```
$ dpkg --print-architecture
amd64

$ dpkg --print-foreign-architectures
i386
```

In Travis arm64 environment, here is the initial setting for architectures.


```
$ dpkg --print-architecture
aarch64

$ dpkg --print-foreign-architectures
  => empty
```

So, I needed to run `sudo dpkg --add-architecture armhf` manually.

Here are the available setarch values in Travis arm64.

```
$ setarch --list
uname26
linux32
linux64
aarch64
```

The value shows armv8l. It looks good.

```
$ $SETARCH uname -a
Switching on ADDR_LIMIT_32BIT.
Linux travis-job-junaruga-ruby-610971033 5.3.0-19-generic #20~18.04.2-Ubuntu SMP Tue Oct 22 18:10:05 UTC 2019 armv8l armv8l armv8l GNU/Linux
```

long: 4 byte, void*: 4 byte look correct.
I am not sure that off_t: 8 byte is correct. Because I saw off_t: 4 byte in arm32v7/ubuntu container environment with QEMU emulation.

```
$ $SETARCH ../configure -C --disable-install-doc --prefix=$RUBY_PREFIX $CONFIG_FLAG
...
checking size of long... 4
...
checking size of off_t... 8
checking size of void*... 4
```

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

```
$ travis_wait 50 $SETARCH make -s test-all -o exts TESTOPTS="${TESTOPTS} ${TEST_ALL_OPTS}" RUBYOPT="-w"
...
/home/travis/build/junaruga/ruby/build/.ext/common/fiddle/import.rb:299:in `import_function': cannot find the function: strcpy() (Fiddle::DLError)
	/home/travis/build/junaruga/ruby/build/.ext/common/fiddle/import.rb:172:in `extern'
	/home/travis/build/junaruga/ruby/test/fiddle/test_import.rb:17:in `<module:LIBC>'
	/home/travis/build/junaruga/ruby/test/fiddle/test_import.rb:10:in `<module:Fiddle>'
	/home/travis/build/junaruga/ruby/test/fiddle/test_import.rb:9:in `<top (required)>'
	/home/travis/build/junaruga/ruby/lib/rubygems/core_ext/kernel_require.rb:92:in `require'
	/home/travis/build/junaruga/ruby/lib/rubygems/core_ext/kernel_require.rb:92:in `require'
	/home/travis/build/junaruga/ruby/tool/lib/test/unit/parallel.rb:121:in `run'
	/home/travis/build/junaruga/ruby/tool/lib/test/unit/parallel.rb:208:in `<main>'
running file: /home/travis/build/junaruga/ruby/test/fiddle/test_import.rb
...
```

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

* 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>