take into account location of header files of dependencies in toolchain method that defines search path for header files in build environment#5041
Merged
bedroge merged 1 commit intoeasybuilders:developfrom Nov 13, 2025
Conversation
…d that defines search path for header files in build environment
23d0d7a to
5b33aed
Compare
bedroge
approved these changes
Nov 13, 2025
Contributor
bedroge
left a comment
There was a problem hiding this comment.
Lgtm!
Tested this with the examples from #5039 (comment) and various (module) search path configurations, and it works fine in all situations! 🎉
As an example, $CPPFLAGS is now correctly set to:
== 2025-11-12 20:05:56,552 environment.py:95 INFO Environment variable CPPFLAGS set to -I/data/apps/software/foo/1.0-GCC-13.3.0/include/foo -I/data/apps/software/foo/1.0-GCC-13.3.0/include (previously undefined)
And when using include_paths:
== 2025-11-13 11:06:38,118 environment.py:95 INFO Environment variable C_INCLUDE_PATH set to /data/apps/software/foo/1.0-GCC-13.3.0/include/foo:/data/apps/software/foo/1.0-GCC-13.3.0/i
nclude (previous value: '/data/apps/software/foo/1.0-GCC-13.3.0/include/foo:/data/apps/software/foo/1.0-GCC-13.3.0/include')
(it used to only include ..../include, and not ..../include/foo).
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 #5039, follow-up for #5023 which was a step in the right direction but incomplete
The
_add_dependency_cpp_headersmethod ofToolchainonly considerincludeas subdirectory for dependencies, but in some cases additional subdirectories must be taken into account for finder header files.We can determine the correct list of subdirectories based on the
$CPATH, and$C_INCLUDE_PATH& friends environment variables that get set when the modules for the (build) dependencies get loaded.This fix is only relevant when EasyBuild is configured with
--search-path-cpp-headersto something else than (the default)flags, since then$CPPFLAGSis defined in toolchain build environment and the$CPATHor$C_INCLUDE_PATHset by dependency modules is not overwritten).