pandoc / dockerfiles

Dockerfiles for various pandoc images
GNU General Public License v2.0
364 stars 98 forks source link

Fix failing builds #222

Closed Tallyrald closed 4 months ago

Tallyrald commented 8 months ago

Dear maintainers!

After multiple attempts I was able to find a working solution to the failing builds. Unfortunately I needed to change several important things to get it working again, but I'll explain everything below. Key changes:

Unfortunately the LaTeX test fails for some reason, but I'm not entirely sure why. Still I hope that my findings and solutions in this PR help re-rail this repository to continue recieving updates in the future.

Here is the Github Actions build that (almost) succeeded: https://github.com/Tallyrald/pandoc-dockerfiles/actions/runs/7409106601

Please let me know if I missed something or if I need to make changes to further help you out.

Details:

  1. Alpine: 3.16 is quite old and several dependencies seemed to have a problem with it. I tried to update it to 3.17 then to 3.18, but both of these versions seem to have some kind of networking bug when using Cabal install (maybe because of the change from openSSL1.1.1 to 3 on Alpine 3.17). Thankfully 3.19 came out not long ago and it seems to not have this networking issue anymore which is why it is the only viable solution at the moment.
  2. GHC and Cabal: Pandoc requires a more recent version of GHC (>=8.10 I believe), but that is not available in Ubuntu Jammy APT, so I chose to use GHCup for installation (just like Pandoc itself is using it in it's own repo). This also allows for greater control over the build environment and helps reduce failures caused by automatic future updates. I implemented this for both Ubuntu and Alpine to keep them in sync. I also updated Cabal to 3.10 to properly support newer versions of GHC, but I guess simply using latest may also be an option.
  3. PIP: In Alpine 3.19 using PIP without a virtual environment is not supported anymore so I changed the install behaviour to reflect this for both Ubuntu and Alpine to keep them in sync and reduce possible errors in the future.
  4. WGET: I observed intermittent connection issues on Alpine with wget so I changed it to curl. There is a possibility that this issue is also resolved by the Alpine version upgrade (in which case wget is fine I guess), but I didn't test this.

Possibly closes: https://github.com/pandoc/dockerfiles/issues/208 & https://github.com/pandoc/dockerfiles/issues/198

Tallyrald commented 6 months ago

I've updated the PR to include the latest fixes found in Alpine 3.19.1 and also updated the very old native testsuite from Pandoc. Unfortunately the LaTeX test still fails and I don't know how to fix it. Otherwise the build phase is fine (except some random networking errors in Github Actions that plagues this platform).

tarleb commented 4 months ago

Hello @Tallyrald, thank you for the PR, and apologies for the long wait. My open source involvement had to take a step back for a while.

I'm going to look through the suggested changes in detail, and might cherry-pick some commits, if that's ok with you.

Ideas like switching to ghcup for building are welcome, but should probably go into a separate PR.

Again, thanks for your help!

Tallyrald commented 4 months ago

Hi! I included ghcup mainly because I found no alternative on Ubuntu Jammy for a proper Cabal+GHC version combination that wasn't too old for Pandoc. Maybe the newest 24.04 LTS has more recent versions available. Then again using ghcup on both Ubuntu and Alpine makes the whole installation more predictable across distros. Let me know if you need more explanation about the changes included here.

tarleb commented 4 months ago

Closing this, as the build pipeline is back in business. Thanks once more.