Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AArch64 tests to CI #1526

Merged
merged 2 commits into from
Apr 22, 2020
Merged

Conversation

alexcrichton
Copy link
Member

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.

@alexcrichton alexcrichton added the cranelift Issues related to the Cranelift code generator label Apr 16, 2020
@alexcrichton
Copy link
Member Author

I should note that I tried to write #[should_panic] for all failing tests on aarch64 so if something is fixed we can be sure to enable the regression test. Unfortunately though this directive doesn't work for test functions returning a result, so many wasmtime tests are simply #[ignore]

let requested_arch = context.isa.unwrap().triple().architecture;
if requested_arch != Architecture::host() {
return Ok(());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we might want to print something saying we skipped a test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the filetest infrastructure print out anything else currently? Curious if I can see an example of what format to print and such.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over in cranelift/src/filetests/runner.rs it is printing FAIL {path}: {error} so maybe we could print IGNORE {path}: host ISA did not match target ISA? That way at least there is some indication that things didn't run perfectly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm so it looks like the path isn't already threaded through, would you be ok to follow-up with this at a later date?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, tag me in an issue and I will try to look at this later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing! Extracted out #1558

@github-actions
Copy link

Subscribe to Label Action

cc @bnjbvr

This issue or pull request has been labeled: "cranelift"

Thus the following users have been cc'd because of the following labels:

  • bnjbvr: cranelift

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@github-actions github-actions bot added cranelift:module fuzzing Issues related to our fuzzing infrastructure wasi Issues pertaining to WASI wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:c-api Issues pertaining to the C API. labels Apr 16, 2020
@github-actions
Copy link

Subscribe to Label Action

cc @fitzgen, @kubkon, @peterhuene

This issue or pull request has been labeled: "cranelift:module", "fuzzing", "wasi", "wasmtime:api", "wasmtime:c-api"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: fuzzing
  • kubkon: wasi
  • peterhuene: wasmtime:api, wasmtime:c-api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

src=$2
exe=$3
src=$1
exe=$2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an internal script we use to build tarballs, it's not really intended to be super-well-documented or make a ton of sense...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for future sanity -- maybe standardize on $platform, and add a # Usage: build-tarballs.sh PLATFORM [.exe] (PLATFORM is e.g. x86_64-linux, aarch64-linux) comment (no need for an actual arg check)?

build.rs Outdated Show resolved Hide resolved
@alexcrichton
Copy link
Member Author

Updated with a comment about the new semantics of test_run

@alexcrichton
Copy link
Member Author

Ok should be green now to account for recent merges.

@alexcrichton
Copy link
Member Author

Ok I've pushed up a commit which accounts for #1569 and recently fixed tests too.

cfallin added a commit to cfallin/wasmtime that referenced this pull request Apr 22, 2020
This change adds SourceLoc information per instruction in a `VCode<Inst>`
container, and keeps this information up-to-date across register allocation
and branch reordering. The information is initially collected during
instruction lowering, eventually collected on the MachSection, and finally
provided to the environment that wraps the codegen crate for wasmtime.

This PR is based on top of bytecodealliance#1570 and bytecodealliance#1571 (part of a series fixing tests).

This PR depends on wasmtime/regalloc.rs#50, a change to the register
allocator to provide instruction-granularity info on the rewritten
instruction stream (rather than block-granularity).

With the prior PRs applied as well, quite a few more unit tests pass;
the exclusion list in bytecodealliance#1526 should be updated if this PR lands first.
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 (bytecodealliance#1521), and
all wasmtime tests involving compilation are also disabled due to
panicking attempting to generate generate instruction offset information
for trap symbolication (bytecodealliance#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.
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a few comment-addition / clarity requests both otherwise I'm happy with this.

src=$2
exe=$3
src=$1
exe=$2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for future sanity -- maybe standardize on $platform, and add a # Usage: build-tarballs.sh PLATFORM [.exe] (PLATFORM is e.g. x86_64-linux, aarch64-linux) comment (no need for an actual arg check)?

_ => {}
},
_ => panic!("unrecognized strategy"),
}

false
}

fn should_panic(testsuite: &str, testname: &str) -> bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little clarity nit, but maybe add a comment here to distinguish from the "test that this correctly panics" unit-test idiom. Something like // Determine whether to add a should_panic attribute. These tests currently panic because of unfinished backend implementation work; we will remove them from this list as we finish the implementation.

@alexcrichton alexcrichton merged commit d1aa86f into bytecodealliance:master Apr 22, 2020
@alexcrichton alexcrichton deleted the arm64-ci-pr branch April 22, 2020 17:57
cfallin added a commit to cfallin/wasmtime that referenced this pull request Apr 23, 2020
This change adds SourceLoc information per instruction in a `VCode<Inst>`
container, and keeps this information up-to-date across register allocation
and branch reordering. The information is initially collected during
instruction lowering, eventually collected on the MachSection, and finally
provided to the environment that wraps the codegen crate for wasmtime.

This PR is based on top of bytecodealliance#1570 and bytecodealliance#1571 (part of a series fixing tests).

This PR depends on wasmtime/regalloc.rs#50, a change to the register
allocator to provide instruction-granularity info on the rewritten
instruction stream (rather than block-granularity).

With the prior PRs applied as well, quite a few more unit tests pass;
the exclusion list in bytecodealliance#1526 should be updated if this PR lands first.
cfallin added a commit to cfallin/wasmtime that referenced this pull request Apr 24, 2020
This change adds SourceLoc information per instruction in a `VCode<Inst>`
container, and keeps this information up-to-date across register allocation
and branch reordering. The information is initially collected during
instruction lowering, eventually collected on the MachSection, and finally
provided to the environment that wraps the codegen crate for wasmtime.

This PR is based on top of bytecodealliance#1570 and bytecodealliance#1571 (part of a series fixing tests).

This PR depends on wasmtime/regalloc.rs#50, a change to the register
allocator to provide instruction-granularity info on the rewritten
instruction stream (rather than block-granularity).

With the prior PRs applied as well, quite a few more unit tests pass;
the exclusion list in bytecodealliance#1526 should be updated if this PR lands first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:module cranelift Issues related to the Cranelift code generator fuzzing Issues related to our fuzzing infrastructure wasi Issues pertaining to WASI wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:c-api Issues pertaining to the C API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants