Files
komorebi/tools/mac-check.sh
T
LGUG2Z f7f444efb6 build(tools): tools, justfile and scripts name the outputs of the one flake
fast-check classifies the paths of the final directories (komorebi-linux, komorebi-macos,
komorebi-hotkeys, nix/{windows,linux,macos}, docs and schemas per platform), runs the Linux
check from the repository root and evaluates one check and one package per platform in the
root flake; kde-closure-check reads nix/linux/root-crates.json and compares it with the cargo
tree of the Linux packages (the listed crates besides komorebi-linux, komorebi-hotkeys and
komorebi-daemon); mac-check.sh drops the nested-workspace branch; e2e-needed treats nix/windows,
nix/workspace-src.nix, nix/lib.nix and nix/common.nix as fixed inputs of the Windows binaries
and the Linux and macOS trees as outside them; build-ref.sh builds `windows-NAME` for a REF with
the one-flake layout and keeps the old names for an older REF with its own flake. The justfile
names linux-nix-options-validation and runs a VM suite as legacyPackages.<system>.vm.NAME
(the vm-* checks are heavyChecks for now). scripts/linux/{run-kde,vm-mac,sync-e2e-core,
scenario-status} find the repository root and the VM library from scripts/linux/ and nix/linux/
(on the rebase onto wip-cutover-all the coordinator versions of run-kde, vm-mac and
scenario-status were kept: same change).

Not touched: scripts/linux/compare-gen.py, a migration comparison between the three old trees
that still looks for komorebi-for-mac/ (obsolete; open).

Verified: bash -n on the changed scripts; tools/kde-closure-check passes (14 root crates);
tools/fast-check --list classifies this revision as nix-only. fast-check commands for the
platforms were not run.
2026-11-05 15:03:27 -08:00

19 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# usage: tools/mac-check.sh [extra cargo args]
# Type-check of the macOS code on Linux (target aarch64-apple-darwin) through the fake C compiler
# tools/cc-fake.sh. Cannot link or run anything. Same command as the macOS step of tools/fast-check, but
# unconditional. Run from anywhere inside the repository; uses FAST_CHECK_SCRATCH like fast-check.
set -euo pipefail
S="${FAST_CHECK_SCRATCH:-${XDG_CACHE_HOME:-$HOME/.cache}/komorebi-fast-check}"
HERE="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
ROOT="$(jj root 2>/dev/null || git rev-parse --show-toplevel)"
cd "$ROOT"
# the macOS packages of the one workspace of the repository
PKGS=(-p komorebi -p komorebi-macos -p komorebic -p komorebi-client -p komorebi-bar)
export CARGO_TARGET_DIR="$S/target-fast-mac" COMMIT_HASH="${COMMIT_HASH:-dev}"
export CC_aarch64_apple_darwin="$HERE/cc-fake.sh" AR_aarch64_apple_darwin=ar
PKG_CONFIG_PATH="$(nix build --no-link --print-out-paths nixpkgs#openssl.dev)/lib/pkgconfig"
export PKG_CONFIG_PATH
exec nix shell nixpkgs#gcc nixpkgs#pkg-config nixpkgs#openssl.dev -c \
cargo check --target aarch64-apple-darwin "${PKGS[@]}" --all-targets "$@"