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

bugfix: ENOENT error when packaging individually while none of the functions have a requirements file #690

Closed
wants to merge 1 commit into from

Conversation

noxasaxon
Copy link

This addresses issue #397

In 2019 @ComfyDust did an investigation into this and pinpointed it to the pip.js file, with a workaround that you can create an empty requirements.txt file in each function folder.

As of 2022, the workaround is creating a requirements.txt file in a single function folder, which creates the requirements directory and prevents an ENOENT.

This PR ensures that the function's requirements parent directory is created regardless of whether a requirements file exists.

In my testing this did not increase deployment times at all, and lets packaging "individually" work if no requirements files are in any folder.

@pgrzesik
Copy link
Contributor

pgrzesik commented Apr 1, 2022

Thanks @noxasaxon - I'm honestly not sure about the proposed solution - why do we actually have to create these directories if they're not needed? What part of the building process fails due to the dir not existing? Maybe that part should be fixed so it doesn't try to access anything from a directory that shouldn't even exist? Do you have a reproduction steps for this bug?

@pgrzesik
Copy link
Contributor

pgrzesik commented Oct 1, 2022

Hey @noxasaxon - there's no activity for a few months. I'm going to close this PR fow now, but feel free to come back and we can re-open it 💯 Thanks for your work 🙇

@pgrzesik pgrzesik closed this Oct 1, 2022
@noxasaxon
Copy link
Author

Hey sorry I forgot to report back!

I ended up making a new package that isn't a serverless plugin, because we wanted to make sure we could move to pulumi or something later. It uses your caching and conditional docker code, and adds some customizations for what I was trying to do.

https://github.com/twilio-labs/socless_lambda_packager

@pgrzesik
Copy link
Contributor

pgrzesik commented Oct 3, 2022

Hey @noxasaxon, thanks a lot for reporting back 🙇 I will check that out, maybe we can still incorporate it into the plugin. 💯

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

Successfully merging this pull request may close these issues.

2 participants