new file mode 100644
@@ -0,0 +1 @@
+RUST_DIST_SERVER ??= "https://static.rust-lang.org"
@@ -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"
@@ -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} \
@@ -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)
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