-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgconfig: Disable pkgconf and pkg-config's path stripping #10644
Conversation
Enabling system includes could work well with Spack since it prepends all dependency include directories. Although there could be cases where
That seems like a small risk considering it at first. Are you aware of issues with enabling system includes? Side note: Ideally (although the logic is being reworked now e.g. at #10623), another option would be to add an override for |
As far as I know, this should not change anything. I have also never seen a pkg-config file that includes "real" system paths such as /usr/include. I have actually needed to set these variables in the past to make builds work for software (outside of Spack) that used Spack packages as dependencies: pkg-config was called while the modules were loaded (and thus TBH, this might be a niche use case but I also find it counter-intuitive to strip out paths that were set explicitly in the pkg-config file. |
Apologies but #10675 created a minor conflict here. For Spack-based builds, I'm leaning toward #10623 being a better long-term solution: generally when this CPATH warning is printed, I think it means that the Spack package should override
I think a workable approach would be to make use of I suppose a middle ground would be to keep some sort of debug message encouraging the user to update
That is useful info, but on the other hand I don't think this is guaranteed. For example at https://linux.die.net/man/1/pkg-config:
|
By default, pkgconf and pkg-config strip out system paths. This can cause problems because Spack sets `CPATH`, which is taken into account when determining the system paths. The difference of this change can be tested with: `spack build-env gettext -- pkg-config --cflags libxml-2.0` Before this change, the output should be empty because the libxml2 package explicitly sets `CPATH`, which causes pkgconf and pkg-config to strip out its include directory. After this change, the output should contain the include directory.
8824147
to
bb3ca32
Compare
No problem. :-) I have pushed an update that resolves the conflict.
Good point. I have updated the PR to leave the warning alone. #10623 should then probably update it to steer packagers towards
The problem I ran into was actually just pkg-config stripping out paths that it believed to be system paths (because Spack's modules set
I also wondered about this. One way would be to set |
I think I understand: you are loading Spack-generated modules which set CPATH, and that is interfering with non-Spack builds? If so, one option is to use the I'm primarily digging into this because the uncertainty on the behavior of |
I do not really want to change the module files themselves since other people might expect the unmodified ones.
I typically prefer pkg-config to return what the authors of the .pc file intended. Even though I have not encountered such a case yet, the deduplication might screw up the ordering of include directories etc. |
By default, pkgconf and pkg-config strip out system paths. This can cause problems because Spack sets
CPATH
, which is taken into account when determining the system paths.The difference of this change can be tested with:
spack build-env gettext -- pkg-config --cflags libxml-2.0
Before this change, the output should be empty because the libxml2 package explicitly sets
CPATH
, which causes pkgconf and pkg-config to strip out its include directory. After this change, the output should contain the include directory.