Patrick Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame] | 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 @@ |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 24 | if "RUSTFLAGS_BOOTSTRAP" in env: |
| 25 | env["RUSTFLAGS"] += " " + env["RUSTFLAGS_BOOTSTRAP"] |
Patrick Williams | f52e3dd | 2024-01-26 13:04:43 -0600 | [diff] [blame] | 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", |