Skip to contentSkip to conversation

selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set

PATCH In review Shuah Khan 2 participants 4 messages May 11, 2019 – May 16, 2019

Subsystems (4)
lore
Share & tools
lore

Shuah Khan

author maintainer
#0 lore raw

PATCH 1/1 selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set

commit 8ce72dc32578 ("selftests: fix headers_install circular dependency") broke bpf build/test workflow. When KBUILD_OUTPUT is set, bpf objects end up in KBUILD_OUTPUT build directory instead of in ../selftests/bpf.

The following bpf workflow breaks when it can't find the test_verifier:

cd tools/testing/selftests/bpf; make; ./test_verifier;

Fix it to set OUTPUT only when it is undefined in lib.mk. It didn't need to be set in the first place.

Fixes commit 8ce72dc32578 ("selftests: fix headers_install circular dependency")
Reported-by Alexei Starovoitov <alexei.starovoitov at gmail.com>
Signed-off-by Shuah Khan <skhan at linuxfoundation.org>
---
 tools/testing/selftests/lib.mk | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
tools/testing/selftests/lib.mk +3 -9
index 098dd0065fb1..077337195783 100644
@@ -3,15 +3,9 @@
 CC := $(CROSS_COMPILE)gcc
 
 ifeq (0,$(MAKELEVEL))
-    ifneq ($(O),)
-	OUTPUT := $(O)
-    else
-	ifneq ($(KBUILD_OUTPUT),)
-		OUTPUT := $(KBUILD_OUTPUT)
-	else
-		OUTPUT := $(shell pwd)
-		DEFAULT_INSTALL_HDR_PATH := 1
-	endif
+    ifeq ($(OUTPUT),)
+	OUTPUT := $(shell pwd)
+	DEFAULT_INSTALL_HDR_PATH := 1
     endif
 endif
 selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST))))
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Shuah Khan

commit 8ce72dc32578 ("selftests: fix headers_install circular dependency") broke bpf build/test workflow. When KBUILD_OUTPUT is set, bpf objects end up in KBUILD_OUTPUT build directory instead of in ../selftests/bpf.

The following bpf workflow breaks when it can't find the test_verifier:

cd tools/testing/selftests/bpf; make; ./test_verifier;

Quoted 7 lines

Fix it to set OUTPUT only when it is undefined in lib.mk. It didn't need to be set in the first place.

Fixes commit 8ce72dc32578 ("selftests: fix headers_install circular dependency")
Reported-by Alexei Starovoitov <alexei.starovoitov at gmail.com>
Signed-off-by Shuah Khan <skhan at linuxfoundation.org>

'git am' couldn't apply this patch because "sha1 information is lacking", but the patch itself looks good.
Acked-by: Alexei Starovoitov <ast at kernel.org>
Thanks for the quick fix.

#2 lore raw
Quoted 15 lines · Alexei Starovoitov
Quoted 13 lines · Shuah Khan

commit 8ce72dc32578 ("selftests: fix headers_install circular dependency") broke bpf build/test workflow. When KBUILD_OUTPUT is set, bpf objects end up in KBUILD_OUTPUT build directory instead of in ../selftests/bpf.

The following bpf workflow breaks when it can't find the test_verifier:

cd tools/testing/selftests/bpf; make; ./test_verifier;

Fix it to set OUTPUT only when it is undefined in lib.mk. It didn't need to be set in the first place.

Fixes commit 8ce72dc32578 ("selftests: fix headers_install circular dependency")
Quoted 7 lines
Quoted 2 lines
Reported-by Alexei Starovoitov <alexei.starovoitov at gmail.com>
Signed-off-by Shuah Khan <skhan at linuxfoundation.org>

'git am' couldn't apply this patch because "sha1 information is lacking", but the patch itself looks good.
Acked-by: Alexei Starovoitov <ast at kernel.org>
Thanks for the quick fix.

Ping! What is the status of the fix?

author maintainer
#3 lore raw
Quoted 20 lines · Alexei Starovoitov
Quoted 18 lines · Alexei Starovoitov
Quoted 15 lines · Shuah Khan

commit 8ce72dc32578 ("selftests: fix headers_install circular dependency") broke bpf build/test workflow. When KBUILD_OUTPUT is set, bpf objects end up in KBUILD_OUTPUT build directory instead of in ../selftests/bpf.

The following bpf workflow breaks when it can't find the test_verifier:

cd tools/testing/selftests/bpf; make; ./test_verifier;

Fix it to set OUTPUT only when it is undefined in lib.mk. It didn't need to be set in the first place.

Fixes commit 8ce72dc32578 ("selftests: fix headers_install circular dependency")
Reported-by Alexei Starovoitov <alexei.starovoitov at gmail.com>
Signed-off-by Shuah Khan <skhan at linuxfoundation.org>
Quoted 7 lines
Quoted 4 lines

'git am' couldn't apply this patch because "sha1 information is lacking", but the patch itself looks good.
Acked-by: Alexei Starovoitov <ast at kernel.org>
Thanks for the quick fix.

Ping! What is the status of the fix?

Sending pull request this afternoon.

thanks,
-- Shuah