Revert "classes/buildhistory: also save recipe info for native recipes"
PATCH 1/1 Revert "classes/buildhistory: also save recipe info for native recipes"
This reverts commit d123606c4bef85c2436b40f51e47b602b7600c0b.
This change contains races as it will start poking into do_package task directories from do_populate_sysroot. If we want to do this for native recipes, we need to add guards around the package code and only make this happen for native in populate_sysroot, not target in populate_sysroot too. Backtrace from an example problem below:
ERROR: openssl-1.1.1g-r0 do_populate_sysroot: Error executing a python function in exec_python_func() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:buildhistory_emit_pkghistory(d)
0003:File: '/home/ross/Yocto/poky/meta/classes/buildhistory.bbclass', lineno: 319, function: buildhistory_emit_pkghistory
0315:
0316: write_pkghistory(pkginfo, d)
0317:
0318: # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
*** 0319: bb.build.exec_func("buildhistory_list_pkg_files", d)
0320:}
0321:
0322:python buildhistory_emit_outputsigs() {
0323: if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():File: '/home/ross/Yocto/poky/bitbake/lib/bb/build.py', lineno: 256, function: exec_func
0252: with bb.utils.fileslocked(lockfiles):
0253: if ispython:
0254: exec_func_python(func, d, runfile, cwd=adir)
0255: else:
*** 0256: exec_func_shell(func, d, runfile, cwd=adir)
0257:
0258: try:
0259: curcwd = os.getcwd()
0260: except:File: '/home/ross/Yocto/poky/bitbake/lib/bb/build.py', lineno: 503, function: exec_func_shell
0499: with open(fifopath, 'r+b', buffering=0) as fifo:
0500: try:
0501: bb.debug(2, "Executing shell function %s" % func)
0502: with open(os.devnull, 'r+') as stdin, logfile:
*** 0503: bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
0504: except bb.process.ExecutionError as exe:
0505: # Find the backtrace that the shell trap generated
0506: backtrace_marker_regex = re.compile(r"WARNING: Backtrace \(BB generated script\)")
0507: stdout_lines = (exe.stdout or "").split("\n")
File: '/home/ross/Yocto/poky/bitbake/lib/bb/process.py', lineno: 184, function: run
0180: if not stderr is None:
0181: stderr = stderr.decode("utf-8")
0182:
0183: if pipe.returncode != 0: *** 0184: raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
0185: return stdout, stderr
Exception: bb.process.ExecutionError: Execution of '/yocto/ross/build/tmp/work/neoversen1-poky-linux/openssl/1.1.1g-r0/temp/run.buildhistory_list_pkg_files.4158804' failed with exit code 2:
/yocto/ross/build/tmp/work/neoversen1-poky-linux/openssl/1.1.1g-r0/temp/run.buildhistory_list_pkg_files.4158804: 183: cd: can't cd to /yocto/ross/build/tmp/work/neoversen1-poky-linux/openssl/1.1.1g-r0/packages-split/openssl-engines
--- meta/classes/buildhistory.bbclass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/buildhistory.bbclass +4 -4
@@ -90,7 +90,8 @@ buildhistory_emit_sysroot() { python buildhistory_emit_pkghistory() { if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: bb.build.exec_func("buildhistory_emit_sysroot", d) - elif not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: + + if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: return 0 if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
@@ -228,9 +229,8 @@ python buildhistory_emit_pkghistory() { break except IOError as e: if e.errno == errno.ENOENT: - if not bb.data.inherits_class('native', d): - # Probably a -cross recipe, just ignore - return 0 + # Probably a -cross recipe, just ignore + return 0 else: raise
Signature · 1 line
2.25.1
Verified this fixes my build failures.
Ross
Quoted 93 lines · Richard Purdie
This reverts commit
d123606c4bef85c2436b40f51e47b602b7600c0b.This change contains races as it will start poking into
do_packagetask directories fromdo_populate_sysroot. If we want to do this for native recipes, we need to add guards around the package code and only make this happen for native inpopulate_sysroot, not target inpopulate_sysroottoo. Backtrace from an example problem below:ERROR: openssl-1.1.1g-r0
do_populate_sysroot: Error executing a python function inexec_python_func()autogenerated:The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func()autogenerated', lineno: 2, function: <module>0001: *** 0002:buildhistory_emit_pkghistory(d) 0003:File: '
/home/ross/Yocto/poky/meta/classes/buildhistory.bbclass', lineno: 319, function:buildhistory_emit_pkghistory
0315:
0316:write_pkghistory(pkginfo, d)
0317:
0318: # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
*** 0319:bb.build.exec_func("buildhistory_list_pkg_files", d)0320:} 0321: 0322:python buildhistory_emit_outputsigs() { 0323: if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():File: '
/home/ross/Yocto/poky/bitbake/lib/bb/build.py', lineno: 256, function:exec_func
0252: withbb.utils.fileslocked(lockfiles):
0253: if ispython:
0254:exec_func_python(func, d, runfile, cwd=adir)
0255: else:
*** 0256:exec_func_shell(func, d, runfile, cwd=adir)0257: 0258: try: 0259: curcwd = os.getcwd() 0260: except:File: '
/home/ross/Yocto/poky/bitbake/lib/bb/build.py', lineno: 503, function:exec_func_shell
0499: withopen(fifopath, 'r+b', buffering=0)as fifo:
0500: try:
0501:bb.debug(2, "Executing shell function %s" % func)
0502: withopen(os.devnull, 'r+')as stdin, logfile:
*** 0503:bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
0504: except bb.process.ExecutionError as exe:
0505: # Find the backtrace that the shell trap generated
0506:backtrace_marker_regex=re.compile(r"WARNING: Backtrace \(BB generated script\)")
0507:stdout_lines= (exe.stdout or "").split("\n")
File: '/home/ross/Yocto/poky/bitbake/lib/bb/process.py', lineno: 184, function: run0180: if not stderr is None: 0181: stderr = stderr.decode("utf-8") 0182: 0183: if pipe.returncode != 0:*** 0184: raise
ExecutionError(cmd, pipe.returncode, stdout, stderr)
0185: return stdout, stderr
Exception: bb.process.ExecutionError: Execution of '/yocto/ross/build/tmp/work/neoversen1-poky-linux/openssl/1.1.1g-r0/temp/run.buildhistory_list_pkg_files.4158804' failed with exit code 2:
/yocto/ross/build/tmp/work/neoversen1-poky-linux/openssl/1.1.1g-r0/temp/run.buildhistory_list_pkg_files.4158804: 183: cd: can't cd to /yocto/ross/build/tmp/work/neoversen1-poky-linux/openssl/1.1.1g-r0/packages-split/openssl-enginesSigned-off-by Richard Purdie <[email protected]>--- meta/classes/buildhistory.bbclass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)meta/classes/buildhistory.bbclass +4
-5@@ -90,7 +90,8 @@ buildhistory_emit_sysroot() { python buildhistory_emit_pkghistory() { if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']: bb.build.exec_func("buildhistory_emit_sysroot", d) - elif not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: + + if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']: return 0 if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():@@ -228,9 +229,8 @@ python buildhistory_emit_pkghistory() { break except IOError as e: if e.errno == errno.ENOENT: - if not bb.data.inherits_class('native', d): - # Probably a -cross recipe, just ignore - return 0 + # Probably a -cross recipe, just ignore + return 0 else: raise --2.25.1
Quoted 3 lines · On Friday, 23 October 2020 23:47:38 NZDT Ross Burton wrote:
Verified this fixes my build failures.
Ross
My apologies, this was not properly thought out nor sufficiently tested.
Paul