Skip to contentSkip to conversation

cve-check: print warning if file is missing

PATCH In review akuster 2 participants 6 messages Jul 27, 2020

lore
Share & tools
lore

akuster

author
#0 lore raw

PATCH v2 1/1 cve-check: print warning if file is missing

If the "tmp/cve_check" file was not create as in the case for -c populate_sdk, just print a warning instead of dumping a trace back

---
v2] lets include the missing part of the patch

---
 meta/classes/cve-check.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/cve-check.bbclass +4 -0
index 0889e7544aa..b16da9890af 100644
@@ -55,6 +55,10 @@ python cve_save_summary_handler () {
 
     cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
+    if not os.path.isfile(cve_tmp_file):
+        bb.warn("File Not found: %s" % cve_tmp_file)
+        return
+
     cve_summary_name = d.getVar("CVE_CHECK_SUMMARY_FILE_NAME")
     cvelogpath = d.getVar("CVE_CHECK_SUMMARY_DIR")
     bb.utils.mkdirhier(cvelogpath)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 18 lines · akuster

If the "tmp/cve_check" file was not create as in the case for -c populate_sdk, just print a
warning instead of dumping a trace back

---
v2] lets include the missing part of the patch

---
 meta/classes/cve-check.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/cve- renamed from meta/classes/cve-check.bbclass +0 -0

check.bbclass
index 0889e7544aa..b16da9890af 100644

meta/classes/cve-check.bbclass python cve_save_summary_handler () { · line 61

Quoted 7 lines
meta/classes/cve-check.bbclass +4 -0
@@ -55,6 +55,10 @@ python cve_save_summary_handler () {
 
     cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
+    if not os.path.isfile(cve_tmp_file):
+        bb.warn("File Not found: %s" % cve_tmp_file)
+        return
+

A warning is something the user really needs to fix or take some action about. Is this a warning?

Cheers,

Richard

author
#2 lore raw
Quoted 20 lines · Richard Purdie
Quoted 19 lines · akuster

If the "tmp/cve_check" file was not create as in the case for -c populate_sdk, just print a
warning instead of dumping a trace back

---
v2] lets include the missing part of the patch

---
 meta/classes/cve-check.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/cve- renamed from meta/classes/cve-check.bbclass +0 -0

check.bbclass
index 0889e7544aa..b16da9890af 100644

meta/classes/cve-check.bbclass +0 -0
@@ -55,6 +55,10 @@ python cve_save_summary_handler () {
 
Quoted 8 lines

meta/classes/cve-check.bbclass python cve_save_summary_handler () { · line 61

Quoted 6 lines
meta/classes/cve-check.bbclass +4 -0
     cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
+    if not os.path.isfile(cve_tmp_file):
+        bb.warn("File Not found: %s" % cve_tmp_file)
+        return
+

A warning is something the user really needs to fix or take some action about. Is this a warning?

Its actually an error in certail conditions. Do we want this to be silent or fail on 'populate_sdk'?

Quoted 7 lines

Cheers,

Richard

#3 lore raw
Quoted 31 lines · On Mon, 2020-07-27 at 06:57 -0700, akuster808 wrote:
Quoted 22 lines · Richard Purdie
Quoted 21 lines · akuster

If the "tmp/cve_check" file was not create as in the case for -c populate_sdk, just print a
warning instead of dumping a trace back

---
v2] lets include the missing part of the patch

---
 meta/classes/cve-check.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/cve- renamed from meta/classes/cve-check.bbclass +0 -0

check.bbclass
index 0889e7544aa..b16da9890af 100644

meta/classes/cve-check.bbclass +0 -0
@@ -55,6 +55,10 @@ python cve_save_summary_handler () {
 
     cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
Quoted 7 lines

meta/classes/cve-check.bbclass python cve_save_summary_handler () { · line 61

Quoted 4 lines
meta/classes/cve-check.bbclass +4 -0
+    if not os.path.isfile(cve_tmp_file):
+        bb.warn("File Not found: %s" % cve_tmp_file)
+        return
+

A warning is something the user really needs to fix or take some action
about. Is this a warning?

Quoted 2 lines

Its actually an error in certail conditions. Do we want this to be silent or fail on 'populate_sdk'?

What are the "certain conditions"?

Should it not detect those conditions and error if they occur?

Showing a warning and asking the user to guess is not a good user experience. I have no idea whether I should worry about the warning above or not for example, so I doubt anyone else does either.

Cheers,

Richard

author
#4 lore raw
Quoted 31 lines · Richard Purdie
Quoted 30 lines · On Mon, 2020-07-27 at 06:57 -0700, akuster808 wrote:
Quoted 29 lines · Richard Purdie
Quoted 18 lines · akuster

If the "tmp/cve_check" file was not create as in the case for -c populate_sdk, just print a
warning instead of dumping a trace back

---
v2] lets include the missing part of the patch

---
 meta/classes/cve-check.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/cve- renamed from meta/classes/cve-check.bbclass +0 -0

check.bbclass
index 0889e7544aa..b16da9890af 100644

meta/classes/cve-check.bbclass python cve_save_summary_handler () { · line 61

Quoted 7 lines
meta/classes/cve-check.bbclass +4 -0
@@ -55,6 +55,10 @@ python cve_save_summary_handler () {
 
     cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
+    if not os.path.isfile(cve_tmp_file):
+        bb.warn("File Not found: %s" % cve_tmp_file)
+        return
+

A warning is something the user really needs to fix or take some action
about. Is this a warning?

Quoted 3 lines
Quoted 2 lines

Its actually an error in certail conditions. Do we want this to be silent or fail on 'populate_sdk'?

What are the "certain conditions"?

populate_sdk

Quoted 2 lines

Should it not detect those conditions and error if they occur?

if INHERIT += "cve-check' is included and -c populate_sdk, the file is not generated.

Quoted 4 lines

Showing a warning and asking the user to guess is not a good user experience. I have no idea whether I should worry about the warning above or not for example, so I doubt anyone else does either.

I am fine with not sending any warning.

- armin

Quoted 5 lines

Cheers,

Richard

#5 lore raw
Quoted 48 lines · On Mon, 2020-07-27 at 09:05 -0700, akuster808 wrote:
Quoted 34 lines · Richard Purdie
Quoted 33 lines · On Mon, 2020-07-27 at 06:57 -0700, akuster808 wrote:
Quoted 32 lines · Richard Purdie
Quoted 20 lines · akuster

If the "tmp/cve_check" file was not create as in the case for -c
populate_sdk, just print a
warning instead of dumping a trace back

---
v2] lets include the missing part of the patch

---
 meta/classes/cve-check.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/cve- renamed from meta/classes/cve-check.bbclass +0 -0

check.bbclass
index 0889e7544aa..b16da9890af 100644

meta/classes/cve-check.bbclass python cve_save_summary_handler () { · line 61

Quoted 7 lines
meta/classes/cve-check.bbclass +4 -0
@@ -55,6 +55,10 @@ python cve_save_summary_handler () {
 
     cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
 
+    if not os.path.isfile(cve_tmp_file):
+        bb.warn("File Not found: %s" % cve_tmp_file)
+        return
+

A warning is something the user really needs to fix or take some
action
about. Is this a warning?

Quoted 4 lines
Quoted 3 lines

Its actually an error in certail conditions. Do we want this to be
silent or fail on 'populate_sdk'?

What are the "certain conditions"?

populate_sdk

Quoted 1 line

Should it not detect those conditions and error if they occur?

if INHERIT += "cve-check' is included and -c populate_sdk, the file is
not generated.

Quoted 5 lines
Quoted 3 lines

Showing a warning and asking the user to guess is not a good user experience. I have no idea whether I should worry about the warning above or not for example, so I doubt anyone else does either.

I am fine with not sending any warning.

That sounds like the correct solution to me in this case or maybe a bb.note() which won't be shown on the console but probably will be in the logs.

Cheers,

Richard