build(deps): keep Homebrew out of local dependency child builds - #5361
Draft
zachlewis wants to merge 1 commit into
Draft
build(deps): keep Homebrew out of local dependency child builds#5361zachlewis wants to merge 1 commit into
zachlewis wants to merge 1 commit into
Conversation
IGNORE_HOMEBREWED_DEPS pruned prefix paths and set CMAKE_IGNORE_PATH, but CMAKE_IGNORE_PATH does not stop config-package searches, and local dependency child builds could still quietly resolve Homebrew packages we are ignoring. Concretely: with a Homebrew Imath 3.2 installed, the local OpenEXR build resolved Imath_DIR=/opt/homebrew/lib/cmake/Imath while OpenImageIO itself used the locally built Imath 3.1.10, and libOpenImageIO then failed to link with Imath_3_2 vs Imath_3_1 namespace-mangled symbol mismatches. Set CMAKE_IGNORE_PREFIX_PATH for the Homebrew prefixes (honored by config searches) and forward it to dependency child builds alongside CMAKE_IGNORE_PATH. Verified: the OpenEXR child build resolves the local deps Imath and libOpenImageIO links clean. Assisted-by: Claude Code (Fable 5) Signed-off-by: Zach Lewis <zachcanbereached@gmail.com>
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
IGNORE_HOMEBREWED_DEPS=ONprunes the Homebrew prefixes from the search paths and setsCMAKE_IGNORE_PATH, butCMAKE_IGNORE_PATHis not honored by config-package searches — and the local dependency child builds launched bybuild_dependency_with_cmakecan therefore quietly resolve Homebrew packages that the parent build is deliberately ignoring.Concrete failure: with Homebrew Imath 3.2 installed, a local OpenEXR dependency build resolved
Imath_DIR=/opt/homebrew/lib/cmake/Imathwhile OpenImageIO itself compiled against the locally built Imath 3.1.10. Imath's versioned namespace is baked into every mangled symbol, so the mismatch (Imath_3_2vsImath_3_1) surfaced as unresolved symbols when linking libOpenImageIO. (This is an instance of the auto-build "sharp edges" discussed on #5313.)What this does
IGNORE_HOMEBREWED_DEPSblock, also append the Homebrew prefixes toCMAKE_IGNORE_PREFIX_PATH(CMake ≥ 3.23), which config-package searches do honor.CMAKE_IGNORE_PREFIX_PATHto dependency child builds alongside the existingCMAKE_IGNORE_PATHforwarding.What it deliberately does not do
No behavior change when
IGNORE_HOMEBREWED_DEPSis off andCMAKE_IGNORE_PREFIX_PATHis unset — both hunks are conditional on the variable being non-empty.Testing
On macOS (arm64, Homebrew Imath 3.2.2 present),
IGNORE_HOMEBREWED_DEPS=ON+OpenImageIO_BUILD_MISSING_DEPS=all:Imath_DIR=/opt/homebrew/lib/cmake/Imath; libOpenImageIO failed to link withImath_3_2/Imath_3_1symbol mismatches;Assisted-by: Claude Code (Fable 5)