Skip to content

fix(cmake): don't pass REQUIRED to find_dependency in package config - #1

Merged
hoshimoe merged 1 commit into
mainfrom
claude/neko-upstream-issues-693478
Jul 30, 2026
Merged

fix(cmake): don't pass REQUIRED to find_dependency in package config#1
hoshimoe merged 1 commit into
mainfrom
claude/neko-upstream-issues-693478

Conversation

@hoshimoe

Copy link
Copy Markdown
Owner

Summary

Upstream fix for feedback a vcpkg maintainer gave while reviewing microsoft/vcpkg#53099:

find_dependency must generally not have REQUIRED or QUIET; the whole point of find_dependency is to forward the REQUIRED or QUIET-ness requested by the caller.

NekoFunctionConfig.cmake.in hard-coded REQUIRED on all three of its dependencies, so find_package(NekoFunction CONFIG QUIET) raised a fatal error when one was absent instead of returning a graceful -NOTFOUND, which is what a QUIET caller expects.

Change

Dropped REQUIRED from all three calls:

  • find_dependency(NekoSchema)
  • find_dependency(OpenSSL) — still gated on NEKO_FUNCTION_HAS_HASH
  • find_dependency(minizip-ng) — still gated on NEKO_FUNCTION_HAS_ARCHIVE

The feature gating is unchanged: the optional dependencies are only looked up when the corresponding feature was enabled at configure time, which is the correct way to express an optional dependency — QUIET was never doing that job.

Verification

Built and installed into a local prefix (NEKO_FUNCTION_ENABLE_HASH=ON, ENABLE_ARCHIVE=OFF), confirmed the generated config gates correctly, then configured a consumer project against the installed package:

Caller NekoSchema Result
find_package(NekoFunction CONFIG QUIET) missing exit 0, NekoFunction_FOUND=0 (was: fatal error)
find_package(NekoFunction CONFIG REQUIRED) missing fatal error — correct
find_package(NekoFunction CONFIG REQUIRED) present exit 0, FOUND=1, VERSION=1.0.11

Version metadata is already consistent here — project(NekoFunction VERSION 1.0.11) matches the packaged 1.0.11.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WMgcdYggBJ6aMCuNXYbRZT


Generated by Claude Code

find_dependency() forwards the REQUIRED/QUIET-ness requested by the caller
of find_package(); hard-coding REQUIRED defeats that. A consumer doing
find_package(NekoFunction CONFIG QUIET) got a fatal error instead of a graceful
-NOTFOUND when a transitive dependency was absent.

Reported by a vcpkg maintainer in microsoft/vcpkg#53099.
@hoshimoe
hoshimoe merged commit d66add1 into main Jul 30, 2026
16 of 21 checks passed
@hoshimoe
hoshimoe deleted the claude/neko-upstream-issues-693478 branch July 30, 2026 23:04
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.

2 participants