ci: add a Linux aarch64 build - #331
Open
WizzardSK wants to merge 1 commit into
Open
Conversation
There is no rust-linux-aarch64.yml template yet (libretro/libretro-super#2030) and the rust build image is amd64-only, so this cross-compiles from that image the same way it already cross-compiles the Apple and Android arm64 targets: add the target, the cross linker via CARGO_TARGET_*_LINKER, and an aarch64 strip. before_script inlines the rustup target add rather than extending .rust-target-install, since the cross linker has to be apt-installed in the same block; the toolchain-pin handling from the #91899 post-mortem is unchanged.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
libretro-build-linux-aarch64job so the core lands innightly/linux/aarch64/on the buildbot, where it is currently missing.Why it is not a one-liner
There is no
rust-linux-aarch64.ymltemplate in ci-templates — onlyrust-linux-x64.yml— andlibretro-build-rustisFROM libretro-build-amd64-ubuntu, so there is no native aarch64 image to point at either. I raised that gap as libretro/libretro-super#2030.So this job cross-compiles from the same image the x64 job already uses, in the style that image already uses for its other arm64 targets (
CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKERand friends): add the target, pointCARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKERataarch64-linux-gnu-gcc, and overrideSTRIP, since the template's defaultstripis host binutils (rust-webos.ymldoes the same for its ARM targets)..libretro-rust-linux-x64is extended rather than-default, since that is what pinsTARGET_ARCHto x86_64.I read the #91899 post-mortem before writing this. The job declares
RUST_TARGETlike every other one and runsrustup target add ${RUST_TARGET}, so therust-toolchain.tomlpin gets itsrust-stdfor aarch64 the same way; it spells thebefore_scriptout rather than extending.rust-target-installonly because the cross linker has to be apt-installed in the same block. Nothing is added totargetsinrust-toolchain.toml, per the note there.If a
rust-linux-aarch64.ymltemplate ever lands, this job collapses to anextends:line.Tested on real aarch64 hardware
Built and run natively on an aarch64 Linux machine (Snapdragon 7c / SC7180, postmarketOS), target
aarch64-unknown-linux-gnu. Worth noting for the pin: rustup honouredrust-toolchain.tomland pulled a fresh 1.96.0 aarch64 toolchain on its own, and the build was clean on it.cargo build --release --target aarch64-unknown-linux-gnuis clean across all the workspace crates (cpu, ppu, apu, mappers, core, libretro)librustynes.so, ELF 64-bit LSB shared object, ARM aarch64, 1.9 MBOne aside, unrelated to this PR: the core cannot be driven by a minimal libretro host that calls
retro_set_environmentbeforeretro_init.rust-libretro0.3.2 panics there withretro_set_environment: Core has not been initialized yet!(rust-libretro-0.3.2/src/lib.rs:432). RetroArch happens to call them in the other order so it never trips, but a stricter frontend would. That is upstreamrust-libretro, not this repo — flagging it only because it cost me a confusing crash while benchmarking.What I could not test: I built natively on aarch64, whereas this job cross-compiles from x86_64. I also cannot run GitLab pipelines from a GitHub PR, so the job itself has not been executed by CI yet.
Summary by CodeRabbit
aarch64-unknown-linux-gnu, enabling support for ARM64 environments.