Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7854da88e2 |
No files matched your search
@@ -2,8 +2,6 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Use Mesh release APIs and package imports without changing signed release messages or cached catalog formats.
|
||||
|
||||
- Offer each host only node releases it can run: the publisher checks each payload's ZX revision against the ledger, the remote catalog names its revision and oldest host interface, and the node's history keeps the newest release of every format, ZX revision and interface. Publish an optional signed WebAssembly variant of a node app for web hosts.
|
||||
|
||||
- Validate signed package sizes against checked integer ranges instead of a universal 64 MiB limit, and verify public payloads incrementally without weakening signatures or exact digests.
|
||||
|
||||
@@ -151,7 +151,7 @@ position. Legacy Media services retain their existing dispatch and permission
|
||||
policy.
|
||||
|
||||
The native consumer installs its provider once on its owning thread with
|
||||
`MediaAudioUseDesktop()` from `kryon/media_audio_desktop`. Without a provider,
|
||||
`MediaAudioUseRaylib()` from `kryon/media_audio_raylib`. Without a provider,
|
||||
authorized calls return `Unsupported`; device/browser results retain Kryon's
|
||||
`Unavailable`/`Suspended` semantics. Apps supplies each actual `HostedApp.audio`
|
||||
owner and `AppHostAudioRead` to `WidgetHostAudioCall`, using the active node's
|
||||
@@ -280,7 +280,7 @@ verifies public package imports and launcher search/grouping.
|
||||
copy, one transfer at a time and waiting 1 s, doubling to 60 s, between attempts.
|
||||
`python3 tests/art_host_test.py /path/to/libziran.a` serves a real HTTP failure,
|
||||
then decodes the recovered art's pixels without a display.
|
||||
- `python3 tests/audio_host_test.py /path/to/libziran.a`
|
||||
exercises real hosted guests with dummy/no-provider hosts and Kryon's desktop
|
||||
mixer on SDL's private dummy device. Run `tests/native_fixture.py`, `tests/consumer_test.py` and
|
||||
- `RAYLIB_A=/path/to/libraylib.a python3 tests/audio_host_test.py /path/to/libziran.a`
|
||||
exercises real hosted guests with dummy/no-provider and private null-device
|
||||
Raylib hosts. Run `tests/native_fixture.py`, `tests/consumer_test.py` and
|
||||
`tests/tree_test.sh` with the same resolved compiler/runtime graph too.
|
||||
@@ -1,6 +1,6 @@
|
||||
#import "apps/host"
|
||||
Hash :: #import "crypto/sha256";
|
||||
Mesh :: #import "mesh_client/crypto";
|
||||
Daochi :: #import "daochi_client/crypto";
|
||||
#import "std/c_string"
|
||||
#import "std/text_buffer"
|
||||
|
||||
@@ -11,19 +11,19 @@ Check :: () -> s32 {
|
||||
input: [3]u8 = .[97, 98, 99]
|
||||
first: [32]u8; second: [32]u8
|
||||
first_hex: [65]u8; second_hex: [65]u8
|
||||
Hash.Sha256(*input[0], 3, *first[0]); Mesh.Sha256(*input[0], 3, *second[0])
|
||||
Hash.Sha256(*input[0], 3, *first[0]); Daochi.Sha256(*input[0], 3, *second[0])
|
||||
if Hash.BytesToHex(*first[0], 32, *first_hex[0], 65) != 1 ||
|
||||
Mesh.BytesToHex(*second[0], 32, *second_hex[0], 65) != 1 ||
|
||||
Daochi.BytesToHex(*second[0], 32, *second_hex[0], 65) != 1 ||
|
||||
TextUntilNul(first_hex[:]) != known || TextUntilNul(second_hex[:]) != known { return 2 }
|
||||
Hash.Sha256Hex(*input[0], 3, *first_hex[0]); Mesh.Sha256Hex(*input[0], 3, *second_hex[0])
|
||||
Hash.Sha256Hex(*input[0], 3, *first_hex[0]); Daochi.Sha256Hex(*input[0], 3, *second_hex[0])
|
||||
if TextUntilNul(first_hex[:]) != known || TextUntilNul(second_hex[:]) != known { return 3 }
|
||||
if Hash.HexToBytes(known, *first[0], 32) != 1 || Mesh.HexToBytes(known, *second[0], 32) != 1 { return 4 }
|
||||
if Hash.HexToBytes(known, *first[0], 32) != 1 || Daochi.HexToBytes(known, *second[0], 32) != 1 { return 4 }
|
||||
key: [3]u8 = .[107, 101, 121]
|
||||
if Hash.HmacSha256(*key[0], 3, *input[0], 3, *first[0]) != 1 ||
|
||||
Mesh.HmacSha256(*key[0], 3, *input[0], 3, *second[0]) != 1 { return 5 }
|
||||
Daochi.HmacSha256(*key[0], 3, *input[0], 3, *second[0]) != 1 { return 5 }
|
||||
for at: cast(s32)0..31 { if first[at] != second[at] { return 6 } }
|
||||
if Hash.HmacSha256Text(*key[0], 3, "abc", *first[0]) != 1 ||
|
||||
Mesh.HmacSha256Text(*key[0], 3, "abc", *second[0]) != 1 { return 7 }
|
||||
Daochi.HmacSha256Text(*key[0], 3, "abc", *second[0]) != 1 { return 7 }
|
||||
for at: cast(s32)0..31 { if first[at] != second[at] { return 8 } }
|
||||
return 0
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Sign, check and publish the Mesh releases of apps the node offers.
|
||||
"""Sign, check and publish the Daochi releases of apps the node offers.
|
||||
|
||||
The node serves each app as signed release v2 metadata beside its immutable
|
||||
ZX portable executable. ZX hosts ask the node with format=zx and the ZX
|
||||
@@ -591,7 +591,7 @@ def publish_node_app(store, name, target, remote_store, app_id=None):
|
||||
if not re.fullmatch(r"[a-zA-Z0-9_.@-]+", target) or target.startswith("-"):
|
||||
raise ValueError("invalid SSH target")
|
||||
if not remote_store.startswith("/") or "\n" in remote_store:
|
||||
raise ValueError("Mesh package store must be an absolute path")
|
||||
raise ValueError("Daochi package store must be an absolute path")
|
||||
with tempfile.TemporaryDirectory(prefix="inbe-upload-") as staging:
|
||||
archive = Path(staging) / "packages.tar"
|
||||
directory = store / (app_id or "inbe." + name)
|
||||
|
||||
+27
-27
@@ -13,7 +13,7 @@
|
||||
#import "kryon/http_transfer"
|
||||
#import "catalog"
|
||||
#import "protocol"
|
||||
Release :: #import "mesh_client/release";
|
||||
Release :: #import "daochi_client/release";
|
||||
|
||||
APP_REMOTE_METADATA_LIMIT :: 65536
|
||||
APP_REMOTE_CATALOG_LIMIT :: 262144
|
||||
@@ -35,7 +35,7 @@ AppRemoteSource :: struct {
|
||||
AppRemoteCatalog :: struct {
|
||||
source: AppRemoteSource
|
||||
files: *AppFiles
|
||||
verify: Release.MeshReleaseVerify
|
||||
verify: Release.DaochiReleaseVerify
|
||||
allowed: bool
|
||||
failed: bool
|
||||
changed: bool
|
||||
@@ -46,14 +46,14 @@ AppRemoteCatalog :: struct {
|
||||
response: [APP_REMOTE_METADATA_LIMIT + 1]u8
|
||||
allocation: *u8
|
||||
pending_metadata: string
|
||||
pending_release: Release.MeshRelease
|
||||
pending_release: Release.DaochiRelease
|
||||
metadata: string
|
||||
bytes: string
|
||||
release: Release.MeshRelease
|
||||
release: Release.DaochiRelease
|
||||
// Retained until the consumer stops using its previous root collection.
|
||||
previous_metadata: string
|
||||
previous_bytes: string
|
||||
previous_release: Release.MeshRelease
|
||||
previous_release: Release.DaochiRelease
|
||||
}
|
||||
|
||||
remote_memory :: #system_library "c";
|
||||
@@ -81,12 +81,12 @@ AppRemoteOriginValid :: (origin: string) -> bool {
|
||||
|
||||
AppRemoteSourceValid :: (source: *AppRemoteSource) -> bool {
|
||||
return source != null && AppRemoteOriginValid(TextUntilNul(source.origin[:])) &&
|
||||
Release.MeshIdentifierValid(TextUntilNul(source.app_id[:])) &&
|
||||
Release.MeshIdentifierValid(TextUntilNul(source.key_id[:])) &&
|
||||
Release.MeshHashValid(TextUntilNul(source.public_key[:])) &&
|
||||
source.oldest_host_api > 0 && source.oldest_host_api <= source.host_api &&
|
||||
source.host_api <= 65535 && source.module_api > 0 && source.module_api <= 65535 &&
|
||||
source.minimum_sequence >= 0 && source.minimum_sequence <= 2147483647
|
||||
Release.DaochiIdentifierValid(TextUntilNul(source.app_id[:])) &&
|
||||
Release.DaochiIdentifierValid(TextUntilNul(source.key_id[:])) &&
|
||||
Release.DaochiHashValid(TextUntilNul(source.public_key[:])) &&
|
||||
source.oldest_host_api > 0 && source.oldest_host_api <= source.host_api &&
|
||||
source.host_api <= 65535 && source.module_api > 0 && source.module_api <= 65535 &&
|
||||
source.minimum_sequence >= 0 && source.minimum_sequence <= 2147483647
|
||||
}
|
||||
|
||||
AppRemoteSourceRead :: (json: string, at: s32, source: *AppRemoteSource) -> bool {
|
||||
@@ -100,13 +100,13 @@ AppRemoteSourceRead :: (json: string, at: s32, source: *AppRemoteSource) -> bool
|
||||
if cast(float64)source.minimum_sequence != number.value { return false }
|
||||
}
|
||||
return AppsReadText(json, at, "origin", source.origin[:]) &&
|
||||
AppsReadText(json, at, "app_id", source.app_id[:]) &&
|
||||
AppsReadText(json, at, "key_id", source.key_id[:]) &&
|
||||
AppsReadText(json, at, "public_key", source.public_key[:]) && AppRemoteSourceValid(source)
|
||||
AppsReadText(json, at, "app_id", source.app_id[:]) &&
|
||||
AppsReadText(json, at, "key_id", source.key_id[:]) &&
|
||||
AppsReadText(json, at, "public_key", source.public_key[:]) && AppRemoteSourceValid(source)
|
||||
}
|
||||
|
||||
AppRemoteParse :: (remote: *AppRemoteCatalog, metadata: string) -> Release.MeshRelease {
|
||||
signed := Release.MeshParseRelease(metadata, TextUntilNul(remote.source.public_key[:]),
|
||||
AppRemoteParse :: (remote: *AppRemoteCatalog, metadata: string) -> Release.DaochiRelease {
|
||||
signed := Release.DaochiParseRelease(metadata, TextUntilNul(remote.source.public_key[:]),
|
||||
67108864, remote.verify)
|
||||
if !signed.valid || TextUntilNul(signed.app_id[:]) != TextUntilNul(remote.source.app_id[:]) ||
|
||||
TextUntilNul(signed.key_id[:]) != TextUntilNul(remote.source.key_id[:]) ||
|
||||
@@ -115,7 +115,7 @@ AppRemoteParse :: (remote: *AppRemoteCatalog, metadata: string) -> Release.MeshR
|
||||
signed.module_api != remote.source.module_api || signed.data_schema != 0 ||
|
||||
signed.dependency_count != 0 || signed.sequence < remote.source.minimum_sequence ||
|
||||
signed.artifacts[0].size > APP_REMOTE_CATALOG_LIMIT {
|
||||
return Release.MeshRelease.{}
|
||||
return Release.DaochiRelease.{}
|
||||
}
|
||||
return signed
|
||||
}
|
||||
@@ -132,16 +132,16 @@ AppRemoteRead :: (files: *AppFiles, name: string, maximum: s64) -> string {
|
||||
return AppFileRead(files, name)
|
||||
}
|
||||
|
||||
AppRemotePayloadName :: (release: *Release.MeshRelease) -> string {
|
||||
AppRemotePayloadName :: (release: *Release.DaochiRelease) -> string {
|
||||
name: Vec(u8)
|
||||
BuilderPrint(*name, "%.zx", TextUntilNul(release.artifacts[0].sha256[:]))
|
||||
return BuilderFinish(name)
|
||||
}
|
||||
|
||||
AppRemoteCollectionValid :: (remote: *AppRemoteCatalog, bytes: string,
|
||||
release: *Release.MeshRelease) -> bool {
|
||||
release: *Release.DaochiRelease) -> bool {
|
||||
if !release.valid || bytes.count != release.artifacts[0].size ||
|
||||
!Release.MeshSha256Matches(bytes, TextUntilNul(release.artifacts[0].sha256[:])) { return false }
|
||||
!Release.DaochiSha256Matches(bytes, TextUntilNul(release.artifacts[0].sha256[:])) { return false }
|
||||
opened: HostedApp
|
||||
if !HostedAppOpen(*opened, bytes) { return false }
|
||||
defer { HostedAppClose(*opened) }
|
||||
@@ -154,7 +154,7 @@ AppRemoteCollectionValid :: (remote: *AppRemoteCatalog, bytes: string,
|
||||
// No network request is made here. Invalid cache bytes remain unexecuted.
|
||||
// The AppFiles namespace belongs to this one configured collection.
|
||||
AppRemoteCatalogOpen :: (remote: *AppRemoteCatalog, source: AppRemoteSource,
|
||||
files: *AppFiles, verify: Release.MeshReleaseVerify) -> bool {
|
||||
files: *AppFiles, verify: Release.DaochiReleaseVerify) -> bool {
|
||||
if remote == null || remote.files != null || files == null || verify == null ||
|
||||
!AppRemoteSourceValid(*source) { return false }
|
||||
remote.source = source
|
||||
@@ -184,7 +184,7 @@ AppRemoteCancelTransfer :: (remote: *AppRemoteCatalog) {
|
||||
if remote.allocation != null { AppRemoteFree(remote.allocation); remote.allocation = null }
|
||||
AppFileFree(remote.pending_metadata)
|
||||
remote.pending_metadata = ""
|
||||
remote.pending_release = Release.MeshRelease.{}
|
||||
remote.pending_release = Release.DaochiRelease.{}
|
||||
remote.stage = 0
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ AppRemoteFail :: (remote: *AppRemoteCatalog) {
|
||||
remote.failed = true
|
||||
}
|
||||
|
||||
AppRemoteAccept :: (remote: *AppRemoteCatalog, release: Release.MeshRelease,
|
||||
AppRemoteAccept :: (remote: *AppRemoteCatalog, release: Release.DaochiRelease,
|
||||
metadata: string, bytes: string) -> bool {
|
||||
name := AppRemotePayloadName(*release)
|
||||
defer { AppFileFree(name) }
|
||||
@@ -271,7 +271,7 @@ AppRemoteCatalogPump :: (remote: *AppRemoteCatalog) {
|
||||
signed := AppRemoteParse(remote, metadata)
|
||||
if !signed.valid || (remote.ready && (signed.sequence < remote.release.sequence ||
|
||||
(signed.sequence == remote.release.sequence &&
|
||||
TextUntilNul(signed.artifacts[0].sha256[:]) != TextUntilNul(remote.release.artifacts[0].sha256[:])))) {
|
||||
TextUntilNul(signed.artifacts[0].sha256[:]) != TextUntilNul(remote.release.artifacts[0].sha256[:])))) {
|
||||
AppFileFree(metadata)
|
||||
AppRemoteFail(remote)
|
||||
return
|
||||
@@ -320,7 +320,7 @@ AppRemoteCatalogCollect :: (remote: *AppRemoteCatalog) {
|
||||
AppFileFree(remote.previous_bytes)
|
||||
remote.previous_metadata = ""
|
||||
remote.previous_bytes = ""
|
||||
remote.previous_release = Release.MeshRelease.{}
|
||||
remote.previous_release = Release.DaochiRelease.{}
|
||||
remote.changed = false
|
||||
AppRemotePruneCache(remote)
|
||||
}
|
||||
@@ -347,7 +347,7 @@ AppRemotePruneCache :: (remote: *AppRemoteCatalog) {
|
||||
if !entry.valid { break }
|
||||
name := TextUntilNul(entry.name[:])
|
||||
if (entry.kind != .Regular && entry.kind != .Unknown) || name.count != 67 ||
|
||||
name[64:] != ".zx" || !Release.MeshHashValid(name[:64]) ||
|
||||
name[64:] != ".zx" || !Release.DaochiHashValid(name[:64]) ||
|
||||
name[:64] == current_hash || (fallback.valid && name[:64] == previous_hash) { continue }
|
||||
// AppFiles validates every component and refuses symbolic links.
|
||||
path := AppFilePath(remote.files, name, false)
|
||||
@@ -366,7 +366,7 @@ AppRemoteCatalogRestore :: (remote: *AppRemoteCatalog) -> bool {
|
||||
remote.release = remote.previous_release
|
||||
remote.previous_metadata = ""
|
||||
remote.previous_bytes = ""
|
||||
remote.previous_release = Release.MeshRelease.{}
|
||||
remote.previous_release = Release.DaochiRelease.{}
|
||||
remote.changed = false
|
||||
remote.failed = true
|
||||
return restored
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
#import "kryon/hosted_app"
|
||||
#import "kryon/hosted_values"
|
||||
#import "kryon/file_download"
|
||||
#import "kryon/image_pixels"
|
||||
#import "std/image"
|
||||
#import "std/vec"
|
||||
#import "art_decode"
|
||||
transfer: FileDownload;
|
||||
requests: s32;
|
||||
bundle_calls: s32;
|
||||
@@ -25,6 +23,8 @@ libc :: #system_library "libc";
|
||||
PreparationTestBegin :: () #foreign libc;
|
||||
PreparationTestYield :: () #foreign libc;
|
||||
PreparationTestNow :: () -> float64 #foreign libc;
|
||||
art_raylib :: #system_library "raylib";
|
||||
ArtUnloadImage :: (image: RaylibGlyphImage) #foreign art_raylib "UnloadImage";
|
||||
rejected: s32;
|
||||
cached: string;
|
||||
ArtBundle :: (context: *void, parent: *AppNode, entry: *AppEntry) -> HostedAsset {
|
||||
@@ -93,14 +93,12 @@ ArtCheck :: () -> s32 {
|
||||
PreparationTestYield()
|
||||
}
|
||||
if !preview.found || requests != 4 { return 7 }
|
||||
// Decode the recovered bytes through Kryon's actual desktop CPU decoder,
|
||||
// which reads a file, then inspect its straight RGBA pixel data.
|
||||
decoded := FixtureEnvironment("APPS_ART_PREVIEW")
|
||||
if !WriteEntireFile(decoded, preview.data) { return 8 }
|
||||
image := LoadImagePixels(decoded)
|
||||
if image.width != 1 || image.height != 1 || image.pixels.count != 4 { VecFree(image.pixels); return 8 }
|
||||
correct := image.pixels[0] == 40 && image.pixels[1] == 160 && image.pixels[2] == 100 && image.pixels[3] == 255
|
||||
VecFree(image.pixels)
|
||||
// Decode through Kryon's actual native CPU decoder, then inspect pixel data.
|
||||
image := RaylibDecodePixels(preview.data, ".png")
|
||||
if image.data == null || image.width != 1 || image.height != 1 || image.format != 4 { return 8 }
|
||||
pixel := cast(*u8)image.data
|
||||
correct := pixel[0] == 40 && pixel[1] == 160 && pixel[2] == 100
|
||||
ArtUnloadImage(image)
|
||||
if !correct { return 9 }
|
||||
FileDownloadRelease(*transfer)
|
||||
if !SlimStop(*host) { return 10 }
|
||||
|
||||
+21
-8
@@ -5,6 +5,7 @@ import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
@@ -47,12 +48,14 @@ def main():
|
||||
(assets / 'preview.png').unlink()
|
||||
(assets / 'apps/apps.zx').unlink()
|
||||
native.bundle('collection', root, assets)
|
||||
toolchain = Path(subprocess.check_output(
|
||||
[native.ZIRAN, 'pkg', 'path', 'ziran'], cwd=ROOT, text=True).strip())
|
||||
toolchain, kryon, raylib = [Path(subprocess.check_output(
|
||||
[native.ZIRAN, 'pkg', 'path', name], cwd=ROOT, text=True).strip())
|
||||
for name in ('ziran', 'kryon', 'raylib')]
|
||||
mapping = WORK / 'module-map.tsv'
|
||||
lines = (ROOT / 'build/.ziran/module-map.tsv').read_text().splitlines()
|
||||
lines += ['M\troot\tnative_behavior\t' + str(ROOT / 'tests/native_behavior.zi'),
|
||||
'M\troot\tart_host_behavior\t' + str(ROOT / 'tests/art_host_behavior.zi')]
|
||||
'M\troot\tart_host_behavior\t' + str(ROOT / 'tests/art_host_behavior.zi'),
|
||||
'D\troot\tart_decode\t' + kryon.name + '\traylib_image_decode']
|
||||
mapping.write_text('\n'.join(lines) + '\n')
|
||||
os.environ['ZIRAN_PACKAGE_MAP'] = str(mapping)
|
||||
output = WORK / 'c'
|
||||
@@ -63,15 +66,26 @@ def main():
|
||||
'int main(void) { int r=ArtCheck(); if(r) fprintf(stderr,"Apps art test %d failed\\n",r); return r?1:0; }\n')
|
||||
includes = [arg for p in [output, *sorted(output.rglob('*'))] if p.is_dir() for arg in ('-iquote', str(p))]
|
||||
cc = os.environ.get('CC', 'cc')
|
||||
# Kryon's desktop decoder loads the system GdkPixbuf on first use; no
|
||||
# window or graphics context exists.
|
||||
# Only Raylib's CPU image decoder is linked; no window or graphics context exists.
|
||||
support = WORK / 'raylib_support.c'
|
||||
support.write_text('#include <stdlib.h>\n'
|
||||
'void TraceLog(int level, const char *text, ...) { (void)level; (void)text; }\n'
|
||||
'void *MemAlloc(unsigned int size) { return calloc(size, 1); }\n'
|
||||
'void *MemRealloc(void *data, unsigned int size) { return realloc(data, size); }\n'
|
||||
'void MemFree(void *data) { free(data); }\n'
|
||||
'const char *rlGetPixelFormatName(unsigned int format) { (void)format; return ""; }\n')
|
||||
decoder = WORK / 'rtextures.o'
|
||||
run(cc, '-O1', '-ffunction-sections', '-fdata-sections', '-I' + str(raylib / 'src'),
|
||||
'-c', raylib / 'src/rtextures.c', '-o', decoder)
|
||||
executable = WORK / 'test'
|
||||
webp_libs = shlex.split(subprocess.check_output(
|
||||
['pkg-config', '--libs', 'libwebpdemux', 'libwebp'], text=True))
|
||||
run(cc, '-std=c11', '-O1', '-ffunction-sections', '-fdata-sections',
|
||||
'-I' + str(toolchain / 'include'), *includes, *sorted(output.rglob('*.c')),
|
||||
ROOT / 'tests/preparation_host.c', sys.argv[1],
|
||||
ROOT / 'tests/preparation_host.c', support, sys.argv[1], decoder,
|
||||
'-Wl,--gc-sections', '-Wl,--wrap=BundleOpenBytes',
|
||||
'-Wl,--wrap=BundleInstantiate', '-Wl,--wrap=BundleInstanceRun', '-Wl,--wrap=BundleClose',
|
||||
'-ldl', '-lm', '-lpthread', '-o', executable)
|
||||
*webp_libs, '-lm', '-lpthread', '-o', executable)
|
||||
class Handler(http.server.BaseHTTPRequestHandler):
|
||||
calls = 0
|
||||
def do_GET(self):
|
||||
@@ -93,7 +107,6 @@ def main():
|
||||
thread.start()
|
||||
env = dict(os.environ, APPS_ART_URL=f'http://127.0.0.1:{server.server_port}/art.zx',
|
||||
APPS_ART_DESTINATION=str(WORK / 'download.zx'),
|
||||
APPS_ART_PREVIEW=str(WORK / 'preview.png'),
|
||||
APPS_FIXTURE_SLIM_ROOT_BUNDLE=str(root), APPS_FIXTURE_SLIM_ROOT_SHA256=native.digest(root),
|
||||
APPS_FIXTURE_UI_BUNDLE=str(controller), APPS_FIXTURE_HARNESS_SHA256=native.digest(controller))
|
||||
try:
|
||||
|
||||
@@ -27,7 +27,7 @@ Node :: #import "node_types";
|
||||
#import "kryon/media_audio"
|
||||
#import "kryon/media_audio_host"
|
||||
#if #defined(APPS_AUDIO_NATIVE_TEST) {
|
||||
#import "kryon/media_audio_desktop"
|
||||
#import "kryon/media_audio_raylib"
|
||||
}
|
||||
using HostValueKind;
|
||||
using FrameStatus;
|
||||
@@ -85,7 +85,7 @@ AudioDummy :: (voice: *MediaAudioVoice, command: MediaAudioCommand, bytes: strin
|
||||
}
|
||||
AudioInstall :: () {
|
||||
#if #defined(APPS_AUDIO_NATIVE_TEST) {
|
||||
MediaAudioUseDesktop()
|
||||
MediaAudioUseRaylib()
|
||||
} else {
|
||||
MediaAudioUseProvider(AudioDummy)
|
||||
}
|
||||
|
||||
@@ -64,6 +64,14 @@ def main():
|
||||
os.environ['APPS_AUDIO_' + kind + '_SHA256'] = native.digest(path)
|
||||
toolchain = Path(subprocess.check_output([ZIRAN, 'pkg', 'path', 'ziran'], cwd=ROOT, text=True).strip())
|
||||
kryon = Path(subprocess.check_output([ZIRAN, 'pkg', 'path', 'kryon'], cwd=ROOT, text=True).strip())
|
||||
raylib = Path(os.environ['RAYLIB_A'])
|
||||
# Use Raylib's actual decoder/mixer with miniaudio's paced null backend.
|
||||
# ALSA null consumes without pacing and cannot verify a playback clock.
|
||||
audio_source = raylib.parent / 'source/raudio.c'
|
||||
null_audio = WORK / 'null-audio.o'
|
||||
run(os.environ.get('CC', 'cc'), '-O1', '-ffunction-sections', '-fdata-sections',
|
||||
'-DMA_ENABLE_ONLY_SPECIFIC_BACKENDS', '-DMA_ENABLE_NULL',
|
||||
'-I' + str(audio_source.parent), '-c', audio_source, '-o', null_audio)
|
||||
# Like consumer_test.py, extend the actual resolved package map only for
|
||||
# test entry modules outside the package's published module roots.
|
||||
mapping = WORK / 'module-map.tsv'
|
||||
@@ -84,9 +92,7 @@ def main():
|
||||
includes = [arg for p in [output, *sorted(output.rglob('*'))] if p.is_dir() for arg in ('-iquote', str(p))]
|
||||
libs = []
|
||||
if actual:
|
||||
# Kryon's desktop mixer pulls through its SDL sink; SDL's dummy
|
||||
# driver paces that pull like a device clock and opens no device.
|
||||
libs = subprocess.check_output(['pkg-config', '--libs', 'sdl2', 'opus'], text=True).split()
|
||||
libs = [str(null_audio), str(raylib), *subprocess.check_output(['pkg-config', '--libs', 'sdl2', 'libdrm', 'gbm', 'egl', 'glesv2', 'opus'], text=True).split(), '-ldl']
|
||||
executable = WORK / 'test'
|
||||
run(os.environ.get('CC', 'cc'), '-std=c11', '-O1', '-ffunction-sections', '-fdata-sections',
|
||||
'-I' + str(toolchain / 'include'), *includes, *sorted(output.rglob('*.c')),
|
||||
@@ -104,7 +110,7 @@ def main():
|
||||
if result.returncode:
|
||||
print((result.stdout + result.stderr)[-6000:])
|
||||
result.check_returncode()
|
||||
print('Apps audio: ' + ('actual desktop mixer/SDL dummy device' if actual else 'dummy/no provider') + ' passed')
|
||||
print('Apps audio: ' + ('actual Raylib/null device' if actual else 'dummy/no provider') + ' passed')
|
||||
print('Apps audio package: ' + str(kryon))
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Link actual Apps and Mesh Client against an explicit canonical Crypto source.
|
||||
"""Link actual Apps and DaochiClient against an explicit canonical Crypto source.
|
||||
|
||||
No package checkout, generated-code patch or consumer lock edit is involved.
|
||||
The independent fixture uses real package-qualified imports on retained IR55.
|
||||
@@ -18,7 +18,7 @@ def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("runtime", type=Path)
|
||||
parser.add_argument("--crypto-source", type=Path, required=True)
|
||||
parser.add_argument("--mesh-source", type=Path, required=True)
|
||||
parser.add_argument("--daochi-source", type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
for name in ("DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "DBUS_SESSION_BUS_ADDRESS"):
|
||||
os.environ.pop(name, None)
|
||||
@@ -30,14 +30,14 @@ def main():
|
||||
package = "p0000000000000001"
|
||||
crypto_id = next(row.split("\t")[3] for row in mapping_rows if row.startswith("D\troot\tcrypto/sha256\t"))
|
||||
old_crypto = next(row.split("\t")[2] for row in mapping_rows if row.startswith("P\t" + crypto_id + "\t"))
|
||||
# Keep the resolved Mesh identity and its dependency edges when testing
|
||||
# Keep the resolved Daochi identity and its dependency edges when testing
|
||||
# another source root; the same file cannot be a second package module.
|
||||
mesh_id = next(row.split("\t")[3] for row in mapping_rows
|
||||
if row.startswith("D\troot\tmesh_client/crypto\t"))
|
||||
old_mesh = next(row.split("\t")[2] for row in mapping_rows
|
||||
if row.startswith("P\t" + mesh_id + "\t"))
|
||||
dao_id = next(row.split("\t")[3] for row in mapping_rows
|
||||
if row.startswith("D\troot\tdaochi_client/crypto\t"))
|
||||
old_dao = next(row.split("\t")[2] for row in mapping_rows
|
||||
if row.startswith("P\t" + dao_id + "\t"))
|
||||
sources = [(old_crypto, args.crypto_source.resolve()),
|
||||
(old_mesh, args.mesh_source.resolve())]
|
||||
(old_dao, args.daochi_source.resolve())]
|
||||
for row in mapping_rows:
|
||||
fields = row.split("\t")
|
||||
if len(fields) > 1 and fields[1] == "root":
|
||||
@@ -68,7 +68,7 @@ def main():
|
||||
"-I" + str(toolchain / "include"), *includes, *map(str, sorted(output.rglob("*.c"))),
|
||||
str(args.runtime.resolve()), "-Wl,--gc-sections", "-lm", "-lpthread", "-o", str(WORK / "test")], check=True)
|
||||
subprocess.run([str(WORK / "test")], check=True)
|
||||
print("IR55 external Apps + Mesh Client + Crypto native link and unchanged SHA256/hex/HMAC APIs passed")
|
||||
print("IR55 external Apps + DaochiClient + Crypto native link and unchanged SHA256/hex/HMAC APIs passed")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
+73
-46
@@ -20,22 +20,13 @@
|
||||
"url": "https://github.com/libsdl-org/SDL.git"
|
||||
},
|
||||
{
|
||||
"commit": "d99d9e9802061f726773a0f89d15ec4ed3366957",
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "oqs": "p7098ac9cd92f7e5f"},
|
||||
"dependency_refs": {"crypto": "master", "oqs": "master"},
|
||||
"id": "p26a11bcd81564528",
|
||||
"name": "mesh_client",
|
||||
"ref": "d99d9e9802061f726773a0f89d15ec4ed3366957",
|
||||
"url": "https://git.waozi.xyz/ziranlang/mesh-client.git"
|
||||
},
|
||||
{
|
||||
"commit": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
|
||||
"dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"},
|
||||
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
|
||||
"id": "p2af20e0c835b1c63",
|
||||
"name": "webp",
|
||||
"ref": "ec6ed304767e10c125ab2820f3b01d6fd773e147",
|
||||
"url": "https://github.com/ziranlang/webp.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": "1844042d1ca751e62e61df7617dba19c98588339",
|
||||
@@ -46,15 +37,6 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/webmproject/libwebp.git"
|
||||
},
|
||||
{
|
||||
"commit": "f5f186bb13569ef13338f81366ff63fb9b9282f6",
|
||||
"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": "p3ed49c5d0912e411",
|
||||
"name": "avif",
|
||||
"ref": "f5f186bb13569ef13338f81366ff63fb9b9282f6",
|
||||
"url": "https://github.com/ziranlang/avif.git"
|
||||
},
|
||||
{
|
||||
"commit": "1aadfad932c98c069a1204261b1856f81f3bc199",
|
||||
"dependencies": {},
|
||||
@@ -64,15 +46,6 @@
|
||||
"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"},
|
||||
@@ -90,6 +63,15 @@
|
||||
"ref": "360553150917f352e49e1beb78917370792ccaef",
|
||||
"url": "https://github.com/ziranlang/image-codec.git"
|
||||
},
|
||||
{
|
||||
"commit": "970d5e44b1702158cb16469892da6ff50f142427",
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "oqs": "p7098ac9cd92f7e5f"},
|
||||
"dependency_refs": {"crypto": "master", "oqs": "master"},
|
||||
"id": "p6af0b5bd9fd0cd31",
|
||||
"name": "DaochiClient",
|
||||
"ref": "970d5e44b1702158cb16469892da6ff50f142427",
|
||||
"url": "https://github.com/ziranlang/daochi-client.git"
|
||||
},
|
||||
{
|
||||
"commit": "22d2ddbdc236796953c905a05a2cebf5ab1b4ff3",
|
||||
"dependencies": {"liboqs": "p983c695d118b6109"},
|
||||
@@ -108,6 +90,15 @@
|
||||
"source": true,
|
||||
"url": "https://aomedia.googlesource.com/aom"
|
||||
},
|
||||
{
|
||||
"commit": "1b290f19aa1a4069c908a4687f04458c58a2b658",
|
||||
"dependencies": {"audio": "pb46a53117b2530ce", "avif": "p274c2dd6d03a7c0c", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "raylib": "pcc7aa76725f2fb2f", "sdl3": "p16cd0434af3dff7b", "webp": "pa068bd09450b2a80"},
|
||||
"dependency_refs": {"audio": "ce5837f80e8ce6cb8d2d9f77915095d764da3485", "avif": "f26a552247e2cd367fd33def6860d903cac6ab8a", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "raylib": "fafa2cea97d0cb379d832086ba45a989fa6f9c8e", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "02145a00a1f0df2a111da04a75f3fef260883897"},
|
||||
"id": "p8f647d8005d4c2a7",
|
||||
"name": "kryon",
|
||||
"ref": "1b290f19aa1a4069c908a4687f04458c58a2b658",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "e77d81dab791c13bf1c4e5d9a7160c403be9bbe0",
|
||||
"dependencies": {},
|
||||
@@ -117,6 +108,15 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/open-quantum-safe/liboqs.git"
|
||||
},
|
||||
{
|
||||
"commit": "02145a00a1f0df2a111da04a75f3fef260883897",
|
||||
"dependencies": {"image_codec": "p69c0e968ae5735d9", "libwebp": "p3b3c785a0e17e605"},
|
||||
"dependency_refs": {"image_codec": "360553150917f352e49e1beb78917370792ccaef", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339"},
|
||||
"id": "pa068bd09450b2a80",
|
||||
"name": "webp",
|
||||
"ref": "02145a00a1f0df2a111da04a75f3fef260883897",
|
||||
"url": "https://github.com/ziranlang/webp.git"
|
||||
},
|
||||
{
|
||||
"commit": "54706fc6bc0cdecab7e9593974a4039cc038fca7",
|
||||
"dependencies": {},
|
||||
@@ -126,6 +126,24 @@
|
||||
"source": true,
|
||||
"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": "944826f70779a6b6cd53f6b06a75b36f4d8a2558",
|
||||
"dependencies": {},
|
||||
@@ -134,6 +152,15 @@
|
||||
"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": {},
|
||||
@@ -144,23 +171,23 @@
|
||||
"url": "https://github.com/xiph/opus.git"
|
||||
},
|
||||
{
|
||||
"commit": "609be370592f0c6e617ad5fca8774069aef16dc5",
|
||||
"dependencies": {"audio": "p59deb49c7f103127", "avif": "p3ed49c5d0912e411", "image_codec": "p69c0e968ae5735d9", "libaom": "p74ab3cb6eb3b86fa", "libavif": "p57c0272208aae8db", "libwebp": "p3b3c785a0e17e605", "sdl3": "p16cd0434af3dff7b", "webp": "p2af20e0c835b1c63"},
|
||||
"dependency_refs": {"audio": "1b2f35b7b39df6fb9af7a52324b4b7cf18e98df2", "avif": "f5f186bb13569ef13338f81366ff63fb9b9282f6", "image_codec": "360553150917f352e49e1beb78917370792ccaef", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "ec6ed304767e10c125ab2820f3b01d6fd773e147"},
|
||||
"id": "pfd7050febfef3900",
|
||||
"name": "kryon",
|
||||
"ref": "609be370592f0c6e617ad5fca8774069aef16dc5",
|
||||
"url": "https://git.waozi.xyz/kryonlabs/kryon.git"
|
||||
"commit": "9600522de53973336fa033a289858a4354cbb04c",
|
||||
"dependencies": {},
|
||||
"id": "pe4a63e2d6e0424e7",
|
||||
"name": "stb",
|
||||
"ref": "9600522de53973336fa033a289858a4354cbb04c",
|
||||
"source": true,
|
||||
"url": "https://github.com/nothings/stb.git"
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "kryon": "pfd7050febfef3900", "mesh_client": "p26a11bcd81564528"},
|
||||
"dependency_refs": {"crypto": "master", "kryon": "609be370592f0c6e617ad5fca8774069aef16dc5", "mesh_client": "d99d9e9802061f726773a0f89d15ec4ed3366957"},
|
||||
"dependencies": {"crypto": "pc23fbf455e97614d", "daochi_client": "p6af0b5bd9fd0cd31", "kryon": "p8f647d8005d4c2a7"},
|
||||
"dependency_refs": {"crypto": "master", "daochi_client": "970d5e44b1702158cb16469892da6ff50f142427", "kryon": "1b290f19aa1a4069c908a4687f04458c58a2b658"},
|
||||
"name": "Apps"
|
||||
},
|
||||
"toolchain": {
|
||||
"commit": "3432c0ca263e855cd6d1627d1e42e70749f5aa0b",
|
||||
"ref": "3432c0ca263e855cd6d1627d1e42e70749f5aa0b",
|
||||
"url": "https://git.waozi.xyz/ziranlang/ziran.git"
|
||||
"commit": "d17c7aa1e093066ef03f307a45f6966dd9b29d4b",
|
||||
"ref": "d17c7aa1e093066ef03f307a45f6966dd9b29d4b",
|
||||
"url": "https://github.com/ziranlang/ziran.git"
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -3,8 +3,8 @@ name = "Apps"
|
||||
module_roots = ["src", "ui", "fixtures"]
|
||||
|
||||
[toolchain]
|
||||
git = "https://git.waozi.xyz/ziranlang/ziran.git"
|
||||
ref = "3432c0ca263e855cd6d1627d1e42e70749f5aa0b"
|
||||
git = "https://github.com/ziranlang/ziran.git"
|
||||
ref = "d17c7aa1e093066ef03f307a45f6966dd9b29d4b"
|
||||
|
||||
[exports]
|
||||
game_hud = "src/game_hud.zi"
|
||||
@@ -24,13 +24,13 @@ node_app = "src/node_app.zi"
|
||||
node_codec = "src/node_codec.zi"
|
||||
|
||||
[dependencies.kryon]
|
||||
git = "https://git.waozi.xyz/kryonlabs/kryon.git"
|
||||
ref = "609be370592f0c6e617ad5fca8774069aef16dc5"
|
||||
git = "https://github.com/kryonlabs/kryon.git"
|
||||
ref = "1b290f19aa1a4069c908a4687f04458c58a2b658"
|
||||
|
||||
[dependencies.crypto]
|
||||
git = "https://github.com/ziranlang/crypto.git"
|
||||
ref = "master"
|
||||
|
||||
[dependencies.mesh_client]
|
||||
git = "https://git.waozi.xyz/ziranlang/mesh-client.git"
|
||||
ref = "d99d9e9802061f726773a0f89d15ec4ed3366957"
|
||||
[dependencies.daochi_client]
|
||||
git = "https://github.com/ziranlang/daochi-client.git"
|
||||
ref = "970d5e44b1702158cb16469892da6ff50f142427"
|
||||
Reference in new issue
Block a user