Repair clean-checkout builds and the package-release harness

Install ffmpeg wherever the app build checks the guide narration clips:
the check decodes every clip, and only the Test jobs had ffmpeg, so web,
Linux, Windows, Android, Snap and F-Droid builds reported all 320 clips
as stale. Link the package-release harness and the sync server against
the pinned toolchain instead of the removed build/ziran-toolchain, use
the current zi2zx command form, resolve the media compression test
through package exports, and stage Tai Chi preview voices only for the
app's own locales.
This commit is contained in:
waozi committed 2026-11-17 01:44:55 -03:00
1 parent 1a18c5976a
commit 7fbef85924
22 files changed
+52 -26

No files matched your search

+2
View File
@@ -3,3 +3,5 @@ nasm
# dav1d (the AVIF decoder) builds with Meson and Ninja.
meson
ninja-build
# The app build decodes every guide narration clip with ffmpeg to check it.
ffmpeg
+2
View File
@@ -31,3 +31,5 @@ nasm
# dav1d (the AVIF decoder) builds with Meson and Ninja.
meson
ninja-build
# The app build decodes every guide narration clip with ffmpeg to check it.
ffmpeg
+2
View File
@@ -3,3 +3,5 @@ zlib1g-dev
zip
tcl
python3-fonttools
# The app build decodes every guide narration clip with ffmpeg to check it.
ffmpeg
+2
View File
@@ -10,3 +10,5 @@ nasm
# dav1d (the AVIF decoder) builds with Meson and Ninja.
meson
ninja-build
# The app build decodes every guide narration clip with ffmpeg to check it.
ffmpeg
+2 -2
View File
@@ -22,8 +22,8 @@ fi
# Emscripten's PATH entry holds a cmake directory, which make's own command
# lookup would try to run instead of the cmake program. The server generates
# its Go with Ziran, Breeze's own toolchain.
make /src/build/ziran-toolchain/bin/zi2c
make /src/build/packages/ziran/build/bin/zi2c
make -C "$server" BUILD_DIR="$server/build" CMAKE="$(command -v cmake)" \
ZIRAN=/src/build/ziran-toolchain/bin/ziran build
ZIRAN=/src/build/packages/ziran/build/bin/ziran build
DAOCHI_BIN="$server/daochi" make sync-server-test
git -c safe.directory="$server" -C "$server" diff --exit-code "$commit" -- .
+2 -2
View File
@@ -172,8 +172,8 @@ jobs:
if: matrix.shard == 0
run: |
# The server generates its Go with Ziran, Breeze's own toolchain.
make "$GITHUB_WORKSPACE/build/ziran-toolchain/bin/zi2c"
make -C .test-server build ZIRAN="$GITHUB_WORKSPACE/build/ziran-toolchain/bin/ziran"
make "$GITHUB_WORKSPACE/build/packages/ziran/build/bin/zi2c"
make -C .test-server build ZIRAN="$GITHUB_WORKSPACE/build/packages/ziran/build/bin/ziran"
make sync-server-test DAOCHI_BIN="$GITHUB_WORKSPACE/.test-server/daochi"
browser-addons:
+1 -1
View File
@@ -45,7 +45,7 @@ jobs:
- name: Install recipe dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends build-essential jimsh libssl-dev meson nasm ninja-build python3-fonttools openjdk-21-jdk-headless fdroidserver git-lfs
apt-get install -y --no-install-recommends build-essential jimsh libssl-dev meson nasm ninja-build python3-fonttools ffmpeg openjdk-21-jdk-headless fdroidserver git-lfs
update-alternatives --set java /usr/lib/jvm/java-21-openjdk-amd64/bin/java
- name: Checkout candidate
+1 -1
View File
@@ -2,7 +2,7 @@
"subdir": "droid/app",
"sudo": [
"apt-get update",
"apt-get install -y build-essential jimsh libssl-dev meson nasm ninja-build python3-fonttools"
"apt-get install -y build-essential jimsh libssl-dev meson nasm ninja-build python3-fonttools ffmpeg"
],
"gradle": ["yes"],
"output": "build/outputs/apk/release/app-universal-release-unsigned.apk",
+2
View File
@@ -89,6 +89,8 @@ parts:
- xz-utils
- python3
- python3-fonttools
# The app build decodes every guide narration clip to check it.
- ffmpeg
# Fetches the Ziran packages pinned in ziran.lock.
- git
override-build: |
+2 -2
View File
@@ -79,7 +79,7 @@ def compile_renderer():
generated.mkdir(parents=True, exist_ok=True)
subprocess.run(["make", "build-laws"], cwd=ROOT, check=True)
subprocess.run([
str(ROOT / "build/ziran-toolchain/bin/zi2c"), "--no-main", "--root", "scripts",
str(ROOT / "build/packages/ziran/build/bin/zi2c"), "--no-main", "--root", "scripts",
"--module-path", "src", "--module-path", "build/packages/ziran/std",
"-o", str(generated), "scripts/sun_salutation_preview.zi",
], cwd=ROOT, check=True)
@@ -88,7 +88,7 @@ def compile_renderer():
os.environ.get("CC", "cc"), "-std=c11", "-O2", "-shared", "-fPIC",
"-I" + str(ROOT / "build/packages/ziran/include"), "-I" + str(generated),
*map(str, sorted(generated.glob("*.c"))),
str(ROOT / "build/ziran-toolchain/libziran.a"), "-lm", "-lz", "-o", str(library),
str(ROOT / "build/packages/ziran/build/libziran.a"), "-lm", "-lz", "-o", str(library),
], cwd=ROOT, check=True)
return library
+17 -1
View File
@@ -208,8 +208,21 @@ def preview_course(data):
return result.getvalue(), spoken
def app_locale_codes():
"""Language codes the app ships, from locales/index.txt."""
codes = set()
for line in (ROOT / 'locales/index.txt').read_text(encoding='utf-8').splitlines():
if '|' in line:
codes.add(line.split('|', 1)[0])
return codes
def stage_preview(media, assets):
"""Copy only existing free clips; never generate or publish narration."""
"""Copy only existing free clips; never generate or publish narration.
Practice media can carry voices for languages the app does not ship;
only the app's own locales are staged.
"""
source = media / 'taichi'
target = assets / 'practices/taichi-preview'
target.mkdir(parents=True, exist_ok=True)
@@ -221,10 +234,13 @@ def stage_preview(media, assets):
with zipfile.ZipFile(target / 'course.zip', 'w') as archive:
archive.writestr(member, data, compresslevel=9)
shutil.copyfile(source / 'flat-edge.png', target / 'flat-edge.png')
languages = app_locale_codes()
for voice in ('voice', 'voice-male'):
for language in sorted((source / voice).glob('*')):
if not language.is_dir():
continue
if language.name not in languages:
continue
copied = 0
for key in sorted(spoken):
clip = language / (key + '.ogg')
+2 -2
View File
@@ -9,9 +9,9 @@ source=$root/tests/audio_policy_behavior.zi
mkdir -p "$work/ir" "$work/c"
"$bin/zi2zir" --root "$root/tests" --module-path "$root/src" \
-o "$work/ir" "$source"
"$bin/zi2zx" bundle --root "$root/tests" --module-path "$root/src" \
"$bin/zi2zx" --root "$root/tests" --module-path "$root/src" \
--entry audio_policy_behavior:Answer -o "$work/source.zx" "$source"
"$bin/zi2zx" bundle --root "$work/ir" --module-path "$work/ir" \
"$bin/zi2zx" --root "$work/ir" --module-path "$work/ir" \
--entry audio_policy_behavior:Answer \
-o "$work/saved.zx" "$work/ir/audio_policy_behavior.zir"
[ "$(env -u DISPLAY -u WAYLAND_DISPLAY "$bin/zi2zx" run "$work/source.zx")" = 42 ]
+1 -1
View File
@@ -23,7 +23,7 @@ for input in source saved; do
fi
output=$work/$input
mkdir -p "$output/c" "$output/go"
"$bin/zi2zx" bundle --root "$module_root" \
"$bin/zi2zx" --root "$module_root" \
--module-path "$app_path" \
--entry bottom_nav_policy_behavior:Answer \
-o "$output/policy.zx" "$file"
+1 -1
View File
@@ -26,7 +26,7 @@ for input in source saved; do
output=$work/$input
rm -rf "$output/c" "$output/go"
mkdir -p "$output/c" "$output/go"
"$bin/zi2zx" bundle --root "$module_root" \
"$bin/zi2zx" --root "$module_root" \
--module-path "$library_path" --module-path "$practice_path" \
--entry breath_timing_behavior:Answer \
-o "$output/breath.zx" "$file"
+2 -2
View File
@@ -12,12 +12,12 @@ mkdir -p "$work/ir" "$work/c"
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/daochi-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$root/build/packages/kryon/src/backend" \
-o "$work/ir" "$source"
"$bin/zi2zx" bundle --root "$root/tests" \
"$bin/zi2zx" --root "$root/tests" \
--module-path "$root/src" --module-path "$root/build/packages/kryon/src/ui" \
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/daochi-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$root/build/packages/kryon/src/backend" \
--entry device_policy_behavior:Answer \
-o "$work/source.zx" "$source"
"$bin/zi2zx" bundle --root "$work/ir" --module-path "$work/ir" \
"$bin/zi2zx" --root "$work/ir" --module-path "$work/ir" \
--module-path "$root/build/packages/kryon/src/ui" \
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/daochi-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$root/build/packages/kryon/src/backend" \
--entry device_policy_behavior:Answer \
+1 -1
View File
@@ -23,7 +23,7 @@ for input in source saved; do
fi
output=$work/$input
mkdir -p "$output/c" "$output/go"
"$bin/zi2zx" bundle --root "$module_root" \
"$bin/zi2zx" --root "$module_root" \
--module-path "$app_path" \
--entry exercise_types_behavior:Answer \
-o "$output/exercises.zx" "$file"
+1 -1
View File
@@ -4,7 +4,7 @@ root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
bin=${1:-"$root/build/ziran-toolchain/bin"}
work="$root/build/habits-table-layout-test"
mkdir -p "$work"
"$bin/zi2zx" bundle --root "$root/tests" \
"$bin/zi2zx" --root "$root/tests" \
--entry habits_table_layout_behavior:Answer \
-o "$work/layout.zx" "$root/tests/habits_table_layout_behavior.zi"
[ "$("$bin/zi2zx" run "$work/layout.zx")" = 42 ]
+1 -1
View File
@@ -23,7 +23,7 @@ for input in source saved; do
fi
output=$work/$input
mkdir -p "$output/c" "$output/go"
"$bin/zi2zx" bundle --root "$module_root" \
"$bin/zi2zx" --root "$module_root" \
--module-path "$app_path" --module-path "$root/build/packages/ziran/std" \
--entry launcher_policy_behavior:Answer \
-o "$output/policy.zx" "$file"
+5 -5
View File
@@ -16,11 +16,11 @@ mkdir -p "$work/generated" "$work/data"
python3 -B "$root/tests/make_media_compression_fixture.py" "$work/input.png"
unset DISPLAY WAYLAND_DISPLAY WAYLAND_SOCKET XAUTHORITY DBUS_SESSION_BUS_ADDRESS DBUS_SYSTEM_BUS_ADDRESS SESSION_MANAGER XDG_RUNTIME_DIR
export ZIRAN_DESKTOP_RECOVERY=0 HARMONY_DESKTOP_RECOVERY=0 YUE_DESKTOP_RECOVERY=0
"$ziran" build --target=c --define PLATFORM_DESKTOP --define AVIF_RAYLIB --define MEDIA_COMPRESSION_REAL_CODEC --root "$root/tests" \
--module-path "$root/src" --module-path "$root/build/packages/kryon/src/ui" \
--module-path "$root/build/packages/css/src" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") \
--module-path "$root/build/packages/kryon/src/backend" --module-path "$root/build/packages/game2d/src" \
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/daochi-client" \
# Project mode resolves package imports through their exports (such as
# kryon/text_area for the Lumi frame), as the app build does.
"$ziran" build --project --offline --target=c --define PLATFORM_DESKTOP --define AVIF_RAYLIB \
--define MEDIA_COMPRESSION_REAL_CODEC --root "$root" \
--module-path "$root/tests" \
--entry media_compression_behavior:Check -o "$work/generated" \
"$root/tests/media_compression_behavior.zi" "$root/tests/media_compression_test_host.zi" "$root/src/app/app_clock_host.zi"
cat > "$work/generated/main.c" <<'C'
+1 -1
View File
@@ -26,7 +26,7 @@ for input in source saved; do
output=$work/$input
rm -rf "$output/c" "$output/go"
mkdir -p "$output/c" "$output/go"
"$bin/zi2zx" bundle --root "$module_root" \
"$bin/zi2zx" --root "$module_root" \
--module-path "$module_path" \
--module-path "$root/build/packages/kryon/src/ui" \
--module-path "$root/build/packages/ziran/std" --module-path "$root/build/packages/daochi-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$root/build/packages/kryon/src/backend" \
+1 -1
View File
@@ -34,7 +34,7 @@ def main():
work = Path(os.environ.get('INBE_PACKAGE_TEST_OUTPUT', str(ROOT / "build/package-release-test")))
work.mkdir(parents=True, exist_ok=True)
toolchain = options.toolchain or ROOT / 'build/packages/ziran'
runtime = options.runtime or ROOT / 'build/ziran-toolchain/libziran.a'
runtime = options.runtime or toolchain / 'build/libziran.a'
def stage(*arguments):
return release_tool.stage(*arguments, build_directory=options.bundle_build_dir)
environment = {key: value for key, value in os.environ.items()
+1 -1
View File
@@ -9,7 +9,7 @@ source=$root/tests/patterns_rules_behavior.zi
"$bin/zi2zir" --check-only --root "$root/tests" \
--module-path "$root/src" "$source"
"$bin/zi2zx" bundle --root "$root/tests" \
"$bin/zi2zx" --root "$root/tests" \
--module-path "$root/src" \
--entry patterns_rules_behavior:Answer \
-o "$work/patterns.zx" "$source"