Guard against re-fetching an ecosystem dep that's already the top-level project - #79
Merged
Merged
Conversation
…el project
nwx_ecosystem_dependency() only short-circuited on the nwx::<name> alias
target (set when a dep is resolved via find_package() against an installed
wheel). It missed the case where <name> is already a bare target because
this repo IS <name>'s top-level project (built directly via nwx_library(),
which never defines the nwx:: alias) and is also, transitively, its own
ecosystem dependency -- e.g. SCF built with -DINTEGRATION_TESTING=ON pulls
in the nwchemex superproject, which itself depends on scf. FetchContent
would then redefine the same target and CMake would fail with a
duplicate-target error ("add_library cannot create target 'scf' because
another target with the same name already exists").
Verified with a minimal standalone repro mirroring get_dependencies.cmake's
FetchContent_MakeAvailable call: before this fix, a pre-existing bare target
still fell through to FetchContent and failed trying to clone a bogus URL;
after this fix, it short-circuits before ever reaching FetchContent. A
second repro with no pre-existing target confirms normal, non-self-referencing
fetches are unaffected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🚀 [bumpr] Bumped! |
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.
Summary
This affects every ecosystem repo that routes through this shared macro (`chemcache`, `chemist`, `integrals`, `parallelzone`, `pluginplay`, `nux`, `nwchemex`, `scf`, `simde`, `tensorwrapper`, `utilities`) whenever it's both a dependency of another ecosystem repo and built with `INTEGRATION_TESTING=ON`.
Test plan
🤖 Generated with Claude Code