Skip to content

Commit cc86884

Browse files
authored
Merge branch 'master' into http2_http3
2 parents f70d902 + 99f141f commit cc86884

2,772 files changed

Lines changed: 280230 additions & 54610 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/android_cross_compile.vsh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ fn main() {
2424
include_path := os.join_path(sysroot_path, 'usr', 'include')
2525
android_include_path := os.join_path(include_path, 'android')
2626

27-
//'-I"$include_path"'
28-
cflags := ['-I"$android_include_path"', '-Wno-unused-value', '-Wno-implicit-function-declaration',
27+
//'-I"${include_path}"'
28+
cflags := ['-I"${android_include_path}"', '-Wno-unused-value', '-Wno-implicit-function-declaration',
2929
'-Wno-int-conversion']
3030
for arch in ndk.supported_archs {
3131
for level in ['min', 'max'] {
@@ -46,22 +46,22 @@ fn main() {
4646
o_file := os.join_path(work_dir, arch + '-' + level + '.o')
4747

4848
// x.v -> x.c
49-
v_compile_cmd := '$vexe -o $c_file -os android -gc none $v_example'
49+
v_compile_cmd := '${vexe} -o ${c_file} -os android -gc none ${v_example}'
5050
vres := os.execute(v_compile_cmd)
5151
if vres.exit_code != 0 {
52-
panic('"$v_compile_cmd" failed: $vres.output')
52+
panic('"${v_compile_cmd}" failed: ${vres.output}')
5353
}
5454
assert os.exists(c_file)
5555

5656
// x.c -> x.o
57-
compile_cmd := '$compiler_api ${cflags.join(' ')} -c $c_file -o $o_file'
57+
compile_cmd := '${compiler_api} ${cflags.join(' ')} -c ${c_file} -o ${o_file}'
5858
cres := os.execute(compile_cmd)
5959
if cres.exit_code != 0 {
60-
panic('"$compile_cmd" failed: $cres.output')
60+
panic('"${compile_cmd}" failed: ${cres.output}')
6161
}
6262
assert os.exists(o_file)
6363
compiler_exe_name := os.file_name(compiler_api)
64-
println('Compiled examples/toml.v successfully for ($level) $arch $compiler_exe_name')
64+
println('Compiled examples/toml.v successfully for (${level}) ${arch} ${compiler_exe_name}')
6565
}
6666
}
6767
}

.github/workflows/benchmark_footprint_json_decode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: (echo '```txt'; v -prod crun vlib/x/json2/tests/bench.v; echo '```') > vlib/x/json2/tests/bench_out.md
2222

2323
- name: Upload result file
24-
uses: actions/upload-artifact@v6
24+
uses: actions/upload-artifact@v7
2525
with:
2626
name: program-output
2727
path: vlib/x/json2/tests/bench_out.md

.github/workflows/benchmark_footprint_json_encode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: (echo '```sh'; v -prod crun vlib/v/tests/bench/bench_json_vs_json2.v; echo '```') > vlib/v/tests/bench/bench_json_vs_json2_out.md
2424

2525
- name: Upload result file
26-
uses: actions/upload-artifact@v6
26+
uses: actions/upload-artifact@v7
2727
with:
2828
name: program-output
2929
path: vlib/v/tests/bench/bench_json_vs_json2_out.md

.github/workflows/bootstrapping_ci.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,32 @@ jobs:
7878
run: |
7979
# Derive a commit sha from an older successful fast workflow on master that was able to build V.
8080
# The workflow used below is `Path Testing CI` (18477644).
81-
recent_good_commit=$(curl -L \
82-
-H "Accept: application/vnd.github+json" \
83-
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
84-
-H "X-GitHub-Api-Version: 2022-11-28" \
85-
"https://api.github.com/repos/vlang/v/actions/workflows/18477644/runs?branch=master&status=success&event=push&per_page=5&page=2" \
86-
| jq -r '.workflow_runs[4].head_sha')
81+
# Fetch several successful runs and pick the first commit that is actually reachable on master.
82+
# Some runs may reference commits from force-pushed branches that are no longer on master.
83+
recent_good_commit=""
84+
valid_count=0
85+
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')
92+
for sha in $commits; do
93+
if git merge-base --is-ancestor "$sha" master 2>/dev/null; then
94+
valid_count=$((valid_count + 1))
95+
# Skip the first few valid commits to get an older one for testing upgrades.
96+
if [ "$valid_count" -ge 5 ]; then
97+
recent_good_commit="$sha"
98+
break 2
99+
fi
100+
fi
101+
done
102+
done
103+
if [ -z "$recent_good_commit" ]; then
104+
echo "Could not find a valid recent good commit on master"
105+
exit 1
106+
fi
87107
echo "recent_good_commit=$recent_good_commit"
88108
# Build oldv at recent_good_commit.
89109
./v run cmd/tools/oldv.v -v "$recent_good_commit"

.github/workflows/compare_pr_to_master.v

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,12 @@ fn main() {
109109
r('git checkout v_repo_master')
110110
master_branch := gbranch()
111111
hline(' Compiling old V executables from branch: ${master_branch}, commit: ${gcommit()} ...')
112+
// Use `make` to bootstrap the old V from the C sources on the master branch,
113+
// because the new V compiler may have breaking changes that prevent it from
114+
// compiling the old code directly.
115+
xtime('make -j4')
112116
xtime('./v -o vold1 cmd/v')
113-
xtime('./vold1 -o vold2 cmd/v')
114-
xtime('./vold2 -no-parallel -o vold cmd/v')
117+
xtime('./vold1 -no-parallel -o vold cmd/v')
115118
xtime('./vold -no-parallel -o ohw_master.c examples/hello_world.v')
116119
xtime('./vold -no-parallel -o ohw_master_gcc.c -cc gcc examples/hello_world.v')
117120
xtime('./vold -no-parallel -o ov_master.c cmd/v')
@@ -126,7 +129,7 @@ fn main() {
126129
if compare_prod {
127130
show_size('vold_prod')
128131
}
129-
r('rm -rf vold1 vold2')
132+
r('rm -rf vold1')
130133

131134
hline('File sizes so far ...')
132135
compare_size('ohw_master.c', 'nhw_current.c')

.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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ 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#6 / vlang/v#26853)"
17+
## 0x8000_0000 = 2147483648 overflows V's int (max 2147483647).
18+
## This causes a V warning (soon: hard error) and TCC rejects the generated C.
19+
sed -i 's/const shf_private = int(0x8000_0000)/const shf_private = u32(0x8000_0000)/' vtcc/src/tccelf.v
20+
1621
show "Compile vtcc"
1722
cd vtcc/
1823
v run make.vsh

.github/workflows/cross_ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
./v -os linux cmd/v
4747
# TODO: fix this: ./v -os linux examples/2048/2048.v
4848
49+
- name: Cross-compilation of veb app to Linux with -d use_openssl
50+
run: ./v -d use_openssl -os linux examples/veb/veb_example.v
51+
4952
- name: Cross-compilation to Windows
5053
run: |
5154
./v -os windows cmd/v
@@ -85,7 +88,7 @@ jobs:
8588
- name: v_win.c can be compiled and run with -os windows
8689
run: |
8790
./v -cc msvc -os windows -o /tmp/v_win.c cmd/v
88-
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
8992
ls -lart v_from_vc.exe
9093
wine ./v_from_vc.exe version
9194

.github/workflows/db_ci.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Database CI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths-ignore:
7+
- '**.md'
8+
- '**.yml'
9+
- '!**/db_ci.yml'
10+
- 'examples/**'
11+
- 'doc/**'
12+
pull_request:
13+
paths-ignore:
14+
- '**.md'
15+
- '**.yml'
16+
- '!**/db_ci.yml'
17+
- 'examples/**'
18+
- 'doc/**'
19+
20+
concurrency:
21+
group: db-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
mysql-driver-tests:
26+
runs-on: ubuntu-24.04
27+
timeout-minutes: 30
28+
services:
29+
mysql:
30+
image: mysql:8.0
31+
env:
32+
MYSQL_ROOT_PASSWORD: 12345678
33+
MYSQL_ROOT_HOST: '%'
34+
ports:
35+
- 3306:3306
36+
options: >-
37+
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -p12345678"
38+
--health-interval=10s
39+
--health-timeout=5s
40+
--health-retries=24
41+
steps:
42+
- uses: actions/checkout@v6
43+
- name: Build V
44+
run: make -j4 && ./v symlink
45+
- name: Install mysql client headers
46+
run: |
47+
.github/workflows/disable_azure_mirror.sh
48+
./v retry -- sudo apt update
49+
./v retry -- sudo apt install --quiet -y libmariadb-dev
50+
- name: Run mysql driver tests
51+
run: ./v -d network -d started_mysqld -silent test vlib/db/mysql/
52+
53+
postgres-driver-tests:
54+
runs-on: ubuntu-24.04
55+
timeout-minutes: 30
56+
services:
57+
postgres:
58+
image: postgres:16
59+
env:
60+
POSTGRES_PASSWORD: 12345678
61+
ports:
62+
- 5432:5432
63+
options: >-
64+
--health-cmd="pg_isready -U postgres -d postgres"
65+
--health-interval=10s
66+
--health-timeout=5s
67+
--health-retries=24
68+
steps:
69+
- uses: actions/checkout@v6
70+
- name: Build V
71+
run: make -j4 && ./v symlink
72+
- name: Install postgres client headers
73+
run: |
74+
.github/workflows/disable_azure_mirror.sh
75+
./v retry -- sudo apt update
76+
./v retry -- sudo apt install --quiet -y libpq-dev
77+
- name: Run postgres driver tests
78+
run: ./v -d network -d started_postgres -silent test vlib/db/pg/
79+
80+
mssql-driver-tests:
81+
runs-on: ubuntu-24.04
82+
timeout-minutes: 30
83+
services:
84+
mssql:
85+
image: mcr.microsoft.com/mssql/server:2022-latest
86+
env:
87+
ACCEPT_EULA: Y
88+
MSSQL_PID: Developer
89+
MSSQL_SA_PASSWORD: Vlang12345678!
90+
ports:
91+
- 1433:1433
92+
steps:
93+
- uses: actions/checkout@v6
94+
- name: Build V
95+
run: make -j4 && ./v symlink
96+
- name: Install ODBC dependencies
97+
run: |
98+
.github/workflows/disable_azure_mirror.sh
99+
[ -f /usr/share/keyrings/microsoft-prod.gpg ] || curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --batch --no-tty --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
100+
curl -fsSL https://packages.microsoft.com/config/ubuntu/24.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
101+
./v retry -- sudo apt update
102+
sudo ACCEPT_EULA=Y apt install --quiet -y msodbcsql18 unixodbc-dev
103+
- name: Wait for sql server
104+
run: |
105+
for _ in $(seq 1 60); do
106+
if (echo > /dev/tcp/127.0.0.1/1433) >/dev/null 2>&1; then
107+
exit 0
108+
fi
109+
sleep 2
110+
done
111+
exit 1
112+
- name: Run mssql driver tests
113+
env:
114+
VMSSQL_CONN_STR: 'Driver={ODBC Driver 18 for SQL Server};Server=127.0.0.1;Port=1433;UID=sa;PWD=Vlang12345678!;Database=master;TrustServerCertificate=yes'
115+
run: ./v -d network -d started_mssql -silent test vlib/db/mssql/

.github/workflows/docs_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
runs-on: ubuntu-24.04
4040
timeout-minutes: 5
4141
env:
42-
MOPTIONS: --diff --deprecated --relative-paths --exclude /vlib/v/ --exclude /builtin/linux_bare/ --exclude /testdata/ --exclude /tests/
42+
MOPTIONS: --diff --deprecated --relative-paths --exclude /vlib/v/ --exclude /vlib/v2/ --exclude /builtin/linux_bare/ --exclude /testdata/ --exclude /tests/ --exclude /vlib/sokol/ --exclude /vlib/x/
4343
steps:
4444
- uses: actions/checkout@v6
4545
- name: Build V

0 commit comments

Comments
 (0)