From d6e9b0dcf9decb6a092174c7f8b3fa0febe6de1d Mon Sep 17 00:00:00 2001 From: ColorfulRhino <131405023+ColorfulRhino@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:40:09 +0200 Subject: [PATCH] python: Move `python3-setuptools` and `python3-pyelftools` to requirements.txt Different build hosts have vastly different versions of setuptools and pyelftools depending on the host OS, e.g. Ubuntu 22.04 has setuptools v59 while the latest version at the time of this commit is setuptools v71. Using Pip instead of APT to download these packages assures that all build hosts use the same version, removing some points of failures and inconsistencies. --- lib/functions/host/prepare-host.sh | 3 ++- requirements.txt | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/functions/host/prepare-host.sh b/lib/functions/host/prepare-host.sh index ed97a6aa8..3e4e420c3 100644 --- a/lib/functions/host/prepare-host.sh +++ b/lib/functions/host/prepare-host.sh @@ -290,7 +290,8 @@ function adaptative_prepare_host_dependencies() { host_deps_add_extra_python # See python-tools.sh::host_deps_add_extra_python() ### Python3 -- required for Armbian's Python tooling, and also for more recent u-boot builds. Needs 3.9+; ffi-dev is needed for some Python packages when the wheel is not prebuilt - host_dependencies+=("python3-dev" "python3-setuptools" "python3-pip" "python3-pyelftools" "libffi-dev") + ### 'python3-setuptools' and 'python3-pyelftools' moved to requirements.txt to make sure build hosts use the same/latest versions of these tools. + host_dependencies+=("python3-dev" "python3-pip" "libffi-dev") # Needed for some u-boot's, lest "tools/mkeficapsule.c:21:10: fatal error: gnutls/gnutls.h" host_dependencies+=("libgnutls28-dev") diff --git a/requirements.txt b/requirements.txt index 2d21cf6a3..83dcdb344 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,8 @@ # Always use a fixed version, this is important for correct hashing. # Dependabot will keep these versions up to date. +setuptools == 70.1.1 # for building Python packages +pyelftools == 0.31 # for building U-Boot unidiff == 0.7.5 # for parsing unified diff GitPython == 3.1.43 # for manipulating git repos unidecode == 1.3.8 # for converting strings to ascii