Skip to content

Conversation

blimmer
Copy link
Contributor

@blimmer blimmer commented May 27, 2020

This allows dependencies with compiled binaries, such as psycopg2-binary to work properly in the Lambda environment after building.

When the .so files are stripped, the Lambda function will fail with this exception:

[ERROR] Runtime.ImportModuleError: Unable to import module 'main': libpq-3d107b13.so.5.11: ELF load command address/offset not properly aligned

I've tested this change on my project and can confirm that it works as expected for my project.

I came to this conclusion by taking a look at serverless-python-requirements which provides this option and specifically mentions the ELF load command error I was receiving: https://github.com/UnitedIncome/serverless-python-requirements#option-not-to-strip-binaries

Also, thank you for this project! It has been very useful 😄

@tobilg
Copy link
Owner

tobilg commented May 27, 2020

Thanks a lot @blimmer! I made one small comment, could you please check?

@blimmer
Copy link
Contributor Author

blimmer commented May 27, 2020

Hey @tobilg - no problem. I don't see any comments on the files or the commit. Could you point me in the right direction? I'm happy to take a look.

@tobilg
Copy link
Owner

tobilg commented May 27, 2020

@blimmer sorry, this somehow got stuck in the GitHub App

This allows dependencies with compiled binaries, such as psycopg2-binary to work properly in the Lambda environment after building.
@blimmer blimmer force-pushed the add-flag-to-strip-so-strip branch from b24d884 to 175a1eb Compare May 27, 2020 18:51
@blimmer
Copy link
Contributor Author

blimmer commented May 27, 2020

No problem! Update made.

@tobilg tobilg merged commit bba9d83 into tobilg:master May 27, 2020
@tobilg
Copy link
Owner

tobilg commented May 27, 2020

Thanks a lot @blimmer!

@blimmer
Copy link
Contributor Author

blimmer commented May 27, 2020

No problem - thanks for the fast review and, more generally, this project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants