Skip to content

Packaging Python lambda layer fails to include platlib libraries (lib64) #13529

@conviviumtools

Description

@conviviumtools

How did you install the Amplify CLI?

No response

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

latest

What operating system are you using?

Amazon Linux 2

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

Added a lambda function, edited the function, and pushed.

Describe the bug

This function fails to include lib64 libraries when packaging up dependencies for execution on a Lambda function in service contexts. On Amazon Linux 2 (and some other Linux distros) platlib != purelib, so lib != lib64. All of the libraries in pipenv are necessary for executing Lambda functions, not just the purelib ones.

Expected behavior

I would expect both lib and lib64 to be packaged up, but lib64 is ignored.

Reproduction steps

Include a Python library with a platlib on Amazon Linux 2 (e.g. charset-normalizer, a dependency of requests) in an amplify-specified Lambda function. amplify push from an instance running Amazon Linux 2 where context.service is true (for example, one of the pre-provisioned build instances). The Lambda function will fail to import all lib64 libraries.

Project Identifier

No response

Log output

Details
# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest a new featurefunctionsIssues tied to the functions category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions