[PATCH 11/23] kbuild: check the presence of include/generated/rustc_cfg

Masahiro Yamada posted 23 patches 2 months, 1 week ago
There is a newer version of this series
[PATCH 11/23] kbuild: check the presence of include/generated/rustc_cfg
Posted by Masahiro Yamada 2 months, 1 week ago
Since commit 2f7ab1267dc9 ("Kbuild: add Rust support"), Kconfig
generates include/generated/rustc_cfg, but its presence is not checked
in the top-level Makefile. It should be checked similarly to the C
header counterpart, include/generated/autoconf.h.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 3f5c273c2901..5700d08c9b57 100644
--- a/Makefile
+++ b/Makefile
@@ -780,7 +780,7 @@ else # !may-sync-config
 # and include/config/auto.conf but do not care if they are up-to-date.
 # Use auto.conf to show the error message
 
-checked-configs := include/generated/autoconf.h include/config/auto.conf
+checked-configs := include/generated/autoconf.h include/generated/rustc_cfg include/config/auto.conf
 missing-configs := $(filter-out $(wildcard $(checked-configs)), $(checked-configs))
 
 ifdef missing-configs
@@ -1187,7 +1187,8 @@ PHONY += prepare archprepare
 
 archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
 	asm-generic $(version_h) include/generated/utsrelease.h \
-	include/generated/compile.h include/generated/autoconf.h remove-stale-files
+	include/generated/compile.h include/generated/autoconf.h \
+	include/generated/rustc_cfg remove-stale-files
 
 prepare0: archprepare
 	$(Q)$(MAKE) $(build)=scripts/mod
-- 
2.43.0
Re: [PATCH 11/23] kbuild: check the presence of include/generated/rustc_cfg
Posted by Miguel Ojeda 2 months ago
On Tue, Sep 17, 2024 at 4:17 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Since commit 2f7ab1267dc9 ("Kbuild: add Rust support"), Kconfig
> generates include/generated/rustc_cfg, but its presence is not checked
> in the top-level Makefile. It should be checked similarly to the C
> header counterpart, include/generated/autoconf.h.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Sounds good to me:

Acked-by: Miguel Ojeda <ojeda@kernel.org>

I also tested that it indeed prints it if removed:

    ***
    ***  ERROR: Kernel configuration is invalid. The following files
are missing:
    ***    - ....../linux/include/generated/rustc_cfg
    ***  Run "make oldconfig && make prepare" on kernel source to fix it.
    ***

which is nice! So:

Tested-by: Miguel Ojeda <ojeda@kernel.org>

I guess this tag may apply to the previous patch too.

Cheers,
Miguel
Re: [PATCH 11/23] kbuild: check the presence of include/generated/rustc_cfg
Posted by Nicolas Schier 2 months ago
On Tue, Sep 17, 2024 at 11:16:39PM +0900, Masahiro Yamada wrote:
> Since commit 2f7ab1267dc9 ("Kbuild: add Rust support"), Kconfig
> generates include/generated/rustc_cfg, but its presence is not checked
> in the top-level Makefile. It should be checked similarly to the C
> header counterpart, include/generated/autoconf.h.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  Makefile | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 3f5c273c2901..5700d08c9b57 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -780,7 +780,7 @@ else # !may-sync-config
>  # and include/config/auto.conf but do not care if they are up-to-date.
>  # Use auto.conf to show the error message
>  
> -checked-configs := include/generated/autoconf.h include/config/auto.conf
> +checked-configs := include/generated/autoconf.h include/generated/rustc_cfg include/config/auto.conf
>  missing-configs := $(filter-out $(wildcard $(checked-configs)), $(checked-configs))
>  
>  ifdef missing-configs
> @@ -1187,7 +1187,8 @@ PHONY += prepare archprepare
>  
>  archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
>  	asm-generic $(version_h) include/generated/utsrelease.h \
> -	include/generated/compile.h include/generated/autoconf.h remove-stale-files
> +	include/generated/compile.h include/generated/autoconf.h \
> +	include/generated/rustc_cfg remove-stale-files
>  
>  prepare0: archprepare
>  	$(Q)$(MAKE) $(build)=scripts/mod
> -- 
> 2.43.0
> 

Reviewed-by: Nicolas Schier <n.schier@avm.de>