mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-05-03 07:22:27 +00:00
71d49b049e
When including resources in the package and packaging on Ubuntu, `FileManager` throws a FilePermission error. The docker daemon runs as root and files to be copied are owned by `root` while the archiver runs as the current user (`ubuntu` on EC2 Ubuntu). The `FileManager` manages to copy the files but throws an error after the copy. We suspect the `FileManager` to perform some kind of operation after the copy and it fails because of the `root` permission of the files. See https://github.com/swift-server/swift-aws-lambda-runtime/issues/449#issuecomment-2595978246 for a description of the problem. This PR contains code to reproduce the problem, a very simple workaround, and an integration test. The workaround consists of - trapping all errors - verify if the error is the permission error (Code = 513) - verify if the files have been copied or not - if the two above conditions are met, ignore the error, otherwise re-throw it I would rather prefer a solution that solves the root cause rather than just ignoring the error. We're still investigating the root cause (see [this thread](https://forums.swift.org/t/filemanager-copyitem-on-linux-fails-after-copying-the-files/77282) on the Swift Forum and this issue on Swift Foundation https://github.com/swiftlang/swift-foundation/issues/1125
2 lines
12 B
Plaintext
2 lines
12 B
Plaintext
Hello World
|