Add cross-architecture continuous integrations under QEMU - #107
Add cross-architecture continuous integrations under QEMU#107s1amese2003 wants to merge 1 commit into
Conversation
|
A note on loong64, since this workflow only builds and runs the example there. Full unit-tests on loong64 are achievable, just not on Ubuntu: no Ubuntu release has a I left it out because it would tie this workflow to a rolling release. While checking, Happy to switch the loong64 job to a Debian container if you would rather have the coverage. |
defs.h implements spin_loop_pause() and CACHE_LINE_SIZE for ppc64, s390x, riscv and loongarch, but the continuous integrations build and run on x86_64 and arm64 only. Cross-compile in a Debian container and run under QEMU user-mode emulation. Debian serves all four architectures from one archive, so enabling them takes dpkg --add-architecture alone, and it packages Boost.Test for loong64, which Ubuntu has no port for.
9e77d3a to
6197178
Compare
|
Correction to my note above: loong64 does not have to be limited to the example. I moved the workflow into a Debian container, where The trade-off moved rather than disappeared: this ties the job to |
max0x7ba
left a comment
There was a problem hiding this comment.
Thank you for your wonderful contribution of the advanced cross-platform CI, Li.
Your method of invoking the cross-compiler directly is a refreshing and elegant solution, in my opinion.
If you could address my comment, I would be happy to merge.
|
|
||
| - name: Build the unit-tests and the example | ||
| run: | | ||
| ${{ matrix.triplet }}-g++ -std=c++14 -O2 -pthread -Wall -Wextra -Iinclude -Isrc \ |
There was a problem hiding this comment.
Add -Wno-unused-variable to silence compiler warnings to both commands, please.
defs.himplementsspin_loop_pause()andCACHE_LINE_SIZEfor ppc64, s390x, riscv andloongarch, but the continuous integrations build and run the tests on x86_64 and arm64
only, so those four branches are never compiled.
This adds one job per architecture. The job runs in a Debian container because Debian
serves all four architectures from a single archive and packages Boost.Test for each of
them, so enabling one is
dpkg --add-architecturealone. The cross-toolchains build theunit-tests and the example, and QEMU user-mode emulation runs them. Nothing is compiled
under emulation, so the whole matrix finishes in about eighty seconds.
One trade-off worth stating plainly:
debian:testingis a rolling target, so unrelatedupstream churn can turn this job red. Ubuntu cannot replace it — no Ubuntu release has a
loong64 port, so there is no
libboost-test-dev:loong64to linktests.ccagainst. Ialso have an Ubuntu-based variant that covers ppc64el, riscv64 and s390x with the
unit-tests and loong64 with the example only; happy to switch to it if you would rather
have LTS inputs.
Verification
Green on a fork: https://github.com/s1amese2003/atomic_queue/actions/runs/32273844744
powerpc64le-linux-gnu-g++15.3.0riscv64-linux-gnu-g++15.3.0s390x-linux-gnu-g++15.3.0loongarch64-linux-gnu-g++16.1.0QEMU 11.0.3 throughout. The same four builds were also run locally in a Debian forky
container and produced identical assertion counts.