Fix VICE cross-compile and image cache-warming for release builds
release / build (push) Successful in 5m34s

build-image/Dockerfile: add bison (VICE's configure needs a yacc-compatible
parser generator, same category as the earlier flex fix) and exclude
packageRelease/signReleaseBundle from the cache-warm stage's gradlew run,
since those always fail there for lack of a keystore that's never baked
into the image.

vice_jni.c: guard getFrameCount()/setSoundEnabled() with #ifdef
HAVE_VICE_SRC like their sibling functions already do — they referenced
globals that only exist when VICE is linked in, breaking the documented
no-VICE placeholder build. Only surfaced now because the cache-warm stage
is the first thing to ever compile this file without VICE.

dist.sh: floor the untagged dev-build's versionCode at 1, since the
0.0.0-dev+<sha> placeholder otherwise computes to 0, which Android's
Gradle plugin rejects.

run-image.sh: wipe generated build artifacts (vice-src, vice-libs,
nibtools-src/libs, app/build, .cxx) before each run so it exercises a true
from-scratch build like CI does, instead of silently reusing artifacts
left over from a previous local run. Also chown the bind-mounted repo back
to the host user on exit, since the container runs as root and was
otherwise leaving root-owned files behind.
This commit is contained in:
ml
2026-07-04 15:11:53 +02:00
parent 8881241fd8
commit e07258c8bd
6 changed files with 56 additions and 13 deletions
+16 -6
View File
@@ -26,14 +26,14 @@ ENV DEBIAN_FRONTEND=noninteractive \
# git/unzip/curl/jq: checkout, SDK downloads, and the release workflow's
# calls to the Gitea API (create release, upload assets).
# python3-venv: pebble-tool's `sdk install` creates a venv per SDK version.
# dos2unix/autoconf/automake/pkg-config/xa65/build-essential/gettext/flex:
# dos2unix/autoconf/automake/pkg-config/xa65/build-essential/gettext/flex/bison:
# host tools required by the companion app's build_vice.sh (see that file's
# own preflight check, plus flex for VICE's AC_PROG_LEX-based configure) to
# cross-compile VICE via autotools before NDK clang takes over for the
# actual target compilation.
# own preflight check, plus flex/bison for VICE's AC_PROG_LEX/AC_PROG_YACC-
# based configure) to cross-compile VICE via autotools before NDK clang takes
# over for the actual target compilation.
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates git unzip tar xz-utils python3 python3-venv file jq \
dos2unix autoconf automake pkg-config xa65 build-essential gettext flex \
dos2unix autoconf automake pkg-config xa65 build-essential gettext flex bison \
&& rm -rf /var/lib/apt/lists/*
# --- Android SDK: cmdline-tools, platform, build-tools, NDK, CMake ---
@@ -82,6 +82,13 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
# stage only ever warms the Gradle/Maven dependency cache, never bakes in
# compiled VICE/nibtools output.
#
# packageRelease/signReleaseBundle are also excluded — they're the only tasks
# that need the release keystore, which never exists here (secrets are
# injected at job runtime, never baked into the image). Excluding them lets
# everything upstream (dependency resolution, Kotlin/native compilation,
# resource merging, dexing) still run and get cached, without two guaranteed,
# noisy "missing storeFile" failures cluttering every image build.
#
# This is a pure optimization: if the app's dependencies change after this
# image was built, Gradle just downloads the delta against the warm cache at
# `docker run` time — same as it would without this stage, just slower for
@@ -91,7 +98,10 @@ FROM base AS gradle-cache-warm
COPY SchwertUndMagieOnPebbleCompanionApp /tmp/warm/SchwertUndMagieOnPebbleCompanionApp
WORKDIR /tmp/warm/SchwertUndMagieOnPebbleCompanionApp
RUN chmod +x gradlew \
&& (./gradlew bundleRelease assembleRelease -x buildVice -x buildNibtools --continue || true)
&& (./gradlew bundleRelease assembleRelease \
-x buildVice -x buildNibtools \
-x packageRelease -x signReleaseBundle \
--continue || true)
FROM base
COPY --from=gradle-cache-warm /root/.gradle /root/.gradle
+1 -1
View File
@@ -1 +1 @@
2
3