Skip to content

Doesn't compile with the Linux Static SDK (aka musl) #330

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

Closed
sebsto opened this issue Jun 19, 2024 · 0 comments · Fixed by #331
Closed

Doesn't compile with the Linux Static SDK (aka musl) #330

sebsto opened this issue Jun 19, 2024 · 0 comments · Fixed by #331
Assignees
Labels
kind/enhancement Improvements to existing feature.

Comments

@sebsto
Copy link
Contributor

sebsto commented Jun 19, 2024

Expected behavior

Now that the Static Linux SDK has been released, it open the doors to cross-paltform compilation from Mac that doesn't require Docker or depend on Amazon Linux.
In theory the binary created with the Static Linux SDK should work "as is" on AWS Lambda.

To make this happen, the AWS Lambda Runtime must slightly adjust the way it detects Linux and import Glibc.

I'll send a PR to fix this in a moment.

Actual behavior

Compilation errors such as

swift-aws-lambda-runtime/Sources/AWSLambdaRuntimeCore/Lambda.swift:16:8: error: no such module 'Glibc'
 14 | 
 15 | #if os(Linux)
 16 | import Glibc
    |        `- error: no such module 'Glibc'
 17 | #else
 18 | import Darwin.C

Steps to reproduce

  1. Install the Linux Static SDK (doc)
  2. Apply the patch as described in this message
  3. Compile with swift build --swift-sdk aarch64-swift-linux-musl

If possible, minimal yet complete reproducer code (or URL to code)

No response

What version of this project (swift-aws-lambda-runtime) are you using?

1.0.0-alpha1

Swift version

✗ swift --version && uname -a 
Apple Swift version 6.0-dev (LLVM 6e13b8be259f20f, Swift 372de4670b9cd55)
Target: arm64-apple-macosx14.0
Darwin bcd07458a91c 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64

Amazon Linux 2 docker image version

No response

@sebsto sebsto added the kind/enhancement Improvements to existing feature. label Jun 19, 2024
@sebsto sebsto self-assigned this Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements to existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant