aws-samples / serverless-dotnet-demo

MIT No Attribution
142 stars 37 forks source link

.NET 7 AOTNative for ARM64 #9

Closed phillip-haydon closed 1 year ago

phillip-haydon commented 1 year ago

It seems that .NET 7 AOTNative wont work for ARM64?

Failed to load /var/task/libcoreclr.so, error: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /var/task/libcoreclr.so)

Will this get fixed? I assume AWS wont support .NET 7 natively and we will be required to use the custom bootstrap, and we will need to wait for .NET 8 for native support. But I would assume the issue with .NET 7 will exist in .NET 8?

slang25 commented 1 year ago

From my understanding of the current issue, the .NET team will be looking at other ways to build dotnet in a way that will be easier to control native dependency versions, but that will likely be a .NET 8 and up thing. See this discussion, this specific issue is around the unique combination of kernel version and glibc version that are shipped with AL2.

For now (in the .NET 7 timeframe) we'll need to wait for AWS to update the runtime distro to AL2022.

phillip-haydon commented 1 year ago

Oh I'm dying for AL2022, wish it would hurry up so I can ditch Ubuntu :D

Guess for now I'll keep my lambda's as x64. Thanks.

jeastham1993 commented 1 year ago

@phillip-haydon what @slang25 says is correct. Amazon Linux 2 is based on CentOS which if you look at the Microsoft docs only supports x86.

That said, I'm going to do some work in the next week or so with .NET 7 native AOT in a container on Lambda. That should unlock .NET 7 on ARM, I'll keep this issue open for the moment and report back when I get them benchmarks added.

jeastham1993 commented 1 year ago

@phillip-haydon @slang25 a short update on this, I have got .NET 7 native AOT running on ARM in an Alpine based container. So it's possible. The challenge I have at the moment is I'm compiling the code on an ARM based Ubuntu machine, and of course SAM doesn't run on ARM. Just trying to write up a way to make build, push and deploy simpler then I'll publish it to this repo.

normj commented 1 year ago

I don't have write permissions to close this but Microsoft has released new versions of .NET 7 for ARM that are compatible with Amazon Linux 2 and our .NET Lambda packaging tool has been updated to support creating .NET 7 AOT ARM functions. So this issue can be closed.