Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
fix: check if platform-tool/rust/bin/rustc exists (#32350)
Browse files Browse the repository at this point in the history
fix: check platform-tool/rust/bin/rustc exist before use
(cherry picked from commit c657455)
  • Loading branch information
yihau authored and mergify[bot] committed Jun 30, 2023
1 parent 02d5647 commit f1da13c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sdk/cargo-build-sbf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ fn get_base_rust_version(platform_tools_version: &str) -> String {
let target_path =
make_platform_tools_path_for_version("platform-tools", platform_tools_version);
let rustc = target_path.join("rust").join("bin").join("rustc");
if !rustc.exists() {
return String::from("");
}
let args = vec!["--version"];
let output = spawn(&rustc, args, false);
let rustc_re = Regex::new(r"(rustc [0-9]+\.[0-9]+\.[0-9]+).*").unwrap();
Expand Down

0 comments on commit f1da13c

Please sign in to comment.