Skip to content

Commit 5806b49

Browse files
more changes to swift, java
1 parent 14a4230 commit 5806b49

File tree

2 files changed

+32
-23
lines changed

2 files changed

+32
-23
lines changed

Dockerfile

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ ENV PATH=$HOME/.local/share/mise/shims:$PATH
9696

9797
### LLVM ###
9898

99-
RUN install -dm 0755 /etc/apt/keyrings \
100-
&& curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key \
101-
| gpg --batch --yes --dearmor -o /etc/apt/keyrings/llvm.gpg \
102-
&& chmod 0644 /etc/apt/keyrings/llvm.gpg \
103-
&& . /etc/os-release \
104-
&& echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] https://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-20 main" \
105-
> /etc/apt/sources.list.d/llvm.list \
106-
&& apt-get update \
107-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends clang-20 lld-20 lldb-20 llvm-20 \
108-
&& rm -rf /var/lib/apt/lists/*
99+
RUN apt-get update && apt-get install -y --no-install-recommends \
100+
cmake=3.28.* \
101+
ccache=4.9.* \
102+
ninja-build=1.11.* \
103+
nasm=2.16.* \
104+
yasm=1.3.* \
105+
gawk=1:5.2.* \
106+
lsb-release=12.0-* \
107+
&& rm -rf /var/lib/apt/lists/* \
108+
&& bash -c "$(curl -fsSL https://apt.llvm.org/llvm.sh)"
109109

110110
### PYTHON ###
111111

@@ -124,7 +124,7 @@ RUN git -c advice.detachedHead=0 clone --branch "$PYENV_VERSION" --depth 1 https
124124
&& pyenv install $PYTHON_VERSIONS \
125125
&& pyenv global "$PYTHON_VERSION"
126126

127-
# Install pipx for common global package managers (e.g. poetry)
127+
# Install pipx for common global package managers (e.g. poetry)
128128
ENV PIPX_BIN_DIR=/root/.local/bin
129129
ENV PATH=$PIPX_BIN_DIR:$PATH
130130
RUN apt-get update && apt-get install -y --no-install-recommends pipx=1.4.* \
@@ -170,24 +170,29 @@ RUN mise use --global "bun@${BUN_VERSION}"
170170

171171
ARG GRADLE_VERSION=8.14
172172
ARG MAVEN_VERSION=3.9.10
173-
174173
# OpenJDK 11 is not available for arm64. Codex Web only uses amd64 which
175174
# does support 11.
176-
RUN if [ "$TARGETARCH" = "arm64" ]; then \
177-
JAVA_VERSIONS="21 17"; \
178-
else \
179-
JAVA_VERSIONS="21 17 11"; \
180-
fi; \
181-
for v in $JAVA_VERSIONS; do mise install "java@${v}"; done && \
182-
mise use --global "java@${JAVA_VERSIONS%% *}" && \
183-
mise use --global "gradle@${GRADLE_VERSION}" && \
184-
mise use --global "maven@${MAVEN_VERSION}"
175+
ARG AMD_JAVA_VERSIONS="21 17 11"
176+
ARG ARM_JAVA_VERSIONS="21 17"
177+
178+
RUN JAVA_VERSIONS="$( [ "$TARGETARCH" = "arm64" ] && echo "$ARM_JAVA_VERSIONS" || echo "$AMD_JAVA_VERSIONS" )" \
179+
&& for v in $JAVA_VERSIONS; do mise install "java@${v}"; done \
180+
&& mise use --global "java@${JAVA_VERSIONS%% *}" \
181+
&& mise use --global "gradle@${GRADLE_VERSION}" \
182+
&& mise use --global "maven@${MAVEN_VERSION}"
185183

186184
### SWIFT ###
187185

188186
ARG SWIFT_VERSIONS="6.1 5.10.1"
189-
RUN for v in $SWIFT_VERSIONS; do mise install "swift@${v}"; done \
190-
&& mise use --global "swift@${SWIFT_VERSIONS%% *}"
187+
# mise currently broken for swift on ARM
188+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
189+
for v in $SWIFT_VERSIONS; do \
190+
mise install "swift@${v}"; \
191+
done && \
192+
mise use --global "swift@${SWIFT_VERSIONS%% *}"; \
193+
else \
194+
echo "Skipping Swift install on $TARGETARCH"; \
195+
fi
191196

192197
### RUST ###
193198

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ docker pull ghcr.io/openai/codex-universal:latest
1717
This repository builds the image for both linux/amd64 and linux/arm64. However we only run the linux/amd64 version.
1818
Your installed Docker may support linux/amd64 emulation by passing the `--platform linux/amd64` flag.
1919

20+
The arm64 differs from the amd64 image in 2 ways:
21+
- OpenJDK 10 is not available on amd64
22+
- The arm64 image skips install swift because of a current bug with mise
23+
2024
The below script shows how can you approximate the `setup` environment in Codex:
2125

2226
```sh

0 commit comments

Comments
 (0)