-
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 local build does not copy .so files #1360
Comments
This is indeed a bug. We intentionally ignore certain files, .so files are one of them - https://github.com/awslabs/aws-lambda-builders/blob/develop/aws_lambda_builders/workflows/python_pip/workflow.py#L27 The intention behind excluding .so files is to prevent people from inadvertently including .so files built for one platform (say Mac) and hoping it will run on Lambda. Since ptvsd produces .so files it needs to be compiled for the Lambda environment. I would recommend adding ptvsd to your requirements.txt during development and removing it before you push to production. If this works, I can update the documentation to reflect the "sam build" usecase as well. Of course, it will be easier if |
I tried adding My current workaround is to run the following after the build step, which eliminates the error
|
Are there any plans to support some kind of |
I've precompiled |
This feature will be useful for certain libraries that require .so files |
We have a few issues asking for a similar thing in |
|
Description
The build process doesn't copy over .so files when building a Python Lambda function.
Steps to reproduce
Install the
ptvsd
library:Build a Lambda function that uses
ptvsd
The template file should include a reference to the
package
folder noted earlier (likeCodeUri: ../package
).Observed result
When following the
ptvsd
debugging steps, the following error is thrown from thesam local invoke
process:Looking into the
.aws-sam/build/Function/ptvsd/pydevd/pydevd_attach_to_process
folder, I can confirm the.so
files were not copied over. Looking inpackage/ptvsd/_vendored/pydevd/pydevd_attach_to_process
, I can confirm that the.so
files are present.Expected result
Debugging process runs without error.
The text was updated successfully, but these errors were encountered: