This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 05dad99c8 fix(build): use libgit2's bundled zlib so the image builds
on arm64 hosts (#9132)
05dad99c8 is described below
commit 05dad99c836c6e868da3fa00fa5704cdd5ef534a
Author: Ullrich Schäfer <[email protected]>
AuthorDate: Sat Sep 12 04:17:40 2026 +0200
fix(build): use libgit2's bundled zlib so the image builds on arm64 hosts
(#9132)
Building the server image on an arm64 host fails while linking libgit2 for
the amd64 target:
/rootfs-amd64/usr/lib/x86_64-linux-gnu/libz.a(deflate.o): relocation
R_X86_64_PC32 against symbol `z_errmsg' can not be used when making a
shared object; recompile with -fPIC
ld: final link failed: bad value
libgit2 is built with BUILD_SHARED_LIBS=ON, but the staged cross sysroot
offers only a static, non-PIC libz.a, which cannot go into a shared
object. Point libgit2 at its own bundled zlib for both cross targets; it
is compiled as part of the shared library and so is position independent.
Verified on an Apple Silicon host: `docker build --platform linux/amd64`
now links libgit2.so and proceeds to the Go build, where it failed before.
Generated-by: Claude Code (Claude Opus 5)
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
backend/Dockerfile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/backend/Dockerfile b/backend/Dockerfile
index e77fe682e..d00239584 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -68,11 +68,11 @@ RUN for arch in aarch64 x86_64 ; do \
mkdir build && cd build && \
if [ "$arch" = "aarch64" ] ; then \
cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
- -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSROOT=/rootfs-arm64 \
+ -DBUILD_SHARED_LIBS=ON -DUSE_BUNDLED_ZLIB=ON
-DCMAKE_SYSROOT=/rootfs-arm64 \
-DCMAKE_INSTALL_PREFIX=/usr/local/deps/${arch} ; \
elif [ "$arch" = "x86_64" ] ; then \
cmake .. -DCMAKE_C_COMPILER=x86_64-linux-gnu-gcc \
- -DBUILD_SHARED_LIBS=ON -DCMAKE_SYSROOT=/rootfs-amd64 \
+ -DBUILD_SHARED_LIBS=ON -DUSE_BUNDLED_ZLIB=ON
-DCMAKE_SYSROOT=/rootfs-amd64 \
-DCMAKE_INSTALL_PREFIX=/usr/local/deps/${arch} ; \
fi && \
make -j install ; \