gazebo-tooling / action-gz-ci

MIT License
5 stars 4 forks source link

pip install of rocker and colcon-common-extensions conflict on 24.04 #76

Closed scpeters closed 4 months ago

scpeters commented 4 months ago

Sometime in the past week, workflows using action-gz-ci started failing on Ubuntu 24.04 (Noble) due to a change in behavior of pip when attempting to resolve a conflict between empy versions required by colcon (which is limited to empy <4 due to https://github.com/colcon/colcon-core/issues/602). Here's how the conflict occurs:

  1. We pip install the requirements.txt file from gzdev, which includes osrf/rocker.
  2. rocker lists empy as one of its install_requires in its setup.py without placing a version constraint on empy, which leads to empy 4.1 being installed.
  3. We pip install colcon-common-extensions, which requires empy < 4, so empy 3.3.0 is installed and empy 4.1 is uninstalled.

About a week ago, this is how it worked (see https://github.com/gazebosim/sdformat/actions/runs/9571038885/job/26387170112 for example)

~~~ Building wheels for collected packages: EmPy Building wheel for EmPy (setup.py): started Building wheel for EmPy (setup.py): finished with status 'done' Created wheel for EmPy: filename=empy-3.3.4-py3-none-any.whl size=29337 sha256=3c9136d6177b3e88f93c6861752210e6f028ceef508515eb594eaa8a589ff03a Stored in directory: /tmp/pip-ephem-wheel-cache-2qi0wql7/wheels/d4/8c/2a/6c28d813f5c017e0c5270ca3b58527616dff038084815779ae Successfully built EmPy Installing collected packages: notify2, EmPy, distlib, vcstool, python-dateutil, pyparsing, docutils, coverage, argcomplete, pytest-rerunfailures, pytest-repeat, catkin-pkg, pytest-cov, colcon-core, colcon-zsh, colcon-test-result, colcon-recursive-crawl, colcon-python-setup-py, colcon-powershell, colcon-pkg-config, colcon-parallel-executor, colcon-package-selection, colcon-package-information, colcon-output, colcon-notification, colcon-metadata, colcon-library-path, colcon-devtools, colcon-defaults, colcon-bash, colcon-argcomplete, colcon-cmake, colcon-cd, colcon-ros, colcon-common-extensions Attempting uninstall: EmPy Found existing installation: empy 4.1 Uninstalling empy-4.1: Successfully uninstalled empy-4.1 Successfully installed EmPy-3.3.4 argcomplete-3.4.0 catkin-pkg-1.0.0 colcon-argcomplete-0.3.3 colcon-bash-0.5.0 colcon-cd-0.1.1 colcon-cmake-0.2.28 colcon-common-extensions-0.3.0 colcon-core-0.16.1 colcon-defaults-0.2.8 colcon-devtools-0.3.0 colcon-library-path-0.2.1 colcon-metadata-0.2.5 colcon-notification-0.3.0 colcon-output-0.2.13 colcon-package-information-0.4.0 colcon-package-selection-0.2.10 colcon-parallel-executor-0.3.0 colcon-pkg-config-0.1.0 colcon-powershell-0.4.0 colcon-python-setup-py-0.2.8 colcon-recursive-crawl-0.2.3 colcon-ros-0.4.1 colcon-test-result-0.3.8 colcon-zsh-0.5.0 coverage-7.5.3 distlib-0.3.8 docutils-0.21.2 notify2-0.3.1 pyparsing-3.1.2 pytest-cov-5.0.0 pytest-repeat-0.9.3 pytest-rerunfailures-14.0 python-dateutil-2.9.0.post0 vcstool-0.3.0 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv ~~~

Now however, after uninstalling empy 4.1, pip also tries to uninstall itself and fails (see https://github.com/gazebosim/sdformat/actions/runs/9701621981/job/26775660003)

~~~ Building wheels for collected packages: EmPy Building wheel for EmPy (setup.py): started Building wheel for EmPy (setup.py): finished with status 'done' Created wheel for EmPy: filename=empy-3.3.4-py3-none-any.whl size=29337 sha256=9a4f758a41b9e266fedaefa10fe70e9782eca4a3f9968f24e8799bb452a5c54e Stored in directory: /tmp/pip-ephem-wheel-cache-uhd5n0fc/wheels/d4/8c/2a/6c28d813f5c017e0c5270ca3b58527616dff038084815779ae Successfully built EmPy Installing collected packages: notify2, EmPy, distlib, vcstool, python-dateutil, pyparsing, pip, docutils, coverage, argcomplete, pytest-rerunfailures, pytest-repeat, catkin-pkg, pytest-cov, colcon-core, colcon-zsh, colcon-test-result, colcon-recursive-crawl, colcon-python-setup-py, colcon-powershell, colcon-pkg-config, colcon-parallel-executor, colcon-package-selection, colcon-package-information, colcon-output, colcon-notification, colcon-metadata, colcon-library-path, colcon-devtools, colcon-defaults, colcon-bash, colcon-argcomplete, colcon-cmake, colcon-cd, colcon-ros, colcon-common-extensions Attempting uninstall: EmPy Found existing installation: empy 4.1 Uninstalling empy-4.1: Successfully uninstalled empy-4.1 Attempting uninstall: pip Found existing installation: pip 24.0 ERROR: Cannot uninstall pip 24.0, RECORD file not found. Hint: The package was installed by debian. ~~~
scpeters commented 4 months ago

I'll mark this closed since we merged a workaround in #77. The better solution would be to use python virtual environments, but we can consider that separately.