devcontainers / devcontainers/images

Shallow sync of `vcpkg` breaks versioning

Open
#398 3 comments 0 reactions 0 assignees View on GitHub
needs-more-info
Dominant language
Shell
Stars
2.1k
Forks
963
Avg merge
7h 48m
Merged PRs (30d)
11

Description

See https://github.com/microsoft/vcpkg/issues/25349

Because this image [shallow-clones `vcpkg`](https://github.com/devcontainers/images/blob/main/src/cpp/.devcontainer/base-scripts/install-vcpkg.sh#L67-L73), it's difficult to get versioning working. Specifically, any useful value of `builtin-baseline` will fail to sync, and packages will subsequently not be found.

I'm working towards a workaround on this, that looks something like:

1. During image build, parse `vcpkg.json` with a tool like [jq](https://github.com/stedolan/jq) to extract the value of `builtin-baseline` hash.
2. Derive the commit date of the hash with `git show -s --format=%ci`
3. Sync the image's `vcpkg` repo with `git fetch --shallow-since=`

This is the best I can think of - I don't love bringing in a dependency like `jq`, and it seems bizarre (although possibly intended) to manipulate the vcpkg repository during such a straightforward use case. I'd love to get any feedback on this approach and see if there's a simpler path forward.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.