Build environment: add external pkgconfig dirs even when they are system paths#49378
Open
scheibelp wants to merge 2 commits intospack:developfrom
Open
Build environment: add external pkgconfig dirs even when they are system paths#49378scheibelp wants to merge 2 commits intospack:developfrom
scheibelp wants to merge 2 commits intospack:developfrom
Conversation
Signed-off-by: Peter Scheibel <[email protected]>
Signed-off-by: Peter Scheibel <[email protected]>
haampie
reviewed
Mar 8, 2025
| pcdir = os.path.join(dep.prefix, d, "pkgconfig") | ||
| if os.path.isdir(pcdir): | ||
| env.prepend_path("PKG_CONFIG_PATH", pcdir) | ||
| if not is_system_path(dep.prefix): |
Member
There was a problem hiding this comment.
Branch on external / not external; is_system_path is incorrect for spack users on cernvm-fs
Member
Author
There was a problem hiding this comment.
If a package is external but not in a system path, I want to take this branch, so I could use some more detail to refine this: what happens on cernvm-fs?
Member
There was a problem hiding this comment.
It's not rooted at /. You should let go of the concept of static "system" paths, it does not exist. The only thing that exists is default search paths of certain applications.
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.
Fixes #48293
Spack-built pkgconfig won't search system paths for
.pcfiles, so if there is an external in a system path, spack wasn't adding its associatedpkgconfigdir to PKG_CONFIG_PATH.When an external is a system path, this PR makes it so that spack will add its associated
pkgconfigdir if the associated.pcfile is found there. If there are no externals in system paths then Spack will not add them to PKG_CONFIG_PATH; even if there are externals in system paths, if their associated .pc files are not found, then Spack will not add those system paths to PKG_CONFIG_PATH.Packages can define
pkg_config_nameto help spack find the right .pc file. It defaults to the (lower-cased) name of the package, e.g.zlib.pcfor thezlibpackage.