Files
ghostty-rs/scripts/windows-crosscheck.sh
T
ddidderr 231ee35ea9 build: add reproducible macOS, Windows and wasm cross-check scripts
The non-Linux code paths can only be compile-checked on this machine;
agents had used ad-hoc wrapper setups. These scripts make the checks
reproducible and are wired into `just check-macos`, `check-windows`,
`check-wasm` and `check-all`:
- macos-crosscheck.sh: zig cc wrappers (dropping -arch/-mmacosx-
  version-min) plus a declaration-only os/log.h stub so the few C build
  scripts compile; clippy -D warnings on all 17 cross-platform crates
  for aarch64/x86_64-apple-darwin.
- windows-crosscheck.sh: mingw toolchain and a stub fontconfig.pc;
  clippy -D warnings for x86_64-pc-windows-gnu.
- wasm-check.sh: wasm32 clippy/build and the node-based wasm tests.

Also fixes a needless_pass_by_value lint in osbytes' non-Unix branch
that only the Windows check surfaces.

Test Plan:
- just check-macos; just check-macos x86_64-apple-darwin
- just check-windows; just check-wasm
2026-10-12 08:16:14 +02:00

23 lines
979 B
Bash
Executable File

#!/usr/bin/env bash
# Compile-check (clippy -D warnings) the Windows code paths from Linux with
# mingw. No linking happens, so a stub fontconfig.pc is enough. See
# docs/rewrite/notes/windows-WIN.md.
set -euo pipefail
cd "$(dirname "$0")/.."
W="$PWD/target/windows-cross"
mkdir -p "$W/pkgconfig"
cat > "$W/pkgconfig/fontconfig.pc" <<'EOS'
Name: fontconfig
Description: stub for cross cargo check
Version: 2.15.0
Libs: -lfontconfig
Cflags:
EOS
export RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH="$W/pkgconfig"
export CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-gcc CXX_x86_64_pc_windows_gnu=x86_64-w64-mingw32-g++ \
AR_x86_64_pc_windows_gnu=x86_64-w64-mingw32-ar
cargo clippy --target x86_64-pc-windows-gnu --lib --tests \
-p ghostty-vt -p ghostty-unicode -p ghostty-datastruct -p ghostty-input -p ghostty-os \
-p ghostty-config -p ghostty-terminal -p ghostty-termio -p ghostty-crash -p ghostty-core \
-p ghostty-cli -- -D warnings