From de384bb9ccdf0539755434c1f46dae1f93a6ad72 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 19 Jul 2022 15:25:24 +0200 Subject: [PATCH 1/4] Fixed residual package-doc issues --- lib/api/src/lib.rs | 4 ---- lib/api/src/sys/externals/global.rs | 10 +++++----- lib/api/src/sys/function_env.rs | 6 +++--- lib/api/src/sys/instance.rs | 2 +- lib/api/src/sys/store.rs | 4 ++-- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/api/src/lib.rs b/lib/api/src/lib.rs index 5a14ab0dab6..d1160e5e4b9 100644 --- a/lib/api/src/lib.rs +++ b/lib/api/src/lib.rs @@ -196,10 +196,6 @@ //! A Host function is any function implemented on the host, in this case in //! Rust. //! -//! Host functions can optionally be created with an environment that -//! implements [`WasmerEnv`]. This environment is useful for maintaining -//! host state (for example the filesystem in WASI). -//! //! Thus WebAssembly modules by themselves cannot do anything but computation //! on the core types in [`Value`]. In order to make them more useful we //! give them access to the outside world with [`imports`]. diff --git a/lib/api/src/sys/externals/global.rs b/lib/api/src/sys/externals/global.rs index 108d256d08e..ff35dec5506 100644 --- a/lib/api/src/sys/externals/global.rs +++ b/lib/api/src/sys/externals/global.rs @@ -19,7 +19,7 @@ pub struct Global { } impl Global { - /// Create a new `Global` with the initial value [`Val`]. + /// Create a new `Global` with the initial value [`Value`]. /// /// # Example /// @@ -36,7 +36,7 @@ impl Global { Self::from_value(ctx, val, Mutability::Const).unwrap() } - /// Create a mutable `Global` with the initial value [`Val`]. + /// Create a mutable `Global` with the initial value [`Value`]. /// /// # Example /// @@ -53,7 +53,7 @@ impl Global { Self::from_value(ctx, val, Mutability::Var).unwrap() } - /// Create a `Global` with the initial value [`Val`] and the provided [`Mutability`]. + /// Create a `Global` with the initial value [`Value`] and the provided [`Mutability`]. fn from_value( ctx: &mut impl AsStoreMut, val: Value, @@ -95,7 +95,7 @@ impl Global { *self.handle.get(ctx.as_store_ref().objects()).ty() } - /// Retrieves the current value [`Val`] that the Global has. + /// Retrieves the current value [`Value`] that the Global has. /// /// # Example /// @@ -120,7 +120,7 @@ impl Global { } } - /// Sets a custom value [`Val`] to the runtime Global. + /// Sets a custom value [`Value`] to the runtime Global. /// /// # Example /// diff --git a/lib/api/src/sys/function_env.rs b/lib/api/src/sys/function_env.rs index c2fd67018c6..0dde57ea78c 100644 --- a/lib/api/src/sys/function_env.rs +++ b/lib/api/src/sys/function_env.rs @@ -73,19 +73,19 @@ impl Clone for FunctionEnv { } } -/// A temporary handle to a [`Context`]. +/// A temporary handle to a [`FunctionEnv`]. pub struct FunctionEnvMut<'a, T: 'a> { pub(crate) store_mut: StoreMut<'a>, pub(crate) func_env: FunctionEnv, } impl FunctionEnvMut<'_, T> { - /// Returns a reference to the host state in this context. + /// Returns a reference to the host state in this function environement. pub fn data(&self) -> &T { self.func_env.as_ref(&self.store_mut) } - /// Returns a mutable- reference to the host state in this context. + /// Returns a mutable- reference to the host state in this function environement. pub fn data_mut(&mut self) -> &mut T { self.func_env.as_mut(&mut self.store_mut) } diff --git a/lib/api/src/sys/instance.rs b/lib/api/src/sys/instance.rs index bcc4d6beb55..93bd15a9112 100644 --- a/lib/api/src/sys/instance.rs +++ b/lib/api/src/sys/instance.rs @@ -62,7 +62,7 @@ pub enum InstantiationError { #[error("missing required CPU features: {0:?}")] CpuFeature(String), - /// Import from a different [`Store`]. + /// Import from a different Store. /// This error occurs when an import from a different store is used. #[error("cannot mix imports from different stores")] DifferentStores, diff --git a/lib/api/src/sys/store.rs b/lib/api/src/sys/store.rs index 862ebda5b61..bf0fce4b5d6 100644 --- a/lib/api/src/sys/store.rs +++ b/lib/api/src/sys/store.rs @@ -145,7 +145,7 @@ impl fmt::Debug for Store { } } -/// A temporary handle to a [`Context`]. +/// A temporary handle to a [`Store`]. pub struct StoreRef<'a> { pub(crate) inner: &'a StoreInner, } @@ -182,7 +182,7 @@ impl<'a> StoreRef<'a> { } } -/// A temporary handle to a [`Context`]. +/// A temporary handle to a [`Store`]. pub struct StoreMut<'a> { pub(crate) inner: &'a mut StoreInner, } From dbaca9f5b75aa7f743fea3bb558d9e6feebae3f9 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 19 Jul 2022 15:39:44 +0200 Subject: [PATCH 2/4] Add a step to package-docs in the sys tests --- .github/workflows/test-sys.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index b67ea15f89f..c45bb068a5e 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -53,6 +53,7 @@ jobs: run_test: true run_test_capi: true run_integration_tests: true + run_build_docs: true use_sccache: true - build: macos-x64 os: macos-11 @@ -63,12 +64,14 @@ jobs: use_sccache: true run_integration_tests: true run_ios_tests: true + run_build_docs: true - build: macos-arm64 os: macos-11.0 target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false + run_build_docs: true - build: windows-x64 os: windows-2019 #target: x86_64-pc-windows-msvc commented because of bug in rust setup action @@ -78,6 +81,7 @@ jobs: use_sccache: true run_test: true run_test_capi: false # We can't run yet the capi tests on Windows + run_build_docs: true - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest @@ -85,6 +89,7 @@ jobs: run_test: true run_test_capi: false # It can't run the capi tests because of a cc linker issue (`wasm_engine_new` is redefined) run_integration_tests: false + run_build_docs: false use_sccache: false container: ${{ matrix.container }} env: @@ -218,6 +223,10 @@ jobs: if: matrix.run_test_capi && matrix.os == 'windows-2019' run: | make test-capi + - name: Build Doc + if: matrix.run_build_docs + run: | + make package-docs audit: name: Audit From 18a02c36cfdd0b427983aa119539aa514b4d645e Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 19 Jul 2022 15:46:07 +0200 Subject: [PATCH 3/4] Disable the package-docs test on macos --- .github/workflows/test-sys.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index c45bb068a5e..914fef31a55 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -64,14 +64,14 @@ jobs: use_sccache: true run_integration_tests: true run_ios_tests: true - run_build_docs: true + run_build_docs: false - build: macos-arm64 os: macos-11.0 target: aarch64-apple-darwin use_sccache: true run_test: false run_test_capi: false - run_build_docs: true + run_build_docs: false - build: windows-x64 os: windows-2019 #target: x86_64-pc-windows-msvc commented because of bug in rust setup action From c7173088f9a6be0511cdbebaaa07cd13bb1c00ab Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 19 Jul 2022 16:50:57 +0200 Subject: [PATCH 4/4] Disable the package-docs test on windows too --- .github/workflows/test-sys.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 914fef31a55..1a1267f4a57 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -81,7 +81,7 @@ jobs: use_sccache: true run_test: true run_test_capi: false # We can't run yet the capi tests on Windows - run_build_docs: true + run_build_docs: false - build: linux-musl-x64 target: x86_64-unknown-linux-musl os: ubuntu-latest