#!/usr/bin/env bash # check-make-shells — assert that apps/backend/Makefile's run/dev/start-debug # and deadcode targets expand to the correct per-shell command line, without # running them. # # The Makefile dispatches on two independent axes: # * EXE suffix — keyed on $(OS): any Windows build (native cmd/PowerShell # OR Git Bash) produces kandev.exe. # * shell syntax — keyed on $(OS)$(MSYSTEM): only native cmd/PowerShell uses # `set VAR=VAL&` + backslash path + no exec; Unix and Git # Bash/MSYS use POSIX `VAR=val exec`. # Git Bash is the trap — it sets OS=Windows_NT yet runs recipes through sh, so # it must take the POSIX branch while keeping the .exe suffix. Conflating the # two axes (the pre-fix bug) made Git Bash emit `set VAR=VAL&` into bash, where # the env var is never exported. # # Each shell is simulated deterministically with make's OS=/MSYSTEM= # command-line overrides, so one host checks the dispatch for all three shells # without having to run on each. The harness itself is bash (grep, sed), so it # needs a POSIX shell — it runs in the Linux CI job and under Git Bash/WSL # locally, not from native cmd.exe/PowerShell. Covers the Make-target dispatch # that the backend Go CI jobs don't exercise. set -euo pipefail backend_dir="$(cd "$(dirname "$0")/../apps/backend" && pwd)" status=0 # expect