ci: add 32-bit Linux and Windows builds - #121
Conversation
The buildbot gets x86_64 and aarch64 Linux, x86_64 Windows, macOS, iOS/tvOS and all four Android ABIs; the two 32-bit desktop targets are the gap, and RetroArch still ships i686 builds for both platforms. Nothing new is needed on GitLab: both rust templates are generic over TARGET_ARCH and the image already carries gcc-multilib and the 32-bit mingw toolchain, so each job is its 64-bit sibling with a different target (plus, on Windows, the linker rustc would otherwise guess wrong). The GitHub release and nightly workflows carry the same target list, so the two targets go in there as well. Both are libretro-core-only: the standalone frontend would need a full set of 32-bit desktop dev packages on the runner, while the GitLab jobs build the core alone anyway.
The buildbot's mingw (gcc 7.3-win32, from the bionic base image) uses SJLJ exceptions on 32-bit x86, but rustc's i686-pc-windows-gnu expects DWARF-2 unwinding, so linking the precompiled std fails with undefined references to _Unwind_Resume and _Unwind_RaiseException. The 64-bit job is unaffected because it uses SEH. Compiling std from source with panic=abort drops the unwinding machinery, and the link goes through unchanged otherwise. It is also the sounder behaviour for a cdylib: a Rust panic unwinding across the libretro C boundary is undefined.
|
Updated with the fix for the GitLab pipeline failure BBKEmu hit after merging (AloysHF/BBKEmu#20 carries the same change there). The 32-bit Windows job could not link: the buildbot's rust image inherits its mingw from the bionic base image ( The job now compiles variables:
RUSTFLAGS: "-Cpanic=abort"
before_script:
- rustup toolchain install nightly --component rust-src
- rustup +nightly target add i686-pc-windows-gnu
script:
- cargo +nightly build --release --target ${TARGET_ARCH} -Z build-std=std,panic_abort
Verified in a |
The build image already ships nightly with rust-src. Reinstalling it makes rustup replace a component that lives in an image layer, which fails with "Invalid cross-device link". The rustup target stays: -Z build-std does not build rsbegin.o/rsend.o, which come from library/rtstartup and are produced by the compiler's own bootstrap, so they ship only with the precompiled target. Without it the windows-gnu link fails with "rsbegin.o: No such file or directory".
|
Pushed a third commit to this branch, carrying over what the same change turned out to need in BBKEmu (AloysHF/BBKEmu#22). Two things were wrong with the
So the before_script:
- rustup +nightly target add ${TARGET_ARCH}Only those two object files come from the precompiled target; the Verified in a |
The libretro-build-rust image was rebuilt on 2026-09-21: gcc-multilib is gone and a gcc 14 i686-linux-gnu cross compiler took its place, and the nightly it carries now links std against -lsynchronization. Both 32-bit jobs as written here stopped linking (seen on BBKEmu, which carries the same jobs). linux-i686 uses the official rust-linux-i686.yml template, which names that cross compiler. The multilib-based job now ends in crtbeginS.o being incompatible with elf32-i386. windows-i686 switches to llvm-mingw's libunwind, the recipe that is green on holani-retro against the current image. The nightly build-std job fails with "cannot find -lsynchronization" on the image's old mingw-w64 runtime, and the official template still hits _Unwind_Resume.
|
Pushed a fourth commit: the two 32-bit jobs here are the ones that went red on BBKEmu after
The GitHub Actions part of this PR is unchanged. |
rust-windows-i686.yml now links with llvm-mingw, which the rebuilt libretro-build-rust image carries together with the libgcc stand-ins and the linker variables, so the job is a one-line extends like the others.
|
Pushed a fifth commit. The 32-bit Windows job is now a one-line |
The aarch64 job cross-compiled from the x64 image and installed gcc-aarch64-linux-gnu and the rustup target in before_script. The rust-linux-aarch64.yml template exists now, so the job is a plain extends like the others and nothing is installed from the script.
The buildbot currently gets x86_64 and aarch64 Linux, x86_64 Windows, macOS, iOS/tvOS and all four Android ABIs — the two 32-bit desktop targets are the gap, and RetroArch still ships i686 builds for both platforms. Same change as AloysHF/BBKEmu#19, with the GitHub workflows kept in sync as you asked for there.
GitLab — every job is a one-line
extendsof the official ci-templates: the two new 32-bit ones userust-linux-i686.ymlandrust-windows-i686.yml, and the existing aarch64 job moves torust-linux-aarch64.ymltoo. The file matches AloysHF/BBKEmu after #27, and nothing is installed from the recipe itself; whatever a target needs comes from the rust build image.GitHub —
release.ymlandnightly-build.ymlcarry the same target list, so they get the two targets as well:i686-unknown-linux-gnuon ubuntu-22.04 (withgcc-multilib) andi686-pc-windows-msvcon windows-latest, where MSVC cross-compiles to x86 out of the box. Both entries are markedlibretro_only: trueand the standalone build/package steps skip them — the standalone frontend would need a full set of 32-bit desktop dev packages on the runner, while the GitLab jobs build the core alone anyway. The release notes mention that.Built both targets on GitHub runners against the current tree:
i686-unknown-linux-gnu→ELF 32-bit LSB shared object, Intel 80386, exportingretro_runi686-pc-windows-msvc→PE32 executable (DLL), Intel i386