ci: link os_compat for replay CMake tests; fix llvm-mingw mirrors
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:
+6
-1
@@ -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()
|
||||||
|
|||||||
@@ -19,17 +19,25 @@ 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 \
|
||||||
ok=1
|
--retry-delay 2 -o "$TGZ" "$u"; then
|
||||||
break
|
# Reject tiny error pages that some proxies return with HTTP 200.
|
||||||
|
sz=$(wc -c <"$TGZ")
|
||||||
|
if [[ "$sz" -gt 10000000 ]]; then
|
||||||
|
ok=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo " too small ($sz bytes), next mirror"
|
||||||
fi
|
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; }
|
||||||
|
|||||||
Reference in New Issue
Block a user