From 7fbef85924e499d1debe368433ffb14f0057d1a5 Mon Sep 17 00:00:00 2001 From: Waozi Date: Tue, 17 Nov 2026 01:44:55 -0300 Subject: [PATCH] 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. --- .github/apt/android-packages.txt | 2 ++ .github/apt/linux-packages.txt | 2 ++ .github/apt/web-packages.txt | 2 ++ .github/apt/windows-packages.txt | 2 ++ .github/local-ci/check-sync.sh | 4 ++-- .github/workflows/ci.yml | 4 ++-- .github/workflows/fdroid.yml | 2 +- packaging/fdroid-build.json | 2 +- packaging/snap/snap/snapcraft.yaml | 2 ++ scripts/render-sun-salutation-live.py | 4 ++-- scripts/tai_chi_preview.py | 18 +++++++++++++++++- tests/audio_policy_zi_test.sh | 4 ++-- tests/bottom_nav_policy_zi_test.sh | 2 +- tests/breath_timing_zi_test.sh | 2 +- tests/device_policy_zi_test.sh | 4 ++-- tests/exercise_types_zi_test.sh | 2 +- tests/habits_table_layout_test.sh | 2 +- tests/launcher_policy_zi_test.sh | 2 +- tests/media_compression_zi_test.sh | 10 +++++----- tests/navigation_routes_zi_test.sh | 2 +- tests/package_release_test.py | 2 +- tests/patterns_rules_zi_test.sh | 2 +- 22 files changed, 52 insertions(+), 26 deletions(-) diff --git a/.github/apt/android-packages.txt b/.github/apt/android-packages.txt index 8fc3879dd..96846fb9b 100644 --- a/.github/apt/android-packages.txt +++ b/.github/apt/android-packages.txt @@ -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 diff --git a/.github/apt/linux-packages.txt b/.github/apt/linux-packages.txt index 5eee4001c..eaabb0af3 100644 --- a/.github/apt/linux-packages.txt +++ b/.github/apt/linux-packages.txt @@ -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 diff --git a/.github/apt/web-packages.txt b/.github/apt/web-packages.txt index 7aeba42c0..415e6d172 100644 --- a/.github/apt/web-packages.txt +++ b/.github/apt/web-packages.txt @@ -3,3 +3,5 @@ zlib1g-dev zip tcl python3-fonttools +# The app build decodes every guide narration clip with ffmpeg to check it. +ffmpeg diff --git a/.github/apt/windows-packages.txt b/.github/apt/windows-packages.txt index 6418d2ab7..3851423a0 100644 --- a/.github/apt/windows-packages.txt +++ b/.github/apt/windows-packages.txt @@ -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 diff --git a/.github/local-ci/check-sync.sh b/.github/local-ci/check-sync.sh index de24bda6b..8ccd7410d 100644 --- a/.github/local-ci/check-sync.sh +++ b/.github/local-ci/check-sync.sh @@ -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" -- . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 610c55d87..06310d657 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/fdroid.yml b/.github/workflows/fdroid.yml index 863684a9d..5fca8f7ed 100644 --- a/.github/workflows/fdroid.yml +++ b/.github/workflows/fdroid.yml @@ -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 diff --git a/packaging/fdroid-build.json b/packaging/fdroid-build.json index 07d47e653..6cae0f725 100644 --- a/packaging/fdroid-build.json +++ b/packaging/fdroid-build.json @@ -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", diff --git a/packaging/snap/snap/snapcraft.yaml b/packaging/snap/snap/snapcraft.yaml index e4a877725..62514e1d6 100644 --- a/packaging/snap/snap/snapcraft.yaml +++ b/packaging/snap/snap/snapcraft.yaml @@ -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: | diff --git a/scripts/render-sun-salutation-live.py b/scripts/render-sun-salutation-live.py index 4b6c182ff..812549b99 100644 --- a/scripts/render-sun-salutation-live.py +++ b/scripts/render-sun-salutation-live.py @@ -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 diff --git a/scripts/tai_chi_preview.py b/scripts/tai_chi_preview.py index 1e565b8b5..6374caf3e 100644 --- a/scripts/tai_chi_preview.py +++ b/scripts/tai_chi_preview.py @@ -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') diff --git a/tests/audio_policy_zi_test.sh b/tests/audio_policy_zi_test.sh index b433d18a4..fedc76a33 100644 --- a/tests/audio_policy_zi_test.sh +++ b/tests/audio_policy_zi_test.sh @@ -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 ] diff --git a/tests/bottom_nav_policy_zi_test.sh b/tests/bottom_nav_policy_zi_test.sh index fa5affff0..5f1c5d8f9 100644 --- a/tests/bottom_nav_policy_zi_test.sh +++ b/tests/bottom_nav_policy_zi_test.sh @@ -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" diff --git a/tests/breath_timing_zi_test.sh b/tests/breath_timing_zi_test.sh index 2233990e7..ab24195e0 100644 --- a/tests/breath_timing_zi_test.sh +++ b/tests/breath_timing_zi_test.sh @@ -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" diff --git a/tests/device_policy_zi_test.sh b/tests/device_policy_zi_test.sh index 2a2e6a110..8f5ec56a7 100644 --- a/tests/device_policy_zi_test.sh +++ b/tests/device_policy_zi_test.sh @@ -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 \ diff --git a/tests/exercise_types_zi_test.sh b/tests/exercise_types_zi_test.sh index d297ae15d..319b0c7fc 100644 --- a/tests/exercise_types_zi_test.sh +++ b/tests/exercise_types_zi_test.sh @@ -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" diff --git a/tests/habits_table_layout_test.sh b/tests/habits_table_layout_test.sh index d298447d0..b517620ac 100755 --- a/tests/habits_table_layout_test.sh +++ b/tests/habits_table_layout_test.sh @@ -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 ] diff --git a/tests/launcher_policy_zi_test.sh b/tests/launcher_policy_zi_test.sh index 82df2ac62..087329952 100644 --- a/tests/launcher_policy_zi_test.sh +++ b/tests/launcher_policy_zi_test.sh @@ -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" diff --git a/tests/media_compression_zi_test.sh b/tests/media_compression_zi_test.sh index 9225ce9d6..1da11a286 100644 --- a/tests/media_compression_zi_test.sh +++ b/tests/media_compression_zi_test.sh @@ -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' diff --git a/tests/navigation_routes_zi_test.sh b/tests/navigation_routes_zi_test.sh index b8b03c4ed..6b22ea8cd 100644 --- a/tests/navigation_routes_zi_test.sh +++ b/tests/navigation_routes_zi_test.sh @@ -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" \ diff --git a/tests/package_release_test.py b/tests/package_release_test.py index 4de0eba11..c37828f8b 100644 --- a/tests/package_release_test.py +++ b/tests/package_release_test.py @@ -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() diff --git a/tests/patterns_rules_zi_test.sh b/tests/patterns_rules_zi_test.sh index 58085d58b..6d63dfa90 100644 --- a/tests/patterns_rules_zi_test.sh +++ b/tests/patterns_rules_zi_test.sh @@ -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"