catkin / catkin_tools

Command line tools for working with catkin
Apache License 2.0
163 stars 146 forks source link

__pycache__ symlink collisions #718

Closed MatthijsBurgh closed 2 years ago

MatthijsBurgh commented 2 years ago

System Info

Build / Run Issue

Only using catkin_tools. Issue is only related to catkin_tools

Expected Behavior

No/less warnings.

Actual Behavior

Warnings   << PKG_NAME:symlink /home/USER/ros/noetic/system/logs/PKG_NAME/build.symlink.024.log
Warning: Cannot symlink from /home/USER/ros/noetic/system/devel/.private/PKG_NAME/lib/python3/dist-packages/PKG_NAME/__pycache__/__init__.cpython-38.pyc to existing file /home/USER/ros/noetic/system/devel/lib/python3/dist-packages/PKG_NAME/__pycache__/__init__.cpython-38.pyc
Warning: Source hash: 579f9d4cdb5678b2df2f0412c42cc723
Warning: Dest hash: 1cfd60a791224ea1a09b330d95f76ca1

During the first build run, there is no cache yet. So there is no symlinking from private to shared devel space. I don't know how, but by running stuff python creates a cache in both locations. Which then causes conflicts on a later build run.

I am not sure what a good solution would be to this issue. It would preferable to reduce the warnings. The cache doesn't really have to be symlinked, but you want both the private and shared devel space to be really cleaned in a catkin clean PKG_NAME run.

Steps to Reproduce the Issue

Nothing really special

catkin build
# do some things that causes the caches to be created in both locations
catkin build
timonegk commented 2 years ago

I implemented a solution where the pycache is not linked at all in #724. Could you check if it works for you?