All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Reverse the order of OVERRIDES
@ 2010-10-15  3:36 Chris Larson
  2010-10-15  4:07 ` Khem Raj
                   ` (4 more replies)
  0 siblings, 5 replies; 36+ messages in thread
From: Chris Larson @ 2010-10-15  3:36 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Chris Larson

From: Chris Larson <chris_larson@mentor.com>

Given the current implementation of OVERRIDES in bitbake, the variable is
expected to contain elements in the order least specific to most specific,
however, our current usage of it does not match that.  As one example, "local"
is supposed to always be the most specific override, yet currently it's the
least specific.  As another example, currently the target architecture is seen
as more specific than the machine, which is also clearly wrong.

It becomes clear that a reversal of the current value will bring us to a more
sane behavior, and avoids the need for the dual overrides hack mentioned in
the comments, so clean those up as well.

This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
inject overrides elements which are more specific than the distro but less
specific than the machine, which is where things like MACHINE_CLASS or
SOC_FAMILY or the like would go.  This variable is *space* separated, to make
it easier and more convenient to assemble the variable incrementally, and it's
then translated to : separated when used in OVERRIDES.

Signed-off-by: Chris Larson <chris_larson@mentor.com>
---
 conf/bitbake.conf                             |   17 +++--------------
 conf/distro/include/arm-thumb.inc             |    6 +++---
 conf/distro/micro.conf                        |    6 +++---
 conf/distro/minimal.conf                      |    5 +++--
 conf/distro/shr.conf                          |    5 +++--
 conf/machine/fsg3be.conf                      |    2 +-
 conf/machine/kixrp435.conf                    |    2 +-
 conf/machine/nslu2be.conf                     |    2 +-
 conf/machine/nslu2le.conf                     |    2 +-
 recipes/binutils/binutils_csl-arm-20050416.bb |    2 +-
 recipes/binutils/binutils_csl-arm-20050603.bb |    2 +-
 recipes/eglibc/eglibc-package.bbclass         |    2 +-
 recipes/glibc/glibc-package.inc               |    2 +-
 recipes/prelink/prelink_20061027.bb           |    2 +-
 recipes/prelink/prelink_20071009.bb           |    2 +-
 recipes/prelink/prelink_20090925.bb           |    2 +-
 16 files changed, 26 insertions(+), 35 deletions(-)

diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 494e14e..c2359dc 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -675,20 +675,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
 
 # Overrides are processed left to right, so the ones that are named later take precedence.
 # You generally want them to go from least to most specific.
-# 
-# This means that an envionment variable named '<foo>_arm' overrides an
-# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
-# an environment variable '<foo>_ramses' overrides '<foo>' but doesn't override
-# '<foo>_arm' when ${MACHINE} is 'ramses'. 
-# If you use combination ie '<foo>_arm_ramses', then '<foo>_arm_ramses' will override 
-# '<foo>_arm' and then '<foo>' will be overriden with that value from '<foo>_arm'.
-# And finally '<foo>_local' overrides anything, but with lowest priority.
-#
-# This works for  functions as well, they are really just environment variables.
-# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
-OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
-# Alternative OVERRIDES definition without "fail fast", usually only for native building and Scratchbox toolchains.
-#OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}"
+MACHINE_OVERRIDES ?= ""
+OVERRIDES = "pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
+${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES', True).split())}:${MACHINE}:local"
 
 ##################################################################
 # Include the rest of the config files.
diff --git a/conf/distro/include/arm-thumb.inc b/conf/distro/include/arm-thumb.inc
index 36edd4f..75ed978 100644
--- a/conf/distro/include/arm-thumb.inc
+++ b/conf/distro/include/arm-thumb.inc
@@ -16,9 +16,9 @@ THUMB_INTERWORK ?= "no"
 #    arm system and vice versa.  It is strongly recommended that DISTROs not
 #    turn this off - the actual cost is very small.
 
-OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
-OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
-OVERRIDES_append_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
+OVERRIDE_THUMB = "${@['', 'thumb:'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
+OVERRIDE_INTERWORK = "${@['', 'thumb-interwork:'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
+OVERRIDES_prepend_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
 
 #    Compiler and linker options for application code and kernel code.  These
 #    options ensure that the compiler has the correct settings for the selected
diff --git a/conf/distro/micro.conf b/conf/distro/micro.conf
index 6d396b3..19b5e62 100644
--- a/conf/distro/micro.conf
+++ b/conf/distro/micro.conf
@@ -69,10 +69,10 @@ require conf/distro/include/sane-toolchain.inc
 require conf/distro/include/arm-thumb.inc
 
 #############################################################################
-# OVERRIDES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
 #############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:\
-${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
 
 #############################################################################
 # PREFERRED VERSIONS
diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf
index 376ffde..0d32cfe 100644
--- a/conf/distro/minimal.conf
+++ b/conf/distro/minimal.conf
@@ -81,9 +81,10 @@ KERNEL = "kernel26"
 MACHINE_KERNEL_VERSION = "2.6"
 
 #############################################################################
-# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
 #############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
 
 #############################################################################
 # TOOLCHAIN
diff --git a/conf/distro/shr.conf b/conf/distro/shr.conf
index ade8cba..74e3fe9 100644
--- a/conf/distro/shr.conf
+++ b/conf/distro/shr.conf
@@ -151,9 +151,10 @@ KERNEL = "kernel26"
 MACHINE_KERNEL_VERSION = "2.6"
 
 #############################################################################
-# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
 #############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
 
 #############################################################################
 # TOOLCHAIN
diff --git a/conf/machine/fsg3be.conf b/conf/machine/fsg3be.conf
index a2ca95b..c5ddc25 100644
--- a/conf/machine/fsg3be.conf
+++ b/conf/machine/fsg3be.conf
@@ -8,7 +8,7 @@ PACKAGE_EXTRA_ARCHS = "ixp4xxbe"
 
 MACHINE_ARCH = "ixp4xxbe"
 
-OVERRIDES = "local:${MACHINE}:ixp4xxbe:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx ixp4xxbe"
 
 # Match the vendor's latest kernel
 PREFERRED_PROVIDER_virtual/kernel ?= "fsg3-kernel"
diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
index 8259127..b4a2fa6 100644
--- a/conf/machine/kixrp435.conf
+++ b/conf/machine/kixrp435.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
 # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
 PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
 
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "nslu2 ixp4xx"
 
 PREFERRED_PROVIDER_virtual/kernel = "linux"
 PREFERRED_VERSION_linux = "2.6.30"
diff --git a/conf/machine/nslu2be.conf b/conf/machine/nslu2be.conf
index 9bc92f1..88e6ed2 100644
--- a/conf/machine/nslu2be.conf
+++ b/conf/machine/nslu2be.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "armeb"
 # Note: armv4b armv4tb armv5teb will be added by tune-xscale.inc automatically.
 PACKAGE_EXTRA_ARCHS = "armv5eb ixp4xxbe"
 
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "nslu2 ixp4xx"
 
 ROOT_FLASH_SIZE ?= "6"
 
diff --git a/conf/machine/nslu2le.conf b/conf/machine/nslu2le.conf
index 62e47cb..edd0d94 100644
--- a/conf/machine/nslu2le.conf
+++ b/conf/machine/nslu2le.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
 # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
 PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
 
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "nslu2 ixp4xx"
 
 ROOT_FLASH_SIZE ?= "6"
 
diff --git a/recipes/binutils/binutils_csl-arm-20050416.bb b/recipes/binutils/binutils_csl-arm-20050416.bb
index ad45438..71803d1 100644
--- a/recipes/binutils/binutils_csl-arm-20050416.bb
+++ b/recipes/binutils/binutils_csl-arm-20050416.bb
@@ -7,7 +7,7 @@ LICENSE = "GPL"
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
 PV = "2.15.99+csl-arm+cvs20050416"
 PR = "r3"
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
 DEFAULT_PREFERENCE = "-1"
 DEFAULT_PREFERENCE_arm-linux = "-1"
 DEFAULT_PREFERENCE_arm-linuxeabi = "-1"
diff --git a/recipes/binutils/binutils_csl-arm-20050603.bb b/recipes/binutils/binutils_csl-arm-20050603.bb
index 595cb98..50e8677 100644
--- a/recipes/binutils/binutils_csl-arm-20050603.bb
+++ b/recipes/binutils/binutils_csl-arm-20050603.bb
@@ -7,7 +7,7 @@ LICENSE = "GPL"
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
 PV = "2.15.99+csl-arm+cvs20050603"
 PR = "r3"
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
 DEFAULT_PREFERENCE = "-1"
 #DEFAULT_PREFERENCE_arm-linux = "1"
 #DEFAULT_PREFERENCE_arm-linuxeabi = "1"
diff --git a/recipes/eglibc/eglibc-package.bbclass b/recipes/eglibc/eglibc-package.bbclass
index dbca1ab..c802bd5 100644
--- a/recipes/eglibc/eglibc-package.bbclass
+++ b/recipes/eglibc/eglibc-package.bbclass
@@ -116,7 +116,7 @@ def get_eglibc_fpu_setting(bb, d):
 EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}"
 EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
 
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
 
 do_configure_prepend() {
         sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
diff --git a/recipes/glibc/glibc-package.inc b/recipes/glibc/glibc-package.inc
index 0b263bb..8cd8564 100644
--- a/recipes/glibc/glibc-package.inc
+++ b/recipes/glibc/glibc-package.inc
@@ -44,7 +44,7 @@ def get_glibc_fpu_setting(bb, d):
 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
 EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
 
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
 
 do_install() {
 	oe_runmake install_root=${D} install
diff --git a/recipes/prelink/prelink_20061027.bb b/recipes/prelink/prelink_20061027.bb
index ad2faf5..552117b 100644
--- a/recipes/prelink/prelink_20061027.bb
+++ b/recipes/prelink/prelink_20061027.bb
@@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
            file://prelink.default"
 
 TARGET_OS_ORIG := "${TARGET_OS}"
-OVERRIDES_append = ":${TARGET_OS_ORIG}"
+OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
 SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
 
 S = "${WORKDIR}/prelink-0.0.${PV}"
diff --git a/recipes/prelink/prelink_20071009.bb b/recipes/prelink/prelink_20071009.bb
index faf930c..e2ab3fb 100644
--- a/recipes/prelink/prelink_20071009.bb
+++ b/recipes/prelink/prelink_20071009.bb
@@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
            file://prelink.default"
 
 TARGET_OS_ORIG := "${TARGET_OS}"
-OVERRIDES_append = ":${TARGET_OS_ORIG}"
+OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
 SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
 
 S = "${WORKDIR}/prelink-0.0.${PV}"
diff --git a/recipes/prelink/prelink_20090925.bb b/recipes/prelink/prelink_20090925.bb
index 4c83402..5b247b6 100644
--- a/recipes/prelink/prelink_20090925.bb
+++ b/recipes/prelink/prelink_20090925.bb
@@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
            file://prelink.default"
 
 #TARGET_OS_ORIG := "${TARGET_OS}"
-#OVERRIDES_append = ":${TARGET_OS_ORIG}"
+#OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
 #SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
 
 S = "${WORKDIR}/prelink-0.0.${PV}"
-- 
1.7.2.3




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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-15  3:36 [PATCH] Reverse the order of OVERRIDES Chris Larson
@ 2010-10-15  4:07 ` Khem Raj
  2010-10-15  6:56   ` Frans Meulenbroeks
  2010-10-15 14:18   ` Tom Rini
  2010-10-15 10:42 ` Koen Kooi
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 36+ messages in thread
From: Khem Raj @ 2010-10-15  4:07 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Chris Larson

On Thu, Oct 14, 2010 at 8:36 PM, Chris Larson <kergoth@gmail.com> wrote:
> From: Chris Larson <chris_larson@mentor.com>
>
> Given the current implementation of OVERRIDES in bitbake, the variable is
> expected to contain elements in the order least specific to most specific,
> however, our current usage of it does not match that.  As one example, "local"
> is supposed to always be the most specific override, yet currently it's the
> least specific.  As another example, currently the target architecture is seen
> as more specific than the machine, which is also clearly wrong.
>
> It becomes clear that a reversal of the current value will bring us to a more
> sane behavior, and avoids the need for the dual overrides hack mentioned in
> the comments, so clean those up as well.
>
> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
> inject overrides elements which are more specific than the distro but less
> specific than the machine, which is where things like MACHINE_CLASS or
> SOC_FAMILY or the like would go.  This variable is *space* separated, to make
> it easier and more convenient to assemble the variable incrementally, and it's
> then translated to : separated when used in OVERRIDES.
>
> Signed-off-by: Chris Larson <chris_larson@mentor.com>

both things look nice to me. We might need to document MACHINE_OVERRIDES though.

Acked-by: Khem Raj <raj.khem@gmail.com>

> ---
>  conf/bitbake.conf                             |   17 +++--------------
>  conf/distro/include/arm-thumb.inc             |    6 +++---
>  conf/distro/micro.conf                        |    6 +++---
>  conf/distro/minimal.conf                      |    5 +++--
>  conf/distro/shr.conf                          |    5 +++--
>  conf/machine/fsg3be.conf                      |    2 +-
>  conf/machine/kixrp435.conf                    |    2 +-
>  conf/machine/nslu2be.conf                     |    2 +-
>  conf/machine/nslu2le.conf                     |    2 +-
>  recipes/binutils/binutils_csl-arm-20050416.bb |    2 +-
>  recipes/binutils/binutils_csl-arm-20050603.bb |    2 +-
>  recipes/eglibc/eglibc-package.bbclass         |    2 +-
>  recipes/glibc/glibc-package.inc               |    2 +-
>  recipes/prelink/prelink_20061027.bb           |    2 +-
>  recipes/prelink/prelink_20071009.bb           |    2 +-
>  recipes/prelink/prelink_20090925.bb           |    2 +-
>  16 files changed, 26 insertions(+), 35 deletions(-)
>
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index 494e14e..c2359dc 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -675,20 +675,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
>
>  # Overrides are processed left to right, so the ones that are named later take precedence.
>  # You generally want them to go from least to most specific.
> -#
> -# This means that an envionment variable named '<foo>_arm' overrides an
> -# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
> -# an environment variable '<foo>_ramses' overrides '<foo>' but doesn't override
> -# '<foo>_arm' when ${MACHINE} is 'ramses'.
> -# If you use combination ie '<foo>_arm_ramses', then '<foo>_arm_ramses' will override
> -# '<foo>_arm' and then '<foo>' will be overriden with that value from '<foo>_arm'.
> -# And finally '<foo>_local' overrides anything, but with lowest priority.
> -#
> -# This works for  functions as well, they are really just environment variables.
> -# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
> -OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> -# Alternative OVERRIDES definition without "fail fast", usually only for native building and Scratchbox toolchains.
> -#OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}"
> +MACHINE_OVERRIDES ?= ""
> +OVERRIDES = "pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
> +${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES', True).split())}:${MACHINE}:local"
>
>  ##################################################################
>  # Include the rest of the config files.
> diff --git a/conf/distro/include/arm-thumb.inc b/conf/distro/include/arm-thumb.inc
> index 36edd4f..75ed978 100644
> --- a/conf/distro/include/arm-thumb.inc
> +++ b/conf/distro/include/arm-thumb.inc
> @@ -16,9 +16,9 @@ THUMB_INTERWORK ?= "no"
>  #    arm system and vice versa.  It is strongly recommended that DISTROs not
>  #    turn this off - the actual cost is very small.
>
> -OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
> -OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
> -OVERRIDES_append_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
> +OVERRIDE_THUMB = "${@['', 'thumb:'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
> +OVERRIDE_INTERWORK = "${@['', 'thumb-interwork:'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
> +OVERRIDES_prepend_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
>
>  #    Compiler and linker options for application code and kernel code.  These
>  #    options ensure that the compiler has the correct settings for the selected
> diff --git a/conf/distro/micro.conf b/conf/distro/micro.conf
> index 6d396b3..19b5e62 100644
> --- a/conf/distro/micro.conf
> +++ b/conf/distro/micro.conf
> @@ -69,10 +69,10 @@ require conf/distro/include/sane-toolchain.inc
>  require conf/distro/include/arm-thumb.inc
>
>  #############################################################################
> -# OVERRIDES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:\
> -${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>  #############################################################################
>  # PREFERRED VERSIONS
> diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf
> index 376ffde..0d32cfe 100644
> --- a/conf/distro/minimal.conf
> +++ b/conf/distro/minimal.conf
> @@ -81,9 +81,10 @@ KERNEL = "kernel26"
>  MACHINE_KERNEL_VERSION = "2.6"
>
>  #############################################################################
> -# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>  #############################################################################
>  # TOOLCHAIN
> diff --git a/conf/distro/shr.conf b/conf/distro/shr.conf
> index ade8cba..74e3fe9 100644
> --- a/conf/distro/shr.conf
> +++ b/conf/distro/shr.conf
> @@ -151,9 +151,10 @@ KERNEL = "kernel26"
>  MACHINE_KERNEL_VERSION = "2.6"
>
>  #############################################################################
> -# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>  #############################################################################
>  # TOOLCHAIN
> diff --git a/conf/machine/fsg3be.conf b/conf/machine/fsg3be.conf
> index a2ca95b..c5ddc25 100644
> --- a/conf/machine/fsg3be.conf
> +++ b/conf/machine/fsg3be.conf
> @@ -8,7 +8,7 @@ PACKAGE_EXTRA_ARCHS = "ixp4xxbe"
>
>  MACHINE_ARCH = "ixp4xxbe"
>
> -OVERRIDES = "local:${MACHINE}:ixp4xxbe:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx ixp4xxbe"
>
>  # Match the vendor's latest kernel
>  PREFERRED_PROVIDER_virtual/kernel ?= "fsg3-kernel"
> diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
> index 8259127..b4a2fa6 100644
> --- a/conf/machine/kixrp435.conf
> +++ b/conf/machine/kixrp435.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
>
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"
>
>  PREFERRED_PROVIDER_virtual/kernel = "linux"
>  PREFERRED_VERSION_linux = "2.6.30"
> diff --git a/conf/machine/nslu2be.conf b/conf/machine/nslu2be.conf
> index 9bc92f1..88e6ed2 100644
> --- a/conf/machine/nslu2be.conf
> +++ b/conf/machine/nslu2be.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "armeb"
>  # Note: armv4b armv4tb armv5teb will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5eb ixp4xxbe"
>
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"
>
>  ROOT_FLASH_SIZE ?= "6"
>
> diff --git a/conf/machine/nslu2le.conf b/conf/machine/nslu2le.conf
> index 62e47cb..edd0d94 100644
> --- a/conf/machine/nslu2le.conf
> +++ b/conf/machine/nslu2le.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
>
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"
>
>  ROOT_FLASH_SIZE ?= "6"
>
> diff --git a/recipes/binutils/binutils_csl-arm-20050416.bb b/recipes/binutils/binutils_csl-arm-20050416.bb
> index ad45438..71803d1 100644
> --- a/recipes/binutils/binutils_csl-arm-20050416.bb
> +++ b/recipes/binutils/binutils_csl-arm-20050416.bb
> @@ -7,7 +7,7 @@ LICENSE = "GPL"
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
>  PV = "2.15.99+csl-arm+cvs20050416"
>  PR = "r3"
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  DEFAULT_PREFERENCE = "-1"
>  DEFAULT_PREFERENCE_arm-linux = "-1"
>  DEFAULT_PREFERENCE_arm-linuxeabi = "-1"
> diff --git a/recipes/binutils/binutils_csl-arm-20050603.bb b/recipes/binutils/binutils_csl-arm-20050603.bb
> index 595cb98..50e8677 100644
> --- a/recipes/binutils/binutils_csl-arm-20050603.bb
> +++ b/recipes/binutils/binutils_csl-arm-20050603.bb
> @@ -7,7 +7,7 @@ LICENSE = "GPL"
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
>  PV = "2.15.99+csl-arm+cvs20050603"
>  PR = "r3"
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  DEFAULT_PREFERENCE = "-1"
>  #DEFAULT_PREFERENCE_arm-linux = "1"
>  #DEFAULT_PREFERENCE_arm-linuxeabi = "1"
> diff --git a/recipes/eglibc/eglibc-package.bbclass b/recipes/eglibc/eglibc-package.bbclass
> index dbca1ab..c802bd5 100644
> --- a/recipes/eglibc/eglibc-package.bbclass
> +++ b/recipes/eglibc/eglibc-package.bbclass
> @@ -116,7 +116,7 @@ def get_eglibc_fpu_setting(bb, d):
>  EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}"
>  EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
>
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>
>  do_configure_prepend() {
>         sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
> diff --git a/recipes/glibc/glibc-package.inc b/recipes/glibc/glibc-package.inc
> index 0b263bb..8cd8564 100644
> --- a/recipes/glibc/glibc-package.inc
> +++ b/recipes/glibc/glibc-package.inc
> @@ -44,7 +44,7 @@ def get_glibc_fpu_setting(bb, d):
>  EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
>  EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
>
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>
>  do_install() {
>        oe_runmake install_root=${D} install
> diff --git a/recipes/prelink/prelink_20061027.bb b/recipes/prelink/prelink_20061027.bb
> index ad2faf5..552117b 100644
> --- a/recipes/prelink/prelink_20061027.bb
> +++ b/recipes/prelink/prelink_20061027.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>            file://prelink.default"
>
>  TARGET_OS_ORIG := "${TARGET_OS}"
> -OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> diff --git a/recipes/prelink/prelink_20071009.bb b/recipes/prelink/prelink_20071009.bb
> index faf930c..e2ab3fb 100644
> --- a/recipes/prelink/prelink_20071009.bb
> +++ b/recipes/prelink/prelink_20071009.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>            file://prelink.default"
>
>  TARGET_OS_ORIG := "${TARGET_OS}"
> -OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> diff --git a/recipes/prelink/prelink_20090925.bb b/recipes/prelink/prelink_20090925.bb
> index 4c83402..5b247b6 100644
> --- a/recipes/prelink/prelink_20090925.bb
> +++ b/recipes/prelink/prelink_20090925.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>            file://prelink.default"
>
>  #TARGET_OS_ORIG := "${TARGET_OS}"
> -#OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +#OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  #SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> --
> 1.7.2.3
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-15  4:07 ` Khem Raj
@ 2010-10-15  6:56   ` Frans Meulenbroeks
  2010-10-15 14:18   ` Tom Rini
  1 sibling, 0 replies; 36+ messages in thread
From: Frans Meulenbroeks @ 2010-10-15  6:56 UTC (permalink / raw)
  To: openembedded-devel

2010/10/15 Khem Raj <raj.khem@gmail.com>:
> On Thu, Oct 14, 2010 at 8:36 PM, Chris Larson <kergoth@gmail.com> wrote:
>> From: Chris Larson <chris_larson@mentor.com>
>>
>> Given the current implementation of OVERRIDES in bitbake, the variable is
>> expected to contain elements in the order least specific to most specific,
>> however, our current usage of it does not match that.  As one example, "local"
>> is supposed to always be the most specific override, yet currently it's the
>> least specific.  As another example, currently the target architecture is seen
>> as more specific than the machine, which is also clearly wrong.
>>
>> It becomes clear that a reversal of the current value will bring us to a more
>> sane behavior, and avoids the need for the dual overrides hack mentioned in
>> the comments, so clean those up as well.
>>
>> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
>> inject overrides elements which are more specific than the distro but less
>> specific than the machine, which is where things like MACHINE_CLASS or
>> SOC_FAMILY or the like would go.  This variable is *space* separated, to make
>> it easier and more convenient to assemble the variable incrementally, and it's
>> then translated to : separated when used in OVERRIDES.
>>
>> Signed-off-by: Chris Larson <chris_larson@mentor.com>
>
> both things look nice to me. We might need to document MACHINE_OVERRIDES though.
>
> Acked-by: Khem Raj <raj.khem@gmail.com>
>
Looks fine to me.
Actually I've wondered several times why local did not have priority
(but I had to do things like X_local).
But before adding an ack, I would like to ask what has been done wrt
testing (as this is potentially quite invasive).

Also is there a way we can detect where the recipes can be simplified
by adding unneeded appendices? (e.g by modifying/extending
recipe_sanity).

Thanks for the patch! Frans



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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-15  3:36 [PATCH] Reverse the order of OVERRIDES Chris Larson
  2010-10-15  4:07 ` Khem Raj
@ 2010-10-15 10:42 ` Koen Kooi
  2010-10-15 14:12 ` Maupin, Chase
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 36+ messages in thread
From: Koen Kooi @ 2010-10-15 10:42 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15-10-10 05:36, Chris Larson wrote:
> From: Chris Larson <chris_larson@mentor.com>
> 
> Given the current implementation of OVERRIDES in bitbake, the variable is
> expected to contain elements in the order least specific to most specific,
> however, our current usage of it does not match that.  As one example, "local"
> is supposed to always be the most specific override, yet currently it's the
> least specific.  As another example, currently the target architecture is seen
> as more specific than the machine, which is also clearly wrong.
> 
> It becomes clear that a reversal of the current value will bring us to a more
> sane behavior, and avoids the need for the dual overrides hack mentioned in
> the comments, so clean those up as well.
> 
> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
> inject overrides elements which are more specific than the distro but less
> specific than the machine, which is where things like MACHINE_CLASS or
> SOC_FAMILY or the like would go.  This variable is *space* separated, to make
> it easier and more convenient to assemble the variable incrementally, and it's
> then translated to : separated when used in OVERRIDES.
> 
> Signed-off-by: Chris Larson <chris_larson@mentor.com>

Thanks for the patch! Chase or I will take care of moving SOC_FAMILY to
MACHINE_OVERRIDES after this lands.

Acked-by: Koen Kooi <k-kooi@ti.com>



> ---
>  conf/bitbake.conf                             |   17 +++--------------
>  conf/distro/include/arm-thumb.inc             |    6 +++---
>  conf/distro/micro.conf                        |    6 +++---
>  conf/distro/minimal.conf                      |    5 +++--
>  conf/distro/shr.conf                          |    5 +++--
>  conf/machine/fsg3be.conf                      |    2 +-
>  conf/machine/kixrp435.conf                    |    2 +-
>  conf/machine/nslu2be.conf                     |    2 +-
>  conf/machine/nslu2le.conf                     |    2 +-
>  recipes/binutils/binutils_csl-arm-20050416.bb |    2 +-
>  recipes/binutils/binutils_csl-arm-20050603.bb |    2 +-
>  recipes/eglibc/eglibc-package.bbclass         |    2 +-
>  recipes/glibc/glibc-package.inc               |    2 +-
>  recipes/prelink/prelink_20061027.bb           |    2 +-
>  recipes/prelink/prelink_20071009.bb           |    2 +-
>  recipes/prelink/prelink_20090925.bb           |    2 +-
>  16 files changed, 26 insertions(+), 35 deletions(-)
> 
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index 494e14e..c2359dc 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -675,20 +675,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
>  
>  # Overrides are processed left to right, so the ones that are named later take precedence.
>  # You generally want them to go from least to most specific.
> -# 
> -# This means that an envionment variable named '<foo>_arm' overrides an
> -# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
> -# an environment variable '<foo>_ramses' overrides '<foo>' but doesn't override
> -# '<foo>_arm' when ${MACHINE} is 'ramses'. 
> -# If you use combination ie '<foo>_arm_ramses', then '<foo>_arm_ramses' will override 
> -# '<foo>_arm' and then '<foo>' will be overriden with that value from '<foo>_arm'.
> -# And finally '<foo>_local' overrides anything, but with lowest priority.
> -#
> -# This works for  functions as well, they are really just environment variables.
> -# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
> -OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> -# Alternative OVERRIDES definition without "fail fast", usually only for native building and Scratchbox toolchains.
> -#OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}"
> +MACHINE_OVERRIDES ?= ""
> +OVERRIDES = "pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
> +${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES', True).split())}:${MACHINE}:local"
>  
>  ##################################################################
>  # Include the rest of the config files.
> diff --git a/conf/distro/include/arm-thumb.inc b/conf/distro/include/arm-thumb.inc
> index 36edd4f..75ed978 100644
> --- a/conf/distro/include/arm-thumb.inc
> +++ b/conf/distro/include/arm-thumb.inc
> @@ -16,9 +16,9 @@ THUMB_INTERWORK ?= "no"
>  #    arm system and vice versa.  It is strongly recommended that DISTROs not
>  #    turn this off - the actual cost is very small.
>  
> -OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
> -OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
> -OVERRIDES_append_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
> +OVERRIDE_THUMB = "${@['', 'thumb:'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
> +OVERRIDE_INTERWORK = "${@['', 'thumb-interwork:'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
> +OVERRIDES_prepend_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
>  
>  #    Compiler and linker options for application code and kernel code.  These
>  #    options ensure that the compiler has the correct settings for the selected
> diff --git a/conf/distro/micro.conf b/conf/distro/micro.conf
> index 6d396b3..19b5e62 100644
> --- a/conf/distro/micro.conf
> +++ b/conf/distro/micro.conf
> @@ -69,10 +69,10 @@ require conf/distro/include/sane-toolchain.inc
>  require conf/distro/include/arm-thumb.inc
>  
>  #############################################################################
> -# OVERRIDES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:\
> -${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>  
>  #############################################################################
>  # PREFERRED VERSIONS
> diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf
> index 376ffde..0d32cfe 100644
> --- a/conf/distro/minimal.conf
> +++ b/conf/distro/minimal.conf
> @@ -81,9 +81,10 @@ KERNEL = "kernel26"
>  MACHINE_KERNEL_VERSION = "2.6"
>  
>  #############################################################################
> -# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>  
>  #############################################################################
>  # TOOLCHAIN
> diff --git a/conf/distro/shr.conf b/conf/distro/shr.conf
> index ade8cba..74e3fe9 100644
> --- a/conf/distro/shr.conf
> +++ b/conf/distro/shr.conf
> @@ -151,9 +151,10 @@ KERNEL = "kernel26"
>  MACHINE_KERNEL_VERSION = "2.6"
>  
>  #############################################################################
> -# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>  
>  #############################################################################
>  # TOOLCHAIN
> diff --git a/conf/machine/fsg3be.conf b/conf/machine/fsg3be.conf
> index a2ca95b..c5ddc25 100644
> --- a/conf/machine/fsg3be.conf
> +++ b/conf/machine/fsg3be.conf
> @@ -8,7 +8,7 @@ PACKAGE_EXTRA_ARCHS = "ixp4xxbe"
>  
>  MACHINE_ARCH = "ixp4xxbe"
>  
> -OVERRIDES = "local:${MACHINE}:ixp4xxbe:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx ixp4xxbe"
>  
>  # Match the vendor's latest kernel
>  PREFERRED_PROVIDER_virtual/kernel ?= "fsg3-kernel"
> diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
> index 8259127..b4a2fa6 100644
> --- a/conf/machine/kixrp435.conf
> +++ b/conf/machine/kixrp435.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
>  
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"
>  
>  PREFERRED_PROVIDER_virtual/kernel = "linux"
>  PREFERRED_VERSION_linux = "2.6.30"
> diff --git a/conf/machine/nslu2be.conf b/conf/machine/nslu2be.conf
> index 9bc92f1..88e6ed2 100644
> --- a/conf/machine/nslu2be.conf
> +++ b/conf/machine/nslu2be.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "armeb"
>  # Note: armv4b armv4tb armv5teb will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5eb ixp4xxbe"
>  
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"
>  
>  ROOT_FLASH_SIZE ?= "6"
>  
> diff --git a/conf/machine/nslu2le.conf b/conf/machine/nslu2le.conf
> index 62e47cb..edd0d94 100644
> --- a/conf/machine/nslu2le.conf
> +++ b/conf/machine/nslu2le.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
>  
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"
>  
>  ROOT_FLASH_SIZE ?= "6"
>  
> diff --git a/recipes/binutils/binutils_csl-arm-20050416.bb b/recipes/binutils/binutils_csl-arm-20050416.bb
> index ad45438..71803d1 100644
> --- a/recipes/binutils/binutils_csl-arm-20050416.bb
> +++ b/recipes/binutils/binutils_csl-arm-20050416.bb
> @@ -7,7 +7,7 @@ LICENSE = "GPL"
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
>  PV = "2.15.99+csl-arm+cvs20050416"
>  PR = "r3"
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  DEFAULT_PREFERENCE = "-1"
>  DEFAULT_PREFERENCE_arm-linux = "-1"
>  DEFAULT_PREFERENCE_arm-linuxeabi = "-1"
> diff --git a/recipes/binutils/binutils_csl-arm-20050603.bb b/recipes/binutils/binutils_csl-arm-20050603.bb
> index 595cb98..50e8677 100644
> --- a/recipes/binutils/binutils_csl-arm-20050603.bb
> +++ b/recipes/binutils/binutils_csl-arm-20050603.bb
> @@ -7,7 +7,7 @@ LICENSE = "GPL"
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
>  PV = "2.15.99+csl-arm+cvs20050603"
>  PR = "r3"
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  DEFAULT_PREFERENCE = "-1"
>  #DEFAULT_PREFERENCE_arm-linux = "1"
>  #DEFAULT_PREFERENCE_arm-linuxeabi = "1"
> diff --git a/recipes/eglibc/eglibc-package.bbclass b/recipes/eglibc/eglibc-package.bbclass
> index dbca1ab..c802bd5 100644
> --- a/recipes/eglibc/eglibc-package.bbclass
> +++ b/recipes/eglibc/eglibc-package.bbclass
> @@ -116,7 +116,7 @@ def get_eglibc_fpu_setting(bb, d):
>  EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}"
>  EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
>  
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  
>  do_configure_prepend() {
>          sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
> diff --git a/recipes/glibc/glibc-package.inc b/recipes/glibc/glibc-package.inc
> index 0b263bb..8cd8564 100644
> --- a/recipes/glibc/glibc-package.inc
> +++ b/recipes/glibc/glibc-package.inc
> @@ -44,7 +44,7 @@ def get_glibc_fpu_setting(bb, d):
>  EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
>  EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
>  
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  
>  do_install() {
>  	oe_runmake install_root=${D} install
> diff --git a/recipes/prelink/prelink_20061027.bb b/recipes/prelink/prelink_20061027.bb
> index ad2faf5..552117b 100644
> --- a/recipes/prelink/prelink_20061027.bb
> +++ b/recipes/prelink/prelink_20061027.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>             file://prelink.default"
>  
>  TARGET_OS_ORIG := "${TARGET_OS}"
> -OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>  
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> diff --git a/recipes/prelink/prelink_20071009.bb b/recipes/prelink/prelink_20071009.bb
> index faf930c..e2ab3fb 100644
> --- a/recipes/prelink/prelink_20071009.bb
> +++ b/recipes/prelink/prelink_20071009.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>             file://prelink.default"
>  
>  TARGET_OS_ORIG := "${TARGET_OS}"
> -OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>  
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> diff --git a/recipes/prelink/prelink_20090925.bb b/recipes/prelink/prelink_20090925.bb
> index 4c83402..5b247b6 100644
> --- a/recipes/prelink/prelink_20090925.bb
> +++ b/recipes/prelink/prelink_20090925.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>             file://prelink.default"
>  
>  #TARGET_OS_ORIG := "${TARGET_OS}"
> -#OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +#OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  #SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>  
>  S = "${WORKDIR}/prelink-0.0.${PV}"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFMuDAvMkyGM64RGpERAlxxAKCzjaugv4f3l8A/wL+evxo3QOjbyQCgiuLC
GTiLjxOoQ/7pW0vhSZf1owM=
=hkIm
-----END PGP SIGNATURE-----




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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-15  3:36 [PATCH] Reverse the order of OVERRIDES Chris Larson
  2010-10-15  4:07 ` Khem Raj
  2010-10-15 10:42 ` Koen Kooi
@ 2010-10-15 14:12 ` Maupin, Chase
  2010-10-15 15:17   ` Chris Larson
  2010-10-15 15:41 ` [PATCH (v2)] " Chris Larson
  2010-10-16 18:04 ` [PATCH] " Martin Jansa
  4 siblings, 1 reply; 36+ messages in thread
From: Maupin, Chase @ 2010-10-15 14:12 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Chris Larson

> diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
> index 8259127..b4a2fa6 100644
> --- a/conf/machine/kixrp435.conf
> +++ b/conf/machine/kixrp435.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc
> automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
> 
> -OVERRIDES =
> "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build
> -${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"

Should this be "ixp4xx nslu2"?  At least in order to keep the original behavior?

> 
>  PREFERRED_PROVIDER_virtual/kernel = "linux"
>  PREFERRED_VERSION_linux = "2.6.30"
> diff --git a/conf/machine/nslu2be.conf b/conf/machine/nslu2be.conf
> index 9bc92f1..88e6ed2 100644
> --- a/conf/machine/nslu2be.conf
> +++ b/conf/machine/nslu2be.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "armeb"
>  # Note: armv4b armv4tb armv5teb will be added by tune-xscale.inc
> automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5eb ixp4xxbe"
> 
> -OVERRIDES =
> "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build
> -${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"

Should this be "ixp4xx nslu2"?  At least in order to keep the original behavior?

> 
>  ROOT_FLASH_SIZE ?= "6"
> 
> diff --git a/conf/machine/nslu2le.conf b/conf/machine/nslu2le.conf
> index 62e47cb..edd0d94 100644
> --- a/conf/machine/nslu2le.conf
> +++ b/conf/machine/nslu2le.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc
> automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
> 
> -OVERRIDES =
> "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build
> -${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "nslu2 ixp4xx"

Should this be "ixp4xx nslu2"?  At least in order to keep the original behavior?

> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-15  4:07 ` Khem Raj
  2010-10-15  6:56   ` Frans Meulenbroeks
@ 2010-10-15 14:18   ` Tom Rini
  1 sibling, 0 replies; 36+ messages in thread
From: Tom Rini @ 2010-10-15 14:18 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Chris Larson

Khem Raj wrote:
> On Thu, Oct 14, 2010 at 8:36 PM, Chris Larson <kergoth@gmail.com> wrote:
>> From: Chris Larson <chris_larson@mentor.com>
>>
>> Given the current implementation of OVERRIDES in bitbake, the variable is
>> expected to contain elements in the order least specific to most specific,
>> however, our current usage of it does not match that.  As one example, "local"
>> is supposed to always be the most specific override, yet currently it's the
>> least specific.  As another example, currently the target architecture is seen
>> as more specific than the machine, which is also clearly wrong.
>>
>> It becomes clear that a reversal of the current value will bring us to a more
>> sane behavior, and avoids the need for the dual overrides hack mentioned in
>> the comments, so clean those up as well.
>>
>> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
>> inject overrides elements which are more specific than the distro but less
>> specific than the machine, which is where things like MACHINE_CLASS or
>> SOC_FAMILY or the like would go.  This variable is *space* separated, to make
>> it easier and more convenient to assemble the variable incrementally, and it's
>> then translated to : separated when used in OVERRIDES.
>>
>> Signed-off-by: Chris Larson <chris_larson@mentor.com>
> 
> both things look nice to me. We might need to document MACHINE_OVERRIDES though.

Yes, no new variables without updating the docs.

-- 
Tom Rini
Mentor Graphics Corporation



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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-15 14:12 ` Maupin, Chase
@ 2010-10-15 15:17   ` Chris Larson
  2010-10-15 15:29     ` Maupin, Chase
  0 siblings, 1 reply; 36+ messages in thread
From: Chris Larson @ 2010-10-15 15:17 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Chris Larson

On Fri, Oct 15, 2010 at 7:12 AM, Maupin, Chase <chase.maupin@ti.com> wrote:

> > diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
> > index 8259127..b4a2fa6 100644
> > --- a/conf/machine/kixrp435.conf
> > +++ b/conf/machine/kixrp435.conf
> > @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
> >  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc
> > automatically.
> >  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
> >
> > -OVERRIDES =
> >
> "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build
> > -${BUILD_OS}:fail-fast:pn-${PN}"
> > +MACHINE_OVERRIDES += "nslu2 ixp4xx"
>
> Should this be "ixp4xx nslu2"?  At least in order to keep the original
> behavior?


Yes, good catch, thanks, I'll fix it in the next version of the patch.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-15 15:17   ` Chris Larson
@ 2010-10-15 15:29     ` Maupin, Chase
  0 siblings, 0 replies; 36+ messages in thread
From: Maupin, Chase @ 2010-10-15 15:29 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Chris Larson

> -----Original Message-----
> From: openembedded-devel-bounces@lists.openembedded.org
> [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf Of
> Chris Larson
> Sent: Friday, October 15, 2010 10:17 AM
> To: openembedded-devel@lists.openembedded.org
> Cc: Chris Larson
> Subject: Re: [oe] [PATCH] Reverse the order of OVERRIDES
> 
> On Fri, Oct 15, 2010 at 7:12 AM, Maupin, Chase <chase.maupin@ti.com>
> wrote:
> 
> > > diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
> > > index 8259127..b4a2fa6 100644
> > > --- a/conf/machine/kixrp435.conf
> > > +++ b/conf/machine/kixrp435.conf
> > > @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
> > >  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc
> > > automatically.
> > >  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
> > >
> > > -OVERRIDES =
> > >
> >
> "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build
> > > -${BUILD_OS}:fail-fast:pn-${PN}"
> > > +MACHINE_OVERRIDES += "nslu2 ixp4xx"
> >
> > Should this be "ixp4xx nslu2"?  At least in order to keep the original
> > behavior?
> 
> 
> Yes, good catch, thanks, I'll fix it in the next version of the patch.

Everything else looked OK to me.  Thanks for this change Chris.

> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

* [PATCH (v2)] Reverse the order of OVERRIDES
  2010-10-15  3:36 [PATCH] Reverse the order of OVERRIDES Chris Larson
                   ` (2 preceding siblings ...)
  2010-10-15 14:12 ` Maupin, Chase
@ 2010-10-15 15:41 ` Chris Larson
  2010-10-15 16:02   ` Maupin, Chase
                     ` (2 more replies)
  2010-10-16 18:04 ` [PATCH] " Martin Jansa
  4 siblings, 3 replies; 36+ messages in thread
From: Chris Larson @ 2010-10-15 15:41 UTC (permalink / raw)
  To: openembedded-devel

From: Chris Larson <chris_larson@mentor.com>

Given the current implementation of OVERRIDES in bitbake, the variable is
expected to contain elements in the order least specific to most specific,
however, our current usage of it does not match that.  As one example, "local"
is supposed to always be the most specific override, yet currently it's the
least specific.  As another example, currently the target architecture is seen
as more specific than the machine, which is also clearly wrong.

Big thanks to Chase Maupin for investigating and identifying this long
standing issue.

It becomes clear that a reversal of the current value will bring us to a more
sane behavior, and avoids the need for the dual overrides hack mentioned in
the comments, so this implements this reversal, and drops the unnecessary and
confusing comments.

This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
inject overrides elements which are more specific than the distro but less
specific than the machine, which is where things like MACHINE_CLASS or
SOC_FAMILY or the like would go.  This variable is *space* separated, to make
it easier and more convenient to assemble the variable incrementally.

Reported-by: Chase Maupin <chase.maupin@ti.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
---
 conf/bitbake.conf                             |   17 ++-----------
 conf/distro/include/arm-thumb.inc             |    6 ++--
 conf/distro/micro.conf                        |    6 ++--
 conf/distro/minimal.conf                      |    5 ++-
 conf/distro/shr.conf                          |    5 ++-
 conf/machine/fsg3be.conf                      |    2 +-
 conf/machine/kixrp435.conf                    |    2 +-
 conf/machine/nslu2be.conf                     |    2 +-
 conf/machine/nslu2le.conf                     |    2 +-
 docs/usermanual/chapters/common_use_cases.xml |   31 +++++++++++++++++++-----
 recipes/binutils/binutils_csl-arm-20050416.bb |    2 +-
 recipes/binutils/binutils_csl-arm-20050603.bb |    2 +-
 recipes/eglibc/eglibc-package.bbclass         |    2 +-
 recipes/glibc/glibc-package.inc               |    2 +-
 recipes/prelink/prelink_20061027.bb           |    2 +-
 recipes/prelink/prelink_20071009.bb           |    2 +-
 recipes/prelink/prelink_20090925.bb           |    2 +-
 17 files changed, 50 insertions(+), 42 deletions(-)

diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index a5d6a1a..30dcd3e 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -675,20 +675,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
 
 # Overrides are processed left to right, so the ones that are named later take precedence.
 # You generally want them to go from least to most specific.
-# 
-# This means that an envionment variable named '<foo>_arm' overrides an
-# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
-# an environment variable '<foo>_ramses' overrides '<foo>' but doesn't override
-# '<foo>_arm' when ${MACHINE} is 'ramses'. 
-# If you use combination ie '<foo>_arm_ramses', then '<foo>_arm_ramses' will override 
-# '<foo>_arm' and then '<foo>' will be overriden with that value from '<foo>_arm'.
-# And finally '<foo>_local' overrides anything, but with lowest priority.
-#
-# This works for  functions as well, they are really just environment variables.
-# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
-OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
-# Alternative OVERRIDES definition without "fail fast", usually only for native building and Scratchbox toolchains.
-#OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}"
+MACHINE_OVERRIDES ?= ""
+OVERRIDES = "pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
+${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES', True).split())}:${MACHINE}:local"
 
 ##################################################################
 # Include the rest of the config files.
diff --git a/conf/distro/include/arm-thumb.inc b/conf/distro/include/arm-thumb.inc
index 36edd4f..75ed978 100644
--- a/conf/distro/include/arm-thumb.inc
+++ b/conf/distro/include/arm-thumb.inc
@@ -16,9 +16,9 @@ THUMB_INTERWORK ?= "no"
 #    arm system and vice versa.  It is strongly recommended that DISTROs not
 #    turn this off - the actual cost is very small.
 
-OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
-OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
-OVERRIDES_append_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
+OVERRIDE_THUMB = "${@['', 'thumb:'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
+OVERRIDE_INTERWORK = "${@['', 'thumb-interwork:'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
+OVERRIDES_prepend_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
 
 #    Compiler and linker options for application code and kernel code.  These
 #    options ensure that the compiler has the correct settings for the selected
diff --git a/conf/distro/micro.conf b/conf/distro/micro.conf
index 6d396b3..19b5e62 100644
--- a/conf/distro/micro.conf
+++ b/conf/distro/micro.conf
@@ -69,10 +69,10 @@ require conf/distro/include/sane-toolchain.inc
 require conf/distro/include/arm-thumb.inc
 
 #############################################################################
-# OVERRIDES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
 #############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:\
-${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
 
 #############################################################################
 # PREFERRED VERSIONS
diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf
index 376ffde..0d32cfe 100644
--- a/conf/distro/minimal.conf
+++ b/conf/distro/minimal.conf
@@ -81,9 +81,10 @@ KERNEL = "kernel26"
 MACHINE_KERNEL_VERSION = "2.6"
 
 #############################################################################
-# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
 #############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
 
 #############################################################################
 # TOOLCHAIN
diff --git a/conf/distro/shr.conf b/conf/distro/shr.conf
index ade8cba..74e3fe9 100644
--- a/conf/distro/shr.conf
+++ b/conf/distro/shr.conf
@@ -151,9 +151,10 @@ KERNEL = "kernel26"
 MACHINE_KERNEL_VERSION = "2.6"
 
 #############################################################################
-# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
+# Ensure MACHINE_CLASS is in OVERRIDES
 #############################################################################
-OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_CLASS ?= ""
+MACHINE_OVERRIDES += "${MACHINE_CLASS}"
 
 #############################################################################
 # TOOLCHAIN
diff --git a/conf/machine/fsg3be.conf b/conf/machine/fsg3be.conf
index a2ca95b..c5ddc25 100644
--- a/conf/machine/fsg3be.conf
+++ b/conf/machine/fsg3be.conf
@@ -8,7 +8,7 @@ PACKAGE_EXTRA_ARCHS = "ixp4xxbe"
 
 MACHINE_ARCH = "ixp4xxbe"
 
-OVERRIDES = "local:${MACHINE}:ixp4xxbe:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx ixp4xxbe"
 
 # Match the vendor's latest kernel
 PREFERRED_PROVIDER_virtual/kernel ?= "fsg3-kernel"
diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
index 8259127..ba8216d 100644
--- a/conf/machine/kixrp435.conf
+++ b/conf/machine/kixrp435.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
 # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
 PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
 
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx nslu2"
 
 PREFERRED_PROVIDER_virtual/kernel = "linux"
 PREFERRED_VERSION_linux = "2.6.30"
diff --git a/conf/machine/nslu2be.conf b/conf/machine/nslu2be.conf
index 9bc92f1..69d12a7 100644
--- a/conf/machine/nslu2be.conf
+++ b/conf/machine/nslu2be.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "armeb"
 # Note: armv4b armv4tb armv5teb will be added by tune-xscale.inc automatically.
 PACKAGE_EXTRA_ARCHS = "armv5eb ixp4xxbe"
 
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx nslu2"
 
 ROOT_FLASH_SIZE ?= "6"
 
diff --git a/conf/machine/nslu2le.conf b/conf/machine/nslu2le.conf
index 62e47cb..5cd8a77 100644
--- a/conf/machine/nslu2le.conf
+++ b/conf/machine/nslu2le.conf
@@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
 # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
 PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
 
-OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
+MACHINE_OVERRIDES += "ixp4xx nslu2"
 
 ROOT_FLASH_SIZE ?= "6"
 
diff --git a/docs/usermanual/chapters/common_use_cases.xml b/docs/usermanual/chapters/common_use_cases.xml
index 8202dda..2114047 100644
--- a/docs/usermanual/chapters/common_use_cases.xml
+++ b/docs/usermanual/chapters/common_use_cases.xml
@@ -7,8 +7,8 @@
 
     <para>Creating a new distribution is not complicated, however we urge you
     to try existing distributions first, because it's also very easy to do
-    wrong. The config needs to be created in $OEBASE/openembedded/conf/distro 
-    directory. So what has to be inside? 
+    wrong. The config needs to be created in $OEBASE/openembedded/conf/distro
+    directory. So what has to be inside?
       <itemizedlist>
         <listitem>
           <para><command>DISTRO_VERSION</command> so users will know which
@@ -72,8 +72,8 @@ SRCDATE = "20061014"
   <section id="commonuse_new_machine">
     <title>Adding a new Machine</title>
 
-    <para>To be able to build for a device OpenEmbedded has to know about it, 
-    so a machine config file needs to be written. All of the machine 
+    <para>To be able to build for a device OpenEmbedded has to know about it,
+    so a machine config file needs to be written. All of the machine
     configs are stored in $OEBASE/openembedded/conf/machine/ directory.</para>
 
     <para>As usual some variables are required: <itemizedlist>
@@ -97,6 +97,23 @@ SRCDATE = "20061014"
     <para>There are also some optional variables that can be defined:
     <itemizedlist>
     <listitem>
+      <para>
+        <command>MACHINE_OVERRIDES</command> lists additional items to add to
+        the <command>OVERRIDES</command> variable, between the
+        <command>DISTRO</command> and the <command>MACHINE</command>.  This is
+        utilized to add overrides which are less specific than the machine,
+        but are nonetheless related to it, allowing us to define variables a
+        certain way for a group of machines, rather than for each individual
+        one.  As an example, this variable may be used by the distribution to
+        add <command>SOC_FAMILY</command> or <command>MACHINE_CLASS</command>.
+      </para>
+      <para>
+        Note that this variable is space separated, and should always be
+        manipulated with +=, to ensure it's built up incrementally, and no
+        additions are lost.
+      </para>
+    </listitem>
+    <listitem>
           <para><command>SOC_FAMILY</command> describes a family of processors
             that all share common features such as kernel versions,
             bootloaders, etc.  This is used to allow overrides for a whole
@@ -105,7 +122,7 @@ SRCDATE = "20061014"
             or local setting.
           </para>
           <para>
-            NOTE: SOC_FAMILY is different than MACHINE_CLASS in that 
+            NOTE: SOC_FAMILY is different than MACHINE_CLASS in that
             MACHINE_CLASS is intended to specify a grouping of devices
             that may have different processors but share common features.
             For example all OMAP3 devices can be described using the SOC_FAMILY
@@ -139,7 +156,7 @@ SRCDATE = "20061014"
             <listitem><para>for cvs: add 'PV = "1.1+cvs${SRCREV}"' to your bb file.</para></listitem>
           </itemizedlist>
         Accompany either with an entry to conf/distro/include/sane-srcrevs.inc for a revision that you know
-        builds successfully.  It is also common to define the stable SRCREV 
+        builds successfully.  It is also common to define the stable SRCREV
         for your package directly in the package recipe.
         </para>
         <para>
@@ -276,7 +293,7 @@ RDEPENDS_${PN} += "\
             <title>Putting it together</title>
             <para>In the previous two sections we have prepared the host and
             target side. One thing that is missing is combining the two newly
-            created tasks and actually creating the SDK. This is what we are 
+            created tasks and actually creating the SDK. This is what we are
             going to do now.</para>
 
             <para>Create <filename>meta-toolchain-YOU.bb</filename> in the
diff --git a/recipes/binutils/binutils_csl-arm-20050416.bb b/recipes/binutils/binutils_csl-arm-20050416.bb
index ad45438..71803d1 100644
--- a/recipes/binutils/binutils_csl-arm-20050416.bb
+++ b/recipes/binutils/binutils_csl-arm-20050416.bb
@@ -7,7 +7,7 @@ LICENSE = "GPL"
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
 PV = "2.15.99+csl-arm+cvs20050416"
 PR = "r3"
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
 DEFAULT_PREFERENCE = "-1"
 DEFAULT_PREFERENCE_arm-linux = "-1"
 DEFAULT_PREFERENCE_arm-linuxeabi = "-1"
diff --git a/recipes/binutils/binutils_csl-arm-20050603.bb b/recipes/binutils/binutils_csl-arm-20050603.bb
index 595cb98..50e8677 100644
--- a/recipes/binutils/binutils_csl-arm-20050603.bb
+++ b/recipes/binutils/binutils_csl-arm-20050603.bb
@@ -7,7 +7,7 @@ LICENSE = "GPL"
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
 PV = "2.15.99+csl-arm+cvs20050603"
 PR = "r3"
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
 DEFAULT_PREFERENCE = "-1"
 #DEFAULT_PREFERENCE_arm-linux = "1"
 #DEFAULT_PREFERENCE_arm-linuxeabi = "1"
diff --git a/recipes/eglibc/eglibc-package.bbclass b/recipes/eglibc/eglibc-package.bbclass
index dbca1ab..c802bd5 100644
--- a/recipes/eglibc/eglibc-package.bbclass
+++ b/recipes/eglibc/eglibc-package.bbclass
@@ -116,7 +116,7 @@ def get_eglibc_fpu_setting(bb, d):
 EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}"
 EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
 
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
 
 do_configure_prepend() {
         sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
diff --git a/recipes/glibc/glibc-package.inc b/recipes/glibc/glibc-package.inc
index 0b263bb..8cd8564 100644
--- a/recipes/glibc/glibc-package.inc
+++ b/recipes/glibc/glibc-package.inc
@@ -44,7 +44,7 @@ def get_glibc_fpu_setting(bb, d):
 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
 EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
 
-OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
 
 do_install() {
 	oe_runmake install_root=${D} install
diff --git a/recipes/prelink/prelink_20061027.bb b/recipes/prelink/prelink_20061027.bb
index ad2faf5..552117b 100644
--- a/recipes/prelink/prelink_20061027.bb
+++ b/recipes/prelink/prelink_20061027.bb
@@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
            file://prelink.default"
 
 TARGET_OS_ORIG := "${TARGET_OS}"
-OVERRIDES_append = ":${TARGET_OS_ORIG}"
+OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
 SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
 
 S = "${WORKDIR}/prelink-0.0.${PV}"
diff --git a/recipes/prelink/prelink_20071009.bb b/recipes/prelink/prelink_20071009.bb
index faf930c..e2ab3fb 100644
--- a/recipes/prelink/prelink_20071009.bb
+++ b/recipes/prelink/prelink_20071009.bb
@@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
            file://prelink.default"
 
 TARGET_OS_ORIG := "${TARGET_OS}"
-OVERRIDES_append = ":${TARGET_OS_ORIG}"
+OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
 SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
 
 S = "${WORKDIR}/prelink-0.0.${PV}"
diff --git a/recipes/prelink/prelink_20090925.bb b/recipes/prelink/prelink_20090925.bb
index 4c83402..5b247b6 100644
--- a/recipes/prelink/prelink_20090925.bb
+++ b/recipes/prelink/prelink_20090925.bb
@@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
            file://prelink.default"
 
 #TARGET_OS_ORIG := "${TARGET_OS}"
-#OVERRIDES_append = ":${TARGET_OS_ORIG}"
+#OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
 #SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
 
 S = "${WORKDIR}/prelink-0.0.${PV}"
-- 
1.7.2.3




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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-10-15 15:41 ` [PATCH (v2)] " Chris Larson
@ 2010-10-15 16:02   ` Maupin, Chase
  2010-10-15 17:20   ` Khem Raj
  2010-10-15 19:37   ` Koen Kooi
  2 siblings, 0 replies; 36+ messages in thread
From: Maupin, Chase @ 2010-10-15 16:02 UTC (permalink / raw)
  To: openembedded-devel

> -----Original Message-----
> From: openembedded-devel-bounces@lists.openembedded.org
> [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf Of
> Chris Larson
> Sent: Friday, October 15, 2010 10:41 AM
> To: openembedded-devel@lists.openembedded.org
> Subject: [oe] [PATCH (v2)] Reverse the order of OVERRIDES
>
> From: Chris Larson <chris_larson@mentor.com>
>
> Given the current implementation of OVERRIDES in bitbake, the variable is
> expected to contain elements in the order least specific to most specific,
> however, our current usage of it does not match that.  As one example,
> "local"
> is supposed to always be the most specific override, yet currently it's
> the
> least specific.  As another example, currently the target architecture is
> seen
> as more specific than the machine, which is also clearly wrong.
>
> Big thanks to Chase Maupin for investigating and identifying this long
> standing issue.
>
> It becomes clear that a reversal of the current value will bring us to a
> more
> sane behavior, and avoids the need for the dual overrides hack mentioned
> in
> the comments, so this implements this reversal, and drops the unnecessary
> and
> confusing comments.
>
> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism
> to
> inject overrides elements which are more specific than the distro but less
> specific than the machine, which is where things like MACHINE_CLASS or
> SOC_FAMILY or the like would go.  This variable is *space* separated, to
> make
> it easier and more convenient to assemble the variable incrementally.
>
> Reported-by: Chase Maupin <chase.maupin@ti.com>
> Signed-off-by: Chris Larson <chris_larson@mentor.com>


Acked-by: Chase Maupin <chase.maupin@ti.com>

> ---
>  conf/bitbake.conf                             |   17 ++-----------
>  conf/distro/include/arm-thumb.inc             |    6 ++--
>  conf/distro/micro.conf                        |    6 ++--
>  conf/distro/minimal.conf                      |    5 ++-
>  conf/distro/shr.conf                          |    5 ++-
>  conf/machine/fsg3be.conf                      |    2 +-
>  conf/machine/kixrp435.conf                    |    2 +-
>  conf/machine/nslu2be.conf                     |    2 +-
>  conf/machine/nslu2le.conf                     |    2 +-
>  docs/usermanual/chapters/common_use_cases.xml |   31 +++++++++++++++++++-
> ----
>  recipes/binutils/binutils_csl-arm-20050416.bb |    2 +-
>  recipes/binutils/binutils_csl-arm-20050603.bb |    2 +-
>  recipes/eglibc/eglibc-package.bbclass         |    2 +-
>  recipes/glibc/glibc-package.inc               |    2 +-
>  recipes/prelink/prelink_20061027.bb           |    2 +-
>  recipes/prelink/prelink_20071009.bb           |    2 +-
>  recipes/prelink/prelink_20090925.bb           |    2 +-
>  17 files changed, 50 insertions(+), 42 deletions(-)
>
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index a5d6a1a..30dcd3e 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -675,20 +675,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
>
>  # Overrides are processed left to right, so the ones that are named later
> take precedence.
>  # You generally want them to go from least to most specific.
> -#
> -# This means that an envionment variable named '<foo>_arm' overrides an
> -# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
> -# an environment variable '<foo>_ramses' overrides '<foo>' but doesn't
> override
> -# '<foo>_arm' when ${MACHINE} is 'ramses'.
> -# If you use combination ie '<foo>_arm_ramses', then '<foo>_arm_ramses'
> will override
> -# '<foo>_arm' and then '<foo>' will be overriden with that value from
> '<foo>_arm'.
> -# And finally '<foo>_local' overrides anything, but with lowest priority.
> -#
> -# This works for  functions as well, they are really just environment
> variables.
> -# Default OVERRIDES to make compilation fail fast in case of build system
> misconfiguration.
> -OVERRIDES =
> "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-
> ${BUILD_OS}:fail-fast:pn-${PN}"
> -# Alternative OVERRIDES definition without "fail fast", usually only for
> native building and Scratchbox toolchains.
> -#OVERRIDES =
> "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-
> ${BUILD_OS}:pn-${PN}"
> +MACHINE_OVERRIDES ?= ""
> +OVERRIDES = "pn-${PN}:fail-fast:build-
> ${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
> +${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES',
> True).split())}:${MACHINE}:local"
>
>  ##################################################################
>  # Include the rest of the config files.
> diff --git a/conf/distro/include/arm-thumb.inc b/conf/distro/include/arm-
> thumb.inc
> index 36edd4f..75ed978 100644
> --- a/conf/distro/include/arm-thumb.inc
> +++ b/conf/distro/include/arm-thumb.inc
> @@ -16,9 +16,9 @@ THUMB_INTERWORK ?= "no"
>  #    arm system and vice versa.  It is strongly recommended that DISTROs
> not
>  #    turn this off - the actual cost is very small.
>
> -OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET',
> d, 1) == 'thumb']}"
> -OVERRIDE_INTERWORK = "${@['', ':thumb-
> interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
> -OVERRIDES_append_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
> +OVERRIDE_THUMB = "${@['', 'thumb:'][bb.data.getVar('ARM_INSTRUCTION_SET',
> d, 1) == 'thumb']}"
> +OVERRIDE_INTERWORK = "${@['', 'thumb-
> interwork:'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
> +OVERRIDES_prepend_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
>
>  #    Compiler and linker options for application code and kernel code.
> These
>  #    options ensure that the compiler has the correct settings for the
> selected
> diff --git a/conf/distro/micro.conf b/conf/distro/micro.conf
> index 6d396b3..19b5e62 100644
> --- a/conf/distro/micro.conf
> +++ b/conf/distro/micro.conf
> @@ -69,10 +69,10 @@ require conf/distro/include/sane-toolchain.inc
>  require conf/distro/include/arm-thumb.inc
>
>
> ##########################################################################
> ###
> -# OVERRIDES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>
> ##########################################################################
> ###
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:\
> -${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>
> ##########################################################################
> ###
>  # PREFERRED VERSIONS
> diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf
> index 376ffde..0d32cfe 100644
> --- a/conf/distro/minimal.conf
> +++ b/conf/distro/minimal.conf
> @@ -81,9 +81,10 @@ KERNEL = "kernel26"
>  MACHINE_KERNEL_VERSION = "2.6"
>
>
> ##########################################################################
> ###
> -# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>
> ##########################################################################
> ###
> -OVERRIDES =
> "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:b
> uild-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>
> ##########################################################################
> ###
>  # TOOLCHAIN
> diff --git a/conf/distro/shr.conf b/conf/distro/shr.conf
> index ade8cba..74e3fe9 100644
> --- a/conf/distro/shr.conf
> +++ b/conf/distro/shr.conf
> @@ -151,9 +151,10 @@ KERNEL = "kernel26"
>  MACHINE_KERNEL_VERSION = "2.6"
>
>
> ##########################################################################
> ###
> -# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>
> ##########################################################################
> ###
> -OVERRIDES =
> "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:b
> uild-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>
> ##########################################################################
> ###
>  # TOOLCHAIN
> diff --git a/conf/machine/fsg3be.conf b/conf/machine/fsg3be.conf
> index a2ca95b..c5ddc25 100644
> --- a/conf/machine/fsg3be.conf
> +++ b/conf/machine/fsg3be.conf
> @@ -8,7 +8,7 @@ PACKAGE_EXTRA_ARCHS = "ixp4xxbe"
>
>  MACHINE_ARCH = "ixp4xxbe"
>
> -OVERRIDES =
> "local:${MACHINE}:ixp4xxbe:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:bu
> ild-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx ixp4xxbe"
>
>  # Match the vendor's latest kernel
>  PREFERRED_PROVIDER_virtual/kernel ?= "fsg3-kernel"
> diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
> index 8259127..ba8216d 100644
> --- a/conf/machine/kixrp435.conf
> +++ b/conf/machine/kixrp435.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc
> automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
>
> -OVERRIDES =
> "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build
> -${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx nslu2"
>
>  PREFERRED_PROVIDER_virtual/kernel = "linux"
>  PREFERRED_VERSION_linux = "2.6.30"
> diff --git a/conf/machine/nslu2be.conf b/conf/machine/nslu2be.conf
> index 9bc92f1..69d12a7 100644
> --- a/conf/machine/nslu2be.conf
> +++ b/conf/machine/nslu2be.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "armeb"
>  # Note: armv4b armv4tb armv5teb will be added by tune-xscale.inc
> automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5eb ixp4xxbe"
>
> -OVERRIDES =
> "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build
> -${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx nslu2"
>
>  ROOT_FLASH_SIZE ?= "6"
>
> diff --git a/conf/machine/nslu2le.conf b/conf/machine/nslu2le.conf
> index 62e47cb..5cd8a77 100644
> --- a/conf/machine/nslu2le.conf
> +++ b/conf/machine/nslu2le.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc
> automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
>
> -OVERRIDES =
> "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build
> -${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx nslu2"
>
>  ROOT_FLASH_SIZE ?= "6"
>
> diff --git a/docs/usermanual/chapters/common_use_cases.xml
> b/docs/usermanual/chapters/common_use_cases.xml
> index 8202dda..2114047 100644
> --- a/docs/usermanual/chapters/common_use_cases.xml
> +++ b/docs/usermanual/chapters/common_use_cases.xml
> @@ -7,8 +7,8 @@
>
>      <para>Creating a new distribution is not complicated, however we urge
> you
>      to try existing distributions first, because it's also very easy to
> do
> -    wrong. The config needs to be created in
> $OEBASE/openembedded/conf/distro
> -    directory. So what has to be inside?
> +    wrong. The config needs to be created in
> $OEBASE/openembedded/conf/distro
> +    directory. So what has to be inside?
>        <itemizedlist>
>          <listitem>
>            <para><command>DISTRO_VERSION</command> so users will know
> which
> @@ -72,8 +72,8 @@ SRCDATE = "20061014"
>    <section id="commonuse_new_machine">
>      <title>Adding a new Machine</title>
>
> -    <para>To be able to build for a device OpenEmbedded has to know about
> it,
> -    so a machine config file needs to be written. All of the machine
> +    <para>To be able to build for a device OpenEmbedded has to know about
> it,
> +    so a machine config file needs to be written. All of the machine
>      configs are stored in $OEBASE/openembedded/conf/machine/
> directory.</para>
>
>      <para>As usual some variables are required: <itemizedlist>
> @@ -97,6 +97,23 @@ SRCDATE = "20061014"
>      <para>There are also some optional variables that can be defined:
>      <itemizedlist>
>      <listitem>
> +      <para>
> +        <command>MACHINE_OVERRIDES</command> lists additional items to
> add to
> +        the <command>OVERRIDES</command> variable, between the
> +        <command>DISTRO</command> and the <command>MACHINE</command>.
> This is
> +        utilized to add overrides which are less specific than the
> machine,
> +        but are nonetheless related to it, allowing us to define
> variables a
> +        certain way for a group of machines, rather than for each
> individual
> +        one.  As an example, this variable may be used by the
> distribution to
> +        add <command>SOC_FAMILY</command> or
> <command>MACHINE_CLASS</command>.
> +      </para>
> +      <para>
> +        Note that this variable is space separated, and should always be
> +        manipulated with +=, to ensure it's built up incrementally, and
> no
> +        additions are lost.
> +      </para>
> +    </listitem>
> +    <listitem>
>            <para><command>SOC_FAMILY</command> describes a family of
> processors
>              that all share common features such as kernel versions,
>              bootloaders, etc.  This is used to allow overrides for a
> whole
> @@ -105,7 +122,7 @@ SRCDATE = "20061014"
>              or local setting.
>            </para>
>            <para>
> -            NOTE: SOC_FAMILY is different than MACHINE_CLASS in that
> +            NOTE: SOC_FAMILY is different than MACHINE_CLASS in that
>              MACHINE_CLASS is intended to specify a grouping of devices
>              that may have different processors but share common features.
>              For example all OMAP3 devices can be described using the
> SOC_FAMILY
> @@ -139,7 +156,7 @@ SRCDATE = "20061014"
>              <listitem><para>for cvs: add 'PV = "1.1+cvs${SRCREV}"' to
> your bb file.</para></listitem>
>            </itemizedlist>
>          Accompany either with an entry to conf/distro/include/sane-
> srcrevs.inc for a revision that you know
> -        builds successfully.  It is also common to define the stable
> SRCREV
> +        builds successfully.  It is also common to define the stable
> SRCREV
>          for your package directly in the package recipe.
>          </para>
>          <para>
> @@ -276,7 +293,7 @@ RDEPENDS_${PN} += "\
>              <title>Putting it together</title>
>              <para>In the previous two sections we have prepared the host
> and
>              target side. One thing that is missing is combining the two
> newly
> -            created tasks and actually creating the SDK. This is what we
> are
> +            created tasks and actually creating the SDK. This is what we
> are
>              going to do now.</para>
>
>              <para>Create <filename>meta-toolchain-YOU.bb</filename> in
> the
> diff --git a/recipes/binutils/binutils_csl-arm-20050416.bb
> b/recipes/binutils/binutils_csl-arm-20050416.bb
> index ad45438..71803d1 100644
> --- a/recipes/binutils/binutils_csl-arm-20050416.bb
> +++ b/recipes/binutils/binutils_csl-arm-20050416.bb
> @@ -7,7 +7,7 @@ LICENSE = "GPL"
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
>  PV = "2.15.99+csl-arm+cvs20050416"
>  PR = "r3"
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  DEFAULT_PREFERENCE = "-1"
>  DEFAULT_PREFERENCE_arm-linux = "-1"
>  DEFAULT_PREFERENCE_arm-linuxeabi = "-1"
> diff --git a/recipes/binutils/binutils_csl-arm-20050603.bb
> b/recipes/binutils/binutils_csl-arm-20050603.bb
> index 595cb98..50e8677 100644
> --- a/recipes/binutils/binutils_csl-arm-20050603.bb
> +++ b/recipes/binutils/binutils_csl-arm-20050603.bb
> @@ -7,7 +7,7 @@ LICENSE = "GPL"
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
>  PV = "2.15.99+csl-arm+cvs20050603"
>  PR = "r3"
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  DEFAULT_PREFERENCE = "-1"
>  #DEFAULT_PREFERENCE_arm-linux = "1"
>  #DEFAULT_PREFERENCE_arm-linuxeabi = "1"
> diff --git a/recipes/eglibc/eglibc-package.bbclass
> b/recipes/eglibc/eglibc-package.bbclass
> index dbca1ab..c802bd5 100644
> --- a/recipes/eglibc/eglibc-package.bbclass
> +++ b/recipes/eglibc/eglibc-package.bbclass
> @@ -116,7 +116,7 @@ def get_eglibc_fpu_setting(bb, d):
>  EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}"
>  EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
>
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>
>  do_configure_prepend() {
>          sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
> diff --git a/recipes/glibc/glibc-package.inc b/recipes/glibc/glibc-
> package.inc
> index 0b263bb..8cd8564 100644
> --- a/recipes/glibc/glibc-package.inc
> +++ b/recipes/glibc/glibc-package.inc
> @@ -44,7 +44,7 @@ def get_glibc_fpu_setting(bb, d):
>  EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
>  EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
>
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>
>  do_install() {
>       oe_runmake install_root=${D} install
> diff --git a/recipes/prelink/prelink_20061027.bb
> b/recipes/prelink/prelink_20061027.bb
> index ad2faf5..552117b 100644
> --- a/recipes/prelink/prelink_20061027.bb
> +++ b/recipes/prelink/prelink_20061027.bb
> @@ -12,7 +12,7 @@ SRC_URI =
> "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>             file://prelink.default"
>
>  TARGET_OS_ORIG := "${TARGET_OS}"
> -OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> diff --git a/recipes/prelink/prelink_20071009.bb
> b/recipes/prelink/prelink_20071009.bb
> index faf930c..e2ab3fb 100644
> --- a/recipes/prelink/prelink_20071009.bb
> +++ b/recipes/prelink/prelink_20071009.bb
> @@ -12,7 +12,7 @@ SRC_URI =
> "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>             file://prelink.default"
>
>  TARGET_OS_ORIG := "${TARGET_OS}"
> -OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> diff --git a/recipes/prelink/prelink_20090925.bb
> b/recipes/prelink/prelink_20090925.bb
> index 4c83402..5b247b6 100644
> --- a/recipes/prelink/prelink_20090925.bb
> +++ b/recipes/prelink/prelink_20090925.bb
> @@ -12,7 +12,7 @@ SRC_URI =
> "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>             file://prelink.default"
>
>  #TARGET_OS_ORIG := "${TARGET_OS}"
> -#OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +#OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  #SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> --
> 1.7.2.3
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-10-15 15:41 ` [PATCH (v2)] " Chris Larson
  2010-10-15 16:02   ` Maupin, Chase
@ 2010-10-15 17:20   ` Khem Raj
  2010-10-15 19:37   ` Koen Kooi
  2 siblings, 0 replies; 36+ messages in thread
From: Khem Raj @ 2010-10-15 17:20 UTC (permalink / raw)
  To: openembedded-devel

On Fri, Oct 15, 2010 at 8:41 AM, Chris Larson <kergoth@gmail.com> wrote:
> From: Chris Larson <chris_larson@mentor.com>
>
> Given the current implementation of OVERRIDES in bitbake, the variable is
> expected to contain elements in the order least specific to most specific,
> however, our current usage of it does not match that.  As one example, "local"
> is supposed to always be the most specific override, yet currently it's the
> least specific.  As another example, currently the target architecture is seen
> as more specific than the machine, which is also clearly wrong.
>
> Big thanks to Chase Maupin for investigating and identifying this long
> standing issue.
>
> It becomes clear that a reversal of the current value will bring us to a more
> sane behavior, and avoids the need for the dual overrides hack mentioned in
> the comments, so this implements this reversal, and drops the unnecessary and
> confusing comments.
>
> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
> inject overrides elements which are more specific than the distro but less
> specific than the machine, which is where things like MACHINE_CLASS or
> SOC_FAMILY or the like would go.  This variable is *space* separated, to make
> it easier and more convenient to assemble the variable incrementally.
>
> Reported-by: Chase Maupin <chase.maupin@ti.com>
> Signed-off-by: Chris Larson <chris_larson@mentor.com>

Acked-by: Khem Raj <raj.khem@gmail.com>

> ---
>  conf/bitbake.conf                             |   17 ++-----------
>  conf/distro/include/arm-thumb.inc             |    6 ++--
>  conf/distro/micro.conf                        |    6 ++--
>  conf/distro/minimal.conf                      |    5 ++-
>  conf/distro/shr.conf                          |    5 ++-
>  conf/machine/fsg3be.conf                      |    2 +-
>  conf/machine/kixrp435.conf                    |    2 +-
>  conf/machine/nslu2be.conf                     |    2 +-
>  conf/machine/nslu2le.conf                     |    2 +-
>  docs/usermanual/chapters/common_use_cases.xml |   31 +++++++++++++++++++-----
>  recipes/binutils/binutils_csl-arm-20050416.bb |    2 +-
>  recipes/binutils/binutils_csl-arm-20050603.bb |    2 +-
>  recipes/eglibc/eglibc-package.bbclass         |    2 +-
>  recipes/glibc/glibc-package.inc               |    2 +-
>  recipes/prelink/prelink_20061027.bb           |    2 +-
>  recipes/prelink/prelink_20071009.bb           |    2 +-
>  recipes/prelink/prelink_20090925.bb           |    2 +-
>  17 files changed, 50 insertions(+), 42 deletions(-)
>
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index a5d6a1a..30dcd3e 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -675,20 +675,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
>
>  # Overrides are processed left to right, so the ones that are named later take precedence.
>  # You generally want them to go from least to most specific.
> -#
> -# This means that an envionment variable named '<foo>_arm' overrides an
> -# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
> -# an environment variable '<foo>_ramses' overrides '<foo>' but doesn't override
> -# '<foo>_arm' when ${MACHINE} is 'ramses'.
> -# If you use combination ie '<foo>_arm_ramses', then '<foo>_arm_ramses' will override
> -# '<foo>_arm' and then '<foo>' will be overriden with that value from '<foo>_arm'.
> -# And finally '<foo>_local' overrides anything, but with lowest priority.
> -#
> -# This works for  functions as well, they are really just environment variables.
> -# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
> -OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> -# Alternative OVERRIDES definition without "fail fast", usually only for native building and Scratchbox toolchains.
> -#OVERRIDES = "local:${MACHINE}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}"
> +MACHINE_OVERRIDES ?= ""
> +OVERRIDES = "pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
> +${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES', True).split())}:${MACHINE}:local"
>
>  ##################################################################
>  # Include the rest of the config files.
> diff --git a/conf/distro/include/arm-thumb.inc b/conf/distro/include/arm-thumb.inc
> index 36edd4f..75ed978 100644
> --- a/conf/distro/include/arm-thumb.inc
> +++ b/conf/distro/include/arm-thumb.inc
> @@ -16,9 +16,9 @@ THUMB_INTERWORK ?= "no"
>  #    arm system and vice versa.  It is strongly recommended that DISTROs not
>  #    turn this off - the actual cost is very small.
>
> -OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
> -OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
> -OVERRIDES_append_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
> +OVERRIDE_THUMB = "${@['', 'thumb:'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
> +OVERRIDE_INTERWORK = "${@['', 'thumb-interwork:'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}"
> +OVERRIDES_prepend_arm =. "${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}"
>
>  #    Compiler and linker options for application code and kernel code.  These
>  #    options ensure that the compiler has the correct settings for the selected
> diff --git a/conf/distro/micro.conf b/conf/distro/micro.conf
> index 6d396b3..19b5e62 100644
> --- a/conf/distro/micro.conf
> +++ b/conf/distro/micro.conf
> @@ -69,10 +69,10 @@ require conf/distro/include/sane-toolchain.inc
>  require conf/distro/include/arm-thumb.inc
>
>  #############################################################################
> -# OVERRIDES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:\
> -${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>  #############################################################################
>  # PREFERRED VERSIONS
> diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf
> index 376ffde..0d32cfe 100644
> --- a/conf/distro/minimal.conf
> +++ b/conf/distro/minimal.conf
> @@ -81,9 +81,10 @@ KERNEL = "kernel26"
>  MACHINE_KERNEL_VERSION = "2.6"
>
>  #############################################################################
> -# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>  #############################################################################
>  # TOOLCHAIN
> diff --git a/conf/distro/shr.conf b/conf/distro/shr.conf
> index ade8cba..74e3fe9 100644
> --- a/conf/distro/shr.conf
> +++ b/conf/distro/shr.conf
> @@ -151,9 +151,10 @@ KERNEL = "kernel26"
>  MACHINE_KERNEL_VERSION = "2.6"
>
>  #############################################################################
> -# OVERWRITES adjusted from bitbake.conf to feature the MACHINE_CLASS
> +# Ensure MACHINE_CLASS is in OVERRIDES
>  #############################################################################
> -OVERRIDES = "local:${MACHINE}:${MACHINE_CLASS}:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_CLASS ?= ""
> +MACHINE_OVERRIDES += "${MACHINE_CLASS}"
>
>  #############################################################################
>  # TOOLCHAIN
> diff --git a/conf/machine/fsg3be.conf b/conf/machine/fsg3be.conf
> index a2ca95b..c5ddc25 100644
> --- a/conf/machine/fsg3be.conf
> +++ b/conf/machine/fsg3be.conf
> @@ -8,7 +8,7 @@ PACKAGE_EXTRA_ARCHS = "ixp4xxbe"
>
>  MACHINE_ARCH = "ixp4xxbe"
>
> -OVERRIDES = "local:${MACHINE}:ixp4xxbe:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx ixp4xxbe"
>
>  # Match the vendor's latest kernel
>  PREFERRED_PROVIDER_virtual/kernel ?= "fsg3-kernel"
> diff --git a/conf/machine/kixrp435.conf b/conf/machine/kixrp435.conf
> index 8259127..ba8216d 100644
> --- a/conf/machine/kixrp435.conf
> +++ b/conf/machine/kixrp435.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
>
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx nslu2"
>
>  PREFERRED_PROVIDER_virtual/kernel = "linux"
>  PREFERRED_VERSION_linux = "2.6.30"
> diff --git a/conf/machine/nslu2be.conf b/conf/machine/nslu2be.conf
> index 9bc92f1..69d12a7 100644
> --- a/conf/machine/nslu2be.conf
> +++ b/conf/machine/nslu2be.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "armeb"
>  # Note: armv4b armv4tb armv5teb will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5eb ixp4xxbe"
>
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx nslu2"
>
>  ROOT_FLASH_SIZE ?= "6"
>
> diff --git a/conf/machine/nslu2le.conf b/conf/machine/nslu2le.conf
> index 62e47cb..5cd8a77 100644
> --- a/conf/machine/nslu2le.conf
> +++ b/conf/machine/nslu2le.conf
> @@ -7,7 +7,7 @@ TARGET_ARCH = "arm"
>  # Note: armv4 armv4t armv5te will be added by tune-xscale.inc automatically.
>  PACKAGE_EXTRA_ARCHS = "armv5e ixp4xxle"
>
> -OVERRIDES = "local:${MACHINE}:nslu2:ixp4xx:${DISTRO}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
> +MACHINE_OVERRIDES += "ixp4xx nslu2"
>
>  ROOT_FLASH_SIZE ?= "6"
>
> diff --git a/docs/usermanual/chapters/common_use_cases.xml b/docs/usermanual/chapters/common_use_cases.xml
> index 8202dda..2114047 100644
> --- a/docs/usermanual/chapters/common_use_cases.xml
> +++ b/docs/usermanual/chapters/common_use_cases.xml
> @@ -7,8 +7,8 @@
>
>     <para>Creating a new distribution is not complicated, however we urge you
>     to try existing distributions first, because it's also very easy to do
> -    wrong. The config needs to be created in $OEBASE/openembedded/conf/distro
> -    directory. So what has to be inside?
> +    wrong. The config needs to be created in $OEBASE/openembedded/conf/distro
> +    directory. So what has to be inside?
>       <itemizedlist>
>         <listitem>
>           <para><command>DISTRO_VERSION</command> so users will know which
> @@ -72,8 +72,8 @@ SRCDATE = "20061014"
>   <section id="commonuse_new_machine">
>     <title>Adding a new Machine</title>
>
> -    <para>To be able to build for a device OpenEmbedded has to know about it,
> -    so a machine config file needs to be written. All of the machine
> +    <para>To be able to build for a device OpenEmbedded has to know about it,
> +    so a machine config file needs to be written. All of the machine
>     configs are stored in $OEBASE/openembedded/conf/machine/ directory.</para>
>
>     <para>As usual some variables are required: <itemizedlist>
> @@ -97,6 +97,23 @@ SRCDATE = "20061014"
>     <para>There are also some optional variables that can be defined:
>     <itemizedlist>
>     <listitem>
> +      <para>
> +        <command>MACHINE_OVERRIDES</command> lists additional items to add to
> +        the <command>OVERRIDES</command> variable, between the
> +        <command>DISTRO</command> and the <command>MACHINE</command>.  This is
> +        utilized to add overrides which are less specific than the machine,
> +        but are nonetheless related to it, allowing us to define variables a
> +        certain way for a group of machines, rather than for each individual
> +        one.  As an example, this variable may be used by the distribution to
> +        add <command>SOC_FAMILY</command> or <command>MACHINE_CLASS</command>.
> +      </para>
> +      <para>
> +        Note that this variable is space separated, and should always be
> +        manipulated with +=, to ensure it's built up incrementally, and no
> +        additions are lost.
> +      </para>
> +    </listitem>
> +    <listitem>
>           <para><command>SOC_FAMILY</command> describes a family of processors
>             that all share common features such as kernel versions,
>             bootloaders, etc.  This is used to allow overrides for a whole
> @@ -105,7 +122,7 @@ SRCDATE = "20061014"
>             or local setting.
>           </para>
>           <para>
> -            NOTE: SOC_FAMILY is different than MACHINE_CLASS in that
> +            NOTE: SOC_FAMILY is different than MACHINE_CLASS in that
>             MACHINE_CLASS is intended to specify a grouping of devices
>             that may have different processors but share common features.
>             For example all OMAP3 devices can be described using the SOC_FAMILY
> @@ -139,7 +156,7 @@ SRCDATE = "20061014"
>             <listitem><para>for cvs: add 'PV = "1.1+cvs${SRCREV}"' to your bb file.</para></listitem>
>           </itemizedlist>
>         Accompany either with an entry to conf/distro/include/sane-srcrevs.inc for a revision that you know
> -        builds successfully.  It is also common to define the stable SRCREV
> +        builds successfully.  It is also common to define the stable SRCREV
>         for your package directly in the package recipe.
>         </para>
>         <para>
> @@ -276,7 +293,7 @@ RDEPENDS_${PN} += "\
>             <title>Putting it together</title>
>             <para>In the previous two sections we have prepared the host and
>             target side. One thing that is missing is combining the two newly
> -            created tasks and actually creating the SDK. This is what we are
> +            created tasks and actually creating the SDK. This is what we are
>             going to do now.</para>
>
>             <para>Create <filename>meta-toolchain-YOU.bb</filename> in the
> diff --git a/recipes/binutils/binutils_csl-arm-20050416.bb b/recipes/binutils/binutils_csl-arm-20050416.bb
> index ad45438..71803d1 100644
> --- a/recipes/binutils/binutils_csl-arm-20050416.bb
> +++ b/recipes/binutils/binutils_csl-arm-20050416.bb
> @@ -7,7 +7,7 @@ LICENSE = "GPL"
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
>  PV = "2.15.99+csl-arm+cvs20050416"
>  PR = "r3"
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  DEFAULT_PREFERENCE = "-1"
>  DEFAULT_PREFERENCE_arm-linux = "-1"
>  DEFAULT_PREFERENCE_arm-linuxeabi = "-1"
> diff --git a/recipes/binutils/binutils_csl-arm-20050603.bb b/recipes/binutils/binutils_csl-arm-20050603.bb
> index 595cb98..50e8677 100644
> --- a/recipes/binutils/binutils_csl-arm-20050603.bb
> +++ b/recipes/binutils/binutils_csl-arm-20050603.bb
> @@ -7,7 +7,7 @@ LICENSE = "GPL"
>  FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
>  PV = "2.15.99+csl-arm+cvs20050603"
>  PR = "r3"
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>  DEFAULT_PREFERENCE = "-1"
>  #DEFAULT_PREFERENCE_arm-linux = "1"
>  #DEFAULT_PREFERENCE_arm-linuxeabi = "1"
> diff --git a/recipes/eglibc/eglibc-package.bbclass b/recipes/eglibc/eglibc-package.bbclass
> index dbca1ab..c802bd5 100644
> --- a/recipes/eglibc/eglibc-package.bbclass
> +++ b/recipes/eglibc/eglibc-package.bbclass
> @@ -116,7 +116,7 @@ def get_eglibc_fpu_setting(bb, d):
>  EXTRA_OECONF += "${@get_eglibc_fpu_setting(bb, d)}"
>  EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
>
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>
>  do_configure_prepend() {
>         sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
> diff --git a/recipes/glibc/glibc-package.inc b/recipes/glibc/glibc-package.inc
> index 0b263bb..8cd8564 100644
> --- a/recipes/glibc/glibc-package.inc
> +++ b/recipes/glibc/glibc-package.inc
> @@ -44,7 +44,7 @@ def get_glibc_fpu_setting(bb, d):
>  EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
>  EXTRA_OEMAKE += "rootsbindir=${base_sbindir}"
>
> -OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
> +OVERRIDES_prepend = "${TARGET_ARCH}-${TARGET_OS}:"
>
>  do_install() {
>        oe_runmake install_root=${D} install
> diff --git a/recipes/prelink/prelink_20061027.bb b/recipes/prelink/prelink_20061027.bb
> index ad2faf5..552117b 100644
> --- a/recipes/prelink/prelink_20061027.bb
> +++ b/recipes/prelink/prelink_20061027.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>            file://prelink.default"
>
>  TARGET_OS_ORIG := "${TARGET_OS}"
> -OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> diff --git a/recipes/prelink/prelink_20071009.bb b/recipes/prelink/prelink_20071009.bb
> index faf930c..e2ab3fb 100644
> --- a/recipes/prelink/prelink_20071009.bb
> +++ b/recipes/prelink/prelink_20071009.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>            file://prelink.default"
>
>  TARGET_OS_ORIG := "${TARGET_OS}"
> -OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> diff --git a/recipes/prelink/prelink_20090925.bb b/recipes/prelink/prelink_20090925.bb
> index 4c83402..5b247b6 100644
> --- a/recipes/prelink/prelink_20090925.bb
> +++ b/recipes/prelink/prelink_20090925.bb
> @@ -12,7 +12,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \
>            file://prelink.default"
>
>  #TARGET_OS_ORIG := "${TARGET_OS}"
> -#OVERRIDES_append = ":${TARGET_OS_ORIG}"
> +#OVERRIDES_prepend = "${TARGET_OS_ORIG}:"
>  #SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch"
>
>  S = "${WORKDIR}/prelink-0.0.${PV}"
> --
> 1.7.2.3
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-10-15 15:41 ` [PATCH (v2)] " Chris Larson
  2010-10-15 16:02   ` Maupin, Chase
  2010-10-15 17:20   ` Khem Raj
@ 2010-10-15 19:37   ` Koen Kooi
  2010-10-15 19:44     ` Chris Larson
  2 siblings, 1 reply; 36+ messages in thread
From: Koen Kooi @ 2010-10-15 19:37 UTC (permalink / raw)
  To: openembedded-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15-10-10 17:41, Chris Larson wrote:
> From: Chris Larson <chris_larson@mentor.com>
> 
> Given the current implementation of OVERRIDES in bitbake, the variable is
> expected to contain elements in the order least specific to most specific,
> however, our current usage of it does not match that.  As one example, "local"
> is supposed to always be the most specific override, yet currently it's the
> least specific.  As another example, currently the target architecture is seen
> as more specific than the machine, which is also clearly wrong.
> 
> Big thanks to Chase Maupin for investigating and identifying this long
> standing issue.
> 
> It becomes clear that a reversal of the current value will bring us to a more
> sane behavior, and avoids the need for the dual overrides hack mentioned in
> the comments, so this implements this reversal, and drops the unnecessary and
> confusing comments.
> 
> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
> inject overrides elements which are more specific than the distro but less
> specific than the machine, which is where things like MACHINE_CLASS or
> SOC_FAMILY or the like would go.  This variable is *space* separated, to make
> it easier and more convenient to assemble the variable incrementally.
> 
> Reported-by: Chase Maupin <chase.maupin@ti.com>
> Signed-off-by: Chris Larson <chris_larson@mentor.com>

Acked-by: Koen Kooi <k-kooi@ti.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFMuK2DMkyGM64RGpERAsrgAJ0QbM4VQaERuv72HzOGZJKGqGxljwCfUpHL
wX5AXypHwuHP4cG9BKj7CjM=
=Jpyx
-----END PGP SIGNATURE-----




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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-10-15 19:37   ` Koen Kooi
@ 2010-10-15 19:44     ` Chris Larson
  2010-11-10 14:26       ` Richard Purdie
  0 siblings, 1 reply; 36+ messages in thread
From: Chris Larson @ 2010-10-15 19:44 UTC (permalink / raw)
  To: openembedded-devel

On Fri, Oct 15, 2010 at 12:37 PM, Koen Kooi <k.kooi@student.utwente.nl>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 15-10-10 17:41, Chris Larson wrote:
> > From: Chris Larson <chris_larson@mentor.com>
> >
> > Given the current implementation of OVERRIDES in bitbake, the variable is
> > expected to contain elements in the order least specific to most
> specific,
> > however, our current usage of it does not match that.  As one example,
> "local"
> > is supposed to always be the most specific override, yet currently it's
> the
> > least specific.  As another example, currently the target architecture is
> seen
> > as more specific than the machine, which is also clearly wrong.
> >
> > Big thanks to Chase Maupin for investigating and identifying this long
> > standing issue.
> >
> > It becomes clear that a reversal of the current value will bring us to a
> more
> > sane behavior, and avoids the need for the dual overrides hack mentioned
> in
> > the comments, so this implements this reversal, and drops the unnecessary
> and
> > confusing comments.
> >
> > This also introduces a MACHINE_OVERRIDES variable as a generic mechanism
> to
> > inject overrides elements which are more specific than the distro but
> less
> > specific than the machine, which is where things like MACHINE_CLASS or
> > SOC_FAMILY or the like would go.  This variable is *space* separated, to
> make
> > it easier and more convenient to assemble the variable incrementally.
> >
> > Reported-by: Chase Maupin <chase.maupin@ti.com>
> > Signed-off-by: Chris Larson <chris_larson@mentor.com>
>
> Acked-by: Koen Kooi <k-kooi@ti.com>
>

This is now in master -- thanks to all for the acks, review, comments -- let
me know if any problems result from this.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-15  3:36 [PATCH] Reverse the order of OVERRIDES Chris Larson
                   ` (3 preceding siblings ...)
  2010-10-15 15:41 ` [PATCH (v2)] " Chris Larson
@ 2010-10-16 18:04 ` Martin Jansa
  2010-10-16 18:24   ` Chris Larson
  4 siblings, 1 reply; 36+ messages in thread
From: Martin Jansa @ 2010-10-16 18:04 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Chris Larson

On Fri, Oct 15, 2010 at 5:36 AM, Chris Larson <kergoth@gmail.com> wrote:
> From: Chris Larson <chris_larson@mentor.com>
>
> Given the current implementation of OVERRIDES in bitbake, the variable is
> expected to contain elements in the order least specific to most specific,
> however, our current usage of it does not match that.  As one example, "local"
> is supposed to always be the most specific override, yet currently it's the
> least specific.  As another example, currently the target architecture is seen
> as more specific than the machine, which is also clearly wrong.
>
> It becomes clear that a reversal of the current value will bring us to a more
> sane behavior, and avoids the need for the dual overrides hack mentioned in
> the comments, so clean those up as well.
>
> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism to
> inject overrides elements which are more specific than the distro but less
> specific than the machine, which is where things like MACHINE_CLASS or
> SOC_FAMILY or the like would go.  This variable is *space* separated, to make
> it easier and more convenient to assemble the variable incrementally, and it's
> then translated to : separated when used in OVERRIDES.
>
> Signed-off-by: Chris Larson <chris_larson@mentor.com>
> ---
>  conf/bitbake.conf                             |   17 +++--------------
>  conf/distro/include/arm-thumb.inc             |    6 +++---
>  conf/distro/micro.conf                        |    6 +++---
>  conf/distro/minimal.conf                      |    5 +++--
>  conf/distro/shr.conf                          |    5 +++--
>  conf/machine/fsg3be.conf                      |    2 +-
>  conf/machine/kixrp435.conf                    |    2 +-
>  conf/machine/nslu2be.conf                     |    2 +-
>  conf/machine/nslu2le.conf                     |    2 +-
>  recipes/binutils/binutils_csl-arm-20050416.bb |    2 +-
>  recipes/binutils/binutils_csl-arm-20050603.bb |    2 +-
>  recipes/eglibc/eglibc-package.bbclass         |    2 +-
>  recipes/glibc/glibc-package.inc               |    2 +-
>  recipes/prelink/prelink_20061027.bb           |    2 +-
>  recipes/prelink/prelink_20071009.bb           |    2 +-
>  recipes/prelink/prelink_20090925.bb           |    2 +-
>  16 files changed, 26 insertions(+), 35 deletions(-)

I'm sorry to notice too late, but this changes breaks do_unpack
behavior, machine dir in FILESPATHPKG are no longer preferred ie for
xorg-conf unpack:

now I get:

NOTE: package xserver-xorg-conf-0.1-r36: task do_unpack: Started
NOTE: Unpacking xserver-xorg-conf/xorg.conf to
/OE/tmpdir-shr/work/om-gta02-oe-linux-gnueabi/xserver-xorg-conf-0.1-r36/
NOTE: package xserver-xorg-conf-0.1-r36: task do_unpack: Succeeded

if I revert this commit:

NOTE: package xserver-xorg-conf-0.1-r36: task do_unpack: Started
NOTE: Unpacking xserver-xorg-conf/om-gta02/xorg.conf to
/OE/tmpdir-shr/work/om-gta02-oe-linux-gnueabi/xserver-xorg-conf-0.1-r36/
NOTE: package xserver-xorg-conf-0.1-r36: task do_unpack: Succeeded

Works OK if there is no "default" file (ie after rm
xserver-xorg-conf/xorg.conf).

Probably needs reversed OVERRIDES order also in bitbake.conf FILESPATH

FILESPATH = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for
fp in d.getVar('FILESPATHBASE', 1).split(':') for p in
d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES',
1) + ':').split(':')])}"

I'll try it and send patch.

Regards,



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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-16 18:04 ` [PATCH] " Martin Jansa
@ 2010-10-16 18:24   ` Chris Larson
  2010-10-16 18:50     ` Martin Jansa
                       ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Chris Larson @ 2010-10-16 18:24 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Chris Larson

On Sat, Oct 16, 2010 at 11:04 AM, Martin Jansa <martin.jansa@gmail.com>wrote:

> Probably needs reversed OVERRIDES order also in bitbake.conf FILESPATH
>
> FILESPATH = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for
> fp in d.getVar('FILESPATHBASE', 1).split(':') for p in
> d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES',
> 1) + ':').split(':')])}"
>

Yes, you're right.  OVERRIDES in bitbake is used such that the *last*
defined overridden variable is used, but FILESPATH uses the *first* file it
finds.  Reversing it there should indeed fix it.  Nicely spotted, thanks.  I
have some errands to run, so won't have a chance to apply a fix until this
evening, so if someone else wants to get it in, feel free.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-16 18:24   ` Chris Larson
@ 2010-10-16 18:50     ` Martin Jansa
  2010-10-16 19:35       ` Martin Jansa
  2010-10-16 19:24     ` [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty Martin Jansa
  2010-10-16 19:32     ` [PATCH] bitbake.conf: reverse OVERRIDES order in FILESPATH definition Martin Jansa
  2 siblings, 1 reply; 36+ messages in thread
From: Martin Jansa @ 2010-10-16 18:50 UTC (permalink / raw)
  To: openembedded-devel

On Sat, Oct 16, 2010 at 8:24 PM, Chris Larson <clarson@kergoth.com> wrote:
> On Sat, Oct 16, 2010 at 11:04 AM, Martin Jansa <martin.jansa@gmail.com>wrote:
>
>> Probably needs reversed OVERRIDES order also in bitbake.conf FILESPATH
>>
>> FILESPATH = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for
>> fp in d.getVar('FILESPATHBASE', 1).split(':') for p in
>> d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES',
>> 1) + ':').split(':')])}"
>>
>
> Yes, you're right.  OVERRIDES in bitbake is used such that the *last*
> defined overridden variable is used, but FILESPATH uses the *first* file it
> finds.  Reversing it there should indeed fix it.  Nicely spotted, thanks.  I
> have some errands to run, so won't have a chance to apply a fix until this
> evening, so if someone else wants to get it in, feel free.

It's a bit more complicated

OE om-gta02@shr ~/dev/recipes/xorg-xserver $ bitbake -e -b
xserver-xorg-conf_0.1.bb | grep ^OVERRIDES
OVERRIDES="thumb:thumb-interwork:libc-glibc:pn-xserver-xorg-conf:fail-fast:build-linux:arm:linux-gnueabi:shr::om-gta02:local:armv4t:armv4t"

that empty :: between shr and om-gta02 (where MACHINE_OVERRIDES should
be) is breaking it for both orders (ie ignoring all after om-gta02 or
after shr from with reversed order)

This is part of filespath (for first FILESPATHPKG - ${PF}) from
base_do_unpack in base.bbclass:
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/task-unpack'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/thumb'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/thumb-interwork'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/libc-glibc'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/pn-xserver-xorg-conf'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/fail-fast'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/build-linux'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/arm'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/linux-gnueabi'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/shr'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36'
        -- here is the problem
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/om-gta02'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/local'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/armv4t'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/armv4t'
'/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36'

Regards,



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

* [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-16 18:24   ` Chris Larson
  2010-10-16 18:50     ` Martin Jansa
@ 2010-10-16 19:24     ` Martin Jansa
  2010-10-19 19:05       ` Maupin, Chase
  2010-10-16 19:32     ` [PATCH] bitbake.conf: reverse OVERRIDES order in FILESPATH definition Martin Jansa
  2 siblings, 1 reply; 36+ messages in thread
From: Martin Jansa @ 2010-10-16 19:24 UTC (permalink / raw)
  To: openembedded-devel

* empty MACHINE_OVERRIDES adds :: to OVERRIDES (then in FILESPATH skips
  every directory after this)
* strip() is needed to remove space in case some distribution has ie
  MACHINE_OVERRIDES ?= ""
  and then
  MACHINE_OVERRIDES += ""
  or
  MACHINE_OVERRIDES ?= "${MACHINE_CLASS}", where MACHINE_CLASS is empty   again
---
 conf/bitbake.conf |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 155c593..5c45e1e 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -676,8 +676,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
 # Overrides are processed left to right, so the ones that are named later take precedence.
 # You generally want them to go from least to most specific.
 MACHINE_OVERRIDES ?= ""
-OVERRIDES = "pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
-${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES', True).split())}:${MACHINE}:local"
+OVERRIDES = "pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:${DISTRO}:\
+${@[':'.join(d.getVar('MACHINE_OVERRIDES', True).split())+':',''][d.getVar('MACHINE_OVERRIDES', True).strip() == '']}\
+${MACHINE}:local"
 
 ##################################################################
 # Include the rest of the config files.
-- 
1.7.3.1




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

* [PATCH] bitbake.conf: reverse OVERRIDES order in FILESPATH definition
  2010-10-16 18:24   ` Chris Larson
  2010-10-16 18:50     ` Martin Jansa
  2010-10-16 19:24     ` [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty Martin Jansa
@ 2010-10-16 19:32     ` Martin Jansa
  2 siblings, 0 replies; 36+ messages in thread
From: Martin Jansa @ 2010-10-16 19:32 UTC (permalink / raw)
  To: openembedded-devel

* directories in FILESPATH are search for first fit and we would expect
  ie ${PN}/local/a.patch to be used before ${PN}/ramses/a.patch
* moving last ':' before OVERRIDES makes FILESPATHBASE/FILESPATHPKG/ as
  last option instead of first

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 conf/bitbake.conf |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index edb9530..1a08673 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -271,7 +271,7 @@ FILES_${PN}-locale = "${datadir}/locale"
 FILE_DIRNAME = "${@os.path.dirname(bb.data.getVar('FILE', d))}"
 FILESPATHBASE = "${FILE_DIRNAME}"
 FILESPATHPKG = "${PF}:${P}:${PN}:${BP}:${BPN}:files:."
-FILESPATH = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', 1).split(':') for p in d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES', 1) + ':').split(':')])}"
+FILESPATH = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', 1).split(':') for p in d.getVar('FILESPATHPKG', 1).split(':') for o in (':' + d.getVar('OVERRIDES', 1)).split(':')[::-1]])}"
 FILESDIR = "${@bb.which(d.getVar('FILESPATH', 1), '.')}"
 
 ##################################################################
-- 
1.7.3.1




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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-16 18:50     ` Martin Jansa
@ 2010-10-16 19:35       ` Martin Jansa
  2010-10-16 19:54         ` Martin Jansa
  0 siblings, 1 reply; 36+ messages in thread
From: Martin Jansa @ 2010-10-16 19:35 UTC (permalink / raw)
  To: openembedded-devel

On Sat, Oct 16, 2010 at 8:50 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Sat, Oct 16, 2010 at 8:24 PM, Chris Larson <clarson@kergoth.com> wrote:
>> On Sat, Oct 16, 2010 at 11:04 AM, Martin Jansa <martin.jansa@gmail.com>wrote:
>>
>>> Probably needs reversed OVERRIDES order also in bitbake.conf FILESPATH
>>>
>>> FILESPATH = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for
>>> fp in d.getVar('FILESPATHBASE', 1).split(':') for p in
>>> d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES',
>>> 1) + ':').split(':')])}"
>>>
>>
>> Yes, you're right.  OVERRIDES in bitbake is used such that the *last*
>> defined overridden variable is used, but FILESPATH uses the *first* file it
>> finds.  Reversing it there should indeed fix it.  Nicely spotted, thanks.  I
>> have some errands to run, so won't have a chance to apply a fix until this
>> evening, so if someone else wants to get it in, feel free.
>
> It's a bit more complicated
>
> OE om-gta02@shr ~/dev/recipes/xorg-xserver $ bitbake -e -b
> xserver-xorg-conf_0.1.bb | grep ^OVERRIDES
> OVERRIDES="thumb:thumb-interwork:libc-glibc:pn-xserver-xorg-conf:fail-fast:build-linux:arm:linux-gnueabi:shr::om-gta02:local:armv4t:armv4t"
>
> that empty :: between shr and om-gta02 (where MACHINE_OVERRIDES should
> be) is breaking it for both orders (ie ignoring all after om-gta02 or
> after shr from with reversed order)

Even with those 2 patches I've just sent I still have wrong order of
TARGET_ARCH OVERRIDES :/.


OE om-gta02@shr ~/dev/recipes/xorg-xserver $ bitbake -e -b
xserver-xorg-conf_0.1.bb | grep ^FILESPATH= | sed "s/:/\n/g" | head -n
20
FILESPATH="
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/armv4t
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/armv4t
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/local
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/om-gta02
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/shr
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/linux-gnueabi
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/arm
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/build-linux
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/fail-fast
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/pn-xserver-xorg-conf
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/libc-glibc
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/thumb-interwork
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/thumb
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/armv4t
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/armv4t
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/local
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/om-gta02
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/shr
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/linux-gnueabi
.....

any hint?

Regards,



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

* Re: [PATCH] Reverse the order of OVERRIDES
  2010-10-16 19:35       ` Martin Jansa
@ 2010-10-16 19:54         ` Martin Jansa
  0 siblings, 0 replies; 36+ messages in thread
From: Martin Jansa @ 2010-10-16 19:54 UTC (permalink / raw)
  To: openembedded-devel

On Sat, Oct 16, 2010 at 9:35 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Sat, Oct 16, 2010 at 8:50 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
>> On Sat, Oct 16, 2010 at 8:24 PM, Chris Larson <clarson@kergoth.com> wrote:
>>> On Sat, Oct 16, 2010 at 11:04 AM, Martin Jansa <martin.jansa@gmail.com>wrote:
>>>
>>>> Probably needs reversed OVERRIDES order also in bitbake.conf FILESPATH
>>>>
>>>> FILESPATH = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for
>>>> fp in d.getVar('FILESPATHBASE', 1).split(':') for p in
>>>> d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES',
>>>> 1) + ':').split(':')])}"
>>>>
>>>
>>> Yes, you're right.  OVERRIDES in bitbake is used such that the *last*
>>> defined overridden variable is used, but FILESPATH uses the *first* file it
>>> finds.  Reversing it there should indeed fix it.  Nicely spotted, thanks.  I
>>> have some errands to run, so won't have a chance to apply a fix until this
>>> evening, so if someone else wants to get it in, feel free.
>>
>> It's a bit more complicated
>>
>> OE om-gta02@shr ~/dev/recipes/xorg-xserver $ bitbake -e -b
>> xserver-xorg-conf_0.1.bb | grep ^OVERRIDES
>> OVERRIDES="thumb:thumb-interwork:libc-glibc:pn-xserver-xorg-conf:fail-fast:build-linux:arm:linux-gnueabi:shr::om-gta02:local:armv4t:armv4t"
>>
>> that empty :: between shr and om-gta02 (where MACHINE_OVERRIDES should
>> be) is breaking it for both orders (ie ignoring all after om-gta02 or
>> after shr from with reversed order)
>
> Even with those 2 patches I've just sent I still have wrong order of
> TARGET_ARCH OVERRIDES :/.
>
>
> OE om-gta02@shr ~/dev/recipes/xorg-xserver $ bitbake -e -b
> xserver-xorg-conf_0.1.bb | grep ^FILESPATH= | sed "s/:/\n/g" | head -n
> 20
> FILESPATH="
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/armv4t
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/armv4t
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/local
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/om-gta02
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/shr
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/linux-gnueabi
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/arm
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/build-linux
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/fail-fast
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/pn-xserver-xorg-conf
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/libc-glibc
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/thumb-interwork
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/thumb
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/armv4t
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/armv4t
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/local
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/om-gta02
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/shr
> /OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/linux-gnueabi
> .....
>
> any hint?

Ah I have TARGET_ARCH (actually FEED_ARCH) twice in OVERRIDES, one
from sane-toolchain.inc and second from sane-feed.inc (maybe we should
drop one of them).

I have patch which preppends FEED_ARCH instead of appending it
-OVERRIDES .= ":${FEED_ARCH}"
+OVERRIDES =. "${FEED_ARCH}:"

in few distro configs

#       modified:   ../../conf/distro/chinook-compat.conf
#       modified:   ../../conf/distro/include/kaeilos-2010.inc
#       modified:   ../../conf/distro/include/kaeilos.inc
#       modified:   ../../conf/distro/include/sane-feed.inc
#       modified:   ../../conf/distro/include/sane-toolchain.inc
#       modified:   ../../conf/distro/maemo5-compat.conf

but now I'm quite confused if it's right fix, because with this
reversed order of OVERRIDES it's not enough to change from append to
preppend, because it also depends on order how
bitbake.conf/sane-*.inc/distro.conf are included together :/.

So now I have

OE om-gta02@shr ~/dev/recipes/xorg-xserver $ bitbake -e -b
xserver-xorg-conf_0.1.bb | grep ^OVERRIDES
OVERRIDES="thumb:thumb-interwork:libc-glibc:armv4t:armv4t:pn-xserver-xorg-conf:fail-fast:build-linux:arm:linux-gnueabi:shr:om-gta02:local"

OE om-gta02@shr ~/dev/recipes/xorg-xserver $ bitbake -e -b
xserver-xorg-conf_0.1.bb | grep ^FILESPATH= | sed "s/:/\n/g" | head -n
20
FILESPATH="
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/local
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/om-gta02
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/shr
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/linux-gnueabi
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/arm
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/build-linux
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/fail-fast
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/pn-xserver-xorg-conf
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/armv4t
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/armv4t
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/libc-glibc
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/thumb-interwork
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36/thumb
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1-r36
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/local
/OE/dev/recipes/xorg-xserver/xserver-xorg-conf-0.1/om-gta02

but it doesn't seem right again :/

Regards,



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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-16 19:24     ` [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty Martin Jansa
@ 2010-10-19 19:05       ` Maupin, Chase
  2010-10-19 19:09         ` Chris Larson
  0 siblings, 1 reply; 36+ messages in thread
From: Maupin, Chase @ 2010-10-19 19:05 UTC (permalink / raw)
  To: openembedded-devel

> -----Original Message-----
> From: openembedded-devel-bounces@lists.openembedded.org
> [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf Of
> Martin Jansa
> Sent: Saturday, October 16, 2010 2:25 PM
> To: openembedded-devel@lists.openembedded.org
> Subject: [oe] [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to
> OVERRIDES when it's empty
> 
> * empty MACHINE_OVERRIDES adds :: to OVERRIDES (then in FILESPATH skips
>   every directory after this)
> * strip() is needed to remove space in case some distribution has ie
>   MACHINE_OVERRIDES ?= ""
>   and then
>   MACHINE_OVERRIDES += ""
>   or
>   MACHINE_OVERRIDES ?= "${MACHINE_CLASS}", where MACHINE_CLASS is empty
> again

I saw this issue in my overlay of having a "::" in my OVERRIDES which caused my parsing to fail in angstrom.inc.  Applying this fix from Martin resolves the parsing issue.  My OVERRIDES appear to be in the correct order with this change:

# OVERRIDES=${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}libc-glibc:pn-${PN}:fail-fast:build-${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:${DISTRO}:${@[':'.join(d.getVar('MACHINE_OVERRIDES', True).split())+':',''][d.getVar('MACHINE_OVERRIDES', True).strip() == '']}${MACHINE}:local
OVERRIDES="thumb-interwork:libc-glibc:pn-helloworld:fail-fast:build-linux:arm:linux-gnueabi:angstrom:armv7a:omap3:am37x-evm:local"

And my FILESPATH ordering is:

helloworld-1.0.0-r1/local
helloworld-1.0.0-r1/am37x-evm
helloworld-1.0.0-r1/omap3
helloworld-1.0.0-r1/armv7a
helloworld-1.0.0-r1/angstrom
helloworld-1.0.0-r1/linux-gnueabi
helloworld-1.0.0-r1/arm
helloworld-1.0.0-r1/build-linux
helloworld-1.0.0-r1/fail-fast
helloworld-1.0.0-r1/pn-helloworld
helloworld-1.0.0-r1/libc-glibc
helloworld-1.0.0-r1/thumb-interwork
helloworld-1.0.0-r1/
.
.
.

Acked-by: Chase Maupin <chase.maupin@ti.com>

> ---
>  conf/bitbake.conf |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index 155c593..5c45e1e 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -676,8 +676,9 @@ BUILDCFG_NEEDEDVARS ?= "TARGET_ARCH TARGET_OS"
>  # Overrides are processed left to right, so the ones that are named later
> take precedence.
>  # You generally want them to go from least to most specific.
>  MACHINE_OVERRIDES ?= ""
> -OVERRIDES = "pn-${PN}:fail-fast:build-
> ${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:\
> -${DISTRO}:${@':'.join(d.getVar('MACHINE_OVERRIDES',
> True).split())}:${MACHINE}:local"
> +OVERRIDES = "pn-${PN}:fail-fast:build-
> ${BUILD_OS}:${TARGET_ARCH}:${TARGET_OS}:${DISTRO}:\
> +${@[':'.join(d.getVar('MACHINE_OVERRIDES',
> True).split())+':',''][d.getVar('MACHINE_OVERRIDES', True).strip() ==
> '']}\
> +${MACHINE}:local"
> 
>  ##################################################################
>  # Include the rest of the config files.
> --
> 1.7.3.1
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-19 19:05       ` Maupin, Chase
@ 2010-10-19 19:09         ` Chris Larson
  2010-10-19 19:18           ` Maupin, Chase
  2010-10-19 19:24           ` Maupin, Chase
  0 siblings, 2 replies; 36+ messages in thread
From: Chris Larson @ 2010-10-19 19:09 UTC (permalink / raw)
  To: openembedded-devel

On Tue, Oct 19, 2010 at 12:05 PM, Maupin, Chase <chase.maupin@ti.com> wrote:

> > -----Original Message-----
> > From: openembedded-devel-bounces@lists.openembedded.org
> > [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf Of
> > Martin Jansa
> > Sent: Saturday, October 16, 2010 2:25 PM
> > To: openembedded-devel@lists.openembedded.org
> > Subject: [oe] [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to
> > OVERRIDES when it's empty
> >
> > * empty MACHINE_OVERRIDES adds :: to OVERRIDES (then in FILESPATH skips
> >   every directory after this)
> > * strip() is needed to remove space in case some distribution has ie
> >   MACHINE_OVERRIDES ?= ""
> >   and then
> >   MACHINE_OVERRIDES += ""
> >   or
> >   MACHINE_OVERRIDES ?= "${MACHINE_CLASS}", where MACHINE_CLASS is empty
> > again
>
> I saw this issue in my overlay of having a "::" in my OVERRIDES which
> caused my parsing to fail in angstrom.inc.  Applying this fix from Martin
> resolves the parsing issue.  My OVERRIDES appear to be in the correct order
> with this change:


Can you explain this?  "caused my parsing to fail" is not very useful
information.  What exactly failed?
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-19 19:09         ` Chris Larson
@ 2010-10-19 19:18           ` Maupin, Chase
  2010-10-19 19:24             ` Denys Dmytriyenko
  2010-10-19 19:24           ` Maupin, Chase
  1 sibling, 1 reply; 36+ messages in thread
From: Maupin, Chase @ 2010-10-19 19:18 UTC (permalink / raw)
  To: openembedded-devel

> -----Original Message-----
> From: openembedded-devel-bounces@lists.openembedded.org
> [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf Of
> Chris Larson
> Sent: Tuesday, October 19, 2010 2:09 PM
> To: openembedded-devel@lists.openembedded.org
> Subject: Re: [oe] [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to
> OVERRIDES when it's empty
> 
> On Tue, Oct 19, 2010 at 12:05 PM, Maupin, Chase <chase.maupin@ti.com>
> wrote:
> 
> > > -----Original Message-----
> > > From: openembedded-devel-bounces@lists.openembedded.org
> > > [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf
> Of
> > > Martin Jansa
> > > Sent: Saturday, October 16, 2010 2:25 PM
> > > To: openembedded-devel@lists.openembedded.org
> > > Subject: [oe] [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to
> > > OVERRIDES when it's empty
> > >
> > > * empty MACHINE_OVERRIDES adds :: to OVERRIDES (then in FILESPATH
> skips
> > >   every directory after this)
> > > * strip() is needed to remove space in case some distribution has ie
> > >   MACHINE_OVERRIDES ?= ""
> > >   and then
> > >   MACHINE_OVERRIDES += ""
> > >   or
> > >   MACHINE_OVERRIDES ?= "${MACHINE_CLASS}", where MACHINE_CLASS is
> empty
> > > again
> >
> > I saw this issue in my overlay of having a "::" in my OVERRIDES which
> > caused my parsing to fail in angstrom.inc.  Applying this fix from
> Martin
> > resolves the parsing issue.  My OVERRIDES appear to be in the correct
> order
> > with this change:
> 
> 
> Can you explain this?  "caused my parsing to fail" is not very useful
> information.  What exactly failed?

Chris,

Sorry, I thought this was an understood issue.  I have put the error output I got below.  Basically, when I got to line 509 of data.py the variables had the following values:

vars = set(['__functions_', '_', '__functions__'])

var = '__functions__'

overrides = ['pn-angstrom', 'fail-fast', 'build-linux', 'arm', 'INVALID', 'angstrom-2008.1', '', 'am37x-evm', 'local']
 
o = ''

OVERRIDES = 'pn-angstrom:fail-fast:build-linux:arm:INVALID:angstrom-2008.1::am37x-evm:local'

The current override being evaluated was the '' one.

The line being evaluated in my overlay was USERDISTRO := "${DISTRO}" in my copy of angstrom.inc

The output from my build was:

a0271661@sdit-build01:~/projects/arago-multi-build$ bitbake helloworldTraceback (most recent call last):
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/bin/bitbake", line 143, in <module>
    main()
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/bin/bitbake", line 123, in main
    cooker.parseConfiguration()
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/cooker.py", line 68, in parseConfiguration
    self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/cooker.py", line 390, in parseConfigurationFile
    self.configuration.data = bb.parse.handle( afile, self.configuration.data )
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/__init__.py", line 75, in handle
    return h['handle'](fn, data, include)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 167, in handle
    feeder(lineno, s, fn, data)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 215, in feeder
    include(fn, s, data, False)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 114, in include
    ret = handle(fn, data, True)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/__init__.py", line 75, in handle
    return h['handle'](fn, data, include)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 167, in handle
    feeder(lineno, s, fn, data)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 221, in feeder
    include(fn, s, data, "include required")
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 114, in include
    ret = handle(fn, data, True)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/__init__.py", line 75, in handle
    return h['handle'](fn, data, include)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/BBHandler.py", line 175, in handle
    feeder(lineno, s, fn, base_name, d)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/BBHandler.py", line 381, in feeder
    return ConfHandler.feeder(lineno, s, fn, d)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 192, in feeder
    bb.data.update_data(e)
  File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/data.py", line 509, in update_data
    for var in vars:
RuntimeError: Set changed size during iteration

> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-19 19:09         ` Chris Larson
  2010-10-19 19:18           ` Maupin, Chase
@ 2010-10-19 19:24           ` Maupin, Chase
  1 sibling, 0 replies; 36+ messages in thread
From: Maupin, Chase @ 2010-10-19 19:24 UTC (permalink / raw)
  To: openembedded-devel

> -----Original Message-----
> From: openembedded-devel-bounces@lists.openembedded.org
> [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf Of
> Chris Larson
> Sent: Tuesday, October 19, 2010 2:09 PM
> To: openembedded-devel@lists.openembedded.org
> Subject: Re: [oe] [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to
> OVERRIDES when it's empty
> 
> On Tue, Oct 19, 2010 at 12:05 PM, Maupin, Chase <chase.maupin@ti.com>
> wrote:
> 
> > > -----Original Message-----
> > > From: openembedded-devel-bounces@lists.openembedded.org
> > > [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf
> Of
> > > Martin Jansa
> > > Sent: Saturday, October 16, 2010 2:25 PM
> > > To: openembedded-devel@lists.openembedded.org
> > > Subject: [oe] [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to
> > > OVERRIDES when it's empty
> > >
> > > * empty MACHINE_OVERRIDES adds :: to OVERRIDES (then in FILESPATH
> skips
> > >   every directory after this)
> > > * strip() is needed to remove space in case some distribution has ie
> > >   MACHINE_OVERRIDES ?= ""
> > >   and then
> > >   MACHINE_OVERRIDES += ""
> > >   or
> > >   MACHINE_OVERRIDES ?= "${MACHINE_CLASS}", where MACHINE_CLASS is
> empty
> > > again
> >
> > I saw this issue in my overlay of having a "::" in my OVERRIDES which
> > caused my parsing to fail in angstrom.inc.  Applying this fix from
> Martin
> > resolves the parsing issue.  My OVERRIDES appear to be in the correct
> order
> > with this change:
> 
> 
> Can you explain this?  "caused my parsing to fail" is not very useful
> information.  What exactly failed?

One other detail I forgot to mention is that I was actually using bitbake from the Arago project which is based on 1.8.18.  I did not see this issue if I used bitbake 1.10 I did not see this issue.  I kept this same fix in my tree and tried with bitbake 1.10 and it too worked so it didn't seem like the fix was negatively impacting the 1.10 version.

> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-19 19:18           ` Maupin, Chase
@ 2010-10-19 19:24             ` Denys Dmytriyenko
  2010-10-20 23:29               ` Denys Dmytriyenko
  0 siblings, 1 reply; 36+ messages in thread
From: Denys Dmytriyenko @ 2010-10-19 19:24 UTC (permalink / raw)
  To: openembedded-devel

On Tue, Oct 19, 2010 at 02:18:25PM -0500, Maupin, Chase wrote:
> > > I saw this issue in my overlay of having a "::" in my OVERRIDES which
> > > caused my parsing to fail in angstrom.inc.  Applying this fix from
> > Martin
> > > resolves the parsing issue.  My OVERRIDES appear to be in the correct
> > order
> > > with this change:
> > 
> > Can you explain this?  "caused my parsing to fail" is not very useful
> > information.  What exactly failed?
> 
> Chris,
> 
> Sorry, I thought this was an understood issue.  I have put the error output 
> I got below.  Basically, when I got to line 509 of data.py the variables had 
> the following values:
> 
> vars = set(['__functions_', '_', '__functions__'])
> 
> var = '__functions__'
> 
> overrides = ['pn-angstrom', 'fail-fast', 'build-linux', 'arm', 'INVALID', 'angstrom-2008.1', '', 'am37x-evm', 'local']
>  
> o = ''
> 
> OVERRIDES = 'pn-angstrom:fail-fast:build-linux:arm:INVALID:angstrom-2008.1::am37x-evm:local'
> 
> The current override being evaluated was the '' one.
> 
> The line being evaluated in my overlay was USERDISTRO := "${DISTRO}" in my 
> copy of angstrom.inc

Chris,

FYI, the below "RuntimeError: Set changed size during iteration" exception 
happens in bitbake 1.8.18 but not the 1.10/mainline.

-- 
Denys

> The output from my build was:
> 
> a0271661@sdit-build01:~/projects/arago-multi-build$ bitbake helloworldTraceback (most recent call last):
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/bin/bitbake", line 143, in <module>
>     main()
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/bin/bitbake", line 123, in main
>     cooker.parseConfiguration()
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/cooker.py", line 68, in parseConfiguration
>     self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/cooker.py", line 390, in parseConfigurationFile
>     self.configuration.data = bb.parse.handle( afile, self.configuration.data )
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/__init__.py", line 75, in handle
>     return h['handle'](fn, data, include)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 167, in handle
>     feeder(lineno, s, fn, data)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 215, in feeder
>     include(fn, s, data, False)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 114, in include
>     ret = handle(fn, data, True)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/__init__.py", line 75, in handle
>     return h['handle'](fn, data, include)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 167, in handle
>     feeder(lineno, s, fn, data)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 221, in feeder
>     include(fn, s, data, "include required")
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 114, in include
>     ret = handle(fn, data, True)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/__init__.py", line 75, in handle
>     return h['handle'](fn, data, include)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/BBHandler.py", line 175, in handle
>     feeder(lineno, s, fn, base_name, d)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/BBHandler.py", line 381, in feeder
>     return ConfHandler.feeder(lineno, s, fn, d)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 192, in feeder
>     bb.data.update_data(e)
>   File "/home/a0271661/projects/arago-multi-build/arago-bitbake/lib/bb/data.py", line 509, in update_data
>     for var in vars:
> RuntimeError: Set changed size during iteration



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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-19 19:24             ` Denys Dmytriyenko
@ 2010-10-20 23:29               ` Denys Dmytriyenko
  2010-10-20 23:34                 ` Chris Larson
  2010-10-21  6:27                 ` Martin Jansa
  0 siblings, 2 replies; 36+ messages in thread
From: Denys Dmytriyenko @ 2010-10-20 23:29 UTC (permalink / raw)
  To: openembedded-devel; +Cc: clarson, martin.jansa

On Tue, Oct 19, 2010 at 03:24:58PM -0400, Denys Dmytriyenko wrote:
> On Tue, Oct 19, 2010 at 02:18:25PM -0500, Maupin, Chase wrote:
> > > > I saw this issue in my overlay of having a "::" in my OVERRIDES which
> > > > caused my parsing to fail in angstrom.inc.  Applying this fix from
> > > Martin
> > > > resolves the parsing issue.  My OVERRIDES appear to be in the correct
> > > order
> > > > with this change:
> > > 
> > > Can you explain this?  "caused my parsing to fail" is not very useful
> > > information.  What exactly failed?
> > 
> > Chris,
> > 
> > Sorry, I thought this was an understood issue.  I have put the error output 
> > I got below.  Basically, when I got to line 509 of data.py the variables had 
> > the following values:
> > 
> > vars = set(['__functions_', '_', '__functions__'])
> > 
> > var = '__functions__'
> > 
> > overrides = ['pn-angstrom', 'fail-fast', 'build-linux', 'arm', 'INVALID', 'angstrom-2008.1', '', 'am37x-evm', 'local']
> >  
> > o = ''
> > 
> > OVERRIDES = 'pn-angstrom:fail-fast:build-linux:arm:INVALID:angstrom-2008.1::am37x-evm:local'
> > 
> > The current override being evaluated was the '' one.
> > 
> > The line being evaluated in my overlay was USERDISTRO := "${DISTRO}" in my 
> > copy of angstrom.inc
> 
> Chris,
> 
> FYI, the below "RuntimeError: Set changed size during iteration" exception 
> happens in bitbake 1.8.18 but not the 1.10/mainline.

Chris, Martin,

After more debugging, it seems the problem is caused by using bitbake 1.8.18 
and conf/collections.inc at the same time, as that version of bitbake chokes 
on empty override "::", when it gets re-spawned from collections.inc. If I 
replace the use of COLLECTIONS with direct BBFILES/BBFILE_* assignments, bitbake 
parses everything just fine. It is reproducible right now on the latest OE 
mainline with bitbake 1.8.18 by just adding "require conf/collections.inc" in 
local.conf or bitbake.conf.

I see that Martin's patch was marked as "Superseded" and archived - is there a 
new patch coming? Or are there any side-effects of this patch? I would 
definitely like to push this patch ASAP to address our immediate problem. 
Thanks.

-- 
Denys



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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-20 23:29               ` Denys Dmytriyenko
@ 2010-10-20 23:34                 ` Chris Larson
  2010-10-21  2:45                   ` Denys Dmytriyenko
  2010-10-21  6:27                 ` Martin Jansa
  1 sibling, 1 reply; 36+ messages in thread
From: Chris Larson @ 2010-10-20 23:34 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: openembedded-devel, martin.jansa

On Wed, Oct 20, 2010 at 4:29 PM, Denys Dmytriyenko <denis@denix.org> wrote:

> I see that Martin's patch was marked as "Superseded" and archived - is
> there a
> new patch coming? Or are there any side-effects of this patch? I would
> definitely like to push this patch ASAP to address our immediate problem.
>

The original problem with empty overrides was the FILESPATH issue, which was
fixed by the commit that sanitized FILESPATH, hence the superseded.  Clearly
there's another issue with them, so this patch is necessary.  Feel free to
apply it with modification and push it, we can always drop it when we bump
the minimum bitbake version to 1.10.x.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-20 23:34                 ` Chris Larson
@ 2010-10-21  2:45                   ` Denys Dmytriyenko
  0 siblings, 0 replies; 36+ messages in thread
From: Denys Dmytriyenko @ 2010-10-21  2:45 UTC (permalink / raw)
  To: openembedded-devel

On Wed, Oct 20, 2010 at 04:34:32PM -0700, Chris Larson wrote:
> On Wed, Oct 20, 2010 at 4:29 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> 
> > I see that Martin's patch was marked as "Superseded" and archived - is
> > there a
> > new patch coming? Or are there any side-effects of this patch? I would
> > definitely like to push this patch ASAP to address our immediate problem.
> >
> 
> The original problem with empty overrides was the FILESPATH issue, which was
> fixed by the commit that sanitized FILESPATH, hence the superseded.  Clearly
> there's another issue with them, so this patch is necessary.  Feel free to
> apply it with modification and push it, we can always drop it when we bump
> the minimum bitbake version to 1.10.x.

Thanks. I will push this patch shortly - I actually have it in my local 
repository applied, but I'm now facing another issue and trying to solve it 
first...

-- 
Denys



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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-20 23:29               ` Denys Dmytriyenko
  2010-10-20 23:34                 ` Chris Larson
@ 2010-10-21  6:27                 ` Martin Jansa
  2010-10-21 14:04                   ` Chris Larson
  1 sibling, 1 reply; 36+ messages in thread
From: Martin Jansa @ 2010-10-21  6:27 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: clarson, openembedded-devel

On Wed, Oct 20, 2010 at 07:29:06PM -0400, Denys Dmytriyenko wrote:
> On Tue, Oct 19, 2010 at 03:24:58PM -0400, Denys Dmytriyenko wrote:
> > On Tue, Oct 19, 2010 at 02:18:25PM -0500, Maupin, Chase wrote:
> > > > > I saw this issue in my overlay of having a "::" in my OVERRIDES which
> > > > > caused my parsing to fail in angstrom.inc.  Applying this fix from
> > > > Martin
> > > > > resolves the parsing issue.  My OVERRIDES appear to be in the correct
> > > > order
> > > > > with this change:
> > > > 
> > > > Can you explain this?  "caused my parsing to fail" is not very useful
> > > > information.  What exactly failed?
> > > 
> > > Chris,
> > > 
> > > Sorry, I thought this was an understood issue.  I have put the error output 
> > > I got below.  Basically, when I got to line 509 of data.py the variables had 
> > > the following values:
> > > 
> > > vars = set(['__functions_', '_', '__functions__'])
> > > 
> > > var = '__functions__'
> > > 
> > > overrides = ['pn-angstrom', 'fail-fast', 'build-linux', 'arm', 'INVALID', 'angstrom-2008.1', '', 'am37x-evm', 'local']
> > >  
> > > o = ''
> > > 
> > > OVERRIDES = 'pn-angstrom:fail-fast:build-linux:arm:INVALID:angstrom-2008.1::am37x-evm:local'
> > > 
> > > The current override being evaluated was the '' one.
> > > 
> > > The line being evaluated in my overlay was USERDISTRO := "${DISTRO}" in my 
> > > copy of angstrom.inc
> > 
> > Chris,
> > 
> > FYI, the below "RuntimeError: Set changed size during iteration" exception 
> > happens in bitbake 1.8.18 but not the 1.10/mainline.
> 
> Chris, Martin,
> 
> After more debugging, it seems the problem is caused by using bitbake 1.8.18 
> and conf/collections.inc at the same time, as that version of bitbake chokes 
> on empty override "::", when it gets re-spawned from collections.inc. If I 
> replace the use of COLLECTIONS with direct BBFILES/BBFILE_* assignments, bitbake 
> parses everything just fine. It is reproducible right now on the latest OE 
> mainline with bitbake 1.8.18 by just adding "require conf/collections.inc" in 
> local.conf or bitbake.conf.
> 
> I see that Martin's patch was marked as "Superseded" and archived - is there a 
> new patch coming? Or are there any side-effects of this patch? I would 
> definitely like to push this patch ASAP to address our immediate problem. 

I've marked it as "Superseded" when Chris pushed that filtering and I've checked 
that it fixes my case.

Maybe we can resolve it by using limited OVERRIDES in FILESPATH as
suggested in "[RFC] do we really need all OVERRIDES in FILESPATH?".
Instead of creating more complicated constructs to be able to push more
stuff to FILESPATH (without '::') and then never use it.

Regards,

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



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

* Re: [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty
  2010-10-21  6:27                 ` Martin Jansa
@ 2010-10-21 14:04                   ` Chris Larson
  0 siblings, 0 replies; 36+ messages in thread
From: Chris Larson @ 2010-10-21 14:04 UTC (permalink / raw)
  To: Martin Jansa; +Cc: openembedded-devel

On Wed, Oct 20, 2010 at 11:27 PM, Martin Jansa <martin.jansa@gmail.com>wrote:

> I've marked it as "Superseded" when Chris pushed that filtering and I've
> checked
> that it fixes my case.
>
> Maybe we can resolve it by using limited OVERRIDES in FILESPATH as
> suggested in "[RFC] do we really need all OVERRIDES in FILESPATH?".
> Instead of creating more complicated constructs to be able to push more
> stuff to FILESPATH (without '::') and then never use it.
>

MACHINE_OVERRIDES aren't specific to FILESPATH, as far as I know.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-10-15 19:44     ` Chris Larson
@ 2010-11-10 14:26       ` Richard Purdie
  2010-11-10 16:22         ` Otavio Salvador
  2010-11-10 16:29         ` Tom Rini
  0 siblings, 2 replies; 36+ messages in thread
From: Richard Purdie @ 2010-11-10 14:26 UTC (permalink / raw)
  To: openembedded-devel

On Fri, 2010-10-15 at 12:44 -0700, Chris Larson wrote:
> On Fri, Oct 15, 2010 at 12:37 PM, Koen Kooi <k.kooi@student.utwente.nl>wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On 15-10-10 17:41, Chris Larson wrote:
> > > From: Chris Larson <chris_larson@mentor.com>
> > >
> > > Given the current implementation of OVERRIDES in bitbake, the variable is
> > > expected to contain elements in the order least specific to most
> > specific,
> > > however, our current usage of it does not match that.  As one example,
> > "local"
> > > is supposed to always be the most specific override, yet currently it's
> > the
> > > least specific.  As another example, currently the target architecture is
> > seen
> > > as more specific than the machine, which is also clearly wrong.
> > >
> > > Big thanks to Chase Maupin for investigating and identifying this long
> > > standing issue.
> > >
> > > It becomes clear that a reversal of the current value will bring us to a
> > more
> > > sane behavior, and avoids the need for the dual overrides hack mentioned
> > in
> > > the comments, so this implements this reversal, and drops the unnecessary
> > and
> > > confusing comments.
> > >
> > > This also introduces a MACHINE_OVERRIDES variable as a generic mechanism
> > to
> > > inject overrides elements which are more specific than the distro but
> > less
> > > specific than the machine, which is where things like MACHINE_CLASS or
> > > SOC_FAMILY or the like would go.  This variable is *space* separated, to
> > make
> > > it easier and more convenient to assemble the variable incrementally.
> > >
> > > Reported-by: Chase Maupin <chase.maupin@ti.com>
> > > Signed-off-by: Chris Larson <chris_larson@mentor.com>
> >
> > Acked-by: Koen Kooi <k-kooi@ti.com>
> >
> 
> This is now in master -- thanks to all for the acks, review, comments -- let
> me know if any problems result from this.

You do realise the damage this potentially causes for compatibility of
metadata between OE and Poky?

This change is pretty serious and potentially alters the handling of any
double override. Poky uses them a bit more extensively than OE does. Its
effectively an architecture change to OE yet no discussion was had at
any TSC meeting :(.

I even asked about this a while back and was *told* that "local" was
meant to be weak, I therefore added a strong version to Poky, in the
spirit of maintaining compatibility.

Richard







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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-11-10 14:26       ` Richard Purdie
@ 2010-11-10 16:22         ` Otavio Salvador
  2010-11-10 16:27           ` Tom Rini
  2010-11-10 16:29         ` Tom Rini
  1 sibling, 1 reply; 36+ messages in thread
From: Otavio Salvador @ 2010-11-10 16:22 UTC (permalink / raw)
  To: openembedded-devel

On Wed, Nov 10, 2010 at 12:26 PM, Richard Purdie <rpurdie@rpsys.net> wrote:
...
> This change is pretty serious and potentially alters the handling of any
> double override. Poky uses them a bit more extensively than OE does. Its
> effectively an architecture change to OE yet no discussion was had at
> any TSC meeting :(.
...

I agree with Richard here. It was merged too fast.

We are suppose to have a release soon and this kind of change
shouldn't be done so near of it.

-- 
Otavio Salvador                  O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br



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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-11-10 16:22         ` Otavio Salvador
@ 2010-11-10 16:27           ` Tom Rini
  0 siblings, 0 replies; 36+ messages in thread
From: Tom Rini @ 2010-11-10 16:27 UTC (permalink / raw)
  To: openembedded-devel

Otavio Salvador wrote:
> On Wed, Nov 10, 2010 at 12:26 PM, Richard Purdie <rpurdie@rpsys.net> wrote:
> ...
>> This change is pretty serious and potentially alters the handling of any
>> double override. Poky uses them a bit more extensively than OE does. Its
>> effectively an architecture change to OE yet no discussion was had at
>> any TSC meeting :(.
> ...
> 
> I agree with Richard here. It was merged too fast.
> 
> We are suppose to have a release soon and this kind of change
> shouldn't be done so near of it.

To be fair, this was done a few weeks before it was decided that we'd 
even have releases, if I follow the timeline for that decision right.

-- 
Tom Rini
Mentor Graphics Corporation



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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-11-10 14:26       ` Richard Purdie
  2010-11-10 16:22         ` Otavio Salvador
@ 2010-11-10 16:29         ` Tom Rini
  2010-12-01 20:26           ` Maupin, Chase
  1 sibling, 1 reply; 36+ messages in thread
From: Tom Rini @ 2010-11-10 16:29 UTC (permalink / raw)
  To: openembedded-devel

Richard Purdie wrote:
> On Fri, 2010-10-15 at 12:44 -0700, Chris Larson wrote:
>> On Fri, Oct 15, 2010 at 12:37 PM, Koen Kooi <k.kooi@student.utwente.nl>wrote:
>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> On 15-10-10 17:41, Chris Larson wrote:
>>>> From: Chris Larson <chris_larson@mentor.com>
>>>>
>>>> Given the current implementation of OVERRIDES in bitbake, the variable is
>>>> expected to contain elements in the order least specific to most
>>> specific,
>>>> however, our current usage of it does not match that.  As one example,
>>> "local"
>>>> is supposed to always be the most specific override, yet currently it's
>>> the
>>>> least specific.  As another example, currently the target architecture is
>>> seen
>>>> as more specific than the machine, which is also clearly wrong.
>>>>
>>>> Big thanks to Chase Maupin for investigating and identifying this long
>>>> standing issue.
>>>>
>>>> It becomes clear that a reversal of the current value will bring us to a
>>> more
>>>> sane behavior, and avoids the need for the dual overrides hack mentioned
>>> in
>>>> the comments, so this implements this reversal, and drops the unnecessary
>>> and
>>>> confusing comments.
>>>>
>>>> This also introduces a MACHINE_OVERRIDES variable as a generic mechanism
>>> to
>>>> inject overrides elements which are more specific than the distro but
>>> less
>>>> specific than the machine, which is where things like MACHINE_CLASS or
>>>> SOC_FAMILY or the like would go.  This variable is *space* separated, to
>>> make
>>>> it easier and more convenient to assemble the variable incrementally.
>>>>
>>>> Reported-by: Chase Maupin <chase.maupin@ti.com>
>>>> Signed-off-by: Chris Larson <chris_larson@mentor.com>
>>> Acked-by: Koen Kooi <k-kooi@ti.com>
>>>
>> This is now in master -- thanks to all for the acks, review, comments -- let
>> me know if any problems result from this.
> 
> You do realise the damage this potentially causes for compatibility of
> metadata between OE and Poky?
> 
> This change is pretty serious and potentially alters the handling of any
> double override. Poky uses them a bit more extensively than OE does. Its
> effectively an architecture change to OE yet no discussion was had at
> any TSC meeting :(.
> 
> I even asked about this a while back and was *told* that "local" was
> meant to be weak, I therefore added a strong version to Poky, in the
> spirit of maintaining compatibility.
> 

(a) Eeep! and (b) That's pretty much the opposite of what the rest of 
the thread / discussion was, which is to say "local is supposed to be 
the final winner, why isn't it?"

Now... what do we do here?

-- 
Tom Rini
Mentor Graphics Corporation



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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-11-10 16:29         ` Tom Rini
@ 2010-12-01 20:26           ` Maupin, Chase
  2010-12-01 21:29             ` Chris Larson
  0 siblings, 1 reply; 36+ messages in thread
From: Maupin, Chase @ 2010-12-01 20:26 UTC (permalink / raw)
  To: openembedded-devel

> -----Original Message-----
> From: openembedded-devel-bounces@lists.openembedded.org
> [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf Of
> Tom Rini
> Sent: Wednesday, November 10, 2010 10:29 AM
> To: openembedded-devel@lists.openembedded.org
> Subject: Re: [oe] [PATCH (v2)] Reverse the order of OVERRIDES
> 
> Richard Purdie wrote:
> > On Fri, 2010-10-15 at 12:44 -0700, Chris Larson wrote:
> >> On Fri, Oct 15, 2010 at 12:37 PM, Koen Kooi
> <k.kooi@student.utwente.nl>wrote:
> >>
> >>> -----BEGIN PGP SIGNED MESSAGE-----
> >>> Hash: SHA1
> >>>
> >>> On 15-10-10 17:41, Chris Larson wrote:
> >>>> From: Chris Larson <chris_larson@mentor.com>
> >>>>
> >>>> Given the current implementation of OVERRIDES in bitbake, the
> variable is
> >>>> expected to contain elements in the order least specific to most
> >>> specific,
> >>>> however, our current usage of it does not match that.  As one example,
> >>> "local"
> >>>> is supposed to always be the most specific override, yet currently
> it's
> >>> the
> >>>> least specific.  As another example, currently the target
> architecture is
> >>> seen
> >>>> as more specific than the machine, which is also clearly wrong.
> >>>>
> >>>> Big thanks to Chase Maupin for investigating and identifying this
> long
> >>>> standing issue.
> >>>>
> >>>> It becomes clear that a reversal of the current value will bring us
> to a
> >>> more
> >>>> sane behavior, and avoids the need for the dual overrides hack
> mentioned
> >>> in
> >>>> the comments, so this implements this reversal, and drops the
> unnecessary
> >>> and
> >>>> confusing comments.
> >>>>
> >>>> This also introduces a MACHINE_OVERRIDES variable as a generic
> mechanism
> >>> to
> >>>> inject overrides elements which are more specific than the distro but
> >>> less
> >>>> specific than the machine, which is where things like MACHINE_CLASS
> or
> >>>> SOC_FAMILY or the like would go.  This variable is *space* separated,
> to
> >>> make
> >>>> it easier and more convenient to assemble the variable incrementally.
> >>>>
> >>>> Reported-by: Chase Maupin <chase.maupin@ti.com>
> >>>> Signed-off-by: Chris Larson <chris_larson@mentor.com>
> >>> Acked-by: Koen Kooi <k-kooi@ti.com>
> >>>
> >> This is now in master -- thanks to all for the acks, review, comments -
> - let
> >> me know if any problems result from this.
> >
> > You do realise the damage this potentially causes for compatibility of
> > metadata between OE and Poky?
> >
> > This change is pretty serious and potentially alters the handling of any
> > double override. Poky uses them a bit more extensively than OE does. Its
> > effectively an architecture change to OE yet no discussion was had at
> > any TSC meeting :(.
> >
> > I even asked about this a while back and was *told* that "local" was
> > meant to be weak, I therefore added a strong version to Poky, in the
> > spirit of maintaining compatibility.
> >
> 
> (a) Eeep! and (b) That's pretty much the opposite of what the rest of
> the thread / discussion was, which is to say "local is supposed to be
> the final winner, why isn't it?"
> 
> Now... what do we do here?

I know this was all posted a while back.  Has there been any resolution on this?  I didn't notice any additional responses to this thread.

> 
> --
> Tom Rini
> Mentor Graphics Corporation
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel



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

* Re: [PATCH (v2)] Reverse the order of OVERRIDES
  2010-12-01 20:26           ` Maupin, Chase
@ 2010-12-01 21:29             ` Chris Larson
  0 siblings, 0 replies; 36+ messages in thread
From: Chris Larson @ 2010-12-01 21:29 UTC (permalink / raw)
  To: openembedded-devel

On Wed, Dec 1, 2010 at 1:26 PM, Maupin, Chase <chase.maupin@ti.com> wrote:
> I know this was all posted a while back.  Has there been any resolution on this?  I didn't notice any additional responses to this thread.
>

See the TSC meeting notes, it was discussed (with myself excluded from
the decision making), and the decision was that it would be reverted
and the issue revisited with an eye toward compatibility issues on a
branch.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics



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

end of thread, other threads:[~2010-12-01 21:31 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-15  3:36 [PATCH] Reverse the order of OVERRIDES Chris Larson
2010-10-15  4:07 ` Khem Raj
2010-10-15  6:56   ` Frans Meulenbroeks
2010-10-15 14:18   ` Tom Rini
2010-10-15 10:42 ` Koen Kooi
2010-10-15 14:12 ` Maupin, Chase
2010-10-15 15:17   ` Chris Larson
2010-10-15 15:29     ` Maupin, Chase
2010-10-15 15:41 ` [PATCH (v2)] " Chris Larson
2010-10-15 16:02   ` Maupin, Chase
2010-10-15 17:20   ` Khem Raj
2010-10-15 19:37   ` Koen Kooi
2010-10-15 19:44     ` Chris Larson
2010-11-10 14:26       ` Richard Purdie
2010-11-10 16:22         ` Otavio Salvador
2010-11-10 16:27           ` Tom Rini
2010-11-10 16:29         ` Tom Rini
2010-12-01 20:26           ` Maupin, Chase
2010-12-01 21:29             ` Chris Larson
2010-10-16 18:04 ` [PATCH] " Martin Jansa
2010-10-16 18:24   ` Chris Larson
2010-10-16 18:50     ` Martin Jansa
2010-10-16 19:35       ` Martin Jansa
2010-10-16 19:54         ` Martin Jansa
2010-10-16 19:24     ` [PATCH] bitbake.conf: don't append MACHINE_OVERRIDES to OVERRIDES when it's empty Martin Jansa
2010-10-19 19:05       ` Maupin, Chase
2010-10-19 19:09         ` Chris Larson
2010-10-19 19:18           ` Maupin, Chase
2010-10-19 19:24             ` Denys Dmytriyenko
2010-10-20 23:29               ` Denys Dmytriyenko
2010-10-20 23:34                 ` Chris Larson
2010-10-21  2:45                   ` Denys Dmytriyenko
2010-10-21  6:27                 ` Martin Jansa
2010-10-21 14:04                   ` Chris Larson
2010-10-19 19:24           ` Maupin, Chase
2010-10-16 19:32     ` [PATCH] bitbake.conf: reverse OVERRIDES order in FILESPATH definition Martin Jansa

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.