microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.26k stars 6.41k forks source link

[vcpkg-tool] Make vcpkg_from_git asset cacheable #27858

Open Neumann-A opened 2 years ago

Neumann-A commented 2 years ago

Currently vcpkg_from_git is not asset cachable because git archive creates archives with different hashes.

Solutions: Use https://github.com/microsoft/vcpkg/pull/25051#issuecomment-1146763193

git -c core.autocrlf=false archive --format tar --prefix=archive/ HEAD | tar -xf - && tar --sort=name --mtime='2020-06-05 00:00Z' --clamp-mtime --owner=0 --group=0 --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime --mode=777 -cf vcpkg-test.tar archive/

to create reproducible archives (requires GNU tar / tar from git for windows).

github-actions[bot] commented 1 year ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Neumann-A commented 1 year ago

still relevant

github-actions[bot] commented 6 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Neumann-A commented 6 months ago

still relevant

benjamin-hodgson commented 3 months ago

If I understand correctly this is more complex than simply building a stable archive - the vcpkg_from_git script would need to be modified to actually talk to the asset cache and accept a corresponding SHA512 for the asset.

I'm interested in this feature because my team at Microsoft wants to use vcpkg to consume an internal library. Our build environment (CloudBuild) lives behind a firewall and only has access to the asset cache, so we can't clone the AzureDevOps repo where the code is hosted.