From 56a9c19c8a72e9cd3ed1a014f88186d05d15c56d Mon Sep 17 00:00:00 2001 From: "(Eliseo) Nathaniel Ruiz Nowell" Date: Wed, 1 Dec 2021 16:17:08 -0800 Subject: [PATCH] Support arm64 for .NET and Go Sample Lambda Funcs --- .../aws-sdk/wrapper/SampleApps/build.sh | 20 ++++++++++++++++++- go/sample-apps/function/build.sh | 4 +++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dotnet/sample-apps/aws-sdk/wrapper/SampleApps/build.sh b/dotnet/sample-apps/aws-sdk/wrapper/SampleApps/build.sh index ccb60e3e1f..105e73f209 100755 --- a/dotnet/sample-apps/aws-sdk/wrapper/SampleApps/build.sh +++ b/dotnet/sample-apps/aws-sdk/wrapper/SampleApps/build.sh @@ -1,6 +1,24 @@ #!/bin/sh +GOARCH=${GOARCH-amd64} + +# Chosen from Microsoft's documentation for Runtime Identifier (RIDs) +# See more: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#linux-rids +if [ $GOARCH = "amd64" ]; then + DOTNET_LINUX_ARCH=x64 +elif [ $GOARCH = "arm64" ]; then + DOTNET_LINUX_ARCH=arm64 +else + echo "Invalid GOARCH value `$GOARCH` received." + exit 2 +fi + mkdir -p build/dotnet -dotnet publish --output "./build/dotnet" --configuration "Release" --framework "netcoreapp3.1" /p:GenerateRuntimeConfigurationFiles=true --runtime linux-x64 --self-contained false +dotnet publish \ + --output "./build/dotnet" \ + --configuration "Release" \ + --framework "netcoreapp3.1" /p:GenerateRuntimeConfigurationFiles=true \ + --runtime linux-$DOTNET_LINUX_ARCH \ + --self-contained false cd build/dotnet || exit zip -r ../function.zip * diff --git a/go/sample-apps/function/build.sh b/go/sample-apps/function/build.sh index f03c9907ee..f14795bde7 100755 --- a/go/sample-apps/function/build.sh +++ b/go/sample-apps/function/build.sh @@ -1,6 +1,8 @@ #!/bin/sh +GOARCH=${GOARCH-amd64} + mkdir -p build -GOOS=linux GOARCH=amd64 go build -o ./build/bootstrap . +GOOS=linux go build -o ./build/bootstrap . cd build || exit zip bootstrap.zip bootstrap