Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v3 Bug #892 0/2] Collected cached siteconfig in the runtime
@ 2011-08-16  3:34 Lianhao Lu
  2011-08-16  3:34 ` [PATCH v3 Bug #892 1/2] toolchain-script.bbclass: Collected cached site config in runtime Lianhao Lu
  2011-08-16  3:34 ` [PATCH v3 Bug #892 2/2] meta-toolchain/environment: Collected site config files " Lianhao Lu
  0 siblings, 2 replies; 3+ messages in thread
From: Lianhao Lu @ 2011-08-16  3:34 UTC (permalink / raw)
  To: openembedded-core

These 2 patches are trying to fix the bug #892. It collected the cached site config files name in the runtime for meta-toolchain and meta-environment, and also added task dependencies to ensure the caches are generated. 

The variable TOOLCHAIN_NEED_CONFIGSITE_CACHE specifies what site config files are needed from the cache used for the toolchain.

The following changes since commit 13db5f420ca9bff98561f80d78958278734ad1f4:
  Zhai Edwin (1):
        distro-tracking: Update info for gpgme, libassuan, apr... after last upgrade.

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib llu/bug892
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=llu/bug892

Lianhao Lu (2):
  toolchain-script.bbclass: Collected cached site config in runtime.
  meta-toolchain/environment: Collected site config files in runtime.

 meta/classes/populate_sdk.bbclass             |    2 +-
 meta/classes/siteinfo.bbclass                 |    4 +++-
 meta/classes/toolchain-scripts.bbclass        |   24 +++++++++++++++++++++---
 meta/recipes-core/meta/meta-environment.bb    |    7 +++----
 meta/recipes-core/meta/meta-toolchain-gmae.bb |    2 ++
 meta/recipes-core/meta/meta-toolchain.bb      |    4 +---
 6 files changed, 31 insertions(+), 12 deletions(-)




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

* [PATCH v3 Bug #892 1/2] toolchain-script.bbclass: Collected cached site config in runtime.
  2011-08-16  3:34 [PATCH v3 Bug #892 0/2] Collected cached siteconfig in the runtime Lianhao Lu
@ 2011-08-16  3:34 ` Lianhao Lu
  2011-08-16  3:34 ` [PATCH v3 Bug #892 2/2] meta-toolchain/environment: Collected site config files " Lianhao Lu
  1 sibling, 0 replies; 3+ messages in thread
From: Lianhao Lu @ 2011-08-16  3:34 UTC (permalink / raw)
  To: openembedded-core

[YOCTO #892]
Modify the function toolchain_create_sdk_siteconfig to collect the
cached site config files which are specified by
TOOLCHAIN_NEED_CONFIGSITE_CACHE in runtime.

Also added task dependency to ensure the cached site config files are
generated.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/classes/siteinfo.bbclass          |    4 +++-
 meta/classes/toolchain-scripts.bbclass |   24 +++++++++++++++++++++---
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
index a61b5e5..02294c4 100644
--- a/meta/classes/siteinfo.bbclass
+++ b/meta/classes/siteinfo.bbclass
@@ -118,7 +118,7 @@ python () {
         bb.fatal("Please add your architecture to siteinfo.bbclass")
 }
 
-def siteinfo_get_files(d):
+def siteinfo_get_files(d, no_cache = False):
     sitedata = siteinfo_data(d)
     sitefiles = ""
     for path in d.getVar("BBPATH", True).split(":"):
@@ -127,6 +127,8 @@ def siteinfo_get_files(d):
             if os.path.exists(filename):
                 sitefiles += filename + " "
 
+    if no_cache: return sitefiles
+
     # Now check for siteconfig cache files
     path_siteconfig = bb.data.getVar('SITECONFIG_SYSROOTCACHE', d, 1)
     if os.path.isdir(path_siteconfig):
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index f7b52be..6fc67f8 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -101,17 +101,28 @@ toolchain_create_sdk_env_script_for_installer () {
 	echo 'export POKY_SDK_VERSION="${SDK_VERSION}"' >> $script
 }
 
+#we get the cached site config in the runtime
+TOOLCHAIN_CONFIGSITE_NOCACHE := "${@siteinfo_get_files(d, True)}"
+TOOLCHAIN_CONFIGSITE_SYSROOTCACHE := "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d"
+TOOLCHAIN_NEED_CONFIGSITE_CACHE = "eglibc ncurses"
+
 #This function create a site config file
 toolchain_create_sdk_siteconfig () {
 	local siteconfig=$1
-	shift
-	local files=$@
 
 	rm -f $siteconfig
 	touch $siteconfig
-	for sitefile in ${files} ; do
+
+	for sitefile in ${TOOLCHAIN_CONFIGSITE_NOCACHE} ; do
 		cat $sitefile >> $siteconfig
 	done
+
+	#get cached site config
+	for sitefile in ${TOOLCHAIN_NEED_CONFIGSITE_CACHE}; do
+		if [ -r ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config ]; then
+			cat ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config >> $siteconfig
+		fi
+	done
 }
 
 #This function create a version information file
@@ -124,3 +135,10 @@ toolchain_create_sdk_version () {
 	echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile
 	echo 'Timestamp: ${DATETIME}' >> $versionfile
 }
+
+python __anonymous () {
+    deps = bb.data.getVarFlag('do_configure', 'depends', d) or ""
+    for dep in (bb.data.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', d, True) or "").split():
+        deps += " %s:do_populate_sysroot" % dep
+    bb.data.setVarFlag('do_configure', 'depends', deps, d)
+}
-- 
1.7.0.4




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

* [PATCH v3 Bug #892 2/2] meta-toolchain/environment: Collected site config files in runtime.
  2011-08-16  3:34 [PATCH v3 Bug #892 0/2] Collected cached siteconfig in the runtime Lianhao Lu
  2011-08-16  3:34 ` [PATCH v3 Bug #892 1/2] toolchain-script.bbclass: Collected cached site config in runtime Lianhao Lu
@ 2011-08-16  3:34 ` Lianhao Lu
  1 sibling, 0 replies; 3+ messages in thread
From: Lianhao Lu @ 2011-08-16  3:34 UTC (permalink / raw)
  To: openembedded-core

[YOCTO #892]
Use the new cached site config files generation mechanism in
toolchain-script.bbclass.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/classes/populate_sdk.bbclass             |    2 +-
 meta/recipes-core/meta/meta-environment.bb    |    7 +++----
 meta/recipes-core/meta/meta-toolchain-gmae.bb |    2 ++
 meta/recipes-core/meta/meta-toolchain.bb      |    4 +---
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/meta/classes/populate_sdk.bbclass b/meta/classes/populate_sdk.bbclass
index 0f3591b..69780e5 100644
--- a/meta/classes/populate_sdk.bbclass
+++ b/meta/classes/populate_sdk.bbclass
@@ -47,7 +47,7 @@ fakeroot do_populate_sdk() {
 	ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
 
 	# Setup site file for external use
-	toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS} ${CONFIG_SITE}
+	toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS}
 
 	toolchain_create_sdk_env_script
 
diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb
index 114727c..39ba96c 100644
--- a/meta/recipes-core/meta/meta-environment.bb
+++ b/meta/recipes-core/meta/meta-environment.bb
@@ -2,13 +2,12 @@ DESCRIPTION = "Package of environment files for SDK"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 LICENSE = "MIT"
-PR = "r6"
+PR = "r7"
 
 EXCLUDE_FROM_WORLD = "1"
 
 inherit toolchain-scripts
-# get target config site before inheritting cross-canadian
-TARGET_CONFIG_SITE := "${@siteinfo_get_files(d)}"
+TOOLCHAIN_NEED_CONFIGSITE_CACHE += "zlib"
 REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
 
 SDK_DIR = "${WORKDIR}/sdk"
@@ -23,7 +22,7 @@ do_generate_content() {
     rm -rf ${SDK_OUTPUT}
     mkdir -p ${SDK_OUTPUT}/${SDKPATH}
 
-    toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS} ${TARGET_CONFIG_SITE}
+    toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS}
 
     toolchain_create_sdk_env_script_for_installer ${REAL_MULTIMACH_TARGET_SYS}
 
diff --git a/meta/recipes-core/meta/meta-toolchain-gmae.bb b/meta/recipes-core/meta/meta-toolchain-gmae.bb
index 4f5501e..512810b 100644
--- a/meta/recipes-core/meta/meta-toolchain-gmae.bb
+++ b/meta/recipes-core/meta/meta-toolchain-gmae.bb
@@ -3,3 +3,5 @@ TOOLCHAIN_TARGET_TASK = "${TOOLCHAIN_TARGET_GMAETASK}"
 TOOLCHAIN_OUTPUTNAME = "${SDK_NAME}-toolchain-gmae-${DISTRO_VERSION}"
 PROVIDES = "meta-toolchain-sdk"
 require meta-toolchain.bb
+
+TOOLCHAIN_NEED_CONFIGSITE_CACHE += "zlib"
diff --git a/meta/recipes-core/meta/meta-toolchain.bb b/meta/recipes-core/meta/meta-toolchain.bb
index 164d717..1058c68 100644
--- a/meta/recipes-core/meta/meta-toolchain.bb
+++ b/meta/recipes-core/meta/meta-toolchain.bb
@@ -1,12 +1,10 @@
 DESCRIPTION = "Meta package for building a installable toolchain"
 LICENSE = "MIT"
 
-PR = "r5"
+PR = "r6"
 
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
 IMAGETEST ?= "dummy"
 inherit populate_sdk imagetest-${IMAGETEST}
-
-CONFIG_SITE := "${@siteinfo_get_files(d)}"
-- 
1.7.0.4




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

end of thread, other threads:[~2011-08-16  3:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-16  3:34 [PATCH v3 Bug #892 0/2] Collected cached siteconfig in the runtime Lianhao Lu
2011-08-16  3:34 ` [PATCH v3 Bug #892 1/2] toolchain-script.bbclass: Collected cached site config in runtime Lianhao Lu
2011-08-16  3:34 ` [PATCH v3 Bug #892 2/2] meta-toolchain/environment: Collected site config files " Lianhao Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox