From ec371820ad2f7b564fc9de7bffea717b96b78412 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 20 Jun 2026 17:27:07 +0300 Subject: [PATCH] ci: fix master checks --- cmd/tools/vbuild-tools.v | 6 ++++++ cmd/tools/vtest-self.v | 4 ++-- examples/macos_tray/tray.v | 4 ++-- vlib/arrays/arrays_fold_test.v | 2 +- vlib/db/pg/pg.c.v | 20 +++++++++---------- vlib/fasthttp/fasthttp_windows.v | 2 +- vlib/v/tests/bench/math_big_gcd/prime/maker.v | 2 +- .../array_filter_using_direct_closure_test.v | 2 +- .../tests/fns/anon_fn_with_alias_args_test.v | 4 ++-- vlib/v/tests/fns/closure_lifetime_api_test.v | 6 ++++++ .../fns/lambda_expr_with_mut_param_test.v | 4 ++-- vlib/v/tests/interfaces/interface_arg_test.v | 2 +- .../tests/structs/struct_field_fn_call_test.v | 2 +- 13 files changed, 36 insertions(+), 24 deletions(-) diff --git a/cmd/tools/vbuild-tools.v b/cmd/tools/vbuild-tools.v index 0d6b21fec..93a3ee42b 100644 --- a/cmd/tools/vbuild-tools.v +++ b/cmd/tools/vbuild-tools.v @@ -14,6 +14,9 @@ import v.util const tools_in_subfolders = ['vast', 'vcreate', 'vdoc', 'vpm', 'vsqlite', 'vsymlink', 'vvet', 'vwhere', 'vcover'] +// v2 is temporarily disabled, so tools that depend on it are skipped too. +const temporarily_disabled_tool_subfolders = ['vast2'] + // non_packaged_tools are tools that should not be packaged with // prebuild versions of V, to keep the size smaller. // They are mainly useful for the V project itself, not to end users. @@ -36,6 +39,9 @@ fn main() { for stool in tools_in_subfolders { skips << os.join_path(tfolder, stool).replace('\\', '/') } + for stool in temporarily_disabled_tool_subfolders { + skips << os.join_path(tfolder, stool).replace('\\', '/') + } buildopts := args_string.all_before('build-tools') mut session := testing.prepare_test_session(buildopts, folder, skips, main_label) session.rm_binaries = false diff --git a/cmd/tools/vtest-self.v b/cmd/tools/vtest-self.v index 005f58494..e03904ccc 100644 --- a/cmd/tools/vtest-self.v +++ b/cmd/tools/vtest-self.v @@ -388,9 +388,9 @@ fn main() { mut tsession := testing.new_test_session(vargs.join(' '), true) tsession.exec_mode = .compile_and_run tsession.files << all_test_files.filter(!it.contains('testdata' + os.path_separator)) - // v2 has its own driver at `cmd/v2/test_all.sh` and is still under heavy + // v2 has its own driver at `cmd/v2/test_all.vsh` and is still under heavy // development, so its tests are excluded from `v test-self`. - v2_dir_fragment := '${os.path_separator}vlib${os.path_separator}v2${os.path_separator}' + v2_dir_fragment := '${os.path_separator}vlib${os.path_separator}v2_toberemoved${os.path_separator}' tsession.skip_files << tsession.files.filter(it.contains(v2_dir_fragment)) if cfg.werror { tsession.custom_defines << 'self_werror' diff --git a/examples/macos_tray/tray.v b/examples/macos_tray/tray.v index bab562e1f..a2becd0f8 100644 --- a/examples/macos_tray/tray.v +++ b/examples/macos_tray/tray.v @@ -21,8 +21,8 @@ struct TrayMenuItem { // Parameters to configure the tray button. struct TrayParams { - items []TrayMenuItem @[required] - on_click fn (item main.TrayMenuItem) @[required] + items []TrayMenuItem @[required] + on_click fn (item TrayMenuItem) @[required] } // Internal Cocoa application state. diff --git a/vlib/arrays/arrays_fold_test.v b/vlib/arrays/arrays_fold_test.v index a11a4fe2c..3d8dd8aee 100644 --- a/vlib/arrays/arrays_fold_test.v +++ b/vlib/arrays/arrays_fold_test.v @@ -24,7 +24,7 @@ fn test_main() { assert arrays.fold[bool, []bool]([true, false], []bool{}, fn (r []bool, t bool) []bool { return arrays.merge(r, [t]) }) == [false, true] - assert arrays.fold[MyInt, []MyInt]([MyInt(0), 1], []MyInt{}, fn (r []main.MyInt, t MyInt) []main.MyInt { + assert arrays.fold[MyInt, []MyInt]([MyInt(0), 1], []MyInt{}, fn (r []MyInt, t MyInt) []MyInt { return arrays.merge(r, [t]) }) == [MyInt(0), 1] assert arrays.fold([1, 2, 3, 4], [5, 6, 7], fn (r []int, t int) []int { diff --git a/vlib/db/pg/pg.c.v b/vlib/db/pg/pg.c.v index 06fb59220..d671ff704 100644 --- a/vlib/db/pg/pg.c.v +++ b/vlib/db/pg/pg.c.v @@ -399,7 +399,7 @@ fn (mut c Conn) physical_close() { } } -fn res_to_rows(res voidptr) []db.pg.Row { +fn res_to_rows(res voidptr) []Row { nr_rows := C.PQntuples(res) nr_cols := C.PQnfields(res) @@ -514,12 +514,12 @@ pub fn (c &Conn) q_string(query string) !string { // q_strings submit a command to the database server and // returns the resulting row set. Alias of `exec` -pub fn (c &Conn) q_strings(query string) ![]db.pg.Row { +pub fn (c &Conn) q_strings(query string) ![]Row { return c.exec(query) } // exec submits a command to the database server and wait for the result, returning an error on failure and a row set on success -pub fn (c &Conn) exec(query string) ![]db.pg.Row { +pub fn (c &Conn) exec(query string) ![]Row { c.ensure_active()! res := C.PQexec(c.conn, &char(query.str)) return c.handle_error_or_rows(res, 'exec') @@ -539,7 +539,7 @@ pub fn (c &Conn) exec_result(query string) !Result { return c.handle_error_or_result(res, 'exec_result') } -fn rows_first_or_empty(rows []db.pg.Row) !Row { +fn rows_first_or_empty(rows []Row) !Row { if rows.len == 0 { return error('no row') } @@ -560,7 +560,7 @@ pub fn (c &Conn) exec_one(query string) !Row { } // exec_param_many executes a query with the parameters provided as ($1), ($2), ($n) -pub fn (c &Conn) exec_param_many(query string, params []string) ![]db.pg.Row { +pub fn (c &Conn) exec_param_many(query string, params []string) ![]Row { c.ensure_active()! unsafe { mut param_vals := []&char{len: params.len} @@ -588,12 +588,12 @@ pub fn (c &Conn) exec_param_many_result(query string, params []string) !Result { } // exec_param executes a query with 1 parameter ($1), and returns either an error on failure, or the full result set on success -pub fn (c &Conn) exec_param(query string, param string) ![]db.pg.Row { +pub fn (c &Conn) exec_param(query string, param string) ![]Row { return c.exec_param_many(query, [param]) } // exec_param2 executes a query with 2 parameters ($1) and ($2), and returns either an error on failure, or the full result set on success -pub fn (c &Conn) exec_param2(query string, param string, param2 string) ![]db.pg.Row { +pub fn (c &Conn) exec_param2(query string, param string, param2 string) ![]Row { return c.exec_param_many(query, [param, param2]) } @@ -607,7 +607,7 @@ pub fn (c &Conn) prepare(name string, query string, num_params int) ! { } // exec_prepared sends a request to execute a prepared statement with given parameters, and waits for the result. The number of parameters must match with the parameters declared in the prepared statement. -pub fn (c &Conn) exec_prepared(name string, params []string) ![]db.pg.Row { +pub fn (c &Conn) exec_prepared(name string, params []string) ![]Row { c.ensure_active()! unsafe { mut param_vals := []&char{len: params.len} @@ -645,7 +645,7 @@ fn (c &Conn) mark_bad_if_disconnected() { } } -fn (c &Conn) handle_error_or_rows(res voidptr, elabel string) ![]db.pg.Row { +fn (c &Conn) handle_error_or_rows(res voidptr, elabel string) ![]Row { e := unsafe { C.PQerrorMessage(c.conn).vstring() } if e != '' { C.PQclear(res) @@ -761,7 +761,7 @@ pub fn (c &Conn) copy_expert(query string, mut file io.ReaderWriter) !int { return 0 } -fn pg_stmt_worker(c &Conn, query string, data orm.QueryData, where orm.QueryData) ![]db.pg.Row { +fn pg_stmt_worker(c &Conn, query string, data orm.QueryData, where orm.QueryData) ![]Row { mut param_types := []u32{} mut param_vals := []&char{} mut param_lens := []int{} diff --git a/vlib/fasthttp/fasthttp_windows.v b/vlib/fasthttp/fasthttp_windows.v index 54aa8d567..efefdc6e7 100644 --- a/vlib/fasthttp/fasthttp_windows.v +++ b/vlib/fasthttp/fasthttp_windows.v @@ -5,7 +5,7 @@ pub: port int = 3000 max_request_buffer_size int = 8192 mut: - request_handler fn (fasthttp.HttpRequest) !fasthttp.HttpResponse @[required] + request_handler fn (HttpRequest) !HttpResponse @[required] } // new_server creates and initializes a new Server instance. diff --git a/vlib/v/tests/bench/math_big_gcd/prime/maker.v b/vlib/v/tests/bench/math_big_gcd/prime/maker.v index 4042171f8..3cf4b541a 100644 --- a/vlib/v/tests/bench/math_big_gcd/prime/maker.v +++ b/vlib/v/tests/bench/math_big_gcd/prime/maker.v @@ -141,7 +141,7 @@ pub fn random_list(cfg []string) []string { return p_list } -pub fn random_set(cfg PrimeCfg) ![]v.tests.bench.math_big_gcd.prime.PrimeSet { +pub fn random_set(cfg PrimeCfg) ![]PrimeSet { p_lists := [ cfg.r.split('.'), cfg.a.split('.'), diff --git a/vlib/v/tests/builtin_arrays/array_filter_using_direct_closure_test.v b/vlib/v/tests/builtin_arrays/array_filter_using_direct_closure_test.v index f60dd2c28..94eec19af 100644 --- a/vlib/v/tests/builtin_arrays/array_filter_using_direct_closure_test.v +++ b/vlib/v/tests/builtin_arrays/array_filter_using_direct_closure_test.v @@ -4,7 +4,7 @@ struct File { is_dir bool } -fn filter(all_files []main.File, interested_file File) []main.File { +fn filter(all_files []File, interested_file File) []File { println(interested_file) return all_files.filter(fn [interested_file] (f File) bool { println(interested_file) diff --git a/vlib/v/tests/fns/anon_fn_with_alias_args_test.v b/vlib/v/tests/fns/anon_fn_with_alias_args_test.v index a8724ce05..022d89409 100644 --- a/vlib/v/tests/fns/anon_fn_with_alias_args_test.v +++ b/vlib/v/tests/fns/anon_fn_with_alias_args_test.v @@ -2,11 +2,11 @@ type MyString = string type MyInt = int struct S1 { - x fn (a int) main.MyString + x fn (a int) MyString } struct S2 { - y fn (a int) main.MyInt + y fn (a int) MyInt } fn get_string(a int) MyString { diff --git a/vlib/v/tests/fns/closure_lifetime_api_test.v b/vlib/v/tests/fns/closure_lifetime_api_test.v index a235ec946..e9a78d04e 100644 --- a/vlib/v/tests/fns/closure_lifetime_api_test.v +++ b/vlib/v/tests/fns/closure_lifetime_api_test.v @@ -8,6 +8,12 @@ fn testsuite_begin() { } } +@[noreturn] +fn skip_test(reason string) { + println('skipping test, because ${reason} .') + exit(0) +} + fn missing_boehm_leak_lib(output string) bool { return output.contains('libgc') && (output.contains('was not found') || output.contains('cannot find')) diff --git a/vlib/v/tests/fns/lambda_expr_with_mut_param_test.v b/vlib/v/tests/fns/lambda_expr_with_mut_param_test.v index 6594afb41..9e6364198 100644 --- a/vlib/v/tests/fns/lambda_expr_with_mut_param_test.v +++ b/vlib/v/tests/fns/lambda_expr_with_mut_param_test.v @@ -1,8 +1,8 @@ struct Window { mut: calls int - on_init fn (mut w main.Window) = unsafe { nil } - cb fn (mut w main.Window, x int) = unsafe { nil } + on_init fn (mut w Window) = unsafe { nil } + cb fn (mut w Window, x int) = unsafe { nil } } fn (mut w Window) run() { diff --git a/vlib/v/tests/interfaces/interface_arg_test.v b/vlib/v/tests/interfaces/interface_arg_test.v index 115673b05..940591874 100644 --- a/vlib/v/tests/interfaces/interface_arg_test.v +++ b/vlib/v/tests/interfaces/interface_arg_test.v @@ -6,7 +6,7 @@ struct Test { struct Cmdable { mut: - call fn (cmd main.ITest) + call fn (cmd ITest) } fn (t Test) test(a ITest) {} diff --git a/vlib/v/tests/structs/struct_field_fn_call_test.v b/vlib/v/tests/structs/struct_field_fn_call_test.v index b4a1de73d..ba4eafb6e 100644 --- a/vlib/v/tests/structs/struct_field_fn_call_test.v +++ b/vlib/v/tests/structs/struct_field_fn_call_test.v @@ -1,5 +1,5 @@ struct Foo { - f fn (main.Foo) int = dummy + f fn (Foo) int = dummy } fn dummy(s Foo) int { -- 2.39.5