Testing and Deployment
A Python Lambda deployment package contains a native library built on a developer's macOS laptop. The function fails to import the library on its x86_64 Lambda runtime. What should the developer do?
Show the answer
Correct answerB. Build the library for the function's Linux environment and architecture.
AWhy not this: More memory does not resolve operating system or architecture incompatibility.
BWhy this is right: Building for the target Linux environment and x86_64 architecture produces a compatible native dependency.
CWhy not this: Changing the search path cannot make an incompatible native binary load successfully.
DWhy not this: A layer does not make a macOS native binary compatible with the Lambda Linux environment.
Native dependencies must be compatible with the Lambda runtime's operating system and processor architecture. Moving an incompatible binary into a Lambda layer changes its packaging, not its compatibility.