Skip to content

Commit 6be295e

Browse files
Merge pull request #860 from adamgemmell/bugfix/support-other-archs
Allow running on aarch64
2 parents afc6917 + 8c9af1c commit 6be295e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

collector/src/main.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ fn main_result() -> anyhow::Result<i32> {
558558
let default_db = "results.db";
559559
let default_out_dir = std::ffi::OsStr::new("results");
560560

561+
// XXX: This doesn't necessarily work for all archs
562+
let target_triple = format!("{}-unknown-linux-gnu", std::env::consts::ARCH);
563+
561564
let ret = match matches.subcommand() {
562565
("bench_local", Some(sub_m)) => {
563566
// Mandatory arguments
@@ -590,7 +593,7 @@ fn main_result() -> anyhow::Result<i32> {
590593
rustc: &rustc,
591594
rustdoc: rustdoc.as_deref(),
592595
cargo: &cargo,
593-
triple: "x86_64-unknown-linux-gnu", // XXX: technically not necessarily true
596+
triple: &target_triple,
594597
is_nightly: true,
595598
},
596599
&benchmarks,
@@ -626,7 +629,7 @@ fn main_result() -> anyhow::Result<i32> {
626629

627630
let pool = database::Pool::open(db);
628631

629-
let sysroot = Sysroot::install(commit.sha.to_string(), "x86_64-unknown-linux-gnu")
632+
let sysroot = Sysroot::install(commit.sha.to_string(), &target_triple)
630633
.with_context(|| format!("failed to install sysroot for {:?}", commit))?;
631634

632635
let benchmarks = get_benchmarks(
@@ -716,7 +719,7 @@ fn main_result() -> anyhow::Result<i32> {
716719
rustdoc: Some(Path::new(rustdoc.trim())),
717720
cargo: Path::new(cargo.trim()),
718721
is_nightly: false,
719-
triple: "x86_64-unknown-linux-gnu",
722+
triple: &target_triple,
720723
},
721724
&benchmarks,
722725
Some(3),
@@ -747,7 +750,7 @@ fn main_result() -> anyhow::Result<i32> {
747750
rustc: &rustc,
748751
rustdoc: rustdoc.as_deref(),
749752
cargo: &cargo,
750-
triple: "x86_64-unknown-linux-gnu", // XXX: technically not necessarily true
753+
triple: &target_triple,
751754
is_nightly: true,
752755
};
753756

@@ -787,7 +790,7 @@ fn main_result() -> anyhow::Result<i32> {
787790
let last_sha = String::from_utf8(last_sha.stdout).expect("utf8");
788791
let last_sha = last_sha.split_whitespace().next().expect(&last_sha);
789792
let commit = get_commit_or_fake_it(&last_sha).expect("success");
790-
let mut sysroot = Sysroot::install(commit.sha.to_string(), "x86_64-unknown-linux-gnu")?;
793+
let mut sysroot = Sysroot::install(commit.sha.to_string(), &target_triple)?;
791794
sysroot.preserve(); // don't delete it
792795

793796
// Print the directory containing the toolchain.

collector/src/rustc-fake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn main() {
5555
.arg("--log-fd")
5656
.arg("1")
5757
.arg("setarch")
58-
.arg("x86_64")
58+
.arg(std::env::consts::ARCH)
5959
.arg("-R")
6060
.arg(&tool)
6161
.args(&args);

0 commit comments

Comments
 (0)