Fix: Restore incremental builds with pkg-config ELPA#7662
Merged
mohanchen merged 2 commits intoJul 21, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a CMake incremental-build regression in ELPA discovery by separating pkg-config outputs from deprecated public ELPA_* inputs and ensuring ELPA::ELPA is consistently backed by a persistent pkg-config imported target across reconfigurations.
Changes:
- Migrates away from the old
ELPA_*pkg-config cache entries by unsetting conflicting internal cache variables once. - Switches pkg-config discovery to use an independent
ELPA_PKGprefix and maps results back onto the publicELPA_*outputs. - Makes
ELPA::ELPAan alias ofPkgConfig::ELPA_PKGwhen available, keeping the deprecated manual fallback path intact.
|
Looks good. Cannot say I like it, but OK if problem resolved. I didn't care too much about old path since we'll drop these logic and depend totally on pkg-config anyways (see this file). |
ZhouXY-PKU
approved these changes
Jul 20, 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.
What's changed?
PR #7630 used
ELPA_LIBRARIESas both a deprecated manual input and an output cached internally byFindPkgConfig. On a later configuration of the same build directory, the cached bare library name such aselpa_openmpwas mistaken for a manual override. Because imported targets do not persist between CMake configurations,ELPA::ELPAwas then recreated with the bare name as its imported location, causingNo rule to make target 'elpa_openmp'during incremental builds.This change moves pkg-config results to the independent
ELPA_PKGprefix and aliasesELPA::ELPAtoPkgConfig::ELPA_PKG. A one-time migration removes conflictingELPA_*cache entries produced by the old implementation, allowing existing build directories to recover without deletion. The deprecatedELPA_DIRand manual include/library discovery path retains its existing search order and imported-target behavior.Verification: repeated
cmake -S . -B <build-dir>andcmake --build <build-dir> --target MODULE_HSOLVER_LCAO -j32in an existing polluted build directory and a clean build directory; both passed twice, and the generated link command contains the resolvedlibelpa_openmp.sopath. The deprecated manual path was also configured and built successfully with explicitELPA_DIR,ELPA_INCLUDE_DIR, andELPA_LIBRARIESvalues.Maybe you can have a look @Growl1234, thanks! In the end the old
ELPA_DIRlogic will be removed when the formal version is released, so it is still an intermediate solution at present in order to make incremental compilation work properly.Governance Notes
source/are changed.