public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Adrian Bunk <bunk@kernel.org>
Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>,
	Roman Zippel <zippel@linux-m68k.org>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: Kconfig no longer outputs a .config with freshly updated defconfigs
Date: Sun, 3 Aug 2008 10:00:19 +0200	[thread overview]
Message-ID: <20080803080019.GA13265@uranus.ravnborg.org> (raw)
In-Reply-To: <20080802192646.GR19682@cs181140183.pp.htv.fi>

On Sat, Aug 02, 2008 at 10:26:47PM +0300, Adrian Bunk wrote:
> On Sat, Aug 02, 2008 at 12:03:33PM -0400, Josh Boyer wrote:
> > I was going through the somewhat tedious task of updating the 4xx
> > defconfigs today, and I noticed some odd behavior from Kconfig.
> > Basically, I would do:
> > 
> > 	make ppc44x_defconfig
> > 	make oldconfig
> > 	<build>
> > 	cp .config arch/powerpc/configs/ppc44x_defconfig
> > 	make distclean
> > 
> > I did this for a number of configs.  Then I went back and tried to build
> > ppc44x_defconfig again and I got this result:
> > 
> > [jwboyer@localhost linux-2.6]$ make ppc44x_defconfig
> >   HOSTCC  scripts/basic/fixdep
> >   HOSTCC  scripts/basic/docproc
> >   HOSTCC  scripts/kconfig/conf.o
> >   HOSTCC  scripts/kconfig/kxgettext.o
> >   SHIPPED scripts/kconfig/zconf.tab.c
> >   SHIPPED scripts/kconfig/lex.zconf.c
> >   SHIPPED scripts/kconfig/zconf.hash.c
> >   HOSTCC  scripts/kconfig/zconf.tab.o
> > scripts/kconfig/lex.zconf.c:1628: warning: ‘input’ defined but not used
> >   HOSTLD  scripts/kconfig/conf
> > [jwboyer@localhost linux-2.6]$ make oldconfig
> > scripts/kconfig/conf -o arch/powerpc/Kconfig
> > #
> > # using defaults found in /boot/config-2.6.25.13-104.fc9.ppc64
> > #
> > 
> > There was no .config file present after the initial 'make
> > ppc44x_defconfig', so it defaulted to using something in /boot.  I'm a
> > bit baffled here, but that seems to be common to any newly updated
> > defconfig I've done.
> > 
> > Was there a change to Kconfig recently that won't copy the defconfig
> > file to .config if there are no symbol changes or something like that?
> 
> Thanks for your bug report, this should have worked.
> 
> @Sam:
> I've bisected this and it is caused by
> commit f443d2eccf077afd8a839cc7ed66cc4d520c5f05
> (kconfig: speed up all*config + randconfig).
> 
> Minimal example for reproducing it:
> 
> make x86_64_defconfig
> cp .config arch/x86/configs/x86_64_defconfig
> rm .config
> make x86_64_defconfig
> ls .config

Thanks Adrian.

The code has started to check if anything changed
and if not - then do not write out a new config.
So in your sample above we would not see any changes
compared to what we read in autoconf.h so we did nto write
out a new autoconf.h (and thus no .config).

The right fix seems to check for .config and for changes
and in both cases to write a new config.

Patch below.

	Sam


diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 9fba838..7c938c2 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -464,6 +464,21 @@ static int conf_update(void)
 	return 0;
 }
 
+/* Write out config if config has changed or .config is missing */
+static int conf_do_write(void)
+{
+	struct stat tmpstat;
+
+	/* Any config changes */
+	if (conf_get_changed())
+		return 1;
+	/* .config missing */
+	if (stat(conf_get_configname(), &tmpstat))
+		return 1;
+
+	return 0;
+}
+
 int main(int ac, char **av)
 {
 	int opt;
@@ -596,7 +611,7 @@ int main(int ac, char **av)
 		break;
 	}
 
-	if (conf_get_changed() && conf_write(NULL)) {
+	if (conf_do_write() && conf_write(NULL)) {
 		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
 		exit(1);
 	}

  parent reply	other threads:[~2008-08-03  8:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1217693013.2328.22.camel@localhost.localdomain>
2008-08-02 19:26 ` Kconfig no longer outputs a .config with freshly updated defconfigs Adrian Bunk
2008-08-02 23:58   ` Josh Boyer
2008-08-03  8:00   ` Sam Ravnborg [this message]
2008-08-03 10:07     ` Adrian Bunk
2008-08-04 21:08       ` Sam Ravnborg
2008-08-05  2:50         ` Roman Zippel
2008-08-05 20:43           ` Sam Ravnborg
2008-08-09  5:26             ` Roman Zippel

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=20080803080019.GA13265@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=bunk@kernel.org \
    --cc=jwboyer@linux.vnet.ibm.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zippel@linux-m68k.org \
    /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