Add AArch64 tests to CI (#1526)
* Add AArch64 tests to CI This commit enhances our CI with an AArch64 builder. Currently we have no physical hardware to run on so for now we run all tests in an emulator. The AArch64 build is cross-compiled from x86_64 from Linux. Tests all happen in release mode with a recent version of QEMU (recent version because it's so much faster, and in release mode because debug mode tests take quite a long time in an emulator). The goal here was not to get all tests passing on CI, but rather to get AArch64 running on CI and get it green at the same time. To achieve that goal many tests are now ignored on aarch64 platforms. Many tests fail due to unimplemented functionality in the aarch64 backend (#1521), and all wasmtime tests involving compilation are also disabled due to panicking attempting to generate generate instruction offset information for trap symbolication (#1523). Despite this, though, all Cranelift tests and other wasmtime tests should be runnin on AArch64 through QEMU with this PR. Additionally we'll have an AArch64 binary release of Wasmtime for Linux, although it won't be too useful just yet since it will panic on almost all wasm modules. * Review comments
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
|
||||
use crate::function_runner::FunctionRunner;
|
||||
use crate::subtest::{Context, SubTest, SubtestResult};
|
||||
use cranelift_codegen;
|
||||
use cranelift_codegen::ir;
|
||||
use cranelift_reader::parse_run_command;
|
||||
use cranelift_reader::TestCommand;
|
||||
use log::trace;
|
||||
use std::borrow::Cow;
|
||||
use target_lexicon::Architecture;
|
||||
|
||||
struct TestRun;
|
||||
|
||||
@@ -32,7 +32,7 @@ impl SubTest for TestRun {
|
||||
}
|
||||
|
||||
fn needs_isa(&self) -> bool {
|
||||
false
|
||||
true
|
||||
}
|
||||
|
||||
fn run(&self, func: Cow<ir::Function>, context: &Context) -> SubtestResult<()> {
|
||||
@@ -42,8 +42,22 @@ impl SubTest for TestRun {
|
||||
let command = parse_run_command(trimmed_comment, &func.signature)
|
||||
.map_err(|e| format!("{}", e))?;
|
||||
trace!("Parsed run command: {}", command);
|
||||
// TODO in following changes we will use the parsed command to alter FunctionRunner's behavior.
|
||||
|
||||
// If this test requests to run on a completely different
|
||||
// architecture than the host platform then we skip it entirely,
|
||||
// since we won't be able to natively execute machine code.
|
||||
let requested_arch = context.isa.unwrap().triple().architecture;
|
||||
if requested_arch != Architecture::host() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// TODO in following changes we will use the parsed command to alter FunctionRunner's behavior.
|
||||
//
|
||||
// Note that here we're also explicitly ignoring `context.isa`,
|
||||
// regardless of what's requested. We want to use the native
|
||||
// host ISA no matter what here, so the ISA listed in the file
|
||||
// is only used as a filter to not run into situations like
|
||||
// running x86_64 code on aarch64 platforms.
|
||||
let runner =
|
||||
FunctionRunner::with_host_isa(func.clone().into_owned(), context.flags.clone());
|
||||
runner.run()?
|
||||
|
||||
Reference in New Issue
Block a user