-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go modules builder fails when using local module with provisioned.AL2 runtime #285
Comments
Any update on this? I have also noticed in Python projects, if you have local modules you want to share across functions that SAM build does not include those either. Seems the way to get around it is to do some layers voodoo but that seems like complete overkill for something that works natively. |
@sliedig, the problem is with I am about to open an issue myself asking why we even have the scratch path for the custom makefile builder and all the issues I see with it. |
Description:
Using
sam build
in go projects with a dependency on a local module fails when the function runtime isRuntime: provided.al2
Steps to reproduce the issue:
sam init --name sam-app --runtime go1.x --dependency-manager mod --app-template hello-world
go mod init hello-go/models
add a new go file called person.go add this code
sam build
sam local invoke "HelloWorldFunction"
you should see the output (with your IP address)Update the sam template to use Amazon Linux 2 instead of the managed runtime.
In the function definition replace handler and runtime properties, and the Metadata resource attribute
sam build
. The build now fails.Observed result:
Expected result:
I would expect the sam build system to correctly build my application irrespective of whether I am using go as a managed runtime or on AL2.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
OS: Darwin x64 20.6.0
go version go1.17.1 darwin/amd64
SAM CLI, version 1.32.0
The text was updated successfully, but these errors were encountered: