mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-10 03:21:30 -10:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
928d1a0810 | ||
|
|
6919bc9cd7 | ||
|
|
a8c5b1815e | ||
|
|
cf6aab7ad2 | ||
|
|
f0cce58206 | ||
|
|
07ac0685e2 | ||
|
|
e3e1d87705 | ||
|
|
05a483cbe6 | ||
|
|
2c5cde4125 | ||
|
|
5f8bbcd1b6 | ||
|
|
e81d65d51b | ||
|
|
193133d616 | ||
|
|
d2cf7a113b | ||
|
|
4e07070e86 | ||
|
|
4562153839 |
No files matched your search
@@ -0,0 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -2,7 +2,6 @@ name: CI 3DS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-devkitpro:latest
|
||||
options: --user root
|
||||
@@ -37,3 +31,6 @@ jobs:
|
||||
run: |
|
||||
make -f Makefile.ctr -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 clean
|
||||
make -f Makefile.ctr -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 HAVE_STATIC_DUMMY=1 info all
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
@@ -2,7 +2,6 @@ name: CI Android
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
@@ -14,17 +13,12 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@v4
|
||||
|
||||
@@ -11,7 +11,6 @@ name: CI Apple
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
@@ -20,10 +19,6 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
# ------------------------------------------------------------------
|
||||
# Build-graph guard: the Bonjour/mDNS netplay discovery path.
|
||||
@@ -57,7 +52,6 @@ jobs:
|
||||
netplay-discovery-guard:
|
||||
name: Build graph - netplay mDNS discovery
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
@@ -134,7 +128,6 @@ jobs:
|
||||
tvos:
|
||||
name: tvOS build (non-gating)
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
continue-on-error: true
|
||||
|
||||
steps:
|
||||
|
||||
@@ -11,35 +11,15 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
compile-matrix: # every codec combination real builds select, not just this one
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
# The gl2 arms compile against the desktop GL and EGL headers,
|
||||
# and the Dingux and RS90 video drivers against SDL 1.2's.
|
||||
pkgs="build-essential libgl-dev libegl-dev libgles-dev libsdl1.2-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v3
|
||||
- name: Compile matrix
|
||||
run: ./.github/workflows/scripts/compile-matrix.sh
|
||||
@@ -1,171 +0,0 @@
|
||||
name: CI cross-libc libretro-common/vfs samples
|
||||
|
||||
# libretro-common/samples runs on ubuntu-latest only, which means
|
||||
# every VFS test in the tree is validated against exactly one C
|
||||
# library. That is the wrong number for this code: file_stream.c and
|
||||
# vfs_implementation.c sit directly on top of stdio and the file
|
||||
# descriptor API, and the libraries disagree about both.
|
||||
#
|
||||
# glibc fread() reads straight into the caller's buffer once
|
||||
# the request reaches the block size, whoever owns the
|
||||
# buffer (libio/fileops.c, _IO_file_xsgetn).
|
||||
# Apple libc the same bypass exists but is skipped when setvbuf()
|
||||
# supplied the buffer - '__SMBF' is then clear - which is
|
||||
# exactly what retro_vfs_file_open_impl() does
|
||||
# (Libc/stdio/FreeBSD/fread.c, radar 5980080 / 6180417).
|
||||
# UCRT not open source; behaviour is inferred and therefore
|
||||
# worth measuring rather than assuming.
|
||||
# msvcrt the older runtime MINGW64 links against, again
|
||||
# different code from UCRT.
|
||||
#
|
||||
# The tests here assert behaviour, not performance, so a difference in
|
||||
# any of the above shows up as a failure rather than a slowdown. The
|
||||
# Windows entries matter most for the descriptor path, which opens
|
||||
# with open()/_wopen() instead of fopen(mode "rb") and so depends on
|
||||
# O_BINARY being in the flags; vfs_bulk_read_test's binary
|
||||
# transparency case is the one that catches its absence.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'libretro-common/streams/file_stream.c'
|
||||
- 'libretro-common/vfs/**'
|
||||
- 'libretro-common/include/vfs/**'
|
||||
- 'libretro-common/include/streams/file_stream.h'
|
||||
- 'libretro-common/samples/file/vfs/**'
|
||||
- '.github/workflows/Cross-libc-vfs-samples.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'libretro-common/streams/file_stream.c'
|
||||
- 'libretro-common/vfs/**'
|
||||
- 'libretro-common/include/vfs/**'
|
||||
- 'libretro-common/include/streams/file_stream.h'
|
||||
- 'libretro-common/samples/file/vfs/**'
|
||||
- '.github/workflows/Cross-libc-vfs-samples.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
# glibc and Apple libc. Both take the descriptor path, since
|
||||
# VFS_HAVE_FILE_MAPPING covers anything with mmap.
|
||||
unix:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: glibc (ubuntu-latest)
|
||||
runner: ubuntu-latest
|
||||
# LeakSanitizer exists here, so run it at full strictness.
|
||||
asan_opts: detect_leaks=1
|
||||
- name: Apple libc (macos-latest)
|
||||
runner: macos-latest
|
||||
# LeakSanitizer is not implemented on Darwin, and asking
|
||||
# for it is fatal rather than ignored: the runtime prints
|
||||
# "detect_leaks is not supported on this platform" and
|
||||
# aborts. Leak coverage for these sources comes from the
|
||||
# Linux leg above; this one is here for Apple's libc
|
||||
# behaviour, which is what differs.
|
||||
asan_opts: detect_leaks=0
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Build and run
|
||||
shell: bash
|
||||
working-directory: libretro-common/samples/file/vfs
|
||||
run: |
|
||||
set -euo pipefail
|
||||
run_cfg() {
|
||||
echo "==> $*"
|
||||
make clean >/dev/null
|
||||
make "$@" SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=${{ matrix.asan_opts }} ./vfs_bulk_read_test
|
||||
./vfs_seek_contract_test
|
||||
./vfs_mapped_ptr_test
|
||||
./vfs_v5_metadata_test
|
||||
}
|
||||
# Mapping on (what the platform actually ships), mapping off
|
||||
# with the descriptor path forced (what the consoles have),
|
||||
# and neither (a target on no list, which must keep its
|
||||
# buffered behaviour).
|
||||
run_cfg MMAP=1
|
||||
run_cfg MMAP=0 DESCRIPTOR_IO=1
|
||||
run_cfg MMAP=0
|
||||
|
||||
- name: Thread sanitizer
|
||||
# Not on macOS: TSan there reports on system libraries the
|
||||
# runner image ships, which is noise this job cannot fix.
|
||||
if: matrix.runner == 'ubuntu-latest'
|
||||
shell: bash
|
||||
working-directory: libretro-common/samples/file/vfs
|
||||
run: |
|
||||
set -euo pipefail
|
||||
make clean >/dev/null
|
||||
make SANITIZER=thread
|
||||
./vfs_bulk_read_test
|
||||
|
||||
# UCRT and msvcrt, through MSYS2. Same C runtimes an MSVC-built
|
||||
# RetroArch links against, so the runtime behaviour these tests
|
||||
# check is the behaviour that ships; the MSVC job covers the
|
||||
# compiler.
|
||||
windows:
|
||||
name: ${{ matrix.sys }} (windows-latest)
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sys: [UCRT64, MINGW64]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.sys }}
|
||||
update: true
|
||||
install: >-
|
||||
base-devel
|
||||
pacboy: >-
|
||||
toolchain:p
|
||||
|
||||
- name: Build and run
|
||||
working-directory: libretro-common/samples/file/vfs
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# No sanitizers here: the MSYS2 toolchains do not ship a
|
||||
# usable ASan runtime for this target, and the point of this
|
||||
# job is which C runtime the calls land on, not memory
|
||||
# safety - the Linux job covers that with the same sources.
|
||||
#
|
||||
# MMAP=0 is required, not cosmetic: -DHAVE_MMAP pulls in
|
||||
# <sys/mman.h>, which does not exist here. The Win32
|
||||
# file-mapping backend is selected by _WIN32 inside vfs.h
|
||||
# rather than by that flag, so VFS_HAVE_FILE_MAPPING - and
|
||||
# with it descriptor I/O and the mapped-pointer path - is on
|
||||
# regardless.
|
||||
make clean MMAP=0
|
||||
make MMAP=0
|
||||
./vfs_bulk_read_test.exe
|
||||
./vfs_seek_contract_test.exe
|
||||
# Win32 branches of the v5 metadata ops: attributes,
|
||||
# SetFileTime, CopyFileW, find-data dirent_stat.
|
||||
./vfs_v5_metadata_test.exe
|
||||
# Exercises the Win32 CreateFileMapping/MapViewOfFile
|
||||
# backend, which no other job in the tree reaches.
|
||||
./vfs_mapped_ptr_test.exe
|
||||
@@ -1,46 +0,0 @@
|
||||
name: CI Context presentable() contract
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
ctx-presentable-check:
|
||||
name: gfx_ctx_driver_t presentable() consistency
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Checker self-test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Fixture pass: a correct driver is clean, a presentable()
|
||||
# casting another driver's context type is flagged, and one
|
||||
# that is defined but never wired into the vtable is flagged.
|
||||
python3 tools/ctx_presentable_check.py --selftest
|
||||
|
||||
- name: Tree check
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Each context driver is compiled by one platform's CI, so a
|
||||
# presentable() that casts the wrong driver's type, or that is
|
||||
# never wired in, is invisible to every other job. This is the
|
||||
# check that sees all of them at once.
|
||||
python3 tools/ctx_presentable_check.py
|
||||
@@ -2,7 +2,6 @@ name: CI DOS/DJGPP
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-djgpp-build-container:latest
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile RA
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI Emscripten
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-emscripten:latest
|
||||
options: --user root
|
||||
@@ -32,3 +26,8 @@ jobs:
|
||||
run: |
|
||||
emmake make -f Makefile.emscripten -j$(getconf _NPROCESSORS_ONLN) clean
|
||||
emmake make -f Makefile.emscripten -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1
|
||||
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI GameCube
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-devkitpro:latest
|
||||
options: --user root
|
||||
@@ -32,3 +26,7 @@ jobs:
|
||||
run: |
|
||||
make -f Makefile.ngc -j$(getconf _NPROCESSORS_ONLN) clean
|
||||
make -f Makefile.ngc -j$(getconf _NPROCESSORS_ONLN) EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0 HAVE_STATIC_DUMMY=1 info all
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
|
||||
@@ -14,34 +14,16 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
linux-nomenu: # Smoketest build with no menu support compiled in
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev nvidia-cg-toolkit nvidia-cg-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install build-essential libxkbcommon-dev libx11-xcb-dev zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev nvidia-cg-toolkit nvidia-cg-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v3
|
||||
- name: Configure
|
||||
run: ./configure --disable-menu
|
||||
- name: Build
|
||||
|
||||
@@ -21,10 +21,8 @@ name: CI Linux ASan + UBSan [No Menu]
|
||||
# surfaced in step output for triage.
|
||||
#
|
||||
# The per-sample tests under .github/workflows/Linux-samples-gfx.yml,
|
||||
# Linux-samples-tasks.yml, Linux-samples-audio.yml,
|
||||
# Linux-samples-network.yml, Linux-samples-settings.yml, and
|
||||
# Linux-libretro-{db,common}-samples.yml regression-test specific
|
||||
# predicates that previously had bugs. This
|
||||
# Linux-samples-tasks.yml, and Linux-libretro-{db,common}-samples.yml
|
||||
# regression-test specific predicates that previously had bugs. This
|
||||
# job is complementary -- it covers everything those harnesses can't
|
||||
# reach because the code only runs from main(), and catches future
|
||||
# heap-corruption / UB regressions across the whole code base for
|
||||
@@ -51,10 +49,6 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
asan-ubsan:
|
||||
name: Build with ASan+UBSan and run headless smoke
|
||||
@@ -72,25 +66,20 @@ jobs:
|
||||
# comment for why SDL2 over xvideo. No sanitizer-specific
|
||||
# packages required; libasan / libubsan ship with the gcc
|
||||
# that ubuntu-latest has installed by default.
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev xvfb x11-utils zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev nvidia-cg-toolkit nvidia-cg-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
build-essential \
|
||||
libxkbcommon-dev libx11-xcb-dev \
|
||||
xvfb x11-utils \
|
||||
zlib1g-dev libfreetype6-dev \
|
||||
libegl1-mesa-dev libgles2-mesa-dev libgbm-dev \
|
||||
nvidia-cg-toolkit nvidia-cg-dev \
|
||||
libavcodec-dev libsdl2-dev libsdl-image1.2-dev \
|
||||
libxml2-dev yasm
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Configure (no menu, no discord/cheevos/networking, sdl2 on)
|
||||
# Trim the build surface for the first iteration so any
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
name: CI Linux native audio transport
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
native-transport:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sanitizer: ['', 'address,undefined']
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: Build the shipping frontend and real audio wrapper fixture
|
||||
working-directory: samples/audio/pipeline_wakeups
|
||||
run: make clean all SANITIZER='${{ matrix.sanitizer }}'
|
||||
- name: Stereo tempo extremes and live controls
|
||||
working-directory: samples/audio/pipeline_wakeups
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
|
||||
run: make check-tempo check-live SANITIZER='${{ matrix.sanitizer }}'
|
||||
- name: Native and mixed formats through 5.1 and 7.1
|
||||
working-directory: samples/audio/pipeline_wakeups
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
|
||||
run: make check-wide SANITIZER='${{ matrix.sanitizer }}'
|
||||
- name: Live source layouts on a fixed device
|
||||
working-directory: samples/audio/pipeline_wakeups
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
|
||||
run: make check-layout SANITIZER='${{ matrix.sanitizer }}'
|
||||
- name: Speed-linked low-pass control requests
|
||||
working-directory: samples/audio/pipeline_wakeups
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
|
||||
run: make check-speed-lpf SANITIZER='${{ matrix.sanitizer }}'
|
||||
- name: Runloop speed-state requests
|
||||
working-directory: samples/audio/pipeline_wakeups
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
|
||||
run: make check-runloop SANITIZER='${{ matrix.sanitizer }}'
|
||||
- name: Automatic producer controls and fallback
|
||||
working-directory: samples/audio/pipeline_wakeups
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
|
||||
run: make check-auto SANITIZER='${{ matrix.sanitizer }}'
|
||||
@@ -15,10 +15,6 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
autoconf-tests:
|
||||
name: Build and run the autoconfig regression suite
|
||||
@@ -27,25 +23,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential zlib1g-dev libfreetype6-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential zlib1g-dev libfreetype6-dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Configure (headless, test drivers)
|
||||
run: |
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
name: CI driver vtables
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
driver-vtables:
|
||||
name: Every driver against its interface
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq --no-install-recommends \
|
||||
build-essential libasound2-dev libpulse-dev libjack-jackd2-dev \
|
||||
libopenal-dev libpipewire-0.3-dev libsdl2-dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Compile each driver against its interface
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# A driver fills in a vtable of function pointers, and almost
|
||||
# every one of them does it positionally and names nothing.
|
||||
# So an entry added to the middle of one of those structures
|
||||
# silently moves every entry after it in every driver that
|
||||
# did not name its fields, and what the compiler then says is
|
||||
# that a layout function is being installed as an underrun
|
||||
# counter - which is an error only if you ask for it to be.
|
||||
#
|
||||
# That happened: frames_consumed_fallback went in between
|
||||
# frames_consumed and underruns, three Windows drivers took
|
||||
# the shift, and the break reached master because the check
|
||||
# run before the commit was one file rather than all of them.
|
||||
#
|
||||
# This is that check. It compiles every driver it can on
|
||||
# Linux - the rest need SDKs that are not here - and treats a
|
||||
# mismatched function pointer as the error it is.
|
||||
#
|
||||
# The names are matched with digits in them as well: a driver
|
||||
# called sdl3 or v4l2 or ps2 is exactly as positional as one
|
||||
# that spells itself in letters, and six of them were being
|
||||
# walked past. The display drivers fill in a vtable of the
|
||||
# same shape, so they are here too.
|
||||
#
|
||||
# A static function nobody calls is in the same family and is
|
||||
# caught here too: it is what a call site that was meant to
|
||||
# be there and is not looks like from the compiler's side.
|
||||
# That happened as well - the pump's scheduler class was
|
||||
# taken but never given back, and the only sign was the
|
||||
# helper that returns it going unused.
|
||||
fail=0
|
||||
defs="-DRARCH_INTERNAL -DHAVE_THREADS -DHAVE_MENU -DHAVE_CONFIGFILE"
|
||||
defs="$defs -DHAVE_AUDIOMIXER -DHAVE_REWIND -DHAVE_RWAV"
|
||||
have="-DHAVE_ALSA -DHAVE_PULSE -DHAVE_JACK -DHAVE_OSS -DHAVE_OPENAL"
|
||||
have="$have -DHAVE_PIPEWIRE -DHAVE_TINYALSA -DHAVE_SDL2"
|
||||
inc="-I. -Ilibretro-common/include -Ideps -Ideps/rcheevos/include"
|
||||
inc="$inc $(pkg-config --cflags libpipewire-0.3 2>/dev/null || true)"
|
||||
# Every file that fills one of these structures in, found by
|
||||
# looking rather than by listing a directory: the Android
|
||||
# build broke on audio/audio_thread_wrapper.c, which fills in
|
||||
# an audio_driver_t and does not live under audio/drivers,
|
||||
# and so was not in the list this job first carried.
|
||||
files=$(grep -rl -E \
|
||||
'audio_driver_t [a-z_0-9]+ *=|camera_driver_t [a-z_0-9]+ *=|record_driver_t [a-z_0-9]+ *=|microphone_driver_t [a-z_0-9]+ *=|gfx_display_ctx_driver_t [a-z_0-9]+ *=' \
|
||||
--include='*.c' . | grep -v '^\./samples/' | sort)
|
||||
echo "$files" | sed 's/^/ /'
|
||||
echo
|
||||
for f in $files; do
|
||||
[ -f "$f" ] || continue
|
||||
out=$(gcc -fsyntax-only -std=gnu99 -Wall \
|
||||
-Werror=incompatible-pointer-types \
|
||||
-Werror=unused-function \
|
||||
$defs $have $inc "$f" 2>&1 || true)
|
||||
# A driver whose platform SDK is not here does not compile
|
||||
# at all, and that is not what this job is about: it is
|
||||
# skipped, and only a pointer mismatch fails.
|
||||
if printf '%s' "$out" | grep -qE "incompatible pointer type|defined but not used"; then
|
||||
echo "=== $f"
|
||||
printf '%s\n' "$out" | grep -E -A2 "incompatible pointer type|defined but not used"
|
||||
fail=1
|
||||
elif printf '%s' "$out" | grep -q ": error:"; then
|
||||
echo "[skip] $f (needs an SDK that is not here)"
|
||||
else
|
||||
echo "[ok] $f"
|
||||
fi
|
||||
done
|
||||
if [ "$fail" -ne 0 ]; then
|
||||
echo
|
||||
echo "A driver does not match the interface it fills in, or has a"
|
||||
echo "static function nothing calls. An optional vtable entry belongs"
|
||||
echo "at the end of the structure, where it cannot move the entries a"
|
||||
echo "positional initialiser relies on; an uncalled helper usually"
|
||||
echo "means the call site that was meant to use it is missing."
|
||||
exit 1
|
||||
fi
|
||||
@@ -15,10 +15,6 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples:
|
||||
name: Build and run libretro-common/samples
|
||||
@@ -27,47 +23,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
# All three packages ship on the stock ubuntu-latest image, so
|
||||
# this step is a no-op there and apt is only contacted if the
|
||||
# image ever drops one of them.
|
||||
# ffmpeg (with libx264): formats/h264/rh264_lossless_test builds
|
||||
# its lossless corpus and its reference decodes with it.
|
||||
if dpkg -s build-essential zlib1g-dev clang ffmpeg >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
build-essential zlib1g-dev clang ffmpeg
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential zlib1g-dev clang
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and run samples
|
||||
shell: bash
|
||||
@@ -96,7 +57,6 @@ jobs:
|
||||
snprintf
|
||||
unbase64_test
|
||||
crc32_test
|
||||
emscripten_mmap_test
|
||||
archive_zip_test
|
||||
archive_zstd_test
|
||||
config_file_test
|
||||
@@ -106,13 +66,11 @@ jobs:
|
||||
rpng
|
||||
rzip_chunk_size_test
|
||||
rzip_matches_buf_test
|
||||
rzip_codec_test
|
||||
data_transfer_source_test
|
||||
data_transfer_prefix_test
|
||||
data_transfer_window_test
|
||||
audio_transfer_window_test
|
||||
rjpeg_test
|
||||
rh264_lossless_test
|
||||
r7z_lzma_props_test
|
||||
vcdiff_test
|
||||
net_ifinfo
|
||||
@@ -120,77 +78,27 @@ jobs:
|
||||
vfs_mapped_ptr_test
|
||||
vfs_large_file_test
|
||||
vfs_seek_contract_test
|
||||
vfs_bulk_read_test
|
||||
vfs_v5_metadata_test
|
||||
vfs_hybrid_test
|
||||
filestream_rbuf_fault_test
|
||||
cdrom_cuesheet_overflow_test
|
||||
cdfs_dir_record_test
|
||||
cdfs_pure_api_test
|
||||
chd_meta_overflow_test
|
||||
strlcpy_append_test
|
||||
http_parse_test
|
||||
rjson_test
|
||||
rm3u_test
|
||||
rtga_test
|
||||
rbmp_test
|
||||
rbmp_encode_test
|
||||
rpng_chunk_overflow_test
|
||||
rpng_roundtrip_test
|
||||
rpng_decode_corpus_test
|
||||
# Benchmark, not a pass/fail test, but it runs its default
|
||||
# 4K comparison and exits 0, so under this job's sanitizer
|
||||
# build it doubles as end-to-end ASan/UBSan smoke coverage
|
||||
# of the old and new screenshot encode/write paths.
|
||||
# Timings in its output are informational only.
|
||||
screenshot_io_bench
|
||||
word_wrap_overflow_test
|
||||
task_queue_title_error_test
|
||||
task_queue_init_failure_test
|
||||
# Stops the worker with a bound when a detachable
|
||||
# handler is stuck; waits ~1.5 s by design.
|
||||
task_queue_detach_test
|
||||
tpool_wait_test
|
||||
data_transfer_pool_scrub_test
|
||||
retro_atomic_test
|
||||
retro_atomic_extern_c_linkage_test
|
||||
retro_atomic_extern_c_linkage_test_cxx
|
||||
# The PS2 EE backend, built off-target against a stub
|
||||
# <kernel.h>: the PS2 CI lane compiles it, this runs it.
|
||||
retro_atomic_ps2_backend_test
|
||||
retro_spsc_test
|
||||
mpsc_stack_test
|
||||
retro_waitable_spsc_test
|
||||
retro_eventcount_test
|
||||
# retro_sleep_until_us must never return early against the
|
||||
# microsecond clock; the late bound is loose for a loaded
|
||||
# runner.
|
||||
retro_sleep_until_test
|
||||
# Runs its natural tier only here; Makefile.test's
|
||||
# threads-samples forces each tier in turn. On the
|
||||
# runner's cores the fence check is load-bearing, which
|
||||
# this box cannot make it.
|
||||
retro_procbarrier_test
|
||||
retro_asym_eventcount_test
|
||||
sthread_ex_test
|
||||
memshm_test
|
||||
fastjmp_test
|
||||
rdds_block_test
|
||||
faulthandler_test
|
||||
memshm_area_test
|
||||
msg_fifo_queue_test
|
||||
audio_mixer_loop_test
|
||||
audio_mixer_rate_guard_test
|
||||
# The AC-3 / E-AC-3 frame layer against ffmpeg's streams:
|
||||
# ffmpeg is in the package list above for it.
|
||||
rac3_frame_test
|
||||
rac3_tables_test
|
||||
rac3_decode_test
|
||||
rac3_encode_test
|
||||
# IEC 61937 bursts against ffmpeg's spdif muxer and demuxer.
|
||||
iec61937_test
|
||||
# The AC-3 arm of audio_transfer against ffmpeg's decode.
|
||||
audio_transfer_ac3_test
|
||||
)
|
||||
|
||||
# Targets that are built but deliberately not executed, each
|
||||
@@ -216,14 +124,6 @@ jobs:
|
||||
# leak is fixed, so LeakSanitizer runs at full strictness and
|
||||
# any surviving allocation is a real config_file regression.
|
||||
declare -A RUN_ENV=(
|
||||
# fastjmp_jmp is a longjmp that is not libc's, so ASan's
|
||||
# fake-stack check cannot follow it; the same holds for
|
||||
# libco. The jump is what the test is for.
|
||||
[fastjmp_test]="ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=0"
|
||||
# The filter must be the one that sees SIGSEGV: ASan installs
|
||||
# its own, and with it the faults never reach the code under
|
||||
# test. handle_segv=0 is how a fastmem core runs.
|
||||
[faulthandler_test]="ASAN_OPTIONS=detect_leaks=1:handle_segv=0 UBSAN_OPTIONS=handle_segv=0"
|
||||
)
|
||||
|
||||
# Samples that are build-only (either they require command-line
|
||||
@@ -232,15 +132,6 @@ jobs:
|
||||
# regressions but not executed.
|
||||
declare -a BUILD_ONLY_DIRS=(
|
||||
formats/xml
|
||||
# A benchmark, not a test: its numbers only mean something
|
||||
# on two dedicated physical cores, which a runner is not.
|
||||
queues/retro_spsc_bench
|
||||
# The same, and for the same reason: it reports park and
|
||||
# commit counts under contention, which a shared runner
|
||||
# cannot produce meaningfully. It also builds a second
|
||||
# binary, the scond variant, and being build-only covers
|
||||
# both without naming either.
|
||||
rthreads/retro_eventcount_bench
|
||||
)
|
||||
|
||||
# Samples that are currently broken at build time on a stock
|
||||
@@ -482,27 +373,6 @@ jobs:
|
||||
|
||||
TSAN_OPTIONS=halt_on_error=1 ./retro_atomic_test
|
||||
|
||||
- name: Run mpsc_stack_test under Clang + ThreadSanitizer
|
||||
shell: bash
|
||||
working-directory: libretro-common/samples/queues/mpsc_stack_test
|
||||
run: |
|
||||
# mpsc_stack.h is the lock-free many-producer single-consumer
|
||||
# stack the runloop's deferred messages ride. Its contract is
|
||||
# the push's compare-exchange publishing the node against the
|
||||
# drain's exchange; a weakened push loses nodes under
|
||||
# contention, observable as a drained-count mismatch AND as a
|
||||
# TSan-reported race. The default ASan/UBSan pass above
|
||||
# catches neither reliably - the race needs TSan's scheduling
|
||||
# to manifest - so this lane is the one that holds the
|
||||
# contract.
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
make clean
|
||||
CC=clang make all SANITIZER=thread
|
||||
|
||||
TSAN_OPTIONS=halt_on_error=1 ./mpsc_stack_test
|
||||
|
||||
- name: Run retro_spsc_test under Clang + ThreadSanitizer
|
||||
shell: bash
|
||||
working-directory: libretro-common/samples/queues/retro_spsc_test
|
||||
@@ -528,32 +398,6 @@ jobs:
|
||||
|
||||
TSAN_OPTIONS=halt_on_error=1 ./retro_spsc_test
|
||||
|
||||
- name: Run retro_eventcount_test under Clang + ThreadSanitizer
|
||||
shell: bash
|
||||
working-directory: libretro-common/samples/rthreads/retro_eventcount_test
|
||||
run: |
|
||||
# retro_eventcount parks a consumer without putting a lock on
|
||||
# the producer's fast path. What it can get wrong is a lost
|
||||
# wakeup: a notify that reads zero waiters while a consumer
|
||||
# that has not yet seen the new epoch is on its way into a
|
||||
# park. The guard is a seq_cst fence on both sides, and a
|
||||
# build with either fence weakened still passes on x86 TSO,
|
||||
# so the value checks alone prove nothing -- TSan is what
|
||||
# sees the missing barrier.
|
||||
#
|
||||
# 'make check' runs the address-wait backend and then the
|
||||
# condition-variable one, which is the backend macOS, the
|
||||
# BSDs and the console ports get. Both matter; only the
|
||||
# first is native here.
|
||||
#
|
||||
# The harness carries its own watchdog, so a genuine lost
|
||||
# wakeup fails the job in a minute instead of hanging it.
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
make clean
|
||||
CC=clang make check SANITIZER=thread
|
||||
|
||||
- name: Run crc32_test under Clang + ThreadSanitizer
|
||||
shell: bash
|
||||
working-directory: libretro-common/samples/encodings/crc32
|
||||
@@ -574,92 +418,6 @@ jobs:
|
||||
|
||||
TSAN_OPTIONS=halt_on_error=1 ./crc32_test
|
||||
|
||||
# memmap.h picks between libretro-common's mman shim and the
|
||||
# platform's own <sys/mman.h>, and Emscripten is the target where
|
||||
# that choice is load-bearing: its libc declares mmap with a 64-bit
|
||||
# off_t while the shim declares a 32-bit size_t, so a consumer that
|
||||
# sees both declarations fails to compile, and reserve/commit has no
|
||||
# meaning behind it at all - an anonymous mmap there allocates and
|
||||
# zeroes the whole length, and mprotect and madvise are no-ops.
|
||||
#
|
||||
# None of that is reachable from the native sweep above, which
|
||||
# compiles the sample with every Emscripten branch preprocessed
|
||||
# away. This lane is where the declarations are held to libc's.
|
||||
emscripten-memmap:
|
||||
name: Emscripten memmap ABI
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
env:
|
||||
# Pinned rather than floating: the job exists to hold a libc ABI,
|
||||
# so the toolchain it is held against changes deliberately.
|
||||
EM_VERSION: 5.0.1
|
||||
EM_CACHE_FOLDER: emsdk-cache
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Cache emsdk
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.EM_CACHE_FOLDER }}
|
||||
key: ${{ env.EM_VERSION }}-${{ runner.os }}
|
||||
|
||||
- name: Set up Emscripten
|
||||
uses: emscripten-core/setup-emsdk@v15
|
||||
with:
|
||||
version: ${{ env.EM_VERSION }}
|
||||
actions-cache-folder: ${{ env.EM_CACHE_FOLDER }}
|
||||
|
||||
- name: Run the memmap sample under node
|
||||
shell: bash
|
||||
working-directory: libretro-common/samples/memmap/emscripten_mmap
|
||||
run: |
|
||||
set -eu
|
||||
set -o pipefail
|
||||
# Fails to compile without the libc declaration; the mmap
|
||||
# assignment through an off_t-typed function pointer is the
|
||||
# discriminator. The mprotect / reserve / msync checks that
|
||||
# follow it cover the calls the same header choice hands to
|
||||
# libc.
|
||||
make clean
|
||||
make check-wasm
|
||||
|
||||
- name: Compile vfs_implementation.c with file mappings enabled
|
||||
shell: bash
|
||||
working-directory: libretro-common
|
||||
run: |
|
||||
set -eu
|
||||
set -o pipefail
|
||||
# The in-tree translation unit that includes memmap.h and
|
||||
# <sys/mman.h> together. Makefile.emscripten does not set
|
||||
# HAVE_MMAP today, so nothing else compiles this shape for
|
||||
# wasm - which is exactly why the two declarations can drift
|
||||
# apart unnoticed until a downstream consumer hits it.
|
||||
emcc -std=c89 -D_GNU_SOURCE -DHAVE_MMAP \
|
||||
-Wall -Wextra -Werror \
|
||||
-I include -c vfs/vfs_implementation.c \
|
||||
-o "$RUNNER_TEMP/vfs_implementation.o"
|
||||
|
||||
# Cross-architecture validation lane for retro_atomic_test.
|
||||
#
|
||||
# The samples job above runs on x86_64, which is a strongly-ordered
|
||||
@@ -690,44 +448,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
# clang ships on the stock ubuntu-latest image; apt is only
|
||||
# contacted if the image ever drops it.
|
||||
if dpkg -s clang >/dev/null 2>&1; then
|
||||
echo "clang already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
clang
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y clang
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build fuzz target
|
||||
shell: bash
|
||||
@@ -739,7 +465,6 @@ jobs:
|
||||
-fno-sanitize-recover=all \
|
||||
-I$LC/include -o config_file_fuzz config_file_fuzz.c \
|
||||
$LC/file/config_file.c \
|
||||
$LC/string/rstrtod.c \
|
||||
$LC/file/file_path.c \
|
||||
$LC/compat/compat_strl.c \
|
||||
$LC/compat/compat_strcasestr.c \
|
||||
@@ -793,38 +518,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
build-essential ${{ matrix.apt_pkgs }} qemu-user-static
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential ${{ matrix.apt_pkgs }} qemu-user-static
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build retro_atomic_test for ${{ matrix.arch }}
|
||||
working-directory: libretro-common/samples/atomic/retro_atomic_test
|
||||
@@ -928,38 +627,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
build-essential ${{ matrix.apt_pkgs }} qemu-user-static
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential ${{ matrix.apt_pkgs }} qemu-user-static
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build crc32_test for ${{ matrix.name }}
|
||||
working-directory: libretro-common/samples/encodings/crc32
|
||||
@@ -998,22 +671,3 @@ jobs:
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./vfs_mapped_ptr_test
|
||||
echo "[pass] vfs_mapped_ptr_test (MMAP=0, ASan)"
|
||||
|
||||
- name: Run vfs_v5_metadata_test against a copy_file_range that ignores len
|
||||
shell: bash
|
||||
working-directory: libretro-common/samples/file/vfs
|
||||
run: |
|
||||
set -eu
|
||||
# A sandboxed kernel (gVisor on some hosted runners) answers
|
||||
# copy_file_range by copying to EOF regardless of len. The
|
||||
# VFS must account the bytes, retire the kernel path for the
|
||||
# process, and finish the copy in place on the portable path.
|
||||
# FAKE_CFR=1 is the to-EOF case, FAKE_CFR=2 a partial overshoot
|
||||
# that leaves the copy part-way and has to be resumed.
|
||||
for mode in 1 2; do
|
||||
make clean >/dev/null
|
||||
make vfs_v5_metadata_test FAKE_CFR=$mode SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./vfs_v5_metadata_test
|
||||
echo "[pass] vfs_v5_metadata_test (FAKE_CFR=$mode, ASan)"
|
||||
done
|
||||
@@ -21,10 +21,6 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
libretro-common-tests:
|
||||
name: Build and run libretro-common/Makefile.test
|
||||
@@ -33,24 +29,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 8
|
||||
run: |
|
||||
# ffmpeg: tools/companion_thumbs_test.sh builds its video-hover
|
||||
# fixture (a 2 KB Baseline MP4) with it.
|
||||
pkgs="build-essential check pkg-config zlib1g-dev lcov gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 wine wine64 ffmpeg"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential check pkg-config \
|
||||
zlib1g-dev lcov \
|
||||
gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 wine wine64
|
||||
# mingw and wine are for the Windows A/W configuration matrix
|
||||
# in Makefile.test. libretro-common selects between the ANSI
|
||||
# and the wide Win32 entry points three ways and, until these
|
||||
@@ -64,25 +47,7 @@ jobs:
|
||||
# contributor's local run is not blocked.
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and run the unit test suites
|
||||
shell: bash
|
||||
@@ -98,12 +63,7 @@ jobs:
|
||||
# coverage, in order -- coverage files collide otherwise.
|
||||
# Any suite failing to build, or any check failing, or any
|
||||
# sanitizer report, fails the job.
|
||||
# 'unit-tests' by name: the default goal of Makefile.test is
|
||||
# win32-configs, so a bare make here builds the Windows A/W
|
||||
# matrix and none of the suites this step exists to run. The
|
||||
# 'all' target adds the concurrency and I/O samples, whose
|
||||
# runtime depends on how many processors the runner has.
|
||||
make -f Makefile.test unit-tests \
|
||||
make -f Makefile.test \
|
||||
LIBCHECK_CFLAGS="$(pkg-config --cflags check)" \
|
||||
CFLAGS="$(pkg-config --cflags check)"
|
||||
echo "[pass] libretro-common unit test suites"
|
||||
@@ -123,118 +83,6 @@ jobs:
|
||||
# free, on Linux.
|
||||
python3 tools/vfs_backend_parity.py
|
||||
|
||||
- name: Check companion backend feature parity
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -eu
|
||||
# The Qt, Win32 and Cocoa desktop companions share one C core
|
||||
# but each has its own presentation; a backend can quietly omit
|
||||
# a feature (no file browser, no scan, no core picker) and still
|
||||
# build and run, the gap only showing when a user switches
|
||||
# drivers. Source-level check, for free, on Linux.
|
||||
python3 tools/companion_parity.py
|
||||
|
||||
- name: Companion thumbnail engine regression test (plain, TSan, ASan)
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -eu
|
||||
# The shared thumbnail engine every desktop companion draws
|
||||
# through: real decoder, decode threads, cache, priority,
|
||||
# cancel, shutdown, and one hover on a video (the still and
|
||||
# the animation share one session). Under both sanitizers,
|
||||
# since it is the one piece of threaded code in the
|
||||
# companions.
|
||||
tools/companion_thumbs_test.sh
|
||||
tools/companion_thumbs_test.sh tsan
|
||||
tools/companion_thumbs_test.sh asan
|
||||
|
||||
- name: Companion core regression test (plain, ASan)
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -eu
|
||||
# The toolkit-free model every desktop companion drives:
|
||||
# playlist listing and All Playlists, the thumbnail path rule,
|
||||
# the file browser, the run / needs-core paths, launch
|
||||
# options - against real .lpl fixtures, with RetroArch's
|
||||
# state replaced by stubs.
|
||||
tools/companion_core_test.sh
|
||||
tools/companion_core_test.sh asan
|
||||
tools/companion_core_test.sh tsan
|
||||
|
||||
- name: C89 / Win32 syntax gate on the companion sources
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -eu
|
||||
# MSVC 2005 builds these as C89 through griffin. The gate's
|
||||
# second pass needs a 32-bit mingw for the Windows-only unit
|
||||
# (the host gcc has no <windows.h>, which used to make the
|
||||
# pass skip it silently - that is how mixed declarations
|
||||
# reached master).
|
||||
sudo apt-get install -y -qq gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 > /dev/null
|
||||
tools/mingw_syntax_check.sh ui/drivers/ui_win32_companion.c \
|
||||
ui/companion/companion_core.c ui/companion/companion_thumbs.c \
|
||||
ui/companion/companion_dock.c \
|
||||
gfx/gfx_anim_preview.c
|
||||
|
||||
- name: Cocoa companion regression harness (GNUstep AppKit, headless)
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -eu
|
||||
# The real ui/drivers/ui_cocoa_companion.m, compiled and linked
|
||||
# against GNUstep's Foundation + AppKit with the real companion
|
||||
# core and the core test's fixtures, driven under Xvfb the way a
|
||||
# user drives it (view popup, File Browser tab, close) and
|
||||
# checked on the AppKit objects themselves.
|
||||
sudo apt-get install -y -qq gobjc gnustep-devel gnustep-back-common xvfb > /dev/null
|
||||
tools/companion_cocoa_test.sh
|
||||
# ASan too: the grid's prefetch reaching past the thumbnail
|
||||
# marks only shows under a checking allocator (it crashed the
|
||||
# app on macOS, where Apple's is one).
|
||||
tools/companion_cocoa_test.sh asan
|
||||
|
||||
- name: Win32 companion regression harness (mingw + Wine, headless)
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
run: |
|
||||
set -eu
|
||||
# The real ui/drivers/ui_win32_companion.c, built with mingw and
|
||||
# linked with the real companion core and the core test's
|
||||
# fixtures, run under Wine on Xvfb and driven with the messages
|
||||
# the widgets send; checked on the real controls.
|
||||
sudo apt-get install -y -qq gcc-mingw-w64-x86-64 wine xvfb > /dev/null
|
||||
tools/companion_win32_test.sh
|
||||
|
||||
- name: WDM-KS ABI against the system ks.h
|
||||
shell: bash
|
||||
working-directory: samples/audio/wdmks_abi
|
||||
run: |
|
||||
set -eu
|
||||
# audio/common/wdmks_ks.h declares the kernel-streaming
|
||||
# interface the WDM-KS driver uses, because ks.h and
|
||||
# ksmedia.h ship with the driver kit rather than the
|
||||
# Platform SDK and not every toolchain here has them.
|
||||
#
|
||||
# That is only safe while what is declared matches what the
|
||||
# system declares. A wrong layout does not fail to build and
|
||||
# does not misbehave visibly: it hands the kernel a structure
|
||||
# whose fields are in the wrong places. So this compiles ours
|
||||
# beside the real headers and asserts every size, every field
|
||||
# offset, every constant and the IOCTL code, on both word
|
||||
# sizes, and in C89 as well as gnu99.
|
||||
#
|
||||
# It has already earned it. KSDATAFORMAT is a union with a
|
||||
# LONGLONG that aligns it to eight; declared as the plain
|
||||
# struct it resembles, KSDATARANGE_AUDIO came out 84 bytes
|
||||
# against 88 and every field past the first would have been
|
||||
# read four bytes off.
|
||||
make check
|
||||
echo "[pass] wdmks_abi"
|
||||
|
||||
- name: Check stack frame budget
|
||||
shell: bash
|
||||
working-directory: ${{ github.workspace }}
|
||||
|
||||
@@ -15,10 +15,6 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples:
|
||||
name: Build and run libretro-db/samples
|
||||
@@ -27,43 +23,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential zlib1g-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential zlib1g-dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and run samples
|
||||
shell: bash
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
name: CI Linux menu harness
|
||||
|
||||
# The menu playlist navigation harness links the SHIPPING RetroArch
|
||||
# objects with only main() replaced, so unlike every other sample it
|
||||
# needs a full build of the program before it can be built at all.
|
||||
#
|
||||
# That is why it lives in its own workflow rather than in
|
||||
# Linux-samples-tasks: a full build does not fit inside that job's
|
||||
# ten-minute budget, and putting it there cancelled the whole job -
|
||||
# every other sample with it - rather than just failing its own step.
|
||||
# Here it can take the time it needs without being able to take
|
||||
# anything else down with it.
|
||||
#
|
||||
# It also needs a NON-Qt build: with Qt enabled main() lives in
|
||||
# ui_qt.o and drags the entire Qt UI in with it.
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'menu/**'
|
||||
- 'playlist.c'
|
||||
- 'playlist.h'
|
||||
- 'tasks/task_content*'
|
||||
- 'samples/menu/playlist_nav/**'
|
||||
- '.github/workflows/Linux-menu-harness.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'menu/**'
|
||||
- 'playlist.c'
|
||||
- 'playlist.h'
|
||||
- 'tasks/task_content*'
|
||||
- 'samples/menu/playlist_nav/**'
|
||||
- '.github/workflows/Linux-menu-harness.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
menu-harness:
|
||||
name: Build and run the menu navigation harness
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 25
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential zlib1g-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Build RetroArch headless
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# The harness drives the menu with the null drivers, so
|
||||
# everything that draws or talks to the network is dead
|
||||
# weight here - and building it is the entire cost of this
|
||||
# workflow. Disabling it takes the build from roughly ten
|
||||
# minutes to about three, and avoids depending on graphics
|
||||
# packages the runner may or may not carry: configure found
|
||||
# X11 and xcb but not libX11-xcb, and the link failed on
|
||||
# -lX11-xcb.
|
||||
#
|
||||
# Qt in particular has to go: with it enabled main() lives
|
||||
# in ui_qt.o, and the harness replaces main().
|
||||
./configure --disable-qt --disable-x11 \
|
||||
--disable-opengl --disable-opengl_core \
|
||||
--disable-opengl1 --disable-vulkan \
|
||||
--disable-cheevos --disable-networking \
|
||||
--disable-ffmpeg
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Build and run content_closing_test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# The guard that keeps the frame loop out of a core being
|
||||
# torn down (core_run() refusing retro_run() while
|
||||
# content_closing is set) cannot fire in shipped code yet:
|
||||
# closing is still synchronous, so no frame runs during it.
|
||||
# It goes live in the change that first lets frames run
|
||||
# during a close, and if it is wrong the symptom is a call
|
||||
# into an unloaded dylib - so it is driven here directly,
|
||||
# against the real core_run() in a real frontend, rather
|
||||
# than going live untested.
|
||||
#
|
||||
# Shares the non-Qt build made above; adds about a second.
|
||||
samples/runloop/content_closing/build.sh
|
||||
./samples/runloop/content_closing/content_closing_test
|
||||
make -C samples/runloop/content_closing clean
|
||||
|
||||
- name: Build and run menu_playlist_nav_test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Four field reports came out of the seam between the
|
||||
# playlist reader and the menu - a stale playlist's entries
|
||||
# under a new heading, then a blank list the back button
|
||||
# could not leave, then a list that filled only after the
|
||||
# user pressed something, then #19427's placeholder flashing
|
||||
# on every completed read - and no oracle that stopped at
|
||||
# the reader could see any of them.
|
||||
#
|
||||
# The harness installs a VFS through the seam the frontend
|
||||
# uses for SAF, returning short reads WITH a per-read delay.
|
||||
# Short reads alone reproduce SAF's syscall count but not
|
||||
# its latency, and on local storage the whole playlist still
|
||||
# fits inside one budget slice - which is exactly why none
|
||||
# of the three reports reproduced on a desktop.
|
||||
samples/menu/playlist_nav/build.sh
|
||||
./samples/menu/playlist_nav/menu_playlist_nav_test
|
||||
make -C samples/menu/playlist_nav clean
|
||||
|
||||
- name: Hot function budget
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Code size and stack frame of the functions that run every
|
||||
# frame, against a checked-in reference: a change that doubles
|
||||
# either passes every lane in the suite and shows up only as a
|
||||
# slower frame on someone's machine. Uses the release objects
|
||||
# this job already built.
|
||||
.github/workflows/scripts/hot-function-budget.sh
|
||||
|
||||
- name: Build and run threaded_video_test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# The threaded video wrapper against the real runloop, on the
|
||||
# same non-Qt menu build: the runtime toggle, reinit under the
|
||||
# wrapper, the command mailbox, presenter repeats, and the
|
||||
# font init/free marshalling - the last of which is where a
|
||||
# deferred font free unbound the video thread's GL context on
|
||||
# X11 and left every frame after it black. This build has no
|
||||
# allocator sanitizer, so it is also the one job where the
|
||||
# frame-path heap lane runs: it counts heap calls over three
|
||||
# hundred frames, threaded and not, and the frame path makes
|
||||
# none.
|
||||
samples/gfx/threaded_video/build.sh
|
||||
./samples/gfx/threaded_video/threaded_video_test 3
|
||||
make -C samples/gfx/threaded_video clean
|
||||
@@ -1,91 +0,0 @@
|
||||
name: CI Linux pace shadow [debug harness]
|
||||
|
||||
# The pace decision - which sources hold the loop each iteration - is
|
||||
# one pure function, runloop_pace_decide() in runloop.h, that every
|
||||
# path of runloop_iterate() defers to. It began life shadowing the
|
||||
# paths' own scattered decisions with a debug assertion that the two
|
||||
# agreed; this job was created to run that assertion in CI, and it
|
||||
# never fired, which is what let the paths defer.
|
||||
#
|
||||
# What the job still does: builds with DEBUG=1 under ASan and UBSan,
|
||||
# so every retro_assert in the wrapper, the ring and the runloop is
|
||||
# live, and runs the threaded-video harness through it - threaded and
|
||||
# unthreaded, menu open and closed, display pacing on, the runtime
|
||||
# toggles - then the pacing sample, whose menu table pins the decision
|
||||
# row by row. The release harness job cannot see an assertion; this
|
||||
# one can.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
linux-pace-shadow:
|
||||
name: Debug build, harness with assertions live
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev xvfb x11-utils zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Configure
|
||||
# Non-Qt, as the harness requires (with Qt, main() lives in
|
||||
# ui_qt.o). Menu enabled: the menu lanes are half the point.
|
||||
run: |
|
||||
./configure \
|
||||
--disable-qt \
|
||||
--disable-discord \
|
||||
--disable-cheevos \
|
||||
--disable-networking \
|
||||
--disable-ffmpeg
|
||||
|
||||
- name: Build with DEBUG=1 and -fsanitize=address,undefined
|
||||
run: |
|
||||
make -j$(getconf _NPROCESSORS_ONLN) SANITIZER=address,undefined DEBUG=1
|
||||
|
||||
- name: Run the threaded-video harness with assertions live
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# SAN=address is the harness's default and links exactly the
|
||||
# build above; CYCLES=2 runs each toggling lane twice.
|
||||
SAN=address CYCLES=2 make -C samples/gfx/threaded_video check
|
||||
make -C samples/gfx/threaded_video clean
|
||||
|
||||
- name: Run the pacing sample (the menu table)
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
make -C samples/runloop/pacing check
|
||||
make -C samples/runloop/pacing clean
|
||||
@@ -1,75 +0,0 @@
|
||||
name: CI Linux Qt companion (persistence)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
qt-companion-persist:
|
||||
# Builds a Qt-enabled RetroArch with the null video/audio/input
|
||||
# drivers and runs tools/companion_qt_persist_test.sh: the desktop
|
||||
# companion's window geometry and dock layout must reach
|
||||
# retroarch.cfg when RetroArch quits with the companion window still
|
||||
# open, and a saved layout must restore and re-save identically.
|
||||
#
|
||||
# The shader stacks are disabled explicitly: with no OpenGL/Vulkan
|
||||
# dev packages on the runner this is a Qt build with NO shader stack
|
||||
# at all, and it links (the shader-preset editor and the companion
|
||||
# core's shader accessors are compiled out). That is deliberate - it
|
||||
# is the one configuration the other jobs never build.
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential pkg-config zlib1g-dev qt6-base-dev libgl-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --enable-qt --disable-x11 --disable-wayland \
|
||||
--disable-opengl --disable-opengles --disable-vulkan \
|
||||
--disable-sdl2 --disable-sdl --disable-alsa --disable-pulse \
|
||||
--disable-ffmpeg --disable-networking --disable-cheevos \
|
||||
--disable-discord --disable-cdrom --disable-flac --disable-mpv \
|
||||
--disable-libusb --disable-udev --disable-v4l2 --disable-freetype \
|
||||
--disable-caca --disable-sixel --disable-microphone --disable-ssl \
|
||||
--disable-bluetooth --disable-wifi --disable-oss --disable-jack \
|
||||
--disable-roar --disable-al --disable-xvideo --disable-kms \
|
||||
--disable-egl --disable-dispmanx --disable-videocore \
|
||||
--disable-crtswitchres --disable-update_cores --disable-hid \
|
||||
--disable-dbus --disable-glsl --disable-slang --disable-cg \
|
||||
--disable-glslang --disable-spirv_cross
|
||||
- name: Build
|
||||
run: make -j$(getconf _NPROCESSORS_ONLN)
|
||||
- name: Companion persistence regression
|
||||
timeout-minutes: 10
|
||||
run: tools/companion_qt_persist_test.sh
|
||||
@@ -1,893 +0,0 @@
|
||||
name: CI Linux samples/audio
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples-audio:
|
||||
name: Build and run samples/audio
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 25
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libasound2-dev libsdl2-dev libopenal-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Build and run mixer_lock_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/mixer_lock
|
||||
run: |
|
||||
set -eu
|
||||
# Includes audio/audio_driver.c and drives the mixer's public
|
||||
# entry points with a real state lock in place. The lock is a
|
||||
# plain mutex, so any path that reaches a locking entry point
|
||||
# while already holding it parks the thread against itself;
|
||||
# loading the first menu sound did exactly that
|
||||
# (libretro/RetroArch#19485). Every case runs on a watchdog:
|
||||
# a reintroduced recursive acquisition aborts with a stack
|
||||
# instead of hanging the job. Also covers the lock being
|
||||
# released on out-of-range slots and a NULL stream name
|
||||
# surviving removal.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x mixer_lock_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./mixer_lock_test
|
||||
echo "[pass] mixer_lock_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 300 ./mixer_lock_test
|
||||
echo "[pass] mixer_lock_test (TSan)"
|
||||
|
||||
- name: Build and run thread_handshake_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/thread_handshake
|
||||
run: |
|
||||
set -eu
|
||||
# Links audio/audio_thread_wrapper.c against a scripted
|
||||
# driver. The wrapped thread parks in one of two waits and
|
||||
# the main thread's block() needs stopped_ack from either; a
|
||||
# stop() landing between start()'s signal and the thread's
|
||||
# re-check used to leave it in the one wait that never
|
||||
# acknowledged. Two thousand start/stop round-trips hit that
|
||||
# window on the previous wrapper on every run. The scripted
|
||||
# device can also stop returning from a call: a stop must
|
||||
# then still complete once the call does, and must be
|
||||
# reported exactly once meanwhile - prompt handshakes are
|
||||
# asserted not to be reported.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x thread_handshake_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 300 \
|
||||
./thread_handshake_test
|
||||
echo "[pass] thread_handshake_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 600 ./thread_handshake_test
|
||||
echo "[pass] thread_handshake_test (TSan)"
|
||||
|
||||
- name: Build and run graph_clock_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/graph_clock
|
||||
run: |
|
||||
set -eu
|
||||
# The two conversions the JACK and PipeWire clock fits add.
|
||||
# Neither a JACK server nor a PipeWire daemon can be started
|
||||
# here, so unlike alsa_clock this mirrors the arithmetic
|
||||
# rather than driving the drivers - a weaker check, said
|
||||
# plainly, and aimed at the parts where being wrong is
|
||||
# silent.
|
||||
#
|
||||
# JACK's current_frames is 32 bits and wraps in about a day
|
||||
# at 48 kHz, sooner if the server was up before RetroArch
|
||||
# started, since the counter is the server's. The difference
|
||||
# is taken in 32 bits where the wrap cancels; widening first
|
||||
# turns one wrap into a four-billion-frame jump. A run is
|
||||
# started two seconds short of the wrap so it goes round
|
||||
# mid-measurement.
|
||||
#
|
||||
# PipeWire's ticks are in units of pw_time.rate, a fraction
|
||||
# that is 1/samplerate. The same physical drift has to read
|
||||
# the same ppm at 44.1k and 48k, which is what the fraction
|
||||
# is there for.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x graph_clock_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./graph_clock_test
|
||||
echo "[pass] graph_clock_test (ASan)"
|
||||
|
||||
- name: Build and run alsa_clock_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/alsa_clock
|
||||
run: |
|
||||
set -eu
|
||||
# The ALSA device-clock estimate, driving the shipping
|
||||
# audio/drivers/alsa.c on a real PCM opened on the null
|
||||
# device. The four libasound calls the estimate is built from
|
||||
# are scripted via --wrap, so a device can be made to run at a
|
||||
# chosen offset and the driver's own answer read back out of
|
||||
# what it logs - what is asserted is the line a user sees.
|
||||
#
|
||||
# Two clocks are covered. The audio timestamp, where a driver
|
||||
# counts one, is the DMA or link clock compared straight
|
||||
# against the system clock and needs neither a rate nor a
|
||||
# delay. Where there is none - the null PCM reports none, and
|
||||
# nor do plenty of real devices - the position is fitted
|
||||
# against the timestamp it was taken with. That position is
|
||||
# inferred from the write count less the delay, so one case
|
||||
# puts an absurd but constant delay in: it shifts the line
|
||||
# and leaves its slope alone, which is why this is a fit and
|
||||
# not a difference of two samples.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x alsa_clock_test
|
||||
ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./alsa_clock_test
|
||||
echo "[pass] alsa_clock_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
timeout 60 ./alsa_clock_test
|
||||
echo "[pass] alsa_clock_test (TSan)"
|
||||
|
||||
- name: Build and run alsa_wait_writable_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/alsa_wait_writable
|
||||
run: |
|
||||
set -eu
|
||||
# Links the shipping audio/drivers/alsa.c and interposes the
|
||||
# five libasound calls alsa_wait_writable() makes via
|
||||
# -Wl,--wrap, so the devices no stock PCM can produce on
|
||||
# demand are scripted: a running stream whose poll never
|
||||
# signals, a prepared stream reporting no space, a start that
|
||||
# lands in an underrun storm, and wakes that never deliver
|
||||
# space. Each must return 0 within a bounded lap and wall-time
|
||||
# budget rather than parking the audio thread; the previous
|
||||
# wait was an unbounded snd_pcm_wait(-1). The conforming path
|
||||
# runs end-to-end on the null PCM, and the harness skips
|
||||
# cleanly if no ALSA configuration is available at all.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x alsa_wait_writable_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./alsa_wait_writable_test
|
||||
echo "[pass] alsa_wait_writable_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 300 ./alsa_wait_writable_test
|
||||
echo "[pass] alsa_wait_writable_test (TSan)"
|
||||
|
||||
- name: Build and run alsa_lifecycle_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/alsa_lifecycle
|
||||
run: |
|
||||
set -eu
|
||||
# Links the shipping audio/drivers/alsa.c against the null PCM
|
||||
# and scripts the libasound calls that decide stop/start and
|
||||
# the blocking write - can_pause, pause, drop, prepare, writei,
|
||||
# wait, recover - via -Wl,--wrap. alive() must follow stop()
|
||||
# and start() on a device that can pause, one that cannot, and
|
||||
# one that says it can and refuses; the blocking write must
|
||||
# write first, wait only on EAGAIN, and never without a bound.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x alsa_lifecycle_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./alsa_lifecycle_test
|
||||
echo "[pass] alsa_lifecycle_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 300 ./alsa_lifecycle_test
|
||||
echo "[pass] alsa_lifecycle_test (TSan)"
|
||||
|
||||
- name: Build and run pipeline_stall_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/pipeline_stall
|
||||
run: |
|
||||
set -eu
|
||||
# Includes audio/audio_driver.c and runs the threaded pipeline's
|
||||
# shipping producer and consumer against a scripted driver whose
|
||||
# write_raw() path reaches the device without the resampler or
|
||||
# the arenas. The device is then made to stop taking audio. The
|
||||
# consumer must take nothing from the ring it cannot deliver and
|
||||
# report no progress it did not make; the producer must record
|
||||
# the stall after one bounded wait and drop at once thereafter;
|
||||
# and both must recover when the device returns. The previous
|
||||
# consumer took the chunk first, threw it away on finding no
|
||||
# room, and cleared the stall - the frontend paced at one frame
|
||||
# per failed pass for as long as the device was stuck.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x pipeline_stall_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 180 \
|
||||
./pipeline_stall_test
|
||||
echo "[pass] pipeline_stall_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 400 ./pipeline_stall_test
|
||||
echo "[pass] pipeline_stall_test (TSan)"
|
||||
|
||||
- name: Build and run upmix_test (plain, ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/upmix
|
||||
run: |
|
||||
set -eu
|
||||
# The stereo-to-wider stage at the last step before a device
|
||||
# opened with a wider speaker layout. A layout is a mask of
|
||||
# positions in ascending bit order, never a count: 5.1 with
|
||||
# the rear pair at the back and 5.1 with it at the sides are
|
||||
# two layouts whose slots differ. The fronts carry the stereo
|
||||
# unchanged, the rear pair -3 dB in its own slots, the centre
|
||||
# the -6 dB sum, the LFE the bass through a 120 Hz low-pass and
|
||||
# none of the treble; stereo is a copy; a mask the stage
|
||||
# cannot fill is refused.
|
||||
make clean && make -j$(nproc) all
|
||||
./upmix_test
|
||||
echo "[pass] upmix_test"
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./upmix_test
|
||||
echo "[pass] upmix_test (ASan)"
|
||||
|
||||
- name: Build and run discrete_multichannel_test (plain, ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/discrete_multichannel
|
||||
run: |
|
||||
set -eu
|
||||
# A core's 5.1 through the multi-channel batch entry to a 5.1
|
||||
# device without the fold and the upmix in between: each
|
||||
# device channel carries its core channel's tone and none of
|
||||
# the others', in all four format pairings, through the
|
||||
# resampler off unity; over the threaded ring; recorded; and
|
||||
# to a stereo device, the fold at the BS.775 gains with the
|
||||
# LFE dropped. The last case runs the shipping WASAPI driver
|
||||
# over the fake device from wasapi_exclusive_pacing, so a
|
||||
# 5.1 core reaches a Dolby Digital decoder as AC-3 bursts
|
||||
# that decode back to its own channels. Includes the
|
||||
# shipping audio_driver.c.
|
||||
make clean && make -j$(nproc) all
|
||||
./discrete_multichannel_test
|
||||
echo "[pass] discrete_multichannel_test"
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./discrete_multichannel_test
|
||||
echo "[pass] discrete_multichannel_test (ASan)"
|
||||
|
||||
- name: Build and run embedded_alsa_test (the embedded ALSA driver, mock kernel device)
|
||||
shell: bash
|
||||
working-directory: samples/audio/embedded_alsa
|
||||
run: |
|
||||
set -eu
|
||||
# The "tinyalsa" driver in audio/drivers/alsa.c talks the
|
||||
# kernel PCM ioctls directly. abi_check compares its copy of
|
||||
# that ABI - extracted from the driver itself, so it cannot
|
||||
# go stale - against <sound/asound.h>: every struct size and
|
||||
# offset, constant and ioctl number. The test then runs the
|
||||
# driver against a mock device that refines parameters the
|
||||
# way the kernel does.
|
||||
make clean && make -j$(nproc) check
|
||||
echo "[pass] embedded_alsa_test"
|
||||
make clean && make -j$(nproc) check SANITIZER=address,undefined
|
||||
echo "[pass] embedded_alsa_test (ASan)"
|
||||
|
||||
- name: Build and run ealsa_test (the embedded ALSA driver against a mock PCM device)
|
||||
shell: bash
|
||||
working-directory: samples/audio/ealsa
|
||||
run: |
|
||||
set -eu
|
||||
# The embedded driver in audio/drivers/alsa.c talks to the
|
||||
# kernel's PCM ABI through one seam - open, ioctl, close,
|
||||
# poll - so a scripted device that answers the way a card
|
||||
# does runs it with no card present, and can refuse a rate, a
|
||||
# format, a channel count or a period grid, which is where a
|
||||
# negotiation goes wrong. Built with HAVE_TINYALSA alone, so
|
||||
# the build never sees an alsa-lib header either. It also
|
||||
# carries what tinyalsa_write_test used to check of the
|
||||
# driver this one replaced: a full device refusing in both
|
||||
# modes, a device that never signals, a poll cut short by a
|
||||
# signal, and the first write reporting what it took.
|
||||
make clean && make -j$(nproc) all
|
||||
./ealsa_test
|
||||
echo "[pass] ealsa_test"
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./ealsa_test
|
||||
echo "[pass] ealsa_test (ASan)"
|
||||
|
||||
- name: Build and run bitstream_test (plain, ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/bitstream
|
||||
run: |
|
||||
set -eu
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq ffmpeg
|
||||
# audio/audio_bitstream.c: a coded stream on its way to a
|
||||
# receiver, which the PCM pipeline has no place for. Real
|
||||
# DTS and AC-3 from ffmpeg, handed over frame by frame:
|
||||
# bursts leave whole and never partial, the queue paces the
|
||||
# source rather than the source running ahead, a gap
|
||||
# produces the pause burst the standard has for it rather
|
||||
# than silence (which makes a receiver drop its lock), and
|
||||
# the PCM frames reported are the device time the bytes
|
||||
# occupy.
|
||||
make clean && make -j$(nproc) all
|
||||
./bitstream_test
|
||||
echo "[pass] bitstream_test"
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./bitstream_test
|
||||
echo "[pass] bitstream_test (ASan)"
|
||||
|
||||
- name: Build and run opensl_test (the Android driver against a mock OpenSL player)
|
||||
shell: bash
|
||||
working-directory: samples/audio/opensl
|
||||
run: |
|
||||
set -eu
|
||||
# audio/drivers/opensl.c is Android-only and has no build
|
||||
# here, so it is built against stand-in <SLES/*.h> over a
|
||||
# scripted player whose queue a thread drains: the block
|
||||
# arithmetic at the latencies of issue #6405 and below, the
|
||||
# queue accounting the hang there came from, float and
|
||||
# 16-bit, a full queue, and a device that stops consuming.
|
||||
make clean && make -j$(nproc) all
|
||||
./opensl_test
|
||||
echo "[pass] opensl_test"
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./opensl_test
|
||||
echo "[pass] opensl_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 ./opensl_test
|
||||
echo "[pass] opensl_test (TSan)"
|
||||
|
||||
- name: Build and run qsa_test (the QNX driver against a mock QSA device)
|
||||
shell: bash
|
||||
working-directory: samples/audio/qsa
|
||||
run: |
|
||||
set -eu
|
||||
# audio/drivers/alsa_qsa.c is QNX-only and has no build here,
|
||||
# so it is built against a stand-in <sys/asoundlib.h> over a
|
||||
# scripted device: init and its failure path, the rate it
|
||||
# reports back, blocking and non-blocking writes, stop and
|
||||
# start, underrun recovery, and a device that stops draining.
|
||||
# Not a substitute for a QNX build; it is the coverage the
|
||||
# driver had none of.
|
||||
make clean && make -j$(nproc) all
|
||||
./qsa_test
|
||||
echo "[pass] qsa_test"
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./qsa_test
|
||||
echo "[pass] qsa_test (ASan)"
|
||||
|
||||
- name: Build and run live_drivers_test (a live PulseAudio server, a null ALSA PCM)
|
||||
shell: bash
|
||||
working-directory: samples/audio/live_drivers
|
||||
run: |
|
||||
set -eu
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq libasound2-dev libpulse-dev pulseaudio
|
||||
# A server with a null sink, and an ALSA config naming a null
|
||||
# PCM: the real drivers against the real libraries, no
|
||||
# hardware. Pulse's telemetry is cached from the server
|
||||
# thread's callbacks; ALSA is run once as the device reports
|
||||
# itself and once told it cannot pause, the fallback from
|
||||
# snd_pcm_pause to snd_pcm_drop.
|
||||
export XDG_RUNTIME_DIR=/tmp/xdg
|
||||
mkdir -p "$XDG_RUNTIME_DIR/pulse"
|
||||
printf 'pcm.nullpcm { type null }\n' > "$HOME/.asoundrc"
|
||||
pulseaudio --daemonize=no --exit-idle-time=-1 --disallow-exit -n \
|
||||
-L "module-null-sink sink_name=nullsink rate=48000 channels=2" \
|
||||
-L "module-native-protocol-unix auth-anonymous=1 socket=$XDG_RUNTIME_DIR/pulse/native" \
|
||||
--log-target=file:/tmp/pa.log &
|
||||
PA_PID=$!
|
||||
sleep 3
|
||||
make clean && make -j$(nproc) all
|
||||
./live_drivers_test
|
||||
echo "[pass] live_drivers_test"
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./live_drivers_test
|
||||
echo "[pass] live_drivers_test (ASan)"
|
||||
kill $PA_PID || true
|
||||
|
||||
- name: Build and run binaural_test (plain, ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/binaural
|
||||
run: |
|
||||
set -eu
|
||||
# A layout rendered to two ears for headphones: a left speaker
|
||||
# arrives at the left ear first, louder and brighter; the rear
|
||||
# pair duller than the front; centre and LFE alike to both
|
||||
# ears; a centred source keeps its level and a full-scale one
|
||||
# leaves at full scale; the two 5.1s render their rear pair
|
||||
# from different directions; stereo is a mild crossfeed.
|
||||
make clean && make -j$(nproc) all
|
||||
./binaural_test
|
||||
echo "[pass] binaural_test"
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./binaural_test
|
||||
echo "[pass] binaural_test (ASan)"
|
||||
|
||||
- name: Build and run pipeline_rate_control_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/pipeline_rate_control
|
||||
run: |
|
||||
set -eu
|
||||
# Includes audio/audio_driver.c and runs the threaded pipeline's
|
||||
# shipping producer, consumer and rate controller against a
|
||||
# device whose 8 ms buffer drains at exactly 48000 frames a
|
||||
# second of wall-clock time, fed one 800-frame video frame every
|
||||
# 1/60 s on an absolute schedule, audio sync off. The clocks
|
||||
# match, so the right ratio is 1.0: after a four-second settle
|
||||
# the mean rate adjustment over three seconds must be within
|
||||
# 500 ppm of it, and the device must have taken 99.5% of what
|
||||
# was produced. Rate control on the pipeline samples pipe and
|
||||
# device together, at the producer; reading the device alone,
|
||||
# which the consumer holds between half and full, pins the
|
||||
# ratio at a bound and the pipe overflows behind it. Real time,
|
||||
# so a loaded runner can shift the mean; the tolerance is ten
|
||||
# times the settled residual.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x pipeline_rate_control_test
|
||||
ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./pipeline_rate_control_test
|
||||
echo "[pass] pipeline_rate_control_test (ASan)"
|
||||
# A core late by 60 ms every 2 s, audio sync off: the silence is
|
||||
# the stalls' own and no more, the late audio is not kept, and
|
||||
# rate control is not pinned against a backlog. And with sync on:
|
||||
# the writer waits, nothing is dropped.
|
||||
ASAN_OPTIONS=detect_leaks=0 timeout 120 ./pipeline_rate_control_test 12 4 jitter
|
||||
ASAN_OPTIONS=detect_leaks=0 timeout 120 ./pipeline_rate_control_test 12 4 sync-jitter
|
||||
echo "[pass] pipeline_rate_control_test (late core, ASan)"
|
||||
# The 64 ms default buffer, sync off, a steady core and a late one:
|
||||
# the consumer's chunks are whole publishes and the pipe's fill
|
||||
# swings by one with the phase; nothing is dropped from a steady
|
||||
# core at any phase.
|
||||
ASAN_OPTIONS=detect_leaks=0 timeout 120 ./pipeline_rate_control_test 16 4 big
|
||||
ASAN_OPTIONS=detect_leaks=0 timeout 120 ./pipeline_rate_control_test 16 4 big-jitter
|
||||
echo "[pass] pipeline_rate_control_test (64 ms device, ASan)"
|
||||
# The producer held 4 ms every five seconds, as a loaded runner
|
||||
# holds it: a publish pushed across a sink window boundary. The
|
||||
# estimate must settle and apply about zero, not the shift.
|
||||
ASAN_OPTIONS=detect_leaks=0 timeout 120 ./pipeline_rate_control_test 16 4 big-stall
|
||||
echo "[pass] pipeline_rate_control_test (stalled producer, ASan)"
|
||||
# A float core on a float ring into a float device: a signal a
|
||||
# tenth of an int16 LSB high arrives as published, not as zero.
|
||||
ASAN_OPTIONS=detect_leaks=0 timeout 120 ./pipeline_rate_control_test 16 4 float
|
||||
echo "[pass] pipeline_rate_control_test (float core, ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 240 ./pipeline_rate_control_test
|
||||
echo "[pass] pipeline_rate_control_test (TSan)"
|
||||
|
||||
- name: Build and run resampler_reset_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/resampler_reset
|
||||
run: |
|
||||
set -eu
|
||||
# Every resampler backend's reset(): after it the stream
|
||||
# continues as a freshly initialised backend would, to the
|
||||
# sample, at the ratios the frontend meets - and the reset
|
||||
# makes no allocation, counted through wrapped malloc, calloc
|
||||
# and memalign_alloc.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x resampler_reset_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 ./resampler_reset_test
|
||||
echo "[pass] resampler_reset_test (ASan)"
|
||||
|
||||
- name: Build and run ff_speedup_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/ff_speedup
|
||||
run: |
|
||||
set -eu
|
||||
# Includes audio/audio_driver.c with the clock replaced by a
|
||||
# counter. The fast-forward speedup multiplier must follow the
|
||||
# core's cadence on both pipelines: measured at the flush inline,
|
||||
# and by the producer at its publish cadence on the threaded
|
||||
# pipeline, where the consumer's own flush interval is the device
|
||||
# draining the previous chunk and would only confirm the previous
|
||||
# multiplier. Re-entry after an idle spell must start from unity
|
||||
# rather than read the idle time as one flush interval.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x ff_speedup_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 120 ./ff_speedup_test
|
||||
echo "[pass] ff_speedup_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 120 ./ff_speedup_test
|
||||
echo "[pass] ff_speedup_test (TSan)"
|
||||
|
||||
- name: Build and run device_list_driver_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/device_list_driver
|
||||
run: |
|
||||
set -eu
|
||||
# Includes audio/audio_driver.c with the alsa and null drivers in
|
||||
# the table. Picking a driver in the menu writes the setting but
|
||||
# does not reinitialise audio, and the Device list - rebuilt on
|
||||
# each open - was asked of the running driver, so it showed the
|
||||
# old driver's devices under the new driver's name until a
|
||||
# restart. The list now comes from the configured driver, and
|
||||
# is freed by the driver that built it. Cases: configured and
|
||||
# running agree; configured differs from running; back again;
|
||||
# nothing running; and release by the builder, once.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x device_list_driver_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./device_list_driver_test
|
||||
echo "[pass] device_list_driver_test (ASan)"
|
||||
|
||||
- name: Build and run rate_control_bounds_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/rate_control_bounds
|
||||
run: |
|
||||
set -eu
|
||||
# Includes audio/audio_driver.c and runs the rate control's
|
||||
# shipping computation against a scripted driver. At the
|
||||
# setpoint, empty and full it must give 1.0 and the band's two
|
||||
# edges; with write_avail() reporting five times buffer_size()
|
||||
# it must give the upper edge and no more. Before the clamp an
|
||||
# over-reporting driver drove it nine times past the band.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x rate_control_bounds_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./rate_control_bounds_test
|
||||
echo "[pass] rate_control_bounds_test (ASan)"
|
||||
|
||||
- name: Build and run latency_contract_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/latency_contract
|
||||
run: |
|
||||
set -eu
|
||||
# Real drivers on backends that need no hardware - the ALSA null
|
||||
# PCM, SDL's dummy audio, OpenAL Soft's null device - opened at
|
||||
# 64 and 32 ms and checked against audio_driver.h's contract:
|
||||
# buffer_size() is the setting in bytes of the output format,
|
||||
# write_avail() never exceeds it, a buffer's worth offered takes
|
||||
# room, and the room comes back as the device plays. The sdl
|
||||
# driver before fdda5f7 reports 42.7 ms against 64 here.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x latency_contract_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./latency_contract_test
|
||||
echo "[pass] latency_contract_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1:suppressions=$PWD/tsan.supp \
|
||||
timeout 300 ./latency_contract_test
|
||||
echo "[pass] latency_contract_test (TSan)"
|
||||
|
||||
- name: Build and run asio_convert_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/asio_convert
|
||||
run: |
|
||||
set -eu
|
||||
# audio/drivers/asio_convert.h is the ASIO driver's sample
|
||||
# conversion, pure C, so it runs here without Windows. Every
|
||||
# ASIOSampleType the specification defines is converted for full
|
||||
# scale, zero, half and one 16-bit step in both signs and checked
|
||||
# byte for byte against the layout the specification gives - the
|
||||
# Int32LSB16..24 family as low-aligned, sign-extended words, the
|
||||
# MSB types big-endian. Saturation and the silence fill past the
|
||||
# supplied frames are checked too. The converter this replaced
|
||||
# wrote five types and memset the rest to silence.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x asio_convert_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./asio_convert_test
|
||||
echo "[pass] asio_convert_test (ASan)"
|
||||
|
||||
- name: Build and run coreaudio_clock_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/coreaudio_clock
|
||||
run: |
|
||||
set -eu
|
||||
# The device clock fitted from the timestamp the render
|
||||
# callback is handed, which the driver used to discard.
|
||||
#
|
||||
# The fit is the same shape as the ASIO one and is checked
|
||||
# there. What is different is the time axis: mHostTime is in
|
||||
# mach absolute units, not nanoseconds, and the ratio is one
|
||||
# to one on Intel and 125 to 3 on Apple silicon. Ignoring it
|
||||
# reads a 48 kHz device as 1152 Hz - invisible on Intel and
|
||||
# wrong on every Mac since 2020 - so the same clock is driven
|
||||
# through both timebases here.
|
||||
#
|
||||
# Also mRateScalar, which is the HAL's own figure for the
|
||||
# same thing, read only where it is flagged valid.
|
||||
#
|
||||
# Arithmetic only, so it runs here without a Mac.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x coreaudio_clock_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./coreaudio_clock_test
|
||||
echo "[pass] coreaudio_clock_test (ASan)"
|
||||
|
||||
- name: Build and run coreaudio_ring_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/coreaudio_ring
|
||||
run: |
|
||||
set -eu
|
||||
# The CoreAudio ring keeps a frame's channels together. Its
|
||||
# capacity is the sample count rounded up to a power of two,
|
||||
# which for six channels is not a whole number of frames, so
|
||||
# the cursors wrap mid-frame - and that does not matter,
|
||||
# because a FIFO returns samples in the order they went in
|
||||
# wherever they sit. This runs the traffic for every layout,
|
||||
# then forces every transfer across the wrap, to keep that
|
||||
# answer honest rather than assumed.
|
||||
#
|
||||
# What does rotate the channels is a transfer whose count is
|
||||
# not a whole number of frames, which is why the callback
|
||||
# trims short reads. The last case does that on purpose and
|
||||
# fails if it goes unnoticed, so the trim has a guard.
|
||||
#
|
||||
# Arithmetic only, so it runs here without a Mac.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x coreaudio_ring_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./coreaudio_ring_test
|
||||
echo "[pass] coreaudio_ring_test (ASan)"
|
||||
|
||||
- name: Build and run asio_clock_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/asio_clock
|
||||
run: |
|
||||
set -eu
|
||||
# The device clock read from the driver's own time
|
||||
# information, rather than from when its callbacks arrived.
|
||||
#
|
||||
# Two things here do not need an interface. The ASIOTime
|
||||
# layout is an ABI: the sample position and system time are
|
||||
# 64-bit values the SDK splits into 32-bit halves on Windows,
|
||||
# and getting that wrong does not fail to build, it reads a
|
||||
# driver's numbers as garbage in a real-time callback. The
|
||||
# offsets are asserted against the SDK's, and asio.c carries
|
||||
# the same assertions for the compiler that sees the real
|
||||
# Windows ABI.
|
||||
#
|
||||
# And the estimate itself: a clock at a known offset is fed
|
||||
# in with scheduling jitter on the timestamps, and the answer
|
||||
# has to be the clock. A two-point estimate fails that - the
|
||||
# anchor's own noise divided by the window reads as drift,
|
||||
# 50 ppm for half a millisecond at ten seconds - which is why
|
||||
# it is a least-squares fit over every callback instead.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x asio_clock_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./asio_clock_test
|
||||
echo "[pass] asio_clock_test (ASan)"
|
||||
|
||||
- name: Build and run asio_ring_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/asio_ring
|
||||
run: |
|
||||
set -eu
|
||||
# Also the write's frame alignment: the callback reads the
|
||||
# ring a frame at a time, so a write must end on one, and
|
||||
# the rule is checked for every layout the driver can open.
|
||||
#
|
||||
# audio/drivers/asio_ring.h sizes the ring in front of the ASIO
|
||||
# device: the latency setting less the device's reported stage,
|
||||
# floored at four periods where that is under 6 ms, 6 ms where it
|
||||
# is over, two periods at the least. Arithmetic only, so it runs
|
||||
# here without Windows. The expected frames are worked by hand
|
||||
# from those rules for the devices that set them - ASIO4ALL at 64
|
||||
# frames, a wrapper locked at 528, a USB DAC at 8 and 128 - and
|
||||
# the two points where the rules meet.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x asio_ring_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./asio_ring_test
|
||||
echo "[pass] asio_ring_test (ASan)"
|
||||
|
||||
- name: Build and run dsound_pump_test (MinGW, under wine)
|
||||
shell: bash
|
||||
working-directory: samples/audio/dsound_pump
|
||||
run: |
|
||||
set -eu
|
||||
# audio/drivers/dsound.c end to end on wine's DirectSound, fed
|
||||
# by an ALSA null PCM, which plays at real-time pace on a
|
||||
# runner with no sound card. Pins that the pump - which now
|
||||
# waits for the play cursor to move the distance it needs,
|
||||
# worked out from the rate, instead of retrying every
|
||||
# millisecond - still moves audio through blocking writes,
|
||||
# fills silence when the writer stops, and lets free() return
|
||||
# at once while it waits.
|
||||
if ! command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1 \
|
||||
|| ! command -v wine >/dev/null 2>&1; then
|
||||
sudo apt-get install -y -qq gcc-mingw-w64-x86-64 wine64 \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30
|
||||
fi
|
||||
printf 'pcm.!default { type null }\nctl.!default { type hw card 0 }\n' > ~/.asoundrc
|
||||
make clean all
|
||||
WINEDEBUG=-all timeout 300 make check
|
||||
echo "[pass] dsound_pump_test (wine)"
|
||||
|
||||
- name: Build and run wasapi_exclusive_pacing_test (ASan + UBSan, then TSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/wasapi_exclusive_pacing
|
||||
run: |
|
||||
set -eu
|
||||
# audio/drivers/wasapi.c, unmodified but for its Windows include
|
||||
# lines, against a fake device on a real-time clock: exclusive
|
||||
# and event-driven, one period per endpoint buffer, every period
|
||||
# taken or counted unanswered. The writer is a frontend with audio
|
||||
# sync off: one frame of core audio per non-blocking write, no rate
|
||||
# control. Passes when no period goes unanswered in either mode and
|
||||
# nothing is dropped once the buffer holds a frame. Before the pump
|
||||
# thread and the drain-first shared write this run gave 3-10% of
|
||||
# periods unanswered; the first smaller-period attempt without the
|
||||
# pump gave 75%.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x wasapi_exclusive_pacing_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 120 \
|
||||
./wasapi_exclusive_pacing_test 3
|
||||
echo "[pass] wasapi_exclusive_pacing_test (ASan)"
|
||||
make clean && make -j$(nproc) all SANITIZER=thread
|
||||
timeout 180 ./wasapi_exclusive_pacing_test 3
|
||||
echo "[pass] wasapi_exclusive_pacing_test (TSan)"
|
||||
|
||||
- name: Build and run sink_rate_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/audio/sink_rate
|
||||
run: |
|
||||
set -eu
|
||||
# The frontend's sink rate estimator against a scripted driver
|
||||
# on a synthetic clock: a device 120 ppm fast and 80 ppm slow are
|
||||
# measured and the resampling bias converges onto them; 5000 ppm
|
||||
# stops at the clamp; with rate control on the bias absorbs rate
|
||||
# control's mean adjustment; a paused window, a count that went
|
||||
# backwards, and a stalled window move nothing; disabled, nothing
|
||||
# moves at all.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x sink_rate_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 ./sink_rate_test
|
||||
echo "[pass] sink_rate_test (ASan)"
|
||||
|
||||
- name: Build and run pacing_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/runloop/pacing
|
||||
run: |
|
||||
set -eu
|
||||
# The three pacing decisions the runloop makes every
|
||||
# iteration, run from runloop.h so this is the shipping code
|
||||
# rather than a copy of it. The gap limiter over all 128
|
||||
# combinations of the pace bits by nonblocking by fastmotion -
|
||||
# exactly one may engage, because engaging next to another
|
||||
# source double-paces and engaging under fast-forward
|
||||
# throttles it to 1x, and both look like performance bugs
|
||||
# rather than pacing bugs. The frame period over the rates a
|
||||
# core can report including zero and a million, bounded and
|
||||
# monotonic. And the filter on the measured loop rate, which
|
||||
# has to reject a stall: one 0.9 s sample used to pull a 60
|
||||
# fps reading to 8 and take several frames to recover.
|
||||
make clean && make -j$(nproc) all SANITIZER=address,undefined
|
||||
test -x pacing_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 ./pacing_test
|
||||
echo "[pass] pacing_test (ASan)"
|
||||
|
||||
- name: Build the ALSA objects through configure (--enable-alsa)
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# The harnesses above compile audio/drivers/alsa.c with
|
||||
# -DHAVE_ALSA on the command line. A distribution build takes
|
||||
# HAVE_ALSA from config.h instead, and the file gates its
|
||||
# alsa-lib includes on it, so build the objects that way too:
|
||||
# configure with ALSA on, then compile them. That covers the
|
||||
# object a distribution ships as well as the ones the
|
||||
# harnesses build (libretro/RetroArch#19525). The embedded
|
||||
# driver takes its define the same way and shares the file,
|
||||
# so the arrangements below cover it too.
|
||||
./configure --enable-alsa --disable-qt --disable-ffmpeg \
|
||||
--disable-x11 --disable-wayland
|
||||
grep -q '^HAVE_ALSA = 1' config.mk
|
||||
make obj-unix/release/audio/drivers/alsa.o \
|
||||
obj-unix/release/audio/common/alsa.o
|
||||
echo "[pass] alsa-lib alone, through configure"
|
||||
|
||||
# The embedded driver is in the same file behind its own
|
||||
# define, and configure puts HAVE_TINYALSA in config.h as
|
||||
# well as on the command line - so it has the same question
|
||||
# to answer as HAVE_ALSA did, and one object serves both
|
||||
# drivers. The two arrangements a distribution can ask for:
|
||||
# the embedded driver with no alsa-lib anywhere, and both in
|
||||
# the one object.
|
||||
rm -f obj-unix/release/audio/drivers/alsa.o
|
||||
./configure --enable-tinyalsa --disable-alsa --disable-qt \
|
||||
--disable-ffmpeg --disable-x11 --disable-wayland
|
||||
grep -q '^HAVE_TINYALSA = 1' config.mk
|
||||
grep -q '^HAVE_ALSA = 0' config.mk
|
||||
make obj-unix/release/audio/drivers/alsa.o
|
||||
echo "[pass] the embedded driver alone, through configure"
|
||||
|
||||
rm -f obj-unix/release/audio/drivers/alsa.o \
|
||||
obj-unix/release/audio/common/alsa.o
|
||||
./configure --enable-alsa --enable-tinyalsa --disable-qt \
|
||||
--disable-ffmpeg --disable-x11 --disable-wayland
|
||||
grep -q '^HAVE_TINYALSA = 1' config.mk
|
||||
grep -q '^HAVE_ALSA = 1' config.mk
|
||||
make obj-unix/release/audio/drivers/alsa.o \
|
||||
obj-unix/release/audio/common/alsa.o
|
||||
echo "[pass] both drivers in the one object, through configure"
|
||||
|
||||
- name: Build and run stretch and native SRC chain (C89, ASan + UBSan)
|
||||
working-directory: samples/audio/stretch
|
||||
run: |
|
||||
make -j$(nproc) check SANITIZER=address,undefined
|
||||
|
||||
- name: Build and run WSOLA kernel tests (C89, ASan + UBSan)
|
||||
working-directory: samples/audio/wsola_search
|
||||
run: |
|
||||
make -j$(nproc) check SANITIZER=address,undefined
|
||||
|
||||
- name: Build and run native speed LPF tests (C89, ASan + UBSan)
|
||||
working-directory: samples/audio/speed_lpf
|
||||
run: make check SANITIZER=address,undefined
|
||||
|
||||
- name: Build and run experimental sinc HQ tests (C89, ASan + UBSan)
|
||||
working-directory: samples/audio/sinc_hq
|
||||
run: |
|
||||
make -j$(nproc) check SANITIZER=address,undefined
|
||||
|
||||
- name: Build and run sinc AVX tests (C89, ASan + UBSan)
|
||||
working-directory: samples/audio/sinc_hq
|
||||
run: |
|
||||
if grep -qw avx /proc/cpuinfo; then
|
||||
make clean
|
||||
make -j$(nproc) check CC="gcc -mavx" SANITIZER=address,undefined
|
||||
else
|
||||
echo "AVX unavailable on this runner; scalar/SSE tests ran above."
|
||||
fi
|
||||
|
||||
- name: Build and run extra-channel capacity test (ASan + UBSan)
|
||||
working-directory: samples/audio/extra_capacity
|
||||
run: |
|
||||
make -j$(nproc) check SANITIZER=address,undefined
|
||||
make clean
|
||||
make -j$(nproc) check SIMD_MASK=RESAMPLER_SIMD_SSE SANITIZER=address,undefined
|
||||
|
||||
- name: Build and run resampler option tests (C89, ASan + UBSan)
|
||||
working-directory: samples/audio/resampler_options
|
||||
run: |
|
||||
make -j$(nproc) check SANITIZER=address,undefined
|
||||
@@ -1,170 +0,0 @@
|
||||
name: CI Linux samples/cores
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'cores/libretro-ffmpeg/**'
|
||||
- 'libretro-common/queues/**'
|
||||
- 'libretro-common/include/retro_spsc.h'
|
||||
- 'libretro-common/include/retro_atomic.h'
|
||||
- 'samples/cores/**'
|
||||
- '.github/workflows/Linux-samples-cores.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'cores/libretro-ffmpeg/**'
|
||||
- 'libretro-common/queues/**'
|
||||
- 'libretro-common/include/retro_spsc.h'
|
||||
- 'libretro-common/include/retro_atomic.h'
|
||||
- 'samples/cores/**'
|
||||
- '.github/workflows/Linux-samples-cores.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples-cores:
|
||||
name: Build and run samples/cores
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 25
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential pkg-config ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Build and run camera ffmpeg_live_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/camera/ffmpeg_live
|
||||
run: |
|
||||
set -eu
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq libavdevice-dev libavfilter-dev
|
||||
# The camera driver against lavfi: built with its input
|
||||
# format set to libavfilter, a filter graph is the device and
|
||||
# the whole pipeline runs with no camera attached - avformat
|
||||
# opens the source, the poll thread reads, the decoder
|
||||
# decodes, swscale converts and poll() takes the frame out
|
||||
# under the buffer's lock.
|
||||
#
|
||||
# The cases are the ones the threading has to get right and
|
||||
# that no eyeball on a webcam would show: start and stop
|
||||
# repeatedly, stop while the thread is mid-frame, free
|
||||
# without stopping, poll before starting, and a source that
|
||||
# does not exist.
|
||||
make clean all
|
||||
./ffmpeg_live_test
|
||||
echo "[pass] ffmpeg_live_test"
|
||||
make clean all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
timeout 600 ./ffmpeg_live_test
|
||||
echo "[pass] ffmpeg_live_test (ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1:suppressions=../../cores/ffmpeg_audio_pipe/tsan.supp \
|
||||
timeout 600 ./ffmpeg_live_test
|
||||
echo "[pass] ffmpeg_live_test (TSan)"
|
||||
|
||||
- name: Build and run ffmpeg_sweep_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/cores/ffmpeg_sweep
|
||||
run: |
|
||||
set -eu
|
||||
# Breadth where ffmpeg_audio_pipe_test has depth: eight clips
|
||||
# across containers, video and audio codecs, rates, channel
|
||||
# counts and the one-sided cases, each loaded, run, seeked
|
||||
# both ways, reset and unloaded in one process - so the
|
||||
# second load is what finds what the first unload left
|
||||
# behind - then files that are truncated, stubbed, noise,
|
||||
# empty or absent, then teardown while the decode thread is
|
||||
# still working.
|
||||
#
|
||||
# Leak detection off: libavutil's HW-device probing keeps a
|
||||
# few objects, as the audio-pipe lane already has it. The
|
||||
# libav* TSan suppressions are the same ones and for the
|
||||
# same reason.
|
||||
make clean all
|
||||
./ffmpeg_sweep_test
|
||||
echo "[pass] ffmpeg_sweep_test"
|
||||
make clean all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 900 ./ffmpeg_sweep_test
|
||||
echo "[pass] ffmpeg_sweep_test (ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1:suppressions=../ffmpeg_audio_pipe/tsan.supp \
|
||||
timeout 900 ./ffmpeg_sweep_test
|
||||
echo "[pass] ffmpeg_sweep_test (TSan)"
|
||||
|
||||
- name: Build and run ffmpeg_audio_pipe_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/cores/ffmpeg_audio_pipe
|
||||
run: |
|
||||
set -eu
|
||||
# cores/libretro-ffmpeg/ffmpeg_core.c as a libretro host would
|
||||
# drive it: a generated clip (tone under a test pattern), 5 s
|
||||
# of frames checked for the audio frame count and a tone in
|
||||
# every batch, then R1/L1 seeks both ways - the decode-thread
|
||||
# / main-thread handshake around the audio ring - and a
|
||||
# teardown mid-stream, all on a watchdog. Needs the ffmpeg
|
||||
# CLI to generate the clip. Leak detection off: libavutil's
|
||||
# own HW-device probing allocates and keeps a few objects.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x ffmpeg_audio_pipe_test
|
||||
ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 300 \
|
||||
./ffmpeg_audio_pipe_test
|
||||
echo "[pass] ffmpeg_audio_pipe_test (ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
# The libav* libraries are uninstrumented, so TSan cannot see
|
||||
# the atomics that order an AVBufferRef's reference count and
|
||||
# reports the allocation and the release as a race. Only
|
||||
# those libraries are suppressed; a race in the core's own
|
||||
# code is still reported.
|
||||
TSAN_OPTIONS=halt_on_error=1:suppressions=tsan.supp \
|
||||
timeout 300 ./ffmpeg_audio_pipe_test
|
||||
echo "[pass] ffmpeg_audio_pipe_test (TSan)"
|
||||
@@ -15,10 +15,6 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples-formats:
|
||||
name: Build and run samples/formats
|
||||
@@ -27,80 +23,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential ffmpeg"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Build and run dts_lpcm_test (plain, ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/formats/dts_lpcm
|
||||
run: |
|
||||
set -eu
|
||||
# The DTS frame layer and the LPCM codec against ffmpeg.
|
||||
#
|
||||
# rdts reads frames, it does not decode them, so what is
|
||||
# checked is that every frame is found where ffmpeg's
|
||||
# encoder put it, that the rate and the arrangement agree
|
||||
# with ffprobe's reading of the same file, and that a stream
|
||||
# byte-swapped or packed fourteen bits to the word reads
|
||||
# back to the same core - which is what a receiver and a
|
||||
# decoder are handed.
|
||||
#
|
||||
# rlpcm does decode, and is bit-exact: the samples go out
|
||||
# through ffmpeg's own converters and come back the same, at
|
||||
# 16 and 24 bits and both byte orders, and what rlpcm writes
|
||||
# back is the bytes it read. 20-bit has no ffmpeg format to
|
||||
# compare against - two samples to five bytes is a disc
|
||||
# packing - so it is checked against itself, and the DVD and
|
||||
# Blu-ray headers against their field layouts. The
|
||||
# audio_transfer arm is driven too: chunked reads against
|
||||
# the codec's own output, the compressed frontier, and
|
||||
# seeks, which for constant-size frames land exactly.
|
||||
#
|
||||
# And the pass-through route, which is what a format with no
|
||||
# decoder is for: every frame repacked to the plain core,
|
||||
# put in the IEC 61937 burst its sample count calls for, and
|
||||
# read back out of that burst byte for byte.
|
||||
make clean all
|
||||
./dts_lpcm_test
|
||||
echo "[pass] dts_lpcm_test"
|
||||
make clean all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./dts_lpcm_test
|
||||
echo "[pass] dts_lpcm_test (ASan)"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and run image_decode_fuzz_test (ASan + UBSan + LSan)
|
||||
shell: bash
|
||||
@@ -140,68 +68,3 @@ jobs:
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
timeout 120 ./image_decode_fuzz_test
|
||||
echo "[pass] image_decode_fuzz_test"
|
||||
|
||||
- name: Build and run image_avail_test (ASan + UBSan + LSan)
|
||||
shell: bash
|
||||
working-directory: samples/formats/image_avail
|
||||
run: |
|
||||
set -eu
|
||||
# Partial-buffer ("avail-aware") still decoding for TGA and
|
||||
# BMP, checked
|
||||
# against the whole-buffer decode that has always been
|
||||
# there: every fixture is decoded once with the file fully
|
||||
# resident and again with the frontier raised a few bytes at
|
||||
# a time, and the two surfaces must be bit-identical.
|
||||
#
|
||||
# The oracle is the decoder itself, so this catches the
|
||||
# failures that do not crash: a wall mistaken for EOF (the
|
||||
# decode pads the rest of the surface and reports success),
|
||||
# an RLE run re-emitted after a stall, a cursor resumed off
|
||||
# by a pixel. It found all three of those on its first runs
|
||||
# while TGA was being converted.
|
||||
#
|
||||
# BMP rows are bottom-up, so a prefix of the file is the
|
||||
# bottom of the image and a stall resumed on the wrong row
|
||||
# shows up as a vertically displaced surface rather than as
|
||||
# noise. The 4bpp and 8bpp fixtures put the wall inside the
|
||||
# palette as well.
|
||||
#
|
||||
# Steps of 1, 3 and 7 bytes put the wall inside every field,
|
||||
# inside RLE packets and mid-pixel for both 24bpp and 32bpp;
|
||||
# 1024 is a realistic read granularity. A truncated file
|
||||
# must still settle rather than wait forever, which is the
|
||||
# one case where stopping at the frontier and stopping at
|
||||
# the end of the data have to be told apart.
|
||||
#
|
||||
# One set of checks replays task_image's real call sequence
|
||||
# rather than an order this test invented - set_buffer_ptr,
|
||||
# then set_avail BEFORE each process(), then set_avail
|
||||
# ((size_t)-1) the instant the read completes, which for a
|
||||
# small file is before any process() has run - at four read
|
||||
# granularities. Inventing the order instead of replaying
|
||||
# it is exactly how the blank-BMP/TGA-thumbnail regression
|
||||
# got past this file: every other check here raised the
|
||||
# frontier only after the first process() call.
|
||||
#
|
||||
# One set of checks drives every avail-aware still decoder -
|
||||
# PNG and JPEG as well as TGA and BMP - through the
|
||||
# image_transfer facade in task_image's order. PNG, JPEG,
|
||||
# WEBM and MP4 clamp the requested frontier in the size
|
||||
# domain because their set_buf_ptr is given the buffer
|
||||
# length; rtga's and rbmp's are not, which is why those two
|
||||
# were the only ones that could turn (size_t)-1 into a
|
||||
# wrapped pointer, and did. A sixth avail-aware decoder
|
||||
# inherits whichever shape it copies, so the check lives
|
||||
# here rather than in anyone's memory.
|
||||
#
|
||||
# It also checks header_ready, the gate the task layer uses
|
||||
# to start a decode early, against the decoder itself: every
|
||||
# prefix it accepts must be one the decoder can actually
|
||||
# begin on, it must accept before the whole file has arrived
|
||||
# (or partial decoding is silently off), and it must be
|
||||
# monotonic in the prefix length.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x image_avail_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
timeout 120 ./image_avail_test
|
||||
echo "[pass] image_avail_test"
|
||||
@@ -15,215 +15,21 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
surface-requirements:
|
||||
name: Producers ask the surface layer
|
||||
samples-gfx:
|
||||
name: Build and run samples/gfx
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Self-test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# A producer outside the allowlist that reads the video flags
|
||||
# directly must be caught, and so must an entry whose file has
|
||||
# stopped reading them - the second is what makes the list
|
||||
# shrink as producers migrate instead of sitting there.
|
||||
python3 tools/surface_requirements_check.py --selftest
|
||||
|
||||
- name: Tree check
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# What a producer should emit is the surface layer's answer
|
||||
# (gfx_surface_query_requirements), so a decoder has one place
|
||||
# to ask rather than three unrelated flags to know about. The
|
||||
# files still asking directly are listed in the checker and
|
||||
# are migrated one at a time; a new one may not join them.
|
||||
python3 tools/surface_requirements_check.py
|
||||
|
||||
samples-gfx:
|
||||
name: Build and run samples/gfx
|
||||
runs-on: ubuntu-latest
|
||||
# The gfx_thumbnail_preview step alone is ~5 min: two sanitizer
|
||||
# builds, the video harness under each, and the windowed-animation
|
||||
# harness under ASan over ~70 MB of lossless frames. 20 was cut
|
||||
# too close once the animation harness joined; the run was
|
||||
# cancelled mid-TSan pass.
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libx11-dev libxrandr-dev libdrm-dev"
|
||||
pkgs="$pkgs xserver-xorg-core xserver-xorg-video-dummy x11-xserver-utils libsdl2-dev libxinerama-dev"
|
||||
pkgs="$pkgs gcc-mingw-w64-x86-64 wine64 openbox cmake ninja-build"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential \
|
||||
libx11-dev libxrandr-dev libdrm-dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Video modeline engine goldens and C89 lane
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# The engine in gfx/modeline/ replaced the SwitchRes 2.2.1
|
||||
# library; tools/modeline_gold.ref is the reference output of
|
||||
# the same matrix run through that library. The scoring and
|
||||
# timing arithmetic are compared bit-for-bit: any drift in
|
||||
# modeline_create/compare/adjust, the presets or the list
|
||||
# logic shows up here as a diff rather than as a CRT that
|
||||
# loses sync in the field.
|
||||
C89="-std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long"
|
||||
C89="$C89 -Werror=declaration-after-statement -Wno-variadic-macros"
|
||||
C89="$C89 -D_GNU_SOURCE"
|
||||
INC="-Ilibretro-common/include -I. -Ideps"
|
||||
# Binaries and outputs go to a scratch dir, never the tree.
|
||||
T=$(mktemp -d)
|
||||
gcc $C89 $INC tools/modeline_gold.c \
|
||||
libretro-common/compat/compat_strl.c -lm -o "$T/modeline_gold"
|
||||
"$T/modeline_gold" > "$T/modeline_gold.out"
|
||||
diff -u tools/modeline_gold.ref "$T/modeline_gold.out"
|
||||
echo "[pass] modeline goldens (C89)"
|
||||
gcc -g -O1 -fsanitize=address,undefined -fno-sanitize-recover=all \
|
||||
-std=gnu89 -D_GNU_SOURCE $INC tools/modeline_gold.c \
|
||||
libretro-common/compat/compat_strl.c -lm -o "$T/modeline_gold_san"
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
"$T/modeline_gold_san" > "$T/modeline_gold_san.out"
|
||||
diff -u tools/modeline_gold.ref "$T/modeline_gold_san.out"
|
||||
echo "[pass] modeline goldens (ASan/UBSan)"
|
||||
rm -rf "$T"
|
||||
# The consumer and the X11 apply path are C89 too; the
|
||||
# full C89_BUILD covers them only after a complete build.
|
||||
DEF="-DRARCH_INTERNAL -DHAVE_THREADS -DHAVE_MENU -DHAVE_MODELINE"
|
||||
DEF="$DEF -DHAVE_X11 -DHAVE_XRANDR -DHAVE_CONFIGFILE -DHAVE_DYNAMIC"
|
||||
for f in gfx/modeline/modeline_core.c \
|
||||
gfx/modeline/modeline_monitor.c \
|
||||
gfx/modeline/modeline_list.c \
|
||||
gfx/modeline/modeline_ini.c \
|
||||
gfx/video_crt_switch.c \
|
||||
gfx/display_servers/dispserv_x11.c; do
|
||||
gcc $C89 $INC $DEF -c "$f" -o /dev/null
|
||||
done
|
||||
echo "[pass] modeline C89 syntax check"
|
||||
|
||||
- name: Atomic backend portability of the gfx sources
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# The gfx sources that use retro_atomic.h have to build on
|
||||
# every backend, not just the one this host selects. The
|
||||
# extended operations (exchange, CAS, the pointer ops) are
|
||||
# offered only where a backend can express them, so a caller
|
||||
# that uses one without gating on it builds here and breaks
|
||||
# on whichever console lands elsewhere; the counters have to
|
||||
# stay warning-clean as statements, which an expression-form
|
||||
# fetch_add is not. Both have reached a console lane before
|
||||
# this one, hence -Werror.
|
||||
INC="-Ilibretro-common/include -I. -Ideps"
|
||||
DEF="-DRARCH_INTERNAL -DHAVE_THREADS -DHAVE_MENU -DHAVE_RGUI"
|
||||
DEF="$DEF -DHAVE_CONFIGFILE -DHAVE_CHEATS -D_GNU_SOURCE"
|
||||
DEF="$DEF -DRETRO_ATOMIC_SUPPRESS_WARNING"
|
||||
# The PS2 backend needs ps2sdk's <kernel.h>; the sample under
|
||||
# libretro-common/samples/atomic carries a stand-in for it.
|
||||
PS2STUB="libretro-common/samples/atomic/retro_atomic_ps2_backend"
|
||||
for backend in C11 GCC_NEW SYNC PS2 VOLATILE; do
|
||||
EXTRA=""
|
||||
if [ "$backend" = "PS2" ]; then EXTRA="-I$PS2STUB/ps2stub"; fi
|
||||
for f in gfx/video_thread_wrapper.c \
|
||||
gfx/font_driver.c \
|
||||
gfx/gfx_thumbnail.c \
|
||||
libretro-common/queues/task_queue.c; do
|
||||
gcc -std=gnu99 -O2 -Wall -Werror $INC $EXTRA $DEF \
|
||||
"-DRETRO_ATOMIC_FORCE_$backend" -c "$f" -o /dev/null
|
||||
done
|
||||
echo "[pass] RETRO_ATOMIC_FORCE_$backend"
|
||||
done
|
||||
echo "[pass] atomic backend portability"
|
||||
|
||||
- name: Build and run vblank_clock_ddraw_test (MinGW, under wine)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/vblank_clock_ddraw
|
||||
run: |
|
||||
set -eu
|
||||
# Scanline Sync's Windows 2000/XP tier against a real DirectDraw
|
||||
# (wine's, which reports the counter as an XDDM driver does):
|
||||
# GetScanLine readings into vblank_sampler_feed and the vblank
|
||||
# clock, and the clock's beam checked against GetScanLine.
|
||||
if ! command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1 \
|
||||
|| ! command -v wine >/dev/null 2>&1 \
|
||||
|| ! command -v xvfb-run >/dev/null 2>&1; then
|
||||
sudo apt-get install -y -qq gcc-mingw-w64-x86-64 wine64 xvfb \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30
|
||||
fi
|
||||
make clean all
|
||||
WINEDEBUG=-all timeout 300 xvfb-run -a -s "-screen 0 1280x1024x24" make check
|
||||
echo "[pass] vblank_clock_ddraw_test (wine)"
|
||||
|
||||
- name: Build and run vblank_clock_test and vblank_clock_pub_test (C89, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/vblank_clock
|
||||
run: |
|
||||
set -eu
|
||||
# gfx/common/vblank_clock.h: the arithmetic Scanline Sync on
|
||||
# Windows uses in place of polling D3DKMTGetScanLine - a clock
|
||||
# fed vblank timestamps from a waiter that only ever wakes
|
||||
# late, and the beam position it implies. Against 50 simulated
|
||||
# displays up to 600 ppm off their nominal rate: no beam
|
||||
# before it settles, beam and wait landing within 6 lines,
|
||||
# missed and duplicate vblanks, a stale clock, and variable
|
||||
# refresh never reported.
|
||||
make clean all SANITIZER=address,undefined
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 timeout 60 ./vblank_clock_test
|
||||
echo "[pass] vblank_clock_test"
|
||||
# The seqlock handing the clock from the kernel-event thread to
|
||||
# the frame thread: one writer publishing flat out, three
|
||||
# readers checking every snapshot is one whole publish and
|
||||
# none goes backwards - under ASan+UBSan, then TSan, which
|
||||
# also checks the pattern is free of formal data races.
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 timeout 120 ./vblank_clock_pub_test
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 300 ./vblank_clock_pub_test
|
||||
echo "[pass] vblank_clock_pub_test (ASan, TSan)"
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build and run vulkan_extension_count_test (ASan)
|
||||
shell: bash
|
||||
@@ -335,42 +141,6 @@ jobs:
|
||||
timeout 60 ./slang_texture_index_bounds_test
|
||||
echo "[pass] slang_texture_index_bounds_test"
|
||||
|
||||
- name: Build and run shader_dir_cycle_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/shader_dir_cycle
|
||||
run: |
|
||||
set -eu
|
||||
# Which folder the Next/Previous Shader hotkeys cycle, over a
|
||||
# shader tree built on disk, with gfx/video_shader_parse.c
|
||||
# compiled for real and only the frontend stubbed.
|
||||
#
|
||||
# The folder is chosen from the loaded preset, and the cases
|
||||
# that decide it are all shapes the menu itself writes:
|
||||
# retroarch.slangp and the core auto preset are simple
|
||||
# presets (#reference), so they stand in for what they point
|
||||
# at, while a preset the user loaded as itself anchors where
|
||||
# it sits however it is written - "Save Preset As" emits a
|
||||
# #reference too, and following those would cycle a preset's
|
||||
# source folder instead of the folder it was saved into.
|
||||
#
|
||||
# Two orderings are what this pins. Following a reference
|
||||
# one hop further than the wrapper puts the cycling in a
|
||||
# folder the user never loaded from; and re-deriving the
|
||||
# anchor from a preset the hotkey itself just applied walks
|
||||
# back to whatever that preset references, so an entry that
|
||||
# is a simple preset traps the cycling on the pair forever.
|
||||
# The setting is also toggled mid-run: the list is built
|
||||
# under one value and must be dropped when it changes, or
|
||||
# turning it on never leaves the root it was cycling.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x shader_dir_cycle_test
|
||||
# The tree is built under a scratch dir, never in the repo.
|
||||
T=$(mktemp -d)
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
timeout 60 ./shader_dir_cycle_test "$T"
|
||||
rm -rf "${T:?}"
|
||||
echo "[pass] shader_dir_cycle_test"
|
||||
|
||||
- name: Build and run vulkan_mailbox_init_leak_test (ASan + LSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/vulkan_mailbox_init_leak
|
||||
@@ -601,20 +371,6 @@ jobs:
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 120 \
|
||||
./gfx_widgets_sanitize_test
|
||||
echo "[pass] gfx_widgets_sanitize_test (TSan)"
|
||||
- name: Build and run gfx_widgets_task_bar_stack_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/gfx_widgets_task_bar_stack
|
||||
run: |
|
||||
set -eu
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x gfx_widgets_task_bar_stack_test
|
||||
ASAN_OPTIONS=detect_leaks=1 timeout 120 \
|
||||
./gfx_widgets_task_bar_stack_test
|
||||
echo "[pass] gfx_widgets_task_bar_stack_test (ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 120 \
|
||||
./gfx_widgets_task_bar_stack_test
|
||||
echo "[pass] gfx_widgets_task_bar_stack_test (TSan)"
|
||||
- name: Build and run display_servers_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/display_servers
|
||||
@@ -652,100 +408,6 @@ jobs:
|
||||
timeout 60 ./display_servers_test
|
||||
echo "[pass] display_servers_test"
|
||||
|
||||
- name: Live mode switching on an Xorg dummy server (X11 + SDL)
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# The stubbed display_servers_test proves the driver issues
|
||||
# the right RandR calls; this proves a real X server accepts
|
||||
# them. Xorg's 'dummy' driver honours XRRCreateMode /
|
||||
# XRRAddOutputMode / XRRSetCrtcConfig with arbitrary timings
|
||||
# (Xvfb's RandR shim returns success and lists nothing, so it
|
||||
# cannot stand in). The X11 sample runs the modeline engine
|
||||
# end to end - generate a 15 kHz timing, put it on the wire
|
||||
# through dispserv_x11, read the crtc back and compare every
|
||||
# field, switch again, restore - and the SDL sample switches
|
||||
# a real SDL2 window among the listed modes through
|
||||
# dispserv_sdl2 (and dispserv_sdl3 on an SDL3 build), for the
|
||||
# modeline path and the menu picker.
|
||||
# The Win32 build runs after them under Wine.
|
||||
sudo Xorg :99 -config samples/gfx/display_servers_x11_live/xorg-dummy.conf \
|
||||
-logfile /tmp/xorg-dummy.log -noreset -nolisten tcp -ac \
|
||||
> /tmp/xorg-dummy.out 2>&1 &
|
||||
XORG_PID=$!
|
||||
for i in $(seq 1 30); do
|
||||
DISPLAY=:99 xrandr >/dev/null 2>&1 && break
|
||||
sleep 0.5
|
||||
done
|
||||
DISPLAY=:99 xrandr | head -3
|
||||
export DISPLAY=:99
|
||||
# SDL3's X11 backend makes a window fullscreen through the
|
||||
# window manager and reverts the mode switch when none
|
||||
# answers; a light one runs for the SDL samples.
|
||||
openbox > /tmp/openbox.out 2>&1 &
|
||||
sleep 1
|
||||
(cd samples/gfx/display_servers_x11_live \
|
||||
&& make clean all SANITIZER=address,undefined \
|
||||
&& ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
timeout 120 ./display_servers_x11_live_test)
|
||||
echo "[pass] display_servers_x11_live_test"
|
||||
(cd samples/gfx/display_servers_sdl2_live \
|
||||
&& make clean all SANITIZER=address,undefined \
|
||||
&& ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
LSAN_OPTIONS=suppressions=lsan.supp \
|
||||
timeout 120 ./display_servers_sdl2_live_test)
|
||||
echo "[pass] display_servers_sdl2_live_test"
|
||||
# The SDL3 server against an SDL3 built from a pinned release
|
||||
# (the runner image ships no libsdl3-dev): video and events
|
||||
# only, X11 backend.
|
||||
SDL3_VER=3.2.20
|
||||
if [ ! -f /opt/sdl3/lib/pkgconfig/sdl3.pc ]; then
|
||||
curl -sL -o /tmp/sdl3.tar.gz \
|
||||
"https://github.com/libsdl-org/SDL/releases/download/release-$SDL3_VER/SDL3-$SDL3_VER.tar.gz"
|
||||
tar -C /tmp -xzf /tmp/sdl3.tar.gz
|
||||
cmake -S "/tmp/SDL3-$SDL3_VER" -B /tmp/sdl3-build -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release -DSDL_SHARED=ON -DSDL_STATIC=OFF \
|
||||
-DSDL_TESTS=OFF -DSDL_EXAMPLES=OFF -DSDL_AUDIO=OFF -DSDL_CAMERA=OFF \
|
||||
-DSDL_WAYLAND=OFF -DSDL_X11=ON -DSDL_OPENGL=OFF -DSDL_OPENGLES=OFF \
|
||||
-DSDL_VULKAN=OFF -DSDL_RENDER=OFF -DCMAKE_INSTALL_PREFIX=/opt/sdl3 \
|
||||
> /tmp/sdl3-cmake.log
|
||||
ninja -C /tmp/sdl3-build > /tmp/sdl3-build.log
|
||||
sudo ninja -C /tmp/sdl3-build install > /tmp/sdl3-install.log
|
||||
fi
|
||||
(cd samples/gfx/display_servers_sdl3_live \
|
||||
&& PKG_CONFIG_PATH=/opt/sdl3/lib/pkgconfig make clean all SANITIZER=address,undefined \
|
||||
&& LD_LIBRARY_PATH=/opt/sdl3/lib \
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
LSAN_OPTIONS=suppressions=lsan.supp \
|
||||
timeout 120 ./display_servers_sdl3_live_test)
|
||||
echo "[pass] display_servers_sdl3_live_test"
|
||||
# The Win32 server, its vendor timing paths and the engine
|
||||
# cross-built with mingw-w64 and run under Wine on the same
|
||||
# display: Wine backs EnumDisplaySettingsExA and
|
||||
# ChangeDisplaySettingsExA with the server's RandR modes, so
|
||||
# the CDS listed-mode switch is real; ADL, ATI legacy and
|
||||
# PowerStrip are linked and must decline.
|
||||
(cd samples/gfx/display_servers_win32_live \
|
||||
&& make clean all \
|
||||
&& WINEDEBUG=-all timeout 300 wine ./display_servers_win32_live_test.exe)
|
||||
echo "[pass] display_servers_win32_live_test (Wine)"
|
||||
# The vendor timing paths against stand-ins: a mock
|
||||
# atiadlxx.dll that re-plugs the monitor after a forced set,
|
||||
# a scratch HKLM key for the ATI legacy registry layout, a
|
||||
# TPShidden window answering PowerStrip's messages.
|
||||
(cd samples/gfx/display_servers_win32_vendor \
|
||||
&& make clean all \
|
||||
&& WINEDEBUG=-all timeout 300 wine ./display_servers_win32_vendor_test.exe)
|
||||
echo "[pass] display_servers_win32_vendor_test (Wine)"
|
||||
# The server must be back on its desktop mode with nothing
|
||||
# generated left behind.
|
||||
xrandr | head -3
|
||||
if xrandr | grep -q 'RA-'; then
|
||||
echo "generated modes left on the server"; exit 1
|
||||
fi
|
||||
pkill openbox || true
|
||||
sudo kill "$XORG_PID" || true
|
||||
|
||||
- name: Build and run display_servers_kms_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/display_servers_kms
|
||||
@@ -782,26 +444,6 @@ jobs:
|
||||
timeout 60 ./display_servers_kms_test
|
||||
echo "[pass] display_servers_kms_test"
|
||||
|
||||
- name: Build and run modeline_edid_parse_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/modeline_edid_parse
|
||||
run: |
|
||||
set -eu
|
||||
# The EDID reader in gfx/modeline/modeline_edid.c, fed the
|
||||
# block the writer produces (round trip), a hand-built EDID
|
||||
# 1.4 with CTA-861 and DisplayID 2.0 extensions checked
|
||||
# field by field, the defect cases (short, wrong header, bad
|
||||
# checksums, a declared but missing extension, data block
|
||||
# and section lengths running past their block), and a
|
||||
# deterministic byte-noise sweep. The parser is handed
|
||||
# whatever an OS reader returns, so every length and offset
|
||||
# in the data is hostile; under ASan a read past the buffer
|
||||
# is the failure this lane exists to catch.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x modeline_edid_parse_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
timeout 60 ./modeline_edid_parse_test
|
||||
|
||||
- name: Build and run gfx_thumbnail_anim_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/gfx_thumbnail_anim
|
||||
@@ -855,174 +497,3 @@ jobs:
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 120 \
|
||||
./gfx_thumbnail_anim_test
|
||||
echo "[pass] gfx_thumbnail_anim_test (TSan)"
|
||||
|
||||
- name: Build and run badge_cache_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/cheevos/badge_cache
|
||||
run: |
|
||||
set -eu
|
||||
# rcheevos_get_badge_texture() never reads, decodes or
|
||||
# uploads on the calling thread, so the achievement widgets
|
||||
# can ask from the video thread. The test links the real
|
||||
# cheevos/cheevos_badge.c with the task and upload stubbed
|
||||
# as steppable queues and checks: nothing synchronous on
|
||||
# the first ask, one decode per badge, the upload posted
|
||||
# only from the decode's completion, the handle handed out
|
||||
# exactly once and owned by the taker, locked and unlocked
|
||||
# as separate keys, a missing file requesting a download
|
||||
# only when asked and loading when the download lands, a
|
||||
# failed load not retried per ask, a reset unloading ready
|
||||
# handles and orphaning in-flight ones (their late delivery
|
||||
# unloaded, never handed to whatever reused the slot), an
|
||||
# off-main-thread ask only recorded until the main thread's
|
||||
# service starts it, the default badge lent rather than
|
||||
# given, and a refused async upload treated as a failure.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x badge_cache_test
|
||||
ASAN_OPTIONS=detect_leaks=1 timeout 60 ./badge_cache_test
|
||||
echo "[pass] badge_cache_test (ASan)"
|
||||
make clean
|
||||
|
||||
- name: Build and run gfx_thumbnail_preview_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/gfx/gfx_thumbnail_preview
|
||||
run: |
|
||||
set -eu
|
||||
# Regression test for the file-browser video preview in
|
||||
# gfx/gfx_thumbnail.c, covering the windowed open, the
|
||||
# anim-first status/alpha handshake, and the preview-audio
|
||||
# hand-off to libretro-common/audio/audio_mixer.c.
|
||||
#
|
||||
# Every fault this pins was invisible to a decode-level
|
||||
# test, which is why they shipped one after another:
|
||||
#
|
||||
# - the windowed open produced a texture and reached
|
||||
# AVAILABLE but nothing raised alpha, so every video
|
||||
# decoded perfectly and drew at zero opacity;
|
||||
# - a LEADING moov left the demuxer's avail below the
|
||||
# media floor, so the first sample was unreachable, and
|
||||
# since the feeder anchors at tell==0 nothing ever
|
||||
# raised the bound - a standstill with no way out;
|
||||
# - a TRAILING moov cannot be reached by a resident head
|
||||
# at all, so preview audio was silent on every such
|
||||
# file until the moov island was committed instead;
|
||||
# - the mixer hand-off copied the whole container out of
|
||||
# a partially-committed window (SIGSEGV), took an
|
||||
# int32_t length that truncated a 7 GB container to
|
||||
# 3.5 GB, dropped every feeder raise for want of an
|
||||
# M4A arm in audio_mixer_voice_set_avail (the same
|
||||
# second of audio on a loop), and applied the resident
|
||||
# bound only under HAVE_ROPUS.
|
||||
#
|
||||
# So this links the REAL gfx_thumbnail.c AND the REAL
|
||||
# audio_mixer.c. The earlier harness stubbed the mixer and
|
||||
# was therefore modelling the two functions three of those
|
||||
# defects lived in. The stubbed audio thread consumes at a
|
||||
# settable rate and TOUCHES every byte it is told is
|
||||
# resident, so an over-claimed avail faults under ASan
|
||||
# rather than passing quietly, and it counts feeder stalls
|
||||
# (excluding the file end, where hitting the wall is the
|
||||
# loop point rather than a starved feeder).
|
||||
#
|
||||
# The fixtures are container LAYOUTS, not clips - where the
|
||||
# moov sits, whether media starts past 4 GiB, whether the
|
||||
# moov outgrows the head - because layout is what every one
|
||||
# of these faults turned on. The multi-gigabyte ones are
|
||||
# sparse: two 7.28 GB files cost ~400 KB of disk.
|
||||
#
|
||||
# The windowed-animation harness below decodes its two
|
||||
# lossless fixtures three times each; they are sized just past
|
||||
# what the feeder may keep resident (~40 MB and ~30 MB), and
|
||||
# mkfixtures.py reuses an existing set, so the second
|
||||
# "make fixtures" (TSan pass) costs nothing. ~55 s under
|
||||
# ASan on one core.
|
||||
# Frame counts are set from measurement, not taste. At 300
|
||||
# ASan / 200 TSan frames this step took ~5.6 min on one
|
||||
# core, against a job budget shared with a dozen others;
|
||||
# 120 / 60 brings it to ~1.5 min and still crosses every
|
||||
# window boundary the assertions rest on (the feeder moves
|
||||
# at AUDIO_BYTES_PER_TICK, not per frame). The job timeout
|
||||
# goes to 20 min to leave headroom for the slowest runner.
|
||||
sudo apt-get install -y -o Acquire::Retries=3 -o Acquire::http::Timeout=30 ffmpeg
|
||||
make clean all SANITIZER=address,undefined
|
||||
make fixtures
|
||||
test -x gfx_thumbnail_preview_test
|
||||
ASAN_OPTIONS=detect_leaks=1:allocator_may_return_null=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 \
|
||||
AUDIO_BYTES_PER_TICK=65536 FRAMES=120 timeout 300 \
|
||||
./gfx_thumbnail_preview_test fixtures/*.mp4 fixtures/anim_lossless.webp
|
||||
echo "[pass] gfx_thumbnail_preview_test (ASan)"
|
||||
# The frame-indexed types (animated WEBP, APNG) through the
|
||||
# same session, windowed: animated WEBP had no progressive
|
||||
# open, so the session read the whole file into the
|
||||
# reservation (for every still WEBP thumbnail too) and
|
||||
# charged one window for it; APNG had the open but no byte
|
||||
# cursor, so the feeder never moved past the 12 MB primed at
|
||||
# open and a longer animation looped early forever. Mapping
|
||||
# residency is measured with mincore, so the bound holds
|
||||
# under the sanitizers. ASan+UBSan only: the harness is
|
||||
# single-threaded (no TSan target), and the lossless decode
|
||||
# of ~900 720p frames takes it past the job budget under
|
||||
# TSan (>5 min) for no coverage.
|
||||
test -x preview_anim_window_test
|
||||
ASAN_OPTIONS=detect_leaks=1:allocator_may_return_null=1 \
|
||||
# V1 in this run plays long_video.mp4 (60 s at 4 Mbit/s,
|
||||
# 29 MB, generated by mkfixtures) end to end through the
|
||||
# session and requires the resident bytes to stay inside
|
||||
# the bitrate-sized window: measured 5.25 MiB peak against
|
||||
# the 20 MiB the fixed 4+8+8 MiB constants held before.
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 600 \
|
||||
./preview_anim_window_test fixtures
|
||||
echo "[pass] preview_anim_window_test (ASan)"
|
||||
# The decode test is the missing half of the harness above:
|
||||
# the REAL mixer -> audio_transfer -> rmp4 -> raac chain over
|
||||
# a budget-fed window, at budgets small enough that the
|
||||
# decoder reaches the resident frontier. The stubbed audio
|
||||
# thread above models exactly the layer these faults lived
|
||||
# in: no wall over the packets on the trailing-moov path
|
||||
# (SIGSEGV inside raac_decode_frame the moment the decoder
|
||||
# outran the feeder), demuxer bounds that refused to lower,
|
||||
# a wall stall taken for end of stream (mid-file rewinds,
|
||||
# then the voice released), and set_avail compiling to a
|
||||
# no-op without HAVE_RWEBM - the _norwebm build exists for
|
||||
# that last one.
|
||||
test -x preview_audio_decode_test
|
||||
test -x preview_audio_decode_test_norwebm
|
||||
ASAN_OPTIONS=detect_leaks=1:allocator_may_return_null=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 600 bash -c '
|
||||
./preview_audio_decode_test fixtures/trailing_large.mp4 1024 island
|
||||
./preview_audio_decode_test fixtures/trailing_large.mp4 262144 island
|
||||
./preview_audio_decode_test_norwebm fixtures/trailing_large.mp4 1024 island
|
||||
./preview_audio_decode_test_norwebm fixtures/trailing_large.mp4 262144 island'
|
||||
echo "[pass] preview_audio_decode_test (ASan)"
|
||||
# The threaded decode against the single-threaded one, frame
|
||||
# for frame: the colour conversion in row bands on a pool,
|
||||
# for the VP9 fixture (four tile columns) the columns decoded
|
||||
# side by side, for the HEVC fixture (WPP) the CTB rows on a
|
||||
# wavefront. Every frame must be byte-identical.
|
||||
test -x preview_blit_bands_test
|
||||
ASAN_OPTIONS=detect_leaks=1:allocator_may_return_null=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 300 bash -c '
|
||||
./preview_blit_bands_test fixtures/long_video.mp4
|
||||
./preview_blit_bands_test fixtures/vp9_tiles.webm
|
||||
./preview_blit_bands_test fixtures/hevc_wpp.mp4'
|
||||
echo "[pass] preview_blit_bands_test (ASan)"
|
||||
# clean keeps fixtures/ by design; regenerate anyway so the
|
||||
# step cannot silently run against an empty glob.
|
||||
make clean all SANITIZER=thread
|
||||
make fixtures
|
||||
TSAN_OPTIONS=halt_on_error=1:allocator_may_return_null=1 FRAMES=60 timeout 300 \
|
||||
./gfx_thumbnail_preview_test fixtures/*.mp4 fixtures/anim_lossless.webp
|
||||
echo "[pass] gfx_thumbnail_preview_test (TSan)"
|
||||
# The pool and the tile-column threads under TSan: the
|
||||
# shared frame buffers and contexts are written in disjoint
|
||||
# columns, the counts merged after the join.
|
||||
TSAN_OPTIONS=halt_on_error=1:allocator_may_return_null=1 timeout 300 bash -c '
|
||||
./preview_blit_bands_test fixtures/long_video.mp4
|
||||
./preview_blit_bands_test fixtures/vp9_tiles.webm
|
||||
./preview_blit_bands_test fixtures/hevc_wpp.mp4'
|
||||
echo "[pass] preview_blit_bands_test (TSan)"
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 600 bash -c '
|
||||
./preview_audio_decode_test fixtures/trailing_large.mp4 1024 island
|
||||
./preview_audio_decode_test fixtures/trailing_large.mp4 262144 island'
|
||||
echo "[pass] preview_audio_decode_test (TSan)"
|
||||
@@ -1,136 +0,0 @@
|
||||
name: CI Linux samples/input
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples-input:
|
||||
name: Build and run samples/input
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libusb-1.0-0-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Build and run illuminance_sensor_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/input/illuminance_sensor
|
||||
run: |
|
||||
set -eu
|
||||
# The Linux IIO illuminance sensor poller, against a fake
|
||||
# sysfs tree under /tmp. Pins that the poll thread waits on a
|
||||
# condition between readings rather than sleeping: a raised
|
||||
# rate applies at once, and close returns without waiting out
|
||||
# the period.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x illuminance_sensor_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./illuminance_sensor_test
|
||||
echo "[pass] illuminance_sensor_test (ASan)"
|
||||
|
||||
- name: Build and run illuminance_sensor_test (TSan)
|
||||
shell: bash
|
||||
working-directory: samples/input/illuminance_sensor
|
||||
run: |
|
||||
set -eu
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 60 ./illuminance_sensor_test
|
||||
echo "[pass] illuminance_sensor_test (TSan)"
|
||||
|
||||
- name: Build and run libusb_hid_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/input/libusb_hid
|
||||
run: |
|
||||
set -eu
|
||||
# The libusb HID driver against a fake libusb: reads and
|
||||
# commands run on asynchronous transfers completed by the poll
|
||||
# thread, with no thread per pad. Pins that a command goes out
|
||||
# at once even while the pad sends nothing, that commands stay
|
||||
# in order one at a time, that unplugging frees the adapter,
|
||||
# and that freeing the driver returns at once with a send
|
||||
# still pending, releasing every transfer and handle.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x libusb_hid_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./libusb_hid_test
|
||||
echo "[pass] libusb_hid_test (ASan)"
|
||||
|
||||
- name: Build and run libusb_hid_test (TSan)
|
||||
shell: bash
|
||||
working-directory: samples/input/libusb_hid
|
||||
run: |
|
||||
set -eu
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 60 ./libusb_hid_test
|
||||
echo "[pass] libusb_hid_test (TSan)"
|
||||
|
||||
- name: Build and run wii_handshake_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/input/wii_handshake
|
||||
run: |
|
||||
set -eu
|
||||
# The Wiimote extension handshake in connect_wii.c, fed
|
||||
# reports directly. Pins that each init write waits for the
|
||||
# remote's acknowledgement instead of a sleep on the packet
|
||||
# thread, that a missing acknowledgement is only overtaken by
|
||||
# a packet after the old 100 ms, and that no packet blocks.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x wii_handshake_test
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
timeout 60 ./wii_handshake_test
|
||||
echo "[pass] wii_handshake_test (ASan)"
|
||||
@@ -1,123 +0,0 @@
|
||||
name: CI Linux samples/network
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples-network:
|
||||
name: Build and run samples/network
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libmbedtls-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Build and run webdav_options_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/network/webdav_options
|
||||
run: |
|
||||
set -eu
|
||||
# Includes network/cloud_sync/webdav.c and drives the OPTIONS
|
||||
# capability probe as shipped over real-world header sets. The
|
||||
# probe has to separate a WebDAV server from a plain HTTP
|
||||
# server that answers OPTIONS, and the target it probes is a
|
||||
# collection, on which PUT is not defined (RFC 4918 9.7.1) -
|
||||
# so PUT's absence from Allow must not fail it. The previous
|
||||
# probe did exactly that, rejecting mod_dav and Koofr
|
||||
# (libretro/RetroArch#19486) while accepting a plain nginx
|
||||
# that happened to list PUT. Covers the DAV header, Allow-only
|
||||
# WebDAV methods, HTTP/2 lowercase field names, plain HTTP
|
||||
# with and without PUT, empty and NULL header lists, and
|
||||
# whole-token matching (PROPFINDX must not match PROPFIND).
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x webdav_options_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./webdav_options_test
|
||||
echo "[pass] webdav_options_test (ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 120 ./webdav_options_test
|
||||
echo "[pass] webdav_options_test (TSan)"
|
||||
|
||||
- name: Build and run cheevos_login_test (bear ASan+UBSan, bear TSan, mbed ASan+UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/network/cheevos_login
|
||||
run: |
|
||||
set -eu
|
||||
# Regression guard for the RetroAchievements login transport
|
||||
# (libretro/RetroArch#19562, #19457): drives net_http with the
|
||||
# exact login shape cheevos_client.c produces, against a local
|
||||
# mock server that validates every request byte-for-byte, over
|
||||
# plain HTTP and over TLS with the real SSL backend linked in.
|
||||
# Covers: login on a fresh TLS connection, trust-store loading
|
||||
# from a realistic messy CA bundle (BearSSL), keep-alive pool
|
||||
# reuse, one-shot replay of a request on a pooled connection
|
||||
# the server closed while idle, and no replay once response
|
||||
# bytes have been seen.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x cheevos_login_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 timeout 120 \
|
||||
make check
|
||||
echo "[pass] cheevos_login_test (BearSSL, ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 180 make check
|
||||
echo "[pass] cheevos_login_test (BearSSL, TSan)"
|
||||
make clean all SSL_BACKEND=mbed SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 timeout 120 \
|
||||
make check SSL_BACKEND=mbed
|
||||
echo "[pass] cheevos_login_test (mbedTLS, ASan)"
|
||||
@@ -1,103 +0,0 @@
|
||||
name: CI Linux samples/record
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'record/**'
|
||||
- 'libretro-common/queues/**'
|
||||
- 'libretro-common/include/retro_spsc.h'
|
||||
- 'libretro-common/include/retro_atomic.h'
|
||||
- 'samples/record/**'
|
||||
- '.github/workflows/Linux-samples-record.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'record/**'
|
||||
- 'libretro-common/queues/**'
|
||||
- 'libretro-common/include/retro_spsc.h'
|
||||
- 'libretro-common/include/retro_atomic.h'
|
||||
- 'samples/record/**'
|
||||
- '.github/workflows/Linux-samples-record.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples-record:
|
||||
name: Build and run samples/record
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 25
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential pkg-config libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Build and run ffmpeg_pipeline_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/record/ffmpeg_pipeline
|
||||
run: |
|
||||
set -eu
|
||||
# record/drivers/record_ffmpeg.c end to end: frames whose
|
||||
# pixels encode their number, plus audio, pushed from the
|
||||
# test thread while the driver's encoder thread drains the
|
||||
# attr/video/audio rings; the file is decoded back and every
|
||||
# frame checked in order and pixel-exact. Covers the rings
|
||||
# under contention, the full-queue wait, and the drain after
|
||||
# the encoder thread is joined. Needs libavcodec with
|
||||
# libx264rgb (Ubuntu's has it).
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x ffmpeg_pipeline_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 300 \
|
||||
./ffmpeg_pipeline_test
|
||||
echo "[pass] ffmpeg_pipeline_test (ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 300 ./ffmpeg_pipeline_test
|
||||
echo "[pass] ffmpeg_pipeline_test (TSan)"
|
||||
@@ -1,89 +0,0 @@
|
||||
name: CI Linux samples/settings
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples-settings:
|
||||
name: Build and run samples/settings
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
|
||||
- name: Build and run pipeline_migration_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/settings/pipeline_migration
|
||||
run: |
|
||||
set -eu
|
||||
# The audio_threaded_pipeline config migration. The setting
|
||||
# briefly held off/automatic/on and was saved as a number; it
|
||||
# is a bool again, and a bool is always saved as "true" or
|
||||
# "false", so a bare digit on the key is the older three-way
|
||||
# value. config_get_bool() reads its automatic (1) as an
|
||||
# explicit on, which forced the pipeline on for users who
|
||||
# never chose it. Pins each stored digit against both
|
||||
# defaults, and pins that "true", "false", absent, empty and
|
||||
# multi-character values are untouched. The rule under test
|
||||
# is restated from config_load_file(), which needs most of the
|
||||
# frontend to run; a change to one must be made in the other.
|
||||
make clean all SANITIZER=address,undefined
|
||||
test -x pipeline_migration_test
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 60 \
|
||||
./pipeline_migration_test
|
||||
echo "[pass] pipeline_migration_test (ASan)"
|
||||
@@ -15,10 +15,6 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
samples-tasks:
|
||||
name: Build and run samples/tasks
|
||||
@@ -27,43 +23,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential zlib1g-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential zlib1g-dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build database_task
|
||||
shell: bash
|
||||
@@ -162,29 +127,6 @@ jobs:
|
||||
timeout 60 ./video_shader_wildcard_test
|
||||
echo "[pass] video_shader_wildcard_test"
|
||||
|
||||
- name: Build and run cloudsync_savefile_owner_test (ASan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/cloudsync
|
||||
run: |
|
||||
set -eu
|
||||
# Regression test for the save-data rollback cloud sync could
|
||||
# cause at startup. A core holds its save RAM in memory and
|
||||
# writes it back when content closes, so a sync that replaces
|
||||
# the file in between has its work overwritten and the stale
|
||||
# result uploaded over the server's copy.
|
||||
# save.c::content_savefile_is_live() is the ownership check
|
||||
# tasks/task_cloudsync.c consults before it touches a local
|
||||
# file; the test pins that predicate and the manifest key
|
||||
# lookup the carry-forward uses to recover the hash the last
|
||||
# sync recorded. Build under AddressSanitizer so a regression
|
||||
# in the list walk is caught at the bounds level. If save.c
|
||||
# amends the predicate, the verbatim copy in
|
||||
# cloudsync_savefile_owner_test.c must follow.
|
||||
make clean all SANITIZER=address
|
||||
test -x cloudsync_savefile_owner_test
|
||||
timeout 60 ./cloudsync_savefile_owner_test
|
||||
echo "[pass] cloudsync_savefile_owner_test"
|
||||
|
||||
- name: Build and run input_remap_bounds_test (ASan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/input_remap
|
||||
@@ -387,44 +329,6 @@ jobs:
|
||||
make clean
|
||||
echo "[pass] core_crc_slice_test (TSan)"
|
||||
|
||||
- name: Build and run get_list_refresh_flags_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/core_updater
|
||||
run: |
|
||||
set -eu
|
||||
# Regression lane for the menu refresh flags around the
|
||||
# core updater get-list task, against the shipping
|
||||
# tasks/task_core_updater.c, tasks/task_http.c,
|
||||
# task_queue.c and net_http.c.
|
||||
#
|
||||
# The Core Downloader entry point sets
|
||||
# MENU_ST_FLAG_ENTRIES_NONBLOCKING_REFRESH before pushing
|
||||
# the get-list task, and only the task's retirement
|
||||
# callback clears it again. The callback reads
|
||||
# refresh_menu through task->state, so the handle has to
|
||||
# stay attached to the task until retrieval; a handler
|
||||
# that frees it early turns the clear into a silent no-op,
|
||||
# MENU_ENTRIES_NEEDS_REFRESH() then stays false for the
|
||||
# rest of the session, and one visit to Core Downloader
|
||||
# wedges every deeper menu until restart. The test drives
|
||||
# the real push end to end against a loopback
|
||||
# .index-extended server, both values of refresh_menu, and
|
||||
# asserts the flags clear and the refresh gate comes back.
|
||||
make -f Makefile.refresh_flags clean all
|
||||
test -x get_list_refresh_flags_test
|
||||
timeout 600 ./get_list_refresh_flags_test
|
||||
echo "[pass] get_list_refresh_flags_test"
|
||||
make -f Makefile.refresh_flags clean all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 600 \
|
||||
./get_list_refresh_flags_test
|
||||
echo "[pass] get_list_refresh_flags_test (ASan)"
|
||||
make -f Makefile.refresh_flags clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 600 \
|
||||
./get_list_refresh_flags_test
|
||||
make -f Makefile.refresh_flags clean
|
||||
echo "[pass] get_list_refresh_flags_test (TSan)"
|
||||
|
||||
- name: Build and run core_backup_io_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/core_backup
|
||||
@@ -530,580 +434,6 @@ jobs:
|
||||
./image_decode_slice_test
|
||||
echo "[pass] image_decode_slice_test (ASan)"
|
||||
|
||||
- name: Build and run scan_begin_budget_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/database
|
||||
run: |
|
||||
set -eu
|
||||
# Pacing + throughput oracle for the manual content scanner's
|
||||
# BEGIN/END split in tasks/task_database.c, compiled from the
|
||||
# tree so it exercises the shipping translation units.
|
||||
#
|
||||
# The regression it pins: MANUAL_SCAN_BEGIN used to perform
|
||||
# the entire recursive directory walk, the whole DAT load and
|
||||
# the playlist setup in one handler invocation, and
|
||||
# MANUAL_SCAN_END flushed every accumulated result (each add
|
||||
# a linear playlist_entry_exists probe) plus a sort and a
|
||||
# write in another - 166 ms measured for the 5000-file
|
||||
# fixture, a hard frame freeze whenever Threaded Tasks is
|
||||
# off. Both are now sequences of sub-states under the shared
|
||||
# per-frame I/O window (tasks/task_nbio_slice.c, the same
|
||||
# window the file-transfer spine uses), with completed
|
||||
# sub-states collapsing into one gather so small libraries
|
||||
# keep single-tick latency.
|
||||
#
|
||||
# Three wall-clock assertions guard the plain build, because
|
||||
# any one alone can be satisfied by a scanner that is worse:
|
||||
# pacing (no gather over the window plus bounded slack),
|
||||
# first feedback within two frames of the push, and total
|
||||
# scan time within a factor of the blocking walk + DAT parse
|
||||
# it replaced - a scanner that no longer freezes but takes
|
||||
# twice as long fails the third lane. Playlist parity (every
|
||||
# fixture file present exactly once) is asserted in every
|
||||
# mode.
|
||||
#
|
||||
# The sanitizer runs use the 'sanitize' mode, which runs
|
||||
# every lane but skips the wall-clock assertions a sanitized
|
||||
# build cannot honestly meet. Those lanes are where the
|
||||
# in-flight resources the split introduced - an open
|
||||
# directory iterator, an open DAT stream over a half-filled
|
||||
# buffer, an open flush playlist - are made to die at every
|
||||
# phase: a 14-point cancellation sweep lands a cancel in
|
||||
# setup, mid-walk, mid-DAT-read, content iteration and
|
||||
# mid-flush, and LeakSanitizer decides whether the teardown
|
||||
# released everything (it already found one 16-byte-per-scan
|
||||
# leak that predates the split). The threaded lane runs the
|
||||
# same scan under the threaded queue and is the TSan target:
|
||||
# the shared window deliberately opts threaded queues out of
|
||||
# its static state, and this is where a mistake in that
|
||||
# opt-out would surface.
|
||||
#
|
||||
# Two dedup lanes guard the playlist path-hash index that
|
||||
# replaced the flush's quadratic existence probes: a
|
||||
# differential lane asserts the index answers exactly like
|
||||
# the linear playlist_entry_exists scan over plain, bare-
|
||||
# archive, inside-archive and case-variant paths with fuzzy
|
||||
# archive matching both off and on, and a no-overwrite
|
||||
# rescan lane re-scans the fixture into the populated
|
||||
# playlist and asserts zero duplicates, driving the index's
|
||||
# budgeted seeding at scale. The throughput factor is
|
||||
# tightened to reject the pre-index quadratic flush.
|
||||
#
|
||||
# The big-DAT lane scans 50 files against a 300k-game DAT
|
||||
# and asserts the same pacing budget: no gather may grow
|
||||
# with DAT size now that the rxml parse and the search-
|
||||
# index build step under the shared window. Its label
|
||||
# check samples the end of the list, so an index that
|
||||
# silently covered only a prefix fails correctness, and
|
||||
# three extra cancel points land inside the budgeted read
|
||||
# and parse of the large document.
|
||||
make clean all
|
||||
test -x scan_begin_budget_test
|
||||
timeout 600 ./scan_begin_budget_test
|
||||
echo "[pass] scan_begin_budget_test"
|
||||
make clean all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 900 \
|
||||
./scan_begin_budget_test sanitize
|
||||
echo "[pass] scan_begin_budget_test (ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 900 \
|
||||
./scan_begin_budget_test sanitize
|
||||
make clean
|
||||
echo "[pass] scan_begin_budget_test (TSan)"
|
||||
|
||||
- name: Build and run database_scan_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/database
|
||||
run: |
|
||||
set -eu
|
||||
# End-to-end oracle for tasks/task_database.c, built from the
|
||||
# shipping translation units. Alongside the database pairing
|
||||
# and playlist assertions it already carries, three memory
|
||||
# safety invariants of the manual scan state machine are
|
||||
# pinned here:
|
||||
#
|
||||
# - a content list whose entries exactly fill
|
||||
# string_list_new()'s initial capacity must leave
|
||||
# DATABASE_SCAN_ITERATE_NEXT at the M3U or the end state.
|
||||
# An exhausted index must never reach
|
||||
# MANUAL_SCAN_ITERATE_CONTENT, which reads its entry
|
||||
# before any bounds check;
|
||||
#
|
||||
# - a content directory with nothing scannable in it must be
|
||||
# rejected as invalid content by the database branch of
|
||||
# manual_scan_begin_dir_list(), the same rule the
|
||||
# non-database branch applies, instead of iterating an
|
||||
# empty list;
|
||||
#
|
||||
# - task_database_cue_prune() and gdi_prune() must leave the
|
||||
# entry being scanned alone when a cue or gdi sheet names
|
||||
# itself, because the serial lookup reads that path next.
|
||||
#
|
||||
# The first and third are bounds and lifetime properties that
|
||||
# a plain build walks straight past, so this lane is sanitized
|
||||
# only and LeakSanitizer decides the teardown as well.
|
||||
make clean database_scan_test SANITIZER=address,undefined
|
||||
test -x database_scan_test
|
||||
scan_root="$(mktemp -d)"
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 900 \
|
||||
./database_scan_test "$scan_root"
|
||||
rm -rf "$scan_root"
|
||||
make clean
|
||||
echo "[pass] database_scan_test (ASan)"
|
||||
|
||||
- name: Build and run pl_manager_budget_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/playlist_manager
|
||||
run: |
|
||||
set -eu
|
||||
# Oracle for the playlist manager tasks' load phase,
|
||||
# compiled from the shipping translation unit against the
|
||||
# real task queue, the real playlist reader and the real
|
||||
# shared per-frame I/O window, with a virtual clock so the
|
||||
# pacing assertions are exact.
|
||||
#
|
||||
# Both handlers were already per-entry state machines with
|
||||
# one exception: the load read the whole playlist in a
|
||||
# single blocking call, which for a large collection is
|
||||
# tens of milliseconds of JSON on the thread driving the
|
||||
# frame loop whenever Threaded Tasks is off.
|
||||
#
|
||||
# The pacing lane isolates that phase: the per-entry
|
||||
# iteration costs the same number of invocations either
|
||||
# way, so the difference between a paced and an unpaced run
|
||||
# is the load. The cancel lane, under LSan, covers
|
||||
# abandoning a task while its playlist is still being read.
|
||||
make clean >/dev/null
|
||||
make all -j$(nproc)
|
||||
./pl_manager_budget_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./pl_manager_budget_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=thread -j$(nproc)
|
||||
TSAN_OPTIONS=halt_on_error=1 ./pl_manager_budget_test
|
||||
make clean >/dev/null
|
||||
|
||||
- name: Build and run overlay_budget_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/overlay
|
||||
run: |
|
||||
set -eu
|
||||
# Oracle for the overlay loader's pacing, compiled from the
|
||||
# shipping translation unit against the real task queue and
|
||||
# the real shared per-frame I/O window, with image loading
|
||||
# stubbed and a virtual clock so the assertions are exact.
|
||||
#
|
||||
# The loader used to chunk by a count derived from the
|
||||
# workload - half an overlay's descriptors, a quarter of
|
||||
# the overlays - which is not pacing: a bigger overlay just
|
||||
# meant bigger chunks, so the job always landed in the same
|
||||
# two or four handler invocations however long each took.
|
||||
# The scaling lane is the one that pins the fix: work per
|
||||
# invocation must not grow with the size of the overlay.
|
||||
#
|
||||
# LSan also guards the image list, which used to be
|
||||
# released only when a load was cancelled and therefore
|
||||
# leaked once per successful overlay load.
|
||||
make clean >/dev/null
|
||||
make all -j$(nproc)
|
||||
./overlay_budget_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./overlay_budget_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=thread -j$(nproc)
|
||||
TSAN_OPTIONS=halt_on_error=1 ./overlay_budget_test
|
||||
make clean >/dev/null
|
||||
|
||||
- name: Build and run overlay_visibility_bounds_test (ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/overlay
|
||||
run: |
|
||||
set -eu
|
||||
# The overlay visibility index does not come from the overlay:
|
||||
# led/drivers/led_overlay.c forwards settings->uints.led_map[],
|
||||
# which configuration.c reads from the config file with no
|
||||
# range of its own. Unbounded, "led1_map = 500" wrote past
|
||||
# overlay_visibility[MAX_VISIBILITY] during drivers_init() and
|
||||
# handed the same index to the video driver's set_alpha().
|
||||
# This builds the shipping LED driver to pin that it really
|
||||
# does forward config values unaltered, and checks the bound
|
||||
# covers the array exactly. If input_driver.c changes that
|
||||
# bound, the verbatim copy in the test must follow.
|
||||
make -f Makefile.visibility clean >/dev/null
|
||||
make -f Makefile.visibility all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./overlay_visibility_bounds_test
|
||||
make -f Makefile.visibility clean >/dev/null
|
||||
|
||||
- name: Build and run content_prefetch_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/content_prefetch
|
||||
run: |
|
||||
set -eu
|
||||
# Oracle for the content prefetch task - the path a menu
|
||||
# content load defers to, streaming the bytes in a budgeted
|
||||
# slice per tick while the frontend keeps running, so the
|
||||
# load takes a finished buffer instead of blocking on a
|
||||
# read.
|
||||
#
|
||||
# Delivery is by ownership transfer from the task callback,
|
||||
# so this is as much a memory-correctness test as a
|
||||
# behavioural one, and it runs under all three flavors. One
|
||||
# lane drives the THREADED queue deliberately: the other
|
||||
# lanes run the handler on the calling thread, where a TSan
|
||||
# run would prove nothing about the worker-to-callback
|
||||
# hand-off that is the only place a race could live.
|
||||
make clean >/dev/null
|
||||
make all -j$(nproc)
|
||||
./content_prefetch_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./content_prefetch_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=thread -j$(nproc)
|
||||
TSAN_OPTIONS=halt_on_error=1 ./content_prefetch_test
|
||||
make clean >/dev/null
|
||||
|
||||
- name: Build and run bluetooth_scan_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/bluetooth_scan
|
||||
run: |
|
||||
set -eu
|
||||
# The Bluetooth scan task on the real threaded task queue,
|
||||
# with the discovery window shortened. The scan used to wait
|
||||
# out the window inside one handler call, holding the task
|
||||
# thread; it now begins, reschedules itself for the end of
|
||||
# the window, and ends. Pins that begin and end run once each
|
||||
# a window apart, that another task runs during the window,
|
||||
# and that the callback fires.
|
||||
make clean all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
timeout 60 ./bluetooth_scan_test
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 60 ./bluetooth_scan_test
|
||||
echo "[pass] bluetooth_scan_test"
|
||||
|
||||
- name: Build and run wait_timeout_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/wait_timeout
|
||||
run: |
|
||||
set -eu
|
||||
# task_queue_wait() waits indefinitely, which is wrong for
|
||||
# anything depending on a machine we do not control - the
|
||||
# netplay MITM query waits on an HTTP round trip to the
|
||||
# lobby server, and a server that never answers used to hang
|
||||
# the frontend outright.
|
||||
#
|
||||
# These lanes pin both directions: a wait that CAN be
|
||||
# satisfied returns as soon as it is, rather than sitting
|
||||
# out its timeout, and one that cannot gives up at roughly
|
||||
# the deadline instead of never. Both queue implementations
|
||||
# are covered, since the bound is a wrapped condition rather
|
||||
# than per-implementation code.
|
||||
make clean >/dev/null
|
||||
make all -j$(nproc)
|
||||
./wait_timeout_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./wait_timeout_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=thread -j$(nproc)
|
||||
TSAN_OPTIONS=halt_on_error=1 ./wait_timeout_test
|
||||
make clean >/dev/null
|
||||
|
||||
- name: Build and run task_ordering_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/ordering
|
||||
run: |
|
||||
set -eu
|
||||
# Pins the task queue's visibility contract, which is what
|
||||
# made a movie-record ordering guard fail.
|
||||
#
|
||||
# retro_task_regular_gather() lifts every running task off
|
||||
# the queue and puts each one BACK as it processes it, so
|
||||
# whether a finder called from inside a handler sees a
|
||||
# sibling depends on where that sibling sits in the pass.
|
||||
# At least one invocation reports "nothing in progress"
|
||||
# while the task is genuinely pending - which an ordering
|
||||
# guard only has to get wrong once. A main-thread flag is
|
||||
# visible from inside a handler and is what the guards use
|
||||
# now; the ordering lane fails if a task guarded that way
|
||||
# runs before the one it waits on.
|
||||
make clean >/dev/null
|
||||
make all -j$(nproc)
|
||||
./task_ordering_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./task_ordering_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=thread -j$(nproc)
|
||||
TSAN_OPTIONS=halt_on_error=1 ./task_ordering_test
|
||||
make clean >/dev/null
|
||||
|
||||
- name: Build and run task_watchdog_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/watchdog
|
||||
run: |
|
||||
set -eu
|
||||
# Oracle for the task queue's slow-handler watchdog,
|
||||
# compiled against the shipping queue. With Threaded Tasks
|
||||
# off, handlers run on the thread that drives the frame
|
||||
# loop, so a handler that does not return promptly is a
|
||||
# visible stall - and the queue is the only place that can
|
||||
# attribute one to a specific task instead of to "something
|
||||
# in the frame".
|
||||
#
|
||||
# The lanes pin: a handler inside its budget is silent; one
|
||||
# that overruns is reported once, attributed to that task,
|
||||
# with a duration above the budget; the threaded queue is
|
||||
# deliberately not measured, because a long handler on a
|
||||
# worker is what the worker is for; and an unregistered
|
||||
# watchdog never fires, which is the default and the state
|
||||
# release builds ship in.
|
||||
make clean >/dev/null
|
||||
make all -j$(nproc)
|
||||
./task_watchdog_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./task_watchdog_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=thread -j$(nproc)
|
||||
TSAN_OPTIONS=halt_on_error=1 ./task_watchdog_test
|
||||
make clean >/dev/null
|
||||
|
||||
- name: Build and run nat_task_serialisation_test (plain, ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/netplay_nat
|
||||
run: |
|
||||
set -eu
|
||||
# Oracle for the NAT traversal task's request serialisation,
|
||||
# compiled from the shipping translation unit against the
|
||||
# real task queue with the natt_* device layer faked.
|
||||
#
|
||||
# Only one NAT task may run at a time - both requests mutate
|
||||
# the single shared request object - and that exclusion used
|
||||
# to be enforced by blocking the calling thread, which is
|
||||
# the one driving the menu, for the duration of UPnP
|
||||
# discovery. The lanes pin the replacement: a push issued
|
||||
# while a task is in flight returns without running it to
|
||||
# completion, a close followed by an open runs as both in
|
||||
# that order rather than being coalesced (coalescing would
|
||||
# leak the port mapping), queued requests actually start
|
||||
# from the task callbacks, and an overflowing request is
|
||||
# refused rather than dropped.
|
||||
make clean >/dev/null
|
||||
make all -j$(nproc)
|
||||
./nat_task_serialisation_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./nat_task_serialisation_test
|
||||
make clean >/dev/null
|
||||
|
||||
- name: Guard against unbounded task_queue_wait in network/ and tasks/
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# task_queue_wait(NULL, ...) does not mean "wait for my
|
||||
# task" - a NULL condition makes both queue implementations
|
||||
# loop until the queue is EMPTY. A caller blocking on one
|
||||
# HTTP round trip therefore also waits out every unrelated
|
||||
# task in flight: a content scan, a core download, a
|
||||
# thumbnail pack. Where a wait is still necessary it must
|
||||
# name a condition that describes the caller's own work, so
|
||||
# the block is bounded by that work and nothing else.
|
||||
#
|
||||
# This does not sanction waiting - the menu paths are held
|
||||
# to the stricter no-wait guard below. It stops the
|
||||
# unbounded form from coming back where waits remain.
|
||||
hits=$(grep -rn --include='*.c' --include='*.cpp' \
|
||||
'task_queue_wait[[:space:]]*([[:space:]]*NULL' \
|
||||
network/ tasks/ || true)
|
||||
if [[ -n "$hits" ]]; then
|
||||
printf '%s\n' "$hits"
|
||||
printf '::error title=Unbounded task_queue_wait::Pass a condition describing your own work; NULL waits for the entire queue to drain.\n'
|
||||
exit 1
|
||||
fi
|
||||
printf 'No unbounded task_queue_wait in network/ or tasks/.\n'
|
||||
|
||||
- name: Guard against task_queue_wait on interactive menu paths
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# task_queue_wait() spins the calling thread until a task
|
||||
# finishes. Reached from the menu it is a hard UI freeze
|
||||
# for the duration of the work - a database scan on slow
|
||||
# storage is seconds - and on Android it is an ANR. The
|
||||
# menu teardown waits that used to live here were replaced
|
||||
# by cancellation plus a stale-completion generation guard
|
||||
# (menu_explore_cancel_init_task / menu_dbinfo_cancel_task).
|
||||
#
|
||||
# Scope is deliberately narrow and mechanical: menu/ and the
|
||||
# two task translation units the menu drives directly. The
|
||||
# remaining wait sites elsewhere (core deinit save/load, NAT
|
||||
# traversal, netplay MITM) are tracked separately and are
|
||||
# NOT covered here - widening this guard is what should
|
||||
# happen as each of those is converted.
|
||||
hits=$(grep -rn 'task_queue_wait' menu/ \
|
||||
tasks/task_menu_explore.c \
|
||||
tasks/task_database_info.c \
|
||||
tasks/task_netplay_nat_traversal.c || true)
|
||||
if [[ -n "$hits" ]]; then
|
||||
printf '%s\n' "$hits"
|
||||
printf '::error title=Blocking wait on a menu path::task_queue_wait() must not be reachable from the menu. Use cancellation with a stale-completion guard, or a deferred continuation.\n'
|
||||
exit 1
|
||||
fi
|
||||
printf 'No task_queue_wait on the guarded menu paths.\n'
|
||||
|
||||
- name: Build and run playlist_parity_test (plain, ASan + UBSan)
|
||||
shell: bash
|
||||
working-directory: samples/playlist
|
||||
run: |
|
||||
set -eu
|
||||
# Parity oracle for playlist.c's read path (playlist_init /
|
||||
# playlist_read_file), compiled from the shipping
|
||||
# translation unit. Pins the reader's observable behaviour
|
||||
# ahead of its restructuring into a budgeted resumable
|
||||
# parse: the full JSON schema, the
|
||||
# malformed-JSON-keeps-partial-data contract, the old
|
||||
# six-line format with its trailing metadata block, RZIP
|
||||
# compressed input, missing-file-reads-empty, and capacity
|
||||
# clamping. The budgeted lanes then assert the resumable
|
||||
# API (playlist_parse_begin/step/end/abort) produces
|
||||
# playlists identical to the blocking path while yielding
|
||||
# repeatedly, for JSON, the old format and the autofix
|
||||
# pass, and that abandoning a parse mid-document leaks
|
||||
# nothing. The cache-reuse lane guards the size stamp the
|
||||
# cache keys on: it must be the on-disk size for every
|
||||
# format and compression combination - including after the
|
||||
# autofix pass saves the file it fixed - or the cached
|
||||
# playlist is never reused and the menu re-parses on every
|
||||
# navigation.
|
||||
#
|
||||
# The switch and supersede lanes cover a field report -
|
||||
# MaterialUI on Android showing one playlist's titles under
|
||||
# another's heading, where selecting a row launches content
|
||||
# from the wrong system. The deferred cached init yields
|
||||
# mid-parse, and the menu reads playlist_get_cached() while
|
||||
# building its list, so leaving the previous playlist
|
||||
# installed until the new one is ready is user-visible and
|
||||
# wrong. The lanes assert on EVERY yield that the cache is
|
||||
# either empty or already the requested playlist, including
|
||||
# when a request is superseded before it finishes, and that
|
||||
# the parse really yielded - a lane that stops exercising
|
||||
# its own window is worse than no lane.
|
||||
#
|
||||
# The pump and rebuild-reuse lanes cover issue #19427
|
||||
# (large playlists flashing the empty-list placeholder):
|
||||
# a yielded read must complete on frames alone, and the
|
||||
# rebuild that follows completion must be served from the
|
||||
# cache just installed - a restart there loops, one flash
|
||||
# per completion. Pinned: the recorded
|
||||
# base_content_directory under an autofix-off config, and
|
||||
# the size stamp left stale by the autofix pass's save.
|
||||
#
|
||||
# The truncated-JSON lane also guards the staged-entry
|
||||
# cleanup in playlist_read_file: an entry interrupted
|
||||
# mid-object is reserved but never committed, and its
|
||||
# already-parsed members must be freed on the error path -
|
||||
# the leak the lane originally flushed out. LSan gates it
|
||||
# here permanently. No threads on this path, so no TSan
|
||||
# flavor.
|
||||
make clean >/dev/null
|
||||
make all -j$(nproc)
|
||||
./playlist_parity_test
|
||||
make clean >/dev/null
|
||||
make all SANITIZER=address,undefined -j$(nproc)
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 \
|
||||
./playlist_parity_test
|
||||
make clean >/dev/null
|
||||
|
||||
- name: Build and run dirwalk_budget_test (plain, ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/menu/dirwalk
|
||||
run: |
|
||||
set -eu
|
||||
# Oracle for menu/menu_dirwalk.c, the budgeted, cancellable
|
||||
# directory enumeration behind interactive menu list
|
||||
# building, compiled from the tree so it exercises the
|
||||
# shipping translation unit.
|
||||
#
|
||||
# The regression it pins: filebrowser_parse and the
|
||||
# playlist-directory displaylists walk and sort their
|
||||
# directory synchronously on the thread that drives the UI,
|
||||
# a stall proportional to directory size. menu_dirwalk
|
||||
# caps it: one budgeted synchronous pass under the shared
|
||||
# per-frame I/O window (small and medium directories
|
||||
# complete on the spot, identical result, single tick),
|
||||
# with oversized walks - and oversized sorts, which for a
|
||||
# 40k-entry directory cost more than the walk - continuing
|
||||
# on a task as a resumable enumeration plus a resumable
|
||||
# bottom-up mergesort, ordered by the exact comparator
|
||||
# dir_list_sort() uses.
|
||||
#
|
||||
# The clock is the test's instrument (the save_state
|
||||
# pattern): the sample provides cpu_features_get_time_usec()
|
||||
# itself. Step 0 reads the real clock for the pacing and
|
||||
# bench lanes; a fixed virtual step per observation makes
|
||||
# window exhaustion deterministic for the deferral, cancel
|
||||
# and threaded lanes on any machine at any cache
|
||||
# temperature. The build also shrinks the sort-machinery
|
||||
# constants (run length, merge batch, synchronous-sort
|
||||
# ceiling) so run sorting, the element-granular resumable
|
||||
# merge, and sort-only deferral are all driven across many
|
||||
# invocations by a 200-entry fixture.
|
||||
#
|
||||
# Parity is the contract: a consumed listing equals
|
||||
# dir_list_new() plus the same sort, entry for entry with
|
||||
# attributes, across the flag and sort-mode combinations
|
||||
# the displaylist callers use. The pacing lane asserts no
|
||||
# single main-thread stall - request, task gather, or
|
||||
# consume - exceeds the window plus bounded slack on a
|
||||
# 40k-file flat fixture (the walk under test is
|
||||
# non-recursive: the menu browses one level, so the files
|
||||
# sit flat, which is also what a large ROM directory looks
|
||||
# like). The bench lane holds the hard precondition:
|
||||
# wall-clock from first request to consumed result may not
|
||||
# regress past the blocking walk + sort it replaces. The
|
||||
# cancel lane supersedes and cancels mid-walk and drains
|
||||
# stale completions, with LeakSanitizer judging the
|
||||
# teardown; the threaded lane hands the walk to a worker
|
||||
# and is the TSan target for the handler-to-main-callback
|
||||
# hand-off.
|
||||
make clean all
|
||||
test -x dirwalk_budget_test
|
||||
timeout 600 ./dirwalk_budget_test
|
||||
echo "[pass] dirwalk_budget_test"
|
||||
make clean all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 900 \
|
||||
./dirwalk_budget_test sanitize
|
||||
echo "[pass] dirwalk_budget_test (ASan)"
|
||||
make clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 900 \
|
||||
./dirwalk_budget_test sanitize
|
||||
make clean
|
||||
echo "[pass] dirwalk_budget_test (TSan)"
|
||||
|
||||
- name: Build and run save_state_io_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/save_state
|
||||
@@ -1232,43 +562,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential zlib1g-dev"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y build-essential zlib1g-dev
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Restore ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ccache-${{ github.workflow }}-${{ github.job }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.workflow }}-${{ github.job }}-
|
||||
|
||||
- name: Enable ccache
|
||||
run: |
|
||||
set -eu
|
||||
command -v ccache >/dev/null 2>&1 || sudo apt-get install -y -qq ccache
|
||||
export CCACHE_DIR="$HOME/.ccache"
|
||||
echo "CCACHE_DIR=$CCACHE_DIR" >> "$GITHUB_ENV"
|
||||
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
|
||||
ccache -M 500M
|
||||
ccache -z
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: C89 syntax check for the HTTP task translation units
|
||||
shell: bash
|
||||
@@ -1305,13 +604,7 @@ jobs:
|
||||
tasks/task_pl_thumbnail_download.c \
|
||||
tasks/task_core_backup.c \
|
||||
core_backup.c \
|
||||
libretro-common/streams/interface_stream.c \
|
||||
tasks/task_file_transfer.c \
|
||||
tasks/task_nbio_slice.c \
|
||||
libretro-common/lists/dir_list.c \
|
||||
libretro-common/formats/logiqx_dat/logiqx_dat.c \
|
||||
libretro-common/formats/xml/rxml.c \
|
||||
database_info.c; do
|
||||
libretro-common/streams/interface_stream.c; do
|
||||
if gcc -fsyntax-only $C89 $INC $DEF "$f"; then
|
||||
echo "[pass] C89 $f"
|
||||
else
|
||||
@@ -1488,58 +781,6 @@ jobs:
|
||||
make -f Makefile.stress clean
|
||||
echo "[pass] http_transfer_stress_test (TSan)"
|
||||
|
||||
- name: Build and run http_transport_failure_test (ASan + UBSan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/http
|
||||
run: |
|
||||
set -eu
|
||||
# What a failed transfer is allowed to hand back, across
|
||||
# libretro-common/net/net_http.c and tasks/task_http.c.
|
||||
#
|
||||
# net_http_new() allocates response.data up front as the
|
||||
# receive buffer - 64KiB of plain malloc(). On a transport
|
||||
# failure nothing is written into it and response.len stays
|
||||
# 0, but the pointer is non-NULL, and net_http_data()'s
|
||||
# accept_err returned it, so every failed download published
|
||||
# uninitialised, unterminated heap as
|
||||
# http_transfer_data_t::data. On a torn body it was worse:
|
||||
# the caller got the Content-Length remainder as the length,
|
||||
# over bytes that never arrived. Meanwhile task_http.c gated
|
||||
# task_set_error() on RETRO_TASK_FLG_MUTE, which only ever
|
||||
# suppressed the on-screen notification - so muted transfers
|
||||
# (achievements, netplay lobby, core list refresh) reported
|
||||
# failure to their callbacks as success.
|
||||
#
|
||||
# Four failure lanes entering net_http_update() at four
|
||||
# different points, plus two contrast lanes: a 200 must still
|
||||
# deliver body, headers and status, and a 404 must still
|
||||
# deliver its body under accept_err, or the fix could be
|
||||
# satisfied by an accessor that returns NULL rather more
|
||||
# often than that and cloud sync's WWW-Authenticate path
|
||||
# would break silently. Both contrast lanes pass on the
|
||||
# pre-fix tree, which is what makes them a guard. Two task
|
||||
# lanes run the same failure through the real task_http.c and
|
||||
# task_queue.c, muted and unmuted.
|
||||
#
|
||||
# getaddrinfo is wrapped at link time so the DNS lane cannot
|
||||
# quietly start testing a successful lookup on a runner whose
|
||||
# resolver answers for everything. Leak detection is on
|
||||
# because the fix changes ownership: net_http_delete() is now
|
||||
# the only thing that frees the receive buffer on failure.
|
||||
#
|
||||
# To confirm this still bites, drop the `status < 0` guard
|
||||
# from net_http_data() and rerun.
|
||||
make -f Makefile.transport_fail clean all SANITIZER=address,undefined
|
||||
ASAN_OPTIONS=detect_leaks=1:detect_stack_use_after_return=1 \
|
||||
UBSAN_OPTIONS=print_stacktrace=1 timeout 300 \
|
||||
./http_transport_failure_test
|
||||
echo "[pass] http_transport_failure_test (ASan)"
|
||||
make -f Makefile.transport_fail clean all SANITIZER=thread
|
||||
TSAN_OPTIONS=halt_on_error=1 timeout 300 \
|
||||
./http_transport_failure_test
|
||||
make -f Makefile.transport_fail clean
|
||||
echo "[pass] http_transport_failure_test (TSan)"
|
||||
|
||||
- name: Build and run http_dns_evict_deadlock_test (ASan, TSan)
|
||||
shell: bash
|
||||
working-directory: samples/tasks/http
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
name: CI Linux state_manager + runahead tests
|
||||
|
||||
# The rewind codec and ring, and the run-ahead core-copy protocol,
|
||||
# driven directly by harnesses that include or extract the shipping
|
||||
# code: samples/state_rewind and samples/runahead. Plain, then under
|
||||
# ASan and UBSan with halt_on_error.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths:
|
||||
- state_manager.c
|
||||
- state_manager.h
|
||||
- runahead.c
|
||||
- runahead.h
|
||||
- runloop.h
|
||||
- samples/state_rewind/**
|
||||
- samples/runahead/**
|
||||
- tasks/task_nbio_slice.c
|
||||
- tasks/tasks_internal.h
|
||||
- libretro-common/queues/task_queue.c
|
||||
- .github/workflows/Linux-state-runahead-tests.yml
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths:
|
||||
- state_manager.c
|
||||
- state_manager.h
|
||||
- runahead.c
|
||||
- runahead.h
|
||||
- runloop.h
|
||||
- samples/state_rewind/**
|
||||
- samples/runahead/**
|
||||
- tasks/task_nbio_slice.c
|
||||
- tasks/tasks_internal.h
|
||||
- libretro-common/queues/task_queue.c
|
||||
- .github/workflows/Linux-state-runahead-tests.yml
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
unit:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: state_rewind
|
||||
run: make -C samples/state_rewind clean check
|
||||
- name: runahead
|
||||
run: make -C samples/runahead clean check
|
||||
|
||||
sanitize:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
ASAN_OPTIONS: abort_on_error=1:detect_leaks=1:print_stacktrace=1
|
||||
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- name: state_rewind (ASan + UBSan)
|
||||
run: make -C samples/state_rewind clean check SANITIZER=address,undefined
|
||||
- name: runahead (ASan + UBSan)
|
||||
run: make -C samples/runahead clean check SANITIZER=address,undefined
|
||||
@@ -1,84 +0,0 @@
|
||||
name: CI Linux TSan [threaded-video harness]
|
||||
|
||||
# The threaded-video harness under ThreadSanitizer. Linux-tsan-threaded-
|
||||
# video.yml builds with TSan and runs RetroArch headless with the
|
||||
# wrapper on, which is one configuration; the harness has a lane for
|
||||
# each thing the wrapper does - the runtime toggle, reinit under the
|
||||
# wrapper, the command mailbox, presenter repeats and their display
|
||||
# phase, the second ring waiter, the re-entrant frame, the call on the
|
||||
# waiting thread, display pacing, the zero-copy loan, the hardware
|
||||
# ring's bookkeeping - and runs each against the shipping objects with
|
||||
# nothing stubbed. It is where the send/wait race in the waiter call
|
||||
# was found, under TSan, on a developer's machine: this job is what
|
||||
# keeps that class of bug found in CI instead. Null drivers, no
|
||||
# display, no SDL, so no suppression file is needed; the harness sets
|
||||
# halt_on_error itself, so any report fails the job.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
linux-tsan-harness:
|
||||
name: TSan build, the threaded-video harness
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev xvfb x11-utils zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Configure
|
||||
# Non-Qt, as the harness requires (with Qt, main() lives in
|
||||
# ui_qt.o). Menu enabled: the menu lanes are half the point.
|
||||
run: |
|
||||
./configure \
|
||||
--disable-qt \
|
||||
--disable-discord \
|
||||
--disable-cheevos \
|
||||
--disable-networking \
|
||||
--disable-ffmpeg
|
||||
|
||||
- name: Build with DEBUG=1 and -fsanitize=thread
|
||||
run: |
|
||||
make -j$(getconf _NPROCESSORS_ONLN) SANITIZER=thread DEBUG=1
|
||||
|
||||
- name: Run the threaded-video harness under TSan
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# SAN=thread links exactly the build above; CYCLES=2 runs
|
||||
# each toggling lane twice. The harness's own TSAN_OPTIONS
|
||||
# halt on the first report.
|
||||
SAN=thread CYCLES=2 make -C samples/gfx/threaded_video check
|
||||
make -C samples/gfx/threaded_video clean
|
||||
@@ -1,165 +0,0 @@
|
||||
name: CI Linux TSan [Threaded video]
|
||||
|
||||
# Builds RetroArch with -fsanitize=thread and runs it headless with
|
||||
# video_threaded = "true", which is the configuration none of the other
|
||||
# jobs cover and the only one where the video thread exists at all.
|
||||
#
|
||||
# Why a separate job from Linux-asan-ubsan.yml: ASan and TSan cannot be
|
||||
# linked into the same binary, and the ASan job deliberately runs
|
||||
# unthreaded (video_threaded = "false") because its purpose is memory
|
||||
# errors on the simplest path. Threading bugs are invisible there --
|
||||
# the second thread is never created.
|
||||
#
|
||||
# What this reaches that nothing else does: the video thread wrapper's
|
||||
# command and frame handoff, every driver frame() call running off the
|
||||
# main thread, and the state the runloop and the video thread share --
|
||||
# window title, alive/focus/presentable, viewport and statistics. Two
|
||||
# real races were found this way and fixed (the window title handoff,
|
||||
# and the runloop asking a context for presentability while the video
|
||||
# thread rebuilt its swapchain); this job is what keeps them fixed.
|
||||
#
|
||||
# Soft-fail for now, like the ASan job's smoke tier was on its first
|
||||
# iterations: TSan reports races inside libSDL2 itself that RetroArch
|
||||
# neither causes nor can fix (see the suppression file written below),
|
||||
# and the baseline wants a few green runs before it gates.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
linux-tsan-threaded-video:
|
||||
name: Build with TSan and run with threaded video
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
# Same set as Linux-asan-ubsan.yml. libtsan ships with the gcc
|
||||
# on the runner image, so nothing sanitizer-specific is needed.
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev xvfb x11-utils zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Configure
|
||||
# Same trimmed surface as the ASan job, for the same reason:
|
||||
# a finding should be a RetroArch bug rather than noise from a
|
||||
# vendored subsystem. --enable-sdl2 is explicit because the run
|
||||
# below selects sdl2, and a silent fallback to another driver
|
||||
# would quietly stop exercising the threaded path this job is
|
||||
# for.
|
||||
run: |
|
||||
./configure \
|
||||
--disable-menu \
|
||||
--disable-discord \
|
||||
--disable-cheevos \
|
||||
--disable-networking \
|
||||
--enable-sdl2
|
||||
|
||||
- name: Build with -fsanitize=thread
|
||||
run: |
|
||||
make -j$(getconf _NPROCESSORS_ONLN) SANITIZER=thread
|
||||
test -x retroarch
|
||||
file retroarch
|
||||
|
||||
- name: Run headless with video_threaded = true
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set -eu
|
||||
|
||||
Xvfb :99 -screen 0 640x480x24 &
|
||||
for i in $(seq 1 15); do
|
||||
if DISPLAY=:99 xdpyinfo >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# A 1x1 PNG for the imageviewer core, as in the ASan job.
|
||||
python3 - <<'PY'
|
||||
import binascii, struct
|
||||
def chunk(t, d):
|
||||
c = t + d
|
||||
return struct.pack(">I", len(d)) + c + struct.pack(">I", binascii.crc32(c))
|
||||
png = b"\x89PNG\r\n\x1a\n"
|
||||
png += chunk(b"IHDR", struct.pack(">IIBBBBB", 1, 1, 8, 2, 0, 0, 0))
|
||||
png += chunk(b"IDAT", b"\x08\xd7\x63\xf8\xcf\xc0\x00\x00\x03\x01\x01\x00\x18\xdd\x8d\xb0")
|
||||
png += chunk(b"IEND", b"")
|
||||
open("/tmp/test.png", "wb").write(png)
|
||||
PY
|
||||
|
||||
# Races inside libSDL2 itself: no RetroArch frame appears on
|
||||
# either access, so there is nothing here to fix. Suppressed
|
||||
# by object so a real race in our own SDL-facing code is
|
||||
# still reported.
|
||||
cat > /tmp/tsan.supp <<'EOF'
|
||||
race:libSDL2-2.0.so
|
||||
EOF
|
||||
|
||||
mkdir -p /tmp/tsan-cfg
|
||||
cat > /tmp/tsan-cfg/retroarch.cfg <<EOF
|
||||
video_driver = "sdl2"
|
||||
audio_driver = "null"
|
||||
video_threaded = "true"
|
||||
video_fullscreen = "false"
|
||||
video_windowed_fullscreen = "false"
|
||||
EOF
|
||||
|
||||
set +e
|
||||
DISPLAY=:99 \
|
||||
TSAN_OPTIONS="halt_on_error=0 history_size=4 suppressions=/tmp/tsan.supp" \
|
||||
timeout 300 ./retroarch \
|
||||
-c /tmp/tsan-cfg/retroarch.cfg \
|
||||
-L cores/libretro-imageviewer/image_core.so \
|
||||
/tmp/test.png \
|
||||
--max-frames=400 \
|
||||
--verbose \
|
||||
> /tmp/tsan.out 2> /tmp/tsan.err
|
||||
rc=$?
|
||||
set -e
|
||||
|
||||
echo "exit=${rc}"
|
||||
echo "=== stderr (last 200) ==="
|
||||
tail -200 /tmp/tsan.err || true
|
||||
|
||||
# The video thread has to have existed, or the run proved
|
||||
# nothing at all and a green result would be misleading.
|
||||
if ! grep -q "ra-video\|[Tt]hreaded video" /tmp/tsan.out /tmp/tsan.err; then
|
||||
echo "[WARN] no sign of the video thread; the threaded path may not have run"
|
||||
fi
|
||||
|
||||
n=$(grep -c "WARNING: ThreadSanitizer" /tmp/tsan.err || true)
|
||||
echo "ThreadSanitizer reports: ${n}"
|
||||
if [ "${n}" -gt 0 ]; then
|
||||
echo ""
|
||||
echo "[INFO] ThreadSanitizer finding(s):"
|
||||
grep "SUMMARY: ThreadSanitizer" /tmp/tsan.err || true
|
||||
fi
|
||||
@@ -1,399 +0,0 @@
|
||||
name: CI Vulkan/GL/D3D11 [idle waits + driver harness]
|
||||
|
||||
# Two checks on the Vulkan driver, both born from the same bug: a
|
||||
# vkQueuePresentKHR under queue_lock waiting for GPU work that a
|
||||
# hardware core could only submit through lock_queue (parallel-GS /
|
||||
# Granite stopped the frontend that way). Every vkQueueWaitIdle and
|
||||
# vkDeviceWaitIdle in the driver had the same shape - a whole-queue
|
||||
# drain, under the lock the core needs, on shader change, overlay
|
||||
# load, font free and swapchain resize - and all of them were replaced
|
||||
# by waits on the driver's own fences.
|
||||
#
|
||||
# 1. Idle-wait check: tools/vulkan_idle_wait_check.py fails on any
|
||||
# vkQueueWaitIdle/vkDeviceWaitIdle in the Vulkan code that is not
|
||||
# on tools/vulkan_idle_wait_allow.list, and on a stale entry.
|
||||
#
|
||||
# 2. Validation harness: the threaded-video harness (real frontend,
|
||||
# real driver, only main() replaced) run on the Vulkan driver over
|
||||
# lavapipe under Xvfb, with the tree built VULKAN_DEBUG=1 so
|
||||
# VK_LAYER_KHRONOS_validation is loaded. The lanes exercise driver
|
||||
# reinit under the wrapper, geometry changes, async texture loads,
|
||||
# font marshalling, present repeat and resize; the layer turns a
|
||||
# texture destroyed while a frame still samples it, a barrier
|
||||
# inside a render pass, or an object leaked at device teardown into
|
||||
# a logged error, and the check-vulkan target fails on any. Those
|
||||
# three were the pre-existing findings the lane produced on its
|
||||
# first run.
|
||||
#
|
||||
# 3. TSan harness: the same lanes on the same driver, built with
|
||||
# -fsanitize=thread. The null-driver TSan job never runs driver
|
||||
# code on the video thread, so a plain field shared between the
|
||||
# frame thread and a driver's frame (the shader chains'
|
||||
# FrameTimeDelta was one) only shows up here. The layer and the
|
||||
# ICD are not instrumented and are suppressed; frontend races fail.
|
||||
# An address,undefined build of the same runs beside it, and the
|
||||
# context-only vulkan_validation sample runs on its own.
|
||||
#
|
||||
# 5. D3D11 harness: the same lanes on the d3d11 driver, on a Windows
|
||||
# runner through MSYS2's MinGW64 build of the tree (no Qt, so main
|
||||
# stays in retroarch.o for the harness to replace) and the software
|
||||
# adapter the runner exposes (Microsoft Basic Render Driver, which
|
||||
# is WARP). The first real-driver coverage the Windows drivers get.
|
||||
#
|
||||
# 4. GL harness: the same lanes on the gl and glcore drivers over
|
||||
# llvmpipe (LIBGL_ALWAYS_SOFTWARE=1), release and TSan. A GL
|
||||
# context is owned by one thread at a time, so anything the
|
||||
# frontend does against the driver from the wrong thread is an X
|
||||
# BadAccess here rather than a corruption elsewhere; the first run
|
||||
# caught the OSD font rebuild doing exactly that.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
vulkan-idle-waits:
|
||||
name: Vulkan idle-wait allowlist
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Checker self-test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
python3 tools/vulkan_idle_wait_check.py --selftest
|
||||
|
||||
- name: Tree check
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
python3 tools/vulkan_idle_wait_check.py
|
||||
|
||||
vulkan-validation-harness:
|
||||
name: Threaded-video harness on Vulkan (lavapipe, validation layer)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 8
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev libxcb1-dev libxinerama-dev libxrandr-dev libxxf86vm-dev libxv-dev xvfb x11-utils zlib1g-dev libfreetype6-dev libvulkan-dev mesa-vulkan-drivers vulkan-validationlayers vulkan-tools libasound2-dev"
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Configure
|
||||
# Non-Qt, as the harness requires (with Qt, main() lives in
|
||||
# ui_qt.o). Everything else at its default so the Vulkan driver
|
||||
# is built with every path a release build has.
|
||||
run: |
|
||||
./configure --disable-qt
|
||||
grep -q '^HAVE_VULKAN = 1' config.mk
|
||||
|
||||
- name: Build with VULKAN_DEBUG=1
|
||||
# VULKAN_DEBUG enables VK_LAYER_KHRONOS_validation and the
|
||||
# debug messenger that reports through RARCH_ERR. It is a
|
||||
# tree-wide define: vulkan_context_t carries a member under it,
|
||||
# so every TU that includes vulkan_common.h must see it.
|
||||
run: |
|
||||
make -j$(getconf _NPROCESSORS_ONLN) VULKAN_DEBUG=1
|
||||
test -x retroarch
|
||||
|
||||
- name: Run the harness on Vulkan under the validation layer
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
Xvfb :99 -screen 0 640x480x24 &
|
||||
for i in $(seq 1 15); do
|
||||
if DISPLAY=:99 xdpyinfo >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
export DISPLAY=:99
|
||||
export VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json
|
||||
# The harness build reuses the tree's own compile and link
|
||||
# lines, so it has to name the same build: VK_DEBUG=1. Its
|
||||
# surface and overlay-page lanes run the driver's real
|
||||
# in-place texture update and its borrowed-texture overlay
|
||||
# page here, under the validation layer.
|
||||
SAN=none VK_DEBUG=1 CYCLES=2 make -C samples/gfx/threaded_video check-vulkan
|
||||
make -C samples/gfx/threaded_video clean
|
||||
|
||||
vulkan-validation-sample:
|
||||
name: vulkan_validation sample (lavapipe, validation layer)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 8
|
||||
run: |
|
||||
pkgs="build-essential libx11-dev libx11-xcb-dev libxcb1-dev xvfb x11-utils libvulkan-dev mesa-vulkan-drivers vulkan-validationlayers vulkan-tools"
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Build and run
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# The context-only sample: vulkan_common.c against the real
|
||||
# loader, brought up and torn down under the validation
|
||||
# layer, and every memory type it advertises selected. It
|
||||
# exits 77 with no display or no device, and that is a pass.
|
||||
Xvfb :99 -screen 0 640x480x24 &
|
||||
for i in $(seq 1 15); do
|
||||
if DISPLAY=:99 xdpyinfo >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
export DISPLAY=:99
|
||||
make -C samples/gfx/vulkan_validation
|
||||
rc=0
|
||||
DISPLAY=:99 VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json \
|
||||
samples/gfx/vulkan_validation/vulkan_validation_test || rc=$?
|
||||
make -C samples/gfx/vulkan_validation clean
|
||||
if [ "$rc" = 77 ]; then echo "skipped: no device"; exit 0; fi
|
||||
exit $rc
|
||||
|
||||
vulkan-asan-harness:
|
||||
name: Threaded-video harness on Vulkan under ASan+UBSan (lavapipe)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 8
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev libxcb1-dev libxinerama-dev libxrandr-dev libxxf86vm-dev libxv-dev xvfb x11-utils zlib1g-dev libfreetype6-dev libvulkan-dev mesa-vulkan-drivers vulkan-validationlayers vulkan-tools libasound2-dev"
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --disable-qt
|
||||
grep -q '^HAVE_VULKAN = 1' config.mk
|
||||
|
||||
- name: Build with DEBUG=1, VULKAN_DEBUG=1 and -fsanitize=address,undefined
|
||||
run: |
|
||||
make -j$(getconf _NPROCESSORS_ONLN) SANITIZER=address,undefined DEBUG=1 VULKAN_DEBUG=1
|
||||
test -x retroarch
|
||||
|
||||
- name: Run the harness on Vulkan under ASan+UBSan
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
Xvfb :99 -screen 0 640x480x24 &
|
||||
for i in $(seq 1 15); do
|
||||
if DISPLAY=:99 xdpyinfo >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
export DISPLAY=:99
|
||||
export VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json
|
||||
SAN=address VK_DEBUG=1 CYCLES=1 make -C samples/gfx/threaded_video check-vulkan
|
||||
make -C samples/gfx/threaded_video clean
|
||||
|
||||
vulkan-tsan-harness:
|
||||
name: Threaded-video harness on Vulkan under TSan (lavapipe)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 8
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev libxcb1-dev libxinerama-dev libxrandr-dev libxxf86vm-dev libxv-dev xvfb x11-utils zlib1g-dev libfreetype6-dev libvulkan-dev mesa-vulkan-drivers vulkan-validationlayers vulkan-tools libasound2-dev"
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --disable-qt
|
||||
grep -q '^HAVE_VULKAN = 1' config.mk
|
||||
|
||||
- name: Build with DEBUG=1, VULKAN_DEBUG=1 and -fsanitize=thread
|
||||
run: |
|
||||
make -j$(getconf _NPROCESSORS_ONLN) SANITIZER=thread DEBUG=1 VULKAN_DEBUG=1
|
||||
test -x retroarch
|
||||
|
||||
- name: Run the harness on Vulkan under TSan
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
Xvfb :99 -screen 0 640x480x24 &
|
||||
for i in $(seq 1 15); do
|
||||
if DISPLAY=:99 xdpyinfo >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
export DISPLAY=:99
|
||||
export VK_DRIVER_FILES=/usr/share/vulkan/icd.d/lvp_icd.json
|
||||
SAN=thread VK_DEBUG=1 CYCLES=1 make -C samples/gfx/threaded_video check-vulkan
|
||||
make -C samples/gfx/threaded_video clean
|
||||
|
||||
gl-harness:
|
||||
name: Threaded-video harness on ${{ matrix.driver }} (llvmpipe, ${{ matrix.san }})
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
driver: [gl, glcore]
|
||||
san: [none, address, thread]
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
timeout-minutes: 8
|
||||
run: |
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev libxcb1-dev libxinerama-dev libxrandr-dev libxxf86vm-dev libxv-dev xvfb x11-utils zlib1g-dev libfreetype6-dev libgl-dev libglx-dev libegl-dev libgles-dev libgl1-mesa-dri libglx-mesa0 mesa-utils libasound2-dev"
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
./configure --disable-qt
|
||||
grep -q '^HAVE_OPENGL = 1' config.mk
|
||||
grep -q '^HAVE_OPENGL_CORE = 1' config.mk
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
case "${{ matrix.san }}" in
|
||||
thread) make -j$(getconf _NPROCESSORS_ONLN) SANITIZER=thread DEBUG=1 ;;
|
||||
address) make -j$(getconf _NPROCESSORS_ONLN) SANITIZER=address,undefined DEBUG=1 ;;
|
||||
*) make -j$(getconf _NPROCESSORS_ONLN) ;;
|
||||
esac
|
||||
test -x retroarch
|
||||
|
||||
- name: Run the harness on ${{ matrix.driver }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
Xvfb :99 -screen 0 640x480x24 &
|
||||
for i in $(seq 1 15); do
|
||||
if DISPLAY=:99 xdpyinfo >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
export DISPLAY=:99
|
||||
export LIBGL_ALWAYS_SOFTWARE=1
|
||||
SAN=${{ matrix.san }} DRIVER=${{ matrix.driver }} CYCLES=1 \
|
||||
make -C samples/gfx/threaded_video check-driver
|
||||
make -C samples/gfx/threaded_video clean
|
||||
|
||||
d3d-harness:
|
||||
name: Threaded-video harness on ${{ matrix.driver }} (WARP, MSYS2 MinGW64)
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 90
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# d3d12 runs the same lanes on the other explicit-API backend:
|
||||
# its in-place texture update is fence-tagged against the frame
|
||||
# that last copied from the upload buffer, which only a running
|
||||
# driver exercises.
|
||||
driver: [d3d11, d3d12]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MINGW64
|
||||
install: >-
|
||||
base-devel
|
||||
git
|
||||
pacboy: >-
|
||||
cc:p
|
||||
gdb:p
|
||||
|
||||
- name: Configure and build RetroArch (no Qt)
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -eu
|
||||
./configure --disable-qt
|
||||
grep -q '^HAVE_D3D11 = 1' config.mk
|
||||
grep -q '^HAVE_D3D12 = 1' config.mk
|
||||
make -j"$(nproc)"
|
||||
test -x retroarch.exe
|
||||
|
||||
- name: Run the harness on ${{ matrix.driver }}
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
set -eu
|
||||
samples/gfx/threaded_video/build.sh
|
||||
SAN=none DRIVER=${{ matrix.driver }} CYCLES=1 GDB=1 make -C samples/gfx/threaded_video check-driver
|
||||
make -C samples/gfx/threaded_video clean
|
||||
@@ -2,7 +2,6 @@ name: CI Linux (i686)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-i386-ubuntu:xenial-gcc9
|
||||
options: --user root
|
||||
@@ -38,13 +32,6 @@ jobs:
|
||||
make -j$(getconf _NPROCESSORS_ONLN) clean
|
||||
make -j$(getconf _NPROCESSORS_ONLN) info all
|
||||
|
||||
- name: Stack frame sweep
|
||||
run: |
|
||||
set -eu
|
||||
# Every stack frame in the graphics objects against the
|
||||
# ceiling in CODING-GUIDELINES. It runs here rather than with
|
||||
# the other checks because this is the job that builds the
|
||||
# drivers: the menu harness turns OpenGL, Vulkan and the rest
|
||||
# off for its own reasons, and the frames this sweep is for
|
||||
# live in exactly those files.
|
||||
.github/workflows/scripts/stack-frame-sweep.sh
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
@@ -2,7 +2,6 @@ name: CI Windows (MSVC)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -14,15 +13,10 @@ env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
# These jobs run smoke tests to ensure that MSVC-specific builds work properly.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
|
||||
msvc:
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
matrix:
|
||||
version: [UWP, 2019, 2022]
|
||||
@@ -37,7 +31,7 @@ jobs:
|
||||
platform: x64
|
||||
# Qt and Cg builds are excluded for now
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI Windows (MSYS2)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -10,10 +9,6 @@ on:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
msys2-build-test:
|
||||
strategy:
|
||||
@@ -33,16 +28,16 @@ jobs:
|
||||
runner: windows-11-arm
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 90
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.sys }}
|
||||
update: true
|
||||
install: >-
|
||||
base-devel
|
||||
git
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
name: CI macOS PowerPC (cross)
|
||||
|
||||
# Builds the macOS (Cocoa + OpenGL) frontend for 32-bit PowerPC with a
|
||||
# GCC 14 cross compiler on Linux, against the 10.5 SDK, once for a
|
||||
# 10.4 deployment target and once for 10.5. This is the
|
||||
# compiler-compatibility leg for the Apple code: no clang, no ARC, no
|
||||
# blocks, no GCD, and nothing newer than Leopard in the SDK. Whatever
|
||||
# the Xcode 3 / PowerPC project would reject, this rejects first.
|
||||
#
|
||||
# Toolchain: VariantXYZ's GCC 14.2 powerpc-apple-darwin8 image (GCC
|
||||
# with the Objective-C front end, cctools-port ld/as, dsymutil), see
|
||||
# https://github.com/VariantXYZ/gcc-powerpc-apple-darwin8.
|
||||
#
|
||||
# The audit step lists every import the binary makes that the 10.4u
|
||||
# SDK does not export; for the 10.4 target that list must be empty,
|
||||
# which is what makes the binary launch on Tiger.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
TARGET: powerpc-apple-darwin8
|
||||
SDKROOT: /usr/local/MacOSX10.5.sdk
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
container:
|
||||
image: ghcr.io/variantxyz/gcc-powerpc-apple-darwin8:build-gcc-14.2-MacOSXSDK10.5
|
||||
options: --user root
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
deployment_target: ["10.4", "10.5"]
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment_target }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
$TARGET-gcc --version | head -n 1
|
||||
./configure --host=$TARGET \
|
||||
--disable-qt --disable-sdl --disable-sdl2 --disable-ffmpeg \
|
||||
--disable-x11 --disable-wayland --disable-egl \
|
||||
--disable-pulse --disable-alsa --disable-jack --disable-oss \
|
||||
--disable-udev --disable-v4l2 --disable-libusb \
|
||||
--disable-freetype --disable-flac --disable-discord \
|
||||
--disable-translate --disable-microphone --disable-avf \
|
||||
--disable-mfi --disable-slang --disable-spirv_cross \
|
||||
--disable-glslang --disable-crtswitchres --disable-al \
|
||||
--disable-cdrom
|
||||
|
||||
- name: Compile RA
|
||||
run: |
|
||||
make ARCH=ppc -j$(getconf _NPROCESSORS_ONLN)
|
||||
file retroarch
|
||||
$TARGET-otool -l retroarch | grep -A2 LC_VERSION_MIN_MACOSX
|
||||
|
||||
- name: Audit imports against the 10.4u SDK
|
||||
if: matrix.deployment_target == '10.4'
|
||||
run: |
|
||||
set -e
|
||||
cd /usr/local
|
||||
wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.4u.sdk.tar.xz
|
||||
tar xJf MacOSX10.4u.sdk.tar.xz && rm MacOSX10.4u.sdk.tar.xz
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
SDK4=/usr/local/MacOSX10.4u.sdk
|
||||
$TARGET-nm -u retroarch | sed 's/^ *//' | sort -u > undef.txt
|
||||
( find $SDK4/usr/lib -name '*.dylib' ; \
|
||||
find $SDK4/System/Library/Frameworks -type f -path '*/Versions/*' ! -path '*/Headers/*' ! -path '*/Resources/*' ) \
|
||||
| while read -r lib; do $TARGET-nm -g -arch ppc "$lib" 2>/dev/null | awk 'NF==3 {print $3} NF==2 {print $2}'; done \
|
||||
| sort -u > sdk4.txt
|
||||
echo "Imports absent from the 10.4u SDK:"
|
||||
comm -23 undef.txt sdk4.txt | grep -v '^_OBJC_CLASS_\$_\|^\.objc_class_name_' | tee missing.txt
|
||||
test ! -s missing.txt
|
||||
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RetroArch-macOS-ppc-${{ matrix.deployment_target }}-${{ steps.slug.outputs.sha8 }}
|
||||
path: retroarch
|
||||
@@ -2,7 +2,6 @@ name: CI macOS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
@@ -11,27 +10,13 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Cocoa companion harness on Apple's AppKit
|
||||
run: |
|
||||
set -o pipefail
|
||||
# The same harness the Linux job runs under GNUstep, built with
|
||||
# Apple's clang against the real Cocoa framework and run on the
|
||||
# runner's window server: key-window arbitration after closing the
|
||||
# companion, the grid, the tables, the dialogs - as AppKit does them.
|
||||
tools/companion_cocoa_test_macos.sh 2>&1 | grep -v "^$"
|
||||
|
||||
- name: Compile RA
|
||||
run: |
|
||||
set -o pipefail
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI Miyoo ARM32
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-dingux:latest
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile RA
|
||||
run: |
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
name: CI msg_hash packed tables
|
||||
|
||||
# intl/msg_hash_<lang>.h is generated as two objects that are paired by
|
||||
# position: the blob struct holds every row as one run of NUL-terminated
|
||||
# strings, and ids[] names the enum each row belongs to.
|
||||
# msg_hash_strtab_index_build() walks the blob once and hands row N to
|
||||
# ids[N].
|
||||
#
|
||||
# Nothing in the C ties them together. Both objects are well formed on
|
||||
# their own, and the sizeof() contiguity check inside the header only
|
||||
# measures the blob against itself, so a row removed from one side and
|
||||
# left on the other compiles clean everywhere and renames every row
|
||||
# after it at runtime. The menu then shows real translated strings
|
||||
# belonging to other entries - which is what #19534 reported, in every
|
||||
# language at once. English is unaffected, because msg_hash_us.c is a
|
||||
# switch rather than a packed table, so no English-language test, manual
|
||||
# or automated, can see it either.
|
||||
#
|
||||
# 5d0f721 did exactly that: retiring audio_block_frames took
|
||||
# MENU_ENUM_LABEL_VALUE_AUDIO_BLOCK_FRAMES and its sublabel out of ids[]
|
||||
# in twenty-nine headers and left the two blob members behind. From the
|
||||
# audio device row onward every language was off by one or two.
|
||||
#
|
||||
# The check re-derives the pairing from the member names - json2h.py
|
||||
# names each member after the djb2 hash of the key its row was emitted
|
||||
# for - and compares it against ids[] row for row, under the guards. It
|
||||
# reads the files rather than building them, so it covers every
|
||||
# language and every #ifdef configuration at once, which no build job
|
||||
# does. intl/json2h.py runs the same check on its own output before
|
||||
# writing, so this is the lane that catches a header edited by hand.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
msg-hash-packed-check:
|
||||
name: blob and ids[] pairing
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Checker self-test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Fixture pass: a consistent table is clean, 5d0f721's shape
|
||||
# (a row dropped from ids[] only) is caught, so is its mirror,
|
||||
# a member one byte wider than its string, a guard present on
|
||||
# one side only, and a contiguity constant left stale.
|
||||
#
|
||||
# The fixtures are built by the checker rather than lifted
|
||||
# from intl/, so this reports the same thing whether or not
|
||||
# the shipped headers currently pass - it is measuring the
|
||||
# checker, not the tree.
|
||||
python3 tools/msg_hash_packed_check.py --selftest
|
||||
|
||||
- name: Tree check
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Every packed header: row N's member name must be what the
|
||||
# key in ids[N] hashes to and carry the same guard, each
|
||||
# member must be exactly its string plus the NUL (or exactly
|
||||
# the chunk, for a non-final chunk of a split row), no row may
|
||||
# hold an embedded NUL, and the sizeof() check must still add
|
||||
# up to the members it guards.
|
||||
python3 tools/msg_hash_packed_check.py
|
||||
|
||||
- name: Format parity self-test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Fixture pass: matching conversions are clean, a conversion
|
||||
# lost, invented, retyped or reordered positionally is caught,
|
||||
# and a percent sign in prose - English's "50% of this value",
|
||||
# Hungarian's "50%-a", a doubled %% - is not mistaken for one.
|
||||
# The format-site scan is measured too: it must see a format
|
||||
# argument taken from the table directly and through a local,
|
||||
# and must not see a string that is copied, passed as a value,
|
||||
# or split on a placeholder rather than formatted.
|
||||
python3 tools/msg_hash_format_check.py --selftest
|
||||
|
||||
- name: Format parity tree check
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Every translated row against its English source: the same
|
||||
# conversions in the same order wherever English has any, no
|
||||
# positional %n$ anywhere, and no conversion invented in a row
|
||||
# that is used as a format string and has none in English.
|
||||
# That last set is measured from the call sites rather than
|
||||
# assumed from the namespace: ninety rows reach a printf-family
|
||||
# format argument today and twenty-nine of them are not MSG_*.
|
||||
python3 tools/msg_hash_format_check.py
|
||||
@@ -1,54 +0,0 @@
|
||||
name: CI Overlapping-buffer copies
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
overlap-copy-check:
|
||||
name: Overlapping dst/src in copy calls
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Checker self-test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Fixture pass: exact-alias strlcpy and overlapping memcpy
|
||||
# element shifts are flagged, memmove is not, unguarded
|
||||
# param->param copy helpers called with aliased buffers are
|
||||
# flagged while alias-guarded helpers are not, the
|
||||
# allowlist suppresses audited same-base copies but can
|
||||
# never suppress an exact alias, and stale allowlist
|
||||
# entries are reported.
|
||||
python3 tools/overlap_copy_check.py --selftest
|
||||
|
||||
- name: Tree check
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# strlcpy resolves to the fortified __strlcpy_chk on macOS,
|
||||
# which aborts on ANY dst/src overlap (bd79aee: typing into
|
||||
# the OSK crashed with EXC_BREAKPOINT), and overlapping
|
||||
# memcpy is UB everywhere (e942ee2: leaderboard element
|
||||
# shift). The portable strlcpy fallback tolerates aliasing
|
||||
# on Linux/Windows, so nothing else in CI can catch this
|
||||
# class before it ships to Mac users. Audited-intentional
|
||||
# same-buffer copies live in tools/overlap_copy_allow.list.
|
||||
python3 tools/overlap_copy_check.py
|
||||
@@ -2,7 +2,6 @@ name: CI PS2
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-ps2:latest
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile Salamander
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI PS3/PSL1GHT
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-psl1ght:latest
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile Salamander
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI PS4/ORBIS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-orbis:latest
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI PSP
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-psp:latest
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile bootstrap
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI PSVita
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-vita:latest-20260905
|
||||
image: reallibretroretroarch/libretro-build-vita:latest
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile Salamander
|
||||
run: |
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
name: CI RGUI pixel format
|
||||
|
||||
# RGUI draws into a 16bpp framebuffer, so every menu colour, wallpaper
|
||||
# and thumbnail pixel passes through one of the argb32_to_* converters
|
||||
# in menu/drivers/rgui.c. Each one quantises the four 8-bit channels
|
||||
# to its target widths and ORs them into their fields, with the widths
|
||||
# and the shifts written by hand on separate lines - seven formats,
|
||||
# fourteen driver idents, and a dithered twin of each.
|
||||
#
|
||||
# Nothing else in CI can see a mistake there. The formats are
|
||||
# per-platform: rgb565 belongs to sdl_dingux, sdl_rs90 and xvideo, and
|
||||
# no runner boots a 565 menu, so a converter can be wrong for months
|
||||
# while every desktop build renders perfectly. It is not a build
|
||||
# break either - a width that outgrows its shift just ORs into the
|
||||
# neighbouring field, silently.
|
||||
#
|
||||
# c6b66c9 did exactly that: it widened green in argb32_to_rgb565 from
|
||||
# 5 bits to 6 but left the packing at (g << 6), where 6-bit green
|
||||
# needs (g << 5). Green's top bit landed on red's LSB, the green
|
||||
# field became (g & 31) << 1, and green wrapped hard at half scale -
|
||||
# mid grey rendered as (139, 0, 131). It shipped, and came back as
|
||||
# #19469, bisected by hand on an Anbernic RG300X.
|
||||
#
|
||||
# The check lifts the marked pixel format conversion block out of
|
||||
# rgui.c and compiles it on its own against two stubs, so it tests the
|
||||
# real shipped converters and the real dispatch table. Field layouts
|
||||
# are measured from the converters, not hardcoded, so a new format
|
||||
# gets checked the moment its row is added to rgui_pixel_format_map.
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'menu/drivers/rgui.c'
|
||||
- 'tools/rgui_pixfmt_check.py'
|
||||
- '.github/workflows/RGUI-Pixel-Format-Check.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'menu/drivers/rgui.c'
|
||||
- 'tools/rgui_pixfmt_check.py'
|
||||
- '.github/workflows/RGUI-Pixel-Format-Check.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
rgui-pixfmt-check:
|
||||
name: RGUI 8-bit to 16bpp conversion contract
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Checker self-test
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Fixture pass: the corrected 6-bit green packed at <<5
|
||||
# passes, c6b66c9's same green packed at <<6 is caught as a
|
||||
# red/green overlap, and a table row wired to another
|
||||
# format's dithered twin is caught as a reach mismatch.
|
||||
#
|
||||
# Both green fixtures are made by forcing the packing shift
|
||||
# either way, so the self-test reports the same thing
|
||||
# whether or not the tree is currently fixed - it is
|
||||
# measuring the checker, not the tree.
|
||||
python3 tools/rgui_pixfmt_check.py --selftest --cc gcc
|
||||
|
||||
- name: Tree check
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
# Per driver ident, and for the unknown-ident fallback: the
|
||||
# bits each input channel can change must be disjoint from
|
||||
# every other channel's and contiguous; 0 and 255 must give
|
||||
# an empty and a full field; the field must be monotonic in
|
||||
# the input; and the dithered twin must cover the same bits
|
||||
# and stay within one level of the plain converter.
|
||||
python3 tools/rgui_pixfmt_check.py --cc gcc
|
||||
@@ -2,7 +2,6 @@ name: CI RS90 Odbeta MIPS32
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-dingux:odbeta
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile RA
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI RetroFW MIPS32
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-dingux:odbeta
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile RA
|
||||
run: |
|
||||
|
||||
@@ -16,10 +16,9 @@ jobs:
|
||||
build:
|
||||
name: build
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI Switch/libnx
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,20 +12,15 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-libnx-devkitpro:v4-10-0
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compile RA
|
||||
run: |
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI Wii
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-devkitpro:latest
|
||||
options: --user root
|
||||
@@ -37,3 +31,7 @@ jobs:
|
||||
run: |
|
||||
make -f Makefile.wii -j$(getconf _NPROCESSORS_ONLN) clean
|
||||
make -f Makefile.wii -j$(getconf _NPROCESSORS_ONLN) EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0 HAVE_STATIC_DUMMY=1 info all
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI WiiU
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-wiiu:latest
|
||||
options: --user root
|
||||
@@ -37,3 +31,6 @@ jobs:
|
||||
run: |
|
||||
make -f Makefile.wiiu -j$(getconf _NPROCESSORS_ONLN) clean
|
||||
make -f Makefile.wiiu -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 info all
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
@@ -2,7 +2,6 @@ name: CI Windows ARM64 (MSVC)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
msvc:
|
||||
runs-on: windows-11-arm
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
matrix:
|
||||
version: [2022]
|
||||
@@ -28,7 +22,7 @@ jobs:
|
||||
platform: [ARM64]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI Windows i686 (MXE)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-mxe-win32-cross:gcc10
|
||||
options: --user root
|
||||
@@ -34,3 +28,7 @@ jobs:
|
||||
./configure --host=i686-w64-mingw32.shared
|
||||
make clean
|
||||
make -j$(getconf _NPROCESSORS_ONLN)
|
||||
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
@@ -1,100 +0,0 @@
|
||||
name: CI Windows (memmap area)
|
||||
|
||||
# The fastmem window's reservation has two implementations and a Windows
|
||||
# runner only ever exercises one of them. From Windows 10 1803 the area is
|
||||
# a placeholder that mapping splits and unmapping coalesces; below that --
|
||||
# back to Windows 2000 -- it is one reservation per allocation-granularity
|
||||
# slot, released and mapped over one slot at a time. Every hosted runner is
|
||||
# far past 1803, so the legacy path never runs unless it is asked for, and
|
||||
# MEMSHM_AREA_FORCE_LEGACY is how it is asked for.
|
||||
#
|
||||
# It is worth running because its failures are quiet. A placeholder split
|
||||
# that loses a range, or a slot released and not put back, does not crash:
|
||||
# it maps the wrong memory, or maps nothing and lets a later map land
|
||||
# somewhere else. A core with a guest RAM behind that reads and writes the
|
||||
# wrong addresses.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'libretro-common/memmap/**'
|
||||
- 'libretro-common/include/memmap.h'
|
||||
- 'libretro-common/samples/memmap/**'
|
||||
- '.github/workflows/Windows-memmap-area.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'libretro-common/memmap/**'
|
||||
- 'libretro-common/include/memmap.h'
|
||||
- 'libretro-common/samples/memmap/**'
|
||||
- '.github/workflows/Windows-memmap-area.yml'
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
area:
|
||||
runs-on: windows-2022
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# The path this runner takes on its own.
|
||||
- name: placeholders
|
||||
defines: ''
|
||||
# And the one every Windows before 10 1803 takes.
|
||||
- name: legacy
|
||||
defines: '-DMEMSHM_AREA_FORCE_LEGACY'
|
||||
name: ${{ matrix.name }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Report the runner's Windows build
|
||||
shell: powershell
|
||||
run: |
|
||||
$v = [System.Environment]::OSVersion.Version
|
||||
Write-Host "Windows $($v.Major).$($v.Minor) build $($v.Build)"
|
||||
if ($v.Build -lt 17134) {
|
||||
Write-Host "::notice::Runner predates 10 1803; the placeholder job tests the legacy path too"
|
||||
}
|
||||
|
||||
# vcvarsall through vswhere, which ships with every Visual Studio and
|
||||
# needs no third-party action: this repo uses only
|
||||
# microsoft/setup-msbuild, and one job is not a reason to add
|
||||
# another dependency to the supply chain.
|
||||
- name: Build the area sample
|
||||
shell: cmd
|
||||
run: |
|
||||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set VSPATH=%%i
|
||||
if not defined VSPATH exit /b 1
|
||||
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
|
||||
cd libretro-common\samples\memmap\memshm_area_test
|
||||
cl /nologo /W3 /WX /I..\..\..\include ${{ matrix.defines }} ^
|
||||
memshm_area_test.c ..\..\..\memmap\memmap.c ^
|
||||
/Fe:memshm_area_test.exe
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
# The sample's own exit code covers the assertions. This also fails
|
||||
# a run that reported no area at all: that is a pass for a platform
|
||||
# which cannot have one, and a silent no-op on a runner that can.
|
||||
- name: Run it, and fail if the area was skipped
|
||||
shell: powershell
|
||||
run: |
|
||||
cd libretro-common\samples\memmap\memshm_area_test
|
||||
$out = & .\memshm_area_test.exe | Out-String
|
||||
Write-Host $out
|
||||
if ($out -match 'skipped') {
|
||||
Write-Error "no area on a runner that must be able to provide one"
|
||||
exit 1
|
||||
}
|
||||
if ($out -notmatch 'memshm area: ok') {
|
||||
Write-Error "the sample did not report ok"
|
||||
exit 1
|
||||
}
|
||||
@@ -2,7 +2,6 @@ name: CI Windows x64 (MXE)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
repository_dispatch:
|
||||
types: [run_build]
|
||||
@@ -13,14 +12,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
container:
|
||||
image: reallibretroretroarch/libretro-build-mxe-win64-cross:gcc10
|
||||
options: --user root
|
||||
@@ -34,3 +28,7 @@ jobs:
|
||||
./configure --host=x86_64-w64-mingw32.shared
|
||||
make clean
|
||||
make -j$(getconf _NPROCESSORS_ONLN)
|
||||
|
||||
- name: Get short SHA
|
||||
id: slug
|
||||
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
|
||||
@@ -14,7 +14,6 @@ jobs:
|
||||
permissions:
|
||||
contents: write # for Git to git push
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Setup Java JDK
|
||||
uses: actions/setup-java@v4
|
||||
@@ -26,7 +25,7 @@ jobs:
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v3
|
||||
- name: Crowdin Sync
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
@@ -16,7 +16,6 @@ permissions:
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Setup Java JDK
|
||||
uses: actions/setup-java@v4
|
||||
@@ -28,7 +27,7 @@ jobs:
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v3
|
||||
- name: Crowdin Sync
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
@@ -2,7 +2,6 @@ name: CI iOS (13)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
@@ -11,14 +10,9 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
@@ -16,38 +16,16 @@ permissions:
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
|
||||
|
||||
jobs:
|
||||
linux-c89: # Smoketest build using most restrictive compiler and default options
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
# libvulkan-dev brings the Vulkan driver, the slang shader stack
|
||||
# (shader_vulkan.c, slang_process.c, glslang_util.c, slang_cache.c)
|
||||
# and the Vulkan contexts into this lane; without it configure
|
||||
# drops them and none of those C files ever meet -std=c89.
|
||||
pkgs="build-essential libxkbcommon-dev libx11-xcb-dev libvulkan-dev zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev nvidia-cg-toolkit nvidia-cg-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm"
|
||||
if dpkg -s $pkgs >/dev/null 2>&1; then
|
||||
echo "All packages already present on runner image; skipping apt."
|
||||
exit 0
|
||||
fi
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get update -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
sudo apt-get install -y \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
$pkgs
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install build-essential libxkbcommon-dev libx11-xcb-dev zlib1g-dev libfreetype6-dev libegl1-mesa-dev libgles2-mesa-dev libgbm-dev nvidia-cg-toolkit nvidia-cg-dev libavcodec-dev libsdl2-dev libsdl-image1.2-dev libxml2-dev yasm
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v3
|
||||
- name: Configure
|
||||
run: ./configure
|
||||
- name: Build
|
||||
|
||||
@@ -26,16 +26,15 @@ fail=0
|
||||
check() {
|
||||
name="$1"; shift
|
||||
defs="$1"; shift
|
||||
bad=0
|
||||
for tu in "$@"; do
|
||||
if ! out=$($CC $WARN $INC $BASE $defs -fsyntax-only "$tu" 2>&1); then
|
||||
echo "FAIL $name"
|
||||
echo " $tu"
|
||||
echo "$out" | sed 's/^/ /' | head -12
|
||||
fail=1; bad=1
|
||||
fail=1
|
||||
fi
|
||||
done
|
||||
[ "$bad" = 1 ] || echo "ok $name"
|
||||
[ "$fail" = 1 ] || echo "ok $name"
|
||||
}
|
||||
|
||||
AUDIO="libretro-common/formats/audio_transfer.c libretro-common/audio/audio_mixer.c"
|
||||
@@ -87,31 +86,6 @@ STUBS="$(dirname "$0")/stubs"
|
||||
# host headers are the real ones and deprecate things the target's do not
|
||||
ARMWARN="$WARN -Wno-deprecated-declarations"
|
||||
|
||||
# A platform's own video driver, which the arm lanes above do not reach:
|
||||
# they check that one file's headers resolve, not that the driver a
|
||||
# console actually draws with still compiles. Settings a driver reads
|
||||
# while answering the frontend have moved into the frame descriptor more
|
||||
# than once, and each time these drivers were the ones left behind -
|
||||
# nothing in CI compiles them.
|
||||
#
|
||||
# @extra carries whatever headers the driver needs that the runner has;
|
||||
# a lane whose headers are absent says so and is not a failure.
|
||||
platform_video() {
|
||||
name="$1"; defs="$2"; extra="$3"; tu="$4"; probe="$5"
|
||||
if [ -n "$probe" ] && [ ! -f "$probe" ]; then
|
||||
echo "skip $name (no $probe)"
|
||||
return
|
||||
fi
|
||||
if ! out=$($CC $WARN $extra $INC $BASE $defs -fsyntax-only "$tu" 2>&1); then
|
||||
echo "FAIL $name"
|
||||
echo " $tu"
|
||||
printf '%s\n' "$out" | sed 's/^/ /' | head -10
|
||||
fail=1
|
||||
else
|
||||
echo "ok $name"
|
||||
fi
|
||||
}
|
||||
|
||||
arm() {
|
||||
name="$1"; stub="$2"; defs="$3"
|
||||
inc="$INC"
|
||||
@@ -139,19 +113,6 @@ arm "orbis" orbis "-DORBIS"
|
||||
arm "ps3" ps3 "-D__PSL1GHT__ -DHAVE_MEMINFO"
|
||||
arm "ps2" "" "-DPS2"
|
||||
arm "emscripten" emscripten "-D__EMSCRIPTEN__"
|
||||
|
||||
platform_video "odroidgo2 video" \
|
||||
"-DHAVE_ODROIDGO2 -DHAVE_OPENGL -DHAVE_GLSL" "" \
|
||||
gfx/drivers/gl2.c ""
|
||||
platform_video "gx video" "-DGEKKO -DHW_RVL" "-I$STUBS/gx" \
|
||||
gfx/drivers/gx_gfx.c ""
|
||||
platform_video "switch video" \
|
||||
"-DHAVE_LIBNX -DSWITCH -D__SWITCH__" "-I$STUBS/libnx" \
|
||||
gfx/drivers/switch_nx_gfx.c ""
|
||||
platform_video "dingux video" "-DDINGUX" "-I/usr/include/SDL" \
|
||||
gfx/drivers/sdl_dingux_gfx.c /usr/include/SDL/SDL.h
|
||||
platform_video "rs90 video" "-DDINGUX -DRS90" "-I/usr/include/SDL" \
|
||||
gfx/drivers/sdl_rs90_gfx.c /usr/include/SDL/SDL.h
|
||||
arm "win32" win32 "-D_WIN32 -D_WIN32_WINNT=0x0600"
|
||||
arm "win32-old" win32 "-D_WIN32 -D_WIN32_WINNT=0x0400"
|
||||
arm "macos" apple "-D__APPLE__"
|
||||
@@ -159,254 +120,4 @@ arm "ios" apple "-D__APPLE__ -DTARGET_OS_IPHONE=1"
|
||||
arm "dos/djgpp" "" "-D__DJGPP__ -D__unix__"
|
||||
arm "linux" "" ""
|
||||
|
||||
|
||||
# The video drivers and the threaded wrapper compile under more than
|
||||
# one API and one threading model, and the desktop job builds one of
|
||||
# each. The OpenGL ring's sync objects went in under a guard the
|
||||
# desktop build satisfied and the GLES builds did not, and every GLES
|
||||
# target - Android, Emscripten, Vita, PS4 - went red at once; a
|
||||
# threadless build had been broken for longer than anyone noticed, on
|
||||
# calls that compile against a prototype and fail only at link.
|
||||
# These lanes are the ones a desktop build does not exercise.
|
||||
echo
|
||||
echo "== video drivers: API and threading combinations =="
|
||||
|
||||
GLINC="-Igfx/include"
|
||||
GLDEFS="-DHAVE_OPENGL -DHAVE_GLSL -DHAVE_FBO -DHAVE_REWIND -DHAVE_OVERLAY"
|
||||
check "gl2: GLES2 (android/emscripten/vita/ps4)" \
|
||||
"$GLDEFS -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_EGL $GLINC" gfx/drivers/gl2.c
|
||||
check "gl2: GLES3" \
|
||||
"$GLDEFS -DHAVE_OPENGLES -DHAVE_OPENGLES3 -DHAVE_EGL $GLINC" gfx/drivers/gl2.c
|
||||
check "gl2: desktop" \
|
||||
"$GLDEFS $GLINC" gfx/drivers/gl2.c
|
||||
GL3DEFS="-DHAVE_OPENGL -DHAVE_OPENGL_CORE -DHAVE_SLANG -DHAVE_GLSLANG -DHAVE_SPIRV_CROSS -DHAVE_REWIND -DHAVE_OVERLAY -Ideps/SPIRV-Cross"
|
||||
check "gl3: desktop" \
|
||||
"$GL3DEFS $GLINC" gfx/drivers/gl3.c
|
||||
check "gl3: GLES3" \
|
||||
"$GL3DEFS -DHAVE_OPENGLES -DHAVE_OPENGLES3 -DHAVE_EGL $GLINC" gfx/drivers/gl3.c
|
||||
# gl3 is not in the C89 job's configuration, so its C89 lane is here.
|
||||
# The flags the Makefile's C89_BUILD lane uses, _GNU_SOURCE included:
|
||||
# -ansi hides the C99 math names otherwise.
|
||||
C89="-std=c89 -ansi -pedantic -Werror=pedantic -Werror=declaration-after-statement -Wno-long-long -Wno-variadic-macros -D_GNU_SOURCE -DC89_BUILD"
|
||||
check "gl3: desktop, C89" \
|
||||
"$GL3DEFS $GLINC $C89" gfx/drivers/gl3.c
|
||||
check "hw ring: OpenGL only" \
|
||||
"-DHAVE_OPENGL $GLINC" gfx/video_thread_hw.c
|
||||
check "hw ring: GLES only" \
|
||||
"-DHAVE_OPENGLES -DHAVE_OPENGLES2 $GLINC" gfx/video_thread_hw.c
|
||||
check "hw ring: Vulkan only" \
|
||||
"-DHAVE_VULKAN $GLINC" gfx/video_thread_hw.c
|
||||
check "hw ring: no hardware API" \
|
||||
"$GLINC" gfx/video_thread_hw.c
|
||||
|
||||
# Widget state lock: the worker draws widgets while the main thread
|
||||
# writes them, and the wrapper yields the lock around its waits.
|
||||
check "widgets: state lock" "$GLINC -DHAVE_GFX_WIDGETS" \
|
||||
gfx/gfx_widgets.c gfx/video_thread_wrapper.c gfx/video_driver.c runloop.c
|
||||
|
||||
# Without threads: the wrapper is not built, and callers must compile
|
||||
# against the macro stand-ins, not the wrapper's prototypes. Syntax
|
||||
# only here; the link is the threadless job's.
|
||||
NOTHREADS=$(echo "$BASE" | sed 's/-DHAVE_THREADS//')
|
||||
check_nothreads() {
|
||||
name="$1"; shift
|
||||
defs="$1"; shift
|
||||
bad=0
|
||||
for tu in "$@"; do
|
||||
if ! out=$($CC $WARN $INC $NOTHREADS $defs -fsyntax-only "$tu" 2>&1); then
|
||||
echo "FAIL $name"
|
||||
echo " $tu"
|
||||
echo "$out" | sed 's/^/ /' | head -12
|
||||
fail=1; bad=1
|
||||
fi
|
||||
done
|
||||
[ "$bad" = 1 ] || echo "ok $name"
|
||||
}
|
||||
# Console rgui: the menu driver's GEKKO and DINGUX shapes have their
|
||||
# own framebuffer dimensions, aspect handling and pixel converters;
|
||||
# a syntax pass keeps refactors honest for both. GEKKO needs one
|
||||
# tiny libogc stub header (tools/platform_stubs/gekko).
|
||||
# The Android OpenSL driver compiles nowhere else; a stub SLES header
|
||||
# set (tools/platform_stubs/android) keeps its lock-free write path
|
||||
# and hardened teardown under a syntax gate.
|
||||
# OpenAL: not in the audit build's configure. Compile-only AL stubs,
|
||||
# first in the include order, so the lane needs no system
|
||||
# libopenal-dev and behaves the same on every runner. Covers the
|
||||
# eventcount park path (threads on).
|
||||
check "audio: openal" "-Itools/platform_stubs/openal -DHAVE_AL -DHAVE_THREADS -Wdeclaration-after-statement -Werror=declaration-after-statement" audio/drivers/openal.c
|
||||
|
||||
# psp_audio: index-pair SPSC + eventcount park; compile-only sce
|
||||
# stubs, PSP and Vita arms.
|
||||
check "psp: psp_audio" "-Itools/platform_stubs/psp -DPSP -DHAVE_THREADS -Wdeclaration-after-statement -Werror=declaration-after-statement" audio/drivers/psp_audio.c
|
||||
check "vita: psp_audio" "-Itools/platform_stubs/vita -DVITA -DHAVE_THREADS -Wdeclaration-after-statement -Werror=declaration-after-statement" audio/drivers/psp_audio.c
|
||||
|
||||
# features_cpu.c on every statically linked platform. It owns
|
||||
# cpu_features_get_time_usec() and retro_sleep_until_us(); the wait's
|
||||
# generic loop calls retro_sleep_us, a per-platform macro from
|
||||
# retro_timers.h everywhere but Windows and Darwin, so the branch that
|
||||
# only the console toolchains compile is compiled here, against
|
||||
# hermetic stubs of each SDK header the file pulls. The host compiler
|
||||
# predefines __linux__ and friends; a lane that keeps them takes the
|
||||
# Linux branch of every #if ladder and proves nothing, so these shed
|
||||
# them. PSP gets _POSIX_C_SOURCE for the host libc's nanosleep, which
|
||||
# pspsdk's newlib declares unconditionally.
|
||||
FCPU_TU=libretro-common/features/features_cpu.c
|
||||
HOSTOFF="-U__linux__ -U__gnu_linux__ -Ulinux -U__unix__ -U__unix -Uunix"
|
||||
check "features_cpu: 3ds" "$HOSTOFF -Itools/platform_stubs/ctr -D_3DS -D__3DS__ -DARM11 -DRARCH_CONSOLE" $FCPU_TU
|
||||
check "features_cpu: gekko" "$HOSTOFF -Itools/platform_stubs/gekko -DGEKKO -DHW_RVL -DRARCH_CONSOLE" $FCPU_TU
|
||||
check "features_cpu: wiiu" "$HOSTOFF -Itools/platform_stubs/wiiu -DWIIU -DRARCH_CONSOLE" $FCPU_TU
|
||||
check "features_cpu: psp" "$HOSTOFF -Itools/platform_stubs/psp -DPSP -D_POSIX_C_SOURCE=199309L -DRARCH_CONSOLE" $FCPU_TU
|
||||
check "features_cpu: vita" "$HOSTOFF -Itools/platform_stubs/vita -DVITA -DRARCH_CONSOLE" $FCPU_TU
|
||||
check "features_cpu: ps3" "$HOSTOFF -Itools/platform_stubs/ps3 -D__PS3__ -DRARCH_CONSOLE" $FCPU_TU
|
||||
check "features_cpu: psl1ght" "$HOSTOFF -Itools/platform_stubs/psl1ght -D__PS3__ -D__PSL1GHT__ -DRARCH_CONSOLE" $FCPU_TU
|
||||
check "features_cpu: emscripten" "$HOSTOFF -Itools/platform_stubs/emscripten -D__EMSCRIPTEN__ -DEMSCRIPTEN" $FCPU_TU
|
||||
|
||||
# The salamander launchers link a hand-picked subset of libretro-common
|
||||
# with -DIS_SALAMANDER: rtime.c for rtime_localtime, no features_cpu.c.
|
||||
# A syntax pass cannot see the link error that a symbol from an
|
||||
# unlinked TU produces there, so this lane links exactly that object
|
||||
# set with a host main, under the Vita salamander's defines.
|
||||
salamander_link() {
|
||||
name="$1"; shift
|
||||
defs="$1"; shift
|
||||
if ! out=$($CC $WARN $INC $BASE $defs -o /tmp/salamander_link_check \
|
||||
tools/platform_stubs/salamander_main.c "$@" 2>&1); then
|
||||
echo "FAIL $name"
|
||||
echo "$out" | sed 's/^/ /' | head -12
|
||||
fail=1
|
||||
else
|
||||
echo "ok $name"
|
||||
fi
|
||||
rm -f /tmp/salamander_link_check
|
||||
}
|
||||
salamander_link "salamander link: rtime.c" \
|
||||
"$HOSTOFF -UHAVE_THREADS -Itools/platform_stubs/vita -DVITA -DIS_SALAMANDER -DRARCH_CONSOLE" \
|
||||
libretro-common/time/rtime.c
|
||||
|
||||
# runloop.c under Android: runloop_idle_wait's looper branch, and every
|
||||
# other ANDROID block in the file, compiled against hermetic NDK stubs
|
||||
# (jni, looper, native_activity, sensor, configuration, window) with
|
||||
# the host identity shed.
|
||||
check "android: runloop" "$HOSTOFF -DANDROID -Itools/platform_stubs/android" runloop.c
|
||||
check "android: dispserv" "$HOSTOFF -DANDROID -Itools/platform_stubs/android" gfx/display_servers/dispserv_android.c
|
||||
|
||||
# The Android arms of rthreads: thread affinity goes to the kernel
|
||||
# directly there (bionic keeps cpu_set_t behind _GNU_SOURCE), and the
|
||||
# API 21 arm names pthread_gettid_np, which only bionic declares.
|
||||
check "android: rthreads (API 21)" "-DHAVE_THREADS -D__ANDROID__ -D__ANDROID_API__=21 -include tools/platform_stubs/android/bionic_pthread_stub.h -Itools/platform_stubs/android" libretro-common/rthreads/rthreads.c
|
||||
check "android: rthreads (API 19)" "-DHAVE_THREADS -D__ANDROID__ -D__ANDROID_API__=19 -Itools/platform_stubs/android" libretro-common/rthreads/rthreads.c
|
||||
|
||||
check "android: opensl" "-DANDROID -DHAVE_OPENSL -Itools/platform_stubs/android -Wdeclaration-after-statement -Werror=declaration-after-statement" audio/drivers/opensl.c
|
||||
|
||||
check "gekko: rgui" "-DGEKKO -DHAVE_MENU -DHAVE_RGUI -Itools/platform_stubs/gekko" menu/drivers/rgui.c
|
||||
check "dingux: rgui" "-DDINGUX -DHAVE_MENU -DHAVE_RGUI" menu/drivers/rgui.c
|
||||
|
||||
# The streaming surface embeds a wrapper node under HAVE_THREADS and
|
||||
# collapses to direct driver calls without; both shapes compile here,
|
||||
# along with the thumbnail code that produces into it.
|
||||
# The VP9 decoder's tile-column threading and the video streams' pooled
|
||||
# colour conversion sit behind HAVE_THREADS; both shapes compile.
|
||||
check "vp9/h265/video streams: threads" "-DHAVE_RVP9 -DHAVE_RVP8 -DHAVE_RWEBM -DHAVE_RMP4 -DHAVE_RH264 -DHAVE_RH265" libretro-common/formats/vp9/rvp9.c libretro-common/formats/h265/rh265.c libretro-common/formats/webm/rwebm_video.c libretro-common/formats/mp4/rmp4_video.c libretro-common/formats/image/image_blit_bands.c
|
||||
check_nothreads "no threads: vp9/h265/video streams" "-DHAVE_RVP9 -DHAVE_RVP8 -DHAVE_RWEBM -DHAVE_RMP4 -DHAVE_RH264 -DHAVE_RH265" libretro-common/formats/vp9/rvp9.c libretro-common/formats/h265/rh265.c libretro-common/formats/webm/rwebm_video.c libretro-common/formats/mp4/rmp4_video.c libretro-common/formats/image/image_blit_bands.c
|
||||
check "gfx_surface: threads" "$GLINC" gfx/gfx_surface.c gfx/gfx_thumbnail.c
|
||||
check_nothreads "no threads: gfx_surface" "$GLINC" gfx/gfx_surface.c gfx/gfx_thumbnail.c
|
||||
check_nothreads "no threads: gl2" "$GLDEFS $GLINC" gfx/drivers/gl2.c
|
||||
check_nothreads "no threads: video_driver" "$GLINC" gfx/video_driver.c
|
||||
check_nothreads "no threads: retroarch" "$GLINC -DHAVE_COMMAND -DHAVE_STDIN_CMD" retroarch.c
|
||||
check_nothreads "no threads: audio_driver" "$GLINC" audio/audio_driver.c
|
||||
check_nothreads "no threads: linux input" "$GLINC" input/common/linux_common.c
|
||||
check_nothreads "no threads: widget state lock stand-ins" \
|
||||
"$GLINC -DHAVE_GFX_WIDGETS" \
|
||||
gfx/gfx_widgets.c gfx/widgets/gfx_widget_volume.c gfx/video_driver.c runloop.c
|
||||
|
||||
# The networking files carry threaded machinery of their own - the HTTP
|
||||
# DNS cache's lock and condition, the task queue's - beside code that is
|
||||
# compiled either way, so a broadcast or a wait written outside the
|
||||
# guard is green in every job here and breaks a threadless build. That
|
||||
# has happened: a DNS cache signal added to net_http_resolve(), which is
|
||||
# not itself guarded, was caught by a sample rather than by this matrix.
|
||||
NETDEFS="-DHAVE_NETWORKING $GLINC"
|
||||
check_nothreads "no threads: net_http" "$NETDEFS" libretro-common/net/net_http.c
|
||||
check_nothreads "no threads: net_socket" "$NETDEFS" libretro-common/net/net_socket.c
|
||||
check_nothreads "no threads: task_http" "$NETDEFS" tasks/task_http.c
|
||||
check_nothreads "no threads: cloud sync" "$NETDEFS -DHAVE_CLOUDSYNC" \
|
||||
tasks/task_cloudsync.c network/cloud_sync/webdav.c
|
||||
|
||||
# The menu and the on-screen widgets are switched separately, so the
|
||||
# frontend translation units have to hold for all four combinations of
|
||||
# the two. Every lane above builds with HAVE_MENU, and the shipping jobs
|
||||
# all enable one or the other, so a declaration that reaches a caller
|
||||
# only through menu_driver.h or gfx_widgets.h is green everywhere and
|
||||
# absent from a build with both off.
|
||||
echo
|
||||
echo "== menu and widget gates =="
|
||||
NOMENU=$(echo "$BASE" | sed 's/-DHAVE_MENU//')
|
||||
check_gates() {
|
||||
name="$1"; shift
|
||||
defs="$1"; shift
|
||||
bad=0
|
||||
for tu in "$@"; do
|
||||
if ! out=$($CC $WARN $INC $NOMENU $defs -fsyntax-only "$tu" 2>&1); then
|
||||
echo "FAIL $name"
|
||||
echo " $tu"
|
||||
echo "$out" | sed 's/^/ /' | head -12
|
||||
fail=1; bad=1
|
||||
fi
|
||||
done
|
||||
[ "$bad" = 1 ] || echo "ok $name"
|
||||
}
|
||||
UITU="retroarch.c runloop.c gfx/video_driver.c gfx/gfx_display.c"
|
||||
UIDEFS="$GLINC -DHAVE_COMMAND -DHAVE_STDIN_CMD"
|
||||
check_gates "gates: menu + widgets" "$UIDEFS -DHAVE_MENU -DHAVE_GFX_WIDGETS" $UITU
|
||||
check_gates "gates: menu only" "$UIDEFS -DHAVE_MENU" $UITU
|
||||
check_gates "gates: widgets only" "$UIDEFS -DHAVE_GFX_WIDGETS" $UITU
|
||||
check_gates "gates: neither" "$UIDEFS" $UITU
|
||||
|
||||
# The optional subsystems switch independently of the menu and of each
|
||||
# other, and the units that call into them are built either way. Each
|
||||
# lane drops one subsystem from a fully featured build; the last drops
|
||||
# all of them, which is what a minimal frontend compiles as.
|
||||
ALLGATES="-DHAVE_MENU -DHAVE_GFX_WIDGETS -DHAVE_OVERLAY -DHAVE_CHEEVOS -DRC_CLIENT_SUPPORTS_HASH -DHAVE_NETWORKING -DHAVE_RUNAHEAD -DHAVE_DYNAMIC -DHAVE_DYLIB"
|
||||
FETU="retroarch.c runloop.c command.c gfx/video_driver.c input/input_driver.c configuration.c tasks/task_content.c"
|
||||
without() { echo "$ALLGATES" | sed "s/$1//g"; }
|
||||
check_gates "gates: every subsystem" "$UIDEFS $ALLGATES" $FETU
|
||||
check_gates "gates: no overlay" "$UIDEFS $(without -DHAVE_OVERLAY)" $FETU
|
||||
check_gates "gates: no cheevos" "$UIDEFS $(without '-DHAVE_CHEEVOS -DRC_CLIENT_SUPPORTS_HASH')" $FETU
|
||||
check_gates "gates: no networking" "$UIDEFS $(without -DHAVE_NETWORKING)" $FETU
|
||||
check_gates "gates: no run-ahead" "$UIDEFS $(without -DHAVE_RUNAHEAD)" $FETU
|
||||
check_gates "gates: no subsystems" "$UIDEFS" $FETU
|
||||
|
||||
# A subsystem's own unit is built only when its gate is on, so each is
|
||||
# checked with that gate on and the user interface off: the achievement
|
||||
# and netplay widgets, and the menu entries either drives, are the edges
|
||||
# where a declaration goes missing.
|
||||
check_gates "gates: netplay, no UI" \
|
||||
"$UIDEFS -DHAVE_NETWORKING" network/netplay/netplay_frontend.c
|
||||
check_gates "gates: cheevos, no UI" \
|
||||
"$UIDEFS -DHAVE_CHEEVOS -DRC_CLIENT_SUPPORTS_HASH" cheevos/cheevos.c
|
||||
check_gates "gates: run-ahead, no UI" \
|
||||
"$UIDEFS -DHAVE_RUNAHEAD -DHAVE_DYNAMIC -DHAVE_DYLIB" runahead.c
|
||||
|
||||
# The builtin DSP filters are compiled only by console builds, through
|
||||
# griffin, and no other job compiles them as C. Each is checked on its
|
||||
# own, as the consoles build it, in the C89 lane: once with the C99 math
|
||||
# names glibc declares under _GNU_SOURCE, and once without them, as on
|
||||
# MSVC, so an undeclared sqrtf() or M_PI fails here.
|
||||
echo
|
||||
echo "== dsp filters: C89 =="
|
||||
DSP=$(ls libretro-common/audio/dsp_filters/*.c)
|
||||
check "dsp filters: C89" "$C89 -DHAVE_FILTERS_BUILTIN" $DSP
|
||||
check "dsp filters: C89, no C99 math declarations" \
|
||||
"$(echo "$C89" | sed 's/ -D_GNU_SOURCE//') -DHAVE_FILTERS_BUILTIN" $DSP
|
||||
|
||||
echo "== run-ahead: the dynamic-library gates =="
|
||||
# The secondary instance exists only with HAVE_DYNAMIC; a build that
|
||||
# can load libraries but links its core statically (HAVE_DYLIB alone)
|
||||
# compiles the secondary path out and keeps the callers linking.
|
||||
RADEFS="-DHAVE_REWIND -DHAVE_RUNAHEAD -DHAVE_DYNAMIC_EXTENSIONS"
|
||||
check "runahead: neither" "$RADEFS" runahead.c
|
||||
check "runahead: HAVE_DYLIB only" "$RADEFS -DHAVE_DYLIB" runahead.c
|
||||
check "runahead: HAVE_DYNAMIC" "$RADEFS -DHAVE_DYNAMIC" runahead.c
|
||||
check "runahead: both" "$RADEFS -DHAVE_DYNAMIC -DHAVE_DYLIB" runahead.c
|
||||
|
||||
exit $fail
|
||||
@@ -1,5 +0,0 @@
|
||||
# function size stack-frame (release build, x86-64 GCC)
|
||||
runloop_iterate 3933 88
|
||||
video_driver_frame 9447 4008
|
||||
video_thread_frame 3097 152
|
||||
audio_driver_sample_batch 394 24
|
||||
@@ -1,81 +0,0 @@
|
||||
#!/bin/sh
|
||||
# The size and stack frame of the frontend's hottest functions, against
|
||||
# a checked-in budget.
|
||||
#
|
||||
# Code size is I-cache footprint on the path that runs every frame, and
|
||||
# the stack frame is what the prologue touches before any work happens.
|
||||
# Neither is visible to a test: a change that doubles either passes
|
||||
# every lane in the suite and shows up only as a slower frame on
|
||||
# someone's machine. This is the check that notices.
|
||||
#
|
||||
# The numbers come from the release objects, so run it after a plain
|
||||
# `make`. The budget is deliberately loose - a quarter over what the
|
||||
# tree measures today - because compilers differ and the point is to
|
||||
# catch a step change, not to freeze a byte count. When a change means
|
||||
# to grow one of these, the reference moves with it in the same commit,
|
||||
# which is exactly the moment to say why in the message.
|
||||
#
|
||||
# The functions, and why each is here:
|
||||
# runloop_iterate the frame's orchestration
|
||||
# video_driver_frame the frontend's hottest function by its
|
||||
# own comment; also the largest frame
|
||||
# video_thread_frame the handover, on the paced path
|
||||
# audio_driver_sample_batch called once per core frame, more with
|
||||
# per-sample cores
|
||||
set -eu
|
||||
|
||||
cd "$(dirname "$0")/../../.."
|
||||
ref=".github/workflows/scripts/hot-function-budget.ref"
|
||||
obj="obj-unix/release"
|
||||
fail=0
|
||||
|
||||
if [ ! -d "$obj" ]; then
|
||||
echo "no release objects in $obj; run make first" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
measure() {
|
||||
o="$1"; fn="$2"
|
||||
sz=$(nm -S "$o" 2>/dev/null | grep -w "$fn" | head -1 | awk '{print $2}')
|
||||
[ -n "$sz" ] || { echo "SKIP $fn (not in $o)"; return; }
|
||||
size=$(printf '%d' "0x$sz")
|
||||
# mawk has no strtonum(); the hex comes back as text and the shell
|
||||
# converts it.
|
||||
frame_hex=$(objdump -d --no-show-raw-insn "$o" 2>/dev/null | awk -v f="$fn" '
|
||||
$0 ~ "<"f">:" { in_fn = 1; next }
|
||||
in_fn && /^$/ { exit }
|
||||
in_fn && /sub +\$0x[0-9a-f]+,%rsp/ {
|
||||
match($0, /0x[0-9a-f]+/); print substr($0, RSTART + 2, RLENGTH - 2); exit }')
|
||||
if [ -n "$frame_hex" ]; then
|
||||
frame=$(printf '%d' "0x$frame_hex")
|
||||
else
|
||||
frame=0
|
||||
fi
|
||||
|
||||
want_size=$(awk -v f="$fn" '$1 == f { print $2 }' "$ref")
|
||||
want_frame=$(awk -v f="$fn" '$1 == f { print $3 }' "$ref")
|
||||
[ -n "$want_size" ] || { echo "SKIP $fn (no reference)"; return; }
|
||||
|
||||
max_size=$(( want_size + want_size / 4 ))
|
||||
max_frame=$(( want_frame + want_frame / 4 + 64 ))
|
||||
status="ok "
|
||||
if [ "$size" -gt "$max_size" ] || [ "$frame" -gt "$max_frame" ]; then
|
||||
status="FAIL "
|
||||
fail=1
|
||||
fi
|
||||
printf '%s %-28s size %6d (budget %6d) frame %5d (budget %5d)\n' \
|
||||
"$status" "$fn" "$size" "$max_size" "$frame" "$max_frame"
|
||||
}
|
||||
|
||||
echo "== hot function budget =="
|
||||
measure "$obj/runloop.o" runloop_iterate
|
||||
measure "$obj/gfx/video_driver.o" video_driver_frame
|
||||
measure "$obj/gfx/video_thread_wrapper.o" video_thread_frame
|
||||
measure "$obj/audio/audio_driver.o" audio_driver_sample_batch
|
||||
|
||||
if [ "$fail" = 1 ]; then
|
||||
echo
|
||||
echo "A hot function grew past its budget. If that is deliberate, move"
|
||||
echo "the number in $ref in the same commit and say why."
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,15 +0,0 @@
|
||||
# function bytes (release build, x86-64 GCC)
|
||||
#
|
||||
# Over the ceiling and left that way, each with its reason. A frame
|
||||
# that is not listed here fails the sweep; one that grows past what is
|
||||
# recorded fails too, and the number moves in the commit that grows it.
|
||||
#
|
||||
# switch_res_crt a CRT mode switch, once when the resolution
|
||||
# changes, on the main thread
|
||||
# spirv_cache_save shader cache written once per compiled pass,
|
||||
# spirv_cache_load read once per pass at load
|
||||
# gfx_anim_preview_probe probes a preview file, off the frame path
|
||||
switch_res_crt 4440
|
||||
spirv_cache_save 4312
|
||||
spirv_cache_load 4296
|
||||
gfx_anim_preview_probe 4128
|
||||
@@ -1,95 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Every stack frame in the graphics objects, against the tree's limit.
|
||||
#
|
||||
# CODING-GUIDELINES puts a ceiling on a function's stack frame - two
|
||||
# kilobytes inside libretro-common, four outside it - because the
|
||||
# threads this code runs on do not all get a desktop's stack, and a
|
||||
# frame that overruns one corrupts whatever is under it rather than
|
||||
# failing. Nothing checked it: the frames this sweep was written for
|
||||
# were twelve kilobytes, in four font paths and an overlay batch, and
|
||||
# they had been there for years.
|
||||
#
|
||||
# A large local array is invisible in review and to every other lane -
|
||||
# it compiles, it runs on a machine with eight megabytes of stack, and
|
||||
# it is only a problem on the platform with the smallest one. This is
|
||||
# the check that notices.
|
||||
#
|
||||
# Reads the release objects, so run it after a plain `make`. Functions
|
||||
# allowed to exceed the ceiling are listed in stack-frame-sweep.ref
|
||||
# with the size they measure; a change that grows one moves its line in
|
||||
# the same commit, which is the moment to say why in the message.
|
||||
set -e
|
||||
cd "$(dirname "$0")/../../.."
|
||||
|
||||
OBJDIR=${OBJDIR:-obj-unix/release}
|
||||
ref="$(dirname "$0")/stack-frame-sweep.ref"
|
||||
limit=${LIMIT:-4096}
|
||||
fail=0
|
||||
|
||||
if [ ! -d "$OBJDIR/gfx" ]; then
|
||||
echo "skip: no objects in $OBJDIR (run make first)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# A large frame is built by repeated probes of a page at a time, so the
|
||||
# allocation is the sum of the subtractions a function makes, not the
|
||||
# largest one.
|
||||
for o in $(find "$OBJDIR/gfx" -name '*.o' | sort); do
|
||||
objdump -d --no-show-raw-insn "$o" 2>/dev/null | awk -v obj="$o" -v lim="$limit" '
|
||||
/^[0-9a-f]+ <.*>:/ {
|
||||
if (fn != "" && total > lim)
|
||||
printf "%s %s %d\n", obj, fn, total
|
||||
fn = $2; sub(/^</, "", fn); sub(/>:$/, "", fn)
|
||||
total = 0
|
||||
next
|
||||
}
|
||||
/sub +\$0x[0-9a-f]+,%rsp/ {
|
||||
# The hex is not at a fixed field: the address column shifts
|
||||
# them, so take it out of the line rather than by index.
|
||||
line = $0
|
||||
sub(/^.*sub +\$0x/, "", line)
|
||||
sub(/,%rsp.*$/, "", line)
|
||||
hex = line
|
||||
# mawk has no strtonum(); fold the hex by hand, and ignore the
|
||||
# sign-extended constants an add-by-subtract produces.
|
||||
n = 0; ok = 1
|
||||
for (i = 1; i <= length(hex); i++) {
|
||||
c = substr(hex, i, 1)
|
||||
p = index("0123456789abcdef", c)
|
||||
if (p == 0) { ok = 0; break }
|
||||
n = n * 16 + (p - 1)
|
||||
}
|
||||
if (ok && n < 4194304) total += n
|
||||
next
|
||||
}
|
||||
END {
|
||||
if (fn != "" && total > lim)
|
||||
printf "%s %s %d\n", obj, fn, total
|
||||
}
|
||||
'
|
||||
done > /tmp/stack-frame-sweep.$$ || true
|
||||
|
||||
echo "== stack frames over $limit bytes =="
|
||||
while read -r obj fn size; do
|
||||
[ -n "$fn" ] || continue
|
||||
want=$(awk -v f="$fn" '$1 == f { print $2 }' "$ref" 2>/dev/null)
|
||||
if [ -z "$want" ]; then
|
||||
echo "FAIL $fn ($size bytes) in $(basename "$obj")"
|
||||
fail=1
|
||||
elif [ "$size" -gt "$want" ]; then
|
||||
echo "FAIL $fn grew to $size, recorded $want"
|
||||
fail=1
|
||||
else
|
||||
echo "ok $fn ($size bytes, recorded $want)"
|
||||
fi
|
||||
done < /tmp/stack-frame-sweep.$$
|
||||
rm -f /tmp/stack-frame-sweep.$$
|
||||
|
||||
if [ "$fail" = 1 ]; then
|
||||
echo
|
||||
echo "A function's stack frame is over the ceiling in CODING-GUIDELINES."
|
||||
echo "Move the array off the frame, or record it in $ref with why."
|
||||
exit 1
|
||||
fi
|
||||
echo "ok nothing else over $limit bytes"
|
||||
exit 0
|
||||
@@ -1,8 +1,5 @@
|
||||
#ifndef STUB_TC_H
|
||||
#define STUB_TC_H
|
||||
#ifdef __MACH__
|
||||
#include <TargetConditionals.h>
|
||||
#endif
|
||||
#ifndef TARGET_OS_IPHONE
|
||||
#define TARGET_OS_IPHONE 0
|
||||
#endif
|
||||
|
||||
@@ -1,372 +1,5 @@
|
||||
/* Stand-in for devkitPro's libogc <gccore.h>, for the GX video driver.
|
||||
*
|
||||
* Prototypes and values follow libogc's, so the driver's calls are
|
||||
* checked as it makes them. As the note at the top of compile-matrix.sh
|
||||
* says, this does not prove the real SDK matches: it proves RetroArch's
|
||||
* own GX code is well formed and uses only what it has arranged to
|
||||
* have. Pinning the surface here rather than fetching the SDK is
|
||||
* deliberate - the 3DS driver no longer compiles against a current
|
||||
* libctru, whose gspSubmitGxCommand() changed shape under it, and a
|
||||
* lane that goes red when somebody else's headers move tells us
|
||||
* nothing about this tree.
|
||||
*/
|
||||
#ifndef LIBOGC_STUB_GCCORE_H
|
||||
#define LIBOGC_STUB_GCCORE_H
|
||||
|
||||
#ifndef STUB_GCCORE_H
|
||||
#define STUB_GCCORE_H
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
typedef int8_t s8;
|
||||
typedef int16_t s16;
|
||||
typedef int32_t s32;
|
||||
typedef int64_t s64;
|
||||
typedef float f32;
|
||||
typedef double f64;
|
||||
typedef volatile uint8_t vu8;
|
||||
typedef volatile uint16_t vu16;
|
||||
typedef volatile uint32_t vu32;
|
||||
typedef uint32_t lwpq_t;
|
||||
typedef uint32_t lwp_t;
|
||||
typedef uint32_t mutex_t;
|
||||
typedef uint32_t syswd_t;
|
||||
typedef struct { u32 dummy[16]; } GXFifoObj;
|
||||
typedef void (*VIRetraceCallback)(u32 retraceCnt);
|
||||
typedef void (*VIPositionCallback)(s16 x, s16 y);
|
||||
typedef f32 Mtx[3][4];
|
||||
typedef f32 Mtx44[4][4];
|
||||
|
||||
#define ATTRIBUTE_ALIGN(v) __attribute__((aligned(v)))
|
||||
#define ATTRIBUTE_PACKED __attribute__((packed))
|
||||
#define LWP_TQUEUE_NULL 0xffffffff
|
||||
#define SYS_BASE_CACHED 0x80000000
|
||||
#define SYS_BASE_UNCACHED 0xc0000000
|
||||
/* uintptr_t, not u32: on the console a pointer is 32 bits and libogc's
|
||||
* own cast is exact, while the host running this check is 64-bit and
|
||||
* would lose half of one. The arithmetic is what matters here. */
|
||||
#define MEM_K0_TO_K1(x) ((void*)((uintptr_t)(x) + (SYS_BASE_UNCACHED - SYS_BASE_CACHED)))
|
||||
#define MEM_K1_TO_K0(x) ((void*)((uintptr_t)(x) - (SYS_BASE_UNCACHED - SYS_BASE_CACHED)))
|
||||
#define VIDEO_PadFramebufferWidth(w) ((u16)(((u16)(w) + 15) & ~15))
|
||||
#define VI_TVMODE(fmt, mode) (((fmt) << 2) + (mode))
|
||||
|
||||
typedef struct { u8 r, g, b, a; } GXColor;
|
||||
typedef struct { u32 dummy[8]; } GXTexObj;
|
||||
typedef struct
|
||||
{
|
||||
u32 viTVMode;
|
||||
u16 fbWidth, efbHeight, xfbHeight;
|
||||
u16 viXOrigin, viYOrigin, viWidth, viHeight;
|
||||
u32 xfbMode;
|
||||
u8 field_rendering, aa;
|
||||
u8 sample_pattern[12][2];
|
||||
u8 vfilter[7];
|
||||
} GXRModeObj;
|
||||
|
||||
typedef enum { CONF_VIDEO_NTSC = 0, CONF_VIDEO_PAL, CONF_VIDEO_MPAL } CONFVideoMode;
|
||||
|
||||
#ifndef COLOR_BLACK
|
||||
#define COLOR_BLACK (0x10801080)
|
||||
#endif
|
||||
#ifndef VI_DISPLAY_PIX_SZ
|
||||
#define VI_DISPLAY_PIX_SZ 2
|
||||
#endif
|
||||
#ifndef VI_EURGB60
|
||||
#define VI_EURGB60 5
|
||||
#endif
|
||||
#ifndef VI_INTERLACE
|
||||
#define VI_INTERLACE 0
|
||||
#endif
|
||||
#ifndef VI_MAX_HEIGHT_EURGB60
|
||||
#define VI_MAX_HEIGHT_EURGB60 VI_MAX_HEIGHT_NTSC
|
||||
#endif
|
||||
#ifndef VI_MAX_HEIGHT_MPAL
|
||||
#define VI_MAX_HEIGHT_MPAL 480
|
||||
#endif
|
||||
#ifndef VI_MAX_HEIGHT_NTSC
|
||||
#define VI_MAX_HEIGHT_NTSC 480
|
||||
#endif
|
||||
#ifndef VI_MAX_HEIGHT_PAL
|
||||
#define VI_MAX_HEIGHT_PAL 576
|
||||
#endif
|
||||
#ifndef VI_MAX_WIDTH_EURGB60
|
||||
#define VI_MAX_WIDTH_EURGB60 VI_MAX_WIDTH_NTSC
|
||||
#endif
|
||||
#ifndef VI_MAX_WIDTH_MPAL
|
||||
#define VI_MAX_WIDTH_MPAL 720
|
||||
#endif
|
||||
#ifndef VI_MAX_WIDTH_NTSC
|
||||
#define VI_MAX_WIDTH_NTSC 720
|
||||
#endif
|
||||
#ifndef VI_MAX_WIDTH_PAL
|
||||
#define VI_MAX_WIDTH_PAL 720
|
||||
#endif
|
||||
#ifndef VI_MPAL
|
||||
#define VI_MPAL 2
|
||||
#endif
|
||||
#ifndef VI_NON_INTERLACE
|
||||
#define VI_NON_INTERLACE 1
|
||||
#endif
|
||||
#ifndef VI_NTSC
|
||||
#define VI_NTSC 0
|
||||
#endif
|
||||
#ifndef VI_PAL
|
||||
#define VI_PAL 1
|
||||
#endif
|
||||
#ifndef VI_PROGRESSIVE
|
||||
#define VI_PROGRESSIVE 2
|
||||
#endif
|
||||
#ifndef VI_XFBMODE_DF
|
||||
#define VI_XFBMODE_DF 1
|
||||
#endif
|
||||
#ifndef VI_XFBMODE_SF
|
||||
#define VI_XFBMODE_SF 0
|
||||
#endif
|
||||
typedef struct { u32 dummy[8]; } syssram;
|
||||
|
||||
/* Drawing primitives libogc gives as inline functions */
|
||||
static inline void GX_Position3f32(f32 x, f32 y, f32 z) { (void)x; (void)y; (void)z; }
|
||||
static inline void GX_Position1x8(u8 i) { (void)i; }
|
||||
static inline void GX_Color4u8(u8 r, u8 g, u8 b, u8 a) { (void)r; (void)g; (void)b; (void)a; }
|
||||
static inline void GX_Color1x8(u8 i) { (void)i; }
|
||||
static inline void GX_TexCoord2f32(f32 s, f32 t) { (void)s; (void)t; }
|
||||
static inline void GX_TexCoord1x8(u8 i) { (void)i; }
|
||||
static inline void GX_End(void) { }
|
||||
void VIDEO_SetGamma(int gamma);
|
||||
|
||||
/* The matrix helpers the driver sets its projection up with */
|
||||
void guOrtho(Mtx44 mt, f32 t, f32 b, f32 l, f32 r, f32 n, f32 f);
|
||||
void guMtxIdentity(Mtx mt);
|
||||
void c_guMtxConcat(Mtx a, Mtx b, Mtx ab);
|
||||
void DCFlushRange(void *startaddress, u32 len);
|
||||
void DCInvalidateRange(void *startaddress, u32 len);
|
||||
void guMtxRotDeg(Mtx mt, const char axis, f32 deg);
|
||||
|
||||
/* The threading calls libretro-common's gx_defines.h maps OS* onto */
|
||||
void LWP_InitQueue(lwpq_t *queue);
|
||||
void LWP_CloseQueue(lwpq_t queue);
|
||||
void LWP_ThreadSignal(lwpq_t queue);
|
||||
void LWP_ThreadBroadcast(lwpq_t queue);
|
||||
s32 LWP_ThreadSleep(lwpq_t queue);
|
||||
s32 LWP_MutexInit(mutex_t *mutex, bool use_recursive);
|
||||
s32 LWP_MutexLock(mutex_t mutex);
|
||||
s32 LWP_MutexTryLock(mutex_t mutex);
|
||||
s32 LWP_MutexUnlock(mutex_t mutex);
|
||||
s32 LWP_MutexDestroy(mutex_t mutex);
|
||||
s32 LWP_CondInit(lwpq_t *cond);
|
||||
s32 LWP_CondWait(lwpq_t cond, mutex_t mutex);
|
||||
s32 LWP_CondDestroy(lwpq_t cond);
|
||||
s32 LWP_CreateThread(lwp_t *thethread, void *(*entry)(void *),
|
||||
void *arg, void *stackbase, u32 stack_size, u8 prio);
|
||||
s32 LWP_JoinThread(lwp_t thethread, void **value_ptr);
|
||||
void VIDEO_SetTrapFilter(bool enable);
|
||||
|
||||
#ifndef CONF_ASPECT_4_3
|
||||
#define CONF_ASPECT_4_3 0
|
||||
#endif
|
||||
#ifndef GX_AF_NONE
|
||||
#define GX_AF_NONE 2
|
||||
#endif
|
||||
#ifndef GX_ALWAYS
|
||||
#define GX_ALWAYS 7
|
||||
#endif
|
||||
#ifndef GX_BL_INVSRCALPHA
|
||||
#define GX_BL_INVSRCALPHA 5
|
||||
#endif
|
||||
#ifndef GX_BL_SRCALPHA
|
||||
#define GX_BL_SRCALPHA 4
|
||||
#endif
|
||||
#ifndef GX_BM_BLEND
|
||||
#define GX_BM_BLEND 1
|
||||
#endif
|
||||
#ifndef GX_CLAMP
|
||||
#define GX_CLAMP 0
|
||||
#endif
|
||||
#ifndef GX_CLIP_DISABLE
|
||||
#define GX_CLIP_DISABLE 1
|
||||
#endif
|
||||
#ifndef GX_CLR_RGBA
|
||||
#define GX_CLR_RGBA 1
|
||||
#endif
|
||||
#ifndef GX_COLOR0A0
|
||||
#define GX_COLOR0A0 4
|
||||
#endif
|
||||
#ifndef GX_CULL_NONE
|
||||
#define GX_CULL_NONE 0
|
||||
#endif
|
||||
#ifndef GX_DF_NONE
|
||||
#define GX_DF_NONE 0
|
||||
#endif
|
||||
#ifndef GX_DIRECT
|
||||
#define GX_DIRECT 1
|
||||
#endif
|
||||
#ifndef GX_DISABLE
|
||||
#define GX_DISABLE 0
|
||||
#endif
|
||||
#ifndef GX_ENABLE
|
||||
#define GX_ENABLE 1
|
||||
#endif
|
||||
#ifndef GX_F32
|
||||
#define GX_F32 4
|
||||
#endif
|
||||
#ifndef GX_FALSE
|
||||
#define GX_FALSE 0
|
||||
#endif
|
||||
#ifndef GX_INDEX8
|
||||
#define GX_INDEX8 2
|
||||
#endif
|
||||
#ifndef GX_LIGHTNULL
|
||||
#define GX_LIGHTNULL 0x000
|
||||
#endif
|
||||
#ifndef GX_LINEAR
|
||||
#define GX_LINEAR 1
|
||||
#endif
|
||||
#ifndef GX_LO_CLEAR
|
||||
#define GX_LO_CLEAR 0
|
||||
#endif
|
||||
#ifndef GX_MAX_Z24
|
||||
#define GX_MAX_Z24 0x00ffffff
|
||||
#endif
|
||||
#ifndef GX_MODULATE
|
||||
#define GX_MODULATE 0
|
||||
#endif
|
||||
#ifndef GX_NEAR
|
||||
#define GX_NEAR 0
|
||||
#endif
|
||||
#ifndef GX_ORTHOGRAPHIC
|
||||
#define GX_ORTHOGRAPHIC 1
|
||||
#endif
|
||||
#ifndef GX_PF_RGB8_Z24
|
||||
#define GX_PF_RGB8_Z24 0
|
||||
#endif
|
||||
#ifndef GX_PNMTX0
|
||||
#define GX_PNMTX0 0
|
||||
#endif
|
||||
#ifndef GX_PNMTX1
|
||||
#define GX_PNMTX1 3
|
||||
#endif
|
||||
#ifndef GX_POS_XYZ
|
||||
#define GX_POS_XYZ 1
|
||||
#endif
|
||||
#ifndef GX_RGBA8
|
||||
#define GX_RGBA8 5
|
||||
#endif
|
||||
#ifndef GX_SRC_REG
|
||||
#define GX_SRC_REG 0
|
||||
#endif
|
||||
#ifndef GX_SRC_VTX
|
||||
#define GX_SRC_VTX 1
|
||||
#endif
|
||||
#ifndef GX_TEVSTAGE0
|
||||
#define GX_TEVSTAGE0 0
|
||||
#endif
|
||||
#ifndef GX_TEXCOORD0
|
||||
#define GX_TEXCOORD0 0x0
|
||||
#endif
|
||||
#ifndef GX_TEXMAP0
|
||||
#define GX_TEXMAP0 0
|
||||
#endif
|
||||
#ifndef GX_TEX_ST
|
||||
#define GX_TEX_ST 1
|
||||
#endif
|
||||
#ifndef GX_TF_RGB565
|
||||
#define GX_TF_RGB565 0x4
|
||||
#endif
|
||||
#ifndef GX_TF_RGB5A3
|
||||
#define GX_TF_RGB5A3 0x5
|
||||
#endif
|
||||
#ifndef GX_TF_RGBA8
|
||||
#define GX_TF_RGBA8 0x6
|
||||
#endif
|
||||
#ifndef GX_TRIANGLESTRIP
|
||||
#define GX_TRIANGLESTRIP 0x98
|
||||
#endif
|
||||
#ifndef GX_TRUE
|
||||
#define GX_TRUE 1
|
||||
#endif
|
||||
#ifndef GX_VA_CLR0
|
||||
#define GX_VA_CLR0 11
|
||||
#endif
|
||||
#ifndef GX_VA_POS
|
||||
#define GX_VA_POS 9
|
||||
#endif
|
||||
#ifndef GX_VA_TEX0
|
||||
#define GX_VA_TEX0 13
|
||||
#endif
|
||||
#ifndef GX_VTXFMT0
|
||||
#define GX_VTXFMT0 0
|
||||
#endif
|
||||
#ifndef GX_ZC_LINEAR
|
||||
#define GX_ZC_LINEAR 0
|
||||
#endif
|
||||
#ifndef LWP_TQUEUE_NULL
|
||||
#define LWP_TQUEUE_NULL 0xffffffff
|
||||
#endif
|
||||
|
||||
s32 CONF_GetAspectRatio(void);
|
||||
s32 CONF_GetDisplayOffsetH(s8 *offset);
|
||||
s32 CONF_GetEuRGB60(void);
|
||||
s32 CONF_GetProgressiveScan(void);
|
||||
s32 CONF_GetVideo(void);
|
||||
void GX_AbortFrame(void);
|
||||
void GX_Begin(u8 primitve,u8 vtxfmt,u16 vtxcnt);
|
||||
void GX_BeginDispList(void *list,u32 size);
|
||||
void GX_CallDispList(void *list,u32 nbytes);
|
||||
void GX_ClearVtxDesc(void);
|
||||
void GX_CopyDisp(void *dest,u8 clear);
|
||||
void GX_DrawDone(void);
|
||||
u32 GX_EndDispList(void);
|
||||
void GX_Flush(void);
|
||||
f32 GX_GetYScaleFactor(u16 efbHeight,u16 xfbHeight);
|
||||
GXFifoObj* GX_Init(void *base,u32 size);
|
||||
void GX_InitTexObj(GXTexObj *obj,void *img_ptr,u16 wd,u16 ht,u8 fmt,u8 wrap_s,u8 wrap_t,u8 mipmap);
|
||||
void GX_InitTexObjFilterMode(GXTexObj *obj,u8 minfilt,u8 magfilt);
|
||||
void GX_InvVtxCache(void);
|
||||
void GX_InvalidateTexAll(void);
|
||||
void GX_LoadPosMtxImm(Mtx mt,u32 pnidx);
|
||||
void GX_LoadProjectionMtx(Mtx44 mt,u8 type);
|
||||
void GX_LoadTexObj(GXTexObj *obj,u8 mapid);
|
||||
void GX_PeekARGB(u16 x,u16 y,GXColor *color);
|
||||
void GX_PokeARGB(u16 x,u16 y,GXColor color);
|
||||
void GX_SetAlphaUpdate(u8 enable);
|
||||
void GX_SetArray(u32 attr,void *ptr,u8 stride);
|
||||
void GX_SetBlendMode(u8 type,u8 src_fact,u8 dst_fact,u8 op);
|
||||
void GX_SetChanCtrl(s32 channel,u8 enable,u8 ambsrc,u8 matsrc,u8 litmask,u8 diff_fn,u8 attn_fn);
|
||||
void GX_SetClipMode(u8 mode);
|
||||
void GX_SetColorUpdate(u8 enable);
|
||||
void GX_SetCopyClear(GXColor color,u32 zvalue);
|
||||
void GX_SetCopyFilter(u8 aa,u8 sample_pattern[12][2],u8 vf,u8 vfilter[7]);
|
||||
void GX_SetCullMode(u8 mode);
|
||||
void GX_SetCurrentMtx(u32 mtx);
|
||||
void GX_SetDispCopyDst(u16 wd,u16 ht);
|
||||
void GX_SetDispCopyGamma(u8 gamma);
|
||||
void GX_SetDispCopySrc(u16 left,u16 top,u16 wd,u16 ht);
|
||||
u32 GX_SetDispCopyYScale(f32 yscale);
|
||||
void GX_SetFieldMode(u8 field_mode,u8 half_aspect_ratio);
|
||||
void GX_SetNumChans(u8 num);
|
||||
void GX_SetNumTexGens(u32 nr);
|
||||
void GX_SetPixelFmt(u8 pix_fmt,u8 z_fmt);
|
||||
void GX_SetTevOp(u8 tevstage,u8 mode);
|
||||
void GX_SetTevOrder(u8 tevstage,u8 texcoord,u32 texmap,u8 color);
|
||||
void GX_SetViewportJitter(f32 xOrig,f32 yOrig,f32 wd,f32 ht,f32 nearZ,f32 farZ,u32 field);
|
||||
void GX_SetVtxAttrFmt(u8 vtxfmt,u32 vtxattr,u32 comptype,u32 compsize,u32 frac);
|
||||
void GX_SetVtxDesc(u8 attr,u8 type);
|
||||
void GX_SetZMode(u8 enable,u8 func,u8 update_enable);
|
||||
u32 SYS_GetArena1Size(void);
|
||||
void VIDEO_ClearFrameBuffer(GXRModeObj *rmode,void *fb,u32 color);
|
||||
void VIDEO_Configure(GXRModeObj *rmode);
|
||||
void VIDEO_Flush(void);
|
||||
u32 VIDEO_GetCurrentTvMode(void);
|
||||
u32 VIDEO_GetNextField(void);
|
||||
GXRModeObj * VIDEO_GetPreferredMode(GXRModeObj *mode);
|
||||
u32 VIDEO_HaveComponentCable(void);
|
||||
void VIDEO_Init(void);
|
||||
void VIDEO_SetBlack(bool black);
|
||||
void VIDEO_SetNextFramebuffer(void *fb);
|
||||
VIRetraceCallback VIDEO_SetPostRetraceCallback(VIRetraceCallback callback);
|
||||
void VIDEO_WaitVSync(void);
|
||||
|
||||
uint32_t SYS_GetArena1Size(void);
|
||||
#endif
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef LIBOGC_STUB_OGCSYS_H
|
||||
#define LIBOGC_STUB_OGCSYS_H
|
||||
#ifndef STUB_OGCSYS_H
|
||||
#define STUB_OGCSYS_H
|
||||
#include <gccore.h>
|
||||
#endif
|
||||
@@ -1,54 +1,9 @@
|
||||
/* Stand-in for devkitPro's libnx <switch.h>.
|
||||
*
|
||||
* Only what the translation units checked here name, declared with the
|
||||
* shapes libnx gives them. As the note at the top of compile-matrix.sh
|
||||
* says, this does not prove the real SDK matches: it proves RetroArch's
|
||||
* own Switch code is well formed and that every symbol it uses is one it
|
||||
* has arranged to have. That is the class of breakage these lanes are
|
||||
* for - a driver naming a struct member or a setting that moved.
|
||||
*/
|
||||
#ifndef LIBNX_STUB_SWITCH_H
|
||||
#define LIBNX_STUB_SWITCH_H
|
||||
|
||||
#ifndef STUB_SWITCH_H
|
||||
#define STUB_SWITCH_H
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
typedef int32_t s32;
|
||||
typedef uint32_t Result;
|
||||
|
||||
/* mem_stats.c */
|
||||
#define R_SUCCEEDED(r) ((r) == 0)
|
||||
#define CUR_PROCESS_HANDLE 0
|
||||
typedef enum { InfoType_TotalMemorySize = 6, InfoType_UsedMemorySize = 7 } InfoType;
|
||||
#define CUR_PROCESS_HANDLE 0xFFFF8001
|
||||
#define R_SUCCEEDED(res) ((res) == 0)
|
||||
#define R_FAILED(res) ((res) != 0)
|
||||
Result svcGetInfo(u64 *out, u32 id, u32 handle, u64 sub);
|
||||
|
||||
/* The window and framebuffer the Switch video driver draws through */
|
||||
typedef struct NWindow NWindow;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *buf;
|
||||
u32 stride;
|
||||
} Framebuffer;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PIXEL_FORMAT_RGBA_8888 = 1
|
||||
} PixelFormat;
|
||||
|
||||
NWindow *nwindowGetDefault(void);
|
||||
Result nwindowSetDimensions(NWindow *nw, u32 width, u32 height);
|
||||
|
||||
Result framebufferCreate(Framebuffer *fb, NWindow *win,
|
||||
u32 width, u32 height, u32 format, u32 num_fbs);
|
||||
Result framebufferMakeLinear(Framebuffer *fb);
|
||||
void *framebufferBegin(Framebuffer *fb, u32 *out_stride);
|
||||
void framebufferEnd(Framebuffer *fb);
|
||||
void framebufferClose(Framebuffer *fb);
|
||||
|
||||
Result svcGetInfo(uint64_t *out, uint32_t id, uint32_t handle, uint64_t sub);
|
||||
#endif
|
||||
@@ -19,7 +19,6 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: Check Out Repo
|
||||
@@ -42,20 +41,11 @@ jobs:
|
||||
out-file-path: "temp"
|
||||
|
||||
- name: Update packages
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
for i in 1 2 3; do
|
||||
sudo timeout 90 apt-get -yq update \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 && break
|
||||
echo "apt-get update failed (attempt $i); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
run: sudo apt-get -yq update
|
||||
|
||||
- name: Install webOS CLI
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
sudo apt-get -yq install \
|
||||
-o Acquire::Retries=3 -o Acquire::http::Timeout=30 \
|
||||
./temp/ares-package_*_amd64.deb \
|
||||
./temp/webosbrew-toolbox-gen-manifest_*.deb
|
||||
|
||||
@@ -91,32 +81,6 @@ jobs:
|
||||
RARCH_VERSION=$(grep -Po '(?<=#define PACKAGE_VERSION ")[^"]+' version.all)
|
||||
echo "RARCH_VERSION=$RARCH_VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Resolve SDL2 prebuilt archive
|
||||
id: sdl2
|
||||
shell: bash
|
||||
run: |
|
||||
URL=$(sed -n 's/^SDL2_PREBUILT_ARCHIVE *?= *//p' Makefile.webos)
|
||||
echo "url=$URL" >> "$GITHUB_OUTPUT"
|
||||
echo "name=$(basename "$URL")" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Cache SDL2 prebuilt
|
||||
id: sdl2-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/sdl2-prebuilt
|
||||
key: sdl2-prebuilt-${{ steps.sdl2.outputs.name }}
|
||||
|
||||
- name: Download SDL2 prebuilt
|
||||
if: steps.sdl2-cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
env:
|
||||
SDL2_URL: ${{ steps.sdl2.outputs.url }}
|
||||
SDL2_NAME: ${{ steps.sdl2.outputs.name }}
|
||||
run: |
|
||||
mkdir -p /tmp/sdl2-prebuilt
|
||||
curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 \
|
||||
--connect-timeout 30 -o "/tmp/sdl2-prebuilt/$SDL2_NAME" "$SDL2_URL"
|
||||
|
||||
- name: Compile RA (GLES2, no wayland legacy variant)
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -124,14 +88,12 @@ jobs:
|
||||
export SDK_PATH=/tmp/arm-webos-linux-gnueabi_sdk-buildroot
|
||||
make -f Makefile.webos clean
|
||||
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=1 \
|
||||
SDL2_PREBUILT_ARCHIVE="file:///tmp/sdl2-prebuilt/${SDL2_NAME}" \
|
||||
-j"$(getconf _NPROCESSORS_ONLN)"
|
||||
mkdir -p webos/arm
|
||||
mv webos/com.retroarch.webos_${RARCH_VERSION}_arm.ipk \
|
||||
webos/arm/com.retroarch.webos-legacy-gles2-no-wayland_${RARCH_VERSION}_arm.ipk
|
||||
env:
|
||||
DEBUG: ${{ github.event_name == 'release' && '0' || '1' }}
|
||||
SDL2_NAME: ${{ steps.sdl2.outputs.name }}
|
||||
|
||||
- name: Upload GLES2 artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
@@ -148,7 +110,6 @@ jobs:
|
||||
make -f Makefile.webos clean
|
||||
bash gfx/common/wayland/generate_wayland_protos.sh
|
||||
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=1 \
|
||||
SDL2_PREBUILT_ARCHIVE="file:///tmp/sdl2-prebuilt/${SDL2_NAME}" \
|
||||
HAVE_XKBCOMMON=1 HAVE_USERLAND=1 HAVE_EGL=1 HAVE_WAYLAND=1 \
|
||||
HAVE_OPENGLES3=1 HAVE_OPENGLES3_1=1 HAVE_OPENGLES3_2=1 -j"$(getconf _NPROCESSORS_ONLN)"
|
||||
mkdir -p webos/arm
|
||||
@@ -156,7 +117,6 @@ jobs:
|
||||
webos/arm/com.retroarch.webos_${RARCH_VERSION}_arm.ipk
|
||||
env:
|
||||
DEBUG: ${{ github.event_name == 'release' && '0' || '1' }}
|
||||
SDL2_NAME: ${{ steps.sdl2.outputs.name }}
|
||||
|
||||
- name: Upload default artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
@@ -181,8 +141,7 @@ jobs:
|
||||
export SDK_PATH=/tmp/aarch64-webos-linux-gnu_sdk-buildroot
|
||||
make -f Makefile.webos clean
|
||||
bash gfx/common/wayland/generate_wayland_protos.sh
|
||||
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} \
|
||||
ADD_SDL2_LIB=0 HAVE_SDL2=0 HAVE_SDL3=1 \
|
||||
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=0 \
|
||||
HAVE_XKBCOMMON=1 HAVE_USERLAND=1 HAVE_EGL=1 HAVE_WAYLAND=1 \
|
||||
HAVE_OPENGLES3=1 HAVE_OPENGLES3_1=1 HAVE_OPENGLES3_2=1 \
|
||||
HAVE_WAYLAND_BACKPORT=0 HAVE_64TO32BIT_BRIDGE=1 SET_ELF_INTERPRETER=1 HAVE_UDEV=1 \
|
||||
|
||||
+1
-24
@@ -4,8 +4,6 @@
|
||||
*.exe
|
||||
*.bmpobj
|
||||
*.binobj
|
||||
*.shbin
|
||||
*.shbin.s
|
||||
*.so
|
||||
*.so.*
|
||||
*.dll
|
||||
@@ -16,10 +14,6 @@
|
||||
*.swp
|
||||
*.cache
|
||||
*.gcda
|
||||
# clang --analyze drops a .plist report per translation unit into the
|
||||
# working directory. Anchored to the repository root so the tracked
|
||||
# Info.plist / ExportOptions.plist files under pkg/apple are unaffected.
|
||||
/*.plist
|
||||
*.lcbk
|
||||
*.gcno
|
||||
.tmp
|
||||
@@ -71,7 +65,6 @@ apple/RetroArch_iOS.xcodeproj/project.xcworkspace/*
|
||||
/Cg/
|
||||
/GL/
|
||||
/SDL/
|
||||
/SDL3/
|
||||
/ffmpeg/
|
||||
/freetype2/
|
||||
/ft2build.h
|
||||
@@ -99,7 +92,7 @@ content_video_history.lpl
|
||||
saves
|
||||
screenshots
|
||||
autoconfig
|
||||
/config
|
||||
config
|
||||
/database
|
||||
overlays
|
||||
playlists
|
||||
@@ -267,21 +260,6 @@ gfx/common/wayland/webos-surface-group.h
|
||||
gfx/common/wayland/tearing-control-v1.h
|
||||
gfx/common/wayland/tearing-control-v1.c
|
||||
|
||||
# samples/: built harness executables and objects. Each directory's
|
||||
# test is <dir>_test; nothing built there is source.
|
||||
samples/**/*_test
|
||||
samples/audio/stretch/stretch_bench
|
||||
samples/**/*.o
|
||||
libretro-common/samples/**/*_test
|
||||
!libretro-common/samples/**/*_test/
|
||||
# Harness executables that are not named <dir>_test. This one had been
|
||||
# committed as a built binary, which made any make clean in that
|
||||
# directory show up as a deletion.
|
||||
samples/audio/embedded_alsa/abi_check
|
||||
samples/gfx/font_lifecycle/lifecycle
|
||||
samples/gfx/font_lifecycle/lifecycle-threaded
|
||||
samples/gfx/font_lifecycle/create
|
||||
|
||||
# libretro-common samples
|
||||
libretro-common/samples/streams/rzip/rzip
|
||||
libretro-common/samples/audio/audio_mixer_loop/audio_mixer_loop_test
|
||||
@@ -318,4 +296,3 @@ gfx/drivers/rsx_shaders/modern_opaque.fpo
|
||||
gfx/drivers/rsx_shaders/modern_opaque.vpo
|
||||
pkg/psl1ght/pkg/USRDIR/shaders_cg/
|
||||
!pkg/psl1ght/pkg/USRDIR/system/
|
||||
samples/audio/embedded_alsa/ealsa_abi.h
|
||||
+3
-3
@@ -782,7 +782,7 @@ build-static-retroarch-dummy-psp:
|
||||
- "cp -f pkg/psp1/PIC1.PNG ${MEDIA_PATH}/${CI_PROJECT_NAME}/pkg"
|
||||
|
||||
build-static-retroarch-vita:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-vita:latest-20260905
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-vita:latest
|
||||
stage: prepare-for-static-cores
|
||||
before_script:
|
||||
- export NUMPROC=$(($(nproc)/3))
|
||||
@@ -808,7 +808,7 @@ build-static-retroarch-vita:
|
||||
- "mv .retroarch-precompiled-gl/ retroarch-precompiled-gl/"
|
||||
|
||||
build-static-retroarch-dummy-vita:
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-vita:latest-20260905
|
||||
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-vita:latest
|
||||
stage: build
|
||||
variables:
|
||||
MEDIA_PATH: .media
|
||||
@@ -991,7 +991,7 @@ build-static-retroarch-ctr-legacy:
|
||||
needs: []
|
||||
script:
|
||||
# Allow failure since we don't have a core
|
||||
- "make -f Makefile.ctr -j$NUMPROC USE_CTRULIB_2=0 ||:"
|
||||
- "make -f Makefile.ctr -j$NUMPROC ||:"
|
||||
- "mkdir .retroarch-precompiled"
|
||||
- "cp -r ./* .retroarch-precompiled/"
|
||||
- "mv .retroarch-precompiled/ retroarch-precompiled/"
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
AGENTS.md
|
||||
|
||||
## Project
|
||||
|
||||
RetroArch is primarily written in C89. Preserve the existing language and style of the file being edited.
|
||||
|
||||
- New C code must be C89-compatible unless the surrounding code explicitly requires otherwise.
|
||||
- Do not introduce C99/C11 features into C89 code.
|
||||
- Existing files written in C++, Objective-C, or another language should remain in that language.
|
||||
- Follow the conventions of surrounding code rather than introducing a new style.
|
||||
- Prefer the smallest change that completely solves the task.
|
||||
- Preserve existing architecture
|
||||
|
||||
RetroArch contains deliberately complex, cross-file systems. Do not simplify, consolidate, refactor, or redesign an existing subsystem merely because its structure appears unnecessarily complicated.
|
||||
|
||||
Complexity may exist for compatibility, platform, driver, or architectural reasons.
|
||||
|
||||
When implementing a feature, find an existing feature with similar behavior and follow its implementation pattern. The current source tree takes precedence over historical examples.
|
||||
|
||||
Do not make unrelated cleanup or refactoring changes.
|
||||
|
||||
## Comments
|
||||
|
||||
Keep comments as short as possible.
|
||||
|
||||
- Prefer no comment when the code is self-explanatory.
|
||||
- When a comment is necessary, prefer a few words or a few lines at most.
|
||||
- Explain why something is non-obvious, rather than describing what obvious code does.
|
||||
- Do not add comments merely because code was changed.
|
||||
- Do not describe the previous implementation or behavior unless that historical context is necessary to understand the current code.
|
||||
- Do not use comments as miniature documentation or change logs.
|
||||
- Prefer clear names and straightforward code over explanatory comments.
|
||||
|
||||
Comments should describe information that will remain useful after the current change is forgotten.
|
||||
|
||||
## Commit messages
|
||||
|
||||
Keep commit messages concise and focused.
|
||||
|
||||
- Explain what changed and why.
|
||||
- Prefer a short subject line and a brief body when additional context is useful.
|
||||
- Do not enumerate every changed file or implementation detail.
|
||||
- Do not describe intermediate attempts, discarded approaches, or the development process.
|
||||
- Do not explain the previous implementation unless it is necessary to understand the change.
|
||||
- Keep the complete commit message below approximately 600 words.
|
||||
- A commit message is not a changelog or development diary.
|
||||
|
||||
## Menu changes
|
||||
|
||||
Adding or modifying a menu option commonly requires changes in several parts of the codebase.
|
||||
|
||||
Do not assume that a menu option can be implemented by modifying only the file where it is displayed.
|
||||
|
||||
### Before adding a menu option:
|
||||
|
||||
- Find an existing menu option with similar behavior.
|
||||
- Trace its complete implementation through the menu, settings, configuration, and message systems.
|
||||
- Identify every part of that pattern that applies to the new option.
|
||||
- Implement the new option consistently across all required layers.
|
||||
- Do not modify unrelated menu code.
|
||||
|
||||
#### Useful reference commits:
|
||||
|
||||
- 6e9aa66aea2b2b3d0687585e41bac658ac9ae252 — SMB timeout/context settings exposed as menu options.
|
||||
- 434f41b935232325ed13024786653f9dfef49643 — CRT menu additions.
|
||||
- 23170b82ec58c2b283a7132b85fa73e18050a5ae — MIDI device dropdown menu items.
|
||||
05faba73e3fed69a5e118df2cc28d31309089243 — menu implementation example.
|
||||
|
||||
These are reference implementations, not fixed lists of files to modify. The required files depend on the feature.
|
||||
|
||||
## Shader and video backend changes
|
||||
|
||||
Shader functionality frequently crosses shared shader code and multiple video backends.
|
||||
|
||||
### When adding or modifying shader functionality:
|
||||
|
||||
- Find an existing shader feature with similar behavior.
|
||||
- Trace the feature through the shared shader infrastructure.
|
||||
- Identify every applicable shader implementation and video backend.
|
||||
- Keep backend implementations consistent where the feature is supported.
|
||||
- Do not update only the backend currently being tested if the feature is expected to work elsewhere.
|
||||
- Check platform/backend-specific differences rather than blindly duplicating code.
|
||||
|
||||
#### Useful reference commits:
|
||||
|
||||
- da5ecaa45a862e51783eca1280f46fbfb7984ede — OriginalAspect and OriginalAspectRot uniforms.
|
||||
- 2a56a827e8a97a3838a9d455f1dca442c0ffbb07 — frametime/original-FPS shader uniforms.
|
||||
- 37cfa4857d064464754e800bad89ce69e81230fe — sensor shader uniforms across multiple shader and video/input backends.
|
||||
|
||||
These commits demonstrate the breadth of changes that may be required. They are examples of implementation patterns, not instructions to reproduce their exact file lists.
|
||||
|
||||
## Historical commits
|
||||
|
||||
Historical commits may be used to understand established implementation patterns.
|
||||
|
||||
- Treat examples as references, not specifications.
|
||||
- Prefer the current source tree when it differs from an historical commit.
|
||||
- Do not copy historical changes mechanically.
|
||||
- Do not reproduce obsolete workarounds merely because they appear in an old commit.
|
||||
- Inspect surrounding current code before applying a historical pattern.
|
||||
|
||||
## Scope of changes
|
||||
|
||||
Keep changes focused.
|
||||
|
||||
### Do not:
|
||||
|
||||
- reformat unrelated code;
|
||||
- rename unrelated symbols;
|
||||
- modernize C89 code;
|
||||
- replace established patterns with preferred patterns;
|
||||
- refactor neighboring code without a direct need;
|
||||
- add documentation or comments solely to explain the current change;
|
||||
- make speculative improvements.
|
||||
|
||||
If a task requires a broad change, make the breadth necessary for the feature rather than artificially minimizing the number of files changed.
|
||||
|
||||
A change touching many files is not inherently a problem in RetroArch. Missing a required layer of an established multi-file system is a problem.
|
||||
@@ -0,0 +1,513 @@
|
||||
static const char *retroarch_contributors_list = R"(
|
||||
RetroArch and the libretro team would like to
|
||||
acknowledge the following contributors:
|
||||
|
||||
1ch (L0sted)
|
||||
23rd
|
||||
6lackmag3
|
||||
A Schain (aschain)
|
||||
Aaron Oneal (aarononeal)
|
||||
Aaron Ramirez (aaronbytes)
|
||||
Abadede
|
||||
Adam Londero (alondero)
|
||||
Adam Mechtley (amechtley)
|
||||
Adriano de Moura Leite (amlib)
|
||||
Adrien Moulin (elyosh)
|
||||
Aethyrion
|
||||
ajefr
|
||||
AKuHAK
|
||||
Alberto Alonso Ruibal (albertoruibal)
|
||||
Alberto Fustinoni (albertofustinoni)
|
||||
Alberto Simon (asimonf)
|
||||
Alcaro
|
||||
aldebaran27
|
||||
Aleksey Samoilov (Sunderland93)
|
||||
Alessandro Mangone (Vektor) (zevektor)
|
||||
Alex Folland (AlexFolland)
|
||||
Alex Kornitzer (alexkornitzer)
|
||||
Alexander Spady (alkaseltzerspadt)
|
||||
Alexander Trufanov (trufanov-nok)
|
||||
Alexandre Garcia (Alexandre-Garcia)
|
||||
Alfredo Monclus (alfrix)
|
||||
aliaspider
|
||||
alphanu1
|
||||
altiereslima
|
||||
Alwin Garside (Yogarine)
|
||||
amtz
|
||||
Anders Storhaug (andersstorhaug)
|
||||
Andre Leiradella (leiradel)
|
||||
Andrés (fr500)
|
||||
Andy Nguyen (TheOfficialFloW)
|
||||
Anthony J. Bentley (bentley)
|
||||
Antonio Jose Ramos Marquez (psxdev)
|
||||
antonioginer
|
||||
Apaczer
|
||||
AridRayne
|
||||
ArnaudFaucher
|
||||
arpruss
|
||||
arstn
|
||||
Artem Polishchuk (tim77)
|
||||
Arto Vainiolehto (arakerlu)
|
||||
asavah
|
||||
Ash (ashquarky)
|
||||
Ashura (CoalaJoe)
|
||||
Avton1
|
||||
ayssia
|
||||
BananaRama203
|
||||
barbudreadmon
|
||||
Barry Rowe (BarryJRowe)
|
||||
Bartłomiej Burdukiewicz (dev-0x7C6)
|
||||
Bashar Astifan (basharast)
|
||||
bearoso
|
||||
Ben Hamilton (Ben Gertzfield) (bhamiltoncx)
|
||||
benklop
|
||||
benutzer193
|
||||
Bernhard Schelling (schellingb)
|
||||
blackgur
|
||||
bmaupin
|
||||
Bobby Smith (bslenul)
|
||||
Boris Timofeev (btimofeev)
|
||||
Brad (SpiralBrad)
|
||||
Braden Farmer (farmerbb)
|
||||
Brandon Johnson (BinaryFissionGames)
|
||||
Breno Dantas Mendonça (brenodantas10)
|
||||
Brian Hoem (ZornTaov)
|
||||
Brian Koropoff (bkoropoff)
|
||||
Brian S. Stephan (bsstephan)
|
||||
BringerethOfLight
|
||||
Brunnis
|
||||
bsmith (DogParty)
|
||||
bubuleur
|
||||
bulzipke
|
||||
C.W. Betts (MaddTheSane)
|
||||
Casey Borders (CaseyB)
|
||||
CatGreen90
|
||||
ceb33
|
||||
cedorg
|
||||
celerizer
|
||||
Charlène (julianaito)
|
||||
CheezeCake
|
||||
Chris Merrett (chrisfu)
|
||||
Christian Murphy (grimpunch)
|
||||
christianhaitian
|
||||
Christoffer Tibell (Brottweiler)
|
||||
Christopher Snowhill (kode54)
|
||||
chu (9chu)
|
||||
Chuck Smith (chucksmith)
|
||||
CidVonHighwind
|
||||
clienthax
|
||||
cold-brewed
|
||||
Colin Kinloch (ColinKinloch)
|
||||
CompCom
|
||||
ComradeEcho
|
||||
confusedguy9
|
||||
Conn O'Griofa (psyke83)
|
||||
Connor McLaughlin (stenzek)
|
||||
Conrad Kreyling (konistehrad)
|
||||
CozmoP
|
||||
Cpasjuste
|
||||
cpsw
|
||||
Cray Elliott (MP2E)
|
||||
Crestwave
|
||||
CrewMdk
|
||||
Cristi Mitrana (cmitu)
|
||||
Cristian Sandu (crazyquark)
|
||||
crystalct
|
||||
CTCaer
|
||||
cucholix
|
||||
cudencuden
|
||||
CyberLabSystems
|
||||
Daehan Kim (iAmGhost)
|
||||
dalter
|
||||
Dan Weiss (Dwedit)
|
||||
danieljg
|
||||
Daniil Zhilin (LaserMoai)
|
||||
dankcushions
|
||||
Darren Thompson (DiscoStarslayer)
|
||||
Dave (freakdave)
|
||||
Dave Leaver (danzel)
|
||||
David CARLIER (devnexen)
|
||||
David Demelier (markand)
|
||||
David Erickson (daviderickson)
|
||||
David G. F. (davidgfnet)
|
||||
David Lawson (dmrlawson)
|
||||
David Walters (hiddenasbestos)
|
||||
dbaronica
|
||||
DEX357
|
||||
diablodiab
|
||||
dibas
|
||||
Diego A. (SuperrSonic)
|
||||
Diego Viola (diegoviola)
|
||||
digitalisland-nino
|
||||
Diogo Barros (BlueKore)
|
||||
Dmitry Sergeenkov (DuMOHsmol)
|
||||
dor3k
|
||||
Doug Christman (dobyrch)
|
||||
driver1998
|
||||
Dudu Akiva (duduke)
|
||||
duganchen
|
||||
dukemiller
|
||||
duskgao
|
||||
Dylan Scott (dyscott)
|
||||
Dystopian
|
||||
eadmaster
|
||||
Eduard Strehlau (Herdinger)
|
||||
ekipan
|
||||
Elvira Khabirova (parport0)
|
||||
embercold
|
||||
Emmanuel Martin (daliaetnano)
|
||||
Ethan Lee (flibitijibibo)
|
||||
extrowerk
|
||||
Ezio-PS
|
||||
F (erbridge)
|
||||
Fabio (Oibaf66)
|
||||
Fabio Ritrovato (Sephiroth87)
|
||||
Fayne Aldan (FayneAldan)
|
||||
fff (felinben)
|
||||
Filipe Azevedo (pasnox)
|
||||
FIX94
|
||||
Flame Sage (flamesage)
|
||||
flyinghead
|
||||
FmT0
|
||||
francescotintori
|
||||
Francisco Javier Trujillo Mata (fjtrujy)
|
||||
Francisco José García García (frangarcj)
|
||||
FreeShippingParty
|
||||
fuzzydunlops732 (JKoppel93)
|
||||
GABO1423
|
||||
Gabriel (Ghabry)
|
||||
GameDragon2k
|
||||
Garrett Brown (garbear)
|
||||
gatecat (daveshah1)
|
||||
GavinDarkglider
|
||||
gblues
|
||||
Geoffrey Plitt (GeoffreyPlitt)
|
||||
Giovanni Cascione (spleen1981)
|
||||
Glenn Hevey (hevey)
|
||||
Googer
|
||||
gordon-fish
|
||||
gouchi
|
||||
Gregor Richards (GregorR)
|
||||
Grzegorz Raciborski (graciborski)
|
||||
Gui Andrade (archshift)
|
||||
Guillaume Thiolliere (thiolliere)
|
||||
Guo Yunhe (guoyunhe)
|
||||
Gustavo Maciel Dias Vieira (gmdvieira)
|
||||
gvbr
|
||||
hadess
|
||||
Hans-Kristian Arntzen (Themaister)
|
||||
Henri Gomez (hgomez)
|
||||
Henri Gomez (hgomez-sonarsource)
|
||||
Henry Castro (hcvcastro)
|
||||
Higor E. (heuripedes)
|
||||
hizzlekizzle
|
||||
Hugo B. (hug0b)
|
||||
Hugo Hromic (hhromic)
|
||||
hunterk
|
||||
Hyllian
|
||||
HyperspaceMadness
|
||||
i30817
|
||||
im4potato
|
||||
ImJezze
|
||||
İbrahim Güngör (igungor)
|
||||
Jack (jakcron)
|
||||
Jacob (cubtekki)
|
||||
Jacob (RegenJacob)
|
||||
Jacob Patterson (jacobpa)
|
||||
jacobsson (Roet-Ivar)
|
||||
Jahed
|
||||
Jake Stine (jstine35)
|
||||
James Le Cuirot (chewi)
|
||||
James Sexton (Bezier89)
|
||||
Jamiras
|
||||
Jan Holthuis (Holzhaus)
|
||||
Jason Tomsic (plaidman)
|
||||
Javier Martinez Canillas (martinezjavier)
|
||||
Jay McCarthy (jeapostrophe)
|
||||
jdgleaver
|
||||
Jean-André Santoni (kivutar)
|
||||
Jean-Paul Mari (djipi)
|
||||
Jean-Sébastien Guay (Skylark13)
|
||||
Jeff (jeffbdavenport)
|
||||
Jeff Sousa (LordeIlluminati)
|
||||
jess (winneon)
|
||||
Jesse Talavera-Greenberg (JesseTG)
|
||||
Joan Coll Cerdán (johanbcn)
|
||||
Job Adrian Salinas Gonzalez (efylan)
|
||||
Joe Osborn (JoeOsborn)
|
||||
Joel (joel16)
|
||||
Joel Puig Rubio (XXLuigiMario)
|
||||
Joerg Sonnenberger (jsonn)
|
||||
Johannes Schickel (lordhoto)
|
||||
John Parton (john-parton)
|
||||
John Regan (jprjr)
|
||||
Jon Maddox (maddox)
|
||||
Jonathan (JonnyMe)
|
||||
Jonathan Relf (jonathanrelf)
|
||||
Joohan Lee (losernator)
|
||||
Jools Wills (joolswills)
|
||||
Jose Lage Miguez (Joselagem)
|
||||
Joseph Carter (knghtbrd)
|
||||
Joseph Conan Montgomery (Grotke)
|
||||
jsd1982 (JamesDunne)
|
||||
jSTE0
|
||||
JuanVCS
|
||||
Justin Jacobs (dorkster)
|
||||
Justin Weiss (justinweiss)
|
||||
JustMeDaFaq
|
||||
Kangmo-Ahn
|
||||
Karl Forshaw (karlforshaw)
|
||||
Kate Eckhart (katepango)
|
||||
Keith Bowes (keithbowes)
|
||||
Ken Rossato (rossato)
|
||||
kikmon
|
||||
Kopert
|
||||
Krzysztof Haładyn (krzys_h) (krzys-h)
|
||||
kurumushi
|
||||
kwyxz
|
||||
l3iggs
|
||||
lambolighting
|
||||
lasers
|
||||
Lawrence Kesteloot (lkesteloot)
|
||||
LazyBumHorse
|
||||
LazyFunker
|
||||
Lennard Kittner (Lennard599)
|
||||
LibretroAdmin
|
||||
Lionel Flandrin (simias)
|
||||
littleguy77
|
||||
liushuyu
|
||||
Logan McNaughton (loganmc10)
|
||||
lordashram
|
||||
Lothar Serra Mari (lotharsm)
|
||||
Lubosz Sarnecki (lubosz)
|
||||
lucasmr
|
||||
lucianposton
|
||||
lxerandrew
|
||||
m4xw
|
||||
mahoneyt944
|
||||
Mahyar Koshkouei (deltabeard)
|
||||
Mai (lioncash)
|
||||
MajorPainTheCactus
|
||||
maksun
|
||||
Manuel Alfayate Corchete (vanfanel)
|
||||
Marcelo Munhoz Pélos (mpelos)
|
||||
Marcus Crisostomo (mcrisostomo)
|
||||
markwkidd
|
||||
Maschell
|
||||
Mats (Myaats)
|
||||
Matt Sephton (gingerbeardman)
|
||||
Matthew Bauer (matthewbauer)
|
||||
Matthew Wang (asakous)
|
||||
Max K. (langerhans)
|
||||
Maxime Gauduin (alucryd)
|
||||
meancoot
|
||||
meepingsnesroms
|
||||
meleu
|
||||
Merry Mello (merryMellody)
|
||||
micechal
|
||||
Michael Burgardt (DisasterMo)
|
||||
Michael K. (kuxii2016)
|
||||
Michael Lelli (ToadKing)
|
||||
mickski56
|
||||
Mico Chopitea (micochops)
|
||||
miguelpinheiro
|
||||
Mike Swanson (chungy)
|
||||
mikeOSX
|
||||
minucce
|
||||
misson20000
|
||||
esoptron
|
||||
Monroe88
|
||||
Morgane (MorganeAD)
|
||||
mprobinson
|
||||
MrHuu
|
||||
MrJs (mrjschulte)
|
||||
Muhamed Hobi (mmhobi7)
|
||||
muzuiget
|
||||
N/A (inactive123)
|
||||
Nargash
|
||||
Nathan S. (natinusala)
|
||||
NathanStrong-Tripwire
|
||||
nattycleopatra
|
||||
Naveen (naveensrinivasan)
|
||||
nayslayer
|
||||
negativeExponent
|
||||
Neil Barkhina (nbarkhina)
|
||||
neil4
|
||||
netux79
|
||||
nfnty
|
||||
nfp0
|
||||
nia (alarixnia)
|
||||
Nicolas Adenis-Lamarre (nadenislamarre)
|
||||
Nicolas Guillaumin (nguillaumin)
|
||||
Nicolas Roehm (NicolasRoehm)
|
||||
Nik (WerWolv)
|
||||
Nikita Vakhrushev (XF10C)
|
||||
Nikola Kocić (nikola-kocic)
|
||||
Nikos Chantziaras (realnc)
|
||||
Nils Hasenbanck (hasenbanck)
|
||||
njordan64
|
||||
nosh01
|
||||
not6 (r-type)
|
||||
notaz
|
||||
nstCactus
|
||||
nurupo
|
||||
Oggom
|
||||
Oh Won Sik (dnjstlr555)
|
||||
Oleg Shevchenko (olsh)
|
||||
Omar Saleem (ofsaleem)
|
||||
opendata26
|
||||
Ophidon
|
||||
orbea
|
||||
Oschowa
|
||||
OsirizX
|
||||
OV2
|
||||
Palmic (mpalomas)
|
||||
pamapa
|
||||
Paolo Bonzini (bonzini)
|
||||
Paul McCarty (notabeatle)
|
||||
pcjco
|
||||
Pedro Ferraz (ferrazpedro)
|
||||
Pedro Ribeiro (pedrib)
|
||||
Peter J Kos (pkos)
|
||||
Philippe Simons (loki666)
|
||||
pinumbernumber
|
||||
Piotr Dobrowolski (Informatic)
|
||||
pjft
|
||||
Poligraf
|
||||
pponso1
|
||||
pyroesp
|
||||
R-YaTian
|
||||
Rafael Toledo (rafaeltoledo)
|
||||
Ramiro Morales (ramiro)
|
||||
Raphaël Zumer (rzumer)
|
||||
redenvelope2000
|
||||
Reid Kleckner (rnk)
|
||||
repojohnray
|
||||
retrotails
|
||||
revvv
|
||||
reztek
|
||||
Richard Howell (rmaz)
|
||||
Rinnegatamante
|
||||
rlnilsen
|
||||
Rob Loach (RobLoach)
|
||||
Robin de Rooij (rrooij)
|
||||
Romain Gay (vikbez)
|
||||
Romain Graillot (notnotme)
|
||||
Romain TISSERAND (rtissera)
|
||||
Roman Fomin (rfomin)
|
||||
Roman Kalashnikov (lunixoid)
|
||||
Royerson
|
||||
rsn8887
|
||||
Ruben Nine (rnine)
|
||||
Ryan C. Gordon (icculus)
|
||||
Ryan Kuba (thelamer)
|
||||
Ryunam
|
||||
rz5
|
||||
Sage (neonfuz)
|
||||
Saggi Mizrahi (ficoos)
|
||||
SAKUJ0
|
||||
Salvador (salvacam)
|
||||
Sam (44100hertz)
|
||||
Sam Lantinga (slouken)
|
||||
Sam Stenvall (Jalle19)
|
||||
Samuel P. (p-sam)
|
||||
Sanaki
|
||||
Scheiker
|
||||
Sean O'Neil (seanocali)
|
||||
Sebastien Ronsse (sronsse)
|
||||
SecularSteve
|
||||
Sefa Eyeoglu (Scrumplex)
|
||||
Sergei Nikitin (Kert)
|
||||
Sergei Trofimovich (trofi)
|
||||
Sergi Granell (xerpi)
|
||||
Sergio Padrino (sergiou87)
|
||||
sergio-br2 (sergiobenrocha2)
|
||||
Seth Kingsley (sethk)
|
||||
Shadow (ShadowOne333)
|
||||
Shane Mouton (ismouton)
|
||||
shantigilbert
|
||||
Shfty
|
||||
Shizeeg Unadequatov (shizeeg)
|
||||
SimpleTease
|
||||
SindenLightgun
|
||||
Sirrempat
|
||||
slotek
|
||||
Soar Qin (soarqin)
|
||||
sonninnos
|
||||
Sou Bunnbu (iyzsong)
|
||||
sparklewind
|
||||
spec-chum
|
||||
Stefan (gizmo98)
|
||||
stefan-gr
|
||||
stellarporter
|
||||
Stephanie Gawroriski (XerTheSquirrel)
|
||||
Steve Cox (stevenjamescox)
|
||||
Stevoisiak
|
||||
stoofin
|
||||
StormedBubbles
|
||||
strotlog
|
||||
Stuart Carnie (stuartcarnie)
|
||||
Sunguk Lee (d3m3vilurr)
|
||||
Supernature2k
|
||||
Sven (RetroSven)
|
||||
Swizzy
|
||||
Sylvain Colinet (Skarsnik)
|
||||
Szunti
|
||||
Tadek Kijkowski (monkeyman79)
|
||||
Tatsuya79
|
||||
Terry Lewis (terry-au)
|
||||
thedax
|
||||
theheroGAC
|
||||
TheMrIron2
|
||||
ThePhxRises
|
||||
TheRhysWyrill
|
||||
Thomas Lorblanchès (Zlika)
|
||||
Tilman M. Jaeschke (asciibeats)
|
||||
Tim Van den Langenbergh (tmtvl)
|
||||
Tobias Gruetzmacher (TobiX)
|
||||
Tobias Jakobi (tobiasjakobi)
|
||||
Todd Laney (ToddLa)
|
||||
Tomáš Kelemen (ToKe79)
|
||||
Tor Arne Vestbø (torarnv)
|
||||
Torsten Paul (t-paul)
|
||||
TotalCaesar659
|
||||
tr12345
|
||||
TroggleMonkey
|
||||
tunip3
|
||||
txorion
|
||||
Tyler Loch (TylerLoch)
|
||||
URBANsUNITED
|
||||
vaguerant
|
||||
Val Packett (valpackett)
|
||||
Valerio Proietti (kamicane)
|
||||
vgmoose
|
||||
Viachaslau Khalikin (viachaslavic)
|
||||
Vicki Pfau (endrift)
|
||||
Vicky C Lau (vickychenglau)
|
||||
vin (suseme)
|
||||
Vincent Pelletier (vpelletier)
|
||||
Vladimir Panteleev (CyberShadow)
|
||||
Vladimir Serbinenko (phcoder)
|
||||
Víctor "IlDucci" (IlDucci)
|
||||
waitingmoon
|
||||
Warning: Non-Potable Water (warningnonpotablewater)
|
||||
webgeek1234
|
||||
Weedy Weed Smoker (WeedyWeedSmoker)
|
||||
whorsemaster
|
||||
Wiimpathy
|
||||
Wiktor Strzębała (wiktorek140)
|
||||
Woohyun Shin (sinusinu)
|
||||
xenomorph-us
|
||||
xhp-creations
|
||||
Xitee (Xitee1)
|
||||
Yari (hyarsan)
|
||||
yesfish (huwpascoe)
|
||||
Yongwoon Cho (ssangkong)
|
||||
yoshisuga
|
||||
Zer0xFF
|
||||
zeromus
|
||||
zlice
|
||||
Érico Nogueira Rolim (ericonr)
|
||||
Ömercan Kömür (fpscan)
|
||||
シーはディー四を取る (cxd4)
|
||||
)";
|
||||
@@ -9,7 +9,6 @@
|
||||
- ANDROID: Enable network commands
|
||||
- ANDROID: Fix dual-motor rumble for USB-connected DS4 and DualSense controllers
|
||||
- AUDIO: ASIO driver for Windows platforms
|
||||
- AUDIO: SDL3 audio and microphone drivers
|
||||
- AUDIO/MICROPHONE: Fix resampling, apple drivers
|
||||
- APPLE: Use coreaudio3 resampling
|
||||
- APPLE: Add coreaudio3 driver to iOS/TVOS
|
||||
@@ -39,7 +38,6 @@
|
||||
- INPUT/MFI: Controller disconnection fix
|
||||
- INPUT/SDL: Fix controller vid/pid detection on Windows
|
||||
- INPUT/SDL: Add wiimote sensor capabilities
|
||||
- INPUT/SDL3: Add SDL3 input driver
|
||||
- INPUT/UDEV: Fix multi-touch detection
|
||||
- INPUT/UDEV: Gyroscope and accelerometer sensor support
|
||||
- INPUT/UDEV: Add wiimote sensor capabilities
|
||||
@@ -126,7 +124,6 @@
|
||||
- VIDEO/METAL: Add HDR10/scRGB output support
|
||||
- VIDEO/METAL: Add support for GPU index
|
||||
- VIDEO/SDL2: Add hardware-accelerated support for widgets, XMB, Ozone
|
||||
- VIDEO/SDL3: Add SDL3 video driver (software/gl/glcore/vulkan)
|
||||
- VIDEO/VULKAN: VK_EXT_full_screen_exclusive is now optional
|
||||
- VIDEO/WAYLAND: Fix fullscreen window offset/incorrect sizing
|
||||
- VIDEO/WAYLAND: Fix issue with tiny menu in case of fullscreen
|
||||
|
||||
+6
-169
@@ -71,131 +71,13 @@ Stack size
|
||||
----------
|
||||
|
||||
You have to assume that stack size is going to be limited in
|
||||
RetroArch. These are the thread stacks the tree creates today:
|
||||
RetroArch. Some game consoles (and other embedded systems)
|
||||
might have a default stack size as low as 128Kb or less.
|
||||
Be conservative with stack size but don't try to put very
|
||||
small structs on heap either [to avoid memory fragmentation
|
||||
among other things]. A balancing act here is necessary.
|
||||
|
||||
* GEKKO (Wii/GC) 8 KiB STACKSIZE, rthreads/rthreads.c
|
||||
* 3DS 32 KiB STACKSIZE, rthreads/rthreads.c
|
||||
* PSP 32 KiB STACKSIZE, rthreads/rthreads.c
|
||||
* Vita 64 KiB STACKSIZE, rthreads/rthreads.c
|
||||
* WiiU 128 KiB STACKSIZE, rthreads/rthreads.c
|
||||
* Switch 128 KiB STACKSIZE, rthreads/rthreads.c
|
||||
* PS2 32 KiB STACKSIZE, rthreads/rthreads.c
|
||||
* Vita 64 KiB rthreads.c, 0x10000
|
||||
* Apple 2 MiB rthreads.c, raised from a 512 KiB default
|
||||
* Windows 1 MiB reserved by default, committed lazily
|
||||
|
||||
8 KiB on GEKKO is the floor, and it is the number to design
|
||||
against.
|
||||
|
||||
Which thread your code runs on is not something you get to assume.
|
||||
Anything reachable from a task handler can end up on one of these:
|
||||
retro_task_regular_gather() runs handlers on the main thread, but
|
||||
with a threaded task queue the same handler runs on a worker.
|
||||
|
||||
*** THE BUDGET ***
|
||||
|
||||
- 4 KiB is the ceiling for a single stack frame anywhere in the
|
||||
tree.
|
||||
- 2 KiB is the ceiling for anything under libretro-common, and it
|
||||
is enforced. tools/stack_budget.py measures every shipped .c
|
||||
there with -fstack-usage and fails the build over it; it runs in
|
||||
CI as part of Linux-libretro-common-tests.yml. Read the header
|
||||
of that script before adding an entry to its allowlist - an
|
||||
entry there is debt, not an exemption.
|
||||
|
||||
Neither number is a per-function allowance to spend. A frame does
|
||||
not run alone, it runs on top of everything that called it. Ten
|
||||
1.5 KiB frames in a row pass every per-frame check ever written
|
||||
and still overflow an 8 KiB stack, which is why the budget sits so
|
||||
far below the smallest stack.
|
||||
|
||||
*** WHY 4 KIB ***
|
||||
|
||||
- Small-stack targets. See the table above. A 16 KiB local buffer
|
||||
is twice the whole GEKKO stack, and nothing warns about it: the
|
||||
code builds everywhere and overflows only on a target most
|
||||
contributors cannot build, at whatever moment it first runs on a
|
||||
worker. config_file_write() carried a 16 KiB stdio buffer as a
|
||||
local on a path reached from input_autoconfigure_connect_handler
|
||||
- a task handler - and nothing noticed for years.
|
||||
|
||||
- Stack probes on Windows. 4 KiB is the page size, and Windows
|
||||
commits thread stacks lazily: one guard page sits below the
|
||||
committed region, and touching it is what makes the OS commit
|
||||
another page and move the guard down. A frame that moves the
|
||||
stack pointer past the guard page without touching it faults
|
||||
outside the guard page, which the OS treats as a plain access
|
||||
violation rather than a request to grow the stack - the process
|
||||
dies. Compilers avoid that by emitting a probe: MSVC's default
|
||||
is /Gs4096 on x86, x64, ARM and ARM64, so any function needing
|
||||
more than one page of locals gets a call to __chkstk (or
|
||||
___chkstk_ms under mingw-w64, which uses the same threshold)
|
||||
that walks the frame page by page in order. So crossing 4 KiB
|
||||
turns a single subtract into an out-of-line loop at every entry
|
||||
to that function, and commits every page it touches for the life
|
||||
of the thread. GCC's -fstack-clash-protection does the same
|
||||
thing on Linux, and the kernel-side reason is the same.
|
||||
|
||||
- Recursion and reentrancy. A frame you can afford once is a frame
|
||||
you cannot afford at depth 40. Anything recursive - directory
|
||||
walks, archive nesting, parsers - should carry its state in a
|
||||
heap-allocated context and bound its depth explicitly, not lean
|
||||
on the stack to hold the recursion for it.
|
||||
|
||||
*** IN PRACTICE ***
|
||||
|
||||
- Measure rather than guess. For one file:
|
||||
|
||||
gcc -O2 -DPSP -fstack-usage -c foo.c -Ilibretro-common/include
|
||||
|
||||
and read foo.su. Or point the script at a file or a directory:
|
||||
tools/stack_budget.py libretro-common/formats/. -DPSP matters,
|
||||
because PATH_MAX_LENGTH is 512 on those targets and 2048
|
||||
elsewhere - a host-shaped measurement overstates every function
|
||||
holding a path buffer. Adding -Wstack-usage=4096 to a local
|
||||
build turns the ceiling into a warning while you work.
|
||||
|
||||
Frame size is a property of an ABI, not of the source; the same
|
||||
function measures 16 to 192 bytes larger under mingw-w64 than
|
||||
under SysV. Do not compare an absolute number against one taken
|
||||
from a different target triple.
|
||||
|
||||
- Per-frame is necessary and not sufficient. tools/stack_chain.py
|
||||
sums frames along the call graph from a set of roots (task
|
||||
handlers being the roots that matter) and reports the deepest
|
||||
chain. It is a screening tool rather than a verdict, which is
|
||||
why it is not in CI - read its header for what it cannot see.
|
||||
|
||||
- Path buffers are the usual culprit. On desktop PATH_MAX_LENGTH
|
||||
is 2048, so two of them in one frame is already over the
|
||||
ceiling. Use DIR_MAX_LENGTH (1024) and NAME_MAX_LENGTH (128)
|
||||
when that is what the buffer actually holds, and reuse one
|
||||
buffer rather than carrying a second.
|
||||
|
||||
- No VLAs and no alloca(). VLAs are not C89 (see below); alloca()
|
||||
additionally makes the frame unbounded at compile time, and
|
||||
-fstack-usage can only report such a frame as dynamic, so it
|
||||
drops out of every check above.
|
||||
|
||||
- When a frame is too large, the question is not "can this
|
||||
overflow today" but "does this need to be on the stack at all".
|
||||
The answer is usually no, and the fix is usually one of: move
|
||||
the buffer to the heap, or move it into a state object that is
|
||||
already allocated once per stream/session, or shrink it. Real
|
||||
examples, all done rather than argued about:
|
||||
|
||||
vh_build 16784 -> 400 scratch to the heap
|
||||
config_file_write 16432 -> 48 stdio buffer to heap
|
||||
chd_read_header_core_file 57504 -> 32 chd_file to the heap
|
||||
rd_gen_lengths 12768 -> 352 scratch into the struct
|
||||
sha1_calculate 4304 -> 224 mapped view, else heap
|
||||
|
||||
- None of this means small structs belong on the heap. Heap
|
||||
allocations are slow compared to the stack, and scattering tiny
|
||||
ones fragments memory - which matters most on exactly the
|
||||
platforms with the small stacks. A balancing act is necessary:
|
||||
a few hundred bytes of locals is fine and idiomatic, a kilobyte
|
||||
wants a reason, and 4 KiB is where the decision is made for you.
|
||||
Be mindful that heap allocations are slow compared to stack.
|
||||
|
||||
Functions
|
||||
---------
|
||||
@@ -229,51 +111,6 @@ VLA (Variable Length Array)
|
||||
Do not use VLAs (Variable Length Array) in C source files. These are not
|
||||
C89-compliant.
|
||||
|
||||
Main thread and task handlers
|
||||
-----------------------------
|
||||
The UI and the main thread must never block. When Threaded Tasks is
|
||||
disabled - which it is on several platforms, and which users turn off
|
||||
deliberately - task handlers run on the same thread that drives the
|
||||
frame loop, so anything a handler does between returns is a frame the
|
||||
UI cannot paint.
|
||||
|
||||
- Do not call task_queue_wait() from code reachable while the menu is
|
||||
visible or a core is running. Cancel the work and guard against a
|
||||
stale completion, or move what follows the wait into the task's own
|
||||
callback. A last-resort safety net is acceptable only where an
|
||||
invariant genuinely requires it (a worker must not call into a core
|
||||
that is about to be unloaded, for instance), and then it must be
|
||||
bounded and commented.
|
||||
|
||||
- Never pass a NULL condition to task_queue_wait(). It does not mean
|
||||
"wait for my task": both queue implementations read it as "until the
|
||||
queue is empty", so the caller ends up waiting out every unrelated
|
||||
task in flight - a content scan, a core download. Pass a condition
|
||||
that describes your own work.
|
||||
|
||||
- A handler that processes a collection must consult the shared
|
||||
per-frame I/O window (task_nbio_slice_open /
|
||||
task_nbio_slice_within_budget / task_nbio_slice_close) between
|
||||
items, and must always complete at least one item per invocation so
|
||||
an exhausted window cannot stall it. Do NOT chunk by a count derived
|
||||
from the workload - "half the entries", "a quarter of the files" -
|
||||
because that is not pacing: a bigger job simply produces bigger
|
||||
chunks and the same number of invocations.
|
||||
|
||||
- Putting work on a background thread is not a substitute for pacing
|
||||
it. The threaded queue is optional; the budget is what protects the
|
||||
frame loop in the configuration that has no worker.
|
||||
|
||||
Debug builds report handlers that overrun a frame - see
|
||||
task_queue_set_slow_handler_cb() - which is the cheapest way to find
|
||||
out whether a handler you are adding respects any of this.
|
||||
|
||||
Commit message density
|
||||
----------------------
|
||||
Keep commit message short and appropriate for the size of the change. One or two
|
||||
paragraphs appropriately sized based on the size of the change. Only explain how the
|
||||
code works moving forward, not how it worked historically. Latter rule should also apply to code comments.
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
- Brace usage follows "Allman style". The brace associated with a control statement is placed on the following line,
|
||||
|
||||
@@ -113,11 +113,7 @@ endif
|
||||
|
||||
ifneq ($(CXX_BUILD), 1)
|
||||
ifneq ($(C89_BUILD),)
|
||||
# The shader sources built into gfx/drivers/gl_shaders are longer
|
||||
# than the 509 characters C90 guarantees a compiler will take in a
|
||||
# string literal, which no declaration of ours can help: this lane
|
||||
# is here for declarations, comments and C99 syntax.
|
||||
CFLAGS += -std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long -Werror=declaration-after-statement -Wno-variadic-macros -Wno-overlength-strings
|
||||
CFLAGS += -std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long -Werror=declaration-after-statement -Wno-variadic-macros
|
||||
else ifeq ($(HAVE_C99), 1)
|
||||
CFLAGS += $(C99_CFLAGS)
|
||||
endif
|
||||
@@ -160,15 +156,6 @@ ifneq ($(SANITIZER),)
|
||||
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
||||
endif
|
||||
|
||||
# GFX_INSTRUMENT=1 counts what the image and surface paths do - uploads,
|
||||
# in-place updates, allocations, canvas copies, overlay pages - so the
|
||||
# budgets those paths are written to can be checked instead of argued.
|
||||
# Off by default: without it the counters do not exist and no call to
|
||||
# them survives the preprocessor.
|
||||
ifeq ($(GFX_INSTRUMENT), 1)
|
||||
DEFINES += -DHAVE_GFX_INSTRUMENT
|
||||
endif
|
||||
|
||||
ifneq ($(findstring $(GPERFTOOLS),profiler),)
|
||||
LIBS += -lprofiler
|
||||
endif
|
||||
@@ -252,7 +239,7 @@ $(TARGET): $(RARCH_OBJ)
|
||||
# Metal.xcodeproj build; the commandline build has to do it by hand.
|
||||
# The .metallib must sit next to the retroarch binary at runtime.
|
||||
ifeq ($(HAVE_METAL), 1)
|
||||
METAL_SHADER_SRCS := gfx/drivers/metal_shaders/Shaders.metal
|
||||
METAL_SHADER_SRCS := gfx/common/metal/Shaders.metal
|
||||
METAL_AIR_FILES := $(METAL_SHADER_SRCS:.metal=.air)
|
||||
|
||||
%.air: %.metal
|
||||
@@ -285,26 +272,12 @@ $(OBJDIR)/%.o: %.m
|
||||
# RetroArch Objective-C code is MRC-written (explicit retain/release,
|
||||
# NSAutoreleasePool, etc.) and would fail to compile under ARC — so
|
||||
# we cannot set -fobjc-arc globally. Xcode does the equivalent via
|
||||
# per-file CLANG_ENABLE_OBJC_ARC=YES build settings. ARC is a clang
|
||||
# feature; GCC (a PowerPC cross build, Xcode 3) has no such switch and
|
||||
# builds these files under MRC through the RARCH_* ownership macros.
|
||||
#
|
||||
# metal.m compiles correctly under BOTH ARC and MRC (its ownership
|
||||
# transfers go through the RARCH_* ownership layer in libretro-common's
|
||||
# defines/cocoa_defines.h, keyed on __has_feature(objc_arc)); it has to,
|
||||
# because the griffin_objc.m unity TU inherits whatever mode the
|
||||
# enclosing Xcode configuration uses. ARC is kept for the standalone
|
||||
# object as the preferred mode: it elides the autorelease-pool traffic
|
||||
# the MRC expansion pays on the per-frame paths.
|
||||
# --version rather than -v: the latter prints the configure line, and a
|
||||
# GCC configured with CC=clang would be taken for clang.
|
||||
ifeq ($(shell $(CC) --version 2>&1 | head -n 1 | grep -c "clang"),1)
|
||||
OBJC_ARC_FLAGS := -fobjc-arc
|
||||
endif
|
||||
$(OBJDIR)/gfx/drivers/metal.o: OBJCFLAGS += $(OBJC_ARC_FLAGS)
|
||||
$(OBJDIR)/input/drivers_joypad/mfi_joypad.o: OBJCFLAGS += $(OBJC_ARC_FLAGS)
|
||||
$(OBJDIR)/input/drivers/cocoa_input.o: OBJCFLAGS += $(OBJC_ARC_FLAGS)
|
||||
$(OBJDIR)/location/drivers/corelocation.o: OBJCFLAGS += $(OBJC_ARC_FLAGS)
|
||||
# per-file CLANG_ENABLE_OBJC_ARC=YES build settings.
|
||||
$(OBJDIR)/gfx/drivers/metal.o: OBJCFLAGS += -fobjc-arc
|
||||
$(OBJDIR)/input/drivers_joypad/mfi_joypad.o: OBJCFLAGS += -fobjc-arc
|
||||
$(OBJDIR)/audio/drivers/coreaudio3.o: OBJCFLAGS += -fobjc-arc
|
||||
$(OBJDIR)/input/drivers/cocoa_input.o: OBJCFLAGS += -fobjc-arc
|
||||
$(OBJDIR)/location/drivers/corelocation.o: OBJCFLAGS += -fobjc-arc
|
||||
|
||||
$(OBJDIR)/%.o: %.S config.h config.mk $(HEADERS)
|
||||
@mkdir -p $(dir $@)
|
||||
@@ -380,7 +353,7 @@ clean:
|
||||
$(Q)rm -rf $(OBJDIR_BASE)
|
||||
$(Q)rm -f $(TARGET)
|
||||
$(Q)rm -f *.d
|
||||
$(Q)rm -f default.metallib gfx/drivers/metal_shaders/*.air
|
||||
$(Q)rm -f default.metallib gfx/common/metal/*.air
|
||||
$(Q)rm -rf $(BUNDLE)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
+124
-207
@@ -129,9 +129,7 @@ endif
|
||||
|
||||
ifneq ($(findstring Darwin,$(OS)),)
|
||||
OSX := 1
|
||||
# IOKit for the power-source query in platform_darwin.m, which every
|
||||
# macOS build makes; the HID driver adds nothing beyond it.
|
||||
LIBS += -framework AppKit -framework IOKit
|
||||
LIBS += -framework AppKit
|
||||
ARCHFLAGS=
|
||||
MINVERFLAGS=
|
||||
ifeq ($(shell uname -p),arm)
|
||||
@@ -161,8 +159,7 @@ ifneq ($(findstring Darwin,$(OS)),)
|
||||
MINVERFLAGS = -mmacosx-version-min=10.6
|
||||
ARCHFLAGS = -arch x86
|
||||
else ifeq ($(ARCH),ppc)
|
||||
# 10.5 unless the invoker targets older (10.4 is the floor).
|
||||
MINVERFLAGS = -mmacosx-version-min=$(or $(MACOSX_DEPLOYMENT_TARGET),10.5)
|
||||
MINVERFLAGS = -mmacosx-version-min=10.5
|
||||
ARCHFLAGS = -arch ppc
|
||||
endif
|
||||
ifeq ($(BUILDBOT),1)
|
||||
@@ -268,7 +265,6 @@ OBJ += \
|
||||
tasks/task_save.o \
|
||||
tasks/task_movie.o \
|
||||
tasks/task_file_transfer.o \
|
||||
tasks/task_nbio_slice.o \
|
||||
tasks/task_content_prefetch.o \
|
||||
tasks/task_image.o \
|
||||
tasks/task_playlist_manager.o \
|
||||
@@ -287,15 +283,13 @@ OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/lists/file_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/lists/dir_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/retro_dirent.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/file_watch.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/stdin_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/file_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/interface_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/memory_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/network_stream.o \
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.o \
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_hybrid.o
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.o
|
||||
|
||||
ifeq ($(ANDROID), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_saf.o
|
||||
@@ -303,7 +297,6 @@ endif
|
||||
|
||||
OBJ += \
|
||||
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
|
||||
$(LIBRETRO_COMM_DIR)/string/rstrtod.o \
|
||||
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
|
||||
$(LIBRETRO_COMM_DIR)/memmap/memalign.o \
|
||||
$(LIBRETRO_COMM_DIR)/memmap/memcpy_nt.o
|
||||
@@ -319,21 +312,13 @@ OBJ += \
|
||||
file_path_special.o \
|
||||
$(LIBRETRO_COMM_DIR)/hash/lrc_hash.o \
|
||||
audio/audio_driver.o \
|
||||
audio/audio_upmix.o \
|
||||
audio/audio_stretch.o \
|
||||
audio/audio_speed_lpf.o \
|
||||
audio/audio_pipeline_stretch.o \
|
||||
audio/audio_binaural.o \
|
||||
input/input_driver.o \
|
||||
input/common/input_hid_common.o \
|
||||
led/led_driver.o \
|
||||
gfx/video_driver.o \
|
||||
gfx/gfx_display.o \
|
||||
gfx/gfx_animation.o \
|
||||
gfx/gfx_instrument.o \
|
||||
gfx/gfx_surface.o \
|
||||
gfx/gfx_thumbnail.o \
|
||||
gfx/gfx_anim_preview.o \
|
||||
configuration.o \
|
||||
$(LIBRETRO_COMM_DIR)/dynamic/dylib.o \
|
||||
cores/dynamic_dummy.o \
|
||||
@@ -420,7 +405,6 @@ OBJ += \
|
||||
playlist.o \
|
||||
$(LIBRETRO_COMM_DIR)/features/features_cpu.o \
|
||||
$(LIBRETRO_COMM_DIR)/memory/mem_stats.o \
|
||||
$(LIBRETRO_COMM_DIR)/memory/mempool.o \
|
||||
verbosity.o \
|
||||
$(LIBRETRO_COMM_DIR)/playlists/label_sanitization.o \
|
||||
$(LIBRETRO_COMM_DIR)/time/rtime.o \
|
||||
@@ -449,14 +433,6 @@ ifeq ($(HAVE_BSV_MOVIE), 1)
|
||||
OBJ += input/bsv/bsvmovie.o
|
||||
endif
|
||||
|
||||
# The MessagePack encoder is shared: the database stores its records
|
||||
# with it and the BSV movie format writes its frames with it, so it is
|
||||
# linked when either is built rather than only with the database.
|
||||
ifneq ($(filter 1,$(HAVE_LIBRETRODB) $(HAVE_BSV_MOVIE)),)
|
||||
OBJ += libretro-db/rmsgpack.o \
|
||||
libretro-db/rmsgpack_dom.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STATESTREAM), 1)
|
||||
DEFINES += -DHAVE_STATESTREAM
|
||||
OBJ += input/bsv/uint32s_index.o
|
||||
@@ -568,6 +544,8 @@ ifeq ($(HAVE_LIBRETRODB), 1)
|
||||
OBJ += libretro-db/bintree.o \
|
||||
libretro-db/libretrodb.o \
|
||||
libretro-db/query.o \
|
||||
libretro-db/rmsgpack.o \
|
||||
libretro-db/rmsgpack_dom.o \
|
||||
database_info.o \
|
||||
tasks/task_database_cue.o
|
||||
|
||||
@@ -734,7 +712,6 @@ else ifeq ($(HAVE_BUILTINMBEDTLS), 1)
|
||||
deps/mbedtls/ripemd160.o \
|
||||
deps/mbedtls/rsa.o \
|
||||
deps/mbedtls/sha1.o \
|
||||
deps/mbedtls/sha_alt.o \
|
||||
deps/mbedtls/sha256.o \
|
||||
deps/mbedtls/sha512.o \
|
||||
deps/mbedtls/threading.o \
|
||||
@@ -817,8 +794,23 @@ endif
|
||||
ifeq ($(HAVE_COREAUDIO), 1)
|
||||
DEFINES += -DHAVE_COREAUDIO
|
||||
OBJ += audio/drivers/coreaudio.o
|
||||
ifeq ($(HAVE_MICROPHONE), 1)
|
||||
OBJ += audio/drivers/coreaudio_mic_macos.o
|
||||
# AVFoundation is 10.7+ and only needed by the microphone driver.
|
||||
# The base coreaudio.c path doesn't use it, so keep it out of the
|
||||
# link line on targets without microphone support (e.g. pre-10.7
|
||||
# / Tiger / Leopard / PowerPC).
|
||||
LIBS += -framework AVFoundation
|
||||
endif
|
||||
HAVE_COREAUDIO_LIBS = 1
|
||||
LIBS += -framework AudioToolbox
|
||||
LIBS += -framework AudioToolbox -framework Accelerate
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COREAUDIO3), 1)
|
||||
DEFINES += -DHAVE_COREAUDIO3
|
||||
OBJ += audio/drivers/coreaudio3.o
|
||||
HAVE_COREAUDIO_LIBS = 1
|
||||
LIBS += -framework AudioToolbox -framework AVFoundation
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COREAUDIO_LIBS), 1)
|
||||
@@ -848,15 +840,14 @@ endif
|
||||
ifeq ($(TARGET), retroarch_3ds)
|
||||
OBJ += audio/drivers/ctr_csnd_audio.o \
|
||||
audio/drivers/ctr_dsp_audio.o
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
OBJ += audio/drivers/ctr_dsp_thread_audio.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ALSA), 1)
|
||||
OBJ += audio/common/alsa.o
|
||||
# audio/drivers/alsa.c carries both drivers; see HAVE_TINYALSA below
|
||||
# for the case where it is built without alsa-lib.
|
||||
ifneq ($(HAVE_TINYALSA), 1)
|
||||
OBJ += audio/drivers/alsa.o
|
||||
endif
|
||||
OBJ += audio/drivers/alsa.o \
|
||||
audio/common/alsa.o
|
||||
|
||||
ifneq ($(HAVE_HAKCHI), 1)
|
||||
ifneq ($(HAVE_SEGAM), 1)
|
||||
@@ -872,10 +863,7 @@ ifeq ($(HAVE_ALSA), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_TINYALSA), 1)
|
||||
# The embedded driver lives in audio/drivers/alsa.c beside the
|
||||
# alsa-lib one, each behind its own define; one object either way,
|
||||
# and a build with only this one needs no alsa-lib.
|
||||
OBJ += audio/drivers/alsa.o
|
||||
OBJ += audio/drivers/tinyalsa.o
|
||||
DEFINES += -DHAVE_TINYALSA
|
||||
endif
|
||||
|
||||
@@ -957,14 +945,6 @@ ifeq ($(HAVE_XAUDIO), 1)
|
||||
LIBS += -lole32
|
||||
endif
|
||||
|
||||
# WDM-KS: kernel streaming. setupapi and ksuser are resolved at
|
||||
# runtime rather than linked, so that a binary carrying this driver
|
||||
# still loads on a Windows that has neither.
|
||||
ifeq ($(HAVE_WDMKS), 1)
|
||||
OBJ += audio/drivers/wdmks.o
|
||||
DEFINES += -DHAVE_WDMKS
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_MMDEVAPI), 1)
|
||||
OBJ += audio/common/mmdevice_common.o
|
||||
endif
|
||||
@@ -1000,30 +980,6 @@ OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/mono_to_stereo_float.o \
|
||||
$(LIBRETRO_COMM_DIR)/audio/conversion/stereo_to_mono_float.o \
|
||||
|
||||
# AC-3: the frame layer, decoder and encoder from ATSC A/52 and the
|
||||
# IEC 61937 burst framing, no dependencies. The decoder is an arm of
|
||||
# audio_transfer (an .ac3 file in the mixer); the encoder and the
|
||||
# framing carry a wider layout to a device that decodes Dolby Digital
|
||||
# but takes stereo PCM only (WASAPI exclusive mode, and WDM-KS).
|
||||
DEFINES += -DHAVE_RAC3
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/ac3/rac3_frame.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/ac3/rac3_decode.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/ac3/rac3_encode.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/iec61937/iec61937.o
|
||||
|
||||
# Linear PCM, and the DTS frame layer. Neither has a dependency and
|
||||
# both are small, so they are in wherever rac3 is: LPCM is what a disc
|
||||
# carries when nothing was compressed, and rdts is what carries a DTS
|
||||
# stream to a decoder that is not this one - the bursts iec61937
|
||||
# already frames.
|
||||
DEFINES += -DHAVE_RLPCM -DHAVE_RDTS
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/lpcm/rlpcm.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/dts/rdts.o
|
||||
|
||||
# The bitstream source: where a stream that arrived already coded
|
||||
# plugs into the output path, which the PCM pipeline has no place for.
|
||||
OBJ += audio/audio_bitstream.o
|
||||
|
||||
ifeq ($(HAVE_RWAV), 1)
|
||||
DEFINES += -DHAVE_RWAV
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/wav/rwav.o
|
||||
@@ -1158,7 +1114,6 @@ endif
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/menu_setting.o \
|
||||
menu/menu_driver.o \
|
||||
menu/menu_str.o \
|
||||
menu/cbs/menu_cbs_ok.o \
|
||||
menu/cbs/menu_cbs_cancel.o \
|
||||
menu/cbs/menu_cbs_select.o \
|
||||
@@ -1173,7 +1128,6 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/cbs/menu_cbs_sublabel.o \
|
||||
menu/cbs/menu_cbs_title.o \
|
||||
menu/menu_displaylist.o \
|
||||
menu/menu_dirwalk.o \
|
||||
menu/menu_contentless_cores.o
|
||||
endif
|
||||
|
||||
@@ -1216,13 +1170,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/rthreads/rthreads.o \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/tpool.o \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/retro_eventcount.o \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/retro_procbarrier.o \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/retro_asym_eventcount.o \
|
||||
$(LIBRETRO_COMM_DIR)/queues/retro_waitable_spsc.o \
|
||||
gfx/video_thread_wrapper.o \
|
||||
gfx/video_thread_hw.o \
|
||||
audio/audio_thread_wrapper.o
|
||||
DEFINES += -DHAVE_THREADS
|
||||
ifeq ($(findstring Haiku,$(OS)),)
|
||||
@@ -1295,12 +1243,14 @@ endif
|
||||
ifeq ($(TARGET), retroarch_switch)
|
||||
ifeq ($(HAVE_LIBNX), 1)
|
||||
OBJ += gfx/drivers/switch_nx_gfx.o \
|
||||
audio/drivers/switch_libnx_audren_audio.o
|
||||
audio/drivers/switch_libnx_audren_audio.o \
|
||||
audio/drivers/switch_libnx_audren_thread_audio.o
|
||||
ifeq ($(HAVE_OPENGL), 1)
|
||||
OBJ += gfx/drivers_context/switch_ctx.o
|
||||
endif
|
||||
endif
|
||||
OBJ += audio/drivers/switch_audio.o \
|
||||
audio/drivers/switch_thread_audio.o \
|
||||
input/drivers/switch_input.o \
|
||||
input/drivers_joypad/switch_joypad.o \
|
||||
frontend/drivers/platform_switch.o
|
||||
@@ -1513,21 +1463,8 @@ endif
|
||||
|
||||
# Companion UI
|
||||
|
||||
# Shared companion core (ui/companion/) is needed by every desktop
|
||||
# companion driver: Qt, native Win32, native Cocoa. Added once.
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += ui/drivers/ui_win32.o \
|
||||
ui/drivers/ui_win32_companion.o
|
||||
# comctl32: InitCommonControls / list-view / status bar used by the
|
||||
# native Win32 companion (MSVC builds pull it in via #pragma comment).
|
||||
LIBS += -lcomctl32 -lshell32 -lole32
|
||||
HAVE_COMPANION_CORE = 1
|
||||
endif
|
||||
ifeq ($(HAVE_QT), 1)
|
||||
HAVE_COMPANION_CORE = 1
|
||||
endif
|
||||
ifeq ($(HAVE_COMPANION_CORE), 1)
|
||||
OBJ += ui/companion/companion_core.o ui/companion/companion_thumbs.o ui/companion/companion_dock.o
|
||||
OBJ += ui/drivers/ui_win32.o
|
||||
endif
|
||||
|
||||
# Video
|
||||
@@ -1691,11 +1628,9 @@ endif
|
||||
ifeq ($(HAVE_METAL), 1)
|
||||
DEFINES += -DHAVE_METAL
|
||||
LIBS += -framework Metal -framework MetalKit -framework QuartzCore
|
||||
# metal.m builds under both ARC and MRC (see the M_OBJC_* ownership
|
||||
# macros at the top of the file). The top-level Makefile still builds
|
||||
# it with a per-file -fobjc-arc override — ARC is the preferred mode
|
||||
# for the standalone object — but the griffin_objc.m unity TU may
|
||||
# compile it either way depending on the Xcode configuration.
|
||||
# Metal code (metal.m) relies on ARC. Enabled per-file via an override
|
||||
# in the top-level Makefile, since applying -fobjc-arc globally would
|
||||
# break the MRC-written Cocoa code (ui_cocoa.m et al.).
|
||||
OBJ += gfx/drivers/metal.o
|
||||
endif
|
||||
|
||||
@@ -1723,10 +1658,6 @@ endif
|
||||
ifeq ($(HAVE_SDL3), 1)
|
||||
SDL3_CFLAGS = $(shell pkg-config sdl3 --cflags)
|
||||
SDL3_LIBS = $(shell pkg-config sdl3 --libs)
|
||||
ifeq ($(strip $(SDL3_LIBS)),)
|
||||
$(warning SDL3_LIBS is not set, falling back to -lSDL3)
|
||||
SDL3_LIBS = -lSDL3
|
||||
endif
|
||||
DEF_FLAGS += $(SDL3_CFLAGS)
|
||||
# RetroArch supplies its own entry point and sets SDL_MAIN_HANDLED
|
||||
# (see retroarch.c), so SDL's WinMain shim library (-lSDL3main /
|
||||
@@ -1739,9 +1670,7 @@ endif
|
||||
OBJ += input/drivers_joypad/sdl3_joypad.o \
|
||||
input/drivers/sdl3_input.o \
|
||||
gfx/drivers/sdl3_gfx.o \
|
||||
gfx/common/sdl3_common.o \
|
||||
gfx/display_servers/dispserv_sdl3.o \
|
||||
audio/drivers/sdl3_audio.o
|
||||
gfx/common/sdl3_common.o
|
||||
|
||||
ifneq ($(filter 1,$(HAVE_OPENGL) $(HAVE_OPENGL1) $(HAVE_OPENGL_CORE) $(HAVE_OPENGLES)),)
|
||||
OBJ += gfx/drivers_context/sdl3_gl_ctx.o
|
||||
@@ -1753,8 +1682,7 @@ endif
|
||||
else ifeq ($(HAVE_SDL2), 1)
|
||||
HAVE_SDL_COMMON = 1
|
||||
OBJ += gfx/drivers/sdl2_gfx.o \
|
||||
gfx/common/sdl2_common.o \
|
||||
gfx/display_servers/dispserv_sdl2.o
|
||||
gfx/common/sdl2_common.o
|
||||
DEF_FLAGS += $(SDL2_CFLAGS)
|
||||
# See the SDL3 note above: drop SDL's WinMain shim lib, we set
|
||||
# SDL_MAIN_HANDLED and provide our own entry point.
|
||||
@@ -1830,12 +1758,9 @@ ifeq ($(HAVE_VULKAN), 1)
|
||||
# into Contents/Frameworks) produces a self-contained bundle with no
|
||||
# external MoltenVK dependency. Matches what Xcode's
|
||||
# LD_RUNPATH_SEARCH_PATHS does for the .xcodeproj build.
|
||||
# The Vulkan render view is a CAMetalLayer on a Metal device, so the
|
||||
# Metal frameworks are linked whether or not the Metal driver is.
|
||||
ifneq ($(findstring Darwin,$(OS)),)
|
||||
LDFLAGS += -Xlinker -rpath -Xlinker @executable_path/../Frameworks \
|
||||
-Xlinker -rpath -Xlinker @executable_path/../Frameworks/MoltenVK.framework
|
||||
LIBS += -framework Metal -framework QuartzCore
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -1846,7 +1771,6 @@ ifeq ($(HAVE_OPENGL_CORE), 1)
|
||||
|
||||
ifeq ($(HAVE_SLANG), 1)
|
||||
OBJ += gfx/drivers_shader/shader_gl3.o
|
||||
OBJ += gfx/drivers_shader/spirv_opengl.o
|
||||
|
||||
NEED_CXX_LINKER = 1
|
||||
endif
|
||||
@@ -1909,8 +1833,7 @@ endif
|
||||
|
||||
ifeq ($(HAVE_D3D11), 1)
|
||||
HAVE_D3D_COMMON = 1
|
||||
OBJ += gfx/drivers/d3d11.o \
|
||||
gfx/common/d3d11_deferred_proxy.o
|
||||
OBJ += gfx/drivers/d3d11.o
|
||||
DEFINES += -DHAVE_D3D11
|
||||
endif
|
||||
|
||||
@@ -1918,6 +1841,7 @@ ifeq ($(HAVE_D3D12), 1)
|
||||
HAVE_D3D_COMMON = 1
|
||||
OBJ += gfx/drivers/d3d12.o
|
||||
DEFINES += -DHAVE_D3D12
|
||||
DEFINES += -DHAVE_D3DKMT
|
||||
endif
|
||||
|
||||
ifneq ($(findstring 1, $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),)
|
||||
@@ -2047,17 +1971,7 @@ ifneq ($(HAVE_BUILTINSPIRV_CROSS), 0)
|
||||
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_msl.o
|
||||
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_parser.o
|
||||
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_cross_parsed_ir.o
|
||||
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_cross_c.o
|
||||
# The C API translation unit compiles its backend wrappers only
|
||||
# when these are defined truthy.
|
||||
DEFINES += -DSPIRV_CROSS_C_API_GLSL=1
|
||||
DEFINES += -DSPIRV_CROSS_C_API_HLSL=1
|
||||
DEFINES += -DSPIRV_CROSS_C_API_MSL=1
|
||||
DEFINES += -DSPIRV_CROSS_C_API_CPP=0
|
||||
DEFINES += -DSPIRV_CROSS_C_API_REFLECT=0
|
||||
else
|
||||
# slang_process.c is C: the header path must reach the C compiler too.
|
||||
CFLAGS += $(SPIRV_CROSS_CFLAGS)
|
||||
CXXFLAGS += $(SPIRV_CROSS_CFLAGS)
|
||||
LIBS += $(SPIRV_CROSS_LIBS)
|
||||
endif
|
||||
@@ -2095,17 +2009,45 @@ ifeq ($(HAVE_7ZIP),1)
|
||||
$(7ZOBJ)
|
||||
endif
|
||||
|
||||
# The built-in Zstandard codec: one C file, no dependency.
|
||||
# The built-in Zstandard codec. Independent of HAVE_ZSTD: a build may
|
||||
# have either, both while platforms are moving over, or eventually only
|
||||
# this one, at which point HAVE_ZSTD and deps/zstd can go.
|
||||
ifeq ($(HAVE_RZSTD),1)
|
||||
DEFINES += -DHAVE_RZSTD
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/encodings/encoding_rzstd.o \
|
||||
$(LIBRETRO_COMM_DIR)/streams/trans_stream_rzstd.o
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/encodings/encoding_rzstd.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ZSTD),1)
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/zstd/lib
|
||||
DEFINES += -DHAVE_ZSTD -DZSTD_DISABLE_ASM
|
||||
ZSOBJ = $(DEPS_DIR)/zstd/lib/common/entropy_common.o \
|
||||
$(DEPS_DIR)/zstd/lib/common/error_private.o \
|
||||
$(DEPS_DIR)/zstd/lib/common/fse_decompress.o \
|
||||
$(DEPS_DIR)/zstd/lib/common/zstd_common.o \
|
||||
$(DEPS_DIR)/zstd/lib/common/xxhash.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/fse_compress.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/hist.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/huf_compress.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_compress.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_compress_literals.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_compress_sequences.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_compress_superblock.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_double_fast.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_fast.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_lazy.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_ldm.o \
|
||||
$(DEPS_DIR)/zstd/lib/compress/zstd_opt.o \
|
||||
$(DEPS_DIR)/zstd/lib/decompress/huf_decompress.o \
|
||||
$(DEPS_DIR)/zstd/lib/decompress/zstd_ddict.o \
|
||||
$(DEPS_DIR)/zstd/lib/decompress/zstd_decompress.o \
|
||||
$(DEPS_DIR)/zstd/lib/decompress/zstd_decompress_block.o
|
||||
|
||||
OBJ += $(ZSOBJ)
|
||||
endif
|
||||
|
||||
# The archive backend needs one decoder, not a particular one. Testing
|
||||
# the two concatenated would be wrong: "00" is not empty.
|
||||
ifeq ($(HAVE_RZSTD),1)
|
||||
ifneq ($(filter 1,$(HAVE_ZSTD) $(HAVE_RZSTD)),)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file_zstd.o
|
||||
endif
|
||||
|
||||
@@ -2295,10 +2237,7 @@ else
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/7z/r7z_lzma.o
|
||||
endif
|
||||
|
||||
# The CHD Zstandard codec decodes through whichever backend is
|
||||
# configured, rzstd first. Same shape as the FLAC test above: either
|
||||
# one gives libchdr a decoder, so build the wrapper for both.
|
||||
ifeq ($(HAVE_RZSTD),1)
|
||||
ifeq ($(HAVE_ZSTD), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_zstd.o
|
||||
endif
|
||||
endif
|
||||
@@ -2330,8 +2269,7 @@ ifeq ($(HAVE_RPNG), 1)
|
||||
DEFINES += -DHAVE_RPNG
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/png/rpng.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/png/rpng_apng.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/png/rpng_encode.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/rpng_file.o
|
||||
$(LIBRETRO_COMM_DIR)/formats/png/rpng_encode.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RJPEG), 1)
|
||||
@@ -2355,9 +2293,6 @@ ifeq ($(HAVE_RWEBM), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/webm/rwebm.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/webm/rwebm_video.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/webm/rwebm_audio.o
|
||||
# The row-band splitter the video blits run through; the mp4 block
|
||||
# adds it when building without webm.
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/image/image_blit_bands.o
|
||||
ifneq ($(HAVE_RWEBP), 1)
|
||||
# rwebm_video decodes VP8 tracks with rvp8, normally built with RWEBP
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/vp8/rvp8.o
|
||||
@@ -2376,9 +2311,6 @@ ifneq ($(HAVE_RVP9), 1)
|
||||
# I420->RGB blits; normally linked from the HAVE_RVP9 block below.
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/image/image_hdr_blit.o
|
||||
endif
|
||||
ifneq ($(HAVE_RWEBM), 1)
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/image/image_blit_bands.o
|
||||
endif
|
||||
ifneq ($(HAVE_RWEBP), 1)
|
||||
ifneq ($(HAVE_RWEBM), 1)
|
||||
# rmp4_video decodes VP8 tracks with rvp8, normally built with RWEBP
|
||||
@@ -2409,13 +2341,12 @@ ifeq ($(HAVE_WEBMPLAYER), 1)
|
||||
endif
|
||||
|
||||
OBJ += $(LIBRETRO_COMM_DIR)/formats/bmp/rbmp_encode.o \
|
||||
$(LIBRETRO_COMM_DIR)/file/rbmp_file.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/json/rjson.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/image_transfer.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/audio_transfer.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/data_transfer.o \
|
||||
$(LIBRETRO_COMM_DIR)/memmap/memmap.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/m3u/rm3u.o
|
||||
$(LIBRETRO_COMM_DIR)/formats/m3u/m3u_file.o
|
||||
|
||||
# Video4Linux 2
|
||||
|
||||
@@ -2432,7 +2363,9 @@ endif
|
||||
# AVFoundation camera + recording (Apple, macOS 10.7+ / iOS). The
|
||||
# 10.7 gate is enforced in qb/config.libs.sh (see the HAVE_AVF block
|
||||
# there); this section just wires the object files and frameworks in
|
||||
# when HAVE_AVF is on.
|
||||
# when HAVE_AVF is on. Note that HAVE_MICROPHONE and HAVE_COREAUDIO3
|
||||
# above also add -framework AVFoundation for their own reasons; make
|
||||
# tolerates the repeat and the linker de-duplicates.
|
||||
ifeq ($(HAVE_AVF), 1)
|
||||
DEFINES += -DHAVE_AVF
|
||||
OBJ += camera/drivers/avfoundation.o \
|
||||
@@ -2594,17 +2527,18 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
DEFINES += -DHAVE_CHEEVOS -DRC_CLIENT_SUPPORTS_HASH
|
||||
INCLUDE_DIRS += -Ideps/rcheevos/include
|
||||
|
||||
# rc_compat carries native recursive mutexes for the consoles
|
||||
# that build threaded (GEKKO, 3DS, WiiU, Vita), so only a
|
||||
# thread-less build compiles the locks out.
|
||||
ifneq ($(HAVE_THREADS), 1)
|
||||
DEFINES += -DRC_NO_THREADS
|
||||
else ifneq (,$(filter GEKKO,$(CFLAGS)))
|
||||
# Gekko (Wii) and 3DS use custom pthread wrappers (see rthreads.c)
|
||||
DEFINES += -DRC_NO_THREADS
|
||||
else ifneq (,$(filter _3DS,$(CFLAGS)))
|
||||
DEFINES += -DRC_NO_THREADS
|
||||
endif
|
||||
|
||||
OBJ += cheevos/cheevos.o \
|
||||
cheevos/cheevos_client.o \
|
||||
cheevos/cheevos_menu.o \
|
||||
cheevos/cheevos_badge.o \
|
||||
$(LIBRETRO_COMM_DIR)/formats/cdfs/cdfs.o \
|
||||
deps/rcheevos/src/rc_client.o \
|
||||
deps/rcheevos/src/rc_compat.o \
|
||||
@@ -2636,7 +2570,7 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
deps/rcheevos/src/rapi/rc_api_user.o \
|
||||
|
||||
# RVZ/WIA disc image support for RetroAchievements
|
||||
HAVE_CHEEVOS_RVZ ?= $(if $(filter 1,$(HAVE_RZSTD)),1,0)
|
||||
HAVE_CHEEVOS_RVZ ?= $(if $(filter 1,$(HAVE_ZSTD) $(HAVE_RZSTD)),1,0)
|
||||
ifeq ($(HAVE_CHEEVOS_RVZ), 1)
|
||||
DEFINES += -DHAVE_CHEEVOS_RVZ
|
||||
OBJ += cheevos/cheevos_rvz.o
|
||||
@@ -2712,19 +2646,6 @@ ifneq ($(findstring Win32,$(OS)),)
|
||||
gfx/display_servers/dispserv_win32.o \
|
||||
gfx/common/dx_guids.o
|
||||
|
||||
# Scanline Sync. Despite the name, D3DKMT is the kernel-mode thunk
|
||||
# into dxgkrnl.sys rather than Direct3D: gdi32 forwards
|
||||
# D3DKMTGetScanLine to ext-ms-win-dx-d3dkmt-dxcore, the adapter is
|
||||
# opened from a plain GDI HDC via EnumDisplayDevices()/CreateDC(),
|
||||
# and d3dkmt_init() runs from win32_window_init(), which every win32
|
||||
# video driver calls - w_vk_ctx, wgl_ctx, gdi and sdl2 as much as
|
||||
# the d3d ones. It lives in win32_common.c, so gate it the same way
|
||||
# that object is gated. It used to be defined only as a side effect
|
||||
# of HAVE_D3D12, which silently dropped the feature from a
|
||||
# Vulkan-or-GL-only Windows build.
|
||||
DEFINES += -DHAVE_D3DKMT
|
||||
INCLUDE_DIRS += -isystemgfx/include/dxsdk
|
||||
|
||||
# Legacy pre-DXGI GUID storage in their own TUs to avoid clashes
|
||||
# between system <d3d8types.h> / <d3d9types.h> and the bundled
|
||||
# <dxsdk/dxgitype.h>. See dx_guids.c header comment.
|
||||
@@ -2751,7 +2672,8 @@ endif
|
||||
|
||||
ifeq ($(HAVE_FFMPEG), 1)
|
||||
OBJ += record/drivers/record_ffmpeg.o \
|
||||
cores/libretro-ffmpeg/ffmpeg_core.o
|
||||
cores/libretro-ffmpeg/ffmpeg_core.o \
|
||||
$(LIBRETRO_COMM_DIR)/rthreads/tpool.o
|
||||
|
||||
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS) $(AVDEVICE_LIBS)
|
||||
DEFINES += -DHAVE_FFMPEG
|
||||
@@ -2760,24 +2682,37 @@ ifeq ($(HAVE_FFMPEG), 1)
|
||||
INCLUDE_DIRS += -Iffmpeg
|
||||
endif
|
||||
|
||||
# Video modeline engine (CRT mode switching is its first consumer)
|
||||
# CRT mode switching
|
||||
ifeq ($(HAVE_CRTSWITCHRES), 1)
|
||||
HAVE_MODELINE = 1
|
||||
endif
|
||||
ifeq ($(HAVE_MODELINE), 1)
|
||||
DEFINES += -DHAVE_MODELINE
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/switchres
|
||||
OBJ += gfx/video_crt_switch.o \
|
||||
gfx/modeline/modeline_core.o \
|
||||
gfx/modeline/modeline_monitor.o \
|
||||
gfx/modeline/modeline_list.o \
|
||||
gfx/modeline/modeline_ini.o \
|
||||
gfx/modeline/modeline_edid.o
|
||||
$(DEPS_DIR)/switchres/monitor.o \
|
||||
$(DEPS_DIR)/switchres/modeline.o \
|
||||
$(DEPS_DIR)/switchres/switchres.o \
|
||||
$(DEPS_DIR)/switchres/display.o \
|
||||
$(DEPS_DIR)/switchres/custom_video.o \
|
||||
$(DEPS_DIR)/switchres/log.o \
|
||||
$(DEPS_DIR)/switchres/switchres_wrapper.o \
|
||||
$(DEPS_DIR)/switchres/edid.o
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
OBJ += gfx/display_servers/win32_modeline_resync.o \
|
||||
gfx/display_servers/win32_modeline_adl.o \
|
||||
gfx/display_servers/win32_modeline_ati.o \
|
||||
gfx/display_servers/win32_modeline_pstrip.o
|
||||
OBJ += $(DEPS_DIR)/switchres/display_windows.o \
|
||||
$(DEPS_DIR)/switchres/custom_video_ati_family.o \
|
||||
$(DEPS_DIR)/switchres/custom_video_ati.o \
|
||||
$(DEPS_DIR)/switchres/custom_video_adl.o \
|
||||
$(DEPS_DIR)/switchres/custom_video_pstrip.o \
|
||||
$(DEPS_DIR)/switchres/resync_windows.o
|
||||
endif
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
OBJ += $(DEPS_DIR)/switchres/display_linux.o
|
||||
ifeq ($(HAVE_X11)$(HAVE_XRANDR), 11)
|
||||
OBJ += $(DEPS_DIR)/switchres/custom_video_xrandr.o
|
||||
DEFINES += -DSR_WITH_XRANDR
|
||||
endif
|
||||
endif
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
DEFINES += -DSR_WIN32_STATIC
|
||||
endif
|
||||
LIBS += -lstdc++
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COMPRESSION), 1)
|
||||
@@ -2786,17 +2721,18 @@ ifeq ($(HAVE_COMPRESSION), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COCOA), 1)
|
||||
DEFINES += -DHAVE_MAIN -DTARGET_OS_OSX=1 -DHAVE_COCOA
|
||||
HAVE_COCOA_COMMON = 1
|
||||
endif
|
||||
ifeq ($(HAVE_COCOA_METAL), 1)
|
||||
HAVE_COCOA_COMMON = 1
|
||||
DEFINES += -DHAVE_COCOA_METAL
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_COCOA_COMMON),1)
|
||||
DEFINES += -DHAVE_MAIN -DOSX -DHAVE_COCOA
|
||||
OBJ += input/drivers/cocoa_input.o \
|
||||
ui/drivers/ui_cocoa.o \
|
||||
ui/drivers/ui_cocoa_companion.o \
|
||||
ui/drivers/cocoa/cocoa_common.o
|
||||
# HAVE_COCOA_COMMON is only known here, after the companion-core
|
||||
# block above ran; add the shared core if Qt/Win32 did not already.
|
||||
ifneq ($(HAVE_COMPANION_CORE), 1)
|
||||
OBJ += ui/companion/companion_core.o ui/companion/companion_thumbs.o ui/companion/companion_dock.o
|
||||
HAVE_COMPANION_CORE = 1
|
||||
endif
|
||||
# RetroArchPlaylistManager uses Obj-C lightweight generics and
|
||||
# nullability macros (Xcode 7+, 2015). It's fine on iOS/tvOS and
|
||||
# modern macOS (10.11+), but GCC 4.0 / old clang on pre-10.11
|
||||
@@ -2883,21 +2819,17 @@ ifeq ($(WANT_LIBFAT), 1)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_STATIC_AUDIO_FILTERS), 1)
|
||||
OBJ += libretro-common/audio/dsp_filters/bitcrusher.o \
|
||||
libretro-common/audio/dsp_filters/chorus.o \
|
||||
OBJ += libretro-common/audio/dsp_filters/chorus.o \
|
||||
libretro-common/audio/dsp_filters/crystalizer.o \
|
||||
libretro-common/audio/dsp_filters/echo.o \
|
||||
libretro-common/audio/dsp_filters/eq.o \
|
||||
libretro-common/audio/dsp_filters/iir.o \
|
||||
libretro-common/audio/dsp_filters/overdrive.o \
|
||||
libretro-common/audio/dsp_filters/panning.o \
|
||||
libretro-common/audio/dsp_filters/phaser.o \
|
||||
libretro-common/audio/dsp_filters/reverb.o \
|
||||
libretro-common/audio/dsp_filters/reverb_early.o \
|
||||
libretro-common/audio/dsp_filters/tremolo.o \
|
||||
libretro-common/audio/dsp_filters/vibrato.o \
|
||||
libretro-common/audio/dsp_filters/wahwah.o \
|
||||
libretro-common/audio/dsp_filters/wsolapitchtempo.o
|
||||
libretro-common/audio/dsp_filters/wahwah.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_RPILED), 1)
|
||||
@@ -2952,15 +2884,7 @@ ifneq (,$(filter 1,$(HAVE_SMBCLIENT) $(HAVE_BUILTINSMBCLIENT)))
|
||||
else ifeq ($(HAVE_BUILTINSMBCLIENT),1)
|
||||
# builtin libsmb2
|
||||
ifneq ($(findstring Win32,$(OS)),)
|
||||
# WIN32_LEAN_AND_MEAN is defined with an empty replacement list on
|
||||
# purpose. It has to be on the command line because the bundled
|
||||
# libsmb2 needs it, but it lands on every TU in the build, and ~40
|
||||
# RetroArch headers do a bare "#define WIN32_LEAN_AND_MEAN" of their
|
||||
# own before including <windows.h>. A plain -DWIN32_LEAN_AND_MEAN
|
||||
# expands to 1, which does not match those, so each one of them
|
||||
# warns about a macro redefinition. Nothing tests the value, only
|
||||
# #ifndef, so an empty definition is equivalent and silent.
|
||||
CFLAGS += -D_WINDOWS -DWIN32_LEAN_AND_MEAN=
|
||||
CFLAGS += -D_WINDOWS -DWIN32_LEAN_AND_MEAN
|
||||
CFLAGS += -DNEED_RANDOM -DNEED_SRANDOM -DNEED_GETLOGIN_R
|
||||
endif
|
||||
INCLUDE_DIRS += -I$(DEPS_DIR)/libsmb2/include
|
||||
@@ -2994,6 +2918,7 @@ endif
|
||||
deps/libsmb2/lib/krb5-wrapper.o \
|
||||
deps/libsmb2/lib/libsmb2.o \
|
||||
deps/libsmb2/lib/md4c.o \
|
||||
deps/libsmb2/lib/md5.o \
|
||||
deps/libsmb2/lib/ntlmssp.o \
|
||||
deps/libsmb2/lib/pdu.o \
|
||||
deps/libsmb2/lib/sha1.o \
|
||||
@@ -3141,12 +3066,4 @@ endif
|
||||
|
||||
endif
|
||||
|
||||
# Cross builds with mingw-w64 (a Linux host, so the MSYS2 detection
|
||||
# above never fires): the toolchain ships the 2.8 import library.
|
||||
ifneq (,$(findstring mingw,$(CC)$(HOST_PREFIX)))
|
||||
ifeq ($(HAVE_XAUDIO), 1)
|
||||
LIBS += -lxaudio2_8
|
||||
endif
|
||||
endif
|
||||
|
||||
##################################
|
||||
+9
-31
@@ -10,7 +10,7 @@ BUILD_3DSX = 1
|
||||
BUILD_3DS = 0
|
||||
BUILD_CIA = 1
|
||||
LIBCTRU_NO_DEPRECATION = 1
|
||||
USE_CTRULIB_2 ?= $(if $(shell grep -sl gspPresentBuffer $(or $(CTRULIB),$(DEVKITPRO)/libctru)/include/3ds/services/gspgpu.h),1,0)
|
||||
USE_CTRULIB_2 ?= 0
|
||||
LOAD_WITHOUT_CORE_INFO ?= 0
|
||||
|
||||
APP_TITLE = RetroArch 3DS
|
||||
@@ -30,6 +30,7 @@ APP_USE_SVCHAX = 0
|
||||
include pkg/ctr/Makefile.cores
|
||||
|
||||
OBJ :=
|
||||
OBJ += gfx/drivers/ctr_shaders/ctr_sprite.o
|
||||
OBJ += ctr/ctr_system.o
|
||||
OBJ += ctr/ctr_memory.o
|
||||
OBJ += ctr/ctr_linear.o
|
||||
@@ -53,7 +54,7 @@ DEFINES :=
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_RGUI -DHAVE_XMB -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER
|
||||
DEFINES += -DHAVE_7ZIP -DHAVE_RZSTD -DHAVE_RPNG -DHAVE_RWEBP -DHAVE_RDDS -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
|
||||
DEFINES += -DHAVE_7ZIP -DHAVE_RPNG -DHAVE_RWEBP -DHAVE_RDDS -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA
|
||||
DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_CORES
|
||||
DEFINES += -DHAVE_UPDATE_CORE_INFO
|
||||
#DEFINES += -DHAVE_UPDATE_ASSETS
|
||||
@@ -138,17 +139,6 @@ ifeq ($(strip $(DEVKITTOOLS)),)
|
||||
endif
|
||||
endif
|
||||
|
||||
CTR_PICASSO := $(firstword $(wildcard $(DEVKITTOOLS)/bin/picasso $(DEVKITTOOLS)/bin/picasso.exe))
|
||||
CTR_BIN2S := $(firstword $(wildcard $(DEVKITTOOLS)/bin/bin2s $(DEVKITTOOLS)/bin/bin2s.exe))
|
||||
|
||||
ifeq ($(words $(CTR_PICASSO) $(CTR_BIN2S)),2)
|
||||
OBJ += gfx/drivers/ctr_shaders/ctr_sprite.o
|
||||
else
|
||||
$(info CTR: picasso/bin2s unavailable, using prebuilt gfx/drivers/ctr_shaders/ctr_sprite_shbin.S)
|
||||
$(info CTR: run 'make -f Makefile.ctr ctr-shaders' on a complete devkitPro install after editing any .vsh/.gsh)
|
||||
OBJ += gfx/drivers/ctr_shaders/ctr_sprite_shbin.o
|
||||
endif
|
||||
|
||||
APP_TITLE := $(shell echo "$(APP_TITLE)" | cut -c1-128)
|
||||
APP_DESCRIPTION := $(shell echo "$(APP_DESCRIPTION)" | cut -c1-256)
|
||||
APP_AUTHOR := $(shell echo "$(APP_AUTHOR)" | cut -c1-128)
|
||||
@@ -308,26 +298,15 @@ $(TARGET): $(TARGET_3DSX) $(TARGET_3DS) $(TARGET_CIA)
|
||||
$(TARGET).3dsx: $(TARGET).elf
|
||||
$(TARGET).elf: $(OBJ) $(LIB_CORE_FULL)
|
||||
|
||||
.PHONY: ctr-shaders
|
||||
ctr-shaders:
|
||||
@set -e; \
|
||||
d=gfx/drivers/ctr_shaders; \
|
||||
trap 'rm -f $$d/ctr_sprite.shbin $$d/ctr_sprite_shbin.S.tmp' EXIT; \
|
||||
$(CTR_PICASSO) $$d/ctr_sprite.vsh $$d/ctr_sprite.gsh -o $$d/ctr_sprite.shbin; \
|
||||
$(CTR_BIN2S) $$d/ctr_sprite.shbin > $$d/ctr_sprite_shbin.S.tmp; \
|
||||
mv $$d/ctr_sprite_shbin.S.tmp $$d/ctr_sprite_shbin.S
|
||||
|
||||
%.o: %.vsh %.gsh
|
||||
$(CTR_PICASSO) $^ -o $*.shbin
|
||||
$(CTR_BIN2S) $*.shbin > $*.shbin.s
|
||||
$(PREFIX)as -o $@ $*.shbin.s
|
||||
rm $*.shbin $*.shbin.s
|
||||
$(DEVKITTOOLS)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITTOOLS)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
rm $*.shbin
|
||||
|
||||
%.o: %.vsh
|
||||
$(CTR_PICASSO) $^ -o $*.shbin
|
||||
$(CTR_BIN2S) $*.shbin > $*.shbin.s
|
||||
$(PREFIX)as -o $@ $*.shbin.s
|
||||
rm $*.shbin $*.shbin.s
|
||||
$(DEVKITTOOLS)/bin/picasso $^ -o $*.shbin
|
||||
$(DEVKITTOOLS)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
|
||||
rm $*.shbin
|
||||
|
||||
%.o: %.cpp
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
@@ -391,6 +370,5 @@ clean:
|
||||
$(Q)rm -f $(TARGET).icn
|
||||
$(Q)rm -f ctr/ctr_config_*.o
|
||||
$(Q)rm -f ctr/3dsx_custom_crt0.o
|
||||
$(Q)rm -f gfx/drivers/ctr_shaders/*.shbin gfx/drivers/ctr_shaders/*.shbin.s
|
||||
|
||||
.PHONY: clean
|
||||
@@ -6,7 +6,7 @@ CONSOLE_LOG = 0
|
||||
BUILD_3DSX = 1
|
||||
BUILD_3DS = 0
|
||||
BUILD_CIA = 1
|
||||
USE_CTRULIB_2 ?= $(if $(shell grep -sl gspPresentBuffer $(or $(CTRULIB),$(DEVKITPRO)/libctru)/include/3ds/services/gspgpu.h),1,0)
|
||||
USE_CTRULIB_2 ?= 0
|
||||
|
||||
APP_TITLE = RetroArch 3DS
|
||||
APP_DESCRIPTION = RetroArch 3DS
|
||||
@@ -31,7 +31,6 @@ OBJ := ctr/ctr_system.o \
|
||||
libretro-common/compat/fopen_utf8.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/string/rstrtod.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
|
||||
@@ -37,7 +37,6 @@ DINGUX = 1
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_RZSTD = 1
|
||||
HAVE_AL = 1
|
||||
# this freezes when switching back from menu
|
||||
HAVE_ALSA = 0
|
||||
@@ -48,7 +47,6 @@ HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_RCHD = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_CXX = 1
|
||||
|
||||
@@ -41,7 +41,6 @@ HAVE_RDDS = 1
|
||||
HAVE_RJPEG = 1
|
||||
HAVE_RBMP = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_RZSTD = 1
|
||||
HAVE_IMAGEVIEWER = 1
|
||||
HAVE_LIBRETRODB = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
@@ -64,7 +63,6 @@ HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
HAVE_CHEEVOS = 0
|
||||
HAVE_CHD = 1
|
||||
HAVE_RCHD = 1
|
||||
HAVE_RVORBIS = 1
|
||||
HAVE_RMODTRACKER = 1
|
||||
HAVE_CORE_INFO_CACHE = 1
|
||||
|
||||
@@ -61,7 +61,6 @@ HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
HAVE_CHEEVOS = 0
|
||||
HAVE_CHD = 1
|
||||
HAVE_RCHD = 1
|
||||
HAVE_RVORBIS = 1
|
||||
HAVE_RMODTRACKER = 1
|
||||
HAVE_CORE_INFO_CACHE = 1
|
||||
@@ -78,7 +77,6 @@ OBJ := frontend/frontend_salamander.o \
|
||||
frontend/drivers/platform_dos.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/string/rstrtod.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
|
||||
@@ -53,7 +53,6 @@ HAVE_CHEATS = 1
|
||||
HAVE_RMODTRACKER = 1
|
||||
HAVE_CORE_INFO_CACHE = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_RZSTD = 1
|
||||
HAVE_BSV_MOVIE ?= 1
|
||||
HAVE_CHD ?= 0
|
||||
HAVE_NETPLAYDISCOVERY ?= 0
|
||||
|
||||
+5
-9
@@ -117,6 +117,7 @@ else ifeq ($(platform), ps3-cobra)
|
||||
else ifeq ($(libogc_platform), 1)
|
||||
EXTERNAL_LIBOGC ?= 0
|
||||
HAVE_OGG_OGC ?= 0
|
||||
GX_PTHREAD_LEGACY ?= 1
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
@@ -155,6 +156,10 @@ else ifeq ($(libogc_platform), 1)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(GX_PTHREAD_LEGACY), 1)
|
||||
CFLAGS += -DGX_PTHREAD_LEGACY
|
||||
CXXFLAGS += -DGX_PTHREAD_LEGACY
|
||||
endif
|
||||
|
||||
ifeq ($(platform), ngc)
|
||||
MACHDEP := -DHW_DOL -mogc
|
||||
@@ -217,7 +222,6 @@ else ifeq ($(libogc_platform), 1)
|
||||
HAVE_RMODTRACKER := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_RZSTD := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_CHEATS := 1
|
||||
@@ -1110,9 +1114,6 @@ endif
|
||||
ifeq ($(HAVE_7ZIP), 1)
|
||||
CFLAGS += -DHAVE_7ZIP
|
||||
endif
|
||||
ifeq ($(HAVE_RZSTD), 1)
|
||||
CFLAGS += -DHAVE_RZSTD
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_SCREENSHOTS), 1)
|
||||
CFLAGS += -DHAVE_SCREENSHOTS
|
||||
@@ -1130,11 +1131,6 @@ ifeq ($(HAVE_RWAV), 1)
|
||||
CFLAGS += -DHAVE_RWAV
|
||||
endif
|
||||
|
||||
# AC-3 (rac3) and IEC 61937: no dependencies, on wherever the mixer is.
|
||||
ifeq ($(HAVE_AUDIOMIXER), 1)
|
||||
CFLAGS += -DHAVE_RAC3
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_OVERLAY), 1)
|
||||
CFLAGS += -DHAVE_OVERLAY
|
||||
endif
|
||||
|
||||
@@ -44,7 +44,6 @@ DINGUX = 1
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_RZSTD = 1
|
||||
HAVE_AL = 0
|
||||
HAVE_ALSA = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
@@ -57,7 +56,6 @@ HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_RCHD = 1
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_CXX = 1
|
||||
HAVE_RMP3 = 1
|
||||
|
||||
@@ -53,7 +53,6 @@ HAVE_IFINFO = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_RCHD = 1
|
||||
HAVE_RVORBIS = 1
|
||||
HAVE_RMODTRACKER = 1
|
||||
HAVE_CORE_INFO_CACHE = 1
|
||||
|
||||
@@ -46,7 +46,6 @@ DINGUX = 1
|
||||
HAVE_SCREENSHOTS = 1
|
||||
HAVE_REWIND = 1
|
||||
HAVE_7ZIP = 1
|
||||
HAVE_RZSTD = 1
|
||||
HAVE_AL = 0
|
||||
HAVE_ALSA = 1
|
||||
HAVE_DSP_FILTER = 1
|
||||
@@ -59,7 +58,6 @@ HAVE_C99 = 1
|
||||
HAVE_CC = 1
|
||||
HAVE_CC_RESAMPLER = 1
|
||||
HAVE_CHD = 1
|
||||
HAVE_RCHD = 1
|
||||
HAVE_COMMAND = 0
|
||||
HAVE_CXX = 1
|
||||
HAVE_RMP3 = 1
|
||||
|
||||
+7
-15
@@ -11,14 +11,6 @@ PC_DEVELOPMENT_UDP_PORT = 3490
|
||||
RARCH_CONSOLE = 0
|
||||
USBGECKO = 0
|
||||
HAVE_STATIC_DUMMY ?= 0
|
||||
# GameCube has no salamander / exec support, so in-menu core
|
||||
# switching is impossible: each core dol is launched directly
|
||||
# from the loader. If core info matching fails (missing or
|
||||
# mismatched info files, stale core_info.cache), a strict
|
||||
# core-info gate would leave content loading with no options at
|
||||
# all. Default to offering the statically linked, currently
|
||||
# running core as a fallback in that case.
|
||||
LOAD_WITHOUT_CORE_INFO ?= 1
|
||||
|
||||
SPACE :=
|
||||
SPACE := $(SPACE) $(SPACE)
|
||||
@@ -67,6 +59,7 @@ libogc_platform := 1
|
||||
|
||||
EXTERNAL_LIBOGC ?= 0
|
||||
HAVE_OGG_OGC ?= 0
|
||||
GX_PTHREAD_LEGACY ?= 1
|
||||
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
|
||||
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
|
||||
LD = $(DEVKITPPC)/bin/powerpc-eabi-ld$(EXE_EXT)
|
||||
@@ -94,6 +87,10 @@ else
|
||||
INCLUDE += -Iwii/libogc/include
|
||||
endif
|
||||
|
||||
ifeq ($(GX_PTHREAD_LEGACY), 1)
|
||||
CFLAGS += -DGX_PTHREAD_LEGACY
|
||||
CXXFLAGS += -DGX_PTHREAD_LEGACY
|
||||
endif
|
||||
|
||||
MACHDEP := -DHW_DOL -mogc
|
||||
|
||||
@@ -136,7 +133,6 @@ HAVE_RTGA := 1
|
||||
HAVE_RMODTRACKER := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_RZSTD := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_PATCH := 1
|
||||
HAVE_XDELTA := 0 # disabled because <lzma.h> isn't available (or we haven't figured out how to install it)
|
||||
@@ -180,8 +176,8 @@ ifeq ($(HAVE_LOGGER), 1)
|
||||
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
CFLAGS += -DHAVE_THREADS
|
||||
ifeq ($(HAVE_KERNEL_PRX), 1)
|
||||
CFLAGS += -DHAVE_KERNEL_PRX
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_WIIUSB_HID), 1)
|
||||
@@ -237,10 +233,6 @@ else
|
||||
CFLAGS += -O3
|
||||
endif
|
||||
|
||||
ifeq ($(LOAD_WITHOUT_CORE_INFO),1)
|
||||
CFLAGS += -DLOAD_WITHOUT_CORE_INFO
|
||||
endif
|
||||
|
||||
ifneq ($(V),1)
|
||||
Q := @
|
||||
endif
|
||||
|
||||
@@ -18,7 +18,6 @@ DEFINES = -std=gnu99
|
||||
DEFINES += -DHAVE_THREADS \
|
||||
-DHAVE_GETOPT_LONG=1 \
|
||||
-DHAVE_GRIFFIN \
|
||||
-DHAVE_RZSTD \
|
||||
-DRARCH_INTERNAL \
|
||||
-DHAVE_CONFIGFILE \
|
||||
-DHAVE_PATCH \
|
||||
|
||||
@@ -53,7 +53,6 @@ else
|
||||
HAVE_RTGA := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_RZSTD := 1
|
||||
HAVE_EGL := 1
|
||||
HAVE_GFX_WIDGETS := 1
|
||||
HAVE_GLSL := 1
|
||||
@@ -89,7 +88,6 @@ else
|
||||
HAVE_UPDATE_CORE_INFO := 1
|
||||
HAVE_CONFIGFILE := 1
|
||||
HAVE_CHD := 1
|
||||
HAVE_RCHD = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
HAVE_CORE_INFO_CACHE := 1
|
||||
|
||||
@@ -77,7 +77,6 @@ OBJS = frontend/frontend_salamander.o \
|
||||
frontend/drivers/platform_orbis.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/string/rstrtod.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ BUILD_FOR_PCSX2 = 0
|
||||
DEBUG = 0
|
||||
SCREEN_DEBUG = 0
|
||||
GRIFFIN_BUILD = 0
|
||||
HAVE_THREADS = 1
|
||||
HAVE_THREADS = 0
|
||||
MUTE_WARNINGS = 1
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
HAVE_STATIC_DUMMY ?= 0
|
||||
@@ -42,7 +42,7 @@ DEFINES += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ += griffin/griffin.o
|
||||
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS
|
||||
DEFINES += -DHAVE_RPNG -DHAVE_RWEBP -DHAVE_RDDS -DHAVE_RJPEG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_RZSTD -DHAVE_CC_RESAMPLER -DHAVE_AUDIOMIXER
|
||||
DEFINES += -DHAVE_RPNG -DHAVE_RWEBP -DHAVE_RDDS -DHAVE_RJPEG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER -DHAVE_AUDIOMIXER
|
||||
DEFINES += -DHAVE_VIDEO_FILTER -DHAVE_RGUI -DHAVE_WINDOW_OFFSET
|
||||
DEFINES += -DHAVE_DSP_FILTER
|
||||
else
|
||||
|
||||
@@ -46,7 +46,6 @@ EE_OBJS = frontend/frontend_salamander.o \
|
||||
frontend/drivers/platform_ps2.o \
|
||||
libretro-common/file/file_path.o \
|
||||
libretro-common/file/file_path_io.o \
|
||||
libretro-common/string/rstrtod.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/lists/dir_list.o \
|
||||
|
||||
+4
-3
@@ -79,8 +79,10 @@ ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||
CFLAGS += -DHAVE_FILE_LOGGER
|
||||
endif
|
||||
|
||||
SHARED_FLAGS := -DHAVE_GCM \
|
||||
-DHAVE_MENU \
|
||||
SHARED_FLAGS :=
|
||||
|
||||
SHARED_FLAGS += -DHAVE_GCM
|
||||
SHARED_FLAGS += -DHAVE_MENU \
|
||||
-DHAVE_CONFIGFILE \
|
||||
-DHAVE_PATCH \
|
||||
-DHAVE_CHEATS \
|
||||
@@ -95,7 +97,6 @@ SHARED_FLAGS := -DHAVE_GCM \
|
||||
-DHAVE_RPNG \
|
||||
-DHAVE_RWEBP \
|
||||
-DHAVE_RDDS \
|
||||
-DHAVE_THREADS \
|
||||
-DHAVE_GRIFFIN=1 \
|
||||
-DHAVE_NETWORKING=1 \
|
||||
-DHAVE_SOCKET_LEGACY=1 \
|
||||
|
||||
@@ -63,7 +63,6 @@ OBJ = frontend/frontend_salamander.o \
|
||||
libretro-common/lists/string_list.o \
|
||||
libretro-common/file/retro_dirent.o \
|
||||
libretro-common/hash/lrc_hash.o \
|
||||
libretro-common/string/rstrtod.o \
|
||||
libretro-common/string/stdstring.o \
|
||||
libretro-common/encodings/encoding_utf.o \
|
||||
libretro-common/compat/compat_strl.o \
|
||||
|
||||
+1
-2
@@ -41,7 +41,6 @@ RARCH_DEFINES = -DPSP \
|
||||
-DHAVE_DSP_FILTER \
|
||||
-DHAVE_VIDEO_FILTER \
|
||||
-DHAVE_7ZIP \
|
||||
-DHAVE_RZSTD \
|
||||
-DHAVE_CC_RESAMPLER \
|
||||
-DHAVE_CORE_INFO_CACHE
|
||||
|
||||
@@ -53,7 +52,7 @@ ifeq ($(HAVE_STATIC_DUMMY),1)
|
||||
else
|
||||
LIBS += -lretro_psp1
|
||||
endif
|
||||
LIBS += -lstdc++ -lpspgu -lpspgum -lpspaudio -lpspfpu -lpsppower -lpsprtc
|
||||
LIBS += -lstdc++ -lpspgu -lpspgum -lpspaudio -lpspfpu -lpsppower -lpsprtc -lpthread
|
||||
|
||||
ifeq ($(HAVE_THREADS), 1)
|
||||
RARCH_DEFINES += -DHAVE_THREADS
|
||||
|
||||
Loaded 100 of 1790 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user