From 9755673d62e871d74284a9a1bc8dc928673e540c Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 10 May 2026 17:18:55 +0300 Subject: [PATCH] ci: gitly, vpm fixes --- .github/workflows/v_apps_and_modules_compile_ci.yml | 2 +- vlib/v/util/util.v | 5 ++++- vlib/v/util/util_test.v | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/v_apps_and_modules_compile_ci.yml b/.github/workflows/v_apps_and_modules_compile_ci.yml index 63ad2c76b..123f4d816 100644 --- a/.github/workflows/v_apps_and_modules_compile_ci.yml +++ b/.github/workflows/v_apps_and_modules_compile_ci.yml @@ -141,7 +141,7 @@ jobs: ## echo "Build Gitly with -autofree" ## v -cc gcc -autofree /tmp/gitly echo "Compile gitly.css from gitly.scss" - sassc /tmp/gitly/static/static/css/gitly.scss > /tmp/gitly/static/static/css/gitly.css + sassc /tmp/gitly/static/css/gitly.scss > /tmp/gitly/static/css/gitly.css # echo "Run first_run.v" # v -cc gcc run /tmp/gitly/tests/first_run.v # # /tmp/gitly/gitly -ci_run diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index 78cae57d2..0ba98d52f 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -81,12 +81,15 @@ fn tool_recompilation_args(tool_name string, user_os string) []string { // FreeBSD's default tcc setup can not compile vdoc reliably. return ['-cc', 'cc'] } - if tool_name == 'vpm' { + if tool_name == 'vpm' && user_os == 'macos' { // vpm performs HTTPS requests against the package registry, so it // pulls in the TLS layer. Build it against OpenSSL instead of the // bundled mbedtls: tcc miscompiles mbedtls big-int routines on // Apple Silicon, which causes TLS handshakes to spin forever in // mbedtls_mpi_sub_abs / ecp_modp (e.g. `v install sdl` would hang). + // Restricted to macOS: musl-based Linux builds lack the glibc + // headers OpenSSL pulls in (e.g. `sys/cdefs.h`), so forcing it + // there breaks `v install` in the docker-ubuntu-musl CI. return ['-d', 'use_openssl'] } return []string{} diff --git a/vlib/v/util/util_test.v b/vlib/v/util/util_test.v index 5b3bd608e..ada26c327 100644 --- a/vlib/v/util/util_test.v +++ b/vlib/v/util/util_test.v @@ -10,13 +10,16 @@ fn test_tool_recompilation_args_force_system_cc_for_vdoc_on_freebsd() { fn test_tool_recompilation_args_use_openssl_for_vpm() { assert tool_recompilation_args('vpm', 'macos') == ['-d', 'use_openssl'] - assert tool_recompilation_args('vpm', 'linux') == ['-d', 'use_openssl'] - assert tool_recompilation_args('vpm', 'windows') == ['-d', 'use_openssl'] } fn test_tool_recompilation_args_do_not_change_other_tools_or_platforms() { assert tool_recompilation_args('vfmt', 'freebsd').len == 0 assert tool_recompilation_args('vdoc', 'linux').len == 0 + // musl-gcc on docker-ubuntu-musl can't find glibc's sys/cdefs.h that + // OpenSSL pulls in, so the `-d use_openssl` workaround is restricted to + // macOS where the original tcc/Apple-Silicon bug was reported. + assert tool_recompilation_args('vpm', 'linux').len == 0 + assert tool_recompilation_args('vpm', 'windows').len == 0 } fn test_fallback_tool_executable_path_uses_vtmp_for_missing_single_file_tool() { -- 2.39.5