All of lore.kernel.org
 help / color / mirror / Atom feed
* [1.32][PATCH 0/1] tinfoil: clean environment when starting up cooker
@ 2017-01-30 20:14 Paul Eggleton
  2017-01-30 20:14 ` [1.32][PATCH 1/1] " Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2017-01-30 20:14 UTC (permalink / raw)
  To: bitbake-devel

A tinfoil fix applicable to the 1.32 branch only.


The following changes since commit 1469828fa747da0aaaa3e964954ff17f2b3180fa:

  cookerdata: Convert multiconfig to use BB_CURRENT_MC (2017-01-11 17:21:12 +0000)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib paule/tinfoil-env-1.32
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/tinfoil-env-1.32

Paul Eggleton (1):
  tinfoil: clean environment when starting up cooker

 lib/bb/tinfoil.py | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.9.3



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [1.32][PATCH 1/1] tinfoil: clean environment when starting up cooker
  2017-01-30 20:14 [1.32][PATCH 0/1] tinfoil: clean environment when starting up cooker Paul Eggleton
@ 2017-01-30 20:14 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2017-01-30 20:14 UTC (permalink / raw)
  To: bitbake-devel

During normal bitbake execution, the environment is cleaned of variables
not on a whitelist while starting up cooker, and then restored
afterwards. Prior to the tinfoil2 rework in master we were taking a
number of shortcuts within tinfoil and one of those was not doing this
environment cleaning. However, prior to OE-Core rev
3d39ca5c91dbb62fb43199f916bd390cd6212e3d we didn't have any code (as far
as I'm aware) that was affected by this shortcut, hence why this wasn't
an issue up to now.

The result is the following error when attempting to run "devtool build"
in the eSDK, as CCACHE_PATH is allowed through from the eSDK's
environment setup script:

----------- snip -----------
ccache: error: Could not find compiler "gcc" in PATH
...
subprocess.CalledProcessError: Command 'gcc  --version' returned
non-zero exit status 1
----------- snip -----------

We can fix this by simply doing the environment filtering while we are
starting up cooker, thus the environment when uninative.bbclass comes to
do the gcc version check it is not affected by CCACHE_PATH or other
variables in the external environment that should be filtered out.

For clarity, this patch is only applicable to the bitbake 1.32 branch
as used for the OE-Core morty branch - master uses the reworked
tinfoil2 and doesn't need this fix.

Fixes [YOCTO #10961].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/tinfoil.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py
index 8899e86..9fa5b5b 100644
--- a/lib/bb/tinfoil.py
+++ b/lib/bb/tinfoil.py
@@ -51,10 +51,13 @@ class Tinfoil:
         features = []
         if tracking:
             features.append(CookerFeatures.BASEDATASTORE_TRACKING)
+        cleanedvars = bb.utils.clean_environment()
         self.cooker = BBCooker(self.config, features)
         self.config_data = self.cooker.data
         bb.providers.logger.setLevel(logging.ERROR)
         self.cooker_data = None
+        for k in cleanedvars:
+            os.environ[k] = cleanedvars[k]
 
     def register_idle_function(self, function, data):
         pass
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-30 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-30 20:14 [1.32][PATCH 0/1] tinfoil: clean environment when starting up cooker Paul Eggleton
2017-01-30 20:14 ` [1.32][PATCH 1/1] " Paul Eggleton

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.