vladholubiev / serverless-libreoffice

Run LibreOffice in AWS Lambda to create PDFs & convert documents
https://vladholubiev.com/serverless-libreoffice
513 stars 75 forks source link

Can't compile against Amazon Linux 2 #27

Closed Rudigern closed 4 years ago

Rudigern commented 4 years ago

NodeJS 8.10 is EOL from Feb 3 and NodeJS 10.x uses Amazon Linux 2. I've tried to compile it in this AMI doesn't seem to work and fails with:

strip: './instdir/**/*': No such file

At the moment it's likely I'll need to move to Python however 3.8 is also on Amazon Linux 2 and by the looks of this it will be the same issue as this is the error I get when trying to run the current compiled version in NodeJS 10.x.

Thanks a heap for this work, very much appreciated.

vladholubiev commented 4 years ago

@Rudigern I have compiled it for Amazon Linux 2 already, and it converts files just ok. But the size is 404 MB, so I'm trying to squeeze it under 250 MB right now

I'll keep you updated, and I am under the pressure of deadline as well :)

Rudigern commented 4 years ago

@vladgolubev Thanks for the quick reply. I'm not sure where I went wrong, I'll try it again today.

Amazon have gutted the AMI, this isn't the first issue of upgrading my Lambda functions where the function doubled or tripled in size because they've removed so much.

randombluff commented 4 years ago

@Rudigern Amazon 2 runtime got tiny runtime compared to Amazon 1, there are no fonts and a lot of libs in libs64. So you should compile with fonts and with libs shipped with lo. Also, you can try to make build without X libraries. If you would want to go with low-weight build, be prepared to get .so files from libs64 of the lambda, and then pack up with LO, also need to add fonts with env variables, here is the list process.env.LC_CTYPE = "en_US.UTF-8"; process.env.LC_ALL = "en_US.UTF-8"; process.env.LD_LIBRARY_PATH = "/tmp/lo/instdir/program"; process.env.SAL_USE_VCLPLUGIN = "gen"; process.env.TMPDIR = "/tmp"; process.env.FONTCONFIG_PATH = "/tmp/lo/instdir/share/fonts"; process.env.FONTCONFIG_FILE = "/var/task/fonts/font.conf"

vladholubiev commented 4 years ago

Hey @Rudigern

We've just published a new version which was compiled for Amazon Linux 2: https://github.com/vladgolubev/serverless-libreoffice/releases/tag/v6.4.0.1 🎉

Thanks for your patience!

Rudigern commented 4 years ago

Thanks a heap!