* [PATCH] cookerdata.py: check for existence of configuration files
@ 2017-01-12 23:40 Juro Bystricky
2017-01-13 10:54 ` Richard Purdie
0 siblings, 1 reply; 5+ messages in thread
From: Juro Bystricky @ 2017-01-12 23:40 UTC (permalink / raw)
To: bitbake-devel; +Cc: jurobystricky
Presently there is no check to verify the existence of configuration
files as listed in BBMULTICONFIG. For example, BBMULTICONFIG = "foobar" in local.conf
does not trigger an error when there is no conf/multiconfig/foobar.conf.
The missing file is silently ignored.
This patch verifies the existence of config files and errors-out with the message:
ERROR: BBMULTICONFIG="foobar" but the configuration file './conf/multiconfig/foobar.conf' does not exist!
when the file does not exist.
[YOCTO#10917]
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
---
bitbake/lib/bb/cookerdata.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index d9eab56..bb1e2c3 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -289,6 +289,12 @@ class CookerDataBuilder(object):
multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split()
for config in multiconfig:
+ if config != "":
+ src = "./conf/multiconfig/" + config + ".conf"
+ if not os.access(src, os.R_OK):
+ parselog.critical("BBMULTICONFIG=\"%s\" but the configuration file '%s' does not exist! " % (self.data.getVar("BBMULTICONFIG"),src))
+ sys.exit(1)
+
mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config)
bb.event.fire(bb.event.ConfigParsed(), mcdata)
self.mcdata[config] = mcdata
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] cookerdata.py: check for existence of configuration files
2017-01-12 23:40 [PATCH] cookerdata.py: check for existence of configuration files Juro Bystricky
@ 2017-01-13 10:54 ` Richard Purdie
2017-01-13 17:01 ` Bystricky, Juro
0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2017-01-13 10:54 UTC (permalink / raw)
To: Juro Bystricky, bitbake-devel; +Cc: jurobystricky
On Thu, 2017-01-12 at 15:40 -0800, Juro Bystricky wrote:
> Presently there is no check to verify the existence of configuration
> files as listed in BBMULTICONFIG. For example, BBMULTICONFIG =
> "foobar" in local.conf
> does not trigger an error when there is no
> conf/multiconfig/foobar.conf.
> The missing file is silently ignored.
>
> This patch verifies the existence of config files and errors-out with
> the message:
>
> ERROR: BBMULTICONFIG="foobar" but the configuration file
> './conf/multiconfig/foobar.conf' does not exist!
>
> when the file does not exist.
>
> [YOCTO#10917]
Sorry but we can't do this. One reason for some of the recent changes
was to move the handling of this to the metadata and out of bitbake.
We've therefore now got:
include conf/multiconfig/${BB_CURRENT_MC}.conf
in bitbake.conf and the system looks for the file that way. The user is
free to add other files in other paths and bitbake doesn't know/care
about the directory layout.
If we really want to make this error, we'd need to add an empty
conf/multiconfig/default.conf and then change this to a require instead
of an include. Bitbake's standard error messages would then kick in.
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cookerdata.py: check for existence of configuration files
2017-01-13 10:54 ` Richard Purdie
@ 2017-01-13 17:01 ` Bystricky, Juro
2017-01-13 17:06 ` Richard Purdie
0 siblings, 1 reply; 5+ messages in thread
From: Bystricky, Juro @ 2017-01-13 17:01 UTC (permalink / raw)
To: Richard Purdie, bitbake-devel@lists.openembedded.org
Cc: jurobystricky@hotmail.com
I see your point. The route via a dummy default.conf would require having
the folder conf/multiconfig present even for users not really interested in
multiconfig. Not a show stopper, it would be just another file created by
oe-init-build-env. (Another possibility is to have the error check as part
of sanity checking)
> -----Original Message-----
> From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org]
> Sent: Friday, January 13, 2017 2:55 AM
> To: Bystricky, Juro <juro.bystricky@intel.com>; bitbake-
> devel@lists.openembedded.org
> Cc: jurobystricky@hotmail.com
> Subject: Re: [PATCH] cookerdata.py: check for existence of configuration
> files
>
> On Thu, 2017-01-12 at 15:40 -0800, Juro Bystricky wrote:
> > Presently there is no check to verify the existence of configuration
> > files as listed in BBMULTICONFIG. For example, BBMULTICONFIG =
> > "foobar" in local.conf
> > does not trigger an error when there is no
> > conf/multiconfig/foobar.conf.
> > The missing file is silently ignored.
> >
> > This patch verifies the existence of config files and errors-out with
> > the message:
> >
> > ERROR: BBMULTICONFIG="foobar" but the configuration file
> > './conf/multiconfig/foobar.conf' does not exist!
> >
> > when the file does not exist.
> >
> > [YOCTO#10917]
>
> Sorry but we can't do this. One reason for some of the recent changes
> was to move the handling of this to the metadata and out of bitbake.
> We've therefore now got:
>
> include conf/multiconfig/${BB_CURRENT_MC}.conf
>
> in bitbake.conf and the system looks for the file that way. The user is
> free to add other files in other paths and bitbake doesn't know/care
> about the directory layout.
>
> If we really want to make this error, we'd need to add an empty
> conf/multiconfig/default.conf and then change this to a require instead
> of an include. Bitbake's standard error messages would then kick in.
>
> Cheers,
>
> Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cookerdata.py: check for existence of configuration files
2017-01-13 17:01 ` Bystricky, Juro
@ 2017-01-13 17:06 ` Richard Purdie
2017-01-13 17:08 ` Bystricky, Juro
0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2017-01-13 17:06 UTC (permalink / raw)
To: Bystricky, Juro, bitbake-devel@lists.openembedded.org
Cc: jurobystricky@hotmail.com
On Fri, 2017-01-13 at 17:01 +0000, Bystricky, Juro wrote:
> I see your point. The route via a dummy default.conf would require
> having
> the folder conf/multiconfig present even for users not really
> interested in
> multiconfig. Not a show stopper, it would be just another file
> created by
> oe-init-build-env. (Another possibility is to have the error check as
> part
> of sanity checking)
We can put this in meta/conf/mulitconfig, it doesn't have to be in the
build directory.
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cookerdata.py: check for existence of configuration files
2017-01-13 17:06 ` Richard Purdie
@ 2017-01-13 17:08 ` Bystricky, Juro
0 siblings, 0 replies; 5+ messages in thread
From: Bystricky, Juro @ 2017-01-13 17:08 UTC (permalink / raw)
To: Richard Purdie, bitbake-devel@lists.openembedded.org
Cc: jurobystricky@hotmail.com
All right, I'll get on it then...
> -----Original Message-----
> From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org]
> Sent: Friday, January 13, 2017 9:06 AM
> To: Bystricky, Juro <juro.bystricky@intel.com>; bitbake-
> devel@lists.openembedded.org
> Cc: jurobystricky@hotmail.com
> Subject: Re: [PATCH] cookerdata.py: check for existence of configuration
> files
>
> On Fri, 2017-01-13 at 17:01 +0000, Bystricky, Juro wrote:
> > I see your point. The route via a dummy default.conf would require
> > having
> > the folder conf/multiconfig present even for users not really
> > interested in
> > multiconfig. Not a show stopper, it would be just another file
> > created by
> > oe-init-build-env. (Another possibility is to have the error check as
> > part
> > of sanity checking)
>
> We can put this in meta/conf/mulitconfig, it doesn't have to be in the
> build directory.
>
> Cheers,
>
> Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-01-13 17:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 23:40 [PATCH] cookerdata.py: check for existence of configuration files Juro Bystricky
2017-01-13 10:54 ` Richard Purdie
2017-01-13 17:01 ` Bystricky, Juro
2017-01-13 17:06 ` Richard Purdie
2017-01-13 17:08 ` Bystricky, Juro
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.