Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: Steve Sakoman <steve@sakoman.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [OE-core][scarthgap 14/21] lib/oe/go: document map_arch, and raise an error on unknown architecture
Date: Wed, 26 Nov 2025 18:40:39 -0600	[thread overview]
Message-ID: <ecf41074-e75d-4c24-a149-dcb411dc7a39@kernel.crashing.org> (raw)
In-Reply-To: <e6de433ccb2784581d6c775cce97f414ef9334b1.1763849517.git.steve@sakoman.com>

This patch breaks Microblaze for me.

Microblazeel is not in the list of course, but go doesn't support this architecture.

During parsing of various things, instead of the component not being available I 
now get many many lines similar to:

WARNING: <recipe>: Exception during build_dependencies for GOARCH
WARNING: <recipe>: Error during finalize of <multiconfig>
ERROR: ExpansionError during parsing <recipe>
bb.data_smart.ExceptionError: Failure expanding TARGET_GOARCH, expression was 
${go_map_arch(d.getVar('TARGET_ARCH'), d)} which triggered exception KeyError: 
'Cannot map architecture microblazeel'
The variable dependency chain for the failure is: TARGET_GOARCH -> GOARCH

(at which point parsing stops)

I see no obvious way here to add an architecture that OE/Poky does not support, 
which now makes this a hard error for any architecture not supported by the core 
of OE and/or go.  (in the case of microblaze, rust and go are likely to never be 
supported.  So there has to be a way for me to avoid the parse error in these 
cases.)

On 11/22/25 4:14 PM, Steve Sakoman wrote:
> From: Ross Burton <ross.burton@arm.com>
> 
> Add a comment explaining what this function does and where the values
> come from.
> 
> If the architecture isn't know, instead of returning an empty string
> which could fail mysteriously, raise a KeyError so it fails quickly.
> 
> (From OE-Core rev: 025414c16319b068df1cd757ad9a3c987a6b871d)
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> Signed-off-by: Peter Marko <peter.marko@siemens.com>
> Signed-off-by: Steve Sakoman <steve@sakoman.com>
> ---
>   meta/lib/oe/go.py | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oe/go.py b/meta/lib/oe/go.py
> index dfd957d157..4559dc63b2 100644
> --- a/meta/lib/oe/go.py
> +++ b/meta/lib/oe/go.py
> @@ -7,6 +7,10 @@
>   import re
>   
>   def map_arch(a):
> +    """
> +    Map our architecture names to Go's GOARCH names.
> +    See https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go for the complete list.
> +    """
>       if re.match('i.86', a):
>           return '386'
>       elif a == 'x86_64':
> @@ -31,4 +35,4 @@ def map_arch(a):
>           return 'riscv64'
>       elif a == 'loongarch64':
>           return 'loong64'
> -    return ''
> +    raise KeyError(f"Cannot map architecture {a}")
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#226712): https://lists.openembedded.org/g/openembedded-core/message/226712
> Mute This Topic: https://lists.openembedded.org/mt/116430143/3616948
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [mark.hatle@kernel.crashing.org]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


  reply	other threads:[~2025-11-27  0:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-22 22:14 [OE-core][scarthgap 00/21] Patch review Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 01/21] spdx30: fix cve status for patch files in VEX Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 02/21] spdx30: Provide software_packageUrl field in SPDX 3.0 SBOM Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 03/21] sqlite3: patch CVE-2025-7709 Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 04/21] xserver-xorg: remove redundant patch Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 05/21] xserver-xorg: fix CVE-2025-62229 CVE-2025-62230 CVE-2025-62231 Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 06/21] xwayland: fix CVE-2025-62229 Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 07/21] xwayland: fix CVE-2025-62230 Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 08/21] xwayland: fix CVE-2025-62231 Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 09/21] musl: patch CVE-2025-26519 Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 10/21] rust-target-config: fix nativesdk-libstd-rs build with baremetal Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 11/21] glslang: fix compiling with gcc15 Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 12/21] testsdk: allow user to specify which tests to run Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 13/21] oe/sdk: fix empty SDK manifests Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 14/21] lib/oe/go: document map_arch, and raise an error on unknown architecture Steve Sakoman
2025-11-27  0:40   ` Mark Hatle [this message]
     [not found]   ` <187BB63A9D5CD718.192695@lists.openembedded.org>
2025-11-27  1:02     ` Mark Hatle
2025-11-27  4:45       ` Peter Kjellerstedt
2025-11-27 15:49         ` Mark Hatle
2025-11-27  7:00       ` Marko, Peter
2025-11-27 15:51         ` Mark Hatle
2025-11-27 16:08           ` Marko, Peter
2025-11-22 22:14 ` [OE-core][scarthgap 15/21] goarch.bbclass: do not leak TUNE_FEATURES into crosssdk task signatures Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 16/21] go: add sdk test Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 17/21] go: extend runtime test Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 18/21] go: remove duplicate arch map in sdk test Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 19/21] oeqa: fix package detection in go sdk tests Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 20/21] oeqa: drop unnecessary dependency from go runtime tests Steve Sakoman
2025-11-22 22:14 ` [OE-core][scarthgap 21/21] oeqa/sdk/buildepoxy: skip test in eSDK Steve Sakoman

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=ecf41074-e75d-4c24-a149-dcb411dc7a39@kernel.crashing.org \
    --to=mark.hatle@kernel.crashing.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=steve@sakoman.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox