Skip to content

Commit 51f7903

Browse files
committed
Merge master into lifetimes
2 parents 420e226 + 6cafb40 commit 51f7903

2,420 files changed

Lines changed: 147193 additions & 48188 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/problem-matchers/v.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"owner": "v-problem-matcher",
66
"pattern": [
77
{
8-
"regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error|notice):\\s+(.*)$",
8+
"regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(error):\\s+(.*)$",
99
"file": 1,
1010
"line": 2,
1111
"column": 3,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module main
2+
3+
import os
4+
5+
fn show_release_tag_for(now string) string {
6+
script_path := os.join_path(os.dir(@FILE), 'workflows', 'show_manual_release_cmd.vsh')
7+
cmd := 'V_RELEASE_TAG_NOW="${now}" ${os.quoted_path(@VEXE)} run ${os.quoted_path(script_path)}'
8+
res := os.execute(cmd)
9+
assert res.exit_code == 0, res.output
10+
for line in res.output.split_into_lines() {
11+
if line.contains('current release_tag: ') {
12+
return line.all_after('current release_tag: ')
13+
}
14+
}
15+
panic('missing release tag in output:\n${res.output}')
16+
}
17+
18+
fn test_show_manual_release_cmd_uses_iso_week_year() {
19+
test_cases := {
20+
'2025-12-28 00:00:00': 'weekly.2025.52'
21+
'2025-12-29 00:00:00': 'weekly.2026.01'
22+
'2025-12-31 00:00:00': 'weekly.2026.01'
23+
'2026-01-01 00:00:00': 'weekly.2026.01'
24+
'2026-01-04 00:00:00': 'weekly.2026.01'
25+
'2026-01-05 00:00:00': 'weekly.2026.02'
26+
}
27+
for input, expected in test_cases {
28+
assert show_release_tag_for(input) == expected
29+
}
30+
}

.github/workflows/bootstrapping_ci.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,34 @@ jobs:
8080
# The workflow used below is `Path Testing CI` (18477644).
8181
# Fetch several successful runs and pick the first commit that is actually reachable on master.
8282
# Some runs may reference commits from force-pushed branches that are no longer on master.
83+
fetch_page() {
84+
local page="$1"
85+
local body=""
86+
for attempt in 1 2 3; do
87+
body=$(curl -sL --max-time 30 \
88+
-H "Accept: application/vnd.github+json" \
89+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
90+
-H "X-GitHub-Api-Version: 2022-11-28" \
91+
"https://api.github.com/repos/vlang/v/actions/workflows/18477644/runs?branch=master&status=success&event=push&per_page=10&page=$page")
92+
if [ -n "$body" ] && echo "$body" | jq -e '.workflow_runs' >/dev/null 2>&1; then
93+
echo "$body" | jq -r '.workflow_runs[].head_sha'
94+
return 0
95+
fi
96+
echo "::warning::page $page attempt $attempt failed, retrying..." >&2
97+
sleep 5
98+
done
99+
return 1
100+
}
83101
recent_good_commit=""
84102
valid_count=0
85103
for page in 1 2 3; do
86-
commits=$(curl -sL \
87-
-H "Accept: application/vnd.github+json" \
88-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
89-
-H "X-GitHub-Api-Version: 2022-11-28" \
90-
"https://api.github.com/repos/vlang/v/actions/workflows/18477644/runs?branch=master&status=success&event=push&per_page=10&page=$page" \
91-
| jq -r '.workflow_runs[].head_sha')
104+
commits=$(fetch_page "$page" || true)
105+
commit_count=$(printf '%s\n' "$commits" | grep -c . || true)
106+
echo "page $page: fetched $commit_count commits"
92107
for sha in $commits; do
93108
if git merge-base --is-ancestor "$sha" master 2>/dev/null; then
94109
valid_count=$((valid_count + 1))
110+
echo " valid #$valid_count: $sha"
95111
# Skip the first few valid commits to get an older one for testing upgrades.
96112
if [ "$valid_count" -ge 5 ]; then
97113
recent_good_commit="$sha"
@@ -100,6 +116,10 @@ jobs:
100116
fi
101117
done
102118
done
119+
if [ -z "$recent_good_commit" ]; then
120+
echo "Path Testing CI lookup yielded only $valid_count valid commits; falling back to git log."
121+
recent_good_commit=$(git log master --first-parent --format=%H --before='14 days ago' -n 1)
122+
fi
103123
if [ -z "$recent_good_commit" ]; then
104124
echo "Could not find a valid recent good commit on master"
105125
exit 1

.github/workflows/compile_discordv.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ function show() {
66
printf "\u001b[35m$1\u001b[0m\n"
77
}
88

9+
## NOTE: this step is disabled in v_apps_and_modules_compile_ci.yml via `${{ false && ... }}`.
10+
## Reason: discord.v uses x.json2.raw_decode which was deprecated-as-error in V on 2025-10-10.
11+
## The upstream repo (vcv88/discord.v) has not been updated since Dec 2024.
12+
## Re-enable both the yml step and this script once vcv88/discord.v#21 is resolved.
13+
## Track: https://github.com/vlang/v/issues/26853
14+
915
rm -rf discord/
1016

1117
show "Clone https://github.com/vcv88/discord.v"

.github/workflows/compile_v_with_vtcc.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ show "Clone vtcc"
1313
.github/workflows/retry.sh git clone https://github.com/felipensp/vtcc --branch stable --quiet vtcc/
1414
du -s vtcc/
1515
## TODO: just `./v vtcc`, later will cause V, to detect the compiler as tcc (which it is), and add `-fwrapv`, which causes the vtcc compiler to panic currently
16+
show "Patch vtcc: fix int(0x8000_0000) overflow (felipensp/vtcc#7 / vlang/v#26853)"
17+
## 0x8000_0000 = 2147483648 overflows V's int (max 2147483647).
18+
## V warns now and will make this a hard error soon; TCC then rejects the generated C.
19+
## Use -2147483648 (INT_MIN) — same bit pattern in two's complement, keeps type as int,
20+
## so no cascading type changes needed in new_section/new_symtab/struct Section.
21+
## Remove this patch once felipensp/vtcc#7 is merged into the stable branch.
22+
sed -i 's/const shf_private = int(0x8000_0000)/const shf_private = -2147483648/' vtcc/src/tccelf.v
23+
1624
show "Compile vtcc"
1725
cd vtcc/
1826
v run make.vsh

.github/workflows/compile_vlang_gui_examples.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,24 @@ function show() {
66
printf "\u001b[35m$1\u001b[0m\n"
77
}
88

9-
rm -rf ~/.vmodules/gui/
9+
rm -rf ~/.vmodules/gui/ ~/.vmodules/vglyph/
1010

1111
export VJOBS=1
12+
show "Clone https://github.com/vlang/vglyph"
13+
v retry -- git clone --filter=blob:none --quiet https://github.com/vlang/vglyph ~/.vmodules/vglyph/
14+
show "Use latest vlang/vglyph commit"
15+
git -C ~/.vmodules/vglyph/ log -1 --oneline
1216
show "Clone https://github.com/vlang/gui"
1317
v retry -- git clone --filter=blob:none --quiet https://github.com/vlang/gui ~/.vmodules/gui/
14-
show "Checkout last known good commit"
15-
git -C ~/.vmodules/gui/ checkout b4e3716b042ee6352efedff64c5b92cbf0e81ded
18+
show "Use latest vlang/gui commit"
19+
git -C ~/.vmodules/gui/ log -1 --oneline
20+
if [[ "$(uname)" == 'Darwin' ]]; then
21+
export VFLAGS="${VFLAGS:-} -cc clang"
22+
fi
1623
show "Check module for syntax and semantic errors"
1724
v -shared -check ~/.vmodules/gui
1825
show "Execute Tests"
1926
v test ~/.vmodules/gui/
2027
show "Compile Examples"
2128
v should-compile-all -no-parallel ~/.vmodules/gui/examples/
22-
rm -rf ~/.vmodules/gui/
29+
rm -rf ~/.vmodules/gui/ ~/.vmodules/vglyph/

.github/workflows/cross_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
- name: v_win.c can be compiled and run with -os windows
8989
run: |
9090
./v -cc msvc -os windows -o /tmp/v_win.c cmd/v
91-
x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe -lws2_32
91+
x86_64-w64-mingw32-gcc /tmp/v_win.c -std=c99 -w -municode -o v_from_vc.exe -lws2_32 -Wl,-stack=33554432
9292
ls -lart v_from_vc.exe
9393
wine ./v_from_vc.exe version
9494
@@ -112,7 +112,7 @@ jobs:
112112
run: |
113113
echo %VFLAGS%
114114
echo $VFLAGS
115-
.\make.bat -msvc
115+
.\makev.bat -msvc
116116
- name: TODO v_win.c can be compiled and run with -os windows
117117
run: |
118118
.\v.exe -os windows -cc msvc -showcc -o v2.exe cmd\v

.github/workflows/debug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
run: |
1515
echo %VFLAGS%
1616
echo $VFLAGS
17-
.\make.bat -msvc
17+
.\makev.bat -msvc
1818
.\v.exe -cflags /WX self
1919
- name: Install dependencies
2020
run: |

.github/workflows/freebsd_ci.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v6
3131
- name: Tests on FreeBSD with tcc
3232
id: tests-freebsd-tcc
33-
uses: cross-platform-actions/action@v0.32.0
33+
uses: cross-platform-actions/action@v1.0.0
3434
with:
3535
operating_system: freebsd
3636
version: '15.0'
@@ -45,16 +45,18 @@ jobs:
4545
sudo pkg install -y alsa-lib libglvnd libXi libXcursor
4646
# Mandatory: hostname not set in VM => some tests fail
4747
sudo hostname -s freebsd-ci
48-
echo "### OS infos"
48+
echo "::group::OS infos"
4949
uname -a
50+
echo "::endgroup::"
51+
echo "::group::Build V"
5052
git config --global --add safe.directory .
51-
echo "### Build V"
5253
gmake
5354
sudo ./v symlink
5455
export VTEST_SHOW_LONGEST_BY_RUNTIME=3
5556
export VTEST_SHOW_LONGEST_BY_COMPTIME=3
5657
export VTEST_SHOW_LONGEST_BY_TOTALTIME=3
5758
export VFLAGS='-cc tcc -no-retry-compilation'
59+
echo "::endgroup::"
5860
./v run ci/freebsd_ci.vsh all
5961
6062
clang-freebsd:
@@ -64,7 +66,7 @@ jobs:
6466
- uses: actions/checkout@v6
6567
- name: Tests on FreeBSD with clang
6668
id: tests-freebsd-clang
67-
uses: cross-platform-actions/action@v0.32.0
69+
uses: cross-platform-actions/action@v1.0.0
6870
with:
6971
operating_system: freebsd
7072
version: '15.0'
@@ -79,16 +81,18 @@ jobs:
7981
sudo pkg install -y alsa-lib libglvnd libXi libXcursor
8082
# Mandatory: hostname not set in VM => some tests fail
8183
sudo hostname -s freebsd-ci
82-
echo "### OS infos"
84+
echo "::group::OS infos"
8385
uname -a
86+
echo "::endgroup::"
87+
echo "::group::Build V"
8488
git config --global --add safe.directory .
85-
echo "### Build V"
8689
gmake
8790
sudo ./v symlink
8891
export VTEST_SHOW_LONGEST_BY_RUNTIME=3
8992
export VTEST_SHOW_LONGEST_BY_COMPTIME=3
9093
export VTEST_SHOW_LONGEST_BY_TOTALTIME=3
9194
export VFLAGS='-cc clang'
95+
echo "::endgroup::"
9296
./v run ci/freebsd_ci.vsh all
9397
9498
gcc-freebsd:
@@ -98,7 +102,7 @@ jobs:
98102
- uses: actions/checkout@v6
99103
- name: Tests on FreeBSD with gcc
100104
id: tests-freebsd-gcc
101-
uses: cross-platform-actions/action@v0.32.0
105+
uses: cross-platform-actions/action@v1.0.0
102106
with:
103107
operating_system: freebsd
104108
version: '15.0'
@@ -113,14 +117,16 @@ jobs:
113117
sudo pkg install -y alsa-lib libglvnd libXi libXcursor
114118
# Mandatory: hostname not set in VM => some tests fail
115119
sudo hostname -s freebsd-ci
116-
echo "### OS infos"
120+
echo "::group::OS infos"
117121
uname -a
122+
echo "::endgroup::"
123+
echo "::group::Build V"
118124
git config --global --add safe.directory .
119-
echo "### Build V"
120125
gmake
121126
sudo ./v symlink
122127
export VTEST_SHOW_LONGEST_BY_RUNTIME=3
123128
export VTEST_SHOW_LONGEST_BY_COMPTIME=3
124129
export VTEST_SHOW_LONGEST_BY_TOTALTIME=3
125130
export VFLAGS='-cc gcc'
131+
echo "::endgroup::"
126132
./v run ci/freebsd_ci.vsh all

.github/workflows/linux_ci.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ jobs:
8080
run: v run ci/linux_ci.vsh test_leak_detector_tcc
8181
- name: Test leak detector not being active for normal compile
8282
run: v run ci/linux_ci.vsh test_leak_detector_not_active_tcc
83-
- name: native cross compilation to macos
84-
run: v run ci/linux_ci.vsh native_cross_compilation_to_macos
8583

8684
gcc-linux:
8785
runs-on: ubuntu-24.04
@@ -130,10 +128,6 @@ jobs:
130128
run: v run ci/linux_ci.vsh v_self_compilation_parallel_cc_gcc
131129
- name: Build modules
132130
run: v run ci/linux_ci.vsh build_modules_gcc
133-
- name: native machine code generation
134-
run: v run ci/linux_ci.vsh native_machine_code_generation_gcc
135-
- name: native cross compilation to macos
136-
run: v run ci/linux_ci.vsh native_cross_compilation_to_macos
137131
- name: compile vdoctor.v with -prod
138132
run: v run ci/linux_ci.vsh compile_vdoctor_prod_gcc
139133
- name: compile vup.v with -prod
@@ -181,7 +175,3 @@ jobs:
181175
run: v run ci/linux_ci.vsh build_examples_autofree_clang
182176
- name: Build modules
183177
run: v run ci/linux_ci.vsh build_modules_clang
184-
- name: native machine code generation
185-
run: v run ci/linux_ci.vsh native_machine_code_generation_clang
186-
- name: native cross compilation to macos
187-
run: v run ci/linux_ci.vsh native_cross_compilation_to_macos

0 commit comments

Comments
 (0)