Hi all,

I recently encountered an interesting issue - I switched some CI pipelines to use rm_work_and_downloads.bbclass, since that cve-check.bbclass fails with

File: '/opt/build/poky/meta/recipes-core/meta/cve-update-db-native.bb', lineno: 55, function: do_populate_cve_db
     0051:
0052: cve_f = open(os.path.join(d.getVar("TMPDIR"), 'cve_check'), 'a')
     0053:
     0054:    if not os.path.isdir(db_dir):
 *** 0055:        os.mkdir(db_dir)
     0056:
     0057:    # Connect to database
     0058:    conn = sqlite3.connect(db_file)
     0059:    c = conn.cursor()
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/opt/build/build/tmp/work/x86_64-linux/cve-update-db-native/downloads/CVE_CHECK'

after some thought about it, it's pretty clear that the WORKDIR based
DL_DIR doesn't work with the cve-update-db-native, as it expects things to be downloaded once.

I currently can think of the following options

- document that this is a known bug and could be easily fix by including
  CVE_CHECK_DB_DIR = "${TOPDIR}/downloads/CVE_CHECK" in local.conf
- or the more complicated option:
  insert the following into rm_work_and_downloads.bbclass

  + # backup original setting to DL_DIR_GLOBAL
  + DL_DIR_GLOBAL := "${DL_DIR}"

  right before DL_DIR is overridden and in cve-check.bbclass

  - CVE_CHECK_DB_DIR ?= "${DL_DIR}/CVE_CHECK"
+ CVE_CHECK_DB_DIR ?= "${@d.getVar('DL_DIR_GLOBAL') or d.getVar('DL_DIR')}/CVE_CHECK"

neither option is really convincing me, that why I'd like to ask, if anyone has a better idea how to fix this issue?

regards
Konrad
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#138377): 
https://lists.openembedded.org/g/openembedded-core/message/138377
Mute This Topic: https://lists.openembedded.org/mt/74269399/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to