Hello Alex,

On Wed, Dec 6, 2023 at 11:08 AM Alexander Kanavin
<alex.kana...@gmail.com> wrote:
>
> Unfortunately I have to say no to this. The problem is that this will
> update to latest revisions on all the layers, which I believe is not
> what people would want, as everything including poky etc. will be
> shifting uncontrollably.

Correct, and that is exactly the reason why this mechanism is only
offered via additional switch. If it is not supplied - then behavior is
exactly the same, and this is intended. Only those users who would
really like to exercise the shift would use it.

I've also prepared a patch for documenting this switch, but held it back
until the functionality is in. There I do explain the case for CI systems
which would want to capture updated setup of all layers in collection.

>
> Conceptually, I would not want oe-setup-layers to suffer from feature
> creep and become bloated and difficult to maintain. Every little
> enhancement is pushing in that direction. It has a json, it does what
> the json prescribes, end of story.

In this regard I think that json prescription is too strict.

While this totally suites the needs and purpose of passing over the layer
setup to any other client, it really limits the usability of setup-layers only
to that specific case. If this was originally an intended design, then
perhaps a note in documentation would be needed.

>
> We've previously discussed with Jermain how this can be solved on the
> bitbake-layers side, e.g. that tool would write out a json where some
> layers don't have a hardcoded revision. I think work to implement that
> has stalled, not sure. But it's not difficult to add.

Is there any mail thread or patch stack where this has been discussed?

I would like to take a look at what was proposed and perhaps re-use and
re-establish that part instead.

Thanks a lot!

>
> Alex
>
>
>
> On Wed, 6 Dec 2023 at 10:25, Andrey Zhizhikin <andre...@gmail.com> wrote:
> >
> > Current script implementation uses revisions recorded in JSON file to
> > replicate previously recorded setup. While this is useful for complete
> > layer setup reproducibility, this does not allow the setup "upgrade" where
> > this script can be used to use remote branch information and latest HEAD,
> > have the setup restored, and then saved using updated revisions.
> >
> > Add new '--skip-revs' parameter which can be used to obtain the updated
> > layer setup.
> >
> > Following set of operations could be executed to achieve this:
> > 1. Restore initial layer setup using remote branch HEAD instead of recorded
> >    revisions by specifying --skip-revs.
> > 2. After layer setup is created, JSON file containing updated revisions is
> >    retrieved via `bitbake-layers create-layers-setup`
> > 3. Updated JSON file can be checked in to bootstrap repository and used
> >    later without '--skip-revs' to replicated updated setup.
> >
> > Signed-off-by: Andrey Zhizhikin <andre...@gmail.com>
> > ---
> >  scripts/oe-setup-layers | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/scripts/oe-setup-layers b/scripts/oe-setup-layers
> > index 6d49688a32..a4941450d3 100755
> > --- a/scripts/oe-setup-layers
> > +++ b/scripts/oe-setup-layers
> > @@ -69,6 +69,13 @@ def _do_checkout(args, json):
> >          remotes = r_remote['remotes']
> >
> >          print('\nSetting up source {}, revision {}, branch 
> > {}'.format(r_name, desc, branch))
> > +        if args['skip_revs']:
> > +            if branch and (branch != 'HEAD'):
> > +                print('\nSkip revision option used, remote {} branch {} 
> > HEAD will be used instead of {}'.format(r_name, branch, rev))
> > +                rev = branch
> > +            else:
> > +                print('\nBranch info is missing in json, --skip-revs 
> > option is not used')
> > +
> >          if not _is_repo_git_repo(repodir):
> >              cmd = 'git init -q {}'.format(repodir)
> >              print("Running '{}'".format(cmd))
> > @@ -108,6 +115,7 @@ except subprocess.CalledProcessError as e:
> >
> >  parser.add_argument('--destdir', default=defaultdest, help='Where to check 
> > out the layers (default is {defaultdest}).'.format(defaultdest=defaultdest))
> >  parser.add_argument('--jsondata', default=__file__+".json", help='File 
> > containing the layer data in json format (default is 
> > {defaultjson}).'.format(defaultjson=__file__+".json"))
> > +parser.add_argument('--skip-revs', action='store_true', help='Skip 
> > revisions recorded in json manifest, and use latest revision on branch to 
> > restore setup')
> >
> >  args = parser.parse_args()
> >
> > --
> > 2.34.1
> >
> >
> > 
> >



-- 
Regards,
Andrey.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191883): 
https://lists.openembedded.org/g/openembedded-core/message/191883
Mute This Topic: https://lists.openembedded.org/mt/103009912/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to