cpp-pm / hunter

CMake driven cross-platform package manager for C/C++.
BSD 2-Clause "Simplified" License
604 stars 181 forks source link

Hunter instances wait for each other #43

Open NeroBurner opened 4 years ago

NeroBurner commented 4 years ago

I'm using a shared HUNTER_ROOT directory for concurrent CI builds. The configurations have the same hunter-version, but different compiler or compiler flags therefore a different generated hunter-toolchain file and sha1. They should be able to work concurrently, but only one of the concurrent cmake projects is actually compiling a hunter package, all other instances are waiting for the former

The build folder should be locked per toolchain, not per hunter-version

PyrO70 commented 4 years ago

There is start of explaining what locking is happening in this bug old issue 1806. I believe the download directory is lock when the downloading happens, but is not release until the build is finish. The build itself is lock for each toolchains.

The problem is that download step and build step is fused in ExternalProject_Add:

    https://github.com/ruslo/hunter/blob/v0.23.151/cmake/schemes/url_sha1_cmake.cmake.in#L142-L163

And for optimization reason Download directory can be shared between several CMake instances (and hence should be locked before modification).