From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: [PATCH] Add FAKEROOTNOENV variable
Date: Tue, 08 Nov 2011 22:19:38 +0000 [thread overview]
Message-ID: <1320790778.10843.123.camel@ted> (raw)
Add a FAKEROOTNOENV which does the opposite of the FAKEROOTENV variable
and is data loaded into the environment for tasks without the fakeroot
flag.
The intent here is to provide a way to control the environment when we
aren't needing fakeroot context which allows us to unload the preload
from memory entirely and gain a valuable speedup.
I'm not 100% happy with needing this at the bitbake level, particularly
with the cache hit but it does give a valuable speedup.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index d495f9e..fe35e13 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -143,6 +143,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
self.section = self.getvar('SECTION', metadata)
self.fakerootenv = self.getvar('FAKEROOTENV', metadata)
self.fakerootdirs = self.getvar('FAKEROOTDIRS', metadata)
+ self.fakerootnoenv = self.getvar('FAKEROOTNOENV', metadata)
@classmethod
def init_cacheData(cls, cachedata):
@@ -178,6 +179,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
cachedata.license = {}
cachedata.section = {}
cachedata.fakerootenv = {}
+ cachedata.fakerootnoenv = {}
cachedata.fakerootdirs = {}
def add_cacheData(self, cachedata, fn):
@@ -243,6 +245,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
cachedata.license[fn] = self.license
cachedata.section[fn] = self.section
cachedata.fakerootenv[fn] = self.fakerootenv
+ cachedata.fakerootnoenv[fn] = self.fakerootnoenv
cachedata.fakerootdirs[fn] = self.fakerootdirs
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 9a1bad7..7a39d89 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1096,6 +1096,12 @@ class RunQueueExecute:
logger.debug(2, 'Running %s:%s under fakeroot, fakedirs: %s' %
(fn, taskname, ', '.join(fakedirs)))
+ else:
+ envvars = (self.rqdata.dataCache.fakerootnoenv[fn] or "").split()
+ for key, value in (var.split('=') for var in envvars):
+ envbackup[key] = os.environ.get(key)
+ os.environ[key] = value
+ fakeenv[key] = value
sys.stdout.flush()
sys.stderr.flush()
reply other threads:[~2011-11-08 22:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1320790778.10843.123.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.