Use stable Rust on CI to test the x64 backend (#2766)
* Use stable Rust on CI to test the x64 backend This commit leverages the newly-released 1.51.0 compiler to test the new backend on Windows and Linux with a stable compiler instead of a nightly compiler. This isolates the nightly build to just the nightly documentation generation and fuzzing, both of which rely on nightly for the best results right now. * Use updated stable in book build job * Run rustfmt for new stable * Silence new warnings for wasi-nn * Allow some dead code in the x64 backend Looks like new rustc is better about emitting some dead-code warnings * Update rust in peepmatic job * Fix a test in the pooling allocator * Remove `package.metdata.docs.rs` temporarily Needs resolution of https://github.com/rust-lang/cargo/pull/9300 first * Fix a warning in a wasi-nn example
This commit is contained in:
19
.github/workflows/main.yml
vendored
19
.github/workflows/main.yml
vendored
@@ -48,6 +48,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
- run: rustup update stable && rustup default stable
|
||||||
- run: |
|
- run: |
|
||||||
set -e
|
set -e
|
||||||
curl -L https://github.com/rust-lang-nursery/mdBook/releases/download/v0.4.4/mdbook-v0.4.4-x86_64-unknown-linux-gnu.tar.gz | tar xzf -
|
curl -L https://github.com/rust-lang-nursery/mdBook/releases/download/v0.4.4/mdbook-v0.4.4-x86_64-unknown-linux-gnu.tar.gz | tar xzf -
|
||||||
@@ -73,11 +74,9 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
# Note that we use nightly Rust for the doc_cfg feature (enabled via `nightlydoc` above)
|
|
||||||
# This version is an older nightly for the new x64 backend (see below)
|
|
||||||
- uses: ./.github/actions/install-rust
|
- uses: ./.github/actions/install-rust
|
||||||
with:
|
with:
|
||||||
toolchain: nightly-2020-12-26
|
toolchain: nightly
|
||||||
- run: cargo doc --no-deps --all --exclude wasmtime-cli --exclude test-programs --exclude cranelift-codegen-meta
|
- run: cargo doc --no-deps --all --exclude wasmtime-cli --exclude test-programs --exclude cranelift-codegen-meta
|
||||||
- run: cargo doc --package cranelift-codegen-meta --document-private-items
|
- run: cargo doc --package cranelift-codegen-meta --document-private-items
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
@@ -178,6 +177,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
- run: rustup update stable && rustup default stable
|
||||||
- name: Test `peepmatic`
|
- name: Test `peepmatic`
|
||||||
run: |
|
run: |
|
||||||
cargo test \
|
cargo test \
|
||||||
@@ -321,10 +321,7 @@ jobs:
|
|||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
|
||||||
# Perform all tests (debug mode) for `wasmtime` with the experimental x64
|
# Perform all tests (debug mode) for `wasmtime` with the experimental x64
|
||||||
# backend. This runs on an older nightly of Rust (because of issues with
|
# backend.
|
||||||
# unifying Cargo features on stable) on Ubuntu such that it's new enough
|
|
||||||
# to build Wasmtime, but old enough where the -Z options being used
|
|
||||||
# haven't been stabilized yet.
|
|
||||||
test_x64:
|
test_x64:
|
||||||
name: Test x64 new backend
|
name: Test x64 new backend
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -334,7 +331,7 @@ jobs:
|
|||||||
submodules: true
|
submodules: true
|
||||||
- uses: ./.github/actions/install-rust
|
- uses: ./.github/actions/install-rust
|
||||||
with:
|
with:
|
||||||
toolchain: nightly-2020-12-26
|
toolchain: stable
|
||||||
- uses: ./.github/actions/define-llvm-env
|
- uses: ./.github/actions/define-llvm-env
|
||||||
|
|
||||||
# Install wasm32 targets in order to build various tests throughout the
|
# Install wasm32 targets in order to build various tests throughout the
|
||||||
@@ -345,7 +342,6 @@ jobs:
|
|||||||
# Run the x64 CI script.
|
# Run the x64 CI script.
|
||||||
- run: ./ci/run-experimental-x64-ci.sh
|
- run: ./ci/run-experimental-x64-ci.sh
|
||||||
env:
|
env:
|
||||||
CARGO_VERSION: "+nightly-2020-12-26"
|
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
|
||||||
# Perform tests on the new x64 backend on Windows as well.
|
# Perform tests on the new x64 backend on Windows as well.
|
||||||
@@ -357,8 +353,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: ./.github/actions/install-rust
|
- uses: ./.github/actions/install-rust
|
||||||
with:
|
|
||||||
toolchain: nightly-2020-11-29
|
|
||||||
- uses: ./.github/actions/define-llvm-env
|
- uses: ./.github/actions/define-llvm-env
|
||||||
|
|
||||||
- name: Install libclang
|
- name: Install libclang
|
||||||
@@ -378,7 +372,6 @@ jobs:
|
|||||||
# Run the x64 CI script.
|
# Run the x64 CI script.
|
||||||
- run: ./ci/run-experimental-x64-ci.sh
|
- run: ./ci/run-experimental-x64-ci.sh
|
||||||
env:
|
env:
|
||||||
CARGO_VERSION: "+nightly-2020-11-29"
|
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
|
||||||
# Build and test the wasi-nn module.
|
# Build and test the wasi-nn module.
|
||||||
@@ -390,8 +383,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: ./.github/actions/install-rust
|
- uses: ./.github/actions/install-rust
|
||||||
with:
|
|
||||||
toolchain: nightly
|
|
||||||
- run: rustup target add wasm32-wasi
|
- run: rustup target add wasm32-wasi
|
||||||
- uses: ./.github/actions/install-openvino
|
- uses: ./.github/actions/install-openvino
|
||||||
- run: ./ci/run-wasi-nn-example.sh
|
- run: ./ci/run-wasi-nn-example.sh
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ anyhow = "1.0.19"
|
|||||||
opt-level = 0
|
opt-level = 0
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
resolver = '2'
|
||||||
members = [
|
members = [
|
||||||
"cranelift",
|
"cranelift",
|
||||||
"crates/bench-api",
|
"crates/bench-api",
|
||||||
|
|||||||
@@ -1,24 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Use the Nightly variant of the compiler to properly unify the
|
cargo test \
|
||||||
# experimental_x64 feature across all crates. Once the feature has stabilized
|
|
||||||
# and become the default, we can remove this.
|
|
||||||
CARGO_VERSION=${CARGO_VERSION:-"+nightly"}
|
|
||||||
|
|
||||||
# Some WASI tests seem to have an issue on Windows with symlinks if we run them
|
|
||||||
# with this particular invocation. It's unclear why (nightly toolchain?) but
|
|
||||||
# we're moving to the new backend by default soon enough, and all tests seem to
|
|
||||||
# work with the main test setup, so let's just work around this by skipping
|
|
||||||
# the tests for now.
|
|
||||||
MINGW_EXTRA=""
|
|
||||||
if [ `uname -o` == "Msys" ]; then
|
|
||||||
MINGW_EXTRA="-- --skip wasi_cap_std_sync"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cargo $CARGO_VERSION \
|
|
||||||
--locked \
|
--locked \
|
||||||
-Zfeatures=all -Zpackage-features \
|
|
||||||
test \
|
|
||||||
--features test-programs/test_programs \
|
--features test-programs/test_programs \
|
||||||
--features experimental_x64 \
|
--features experimental_x64 \
|
||||||
--all \
|
--all \
|
||||||
@@ -32,5 +15,4 @@ cargo $CARGO_VERSION \
|
|||||||
--exclude peepmatic-runtime \
|
--exclude peepmatic-runtime \
|
||||||
--exclude peepmatic-test \
|
--exclude peepmatic-test \
|
||||||
--exclude peepmatic-souper \
|
--exclude peepmatic-souper \
|
||||||
--exclude lightbeam \
|
--exclude lightbeam
|
||||||
$MINGW_EXTRA
|
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ repository = "https://github.com/bytecodealliance/wasmtime"
|
|||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
# FIXME(rust-lang/cargo#9300): uncomment once that lands
|
||||||
rustdoc-args = [ "--document-private-items" ]
|
# [package.metadata.docs.rs]
|
||||||
|
# rustdoc-args = [ "--document-private-items" ]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cranelift-codegen-shared = { path = "../shared", version = "0.72.0" }
|
cranelift-codegen-shared = { path = "../shared", version = "0.72.0" }
|
||||||
|
|||||||
@@ -462,6 +462,7 @@ pub(crate) enum InstructionSet {
|
|||||||
|
|
||||||
/// Some SSE operations requiring 2 operands r/m and r.
|
/// Some SSE operations requiring 2 operands r/m and r.
|
||||||
#[derive(Clone, Copy, PartialEq)]
|
#[derive(Clone, Copy, PartialEq)]
|
||||||
|
#[allow(dead_code)] // some variants here aren't used just yet
|
||||||
pub enum SseOpcode {
|
pub enum SseOpcode {
|
||||||
Addps,
|
Addps,
|
||||||
Addpd,
|
Addpd,
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ enum ExtSpec {
|
|||||||
ZeroExtendTo32,
|
ZeroExtendTo32,
|
||||||
ZeroExtendTo64,
|
ZeroExtendTo64,
|
||||||
SignExtendTo32,
|
SignExtendTo32,
|
||||||
|
#[allow(dead_code)] // not used just yet but may be used in the future!
|
||||||
SignExtendTo64,
|
SignExtendTo64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ edition = "2018"
|
|||||||
license = "Apache-2.0 WITH LLVM-exception"
|
license = "Apache-2.0 WITH LLVM-exception"
|
||||||
description = "Finite-state transducer automata"
|
description = "Finite-state transducer automata"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
# FIXME(rust-lang/cargo#9300): uncomment once that lands
|
||||||
all-features = true
|
# [package.metadata.docs.rs]
|
||||||
|
# all-features = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.106", optional = true }
|
serde = { version = "1.0.106", optional = true }
|
||||||
|
|||||||
@@ -90,7 +90,10 @@ impl UnwindRegistry {
|
|||||||
let mut eh_frame = EhFrame(EndianVec::new(RunTimeEndian::default()));
|
let mut eh_frame = EhFrame(EndianVec::new(RunTimeEndian::default()));
|
||||||
table.write_eh_frame(&mut eh_frame).unwrap();
|
table.write_eh_frame(&mut eh_frame).unwrap();
|
||||||
|
|
||||||
if cfg!(any(all(target_os = "linux", target_env = "gnu"), target_os = "freebsd")) {
|
if cfg!(any(
|
||||||
|
all(target_os = "linux", target_env = "gnu"),
|
||||||
|
target_os = "freebsd"
|
||||||
|
)) {
|
||||||
// libgcc expects a terminating "empty" length, so write a 0 length at the end of the table.
|
// libgcc expects a terminating "empty" length, so write a 0 length at the end of the table.
|
||||||
eh_frame.0.write_u32(0).unwrap();
|
eh_frame.0.write_u32(0).unwrap();
|
||||||
}
|
}
|
||||||
@@ -101,7 +104,10 @@ impl UnwindRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn register_frames(&mut self) {
|
unsafe fn register_frames(&mut self) {
|
||||||
if cfg!(any(all(target_os = "linux", target_env = "gnu"), target_os = "freebsd")) {
|
if cfg!(any(
|
||||||
|
all(target_os = "linux", target_env = "gnu"),
|
||||||
|
target_os = "freebsd"
|
||||||
|
)) {
|
||||||
// On gnu (libgcc), `__register_frame` will walk the FDEs until an entry of length 0
|
// On gnu (libgcc), `__register_frame` will walk the FDEs until an entry of length 0
|
||||||
let ptr = self.frame_table.as_ptr();
|
let ptr = self.frame_table.as_ptr();
|
||||||
__register_frame(ptr);
|
__register_frame(ptr);
|
||||||
|
|||||||
@@ -1618,7 +1618,7 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(target_arch = "aarch64", ignore)] // https://github.com/bytecodealliance/wasmtime/pull/2518#issuecomment-747280133
|
#[cfg_attr(target_arch = "aarch64", ignore)] // https://github.com/bytecodealliance/wasmtime/pull/2518#issuecomment-747280133
|
||||||
#[cfg(all(unix, target_pointer_width = "64"))]
|
#[cfg(all(unix, target_pointer_width = "64", feature = "async"))]
|
||||||
#[test]
|
#[test]
|
||||||
fn test_stack_zeroed() -> Result<()> {
|
fn test_stack_zeroed() -> Result<()> {
|
||||||
let allocator = PoolingInstanceAllocator::new(
|
let allocator = PoolingInstanceAllocator::new(
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ pub fn main() {
|
|||||||
0,
|
0,
|
||||||
&mut output_buffer[..] as *mut [f32] as *mut u8,
|
&mut output_buffer[..] as *mut [f32] as *mut u8,
|
||||||
(output_buffer.len() * 4).try_into().unwrap(),
|
(output_buffer.len() * 4).try_into().unwrap(),
|
||||||
);
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
println!(
|
println!(
|
||||||
"Found results, sorted top 5: {:?}",
|
"Found results, sorted top 5: {:?}",
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ pub unsafe fn compute(context: GraphExecutionContext) -> Result<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(improper_ctypes)]
|
||||||
pub mod wasi_ephemeral_nn {
|
pub mod wasi_ephemeral_nn {
|
||||||
use super::*;
|
use super::*;
|
||||||
#[link(wasm_import_module = "wasi_ephemeral_nn")]
|
#[link(wasm_import_module = "wasi_ephemeral_nn")]
|
||||||
|
|||||||
@@ -9,8 +9,9 @@ repository = "https://github.com/bytecodealliance/wasmtime"
|
|||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
# FIXME(rust-lang/cargo#9300): uncomment once that lands
|
||||||
rustdoc-args = ["--cfg", "nightlydoc"]
|
# [package.metadata.docs.rs]
|
||||||
|
# rustdoc-args = ["--cfg", "nightlydoc"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmtime-runtime = { path = "../runtime", version = "0.25.0" }
|
wasmtime-runtime = { path = "../runtime", version = "0.25.0" }
|
||||||
|
|||||||
Reference in New Issue
Block a user