#35068 depends: fix cmake package discovery for depends-built packages
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #35068 depends: fix cmake package discovery for depends-built packages | Waiting on author | 0 | Mild | 1 | |||
|
|
|
|
| |||
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:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| hebasto (member) | objection, approach | preserving externally set CMAKE_PREFIX_PATH undermines depends build isolation | answered · author replied explaining why preserving it was attempted, but reviewers continued discussion · v1, not yet re-checked | answered | yes | 2026-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, approach | appending external CMAKE_PREFIX_PATH rather than cleanly overwriting it risks depends isolation and consistency | open · v1, not yet re-checked | answered | no | 2026-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
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