utils.pwsh: Add support for curl resume #232
Merged
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.
Description
Note that there is a bug in curl that can prevent curl from successfully interpreting a fully downloaded file as completed. The bug was fixed on October 30, 2023 and is not yet available on curl included with Windows.
Fixed in curl 8.5.0.
curl/curl@225db91
Motivation and Context
I noticed that we have the Resume parameter, but that it wasn't implemented. I wanted to implement it to have a way to skip re-downloading a file that was already downloaded. SkipDeps skips build dependencies. SkipUnpack skips git checkouts and archive extraction but not downloads.
Alternatively, we could add something like SkipDownload and implement that, and remove the Resume parameter.
It may be important to note that due to us invoking MSYS2, the copy of curl from there can take precedence in PATH. From my recent tests, MSYS2 curl (8.1.1 on my machine) is older than the one shipped with Windows, so this may not work unless we attempt to fix the curl executable's path to the Windows copy (which should always be at
C:\Windows\System32\curl.exe
) or locate it and save its path before invoking MSYS2 (withwhere.exe curl.exe
).How Has This Been Tested?
Tested locally with curl 8.4.0 (what is currently shipped on Windows) to ensure that the code did not currently run.
Types of changes
Checklist: