From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 941CFC4332F for ; Thu, 20 Oct 2022 10:05:35 +0000 (UTC) Received: from smtp-fw-6001.amazon.com (smtp-fw-6001.amazon.com [52.95.48.154]) by mx.groups.io with SMTP id smtpd.web10.7928.1666260327963236465 for ; Thu, 20 Oct 2022 03:05:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=ihp0wgRm; spf=pass (domain: amazon.de, ip: 52.95.48.154, mailfrom: prvs=2853493d9=throos@amazon.de) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1666260331; x=1697796331; h=from:to:cc:date:message-id:references:in-reply-to: mime-version:subject; bh=sEX3jCnkH24bMlCIF2uecv0khuzrRTiN7et2c9D2fjw=; b=ihp0wgRmwZt7W5aNNVdbU8DW2fdZnnrK8SdTIZb2gc3smZ69IjAqPOhY hvB3PgY139+EI2LvkGq3HBf5AO3tmJEHqf8fyi72ra2hEPs8+7kXWTjYe 4ILR3agsvDKUT62M41Ig4v4NVz01ziAVqhQZzsVjwCAthxawAUqmZ8JE7 Q=; Subject: AW: [yocto] devtool upgrade for go recipes with git "broken" Thread-Topic: [yocto] devtool upgrade for go recipes with git "broken" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-pdx-2a-m6i4x-21d8d9f4.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-6001.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 10:05:25 +0000 Received: from EX13D08EUC002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2a-m6i4x-21d8d9f4.us-west-2.amazon.com (Postfix) with ESMTPS id ED7BF36D5B7; Thu, 20 Oct 2022 10:05:22 +0000 (UTC) Received: from EX19D016EUC003.ant.amazon.com (10.252.51.244) by EX13D08EUC002.ant.amazon.com (10.43.164.124) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 20 Oct 2022 10:05:21 +0000 Received: from EX19D016EUC001.ant.amazon.com (10.252.51.169) by EX19D016EUC003.ant.amazon.com (10.252.51.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.15; Thu, 20 Oct 2022 10:05:21 +0000 Received: from EX19D016EUC001.ant.amazon.com ([fe80::997f:8b89:37cd:3dc9]) by EX19D016EUC001.ant.amazon.com ([fe80::997f:8b89:37cd:3dc9%3]) with mapi id 15.02.1118.015; Thu, 20 Oct 2022 10:05:21 +0000 From: "Roos, Thomas" To: Alexander Kanavin CC: "yocto@lists.yoctoproject.org" Thread-Index: AQHY5GTr5j5Nvf1ZnEq1HtJaEKftBq4XBOiAgAAEheqAAAJSAIAAAOzQ Date: Thu, 20 Oct 2022 10:05:21 +0000 Message-ID: References: <1028eccc021a4bf5ab2520b3c4fb82a6@amazon.de> <28ffce86de204ea6969c325b97506001@amazon.de>, In-Reply-To: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.43.164.90] Content-Type: multipart/alternative; boundary="_000_a79184da26314c388bc4733b516e47a5amazonde_" MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 20 Oct 2022 10:05:35 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/58376 --_000_a79184da26314c388bc4733b516e47a5amazonde_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable yes, I already did this - it's because that go.bbclass is spangly using a s= ubdir called "src" and that will break the devtool check for upgrades mecha= nism because it's not looking into a src subdir. So git will fail checkout = anything in the parent dir "reference is not a tree" This simple change in the go.bbclass fix it - but I don't know if that addi= tional src dir is somehow necessary: # src folder will break devtool upgrade python go_do_unpack() { src_uri =3D (d.getVar('SRC_URI') or "").split() if len(src_uri) =3D=3D 0: return fetcher =3D bb.fetch2.Fetch(src_uri, d) for url in fetcher.urls: if fetcher.ud[url].type =3D=3D 'git': if fetcher.ud[url].parm.get('destsuffix') is None: s_dirname =3D os.path.basename(d.getVar('S')) #cause problems fetcher.ud[url].parm['destsuffix'] =3D os.pa= th.join(s_dirname, 'src', d.getVar('GO_IMPORT')) + '/' #FIX fetcher.ud[url].parm['destsuffix'] =3D os.path.join(s_dirna= me, '', d.getVar('GO_IMPORT')) + '/' #FIX fetcher.unpack(d.getVar('WORKDIR')) } # src folder will break devtool upgrade go_do_configure() { #cause problems ln -snf ${S}/src ${B}/ #FIX ln -snf ${S} ${B}/ #FIX } ________________________________ Von: Alexander Kanavin Gesendet: Donnerstag, 20. Oktober 2022 11:56:48 An: Roos, Thomas Cc: yocto@lists.yoctoproject.org Betreff: RE: [EXTERNAL][yocto] devtool upgrade for go recipes with git "bro= ken" CAUTION: This email originated from outside of the organization. Do not cli= ck links or open attachments unless you can confirm the sender and know the= content is safe. Thanks, I do not have a quick answer to this, but would appreciate if you can dig deeper into the issue. Alex On Thu, 20 Oct 2022 at 11:50, Roos, Thomas wrote: > > yes, easy > - set the go-helloworld bb srcrev to an older rev - e.g: > SRCREV =3D "ad95e7f791d8e1e7e7ec7f7cedfc2f6b29f6c9e2" > > "devtool upgrade go-helloworld" > > INFO: Extracting upgraded version source... > Traceback (most recent call last): > File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upgrade.py", line 567= , in upgrade > rev2, md5, sha256, srcbranch, srcsubdir2 =3D _extract_new_source(args= .version, srctree, args.no_patch, > File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upgrade.py", line 183= , in _extract_new_source > __run('git checkout %s' % rev) > File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upgrade.py", line 170= , in __run > return _run(cmd, srctree) > File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upgrade.py", line 31,= in _run > return bb.process.run('%s' % cmd, cwd=3Dcwd) > File "/home/ubuntu/yocto/poky/bitbake/lib/bb/process.py", line 189, in = run > raise ExecutionError(cmd, pipe.returncode, stdout, stderr) > bb.process.ExecutionError: Execution of 'git checkout 2e68773dfca072cb81f= 219fc3b97ad34fe9d9f94' failed with exit code 128: > fatal: reference is not a tree: 2e68773dfca072cb81f219fc3b97ad34fe9d9f94 > > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/home/ubuntu/yocto/poky/scripts/devtool", line 338, in > ret =3D main() > File "/home/ubuntu/yocto/poky/scripts/devtool", line 325, in main > ret =3D args.func(args, config, basepath, workspace) > File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upgrade.py", line 575= , in upgrade > _upgrade_error(e, recipedir, srctree, args.keep_failure) > File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upgrade.py", line 134= , in _upgrade_error > _cleanup_on_error(rd, srctree) > File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upgrade.py", line 126= , in _cleanup_on_error > if not len(os.listdir(rdp)): > FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/yoc= to/build/workspace/recipes' > > > > > > ________________________________ > Von: Alexander Kanavin > Gesendet: Donnerstag, 20. Oktober 2022 11:32:19 > An: Roos, Thomas > Cc: yocto@lists.yoctoproject.org > Betreff: RE: [EXTERNAL][yocto] devtool upgrade for go recipes with git "b= roken" > > CAUTION: This email originated from outside of the organization. Do not c= lick links or open attachments unless you can confirm the sender and know t= he content is safe. > > > > It helps if you show the exact error, and a way to reproduce this > using a minimal setup (ideally only poky). > > Alex > > On Thu, 20 Oct 2022 at 11:18, Thomas Roos via lists.yoctoproject.org > wrote: > > > > Hi, > > when doing a "devtool upgrade" for a recipe which inherits "go" and usi= ng a SRC_URI to a git repo this will fail. Complaining that the git revisio= n is "out of tree" - I found that the additional "src" folder inside the ch= eckout out sources is causing this problem and I wondering if this is neces= sary. I'm not a go programmer, but when changing this the recipe seems to p= roduce the same result. > > I did change our go recipe to don't use this additional src folder by o= verwriting the go_do_upack and go_do_configure method. Here: https://github= .com/aws4embeddedlinux/meta-aws/blob/942651026c7a91b9703609d7658bd1649350ac= af/recipes-support/amazon-ssm-agent/amazon-ssm-agent_3.1.1856.0.bb > > Is this a bug or do anybody know why go use that additional src folder? > > > > > > Cheers, > > Thomas > > > > > > > > > > Amazon Web Services EMEA SARL > > 38 avenue John F. Kennedy, L-1855 Luxembourg > > Sitz der Gesellschaft: L-1855 Luxemburg > > eingetragen im Luxemburgischen Handelsregister unter R.C.S. B186284 > > > > Amazon Web Services EMEA SARL, Niederlassung Deutschland > > Marcel-Breuer-Str. 12, D-80807 Muenchen > > Sitz der Zweigniederlassung: Muenchen > > eingetragen im Handelsregister des Amtsgerichts Muenchen unter HRB 2422= 40, USt-ID DE317013094 > > > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > Links: You receive all messages sent to this group. > > View/Reply Online (#58372): https://lists.yoctoproject.org/g/yocto/mess= age/58372 > > Mute This Topic: https://lists.yoctoproject.org/mt/94449982/1686489 > > Group Owner: yocto+owner@lists.yoctoproject.org > > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kanavin= @gmail.com] > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > > > > > > Amazon Web Services EMEA SARL > 38 avenue John F. Kennedy, L-1855 Luxembourg > Sitz der Gesellschaft: L-1855 Luxemburg > eingetragen im Luxemburgischen Handelsregister unter R.C.S. B186284 > > Amazon Web Services EMEA SARL, Niederlassung Deutschland > Marcel-Breuer-Str. 12, D-80807 Muenchen > Sitz der Zweigniederlassung: Muenchen > eingetragen im Handelsregister des Amtsgerichts Muenchen unter HRB 242240= , USt-ID DE317013094 > > Amazon Web Services EMEA SARL 38 avenue John F. Kennedy, L-1855 Luxembourg Sitz der Gesellschaft: L-1855 Luxemburg eingetragen im Luxemburgischen Handelsregister unter R.C.S. B186284 Amazon Web Services EMEA SARL, Niederlassung Deutschland Marcel-Breuer-Str. 12, D-80807 Muenchen Sitz der Zweigniederlassung: Muenchen eingetragen im Handelsregister des Amtsgerichts Muenchen unter HRB 242240, = USt-ID DE317013094 --_000_a79184da26314c388bc4733b516e47a5amazonde_ Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable

yes, I already did this - it's because that go.bbclass is spangly using = a subdir called "src" and that will break the devtool check for u= pgrades mechanism because it's not looking into a src subdir. So git will f= ail checkout anything in the parent dir "reference is not a tree"

This simple change in the go.bbclass fix it - but I don't know if that addi= tional src dir is somehow necessary:


# src folder will break devtool upgrade
python go_do_unpack() {
    src_uri =3D (d.getVar('SRC_URI') or "").split(= )
    if len(src_uri) =3D=3D 0:
        return

    fetcher =3D bb.fetch2.Fetch(src_uri, d)
    for url in fetcher.urls:
        if fetcher.ud[url].type =3D=3D '= git':
            if fetch= er.ud[url].parm.get('destsuffix') is None:
            &nb= sp;   s_dirname =3D os.path.basename(d.getVar('S'))
#cause problems           = ;     fetcher.ud[url].parm['destsuffix'] =3D os.path.jo= in(s_dirname, 'src', d.getVar('GO_IMPORT')) + '/'
#FIX
            &nb= sp;   fetcher.ud[url].parm['destsuffix'] =3D os.path.join(s_dirna= me, '', d.getVar('GO_IMPORT')) + '/'
#FIX
    fetcher.unpack(d.getVar('WORKDIR'))
}

# src folder will break devtool upgrade
go_do_configure() {
#cause problems      ln -snf ${S}/src ${B}/
#FIX
    ln -snf ${S} ${B}/
#FIX
}



Von: Alexander Kanavin &l= t;alex.kanavin@gmail.com>
Gesendet: Donnerstag, 20. Oktober 2022 11:56:48
An: Roos, Thomas
Cc: yocto@lists.yoctoproject.org
Betreff: RE: [EXTERNAL][yocto] devtool upgrade for go recipes with g= it "broken"
 
CAUTION: This email originated from outside of the= organization. Do not click links or open attachments unless you can confir= m the sender and know the content is safe.



Thanks, I do not have a quick answer to this, but would appreciate if
you can dig deeper into the issue.

Alex

On Thu, 20 Oct 2022 at 11:50, Roos, Thomas <throos@amazon.de> wrote:<= br> >
> yes, easy
> - set the go-helloworld bb srcrev to an older rev - e.g:
> SRCREV =3D "ad95e7f791d8e1e7e7ec7f7cedfc2f6b29f6c9e2"
>
> "devtool upgrade go-helloworld"
>
> INFO: Extracting upgraded version source...
> Traceback (most recent call last):
>   File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upg= rade.py", line 567, in upgrade
>     rev2, md5, sha256, srcbranch, srcsubdir2 =3D _= extract_new_source(args.version, srctree, args.no_patch,
>   File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upg= rade.py", line 183, in _extract_new_source
>     __run('git checkout %s' % rev)
>   File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upg= rade.py", line 170, in __run
>     return _run(cmd, srctree)
>   File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upg= rade.py", line 31, in _run
>     return bb.process.run('%s' % cmd, cwd=3Dcwd) >   File "/home/ubuntu/yocto/poky/bitbake/lib/bb/process.= py", line 189, in run
>     raise ExecutionError(cmd, pipe.returncode, std= out, stderr)
> bb.process.ExecutionError: Execution of 'git checkout 2e68773dfca072cb= 81f219fc3b97ad34fe9d9f94' failed with exit code 128:
> fatal: reference is not a tree: 2e68773dfca072cb81f219fc3b97ad34fe9d9f= 94
>
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/home/ubuntu/yocto/poky/scripts/devtool", = line 338, in <module>
>     ret =3D main()
>   File "/home/ubuntu/yocto/poky/scripts/devtool", = line 325, in main
>     ret =3D args.func(args, config, basepath, work= space)
>   File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upg= rade.py", line 575, in upgrade
>     _upgrade_error(e, recipedir, srctree, args.kee= p_failure)
>   File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upg= rade.py", line 134, in _upgrade_error
>     _cleanup_on_error(rd, srctree)
>   File "/home/ubuntu/yocto/poky/scripts/lib/devtool/upg= rade.py", line 126, in _cleanup_on_error
>     if not len(os.listdir(rdp)):
> FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/= yocto/build/workspace/recipes'
>
>
>
>
>
> ________________________________
> Von: Alexander Kanavin <alex.kanavin@gmail.com>
> Gesendet: Donnerstag, 20. Oktober 2022 11:32:19
> An: Roos, Thomas
> Cc: yocto@lists.yoctoproject.org
> Betreff: RE: [EXTERNAL][yocto] devtool upgrade for go recipes with git= "broken"
>
> CAUTION: This email originated from outside of the organization. Do no= t click links or open attachments unless you can confirm the sender and kno= w the content is safe.
>
>
>
> It helps if you show the exact error, and a way to reproduce this
> using a minimal setup (ideally only poky).
>
> Alex
>
> On Thu, 20 Oct 2022 at 11:18, Thomas Roos via lists.yoctoproject.org > <throos=3Damazon.de@lists.yoctoproject.org> wrote:
> >
> > Hi,
> > when doing a "devtool upgrade" for a recipe which inher= its "go" and using a SRC_URI to a git repo this will fail. Compla= ining that the git revision is "out of tree" - I found that the a= dditional "src" folder inside the checkout out sources is causing= this problem and I wondering if this is necessary. I'm not a go programmer, but= when changing this the recipe seems to produce the same result.
> > I did change our go recipe to don't use this additional src folde= r by overwriting the go_do_upack and go_do_configure method. Here: https://github.com/aws4embeddedlinux/meta-aws/blob/942651026c7a91b9703609d7= 658bd1649350acaf/recipes-support/amazon-ssm-agent/amazon-ssm-agent_3.1.1856= .0.bb
> > Is this a bug or do anybody know why go use that additional src f= older?
> >
> >
> > Cheers,
> > Thomas
> >
> >
> >
> >
> > Amazon Web Services EMEA SARL
> > 38 avenue John F. Kennedy, L-1855 Luxembourg
> > Sitz der Gesellschaft: L-1855 Luxemburg
> > eingetragen im Luxemburgischen Handelsregister unter R.C.S. B1862= 84
> >
> > Amazon Web Services EMEA SARL, Niederlassung Deutschland
> > Marcel-Breuer-Str. 12, D-80807 Muenchen
> > Sitz der Zweigniederlassung: Muenchen
> > eingetragen im Handelsregister des Amtsgerichts Muenchen unter HR= B 242240, USt-ID DE317013094
> >
> >
> >
> > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#58372): https://lists.yoctoproject.org/g/yocto/message/58372
> > Mute This Topic: https://lists.yoctoproject.org/mt/94449982/1686489
> > Group Owner: yocto+owner@lists.yoctoproject.org
> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kanavin@gmail.c= om]
> > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
> >
>
>
>
> Amazon Web Services EMEA SARL
> 38 avenue John F. Kennedy, L-1855 Luxembourg
> Sitz der Gesellschaft: L-1855 Luxemburg
> eingetragen im Luxemburgischen Handelsregister unter R.C.S. B186284
>
> Amazon Web Services EMEA SARL, Niederlassung Deutschland
> Marcel-Breuer-Str. 12, D-80807 Muenchen
> Sitz der Zweigniederlassung: Muenchen
> eingetragen im Handelsregister des Amtsgerichts Muenchen unter HRB 242= 240, USt-ID DE317013094
>
>



Amazon Web Services EMEA SARL
38 avenue John F. Kennedy, L-1855 Luxembourg
Sitz der Gesellschaft: L-1855 Luxemburg
eingetragen im Luxemburgischen Handelsregister unter R.C.S. B186284

Amazon Web Services EMEA SARL, Niederlassung Deutschland
Marcel-Breuer-Str. 12, D-80807 Muenchen
Sitz der Zweigniederlassung: Muenchen
eingetragen im Handelsregister des Amtsgerichts Muenchen unter HRB 2422= 40, USt-ID DE317013094


--_000_a79184da26314c388bc4733b516e47a5amazonde_--