Skip to contentSkip to conversation

staging: Fix autoconf-native rebuild failure

PATCH New Richard Purdie 1 participant 2 messages Oct 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: Fix autoconf-native rebuild failure

When rebuilds are triggered, autoconf-native can fail with:

| DEBUG: Executing shell function update_gnu_config
| install: cannot stat '[BUILDPATH]tmp/work/x86_64-linux/autoconf-native/2.71-r0/recipe-sysroot-native/usr/share/gnu-config/config.guess': No such file or directory

which is due to update_gnu_config running before extend_recipe_sysroot. This only happens rarely since usually the prepare_recipe_sysroot function would already have set things up and only in the invalidated task hash cases does this rebuild in this way from configure only.

Fix the code to prepend this function instead of appending which resolves the ordering issue.

---
 meta/classes/staging.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/staging.bbclass +1 -1
index 65a6cd5120b..25f77c77350 100644
@@ -620,7 +620,7 @@ python staging_taskhandler() {
     for task in bbtasks:
         deps = d.getVarFlag(task, "depends")
         if task == "do_configure" or (deps and "populate_sysroot" in deps):
-            d.appendVarFlag(task, "prefuncs", " extend_recipe_sysroot")
+            d.prependVarFlag(task, "prefuncs", "extend_recipe_sysroot ")
 }
 staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess"
 addhandler staging_taskhandler
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/2 patch: Fix exception reporting with repr()

The exceptions generated with repre are more detailed but escaped the newlines making them unreadable. Fix this.

---
 meta/classes/patch.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/patch.bbclass +2 -2
index fdf3c633bc8..8de70254919 100644
@@ -150,12 +150,12 @@ python patch_do_patch() {
             patchset.Import({"file":local, "strippath": parm['striplevel']}, True)
         except Exception as exc:
             bb.utils.remove(process_tmpdir, True)
-            bb.fatal("Importing patch '%s' with striplevel '%s'\n%s" % (parm['patchname'], parm['striplevel'], repr(exc)))
+            bb.fatal("Importing patch '%s' with striplevel '%s'\n%s" % (parm['patchname'], parm['striplevel'], repr(exc).replace("\\n", "\n")))
         try:
             resolver.Resolve()
         except bb.BBHandledException as e:
             bb.utils.remove(process_tmpdir, True)
-            bb.fatal("Applying patch '%s' on target directory '%s'\n%s" % (parm['patchname'], patchdir, repr(e)))
+            bb.fatal("Applying patch '%s' on target directory '%s'\n%s" % (parm['patchname'], patchdir, repr(e).replace("\\n", "\n")))
 
     bb.utils.remove(process_tmpdir, True)
     del os.environ['TMPDIR']
Signature · 1 line
2.32.0