-
Notifications
You must be signed in to change notification settings - Fork 0
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 swift-metrics unzipping #27
Conversation
@@ -40,7 +40,7 @@ let package = Package( | |||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "0.1.0"), | |||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha.1"), | |||
.package(url: "https://github.com/soto-project/soto-s3-file-transfer.git", from: "1.2.0"), | |||
.package(url: "https://github.com/weichsel/ZIPFoundation.git", from: "0.9.19"), | |||
.package(url: "https://github.com/marmelroy/Zip.git", from: "2.1.2"), |
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.
We can't use ZIPFoundation, because it doesn't actually zip directories recursively. Best I can tell there's no way to do it other than by listing all the files ourselves. marmelroy/Zip
supports that, so it's easier to stick with it for now.
let unzip = URL(fileURLWithPath: "/usr/bin/unzip") | ||
let process = try Process.run(unzip, arguments: ["-q", inputPath.path, "-d", outputPath.path]) | ||
process.waitUntilExit() | ||
} |
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.
I've verified that /usr/bin/unzip
is available at that path on the amazon linux image.
Fixes SwiftPackageIndex/SwiftPackageIndex-Server#3137
The issues are as follows:
uploading
stage SwiftPackageIndex-Server#3069)The easiest way to deal with this mess is to simply keep using marmelroy/Zip but fall back to os level unzip when it fails.