Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tool] Consider passing -DD flag to unzip when unzipping binarycached artifacts #33714

Closed
russelltg opened this issue Sep 11, 2023 · 1 comment · Fixed by microsoft/vcpkg-tool#1198 or #33804
Assignees
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

Comments

@russelltg
Copy link
Contributor

russelltg commented Sep 11, 2023

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

  • OS: Linux, but should apply to all OS's

To Reproduce
Steps to reproduce the behavior:

  1. Install a dependency
  2. Build a project that has a PCH that uses that dependency
  3. Install a different version of that dependency that was compiled before the previous one
  4. Build that project again, PCH will not be rebuilt

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?

@russelltg russelltg changed the title Consider passing -DD flag to unzip when unzipping binarycached artifacts [tool] Consider passing -DD flag to unzip when unzipping binarycached artifacts Sep 11, 2023
@Adela0814 Adela0814 self-assigned this Sep 12, 2023
@Adela0814 Adela0814 added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Sep 12, 2023
@Adela0814
Copy link
Contributor

Please feel free to submit the PR to vcpkg-tool. We'd like that very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
3 participants