Skip to content

Comments

Replace FetchContent in hannk with vcpkg#8962

Open
alexreinking wants to merge 6 commits intomainfrom
alexreinking/hannk-vcpkg
Open

Replace FetchContent in hannk with vcpkg#8962
alexreinking wants to merge 6 commits intomainfrom
alexreinking/hannk-vcpkg

Conversation

@alexreinking
Copy link
Member

With vcpkg support in place for the apps, only two stand out as needing additional treatment: hannk and onnx. These both use FetchContent, which fundamentally confuses the build system with dependency provision. This PR removes FetchContent from hannk, replacing it with structured vcpkg ports that benefit from binary caching (we used to build tensorflow-lite on every PR!), SHA512 validated sources, and faster HTTPS based downloads (rather than a shallow git clone). It also upgrades tensorflow-lite to 2.21.0-rc2, which is the first (and latest) version to have a usable CMake package API.

This will likely require making the buildbots unconditionally use vcpkg when building the apps.

@alexreinking alexreinking force-pushed the alexreinking/hannk-vcpkg branch from e08f401 to f30b412 Compare February 24, 2026 20:23
@alexreinking alexreinking requested review from halidebuildbots and removed request for halidebuildbots February 24, 2026 20:26
alexreinking and others added 4 commits February 24, 2026 17:20
MSVC does not honour friend-class access when the accessing code is
in an inline constructor body defined inside the friend class's own
class definition.  Move Tensor::Tensor(Buffer) out-of-line so that
both Buffer and Tensor are fully defined at the point of access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Blank context lines in unified diff must carry a leading space;
a bare newline is treated as end-of-patch by git apply, causing
the "corrupt patch" error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MSVC does not honour the 'friend class Tensor' declaration in Buffer,
so moving the definition out-of-line (previous approach) had no
effect.  Instead, add a public inline accessor GetBuilder() to Buffer
and call it from Tensor's constructor, eliminating the need for
friend-class access entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vcpkg overrides find_package with a macro that stores \${ARGN} in a
double-quoted string.  Textual macro substitution causes the value to
be re-parsed as a string literal, so a Windows path whose components
start with a letter (e.g. \build_bot -> \b) triggers CMake's CMP0010
invalid-escape-sequence error.  Normalizing with file(TO_CMAKE_PATH)
converts backslashes to forward slashes before the path reaches the
macro.

No upstream vcpkg issue exists for this as of 2026-02-25.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant