From 19ca0d0346df5619de5bb61828994932a07163d4 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Mon, 8 Sep 2025 03:36:39 -0300 Subject: [PATCH 1/5] checker: fix multi return var passing to fn arg (potential fix for #24870) (#25250) --- vlib/v/checker/fn.v | 10 ++++++++++ vlib/v/checker/tests/fn_call_arg_multi_err.out | 15 +++++++++++++++ vlib/v/checker/tests/fn_call_arg_multi_err.vv | 11 +++++++++++ 3 files changed, 36 insertions(+) create mode 100644 vlib/v/checker/tests/fn_call_arg_multi_err.out create mode 100644 vlib/v/checker/tests/fn_call_arg_multi_err.vv diff --git a/vlib/v/checker/fn.v b/vlib/v/checker/fn.v index c484eb5a95..12b2d8a357 100644 --- a/vlib/v/checker/fn.v +++ b/vlib/v/checker/fn.v @@ -1685,6 +1685,16 @@ fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) ast. return ast.void_type } } + if !func.is_variadic && func.params.len < (param_i + arg_typ_sym.info.types.len) { + c.fn_call_error_have_want( + nr_params: func.params.len + nr_args: param_i + arg_typ_sym.info.types.len + params: func.params + args: node.args + pos: node.pos + ) + return ast.void_type + } out: for n in 0 .. arg_typ_sym.info.types.len { curr_arg := arg_typs[n] multi_param := if func.is_variadic && i >= func.params.len - 1 { diff --git a/vlib/v/checker/tests/fn_call_arg_multi_err.out b/vlib/v/checker/tests/fn_call_arg_multi_err.out new file mode 100644 index 0000000000..c077a58777 --- /dev/null +++ b/vlib/v/checker/tests/fn_call_arg_multi_err.out @@ -0,0 +1,15 @@ +vlib/v/checker/tests/fn_call_arg_multi_err.vv:9:7: error: assignment mismatch: 1 variable but `a()` returns 2 values + 7 | + 8 | fn main() { + 9 | rets := a() + | ~~ + 10 | b(1, rets) + 11 | } +vlib/v/checker/tests/fn_call_arg_multi_err.vv:10:2: error: expected 2 arguments, but got 3 + 8 | fn main() { + 9 | rets := a() + 10 | b(1, rets) + | ~~~~~~~~~~ + 11 | } +Details: have (int literal, (int, int)) + want (int, []int) diff --git a/vlib/v/checker/tests/fn_call_arg_multi_err.vv b/vlib/v/checker/tests/fn_call_arg_multi_err.vv new file mode 100644 index 0000000000..366e856648 --- /dev/null +++ b/vlib/v/checker/tests/fn_call_arg_multi_err.vv @@ -0,0 +1,11 @@ +fn a() (int, int) { + return 1, 1 +} + +fn b(w int, arg []int) { +} + +fn main() { + rets := a() + b(1, rets) +} From 9158aed80ac2fb2af7acb9caa62deded0d63c2f8 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 8 Sep 2025 10:06:11 +0300 Subject: [PATCH 2/5] ci: change url to http://archive.ubuntu.com in .github/workflows/disable_azure_mirror.sh --- .github/workflows/disable_azure_mirror.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/disable_azure_mirror.sh b/.github/workflows/disable_azure_mirror.sh index 6495995009..0d10a34536 100755 --- a/.github/workflows/disable_azure_mirror.sh +++ b/.github/workflows/disable_azure_mirror.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "APT MIRRORS BEFORE:" cat /etc/apt/apt-mirrors.txt -sudo sed -i 's@http://azure.archive.ubuntu.com@https://us.archive.ubuntu.com@gm' /etc/apt/apt-mirrors.txt +sudo sed -i 's@http://azure.archive.ubuntu.com@http://archive.ubuntu.com@gm' /etc/apt/apt-mirrors.txt echo "APT MIRRORS AFTER:" cat /etc/apt/apt-mirrors.txt From 2c392f848b4a2c87699aca215efef2eec6f9c7b0 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 8 Sep 2025 10:12:14 +0300 Subject: [PATCH 3/5] ci: change the azure mirror URL in /etc/apt/sources.list too --- .github/workflows/disable_azure_mirror.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/disable_azure_mirror.sh b/.github/workflows/disable_azure_mirror.sh index 0d10a34536..753b9facb5 100755 --- a/.github/workflows/disable_azure_mirror.sh +++ b/.github/workflows/disable_azure_mirror.sh @@ -1,10 +1,11 @@ #!/bin/bash -echo "APT MIRRORS BEFORE:" -cat /etc/apt/apt-mirrors.txt +echo "APT MIRRORS BEFORE:"; cat /etc/apt/apt-mirrors.txt sudo sed -i 's@http://azure.archive.ubuntu.com@http://archive.ubuntu.com@gm' /etc/apt/apt-mirrors.txt -echo "APT MIRRORS AFTER:" -cat /etc/apt/apt-mirrors.txt +echo "APT MIRRORS AFTER:"; cat /etc/apt/apt-mirrors.txt -echo "ls -la /etc/apt/sources.list.d/" -ls -la /etc/apt/sources.list.d/ +echo "ls -la /etc/apt/sources.list.d/"; ls -la /etc/apt/sources.list.d/ for f in /etc/apt/sources.list.d/*; do echo "####### $f ######"; cat $f; done + +echo "APT SOURCES BEFORE:"; echo "ls -la /etc/apt/sources.list"; ls -la /etc/apt/sources.list; cat /etc/apt/sources.list +sudo sed -i 's@http://azure.archive.ubuntu.com@http://archive.ubuntu.com@gm' /etc/apt/sources.list +echo "APT SOURCES AFTER:"; echo "ls -la /etc/apt/sources.list"; ls -la /etc/apt/sources.list; cat /etc/apt/sources.list From 619bd968be71c6c60969734121eb7792e6cd29b2 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 8 Sep 2025 11:17:10 +0300 Subject: [PATCH 4/5] ci: use `awalsh128/cache-apt-pkgs-action@v1.5.3` instead of a manual `apt update/apt install` step, to leverage caching more (#25256) --- .github/workflows/puzzle_vibes_ci.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/puzzle_vibes_ci.yml b/.github/workflows/puzzle_vibes_ci.yml index 87c010056b..fcac34b047 100644 --- a/.github/workflows/puzzle_vibes_ci.yml +++ b/.github/workflows/puzzle_vibes_ci.yml @@ -4,19 +4,23 @@ on: workflow_dispatch: push: paths: - - 'vlib/**' + - 'vlib/v/checker/**.v' + - 'vlib/v/gen/c/**.v' - 'thirdparty/**' - 'cmd/tools/builders/**.v' - 'cmd/tools/vshader.v' - '**/puzzle_vibes_ci.yml' + - '!**_test.v' - '!**.md' pull_request: paths: - - 'vlib/**' + - 'vlib/v/checker/**' + - 'vlib/v/gen/c/**' - 'thirdparty/**' - 'cmd/tools/builders/**.v' - 'cmd/tools/vshader.v' - '**/puzzle_vibes_ci.yml' + - '!**_test.v' - '!**.md' concurrency: @@ -29,16 +33,14 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v5 + - uses: awalsh128/cache-apt-pkgs-action@v1.5.3 + with: + packages: libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev + version: 1.0 + - name: Build V run: make && ./v symlink - - name: Install dependencies - run: | - .github/workflows/disable_azure_mirror.sh - v retry 'sudo apt update' - v retry 'sudo apt install -y libsdl2-dev libsdl2-ttf-dev' - v retry 'sudo apt install -y libsdl2-mixer-dev libsdl2-image-dev' - - name: Install & Setup SDL run: v retry -- v install sdl && v ~/.vmodules/sdl/setup.vsh @@ -55,7 +57,7 @@ jobs: run: cd puzzle_vibes && v -g . - name: Check PV compiles with -prod - run: cd puzzle_vibes && v -prod . + run: cd puzzle_vibes && v -prod -no-prod-options . - name: Check PV compiles with -prod and -g - run: cd puzzle_vibes && v -prod -g . + run: cd puzzle_vibes && v -prod -g -no-prod-options . From 71d2e3f55644e93ac01d4aad37deba96888927f7 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 8 Sep 2025 11:45:55 +0300 Subject: [PATCH 5/5] ci: check if `awalsh128/cache-apt-pkgs-action@v1.5.3` works on master (#25257) --- .github/workflows/puzzle_vibes_ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/puzzle_vibes_ci.yml b/.github/workflows/puzzle_vibes_ci.yml index fcac34b047..39aed68d37 100644 --- a/.github/workflows/puzzle_vibes_ci.yml +++ b/.github/workflows/puzzle_vibes_ci.yml @@ -30,7 +30,7 @@ concurrency: jobs: v-compiles-puzzle-vibes: runs-on: ubuntu-24.04 - timeout-minutes: 30 + timeout-minutes: 20 steps: - uses: actions/checkout@v5 - uses: awalsh128/cache-apt-pkgs-action@v1.5.3 @@ -50,12 +50,12 @@ jobs: - name: Clone Puzzle Vibes run: v retry -- git clone https://github.com/larpon/puzzle_vibes/ - - name: Check PV compiles - run: cd puzzle_vibes && v . - - name: Check PV compiles with -g run: cd puzzle_vibes && v -g . + - name: Check PV compiles + run: cd puzzle_vibes && v . + - name: Check PV compiles with -prod run: cd puzzle_vibes && v -prod -no-prod-options .