Skip to content

Commit

Permalink
Merge #932
Browse files Browse the repository at this point in the history
932: Fix panicking when target triplets has less than three elements r=taiki-e a=Cryptex-github

Currently the build script panic when the target triplets have less than three elements, for example `wasm32-wasi`, this PR fixes that issue.

Fixes #931

Co-authored-by: Cryptex <64497526+Cryptex-github@users.noreply.github.com>
  • Loading branch information
bors[bot] and Cryptex-github committed Nov 22, 2022
2 parents accf8fa + 2131647 commit 9b56854
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build-common.rs
Expand Up @@ -5,8 +5,8 @@
// so that mapping to rust standard targets happens correctly.
fn convert_custom_linux_target(target: String) -> String {
let mut parts: Vec<&str> = target.split('-').collect();
let system = parts[2];
if system == "linux" {
let system = parts.get(2);
if system == Some(&"linux") {
parts[1] = "unknown";
};
parts.join("-")
Expand Down

0 comments on commit 9b56854

Please sign in to comment.