build: manually install mold on alpine, as packaged version is broken

This commit is contained in:
Marcus Holland-Moritz 2025-03-21 19:11:53 +01:00
parent 91c810cee9
commit 03b9f928fc
2 changed files with 24 additions and 0 deletions

View File

@ -81,6 +81,8 @@ RUN pip3 install --break-system-packages --root-user-action ignore mistletoe
RUN git config --global --add safe.directory /workspace
COPY install-static-libs.sh /usr/local/bin/install-static-libs.sh
RUN bash /usr/local/bin/install-static-libs.sh gcc clang-19 :alpine
COPY install-mold.sh /usr/local/bin/install-mold.sh
RUN bash /usr/local/bin/install-mold.sh
RUN adduser -G users -s bash -u 1000 -D mhx
RUN apk add --no-cache xxhash-dev
USER mhx

22
.docker/install-mold.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -ex
cd "$HOME"
mkdir pkgs
cd pkgs
MOLD_VERSION=2.37.1
wget -O mold-${MOLD_VERSION}.tar.gz https://github.com/rui314/mold/archive/refs/tags/v${MOLD_VERSION}.tar.gz
tar xf mold-${MOLD_VERSION}.tar.gz
cd mold-${MOLD_VERSION}
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
ninja
ninja install
cd "$HOME"
rm -rf pkgs