wkhtmltopdf_binary_gem icon indicating copy to clipboard operation
wkhtmltopdf_binary_gem copied to clipboard

Add binary for Ubuntu 22.04

Open anatoliliotych opened this issue 2 years ago • 20 comments

anatoliliotych avatar Jul 01 '22 11:07 anatoliliotych

Thanks for updating this.

elissonmichael avatar Jul 12 '22 13:07 elissonmichael

Any predictions to merge into the master? (rubygems too)

MarcusPetri avatar Jul 13 '22 20:07 MarcusPetri

So I've tried to use this in heroku-22 stack and got some issues, so I had to switch to use the same version of binary as ubuntu 20 uses which also didn't help. After that I've switched to https://github.com/rposborne/wkhtmltopdf-heroku

anatoliliotych avatar Jul 14 '22 10:07 anatoliliotych

Any updates on merging this? We've upgraded our server to 22.04 already but this gem hasn't been updated in two years. What is a reasonable timeline to expect new Ubuntu versions in a gem meant to manage a certain binary across OS versions?

maxfurman avatar Oct 06 '22 14:10 maxfurman

So I've tried to use this in heroku-22 stack and got some issues, so I had to switch to use the same version of binary as ubuntu 20 uses which also didn't help. After that I've switched to https://github.com/rposborne/wkhtmltopdf-heroku

Is there any difference?

roostinghawk avatar Oct 24 '22 12:10 roostinghawk

I didn't dig into Heroku version gem, but it helped.

anatoliliotych avatar Oct 24 '22 12:10 anatoliliotych

Thanks. Since our project was using wkhtmltopdf_binary_gem, I would like to keep it. Is there anyway to use before maintainer's approval?

roostinghawk avatar Oct 24 '22 12:10 roostinghawk

Thanks. Since our project was using wkhtmltopdf_binary_gem, I would like to keep it. Is there anyway to use before maintainer's approval?

I'd say no. you can fork and switch back as soon as it will be merged.

anatoliliotych avatar Oct 24 '22 12:10 anatoliliotych

I'd say no. you can fork and switch back as soon as it will be merged.

Plan to fork and generate ubuntu22 binary file by myself. Could you tell me how to generate this file? Thanks

roostinghawk avatar Oct 27 '22 15:10 roostinghawk

@anatoliliotych How did you get the binary file to include in this PR?

I downloaded the official packages from https://wkhtmltopdf.org/downloads.html for Ubuntu 22.04 (both jammy and focal), and neither one matches the md5 checksum as the uncompressed binary in this PR.

Maybe it was an earlier version of the official? Or extracted from an installed system somewhere?

Should we update this PR to use one of the official versions?

unixmonkey avatar Oct 27 '22 16:10 unixmonkey

I just used official ubuntu repo with installed package. It was long ago :)

anatoliliotych avatar Oct 27 '22 16:10 anatoliliotych

@anatoliliotych Would you mind terribly replacing the binary with the most recent one? I'd be happy to merge and release with that.

unixmonkey avatar Oct 27 '22 16:10 unixmonkey

I'm going to do this a little bit later today. :)

anatoliliotych avatar Oct 27 '22 16:10 anatoliliotych

So just to leave some instructions for the future:

  1. Download proper version of package https://wkhtmltopdf.org/downloads.html
  2. Unpack package and get binary from archive usr/loca/bin/wkhtmltopdf
  3. Rename binary to match OS version. mv wkhtmltopdf wkhtmltopdf_ubuntu_22.04_amd64
  4. Pack binary, for example tar -cvzf wkhtmltopdf_ubuntu_22.04_amd64.gz wkhtmltopdf_ubuntu_22.04_amd64
  5. Profit :)

anatoliliotych avatar Oct 27 '22 17:10 anatoliliotych

@unixmonkey please, review my previous comment and PR. I forgot to add tests, going to fix in a moment.

anatoliliotych avatar Oct 27 '22 17:10 anatoliliotych

@unixmonkey could you trigger workflow?

anatoliliotych avatar Oct 29 '22 14:10 anatoliliotych

@anatoliliotych Thanks! Have you verified that this works on your Ubuntu 22 system yet?

unixmonkey avatar Oct 30 '22 12:10 unixmonkey

@anatoliliotych Thanks! Have you verified that this works on your Ubuntu 22 system yet?

@unixmonkey test is failing with Syntax error: Unterminated quoted string and this is what I've met with previous binaries.

anatoliliotych avatar Oct 30 '22 14:10 anatoliliotych

@anatoliliotych I tried this on heroku with stack heroku-22 and it failed out. I tried extracting the binary and myself and noticed that the md5 hash of yours and mine are different(I didn't look into the actual binary). The steps I took to reproduce were similar to yours, but I used the gzip command to pack the binary as it suggests in the README.

So doing:

  1. Download proper version of package https://wkhtmltopdf.org/downloads.html
  2. Unpack package and get binary from archive usr/loca/bin/wkhtmltopdf
  3. Rename binary to match OS version. mv wkhtmltopdf wkhtmltopdf_ubuntu_22.04_amd64
  4. Pack binary, for example gzip --best wkhtmltopdf_ubuntu_22.04_amd64

Doing that final command like that gave me something that now works on Heroku

tabfugnic avatar Nov 01 '22 18:11 tabfugnic

@anatoliliotych I tried this on heroku with stack heroku-22 and it failed out. I tried extracting the binary and myself and noticed that the md5 hash of yours and mine are different(I didn't look into the actual binary). The steps I took to reproduce were similar to yours, but I used the gzip command to pack the binary as it suggests in the README.

So doing:

  1. Download proper version of package https://wkhtmltopdf.org/downloads.html
  2. Unpack package and get binary from archive usr/loca/bin/wkhtmltopdf
  3. Rename binary to match OS version. mv wkhtmltopdf wkhtmltopdf_ubuntu_22.04_amd64
  4. Pack binary, for example gzip --best wkhtmltopdf_ubuntu_22.04_amd64

Doing that final command like that gave me something that now works on Heroku

Super strange how packing can break it :) Let me replace it.

anatoliliotych avatar Nov 01 '22 18:11 anatoliliotych

Any plans to go ahead with this PR?

night91 avatar Nov 11 '22 17:11 night91

I used a different PR, but support for Ubuntu 22.04 is now released in version 0.12.6.6 of this gem. Thank you all for your help, and please let me know if you have any issues!

unixmonkey avatar Nov 30 '22 21:11 unixmonkey