mirror of
https://github.com/block/buzz.git
synced 2026-11-08 10:21:46 +00:00
fix: enforce stable Xcode in desktop dev recipes
Signed-off-by: Tom Brow <tomb@block.xyz>
This commit is contained in:
@@ -14,7 +14,7 @@ STUB
|
||||
cat > "$fixture/bin/xcodebuild" <<'STUB'
|
||||
#!/usr/bin/env bash
|
||||
[[ "${TEST_XCODE:-}" != broken ]] || exit 1
|
||||
printf 'Xcode %s\nBuild version fixture\n' "$TEST_XCODE"
|
||||
printf 'Xcode %s\nBuild version %s\n' "$TEST_XCODE" "${TEST_XCODE_BUILD:-27A266a}"
|
||||
STUB
|
||||
chmod +x "$fixture/bin/"*
|
||||
export PATH="$fixture/bin:$PATH"
|
||||
@@ -27,6 +27,25 @@ for TEST_XCODE in 26.6 27.1 '27.0 beta' broken ''; do
|
||||
export TEST_XCODE
|
||||
if check; then echo "Accepted wrong Xcode: $TEST_XCODE" >&2; exit 1; fi
|
||||
done
|
||||
TEST_XCODE=27.0
|
||||
if TEST_XCODE_BUILD=27A123b check; then echo 'Accepted prerelease build' >&2; exit 1; fi
|
||||
# Run the real standalone recipe body in an isolated fixture. It must reject
|
||||
# the compiler before starting cargo or any desktop/device work.
|
||||
{
|
||||
printf "desktop_dir := 'desktop'\nmesh := ''\nfresh := ''\n"
|
||||
awk '/^desktop-standalone \*ARGS:/ { active=1; print "desktop-standalone *ARGS:"; next } active && /^$/ { exit } active { print }' "$root/Justfile"
|
||||
} > "$fixture/Justfile"
|
||||
cat > "$fixture/bin/cargo" <<'STUB'
|
||||
#!/usr/bin/env bash
|
||||
echo 'Native build started before Xcode validation' >&2
|
||||
exit 99
|
||||
STUB
|
||||
chmod +x "$fixture/bin/cargo"
|
||||
if TEST_XCODE=26.5 "$root/bin/just" --justfile "$fixture/Justfile" desktop-standalone >"$fixture/recipe.log" 2>&1; then
|
||||
echo 'Standalone recipe accepted wrong Xcode' >&2; exit 1
|
||||
fi
|
||||
grep -q 'Buzz requires Xcode' "$fixture/recipe.log"
|
||||
if grep -q 'Native build started' "$fixture/recipe.log"; then cat "$fixture/recipe.log"; exit 1; fi
|
||||
printf 'latest\n' > "$fixture/.xcode-version"
|
||||
if check; then echo 'Accepted invalid pin' >&2; exit 1; fi
|
||||
TEST_OS=Linux check
|
||||
|
||||
Reference in New Issue
Block a user