From f9bdcf888f5366e58a536422b0aca12701d53e5b Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 12 Apr 2019 16:23:54 +0100 Subject: [PATCH] config.json/utils: Allow buildhistory to be configurable and disable for oe-selftest in qemu-arch Signed-off-by: Richard Purdie --- config.json | 5 ++++- scripts/run-config | 2 +- scripts/setup-config | 2 +- scripts/utils.py | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config.json b/config.json index fb5cc82..114ead9 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,6 @@ "BASE_SHAREDDIR" : "/srv/autobuilder/autobuilder.yoctoproject.org", "BASE_PUBLISHDIR" : "/srv/autobuilder/downloads.yoctoproject.org", - "build-history-targets" : ["qemuarm64", "qemuarm", "qemuarm-lsb", "qemumips64", "qemumips", "qemumips-lsb", "qemuppc", "qemuppc-lsb", "qemux86-64", "qemux86-64-lsb", "qemux86", "qemux86-lsb"], "BUILD_HISTORY_DIR" : "buildhistory", "BUILD_HISTORY_REPO" : "ssh://git@push.yoctoproject.org/poky-buildhistory", "BUILD_HISTORY_DIRECTPUSH" : ["poky:morty", "poky:pyro", "poky:rocko", "poky:sumo", "poky:thud", "poky:warrior", "poky:master"], @@ -31,6 +30,7 @@ "SSTATEDIR_RELEASE" : ["SSTATE_MIRRORS += 'file://.* file://${BASE_SHAREDDIR}/pub/sstate/PATH'", "SSTATE_DIR ?= '${BASE_PUBLISHDIR}/sstate/@RELEASENUM@'"], "SDKEXTRAS" : ["SSTATE_MIRRORS += '\\", "file://.* http://sstate.yoctoproject.org/dev/@RELEASENUM@PATH;downloadfilename=PATH'"], "BUILDINFO" : false, + "BUILDHISTORY" : false, "BUILDINFOVARS" : ["INHERIT += 'image-buildinfo'", "IMAGE_BUILDINFO_VARS_append = ' IMAGE_BASENAME IMAGE_NAME'"], "WRITECONFIG" : true, "SENDERRORS" : true, @@ -56,6 +56,7 @@ "templates" : { "arch-qemu" : { "BUILDINFO" : true, + "BUILDHISTORY" : true, "step1" : { "BBTARGETS" : "core-image-sato core-image-sato-dev core-image-sato-sdk core-image-minimal core-image-minimal-dev core-image-sato:do_populate_sdk", "SANITYTARGETS" : "core-image-minimal:do_testimage core-image-sato:do_testimage core-image-sato-sdk:do_testimage core-image-sato:do_testsdk" @@ -67,6 +68,7 @@ }, "step3" : { "PRSERV" : false, + "BUILDHISTORY" : false, "EXTRACMDS" : ["${SCRIPTSDIR}/checkvnc; DISPLAY=:1 oe-selftest -r runqemu meta_ide -j 15"], "ADDLAYER" : ["${BUILDDIR}/../meta-selftest"] } @@ -74,6 +76,7 @@ "lsb-qemu" : { "DISTRO" : "poky-lsb", "BUILDINFO" : true, + "BUILDHISTORY" : true, "step1" : { "BBTARGETS" : "core-image-lsb core-image-lsb-dev core-image-lsb-sdk", "SANITYTARGETS" : "core-image-lsb:do_testimage core-image-lsb-sdk:do_testimage" diff --git a/scripts/run-config b/scripts/run-config index f97e524..7d84d47 100755 --- a/scripts/run-config +++ b/scripts/run-config @@ -143,7 +143,7 @@ def runcmd(cmd, *args, **kwargs): except subprocess.CalledProcessError: print("ERROR: Command %s failed" % cmd) -bh_path, remoterepo, remotebranch, baseremotebranch = utils.getbuildhistoryconfig(ourconfig, args.builddir, args.target, args.reponame, args.branchname) +bh_path, remoterepo, remotebranch, baseremotebranch = utils.getbuildhistoryconfig(ourconfig, args.builddir, args.target, args.reponame, args.branchname, stepnum) if bh_path: runcmd([os.path.join(scriptsdir, "buildhistory-init"), bh_path, remoterepo, remotebranch, baseremotebranch]) diff --git a/scripts/setup-config b/scripts/setup-config index 10383eb..3c8862a 100755 --- a/scripts/setup-config +++ b/scripts/setup-config @@ -92,7 +92,7 @@ extravars = utils.getconfiglistfilter("extravars", ourconfig, args.target, stepn if extravars: variables.extend(extravars) -bh_path, remoterepo, remotebranch, baseremotebranch = utils.getbuildhistoryconfig(ourconfig, args.builddir, args.target, args.reponame, args.branchname) +bh_path, remoterepo, remotebranch, baseremotebranch = utils.getbuildhistoryconfig(ourconfig, args.builddir, args.target, args.reponame, args.branchname, stepnum) if bh_path: variables.append('INHERIT += "buildhistory"') variables.append('BUILDHISTORY_DIR = "%s"' % bh_path) diff --git a/scripts/utils.py b/scripts/utils.py index e1f5628..45d3f93 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -194,9 +194,9 @@ def loadconfig(): # # Common function to determine if buildhistory is enabled and what the parameters are # -def getbuildhistoryconfig(ourconfig, builddir, target, reponame, branchname): - if contains(["BUILD_HISTORY_DIR", "build-history-targets", "BUILD_HISTORY_REPO"], ourconfig): - if target in getconfig("build-history-targets", ourconfig): +def getbuildhistoryconfig(ourconfig, builddir, target, reponame, branchname, stepnum): + if contains(["BUILD_HISTORY_DIR", "BUILD_HISTORY_REPO"], ourconfig): + if utils.getconfigvar("BUILDHISTORY", ourconfig, target, stepnum): base = None if "/" in reponame: reponame = reponame.rsplit("/", 1)[1]