Linux Multiarch testing tips

The topic is intended to share and discuss about the multi arch testing tips on Travis CI.

Motivation

Want to run and test a software not only on intel x86_64, but also on mobile, IoT device (ARM 64-bit, 32-bit) and HPC (super computer, PowerPC).

  • What we want to condier wit low level language programming such as C, C++, Golang.
    • Intel, ARM, PowerPC, and etc.
    • 64-bit or 32-bit
    • Little-endian or Big-endian

Current solution

  • x86_64: (Intel, 64-bit, Little-endian): Use os: linux
  • ppc64le (Power PC, 64-bit, Little-endian): Use os: linux-ppc64le
  • Other solutions:
    • Use multiarch project (QEMU) and the docker container image. [1][2]
    • Use setarch command with Ubuntu arch packages. [3]

The other solutions can test most arches covering 32-bit, big-endian. But can improve the user experience on Travis CI.

Related issues on travis-ci/travis-ci

References

Anything else?

If Travis CI is using AWS internally, here is a good news to support ARM like os: linux-aarch64

New – EC2 Instances (A1) Powered by Arm-Based AWS Graviton Processors

1 Like

See https://github.com/skvark/opencv-python/issues/13 . It’s currently possible to cross-compile things and run tests on an emulator.

Thanks for the info.

I see that opencv-python is doing something.


It has multibuild that enables the build of x86_64 and i686, as a submodule.


I found that recently Docker announced “docker buildx” to build multi arch images.


While qemu-user-static needs the compatible multi arch container images, “docker buildx” might build the general multi-arch container images.
As users do not have to be conscious about using qemu (it seems “moby/qemu” is used internally), they might be able to use it casually.

Finally Travis Ci started supporting a native ARM 64 with “arch: arm64” syntax! Thank you, Travis.

Now I want to see current syntax “os: linux-ppc64le” for ppc64le has the alias “arch: ppc64le”.

It seems arch: ppc64le also works instead of os: linux-ppc64le.

Yesterday Travis announced supporting ppc64le (IBM Power) and s390x (IBM Z). Thank you Travis!

So, I created the example to run in following “native” environments in Travis. “native” means to run without QEMU emulation.

  • amd64 (x86_64 = Intel, 64-bit, Little-endian)
  • arm64 (aarch64 = ARM, 64-bit, Little-endian)
  • ppc64le (IBM, PowerPC, Little-endian)
  • s390x (IBM, Z / Linux One, Big-endian)
  • i686 (Intel, 32-bit, Little-endian)
  • arm32 (armv8l = ARM 32-bit, Little-endian)