ci: link os_compat for replay CMake tests; fix llvm-mingw mirrors
ci / linux (clang) (push) Successful in 3m45s
ci / linux (gcc) (push) Successful in 4m22s
ci / musl (push) Successful in 4m28s
ci / windows-cross (push) Failing after 7m9s

gcc -O0 keeps unused cst_test_util.h helpers that need os_*; clang GC'd
them so only the gcc CMake step failed. Prefer ghfast/ghproxy.net for the
llvm-mingw tarball (gitclone 500 / github unreachable on the runner).
This commit is contained in:
WHC
2026-10-07 02:57:38 +08:00
parent 9b2c7acfae
commit 546a4c7eeb
2 changed files with 18 additions and 5 deletions
+6 -1
View File
@@ -237,7 +237,12 @@ foreach(t ${_CST_SMALL_TESTS})
elseif(t STREQUAL test_json_baseline) elseif(t STREQUAL test_json_baseline)
add_executable(${t} tests/${t}.c src/json_baseline.c vendor/cjson/cJSON.c) add_executable(${t} tests/${t}.c src/json_baseline.c vendor/cjson/cJSON.c)
elseif(t STREQUAL test_replay_starvation OR t STREQUAL test_replay_real) elseif(t STREQUAL test_replay_starvation OR t STREQUAL test_replay_real)
add_executable(${t} tests/${t}.c src/ctl_parse.c src/json_baseline.c vendor/cjson/cJSON.c) # cst_test_util.h static helpers reference os_*; gcc -O0 keeps unused ones
add_executable(${t} tests/${t}.c src/ctl_parse.c src/json_baseline.c
vendor/cjson/cJSON.c src/os_compat.c src/os_win.c)
if(WIN32)
target_link_libraries(${t} PRIVATE advapi32 user32)
endif()
else() else()
add_executable(${t} tests/test_mm_tool.c src/mm_tool.c) add_executable(${t} tests/test_mm_tool.c src/mm_tool.c)
endif() endif()
+10 -2
View File
@@ -19,18 +19,26 @@ fi
if [[ ! -x "$DIR/bin/x86_64-w64-mingw32-gcc" ]]; then if [[ ! -x "$DIR/bin/x86_64-w64-mingw32-gcc" ]]; then
echo "==> download $NAME" echo "==> download $NAME"
# Prefer CN-reachable GitHub proxies; raw github.com is often unreachable.
urls=( urls=(
"https://ghfast.top/https://github.com/mstorsjo/llvm-mingw/releases/download/${VER}/${NAME}.tar.xz"
"https://ghproxy.net/https://github.com/mstorsjo/llvm-mingw/releases/download/${VER}/${NAME}.tar.xz"
"https://gitclone.com/github.com/mstorsjo/llvm-mingw/releases/download/${VER}/${NAME}.tar.xz" "https://gitclone.com/github.com/mstorsjo/llvm-mingw/releases/download/${VER}/${NAME}.tar.xz"
"https://mirror.ghproxy.com/https://github.com/mstorsjo/llvm-mingw/releases/download/${VER}/${NAME}.tar.xz"
"https://github.com/mstorsjo/llvm-mingw/releases/download/${VER}/${NAME}.tar.xz" "https://github.com/mstorsjo/llvm-mingw/releases/download/${VER}/${NAME}.tar.xz"
) )
ok=0 ok=0
for u in "${urls[@]}"; do for u in "${urls[@]}"; do
echo " try $u" echo " try $u"
if curl -fL --retry 2 --connect-timeout 20 --retry-delay 2 -o "$TGZ" "$u"; then if curl -fL --retry 2 --connect-timeout 15 --max-time 600 \
--retry-delay 2 -o "$TGZ" "$u"; then
# Reject tiny error pages that some proxies return with HTTP 200.
sz=$(wc -c <"$TGZ")
if [[ "$sz" -gt 10000000 ]]; then
ok=1 ok=1
break break
fi fi
echo " too small ($sz bytes), next mirror"
fi
done done
[[ $ok -eq 1 ]] || { echo "failed to download llvm-mingw" >&2; exit 1; } [[ $ok -eq 1 ]] || { echo "failed to download llvm-mingw" >&2; exit 1; }
rm -rf "$DIR" rm -rf "$DIR"