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


As another issue, there are 2 test failures in spec/ruby/core/process/clock_getres_spec.rb on Drone CI arm32 case.

https://cloud.drone.io/ruby/ruby/619/1/2

```
1)
Process.clock_getres matches the clock in practice for Process::CLOCK_PROCESS_CPUTIME_ID FAILED
Expected 10000 == 10000
to be falsy but was true
/drone/src/spec/ruby/core/process/clock_getres_spec.rb:30:in `block (4 levels) in <top (required)>'
/drone/src/spec/ruby/core/process/clock_getres_spec.rb:4:in `<top (required)>'

2)
Process.clock_getres matches the clock in practice for Process::CLOCK_THREAD_CPUTIME_ID FAILED
Expected 10000 == 10000
to be falsy but was true
/drone/src/spec/ruby/core/process/clock_getres_spec.rb:30:in `block (4 levels) in <top (required)>'
/drone/src/spec/ruby/core/process/clock_getres_spec.rb:4:in `<top (required)>'
```

The failed test is here.

https://github.com/ruby/ruby/blob/master/spec/ruby/core/process/clock_getres_spec.rb#L27-L30

```
# The clock should not be less accurate than reported (times should
# not all be a multiple of the next precision up, assuming precisions
# are multiples of ten.)
times.select { |t| t % (reported * 10) == 0 }.size.should_not == times.
```

Someone, do you know what "times should not all be a multiple of the next precision up, assuming precisions are multiples of ten." means?

Because adding debug log and comparing the result of my local from the Drone CI arm32 environment, the each value of `times` is "multiples of ten" on the arm32 environment.

https://github.com/junaruga/ruby/blob/hotfix/drone-ci-arm32/spec/ruby/core/process/clock_getres_spec.rb#L16


On my local x86_64

```
$ make -s test-spec MSPECOPT=-ff
...
"[DEBUG] name: CLOCK_PROCESS_CPUTIME_ID, value: 2, reported: 1, times0: 3639283628, times1: 3639287782"
...
"[DEBUG] name: CLOCK_THREAD_CPUTIME_ID, value: 3, reported: 1, times0: 3188148716, times1: 3188150159"
...
```

On Drone CI arm32.

https://cloud.drone.io/junaruga/ruby/18

```
...
"[DEBUG] name: CLOCK_PROCESS_CPUTIME_ID, value: 2, reported: 1, times0: 9551962040, times1: 9551966600"
  => "multiples of ten"
...
"[DEBUG] name: CLOCK_THREAD_CPUTIME_ID, value: 3, reported: 1, times0: 8280880000, times1: 8280884060"
  => "multiples of ten"
...
```

Thanks.

References for CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
* https://ruby-doc.org/core-2.7.0.preview2/Process.html#method-c-clock_gettime
* https://linux.die.net/man/2/clock_gettime


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

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