Add curl retry flags to wasi-sdk Linux download#125488
Add curl retry flags to wasi-sdk Linux download#125488
Conversation
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>
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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) && 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) && tar --strip-components=1 -xzmf wasi-sdk-$(_WasiSdkVersion).tar.gz -C $(_RuntimeLocalWasiSdkPath)" |
There was a problem hiding this comment.
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).
Summary
The Linux
curlcommand inAcquireWasiSdk.targetshas no retry logic, unlike the Windowsdownload-wasi-sdk.ps1which 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 cryptictarerror:Change
Add
--retry 3 --retry-delay 5 --retry-all-errorsto the Linux curl invocation:--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 errorsMotivation
Build 2924549 failed on
Linux_Alpine_x64due 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