Back in June I had a working function with a dependency on PDFKit. I was able to make my own binaries for PDFKit, and upload them to /src/bin folder within my function like so:
/functions/
----- /pdf-gen/
----- /pdf-gen/src/
----- /pdf-gen/src/bin/
----> /pdf-gen/src/bin/libgcj.so.10
----> /pdf-gen/src/bin/pdftk
----- /pdf-gen/pdf-gen.js
Then during the build, Netflify would move those binaries automatically to:
process.env.LAMBDA_TASK_ROOT + "/src/bin"
I was then able to update both process.env.PATH
and process.env.LD_LIBRARY_PATH
so that my command would be available to run. This worked with success and I was able to execute:
exec("pdftk --version", context.done)
with no error, and was now able to run my function and generate a PDF in base64.
I’m back revisiting this application, and it is no longer working with the exact same code. (It continues to work locally using Netlify CLI, because I have installed PDFKit on my system.)
Now when I strip everything out and simply try to return pdftk --version
I get command not found errors and when I run exec("ls -lah " + process.env.LAMBDA_TASK_ROOT + "/src/bin")
I see directory not found.
Has something changed in the build process since June, or any reason why I can no longer run my command?
Thank you!