From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: "Simone Weiß" <simone.p.weiss@posteo.com>,
"bitbake-devel@lists.openembedded.org"
<bitbake-devel@lists.openembedded.org>
Subject: RE: [bitbake-devel] [PATCH v2] bitbake-layers: add/remove option to not use tinfoil
Date: Thu, 28 Mar 2024 14:01:41 +0000 [thread overview]
Message-ID: <DB5PR02MB10213D6FA0DDCA0F41E779385EF3B2@DB5PR02MB10213.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <20240327195409.8095-1-simone.p.weiss@posteo.com>
> -----Original Message-----
> From: bitbake-devel@lists.openembedded.org <bitbake-devel@lists.openembedded.org> On Behalf Of Simone Weiß
> Sent: den 27 mars 2024 20:54
> To: bitbake-devel@lists.openembedded.org
> Cc: Simone Weiß <simone.p.weiss@posteo.com>
> Subject: [bitbake-devel] [PATCH v2] bitbake-layers: add/remove option to not use tinfoil
>
> From: Simone Weiß <simone.p.weiss@posteo.com>
>
> Fixes [YOCTO #15417]
>
> When a layer adds a new dependency after it was added to a conf, it can not be
> removed w/o this dependency in the setup. Even the dependent layer can not be
> added, as the tinfoil setup will fail.
> Add an option to not perform the tinfoil at all, the use will be at own risk,
> i.e. the added layers might not parse properly afterwards.
>
> Signed-off-by: Simone Weiß <simone.p.weiss@posteo.com>
> ---
> v2: Rename option to be more meaningful.
> bin/bitbake-layers | 14 ++++++++++----
> lib/bblayers/action.py | 6 ++++--
> 2 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/bin/bitbake-layers b/bin/bitbake-layers
> index d4b1d1aa..f7ed5ce0 100755
> --- a/bin/bitbake-layers
> +++ b/bin/bitbake-layers
> @@ -34,6 +34,7 @@ def main():
> parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
> parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
> parser.add_argument('-F', '--force', help='Force add without recipe parse verification', action='store_true')
> + parser.add_argument('-S', '--skip_parse_tests', help='Force run without parsing the layers, this might cause later failures.', action='store_true')
Does this really need a separate option? Can't the functionality be folded
into the already existing -F option? Typically, as a user, if I want to make
sure a layer is added no matter what, I would look for an option to force it.
And when I find -F, I would look no further.
> parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
>
> global_args, unparsed_args = parser.parse_known_args()
> @@ -59,16 +60,21 @@ def main():
> plugins = []
> tinfoil = bb.tinfoil.Tinfoil(tracking=True)
> tinfoil.logger.setLevel(logger.getEffectiveLevel())
> - try:
> + if global_args.skip_parse_tests:
> + bbpath_string = []
> + else:
> tinfoil.prepare(True)
> - for path in ([topdir] +
> - tinfoil.config_data.getVar('BBPATH').split(':')):
> + bbpath_string = tinfoil.config_data.getVar('BBPATH').split(':')
Odd variable name, given that it is not a string but a list. I would
call it "bbpaths" instead.
> + print(bbpath_string)
This looks like a debug leftover...
> +
> + try:
> + for path in ([topdir] + bbpath_string):
> pluginpath = os.path.join(path, 'lib', 'bblayers')
> bb.utils.load_plugins(logger, plugins, pluginpath)
>
> registered = False
> for plugin in plugins:
> - if hasattr(plugin, 'tinfoil_init'):
> + if hasattr(plugin, 'tinfoil_init') and not global_args.skip_parse_tests:
> plugin.tinfoil_init(tinfoil)
> if hasattr(plugin, 'register_commands'):
> registered = True
> diff --git a/lib/bblayers/action.py b/lib/bblayers/action.py
> index a8f26993..5aecc452 100644
> --- a/lib/bblayers/action.py
> +++ b/lib/bblayers/action.py
> @@ -50,8 +50,8 @@ class ActionPlugin(LayerPlugin):
>
> try:
> notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None)
> - self.tinfoil.modified_files()
> - if not (args.force or notadded):
> + if not (args.force or notadded or args.skip_parse_tests):
> + self.tinfoil.modified_files()
> try:
> self.tinfoil.run_command('parseConfiguration')
> except (bb.tinfoil.TinfoilUIException, bb.BBHandledException):
> @@ -83,6 +83,8 @@ class ActionPlugin(LayerPlugin):
> layerdir = os.path.abspath(item)
> layerdirs.append(layerdir)
> (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs)
> + if args.skip_parse_tests:
> + return 0
> self.tinfoil.modified_files()
> if notremoved:
> for item in notremoved:
> --
> 2.39.2
//Peter
prev parent reply other threads:[~2024-03-28 14:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 19:54 [PATCH v2] bitbake-layers: add/remove option to not use tinfoil simone.p.weiss
2024-03-28 14:01 ` Peter Kjellerstedt [this message]
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=DB5PR02MB10213D6FA0DDCA0F41E779385EF3B2@DB5PR02MB10213.eurprd02.prod.outlook.com \
--to=peter.kjellerstedt@axis.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=simone.p.weiss@posteo.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).