Skip to contentSkip to conversation

icecc.bbclass: Fix whitespace, improve comment

PATCH In review Martin Jansa 1 participant 4 messages Dec 4, 2013 – Dec 5, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 icecc.bbclass: Fix whitespace, improve comment

* 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'

---
 meta/classes/icecc.bbclass | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)
meta/classes/icecc.bbclass +15 -14
index 931623c..5af764d 100644
@@ -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}')
Signature · 1 line
1.8.4.3
#1 lore raw

PATCH 2/3 WIP: icecc.bbclass: use bb.utils.which also for 'as'

WIP: haven't properly tested it yet

---
 meta/classes/icecc.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/icecc.bbclass +3 -1
index 5af764d..3c719ef 100644
@@ -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" ]
Signature · 1 line
1.8.4.3
#2 lore raw

PATCH 3/3 WIP: icecc.bbclass: Exclude few variables causing different signatures for native and allarch recipes

In reply to Martin Jansa

* 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

---
 meta/classes/icecc.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/icecc.bbclass +4 -0
index 3c719ef..d1c056c 100644
@@ -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)
Signature · 1 line
1.8.4.3
#3 lore raw

Re: [PATCH 3/3] WIP: icecc.bbclass: Exclude few variables causing different signatures for native and allarch recipes

Quoted 3 lines · Martin Jansa

* 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.

Quoted 31 lines
---
 meta/classes/icecc.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
meta/classes/icecc.bbclass +4 -0
index 3c719ef..d1c056c 100644
@@ -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)
Signature · 1 line
1.8.4.3
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]