file(LOCK ... RELEASE) does not work on win32
Hi,
On win32 file(LOCK ... RELEASE)
might fail in some cases.
I debugged the issue - cmFileLock::Release()
is not called at all.
The issue is that
bool cmFileLock::IsLocked(const std::string& filename) const
{
return filename == this->Filename;
}
from Source/cmFileLock.cxx:61
returns false
.
In my case the difference is in the first letter.
this->Filename == "g:/dev/cppan_storage/cfg/amd64-msvc-19.0-32.cmake.lock"
filename == "G:/dev/cppan_storage/cfg/amd64-msvc-19.0-32.cmake.lock"
g
becomes G
in file Source/cmFileCommand.cxx:3115
.
// Unify path (remove '//', '/../', ...)
path = cmSystemTools::CollapseFullPath(path);
This is actually a sad error. Did you consider something like boost::filesystem::path
(maybe future std::filesystem::path
)?