Files
breeze/tests/lumi_delegate_scope_zi_test.sh
T
waozi f25b4dfd5e Build Apps and Crypto as locked packages and take the node-app ABI from Apps
Apps and Crypto are now ordinary Ziran dependencies, pinned in ziran.lock
and linked by scripts/packages.sh, instead of local checkouts handed to the
build. Every dependency and the toolchain are on their latest revisions.

scripts/package-paths.sh is the one list of NAME=DIR package paths; the
native, web, Windows and Android builds, the source check, the bundle
scripts and the tests all use it, so they resolve packages the same way.
The shared Apps controller bundle is built from the locked Apps package,
and its reviewed digest matches that build.

Node apps, the feature cells and the host import the module ABI and the
node-app types and codec from the Apps package. Inner Breeze no longer
keeps its own copies, its codec generator, or the unused protocol module.

Test hosts include zir_string.h for the string helpers they call.
2026-10-18 23:20:13 -03:00

40 lines
2.2 KiB
Bash

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
compiler=${1:-"${ZIRAN_BIN:-"$root/build/ziran-toolchain/bin/ziran"}"}
launcher=$compiler
ziran_dir=$(cd "$root" && "$launcher" pkg path ziran)
monocypher=$(cd "$root" && "$launcher" pkg path monocypher)
liboqs=${2:-"$root/vendor-builds/linux/x86_64/inbe-liboqs/lib/liboqs.a"}
work=$(mktemp -d /tmp/inbe-lumi-delegate-scope.XXXXXX)
trap 'rm -rf "$work"' EXIT HUP INT TERM
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
export YUE_DESKTOP_RECOVERY=0
"$compiler" build --target=c --define PLATFORM_DESKTOP --root "$root/tests" \
--module-path "$root/src" --module-path "$root/build/packages/kryon/src/ui" \
--module-path "$root/build/packages/kss/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" --entry lumi_delegate_scope_behavior:Check \
-o "$work/generated" "$root/tests/lumi_delegate_scope_behavior.zi" "$root/tests/sync_test_host.zi" "$root/tests/delegate_account_host.zi"
cat > "$work/generated/main.c" <<'C'
#include "lumi_delegate_scope_behavior.h"
#include <stdio.h>
#include <stdint.h>
// Only installed-bundle host facts are synthetic; no fake bundle is called.
int32_t __wrap_CellsInstalledMask(void) { return 1 | 2 | 8 | 16; }
int main(void) {
int result = Check();
if (result) fprintf(stderr, "Lumi delegated scope check failed with code %d\n", result);
return result ? 1 : 0;
}
C
"${CC:-cc}" -std=c11 -O0 -ffunction-sections -fdata-sections \
-I"$ziran_dir/include" -I"$work/generated" -I"$root/vendor-builds/sqlite" \
-I"$root/vendor-builds/linux/x86_64/inbe-liboqs/include" -I"$monocypher/src" \
"$work/generated"/*.c "$root/vendor-builds/sqlite/sqlite3.c" \
"$monocypher/src/monocypher.c" "$monocypher/src/optional/monocypher-ed25519.c" "$liboqs" \
-Wl,--gc-sections -Wl,--wrap=CellsInstalledMask -ldl -lpthread -lm -o "$work/test"
APP_DATA_ROOT="$work/data" "$work/test"
printf '%s\n' 'Lumi delegated history scope, private tools, expiry and owner policy checks passed'