Message ID | 20210812081030.4505-2-ubely@ilbers.de |
---|---|
State | RFC |
Headers | show |
Series | Fixes for dpkg-gdb packages rebuild | expand |
On 12.08.21 10:10, Uladzimir Bely wrote: > Task adjust_git modifies git alternates by replacing DL_DIR to /downloads. > New path is used inside buildchroot, so that working git repo > becomes broken outside buildchroot. > > This causes problems with rebuilding such packages as cowsay if something > has changed in bitbake environment since previous build: > > ERROR: > mc:qemuarm64-buster:cowsay-git-r0 do_patch: Command Error: 'sh -c 'git > --work-tree=/path/build/tmp/work/debian-buster-arm64/cowsay/git-r0/git > reset --hard HEAD'' exited with 0 > > 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. > > Signed-off-by: Uladzimir Bely <ubely@ilbers.de> > --- > meta/classes/dpkg-base.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/classes/dpkg-base.bbclass 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() { > > if os.path.exists(alternates): > cmd = ["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) != 0: > bb.fatal("git alternates adjustment failed") > This doesn'tt work, already tried: git fails if just one record is not working. Jan
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 unacceptable due this error message. четверг, 12 августа 2021 г. в 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 > /downloads. > > New path is used inside buildchroot, so that working git repo > > becomes broken outside buildchroot. > > > > This causes problems with rebuilding such packages as cowsay if something > > has changed in bitbake environment since previous build: > > > > ERROR: > > mc:qemuarm64-buster:cowsay-git-r0 do_patch: Command Error: 'sh -c 'git > > --work-tree=/path/build/tmp/work/debian-buster-arm64/cowsay/git-r0/git > > reset --hard HEAD'' exited with 0 > > > > 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. > > > > Signed-off-by: Uladzimir Bely <ub...@ilbers.de> > > --- > > meta/classes/dpkg-base.bbclass | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/meta/classes/dpkg-base.bbclass > 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() { > > > > if os.path.exists(alternates): > > cmd = ["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) != 0: > > bb.fatal("git alternates adjustment failed") > > > > This doesn'tt work, already tried: git fails if just one record is not > working. > > Jan > > -- > Siemens AG, T RDA IOT > Corporate Competence Center Embedded Linux >
On 12.08.21 11:18, Uladzimir Bely wrote: > 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 unacceptable due this error message. > Interesting - it actually failed in the past, not only complained. Anyway, just sent my patches. Jan > четверг, 12 августа 2021 г. в 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 > /downloads. > > New path is used inside buildchroot, so that working git repo > > becomes broken outside buildchroot. > > > > This causes problems with rebuilding such packages as cowsay if > something > > has changed in bitbake environment since previous build: > > > > ERROR: > > mc:qemuarm64-buster:cowsay-git-r0 do_patch: Command Error: 'sh -c > 'git > > > --work-tree=/path/build/tmp/work/debian-buster-arm64/cowsay/git-r0/git > > reset --hard HEAD'' exited with 0 > > > > 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. > > > > Signed-off-by: Uladzimir Bely <ub...@ilbers.de> > > --- > > meta/classes/dpkg-base.bbclass | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/meta/classes/dpkg-base.bbclass > 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() { > > > > if os.path.exists(alternates): > > cmd = ["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) != 0: > > bb.fatal("git alternates adjustment failed") > > > > This doesn'tt work, already tried: git fails if just one record is not > working. > > Jan > > -- > Siemens AG, T RDA IOT > Corporate Competence Center Embedded Linux > > -- > You received this message because you are subscribed to the Google > Groups "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to isar-users+unsubscribe@googlegroups.com > <mailto:isar-users+unsubscribe@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/isar-users/81c0fa46-a359-47bd-bed7-866671649c96n%40googlegroups.com > <https://groups.google.com/d/msgid/isar-users/81c0fa46-a359-47bd-bed7-866671649c96n%40googlegroups.com?utm_medium=email&utm_source=footer>.
diff --git a/meta/classes/dpkg-base.bbclass 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() { if os.path.exists(alternates): cmd = ["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) != 0: bb.fatal("git alternates adjustment failed")
Task adjust_git modifies git alternates by replacing DL_DIR to /downloads. New path is used inside buildchroot, so that working git repo becomes broken outside buildchroot. This causes problems with rebuilding such packages as cowsay if something has changed in bitbake environment since previous build: ERROR: mc:qemuarm64-buster:cowsay-git-r0 do_patch: Command Error: 'sh -c 'git --work-tree=/path/build/tmp/work/debian-buster-arm64/cowsay/git-r0/git reset --hard HEAD'' exited with 0 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. Signed-off-by: Uladzimir Bely <ubely@ilbers.de> --- meta/classes/dpkg-base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)