Skip to content

Build sharp for non-amd64 architectures#293

Closed
calroth wants to merge 2 commits into
TryGhost:masterfrom
calroth:build-libvips-sharp
Closed

Build sharp for non-amd64 architectures#293
calroth wants to merge 2 commits into
TryGhost:masterfrom
calroth:build-libvips-sharp

Conversation

@calroth

@calroth calroth commented Mar 6, 2022

Copy link
Copy Markdown

On non-amd64 architectures, the default version of sharp may not automatically install due to a missing copy of libvips. This is referred to in PR #281 and issues #264 and #267. However whilst #281 fixes the images so they build and run, sharp may still not be built. It's an optional dependency and ghost works fine without it.

This PR is to get libvips installed, and sharp installed and built.

On Alpine, we upgrade to 3.15 (was 3.14). This gives us libvips 8.12.1-r0 (link to Alpine package search) which is sufficient to build the current dependency version of sharp (0.29.0).

The main caveat of the Alpine change is, we'll be upgrading from 3.14 to 3.15. This may require across-the-board testing.

On Debian, we currently use the bullseye image version. However the bullseye version of libvips-dev (8.10.5-2) isn't recent enough (link to Debian package search). So we download and build libvips-dev from Debian bookworm, which brings us version 8.12.1-1. (We also download and build libcgif-dev, since that prerequisite isn't available in bullseye.)

Note that on Debian we download and build the packages from source, targeting the bullseye runtime. This is likely to give better compatibility versus simply installing the official bookworm packages, which may require updated components.

I've only tested this on my 32-bit Raspberry Pi (armv7). Happy to take advice on how to get this PR ready for merging. Thanks!

calroth added 2 commits March 6, 2022 20:08
If the pre-compiled version of sharp (an optional dependency) doesn't
install, then build it ourselves. This requires a recent version of
libvips, so install the Alpine 3.15 version.

(This commit upgrades us from Alpine 3.14 to 3.15.)
If the pre-compiled version of sharp (an optional dependency) doesn't
install, then build it ourselves. This requires a recent version of
libvips, so compile the Debian bookworm version from source (against our
existing Debian bullseye runtime).
@tianon

tianon commented Mar 7, 2022

Copy link
Copy Markdown
Contributor

Interesting! I like this plan for Alpine (where we've got new enough libvips already), and think updating the Alpine version is reasonably sane, but I'm a bit concerned about compiling libvips from source, especially taking the source from bookworm without a proper Debian backport. 🙈

@XChikuX

This comment was marked as off-topic.

@tianon

tianon commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

Closing in favor of #394 🙇

@tianon tianon closed this Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants