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

Merge with upstream #272

Merged
merged 26 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a415485
pulley: Refactor and reuse `imm` for floats (#9872)
alexcrichton Dec 20, 2024
d621b45
Bench API: Enable Pulley and allow recompiling with the same bench en…
fitzgen Dec 20, 2024
f6f447b
pulley: Add macro `CallN` instructions (#9874)
alexcrichton Dec 20, 2024
4da801c
Test x86_64-apple-darwin on newer CI machines (#9880)
alexcrichton Dec 20, 2024
d0a5599
Remove async-trait in bindgen (#9867)
ifsheldon Dec 20, 2024
7c4f0c7
Remove float canonicalization from components (#9879)
alexcrichton Dec 20, 2024
5442662
Fix build on 32-bit Windows; consolidate CI platform checks (#9883)
alexcrichton Dec 20, 2024
058d751
make canonicalize-nan.wast test work (#9878)
Lordworms Dec 20, 2024
afd8bb3
Add async example to bindgen_examples (#9822)
ifsheldon Dec 20, 2024
0da0443
Don't forcibly enable `gc` feature with cli-flags crate (#9887)
alexcrichton Dec 20, 2024
8e40e59
chore: fix 404 status URL (#9894)
linchizhen Dec 23, 2024
f64a9d5
Update README.md (#9890)
rajtechguru Dec 23, 2024
41ff8e7
Add `WASMTIME_LOG_NO_CONTEXT` (#9902)
SingleAccretion Dec 26, 2024
6e95518
Stop formatting ISLE generated code (#9901)
SingleAccretion Dec 26, 2024
bc8b3a5
init (#9893)
Lordworms Dec 27, 2024
069598f
typo-Update instructions.rs (#9895)
romashka-btc Dec 27, 2024
0b2c9d7
[DWARF] Transform instance methods into static methods with a `__this…
SingleAccretion Dec 27, 2024
47a60e8
fix typo (#9906)
JackDrogon Dec 27, 2024
af5a789
ISLE: improve syntax BNF (#9903)
eagr Dec 27, 2024
01a43ed
pulley: Implement 16x8 arithmetics (#9904)
eagr Dec 28, 2024
54b7250
feat: Implement simd_i32x4_arith2 for pulley (#9907)
Xuanwo Dec 29, 2024
2d1c0ab
pulley: Implement vector sqmul_round_sat (#9911)
eagr Dec 29, 2024
90e6651
pulley: fill out more int vector ops (#9908)
eagr Dec 30, 2024
6a95189
c-api: Enable debugger DWARF export for guest code (#9915)
puremourning Dec 30, 2024
90a21e5
Merge with upstream
dhil Dec 30, 2024
190ec98
Disable platform checks
dhil Dec 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 56 additions & 83 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ jobs:
audit: ${{ steps.calculate.outputs.audit }}
preview1-adapter: ${{ steps.calculate.outputs.preview1-adapter }}
run-dwarf: ${{ steps.calculate.outputs.run-dwarf }}
platform-checks: ${{ steps.calculate.outputs.platform-checks }}
steps:
- uses: actions/checkout@v4
- id: calculate
Expand All @@ -216,6 +217,8 @@ jobs:
run_full=true
elif grep -q 'prtest:debug' commits.log; then
echo run-dwarf=true >> $GITHUB_OUTPUT
elif grep -q 'prtest:platform-checks' commits.log; then
echo platform-checks=true >> $GITHUB_OUTPUT
fi
if grep -q crates.c-api names.log; then
echo test-capi=true >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -257,6 +260,7 @@ jobs:
echo audit=true >> $GITHUB_OUTPUT
echo preview1-adapter=true >> $GITHUB_OUTPUT
echo run-dwarf=true >> $GITHUB_OUTPUT
echo platform-checks=true >> $GITHUB_OUTPUT
fi

# Build all documentation of Wasmtime, including the C API documentation,
Expand Down Expand Up @@ -442,30 +446,6 @@ jobs:
- uses: ./.github/actions/cancel-on-failure
if: failure()

# Checks for no_std support, ensure that crates can build on a no_std target
no_std_checks:
name: no_std checks
runs-on: ubuntu-latest
env:
CARGO_NDK_VERSION: 2.12.2
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust

# NOTE(dhil): Currently, we only support x86_64 Linux.
# - run: rustup target add x86_64-unknown-none
# - run: cargo check --target x86_64-unknown-none -p wasmtime --no-default-features --features runtime,component-model
# - run: cargo check --target x86_64-unknown-none -p wasmtime --no-default-features --features runtime,gc,component-model
# - run: cargo check --target x86_64-unknown-none -p wasmtime --no-default-features --features runtime,gc,component-model,signals-based-traps
# - run: cargo check --target x86_64-unknown-none -p cranelift-control --no-default-features
# - run: cargo check --target x86_64-unknown-none -p pulley-interpreter --features encode,decode,disas,interp

# common logic to cancel the entire run if this job fails
- uses: ./.github/actions/cancel-on-failure
if: failure()

# Check that Clippy lints are passing.
clippy:
name: Clippy
Expand Down Expand Up @@ -520,10 +500,6 @@ jobs:
- run: cargo check --features wasmfx_pooling_allocator
- run: cargo check --features wasmfx_baseline,wasmfx_pooling_allocator

# Check whether `wasmtime` cross-compiles to x86_64-unknown-freebsd
- run: rustup target add x86_64-unknown-freebsd
- run: cargo check --target x86_64-unknown-freebsd

# Re-vendor all WIT files and ensure that they're all up-to-date by ensuring
# that there's no git changes.
- name: Re-vendor WIT
Expand All @@ -539,45 +515,66 @@ jobs:
- uses: ./.github/actions/cancel-on-failure
if: failure()

checks_illumos:
name: Check illumos
runs-on: ubuntu-latest
# Various checks that Wasmtime builds for a variety of platforms. Each
# platform may not include the entire dependency tree and maybe just a few
# features here and there, see the `include` matrix for more details.
platform_checks:
needs: determine
# NOTE(dhil): Disabled as the platforms are currently unsupported.
if: false && needs.determine.outputs.platform-checks
name: "Platform: ${{ matrix.target }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- target: x86_64-unknown-freebsd
os: ubuntu-latest
test: cargo check
- target: aarch64-pc-windows-msvc
os: windows-latest
test: cargo check
# While we're here testing a windows target also test a feature'd build
# on Windows. Note that this isn't covered by `micro_checks` above since
# that's for unix platforms, not Windows, so include a small check here
# which isn't the full `micro_checks` matrix but hopefully enough bang
# for our buck.
- target: i686-pc-windows-msvc
os: windows-latest
test: cargo check && cargo build -p wasmtime --no-default-features --features runtime
# This is used for general compatibility with `#![no_std]` targets and a
# variety of crates are tested here.
- target: x86_64-unknown-none
os: ubuntu-latest
test: >
cargo check -p wasmtime --no-default-features --features runtime,component-model &&
cargo check -p wasmtime --no-default-features --features runtime,gc,component-model &&
cargo check -p wasmtime --no-default-features --features runtime,gc,component-model,signals-based-traps &&
cargo check -p wasmtime --no-default-features --features runtime,gc,component-model,signals-based-traps &&
cargo check -p cranelift-control --no-default-features &&
cargo check -p pulley-interpreter --features encode,decode,disas,interp
# Use `cross` for illumos to have a C compiler/linker available.
- target: x86_64-unknown-illumos
os: ubuntu-latest
cross: true
test: cross build
- target: wasm32-wasip1
os: ubuntu-latest
test: cargo build --no-default-features --features compile,cranelift,all-arch
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust

# Check whether `wasmtime` cross-compiles to illumos. We need to use `cross` for this (even for
# cargo check) because of non-Rust dependencies.
- run: rustup target add ${{ matrix.target }}
- name: Install cross
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cross
- name: Cross-compile to illumos
run:
cross build --target x86_64-unknown-illumos

# common logic to cancel the entire run if this job fails
- uses: ./.github/actions/cancel-on-failure
if: failure()

# Check whether `wasmtime` cross-compiles to aarch64-pc-windows-msvc
# We don't build nor test it because it lacks trap handling.
# Tracking issue: https://github.com/bytecodealliance/wasmtime/issues/4992
checks_winarm64:
needs: determine
# TODO(dhil): This check is disabled due to lack of platform support.
if: needs.determine.outputs.run-full && false
name: Check Windows ARM64
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
- run: rustup target add aarch64-pc-windows-msvc
- run: cargo check -p wasmtime --target aarch64-pc-windows-msvc
if: ${{ matrix.cross }}
- run: ${{ matrix.test }}
env:
CARGO_BUILD_TARGET: ${{ matrix.target }}

# common logic to cancel the entire run if this job fails
- uses: ./.github/actions/cancel-on-failure
Expand Down Expand Up @@ -991,27 +988,6 @@ jobs:
- uses: ./.github/actions/cancel-on-failure
if: failure()


build-wasmtime-target-wasm32:
name: Build wasmtime-target-wasm32
# TODO(dhil): This platform is unsupported.
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
- run: rustup target add wasm32-wasip1 wasm32-unknown-unknown
- run: cargo build --target wasm32-wasip1 --no-default-features --features compile,cranelift,all-arch
env:
VERSION: ${{ github.sha }}

# common logic to cancel the entire run if this job fails
- uses: ./.github/actions/cancel-on-failure
if: failure()


bench:
needs: determine
if: needs.determine.outputs.run-full
Expand Down Expand Up @@ -1206,19 +1182,16 @@ jobs:
- doc
- micro_checks
- fiber_tests
- no_std_checks
- clippy
- monolith_checks
- checks_illumos
- checks_winarm64
- platform_checks
- bench
- meta_deterministic_check
- verify-publish
- determine
- miri
- build-preview1-component-adapter
- build-preview1-component-adapter-provider
- build-wasmtime-target-wasm32
- test-min-platform-example
- check_js
if: always()
Expand Down
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ humantime = { workspace = true }
tempfile = { workspace = true, optional = true }

async-trait = { workspace = true }
trait-variant = { workspace = true }
bytes = { workspace = true }
cfg-if = { workspace = true }
tokio = { workspace = true, optional = true, features = [ "signal", "macros" ] }
Expand All @@ -98,6 +99,7 @@ criterion = { workspace = true }
num_cpus = "1.13.0"
memchr = "2.4"
async-trait = { workspace = true }
trait-variant = { workspace = true }
wat = { workspace = true }
rayon = "1.5.0"
wasmtime-wast = { workspace = true, features = ['component-model'] }
Expand Down Expand Up @@ -316,6 +318,7 @@ tracing = "0.1.26"
bitflags = "2.0"
thiserror = "1.0.43"
async-trait = "0.1.71"
trait-variant = "0.1.2"
heck = "0.5"
similar = "2.1.0"
toml = "0.8.10"
Expand Down
3 changes: 2 additions & 1 deletion ci/build-test-matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ const FULL_MATRIX = [
// TODO(dhil): Disabled as long as we don't support other platforms
// than x86_64 Linux.
// {
// "os": "macos-13",
// "os": macos,
// "name": "Test macOS x86_64",
// "filter": "macos-x64",
// "target": "x86_64-apple-darwin",
// },
// {
// "os": macos,
Expand Down
32 changes: 0 additions & 32 deletions cranelift/codegen/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,6 @@ fn run_compilation(compilation: &IsleCompilation) -> Result<(), Errors> {
isle::compile::from_files(file_paths, &options)?
};

let code = rustfmt(&code).unwrap_or_else(|e| {
println!("cargo:warning=Failed to run `rustfmt` on ISLE-generated code: {e:?}");
code
});

eprintln!(
"Writing ISLE-generated Rust code to {}",
compilation.output.display()
Expand All @@ -226,30 +221,3 @@ fn run_compilation(compilation: &IsleCompilation) -> Result<(), Errors> {

Ok(())
}

fn rustfmt(code: &str) -> std::io::Result<String> {
use std::io::Write;

let mut rustfmt = std::process::Command::new("rustfmt")
.stdin(std::process::Stdio::piped())
.stdout(std::process::Stdio::piped())
.spawn()?;

let mut stdin = rustfmt.stdin.take().unwrap();
stdin.write_all(code.as_bytes())?;
drop(stdin);

let mut stdout = rustfmt.stdout.take().unwrap();
let mut data = vec![];
stdout.read_to_end(&mut data)?;

let status = rustfmt.wait()?;
if !status.success() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!("`rustfmt` exited with status {status}"),
));
}

Ok(String::from_utf8(data).expect("rustfmt always writes utf-8 to stdout"))
}
2 changes: 1 addition & 1 deletion cranelift/codegen/meta/src/cdsl/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ fn verify_polymorphic(
/// Verify that the use of TypeVars is consistent with `ctrl_typevar` as the controlling type
/// variable.
///
/// All polymorhic inputs must either be derived from `ctrl_typevar` or be independent free type
/// All polymorphic inputs must either be derived from `ctrl_typevar` or be independent free type
/// variables only used once.
///
/// All polymorphic results must be derived from `ctrl_typevar`.
Expand Down
3 changes: 2 additions & 1 deletion cranelift/codegen/meta/src/pulley.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ impl Inst<'_> {
match self.name {
// Skip instructions related to control-flow as those require
// special handling with `MachBuffer`.
"Jump" | "Call" | "CallIndirect" => true,
"Jump" => true,
n if n.starts_with("Call") => true,

// Skip special instructions not used in Cranelift.
"XPush32Many" | "XPush64Many" | "XPop32Many" | "XPop64Many" => true,
Expand Down
2 changes: 1 addition & 1 deletion cranelift/codegen/meta/src/shared/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ pub(crate) fn define(
r#"
Fixed-point multiplication of numbers in the QN format, where N + 1
is the number bitwidth:
`a := signed_saturate((x * y + 1 << (Q - 1)) >> Q)`
`a := signed_saturate((x * y + (1 << (Q - 1))) >> Q)`

Polymorphic over all integer vector types with 16- or 32-bit numbers.
"#,
Expand Down
Loading
Loading