[2.0][PATCH 0/3] Patch review
Please review this set of patches for kirkstone/2.0 and have comments back by end of day Wednesday.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/3692
The following changes since commit 59c16ae6c55c607c56efd2287537a1b97ba2bf52:
fetch/git : Use cat as pager (2022-05-12 13:41:35 +0100)
are available in the Git repository at:
git://git.openembedded.org/bitbake-contrib stable/2.0-nut
http://cgit.openembedded.org/bitbake-contrib/log/?h=stable/2.0-nut
Gunjan Gupta (1):
fetch2/osc: Small fixes for osc fetcher
Richard Purdie (1):
build: Add clean_stamp API function to allow removal of task stamps
Tomasz Dziendzielski (1):
data: Do not depend on vardepvalueexclude flag
lib/bb/build.py | 14 +++++++++----- lib/bb/data.py | 2 ++ lib/bb/fetch2/osc.py | 16 ++++++++++------ 3 files changed, 21 insertions(+), 11 deletions(-)
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 1/3] fetch2/osc: Small fixes for osc fetcher
From: Gunjan Gupta <[email protected]>
The current fetcher seemed to have some issues that made it difficult when trying to use the same. This patch fixes the following
* Make consistent use of the path that needs to be used as oscdir
* The path mentioned in os.access in download function was not same as ud.moddir which would result into invoking of fetch command instead of update command even if directory already existed
* Before creating oscrc, make sure oscdir exists and create it if it does not exist
* Updated the configuration to use apiurl and added a new parameter to control whether http or https needs to be used to connect to apiurl
--- lib/bb/fetch2/osc.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
lib/bb/fetch2/osc.py +10 -6
@@ -36,6 +36,7 @@ class Osc(FetchMethod): # Create paths to osc checkouts oscdir = d.getVar("OSCDIR") or (d.getVar("DL_DIR") + "/osc") relpath = self._strip_leading_slashes(ud.path) + ud.oscdir = oscdir ud.pkgdir = os.path.join(oscdir, ud.host) ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module)
@@ -49,7 +50,7 @@ class Osc(FetchMethod): else: ud.revision = "" - ud.localfile = d.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision)) + ud.localfile = d.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), relpath.replace('/', '.'), ud.revision)) def _buildosccommand(self, ud, d, command): """
@@ -86,7 +87,7 @@ class Osc(FetchMethod): logger.debug2("Fetch: checking for module directory '" + ud.moddir + "'") - if os.access(os.path.join(d.getVar('OSCDIR'), ud.path, ud.module), os.R_OK): + if os.access(ud.moddir, os.R_OK): oscupdatecmd = self._buildosccommand(ud, d, "update") logger.info("Update "+ ud.url) # update sources there
@@ -114,20 +115,23 @@ class Osc(FetchMethod): Generate a .oscrc to be used for this run. """ - config_path = os.path.join(d.getVar('OSCDIR'), "oscrc") + config_path = os.path.join(ud.oscdir, "oscrc") + if not os.path.exists(ud.oscdir): + bb.utils.mkdirhier(ud.oscdir) + if (os.path.exists(config_path)): os.remove(config_path) f = open(config_path, 'w') + proto = ud.parm.get('proto', 'https') f.write("[general]\n") - f.write("apisrv = %s\n" % ud.host) - f.write("scheme = http\n") + f.write("apiurl = %s://%s\n" % (proto, ud.host)) f.write("su-wrapper = su -c\n") f.write("build-root = %s\n" % d.getVar('WORKDIR')) f.write("urllist = %s\n" % d.getVar("OSCURLLIST")) f.write("extra-pkgs = gzip\n") f.write("\n") - f.write("[%s]\n" % ud.host) + f.write("[%s://%s]\n" % (proto, ud.host)) f.write("user = %s\n" % ud.parm["user"]) f.write("pass = %s\n" % ud.parm["pswd"]) f.close()
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 2/3] data: Do not depend on vardepvalueexclude flag
In reply to Steve SakomanFrom: Tomasz Dziendzielski <[email protected]>
If SRC_URI contains python function that extends vardepvalueexclude its value is being tracked by sstate-cache, which can lead to rebuilds if value is set dynamically (for example gerrit replicas).
Return empty string if vardepvalueexclude is checked to fix this behaviour.
--- lib/bb/data.py | 2 ++ 1 file changed, 2 insertions(+)
lib/bb/data.py +2 -0
@@ -277,6 +277,8 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, ignored_vars, d): try: if key[-1] == ']': vf = key[:-1].split('[') + if vf[1] == "vardepvalueexclude": + return deps, "" value, parser = d.getVarFlag(vf[0], vf[1], False, retparser=True) deps |= parser.references deps = deps | (keys & parser.execs)
Signature · 1 line
2.25.1
[bitbake][kirkstone][2.0][PATCH 3/3] build: Add clean_stamp API function to allow removal of task stamps
In reply to Steve SakomanFrom: Richard Purdie <[email protected]>
We currently have no API to be able to remove all the potential stamps of a task. It is unusual to need to do this, particularly as you could race against other things happening in the system but we do have a use case for this in cleaning up sysroots in OE-Core. The alternative is to mess with CLEANMASK in OE-Core but that is just going to add potential for errors.
We need the first part of the make_stamp() function so separate that out so it can be called seperately.
--- lib/bb/build.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
lib/bb/build.py +9 -5
@@ -835,11 +835,7 @@ def stamp_cleanmask_internal(taskname, d, file_name): return [cleanmask, cleanmask.replace(taskflagname, taskflagname + "_setscene")] -def make_stamp(task, d, file_name = None): - """ - Creates/updates a stamp for a given task - (d can be a data dict or dataCache) - """ +def clean_stamp(task, d, file_name = None): cleanmask = stamp_cleanmask_internal(task, d, file_name) for mask in cleanmask: for name in glob.glob(mask):
@@ -850,6 +846,14 @@ def make_stamp(task, d, file_name = None): if name.endswith('.taint'): continue os.unlink(name) + return + +def make_stamp(task, d, file_name = None): + """ + Creates/updates a stamp for a given task + (d can be a data dict or dataCache) + """ + clean_stamp(task, d, file_name) stamp = stamp_internal(task, d, file_name) # Remove the file and recreate to force timestamp
Signature · 1 line
2.25.1