Skip to content

[PL-89] - Harden the universal FreeType download against flaky mirrors with fail-fast curl, SourceForge fallback, and checksum plus archive validation - #65

Merged
kzryzstof merged 1 commit into
mainfrom
features/PL-89-fix-freetype-download
Aug 2, 2026
Merged

kzryzstof merged 1 commit into
mainfrom
features/PL-89-fix-freetype-download

Conversation

@kzryzstof

@kzryzstof kzryzstof commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The macOS Universal CI build fetched the FreeType release tarball from Savannah with a plain curl -L. When Savannah's mirror redirect returned an HTTP 502, the error page was saved as freetype-2.13.2.tar.xz and passed to tar, failing the build with Unrecognized archive format. This makes the FreeType download resilient to flaky/broken mirrors so a transient mirror outage no longer breaks the build.

Changes

  • Replace the single hard-coded Savannah URL with an ordered mirror list (Savannah primary, SourceForge fallback) tried in turn until one yields a valid archive.
  • Download with curl --fail --location --retry 3 --retry-all-errors plus connect/max timeouts, so HTTP 4xx/5xx fail fast (no error page written) and transient failures are retried without hanging on a dead mirror.
  • Add a verify_archive helper that validates the download by known-good SHA-256 (FreeType 2.13.2) and a tar -tf structural test before extraction.
  • Re-download when the cached archive is missing or fails validation, and remove invalid downloads, so a previously-saved error page is never reused.
  • Exit with a clear error to stderr when no mirror produces a valid archive.

Related

  • PL-89

Generated by describe-pr skill v1.1.0

The build-universal-freetype.sh script fetched the release tarball with
`curl -L` (no --fail), so an HTTP 502 from Savannah's mirror was saved as
the .tar.xz and handed to tar, failing the macOS CI build with
"Unrecognized archive format".

Make the download robust: fail on HTTP errors, retry, fall back from
Savannah to SourceForge, and validate the archive (SHA-256 + tar test)
before extraction so a corrupt or error-page response is never trusted.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@kzryzstof kzryzstof changed the title [PL-89] Harden universal FreeType download [PL-89] - Harden the universal FreeType download against flaky mirrors with fail-fast curl, SourceForge fallback, and checksum plus archive validation Aug 2, 2026
@kzryzstof
kzryzstof merged commit 1c05807 into main Aug 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant