[tool] Consider passing -DD flag to unzip when unzipping binarycached artifacts #33714
Labels
category:vcpkg-bug
The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
requires:tool-release
An issue that has been fixed in the microsoft/vcpkg-tool repo and is waiting for a release thereof
Describe the bug
When vcpkg extracts the contents of a binary cache artifact, it also extracts the mtime of the files. This is problematic for many build systems that rely on comparing mtimes to see if an action needs to be re-ran, so if you install a vcpkg port that was compiled before
the one that is currently installed, many build systems (ninja in my case) will not re-run steps that need to be re-run.
For me, this is manifesting in issues with PCH's, as clang stores exact mtimes in .pch files, and ninja just checks if the header is newer than the pch file, so we end up with pch's not being recompiled properly because ninja thinks they are up to date.
The solution here would be to extract without mtimes. On linux, this can be done with the
-DD
flag to unzip. On windows, this is tricker as 7zip is used, which I did some quick looking and I don't see an equivalent option. Of course this could be fixed by traversing the tree and manually touching all the files.Environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
PCH will be rebuilt because mtime is set to current time, not build time
I'm happy to open a PR, maybe under an experimental feature?
The text was updated successfully, but these errors were encountered: