-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sam build fails with Python layer with makefile BuildMethod #2845
Comments
Hi @AbeGellis, I've tried your example, and I was able to build my layer with following;
One note, Please let us know if you still experience the issue. |
That seems to have done the trick! I'm on If anyone else stumbles into this, I put the .py files and the formerly problematic
since Thanks for your help! |
|
i have install make but also give error, |
Description:
I have a Python 3.8 application in which I am attempting to include the psycopg2-binary library as a layer. I have already built the library against AWS Linux using EC2 and have been able to create and manage this layer within the Lambda console. However, integrating it into the sam workflow is proving troublesome.
When I specify a "python3.8" BuildMethod in my template.yaml, I encounter a similar issue to #1360: there are a number of .so files that I want to include which are automatically omitted from the deployed layer.
Since all I really need to do is copy the contents of my layer directory, I set BuildMethod to "makefile" and added a simple Makefile file to the ContentUri directory. This, however, never seems to be executed, and sam produces a somewhat incoherent error instead, as if I had requested a nonexistent build runtime.
Steps to reproduce:
On AWS Linux, install psycopg2-binary via pip to a target directory.
Copy that installation to a subdirectory of a sam project. In my case this was "layers/psycopg2-binary"
Add the following to template.yaml:
Add a file named "Makefile" to the same subdirectory, with the contents:
Execute the command
sam build psycopg2binary --debug
from the root directory of the sam project.Observed result:
From the debug logs it seems to recognize that I'm trying to use a custom makefile, but the last line makes it seem as though it's still attempting to build psycopg2binary with an unspecified workflow.
Expected result:
"executing makefile" to be output in the command line, and the layer copied into the destination directory.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.23.0The text was updated successfully, but these errors were encountered: