Skip to content

Commit 38f96a8

Browse files
committed
ci: verify default V3 dispatch on macOS
1 parent fadcb35 commit 38f96a8

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/macos_ci.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ jobs:
4141
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
4242
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
4343
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
44-
# V3 is the default compiler on macOS; disable the V3->V1 fallback for the
45-
# whole job so a V3 regression fails CI directly — including when it stops
46-
# ci/macos_ci.vsh itself (compiled by `v run`) from building. The setenv at
47-
# the end of that script is too late to guard its own compilation.
44+
# V3 is the default compiler on macOS; disable the V3->V1 fallback for every
45+
# eligible V3 build so a regression fails CI directly. The `.vsh` runner is
46+
# intentionally compiled by V1; the canary below verifies V3 dispatch itself.
4847
V_MACOS_V3_NO_FALLBACK: 1
4948
steps:
5049
- uses: actions/checkout@v7
@@ -56,14 +55,22 @@ jobs:
5655
restore-keys: |
5756
brew-${{ matrix.os }}-
5857
- name: Build V
59-
# `make`'s post-bootstrap `v run` helpers (e.g. .github/problem-matchers/
60-
# register_all.vsh) are not buildable by V3 yet and legitimately fall back to V1;
61-
# without clearing the job-wide no-fallback guard for this bootstrap step that
62-
# fallback would become a hard build failure. Later steps keep the guard, so V3 is
63-
# still enforced where it must build the program.
58+
# `make` runs bootstrap helpers before the V3 canary; `.vsh` helpers intentionally
59+
# use V1, and other helpers may need the compatibility fallback. Clear the guard
60+
# for this bootstrap step; later eligible builds and the canary retain it.
6461
env:
6562
V_MACOS_V3_NO_FALLBACK: 0
6663
run: make -j4 && ./v symlink
64+
- name: Assert V3 is the default compiler (fail if V1 is silently used)
65+
run: |
66+
set -uo pipefail
67+
printf 'fn main() { println(6 * 7) }\n' > "$RUNNER_TEMP/v3_canary.v"
68+
V_MACOS_V3_NO_FALLBACK=1 ./v -v run "$RUNNER_TEMP/v3_canary.v" > "$RUNNER_TEMP/v3_canary.out" 2>&1 || true
69+
cat "$RUNNER_TEMP/v3_canary.out"
70+
grep -q 'V3 compiler in process' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::V3 was NOT dispatched on macOS — the program was compiled by V1'; exit 1; }
71+
grep -qx '42' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::the V3-compiled canary did not build/run correctly'; exit 1; }
72+
if grep -qiE 'retrying with .-old-compiler|compatibility fallback|used the stable compiler' "$RUNNER_TEMP/v3_canary.out"; then echo '::error::V3 silently fell back to V1'; exit 1; fi
73+
echo 'OK: V3 compiled and ran this program in-process on macOS, with the fallback disabled'
6774
- name: Pkg-config regressions (Clang, no static executable)
6875
run: |
6976
set -euo pipefail

0 commit comments

Comments
 (0)