Skip to content

Commit

Permalink
Fix issue with kernel-net; add it to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Apr 8, 2020
1 parent cd4706f commit 4d58ae2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .azure/install-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ steps:
rustup update --no-self-update $RUST_TOOLCHAIN
rustup default $RUST_TOOLCHAIN
rustup target add x86_64-unknown-linux-musl
rustup target add wasm32-wasi
if [ -n "$ANDROID" ]; then
rustup target add x86_64-linux-android --toolchain $RUST_TOOLCHAIN
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ check-bench: check-bench-singlepass check-bench-llvm
# to https://github.com/rust-lang/cargo/issues/6745 .
NOT_RUNTIME_CRATES = -p wasmer-clif-backend -p wasmer-singlepass-backend -p wasmer-middleware-common -p wasmer-runtime-core -p wasmer-emscripten -p wasmer-llvm-backend -p wasmer-wasi -p wasmer-kernel-loader -p wasmer-interface-types
RUNTIME_CHECK = cargo check --manifest-path lib/runtime/Cargo.toml --no-default-features
check: check-bench
check: check-bench check-kernel-net
cargo check $(NOT_RUNTIME_CRATES)
cargo check --release $(NOT_RUNTIME_CRATES)
cargo check --all-features $(NOT_RUNTIME_CRATES)
Expand Down Expand Up @@ -263,6 +263,8 @@ check: check-bench
--features=llvm,default-backend-llvm
--features=default-backend-singlepass,singlepass,cranelift,llvm,cache,deterministic-execution

check-kernel-net: cargo +nightly check -p kernel-net --target=wasm32-wasi

# Release
release:
cargo build --release --features backend-singlepass,backend-cranelift,backend-llvm,loader-kernel,experimental-io-devices,log/release_max_level_off
Expand Down
10 changes: 5 additions & 5 deletions lib/kernel-net/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ thread_local! {

#[derive(Default)]
struct AsyncState {
callback: Option<Box<FnOnce()>>,
callback: Option<Box<dyn FnOnce()>>,
_epoll: Option<Arc<Epoll>>,
}

pub struct Epoll {
fd: i32,
imm_queue: Mutex<Vec<Box<FnOnce()>>>,
imm_queue: Mutex<Vec<Box<dyn FnOnce()>>>,
}

impl Epoll {
Expand Down Expand Up @@ -163,7 +163,7 @@ fn get_async_io_payload<
direction: EpollDirection,
poll_action: P,
on_ready: F,
) -> Box<FnOnce()> {
) -> Box<dyn FnOnce()> {
__get_async_io_payload(epoll, fd, direction, poll_action, on_ready, false)
}

Expand All @@ -178,7 +178,7 @@ fn __get_async_io_payload<
mut poll_action: P,
on_ready: F,
registered: bool,
) -> Box<FnOnce()> {
) -> Box<dyn FnOnce()> {
let epfd = epoll.fd;
Box::new(move || {
//println!("async io payload");
Expand Down Expand Up @@ -230,7 +230,7 @@ struct SockaddrIn {
}

#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Default, Copy, Clone)]
struct InAddr {
s_addr: u32,
}
Expand Down

0 comments on commit 4d58ae2

Please sign in to comment.