bun icon indicating copy to clipboard operation
bun copied to clipboard

Support AWS Lambda layer running bun

Open efiShtain opened this issue 3 years ago • 6 comments
trafficstars

Hey

Is there a lambda layer for running bun instead of node?

efiShtain avatar Jul 07 '22 11:07 efiShtain

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

TobiasGeiselmann avatar Jul 07 '22 12:07 TobiasGeiselmann

There are two problems:

  1. Bun depends on a version of GLIBC that is too new
  2. Bun depends on io_uring

Both need to be fixed

Jarred-Sumner avatar Jul 08 '22 03:07 Jarred-Sumner

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?

  1. glibc updated to v2.34
  2. liburing is a newly included package

ghostfuel avatar Jul 29 '22 13:07 ghostfuel

@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 ?

efiShtain avatar Aug 20 '22 09:08 efiShtain

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

lightpriest avatar Oct 03 '22 14:10 lightpriest

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 avatar Dec 07 '22 16:12 Electroid

@Electroid will there be instructions in the docs on how to use Bun with AWS Lambda? Is there gonna be a Bun3 runtime?

aprilmintacpineda avatar Feb 23 '23 01:02 aprilmintacpineda