colcon-poetry-ros icon indicating copy to clipboard operation
colcon-poetry-ros copied to clipboard

simultaneous script install for multiple packages in --merge build results in unpredictable files copied to lib/package_name

Open joncppl opened this issue 2 years ago • 2 comments

When multiple packages have a [tool.poetry.scripts] script and are installed with the parallel executor and merge flag (colcon build --merge), there could be potentially be multiple packages writing scripts to bin while one package is copying bin/*. I believe this is a race condition between build tasks.

Additionally, any package that have previously written files to /bin would be damaged due to the use of globing here.

I'm testing some solutions to #20 and consistently see this occurring.

possible solutions:

  • if it wasn't the case that previous packages could have installed to bin, mutexing the install (there was similar race condition in the the core python that was fixed like so https://github.com/colcon/colcon-core/pull/142)
  • assuming script names are unique across packages (should they be?), reading the list of scripts to copy from pyproject.toml
  • install into a staging area (eg. in build) before copying to install

joncppl avatar Jul 11 '22 23:07 joncppl