@@ -96,7 +96,7 @@ dev-native:
9696# pip install --only-binary=:all: --no-index --find-links wheelhouse codex-python
9797# Requires Docker; for cross-arch builds ensure binfmt/qemu is enabled.
9898# -----------------------------------------------------------------------------
99- .PHONY : wheelhouse-linux wheelhouse-clean
99+ .PHONY : wheelhouse-linux wheelhouse-clean wheelhouse-linux-amd64 wheelhouse-linux-arm64 wheelhouse-musl-amd64 wheelhouse-musl-arm64
100100
101101WHEELHOUSE ?= wheelhouse
102102MANYLINUX_X86 ?= quay.io/pypa/manylinux2014_x86_64
@@ -147,3 +147,43 @@ wheelhouse-linux: wheelhouse-clean
147147 $$ P -m pip install -U pip maturin && \
148148 PATH=$$ HOME/.cargo/bin:$$ PATH $$ P -m maturin build --release -m /io/crates/codex_native/Cargo.toml -i $$ P --compatibility musllinux_1_2 -o /io/$(WHEELHOUSE ) '
149149 @echo " Wheelhouse contents:" && ls -al $(WHEELHOUSE )
150+
151+ # Build only manylinux x86_64 (useful to avoid cross-arch emulation)
152+ wheelhouse-linux-amd64 : wheelhouse-clean
153+ @mkdir -p $(WHEELHOUSE )
154+ docker run --rm --platform linux/amd64 -v " $( PWD) " :/io $(MANYLINUX_X86 ) \
155+ bash -lc ' set -e; (command -v curl >/dev/null 2>&1 || yum -y install curl); \
156+ curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal; \
157+ . $$ HOME/.cargo/env; P=$$(ls -1 /opt/python/cp312*/bin/python | head -n1 ) ; \
158+ $$ P -m pip install -U pip maturin; \
159+ PATH=$$ HOME/.cargo/bin:$$ PATH $$ P -m maturin build --release -j $$(( $$(nproc ) ) ) -m /io/crates/codex_native/Cargo.toml -i $$ P -o /io/$(WHEELHOUSE ) '
160+
161+ # Build only manylinux aarch64 (fast on Apple Silicon; slow on x86_64)
162+ wheelhouse-linux-arm64 : wheelhouse-clean
163+ @mkdir -p $(WHEELHOUSE )
164+ docker run --rm --platform linux/arm64 -v " $( PWD) " :/io $(MANYLINUX_ARM ) \
165+ bash -lc ' set -e; (command -v curl >/dev/null 2>&1 || yum -y install curl); \
166+ curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal; \
167+ . $$ HOME/.cargo/env; P=$$(ls -1 /opt/python/cp312*/bin/python | head -n1 ) ; \
168+ $$ P -m pip install -U pip maturin; \
169+ PATH=$$ HOME/.cargo/bin:$$ PATH $$ P -m maturin build --release -j $$(( $$(nproc ) ) ) -m /io/crates/codex_native/Cargo.toml -i $$ P -o /io/$(WHEELHOUSE ) '
170+
171+ # Build only musllinux x86_64 (Alpine)
172+ wheelhouse-musl-amd64 : wheelhouse-clean
173+ @mkdir -p $(WHEELHOUSE )
174+ docker run --rm --platform linux/amd64 -v " $( PWD) " :/io $(MUSLLINUX_X86 ) \
175+ bash -lc ' set -e; (command -v curl >/dev/null 2>&1 || apk add --no-cache curl); \
176+ curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal; \
177+ . $$ HOME/.cargo/env; P=$$(ls -1 /opt/python/cp312*/bin/python | head -n1 ) ; \
178+ $$ P -m pip install -U pip maturin; \
179+ PATH=$$ HOME/.cargo/bin:$$ PATH $$ P -m maturin build --release --compatibility musllinux_1_2 -j $$(( $$(nproc ) ) ) -m /io/crates/codex_native/Cargo.toml -i $$ P -o /io/$(WHEELHOUSE ) '
180+
181+ # Build only musllinux aarch64 (Alpine)
182+ wheelhouse-musl-arm64 : wheelhouse-clean
183+ @mkdir -p $(WHEELHOUSE )
184+ docker run --rm --platform linux/arm64 -v " $( PWD) " :/io $(MUSLLINUX_ARM ) \
185+ bash -lc ' set -e; (command -v curl >/dev/null 2>&1 || apk add --no-cache curl); \
186+ curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal; \
187+ . $$ HOME/.cargo/env; P=$$(ls -1 /opt/python/cp312*/bin/python | head -n1 ) ; \
188+ $$ P -m pip install -U pip maturin; \
189+ PATH=$$ HOME/.cargo/bin:$$ PATH $$ P -m maturin build --release --compatibility musllinux_1_2 -j $$(( $$(nproc ) ) ) -m /io/crates/codex_native/Cargo.toml -i $$ P -o /io/$(WHEELHOUSE ) '
0 commit comments