Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] icecc.bbclass: Fix whitespace, improve comment
@ 2013-12-04 22:10 Martin Jansa
  2013-12-04 22:10 ` [PATCH 2/3] WIP: icecc.bbclass: use bb.utils.which also for 'as' Martin Jansa
  2013-12-04 22:10 ` [PATCH 3/3] WIP: icecc.bbclass: Exclude few variables causing different signatures for native and allarch recipes Martin Jansa
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Jansa @ 2013-12-04 22:10 UTC (permalink / raw)
  To: openembedded-core

* Add leading space in big documentation block at the top
* Drop trailing spaces in code
* Update documentation to mention 'bb.utils.which' instead of 'which'

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/icecc.bbclass | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 931623c..5af764d 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -8,21 +8,22 @@
 # For the cross compiler, creates a tar.gz of our toolchain and sets
 # ICECC_VERSION accordingly.
 #
-#The class now handles all 3 different compile 'stages' (i.e native ,cross-kernel and target) creating the
-#necessary environment tar.gz file to be used by the remote machines.
-#It also supports meta-toolchain generation
+# The class now handles all 3 different compile 'stages' (i.e native ,cross-kernel and target) creating the
+# necessary environment tar.gz file to be used by the remote machines.
+# It also supports meta-toolchain generation
 #
-#If ICECC_PATH is not set in local.conf then the class will try to locate it using 'which'
-#but nothing is sure ;)
+# If ICECC_PATH is not set in local.conf then the class will try to locate it using 'bb.utils.which'
+# but nothing is sure ;)
 #
-#If ICECC_ENV_EXEC is set in local.conf should point to the icecc-create-env script provided by the user
-#or the default one provided by icecc-create-env.bb  will be used
-#(NOTE that this is a modified version of the script need it and *not the one that comes with icecc*
+# If ICECC_ENV_EXEC is set in local.conf, then it should point to the icecc-create-env script provided by the user
+# or the default one provided by icecc-create-env.bb will be used
+# (NOTE that this is a modified version of the script need it and *not the one that comes with icecc*
+#
+# User can specify if specific packages or packages belonging to class should not use icecc to distribute
+# compile jobs to remote machines, but handled locally, by defining ICECC_USER_CLASS_BL and ICECC_USER_PACKAGE_BL
+# with the appropriate values in local.conf. In addition the user can force to enable icecc for packages
+# which set an empty PARALLEL_MAKE variable by defining ICECC_USER_PACKAGE_WL.
 #
-#User can specify if specific packages or packages belonging to class should not use icecc to distribute
-#compile jobs to remote machines, but handled locally, by defining ICECC_USER_CLASS_BL and ICECC_USER_PACKAGE_BL
-#with the appropriate values in local.conf. In addition the user can force to enable icecc for packages
-#which set an empty PARALLEL_MAKE variable by defining ICECC_USER_PACKAGE_WL.
 #########################################################################################
 #Error checking is kept to minimum so double check any parameters you pass to the class
 ###########################################################################################
@@ -96,7 +97,7 @@ def use_icc(bb,d):
 
     package_tmp = d.expand('${PN}')
 
-    system_class_blacklist = [ "none" ] 
+    system_class_blacklist = [ "none" ]
     user_class_blacklist = (d.getVar('ICECC_USER_CLASS_BL') or "none").split()
     package_class_blacklist = system_class_blacklist + user_class_blacklist
 
@@ -174,7 +175,7 @@ def icc_path(bb,d):
 
     else:
         prefix = d.expand('${HOST_PREFIX}')
-        return create_path( [prefix+"gcc", prefix+"g++"], bb, d)      
+        return create_path( [prefix+"gcc", prefix+"g++"], bb, d)
 
 def icc_get_external_tool(bb, d, tool):
     external_toolchain_bindir = d.expand('${EXTERNAL_TOOLCHAIN}${bindir_cross}')
-- 
1.8.4.3



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

* [PATCH 2/3] WIP: icecc.bbclass: use bb.utils.which also for 'as'
  2013-12-04 22:10 [PATCH 1/3] icecc.bbclass: Fix whitespace, improve comment Martin Jansa
@ 2013-12-04 22:10 ` Martin Jansa
  2013-12-04 22:10 ` [PATCH 3/3] WIP: icecc.bbclass: Exclude few variables causing different signatures for native and allarch recipes Martin Jansa
  1 sibling, 0 replies; 4+ messages in thread
From: Martin Jansa @ 2013-12-04 22:10 UTC (permalink / raw)
  To: openembedded-core

WIP: haven't properly tested it yet

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/icecc.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 5af764d..3c719ef 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -251,6 +251,8 @@ set_icecc_env() {
 
     ICECC_CC="${@icc_get_and_check_tool(bb, d, "gcc")}"
     ICECC_CXX="${@icc_get_and_check_tool(bb, d, "g++")}"
+    # cannot use icc_get_and_check_tool here because it assumes as without target_sys prefix
+    ICECC_WHICH_AS="${@bb.utils.which(os.getenv('PATH'), 'as')}"
     if [ ! -x "${ICECC_CC}" -o ! -x "${ICECC_CXX}" ]
     then
         bbwarn "Cannot use icecc: could not get ICECC_CC or ICECC_CXX"
@@ -268,7 +270,7 @@ set_icecc_env() {
     ICECC_AS="`${ICECC_CC} -print-prog-name=as`"
     if [ "`dirname "${ICECC_AS}"`" = "." ]
     then
-        ICECC_AS="`which as`"
+        ICECC_AS="${ICECC_WHICH_AS}"
     fi
 
     if [ ! -f "${ICECC_VERSION}.done" ]
-- 
1.8.4.3



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

* [PATCH 3/3] WIP: icecc.bbclass: Exclude few variables causing different signatures for native and allarch recipes
  2013-12-04 22:10 [PATCH 1/3] icecc.bbclass: Fix whitespace, improve comment Martin Jansa
  2013-12-04 22:10 ` [PATCH 2/3] WIP: icecc.bbclass: use bb.utils.which also for 'as' Martin Jansa
@ 2013-12-04 22:10 ` Martin Jansa
  2013-12-05 21:21   ` Martin Jansa
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Jansa @ 2013-12-04 22:10 UTC (permalink / raw)
  To: openembedded-core

* I'm not entirely sure it's best way to do it, but it's the easiest one
* we can clean TARGET_FPU in allarch.bbclass to resolve icc_version
* we can provide separate icc_get_tool function for native recipes

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/icecc.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 3c719ef..d1c056c 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -142,6 +142,8 @@ def icc_is_native(bb, d):
         bb.data.inherits_class("cross", d) or \
         bb.data.inherits_class("native", d);
 
+# Don't pollute allarch signatures with TARGET_FPU
+icc_version[vardepsexclude] += "TARGET_FPU"
 def icc_version(bb, d):
     if use_icc(bb, d) == "no":
         return ""
@@ -182,6 +184,8 @@ def icc_get_external_tool(bb, d, tool):
     target_prefix = d.expand('${TARGET_PREFIX}')
     return os.path.join(external_toolchain_bindir, '%s%s' % (target_prefix, tool))
 
+# Don't pollute native signatures with target TUNE_PKGARCH through STAGING_BINDIR_TOOLCHAIN
+icc_get_tool[vardepsexclude] += "STAGING_BINDIR_TOOLCHAIN"
 def icc_get_tool(bb, d, tool):
     if icc_is_native(bb, d):
         return bb.utils.which(os.getenv("PATH"), tool)
-- 
1.8.4.3



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

* Re: [PATCH 3/3] WIP: icecc.bbclass: Exclude few variables causing different signatures for native and allarch recipes
  2013-12-04 22:10 ` [PATCH 3/3] WIP: icecc.bbclass: Exclude few variables causing different signatures for native and allarch recipes Martin Jansa
@ 2013-12-05 21:21   ` Martin Jansa
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Jansa @ 2013-12-05 21:21 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2397 bytes --]

On Wed, Dec 04, 2013 at 11:10:32PM +0100, Martin Jansa wrote:
> * I'm not entirely sure it's best way to do it, but it's the easiest one
> * we can clean TARGET_FPU in allarch.bbclass to resolve icc_version
> * we can provide separate icc_get_tool function for native recipes

I've tried to implement cleaner solution, it's easy for TARGET_FPU, but
splitting native portion of icc_get_tool is causing me some issues

shouldn't global "d" be always defined?

this fails when called from shell task: expansion of get_tools 
threw ExpansionError: Failure expanding variable get_tools, expression was
ICECC_CC="${@icc_get_and_check_tool_native(bb, d, 'gcc')}"

which triggered exception NameError: global name 'd' is not defined
but the same line works fine in different shell function

It's probably something trivial, but I don't see it now, any hint would
be appreciated

whole change (currently not working)
http://bpaste.net/show/155875/

Interesting thing is that bitbake -e zlib-native doesn't fail with parse
error (like other parsing errors) but the error message shown above can
be found hidden in bitbake -e output.

> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/classes/icecc.bbclass | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
> index 3c719ef..d1c056c 100644
> --- a/meta/classes/icecc.bbclass
> +++ b/meta/classes/icecc.bbclass
> @@ -142,6 +142,8 @@ def icc_is_native(bb, d):
>          bb.data.inherits_class("cross", d) or \
>          bb.data.inherits_class("native", d);
>  
> +# Don't pollute allarch signatures with TARGET_FPU
> +icc_version[vardepsexclude] += "TARGET_FPU"
>  def icc_version(bb, d):
>      if use_icc(bb, d) == "no":
>          return ""
> @@ -182,6 +184,8 @@ def icc_get_external_tool(bb, d, tool):
>      target_prefix = d.expand('${TARGET_PREFIX}')
>      return os.path.join(external_toolchain_bindir, '%s%s' % (target_prefix, tool))
>  
> +# Don't pollute native signatures with target TUNE_PKGARCH through STAGING_BINDIR_TOOLCHAIN
> +icc_get_tool[vardepsexclude] += "STAGING_BINDIR_TOOLCHAIN"
>  def icc_get_tool(bb, d, tool):
>      if icc_is_native(bb, d):
>          return bb.utils.which(os.getenv("PATH"), tool)
> -- 
> 1.8.4.3
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

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

end of thread, other threads:[~2013-12-05 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-04 22:10 [PATCH 1/3] icecc.bbclass: Fix whitespace, improve comment Martin Jansa
2013-12-04 22:10 ` [PATCH 2/3] WIP: icecc.bbclass: use bb.utils.which also for 'as' Martin Jansa
2013-12-04 22:10 ` [PATCH 3/3] WIP: icecc.bbclass: Exclude few variables causing different signatures for native and allarch recipes Martin Jansa
2013-12-05 21:21   ` Martin Jansa

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