Open tonynajjar opened 6 months ago
I'm having trouble understanding exactly what the problem is here. Are you deleting the file from inside the build base or deleting the file in the package sources? Is the file still referenced in the setup.py
or setup.cfg
under data_files
? Is data_files
using a wildcard?
On my phone currently so can't check in detail, but as far as I remember:
Let me know if you can reproduce with that info or I need to provide you with a more concrete example
Alright, I see it now.
Here's the source of the error: https://github.com/pypa/setuptools/blob/f91fa3d9fc7262e0467e4b2f84fe463f8f8d23cf/setuptools/_distutils/file_util.py#L108-L110
It's pretty much the first thing that setuptools' copy function checks, and I don't see a way around it there. I think we might be able to modify the process that populates the "staged" package and explicitly remove dangling symlinks that match a data_files
wildcard like this, but it might be tricky.
Either way, there will still be a dead symlink left in the install base. Same would happen with CMake.
I noticed recently that in ament_python packages, when building with
--symlink-install
, if I delete a file that was symlinked in thebuild
folder, then on the subsequent build I get the error:can't copy 'build/<deleted-file> doesn't exist or not a regular file
. Maybe it has to do with https://github.com/colcon/colcon-core/pull/592?to reproduce:
colcon build --symlink-install --packages-select package
data_files
ofsetup.py
colcon build --symlink-install --packages-select package
can't copy 'build/<deleted-file> doesn't exist or not a regular file
The workaround is simply to delete the build folder and try again but it would be nice if that wasn't necessary. Maybe you could delete automatically orphaned symlinks?