Skip to content

Commit ce3187b

Browse files
committed
Fix CI buildbot failures, expand CI coverage, add release automation
Code fixes: - libretro.c: Move extern declarations to top of function blocks for MSVC 2005/2010 C89 compliance (error C2143 mid-block declarations) - blitter_simd_sse2.c: Replace _mm_cvtsi128_si64 with memcpy-based helper — the former only exists on x86_64, breaking 32-bit x86 builds (Linux i686, Windows i686 MinGW). Also fix C89 mid-block declarations. - Makefile.common: Detect cross-compiler prefixes (arm-, aarch64-, mips, powerpc) in CC to skip host uname -m SIMD fallback. Fixes webOS ARM build getting SSE2 when built on an x86_64 host. CI coverage (c-cpp.yml — 13 build targets + C89 lint): - Add Windows i686 MinGW (MSYS2 MINGW32) - Add Linux i686 (gcc -m32 multilib) - Add Android NDK arm64-v8a + armeabi-v7a - Add iOS arm64 + tvOS arm64 (Xcode cross-compile) - Add C89 compliance lint job - Add workflow_dispatch for manual trigger via GitHub UI - Parameterize MSYS2 setup (msystem, packages) per matrix entry Release automation: - release.yml: Sync build matrix (12 platform artifacts including iOS/tvOS) - version-bump.yml: New workflow_dispatch to bump version in libretro.c, commit, tag, and push — triggering release.yml automatically .gitignore: Comprehensive ignore rules for build artifacts, test binaries, logs, ROMs, IDE files, Python venvs, and reference docs. Made-with: Cursor
1 parent 065c8b3 commit ce3187b

9 files changed

Lines changed: 353 additions & 46 deletions

File tree

.github/workflows/c-cpp.yml

Lines changed: 108 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [ master ]
66
pull_request:
77
branches: [ master ]
8+
workflow_dispatch:
89

910
jobs:
1011
build:
@@ -31,6 +32,13 @@ jobs:
3132
cc: 'gcc'
3233
cxx: 'g++'
3334

35+
- displayTargetName: 'Linux i686'
36+
artifact: 'virtualjaguar_libretro.so'
37+
os: ubuntu-latest
38+
cc: 'gcc -m32'
39+
cxx: 'g++ -m32'
40+
multilib: true
41+
3442
# macOS
3543
- displayTargetName: 'macOS arm64 (Clang)'
3644
artifact: 'virtualjaguar_libretro.dylib'
@@ -45,13 +53,52 @@ jobs:
4553
cc: 'gcc'
4654
cxx: 'g++'
4755
shell: 'msys2 {0}'
56+
msystem: 'MINGW64'
57+
msys2_packages: 'mingw-w64-x86_64-gcc make'
58+
59+
- displayTargetName: 'Windows i686 (MSYS2)'
60+
artifact: 'virtualjaguar_libretro.dll'
61+
os: windows-latest
62+
cc: 'gcc'
63+
cxx: 'g++'
64+
shell: 'msys2 {0}'
65+
msystem: 'MINGW32'
66+
msys2_packages: 'mingw-w64-i686-gcc make'
4867

4968
# Emscripten (WebAssembly)
5069
- displayTargetName: 'Emscripten (WASM)'
5170
artifact: 'virtualjaguar_libretro_emscripten.bc'
5271
os: ubuntu-latest
5372
emscripten: true
5473

74+
# Android NDK (arm64-v8a)
75+
- displayTargetName: 'Android arm64-v8a'
76+
artifact: 'libs/arm64-v8a/libretro.so'
77+
os: ubuntu-latest
78+
android: true
79+
android_abi: 'arm64-v8a'
80+
81+
# Android NDK (armeabi-v7a)
82+
- displayTargetName: 'Android armeabi-v7a'
83+
artifact: 'libs/armeabi-v7a/libretro.so'
84+
os: ubuntu-latest
85+
android: true
86+
android_abi: 'armeabi-v7a'
87+
88+
# iOS
89+
- displayTargetName: 'iOS arm64'
90+
artifact: 'virtualjaguar_libretro_ios.dylib'
91+
os: macos-latest
92+
make_platform: 'ios-arm64'
93+
cross: true
94+
95+
# tvOS
96+
- displayTargetName: 'tvOS arm64'
97+
artifact: 'virtualjaguar_libretro_tvos.dylib'
98+
os: macos-latest
99+
make_platform: 'tvos-arm64'
100+
cross: true
101+
55102
name: build-${{ matrix.config.displayTargetName }}
56103
runs-on: ${{ matrix.config.os }}
57104

@@ -62,45 +109,68 @@ jobs:
62109
steps:
63110
- uses: actions/checkout@v4
64111

112+
- name: Install multilib
113+
if: matrix.config.multilib
114+
run: |
115+
sudo dpkg --add-architecture i386
116+
sudo apt-get update
117+
sudo apt-get install -y gcc-multilib g++-multilib
118+
65119
- name: Set up MSYS2
66120
if: runner.os == 'Windows'
67121
uses: msys2/setup-msys2@v2
68122
with:
69-
msystem: MINGW64
123+
msystem: ${{ matrix.config.msystem || 'MINGW64' }}
70124
update: false
71-
install: >-
72-
mingw-w64-x86_64-gcc
73-
make
125+
install: ${{ matrix.config.msys2_packages || 'mingw-w64-x86_64-gcc make' }}
74126

75127
- name: Set up Emscripten
76128
if: matrix.config.emscripten
77129
uses: mymindstorm/setup-emsdk@v14
78130

131+
- name: Set up Android NDK
132+
if: matrix.config.android
133+
uses: nttld/setup-ndk@v1
134+
id: setup-ndk
135+
with:
136+
ndk-version: r26d
137+
79138
- name: Build
80-
if: ${{ !matrix.config.emscripten }}
81-
run: make -j4 CC=${{ matrix.config.cc }} CXX=${{ matrix.config.cxx }}
139+
if: ${{ !matrix.config.emscripten && !matrix.config.android && !matrix.config.make_platform }}
140+
run: make -j4 CC="${{ matrix.config.cc }}" CXX="${{ matrix.config.cxx }}"
141+
142+
- name: Build (platform)
143+
if: matrix.config.make_platform
144+
run: make -j4 platform=${{ matrix.config.make_platform }}
82145

83146
- name: Build (Emscripten)
84147
if: matrix.config.emscripten
85148
run: emmake make -j4 platform=emscripten
86149

150+
- name: Build (Android NDK)
151+
if: matrix.config.android
152+
run: |
153+
${{ steps.setup-ndk.outputs.ndk-path }}/ndk-build \
154+
APP_ABI=${{ matrix.config.android_abi }} -j4
155+
87156
- name: Run SIMD blitter tests
88-
if: ${{ !matrix.config.emscripten }}
157+
if: ${{ !matrix.config.emscripten && !matrix.config.android && !matrix.config.cross }}
89158
run: |
90159
ARCH=$(uname -m)
160+
CC="${{ matrix.config.cc }}"
91161
case "$ARCH" in
92162
x86_64|i686|i386) SIMD_SRC=src/blitter_simd_sse2.c; EXTRA="-msse2" ;;
93163
aarch64|arm64) SIMD_SRC=src/blitter_simd_neon.c; EXTRA="" ;;
94164
*) SIMD_SRC=src/blitter_simd_scalar.c; EXTRA="" ;;
95165
esac
96166
97167
echo "==> Testing ${SIMD_SRC}..."
98-
${{ matrix.config.cc }} -O2 -Wall ${EXTRA} -I src \
168+
$CC -O2 -Wall ${EXTRA} -I src \
99169
-o test_blitter_simd test/test_blitter_simd.c ${SIMD_SRC}
100170
./test_blitter_simd
101171
102172
echo "==> Cross-checking against scalar..."
103-
${{ matrix.config.cc }} -O2 -Wall -I src \
173+
$CC -O2 -Wall -I src \
104174
-o test_blitter_scalar test/test_blitter_simd.c src/blitter_simd_scalar.c
105175
./test_blitter_scalar
106176
@@ -110,3 +180,32 @@ jobs:
110180
name: ${{ matrix.config.displayTargetName }}
111181
path: ${{ matrix.config.artifact }}
112182
if-no-files-found: error
183+
184+
c89-lint:
185+
name: C89 compliance check
186+
runs-on: ubuntu-latest
187+
steps:
188+
- uses: actions/checkout@v4
189+
190+
- name: Check for declaration-after-statement
191+
run: |
192+
echo "==> Checking C89 compliance (catches MSVC C89 errors)..."
193+
FAILED=0
194+
for f in libretro.c src/*.c; do
195+
# Skip machine-generated files
196+
case "$f" in
197+
src/m68000/*|src/jag*bios*.c|src/jagstub*bios.c|src/blitter_simd_neon.c|src/blitter_simd_sse2.c) continue ;;
198+
esac
199+
if ! gcc -fsyntax-only -std=gnu89 \
200+
-Werror=declaration-after-statement \
201+
-I. -Isrc -Isrc/m68000 -Ilibretro-common/include \
202+
-D__LIBRETRO__ -DINLINE="inline" \
203+
"$f" 2>&1; then
204+
FAILED=1
205+
fi
206+
done
207+
if [ "$FAILED" = "1" ]; then
208+
echo "::error::C89 compliance check failed — mid-block declarations found"
209+
exit 1
210+
fi
211+
echo "==> All files pass C89 declaration check"

.github/workflows/release.yml

Lines changed: 90 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
config:
16+
# Linux
1617
- platform: linux-x86_64
1718
artifact: virtualjaguar_libretro.so
1819
os: ubuntu-latest
@@ -25,18 +26,69 @@ jobs:
2526
cc: gcc
2627
cxx: g++
2728

29+
- platform: linux-i686
30+
artifact: virtualjaguar_libretro.so
31+
os: ubuntu-latest
32+
cc: 'gcc -m32'
33+
cxx: 'g++ -m32'
34+
multilib: true
35+
36+
# macOS
2837
- platform: macos-arm64
2938
artifact: virtualjaguar_libretro.dylib
3039
os: macos-latest
3140
cc: clang
3241
cxx: clang++
3342

43+
# Windows
3444
- platform: windows-x86_64
3545
artifact: virtualjaguar_libretro.dll
3646
os: windows-latest
3747
cc: gcc
3848
cxx: g++
3949
shell: 'msys2 {0}'
50+
msystem: 'MINGW64'
51+
msys2_packages: 'mingw-w64-x86_64-gcc make'
52+
53+
- platform: windows-i686
54+
artifact: virtualjaguar_libretro.dll
55+
os: windows-latest
56+
cc: gcc
57+
cxx: g++
58+
shell: 'msys2 {0}'
59+
msystem: 'MINGW32'
60+
msys2_packages: 'mingw-w64-i686-gcc make'
61+
62+
# Emscripten (WebAssembly)
63+
- platform: emscripten-wasm
64+
artifact: virtualjaguar_libretro_emscripten.bc
65+
os: ubuntu-latest
66+
emscripten: true
67+
68+
# Android NDK
69+
- platform: android-arm64-v8a
70+
artifact: libs/arm64-v8a/libretro.so
71+
os: ubuntu-latest
72+
android: true
73+
android_abi: 'arm64-v8a'
74+
75+
- platform: android-armeabi-v7a
76+
artifact: libs/armeabi-v7a/libretro.so
77+
os: ubuntu-latest
78+
android: true
79+
android_abi: 'armeabi-v7a'
80+
81+
# iOS
82+
- platform: ios-arm64
83+
artifact: virtualjaguar_libretro_ios.dylib
84+
os: macos-latest
85+
make_platform: 'ios-arm64'
86+
87+
# tvOS
88+
- platform: tvos-arm64
89+
artifact: virtualjaguar_libretro_tvos.dylib
90+
os: macos-latest
91+
make_platform: 'tvos-arm64'
4092

4193
name: build-${{ matrix.config.platform }}
4294
runs-on: ${{ matrix.config.os }}
@@ -48,25 +100,54 @@ jobs:
48100
steps:
49101
- uses: actions/checkout@v4
50102

103+
- name: Install multilib
104+
if: matrix.config.multilib
105+
run: |
106+
sudo dpkg --add-architecture i386
107+
sudo apt-get update
108+
sudo apt-get install -y gcc-multilib g++-multilib
109+
51110
- name: Set up MSYS2
52111
if: runner.os == 'Windows'
53112
uses: msys2/setup-msys2@v2
54113
with:
55-
msystem: MINGW64
114+
msystem: ${{ matrix.config.msystem || 'MINGW64' }}
56115
update: false
57-
install: >-
58-
mingw-w64-x86_64-gcc
59-
make
116+
install: ${{ matrix.config.msys2_packages || 'mingw-w64-x86_64-gcc make' }}
117+
118+
- name: Set up Emscripten
119+
if: matrix.config.emscripten
120+
uses: mymindstorm/setup-emsdk@v14
121+
122+
- name: Set up Android NDK
123+
if: matrix.config.android
124+
uses: nttld/setup-ndk@v1
125+
id: setup-ndk
126+
with:
127+
ndk-version: r26d
60128

61129
- name: Build
62-
run: make -j4 CC=${{ matrix.config.cc }} CXX=${{ matrix.config.cxx }}
130+
if: ${{ !matrix.config.emscripten && !matrix.config.android && !matrix.config.make_platform }}
131+
run: make -j4 CC="${{ matrix.config.cc }}" CXX="${{ matrix.config.cxx }}"
132+
133+
- name: Build (platform)
134+
if: matrix.config.make_platform
135+
run: make -j4 platform=${{ matrix.config.make_platform }}
136+
137+
- name: Build (Emscripten)
138+
if: matrix.config.emscripten
139+
run: emmake make -j4 platform=emscripten
140+
141+
- name: Build (Android NDK)
142+
if: matrix.config.android
143+
run: |
144+
${{ steps.setup-ndk.outputs.ndk-path }}/ndk-build \
145+
APP_ABI=${{ matrix.config.android_abi }} -j4
63146
64147
- name: Package
65148
run: |
66149
mkdir -p dist
67-
cp ${{ matrix.config.artifact }} dist/virtualjaguar_libretro-${{ matrix.config.platform }}${SUFFIX}
68-
env:
69-
SUFFIX: ${{ matrix.config.platform == 'windows-x86_64' && '.dll' || (matrix.config.platform == 'macos-arm64' && '.dylib' || '.so') }}
150+
cp ${{ matrix.config.artifact }} dist/virtualjaguar_libretro-${{ matrix.config.platform }}$(echo "${{ matrix.config.artifact }}" | grep -o '\.[^.]*$')
70151
71152
- name: Upload artifact
72153
uses: actions/upload-artifact@v4
@@ -91,7 +172,7 @@ jobs:
91172
GH_TOKEN: ${{ github.token }}
92173
run: |
93174
TAG="${GITHUB_REF_NAME}"
94-
# Collect all built binaries
175+
echo "==> Creating release ${TAG} with artifacts:"
95176
find artifacts/ -type f | sort
96177
97178
gh release create "${TAG}" \

0 commit comments

Comments
 (0)