diff --git a/ros_buildfarm/common.py b/ros_buildfarm/common.py index ea1a05e09..319d524af 100644 --- a/ros_buildfarm/common.py +++ b/ros_buildfarm/common.py @@ -172,7 +172,13 @@ 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) + 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 return versions @@ -318,6 +324,7 @@ def get_short_os_code_name(os_code_name): 'focal': 'F', 'jammy': 'J', 'jessie': 'J', + 'noble': 'N', 'saucy': 'S', 'stretch': 'S', 'trusty': 'T', 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]@