#35068 depends: fix cmake package discovery for depends-built packages

ReviewabilityReviewsAgreementSize
#35068 ryanofsky depends: fix cmake package discovery for depends-built packagesWaiting on author0Mild1
  • Ensure CMake-based depends packages link against depends-built dependencies rather than host system versions
  • Avoid compilation failures caused by library version mismatches when host packages are present
  • Author silent for 162 days after reviewer feedback
  • A fresh review will likely wait a long time for a response
  • No review verdicts recorded
  • Unaddressed objection: appending external paths risks depends isolation and consistency (purpleKarrot)
  • Concern that preserving externally set search paths undermines depends isolation (hebasto)
  • Maintainers discussed closing or drafting the PR due to inactive review responses (sedited, maflcko)
  • 1 lines added or modified outside tests
  • 0 lines added or modified in tests
  • 1 lines removed in total
  • 1 files, 1 commits
Build and CI#19 of 56
P3 · bug fix
  • P3 because it fixes depends build failures when conflicting packages are installed on the host system
  • Prevents version mismatch errors in CMake-based depends packages without wider functional impact
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Fixes CMake package discovery when building depends packages by exporting CMAKE_PREFIX_PATH instead of CMAKE_MODULE_PATH in depends/funcs.mk. CMake reads CMAKE_PREFIX_PATH from the environment and uses it for config-mode package discovery, ensuring depends packages locate dependencies from the depends prefix rather than the host system.

Problem: When building CMake-based depends packages such as native_libmultiprocess, CMake ignores CMAKE_MODULE_PATH from the environment and config-mode find_package() ignores it anyway. If a system version of a dependency like CapnProto is present on the host, CMake picks up the system headers and libraries instead of the ones installed in the depends prefix, causing build failures like version mismatch compilation errors.

Evidence of importance:

  • PR description documents a concrete build failure: "This fixes a build failure in native_libmultiprocess where cmake would find the system (nix) CapnProto 1.2.0 instead of the depends-built CapnProto 1.4.0, resulting in a compile-time version mismatch error: #error 'Version mismatch between generated code and library headers.'"

Scope: Single-line fix in depends/funcs.mk.

Reviewability

Paused · Waiting on author

Open objection from purpleKarrot with no author reply for 40 days; review would repeat what has been asked.

Waiting on (from the thread read):

  • author: addressing review feedback from purpleKarrot and hebasto 2026-09-22

Agreement

Mild

objection that needs an answer has none yet (purpleKarrot)

Thread notes: Added sedited and maflcko comments discussing whether to close or keep in draft given unaddressed review feedback.

Objections, suggestions, and questions:

ReviewerTypeHarm, request, or questionStatusMust beAuthor repliedQuote
hebasto (member)objection, approachpreserving externally set CMAKE_PREFIX_PATH undermines depends build isolationanswered · author replied explaining why preserving it was attempted, but reviewers continued discussion · v1, not yet re-checkedansweredyes2026-04-13: 'Keeping the `CMAKE_PREFIX_PATH` value potentially set externally seems to me to undermine the purpose of the depends build subsystem, no?'
purpleKarrot (member)objection, approachappending external CMAKE_PREFIX_PATH rather than cleanly overwriting it risks depends isolation and consistencyopen · v1, not yet re-checkedansweredno2026-04-15: 'Is the proper fix for this issue. It may then be discussed separately whether the original env vars of `PKG_CONFIG_LIBDIR`, `PKG_CONFIG_PATH`, and `CMAKE_PREFIX_PATH` should be preserved.'

Participants:

  • hebasto (member, objection, 5 statements 2026-04-13 to 2026-04-14): concerned that preserving external CMAKE_PREFIX_PATH undermines depends isolation
  • purpleKarrot (member, objection, 3 statements 2026-04-15 to 2026-04-15): suggested setting CMAKE_PREFIX_PATH directly without appending external environment paths
  • sedited (member, neutral, 2 statements 2026-08-10 to 2026-09-22): asked about PR status and whether to close due to unaddressed review
  • maflcko (member, neutral, 1 statements 2026-09-22 to 2026-09-22): suggested moving to draft before closing if review is unaddressed

Files

0 lines under test/bench/ci.

  • depends/funcs.mk +1/-1

Card

The short text the ranking pass compares across PRs.

Fixes CMake package discovery for CMake-based packages built inside the depends system by setting CMAKE_PREFIX_PATH instead of CMAKE_MODULE_PATH in the configure environment. Previously, CMake ignored the environment variable and bypassed depends-installed packages, finding host system packages instead. The author demonstrates this causes build failures when compiling native_libmultiprocess due to header and generator version mismatches with host-installed CapnProto.

Data

dossier JSON · extract JSON · model ledger, generated 2026-09-23T01:21, confidence high, input hash bfe16dc1654b677d
thread read through 2026-09-22 (15 statements), head 9a7f122d07
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: Build system · draft

Categories

Build and CI

P3 · bug fix

Fixes depends package builds picking up host system libraries instead of depends-built dependencies. The author notes this resolves 'a build failure in native_libmultiprocess where cmake would find the system (nix) CapnProto 1.2.0 instead of the depends-built CapnProto 1.4.0, resulting in a compile-time version mismatch error'.

Membership: Touches `depends/funcs.mk` and carries the 'Build system' label.

Factors: security/stability 0, bug 1, performance 0, user value 0, leverage 1