From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6995453036489342976 Date: Thu, 12 Aug 2021 02:18:36 -0700 (PDT) From: Uladzimir Bely To: isar-users Message-Id: <81c0fa46-a359-47bd-bed7-866671649c96n@googlegroups.com> In-Reply-To: References: <20210812081030.4505-1-ubely@ilbers.de> <20210812081030.4505-2-ubely@ilbers.de> Subject: Re: [RFC 1/2] dpkg-base: Add new git alternates record instead of replace old one MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2026_1561017106.1628759916303" X-TUID: G7zapKbMycX0 ------=_Part_2026_1561017106.1628759916303 Content-Type: multipart/alternative; boundary="----=_Part_2027_250623735.1628759916303" ------=_Part_2027_250623735.1628759916303 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yes, git still shows the message a currently invalid alternate (one of two= =20 records), but it's able to work further (reset --hard, etc). But I can agree that this way could be unacceptable due this error message. =D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0=B3, 12 =D0=B0=D0=B2=D0=B3=D1=83=D1= =81=D1=82=D0=B0 2021 =D0=B3. =D0=B2 12:00:58 UTC+3, Jan Kiszka:=20 > On 12.08.21 10:10, Uladzimir Bely wrote: > > Task adjust_git modifies git alternates by replacing DL_DIR to=20 > /downloads. > > New path is used inside buildchroot, so that working git repo > > becomes broken outside buildchroot. > >=20 > > This causes problems with rebuilding such packages as cowsay if somethi= ng > > has changed in bitbake environment since previous build: > >=20 > > ERROR: > > mc:qemuarm64-buster:cowsay-git-r0 do_patch: Command Error: 'sh -c 'git > > --work-tree=3D/path/build/tmp/work/debian-buster-arm64/cowsay/git-r0/gi= t > > reset --hard HEAD'' exited with 0 > >=20 > > The solution is to add new path to git alternates so that original path > > will work outside buildchroot, and new one will work in buildchroot. > >=20 > > Signed-off-by: Uladzimir Bely > > --- > > meta/classes/dpkg-base.bbclass | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/meta/classes/dpkg-base.bbclass=20 > b/meta/classes/dpkg-base.bbclass > > index ec8fbc1..4b9b782 100644 > > --- a/meta/classes/dpkg-base.bbclass > > +++ b/meta/classes/dpkg-base.bbclass > > @@ -46,7 +46,7 @@ python do_adjust_git() { > >=20 > > if os.path.exists(alternates): > > cmd =3D ["sed", "-i", alternates, "-e", > > - "s|{}|/downloads|".format(d.getVar("DL_DIR"))] > > + "s|\({}\(.*\)\)|\\1\\n/downloads\\2|".format(d.getVar("DL_DIR"))] > > bb.note(' '.join(cmd)) > > if subprocess.call(cmd) !=3D 0: > > bb.fatal("git alternates adjustment failed") > >=20 > > This doesn'tt work, already tried: git fails if just one record is not > working. > > Jan > > --=20 > Siemens AG, T RDA IOT > Corporate Competence Center Embedded Linux > ------=_Part_2027_250623735.1628759916303 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Yes, git still shows the message a currently invalid alternate (one of= two records), but it's able to work further (reset --hard, etc).

But I can agree that this way could be un= acceptable due this error message.

=D1=87=D0=B5=D1= =82=D0=B2=D0=B5=D1=80=D0=B3, 12 =D0=B0=D0=B2=D0=B3=D1=83=D1=81=D1=82=D0=B0 = 2021 =D0=B3. =D0=B2 12:00:58 UTC+3, Jan Kiszka:
On 12.08.21 10:10, Uladzimir Bely wrote= :
> Task adjust_git modifies git alternates by replacing DL_DIR to /do= wnloads.
> New path is used inside buildchroot, so that working git repo
> becomes broken outside buildchroot.
>=20
> This causes problems with rebuilding such packages as cowsay if so= mething
> has changed in bitbake environment since previous build:
>=20
> ERROR:
> mc:qemuarm64-buster:cowsay-git-r0 do_patch: Command Error: '= sh -c 'git
> --work-tree=3D/path/build/tmp/work/debian-buster-arm64/cowsay/gi= t-r0/git
> reset --hard HEAD'' exited with 0
>=20
> The solution is to add new path to git alternates so that original= path
> will work outside buildchroot, and new one will work in buildchroo= t.
>=20
> Signed-off-by: Uladzimir Bely <ub...@ilbers.de>
> ---
> meta/classes/dpkg-base.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-ba= se.bbclass
> index ec8fbc1..4b9b782 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -46,7 +46,7 @@ python do_adjust_git() {
> =20
> if os.path.exists(alternates):
> cmd =3D ["sed", "-i", alterna= tes, "-e",
> - "s|{}|/downloads|".format(d.getV= ar("DL_DIR"))]
> + "s|\({}\(.*\)\)|\\1\\n/downloads\\2|&= quot;.format(d.getVar("DL_DIR"))]
> bb.note(' '.join(cmd))
> if subprocess.call(cmd) !=3D 0:
> bb.fatal("git alternates adjustment fail= ed")
>=20

This doesn'tt work, already tried: git fails if just one record is = not
working.

Jan

--=20
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
------=_Part_2027_250623735.1628759916303-- ------=_Part_2026_1561017106.1628759916303--