selftests: override KHDR_INCLUDES
var
#131
Open
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.
In a recent series [1], I suggested to use
KHDR_INCLUDES
variable to avoid having to duplicate UAPI header files.The BPF CI builds the kernel in a separated directory --
KBUILD_OUTPUT
variable is set and exported -- and the BPF selftests are executed directly, from the selftests/bpf directory, not from its parent with theTARGETS
parameter. In this case, it is required to overrideKHDR_INCLUDES
to look at the build directory, and not the kernel source, inusr/include
.Note that
tools/testing/selftests/Makefile
supportsKBUILD_OUTPUT
, but this Makefile is not used by the BPF CI: it directly uses the one from the bpf directory:tools/testing/selftests/bpf/Makefile
. That's fine,KHDR_INCLUDES
can be overridden, that should then fix the build issue seen in [1].Also, this
KHDR_INCLUDES
variable is not used by the BPF selftests before my series [1]. It is then fine to merge this modification before applying my modifications.Link: https://lore.kernel.org/bpf/20240816-ups-bpf-next-selftests-use-khdr-v1-0-1e19f3d5b17a@kernel.org/ [1]
Note that I validated this modification only manually, I didn't try to deploy the CI infrastructure on my side. When applying the same commands as the ones from this script, I can reproduce the issue reported by the CI. Not after having set
KHDR_INCLUDES
.