* [PATCH] kbuild: unexport sub_make_done to fix child make invocations
@ 2026-02-14 2:47 Simon Glass
2026-03-03 18:50 ` Tom Rini
0 siblings, 1 reply; 11+ messages in thread
From: Simon Glass @ 2026-02-14 2:47 UTC (permalink / raw)
To: u-boot; +Cc: Ilias Apalodimas, Simon Glass, Sughosh Ganu, Tom Rini
The exported sub_make_done variable leaks into the environment of all
child processes. When make targets like tcheck spawn independent make
invocations with O=, those child makes inherit sub_make_done=1, skip
the KBUILD_OUTPUT setup and try to build in the source tree.
There is a workaround that resets sub_make_done to 0 for specific test
targets, but this isn't great since it has tolist every target that
spawns independent make invocations.
Instead, unexport sub_make_done once we are in the final make
invocation. The direct sub-make already has the value in its
environment from the export, and no further propagation is needed.
This also allows the per-target workaround to be removed.
Fixes: 27529f1cb02d ("kbuild: skip parsing pre sub-make code for recursion")
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index d38fa5d6aca..f539c6f82f3 100644
--- a/Makefile
+++ b/Makefile
@@ -194,6 +194,10 @@ endif # sub_make_done
# We process the rest of the Makefile if this is the final invocation of make
ifeq ($(need-sub-make),)
+# Do not propagate sub_make_done to non-submake children (e.g. test scripts
+# that invoke make separately with O= need to process the KBUILD_OUTPUT block)
+unexport sub_make_done
+
# Do not print "Entering directory ...",
# but we want to display it when entering to the output directory
# so that IDEs/editors are able to understand relative filenames.
@@ -2738,10 +2742,6 @@ help:
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
@echo 'For further info see the ./README file'
-ifneq ($(filter tests pcheck qcheck tcheck,$(MAKECMDGOALS)),)
-export sub_make_done := 0
-endif
-
tests check:
$(srctree)/test/run
--
2.43.0
base-commit: eae0ca2125933c3d1742deba723d2cc4b4955ef0
branch: fix-kbuild
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-02-14 2:47 [PATCH] kbuild: unexport sub_make_done to fix child make invocations Simon Glass
@ 2026-03-03 18:50 ` Tom Rini
2026-03-04 9:54 ` Conor Dooley
0 siblings, 1 reply; 11+ messages in thread
From: Tom Rini @ 2026-03-03 18:50 UTC (permalink / raw)
To: u-boot, Simon Glass; +Cc: Ilias Apalodimas, Simon Glass, Sughosh Ganu
On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> The exported sub_make_done variable leaks into the environment of all
> child processes. When make targets like tcheck spawn independent make
> invocations with O=, those child makes inherit sub_make_done=1, skip
> the KBUILD_OUTPUT setup and try to build in the source tree.
>
> There is a workaround that resets sub_make_done to 0 for specific test
> targets, but this isn't great since it has tolist every target that
> spawns independent make invocations.
>
> [...]
Applied to u-boot/master, thanks!
[1/1] kbuild: unexport sub_make_done to fix child make invocations
commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
--
Tom
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-03 18:50 ` Tom Rini
@ 2026-03-04 9:54 ` Conor Dooley
2026-03-04 15:01 ` Tom Rini
0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2026-03-04 9:54 UTC (permalink / raw)
To: Tom Rini; +Cc: u-boot, Simon Glass, Ilias Apalodimas, Simon Glass, Sughosh Ganu
[-- Attachment #1: Type: text/plain, Size: 1858 bytes --]
On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
>
> > The exported sub_make_done variable leaks into the environment of all
> > child processes. When make targets like tcheck spawn independent make
> > invocations with O=, those child makes inherit sub_make_done=1, skip
> > the KBUILD_OUTPUT setup and try to build in the source tree.
> >
> > There is a workaround that resets sub_make_done to 0 for specific test
> > targets, but this isn't great since it has tolist every target that
> > spawns independent make invocations.
> >
> > [...]
>
> Applied to u-boot/master, thanks!
>
> [1/1] kbuild: unexport sub_make_done to fix child make invocations
> commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
This breaks the build for me:
make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
GEN Makefile
#
# configuration written to .config
#
make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
HOSTCC scripts/basic/fixdep
GEN Makefile
HOSTCC scripts/kconfig/conf.o
YACC scripts/kconfig/zconf.tab.[ch]
LEX scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --syncconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
make[2]: *** [../Makefile:189: __sub-make] Error 2
make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
make: *** [Makefile:189: __sub-make] Error 2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-04 9:54 ` Conor Dooley
@ 2026-03-04 15:01 ` Tom Rini
2026-03-04 15:09 ` Conor Dooley
0 siblings, 1 reply; 11+ messages in thread
From: Tom Rini @ 2026-03-04 15:01 UTC (permalink / raw)
To: Conor Dooley
Cc: u-boot, Simon Glass, Ilias Apalodimas, Simon Glass, Sughosh Ganu
[-- Attachment #1: Type: text/plain, Size: 2101 bytes --]
On Wed, Mar 04, 2026 at 09:54:22AM +0000, Conor Dooley wrote:
> On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> > On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> >
> > > The exported sub_make_done variable leaks into the environment of all
> > > child processes. When make targets like tcheck spawn independent make
> > > invocations with O=, those child makes inherit sub_make_done=1, skip
> > > the KBUILD_OUTPUT setup and try to build in the source tree.
> > >
> > > There is a workaround that resets sub_make_done to 0 for specific test
> > > targets, but this isn't great since it has tolist every target that
> > > spawns independent make invocations.
> > >
> > > [...]
> >
> > Applied to u-boot/master, thanks!
> >
> > [1/1] kbuild: unexport sub_make_done to fix child make invocations
> > commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
>
>
> This breaks the build for me:
> make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
> GEN Makefile
> #
> # configuration written to .config
> #
> make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
> HOSTCC scripts/basic/fixdep
> GEN Makefile
> HOSTCC scripts/kconfig/conf.o
> YACC scripts/kconfig/zconf.tab.[ch]
> LEX scripts/kconfig/zconf.lex.c
> HOSTCC scripts/kconfig/zconf.tab.o
> HOSTLD scripts/kconfig/conf
> scripts/kconfig/conf --syncconfig Kconfig
> ***
> *** Configuration file ".config" not found!
> ***
> *** Please run some configurator (e.g. "make oldconfig" or
> *** "make menuconfig" or "make xconfig").
> ***
> make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
> make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
> make[2]: *** [../Makefile:189: __sub-make] Error 2
> make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
> make: *** [Makefile:189: __sub-make] Error 2
That's odd. What host distro and make? I don't see that on Ubuntu 24.04.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-04 15:01 ` Tom Rini
@ 2026-03-04 15:09 ` Conor Dooley
2026-03-04 15:11 ` Tom Rini
0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2026-03-04 15:09 UTC (permalink / raw)
To: Tom Rini; +Cc: u-boot, Simon Glass, Ilias Apalodimas, Simon Glass, Sughosh Ganu
[-- Attachment #1: Type: text/plain, Size: 2394 bytes --]
On Wed, Mar 04, 2026 at 09:01:45AM -0600, Tom Rini wrote:
> On Wed, Mar 04, 2026 at 09:54:22AM +0000, Conor Dooley wrote:
> > On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> > > On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> > >
> > > > The exported sub_make_done variable leaks into the environment of all
> > > > child processes. When make targets like tcheck spawn independent make
> > > > invocations with O=, those child makes inherit sub_make_done=1, skip
> > > > the KBUILD_OUTPUT setup and try to build in the source tree.
> > > >
> > > > There is a workaround that resets sub_make_done to 0 for specific test
> > > > targets, but this isn't great since it has tolist every target that
> > > > spawns independent make invocations.
> > > >
> > > > [...]
> > >
> > > Applied to u-boot/master, thanks!
> > >
> > > [1/1] kbuild: unexport sub_make_done to fix child make invocations
> > > commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
> >
> >
> > This breaks the build for me:
> > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
> > GEN Makefile
> > #
> > # configuration written to .config
> > #
> > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
> > HOSTCC scripts/basic/fixdep
> > GEN Makefile
> > HOSTCC scripts/kconfig/conf.o
> > YACC scripts/kconfig/zconf.tab.[ch]
> > LEX scripts/kconfig/zconf.lex.c
> > HOSTCC scripts/kconfig/zconf.tab.o
> > HOSTLD scripts/kconfig/conf
> > scripts/kconfig/conf --syncconfig Kconfig
> > ***
> > *** Configuration file ".config" not found!
> > ***
> > *** Please run some configurator (e.g. "make oldconfig" or
> > *** "make menuconfig" or "make xconfig").
> > ***
> > make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
> > make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
> > make[2]: *** [../Makefile:189: __sub-make] Error 2
> > make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
> > make: *** [Makefile:189: __sub-make] Error 2
>
> That's odd. What host distro and make? I don't see that on Ubuntu 24.04.
Originally my CI found it in a docker container with "from: ubuntu:noble",
so 24.04. I reproduced it locally on debian unstable with make 4.4.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-04 15:09 ` Conor Dooley
@ 2026-03-04 15:11 ` Tom Rini
2026-03-04 15:24 ` Conor Dooley
0 siblings, 1 reply; 11+ messages in thread
From: Tom Rini @ 2026-03-04 15:11 UTC (permalink / raw)
To: Conor Dooley
Cc: u-boot, Simon Glass, Ilias Apalodimas, Simon Glass, Sughosh Ganu
[-- Attachment #1: Type: text/plain, Size: 2714 bytes --]
On Wed, Mar 04, 2026 at 03:09:40PM +0000, Conor Dooley wrote:
> On Wed, Mar 04, 2026 at 09:01:45AM -0600, Tom Rini wrote:
> > On Wed, Mar 04, 2026 at 09:54:22AM +0000, Conor Dooley wrote:
> > > On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> > > > On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> > > >
> > > > > The exported sub_make_done variable leaks into the environment of all
> > > > > child processes. When make targets like tcheck spawn independent make
> > > > > invocations with O=, those child makes inherit sub_make_done=1, skip
> > > > > the KBUILD_OUTPUT setup and try to build in the source tree.
> > > > >
> > > > > There is a workaround that resets sub_make_done to 0 for specific test
> > > > > targets, but this isn't great since it has tolist every target that
> > > > > spawns independent make invocations.
> > > > >
> > > > > [...]
> > > >
> > > > Applied to u-boot/master, thanks!
> > > >
> > > > [1/1] kbuild: unexport sub_make_done to fix child make invocations
> > > > commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
> > >
> > >
> > > This breaks the build for me:
> > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
> > > GEN Makefile
> > > #
> > > # configuration written to .config
> > > #
> > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
> > > HOSTCC scripts/basic/fixdep
> > > GEN Makefile
> > > HOSTCC scripts/kconfig/conf.o
> > > YACC scripts/kconfig/zconf.tab.[ch]
> > > LEX scripts/kconfig/zconf.lex.c
> > > HOSTCC scripts/kconfig/zconf.tab.o
> > > HOSTLD scripts/kconfig/conf
> > > scripts/kconfig/conf --syncconfig Kconfig
> > > ***
> > > *** Configuration file ".config" not found!
> > > ***
> > > *** Please run some configurator (e.g. "make oldconfig" or
> > > *** "make menuconfig" or "make xconfig").
> > > ***
> > > make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
> > > make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
> > > make[2]: *** [../Makefile:189: __sub-make] Error 2
> > > make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
> > > make: *** [Makefile:189: __sub-make] Error 2
> >
> > That's odd. What host distro and make? I don't see that on Ubuntu 24.04.
>
> Originally my CI found it in a docker container with "from: ubuntu:noble",
> so 24.04. I reproduced it locally on debian unstable with make 4.4.1
That's even more puzzling (noble is 24.04) since that sounds very close
to our CI too. Can you please look more in to what's going on?
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-04 15:11 ` Tom Rini
@ 2026-03-04 15:24 ` Conor Dooley
2026-03-04 15:45 ` Tom Rini
0 siblings, 1 reply; 11+ messages in thread
From: Conor Dooley @ 2026-03-04 15:24 UTC (permalink / raw)
To: Tom Rini; +Cc: u-boot, Simon Glass, Ilias Apalodimas, Simon Glass, Sughosh Ganu
[-- Attachment #1: Type: text/plain, Size: 2981 bytes --]
On Wed, Mar 04, 2026 at 09:11:54AM -0600, Tom Rini wrote:
> On Wed, Mar 04, 2026 at 03:09:40PM +0000, Conor Dooley wrote:
> > On Wed, Mar 04, 2026 at 09:01:45AM -0600, Tom Rini wrote:
> > > On Wed, Mar 04, 2026 at 09:54:22AM +0000, Conor Dooley wrote:
> > > > On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> > > > > On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> > > > >
> > > > > > The exported sub_make_done variable leaks into the environment of all
> > > > > > child processes. When make targets like tcheck spawn independent make
> > > > > > invocations with O=, those child makes inherit sub_make_done=1, skip
> > > > > > the KBUILD_OUTPUT setup and try to build in the source tree.
> > > > > >
> > > > > > There is a workaround that resets sub_make_done to 0 for specific test
> > > > > > targets, but this isn't great since it has tolist every target that
> > > > > > spawns independent make invocations.
> > > > > >
> > > > > > [...]
> > > > >
> > > > > Applied to u-boot/master, thanks!
> > > > >
> > > > > [1/1] kbuild: unexport sub_make_done to fix child make invocations
> > > > > commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
> > > >
> > > >
> > > > This breaks the build for me:
> > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
> > > > GEN Makefile
> > > > #
> > > > # configuration written to .config
> > > > #
> > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
> > > > HOSTCC scripts/basic/fixdep
> > > > GEN Makefile
> > > > HOSTCC scripts/kconfig/conf.o
> > > > YACC scripts/kconfig/zconf.tab.[ch]
> > > > LEX scripts/kconfig/zconf.lex.c
> > > > HOSTCC scripts/kconfig/zconf.tab.o
> > > > HOSTLD scripts/kconfig/conf
> > > > scripts/kconfig/conf --syncconfig Kconfig
> > > > ***
> > > > *** Configuration file ".config" not found!
> > > > ***
> > > > *** Please run some configurator (e.g. "make oldconfig" or
> > > > *** "make menuconfig" or "make xconfig").
> > > > ***
> > > > make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
> > > > make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
> > > > make[2]: *** [../Makefile:189: __sub-make] Error 2
> > > > make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
> > > > make: *** [Makefile:189: __sub-make] Error 2
> > >
> > > That's odd. What host distro and make? I don't see that on Ubuntu 24.04.
> >
> > Originally my CI found it in a docker container with "from: ubuntu:noble",
> > so 24.04. I reproduced it locally on debian unstable with make 4.4.1
>
> That's even more puzzling (noble is 24.04) since that sounds very close
> to our CI too. Can you please look more in to what's going on?
Can I assume your CI also sets O=<something> then? Is the CI config
stuff in tree, or somewhere else?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-04 15:24 ` Conor Dooley
@ 2026-03-04 15:45 ` Tom Rini
2026-03-04 16:57 ` Ilias Apalodimas
0 siblings, 1 reply; 11+ messages in thread
From: Tom Rini @ 2026-03-04 15:45 UTC (permalink / raw)
To: Conor Dooley
Cc: u-boot, Simon Glass, Ilias Apalodimas, Simon Glass, Sughosh Ganu
[-- Attachment #1: Type: text/plain, Size: 3369 bytes --]
On Wed, Mar 04, 2026 at 03:24:45PM +0000, Conor Dooley wrote:
> On Wed, Mar 04, 2026 at 09:11:54AM -0600, Tom Rini wrote:
> > On Wed, Mar 04, 2026 at 03:09:40PM +0000, Conor Dooley wrote:
> > > On Wed, Mar 04, 2026 at 09:01:45AM -0600, Tom Rini wrote:
> > > > On Wed, Mar 04, 2026 at 09:54:22AM +0000, Conor Dooley wrote:
> > > > > On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> > > > > > On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> > > > > >
> > > > > > > The exported sub_make_done variable leaks into the environment of all
> > > > > > > child processes. When make targets like tcheck spawn independent make
> > > > > > > invocations with O=, those child makes inherit sub_make_done=1, skip
> > > > > > > the KBUILD_OUTPUT setup and try to build in the source tree.
> > > > > > >
> > > > > > > There is a workaround that resets sub_make_done to 0 for specific test
> > > > > > > targets, but this isn't great since it has tolist every target that
> > > > > > > spawns independent make invocations.
> > > > > > >
> > > > > > > [...]
> > > > > >
> > > > > > Applied to u-boot/master, thanks!
> > > > > >
> > > > > > [1/1] kbuild: unexport sub_make_done to fix child make invocations
> > > > > > commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
> > > > >
> > > > >
> > > > > This breaks the build for me:
> > > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
> > > > > GEN Makefile
> > > > > #
> > > > > # configuration written to .config
> > > > > #
> > > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
> > > > > HOSTCC scripts/basic/fixdep
> > > > > GEN Makefile
> > > > > HOSTCC scripts/kconfig/conf.o
> > > > > YACC scripts/kconfig/zconf.tab.[ch]
> > > > > LEX scripts/kconfig/zconf.lex.c
> > > > > HOSTCC scripts/kconfig/zconf.tab.o
> > > > > HOSTLD scripts/kconfig/conf
> > > > > scripts/kconfig/conf --syncconfig Kconfig
> > > > > ***
> > > > > *** Configuration file ".config" not found!
> > > > > ***
> > > > > *** Please run some configurator (e.g. "make oldconfig" or
> > > > > *** "make menuconfig" or "make xconfig").
> > > > > ***
> > > > > make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
> > > > > make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
> > > > > make[2]: *** [../Makefile:189: __sub-make] Error 2
> > > > > make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
> > > > > make: *** [Makefile:189: __sub-make] Error 2
> > > >
> > > > That's odd. What host distro and make? I don't see that on Ubuntu 24.04.
> > >
> > > Originally my CI found it in a docker container with "from: ubuntu:noble",
> > > so 24.04. I reproduced it locally on debian unstable with make 4.4.1
> >
> > That's even more puzzling (noble is 24.04) since that sounds very close
> > to our CI too. Can you please look more in to what's going on?
>
> Can I assume your CI also sets O=<something> then? Is the CI config
> stuff in tree, or somewhere else?
We use buildman, which in turn does separate output directories. We
also, in Azure, have one job that uses O= specifically. Things are
defiend in .gitlab-ci.yml and .azure-pipelines.yml
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-04 15:45 ` Tom Rini
@ 2026-03-04 16:57 ` Ilias Apalodimas
2026-03-04 17:34 ` Tom Rini
0 siblings, 1 reply; 11+ messages in thread
From: Ilias Apalodimas @ 2026-03-04 16:57 UTC (permalink / raw)
To: Tom Rini; +Cc: Conor Dooley, u-boot, Simon Glass, Simon Glass, Sughosh Ganu
Hi Tom
On Wed, 4 Mar 2026 at 17:45, Tom Rini <trini@konsulko.com> wrote:
>
> On Wed, Mar 04, 2026 at 03:24:45PM +0000, Conor Dooley wrote:
> > On Wed, Mar 04, 2026 at 09:11:54AM -0600, Tom Rini wrote:
> > > On Wed, Mar 04, 2026 at 03:09:40PM +0000, Conor Dooley wrote:
> > > > On Wed, Mar 04, 2026 at 09:01:45AM -0600, Tom Rini wrote:
> > > > > On Wed, Mar 04, 2026 at 09:54:22AM +0000, Conor Dooley wrote:
> > > > > > On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> > > > > > > On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> > > > > > >
> > > > > > > > The exported sub_make_done variable leaks into the environment of all
> > > > > > > > child processes. When make targets like tcheck spawn independent make
> > > > > > > > invocations with O=, those child makes inherit sub_make_done=1, skip
> > > > > > > > the KBUILD_OUTPUT setup and try to build in the source tree.
> > > > > > > >
> > > > > > > > There is a workaround that resets sub_make_done to 0 for specific test
> > > > > > > > targets, but this isn't great since it has tolist every target that
> > > > > > > > spawns independent make invocations.
> > > > > > > >
> > > > > > > > [...]
> > > > > > >
> > > > > > > Applied to u-boot/master, thanks!
> > > > > > >
> > > > > > > [1/1] kbuild: unexport sub_make_done to fix child make invocations
> > > > > > > commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
> > > > > >
> > > > > >
> > > > > > This breaks the build for me:
> > > > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
> > > > > > GEN Makefile
> > > > > > #
> > > > > > # configuration written to .config
> > > > > > #
> > > > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
> > > > > > HOSTCC scripts/basic/fixdep
> > > > > > GEN Makefile
> > > > > > HOSTCC scripts/kconfig/conf.o
> > > > > > YACC scripts/kconfig/zconf.tab.[ch]
> > > > > > LEX scripts/kconfig/zconf.lex.c
> > > > > > HOSTCC scripts/kconfig/zconf.tab.o
> > > > > > HOSTLD scripts/kconfig/conf
> > > > > > scripts/kconfig/conf --syncconfig Kconfig
> > > > > > ***
> > > > > > *** Configuration file ".config" not found!
> > > > > > ***
> > > > > > *** Please run some configurator (e.g. "make oldconfig" or
> > > > > > *** "make menuconfig" or "make xconfig").
> > > > > > ***
> > > > > > make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
> > > > > > make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
> > > > > > make[2]: *** [../Makefile:189: __sub-make] Error 2
> > > > > > make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
> > > > > > make: *** [Makefile:189: __sub-make] Error 2
> > > > >
> > > > > That's odd. What host distro and make? I don't see that on Ubuntu 24.04.
> > > >
> > > > Originally my CI found it in a docker container with "from: ubuntu:noble",
> > > > so 24.04. I reproduced it locally on debian unstable with make 4.4.1
> > >
> > > That's even more puzzling (noble is 24.04) since that sounds very close
> > > to our CI too. Can you please look more in to what's going on?
> >
> > Can I assume your CI also sets O=<something> then? Is the CI config
> > stuff in tree, or somewhere else?
>
> We use buildman, which in turn does separate output directories. We
> also, in Azure, have one job that uses O= specifically. Things are
> defiend in .gitlab-ci.yml and .azure-pipelines.yml
I get the same error with
make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- qemu_arm64_lwip_defconfig O=build
make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- O=build
HOSTCC scripts/basic/fixdep
GEN Makefile
HOSTCC scripts/kconfig/conf.o
YACC scripts/kconfig/zconf.tab.[ch]
LEX scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --syncconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[4]: *** [/home/apalos/work/u-boot-tpm/scripts/kconfig/Makefile:75:
syncconfig] Error 1
make[3]: *** [/home/apalos/work/u-boot-tpm/Makefile:702: syncconfig] Error 2
make[2]: *** [../Makefile:189: __sub-make] Error 2
make[1]: *** No rule to make target 'include/config/auto.conf', needed
by 'include/config/uboot.release'. Stop.
make: *** [Makefile:189: __sub-make] Error 2
Also the patch has a Fixes tag, but it doesn't actually fix anything.
It just tries to improve something. Can we revert it on master at
least? Do you want me to send a patch?
Cheers
/Ilias
>
> --
> Tom
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-04 16:57 ` Ilias Apalodimas
@ 2026-03-04 17:34 ` Tom Rini
2026-03-04 18:02 ` Simon Glass
0 siblings, 1 reply; 11+ messages in thread
From: Tom Rini @ 2026-03-04 17:34 UTC (permalink / raw)
To: Ilias Apalodimas
Cc: Conor Dooley, u-boot, Simon Glass, Simon Glass, Sughosh Ganu
[-- Attachment #1: Type: text/plain, Size: 5052 bytes --]
On Wed, Mar 04, 2026 at 06:57:42PM +0200, Ilias Apalodimas wrote:
> Hi Tom
>
>
>
> On Wed, 4 Mar 2026 at 17:45, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Wed, Mar 04, 2026 at 03:24:45PM +0000, Conor Dooley wrote:
> > > On Wed, Mar 04, 2026 at 09:11:54AM -0600, Tom Rini wrote:
> > > > On Wed, Mar 04, 2026 at 03:09:40PM +0000, Conor Dooley wrote:
> > > > > On Wed, Mar 04, 2026 at 09:01:45AM -0600, Tom Rini wrote:
> > > > > > On Wed, Mar 04, 2026 at 09:54:22AM +0000, Conor Dooley wrote:
> > > > > > > On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> > > > > > > > On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> > > > > > > >
> > > > > > > > > The exported sub_make_done variable leaks into the environment of all
> > > > > > > > > child processes. When make targets like tcheck spawn independent make
> > > > > > > > > invocations with O=, those child makes inherit sub_make_done=1, skip
> > > > > > > > > the KBUILD_OUTPUT setup and try to build in the source tree.
> > > > > > > > >
> > > > > > > > > There is a workaround that resets sub_make_done to 0 for specific test
> > > > > > > > > targets, but this isn't great since it has tolist every target that
> > > > > > > > > spawns independent make invocations.
> > > > > > > > >
> > > > > > > > > [...]
> > > > > > > >
> > > > > > > > Applied to u-boot/master, thanks!
> > > > > > > >
> > > > > > > > [1/1] kbuild: unexport sub_make_done to fix child make invocations
> > > > > > > > commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
> > > > > > >
> > > > > > >
> > > > > > > This breaks the build for me:
> > > > > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
> > > > > > > GEN Makefile
> > > > > > > #
> > > > > > > # configuration written to .config
> > > > > > > #
> > > > > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
> > > > > > > HOSTCC scripts/basic/fixdep
> > > > > > > GEN Makefile
> > > > > > > HOSTCC scripts/kconfig/conf.o
> > > > > > > YACC scripts/kconfig/zconf.tab.[ch]
> > > > > > > LEX scripts/kconfig/zconf.lex.c
> > > > > > > HOSTCC scripts/kconfig/zconf.tab.o
> > > > > > > HOSTLD scripts/kconfig/conf
> > > > > > > scripts/kconfig/conf --syncconfig Kconfig
> > > > > > > ***
> > > > > > > *** Configuration file ".config" not found!
> > > > > > > ***
> > > > > > > *** Please run some configurator (e.g. "make oldconfig" or
> > > > > > > *** "make menuconfig" or "make xconfig").
> > > > > > > ***
> > > > > > > make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
> > > > > > > make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
> > > > > > > make[2]: *** [../Makefile:189: __sub-make] Error 2
> > > > > > > make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
> > > > > > > make: *** [Makefile:189: __sub-make] Error 2
> > > > > >
> > > > > > That's odd. What host distro and make? I don't see that on Ubuntu 24.04.
> > > > >
> > > > > Originally my CI found it in a docker container with "from: ubuntu:noble",
> > > > > so 24.04. I reproduced it locally on debian unstable with make 4.4.1
> > > >
> > > > That's even more puzzling (noble is 24.04) since that sounds very close
> > > > to our CI too. Can you please look more in to what's going on?
> > >
> > > Can I assume your CI also sets O=<something> then? Is the CI config
> > > stuff in tree, or somewhere else?
> >
> > We use buildman, which in turn does separate output directories. We
> > also, in Azure, have one job that uses O= specifically. Things are
> > defiend in .gitlab-ci.yml and .azure-pipelines.yml
>
> I get the same error with
> make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- qemu_arm64_lwip_defconfig O=build
> make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- O=build
> HOSTCC scripts/basic/fixdep
> GEN Makefile
> HOSTCC scripts/kconfig/conf.o
> YACC scripts/kconfig/zconf.tab.[ch]
> LEX scripts/kconfig/zconf.lex.c
> HOSTCC scripts/kconfig/zconf.tab.o
> HOSTLD scripts/kconfig/conf
> scripts/kconfig/conf --syncconfig Kconfig
> ***
> *** Configuration file ".config" not found!
> ***
> *** Please run some configurator (e.g. "make oldconfig" or
> *** "make menuconfig" or "make xconfig").
> ***
> make[4]: *** [/home/apalos/work/u-boot-tpm/scripts/kconfig/Makefile:75:
> syncconfig] Error 1
> make[3]: *** [/home/apalos/work/u-boot-tpm/Makefile:702: syncconfig] Error 2
> make[2]: *** [../Makefile:189: __sub-make] Error 2
> make[1]: *** No rule to make target 'include/config/auto.conf', needed
> by 'include/config/uboot.release'. Stop.
> make: *** [Makefile:189: __sub-make] Error 2
>
> Also the patch has a Fixes tag, but it doesn't actually fix anything.
> It just tries to improve something. Can we revert it on master at
> least? Do you want me to send a patch?
Sigh, I'll revert it, thanks.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] kbuild: unexport sub_make_done to fix child make invocations
2026-03-04 17:34 ` Tom Rini
@ 2026-03-04 18:02 ` Simon Glass
0 siblings, 0 replies; 11+ messages in thread
From: Simon Glass @ 2026-03-04 18:02 UTC (permalink / raw)
To: Tom Rini
Cc: Ilias Apalodimas, Conor Dooley, u-boot, Simon Glass, Sughosh Ganu
Hi,
On Wed, 4 Mar 2026 at 10:34, Tom Rini <trini@konsulko.com> wrote:
>
> On Wed, Mar 04, 2026 at 06:57:42PM +0200, Ilias Apalodimas wrote:
> > Hi Tom
> >
> >
> >
> > On Wed, 4 Mar 2026 at 17:45, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Wed, Mar 04, 2026 at 03:24:45PM +0000, Conor Dooley wrote:
> > > > On Wed, Mar 04, 2026 at 09:11:54AM -0600, Tom Rini wrote:
> > > > > On Wed, Mar 04, 2026 at 03:09:40PM +0000, Conor Dooley wrote:
> > > > > > On Wed, Mar 04, 2026 at 09:01:45AM -0600, Tom Rini wrote:
> > > > > > > On Wed, Mar 04, 2026 at 09:54:22AM +0000, Conor Dooley wrote:
> > > > > > > > On Tue, Mar 03, 2026 at 12:50:55PM -0600, Tom Rini wrote:
> > > > > > > > > On Fri, 13 Feb 2026 19:47:34 -0700, Simon Glass wrote:
> > > > > > > > >
> > > > > > > > > > The exported sub_make_done variable leaks into the environment of all
> > > > > > > > > > child processes. When make targets like tcheck spawn independent make
> > > > > > > > > > invocations with O=, those child makes inherit sub_make_done=1, skip
> > > > > > > > > > the KBUILD_OUTPUT setup and try to build in the source tree.
> > > > > > > > > >
> > > > > > > > > > There is a workaround that resets sub_make_done to 0 for specific test
> > > > > > > > > > targets, but this isn't great since it has tolist every target that
> > > > > > > > > > spawns independent make invocations.
> > > > > > > > > >
> > > > > > > > > > [...]
> > > > > > > > >
> > > > > > > > > Applied to u-boot/master, thanks!
> > > > > > > > >
> > > > > > > > > [1/1] kbuild: unexport sub_make_done to fix child make invocations
> > > > > > > > > commit: 4284306d22c5b6d64ecd62b462551d9d313c8104
> > > > > > > >
> > > > > > > >
> > > > > > > > This breaks the build for me:
> > > > > > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build microchip_mpfs_generic_defconfig
> > > > > > > > GEN Makefile
> > > > > > > > #
> > > > > > > > # configuration written to .config
> > > > > > > > #
> > > > > > > > make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build
> > > > > > > > HOSTCC scripts/basic/fixdep
> > > > > > > > GEN Makefile
> > > > > > > > HOSTCC scripts/kconfig/conf.o
> > > > > > > > YACC scripts/kconfig/zconf.tab.[ch]
> > > > > > > > LEX scripts/kconfig/zconf.lex.c
> > > > > > > > HOSTCC scripts/kconfig/zconf.tab.o
> > > > > > > > HOSTLD scripts/kconfig/conf
> > > > > > > > scripts/kconfig/conf --syncconfig Kconfig
> > > > > > > > ***
> > > > > > > > *** Configuration file ".config" not found!
> > > > > > > > ***
> > > > > > > > *** Please run some configurator (e.g. "make oldconfig" or
> > > > > > > > *** "make menuconfig" or "make xconfig").
> > > > > > > > ***
> > > > > > > > make[4]: *** [/stuff/u-boot/scripts/kconfig/Makefile:75: syncconfig] Error 1
> > > > > > > > make[3]: *** [/stuff/u-boot/Makefile:702: syncconfig] Error 2
> > > > > > > > make[2]: *** [../Makefile:189: __sub-make] Error 2
> > > > > > > > make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
> > > > > > > > make: *** [Makefile:189: __sub-make] Error 2
> > > > > > >
> > > > > > > That's odd. What host distro and make? I don't see that on Ubuntu 24.04.
> > > > > >
> > > > > > Originally my CI found it in a docker container with "from: ubuntu:noble",
> > > > > > so 24.04. I reproduced it locally on debian unstable with make 4.4.1
> > > > >
> > > > > That's even more puzzling (noble is 24.04) since that sounds very close
> > > > > to our CI too. Can you please look more in to what's going on?
> > > >
> > > > Can I assume your CI also sets O=<something> then? Is the CI config
> > > > stuff in tree, or somewhere else?
> > >
> > > We use buildman, which in turn does separate output directories. We
> > > also, in Azure, have one job that uses O= specifically. Things are
> > > defiend in .gitlab-ci.yml and .azure-pipelines.yml
> >
> > I get the same error with
> > make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- qemu_arm64_lwip_defconfig O=build
> > make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- O=build
> > HOSTCC scripts/basic/fixdep
> > GEN Makefile
> > HOSTCC scripts/kconfig/conf.o
> > YACC scripts/kconfig/zconf.tab.[ch]
> > LEX scripts/kconfig/zconf.lex.c
> > HOSTCC scripts/kconfig/zconf.tab.o
> > HOSTLD scripts/kconfig/conf
> > scripts/kconfig/conf --syncconfig Kconfig
> > ***
> > *** Configuration file ".config" not found!
> > ***
> > *** Please run some configurator (e.g. "make oldconfig" or
> > *** "make menuconfig" or "make xconfig").
> > ***
> > make[4]: *** [/home/apalos/work/u-boot-tpm/scripts/kconfig/Makefile:75:
> > syncconfig] Error 1
> > make[3]: *** [/home/apalos/work/u-boot-tpm/Makefile:702: syncconfig] Error 2
> > make[2]: *** [../Makefile:189: __sub-make] Error 2
> > make[1]: *** No rule to make target 'include/config/auto.conf', needed
> > by 'include/config/uboot.release'. Stop.
> > make: *** [Makefile:189: __sub-make] Error 2
> >
> > Also the patch has a Fixes tag, but it doesn't actually fix anything.
> > It just tries to improve something. Can we revert it on master at
> > least? Do you want me to send a patch?
>
> Sigh, I'll revert it, thanks.
Yes unfortunately it is broken for this case, but I see another way.
The patch allows adding 'make qcheck' etc. to CI, something Tom has
requested for a while. Since this is being reverted, I'll send a v2.
Regards,
Simon
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-03-04 18:03 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-14 2:47 [PATCH] kbuild: unexport sub_make_done to fix child make invocations Simon Glass
2026-03-03 18:50 ` Tom Rini
2026-03-04 9:54 ` Conor Dooley
2026-03-04 15:01 ` Tom Rini
2026-03-04 15:09 ` Conor Dooley
2026-03-04 15:11 ` Tom Rini
2026-03-04 15:24 ` Conor Dooley
2026-03-04 15:45 ` Tom Rini
2026-03-04 16:57 ` Ilias Apalodimas
2026-03-04 17:34 ` Tom Rini
2026-03-04 18:02 ` Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox