Closed innovia closed 4 years ago
+1, just wanted to say this is a pretty big problem for us to build PHP runtimes (see https://github.com/mnapoli/bref/issues/146 for more details).
Any update on this from SAM team? Also Unable to use this layer locally https://github.com/lambci/git-lambda-layer
Here here, ran into this issue today too with Ruby runtime and a Layer with libvips. https://github.com/customink/ruby-vips-lambda
Maybe the core team can point us to the piece of code that does the unzip of the layers? If it's a matter of looking up with flag or option to use I could maybe try to contribute a fix.
@mnapoli We download and unzip layers here but the main unzipping logic lives here.
The other part this could be going wrong is when we tar up the contents and build the image. This happens within the lambda_image.py file with the actual tar'ing code here.
I haven't had the chance to dig into which part (or both) are causing trouble here. Happy to help lead someone or answer questions around the code.
Maybe related to this? https://stackoverflow.com/questions/35782941/archiving-symlinks-with-python-zipfile and maybe require this? http://infozip.sourceforge.net/UnZip.html or using the CLI zip of the Docker host?
@metaskills SAM CLI doesn't do the zipping. It seems like the zip information is already there but we aren't respecting it?
Yup, that's what I'm thinking cause Python zip does not have the capability to do so. From my limited research. If that is true, how would you suggest a proposed change fix that? Seems the options (and maybe more) are:
This is affecting C++ Lambda functions as well, which relies heavily on symlinks in the zip file.
I see that the label "stage/waiting-for-release" has been removed and the related PR has been reverted. Is there still a plan to fix this problem?
@bubba-h57 Are you still willing to send a new PR with what we talked about here?
I apologize, I'm struggling with some PTSD issues and once the episode passes I can focus again. I would love to do it, I just don't know how long this one will lat and that makes me unreliable. Again, my apologies.
On Fri, Aug 30, 2019, 4:07 PM Jacob Fuss notifications@github.com wrote:
@bubba-h57 https://github.com/bubba-h57 Are you still willing to send a new PR with what we talked about here https://github.com/awslabs/aws-sam-cli/pull/1315#issuecomment-520499875?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/awslabs/aws-sam-cli/issues/878?email_source=notifications&email_token=AAETL3VZCN4IMIXWDJCI4KLQHF4XBA5CNFSM4GLHGAGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5SUWIQ#issuecomment-526732066, or mute the thread https://github.com/notifications/unsubscribe-auth/AAETL3XDB2EGODV47QXBYJDQHF4XBANCNFSM4GLHGAGA .
This is also affecting me for C++ lambda.
@bubba-h57 No need to apologize, your health is way more important!
Since we just merged removing Py2.7 support #1416 and we reverted the initial fix for this due to Py2.7 issues: https://github.com/awslabs/aws-sam-cli/pull/1140#issuecomment-519154547. We should be able to just add this back in. Going to work on a PR based on the previous PR.
PR: #1482
+1 on getting this fixed. I've built an "imagemagick" image processing layer that is impacted by this because imagemagick uses lots of symlinks. Not being able to run and develop locally adds significant friction.
Closing this issue as it was fixed in Release 0.48.0
Description
When adding a package that contains symlinks these symlinks are flattened on the docker image
Briefly describe the bug you are facing. I am taking a folder with symlinks in it and zipping it using the --symlinks option of the zip when I unpack the zip file locally the symlinks are there but when I run the
sam invoke
command there are failures to find these file.when debugging the produced container using
docker run -it --rm --entrypoint=/bin/bash samcli/lambda:provided-11bcc8dc4810532c82a432b30 -i
the files are flatten into names with no symlinks.Steps to reproduce
create a folder with a symlink to a file package the files using
zip -yr some.zip folder_name
runsam local invoke
and call the symlink file. Provide steps to replicate.template.yaml:
index.sh
Observed result
symlinks are flattened into files
command output with debug flag
Expected result
symlinks files should be preserved
Describe what you expected.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 0.9.0Add --debug flag to command you are running
Note: this does not happen with real lambda