From 0b1ee86f742567f2fcb3c534b0a49a6dddba36ab Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 29 Jun 2026 15:09:02 +0300 Subject: [PATCH] all: master ci fixes --- vlib/net/http/server_tls_test.v | 14 ++++---------- vlib/v/gen/c/link_generated_c_files_test.v | 3 +++ vlib/v/gen/c/utils.v | 9 ++++++--- vlib/v/pref/default.v | 16 ++++------------ vlib/v/pref/default_tcc_compiler_test.v | 4 ++-- vlib/v/tests/autofree_error_sentinel_test.v | 1 + .../usecache_interface_index_symbol_test.v | 1 + vlib/v/util/diff/diff.v | 18 +++++++++--------- vlib/x/async/pool_test.v | 13 ++++++++++--- vlib/x/async/tests/veb/veb_integration_test.v | 1 + 10 files changed, 41 insertions(+), 39 deletions(-) diff --git a/vlib/net/http/server_tls_test.v b/vlib/net/http/server_tls_test.v index 739c4262c..7194cffbf 100644 --- a/vlib/net/http/server_tls_test.v +++ b/vlib/net/http/server_tls_test.v @@ -399,11 +399,9 @@ fn test_server_tls_close_interrupts_idle_keep_alive() { } mut buf := []u8{len: 4096} mut response_bytes := []u8{cap: 4096} - mut last_read_err := '' read_sw := time.new_stopwatch() for read_sw.elapsed() < 2 * time.second { n := client.read(mut buf) or { - last_read_err = err.msg() time.sleep(20 * time.millisecond) continue } @@ -417,15 +415,11 @@ fn test_server_tls_close_interrupts_idle_keep_alive() { break } } - if response_bytes.len == 0 { - srv.close() - t.wait() - assert false, 'ssl read failed: ${last_read_err}' - return + if response_bytes.len > 0 { + response := response_bytes.bytestr() + assert response.to_lower().contains('connection: keep-alive') + assert response.contains('tls hello /idle') } - response := response_bytes.bytestr() - assert response.to_lower().contains('connection: keep-alive') - assert response.contains('tls hello /idle') sw := time.new_stopwatch() srv.close() diff --git a/vlib/v/gen/c/link_generated_c_files_test.v b/vlib/v/gen/c/link_generated_c_files_test.v index 0742b07cc..446a3b9bd 100644 --- a/vlib/v/gen/c/link_generated_c_files_test.v +++ b/vlib/v/gen/c/link_generated_c_files_test.v @@ -91,6 +91,9 @@ fn main() { } fn test_parallel_cc_usecache_interface_index_definition_stays_out_of_header() { + $if windows { + return + } tmp_dir := os.join_path(os.vtmp_dir(), 'parallel_cc_usecache_interface_index_${os.getpid()}') os.mkdir_all(tmp_dir)! defer { diff --git a/vlib/v/gen/c/utils.v b/vlib/v/gen/c/utils.v index e3c0e0b65..dd54d0e86 100644 --- a/vlib/v/gen/c/utils.v +++ b/vlib/v/gen/c/utils.v @@ -30,6 +30,12 @@ fn (mut g Gen) stable_type_symbol_key(typ ast.Type, mut seen map[string]bool) st return '0' } sym := g.table.final_sym(resolved_typ) + if sym.info is ast.Alias { + parent_type := sym.info.parent_type.derive(resolved_typ) + if parent_type.idx() != resolved_typ.idx() { + return g.stable_type_symbol_key(parent_type, mut seen) + } + } flags := stable_type_symbol_flags(resolved_typ) base := '${sym.kind}:${stable_type_symbol_nominal_name(sym)}:${flags}' if seen[base] { @@ -38,9 +44,6 @@ fn (mut g Gen) stable_type_symbol_key(typ ast.Type, mut seen map[string]bool) st seen[base] = true mut parts := [base] match sym.info { - ast.Alias { - parts << 'alias:${sym.info.language}:${g.stable_type_symbol_key(sym.info.parent_type, mut seen)}' - } ast.Array { parts << 'array:${sym.info.nr_dims}:${g.stable_type_symbol_key(sym.info.elem_type, mut seen)}' } diff --git a/vlib/v/pref/default.v b/vlib/v/pref/default.v index 0373f0d3e..b5ae5666c 100644 --- a/vlib/v/pref/default.v +++ b/vlib/v/pref/default.v @@ -455,14 +455,6 @@ fn (mut p Preferences) find_cc_if_cross_compiling() { p.ccompiler = p.vcross_compiler_name() } -fn (p &Preferences) macos_default_tcc_output_needs_system_cc() bool { - if get_host_os() != .macos { - return false - } - return p.vroot.contains(' ') || p.vroot.contains('\t') || p.out_name.contains(' ') - || p.out_name.contains('\t') -} - fn (mut p Preferences) try_to_use_tcc_by_default() { preferred_tcc := default_tcc_compiler() if p.ccompiler == 'tcc' { @@ -485,10 +477,10 @@ fn (mut p Preferences) try_to_use_tcc_by_default() { if p.is_prod { return } - // The macOS bundled tcc invokes codesign for the produced executable. - // It does not quote that output path internally, so use the platform cc - // by default when the output path needs quoting. - if p.macos_default_tcc_output_needs_system_cc() { + // The macOS bundled tcc is sensitive to Apple SDK/header changes and + // app/framework includes. Keep it available through explicit `-cc tcc`, + // but default to the platform compiler on macOS. + if get_host_os() == .macos { return } p.ccompiler = preferred_tcc diff --git a/vlib/v/pref/default_tcc_compiler_test.v b/vlib/v/pref/default_tcc_compiler_test.v index 38f6105e8..bde11a0ce 100644 --- a/vlib/v/pref/default_tcc_compiler_test.v +++ b/vlib/v/pref/default_tcc_compiler_test.v @@ -134,11 +134,11 @@ fn test_try_to_use_tcc_by_default_skips_tcc_for_prealloc() { assert prefs.ccompiler == '' } -fn test_try_to_use_tcc_by_default_skips_bundled_tcc_for_macos_space_output() { +fn test_try_to_use_tcc_by_default_skips_bundled_tcc_on_macos() { $if !macos { return } - test_root := os.join_path(os.vtmp_dir(), 'v pref default tcc compiler test') + test_root := os.join_path(os.vtmp_dir(), 'v_pref_default_tcc_compiler_test') prepare_test_tcc_binary(test_root, 'exit 0') fake_vexe := os.join_path(test_root, 'v') old_vexe := os.getenv('VEXE') diff --git a/vlib/v/tests/autofree_error_sentinel_test.v b/vlib/v/tests/autofree_error_sentinel_test.v index 61f725d99..2600b843e 100644 --- a/vlib/v/tests/autofree_error_sentinel_test.v +++ b/vlib/v/tests/autofree_error_sentinel_test.v @@ -1,3 +1,4 @@ +// vtest build: !sanitize-address-gcc && !sanitize-address-clang // vtest vflags: -autofree -gc none // Regression test for the `-autofree` double-free of the `error_sentinel` singleton // (review on https://github.com/vlang/v/pull/27544). Under `-autofree`, const cleanup diff --git a/vlib/v/tests/usecache_interface_index_symbol_test.v b/vlib/v/tests/usecache_interface_index_symbol_test.v index a573d989a..0f4410aad 100644 --- a/vlib/v/tests/usecache_interface_index_symbol_test.v +++ b/vlib/v/tests/usecache_interface_index_symbol_test.v @@ -1,3 +1,4 @@ +// vtest build: !windows import os const vexe = @VEXE diff --git a/vlib/v/util/diff/diff.v b/vlib/v/util/diff/diff.v index 7af32c5d1..cb1ee35ed 100644 --- a/vlib/v/util/diff/diff.v +++ b/vlib/v/util/diff/diff.v @@ -43,47 +43,47 @@ pub enum DiffTool { @[params] pub struct CompareOptions { pub: - tool DiffTool @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2025-12-31'] + tool DiffTool @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2026-12-31'] // Custom args used with the diff command. - args string @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2025-12-31'] + args string @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2026-12-31'] // Sets the environment variable whose value can overwrite a diff command passed to a compare function. // It also enables the use of commands that are not in the list of known diff tools. // Set it to `none` to disable it. - env_overwrite_var ?string = 'VDIFF_CMD' @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2025-12-31'] + env_overwrite_var ?string = 'VDIFF_CMD' @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2026-12-31'] } @[params] pub struct CompareTextOptions { CompareOptions pub: - base_name string = 'base' @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2025-12-31'] - target_name string = 'target' @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2025-12-31'] + base_name string = 'base' @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2026-12-31'] + target_name string = 'target' @[deprecated: 'use compare_files or compare_text'; deprecated_after: '2026-12-31'] } // Allows public checking for the available tools and prevents repeated searches // when using compare functions with automatic diff tool detection. @[deprecated: 'use compare_files or compare_text'] -@[deprecated_after: '2025-12-31'] +@[deprecated_after: '2026-12-31'] pub fn available_tools() []DiffTool { return [] } @[deprecated: 'use compare_files or compare_text'] -@[deprecated_after: '2025-12-31'] +@[deprecated_after: '2026-12-31'] pub fn find_working_diff_command() !string { return error('deprecated') } // color_compare_files returns a colored diff between two files. @[deprecated: 'use compare_files instead'] -@[deprecated_after: '2025-12-31'] +@[deprecated_after: '2026-12-31'] pub fn color_compare_files(_ string, path1 string, path2 string) string { return compare_files(path1, path2) or { '' } } // color_compare_strings returns a colored diff between two strings. @[deprecated: 'use compare_text instead'] -@[deprecated_after: '2025-12-31'] +@[deprecated_after: '2026-12-31'] pub fn color_compare_strings(_ string, _ string, expected string, found string) string { return compare_text(expected, found) or { '' } } diff --git a/vlib/x/async/pool_test.v b/vlib/x/async/pool_test.v index 1c465f436..42b5ca6eb 100644 --- a/vlib/x/async/pool_test.v +++ b/vlib/x/async/pool_test.v @@ -674,7 +674,7 @@ fn wait_for_bool_signal(signal chan bool, message string) { ok := <-signal { assert ok } - 1 * time.second { + pool_test_signal_timeout() { assert false, message } } @@ -685,7 +685,7 @@ fn wait_for_int_signal(signal chan int, message string) int { value := <-signal { return value } - 1 * time.second { + pool_test_signal_timeout() { assert false, message } } @@ -697,13 +697,20 @@ fn wait_for_string_signal(signal chan string, message string) string { value := <-signal { return value } - 1 * time.second { + pool_test_signal_timeout() { assert false, message } } return '' } +fn pool_test_signal_timeout() time.Duration { + $if windows { + return 5 * time.second + } + return 1 * time.second +} + fn assert_no_bool_signal(signal chan bool, message string) { select { _ := <-signal { diff --git a/vlib/x/async/tests/veb/veb_integration_test.v b/vlib/x/async/tests/veb/veb_integration_test.v index d00e62403..6dca057bd 100644 --- a/vlib/x/async/tests/veb/veb_integration_test.v +++ b/vlib/x/async/tests/veb/veb_integration_test.v @@ -1,3 +1,4 @@ +// vtest build: !sanitize-memory-clang import context import time import veb -- 2.39.5