Skip to content

Reject failed library downloads before clearing installed libraries - #8591

Merged
danoli3 merged 2 commits into
openframeworks:masterfrom
danoli3:fix-library-download-validation
Oct 25, 2026
Merged

danoli3 merged 2 commits into
openframeworks:masterfrom
danoli3:fix-library-download-validation

Conversation

@danoli3

@danoli3 danoli3 commented Oct 15, 2026

Copy link
Copy Markdown
Member

Library downloads can report success after an HTTP failure and then reach extraction with a missing, truncated or HTML response instead of an archive. If remote digest lookup is unavailable, download_libs clears installed library directories before discovering the bad package, leaving a partial installation. Tar diagnostics are also suppressed.

Make curl downloads fail on HTTP errors and fail early across parallel transfers. Preserve curl/wget/wget2 exit status instead of allowing optional connection cleanup to mask it. Validate every downloaded tar/zip archive before any platform cleanup, and show extraction errors. Fetch digest metadata for the exact named release tag, with bounded retries/timeouts.

Observed with latest macOS bundles: extraction failed on bundle 3 after a 55.7 MiB transfer and unavailable digest map. The current published third archive is 40,576,583 bytes; an independent download matched GitHub's SHA-256 digest and fully extracted successfully. The transfer total matches bundles 1+2 alone, suggesting a missing/invalid third download rather than a broken published archive. The original failed file/HTTP response was not available for inspection.

Validation:

  • Normal and silent curl HTTP failures propagate; wget failures propagate.
  • Valid tar/zip archives pass; HTML, truncated, empty and missing archives fail.
  • Actual download_libs installer fixture with unavailable digests and an invalid third bundle stops before removing an existing installed-library sentinel.
  • Tests pass under Bash 3 and current Bash; syntax, workflow lint and diff checks pass.
  • Independently downloaded, hashed and fully extracted the current Apothecary macOS bundle 3.

Adds a focused Ubuntu validation workflow. Does not rebuild or replace Apothecary release assets.

@danoli3
danoli3 force-pushed the fix-library-download-validation branch from 32d249f to 20698fe Compare October 16, 2026 01:38
A package that matched its published digest is the release asset byte for
byte, so verifyPackageArchives no longer decompresses it a second time
(tar -tf on a .tar.bz2 costs about as much as extracting it). Packages
without a digest, or every package when digests are unavailable or
--skip-sha is given, are still opened before anything is removed.
verifyPackagesAgainstMap records the matched names in SHA_VERIFIED_PKGS.
verifyPackageArchives is indented with tabs, like the rest of the file.

Tested: test-download-validation.sh under Bash 3.2 and 5.3; macOS
download_libs: three verified bundles extract with no tar -tf, and with
--skip-sha all three are checked first.
@danoli3
danoli3 merged commit 3304b2b into openframeworks:master Oct 25, 2026
21 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