-
Notifications
You must be signed in to change notification settings - Fork 99
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
Native extensions aren't being compiled #35
Comments
Thanks for bringing this up. I can imagine this will be a complicated to resolve if you're developing on an environment that doesn't match the Lambda environment (eg. developing on Windows and running on Lambda/Linux). Perhaps you could manually build binaries then include them in the correct folder using something like the include_files option. If you unzip the generated package and run npm build does it work? |
I've been using a Docker container to do the build, so that it'll actually build correctly for lambda. As for running |
I was able to get around this using the |
@kevinreedy can you share your docker file which simulates the lambda environment - at the moment I use a ec2 instance and this would make it much easier to build the node modules with binary parts (iconv, fibers) - thanks |
@aheissenberger take a look at https://github.com/kevinreedy/chef-asg-cleanup for how I'm successfully building now, specifically https://github.com/kevinreedy/chef-asg-cleanup/blob/master/Dockerfile and https://github.com/kevinreedy/chef-asg-cleanup/blob/master/docker-compose.yml |
@kevinreedy @aheissenberger @Tim-B, I've made a library that may help with these kinds of issues: https://github.com/FreeAllMedia/akiro |
I'm attempting use grunt-aws-lambda for a project (https://github.com/kevinreedy/chef-asg-cleanup) that uses https://github.com/normanjoyner/chef-api. One of its dependencies is https://github.com/quartzjer/ursa, which has native extensions. When I run an
npm install
, the extensions are built! When I rungrunt lambda_package
, they are not. Steps to reproduce below:I imagine there's an option that is needed to pass into
npm.commands.install
(https://github.com/Tim-B/grunt-aws-lambda/blob/master/tasks/lambda_package.js#L59-L66) to ensure thatnode-gyp
gets called, but it's not obvious from looking at npm's code. Any thoughts to push me in the right direction? Thanks!The text was updated successfully, but these errors were encountered: