Fix the curl GitHub mirror, repair the troubleshooting table

The GitHub fallback for curl was a 404 written untested: curl tags its
releases with underscores in the version, 8.22.0 becoming curl-8_22_0,
while the asset name keeps the dots. Derive the tag from the version
rather than assuming the two match. Verified by making the primary host
unresolvable and letting the fallback carry the fetch; the tarball
passes xz -t and extracts to curl-8.22.0/.

The README troubleshooting section was a definition list. It is now a
three-column table, matching the reference sections elsewhere in the
file, with a row added for make static-deps failing to download, which
had no coverage despite the script fetching two tarballs.

Two of its entries were wrong:

- One documented "cannot find -lcares", which the Makefile can no longer
  produce. The recipe passes the explicit path static-deps/libcares.a
  and the prerequisite check fails first with its own message. Verified
  by moving the archive aside and reading what make actually says.

- The ares_* entry gave one diagnostic for two causes that read opposite
  ways. `nm -u static-deps/libcurl.a | grep -c ares_` returns zero when
  the archive was built without c-ares, and nonzero when c-ares is in
  there and the failure is link order. Split them apart.
This commit is contained in:
Luxferre
2026-10-03 09:22:23 +03:00
parent 494bee8b77
commit 5852a9732b
2 changed files with 18 additions and 45 deletions
+4 -1
View File
@@ -107,9 +107,12 @@ CURL_STAMP=$OUT/.curl-version
if fresh "$OUT/libcurl.a" "$CURL_STAMP" "$CURL_VERSION"; then
echo "libcurl.a $CURL_VERSION present, skipping (FORCE=1 to rebuild)"
else
# curl tags its GitHub releases with underscores in the version (8.22.0 ->
# curl-8_22_0), the file name keeps the dots. Verified 2026-10-03.
CURL_TAG=$(printf '%s' "$CURL_VERSION" | tr . _)
fetch "$WORK/curl.tar.xz" \
"https://curl.se/download/curl-$CURL_VERSION.tar.xz" \
"https://github.com/curl/curl/releases/download/curl-$CURL_VERSION/curl-$CURL_VERSION.tar.xz"
"https://github.com/curl/curl/releases/download/curl-$CURL_TAG/curl-$CURL_VERSION.tar.xz"
echo "extracting curl $CURL_VERSION"
tar xf "$WORK/curl.tar.xz" -C "$WORK"
cd "$WORK/curl-$CURL_VERSION"