Skip to content

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