windows: fxc's download retried and resumable, as the other pinned downloads

The release build failed on one connection reset fetching the SDK cab that
fxc.exe comes from: fxc-wine.sh now uses lib.sh's fetch_pinned (hash
checked, in pieces when the line stalls), whose whole-file attempt now
retries on any error, a reset included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 5.5 committed 2026-10-28 00:07:59 +03:00
1 parent d25e6cbd31
commit ddc1bbe686
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -16,6 +16,7 @@ FXC_IN_CAB=fil6dfaf6bbf56939fbab75b569ffa0fd41
DLL_IN_CAB=fil0d3f984977487cd87127d614f654195b
here=$(dirname "$(realpath "$0")")
. "$here/lib.sh"
pkg() { nix build --no-link --print-out-paths --inputs-from "$here/.." "nixpkgs#$1" | head -1; }
verified() {
[ -f "$CACHE/fxc.exe" ] && [ -f "$CACHE/d3dcompiler_47.dll" ] &&
@@ -26,8 +27,8 @@ verified() {
if ! verified; then
mkdir -p "$CACHE"
tmp=$(mktemp -d)
curl -sSfL -o "$tmp/tools.cab" "$CAB_URL"
echo "$CAB_SHA256 $tmp/tools.cab" | sha256sum -c --quiet
# Retried, and in pieces if the line stalls (a reset failed a release build once).
fetch_pinned "$CAB_URL" "$CAB_SHA256" "$tmp/tools.cab" >&2
(cd "$tmp" && "$(pkg gcab.bin)/bin/gcab" -x tools.cab "$FXC_IN_CAB" "$DLL_IN_CAB")
mv "$tmp/$FXC_IN_CAB" "$CACHE/fxc.exe"
mv "$tmp/$DLL_IN_CAB" "$CACHE/d3dcompiler_47.dll"
+1 -1
View File
@@ -66,7 +66,7 @@ fetch_pinned() {
fi
# Whole, unless it stalls: some networks cut TLS to some hosts after about 16 KB (as
# zapret2's cutoff option knows). Then in ranges below that, each on a connection of its own.
if ! curl -fsSL --connect-timeout 30 --speed-limit 1 --speed-time 15 --max-time 900 --retry 2 -o "$out" "$url"; then
if ! curl -fsSL --connect-timeout 30 --speed-limit 1 --speed-time 15 --max-time 900 --retry 3 --retry-all-errors -o "$out" "$url"; then
echo "$url stalled; fetching it in pieces" >&2
local size from=0 step=12000 tries=0
size=$(curl -fsSIL --connect-timeout 30 --max-time 60 "$url" | tr -d '\r' | awk 'tolower($1) == "content-length:" { n = $2 } END { print n }')