Bug 8621

Summary: EXPORT_FUNCTIONS on fakeroot task function doesn't actually end up as a fakeroot task
Product: [Build System, Metadata & Runtime] BitBake Reporter: Paul Eggleton <bluelightning>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: Low CC: poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie, ross.burton
Version: 2.0   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Paul Eggleton 2015-10-31 21:56:08 UTC
If you export a task function in a class with EXPORT_FUNCTIONS which is marked fakeroot, the task doesn't end up executing as a fakeroot task.

It turns out we never do this in the OE-Core metadata; all of our functions exported with EXPORT_FUNCTIONS that should be fakeroot have that varflag set manually in anonymous python, so that explains why we (apparently) hadn't noticed this.
Comment 1 Randy MacLeod 2020-01-23 16:16:19 UTC
Trevor to talk with Richard about this since Richard knows where the fix belongs.
Comment 2 Ross Burton 2021-11-16 17:47:43 UTC
*** Bug 14631 has been marked as a duplicate of this bug. ***
Comment 3 Richard Purdie 2021-11-16 17:59:41 UTC
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 31bcc8e7ac..ec0305cd37 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -223,7 +223,7 @@ class ExportFuncsNode(AstNode):
             for flag in [ "func", "python" ]:
                 if data.getVarFlag(calledfunc, flag, False):
                     data.setVarFlag(func, flag, data.getVarFlag(calledfunc, flag, False))
-            for flag in [ "dirs" ]:
+            for flag in ["dirs", "cleandirs", "fakeroot"]:
                 if data.getVarFlag(func, flag, False):
                     data.setVarFlag(calledfunc, flag, data.getVarFlag(func, flag, False))
             data.setVarFlag(func, "filename", "autogenerated")
Comment 4 Richard Purdie 2022-04-11 20:42:30 UTC
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/3432/steps/14/logs/stdio shows a run with this fix applied on the autobuilder. There is some issue.
Comment 5 Richard Purdie 2022-04-12 21:29:39 UTC
Issue addressed and patch in review