Files
breeze/scripts/check-package-size.py
T
waozi 017d3565d3 Build on Ziran 0.5.0 and Kryon's namespaced widgets, with the Tao picture page
Pin only pushed commits, with no local overrides: Ziran v0.5.0
(f9f92b46), Kryon b45cc524 (one lock entry, ref master, shared with the
Css and Plot master edges), Apps 352901e, Entity b30dd4a and practices
893e5b6f, whose sharpened banners and regenerated Lumi guide clips the
narration check now matches.

The Library opens each Tao Te Ching chapter on its own picture page: the
chapter art and its title, centered together; the text pages follow.
The reader keeps the picture page across reflow, and a chapter start or
a Contents pick opens it. The 81 approved chapter pictures are included.

Breeze now uses Kryon's namespaced widgets (Text.Draw/Text.Props,
Button, Image, Modal.ActionModal, Layout, TabBar, LoadingScreen,
LoadingIndicator, Shape.Circle) instead of the removed Kryon/Widgets
facades. Hosted apps import std/text explicitly, since a short "text"
import now names Kryon's widget. AGENTS.md and the Text/Button API checks
describe the namespaced forms; two unused test doubles are removed.

Build fixes for the new toolchain: the bundle runtime carries Ziran's
instruction engine (no BOOTSTRAP=1) and takes the pinned host zi2c for
cross builds; the Apps controller's lock context has the manifest's
module roots; the app codec generator lists Kryon's raw modules only;
the package scripts read ZX revision 28 bundle assets. The Apps
controller digest matches the Apps 352901e build.

Also included: the stopped lanes' work in this tree (Radio download,
Photos install, Lists, Lumi, Habits shop rewards, astral exercise
selection, appearance and download recovery) and the raylib-free desktop
lane's host modules (app_trace, host_input, host_window, host_clock),
inactive unless DESKTOP_HOST is defined.

Not included: the crash-recovery lane's picture-window and storage
crash-safety changes, which that lane commits itself.

Local tests: zi-check (510 modules), native and Android source checks,
hosted app checks, build-laws, clean-text-api-check, button-api-check,
library-reader-test, library-ui-test, storage-crash-zi-test and
native-image-decode-test pass. The bundled Arcade is still ZX revision 26
and waits for an Arcade build on these pins.
2026-11-16 14:20:12 -03:00

55 lines
2.1 KiB
Python

#!/usr/bin/env python3
"""Report artifact sizes and verify one shared, architecture-independent package."""
import argparse
from pathlib import Path
import sys
import zipfile
ROOT = Path(__file__).resolve().parents[1]
def check(path):
if path.suffix not in (".apk", ".aab"):
return f"Linux binary: {path.stat().st_size / 1e6:.2f} MB"
bundle = path.suffix == ".aab"
prefix = "base/" if bundle else ""
with zipfile.ZipFile(path) as archive:
files = archive.infolist()
package_path = prefix + "assets/inbe.zx"
packages = [entry for entry in files if entry.filename.endswith("/inbe.zx")]
if len(packages) != 1 or packages[0].filename != package_path:
raise ValueError("Expected exactly one shared assets/inbe.zx")
package = packages[0]
controllers = [entry for entry in files if entry.filename.endswith("/apps.zx")]
if len(controllers) != 1 or controllers[0].filename != prefix + "assets/apps.zx":
raise ValueError("Expected exactly one shared assets/apps.zx controller")
libraries = [entry for entry in files
if entry.filename.startswith(prefix + "lib/")
and entry.filename.endswith("/libmain.so")]
if not libraries:
raise ValueError("Missing native application libraries")
if bundle:
size = sum(entry.compress_size for entry in files
if entry.filename.startswith("base/"))
else:
size = path.stat().st_size
return (f"{path.name}: {size / 1e6:.2f} MB; {len(libraries)} ABI(s); "
f"one shared package ({package.file_size / 1e6:.2f} MB unpacked)")
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("artifacts", type=Path, nargs="+")
args = parser.parse_args()
try:
for path in args.artifacts:
print("PASS " + check(path))
except (OSError, ValueError, zipfile.BadZipFile) as error:
print(f"FAIL package artifact: {error}", file=sys.stderr)
return 1
return 0
if __name__ == "__main__":
sys.exit(main())