Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages containing pytest tests create conflicting cache files #725

Open
nuclearsandwich opened this issue Mar 8, 2024 · 1 comment
Open

Comments

@nuclearsandwich
Copy link
Contributor

Example log output from the build of ament_copyright (although the problem is found in ament_lint 0.16.3-noble and ament_pep257 0.16.3-noble which are both test dependencies of ament_copyright.

08:32:47   655 'Selecting previously unselected package ros-rolling-ros-workspace.'
08:32:47   656 'Preparing to unpack .../137-ros-rolling-ros-workspace_1.0.3-5noble.20240308.162208_amd64.deb ...'
08:32:47   657 'Unpacking ros-rolling-ros-workspace (1.0.3-5noble.20240308.162208) ...'
08:32:47   658 'Selecting previously unselected package ros-rolling-ament-lint.'
08:32:47   659 'Preparing to unpack .../138-ros-rolling-ament-lint_0.16.3-2noble.20240308.162603_amd64.deb ...'
08:32:47   660 'Unpacking ros-rolling-ament-lint (0.16.3-2noble.20240308.162603) ...'
08:32:47   661 'Selecting previously unselected package ros-rolling-ament-flake8.'
08:32:47   662 'Preparing to unpack .../139-ros-rolling-ament-flake8_0.16.3-2noble.20240308.162704_amd64.deb ...'
08:32:47   663 'Unpacking ros-rolling-ament-flake8 (0.16.3-2noble.20240308.162704) ...'
08:32:47   664 'Selecting previously unselected package ros-rolling-ament-pep257.'
08:32:47   665 'Preparing to unpack .../140-ros-rolling-ament-pep257_0.16.3-2noble.20240308.162849_amd64.deb ...'
08:32:47   666 'Unpacking ros-rolling-ament-pep257 (0.16.3-2noble.20240308.162849) ...'
08:32:47   667 'dpkg: error processing archive /tmp/apt-dpkg-install-R3A0tO/140-ros-rolling-ament-pep257_0.16.3-2noble.20240308.162849_amd64.deb (--unpack):'
08:32:47   668 ' trying to overwrite '/opt/ros/rolling/lib/python3.12/site-packages/.pytest_cache/.gitignore', which is also in package ros-rolling-ament-lint 0.16.3-2noble.20240308.162603'
08:32:47   669 'Errors were encountered while processing:'
08:32:47   670 ' /tmp/apt-dpkg-install-R3A0tO/140-ros-rolling-ament-pep257_0.16.3-2noble.20240308.162849_amd64.deb'
08:32:47   671 'W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list.d/ubuntu.sources:1'
08:32:47   672 'W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list.d/ubuntu.sources:1'
08:32:47   673 'W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/ubuntu.sources:1'
08:32:47   674 'W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/ubuntu.sources:1'
08:32:47   675 'E: Sub-process /usr/bin/dpkg returned an error code (1)'

This is being mitigated on our build farm by turning off the execution of tests and the installation of test dependencies before triggering a rebuild, which should omit these cache files from our builds but there are ways for us the cache location generally or else exclude these files from packaging as a more complete solution.

@Z572
Copy link

Z572 commented Apr 18, 2024

add PYTEST_ADDOPTS: '-pno:cacheprovider' to build_environment_variables can fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants