Resolve image packages in host tests and refresh the gallery's Kryon pin
The image codec integration left four CI gaps: - The bitmap browser test hard-coded a Bun path; it now uses the configured JS_RUNTIME like the other browser tests, and starts from a clean work directory so stale IR cannot leak into its saved build. - The gallery locked Kryon20b38574, which has no Card widget for its card scene; it now locksf2bfeb40and that commit's image packages. - The raylib typeface, frame pixel and frame snapshot hosts resolve the webp, avif and image_codec packages through the project and link the WebP and AVIF archives they now use. - The behavior suite builds the WebP archive the image job test links.
This commit is contained in:
1 parent
f2bfeb409d
commit
4a1423d0f6
6 files changed
+96
-35
No files matched your search
@@ -164,8 +164,8 @@ include mk/zx-canvas.mk
|
||||
include mk/raylib-library.mk
|
||||
include mk/zx-raylib.mk
|
||||
|
||||
# Injected graphics hosts still link the production AVIF native ABI.
|
||||
ziran-test behavior-tests: $(AVIF_A) $(AOM_A)
|
||||
# Injected graphics hosts still link the production WebP and AVIF native ABIs.
|
||||
ziran-test behavior-tests: $(WEBP_A) $(AVIF_A) $(AOM_A)
|
||||
$(ZX_CANVAS_GENERATED)/.complete $(ZX_RAYLIB_GENERATED)/.complete: | project-toolchain
|
||||
zx-reload-test: zx-player
|
||||
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
|
||||
@@ -414,7 +414,7 @@ raylib-window-test: $(ZI2C_BIN) $(WEBP_A) $(AVIF_A) $(AOM_A)
|
||||
ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/raylib_window_test.sh
|
||||
|
||||
.PHONY: raylib-typeface-test
|
||||
raylib-typeface-test: $(ZI2C_BIN)
|
||||
raylib-typeface-test: $(ZI2C_BIN) $(WEBP_A) $(AVIF_A) $(AOM_A)
|
||||
@env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
|
||||
ZIRAN_ROOT="$(ZIRAN_DIR)" ZIRAN_BIN="$(ZIRAN_BIN)" sh tests/raylib_typeface_test.sh
|
||||
|
||||
@@ -447,7 +447,8 @@ android-fopen-test: project-toolchain
|
||||
.PHONY: raylib-frame-pixels-test
|
||||
raylib-frame-pixels-test: project-toolchain $(RAYLIB_ARCHIVES)
|
||||
@ZIRAN_BIN="$(ZIRAN_BIN)" python3 tests/android_frame_pixels_test.py --host \
|
||||
--raylib "$(RAYLIB_A)" --webp "$(WEBP_A)" --runtime "$(ZIRAN_BUILD_DIR)/libziran.a"
|
||||
--raylib "$(RAYLIB_A)" --webp "$(WEBP_A)" --archive "$(AVIF_A)" --archive "$(AOM_A)" \
|
||||
--runtime "$(ZIRAN_BUILD_DIR)/libziran.a"
|
||||
|
||||
.PHONY: raylib-secondary-window-test
|
||||
raylib-secondary-window-test: $(ZI2C_BIN)
|
||||
|
||||
+63
-10
@@ -10,6 +10,15 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/libsdl-org/SDL.git"
|
||||
},
|
||||
{
|
||||
"commit": "b29d4f43fd295377f745ee88fe6596358fdd12c0",
|
||||
"dependencies": {"image_codec": "pf881ecd979d92258", "libwebp": "p3b3c785a0e17e605"},
|
||||
"dependency_refs": {"image_codec": "a8767d78d0c08d5b1c1fc0bab6fcafdc7a6da930", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
|
||||
"id": "p3506771824db7a7c",
|
||||
"name": "webp",
|
||||
"ref": "b29d4f43fd295377f745ee88fe6596358fdd12c0",
|
||||
"url": "https://github.com/ziranlang/webp.git"
|
||||
},
|
||||
{
|
||||
"commit": "1844042d1ca751e62e61df7617dba19c98588339",
|
||||
"dependencies": {},
|
||||
@@ -19,18 +28,45 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/webmproject/libwebp.git"
|
||||
},
|
||||
{
|
||||
"commit": "f2bfeb409d97a6bec7b8d15c9500ba4e0588d521",
|
||||
"dependencies": {"avif": "p604d73d730de99c3", "image_codec": "pf881ecd979d92258", "libaom": "pfba2650e0a73c0ea", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "p3506771824db7a7c"},
|
||||
"dependency_refs": {"avif": "9da2e2ae6f1e76d3c65b26b2b6eb8da9ad1bc67c", "image_codec": "a8767d78d0c08d5b1c1fc0bab6fcafdc7a6da930", "libaom": "d772e334cc724105040382a977ebb10dfd393293", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "b29d4f43fd295377f745ee88fe6596358fdd12c0"},
|
||||
"id": "p480efbd18a27dba5",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "b83565470e04b7653e9dd88fb776bf7d513736ca",
|
||||
"dependencies": {"kryon": "pc1804bf62ee8780e"},
|
||||
"dependencies": {"kryon": "p480efbd18a27dba5"},
|
||||
"dependency_refs": {"kryon": "master"},
|
||||
"id": "p4c3f14b15870aa32",
|
||||
"name": "DataViews",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/data-views.git"
|
||||
},
|
||||
{
|
||||
"commit": "1aadfad932c98c069a1204261b1856f81f3bc199",
|
||||
"dependencies": {},
|
||||
"id": "p57c0272208aae8db",
|
||||
"name": "libavif",
|
||||
"ref": "1aadfad932c98c069a1204261b1856f81f3bc199",
|
||||
"source": true,
|
||||
"url": "https://github.com/AOMediaCodec/libavif.git"
|
||||
},
|
||||
{
|
||||
"commit": "9da2e2ae6f1e76d3c65b26b2b6eb8da9ad1bc67c",
|
||||
"dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "pf881ecd979d92258", "libaom": "pfba2650e0a73c0ea", "libavif": "p57c0272208aae8db"},
|
||||
"dependency_refs": {"dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "a8767d78d0c08d5b1c1fc0bab6fcafdc7a6da930", "libaom": "d772e334cc724105040382a977ebb10dfd393293", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"},
|
||||
"id": "p604d73d730de99c3",
|
||||
"name": "avif",
|
||||
"ref": "9da2e2ae6f1e76d3c65b26b2b6eb8da9ad1bc67c",
|
||||
"url": "https://github.com/ziranlang/avif.git"
|
||||
},
|
||||
{
|
||||
"commit": "3f888653b6b97010163d824c4cc72476be3214f3",
|
||||
"dependencies": {"kryon": "pc1804bf62ee8780e"},
|
||||
"dependencies": {"kryon": "p480efbd18a27dba5"},
|
||||
"dependency_refs": {"kryon": "master"},
|
||||
"id": "pab5377a2950368a2",
|
||||
"name": "plot",
|
||||
@@ -38,13 +74,13 @@
|
||||
"url": "https://github.com/kryonlabs/plot.git"
|
||||
},
|
||||
{
|
||||
"commit": "20b38574f23e329f889c581d37fe84e34f55b2f0",
|
||||
"dependencies": {"libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b"},
|
||||
"dependency_refs": {"libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a"},
|
||||
"id": "pc1804bf62ee8780e",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
"commit": "54706fc6bc0cdecab7e9593974a4039cc038fca7",
|
||||
"dependencies": {},
|
||||
"id": "pb24767b9eb34d961",
|
||||
"name": "dav1d",
|
||||
"ref": "54706fc6bc0cdecab7e9593974a4039cc038fca7",
|
||||
"source": true,
|
||||
"url": "https://github.com/videolan/dav1d.git"
|
||||
},
|
||||
{
|
||||
"commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
|
||||
@@ -54,10 +90,27 @@
|
||||
"ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e",
|
||||
"source": true,
|
||||
"url": "https://github.com/raysan5/raylib.git"
|
||||
},
|
||||
{
|
||||
"commit": "a8767d78d0c08d5b1c1fc0bab6fcafdc7a6da930",
|
||||
"dependencies": {},
|
||||
"id": "pf881ecd979d92258",
|
||||
"name": "image-codec",
|
||||
"ref": "a8767d78d0c08d5b1c1fc0bab6fcafdc7a6da930",
|
||||
"url": "https://github.com/ziranlang/image-codec.git"
|
||||
},
|
||||
{
|
||||
"commit": "d772e334cc724105040382a977ebb10dfd393293",
|
||||
"dependencies": {},
|
||||
"id": "pfba2650e0a73c0ea",
|
||||
"name": "libaom",
|
||||
"ref": "d772e334cc724105040382a977ebb10dfd393293",
|
||||
"source": true,
|
||||
"url": "https://aomedia.googlesource.com/aom"
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"data_views": "p4c3f14b15870aa32", "kryon": "pc1804bf62ee8780e", "plot": "pab5377a2950368a2"},
|
||||
"dependencies": {"data_views": "p4c3f14b15870aa32", "kryon": "p480efbd18a27dba5", "plot": "pab5377a2950368a2"},
|
||||
"dependency_refs": {"data_views": "master", "kryon": "master", "plot": "master"},
|
||||
"name": "gallery"
|
||||
},
|
||||
|
||||
@@ -38,6 +38,8 @@ def main():
|
||||
help="Android raylib static archive built with custom frame control")
|
||||
parser.add_argument("--webp", type=Path, required=True,
|
||||
help="Kryon's kryonwebp static archive for the same ABI")
|
||||
parser.add_argument("--archive", type=Path, action="append", default=[],
|
||||
help="Another native archive the backend links, such as AVIF's")
|
||||
parser.add_argument("--runtime", type=Path,
|
||||
help="Android Ziran runtime static archive for the same ABI")
|
||||
parser.add_argument("--build-only", action="store_true")
|
||||
@@ -55,15 +57,16 @@ def main():
|
||||
# Existing artifacts are immutable inputs. No active app output is replaced.
|
||||
raylib = args.raylib.resolve(strict=True)
|
||||
webp = args.webp.resolve(strict=True)
|
||||
archives = [archive.resolve(strict=True) for archive in args.archive]
|
||||
runtime = (args.runtime or ziran / "build/libziran.a").resolve(strict=True)
|
||||
source = ROOT / "tests/android_frame_pixels_test.zi"
|
||||
generated = WORK / "c"
|
||||
if generated.exists():
|
||||
shutil.rmtree(generated)
|
||||
defines = ["KRYON_FRAME_THREADS", "PLATFORM_ANDROID", "__x86_64__", "KRYON_TEST_LINUX"] if args.host else ["ANDROID_BUILD", "__arm__"]
|
||||
command = [ziran / "build/bin/ziran", "build", "--target=c", "--no-main",
|
||||
# The project resolves Kryon's module roots and its image packages.
|
||||
command = [ziran / "build/bin/ziran", "build", "--project", "--target=c", "--no-main",
|
||||
*[part for define in defines for part in ["--define", define]], "--root", ROOT / "tests",
|
||||
"--module-path", ROOT / "src/backend", "--module-path", ROOT / "src/ui",
|
||||
"-o", generated, source]
|
||||
output = run(command, cwd=ROOT)
|
||||
includes = sorted({generated, *(p.parent for p in generated.rglob("*.h"))})
|
||||
@@ -81,7 +84,7 @@ def main():
|
||||
executable = WORK / ("host-frame-test" if args.host else "frame-test")
|
||||
command = [compiler, "-std=c11", "-O2", "-ffunction-sections", "-fdata-sections",
|
||||
"-I" + str(ziran / "include"), *["-iquote" + str(p) for p in includes],
|
||||
*sorted(generated.rglob("*.c")), raylib, webp, runtime,
|
||||
*sorted(generated.rglob("*.c")), raylib, webp, *archives, runtime,
|
||||
"-Wl,--gc-sections", "-Wl,--export-dynamic-symbol=CORE",
|
||||
*["-Wl,--wrap=" + name for name in wraps],
|
||||
*libraries, "-o", executable]
|
||||
@@ -104,7 +107,7 @@ def main():
|
||||
"originating_chat": "-1000000002", "serial": args.serial,
|
||||
"package": args.package, "mode": "private EGL pbuffer; hashes only",
|
||||
"inputs": {str(p): hashlib.sha256(p.read_bytes()).hexdigest()
|
||||
for p in [executable, fixture, font, raylib, webp, runtime]}}
|
||||
for p in [executable, fixture, font, raylib, webp, *archives, runtime]}}
|
||||
if args.build_only:
|
||||
print("Built offscreen GLES hash harness; no device access")
|
||||
return
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Actual Canvas/Wasm Image lifecycle in private headless Chromium; Bun only, no Node."""
|
||||
"""Actual Canvas/Wasm Image lifecycle in private headless Chromium, run by the configured JS_RUNTIME."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
from toolchain import ZIRAN, ZIRAN_ROOT
|
||||
from toolchain import JS_RUNTIME, ZIRAN, ZIRAN_ROOT
|
||||
ROOT=Path(__file__).resolve().parents[1]
|
||||
WORK=ROOT/'build/scratch/bitmap-image-browser'
|
||||
ENV={k:v for k,v in os.environ.items() if k not in ('DISPLAY','WAYLAND_DISPLAY','XAUTHORITY','DBUS_SESSION_BUS_ADDRESS','SESSION_MANAGER','GDK_DISPLAY','DESKTOP_SESSION')}
|
||||
BUN=Path(os.environ.get('JS_RUNTIME','/home/wao/.bun/bin/bun'))
|
||||
assert BUN.is_file() and BUN.name=='bun','Bitmap browser test requires the configured Bun runtime'
|
||||
ENV.update(EM_NODE_JS=str(BUN),JS_RUNTIME=str(BUN),EMCC_CORES='1',YUE_DESKTOP_RECOVERY='0',LIBGL_ALWAYS_SOFTWARE='1',EM_CACHE=str(ROOT/'build/emscripten-cache'))
|
||||
EMCC=os.environ.get('EMCC','/home/wao/emsdk/upstream/emscripten/emcc')
|
||||
ENV.update(EMCC_CORES='1',YUE_DESKTOP_RECOVERY='0',LIBGL_ALWAYS_SOFTWARE='1',EM_CACHE=str(ROOT/'build/emscripten-cache'))
|
||||
# A configured runtime also runs emscripten's own JavaScript.
|
||||
if 'JS_RUNTIME' in os.environ:ENV['EM_NODE_JS']=JS_RUNTIME
|
||||
EMCC=os.environ.get('EMCC',str(Path.home()/'emsdk/upstream/emscripten/emcc'))
|
||||
def run(command):
|
||||
subprocess.run(list(map(str,command)),env=ENV,cwd=ROOT,check=True)
|
||||
# Kryon's proven private headless Chromium driver, run by Bun; it polls the
|
||||
# Kryon's private headless Chromium driver; it polls the
|
||||
# page's #result element and has no desktop connection.
|
||||
def browser():
|
||||
profile=Path(tempfile.mkdtemp(prefix='chromium-',dir=WORK))
|
||||
run_env=dict(ENV);run_env.pop('CANVAS_TEST_MESH_GPU',None)
|
||||
subprocess.run([str(BUN),str(ROOT/'tests/canvas_backend_browser.mjs'),(WORK/'test.html').as_uri(),str(profile)],env=run_env,cwd=ROOT,check=True,timeout=60)
|
||||
subprocess.run([JS_RUNTIME,str(ROOT/'tests/canvas_backend_browser.mjs'),(WORK/'test.html').as_uri(),str(profile)],env=run_env,cwd=ROOT,check=True,timeout=60)
|
||||
|
||||
def main():
|
||||
WORK.mkdir(parents=True,exist_ok=True)
|
||||
# Stale IR from another toolchain would leak into the saved build.
|
||||
shutil.rmtree(WORK,ignore_errors=True)
|
||||
WORK.mkdir(parents=True)
|
||||
ir=WORK/'ir';source=ROOT/'tests/bitmap_image_test.zi'
|
||||
common=['--project','--root',ROOT/'tests','--define','PLATFORM_WEB']
|
||||
run([ZIRAN,'ir',*common,'-o',ir,source])
|
||||
|
||||
@@ -30,7 +30,8 @@ for mode in serial threaded; do
|
||||
fi
|
||||
# Reuse the test's disposable output for each backend configuration.
|
||||
# shellcheck disable=SC2086
|
||||
"$ziran" build --target=c "$@" $defines \
|
||||
# The native host resolves Kryon's module roots and image packages from the project.
|
||||
"$ziran" build --project --target=c --root "$repo/tests" $defines \
|
||||
-o "$work/host-c" "$repo/tests/raylib_frame_snapshot_test.zi"
|
||||
# shellcheck disable=SC2046,SC2086
|
||||
"${CC:-cc}" -std=c11 -O1 -ffunction-sections -fdata-sections -I"$work/host-c" \
|
||||
|
||||
@@ -7,7 +7,6 @@ unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
|
||||
mkdir -p "$repo/build/scratch"
|
||||
work=$(mktemp -d "$repo/build/scratch/raylib-typeface.XXXXXX")
|
||||
trap 'rm -rf "$work"' EXIT HUP INT TERM
|
||||
export XDG_CACHE_HOME="$work/cache"
|
||||
if test -n "${RAYLIB_A:-}"; then archive=$RAYLIB_A
|
||||
else
|
||||
raylib_source=${RAYLIB_SOURCE:-$("$ziran" pkg path raylib)}
|
||||
@@ -16,25 +15,26 @@ fi
|
||||
test -f "$archive"
|
||||
raylib_libs=${RAYLIB_LIBS:-$(pkg-config --libs sdl2) -lGL -ldl -lpthread -lm}
|
||||
source=$repo/tests/raylib_typeface_test.zi
|
||||
"$ziran" ir --root "$repo/tests" --module-path "$repo/src/ui" \
|
||||
--module-path "$repo/src/backend" --module-path "$ziran_root/std" -o "$work/ir" "$source"
|
||||
"$ziran" ir --project --root "$repo/tests" -o "$work/ir" "$source"
|
||||
cd "$repo"
|
||||
for form in source saved; do
|
||||
input=$source
|
||||
if test "$form" = saved; then input=$work/ir/raylib_typeface_test.zir; fi
|
||||
for target in c; do
|
||||
output=$work/$form-$target
|
||||
"$ziran" build --target="$target" --root "$repo/tests" \
|
||||
--module-path "$repo/src/ui" --module-path "$repo/src/backend" \
|
||||
--module-path "$ziran_root/std" -o "$output" "$input"
|
||||
"$ziran" build --project --target="$target" --root "$repo/tests" \
|
||||
-o "$output" "$input"
|
||||
compiler=${CC:-cc}; standard=c11; extension=c
|
||||
"$compiler" -std="$standard" -O1 -ffunction-sections -fdata-sections \
|
||||
-Wl,--gc-sections -Wl,--wrap=LoadFontEx -Wl,--wrap=LoadFontFromMemory \
|
||||
-Wl,--wrap=UnloadFont -Wl,--wrap=DrawTextEx -Wl,--wrap=rlDrawRenderBatchActive \
|
||||
-Wl,--wrap=SetTextureFilter -Wl,--wrap=rlGetMatrixModelview \
|
||||
-I"$output" "$output"/*."$extension" "$archive" \
|
||||
"${WEBP_A:-$repo/build/webp-ziran/libkryonwebp.a}" \
|
||||
"${AVIF_A:-$repo/build/avif-ziran/avif/libavif.a}" \
|
||||
"${AOM_A:-$repo/build/avif-ziran/aom/libaom.a}" \
|
||||
$raylib_libs -o "$output/test"
|
||||
timeout --kill-after=2s 20s "$output/test"
|
||||
XDG_CACHE_HOME="$work/cache" timeout --kill-after=2s 20s "$output/test"
|
||||
done
|
||||
done
|
||||
echo 'Raylib real font coverage, CJK fallback, supplementary seeds, measurements and disposal passed C source and saved IR'
|
||||
Reference in new issue
Block a user