mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-15 13:22:19 +01:00
macOS cannot be built or linked on the Linux host; the way to type-check it is
`cargo check --target aarch64-apple-darwin --all-targets` with a fake C compiler so the
C -sys crates' build scripts succeed. That compiler was only a scratchpad file outside the
repository and mac-check.sh hardcoded a workspace path.
tools/cc-fake.sh: verbatim copy of the scratchpad cc-fake.sh (emits an empty object for
every compile, hands -E to the real gcc). No difference.
tools/mac-check.sh: new copy of the old script with these differences:
- no hardcoded `cd /home/jado/komomono-work/ws-step4/komorebi-for-mac`: the root comes from
`jj root` (fallback `git rev-parse --show-toplevel`);
- the fake CC is `$HERE/cc-fake.sh` (next to the script) instead of `$S/kfm/cc-fake.sh`;
- the target dir is `${FAST_CHECK_SCRATCH:-${XDG_CACHE_HOME:-$HOME/.cache}/komorebi-fast-check}/target-fast-mac`
instead of a /tmp/claude-1000 scratchpad;
- in the merged tree (komorebi-for-kde has its own Cargo.toml only in the old layout) it checks the
packages fast-check checks (-p komorebi -p komorebi-macos -p komorebic-macos
-p komorebi-client-macos -p komorebi-bar-macos) from the root; with the old separate workspace it
keeps `cd komorebi-for-mac` and --workspace;
- /bin/sh became bash with `set -euo pipefail`; the old script's omission of --locked is kept
(pass it as an extra argument).
Verified: bash -n and shellcheck clean. Not run: the check itself needs nix and the toolchain build.
13 lines
415 B
Bash
Executable File
13 lines
415 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# check-only hack: emit an empty object for every compile so C -sys build scripts "succeed"
|
|
out=""; prev=""; compile=0
|
|
for a in "$@"; do
|
|
[ "$prev" = "-o" ] && out="$a"
|
|
[ "$a" = "-c" ] && compile=1
|
|
[ "$a" = "-E" ] && { exec gcc "${@}" ; }
|
|
case "$a" in -Fo*) out="${a#-Fo}";; esac
|
|
prev="$a"
|
|
done
|
|
if [ $compile = 1 ] && [ -n "$out" ]; then exec gcc -x c -c /dev/null -o "$out"; fi
|
|
exit 0
|