microsoft / vcpkg

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

[vcpkg-tool] Make vcpkg_from_git asset cacheable #27858

Open Neumann-A opened 1 year ago

Neumann-A commented 1 year 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 11 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 11 months ago

still relevant

github-actions[bot] commented 5 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 5 months ago

still relevant

benjamin-hodgson commented 1 month 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.