bun
bun copied to clipboard
Support AWS Lambda layer running bun
Hey
Is there a lambda layer for running bun instead of node?
Been trying to build a Lambda layer with the bun executable. The problem is that custom runtimes are based on Amazon Linux 2, which comes with GLIBC v2.26, but bun needs v2.27 or newer. This means that bun will not be usable in a Lambda function with custom runtime (or an EC2 instance with Amazon Linux 2).
There are two problems:
- Bun depends on a version of GLIBC that is too new
- Bun depends on io_uring
Both need to be fixed
Only recently have my eye on Bun, looking forward to trying it out in anger sometime!
For AWS Lambda Layer compatibility, for the problems 1,2 listed above - it appears Amazon Linux 2022 (in preview, not yet released and no date announced for Lambda runtime) may well solve both of these if I'm reading it right?
@GSt4r Didn't touch base on c lately Is it possible to statically link the relevant glibc to bun instead of using the system's version ?
@GSt4r Didn't touch base on c lately Is it possible to statically link the relevant glibc to bun instead of using the system's version ?
Aside from io_uring, there will probably be some ABI compatibility issues.
This should now be possible, we've tested Bun 0.3.0 on Amazon Linux 2 and it works. (though work still needs to be done to wire up the Lambda Layer)
@Electroid will there be instructions in the docs on how to use Bun with AWS Lambda? Is there gonna be a Bun3 runtime?