dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

Fix failing builds

Open Tallyrald opened this issue 1 year ago • 1 comments

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:

  • Alpine update from 3.16 to 3.19
  • GHC update from 8.8.4 to 9.6
  • Cabal update to 3.10
  • pip install got a virtual environment
  • wget replaced with curl

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 avatar Jan 04 '24 13:01 Tallyrald