-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
remove SourceArchiver #3874
Conversation
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
@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", |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
@swift-ci please smoke test |
motivation: SourceArchiver was introduced in RegistryClient but adds a system depedency on bsdtar
changes: