Openembedded Core Discussions
 help / color / mirror / Atom feed
* [OE-Core][PATCH 1/4] rust: Move RUST_DIST_SERVER to rust-config.inc
@ 2023-12-30 15:49 Alex Kiernan
  2023-12-30 15:49 ` [OE-Core][PATCH 2/4] cargo: Create CARGO_HOME and CARGO_VENDORING_DIRECTORY Alex Kiernan
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Alex Kiernan @ 2023-12-30 15:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alex Kiernan

Overriding the location of RUST_DIST_SERVER is useful for testing rust
pre-releases, but we need it in rust-source and rust-snapshot; move
RUST_DIST_SERVER to rust-config.inc so we can set it to
`dev-static.rust-lang.org` and use it from both locations.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

 meta/recipes-devtools/rust/rust-config.inc   |  1 +
 meta/recipes-devtools/rust/rust-snapshot.inc |  2 --
 meta/recipes-devtools/rust/rust-source.inc   |  4 +++-
 meta/recipes-devtools/rust/rust_1.74.1.bb    | 11 ++++++++---
 4 files changed, 12 insertions(+), 6 deletions(-)
 create mode 100644 meta/recipes-devtools/rust/rust-config.inc

diff --git a/meta/recipes-devtools/rust/rust-config.inc b/meta/recipes-devtools/rust/rust-config.inc
new file mode 100644
index 000000000000..9fd360616bc4
--- /dev/null
+++ b/meta/recipes-devtools/rust/rust-config.inc
@@ -0,0 +1 @@
+RUST_DIST_SERVER ??= "https://static.rust-lang.org"
diff --git a/meta/recipes-devtools/rust/rust-snapshot.inc b/meta/recipes-devtools/rust/rust-snapshot.inc
index ffc1aed2957c..b67e42d27063 100644
--- a/meta/recipes-devtools/rust/rust-snapshot.inc
+++ b/meta/recipes-devtools/rust/rust-snapshot.inc
@@ -52,8 +52,6 @@ SRC_URI += " \
     ${RUST_DIST_SERVER}/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \
 "
 
-RUST_DIST_SERVER = "https://static.rust-lang.org"
-
 RUST_STD_SNAPSHOT = "rust-std-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
 RUSTC_SNAPSHOT = "rustc-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
 CARGO_SNAPSHOT = "cargo-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index 83a0dbc15fae..fdac009c6d20 100644
--- a/meta/recipes-devtools/rust/rust-source.inc
+++ b/meta/recipes-devtools/rust/rust-source.inc
@@ -1,6 +1,8 @@
+require rust-config.inc
+
 RUST_VERSION ?= "${@d.getVar('PV').split('-')[0]}"
 
-SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;name=rust \
+SRC_URI += "${RUST_DIST_SERVER}/dist/rustc-${RUST_VERSION}-src.tar.xz;name=rust \
             file://hardcodepaths.patch;patchdir=${RUSTSRC} \
             file://0001-Don-t-use-LFS64-symbols-on-musl.patch;patchdir=${RUSTSRC} \
             file://zlib-off64_t.patch;patchdir=${RUSTSRC} \
diff --git a/meta/recipes-devtools/rust/rust_1.74.1.bb b/meta/recipes-devtools/rust/rust_1.74.1.bb
index 30543ada7dbc..dd931a42717c 100644
--- a/meta/recipes-devtools/rust/rust_1.74.1.bb
+++ b/meta/recipes-devtools/rust/rust_1.74.1.bb
@@ -316,6 +316,10 @@ python do_update_snapshot() {
             arch = m.group('arch')
             src_uri[arch].append(f"SRC_URI[{component}-snapshot-{arch}.sha256sum] = \"{v}\"")
 
+    config = """\
+RUST_DIST_SERVER ??= "%s"
+""" % config_dist_server
+
     snapshot = """\
 ## This is information on the rust-snapshot (binary) used to build our current release.
 ## snapshot info is taken from rust/src/stage0.json
@@ -337,12 +341,13 @@ SRC_URI += " \\
     ${RUST_DIST_SERVER}/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\
 "
 
-RUST_DIST_SERVER = "%s"
-
 RUST_STD_SNAPSHOT = "rust-std-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
 RUSTC_SNAPSHOT = "rustc-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
 CARGO_SNAPSHOT = "cargo-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
-""" % config_dist_server
+"""
+
+    with open(os.path.join(d.getVar("THISDIR"), "rust-config.inc"), "w") as f:
+        f.write(config)
 
     with open(os.path.join(d.getVar("THISDIR"), "rust-snapshot.inc"), "w") as f:
         f.write(snapshot)
-- 
2.39.0



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

end of thread, other threads:[~2024-02-11  2:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-30 15:49 [OE-Core][PATCH 1/4] rust: Move RUST_DIST_SERVER to rust-config.inc Alex Kiernan
2023-12-30 15:49 ` [OE-Core][PATCH 2/4] cargo: Create CARGO_HOME and CARGO_VENDORING_DIRECTORY Alex Kiernan
2023-12-30 15:49 ` [OE-Core][PATCH 3/4] cargo: Move vendor directory to registry/src Alex Kiernan
2023-12-30 23:46   ` Richard Purdie
2023-12-30 15:49 ` [OE-Core][PATCH 4/4] rust: Upgrade 1.74.1 -> 1.75.0 Alex Kiernan
2023-12-31 14:23   ` Richard Purdie
2023-12-31 14:34     ` Alex Kiernan
     [not found]     ` <17A5F1406166801F.18542@lists.openembedded.org>
2024-01-02  9:24       ` Alex Kiernan
2024-01-11 14:54         ` [PATCH " Sundeep KOKKONDA
2024-01-14  8:59           ` [OE-core] " Alex Kiernan
     [not found]           ` <17AA2B18BB6DAD55.13033@lists.openembedded.org>
2024-02-10 12:03             ` Alex Kiernan
2024-02-11  2:30               ` Sundeep KOKKONDA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox