Skip to contentSkip to conversation

rcutorture: Ignore KBUILD_OUTPUT in kvm.sh

PATCH In review Puranjay Mohan 5 participants 6 messages Oct 16 – Oct 19

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcutorture: Ignore KBUILD_OUTPUT in kvm.sh

kvm.sh builds the kernel in the source tree, and kvm-build.sh and configinit.sh expect .config and the build products to land there. With KBUILD_OUTPUT set in the environment, make instead writes them to that directory and fails with "The source tree is not clean" or, worse, clobbers an unrelated build. Unset it so kvm.sh works from such shells.

---
 tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++++
 1 file changed, 4 insertions(+)
tools/testing/selftests/rcutorture/bin/kvm.sh +4 -0
index 86dd5c131d226..ee8266156254b 100755
@@ -22,6 +22,10 @@ cd `dirname $scriptname`/../../../../../
 # This script knows only English.
 LANG=en_US.UTF-8; export LANG
 
+# The kernel is built in-tree below, so an out-of-tree KBUILD_OUTPUT in the
+# environment would send .config and the build products somewhere else.
+unset KBUILD_OUTPUT
+
 dur=$((30*60))
 dryrun=""
 RCUTORTURE="`pwd`/tools/testing/selftests/rcutorture"; export RCUTORTURE
Signature · 1 line
2.53.0-Meta
maintainer
#1 lore raw
Quoted 7 lines · Puranjay Mohan

kvm.sh builds the kernel in the source tree, and kvm-build.sh and configinit.sh expect .config and the build products to land there. With KBUILD_OUTPUT set in the environment, make instead writes them to that directory and fails with "The source tree is not clean" or, worse, clobbers an unrelated build. Unset it so kvm.sh works from such shells.

Good point!

Should it (non-fatally) complain if KBUILD_OUTPUT is set in order to avoid silently surprising any users expecting build products to go elsewhere?

Thanx, Paul

Quoted 22 lines
---
 tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++++
 1 file changed, 4 insertions(+)
tools/testing/selftests/rcutorture/bin/kvm.sh +4 -0
index 86dd5c131d226..ee8266156254b 100755
@@ -22,6 +22,10 @@ cd `dirname $scriptname`/../../../../../
 # This script knows only English.
 LANG=en_US.UTF-8; export LANG
 
+# The kernel is built in-tree below, so an out-of-tree KBUILD_OUTPUT in the
+# environment would send .config and the build products somewhere else.
+unset KBUILD_OUTPUT
+
 dur=$((30*60))
 dryrun=""
 RCUTORTURE="`pwd`/tools/testing/selftests/rcutorture"; export RCUTORTURE
Signature · 1 line
2.53.0-Meta
#2 lore raw
Quoted 8 lines · Paul E. McKenney
Quoted 6 lines · Puranjay Mohan

kvm.sh builds the kernel in the source tree, and kvm-build.sh and configinit.sh expect .config and the build products to land there. With KBUILD_OUTPUT set in the environment, make instead writes them to that directory and fails with "The source tree is not clean" or, worse, clobbers an unrelated build. Unset it so kvm.sh works from such shells.

Quoted 8 lines
Quoted 1 line

Good point!

Should it (non-fatally) complain if KBUILD_OUTPUT is set in order to avoid silently surprising any users expecting build products to go elsewhere?

Thanx, Paul

I guess I am the only one!! :p
If you think we should do it I will send v2.

Thanks,
Puranjay

maintainer
#3 lore raw
Quoted 9 lines · Puranjay Mohan
Quoted 8 lines · Paul E. McKenney
Quoted 6 lines · Puranjay Mohan

kvm.sh builds the kernel in the source tree, and kvm-build.sh and configinit.sh expect .config and the build products to land there. With KBUILD_OUTPUT set in the environment, make instead writes them to that directory and fails with "The source tree is not clean" or, worse, clobbers an unrelated build. Unset it so kvm.sh works from such shells.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Good point!

Should it (non-fatally) complain if KBUILD_OUTPUT is set in order to avoid silently surprising any users expecting build products to go elsewhere?

I guess I am the only one!! :p

Well, the only one who has complained thus far. ;-)

Quoted 1 line

If you think we should do it I will send v2.

Please!

The other alternative would be to make these scripts correctly handle KBUILD_OUTPUT. Which is probably the "right" thing to do, but might or might not be a reasonable thing to do.

Thoughts?

Thanx, Paul

maintainer
#4 lore raw
Quoted 21 lines · Paul E. McKenney
Quoted 9 lines · Puranjay Mohan
Quoted 8 lines · Paul E. McKenney
Quoted 6 lines · Puranjay Mohan

kvm.sh builds the kernel in the source tree, and kvm-build.sh and configinit.sh expect .config and the build products to land there. With KBUILD_OUTPUT set in the environment, make instead writes them to that directory and fails with "The source tree is not clean" or, worse, clobbers an unrelated build. Unset it so kvm.sh works from such shells.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Good point!

Should it (non-fatally) complain if KBUILD_OUTPUT is set in order to avoid silently surprising any users expecting build products to go elsewhere?

I guess I am the only one!! :p

Well, the only one who has complained thus far. ;-)

Quoted 7 lines
Quoted 1 line

If you think we should do it I will send v2.

Please!

The other alternative would be to make these scripts correctly handle KBUILD_OUTPUT. Which is probably the "right" thing to do, but might or might not be a reasonable thing to do.

It may be risky if a new script is introduced that does not support KBUILD_OUTPUT then, I think the above suggestions to warn and ignore make sense.

I also feel kvm.sh is not a 'normal kernel build', so I think maybe respecting KBUILD_OUTPUT is not strictly needed.

FWIW, I typically setup multiple worktrees for torture testing independent of my main source repo so I end up not having this issue as I do all my testing in-tree.

thanks,

Joel Fernandes

Reviewed-by Tested-by on v1 1/1
#5 lore raw
In reply to Puranjay Mohan
Quoted 5 lines · Puranjay Mohan

kvm.sh builds the kernel in the source tree, and kvm-build.sh and configinit.sh expect .config and the build products to land there. With KBUILD_OUTPUT set in the environment, make instead writes them to that directory and fails with "The source tree is not clean" or, worse, clobbers an unrelated build. Unset it so kvm.sh works from such shells.

I also have seem to faced this.

Quoted 18 lines

---
tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++++

1 file changed, 4 insertions(+)
tools/testing/selftests/rcutorture/bin/kvm.sh +0 -0
index 86dd5c131d226..ee8266156254b 100755
@@ -22,6 +22,10 @@ cd `dirname $scriptname`/../../../../../
 # This script knows only English.

LANG=en_US.UTF-8; export LANG

tools/testing/selftests/rcutorture/bin/kvm.sh +4 -0
+# The kernel is built in-tree below, so an out-of-tree KBUILD_OUTPUT in the
+# environment would send .config and the build products somewhere else.
+unset KBUILD_OUTPUT
+
Quoted 4 lines

dur=$((30*60))
dryrun="" RCUTORTURE="pwd/tools/testing/selftests/rcutorture"; export RCUTORTURE

--- Thanks!
"I'm not a very positive person" - Linus torvalds