fix: retry and validate Sharp binary downloads - #252
Merged
Conversation
curl had no --fail/--retry, so an interrupted transfer could leave a truncated, zero-byte, or partial .tgz cached with a success exit code. Every subsequent synth/destroy in the same job then hit the same corrupt cache entry and failed at extraction. Add --fail --retry 3 --retry-delay 1 to curl, and validate cached files (existing or freshly downloaded) are non-empty before trusting them, discarding and re-downloading otherwise. Fixes #249
cdklabs-automation
enabled auto-merge
August 25, 2026 15:18
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
downloadAndInstallSharpBinariesusedcurl -Lwith no--fail/retry, so a dropped connection mid-download could leave a truncated.tgzcached with a successful exit codesynth/destroyin the same job then reused that same corrupt cache entry and failed attarextraction withunexpected end of file--fail --retry 3 --retry-delay 1to the curl call, and added a non-empty check on cached files (both pre-existing and freshly downloaded), discarding and re-downloading when invalidFixes #249
Test plan
pnpm compilepassespnpm eslint src/nextjs-build/nextjs-build.tspasses