Skip to content

Commit 71d9034

Browse files
authored
Build images for Python 3.14.0 and update urls for 2026 (#66)
1 parent c75b916 commit 71d9034

File tree

5 files changed

+202
-6
lines changed

5 files changed

+202
-6
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,23 @@ jobs:
101101
- py311
102102
- py312
103103
- py313
104+
- py314
104105
ubuntu-version:
105106
- 22.04
106107
- 24.04
107108
include:
108109
- type: roborio
109110
pyversion: py313
110111
ubuntu-version: 22.04
112+
- type: roborio
113+
pyversion: py314
114+
ubuntu-version: 22.04
111115
- type: systemcore
112116
pyversion: py313
113117
ubuntu-version: 24.04
118+
- type: systemcore
119+
pyversion: py314
120+
ubuntu-version: 24.04
114121

115122
steps:
116123
- uses: actions/checkout@v4

cross-ubuntu-py/Dockerfile.py314

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
2+
ARG UBUNTU=invalid-ubuntu
3+
ARG ARCH=invalid-arch
4+
ARG VERSION=invalid-version
5+
6+
FROM wpilib/${ARCH}-cross-ubuntu-minimal:${VERSION}-${UBUNTU} AS pycompile
7+
8+
ARG TARGET_HOST=invalid-target-host
9+
ARG AC_TARGET_HOST=invalid-ac-target-host
10+
ARG EXTRA_CROSS_CONFIGURE_ARGS=
11+
12+
ENV TARGET_HOST=${TARGET_HOST}
13+
ENV AC_TARGET_HOST=${AC_TARGET_HOST}
14+
ENV EXTRA_CROSS_CONFIGURE_ARGS=${EXTRA_CROSS_CONFIGURE_ARGS}
15+
ENV BUILD_HOST="x86_64"
16+
ENV WORKING_DIRECTORY="/build"
17+
ENV INSTALL_DIRECTORY="/build/crosspy"
18+
ENV PYTHON_VERSION="3.14.0"
19+
ENV PYTHON_FTP_VERSION="3.14.0"
20+
ENV PYTHON_EXE="python3.14"
21+
ENV SOURCE_DIRECTORY="Python-$PYTHON_VERSION"
22+
ENV PYTHON_ARCHIVE="Python-$PYTHON_VERSION.tar.xz"
23+
ENV PREFIX="$INSTALL_DIRECTORY"
24+
25+
#
26+
# Python compilation prereqs
27+
#
28+
29+
RUN set -xe; \
30+
apt-get update; \
31+
apt-get install -y build-essential checkinstall g++ libreadline-dev libncurses-dev libssl-dev \
32+
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev liblzma-dev lzma-dev libffi-dev zlib1g-dev; \
33+
# cleanup
34+
rm -rf /var/lib/apt/lists/*
35+
36+
#
37+
# Python cross-compilation
38+
#
39+
40+
RUN set -xe; \
41+
mkdir -p "$PREFIX"; \
42+
# Download
43+
cd $WORKING_DIRECTORY; \
44+
wget -c https://www.python.org/ftp/python/$PYTHON_FTP_VERSION/$PYTHON_ARCHIVE; \
45+
rm -rf $SOURCE_DIRECTORY; \
46+
tar -xf $PYTHON_ARCHIVE; \
47+
cd $SOURCE_DIRECTORY; \
48+
# Build python for host
49+
cd $WORKING_DIRECTORY;cd $SOURCE_DIRECTORY; \
50+
./configure --enable-optimizations --with-ensurepip=install; \
51+
make -j; \
52+
make -j altinstall
53+
54+
RUN set -xe; \
55+
# Remove build dependencies -- compilation uses host for some reason
56+
apt-get remove -y libreadline-dev libncursesw5-dev libssl-dev \
57+
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev liblzma-dev lzma-dev libffi-dev zlib1g-dev; \
58+
apt-get autoremove -y;
59+
60+
RUN set -xe; \
61+
# cross-compile
62+
cd $WORKING_DIRECTORY; \
63+
rm -rf $SOURCE_DIRECTORY; \
64+
tar -xf $PYTHON_ARCHIVE; \
65+
cd $SOURCE_DIRECTORY; \
66+
./configure --host=$TARGET_HOST --build=$BUILD_HOST --prefix=$PREFIX \
67+
--with-build-python=$(which $PYTHON_EXE) \
68+
--disable-ipv6 \
69+
ac_cv_host=$AC_TARGET_HOST \
70+
ac_cv_buggy_getaddrinfo=no \
71+
ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no \
72+
ac_cv_have_long_long_format=yes \
73+
ac_cv_pthread_is_default=no ac_cv_pthread=yes ac_cv_cxx_thread=yes \
74+
${EXTRA_CROSS_CONFIGURE_ARGS}; \
75+
make -j; \
76+
# make install here is fine because we include --prefix in the configure statement
77+
make install
78+
79+
80+
#
81+
# Minimal cross-compilation environment
82+
#
83+
84+
FROM wpilib/${ARCH}-cross-ubuntu-minimal:${VERSION}-${UBUNTU} AS crossenv
85+
86+
RUN set -xe; \
87+
apt-get update; \
88+
apt-get install -y \
89+
binutils libreadline8 libncursesw6 libssl3 \
90+
libsqlite3-0 libgdbm6 libbz2-1.0 liblzma5 libffi8 zlib1g; \
91+
rm -rf /var/lib/apt/lists/*
92+
93+
COPY --from=pycompile /usr/local /usr/local
94+
COPY --from=pycompile /build/crosspy /build/crosspy
95+
96+
ARG ARCH=invalid-arch
97+
ARG TARGET_HOST=invalid-target-host
98+
ARG MACHINE_ARG=
99+
ARG EXTRA_CROSSENV_ARGS=
100+
101+
RUN set -xe; \
102+
ldconfig; \
103+
python3.14 -m pip install 'crossenv~=1.6.0'; \
104+
python3.14 -m crossenv /build/crosspy/bin/python3.14 /build/venv ${MACHINE_ARG} --sysroot=$(${TARGET_HOST}-gcc -print-sysroot) --env UNIXCONFDIR=/build/venv/cross/etc ${EXTRA_CROSSENV_ARGS}; \
105+
/build/venv/bin/cross-pip install wheel;
106+
107+
COPY pip-${ARCH}.conf /build/venv/cross/pip.conf
108+
COPY os-release-${ARCH} /build/venv/cross/etc/os-release
109+
110+
ENV RPYBUILD_PARALLEL=1
111+

cross-ubuntu-py/pip-raspbian.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
[global]
33
extra-index-url =
4-
https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025/simple
4+
https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2026/simple
55
https://www.piwheels.org/simple

cross-ubuntu-py/pip-roborio.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22
[global]
3-
extra-index-url = https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025/simple
3+
extra-index-url = https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2026/simple

cross-ubuntu-py/py.mk

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
UBUNTU?=22.04
3-
YEAR?=2025
3+
YEAR?=2026
44
DOCKER_USER?=wpilib
55

66
TYPE_RASPBIAN=raspbian
@@ -20,11 +20,19 @@ AC_TARGET_HOST_SYSTEMCORE=aarch64-bookworm-linux-gnu
2020

2121

2222
.PHONY: build/cross-python
23-
build/cross-python: build/cross-raspbian-py311 build/cross-raspbian-py312 build/cross-roborio-py313 build/cross-systemcore-py313 build/cross-raspbian-py313
23+
build/cross-python: \
24+
build/cross-raspbian-py311 \
25+
build/cross-raspbian-py312 \
26+
build/cross-roborio-py313 build/cross-systemcore-py313 build/cross-raspbian-py313 \
27+
build/cross-roborio-py314 build/cross-systemcore-py314 build/cross-raspbian-py314
2428

2529

2630
.PHONY: push/cross-python
27-
push/cross-python: push/cross-raspbian-py311 push/cross-raspbian-py312 push/cross-roborio-py313 push/cross-systemcore-py313 push/cross-raspbian-py313
31+
push/cross-python: \
32+
push/cross-raspbian-py311 \
33+
push/cross-raspbian-py312 \
34+
push/cross-roborio-py313 push/cross-systemcore-py313 push/cross-raspbian-py313 \
35+
push/cross-roborio-py313 push/cross-systemcore-py314 push/cross-raspbian-py314
2836

2937

3038
# raspbian manylinux tags for crossenv
@@ -163,4 +171,74 @@ build/cross-systemcore-py313:
163171

164172
.PHONY: push/cross-systemcore-py313
165173
push/cross-systemcore-py313:
166-
docker push wpilib/$(TYPE_SYSTEMCORE)-cross-ubuntu:$(YEAR)-$(UBUNTU)-py313
174+
docker push wpilib/$(TYPE_SYSTEMCORE)-cross-ubuntu:$(YEAR)-$(UBUNTU)-py313
175+
176+
177+
#
178+
# Python 3.14
179+
#
180+
181+
.PHONY: build/cross-raspbian-py314
182+
build/cross-raspbian-py314:
183+
cd cross-ubuntu-py && \
184+
docker build . \
185+
-t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py314 \
186+
--build-arg UBUNTU=$(UBUNTU) \
187+
--build-arg ARCH=$(TYPE_RASPBIAN) \
188+
--build-arg TARGET_HOST=$(TARGET_HOST_RASPBIAN) \
189+
--build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_RASPBIAN) \
190+
--build-arg VERSION=$(VERSION_RASPBIAN) \
191+
--build-arg EXTRA_CROSS_CONFIGURE_ARGS="ac_cv_libatomic_needed=yes" \
192+
--build-arg EXTRA_CROSSENV_ARGS="$(RPI_MANYLINUX_TAGS) --platform-tag=linux_armv7l" \
193+
-f Dockerfile.py314
194+
195+
cd cross-ubuntu-py && \
196+
docker build . \
197+
-t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:2027-$(VERSION_RASPBIAN)-$(UBUNTU)-py314 \
198+
--build-arg IMAGE=wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py314 \
199+
-f Dockerfile.raspbian-2027
200+
201+
.PHONY: push/cross-raspbian-py314
202+
push/cross-raspbian-py314:
203+
docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py314
204+
205+
docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:2027-$(VERSION_RASPBIAN)-$(UBUNTU)-py314
206+
207+
208+
.PHONY: build/cross-roborio-py314
209+
build/cross-roborio-py314:
210+
cd cross-ubuntu-py && \
211+
docker build . \
212+
-t wpilib/$(TYPE_ROBORIO)-cross-ubuntu:$(YEAR)-$(UBUNTU)-py314 \
213+
--build-arg UBUNTU=$(UBUNTU) \
214+
--build-arg ARCH=$(TYPE_ROBORIO) \
215+
--build-arg TARGET_HOST=$(TARGET_HOST_ROBORIO) \
216+
--build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_ROBORIO) \
217+
--build-arg VERSION=$(VERSION_ROBORIO) \
218+
--build-arg MACHINE_ARG="--machine=roborio" \
219+
--build-arg EXTRA_CROSSENV_ARGS="--platform-tag=linux_roborio" \
220+
-f Dockerfile.py314
221+
222+
.PHONY: push/cross-roborio-py314
223+
push/cross-roborio-py314:
224+
docker push wpilib/$(TYPE_ROBORIO)-cross-ubuntu:$(YEAR)-$(UBUNTU)-py314
225+
226+
227+
228+
.PHONY: build/cross-systemcore-py314
229+
build/cross-systemcore-py314:
230+
cd cross-ubuntu-py && \
231+
docker build . \
232+
-t wpilib/$(TYPE_SYSTEMCORE)-cross-ubuntu:$(YEAR)-$(UBUNTU)-py314 \
233+
--build-arg UBUNTU=$(UBUNTU) \
234+
--build-arg ARCH=$(TYPE_SYSTEMCORE) \
235+
--build-arg TARGET_HOST=$(TARGET_HOST_SYSTEMCORE) \
236+
--build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_SYSTEMCORE) \
237+
--build-arg VERSION=$(VERSION_SYSTEMCORE) \
238+
--build-arg MACHINE_ARG="--machine=systemcore" \
239+
--build-arg EXTRA_CROSSENV_ARGS="--platform-tag=linux_systemcore $(SC_MANYLINUX_TAGS) --platform-tag=linux_aarch64" \
240+
-f Dockerfile.py314
241+
242+
.PHONY: push/cross-systemcore-py314
243+
push/cross-systemcore-py314:
244+
docker push wpilib/$(TYPE_SYSTEMCORE)-cross-ubuntu:$(YEAR)-$(UBUNTU)-py314

0 commit comments

Comments
 (0)