From 25c7d82a86b945d104c53e83f9929a3de54ab3d8 Mon Sep 17 00:00:00 2001 From: jfh Date: Wed, 3 Nov 2021 23:37:44 +0200 Subject: [PATCH] Add wasi check to ci. --- .github/workflows/ci.yaml | 10 ++++++++++ vm/src/exceptions.rs | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8cb89c78a..c19d9b26c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -105,6 +105,16 @@ jobs: command: check args: --target aarch64-linux-android + - uses: actions-rs/toolchain@v1 + with: + target: wasm32-wasi + + - name: Check compilation for wasi + uses: actions-rs/cargo@v1 + with: + command: check + args: --target wasm32-wasi --features freeze-stdlib + - name: Prepare repository for redox compilation run: bash scripts/redox/uncomment-cargo.sh - name: Check compilation for Redox diff --git a/vm/src/exceptions.rs b/vm/src/exceptions.rs index 05e7f59c7..d52cecb18 100644 --- a/vm/src/exceptions.rs +++ b/vm/src/exceptions.rs @@ -989,7 +989,7 @@ impl IntoPyException for widestring::NulError { } } -#[cfg(not(target_arch = "wasm32"))] +#[cfg(any(unix, windows, target_os = "wasi"))] pub(crate) fn raw_os_error_to_exc_type(errno: i32, vm: &VirtualMachine) -> Option { use crate::stdlib::errno::errors; let excs = &vm.ctx.exceptions; @@ -998,6 +998,7 @@ pub(crate) fn raw_os_error_to_exc_type(errno: i32, vm: &VirtualMachine) -> Optio errors::EALREADY => Some(excs.blocking_io_error.clone()), errors::EINPROGRESS => Some(excs.blocking_io_error.clone()), errors::EPIPE => Some(excs.broken_pipe_error.clone()), + #[cfg(not(target_os = "wasi"))] errors::ESHUTDOWN => Some(excs.broken_pipe_error.clone()), errors::ECHILD => Some(excs.child_process_error.clone()), errors::ECONNABORTED => Some(excs.connection_aborted_error.clone()),