diff options
| -rw-r--r-- | meta/recipes-devtools/rust/files/cargo-path.patch | 37 |
1 files changed, 37 insertions, 0 deletions
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..84bd580aa7 --- /dev/null +++ b/meta/recipes-devtools/rust/files/cargo-path.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | Fix the cargo binary path error and ensure that it is fetched | ||
| 2 | during rustc bootstrap in rust oe-selftest. | ||
| 3 | |||
| 4 | ====================================================================== | ||
| 5 | ERROR: test_cargoflags (bootstrap_test.BuildBootstrap) | ||
| 6 | ---------------------------------------------------------------------- | ||
| 7 | Traceback (most recent call last): | ||
| 8 | 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 | ||
| 9 | args, _ = self.build_args(env={"CARGOFLAGS": "--timings"}) | ||
| 10 | 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 | ||
| 11 | return build.build_bootstrap_cmd(env), env | ||
| 12 | 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 | ||
| 13 | raise Exception("no cargo executable found at `{}`".format( | ||
| 14 | 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` | ||
| 15 | |||
| 16 | Upstream-Status: Submitted [https://github.com/rust-lang/rust/pull/120125] | ||
| 17 | |||
| 18 | Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> | ||
| 19 | --- | ||
| 20 | diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py | ||
| 21 | --- a/src/bootstrap/bootstrap.py | ||
| 22 | +++ b/src/bootstrap/bootstrap.py | ||
| 23 | @@ -954,9 +954,11 @@ | ||
| 24 | if deny_warnings: | ||
| 25 | env["RUSTFLAGS"] += " -Dwarnings" | ||
| 26 | |||
| 27 | - env["PATH"] = os.path.join(self.bin_root(), "bin") + \ | ||
| 28 | - os.pathsep + env["PATH"] | ||
| 29 | - if not os.path.isfile(self.cargo()): | ||
| 30 | + cargo_bin_path = os.path.join(self.bin_root(), "bin", "cargo") | ||
| 31 | + if not os.path.isfile(cargo_bin_path): | ||
| 32 | + cargo_bin_path = os.getenv("RUST_TARGET_PATH") + "rust-snapshot/bin/cargo" | ||
| 33 | + env["PATH"] = os.path.dirname(cargo_bin_path) + os.pathsep + env["PATH"] | ||
| 34 | + else: | ||
| 35 | raise Exception("no cargo executable found at `{}`".format( | ||
| 36 | self.cargo())) | ||
| 37 | args = [self.cargo(), "build", "--manifest-path", | ||
