[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVmgZjyGxz0F=Akz+3egFtGMppGg6TRAnRhd=KZv5ADdg@mail.gmail.com>
Date: Fri, 10 May 2019 08:46:35 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: linux-kbuild <linux-kbuild@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg KH <gregkh@...uxfoundation.org>,
Ulf Magnusson <ulfalizer@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Joel Fernandes <joel@...lfernandes.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] kconfig: do not write .config if the content is the same
Hi Yamada-san,
On Fri, May 10, 2019 at 8:14 AM Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
> Kconfig updates the .config when it exits even if its content is
> exactly the same as before. Since its timestamp becomes newer than
> that of other build artifacts, additional processing is invoked,
> which is annoying.
>
> - syncconfig is invoked to update include/config/auto.conf, etc.
>
> - kernel/config.o is recompiled if CONFIG_IKCONFIG is enabled,
> then vmlinux is relinked as well.
>
> If the .config is not changed at all, we do not have to even
> touch it. Just bail out showing "No change to .config".
>
> $ make allmodconfig
> scripts/kconfig/conf --allmodconfig Kconfig
> #
> # configuration written to .config
> #
> $ make allmodconfig
> scripts/kconfig/conf --allmodconfig Kconfig
> #
> # No change to .config
> #
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
Thanks for your patch!
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -888,6 +935,13 @@ int conf_write(const char *name)
> fclose(out);
>
> if (*tmpname) {
> + if (is_same(name, tmpname)) {
> + conf_message("No change to %s", name);
> + unlink(tmpname);
> + sym_set_change_count(0);
> + return 0;
> + }
> +
> snprintf(oldname, sizeof(oldname), "%s.old", name);
> rename(name, oldname);
> if (rename(tmpname, name))
This causes a semantic change for the meaning of ".config.old", which is
no longer updated if .config has not changed.
Hence its contents may no longer correspond to the previous config, but to
an arbitrary older version.
My workflow involves always running my own script "linux-oldconfig",
instead of "make oldconfig", so I immediately see what has changed:
$ cat $(type -p linux-oldconfig)
#!/bin/bash
make ${0#*/linux-} && colordiff -u .config{.old,}
However, after your patch, "linux-oldconfig" keeps on showing the old
changes, while .config itself has not changed. I guess other people
tracking .config changes are using a similar scheme.
One way to fix this is to rename tmpname to oldname if is_same() returns
true. However, this may have side effects for other people, as the
timestamp of .config.old will be changed.
Do you have a better solution?
Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists