Comments (14)
Agree, please open an issue in the aws-sdk-swift repo and an engineer can take a look:
https://github.com/awslabs/aws-sdk-swift
from swift-aws-lambda-runtime.
this looks to be an issue with aws-sdk-swift
?
from swift-aws-lambda-runtime.
cc @dave-moser
from swift-aws-lambda-runtime.
That was my first impression, but building the solution works as expected (no errors). The error only appears when the archive
operation was performed.
I also tested with different aws-sdk versions and the results after archiving were the same error.
But if I remove the aws-sdk from the package the archive
operations ends as expected.
I think the error is a mix between the archive
and the aws-sdk, even it's not an error, it's a kind of perfect storm building procedure.
from swift-aws-lambda-runtime.
perhaps the docker image does not have all the required bits?
from swift-aws-lambda-runtime.
Maybe, I didn't test with another docker image... 😮
from swift-aws-lambda-runtime.
I have use the Amazon Linux 2 image for Swift 5.6 and 5.7.2, but the issue remains.
Inside my package I changed the swift tool version when launch tests agains Swift 5.6
// swift-tools-version: 5.6
Swift 5.6
Below this lines is the archive
command setting Swift version to 5.6. The Amazon Linux 2 docker image was pulled and used as expected thanks to the new --swift-version
argument 👍
swift package --disable-sandbox archive --output-path /Users/adolfo/Desktop --verbose 2 --swift-version 5.6
The command output is the following:
-------------------------------------------------------------------------
configuration
-------------------------------------------------------------------------
{
outputDirectory: /Users/adolfo/Desktop
products: ["Favorites"]
buildConfiguration: release
baseDockerImage: swift:5.6-amazonlinux2
}
-------------------------------------------------------------------------
building "awslambdabackend" in docker
-------------------------------------------------------------------------
updating "swift:5.6-amazonlinux2" docker image
5.6-amazonlinux2: Pulling from library/swift
Digest: sha256:450a6cbb1028de5947a49dc18bc9f4eece87c16432e12ca6073666401d9106b9
Status: Image is up to date for swift:5.6-amazonlinux2
docker.io/library/swift:5.6-amazonlinux2
/usr/local/bin/docker run --rm -v /Users/adolfo/Documents/Globant/AWS Lambda Tech Talk/Lambdas/AWSLambdaBackend:/workspace -w /workspace swift:5.6-amazonlinux2 bash -cl swift build -c release --show-bin-path
/workspace/.build/aarch64-unknown-linux-gnu/release
building "Favorites"
/usr/local/bin/docker run --rm -v /Users/adolfo/Documents/Globant/AWS Lambda Tech Talk/Lambdas/AWSLambdaBackend:/workspace -w /workspace swift:5.6-amazonlinux2 bash -cl swift build -c release --product Favorites --static-swift-stdlib
'swift-aws-lambda-events': error: package 'swift-aws-lambda-events' is using Swift tools version 5.7.0 but the installed version is 5.6.3
'swift-aws-lambda-runtime'
:
error:
package 'swift-aws-lambda-runtime' is using Swift tools version 5.7.0 but the installed version is 5.6.3
'swift-aws-lambda-runtime': error: package 'swift-aws-lambda-runtime' is using Swift tools version 5.7.0 but the installed version is 5.6.3
'swift-aws-lambda-events': error: package 'swift-aws-lambda-events' is using Swift tools version 5.7.0 but the installed version is 5.6.3
'swift-aws-lambda-runtime': error: package 'swift-aws-lambda-runtime' is using Swift tools version 5.7.0 but the installed version is 5.6.3
'swift-aws-lambda-events': error: package 'swift-aws-lambda-events' is using Swift tools version 5.7.0 but the installed version is 5.6.3
'aws-crt-swift': error: target 'S2N' has invalid header layout: umbrella header found at '/workspace/.build/checkouts/aws-crt-swift/aws-common-runtime/s2n/api/S2N.h', but directories exist next to it: /workspace/.build/checkouts/aws-crt-swift/aws-common-runtime/s2n/api/unstable; consider removing them
error: /usr/local/bin/docker run --rm -v /Users/adolfo/Documents/Globant/AWS Lambda Tech Talk/Lambdas/AWSLambdaBackend:/workspace -w /workspace swift:5.6-amazonlinux2 bash -cl swift build -c release --product Favorites --static-swift-stdlib failed with code 1
There are errors related to the Swift tools version but the Umbrella header issue still remains.
Swift 5.7.2
Command:
swift package --disable-sandbox archive --output-path /Users/adolfo/Desktop --verbose 2 --swift-version 5.7.2
Output:
-------------------------------------------------------------------------
configuration
-------------------------------------------------------------------------
{
outputDirectory: /Users/adolfo/Desktop
products: ["Favorites"]
buildConfiguration: release
baseDockerImage: swift:5.7.2-amazonlinux2
}
-------------------------------------------------------------------------
building "awslambdabackend" in docker
-------------------------------------------------------------------------
updating "swift:5.7.2-amazonlinux2" docker image
5.7.2-amazonlinux2: Pulling from library/swift
Digest: sha256:4ac1263265156f50514e8d8e5162d042b8e7d914511b6be02fc1603afbac6745
Status: Image is up to date for swift:5.7.2-amazonlinux2
docker.io/library/swift:5.7.2-amazonlinux2
/usr/local/bin/docker run --rm -v /Users/adolfo/Documents/Globant/AWS Lambda Tech Talk/Lambdas/AWSLambdaBackend:/workspace -w /workspace swift:5.7.2-amazonlinux2 bash -cl swift build -c release --show-bin-path
/workspace/.build/aarch64-unknown-linux-gnu/release
building "Favorites"
/usr/local/bin/docker run --rm -v /Users/adolfo/Documents/Globant/AWS Lambda Tech Talk/Lambdas/AWSLambdaBackend:/workspace -w /workspace swift:5.7.2-amazonlinux2 bash -cl swift build -c release --product Favorites --static-swift-stdlib
error: 'aws-crt-swift': target 'S2N' has invalid header layout: umbrella header found at '/workspace/.build/checkouts/aws-crt-swift/aws-common-runtime/s2n/api/S2N.h', but directories exist next to it: /workspace/.build/checkouts/aws-crt-swift/aws-common-runtime/s2n/api/unstable; consider removing them
error: /usr/local/bin/docker run --rm -v /Users/adolfo/Documents/Globant/AWS Lambda Tech Talk/Lambdas/AWSLambdaBackend:/workspace -w /workspace swift:5.7.2-amazonlinux2 bash -cl swift build -c release --product Favorites --static-swift-stdlib failed with code 1
The Swift tool version error now is solved but the Umbrella header issue remains.
from swift-aws-lambda-runtime.
I think we need someone from the aws-sdk project to weight in on this, seems like an issue compiling that library in the docker container
from swift-aws-lambda-runtime.
Indeed.
Do you know if there is an Amazon engineer collaborating in this repo?
If no one is available maybe we can post this issue in the Swift Forums or open a new issue in the AWS-SDK repo
from swift-aws-lambda-runtime.
+1
Also seeing this issue:
/usr/local/bin/docker run --rm -v /Users/jeremy/Projects/xcode-cloud-lambda:/workspace -w /workspace swift:amazonlinux2 bash -cl swift build -c release --product XcodeCloudLambda --static-swift-stdlib failed with code 1
from swift-aws-lambda-runtime.
The last news about this issue is that the issue opened at the aws-sdk-swift has been moved to the aws-crt-swift team.
The related issue is 👉 awslabs/aws-crt-swift#163 and is planned for 2023 Q2.
from swift-aws-lambda-runtime.
Glad to see this is active on the aws-crt-swift project, and it's been successfully reproduced. Are there any known workarounds to this issue (are there any known older versions of the AWS libraries that work, for example), or should alternate libraries be evaluated in the meantime?
from swift-aws-lambda-runtime.
Hi @mattcorey
I'm using Soto SDK and works really well.
from swift-aws-lambda-runtime.
News from Amazon CRT team. The issue is solved at 0.12.0
release.
More info at 👉 awslabs/aws-crt-swift#163
from swift-aws-lambda-runtime.
Related Issues (20)
- Totally remove dependency on Foundation HOT 3
- Runtime not populating `APIGateway.V2.Request` properties HOT 1
- Support bootstrapping the LoggingSystem in Lambda.run's factory
- Use primary associated type to reduce boilerplate HOT 1
- Plugin does not work HOT 4
- [plugin] Provided Examples' Package.swift does not work with the archive plugin. HOT 2
- [plugin] LocalDebugging example - archive fails because of Shared code HOT 3
- Replacement for Lambda.run? HOT 5
- How to fix newline in input causing Swift AWS lambda to fail in localhost testing HOT 2
- README.MD example about SimpleLambdaHandler HOT 3
- Discussions repository Feature HOT 5
- Archive plugin to generate libraries (*.so) HOT 2
- [Request] Support Serverless Framework with a plugin? HOT 6
- [Idea] Could Lambda Layers Custom Runtime improve cold start performance? HOT 3
- [Feature Request] Somehow don't touch Package.resolved during lambda package archive to work better with VSCode. HOT 1
- [BUG] Can't compile code with NSFileCoordinator (cannot find in scope) HOT 3
- CI builds fails with Swift 5.9 and Swift nightly HOT 4
- [Question] Can DocC remove license headers from source code file HOT 4
- Add support for SPM Resources HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-aws-lambda-runtime.