@@ -5,8 +5,12 @@ ARG PLATFORM=x86_64
5
5
ARG DEVTOOLSET_ROOTPATH=/opt/rh/gcc-toolset-14/root
6
6
ARG LD_LIBRARY_PATH_ARG=${DEVTOOLSET_ROOTPATH}/usr/lib64:${DEVTOOLSET_ROOTPATH}/usr/lib:${DEVTOOLSET_ROOTPATH}/usr/lib64/dyninst:${DEVTOOLSET_ROOTPATH}/usr/lib/dyninst
7
7
ARG PREPEND_PATH=/usr/local/bin:${DEVTOOLSET_ROOTPATH}/usr/bin:
8
+ ARG MANYLINUX_BUILDARCH=${BUILDARCH}
9
+ ARG MANYLINUX_DISABLE_CLANG=0
10
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON=0
8
11
9
- FROM $BASEIMAGE AS runtime_base
12
+
13
+ FROM $BASEIMAGE AS runtime_base_packages
10
14
ARG POLICY
11
15
ARG PLATFORM
12
16
ARG DEVTOOLSET_ROOTPATH
@@ -42,29 +46,49 @@ RUN manylinux-entrypoint /build_scripts/install-runtime-packages.sh && rm -rf /b
42
46
43
47
COPY build_scripts/build_utils.sh /build_scripts/
44
48
49
+
50
+ # prepare cross-compilation support
51
+ FROM --platform=linux/${MANYLINUX_BUILDARCH} ghcr.io/mayeut/static-clang:20.1.8.0 AS static_clang_bin
52
+ FROM runtime_base_packages AS static_clang_prepare
53
+ ARG MANYLINUX_DISABLE_CLANG
54
+ COPY build_scripts/install-clang-static.sh /build_scripts/
55
+ RUN --mount=type=bind,target=/clang,from=static_clang_bin \
56
+ mkdir -p /tmp/cross-compiler && \
57
+ cp -rf /clang/opt/clang/* /tmp/cross-compiler/ && \
58
+ /build_scripts/install-clang-static.sh /tmp/cross-compiler
59
+ FROM scratch AS static_clang
60
+ COPY --from=static_clang_prepare /tmp/cross-compiler /
61
+
62
+
63
+ FROM runtime_base_packages AS runtime_base
45
64
COPY build_scripts/install-autoconf.sh /build_scripts/
46
- RUN export AUTOCONF_ROOT=autoconf-2.72 && \
65
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
66
+ export AUTOCONF_ROOT=autoconf-2.72 && \
47
67
export AUTOCONF_HASH=afb181a76e1ee72832f6581c0eddf8df032b83e2e0239ef79ebedc4467d92d6e && \
48
68
export AUTOCONF_DOWNLOAD_URL=http://ftp.gnu.org/gnu/autoconf && \
49
- manylinux- entrypoint /build_scripts/install-autoconf.sh
69
+ /tmp/cross-compiler/ entrypoint /build_scripts/install-autoconf.sh
50
70
51
71
COPY build_scripts/install-automake.sh /build_scripts/
52
- RUN export AUTOMAKE_ROOT=automake-1.18.1 && \
72
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
73
+ export AUTOMAKE_ROOT=automake-1.18.1 && \
53
74
export AUTOMAKE_HASH=63e585246d0fc8772dffdee0724f2f988146d1a3f1c756a3dc5cfbefa3c01915 && \
54
75
export AUTOMAKE_DOWNLOAD_URL=http://ftp.gnu.org/gnu/automake && \
55
- manylinux- entrypoint /build_scripts/install-automake.sh
76
+ /tmp/cross-compiler/ entrypoint /build_scripts/install-automake.sh
56
77
57
78
COPY build_scripts/install-libtool.sh /build_scripts/
58
- RUN export LIBTOOL_ROOT=libtool-2.5.4 && \
79
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
80
+ export LIBTOOL_ROOT=libtool-2.5.4 && \
59
81
export LIBTOOL_HASH=da8ebb2ce4dcf46b90098daf962cffa68f4b4f62ea60f798d0ef12929ede6adf && \
60
82
export LIBTOOL_DOWNLOAD_URL=http://ftp.gnu.org/gnu/libtool && \
61
- manylinux- entrypoint /build_scripts/install-libtool.sh
83
+ /tmp/cross-compiler/ entrypoint /build_scripts/install-libtool.sh
62
84
63
85
COPY build_scripts/install-libxcrypt.sh /build_scripts/
64
- RUN export LIBXCRYPT_VERSION=4.4.38 && \
86
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
87
+ export LIBXCRYPT_VERSION=4.4.38 && \
65
88
export LIBXCRYPT_HASH=80304b9c306ea799327f01d9a7549bdb28317789182631f1b54f4511b4206dd6 && \
66
89
export LIBXCRYPT_DOWNLOAD_URL=https://github.com/besser82/libxcrypt/releases/download && \
67
- manylinux-entrypoint /build_scripts/install-libxcrypt.sh
90
+ /tmp/cross-compiler/entrypoint /build_scripts/install-libxcrypt.sh
91
+
68
92
69
93
FROM runtime_base AS build_base
70
94
COPY build_scripts/install-build-packages.sh /build_scripts/
@@ -73,81 +97,111 @@ RUN manylinux-entrypoint /build_scripts/install-build-packages.sh
73
97
74
98
FROM build_base AS build_git
75
99
COPY build_scripts/build-curl.sh /build_scripts/
76
- RUN export CURL_ROOT=curl-8.15.0 && \
100
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
101
+ export CURL_ROOT=curl-8.15.0 && \
77
102
export CURL_HASH=d85cfc79dc505ff800cb1d321a320183035011fa08cb301356425d86be8fc53c && \
78
103
export CURL_DOWNLOAD_URL=https://curl.haxx.se/download && \
79
- manylinux- entrypoint /build_scripts/build-curl.sh
104
+ /tmp/cross-compiler/ entrypoint /build_scripts/build-curl.sh
80
105
COPY build_scripts/build-git.sh /build_scripts/
81
- RUN export GIT_ROOT=git-2.51.0 && \
106
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
107
+ export GIT_ROOT=git-2.51.0 && \
82
108
export GIT_HASH=3d531799d2cf2cac8e294ec6e3229e07bfca60dc6c783fe69e7712738bef7283 && \
83
109
export GIT_DOWNLOAD_URL=https://www.kernel.org/pub/software/scm/git && \
84
- manylinux-entrypoint /build_scripts/build-git.sh
110
+ /tmp/cross-compiler/entrypoint /build_scripts/build-git.sh
111
+
85
112
86
113
FROM build_base AS build_sqlite3
87
114
COPY build_scripts/build-sqlite3.sh /build_scripts/
88
- RUN export SQLITE_AUTOCONF_ROOT=sqlite-autoconf-3500400 && \
115
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
116
+ export SQLITE_AUTOCONF_ROOT=sqlite-autoconf-3500400 && \
89
117
export SQLITE_AUTOCONF_HASH=a3db587a1b92ee5ddac2f66b3edb41b26f9c867275782d46c3a088977d6a5b18 && \
90
118
export SQLITE_AUTOCONF_DOWNLOAD_URL=https://www.sqlite.org/2025 && \
91
- manylinux-entrypoint /build_scripts/build-sqlite3.sh
119
+ /tmp/cross-compiler/entrypoint /build_scripts/build-sqlite3.sh
120
+
92
121
93
122
FROM build_base AS build_tcl_tk
94
123
COPY build_scripts/build-tcltk.sh /build_scripts/
95
- RUN export TCL_ROOT=tcl8.6.17 && \
124
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
125
+ export TCL_ROOT=tcl8.6.17 && \
96
126
export TCL_HASH=a3903371efcce8a405c5c245d029e9f6850258a60fa3761c4d58995610949b31 && \
97
127
export TCL_DOWNLOAD_URL=https://prdownloads.sourceforge.net/tcl && \
98
128
export TK_ROOT=tk8.6.17 && \
99
129
export TK_HASH=e4982df6f969c08bf9dd858a6891059b4a3f50dc6c87c10abadbbe2fc4838946 && \
100
- manylinux-entrypoint /build_scripts/build-tcltk.sh
130
+ /tmp/cross-compiler/entrypoint /build_scripts/build-tcltk.sh
131
+
101
132
102
133
FROM build_base AS build_mpdecimal
103
134
COPY build_scripts/build-mpdecimal.sh /build_scripts/
104
- RUN export MPDECIMAL_ROOT=mpdecimal-4.0.0 && \
135
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
136
+ export MPDECIMAL_ROOT=mpdecimal-4.0.0 && \
105
137
export MPDECIMAL_HASH=942445c3245b22730fd41a67a7c5c231d11cb1b9936b9c0f76334fb7d0b4468c && \
106
138
export MPDECIMAL_DOWNLOAD_URL=https://www.bytereef.org/software/mpdecimal/releases && \
107
- manylinux- entrypoint /build_scripts/build-mpdecimal.sh
139
+ /tmp/cross-compiler/ entrypoint /build_scripts/build-mpdecimal.sh
108
140
109
141
110
142
FROM --platform=${BUILDPLATFORM} ghcr.io/sigstore/cosign/cosign:v2.5.0 AS cosign-bin
111
143
144
+
112
145
FROM build_base AS build_cpython
113
146
COPY --from=build_tcl_tk /manylinux-buildfs /
114
147
COPY --from=build_mpdecimal /manylinux-buildfs /
115
148
COPY --from=build_sqlite3 /manylinux-buildfs /
116
149
RUN if command -v apk >/dev/null 2>&1; then ldconfig /; else ldconfig; fi
117
150
COPY build_scripts/build-openssl.sh /build_scripts/
118
- RUN export OPENSSL_ROOT=openssl-3.5.2 && \
151
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
152
+ export OPENSSL_ROOT=openssl-3.5.2 && \
119
153
export OPENSSL_HASH=c53a47e5e441c930c3928cf7bf6fb00e5d129b630e0aa873b08258656e7345ec && \
120
154
export OPENSSL_DOWNLOAD_URL=https://github.com/openssl/openssl/releases/download/${OPENSSL_ROOT} && \
121
- manylinux- entrypoint /build_scripts/build-openssl.sh
155
+ /tmp/cross-compiler/ entrypoint /build_scripts/build-openssl.sh
122
156
COPY --from=cosign-bin /ko-app/cosign /usr/local/bin/cosign
123
157
COPY build_scripts/build-cpython.sh /build_scripts/
124
158
159
+
125
160
FROM build_cpython AS build_cpython38
126
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://github.com/login/oauth 3.8.20
161
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
162
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
163
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://github.com/login/oauth 3.8.20
127
164
128
165
FROM build_cpython AS build_cpython39
129
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://github.com/login/oauth 3.9.23
166
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
167
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
168
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://github.com/login/oauth 3.9.23
130
169
131
170
FROM build_cpython AS build_cpython310
132
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.10.18
171
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
172
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
173
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.10.18
133
174
134
175
FROM build_cpython AS build_cpython311
135
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.11.13
176
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
177
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
178
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.11.13
136
179
137
180
FROM build_cpython AS build_cpython312
138
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.12.11
181
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
182
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
183
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.12.11
139
184
140
185
FROM build_cpython AS build_cpython313
141
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.13.7
186
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
187
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
188
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.13.7
142
189
143
190
FROM build_cpython AS build_cpython313_nogil
144
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.13.7 nogil
191
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
192
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
193
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://accounts.google.com 3.13.7 nogil
145
194
146
195
FROM build_cpython AS build_cpython314
147
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://github.com/login/oauth 3.14.0rc2
196
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
197
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
198
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://github.com/login/oauth 3.14.0rc2
148
199
149
200
FROM build_cpython AS build_cpython314_nogil
150
- RUN manylinux-entrypoint /build_scripts/build-cpython.sh
[email protected] https://github.com/login/oauth 3.14.0rc2 nogil
201
+ ARG MANYLINUX_DISABLE_CLANG_FOR_CPYTHON
202
+ RUN --mount=type=bind,from=static_clang,target=/tmp/cross-compiler,ro \
203
+ /tmp/cross-compiler/entrypoint /build_scripts/build-cpython.sh
[email protected] https://github.com/login/oauth 3.14.0rc2 nogil
204
+
151
205
152
206
FROM runtime_base
153
207
COPY --from=build_tcl_tk /manylinux-rootfs /
0 commit comments