From: Dirk Gouders <dirk@gouders.net>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-kbuild@vger.kernel.org, Ulf Magnusson <ulfalizer@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Sam Ravnborg <sam@ravnborg.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 05/12] kconfig: make syncconfig update .config regardless of sym_change_count
Date: Fri, 06 Jul 2018 14:23:58 +0200 [thread overview]
Message-ID: <ghva9simch.fsf@lena.gouders.net> (raw)
In-Reply-To: <1530758389-30862-6-git-send-email-yamada.masahiro@socionext.com> (Masahiro Yamada's message of "Thu, 5 Jul 2018 11:39:42 +0900")
Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> syncconfig updates the .config only when sym_change_count > 0, i.e.
> any change in config symbols has been detected.
>
> Not only symbols but also comments are contained in the .config file.
> If only comments are updated, they are not fed back to the .config,
> then the stale comments are left-over. Of course, this is just a
> matter of comments, but why not fix it.
Hello Masahiro,
I am currently looking at and testing this series.
First: For this patch I would suggest to also edit the syncconfig
section of "conf --help".
Further, on a slow laptop, I was suspecting, this patch to cause full
rebuilds of everything, each time I ran "make syncconfig" followed by
"make" but could not verify this on another machine, so perhaps I am
just (for testing purposes) removing the wrong files (modules.builtin
for example) -- I am still testing.
But, what irritates me with testing is that (also without your
patches) two consecutive "make" produce different output, one of them
always shows a warning and this is reproducable. I just want to make
sure there is no other problem that influences my testing:
$ make
CALL scripts/checksyscalls.sh
DESCEND objtool
CHK include/generated/compile.h
DATAREL arch/x86/boot/compressed/vmlinux
Kernel: arch/x86/boot/bzImage is ready (#15)
Building modules, stage 2.
MODPOST 211 modules
$ make
CALL scripts/checksyscalls.sh
DESCEND objtool
CHK include/generated/compile.h
LD arch/x86/boot/compressed/vmlinux
ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
ld: warning: creating a DT_TEXTREL in object.
ZOFFSET arch/x86/boot/zoffset.h
AS arch/x86/boot/header.o
LD arch/x86/boot/setup.elf
OBJCOPY arch/x86/boot/setup.bin
OBJCOPY arch/x86/boot/vmlinux.bin
BUILD arch/x86/boot/bzImage
Setup is 15580 bytes (padded to 15872 bytes).
System is 8069 kB
CRC e01d75ec
Kernel: arch/x86/boot/bzImage is ready (#15)
Building modules, stage 2.
MODPOST 211 modules
Dirk
> I see some scenarios where this happens.
>
> Scenario A:
>
> 1. You have a source tree that has already been configured.
>
> 2. Linus increments the version number in the top-level Makefile
> (i.e. he commits a new release)
>
> 3. You pull it, and run 'make'
>
> 4. syncconfig is invoked because the environment variable,
> KERNELVERSION is updated, but the .config is not updated since
> no config symbol is changed.
>
> 5. The .config file contains a kernel version in the top line:
>
> # Automatically generated file; DO NOT EDIT.
> # Linux/arm64 4.18.0-rc2 Kernel Configuration
>
> ... which points to a previous version.
>
> Scenario B:
>
> 1. You have a source tree that has already been configured.
>
> 2. You upgrade the compiler, but it still has the same version number.
> This may happen if you regularly build the latest compiler from
> the source code.
>
> 3. You run 'make'
>
> 4. syncconfig is invoked because the environment variable,
> CC_VERSION_TEXT is updated, but the .config is not updated since
> no config symbol is changed.
>
> 5. The .config file contains the version string of the compiler:
>
> #
> # Compiler: aarch64-linux-gcc (GCC) 9.0.0 20180628 (experimental)
> #
>
> ... which carries the information of the old compiler.
>
> If KCONFIG_NOSILENTUPDATE is set, syncconfig is not allowed to update
> the .config file. Otherwise, it is fine to update it regardless of
> sym_change_count.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> scripts/kconfig/conf.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
> index 671ff53..5af8991 100644
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -496,6 +496,7 @@ int main(int ac, char **av)
> int opt;
> const char *name, *defconfig_file = NULL /* gcc uninit */;
> struct stat tmpstat;
> + int no_conf_write = 0;
>
> tty_stdio = isatty(0) && isatty(1);
>
> @@ -633,13 +634,14 @@ int main(int ac, char **av)
> }
>
> if (sync_kconfig) {
> - if (conf_get_changed()) {
> - name = getenv("KCONFIG_NOSILENTUPDATE");
> - if (name && *name) {
> + name = getenv("KCONFIG_NOSILENTUPDATE");
> + if (name && *name) {
> + if (conf_get_changed()) {
> fprintf(stderr,
> "\n*** The configuration requires explicit update.\n\n");
> return 1;
> }
> + no_conf_write = 1;
> }
> }
>
> @@ -688,7 +690,7 @@ int main(int ac, char **av)
> /* syncconfig is used during the build so we shall update autoconf.
> * All other commands are only used to generate a config.
> */
> - if (conf_get_changed() && conf_write(NULL)) {
> + if (!no_conf_write && conf_write(NULL)) {
> fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
> exit(1);
> }
next prev parent reply other threads:[~2018-07-06 12:33 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 2:39 [PATCH v3 00/12] kbuild/kconfig: do not update config during installation Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 01/12] kconfig: rename file_write_dep and move it to confdata.c Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 02/12] kconfig: split out helpers to check file/directory, create directory Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 03/12] kconfig: remove unneeded directory generation from local*config Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 04/12] kconfig: create directories needed for syncconfig by itself Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 05/12] kconfig: make syncconfig update .config regardless of sym_change_count Masahiro Yamada
2018-07-06 12:23 ` Dirk Gouders [this message]
2018-07-06 23:38 ` Dirk Gouders
2018-07-09 11:39 ` Dirk Gouders
2018-07-10 15:19 ` Kees Cook
2018-07-12 2:12 ` Masahiro Yamada
2018-07-12 11:32 ` Dirk Gouders
2018-07-12 21:06 ` Dirk Gouders
2018-07-13 14:57 ` Masahiro Yamada
2018-07-14 7:12 ` Dirk Gouders
2018-07-05 2:39 ` [PATCH v3 06/12] kconfig: allow all config targets to write auto.conf if missing Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 07/12] kbuild: use 'include' directive to load auto.conf from top Makefile Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 08/12] kbuild: add .DELETE_ON_ERROR special target Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 09/12] kbuild: do not update config when running install targets Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 10/12] kbuild: do not update config for 'make kernelrelease' Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 11/12] kbuild: remove auto.conf and tristate.conf from prerequisites Masahiro Yamada
2018-07-05 2:39 ` [PATCH v3 12/12] kbuild: replace include/config/%.conf with include/config/auto.conf Masahiro Yamada
2018-07-10 11:34 ` [PATCH v3 00/12] kbuild/kconfig: do not update config during installation Dirk Gouders
2018-07-12 8:29 ` Masahiro Yamada
2018-07-13 7:44 ` Dirk Gouders
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ghva9simch.fsf@lena.gouders.net \
--to=dirk@gouders.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@linux-foundation.org \
--cc=ulfalizer@gmail.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox