Skip to content

Add curl retry flags to wasi-sdk Linux download#125488

Open
steveisok wants to merge 2 commits intomainfrom
steveisok/wasi-sdk-curl-retry
Open

Add curl retry flags to wasi-sdk Linux download#125488
steveisok wants to merge 2 commits intomainfrom
steveisok/wasi-sdk-curl-retry

Conversation

@steveisok
Copy link
Member

Summary

The Linux curl command in AcquireWasiSdk.targets has no retry logic, unlike the Windows download-wasi-sdk.ps1 which retries up to 8 times on partial transfers. This causes transient GitHub download failures (rate limits, network blips, truncated responses) to fail the entire build with a cryptic tar error:

tar: Error is not recoverable: exiting now

Change

Add --retry 3 --retry-delay 5 --retry-all-errors to the Linux curl invocation:

- curl --silent -L -o wasi-sdk-25.0.tar.gz <url>
+ curl --silent --retry 3 --retry-delay 5 --retry-all-errors -L -o wasi-sdk-25.0.tar.gz <url>
  • --retry 3: Retry up to 3 times on failure
  • --retry-delay 5: Wait 5 seconds between retries
  • --retry-all-errors: Retry on connection failures and timeouts, not just HTTP transient errors

Motivation

Build 2924549 failed on Linux_Alpine_x64 due to a transient wasi-sdk download failure. The next scheduled build succeeded without any code change — confirming the issue was transient. The Windows download script already handles this case with up to 8 retry attempts.

cc @lewing

The Linux curl command in AcquireWasiSdk.targets has no retry logic,
unlike the Windows download script which retries up to 8 times.
This causes transient GitHub download failures (rate limits, network
blips) to fail the entire build with a cryptic tar error.

Add --retry 3 --retry-delay 5 --retry-all-errors to bring Linux
to parity with Windows retry behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves reliability of acquiring the WASI SDK during non-Windows builds by adding curl retry behavior in AcquireWasiSdk.targets, reducing transient download failures during builds.

Changes:

  • Add curl retry flags (--retry, --retry-delay, --retry-all-errors) to the Linux/macOS WASI SDK download step.

You can also share your feedback on Copilot code review. Take the survey.

@steveisok steveisok requested review from akoeplinger and lewing March 12, 2026 12:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 12, 2026 13:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


You can also share your feedback on Copilot code review. Take the survey.

<MakeDir Directories="$(_RuntimeLocalWasiSdkPath)" />

<Exec Command="curl --silent -L -o wasi-sdk-$(_WasiSdkVersion).tar.gz $(_WasiSdkUrl) &amp;&amp; tar --strip-components=1 -xzmf wasi-sdk-$(_WasiSdkVersion).tar.gz -C $(_RuntimeLocalWasiSdkPath)"
<Exec Command="curl --silent --show-error --fail --retry 3 --retry-delay 5 -L -o wasi-sdk-$(_WasiSdkVersion).tar.gz $(_WasiSdkUrl) &amp;&amp; tar --strip-components=1 -xzmf wasi-sdk-$(_WasiSdkVersion).tar.gz -C $(_RuntimeLocalWasiSdkPath)"
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says the Linux curl invocation adds --retry-all-errors, but the updated command line doesn’t include that flag. To avoid confusion, either update the description to match the actual change, or add --retry-all-errors (if supported/acceptable for the target curl versions).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants