cmake: Skip PATH environment variable when discovering CapnProto#290
cmake: Skip PATH environment variable when discovering CapnProto#290hebasto wants to merge 1 commit into
PATH environment variable when discovering CapnProto#290Conversation
On systems with UsrMerge, the `PATH` environment variable can cause CMake to produce include paths that contain root-level symlinks. The `capnp` compiler resolves paths lexically and fails to process them properly, resulting in a "no such directory" error.
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
So the problem on these systems is that Both of these paths are valid and resolve to The problem is that capnproto is not using the operating system to resolve the include path. Instead it tries to simplify the include path lexically, resulting in Trying to work around in this libmultiprocess is a hack because libmultiprocess is not involved in constructing or interpreting these paths. The fix is also fragile. It's interesting that CMake locates the package in It also seems like users can fix this by setting PATH variables more sanely (maflcko/bitcoin-core-nightly#14 (comment)) to point to real directories instead of /bin and /sbin symlinks created for backwards compatibility. Or to at least order the symlinks after the real directories. If we want to address this issue at all in libmultiprocess, i think the think to do would be detect when CAPNP_INCLUDE_DIRECTORY can't be resolved lexically and recommend users fix their PATH or use -DCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH=OFF as a workaround. But this seems like something that should be resolved by users of these systems or by capnproto, not something libmultiprocess should be involved with. |
|
Fair enough. Closing. |
On systems with UsrMerge, the
PATHenvironment variable can cause CMake to produce include paths that contain root-level symlinks. Thecapnpcompiler resolves paths lexically and fails to process them properly, resulting in a "no such directory" error.Fixes maflcko/bitcoin-core-nightly#14.
CI runs in Bitcoin Core repo: https://github.com/hebasto/bitcoin/actions/runs/27019344100/job/79742757484.