Files
breeze/tests/cells_platform_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

48 lines
1.9 KiB
Bash

#!/bin/sh
# Build the same headless typed module host for native or Android API 21.
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$root"
ziran=${1:-build/ziran-toolchain/bin/ziran}
target=${2:-native}
work=$root/build/cells-platform-probe
source=$root/build/packages/ziran
generated=$work/generated-$target
mkdir -p "$generated"
set --
if [ "$target" = android ]; then
set -- --define ANDROID_BUILD --define __arm__
fi
"$ziran" build --target=c --no-main "$@" --root "$root/tests" \
--module-path "$root/src" --module-path "$root/build/packages/kryon/src/ui" --module-path "$root/build/packages/kryon/src/backend" \
$(sh "$root/scripts/package-paths.sh" "$root/build/packages") \
--module-path "$root/build/packages/daochi-client" \
--module-path "$source/std" -o "$generated" \
"$root/tests/cells_platform_probe.zi"
if [ "$target" = android ]; then
sdk=${ANDROID_SDK_ROOT:-/home/wao/Android/Sdk}
ndk=$sdk/ndk/28.2.13676358/toolchains/llvm/prebuilt/linux-x86_64/bin
cc=$ndk/armv7a-linux-androideabi21-clang
runtime=$root/build/bundle-runtime/android32-probe
python3 scripts/build-bundle-runtime.py --source "$source" \
--output "$runtime" --cc "$cc" --ar "$ndk/llvm-ar" \
--objcopy "$ndk/llvm-objcopy" --flags='-O2 -fPIC -D_GNU_SOURCE -std=c11'
binary=$work/android-armv7
elif [ "$target" = native ]; then
cc=${CC:-cc}
runtime=$root/build/ziran-toolchain
binary=$work/native
else
echo "usage: cells_platform_test.sh ZIRAN native|android" >&2
exit 2
fi
"$cc" -D_GNU_SOURCE -std=c11 -O2 -ffunction-sections -fdata-sections \
-I"$source/include" -I"$source/cmd/zir" -iquote "$generated" \
"$root/tests/cells_platform_host.c" "$generated"/*.c \
"$runtime/libziran.a" -Wl,--wrap=tmpfile -Wl,--gc-sections -lm -o "$binary"
if [ "$target" = android ]; then
sh tests/cells_android_probe.sh
else
"$binary" "$root/build/inbe.zib" "$root/build/inbe-full.zib"
fi