From patchwork Tue Aug 4 16:57:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94490 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AF6FC56202 for ; Tue, 4 Aug 2026 16:58:19 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21209.1785862690352603610 for ; Tue, 04 Aug 2026 09:58:10 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=ZPF0mHEE; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A5BC21476 for ; Tue, 4 Aug 2026 09:58:05 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5382A3F66F for ; Tue, 4 Aug 2026 09:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862689; bh=twSgCRYh+pWQxkgNTcPmDQZfPWAp89omajrL+vWGLx0=; h=From:To:Subject:Date:From; b=ZPF0mHEEw7voSMp43q/Bm0p5WWEd8m5KneWz8ogOfVpmfSa0nRysmtfFRKzzkvZLR J319oBbHB5YZboSuPQM5oQxX9zgKLNxId07ARdF323NtXy4Fi1HPaq0WT0+F2cOHJs oklW/wZryF4nDwg5RX3EB0F1zDTDuVuVCOxu9lwA= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/9] classes/cargo_common: move PKG_CONFIG_ALLOW_CROSS export to oe_cargo_fix_env Date: Tue, 4 Aug 2026 17:57:55 +0100 Message-ID: <20260804165803.598030-1-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242781 This export is used to tell the pkg-config-rs crate how to behave, so is only needed at build time. Move the export to oe_cargo_fix_env() along with the other variables so that the exports are localised and not global. Signed-off-by: Ross Burton --- meta/classes-recipe/cargo_common.bbclass | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index a21c5423642..95739122a59 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass @@ -20,11 +20,6 @@ inherit rust-common # Where we download our registry and dependencies to export CARGO_HOME = "${UNPACKDIR}/cargo_home" -# The pkg-config-rs library used by cargo build scripts disables itself when -# cross compiling unless this is defined. We set up pkg-config appropriately -# for cross compilation, so tell it we know better than it. -export PKG_CONFIG_ALLOW_CROSS = "1" - # Don't instruct cargo to use crates downloaded by bitbake. Some rust packages, # for example the rust compiler itself, come with their own vendored sources. # Specifying two [source.crates-io] will not work. @@ -241,11 +236,15 @@ oe_cargo_fix_env () { # openssl-sys export OPENSSL_NO_VENDOR="1" - # pkg-config-rs. Crates can still override the dynamic linking - # but try to dynamically link to system libraries. + # pkg-config-rs. # https://docs.rs/pkg-config/latest/pkg_config/ - export SYSTEM_DEPS_BUILD_INTERNAL="never" + # In cross pkg-config-rs disables itself unless this is defined to tell it + # we have set up sysroots appropriately. + export PKG_CONFIG_ALLOW_CROSS="1" + # Crates can still override the dynamic linking but try to dynamically link + # to system libraries. export PKG_CONFIG_ALL_DYNAMIC="1" + export SYSTEM_DEPS_BUILD_INTERNAL="never" # zstd-sys export ZSTD_SYS_USE_PKG_CONFIG="1" From patchwork Tue Aug 4 16:57:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94492 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 355D5C56203 for ; Tue, 4 Aug 2026 16:58:19 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21210.1785862690982759962 for ; Tue, 04 Aug 2026 09:58:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=evyF3m2O; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 50E1B165C for ; Tue, 4 Aug 2026 09:58:06 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 05B2D3F66F for ; Tue, 4 Aug 2026 09:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862690; bh=O2FPLrxOStcXzRUu0wocSOI7QzysIgGaz8nRHLHE+94=; h=From:To:Subject:Date:In-Reply-To:References:From; b=evyF3m2OB27ehFidx9iakL8ksB6tawZZxkae0EFLK9sBcCV7KnDli14PveeUzF0ko EzXLY33bIAQ3BhRvIqpjNkEy39+1g3GkAgGIAhTXlFa88MKZS4+tQKJW/l8wAUUD6n TgvtItP/BMqcpRSxo86/7leeQ0RwNmCQzohoAr1o= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/9] classes/rust: remove unused variables Date: Tue, 4 Aug 2026 17:57:56 +0100 Message-ID: <20260804165803.598030-2-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804165803.598030-1-ross.burton@arm.com> References: <20260804165803.598030-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242782 RUSTC_ARCHFLAGS is never passed anywhere, remove it. RUSTC_BUILD_LDFLAGS is commented out, remove it. HOST_CFLAGS et al are assigned to the CFLAGS for convenience, but are not used anywhere and the same values are exported in cargo_common's oe_cargo_fix_env(). Signed-off-by: Ross Burton --- meta/classes-recipe/rust.bbclass | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/meta/classes-recipe/rust.bbclass b/meta/classes-recipe/rust.bbclass index e727601679a..6407c103941 100644 --- a/meta/classes-recipe/rust.bbclass +++ b/meta/classes-recipe/rust.bbclass @@ -8,8 +8,6 @@ inherit rust-common RUSTC = "rustc" -RUSTC_ARCHFLAGS += "--target=${RUST_HOST_SYS} ${RUSTFLAGS}" - def rust_base_dep(d): # Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to # use rust instead of gcc @@ -23,26 +21,6 @@ def rust_base_dep(d): DEPENDS:append = " ${@rust_base_dep(d)}" -# BUILD_LDFLAGS -# ${STAGING_LIBDIR_NATIVE} -# ${STAGING_BASE_LIBDIR_NATIVE} -# BUILDSDK_LDFLAGS -# ${STAGING_LIBDIR} -# #{STAGING_DIR_HOST} -# TARGET_LDFLAGS ????? -#RUSTC_BUILD_LDFLAGS = "\ -# --sysroot ${STAGING_DIR_NATIVE} \ -# -L${STAGING_LIBDIR_NATIVE} \ -# -L${STAGING_BASE_LIBDIR_NATIVE} \ -#" - -# XXX: for some reason bitbake sets BUILD_* & TARGET_* but uses the bare -# variables for HOST. Alias things to make it easier for us. -HOST_LDFLAGS ?= "${LDFLAGS}" -HOST_CFLAGS ?= "${CFLAGS}" -HOST_CXXFLAGS ?= "${CXXFLAGS}" -HOST_CPPFLAGS ?= "${CPPFLAGS}" - rustlib_suffix = "${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${RUST_HOST_SYS}/lib" # Native sysroot standard library path rustlib_src = "${prefix}/lib/${rustlib_suffix}" From patchwork Tue Aug 4 16:57:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2C4DC561F8 for ; Tue, 4 Aug 2026 16:58:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.21232.1785862691617575847 for ; Tue, 04 Aug 2026 09:58:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=A4DXXTNQ; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 043391476 for ; Tue, 4 Aug 2026 09:58:07 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AB4693F66F for ; Tue, 4 Aug 2026 09:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862691; bh=OtAV9CDQm3VaojLG/5RiZ0a1aY3IySsXxKFJFfR0HgA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A4DXXTNQEZMAiFuZGLyMGa0Qet/SrHN6rSaOwLKVPLL/i0nQ8tb97dC1s+202T2aI fuqfeuq0Ju35DwYftqoZQuxS700pRg4YrJ7oRFESCGPXW2E/iFA2ca6LpY/TwkaqW6 RPsKTxrlAdBWVtTx4xxe94dGX3twLIhGY6zljD7w= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/9] classes/cargo: move general assignments to cargo_common.bbclass Date: Tue, 4 Aug 2026 17:57:57 +0100 Message-ID: <20260804165803.598030-3-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804165803.598030-1-ross.burton@arm.com> References: <20260804165803.598030-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242783 The cargo integration is split into two classes so that recipes can inherit cargo_common if they can't use cargo directly to build, for example when using meson+cargo or building rust itself. However, a number of variables where in cargo.bbclass when they should really be in cargo_common.bbclass: move the assignments so that the cargo.bbclass simply inherits cargo_common, sets B, and implements the compile/install tasks. Signed-off-by: Ross Burton --- meta/classes-recipe/cargo.bbclass | 27 ---------------------- meta/classes-recipe/cargo_common.bbclass | 29 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index b34f3ce0cd7..31e655650cc 100644 --- a/meta/classes-recipe/cargo.bbclass +++ b/meta/classes-recipe/cargo.bbclass @@ -26,33 +26,6 @@ DEPENDS:append:class-native = " rust-native" # Enable build separation B = "${WORKDIR}/build" -# In case something fails in the build process, give a bit more feedback on -# where the issue occured -export RUST_BACKTRACE = "1" - -RUSTFLAGS ??= "" - -# The cargo profile to use. Defaults to release or dev based on DEBUG_BUILD, but -# can be set to any valid profile. -# https://doc.rust-lang.org/cargo/reference/profiles.html -CARGO_PROFILE ?= "${@oe.utils.vartrue('DEBUG_BUILD', 'dev', 'release', d)}" - -# --frozen flag will prevent network access (which is required since only -# the do_fetch step is authorized to access network) -# and will require an up to date Cargo.lock file. -# This force the package being built to already ship a Cargo.lock, in the end -# this is what we want, at least, for reproducibility of the build. -CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} --profile=${CARGO_PROFILE} --manifest-path=${CARGO_MANIFEST_PATH}" - -# The build directory is named after the profile, apart from the dev profile -# which uses 'debug'. -def cargo_build_directory(d): - profile = d.getVar("CARGO_PROFILE") - return "debug" if profile == "dev" else profile -BUILD_DIR = "${@cargo_build_directory(d)}" - -CARGO_TARGET_SUBDIR = "${RUST_HOST_SYS}/${BUILD_DIR}" - oe_cargo_build () { export RUSTFLAGS="${RUSTFLAGS}" bbnote "Using rust targets from ${RUST_TARGET_PATH}" diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index 95739122a59..0fb6844d932 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass @@ -17,6 +17,35 @@ # add crate fetch support inherit rust-common +# In case something fails in the build process, give a bit more feedback on +# where the issue occured +export RUST_BACKTRACE = "1" + +# Flags passed to all invocations of rustc +# https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags +RUSTFLAGS ??= "" + +# The cargo profile to use. Defaults to release or dev based on DEBUG_BUILD, but +# can be set to any valid profile. +# https://doc.rust-lang.org/cargo/reference/profiles.html +CARGO_PROFILE ?= "${@oe.utils.vartrue('DEBUG_BUILD', 'dev', 'release', d)}" + +# --frozen flag will prevent network access (which is required since only +# the do_fetch step is authorized to access network) +# and will require an up to date Cargo.lock file. +# This force the package being built to already ship a Cargo.lock, in the end +# this is what we want, at least, for reproducibility of the build. +CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} --profile=${CARGO_PROFILE} --manifest-path=${CARGO_MANIFEST_PATH}" + +# The build directory is named after the profile, apart from the dev profile +# which uses 'debug'. +def cargo_build_directory(d): + profile = d.getVar("CARGO_PROFILE") + return "debug" if profile == "dev" else profile +BUILD_DIR = "${@cargo_build_directory(d)}" + +CARGO_TARGET_SUBDIR = "${RUST_HOST_SYS}/${BUILD_DIR}" + # Where we download our registry and dependencies to export CARGO_HOME = "${UNPACKDIR}/cargo_home" From patchwork Tue Aug 4 16:57:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BC17C56201 for ; Tue, 4 Aug 2026 16:58:19 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.21233.1785862692161052914 for ; Tue, 04 Aug 2026 09:58:12 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=ABslkqp8; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A9CDB165C for ; Tue, 4 Aug 2026 09:58:07 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5BC673F66F for ; Tue, 4 Aug 2026 09:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862691; bh=m2yVo8OuCPKS1d21oM8BTwjKWivskcDDewi0hnViFzg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ABslkqp8J3lxo7WJsoMw4Q2bwtkR+c5rErxYl0rf7yWVrem9UPTe0DH/dCkNmlgRj DWiIStkeolTyKUk0zJtSszsY9W77Do5v4zhDvZk6aIVyjbNxFe2HxMXVQ+NGHmYXgX cuKYHkBvpi2NLQH/WPv8r9TLt1tcmDVOUbrsOdDs= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 4/9] classes/cargo: consolidate dependencies Date: Tue, 4 Aug 2026 17:57:58 +0100 Message-ID: <20260804165803.598030-4-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804165803.598030-1-ross.burton@arm.com> References: <20260804165803.598030-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242784 Move the dependencies from cargo to cargo_common: if cargo is being used in any way then you need to depend on cargo-native. Inherit rust instead of rust-common or rust-target-config: rust inherits rust-common that inherits rust-target-config, and rust.bbclass simply adds the dependency on rust-native. This means we can drop the explicit rust dependencies to avoid duplication. Signed-off-by: Ross Burton --- meta/classes-recipe/cargo.bbclass | 9 --------- meta/classes-recipe/cargo_common.bbclass | 4 +++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index 31e655650cc..628dbc98f18 100644 --- a/meta/classes-recipe/cargo.bbclass +++ b/meta/classes-recipe/cargo.bbclass @@ -10,19 +10,10 @@ ## Cargo. inherit cargo_common -inherit rust-target-config # the binary we will use CARGO = "cargo" -# We need cargo to compile for the target -BASEDEPENDS:append = " cargo-native" - -# Ensure we get the right rust variant -DEPENDS:append:class-target = " rust-native ${RUSTLIB_DEP}" -DEPENDS:append:class-nativesdk = " rust-native ${RUSTLIB_DEP}" -DEPENDS:append:class-native = " rust-native" - # Enable build separation B = "${WORKDIR}/build" diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index 0fb6844d932..f58bd80728c 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass @@ -15,7 +15,9 @@ ## # add crate fetch support -inherit rust-common +inherit rust + +BASEDEPENDS:append = " cargo-native" # In case something fails in the build process, give a bit more feedback on # where the issue occured From patchwork Tue Aug 4 16:57:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35739C56205 for ; Tue, 4 Aug 2026 16:58:19 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21211.1785862692875506295 for ; Tue, 04 Aug 2026 09:58:12 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=SFBwGdIR; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 593141476 for ; Tue, 4 Aug 2026 09:58:08 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0CAB43F66F for ; Tue, 4 Aug 2026 09:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862692; bh=hFRNAIDIyO1aI7ZN3d6e+BbGb9+O8/l5/YGuKJzsDfY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SFBwGdIRh0CD3d+1QTLHk1mgJImq5Op7BkU+wE7GLwtmnGmVRtlcPYHpJupeGtBcW QHnOalQZWbGPtT1MSaSV/l+LGXE4BTn0pVnNsSk31etEK65THcndPDdFq+7xrLzfvw sVwXYvm8i0mZw0ACZFg3utHhyoXw3Ld7sgHuRCl4= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 5/9] rust: clean up dependencies Date: Tue, 4 Aug 2026 17:57:59 +0100 Message-ID: <20260804165803.598030-5-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804165803.598030-1-ross.burton@arm.com> References: <20260804165803.598030-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242785 The rust recipe inherits cargo_common which now depends on rust-native and cargo-native, so we can just remove those dependencies in the native case instead of having to handle target/nativesdk. Signed-off-by: Ross Burton --- meta/recipes-devtools/rust/rust_1.96.1.bb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/meta/recipes-devtools/rust/rust_1.96.1.bb b/meta/recipes-devtools/rust/rust_1.96.1.bb index f8f47b04142..7d1761c562c 100644 --- a/meta/recipes-devtools/rust/rust_1.96.1.bb +++ b/meta/recipes-devtools/rust/rust_1.96.1.bb @@ -12,21 +12,19 @@ inherit rust inherit cargo_common DEPENDS += "llvm" + # native rust uses cargo/rustc from binary snapshots to bootstrap # but everything else should use our native builds -DEPENDS:append:class-target = " cargo-native rust-native" -DEPENDS:append:class-nativesdk = " cargo-native rust-native" +DEPENDS:remove:class-native = "cargo-native" +INHIBIT_DEFAULT_RUST_DEPS:class-native = "1" + +PROVIDES:class-native = "virtual/${TARGET_PREFIX}rust" RDEPENDS:${PN}:append:class-target = " gcc g++ binutils" PACKAGECONFIG ??= "llvm-shared" PACKAGECONFIG[llvm-shared] = ",,," -# Otherwise we'll depend on what we provide -INHIBIT_DEFAULT_RUST_DEPS:class-native = "1" -# We don't need to depend on gcc-native because yocto assumes it exists -PROVIDES:class-native = "virtual/${TARGET_PREFIX}rust" - S = "${RUSTSRC}" # Separate build directory from the shared source tree so that multiple # variants (target, native, nativesdk) don't conflict in the source dir. From patchwork Tue Aug 4 16:58:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA6F3C55838 for ; Tue, 4 Aug 2026 16:58:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21212.1785862693819165164 for ; Tue, 04 Aug 2026 09:58:13 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=YzcPvhB4; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 13F781476 for ; Tue, 4 Aug 2026 09:58:09 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B1BB53F66F for ; Tue, 4 Aug 2026 09:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862693; bh=j/nsyXJmZcylBcuPCaLzk5Hl3XXF8cpRnotmhalaTZ4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YzcPvhB4U4QJ1VjbyYq5Wc2SEXCPtn0vkOa9x+GNjYivLn2OeUd9SVPY+Vq1hxwY3 Edjyjch0vYl8d4TcRO8bRWDCiqxlSabZcXqgNu1XDEE1duyEoauF+sfMFNK49qsW14 FIXlyLSAqHjvPCl3VWRVsroZkM44ApgZ6qGeObrs= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 6/9] classes/cargo_c: inherit cargo_common Date: Tue, 4 Aug 2026 17:58:00 +0100 Message-ID: <20260804165803.598030-6-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804165803.598030-1-ross.burton@arm.com> References: <20260804165803.598030-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242786 This class is an alternative to cargo.bbclass, and now the dependencies have moved to cargo_common.bbclass it can inherit that class directly. As cargo.bbclass sets B, we can set it in cargo_c.bbclass. Signed-off-by: Ross Burton --- meta/classes-recipe/cargo_c.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/cargo_c.bbclass b/meta/classes-recipe/cargo_c.bbclass index e91ee1d9fc0..18574b73cb2 100644 --- a/meta/classes-recipe/cargo_c.bbclass +++ b/meta/classes-recipe/cargo_c.bbclass @@ -9,7 +9,7 @@ ## This class is used by any recipes that want to compile a C ABI compatible ## library with header and pkg config file -inherit cargo pkgconfig +inherit cargo_common pkgconfig # the binaries we will use CARGO_C_BUILD = "cargo-cbuild" @@ -18,6 +18,8 @@ CARGO_C_INSTALL = "cargo-cinstall" # We need cargo-c to compile for the target BASEDEPENDS:append = " cargo-c-native" +B = "${WORKDIR}/build" + do_compile[progress] = "outof:\s+(\d+)/(\d+)" cargo_c_do_compile() { oe_cargo_fix_env From patchwork Tue Aug 4 16:58:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94484 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB7F1C55822 for ; Tue, 4 Aug 2026 16:58:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21213.1785862694178102193 for ; Tue, 04 Aug 2026 09:58:14 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=FvAUdaz8; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BAF42165C for ; Tue, 4 Aug 2026 09:58:09 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6C68B3F66F for ; Tue, 4 Aug 2026 09:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862693; bh=OKY5qFwMntA9PsvoyvdllbPyOkepXTL1hwu8nxS1QxA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FvAUdaz85QzUPh9ja9BDGjP3YwuN4w08GI9E2VYScyUreN3hwkIWcXw4P37vjhR2B 2blNx5KquEN1vEeK+Tvkunl0LJPRpbAI/hOEmZuA0315K9OCrW7+mEXIKU2Rhw1OUx eRor5Q7qX7U/dkWOMU4/g1EIoPaksMN273kdte5A= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 7/9] classes/cargo-c: remove CARGO_C_BUILD/CARGO_C_INSTALL variables Date: Tue, 4 Aug 2026 17:58:01 +0100 Message-ID: <20260804165803.598030-7-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804165803.598030-1-ross.burton@arm.com> References: <20260804165803.598030-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242787 There's no point in having variables to control what cargo-c binaries are executed as there are no alternatives. The cargo class does this because it is used when bootstrapping cargo. This isn't needed to build cargo-c, but the pattern was copied into this class. Signed-off-by: Ross Burton --- meta/classes-recipe/cargo_c.bbclass | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/meta/classes-recipe/cargo_c.bbclass b/meta/classes-recipe/cargo_c.bbclass index 18574b73cb2..e68ac93a610 100644 --- a/meta/classes-recipe/cargo_c.bbclass +++ b/meta/classes-recipe/cargo_c.bbclass @@ -11,10 +11,6 @@ inherit cargo_common pkgconfig -# the binaries we will use -CARGO_C_BUILD = "cargo-cbuild" -CARGO_C_INSTALL = "cargo-cinstall" - # We need cargo-c to compile for the target BASEDEPENDS:append = " cargo-c-native" @@ -25,16 +21,13 @@ cargo_c_do_compile() { oe_cargo_fix_env export RUSTFLAGS="${RUSTFLAGS}" bbnote "Using rust targets from ${RUST_TARGET_PATH}" - bbnote "cargo-cbuild = $(which ${CARGO_C_BUILD})" - bbnote "${CARGO_C_BUILD} cbuild ${CARGO_BUILD_FLAGS}" - "${CARGO_C_BUILD}" cbuild ${CARGO_BUILD_FLAGS} + cargo-cbuild cbuild ${CARGO_BUILD_FLAGS} } cargo_c_do_install() { oe_cargo_fix_env export RUSTFLAGS="${RUSTFLAGS}" - bbnote "cargo-cinstall = $(which ${CARGO_C_INSTALL})" - "${CARGO_C_INSTALL}" cinstall ${CARGO_BUILD_FLAGS} \ + cargo-cinstall cinstall ${CARGO_BUILD_FLAGS} \ --destdir ${D} \ --prefix ${prefix} \ --libdir ${libdir} \ From patchwork Tue Aug 4 16:58:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94485 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA846C55184 for ; Tue, 4 Aug 2026 16:58:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21214.1785862694852057545 for ; Tue, 04 Aug 2026 09:58:14 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=XWVTo8JN; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6B8731476 for ; Tue, 4 Aug 2026 09:58:10 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1D2733F66F for ; Tue, 4 Aug 2026 09:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862694; bh=1FvUplVL9rUZya5FNXhG7iaEWTJqZknrmnvSXkw3EpY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XWVTo8JNQWqQ9Ju+BZZcV0+OmHejzoLlXpUjKYaXVccnSTLCAuOOLMPmI+6wa3970 r9SEBN7jQ/jeZKiJblHs7vykloU+qmayKXrBY6NrWZE4gaQiBqSlzik3Nip7+Gdzti tHRDuVWW9VuqojrvIpdj54CrqRAvTNjqDw0n12v4= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 8/9] classes/cargo-c: pass flags via CARGO_BUILD_FLAGS Date: Tue, 4 Aug 2026 17:58:02 +0100 Message-ID: <20260804165803.598030-8-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804165803.598030-1-ross.burton@arm.com> References: <20260804165803.598030-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242788 We need to pass the same flags to cbuild and cinstall, as otherwise it will build in do_compile and then rebuild with the right paths in do_install. Add the flags to CARGO_BUILD_FLAGS so that they get used in all calls and do_install no longer does any building. Example from buildstats: PKG TASK ABSDIFF RELDIFF WALLTIME1 -> WALLTIME2 gstreamer1.0-plugins-rs do_install -263.6s -99.0% 266.2s -> 2.7s Signed-off-by: Ross Burton --- meta/classes-recipe/cargo_c.bbclass | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/meta/classes-recipe/cargo_c.bbclass b/meta/classes-recipe/cargo_c.bbclass index e68ac93a610..cd486b20067 100644 --- a/meta/classes-recipe/cargo_c.bbclass +++ b/meta/classes-recipe/cargo_c.bbclass @@ -16,6 +16,13 @@ BASEDEPENDS:append = " cargo-c-native" B = "${WORKDIR}/build" +CARGO_BUILD_FLAGS += "\ + --destdir ${D} \ + --prefix ${prefix} \ + --libdir ${libdir} \ + --library-type cdylib \ + " + do_compile[progress] = "outof:\s+(\d+)/(\d+)" cargo_c_do_compile() { oe_cargo_fix_env @@ -27,11 +34,7 @@ cargo_c_do_compile() { cargo_c_do_install() { oe_cargo_fix_env export RUSTFLAGS="${RUSTFLAGS}" - cargo-cinstall cinstall ${CARGO_BUILD_FLAGS} \ - --destdir ${D} \ - --prefix ${prefix} \ - --libdir ${libdir} \ - --library-type cdylib + cargo-cinstall cinstall ${CARGO_BUILD_FLAGS} } EXPORT_FUNCTIONS do_compile do_install From patchwork Tue Aug 4 16:58:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 94486 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07489C55ABF for ; Tue, 4 Aug 2026 16:58:19 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.21215.1785862695556574604 for ; Tue, 04 Aug 2026 09:58:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=NhfAsAUn; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 21CE51476 for ; Tue, 4 Aug 2026 09:58:11 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C24533F66F for ; Tue, 4 Aug 2026 09:58:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785862695; bh=8bXbbaioeXBZs/w6m3RznA9M55fY66i988Oq/Hb/Bf8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NhfAsAUn+/Ut8W6VD2RzDsUgX3HyfhvOLtnJF2mD5pjsOaBnB6yDZnRJ7eTXDyXVj WF+lbfr1dWhRh4ZrPtKE+7dyL0Y2i3JRnDdKn1+Cew18uJPbJd+QQbabC1NR5oBBHJ jZYd6ZtK4YF8VXuUPBFwPrz/23CBT1nE6U8JI2Bc= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 9/9] classes/cargo: merge oe_cargo_build into cargo_do_compile Date: Tue, 4 Aug 2026 17:58:03 +0100 Message-ID: <20260804165803.598030-9-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260804165803.598030-1-ross.burton@arm.com> References: <20260804165803.598030-1-ross.burton@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 04 Aug 2026 16:58:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242789 A layer of indirection between cargo_do_compile() and actually calling cargo isn't needed, so merge oe_cargo_build into cargo_do_compile. Signed-off-by: Ross Burton --- meta/classes-recipe/cargo.bbclass | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index 628dbc98f18..586071988a9 100644 --- a/meta/classes-recipe/cargo.bbclass +++ b/meta/classes-recipe/cargo.bbclass @@ -17,7 +17,8 @@ CARGO = "cargo" # Enable build separation B = "${WORKDIR}/build" -oe_cargo_build () { +do_compile[progress] = "outof:\s+(\d+)/(\d+)" +cargo_do_compile () { export RUSTFLAGS="${RUSTFLAGS}" bbnote "Using rust targets from ${RUST_TARGET_PATH}" bbnote "cargo = $(which ${CARGO})" @@ -25,11 +26,6 @@ oe_cargo_build () { "${CARGO}" build ${CARGO_BUILD_FLAGS} ${PACKAGECONFIG_CONFARGS} "$@" } -do_compile[progress] = "outof:\s+(\d+)/(\d+)" -cargo_do_compile () { - oe_cargo_build -} - cargo_do_install () { local have_installed=false for tgt in "${B}/target/${CARGO_TARGET_SUBDIR}/"*; do