report-error.bbclass: add local.conf/auto.conf into error report
PATCH v2 1/1 report-error.bbclass: add local.conf/auto.conf into error report
From: Changqing Li <[email protected]>
sometimes, it is not enough to reproduce a failed build with current info on error reports web, add local.conf/auto.conf into error report to make it more easier to reproduce failed build
Note: this need work together with change in repo error-report-web, which will display local.conf and auto.conf as Error Details
[YOCTO #13252]
--- meta/classes/report-error.bbclass | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
meta/classes/report-error.bbclass +15 -0
@@ -25,6 +25,19 @@ def errorreport_savedata(e, newdata, file): json.dump(newdata, f, indent=4, sort_keys=True) return datafile +def get_conf_data(e, filename): + builddir = e.data.getVar('TOPDIR') + filepath = os.path.join(builddir, "conf", filename) + jsonstring = "" + if os.path.exists(filepath): + with open(filepath, 'r') as f: + for line in f.readlines(): + if line.startswith("#") or len(line.strip()) == 0: + continue + else: + jsonstring=jsonstring + line + return jsonstring + python errorreport_handler () { import json import codecs
@@ -51,6 +64,8 @@ python errorreport_handler () { data['failures'] = [] data['component'] = " ".join(e.getPkgs()) data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data)) + data['local_conf'] = get_conf_data(e, 'local.conf') + data['auto_conf'] = get_conf_data(e, 'auto.conf') lock = bb.utils.lockfile(datafile + '.lock') errorreport_savedata(e, data, "error-report.txt") bb.utils.unlockfile(lock)
Signature · 1 line
2.7.4
It is ok to merge this repo first, and error-report-web still old, since error-report-web will ignore the new field.
but cannot update error-report-web to new one first, or the database of error-report-web will report error
since report from oe-core don't provide default value for the new field of database.
Quoted 49 lines · On 9/18/19 9:31 AM, [email protected] wrote:
From: Changqing Li <[email protected]>
sometimes, it is not enough to reproduce a failed build with current info on error reports web, add
local.conf/auto.confinto error report to make it more easier to reproduce failed buildNote: this need work together with change in repo error-report-web, which will display local.conf and auto.conf as Error Details
[YOCTO #13252]
Signed-off-by Changqing Li <[email protected]>--- meta/classes/report-error.bbclass | 15 +++++++++++++++ 1 file changed, 15 insertions(+)meta/classes/report-error.bbclass +15
-0@@ -25,6 +25,19 @@ def errorreport_savedata(e, newdata, file): json.dump(newdata, f, indent=4, sort_keys=True) return datafile +def get_conf_data(e, filename): + builddir = e.data.getVar('TOPDIR') + filepath = os.path.join(builddir, "conf", filename) + jsonstring = "" + if os.path.exists(filepath): + with open(filepath, 'r') as f: + for line in f.readlines(): + if line.startswith("#") or len(line.strip()) == 0: + continue + else: + jsonstring=jsonstring + line + return jsonstring + python errorreport_handler () { import json import codecs@@ -51,6 +64,8 @@ python errorreport_handler () { data['failures'] = [] data['component'] = " ".join(e.getPkgs()) data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data)) + data['local_conf'] = get_conf_data(e, 'local.conf') + data['auto_conf'] = get_conf_data(e, 'auto.conf') lock = bb.utils.lockfile(datafile + '.lock') errorreport_savedata(e, data, "error-report.txt") bb.utils.unlockfile(lock)
Signature · 3 lines
BRs Sandy(Li Changqing)