All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] build/xen: fail to rebuild if Kconfig fails
@ 2024-02-15  9:30 Roger Pau Monne
  2024-02-15  9:49 ` Jan Beulich
  2024-02-15 10:32 ` Anthony PERARD
  0 siblings, 2 replies; 17+ messages in thread
From: Roger Pau Monne @ 2024-02-15  9:30 UTC (permalink / raw)
  To: xen-devel
  Cc: anthony.perard, Roger Pau Monne, Andrew Cooper, George Dunlap,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu

When doing a rebuild with an xen/include/config/auto.conf already present in
the tree, failures from Kconfig are ignored since the target is present:

gmake -C xen install
gmake[1]: Entering directory '/root/src/xen/xen'
tools/kconfig/conf  --syncconfig Kconfig
common/Kconfig:2: syntax error
common/Kconfig:1: invalid statement
gmake[2]: *** [tools/kconfig/Makefile:73: syncconfig] Error 1
  UPD     include/xen/compile.h
 Xen 4.19-unstable
gmake[3]: Nothing to be done for 'all'.
gmake[2]: 'arch/x86/include/asm/asm-offsets.h' is up to date.

Ultimately leading to a successful build despite the Kconfig error.

Fix this by first removing xen/include/config/auto.conf before attempting to
regenerate, and then also make xen/include/config/auto.conf a hard dependency
of the build process (ie: drop the leading '-') and reordering so the .cmd
target is executed before including the configuration file.

This leads to the build properly failing if the config file cannot be
re-generated:

gmake -C xen install
gmake[1]: Entering directory '/root/src/xen/xen'
rm -rf include/config/auto.conf
tools/kconfig/conf  --syncconfig Kconfig
common/Kconfig:2: syntax error
common/Kconfig:1: invalid statement
gmake[2]: *** [tools/kconfig/Makefile:73: syncconfig] Error 1
gmake[1]: *** [Makefile:379: include/config/auto.conf] Error 2
gmake[1]: Leaving directory '/root/src/xen/xen'
gmake: *** [Makefile:143: install-xen] Error 2

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Maybe there's a better way for dealing with all this, my makefile foo is very
limited.
---
 xen/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 21832d640225..7e6860a58a1d 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -358,10 +358,10 @@ config: tools_fixdep outputmakefile FORCE
 else # !config-build
 
 ifeq ($(need-config),y)
--include include/config/auto.conf
 # Read in dependencies to all Kconfig* files, make sure to run syncconfig if
 # changes are detected.
 -include include/config/auto.conf.cmd
+include include/config/auto.conf
 
 # Allow people to just run `make` as before and not force them to configure
 # Only run defconfig if $(KCONFIG_CONFIG) is missing
@@ -375,6 +375,7 @@ $(KCONFIG_CONFIG): tools_fixdep
 # This exploits the 'multi-target pattern rule' trick.
 # The syncconfig should be executed only once to make all the targets.
 include/config/%.conf include/config/%.conf.cmd: $(KCONFIG_CONFIG)
+	rm -rf include/config/$*.conf
 	$(Q)$(MAKE) $(build)=tools/kconfig syncconfig
 
 ifeq ($(CONFIG_DEBUG),y)
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-02-19  8:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-15  9:30 [PATCH] build/xen: fail to rebuild if Kconfig fails Roger Pau Monne
2024-02-15  9:49 ` Jan Beulich
2024-02-15 10:28   ` Roger Pau Monné
2024-02-15 10:43     ` Jan Beulich
2024-02-15 11:04       ` Roger Pau Monné
2024-02-15 12:11         ` Jan Beulich
2024-02-15 12:18           ` Jan Beulich
2024-02-15 13:02         ` Jan Beulich
2024-02-15 16:08           ` Roger Pau Monné
2024-02-15 16:22             ` Jan Beulich
2024-02-15 17:23               ` Roger Pau Monné
2024-02-16 10:04                 ` Jan Beulich
2024-02-16 10:51                   ` Roger Pau Monné
2024-02-19  8:36                     ` Jan Beulich
2024-02-15 10:32 ` Anthony PERARD
2024-02-15 10:34   ` Jan Beulich
2024-02-15 11:46   ` Roger Pau Monné

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.