Skip to content

remove SourceArchiver #3874

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

Merged
merged 2 commits into from
Nov 18, 2021
Merged

remove SourceArchiver #3874

merged 2 commits into from
Nov 18, 2021

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Nov 18, 2021

motivation: SourceArchiver was introduced in RegistryClient but adds a system depedency on bsdtar

changes:

  • remove SourceArchiver
  • change RegistryClient to use ZipArchiver
  • add utility to strip first level of a directory and use that in RegistryClient
  • add tests

motivation: SourceArchiver was introduced in RegistryClient but adds a system depedency on bsdtar

changes:
* remove SourceArchiver
* change RegistryClient to use ZipArchiver
* add utility to strip first level of a directory and use that in RegistryClient
* add tests
@tomerd
Copy link
Contributor Author

tomerd commented Nov 18, 2021

@swift-ci please smoke test

// TODO: consider calling `libarchive` or some other library directly instead of spawning a process
DispatchQueue.sharedConcurrent.async {
do {
let result = try Process.popen(args: "bsdtar",
Copy link
Contributor Author

@tomerd tomerd Nov 18, 2021

Choose a reason for hiding this comment

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

bsdtar is a new system dependency and the reason it was introduced as explained above (see code comment) was for stripping the top level directory. this PR basically rolls back that and uses unzip which SwiftPM already relies on (and as such is already a system dependency) and handles stripping programmatically after the unzipping

completion(result.mapError { error in
completion(result.tryMap {
// strip first level component
try fileSystem.stripFirstLevel(of: destinationPath)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yim-lee we would need to adopt this also in the compatibility test suite and update the fixtures accordingly

@tomerd
Copy link
Contributor Author

tomerd commented Nov 18, 2021

@swift-ci please smoke test

@tomerd tomerd merged commit 6131cf8 into swiftlang:main Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants