Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-tarballed SDK installation with remote URL #7312

Conversation

kateinoigakukun
Copy link
Member

Motivation:

4714ea9 introduced a regression where non-tarball SDKs could not be installed from a remote URL due to the wrong assumption that the downloaded file would always be a tarball.

This issue exists in 5.10 release branch, so will cherry-pick after merging this PR.

Modifications:

This commit fixes the issue by checking the file extension part of the URL for every supported archive format, then falling back to the tarball format if no supported extension is found.

Result:

Non-tarball SDK artifact bundles can be installed from remote URL.

4714ea9 introduced a regression where non-tarball SDKs could not be
installed from a remote URL due to the wrong assumption that the
downloaded file would always be a tarball. This commit fixes the issue
by checking the file extension part of the URL for every supported
archive format, then falling back to the tarball format if no supported
extension is found.
@kateinoigakukun
Copy link
Member Author

@swift-ci Please smoke test

@kateinoigakukun
Copy link
Member Author

@swift-ci Please test

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Great catch, thanks!

@kateinoigakukun kateinoigakukun merged commit 5b1fe44 into swiftlang:main Feb 5, 2024
5 checks passed
@kateinoigakukun kateinoigakukun deleted the yt/fix-non-tarball-sdk-url-install branch February 5, 2024 11:43
kateinoigakukun added a commit to kateinoigakukun/swift-package-manager that referenced this pull request Feb 5, 2024
### Motivation:

4714ea9 introduced a regression where non-tarball SDKs could not be
installed from a remote URL due to the wrong assumption that the
downloaded file would always be a tarball.

This issue exists in 5.10 release branch, so will cherry-pick after
merging this PR.

### Modifications:

This commit fixes the issue by checking the file extension part of the
URL for every supported archive format, then falling back to the tarball
format if no supported extension is found.

### Result:

Non-tarball SDK artifact bundles can be installed from remote URL.
MaxDesiatov pushed a commit that referenced this pull request Apr 3, 2024
)

* **Explanation**:
4714ea9
introduced a regression where non-tarball SDKs could not be installed
from a remote URL due to the wrong assumption that the downloaded file
would always be a tarball.
* **Scope**: Experimental Swift SDK installation
* **Risk**: Low, only affects to `swift experimental-sdk` command, which
is still experimental. Also doesn't impact other binaries or SwiftPM
clients/libraries.
* **Testing**: Some new unit tests are added in this change.
* **Reviewer**: @MaxDesiatov 
* **Main branch PR**:
#7312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants