Coder Social home page Coder Social logo

Comments (14)

dave-moser avatar dave-moser commented on July 17, 2024 1

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.

tomerd avatar tomerd commented on July 17, 2024

this looks to be an issue with aws-sdk-swift?

from swift-aws-lambda-runtime.

tomerd avatar tomerd commented on July 17, 2024

cc @dave-moser

from swift-aws-lambda-runtime.

fitomad avatar fitomad commented on July 17, 2024

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.

tomerd avatar tomerd commented on July 17, 2024

perhaps the docker image does not have all the required bits?

from swift-aws-lambda-runtime.

fitomad avatar fitomad commented on July 17, 2024

Maybe, I didn't test with another docker image... 😮

from swift-aws-lambda-runtime.

fitomad avatar fitomad commented on July 17, 2024

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.

tomerd avatar tomerd commented on July 17, 2024

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.

fitomad avatar fitomad commented on July 17, 2024

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.

jagreenwood avatar jagreenwood commented on July 17, 2024

+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.

fitomad avatar fitomad commented on July 17, 2024

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.

mattcorey avatar mattcorey commented on July 17, 2024

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.

fitomad avatar fitomad commented on July 17, 2024

Hi @mattcorey

I'm using Soto SDK and works really well.

from swift-aws-lambda-runtime.

fitomad avatar fitomad commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.