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 swift-metrics unzipping #27

Merged
merged 7 commits into from
Jul 1, 2024
Merged

Fix swift-metrics unzipping #27

merged 7 commits into from
Jul 1, 2024

Conversation

finestructure
Copy link
Member

@finestructure finestructure commented Jun 27, 2024

Fixes SwiftPackageIndex/SwiftPackageIndex-Server#3137

The issues are as follows:

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.

  • run unit tests
  • run integration test

@cla-bot cla-bot bot added the cla-signed label Jun 27, 2024
@@ -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"),
Copy link
Member Author

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()
}
Copy link
Member Author

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.

@finestructure finestructure changed the title Regression test Fix swift-metrics unzipping Jun 27, 2024
@finestructure finestructure merged commit a9e4d1f into main Jul 1, 2024
2 checks passed
@finestructure finestructure deleted the regression-test branch July 1, 2024 15:26
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.

Properly fix doc generation issue
2 participants