diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f392ec5..1e7ad72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,3 +88,33 @@ jobs: file "$binary" test "$(lipo -archs "$binary")" = arm64 otool -L "$binary" + + native-app: + name: Native app build and smoke + runs-on: macos-26 + timeout-minutes: 20 + env: + CARGO_BUILD_JOBS: 3 + RUSTUP_TOOLCHAIN: 1.100.0-aarch64-apple-darwin + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Verify runner architecture + run: | + uname -m + test "$(uname -m)" = arm64 + test "$(sysctl -n sysctl.proc_translated)" = 0 + - name: Install native Rust + run: | + rustup toolchain install "$RUSTUP_TOOLCHAIN" --profile minimal + rustc -vV + - name: Show Swift and Xcode + run: | + xcodebuild -version + swift --version + # Builds the locked C ABI library and the Swift app together, checks the + # executable is arm64-only and links only system libraries, and runs + # `--smoke`. This is an app build and smoke result, not GPU verification. + - name: Build BetterXen.app and run its smoke check + run: scripts/build-app.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 321161a..018fd0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ remains unsupported. - Added a Python 3 fallback for `timeout` in `scripts/test-gpu.sh`, so the native Metal suite runs on stock macOS without GNU coreutils while preserving bounded execution and the usual timeout exit status. ### Added +- Added a `Native app build and smoke` CI job (#248). On the same native `macos-26` runner image and pinned Rust toolchain as the Rust checks, it runs `scripts/build-app.sh`, which builds the locked C ABI library and the Swift app together, bundles and ad-hoc signs `BetterXen.app`, and runs its `--smoke` check, so a Swift compile, link or smoke failure is designed to fail CI (implemented and verified locally; not yet shown on a CI run). `scripts/build-app.sh` also prints `file` and a single `otool -L` listing for the executable, fails if that listing fails or is empty, and fails if the executable links any library outside `/System/Library/` and `/usr/lib/`, naming bundle-relative (`@rpath`, `@executable_path`, `@loader_path`) entries separately (checked locally against stubbed failing, empty, bundle-relative and non-system listings). The job is an app build and smoke result; it runs no Metal fixture and is not GPU verification. - Recorded the migrated PR integration decisions, native verification and scope exclusions in the testing documentation. - Added `xenora-bench startup` (#178), which measures Metal startup in fresh processes and in repeated submissions within one process, phase by phase (launch, device and queue, translation, library, pipeline, diff --git a/scripts/build-app.sh b/scripts/build-app.sh index 19fe502..e5e16a7 100755 --- a/scripts/build-app.sh +++ b/scripts/build-app.sh @@ -54,5 +54,22 @@ codesign --force --sign - "$bundle" binary="$bundle/Contents/MacOS/BetterXen" [ "$(lipo -archs "$binary")" = arm64 ] || fail "executable is not arm64-only: $(lipo -archs "$binary")" +file "$binary" +# Only system libraries may be linked: anything else would be a host dependency +# shipped or expected outside macOS, which this bundle does not carry. List the +# dependencies once, print that listing and check the same output. +dependencies=$(otool -L "$binary") || fail "otool -L failed for $binary" +printf '%s\n' "$dependencies" +dependencies=$(printf '%s\n' "$dependencies" | tail -n +2 | awk '{print $1}') +# Every Swift executable links at least libSystem, so an empty list is an error. +[ -n "$dependencies" ] || fail "otool -L listed no dependencies for $binary" +for dependency in $dependencies; do + case "$dependency" in + /System/Library/*|/usr/lib/*) ;; + @rpath/*|@executable_path/*|@loader_path/*) + fail "executable links a bundle-relative library, but this bundle ships none: $dependency" ;; + *) fail "executable links a non-system library: $dependency" ;; + esac +done "$binary" --smoke echo "build-app: built $bundle"