Skip to content
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

pythonRequirements.zip contains Mac .so files even with slim: true #760

Open
3 tasks done
tibbe opened this issue Feb 15, 2023 · 1 comment
Open
3 tasks done

pythonRequirements.zip contains Mac .so files even with slim: true #760

tibbe opened this issue Feb 15, 2023 · 1 comment

Comments

@tibbe
Copy link

tibbe commented Feb 15, 2023

Are you certain it's a bug?

  • Yes, it looks like a bug

Are you using the latest plugin release?

  • Yes, I'm using the latest plugin release

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

Looking for what's taking up so much space in our pythonRequirements.zip I found (Mac-specific) .so and .dylib files there:

-rwxr-xr-x  1 tibbe  wheel  3672864 Feb 15 14:42 ./python/PIL/.dylibs/libharfbuzz.0.dylib
-rw-r--r--  1 tibbe  wheel  3901268 Feb 15 14:42 ./python/googleapiclient/discovery_cache/documents/compute.v1.json
-rwxr-xr-x  1 tibbe  wheel  4097242 Feb 15 14:42 ./python/cryptography/hazmat/bindings/_rust.abi3.so
-rw-r--r--  1 tibbe  wheel  4143556 Feb 15 14:42 ./python/googleapiclient/discovery_cache/documents/compute.beta.json
-rw-r--r--  1 tibbe  wheel  4720186 Feb 15 14:42 ./python/googleapiclient/discovery_cache/documents/compute.alpha.json
-rw-r--r--  1 tibbe  wheel  5211997 Feb 15 14:42 ./python/googleapiclient/discovery_cache/documents/contentwarehouse.v1.json
-rwxr-xr-x  1 tibbe  wheel  11614701 Feb 15 14:42 ./python/cryptography/hazmat/bindings/_openssl.abi3.so
-rwxr-xr-x  1 tibbe  wheel  12469896 Feb 15 14:42 ./python/grpc/_cython/cygrpc.cpython-39-darwin.so

Sending these to Lambda doesn't make sense, as Lambda runs on Linux x86-64/ARM and not Mac ARM. Why are these files included?

Service configuration (serverless.yml) content

pythonRequirements:
    pythonBin: python3
    slim: true
    layer: true
    noDeploy:
      # Shipped in a separate layer:
      - Pillow


Project is proprietary so I cannot include the whole config.

Command name and used flags

serverless package

Command output

N/A

Environment information

✗ serverless --version
Running "serverless" from node_modules
Framework Core: 3.26.0 (local) 3.26.0 (global)
Plugin: 6.2.2
SDK: 4.3.2
@hrist0stoichev
Copy link

slim only removes **/*.py[c|o], **/__pycache__*, and **/*.dist-info* by default. The .so files are trimmed only, not removed. If you want to remove anything else you can use:

slimPatterns:
  - '**/*.so'
  - '**/*.dylib'

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

No branches or pull requests

2 participants