From: Yash Shinde <[email protected]>
Fixes: Exception: no cargo executable found at
`${B}/rustc-1.74.1-src/build/x86_64-unknown-linux-gnu/stage0/bin/cargo`
Fix the cargo binary path error on oe-selftest and path set to
rust-snapshot dir.
Patch sent to upstream- https://github.com/rust-lang/rust/pull/120125
Signed-off-by: Yash Shinde <[email protected]>
---
.../rust/files/cargo-path.patch | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 meta/recipes-devtools/rust/files/cargo-path.patch
diff --git a/meta/recipes-devtools/rust/files/cargo-path.patch
b/meta/recipes-devtools/rust/files/cargo-path.patch
new file mode 100644
index 0000000000..547df353d2
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/cargo-path.patch
@@ -0,0 +1,37 @@
+Fix the cargo binary path error and ensure that it is fetched
+during rustc bootstrap in rust oe-selftest.
+
+======================================================================
+ERROR: test_cargoflags (bootstrap_test.BuildBootstrap)
+----------------------------------------------------------------------
+Traceback (most recent call last):
+ File
"/home/build-st/tmp/work/cortexa57-poky-linux/rust/1.74.1/rustc-1.74.1-src/src/bootstrap/bootstrap_test.py",
line 157, in test_cargoflags
+ args, _ = self.build_args(env={"CARGOFLAGS": "--timings"})
+ File
"/home/build-st/tmp/work/cortexa57-poky-linux/rust/1.74.1/rustc-1.74.1-src/src/bootstrap/bootstrap_test.py",
line 154, in build_args
+ return build.build_bootstrap_cmd(env), env
+ File
"/home/build-st/tmp/work/cortexa57-poky-linux/rust/1.74.1/rustc-1.74.1-src/src/bootstrap/bootstrap.py",
line 960, in build_bootstrap_cmd
+ raise Exception("no cargo executable found at `{}`".format(
+Exception: no cargo executable found at
`/home/build-st/tmp/work/cortexa57-poky-linux/rust/1.74.1/rustc-1.74.1-src/build/x86_64-unknown-linux-gnu/stage0/bin/cargo`
+
+Upstream-Status: Submitted [https://github.com/rust-lang/rust/pull/120125]
+
+Signed-off-by: Yash Shinde <[email protected]>
+---
+diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
+--- a/src/bootstrap/bootstrap.py
++++ b/src/bootstrap/bootstrap.py
+@@ -954,9 +954,11 @@
+ if deny_warnings:
+ env["RUSTFLAGS"] += " -Dwarnings"
+
+- env["PATH"] = os.path.join(self.bin_root(), "bin") + \
+- os.pathsep + env["PATH"]
+- if not os.path.isfile(self.cargo()):
++ cargo_bin_path = os.path.join(self.bin_root(), "bin", "cargo")
++ if not os.path.isfile(cargo_bin_path):
++ cargo_bin_path = os.getenv("RUST_TARGET_PATH") +
"rust-snapshot/bin/cargo"
++ env["PATH"] = os.path.dirname(cargo_bin_path) + os.pathsep +
env["PATH"]
++ else:
+ raise Exception("no cargo executable found at `{}`".format(
+ self.cargo()))
+ args = [self.cargo(), "build", "--manifest-path",
--
2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#194206):
https://lists.openembedded.org/g/openembedded-core/message/194206
Mute This Topic: https://lists.openembedded.org/mt/103905740/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-