Closed jrosen081 closed 1 month ago
Thank for the quick reaction about this. The local debugging example was based on v1 and will disappear.
I will test your changes on a test project I have. If all goes well, I will merge this PR and later remove the LocalDebugging Example
@jrosen081 can you run our Swift Format script and add the changes to the commit ? We use teh script from the Swift NIO project, here is how I run it (I'll work on a more integrated / automatic version as soon as I manage to land the last 34 PRs)
.build/checkouts/swift-nio/scripts/check-swift-format.sh .
Thank you
@jrosen081 I just tested against #385 and this PR solves it also. Thank you As soon as you fix the swift-format issue. I'll merge the changes
.build/checkouts/swift-nio/scripts/check-swift-format.sh
Hmmm when trying to run it, I get the following error:
/Users/jackrosen/code/swift-aws-lambda-runtime/Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift:30:26: error: unexpected code in parameter clause
Looks like it complains about sending Handler
, but that should be fine in Swift 6 I think. And I am using Swift 6 based on the response I get from swift --version
:
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
I'm not sure how to proceed from here
.build/checkouts/swift-nio/scripts/check-swift-format.sh
Hmmm when trying to run it, I get the following error:
/Users/jackrosen/code/swift-aws-lambda-runtime/Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift:30:26: error: unexpected code in parameter clause
Looks like it complains about
sending Handler
, but that should be fine in Swift 6 I think. And I am using Swift 6 based on the response I get fromswift --version
:swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
I'm not sure how to proceed from here
It actually did run the formatter, but failed after my changes. PR is updated with formatting
Adds support for copying all resources (from all dependencies) into the final executable when packaging for aws lambda.
Motivation:
Closes #367 (and I believe #385 as well).
When an external dependency has resources in SPM, the packager would not copy them into the final executable. This caused an issue on launch where swift would try to create the resources, but this would fail to package. This fixes this.
Modifications:
Updated the packager to go through the build artifact and copy all
.resources
files into the new zip. This also adds a dependency to theLocalDebugging
package so that I could test with that.I also made some small updates to the packager to get them working locally with the new package directory setup (changing from 2 levels deep of folder nesting to 3).
Result:
I couldn't find any automated tests for the packager (I might have missed them), but to test this locally, I applied the following diff (to make the project build):
and then ran
LAMBDA_USE_LOCAL_DEPS=true swift package archive --disable-sandbox
in theMyLambda
folder. This then created a zip that had both thebootstrap
and theShared_Shared.resources
in it.