-
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
Compression packs symlinks as copies #477
Comments
This is also an issue with Given: AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
DependenciesLayer:
Type: AWS::Serverless::LayerVersion
Properties:
ContentUri: dependencies/ If the You can manually create the zip yourself, but if you refer to it in the |
I'd like to revive this issue as it seems there hasn't been any movement in a couple years. It will start having a larger impact as Nodejs devs start moving away from the Commonjs module loader and start using native ES modules. The Lambda team recently announced support for native ESM which is awesome, however, importing modules defined in a shared layer does not work because Nodejs dropped support for the NODE_PATH env var, recommending using symlinks instead. There's also been discussion around using the loaders feature to solve this issue but it's still experimental. Using a symlink works nicely if your workflow does not include SAM CLI as demonstrated here. When I add the symlink It would be awesome to see this working in the SAM toolchain! Lambda, CDK, and Cloudformation |
Is there an update on this issue? SAM CLI turning symlinks into copies is causing my Layer to be over the maximum uncompressed size. My workaround is manually creating the .zip file, but this breaks the workflow and causes me to put a large binary in my source repository. |
Description:
sam package
compresses symlinks as an additional copy of the file to which they resolve. Given a traditional shared library layout with…
sam package
will pack the library three times, not once with two symlinks.Steps to reproduce the issue:
make
in a directory with.env
,template.yml
, andMakefile
:.env
: replace the values with your own profile, region, and S3 bucket name:template.yml
:Makefile
:Observed result:
Expected result:
Also, I expect compression at least as good as
zip -9
.Additional environment details (Ex: Windows, Mac, Amazon Linux etc) macOS 10.13.5
Output of
sam --version
: SAM CLI, version 0.3.0Optional Debug logs: I gave
--debug
but couldn't find the outputThe text was updated successfully, but these errors were encountered: