Skip to content

Commit d4d133d

Browse files
committed
merge: resolve multiwindow conflicts with current master
2 parents 70a0027 + c5aa74c commit d4d133d

138 files changed

Lines changed: 12803 additions & 929 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/linux_ci.yml

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ on:
66
branches:
77
- master
88
paths-ignore:
9-
- 'vlib/v3/**'
9+
# vlib/v3/** is intentionally NOT ignored: V3 is the default compiler on
10+
# Linux, so changes to it must run this suite (with the fallback disabled).
1011
- '**.md'
1112
- '**.yml'
1213
- '!**/linux_ci.yml'
1314
- 'cmd/tools/**'
1415
- '!cmd/tools/builders/**.v'
1516
pull_request:
1617
paths-ignore:
17-
- 'vlib/v3/**'
18+
# vlib/v3/** is intentionally NOT ignored: V3 is the default compiler on
19+
# Linux, so changes to it must run this suite (with the fallback disabled).
1820
- '**.md'
1921
- '**.yml'
2022
- '!**/linux_ci.yml'
@@ -34,11 +36,33 @@ jobs:
3436
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
3537
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
3638
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
39+
# V3 is the default compiler on Linux; disable the V3->V1 fallback for every
40+
# eligible V3 build so a regression fails CI directly. The `.vsh` runner is
41+
# intentionally compiled by V1; the canary below verifies V3 dispatch itself.
42+
V_MACOS_V3_NO_FALLBACK: 1
3743
steps:
3844
- uses: actions/checkout@v7.0.1
3945
- uses: ./.github/actions/cache-apt-packages-action
4046
- name: Build v
47+
# `make` runs bootstrap helpers before the V3 canary: detect_tcc.v may need the
48+
# compatibility fallback, while register_all.vsh intentionally uses V1. Clear the
49+
# guard for this bootstrap step; later eligible builds and the canary retain it.
50+
env:
51+
V_MACOS_V3_NO_FALLBACK: 0
4152
run: make -j4 && ./v symlink
53+
- name: Assert V3 is the default compiler (fail if V1 is silently used)
54+
run: |
55+
set -uo pipefail
56+
# A monumental default-compiler change should be provable, not assumed:
57+
# this canary fails loudly if V3 is NOT actually dispatched on Linux
58+
# (i.e. the build silently used V1), or if V3 silently fell back to V1.
59+
printf 'fn main() { println(6 * 7) }\n' > "$RUNNER_TEMP/v3_canary.v"
60+
V_MACOS_V3_NO_FALLBACK=1 ./v -v run "$RUNNER_TEMP/v3_canary.v" > "$RUNNER_TEMP/v3_canary.out" 2>&1 || true
61+
cat "$RUNNER_TEMP/v3_canary.out"
62+
grep -q 'V3 compiler in process' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::V3 was NOT dispatched on Linux — the program was compiled by V1, so the default-compiler change is a no-op'; exit 1; }
63+
grep -qx '42' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::the V3-compiled canary did not build/run correctly'; exit 1; }
64+
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
65+
echo 'OK: V3 compiled and ran this program in-process on Linux, with the fallback disabled'
4266
- name: Pkg-config regression (TCC dynamic isolation)
4367
run: ./v -cc tcc -no-retry-compilation test vlib/v/checker/pkgconfig_static_mode_test.v
4468
- name: Build v with -prealloc
@@ -62,6 +86,11 @@ jobs:
6286
- name: Self tests
6387
run: v run ci/linux_ci.vsh self_tests_tcc
6488
- name: Build examples
89+
# The examples corpus includes deliberate inline-assembly compatibility
90+
# cases, so exercise the documented V3-to-V1 fallback in this lane. The
91+
# canary and dedicated V3 suites above remain strict.
92+
env:
93+
V_MACOS_V3_NO_FALLBACK: 0
6594
run: v run ci/linux_ci.vsh build_examples_tcc
6695
- name: Run the submodule example, using a relative path
6796
run: v run ci/linux_ci.vsh run_submodule_example_tcc
@@ -95,11 +124,30 @@ jobs:
95124
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
96125
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
97126
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
127+
# V3 is the default compiler on Linux; disable the V3->V1 fallback for every
128+
# eligible V3 build so a regression fails CI directly. The `.vsh` runner is
129+
# intentionally compiled by V1; the canary below verifies V3 dispatch itself.
130+
V_MACOS_V3_NO_FALLBACK: 1
98131
steps:
99132
- uses: actions/checkout@v7.0.1
100133
- uses: ./.github/actions/cache-apt-packages-action
101134
- name: Build V
135+
# `make` runs bootstrap helpers before the V3 canary: detect_tcc.v may need the
136+
# compatibility fallback, while register_all.vsh intentionally uses V1. Clear the
137+
# guard for this bootstrap step; later eligible builds and the canary retain it.
138+
env:
139+
V_MACOS_V3_NO_FALLBACK: 0
102140
run: make -j4 && ./v symlink
141+
- name: Assert V3 is the default compiler (fail if V1 is silently used)
142+
run: |
143+
set -uo pipefail
144+
printf 'fn main() { println(6 * 7) }\n' > "$RUNNER_TEMP/v3_canary.v"
145+
V_MACOS_V3_NO_FALLBACK=1 ./v -v run "$RUNNER_TEMP/v3_canary.v" > "$RUNNER_TEMP/v3_canary.out" 2>&1 || true
146+
cat "$RUNNER_TEMP/v3_canary.out"
147+
grep -q 'V3 compiler in process' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::V3 was NOT dispatched on Linux — the program was compiled by V1, so the default-compiler change is a no-op'; exit 1; }
148+
grep -qx '42' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::the V3-compiled canary did not build/run correctly'; exit 1; }
149+
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
150+
echo 'OK: V3 compiled and ran this program in-process on Linux, with the fallback disabled'
103151
- name: Pkg-config regressions (GCC)
104152
run: |
105153
set -euo pipefail
@@ -442,6 +490,11 @@ jobs:
442490
EOF
443491
chmod +x "$RUNNER_TEMP/multiwindow_weston_command.sh"
444492
- name: Multiwindow portable and mock regressions
493+
# These regressions intentionally cover compatibility paths that V3 does not
494+
# support yet. Keep the direct canary and ordinary compiler suite strict, while
495+
# allowing this lane to verify that the stable-compiler fallback still works.
496+
env:
497+
V_MACOS_V3_NO_FALLBACK: 0
445498
run: |
446499
set -euo pipefail
447500
@@ -483,6 +536,7 @@ jobs:
483536
/tmp/gg_multiwindow_default
484537
- name: Multiwindow X11 native regressions
485538
env:
539+
V_MACOS_V3_NO_FALLBACK: 0
486540
VGG_MULTIWINDOW_RUNTIME_PROBES: '1'
487541
VGG_MULTIWINDOW_RUNTIME_BACKEND: x11
488542
VGG_MULTIWINDOW_EXAMPLE_UNATTENDED: x11
@@ -532,6 +586,7 @@ jobs:
532586
/tmp/gg_multiwindow_x11
533587
- name: Multiwindow Wayland native regressions
534588
env:
589+
V_MACOS_V3_NO_FALLBACK: 0
535590
VGG_MULTIWINDOW_RUNTIME_PROBES: '1'
536591
VGG_MULTIWINDOW_RUNTIME_BACKEND: wayland
537592
VGG_MULTIWINDOW_EXAMPLE_UNATTENDED: wayland
@@ -597,6 +652,11 @@ jobs:
597652
- name: Self tests (-cstrict)
598653
run: v run ci/linux_ci.vsh self_tests_cstrict_gcc
599654
- name: Build examples
655+
# The examples corpus includes deliberate inline-assembly compatibility
656+
# cases, so exercise the documented V3-to-V1 fallback in this lane. The
657+
# canary and dedicated V3 suites above remain strict.
658+
env:
659+
V_MACOS_V3_NO_FALLBACK: 0
600660
run: v run ci/linux_ci.vsh build_examples_gcc
601661
- name: Build tetris with -autofree
602662
run: v run ci/linux_ci.vsh build_tetris_autofree_gcc
@@ -621,11 +681,30 @@ jobs:
621681
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
622682
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
623683
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
684+
# V3 is the default compiler on Linux; disable the V3->V1 fallback for every
685+
# eligible V3 build so a regression fails CI directly. The `.vsh` runner is
686+
# intentionally compiled by V1; the canary below verifies V3 dispatch itself.
687+
V_MACOS_V3_NO_FALLBACK: 1
624688
steps:
625689
- uses: actions/checkout@v7.0.1
626690
- uses: ./.github/actions/cache-apt-packages-action
627691
- name: Build V
692+
# `make` runs bootstrap helpers before the V3 canary: detect_tcc.v may need the
693+
# compatibility fallback, while register_all.vsh intentionally uses V1. Clear the
694+
# guard for this bootstrap step; later eligible builds and the canary retain it.
695+
env:
696+
V_MACOS_V3_NO_FALLBACK: 0
628697
run: make -j4 && ./v symlink
698+
- name: Assert V3 is the default compiler (fail if V1 is silently used)
699+
run: |
700+
set -uo pipefail
701+
printf 'fn main() { println(6 * 7) }\n' > "$RUNNER_TEMP/v3_canary.v"
702+
V_MACOS_V3_NO_FALLBACK=1 ./v -v run "$RUNNER_TEMP/v3_canary.v" > "$RUNNER_TEMP/v3_canary.out" 2>&1 || true
703+
cat "$RUNNER_TEMP/v3_canary.out"
704+
grep -q 'V3 compiler in process' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::V3 was NOT dispatched on Linux — the program was compiled by V1, so the default-compiler change is a no-op'; exit 1; }
705+
grep -qx '42' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::the V3-compiled canary did not build/run correctly'; exit 1; }
706+
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
707+
echo 'OK: V3 compiled and ran this program in-process on Linux, with the fallback disabled'
629708
- name: Pkg-config regressions (Clang)
630709
run: |
631710
set -euo pipefail
@@ -662,6 +741,11 @@ jobs:
662741
- name: Self tests (-cstrict)
663742
run: v run ci/linux_ci.vsh self_tests_cstrict_clang
664743
- name: Build examples
744+
# The examples corpus includes deliberate inline-assembly compatibility
745+
# cases, so exercise the documented V3-to-V1 fallback in this lane. The
746+
# canary and dedicated V3 suites above remain strict.
747+
env:
748+
V_MACOS_V3_NO_FALLBACK: 0
665749
run: v run ci/linux_ci.vsh build_examples_clang
666750
- name: Build examples with -autofree
667751
run: v run ci/linux_ci.vsh build_examples_autofree_clang

.github/workflows/macos_ci.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ on:
66
branches:
77
- master
88
paths-ignore:
9-
- 'vlib/v3/**'
9+
# vlib/v3/** is intentionally NOT ignored: V3 is the default compiler on
10+
# macOS, so changes to it must run this suite (with the fallback disabled).
1011
- '**.md'
1112
- '**.yml'
1213
- '!**/macos_ci.yml'
1314
- 'cmd/tools/**'
1415
- '!cmd/tools/builders/**.v'
1516
pull_request:
1617
paths-ignore:
17-
- 'vlib/v3/**'
18+
# vlib/v3/** is intentionally NOT ignored: V3 is the default compiler on
19+
# macOS, so changes to it must run this suite (with the fallback disabled).
1820
- '**.md'
1921
- '**.yml'
2022
- '!**/macos_ci.yml'
@@ -29,7 +31,9 @@ jobs:
2931
clang-macos:
3032
strategy:
3133
matrix:
32-
os: [macos-14]
34+
# V3 (vlib/v3, `-new-compiler`) is the default compiler on macOS, so
35+
# exercise it on every arm64 (Apple-silicon) runner image, not just one.
36+
os: [macos-14, macos-15, macos-26]
3337
fail-fast: false
3438
runs-on: ${{ matrix.os }}
3539
timeout-minutes: 151
@@ -38,6 +42,10 @@ jobs:
3842
VTEST_SHOW_LONGEST_BY_RUNTIME: 3
3943
VTEST_SHOW_LONGEST_BY_COMPTIME: 3
4044
VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
45+
# V3 is the default compiler on macOS; disable the V3->V1 fallback for every
46+
# eligible V3 build so a regression fails CI directly. The `.vsh` runner is
47+
# intentionally compiled by V1; the canary below verifies V3 dispatch itself.
48+
V_MACOS_V3_NO_FALLBACK: 1
4149
steps:
4250
- uses: actions/checkout@v7.0.1
4351
- name: Cache Homebrew downloads
@@ -48,7 +56,22 @@ jobs:
4856
restore-keys: |
4957
brew-${{ matrix.os }}-
5058
- name: Build V
59+
# `make` runs bootstrap helpers before the V3 canary; `.vsh` helpers intentionally
60+
# use V1, and other helpers may need the compatibility fallback. Clear the guard
61+
# for this bootstrap step; later eligible builds and the canary retain it.
62+
env:
63+
V_MACOS_V3_NO_FALLBACK: 0
5164
run: make -j4 && ./v symlink
65+
- name: Assert V3 is the default compiler (fail if V1 is silently used)
66+
run: |
67+
set -uo pipefail
68+
printf 'fn main() { println(6 * 7) }\n' > "$RUNNER_TEMP/v3_canary.v"
69+
V_MACOS_V3_NO_FALLBACK=1 ./v -v run "$RUNNER_TEMP/v3_canary.v" > "$RUNNER_TEMP/v3_canary.out" 2>&1 || true
70+
cat "$RUNNER_TEMP/v3_canary.out"
71+
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; }
72+
grep -qx '42' "$RUNNER_TEMP/v3_canary.out" || { echo '::error::the V3-compiled canary did not build/run correctly'; exit 1; }
73+
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
74+
echo 'OK: V3 compiled and ran this program in-process on macOS, with the fallback disabled'
5275
- name: Pkg-config regressions (Clang, no static executable)
5376
run: |
5477
set -euo pipefail
@@ -182,8 +205,10 @@ jobs:
182205
printf 'MULTIWINDOW_MACOS_NATIVE_OPERATION_PROOF status=PASS route=V1_COMPAT sha256=%s tests=%s\n' \
183206
"$actual_source_sha256" "$source_test_count"
184207
- name: Multiwindow Metal regressions and runtime probes
208+
# Some multiwindow tests still exercise V3-incompatible constructs. The
209+
# direct canary above remains strict; this lane also verifies fallback.
185210
env:
186-
V_MACOS_V3_NO_FALLBACK: '1'
211+
V_MACOS_V3_NO_FALLBACK: 0
187212
VGG_MULTIWINDOW_RUNTIME_PROBES: '1'
188213
VGG_MULTIWINDOW_RUNTIME_BACKEND: appkit
189214
VGG_MULTIWINDOW_EXAMPLE_UNATTENDED: appkit

.github/workflows/tools_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ concurrency:
2929
jobs:
3030
tools-linux:
3131
runs-on: ubuntu-22.04
32-
timeout-minutes: 20
32+
timeout-minutes: 40
3333
strategy:
3434
matrix:
3535
cc: [tcc, gcc, clang]

ci/linux_ci.vsh

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,30 @@ fn test_pure_v_math_module() {
2020
exec('v -exclude @vlib/math/*.c.v test vlib/math/')
2121
}
2222
23+
fn use_established_compiler_for_self_tests() {
24+
current_vflags := os.getenv('VFLAGS')
25+
if '-old-compiler' !in current_vflags.fields() {
26+
os.setenv('VFLAGS', '${current_vflags} -old-compiler'.trim_space(), true)
27+
}
28+
}
29+
2330
fn self_tests() {
31+
// The dedicated V3 workflow owns strict V3 coverage. Keep the full vlib suite
32+
// and its nested compiler invocations on V1 so the compatibility compiler
33+
// shipped by this rollout remains tested.
34+
use_established_compiler_for_self_tests()
2435
if common.is_github_job {
25-
exec('v -W -silent test-self vlib')
36+
exec('v -old-compiler -W -silent test-self vlib')
2637
} else {
27-
exec('v -progress test-self vlib')
38+
exec('v -old-compiler -progress test-self vlib')
2839
}
2940
}
3041
3142
fn build_examples() {
3243
if common.is_github_job {
33-
exec('v -W build-examples')
44+
// The exhaustive CI matrix includes a few deliberately large examples.
45+
// Keep the user-facing V3 memory guard while allowing CI to validate them.
46+
exec('v -no-memory-limit -W build-examples')
3447
} else {
3548
exec('v -progress build-examples')
3649
}
@@ -242,12 +255,14 @@ fn self_tests_gcc() {
242255
}
243256
244257
fn self_tests_prod_gcc() {
258+
use_established_compiler_for_self_tests()
245259
exec('v -o vprod -prod cmd/v')
246-
exec('./vprod -silent test-self vlib')
260+
exec('./vprod -old-compiler -silent test-self vlib')
247261
}
248262
249263
fn self_tests_cstrict_gcc() {
250-
exec('VTEST_JUST_ESSENTIAL=1 V_CI_CSTRICT=1 v -cc gcc -cstrict -silent test-self vlib')
264+
use_established_compiler_for_self_tests()
265+
exec('VTEST_JUST_ESSENTIAL=1 V_CI_CSTRICT=1 v -old-compiler -cc gcc -cstrict -silent test-self vlib')
251266
}
252267
253268
fn build_examples_gcc() {
@@ -366,12 +381,14 @@ fn self_tests_clang() {
366381
}
367382
368383
fn self_tests_vprod_clang() {
384+
use_established_compiler_for_self_tests()
369385
exec('v -o vprod -prod cmd/v')
370-
exec('./vprod -silent test-self vlib')
386+
exec('./vprod -old-compiler -silent test-self vlib')
371387
}
372388
373389
fn self_tests_cstrict_clang() {
374-
exec('VTEST_JUST_ESSENTIAL=1 V_CI_CSTRICT=1 ./vprod -cstrict -silent test-self vlib')
390+
use_established_compiler_for_self_tests()
391+
exec('VTEST_JUST_ESSENTIAL=1 V_CI_CSTRICT=1 ./vprod -old-compiler -cstrict -silent test-self vlib')
375392
}
376393
377394
fn build_examples_clang() {
@@ -400,7 +417,10 @@ fn build_modules_clang() {
400417
}
401418
402419
fn test_inline_assembly() {
403-
exec('v test vlib/v/slow_tests/assembly')
420+
// V3 does not lower inline assembly yet. Select V1 explicitly so this task
421+
// remains transparent and never exercises the compatibility retry path (which
422+
// is disabled below via V_MACOS_V3_NO_FALLBACK).
423+
exec('v -old-compiler test vlib/v/slow_tests/assembly')
404424
}
405425
406426
// Collect all tasks
@@ -468,4 +488,11 @@ const all_tasks = {
468488
'test_inline_assembly': Task{test_inline_assembly, 'Test inline assembly'}
469489
}
470490
491+
// V3 is the default compiler on Linux as well as macOS. A supported V3
492+
// compilation must fail directly in CI: never let the compatibility retry turn a
493+
// V3 regression into a passing V1 build. The workflow job also exports this in its
494+
// `env:`, so it already covers this runner script's own compilation (`v run
495+
// ci/linux_ci.vsh ...`); setting it here as well applies it when the tasks are run
496+
// outside that job (e.g. locally).
497+
os.setenv('V_MACOS_V3_NO_FALLBACK', '1', true)
471498
common.run(all_tasks)

0 commit comments

Comments
 (0)