Skip to content

Conversation

@a-ovchinnikov
Copy link
Contributor

@a-ovchinnikov a-ovchinnikov commented Jul 18, 2025

This commit adds initial overview of vcpkg (C/C++ package manager) and briefly discusses how its support could be implemented.

vcpkg: https://learn.microsoft.com/en-us/vcpkg/

A PoC for cmake scripts processing on Hermeto's side: ec38dff

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • Docs updated (if applicable)
  • Docs links in the code are still valid (if docs were updated)

Note: if the contribution is external (not from an organization member), the CI
pipeline will not run automatically. After verifying that the CI is safe to run:

@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

📝 Walkthrough

Walkthrough

Adds a new design document docs/design/vcpkg.md that describes approaches and detailed steps for integrating vcpkg-based dependency management into Hermeto, covering dependency specification, registries/caching, download/build workflows, dependency-graph handling, and two implementation options with references.

Changes

Cohort / File(s) Summary
Design Docs
docs/design/vcpkg.md
New design document describing vcpkg integration: background, dependency formats (ports, portfiles, vcpkg.json, patches), registry and cache behavior, download/build workflows, dependency graph limitations, and two implementation options (external vcpkg vs. in-house) with detailed implementation steps and references.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title “vcpkg: Adds initial overview” succinctly identifies the primary change of adding an overview of vcpkg support and clearly aligns with the documentation update described in the changeset without extraneous details.
Description Check ✅ Passed The pull request description provides a concise summary of the added vcpkg overview, references the official vcpkg documentation and the proof-of-concept commit, and correctly incorporates the repository’s maintainer checklist template and CI approval instructions as specified by the template.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eaf20b0 and 2b39546.

📒 Files selected for processing (1)
  • docs/design/vcpkg.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/design/vcpkg.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build container image and run integration tests on it
  • GitHub Check: Konflux kflux-prd-rh03 / on-pull-request

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@eskultety eskultety linked an issue Jul 21, 2025 that may be closed by this pull request
@eskultety eskultety removed a link to an issue Jul 21, 2025
Copy link
Member

@eskultety eskultety left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to say, compared to Conan, vcpkg definitely gives me far less shivers.

</details>

While it contains enough data to populate a SBOM it has to be parsed which is
inherently error-prone. There does not seem to be any way to get around this.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to rely on stdout for SBOM populating? If there's some registry data available locally, don't we get the cmake portfile recipe with every depedency? That would be a more reliable source for SBOM contents IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concerns are transient dependencies (admittedly they seem to be somewhat rare), and any potential deviation which the tool makes from a list of versions and cares to report. Building a list of transitive dependencies is not that big of a task, but making sure that what was downloaded matches the spec is more complicated, that is why I reluctantly recommend parsing logs (while fully understanding how brittle this is).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is why I reluctantly recommend parsing logs

This is too error prone and unstable to back our "accurate SBOM" claim I'm afraid. I think we need to consider a different approach.

Copy link
Member

@eskultety eskultety Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to capture what I discussed over a private channel on this topic - could we maybe leverage CMake to create our own little cmake script that would import a given portfile.cmake and see if there's a way to access the signature (e.g. https://learn.microsoft.com/en-us/vcpkg/maintainers/functions/vcpkg_from_github) attributes/variables in CMake's context and dump them in a JSON/YAML format that would allow us to easily consume and process the crucial set of data?

Comment on lines 149 to 213
is not immediately clear how big this problem is, if it is a big problem then
sources will have to be injected into a new $VCPKG_ROOT on a build system.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unclear on this bit, can you elaborate? Do you mean similarly to cargo and some toolchain pinning, but in this case incompatible cache structuring?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. By default the sources end up in $VCPKG_ROOT which also contains port definitions, versions database and cmake scripts necessary for vcpkg to operate. If, for any reason, someone would use a clean version of vcpkg from, say, our image then we would at the very least need to link buildtrees within it to buildtrees generated during fetch. If, however, one could reuse effectively entire vcpkg root directory from the fetch phase then this is not a problem.

Comment on lines 117 to 184
Following the precedent set in other package managers vcpkg should be used as
an external tool. It will need to be downloaded and bootstrapped first, then
caches locations will need to be set, after which package's dependencies
could be resolved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, since vcpkg is OSS (kudos Microsoft!), can we have a look at their implementation for inspiration, see what it is they do with vcpkg install --only-download and assess if reimplementing the fetching logic is totally impractical from our POV?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need to not only re-implement fetch logic, but also provide correct repository structure for a vcpkg instance down the road. As always -- this is possible, but not very practical since we would need to maintain it. And since vcpkg relies heavily on cmake wouldn't that also mean that we would need to re-implement cmake functionality?

@a-ovchinnikov a-ovchinnikov force-pushed the vcpkg_overview_document branch from 795f290 to 2d1b789 Compare August 26, 2025 21:55
@a-ovchinnikov a-ovchinnikov force-pushed the vcpkg_overview_document branch from 2d1b789 to bbaf7b5 Compare September 3, 2025 21:09
@a-ovchinnikov a-ovchinnikov force-pushed the vcpkg_overview_document branch 3 times, most recently from 9b9b6f3 to 6d5085c Compare September 23, 2025 17:45
@a-ovchinnikov a-ovchinnikov force-pushed the vcpkg_overview_document branch from 6d5085c to eaf20b0 Compare September 29, 2025 14:13
@a-ovchinnikov a-ovchinnikov marked this pull request as ready for review September 29, 2025 14:14
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1aebd11 and eaf20b0.

📒 Files selected for processing (1)
  • docs/design/vcpkg.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Konflux kflux-prd-rh03 / on-pull-request
  • GitHub Check: Build container image and run integration tests on it

Copy link
Contributor

@taylormadore taylormadore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The investigation was thorough and the design appears comprehensive.

This commit adds initial overview of vcpkg (C/C++ package manager)
and briefly discusses how its support could be implemented.

vcpkg: https://learn.microsoft.com/en-us/vcpkg/

Signed-off-by: Alexey Ovchinnikov <aovchinn@redhat.com>
@a-ovchinnikov a-ovchinnikov force-pushed the vcpkg_overview_document branch from eaf20b0 to 2b39546 Compare September 29, 2025 14:23
Copy link
Member

@eskultety eskultety left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A solid starting point.

@a-ovchinnikov a-ovchinnikov added this pull request to the merge queue Oct 2, 2025
Merged via the queue into hermetoproject:main with commit bd3ade9 Oct 2, 2025
14 checks passed
@a-ovchinnikov a-ovchinnikov deleted the vcpkg_overview_document branch October 2, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants