Skip to contentSkip to conversation

WORKDIR and insane tweaks

RFC PATCH New Ross Burton 1 participant 3 messages Aug 13, 2013

lore
Share & tools
lore
#0 lore raw

cover WORKDIR and insane tweaks

Hi,

Last night I was attempting a build with WORKDIR in a tmpfs to see what impact it made on build time (the results were fairly interesting, I'll write them up shortly).

I noticed that to move WORKDIR I had to replicate the full WORKDIR path logic, which was a bit irritating but not that serious. I then noticed that the "rpaths" sanity test checks that WORKDIR is in fact TMPDIR/work, and does a bb.fatal() if it isn't. My best understanding here is that the check needs to know the base of all possible WORKDIRS so that it can check for linkage directly into another package's work directory.

Assuming that understanding is correct then both problems can be resolved with a BASE_WORKDIR variable, which this series adds to bitbake.conf and then uses in insane.bbclass.

Ross

The following changes since commit 16d522bcd1f1b7741577fa31fab7e2129da0cae9:

maintainers.inc: reassign maintainers, remove obsolete recipes (2013-08-12 13:13:05 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ross/workdir

for you to fetch changes up to e91cbd17131101d1c470669acce66682ae06960a:

insane: don't abort if workdir is not TMPDIR/work (2013-08-13 10:36:53 +0100)

----------------------------------------------------------------
Ross Burton (2):
bitbake.conf: define WORKDIR in terms of BASE_WORKDIR
insane: don't abort if workdir is not TMPDIR/work

 meta/classes/insane.bbclass |    5 +----
 meta/conf/bitbake.conf      |    3 ++-
 2 files changed, 3 insertions(+), 5 deletions(-)

Ross Burton (2):
bitbake.conf: define WORKDIR in terms of BASE_WORKDIR
insane: don't abort if workdir is not TMPDIR/work

 meta/classes/insane.bbclass |    5 +----
 meta/conf/bitbake.conf      |    3 ++-
 2 files changed, 3 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/2 bitbake.conf: define WORKDIR in terms of BASE_WORKDIR

To make it easier to move WORKDIR, define it using the new variable BASE_WORKDIR, which is the root of the work directory.

---
 meta/conf/bitbake.conf |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/conf/bitbake.conf +2 -1
index 07eb473..9e2696b 100644
@@ -338,8 +338,8 @@ HGDIR = "${CO_DIR}/hg"
 STAMPS_DIR ?= "${TMPDIR}/stamps"
 STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
 STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
-WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+BASE_WORKDIR ?= "${TMPDIR}/work"
+WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
 T = "${WORKDIR}/temp"
 D = "${WORKDIR}/image"
 S = "${WORKDIR}/${BP}"
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/2 insane: don't abort if workdir is not TMPDIR/work

In reply to Ross Burton

The BASE_WORKDIR variable can be used instead of enforcing WORKDIR being TMPDIR/work (and aborting the build if it isn't).

---
 meta/classes/insane.bbclass |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
meta/classes/insane.bbclass +1 -4
index aa02985..865db5e 100644
@@ -175,10 +175,7 @@ def package_qa_check_rpath(file,name, d, elf, messages):
     if os.path.islink(file):
         return
 
-    bad_dirs = [d.getVar('TMPDIR', True) + "/work", d.getVar('STAGING_DIR_TARGET', True)]
-
-    if not bad_dirs[0] in d.getVar('WORKDIR', True):
-        bb.fatal("This class assumed that WORKDIR is ${TMPDIR}/work... Not doing any check")
+    bad_dirs = [d.getVar('BASE_WORKDIR', True), d.getVar('STAGING_DIR_TARGET', True)]
 
     phdrs = elf.run_objdump("-p", d)
 
Signature · 1 line
1.7.10.4