Closed felixvanoost closed 1 month ago
@ggrossetie any thoughts on the preferred approach?
Hey!
I think we should opt for the 3rd solution. I already have an ARM64 runner so I can configure it to build the dvisvgm
binary.
@ggrossetie I saw the announcement a couple of months ago; would you consider joining the beta? Looks like it's only available to business accounts for now.
Is there anything I can do suport this issue?
I saw the announcement a couple of months ago; would you consider joining the beta? Looks like it's only available to business accounts for now.
I thought it was GA :/
@felixvanoost Do you have a repository that build dvisvgm
binaries? If so, we can move it to the yuzutech organization and I can setup a build on my ARM64 runner.
@ggrossetie I don't have one currently but can create one if it helps. The kroki-builder-dvisvgm
code in the existing Dockerfile works for both amd64
and arm64
as long as each binary is built using the same build and target architecture. The part that isn't working is cross-compilation.
FROM --platform=$BUILDPLATFORM ubuntu:jammy AS kroki-builder-dvisvgm
RUN apt-get update && apt-get install --no-install-recommends --yes \
build-essential \
pkg-config \
libclipper-dev \
libfreetype-dev \
libkpathsea-dev \
ghostscript \
libssl-dev \
zlib1g-dev \
curl \
ca-certificates
ARG DVISVGM_VERSION=3.0.4
ARG BUILDARCH
ARG TARGETARCH
RUN curl -LO https://github.com/mgieseki/dvisvgm/releases/download/$DVISVGM_VERSION/dvisvgm-$DVISVGM_VERSION.tar.gz && \
tar xf dvisvgm-$DVISVGM_VERSION.tar.gz && \
cd dvisvgm-$DVISVGM_VERSION && \
case $BUILDARCH in \
"amd64") MAKE_BUILD_ARCH=x86_64 ;; \
"arm64") MAKE_BUILD_ARCH=aarch64 ;; \
*) MAKE_BUILD_ARCH=$BUILDARCH ;; \
esac && \
case $TARGETARCH in \
"amd64") MAKE_TARGET_ARCH=x86_64 ;; \
"arm64") MAKE_TARGET_ARCH=aarch64 ;; \
*) MAKE_TARGET_ARCH=$TARGETARCH ;; \
esac && \
./configure --enable-bundled-libs --build $MAKE_BUILD_ARCH-linux-gnu --host $MAKE_TARGET_ARCH-linux-gnu && \
make && \
make install
In short, you should be able to copy this code directly to a new repo and set up a workflow that builds one dvisvgm
binary on an arm64
host and the other on an amd64
host.
We know this will work because the Kroki nightly
CI worflow that runs on an arm64
host builds and passes all the tests without issues. This is also why I didn't catch the issue earlier, because the main
and nightly
workflows run on native hosts but the release
workflow cross-compiles to arm64
from an amd64
host.
Update: It turns out that up-to-date dvisvgm
binaries are available via apt
for Ubuntu 24.04 (Noble), which will become the new LTS release in about 3 weeks:
https://packages.ubuntu.com/noble/dvisvgm
I can open a PR for the change once an updated version of the eclipse-temurin
image is released.
Yes that would be awesome, thanks 👍🏻
Resolved in #1770.
TikZ returns an
Exec format error (exit code 126)
when running onarm64
. I thought I had checked all the libraries before opening #1487, but this doesn't seem to have been the case... 😅After some digging I realised that the
kroki-builder-dvisvgm
stage doesn't install the correct cross-compiler tools to actually build thearm64
binary from anamd64
host. Fromv0.23.0, platform=arm64
, we can see that the binary type is alwaysx86-64
:This issue hasn't shown up in CI because the workflows only use native builds that don't require cross-compilation. There are 3 ways to resolve this:
kroki-builder-dvisvgm
stage, which produces the correct result but takes forever to build. This wouldn't affect the CI normally because they're all running natively, but it would make therelease
workflow take much longer than it currently does.dvisvgm
binaries in a separate Yuzutech repo. This could be done with the native Arm runner.I can work on a fix for either 1 or 2 if needed.