summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 13:55:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 17:08:04 +0000
commit7935ae2e805d935f0f7f38e06e5ef94482540041 (patch)
tree7cd89695fa524d3fae35d56d2138fcd82bd763f5 /meta
parent88f01667707bd00b5f918950075e2235b3440b4b (diff)
downloadpoky-7935ae2e805d935f0f7f38e06e5ef94482540041.tar.gz
sstate/gcc: Fix shared workdir handling for siginfo files
For a shared workdir, any one of the fetch/unpack/patch tasks may run yet the PN and architecture fields in SSTATE_PKGSPEC may differ. This makes looking up the appropriate siginfo file near impossible. I've tried several different ways of resolving this and this is the neatest solution I could find, its still rather ugly. I believe the usefulness of better sstate debugging outweighs the ugliness of the code. This patch also changes the sstate_checkhashes() code to look for siginfo files rather than the actual sstate packages themselves. This means the function can be used in other contexts to find info files for tasks that may not have sstate data. It is assumed that sstate mirrors will have both files available. This is done to allow bitbake to query whether tasks have matching signatures in sstate directories or not. (From OE-Core rev: 068e4289b597699cbff2dfde44ba833af4535281) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sstate.bbclass40
-rw-r--r--meta/recipes-devtools/gcc/gcc-common.inc1
2 files changed, 33 insertions, 8 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 678d5e3f44..9df9ac2429 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -10,6 +10,7 @@ def generate_sstatefn(spec, hash, d):
10 10
11SSTATE_PKGARCH = "${PACKAGE_ARCH}" 11SSTATE_PKGARCH = "${PACKAGE_ARCH}"
12SSTATE_PKGSPEC = "sstate-${PN}-${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}-${PV}-${PR}-${SSTATE_PKGARCH}-${SSTATE_VERSION}-" 12SSTATE_PKGSPEC = "sstate-${PN}-${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}-${PV}-${PR}-${SSTATE_PKGARCH}-${SSTATE_VERSION}-"
13SSTATE_SWSPEC = ""
13SSTATE_PKGNAME = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC', True), d.getVar('BB_TASKHASH', True), d)}" 14SSTATE_PKGNAME = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC', True), d.getVar('BB_TASKHASH', True), d)}"
14SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}" 15SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
15SSTATE_EXTRAPATH = "" 16SSTATE_EXTRAPATH = ""
@@ -26,7 +27,7 @@ SSTATE_DUPWHITELIST += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/
26SSTATE_SCAN_FILES ?= "*.la *-config *_config" 27SSTATE_SCAN_FILES ?= "*.la *-config *_config"
27SSTATE_SCAN_CMD ?= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES", True).split())}" \) -type f' 28SSTATE_SCAN_CMD ?= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES", True).split())}" \) -type f'
28 29
29BB_HASHFILENAME = "${SSTATE_EXTRAPATH} ${SSTATE_PKGSPEC}" 30BB_HASHFILENAME = "${SSTATE_EXTRAPATH} ${SSTATE_PKGSPEC} ${SSTATE_SWSPEC}"
30 31
31SSTATE_MANMACH ?= "${SSTATE_PKGARCH}" 32SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
32 33
@@ -606,11 +607,28 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
606 e = extra.split(":") 607 e = extra.split(":")
607 mapping[e[0]] = e[1] 608 mapping[e[0]] = e[1]
608 609
610 def getpathcomponents(task, d):
611 # Magic data from BB_HASHFILENAME
612 splithashfn = sq_hashfn[task].split(" ")
613 spec = splithashfn[1]
614 extrapath = splithashfn[0]
615
616 tname = sq_task[task][3:]
617 if sq_task[task] in mapping:
618 tname = mapping[sq_task[task]]
619
620 if tname in ["fetch", "unpack", "patch"] and splithashfn[2]:
621 spec = splithashfn[2]
622 extrapath = ""
623
624 return spec, extrapath, tname
625
626
609 for task in range(len(sq_fn)): 627 for task in range(len(sq_fn)):
610 spec = sq_hashfn[task].split(" ")[1]
611 extrapath = sq_hashfn[task].split(" ")[0]
612 628
613 sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + mapping[sq_task[task]] + ".tgz") 629 spec, extrapath, tname = getpathcomponents(task, d)
630
631 sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz.siginfo")
614 if os.path.exists(sstatefile): 632 if os.path.exists(sstatefile):
615 bb.debug(2, "SState: Found valid sstate file %s" % sstatefile) 633 bb.debug(2, "SState: Found valid sstate file %s" % sstatefile)
616 ret.append(task) 634 ret.append(task)
@@ -639,9 +657,9 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
639 if task in ret: 657 if task in ret:
640 continue 658 continue
641 659
642 spec = sq_hashfn[task].split(" ")[1] 660 spec, extrapath, tname = getpathcomponents(task, d)
643 extrapath = sq_hashfn[task].split(" ")[0] 661
644 sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + mapping[sq_task[task]] + ".tgz") 662 sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz.siginfo")
645 663
646 srcuri = "file://" + sstatefile 664 srcuri = "file://" + sstatefile
647 localdata.setVar('SRC_URI', srcuri) 665 localdata.setVar('SRC_URI', srcuri)
@@ -743,6 +761,12 @@ python sstate_eventhandler() {
743 spkg = d.getVar('SSTATE_PKG', True) 761 spkg = d.getVar('SSTATE_PKG', True)
744 if not spkg.endswith(".tgz"): 762 if not spkg.endswith(".tgz"):
745 taskname = d.getVar("BB_RUNTASK", True)[3:] 763 taskname = d.getVar("BB_RUNTASK", True)[3:]
746 bb.siggen.dump_this_task(d.getVar('SSTATE_PKG', True) + '_' + taskname + ".tgz" ".siginfo", d) 764 spec = d.getVar('SSTATE_PKGSPEC', True)
765 swspec = d.getVar('SSTATE_SWSPEC', True)
766 if taskname in ["fetch", "unpack", "patch"] and swspec:
767 d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
768 d.setVar("SSTATE_EXTRAPATH", "")
769 sstatepkg = d.getVar('SSTATE_PKG', True)
770 bb.siggen.dump_this_task(sstatepkg + '_' + taskname + ".tgz" ".siginfo", d)
747} 771}
748 772
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
index 55c61850b6..e49d72477a 100644
--- a/meta/recipes-devtools/gcc/gcc-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -95,6 +95,7 @@ do_patch[stamp-base-clean] = "${SSCLEAN}"
95 95
96# SW means Shared Work directory 96# SW means Shared Work directory
97SW = "${TMPDIR}/work-shared/gcc-${PV}-${PR}" 97SW = "${TMPDIR}/work-shared/gcc-${PV}-${PR}"
98SSTATE_SWSPEC = "sstate-gcc-${PV}-${PR}-${SSTATE_VERSION}-"
98WORKDIR_task-unpack = "${SW}" 99WORKDIR_task-unpack = "${SW}"
99WORKDIR_task-patch = "${SW}" 100WORKDIR_task-patch = "${SW}"
100 101