From 38030c13260f13937349e0436450d8cfd53e288a Mon Sep 17 00:00:00 2001 From: "Marco A. Gutierrez" Date: Wed, 17 Jan 2024 16:21:34 +0100 Subject: [PATCH 1/4] Add os code name mapping for Ubuntu Noble (#1017) Signed-off-by: Marco A. Gutierrez --- ros_buildfarm/common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ros_buildfarm/common.py b/ros_buildfarm/common.py index ea1a05e09..0deb7acfc 100644 --- a/ros_buildfarm/common.py +++ b/ros_buildfarm/common.py @@ -318,6 +318,7 @@ def get_short_os_code_name(os_code_name): 'focal': 'F', 'jammy': 'J', 'jessie': 'J', + 'noble': 'N', 'saucy': 'S', 'stretch': 'S', 'trusty': 'T', From bf2bd689455ef1142b89e83236739aeebd90c37e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Crist=C3=B3bal=20Arroyo?= Date: Wed, 31 Jan 2024 14:49:03 -0500 Subject: [PATCH 2/4] Fix `pytest-rerunfailures` installation by using apt instead of pip (#1020) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change installation of pytest-rerunfailures to use apt Signed-off-by: Cristóbal Arroyo * Initial commit * Remove os_code_name Signed-off-by: Cristóbal Arroyo --------- Signed-off-by: Cristóbal Arroyo --- ros_buildfarm/templates/devel/devel_task.Dockerfile.em | 6 +++++- .../snippet/install_pytest-rerunfailures.Dockerfile.em | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 ros_buildfarm/templates/snippet/install_pytest-rerunfailures.Dockerfile.em diff --git a/ros_buildfarm/templates/devel/devel_task.Dockerfile.em b/ros_buildfarm/templates/devel/devel_task.Dockerfile.em index 682df198c..95d1a79b3 100644 --- a/ros_buildfarm/templates/devel/devel_task.Dockerfile.em +++ b/ros_buildfarm/templates/devel/devel_task.Dockerfile.em @@ -66,7 +66,11 @@ RUN python3 -u /tmp/wrapper_scripts/apt.py update-install-clean -q -y git python RUN python3 -u /tmp/wrapper_scripts/apt.py update-install-clean -q -y python3-pip @# colcon-core.package_identification.python needs at least setuptools 30.3.0 @# pytest-rerunfailures enables usage of --retest-until-pass -RUN pip3 install -U setuptools==59.6.0 pytest-rerunfailures +@(TEMPLATE( + 'snippet/install_pytest-rerunfailures.Dockerfile.em', + os_name=os_name, +))@ +RUN pip3 install -U setuptools==59.6.0 @[end if]@ RUN python3 -u /tmp/wrapper_scripts/apt.py update-install-clean -q -y ccache diff --git a/ros_buildfarm/templates/snippet/install_pytest-rerunfailures.Dockerfile.em b/ros_buildfarm/templates/snippet/install_pytest-rerunfailures.Dockerfile.em new file mode 100644 index 000000000..727ebf0da --- /dev/null +++ b/ros_buildfarm/templates/snippet/install_pytest-rerunfailures.Dockerfile.em @@ -0,0 +1,4 @@ +@[if os_name == 'debian' or os_name == 'ubuntu']@ +@# python3-pytest-rerunfailures is supported since Ubuntu jammy +RUN for i in 1 2 3; do apt-get update && apt-get install -q -y python3-pytest-rerunfailures && apt-get clean && break || if [ $i -lt 3 ]; then sleep 5; else false; fi; done +@[end if]@ From 09a78f439aa21565a885bc863445f35b9eaa618e Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Fri, 8 Mar 2024 16:16:52 -0600 Subject: [PATCH 3/4] Handle virtual deb packages when querying apt cache (#1023) These virtual packages are supported by the rosdep tool, so should be acceptable for use here as well. --- ros_buildfarm/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ros_buildfarm/common.py b/ros_buildfarm/common.py index 0deb7acfc..1347818ca 100644 --- a/ros_buildfarm/common.py +++ b/ros_buildfarm/common.py @@ -172,7 +172,11 @@ def get_distribution_repository_keys(urls, key_files): def get_binary_package_versions(apt_cache, debian_pkg_names): versions = {} for debian_pkg_name in debian_pkg_names: - pkg = apt_cache[debian_pkg_name] + pkg = apt_cache.get(debian_pkg_name) + if not pkg: + prov = apt_cache.get_providing_packages(debian_pkg_name) + assert len(prov) == 1 + pkg = apt_cache[prov[0]] versions[debian_pkg_name] = max(pkg.versions).version return versions From 7c12df582301a99f3d2e877f3c63e69581da5f8e Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Mon, 11 Mar 2024 16:06:00 -0500 Subject: [PATCH 4/4] Fix error message when a package isn't available (#1024) The original behavior was to raise a KeyError with the missing package name, but this was regressed to an assert with no actionable error message by a previous change. Fixes 09a78f4 --- ros_buildfarm/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ros_buildfarm/common.py b/ros_buildfarm/common.py index 1347818ca..319d524af 100644 --- a/ros_buildfarm/common.py +++ b/ros_buildfarm/common.py @@ -175,6 +175,8 @@ def get_binary_package_versions(apt_cache, debian_pkg_names): pkg = apt_cache.get(debian_pkg_name) if not pkg: prov = apt_cache.get_providing_packages(debian_pkg_name) + if not prov: + raise KeyError("No packages available for '%s'" % (debian_pkg_name,)) assert len(prov) == 1 pkg = apt_cache[prov[0]] versions[debian_pkg_name] = max(pkg.versions).version