rcutorture: Ignore KBUILD_OUTPUT in kvm.sh
Subsystems (3)
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
@@ -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
Paul E. McKenney
maintainerQuoted 7 lines · Puranjay Mohan
kvm.shbuilds the kernel in the source tree, andkvm-build.shandconfiginit.shexpect .config and the build products to land there. WithKBUILD_OUTPUTset 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 sokvm.shworks from such shells.Signed-off-by Puranjay Mohan <[email protected]>
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@@ -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 RCUTORTURESignature · 1 line
2.53.0-Meta
Quoted 8 lines · Paul E. McKenney
Quoted 6 lines · Puranjay Mohan
kvm.shbuilds the kernel in the source tree, andkvm-build.shandconfiginit.shexpect .config and the build products to land there. WithKBUILD_OUTPUTset 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 sokvm.shworks from such shells.
Quoted 8 lines
Quoted 1 line
Signed-off-by Puranjay Mohan <[email protected]>Good point!
Should it (non-fatally) complain if
KBUILD_OUTPUTis 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
Paul E. McKenney
maintainerQuoted 9 lines · Puranjay Mohan
Quoted 8 lines · Paul E. McKenney
Quoted 6 lines · Puranjay Mohan
kvm.shbuilds the kernel in the source tree, andkvm-build.shandconfiginit.shexpect .config and the build products to land there. WithKBUILD_OUTPUTset 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 sokvm.shworks from such shells.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Puranjay Mohan <[email protected]>Good point!
Should it (non-fatally) complain if
KBUILD_OUTPUTis 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
Joel Fernandes
maintainerQuoted 21 lines · Paul E. McKenney
Quoted 9 lines · Puranjay Mohan
Quoted 8 lines · Paul E. McKenney
Quoted 6 lines · Puranjay Mohan
kvm.shbuilds the kernel in the source tree, andkvm-build.shandconfiginit.shexpect .config and the build products to land there. WithKBUILD_OUTPUTset 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 sokvm.shworks from such shells.Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Puranjay Mohan <[email protected]>Good point!
Should it (non-fatally) complain if
KBUILD_OUTPUTis 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
Quoted 5 lines · Puranjay Mohan
kvm.shbuilds the kernel in the source tree, andkvm-build.shandconfiginit.shexpect .config and the build products to land there. WithKBUILD_OUTPUTset 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 sokvm.shworks from such shells.
I also have seem to faced this.
Quoted 18 lines
Signed-off-by Puranjay Mohan <[email protected]>---
tools/testing/selftests/rcutorture/bin/kvm.sh| 4 ++++1 file changed, 4 insertions(+)tools/testing/selftests/rcutorture/bin/kvm.sh +0
-0@@ -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