diff --git a/CHANGELOG.md b/CHANGELOG.md index 610ee85..4a62345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## [Unreleased] +- Build with Ziran 7fbc8152 and Kryon 3627ea8a, the Kryon without raylib, together with Plot, Game2D, CSS and Apps. +- The `native-crypto` artifact's Android and Windows runtimes generate their C with the toolchain's own `zi2c` under the device's target conditions, so an ARMv7 build no longer cross-compiles a code generator against glibc symbols bionic lacks; Android consumers also link liblog, which the runtime's diagnostics use. + - Limit native Profile artifacts to the declared profile pictures, excluding game and leaderboard artwork. - Use the Mesh client namespace for account sync while preserving existing account keys, records and protocol bytes. diff --git a/tools/artifacts.zi b/tools/artifacts.zi index eea7e8e..3742e6a 100644 --- a/tools/artifacts.zi +++ b/tools/artifacts.zi @@ -94,7 +94,8 @@ Archive :: (generated: string, output: string, include: string = "") -> bool { SystemLinkText :: (profile: bool) -> string { if web { return ifx profile then "js-library\tziran_web.js\nembed\tentity.zx@/entity.zx\nembed\tfont.ttf@/kryon-font.ttf\n" else "flag\t-sUSE_ZLIB=1\nflag\t-sASYNCIFY\nflag\t-sALLOW_MEMORY_GROWTH=1\nflag\t-sFORCE_FILESYSTEM=1\nflag\t-lidbfs.js\n" } if windows { return ifx profile then "flag\t-flto=1\nlibrary\t-luser32\nlibrary\t-lshell32\nlibrary\t-lole32\nlibrary\t-lcomdlg32\n" else "library\t-lws2_32\nlibrary\t-liphlpapi\nlibrary\t-lcrypt32\nlibrary\t-lsecur32\nlibrary\t-lbcrypt\nlibrary\t-ladvapi32\nlibrary\t-lm\n" } - if android { return ifx profile then "library\t-landroid\nlibrary\t-llog\n" else "library\t-lm\nlibrary\t-lz\nlibrary\t-ldl\n" } + // The Ziran runtime reports diagnostics through liblog's __android_log_print. + if android { return ifx profile then "library\t-landroid\nlibrary\t-llog\n" else "library\t-lm\nlibrary\t-lz\nlibrary\t-ldl\nlibrary\t-llog\n" } return ifx profile then "pkg-config\tsdl2 cairo freetype2 fontconfig pangocairo gtk+-3.0\nlibrary\t-lX11\n" else "library\t-l:libcurl.so.4\nlibrary\t-lm\nlibrary\t-lpthread\nlibrary\t-lz\nlibrary\t-ldl\n" } // Consumers append these rows in descriptor dependency order; all native @@ -163,7 +164,12 @@ Crypto :: () -> bool { // Hosts run the profile's ZX bundle through this runtime, so it carries // Ziran's instruction engine; a BOOTSTRAP=1 runtime opens no bundle. runtime := Out("runtime") - if !Step("make", "-s", "-j1", "-C", PkgGetenv("ZIRAN_TOOLCHAIN_ROOT"), Flag("BUILD_DIR=", runtime), Flag("CC=", cc), Flag("AR=", ar), ifx web then "CFLAGS=-O2 -sUSE_ZLIB=1" else ifx windows then Flag("CFLAGS=-O2 -I", Package("zlib")) else "CFLAGS=-O2 -fPIC", ifx web then "OBJCOPY=true" else ifx android then Flag("OBJCOPY=", JoinPath(PathParent(cc), "llvm-objcopy")) else ifx windows then Flag("OBJCOPY=", PkgJoin(mingw, "objcopy")) else "", ifx web then "TARGET_MACHINE=wasm32-unknown-emscripten" else ifx android then Flag("TARGET_MACHINE=", ifx abi == "arm64-v8a" then "aarch64-linux-android" else "arm-linux-androideabi") else "", JoinPath(runtime, "libziran.a")) { return false } + // A device runtime's C is generated on this host by the toolchain's own + // zi2c, under the device's target conditions: Linux branches such as + // glibc's __errno_location never reach bionic or MinGW. + generator := ifx android || windows then Flag("GEN_ZI2C=", JoinPath(PkgGetenv("ZIRAN_TOOLCHAIN_ROOT"), "build/bin/zi2c")) else "" + target := ifx windows then "ZIRAN_DEFINES=--target-os windows --target-cpu x64 --define _WIN32 --define __x86_64__" else ifx android && abi == "arm64-v8a" then "ZIRAN_DEFINES=--target-os android --target-cpu arm64 --define __aarch64__" else ifx android then "ZIRAN_DEFINES=--target-os android --target-cpu none --define __arm__" else "" + if !Step("make", "-s", "-j1", "-C", PkgGetenv("ZIRAN_TOOLCHAIN_ROOT"), Flag("BUILD_DIR=", runtime), Flag("CC=", cc), Flag("AR=", ar), generator, target,ifx web then "CFLAGS=-O2 -sUSE_ZLIB=1" else ifx windows then Flag("CFLAGS=-O2 -I", Package("zlib")) else "CFLAGS=-O2 -fPIC", ifx web then "OBJCOPY=true" else ifx android then Flag("OBJCOPY=", JoinPath(PathParent(cc), "llvm-objcopy")) else ifx windows then Flag("OBJCOPY=", PkgJoin(mingw, "objcopy")) else "", ifx web then "TARGET_MACHINE=wasm32-unknown-emscripten" else ifx android then Flag("TARGET_MACHINE=", ifx abi == "arm64-v8a" then "aarch64-linux-android" else "arm-linux-androideabi") else "", JoinPath(runtime, "libziran.a")) { return false } return CopyFile(JoinPath(runtime, "libziran.a"), Out("libziran.a")) && PkgWrite(Out("link.txt"), LinkText(false)) } // Re-root the provider's resolved dependencies without resolving a second lock. diff --git a/ziran.lock b/ziran.lock index 8159f7e..c64c68b 100644 --- a/ziran.lock +++ b/ziran.lock @@ -36,15 +36,6 @@ "source": true, "url": "https://github.com/open-quantum-safe/liboqs.git" }, - { - "commit": "f26a552247e2cd367fd33def6860d903cac6ab8a", - "dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"}, - "dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"}, - "id": "p274c2dd6d03a7c0c", - "name": "avif", - "ref": "f26a552247e2cd367fd33def6860d903cac6ab8a", - "url": "https://github.com/ziranlang/avif.git" - }, { "commit": "ec6ed304767e10c125ab2820f3b01d6fd773e147", "dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"}, @@ -72,6 +63,15 @@ "source": true, "url": "https://github.com/AOMediaCodec/libavif.git" }, + { + "commit": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", + "dependencies": {"libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e"}, + "dependency_refs": {"libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7"}, + "id": "p59deb49c7f103127", + "name": "audio", + "ref": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", + "url": "https://github.com/ziranlang/audio.git" + }, { "commit": "bd278217e2bac754d868b3d6502eac4257658d4b", "dependencies": {"dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa"}, @@ -143,6 +143,15 @@ "source": true, "url": "https://github.com/LoupVaillant/Monocypher.git" }, + { + "commit": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", + "dependencies": {"av1": "p5d7d12505a42f7b3", "dav1d": "pb24767b9eb34d961", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db"}, + "dependency_refs": {"av1": "bd278217e2bac754d868b3d6502eac4257658d4b", "dav1d": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199"}, + "id": "pb203529d803e73a4", + "name": "avif", + "ref": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", + "url": "https://github.com/ziranlang/avif.git" + }, { "commit": "54706fc6bc0cdecab7e9593974a4039cc038fca7", "dependencies": {}, @@ -153,22 +162,13 @@ "url": "https://github.com/videolan/dav1d.git" }, { - "commit": "ce5837f80e8ce6cb8d2d9f77915095d764da3485", - "dependencies": {"dr_libs": "pb7c2dd1c09da0c1c", "libopus": "pe1fe9bbe80bf1d6d", "libsamplerate": "p0dd67588478f9a3e", "stb": "pe4a63e2d6e0424e7"}, - "dependency_refs": {"dr_libs": "f12e197fd462e4c22873fbd70d11b1d2f2c1dc3c", "libopus": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "libsamplerate": "c96f5e3de9c4488f4e6c97f59f5245f22fda22f7", "stb": "9600522de53973336fa033a289858a4354cbb04c"}, - "id": "pb46a53117b2530ce", - "name": "audio", - "ref": "ce5837f80e8ce6cb8d2d9f77915095d764da3485", - "url": "https://github.com/ziranlang/audio.git" - }, - { - "commit": "f12e197fd462e4c22873fbd70d11b1d2f2c1dc3c", - "dependencies": {}, - "id": "pb7c2dd1c09da0c1c", - "name": "dr_libs", - "ref": "f12e197fd462e4c22873fbd70d11b1d2f2c1dc3c", - "source": true, - "url": "https://github.com/mackron/dr_libs.git" + "commit": "3627ea8a90e7f507510dde3cafacd5c74e441932", + "dependencies": {"audio": "p59deb49c7f103127", "avif": "pb203529d803e73a4", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"}, + "dependency_refs": {"audio": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", "avif": "2611e727e226a2af22dfb7f10bf224bd2f1a3d30", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"}, + "id": "pbfc78dfea1032b93", + "name": "kryon", + "ref": "3627ea8a90e7f507510dde3cafacd5c74e441932", + "url": "https://github.com/kryonlabs/kryon.git" }, { "commit": "944826f70779a6b6cd53f6b06a75b36f4d8a2558", @@ -178,15 +178,6 @@ "ref": "master", "url": "https://github.com/ziranlang/crypto.git" }, - { - "commit": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", - "dependencies": {}, - "id": "pcc7aa76725f2fb2f", - "name": "raylib", - "ref": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", - "source": true, - "url": "https://github.com/raysan5/raylib.git" - }, { "commit": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "dependencies": {}, @@ -195,34 +186,16 @@ "ref": "ddbe48383984d56acd9e1ab6a090c54ca6b735a6", "source": true, "url": "https://github.com/xiph/opus.git" - }, - { - "commit": "9600522de53973336fa033a289858a4354cbb04c", - "dependencies": {}, - "id": "pe4a63e2d6e0424e7", - "name": "stb", - "ref": "9600522de53973336fa033a289858a4354cbb04c", - "source": true, - "url": "https://github.com/nothings/stb.git" - }, - { - "commit": "3f72441949d4e16094834fa9220e5d7fa77a0ac0", - "dependencies": {"audio": "pb46a53117b2530ce", "avif": "p274c2dd6d03a7c0c", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"}, - "dependency_refs": {"audio": "ce5837f80e8ce6cb8d2d9f77915095d764da3485", "avif": "f26a552247e2cd367fd33def6860d903cac6ab8a", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"}, - "id": "peb1e86e2b07f33bb", - "name": "kryon", - "ref": "3f72441949d4e16094834fa9220e5d7fa77a0ac0", - "url": "https://github.com/kryonlabs/kryon.git" } ], "root": { - "dependencies": {"curl": "p8da229d15597ab5c", "kryon": "peb1e86e2b07f33bb", "mesh_client": "p8204ae87a845c1c3", "monocypher": "p966a7198f42a3ddc", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p82dbc05081cd4d96"}, - "dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "kryon": "3f72441949d4e16094834fa9220e5d7fa77a0ac0", "mesh_client": "c1ac6095d01bcfdd4c5ae49c4636aaf9a0303449", "monocypher": "master", "oqs": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"}, + "dependencies": {"curl": "p8da229d15597ab5c", "kryon": "pbfc78dfea1032b93", "mesh_client": "p8204ae87a845c1c3", "monocypher": "p966a7198f42a3ddc", "oqs": "p7098ac9cd92f7e5f", "qrcode": "p0dfa70137405b096", "zlib": "p82dbc05081cd4d96"}, + "dependency_refs": {"curl": "19b299005fbe2d895f4ad525cfdae62a2220c3ea", "kryon": "3627ea8a90e7f507510dde3cafacd5c74e441932", "mesh_client": "c1ac6095d01bcfdd4c5ae49c4636aaf9a0303449", "monocypher": "master", "oqs": "master", "qrcode": "master", "zlib": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf"}, "name": "Entity" }, "toolchain": { - "commit": "e0367fa9c5731dcf9bb84ed7f3d294570d8c0bda", - "ref": "e0367fa9c5731dcf9bb84ed7f3d294570d8c0bda", + "commit": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863", + "ref": "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863", "url": "https://github.com/ziranlang/ziran.git" } } diff --git a/ziran.toml b/ziran.toml index b747213..cac3217 100644 --- a/ziran.toml +++ b/ziran.toml @@ -5,11 +5,11 @@ module_roots = ["src", "tests"] [toolchain] git = "https://github.com/ziranlang/ziran.git" -ref = "e0367fa9c5731dcf9bb84ed7f3d294570d8c0bda" +ref = "7fbc8152b0ab18b641a73d16d93ccda1e1c7f863" [dependencies.kryon] git = "https://github.com/kryonlabs/kryon.git" -ref = "3f72441949d4e16094834fa9220e5d7fa77a0ac0" +ref = "3627ea8a90e7f507510dde3cafacd5c74e441932" [exports] canvas_profile_host = "src/canvas_profile_host.zi"