All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@aj.id.au>
To: openembedded-core@lists.openembedded.org
Subject: [RFC PATCH 8/8] rust: Introduce RUST_BUILD_ARCH
Date: Tue, 22 Feb 2022 14:22:34 +1030	[thread overview]
Message-ID: <20220222035234.463162-9-andrew@aj.id.au> (raw)
In-Reply-To: <20220222035234.463162-1-andrew@aj.id.au>

On modern Power systems `uname -m` yields 'ppc64le' while the toolchain
knows the architecture as 'powerpc64le'. Provide a mapping from one to
the other to download the correct snapshot artifacts.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 meta/classes/rust-common.bbclass             |  3 +++
 meta/recipes-devtools/rust/rust-snapshot.inc | 12 ++++++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass
index 58ece01097c8..2ee7e178e536 100644
--- a/meta/classes/rust-common.bbclass
+++ b/meta/classes/rust-common.bbclass
@@ -107,6 +107,9 @@ def rust_base_triple(d, thing):
         libc = bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hf', '', d)
     return arch + vendor + '-' + os + libc
 
+# In some cases uname and the toolchain differ on their idea of the arch name
+RUST_BUILD_ARCH = "${@arch_to_rust_arch(d.getVar('BUILD_ARCH'))}"
+
 # Naming explanation
 # Yocto
 # - BUILD_SYS - Yocto triple of the build environment
diff --git a/meta/recipes-devtools/rust/rust-snapshot.inc b/meta/recipes-devtools/rust/rust-snapshot.inc
index d6ffe92d07ee..d0c05aec7866 100644
--- a/meta/recipes-devtools/rust/rust-snapshot.inc
+++ b/meta/recipes-devtools/rust/rust-snapshot.inc
@@ -19,11 +19,11 @@ SRC_URI[rustc-snapshot-powerpc64le.sha256sum] = "f43cb99109c3438c77c7079cdce4673
 SRC_URI[cargo-snapshot-powerpc64le.sha256sum] = "599cf1b5a8cdbf76d591621bc9222aefa60e2f5fd378ae71c4dcf4514c47122e"
 
 SRC_URI += " \
-    https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-    https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-    https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+    https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \
+    https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \
+    https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \
 "
 
-RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
+RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
+CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
-- 
2.32.0



      parent reply	other threads:[~2022-02-22  3:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22  3:52 [RFC PATCH 0/8] rust: Fix powerpc64le support Andrew Jeffery
2022-02-22  3:52 ` [RFC PATCH 1/8] rust: Migrate arch_to_rust_target_arch() to rust-common class Andrew Jeffery
2022-02-22 10:05   ` [OE-core] " Richard Purdie
2022-02-23  0:41     ` Andrew Jeffery
2022-02-22  3:52 ` [RFC PATCH 2/8] rust: Rename arch_to_rust_target_arch() for generality Andrew Jeffery
2022-02-22  3:52 ` [RFC PATCH 3/8] rust: Handle Power arch variants in arch_to_rust_arch() Andrew Jeffery
2022-02-22  3:52 ` [RFC PATCH 4/8] rust: Consistently use RUST_{BUILD,HOST,TARGET}_{ARCH,SYS} Andrew Jeffery
2022-02-22  3:52 ` [RFC PATCH 5/8] rust: libstd-rs: Install deps under {RUST_,}TARGET_SYS mismatch Andrew Jeffery
2022-02-22  3:52 ` [RFC PATCH 6/8] rust: Mitigate duplicate sections on matching architectures Andrew Jeffery
2022-02-22  9:57   ` [OE-core] " Alexander Kanavin
2022-02-23  0:38     ` Andrew Jeffery
2022-02-28  0:13       ` Andrew Jeffery
2022-02-28  8:21         ` Alexander Kanavin
2022-02-28 13:57           ` Andrew Jeffery
2022-02-22  3:52 ` [RFC PATCH 7/8] rust: Add snapshot checksums for powerpc64le Andrew Jeffery
2022-02-22  9:59   ` [OE-core] " Alexander Kanavin
2022-02-22 12:28     ` Richard Purdie
2022-02-22 14:23       ` Alexander Kanavin
2022-02-22 18:34         ` Khem Raj
2022-02-22 23:41           ` Andrew Jeffery
2022-02-23  0:17         ` Andrew Jeffery
2022-02-22 23:49       ` Andrew Jeffery
2022-02-23  0:03         ` Richard Purdie
2022-02-23  0:27           ` Andrew Jeffery
2022-02-23  0:43             ` Richard Purdie
2022-02-22  3:52 ` Andrew Jeffery [this message]

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=20220222035234.463162-9-andrew@aj.id.au \
    --to=andrew@aj.id.au \
    --cc=openembedded-core@lists.openembedded.org \
    /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.