ziran.toml and ziran.lock pin the Ziran toolchain, Kryon, Game2D, the Daochi client, and the C libraries (as source packages) at the commits the vendor submodules used. scripts/packages.sh bootstraps the locked toolchain, runs ziran fetch, and links each checkout under build/packages/; make, Gradle, and CI run it before building. make package-check replaces no-vendor-edits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
25 lines
1.0 KiB
Bash
25 lines
1.0 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
bin=${1:-"$root/build/ziran-toolchain/bin"}
|
|
work=$(mktemp -d "$root/build/patterns-session-test.XXXXXX")
|
|
trap 'rm -rf "$work"' EXIT HUP INT TERM
|
|
source=$root/tests/patterns_session_behavior.zi
|
|
|
|
"$bin/zi2zir" --check-only --root "$root/tests" \
|
|
--module-path "$root/src" --module-path "$root/build/packages/kryon/src/ui" \
|
|
--module-path "$root/build/packages/ziran/std" "$source"
|
|
"$bin/zi2c" --no-main --root "$root/tests" \
|
|
--module-path "$root/src" --module-path "$root/build/packages/kryon/src/ui" \
|
|
--module-path "$root/build/packages/ziran/std" -o "$work/c" "$source"
|
|
cat > "$work/c/main.c" <<'C'
|
|
#include "patterns_session_behavior.h"
|
|
int main(void) { return Answer() == 42 ? 0 : 1; }
|
|
C
|
|
"${CC:-cc}" -std=c11 -ffunction-sections -fdata-sections \
|
|
-Wl,--gc-sections -I"$root/build/packages/ziran/include" \
|
|
-I"$work/c" "$work/c"/*.c -o "$work/test"
|
|
env -u DISPLAY -u WAYLAND_DISPLAY "$work/test"
|
|
echo "Patterns session Ziran test passed"
|