diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ee5bb9..8e8f9a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,14 +58,14 @@ jobs: - raspbian - aarch64 pyversion: - - py38 - py39 - py310 - py311 - py312 + - py313 include: - type: roborio - pyversion: py312 + pyversion: py313 steps: - uses: actions/checkout@v4 diff --git a/cross-ubuntu-py/Dockerfile.py38 b/cross-ubuntu-py/Dockerfile.py313 similarity index 68% rename from cross-ubuntu-py/Dockerfile.py38 rename to cross-ubuntu-py/Dockerfile.py313 index 8cdfc3e..27d01d3 100644 --- a/cross-ubuntu-py/Dockerfile.py38 +++ b/cross-ubuntu-py/Dockerfile.py313 @@ -7,13 +7,17 @@ FROM wpilib/${ARCH}-cross-ubuntu-minimal:${VERSION}-${UBUNTU} AS pycompile ARG TARGET_HOST=invalid-target-host ARG AC_TARGET_HOST=invalid-ac-target-host +ARG EXTRA_CROSS_CONFIGURE_ARGS= ENV TARGET_HOST=${TARGET_HOST} ENV AC_TARGET_HOST=${AC_TARGET_HOST} +ENV EXTRA_CROSS_CONFIGURE_ARGS=${EXTRA_CROSS_CONFIGURE_ARGS} ENV BUILD_HOST="x86_64" ENV WORKING_DIRECTORY="/build" ENV INSTALL_DIRECTORY="/build/crosspy" -ENV PYTHON_VERSION="3.8.16" +ENV PYTHON_VERSION="3.13.0" +ENV PYTHON_FTP_VERSION="3.13.0" +ENV PYTHON_EXE="python3.13" ENV SOURCE_DIRECTORY="Python-$PYTHON_VERSION" ENV PYTHON_ARCHIVE="Python-$PYTHON_VERSION.tar.xz" ENV PREFIX="$INSTALL_DIRECTORY" @@ -33,38 +37,45 @@ RUN set -xe; \ # Python cross-compilation # -COPY 0001-bpo-41916-allow-cross-compiled-python-to-have-pthrea.patch / -COPY 0001-Use-specified-host_cpu-when-cross-compiling-for-Linu.patch / - RUN set -xe; \ mkdir -p "$PREFIX"; \ # Download cd $WORKING_DIRECTORY; \ - wget -c https://www.python.org/ftp/python/$PYTHON_VERSION/$PYTHON_ARCHIVE; \ + wget -c https://www.python.org/ftp/python/$PYTHON_FTP_VERSION/$PYTHON_ARCHIVE; \ rm -rf $SOURCE_DIRECTORY; \ tar -xf $PYTHON_ARCHIVE; \ cd $SOURCE_DIRECTORY; \ - # patch -pthread CXX issue - patch -p1 < /0001-bpo-41916-allow-cross-compiled-python-to-have-pthrea.patch; \ - # patch arm cpu hardcoding - patch -p1 < /0001-Use-specified-host_cpu-when-cross-compiling-for-Linu.patch; \ # Build python for host cd $WORKING_DIRECTORY;cd $SOURCE_DIRECTORY; \ ./configure --enable-optimizations --with-ensurepip=install; \ - make -j altinstall; \ + make -j; \ + make -j altinstall + +RUN set -xe; \ + # Remove build dependencies -- compilation uses host for some reason + apt-get remove -y libreadline-dev libncursesw5-dev libssl-dev \ + libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev liblzma-dev lzma-dev libffi-dev zlib1g-dev; \ + apt-get autoremove -y; + +RUN set -xe; \ # cross-compile - cd $WORKING_DIRECTORY;cd $SOURCE_DIRECTORY; make distclean; \ + cd $WORKING_DIRECTORY; \ + rm -rf $SOURCE_DIRECTORY; \ + tar -xf $PYTHON_ARCHIVE; \ + cd $SOURCE_DIRECTORY; \ ./configure --host=$TARGET_HOST --build=$BUILD_HOST --prefix=$PREFIX \ - --disable-ipv6 --enable-unicode=ucs4 \ + --with-build-python=$(which $PYTHON_EXE) \ + --disable-ipv6 \ ac_cv_host=$AC_TARGET_HOST \ ac_cv_buggy_getaddrinfo=no \ ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no \ ac_cv_have_long_long_format=yes \ - ac_cv_pthread_is_default=no ac_cv_pthread=yes ac_cv_cxx_thread=yes; \ + ac_cv_pthread_is_default=no ac_cv_pthread=yes ac_cv_cxx_thread=yes \ + ${EXTRA_CROSS_CONFIGURE_ARGS}; \ make -j; \ # make install here is fine because we include --prefix in the configure statement make install - + # # Minimal cross-compilation environment @@ -84,11 +95,12 @@ COPY --from=pycompile /build/crosspy /build/crosspy ARG ARCH=invalid-arch ARG TARGET_HOST=invalid-target-host +ARG MACHINE_ARG= RUN set -xe; \ ldconfig; \ - python3.8 -m pip install crossenv==1.4.0; \ - python3.8 -m crossenv /build/crosspy/bin/python3.8 /build/venv --sysroot=$(${TARGET_HOST}-gcc -print-sysroot) --env UNIXCONFDIR=/build/venv/cross/etc; \ + python3.13 -m pip install 'crossenv~=1.5.0'; \ + python3.13 -m crossenv /build/crosspy/bin/python3.13 /build/venv ${MACHINE_ARG} --sysroot=$(${TARGET_HOST}-gcc -print-sysroot) --env UNIXCONFDIR=/build/venv/cross/etc; \ /build/venv/bin/cross-pip install wheel; COPY pip-${ARCH}.conf /build/venv/cross/pip.conf diff --git a/cross-ubuntu-py/os-release-roborio b/cross-ubuntu-py/os-release-roborio index 3a38a4c..fcae265 100644 --- a/cross-ubuntu-py/os-release-roborio +++ b/cross-ubuntu-py/os-release-roborio @@ -1,5 +1,5 @@ ID="nilrt-academic" NAME="NI Linux Real-Time - Academic" -VERSION="8.14" -VERSION_ID="8.14" -PRETTY_NAME="NI Linux Real-Time - Academic 8.14" \ No newline at end of file +VERSION="8.15" +VERSION_ID="8.15" +PRETTY_NAME="NI Linux Real-Time - Academic 8.15" \ No newline at end of file diff --git a/cross-ubuntu-py/pip-aarch64.conf b/cross-ubuntu-py/pip-aarch64.conf index 7f04e29..bc215ac 100644 --- a/cross-ubuntu-py/pip-aarch64.conf +++ b/cross-ubuntu-py/pip-aarch64.conf @@ -1,3 +1,3 @@ [global] -extra-index-url = https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2024/simple +extra-index-url = https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025/simple diff --git a/cross-ubuntu-py/pip-raspbian.conf b/cross-ubuntu-py/pip-raspbian.conf index 7f96c46..0383ef7 100644 --- a/cross-ubuntu-py/pip-raspbian.conf +++ b/cross-ubuntu-py/pip-raspbian.conf @@ -1,5 +1,5 @@ [global] extra-index-url = - https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2024/simple + https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025/simple https://www.piwheels.org/simple \ No newline at end of file diff --git a/cross-ubuntu-py/pip-roborio.conf b/cross-ubuntu-py/pip-roborio.conf index 7f04e29..bc215ac 100644 --- a/cross-ubuntu-py/pip-roborio.conf +++ b/cross-ubuntu-py/pip-roborio.conf @@ -1,3 +1,3 @@ [global] -extra-index-url = https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2024/simple +extra-index-url = https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025/simple diff --git a/cross-ubuntu-py/py.mk b/cross-ubuntu-py/py.mk index 3815a5b..dad75cb 100644 --- a/cross-ubuntu-py/py.mk +++ b/cross-ubuntu-py/py.mk @@ -1,5 +1,6 @@ UBUNTU?=22.04 +YEAR?=2025 DOCKER_USER?=wpilib TYPE_RASPBIAN=raspbian @@ -19,46 +20,11 @@ AC_TARGET_HOST_ROBORIO=armv7l-frc2024-linux-gnueabi .PHONY: build/cross-python -build/cross-python: build/cross-raspbian-py38 build/cross-aarch64-py38 build/cross-raspbian-py39 build/cross-aarch64-py39 build/cross-raspbian-py310 build/cross-aarch64-py310 build/cross-raspbian-py311 build/cross-aarch64-py311 build/cross-roborio-py312 build/cross-raspbian-py312 build/cross-aarch64-py312 - -.PHONY: push/cross-python -push/cross-python: push/cross-raspbian-py38 push/cross-aarch64-py38 push/cross-raspbian-py39 push/cross-aarch64-py39 push/cross-raspbian-py310 push/cross-aarch64-py310 push/cross-raspbian-py311 push/cross-aarch64-py311 push/cross-roborio-py312 push/cross-raspbian-py312 push/cross-aarch64-py312 - - -# -# Python 3.8 -# - -.PHONY: build/cross-raspbian-py38 -build/cross-raspbian-py38: - cd cross-ubuntu-py && \ - docker build . \ - -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py38 \ - --build-arg ARCH=$(TYPE_RASPBIAN) \ - --build-arg TARGET_HOST=$(TARGET_HOST_RASPBIAN) \ - --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_RASPBIAN) \ - --build-arg VERSION=$(VERSION_RASPBIAN) \ - -f Dockerfile.py38 - -.PHONY: push/cross-raspbian-py38 -push/cross-raspbian-py38: - docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py38 +build/cross-python: build/cross-raspbian-py39 build/cross-aarch64-py39 build/cross-raspbian-py310 build/cross-aarch64-py310 build/cross-raspbian-py311 build/cross-aarch64-py311 build/cross-raspbian-py312 build/cross-aarch64-py312 build/cross-roborio-py313 build/cross-raspbian-py313 build/cross-aarch64-py313 -.PHONY: build/cross-aarch64-py38 -build/cross-aarch64-py38: - cd cross-ubuntu-py && \ - docker build . \ - -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py38 \ - --build-arg ARCH=$(TYPE_AARCH64) \ - --build-arg TARGET_HOST=$(TARGET_HOST_AARCH64) \ - --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_AARCH64) \ - --build-arg VERSION=$(VERSION_AARCH64) \ - -f Dockerfile.py38 - -.PHONY: push/cross-aarch64-py38 -push/cross-aarch64-py38: - docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py38 +.PHONY: push/cross-python +push/cross-python: push/cross-raspbian-py39 push/cross-aarch64-py39 push/cross-raspbian-py310 push/cross-aarch64-py310 push/cross-raspbian-py311 push/cross-aarch64-py311 push/cross-raspbian-py312 push/cross-aarch64-py312 push/cross-roborio-py313 push/cross-raspbian-py313 push/cross-aarch64-py313 # @@ -69,7 +35,7 @@ push/cross-aarch64-py38: build/cross-raspbian-py39: cd cross-ubuntu-py && \ docker build . \ - -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py39 \ + -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py39 \ --build-arg ARCH=$(TYPE_RASPBIAN) \ --build-arg TARGET_HOST=$(TARGET_HOST_RASPBIAN) \ --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_RASPBIAN) \ @@ -78,14 +44,14 @@ build/cross-raspbian-py39: .PHONY: push/cross-raspbian-py39 push/cross-raspbian-py39: - docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py39 + docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py39 .PHONY: build/cross-aarch64-py39 build/cross-aarch64-py39: cd cross-ubuntu-py && \ docker build . \ - -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py39 \ + -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(YEAR)-$(VERSION_AARCH64)-$(UBUNTU)-py39 \ --build-arg ARCH=$(TYPE_AARCH64) \ --build-arg TARGET_HOST=$(TARGET_HOST_AARCH64) \ --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_AARCH64) \ @@ -94,7 +60,7 @@ build/cross-aarch64-py39: .PHONY: push/cross-aarch64-py39 push/cross-aarch64-py39: - docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py39 + docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(YEAR)-$(VERSION_AARCH64)-$(UBUNTU)-py39 # @@ -105,7 +71,7 @@ push/cross-aarch64-py39: build/cross-raspbian-py310: cd cross-ubuntu-py && \ docker build . \ - -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py310 \ + -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py310 \ --build-arg ARCH=$(TYPE_RASPBIAN) \ --build-arg TARGET_HOST=$(TARGET_HOST_RASPBIAN) \ --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_RASPBIAN) \ @@ -114,14 +80,14 @@ build/cross-raspbian-py310: .PHONY: push/cross-raspbian-py310 push/cross-raspbian-py310: - docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py310 + docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py310 .PHONY: build/cross-aarch64-py310 build/cross-aarch64-py310: cd cross-ubuntu-py && \ docker build . \ - -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py310 \ + -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(YEAR)-$(VERSION_AARCH64)-$(UBUNTU)-py310 \ --build-arg ARCH=$(TYPE_AARCH64) \ --build-arg TARGET_HOST=$(TARGET_HOST_AARCH64) \ --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_AARCH64) \ @@ -130,7 +96,7 @@ build/cross-aarch64-py310: .PHONY: push/cross-aarch64-py310 push/cross-aarch64-py310: - docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py310 + docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(YEAR)-$(VERSION_AARCH64)-$(UBUNTU)-py310 # @@ -141,7 +107,7 @@ push/cross-aarch64-py310: build/cross-raspbian-py311: cd cross-ubuntu-py && \ docker build . \ - -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py311 \ + -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py311 \ --build-arg ARCH=$(TYPE_RASPBIAN) \ --build-arg TARGET_HOST=$(TARGET_HOST_RASPBIAN) \ --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_RASPBIAN) \ @@ -150,14 +116,14 @@ build/cross-raspbian-py311: .PHONY: push/cross-raspbian-py311 push/cross-raspbian-py311: - docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py311 + docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py311 .PHONY: build/cross-aarch64-py311 build/cross-aarch64-py311: cd cross-ubuntu-py && \ docker build . \ - -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py311 \ + -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(YEAR)-$(VERSION_AARCH64)-$(UBUNTU)-py311 \ --build-arg ARCH=$(TYPE_AARCH64) \ --build-arg TARGET_HOST=$(TARGET_HOST_AARCH64) \ --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_AARCH64) \ @@ -166,7 +132,7 @@ build/cross-aarch64-py311: .PHONY: push/cross-aarch64-py311 push/cross-aarch64-py311: - docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py311 + docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(YEAR)-$(VERSION_AARCH64)-$(UBUNTU)-py311 @@ -178,7 +144,7 @@ push/cross-aarch64-py311: build/cross-raspbian-py312: cd cross-ubuntu-py && \ docker build . \ - -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py312 \ + -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py312 \ --build-arg ARCH=$(TYPE_RASPBIAN) \ --build-arg TARGET_HOST=$(TARGET_HOST_RASPBIAN) \ --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_RASPBIAN) \ @@ -187,7 +153,7 @@ build/cross-raspbian-py312: .PHONY: push/cross-raspbian-py312 push/cross-raspbian-py312: - docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(VERSION_RASPBIAN)-$(UBUNTU)-py312 + docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py312 .PHONY: build/cross-roborio-py312 @@ -212,7 +178,7 @@ push/cross-roborio-py312: build/cross-aarch64-py312: cd cross-ubuntu-py && \ docker build . \ - -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py312 \ + -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(YEAR)-$(VERSION_AARCH64)-$(UBUNTU)-py312 \ --build-arg ARCH=$(TYPE_AARCH64) \ --build-arg TARGET_HOST=$(TARGET_HOST_AARCH64) \ --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_AARCH64) \ @@ -221,4 +187,60 @@ build/cross-aarch64-py312: .PHONY: push/cross-aarch64-py312 push/cross-aarch64-py312: - docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py312 + docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(YEAR)-$(VERSION_AARCH64)-$(UBUNTU)-py312 + + + +# +# Python 3.13 +# + +.PHONY: build/cross-raspbian-py313 +build/cross-raspbian-py313: + cd cross-ubuntu-py && \ + docker build . \ + -t wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py313 \ + --build-arg ARCH=$(TYPE_RASPBIAN) \ + --build-arg TARGET_HOST=$(TARGET_HOST_RASPBIAN) \ + --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_RASPBIAN) \ + --build-arg VERSION=$(VERSION_RASPBIAN) \ + --build-arg EXTRA_CROSS_CONFIGURE_ARGS="ac_cv_libatomic_needed=yes" \ + -f Dockerfile.py313 + +.PHONY: push/cross-raspbian-py313 +push/cross-raspbian-py313: + docker push wpilib/$(TYPE_RASPBIAN)-cross-ubuntu:$(YEAR)-$(VERSION_RASPBIAN)-$(UBUNTU)-py313 + + +.PHONY: build/cross-roborio-py313 +build/cross-roborio-py313: + cd cross-ubuntu-py && \ + docker build . \ + -t wpilib/$(TYPE_ROBORIO)-cross-ubuntu:$(YEAR)-$(UBUNTU)-py313 \ + --build-arg ARCH=$(TYPE_ROBORIO) \ + --build-arg TARGET_HOST=$(TARGET_HOST_ROBORIO) \ + --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_ROBORIO) \ + --build-arg VERSION=$(VERSION_ROBORIO) \ + --build-arg MACHINE_ARG="--machine=roborio" \ + -f Dockerfile.py313 + +.PHONY: push/cross-roborio-py313 +push/cross-roborio-py313: + docker push wpilib/$(TYPE_ROBORIO)-cross-ubuntu:$(YEAR)-$(UBUNTU)-py313 + + + +.PHONY: build/cross-aarch64-py313 +build/cross-aarch64-py313: + cd cross-ubuntu-py && \ + docker build . \ + -t wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py313 \ + --build-arg ARCH=$(TYPE_AARCH64) \ + --build-arg TARGET_HOST=$(TARGET_HOST_AARCH64) \ + --build-arg AC_TARGET_HOST=$(AC_TARGET_HOST_AARCH64) \ + --build-arg VERSION=$(VERSION_AARCH64) \ + -f Dockerfile.py313 + +.PHONY: push/cross-aarch64-py313 +push/cross-aarch64-py313: + docker push wpilib/$(TYPE_AARCH64)-cross-ubuntu:$(VERSION_AARCH64)-$(UBUNTU)-py313