base: Fix license checksum rebuild problems
PATCH 1/1 base: Fix license checksum rebuild problems
"MACHINE=qemux86-64 bitbake init-ifupdown; MACHINE=genericx86-64 bitbake init-ifupdown" shows a rebuild when it would be expected. The reason is a LIC_FILES_CHKSUM which contains file://${WORKDIR}, an absolute path which doesn't exist in the first build but does in the second, causing a signature change and a rebuild.
Fix the problem by ignoring any file:// url which resolves since TMPDIR for license file dependency purposes.
meta/classes/base.bbclass +3 -0
@@ -97,6 +97,7 @@ PATH_prepend = "${@extra_path_elements(d)}" def get_lic_checksum_file_list(d): filelist = [] lic_files = d.getVar("LIC_FILES_CHKSUM", True) or '' + tmpdir = d.getVar("TMPDIR", True) urls = lic_files.split() for url in urls:
@@ -105,6 +106,8 @@ def get_lic_checksum_file_list(d): try: path = bb.fetch.decodeurl(url)[2] if path[0] == '/': + if path.startswith(tmpdir): + continue filelist.append(path + ":" + str(os.path.exists(path))) except bb.fetch.MalformedUrl: raise bb.build.FuncFailed(d.getVar('PN', True) + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
Quoted 26 lines · Richard Purdie
"MACHINE=qemux86-64 bitbake init-ifupdown; MACHINE=genericx86-64 bitbake init-ifupdown"
shows a rebuild when it would be expected. The reason is aLIC_FILES_CHKSUMwhich
contains file://${WORKDIR}, an absolute path which doesn't exist in the first build
but does in the second, causing a signature change and a rebuild.Fix the problem by ignoring any file:// url which resolves since TMPDIR for license file dependency purposes.
Signed-off-by Richard Purdie <[email protected]>meta/classes/base.bbclass +1
-0@@ -97,6 +97,7 @@ PATH_prepend = "${@extra_path_elements(d)}" def get_lic_checksum_file_list(d): filelist = [] lic_files = d.getVar("LIC_FILES_CHKSUM", True) or '' + tmpdir = d.getVar("TMPDIR", True) urls = lic_files.split() for url in urls:
meta/classes/base.bbclass def get_lic_checksum_file_list(d): · line 111
Quoted 6 lines
meta/classes/base.bbclass +2
-0@@ -105,6 +106,8 @@ def get_lic_checksum_file_list(d): try: path = bb.fetch.decodeurl(url)[2] if path[0] == '/': + if path.startswith(tmpdir): + continue
Hmm, this would probably never be a real issue, but this is using a string startswith() without a path separator, meaning it’d match e.g. /path/to/tmpfoo/ as well as /path/to/tmp/ :)
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics