oficina / docs Public

Clone
git clone https://amadan.net/oficina/docs

Plain git — no account needed to clone.

Download

Download this file

1#!/bin/sh
2# Repeatable native engine, wire compatibility, and Apple adapter checks.
3set -eu
4cd "$(dirname "$0")/../.."
5core_only=0
6mutations=0
7for argument in "$@"; do
8 case "$argument" in
9 --core-only) core_only=1 ;;
10 --mutations) mutations=1 ;;
11 *) echo "usage: $0 [--core-only] [--mutations]" >&2; exit 2 ;;
12 esac
13done
14if [ "$core_only" = 0 ] && [ "$(uname -s)" != Darwin ]; then
15 echo "Apple checks require macOS; use --core-only for native engine and wire checks." >&2
16 exit 2
17fi
18if [ -n "${DOCS_LLVM_LIBRARY_PATH:-}" ]; then export DYLD_LIBRARY_PATH="$DOCS_LLVM_LIBRARY_PATH"; fi
19CARGO=${CARGO:-cargo}
20"$CARGO" build --locked --manifest-path native/crdt/Cargo.toml --release --target wasm32-unknown-unknown --lib
21"$CARGO" test --locked --manifest-path native/crdt/Cargo.toml
22"$CARGO" test --locked --manifest-path native/host/Cargo.toml
23
24npm ci --prefix fixtures --ignore-scripts --no-audit --no-fund
25native_check_dir=$(mktemp -d "${TMPDIR:-/tmp}/docs-native-check.XXXXXX")
26trap 'rm -rf "$native_check_dir"' EXIT HUP INT TERM
27"$CARGO" run --locked --quiet --manifest-path native/crdt/Cargo.toml --bin wire_fixture -- "$native_check_dir/native.bin"
28node fixtures/native-wire.mjs "$native_check_dir/native.bin" "$native_check_dir/browser.bin"
29"$CARGO" run --locked --quiet --manifest-path native/crdt/Cargo.toml --bin wire_fixture -- "$native_check_dir/native.bin" "$native_check_dir/browser.bin"
30"$CARGO" run --locked --quiet --manifest-path native/crdt/Cargo.toml --bin rule_wire_probe -- "$native_check_dir/rule"
31node native/scripts/check-rule-wire.mjs "$native_check_dir/rule"
32if [ "$core_only" = 0 ]; then
33 native/scripts/build-crdt.sh
34 swift test --package-path native/apple
35fi
36if [ "$mutations" = 1 ]; then python3 native/scripts/check-mutations.py; fi
37echo "Native checks passed (core-only=$core_only)."
38