* [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh
@ 2026-10-16 10:26 Puranjay Mohan
2026-10-16 15:11 ` Paul E. McKenney
2026-10-16 17:41 ` Bradley Morgan
0 siblings, 2 replies; 6+ messages in thread
From: Puranjay Mohan @ 2026-10-16 10:26 UTC (permalink / raw)
To: rcu
Cc: Puranjay Mohan, Paul E. McKenney, Josh Triplett, Steven Rostedt,
Joel Fernandes, Boqun Feng, Frederic Weisbecker
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.
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
---
tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index 86dd5c131d226..ee8266156254b 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -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
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh
2026-10-16 10:26 [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh Puranjay Mohan
@ 2026-10-16 15:11 ` Paul E. McKenney
2026-10-16 15:22 ` Puranjay Mohan
2026-10-16 17:41 ` Bradley Morgan
1 sibling, 1 reply; 6+ messages in thread
From: Paul E. McKenney @ 2026-10-16 15:11 UTC (permalink / raw)
To: Puranjay Mohan
Cc: rcu, Josh Triplett, Steven Rostedt, Joel Fernandes, Boqun Feng,
Frederic Weisbecker
On Fri, Oct 16, 2026 at 03:26:56AM -0700, Puranjay Mohan wrote:
> 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.
>
> Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
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
> ---
> tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
> index 86dd5c131d226..ee8266156254b 100755
> --- a/tools/testing/selftests/rcutorture/bin/kvm.sh
> +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
> @@ -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
> --
> 2.53.0-Meta
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh
2026-10-16 15:11 ` Paul E. McKenney
@ 2026-10-16 15:22 ` Puranjay Mohan
2026-10-16 16:50 ` Paul E. McKenney
0 siblings, 1 reply; 6+ messages in thread
From: Puranjay Mohan @ 2026-10-16 15:22 UTC (permalink / raw)
To: paulmck
Cc: rcu, Josh Triplett, Steven Rostedt, Joel Fernandes, Boqun Feng,
Frederic Weisbecker
On Fri, Oct 16, 2026 at 4:12 PM Paul E. McKenney <paulmck@kernel.org> wrote:
>
> On Fri, Oct 16, 2026 at 03:26:56AM -0700, Puranjay Mohan wrote:
> > 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.
> >
> > Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
>
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh
2026-10-16 15:22 ` Puranjay Mohan
@ 2026-10-16 16:50 ` Paul E. McKenney
2026-10-19 0:23 ` Joel Fernandes
0 siblings, 1 reply; 6+ messages in thread
From: Paul E. McKenney @ 2026-10-16 16:50 UTC (permalink / raw)
To: Puranjay Mohan
Cc: rcu, Josh Triplett, Steven Rostedt, Joel Fernandes, Boqun Feng,
Frederic Weisbecker
On Fri, Oct 16, 2026 at 04:22:03PM +0100, Puranjay Mohan wrote:
> On Fri, Oct 16, 2026 at 4:12 PM Paul E. McKenney <paulmck@kernel.org> wrote:
> >
> > On Fri, Oct 16, 2026 at 03:26:56AM -0700, Puranjay Mohan wrote:
> > > 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.
> > >
> > > Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
> >
> > 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. ;-)
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh
2026-10-16 10:26 [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh Puranjay Mohan
2026-10-16 15:11 ` Paul E. McKenney
@ 2026-10-16 17:41 ` Bradley Morgan
1 sibling, 0 replies; 6+ messages in thread
From: Bradley Morgan @ 2026-10-16 17:41 UTC (permalink / raw)
To: puranjay; +Cc: boqun, frederic, joelagnelf, josh, paulmck, rcu, rostedt
On 16 October 2026 11:26:56 BST, Puranjay Mohan <puranjay@kernel.org>
wrote:
>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.
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Tested-by: Bradley Morgan <brads@mainlining.org> # Power10
>
>Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
>---
> tools/testing/selftests/rcutorture/bin/kvm.sh | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
>index 86dd5c131d226..ee8266156254b 100755
>--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
>+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
>@@ -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
>
--- Thanks!
"I'm not a very positive person" - Linus torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh
2026-10-16 16:50 ` Paul E. McKenney
@ 2026-10-19 0:23 ` Joel Fernandes
0 siblings, 0 replies; 6+ messages in thread
From: Joel Fernandes @ 2026-10-19 0:23 UTC (permalink / raw)
To: Paul E. McKenney
Cc: Puranjay Mohan, rcu, Josh Triplett, Steven Rostedt, Boqun Feng,
Frederic Weisbecker
On Fri, Oct 16, 2026 at 09:50:32AM -0700, Paul E. McKenney wrote:
> On Fri, Oct 16, 2026 at 04:22:03PM +0100, Puranjay Mohan wrote:
> > On Fri, Oct 16, 2026 at 4:12 PM Paul E. McKenney <paulmck@kernel.org> wrote:
> > >
> > > On Fri, Oct 16, 2026 at 03:26:56AM -0700, Puranjay Mohan wrote:
> > > > 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.
> > > >
> > > > Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
> > >
> > > 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. ;-)
>
> > 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-19 0:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 10:26 [PATCH] rcutorture: Ignore KBUILD_OUTPUT in kvm.sh Puranjay Mohan
2026-10-16 15:11 ` Paul E. McKenney
2026-10-16 15:22 ` Puranjay Mohan
2026-10-16 16:50 ` Paul E. McKenney
2026-10-19 0:23 ` Joel Fernandes
2026-10-16 17:41 ` Bradley Morgan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.