diff mbox series

[XEN,v8,36/47] RFC, no-VPATH: Kconfig: only ready auto.conf from objtree

Message ID 20211125134006.1076646-37-anthony.perard@citrix.com (mailing list archive)
State Superseded
Headers show
Series xen: Build system improvements, now with out-of-tree build! | expand

Commit Message

Anthony PERARD Nov. 25, 2021, 1:39 p.m. UTC
From: Anthony PERARD <anthony.perard@gmail.com>

zconf_fopen() will open file in $srctree if the file isn't in
$objtree. This is an issue for "auto.conf" as it could be in the
source tree if it is dirty. With "auto.conf" read from the source
tree, kconfig will not properly set the file associated with a
CONFIG_* properly in "include/config/" and instead only touch the
files that correspond to new CONFIG_* option that were not set in the
"auto.conf" found in the source tree.

That might not be an issue, but it is probably better to have a
populated "include/config/" directory in sync with
"include/config/auto.conf".

The second that read from conf_get_configname() would read ".config"
from the source directory which is also not wanted in Xen.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/tools/kconfig/confdata.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Jan Beulich Dec. 21, 2021, 2:23 p.m. UTC | #1
On 25.11.2021 14:39, Anthony PERARD wrote:
> From: Anthony PERARD <anthony.perard@gmail.com>
> 
> zconf_fopen() will open file in $srctree if the file isn't in
> $objtree. This is an issue for "auto.conf" as it could be in the
> source tree if it is dirty. With "auto.conf" read from the source
> tree, kconfig will not properly set the file associated with a
> CONFIG_* properly in "include/config/" and instead only touch the
> files that correspond to new CONFIG_* option that were not set in the
> "auto.conf" found in the source tree.

Do we really mean to support mixing in-tree and out-of-tree builds
from one source tree? Without such mixing, iiuc there would be no
such problem.

Jan
Anthony PERARD Dec. 21, 2021, 3:12 p.m. UTC | #2
On Tue, Dec 21, 2021 at 03:23:48PM +0100, Jan Beulich wrote:
> On 25.11.2021 14:39, Anthony PERARD wrote:
> > From: Anthony PERARD <anthony.perard@gmail.com>
> > 
> > zconf_fopen() will open file in $srctree if the file isn't in
> > $objtree. This is an issue for "auto.conf" as it could be in the
> > source tree if it is dirty. With "auto.conf" read from the source
> > tree, kconfig will not properly set the file associated with a
> > CONFIG_* properly in "include/config/" and instead only touch the
> > files that correspond to new CONFIG_* option that were not set in the
> > "auto.conf" found in the source tree.
> 
> Do we really mean to support mixing in-tree and out-of-tree builds
> from one source tree? Without such mixing, iiuc there would be no
> such problem.

Could you read and reply to the cover letter instead? The second
paragraph of the v8 changelog speaks about this. I would rather have a
discussion about this on the cover letter thread than in a patch.

Thanks,
diff mbox series

Patch

diff --git a/xen/tools/kconfig/confdata.c b/xen/tools/kconfig/confdata.c
index 4f9139d055be..805d4c3e5636 100644
--- a/xen/tools/kconfig/confdata.c
+++ b/xen/tools/kconfig/confdata.c
@@ -357,12 +357,17 @@  int conf_read_simple(const char *name, int def)
 	int i, def_flags;
 
 	if (name) {
-		in = zconf_fopen(name);
+		if (def == S_DEF_AUTO) {
+			/* only open include/config/auto.conf in objtree */
+			in = fopen(name, "r");
+		} else {
+			in = zconf_fopen(name);
+		}
 	} else {
 		struct property *prop;
 
 		name = conf_get_configname();
-		in = zconf_fopen(name);
+		in = fopen(name, "r");
 		if (in)
 			goto load;
 		sym_add_change_count(1);