wkhtmltopdf / packaging

Packaging of wkhtmltopdf releases
https://wkhtmltopdf.org/downloads.html#stable
308 stars 141 forks source link

Wkhtmltox compiled using wrong libraries #140

Closed alekth85 closed 1 year ago

alekth85 commented 1 year ago

Compile is successful, this is the build command:

./build compile-docker focal-amd64 /usr/local/src/wkhtmltopdf /usr/local/wkhtmltopdf

The binary is built on Ubuntu 20.04 Focal, for what I understand, "target" is focal, but the libraries required by binary are completely wrong as these versions of libssl and libc6 are not available on focal.

root@web02(/usr/local/src/package) (master)# ldd /usr/local/wkhtmltopdf/wkhtmltox/bin/wkhtmltopdf  | grep 'not f'
/usr/local/wkhtmltopdf/wkhtmltox/bin/wkhtmltopdf: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /usr/local/wkhtmltopdf/wkhtmltox/bin/wkhtmltopdf)
/usr/local/wkhtmltopdf/wkhtmltox/bin/wkhtmltopdf: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /usr/local/wkhtmltopdf/wkhtmltox/bin/wkhtmltopdf)
/usr/local/wkhtmltopdf/wkhtmltox/bin/wkhtmltopdf: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /usr/local/wkhtmltopdf/wkhtmltox/bin/wkhtmltopdf)
    libssl.so.3 => not found
    libcrypto.so.3 => not found
root@web02(/usr/local/src/package) (master)#

So, the libc for this should be 2.31, that is the libc6 used by ubuntu 20.04. Why is this package looking for 2.32+?

Also, the libssl on focal is 1.1.1, but this binary depends on openssl 3.0.0. If I symlink libssl.so.1 -> libssl.so.3, and run ldconfig.. the ldd will not complain about lib being not found, but it will complain about wkhtmltopdf requiring openssl 3_0_0

Any idea what I'm doing wrong here? I was under impression that by setting target focal-amd64, I'm compiling wkhtmltox binaries for libraries used by focal 20.04, but this is not the case. Compiled wkhtmltopdf is looking for versions that focal does not use.

Thank you

ashkulz commented 1 year ago

Why aren't you using the binaries on the website?

alekth85 commented 1 year ago

I need two different versions on the server running at the same time, mostly for testing. We have the ubuntu provided package, 0.12.5... and actually, few days ago I installed the package from https://wkhtmltopdf.org/downloads.html for Focal, and extracted it under /usr/local/bin/custom-wkhtmltopdf with dpkg-deb. So I do already have two versions running. Eg.

Binary from the wkhtmltopdf site:

root@web01(~)# /usr/local/bin/custom-wkhtmltopdf -V
wkhtmltopdf 0.12.6 (with patched qt)

Binary provided by ubuntu 20.04:

root@web01(~)# wkhtmltopdf -V
wkhtmltopdf 0.12.5

The problem I'm having with the new version from the website is that the in one of my tests css is not loading for the html page, while 0.12.5 works fine. Basically, 0.12.5 test html converts to pdf successfully and looks good, while 0.12.6 is completely lacking any styling, while still generating pdf, just without any styling.

Also, the font seems to be not loading (as reported by some of my users). Font is defined in CSS, so it might be related to above problem of stylings not loading.

I did not go into the reasons why there are these issues with 0.12.6 binary downloaded from website, I was instead trying to get my own version to compile, hoping that my compiled version would not have the same issue as the version of wkhtmltopdf downloaded from the website (/usr/local/bin/custom-wkhtmltopdf, 0.12.6)

Hopefully that was clear.

alekth85 commented 1 year ago

Any idea?

I'm having this problem because I don't clearly understand how the build system actually works. I was under the impression that when I select the target, it will download docker image for that target (focal, 20.04 ubuntu), adn then build it THERE using the libraries that are available in that distribution / distribution version.

Am I mistaken, and if so, do you know off the top of your head what I can do to compile the source code for libc, libssl version that are available on Ubuntu Focal, 20.04?

Thank you for your help.

ashkulz commented 1 year ago

The version on the website will have the same behavior as the self-compiled version. I'm not sure about the error you're getting, are you 100% sure you copied the right binary?

falves1 commented 1 year ago

Qt not present in wkhtmltopdf source: /usr/src/wkhtmltopdf the command is ./build package-docker jammy-amd64 /usr/src/wkhtmltopdf what do I need to do?

falves1 commented 1 year ago

I installed the packages. I wonder if you would be open to do some consulting work for me. Please contact via email ve-ne-fax *(no hyphens) at the popular service from Google. please look at https://1eye.us/images/pdf/elnacional/elnacional.html

ashkulz commented 1 year ago

@falves1 did you try to install the package from the website? That's the preferred option.

For the error you're getting, I think you didn't clone with --recurse-submodules.

falves1 commented 1 year ago

yes, all it's fine now. Many thanks for your response.

ashkulz commented 1 year ago

@alekth85 considering you didn't respond in 2+ months, I'm closing this issue. Please reopen with more details if required :+1: