Skip to content

Commit 407f14d

Browse files
committed
fix builder build for trixie
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
1 parent 9c4b22b commit 407f14d

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

.github/workflows/builder.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
default: "1.25.0"
1212
osxcross-git-hash:
1313
description: git commit hash of osx-cross project
14-
default: "ff8d100f3f026b4ffbe4ce96d8aac4ce06f1278b"
14+
default: "f873f534c6cdb0776e457af8c7513da1e02abe59"
1515
osx-min-version:
1616
description: minimal macOS SDK deployment target
1717
default: "10.13"
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
images: ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/golang-cross-builder
4646
tags: |
47-
type=raw,value=latest,enable=${{ matrix.codename == 'bookworm' && github.ref == format('refs/heads/{0}', 'main') }}
47+
type=raw,value=latest,enable=${{ matrix.codename == 'trixie' && github.ref == format('refs/heads/{0}', 'main') }}
4848
type=raw,value=${{ env.GOLANG_CROSS_TAG }}
4949
- name: Login to GitHub Container Registry
5050
uses: docker/login-action@v3

Dockerfile.builder

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ FROM ghcr.io/gythialy/osx-sdk:${OSK_SDK:-macos-13} AS osx-sdk
77

88
FROM golang:${GO_VERSION:-1.25.0}-${OS_CODENAME:-trixie} AS base
99

10+
# Re-declare ARG after FROM to make it available in this stage
11+
ARG OS_CODENAME=trixie
12+
1013
# osxcross parameters
1114
ARG OSX_VERSION_MIN=10.13
12-
ARG OSX_CROSS_COMMIT=ff8d100f3f026b4ffbe4ce96d8aac4ce06f1278b
15+
ARG OSX_CROSS_COMMIT=f873f534c6cdb0776e457af8c7513da1e02abe59
1316
# ARG APT_MIRROR
1417
# RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
1518
# && sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list
@@ -23,6 +26,9 @@ RUN set -x; echo "Starting image build for Debian " \
2326
&& dpkg --add-architecture armhf \
2427
&& dpkg --add-architecture i386 \
2528
&& apt-get update \
29+
&& if [ "${OS_CODENAME}" != "trixie" ]; then \
30+
apt-get install -y -q software-properties-common multistrap lzma-dev; \
31+
fi \
2632
&& apt-get install -y -q \
2733
autoconf \
2834
automake \
@@ -42,16 +48,16 @@ RUN set -x; echo "Starting image build for Debian " \
4248
libtool \
4349
llvm \
4450
mercurial \
45-
multistrap \
51+
mmdebstrap \
4652
patch \
47-
software-properties-common \
4853
subversion \
4954
wget \
5055
xz-utils \
5156
# cmake \
5257
qemu-user-static \
5358
libxml2-dev \
54-
lzma-dev \
59+
liblzma-dev \
60+
zlib1g-dev \
5561
openssl \
5662
mingw-w64 \
5763
musl-tools \
@@ -70,13 +76,13 @@ WORKDIR "${OSX_CROSS_PATH}"
7076
# install osxcross:
7177
RUN \
7278
git clone https://github.com/tpoechtrager/osxcross.git . \
73-
&& git checkout -q "${OSX_CROSS_COMMIT:-ff8d100f3f026b4ffbe4ce96d8aac4ce06f1278b}"
79+
&& git checkout -q "${OSX_CROSS_COMMIT:-f873f534c6cdb0776e457af8c7513da1e02abe59}"
7480

7581
# install osx sdk
7682
COPY --from=osx-sdk "${OSX_CROSS_PATH}/." "${OSX_CROSS_PATH}"
7783

7884
# install cmake
79-
ARG CMAKE_VERSION=3.28.3
85+
ARG CMAKE_VERSION=4.1.0
8086
RUN \
8187
# wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz \
8288
# && tar -xf cmake-${CMAKE_VERSION}.tar.gz \
@@ -97,9 +103,15 @@ RUN patch -p1 < osxcross-08-52-08.patch
97103
COPY scripts/llvm.sh "${OSX_CROSS_PATH}/"
98104
RUN \
99105
# install clang-16
100-
./llvm.sh 16 \
101-
&& update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 \
102-
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 \
106+
if [ "${OS_CODENAME}" = "trixie" ]; then \
107+
apt-get update && apt-get install -y --no-install-recommends clang-18 && \
108+
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 && \
109+
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100; \
110+
else \
111+
./llvm.sh 16 && \
112+
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 && \
113+
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100; \
114+
fi \
103115
&& clang --version \
104116
&& clang++ --version \
105117
&& UNATTENDED=yes OSX_VERSION_MIN=${OSX_VERSION_MIN:-10.13} ./build.sh \

0 commit comments

Comments
 (0)