softprops / serverless-rust

⚡ 🦀 a serverless framework plugin for rustlang applications
https://www.npmjs.com/package/serverless-rust
MIT License
545 stars 82 forks source link

Support building for al2 with GNU + glibc 2.26 #100

Closed seanpianka closed 1 year ago

seanpianka commented 3 years ago

What did you implement:

I modified the build script to invoke the compiler for GNU instead of MUSL, with inspiration from here and here. glibc 2.26 must be available locally.

How did you verify your change:

I built and deployed an app to lambda with al2 that was compiled with these changes.

What (if anything) would need to be called out in the CHANGELOG for the next release:

We'd need a way to switch the target args, rust flags, and chosen compiler executable between MUSL and GNU.

ghost commented 3 years ago

This would be great to have since Amazon Linux 1 has ended it's standard support now: https://aws.amazon.com/blogs/aws/update-on-amazon-linux-ami-end-of-life/ https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/

rib commented 2 years ago

In case anyone has looked at using these rust toochain docker images forked/updated from softprops repos: https://github.com/rust-serverless/lambda-rust they are based on the newer Amazon Linux 2 runtime (provided.al2) which will require this change.