All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Neves <ptsneves@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Paulo Neves <paulo.de_sousa_neves@nokia.com>
Subject: [PATCH] Fix COMPATIBLE_MACHINE for -native recipe variants.
Date: Fri, 12 Jan 2018 18:45:54 +0100	[thread overview]
Message-ID: <1515779154-17898-1-git-send-email-ptsneves@gmail.com> (raw)

From: Paulo Neves <paulo.de_sousa_neves@nokia.com>

Hello I am having a problem where I want a recipe, along
with its -native version to only be available when allowed
by compatible machine.

In the non native case, COMPATIBLE_MACHINE is correctly
honored. But in the -native version the COMPATIBLE_MACHINE
is not honored because in the native.bbclass there is:

MACHINEOVERRIDES = ""

This change was introduced in
d09e6d883042e5d094cd08d829327c4bbbfae135.
While the explanation provided by the commit is accurate for
specific case mentioned it also breaks the
COMPATIBLE_MACHINE mechanism which relies on the
MACHINEOVERRIDES variable.

Further evidence that this was not intended is that the
exception text is false:

ERROR: Nothing PROVIDES 'x-filter-native'
x-filter-native was skipped: incompatible with machine m1
(not in COMPATIBLE_MACHINE)

And the x-filter-native'.bb recipe header contains:

COMPATIBLE_MACHINE = "^m1$"

So the exception uses ${MACHINE} to report that a
${MACHINEOVERRIDE} was not matched with the
COMPATIBLE_MACHINE, which is a false statement.

This fix attempts to correct the issue with minimal
changes.

Change-Id: If5085e4e92550b8154033dd56149eb4e358ef266
---
 meta/classes/base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index d95afb7..d1c31c2 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -488,7 +488,7 @@ python () {
     need_machine = d.getVar('COMPATIBLE_MACHINE')
     if need_machine:
         import re
-        compat_machines = (d.getVar('MACHINEOVERRIDES') or "").split(":")
+        compat_machines = (d.getVar('MACHINEOVERRIDES') or d.getVar('MACHINE')).split(":")
         for m in compat_machines:
             if re.match(need_machine, m):
                 break
-- 
2.7.4



             reply	other threads:[~2018-01-12 17:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 17:45 Paulo Neves [this message]
2018-01-12 18:04 ` ✗ patchtest: failure for Fix COMPATIBLE_MACHINE for -native recipe variants Patchwork
2018-01-13 17:14 ` [PATCH] " Richard Purdie
     [not found]   ` <d7600f26-373a-7ca9-cbaa-97dfac3bd86d@nokia.com>
2018-01-15 11:05     ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515779154-17898-1-git-send-email-ptsneves@gmail.com \
    --to=ptsneves@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paulo.de_sousa_neves@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.