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

Synchronize contents of lib/api/src/sys to lib/api/src/js #3054

Closed
silwol opened this issue Aug 1, 2022 · 4 comments · Fixed by #3129
Closed

Synchronize contents of lib/api/src/sys to lib/api/src/js #3054

silwol opened this issue Aug 1, 2022 · 4 comments · Fixed by #3129
Assignees
Labels
bug Something isn't working priority-high High priority issue
Milestone

Comments

@silwol
Copy link
Contributor

silwol commented Aug 1, 2022

As commented in #1840 (comment) the two directories are out of sync, and the contents of lib/api/src/js should undergo the equivalent changes to lib/api/src/sys on master branch.

@silwol silwol added the bug Something isn't working label Aug 1, 2022
@epilys epilys added this to the v3.0 milestone Aug 2, 2022
@epilys epilys added the priority-high High priority issue label Aug 2, 2022
@syrusakbary syrusakbary assigned fschutt and unassigned silwol Aug 19, 2022
@syrusakbary
Copy link
Member

We need to ensure that the public-facing API is literally the same (except some small exceptions) on both the JS codebase and SYS one @fschutt

@fschutt
Copy link
Contributor

fschutt commented Aug 19, 2022

@fschutt
Copy link
Contributor

fschutt commented Aug 19, 2022

rustup update nightly
cargo +nightly rustdoc --lib -- -Z unstable-options --output-format json
cargo +nightly rustdoc --no-default-features --features="js,std" --target wasm32-wasi --lib -- -Z unstable-options --output-format json
cp ../../target/doc/wasmer.json ./wasmer-sys.json
cp ../../target/wasm32-wasi/doc/wasmer.json ./wasmer-js.json
~/Development/cargo-public-api/target/release/public-api ./wasmer-js.json ./wasmer-sys.json > api.diff

@fschutt
Copy link
Contributor

fschutt commented Aug 23, 2022

#[repr(transparent)] pub struct wasmer::sys::ExternRef
pub const wasmer::sys::ExternRef::WASM_TYPE: Type
pub const wasmer::sys::Function::WASM_TYPE: Type (type Abi => f64 / usize)
pub enum variant wasmer::sys::InstantiationError::*
pub enum variant wasmer::sys::Value::ExternRef(Option<ExternRef>)
pub enum variant wasmer::sys::Value::FuncRef(Option<Function>)
pub enum variant wasmer::sys::Value::V128(u128)
pub fn wasmer::sys::BaseTunables (BaseTunables do not exist)
pub fn wasmer::sys::BaseTunables::clone(&self) -> BaseTunables
pub fn wasmer::sys::BaseTunables::create_host_memory(&self, ty: &MemoryType, style: &MemoryStyle) -> Result<VMMemory, MemoryError>
pub fn wasmer::sys::BaseTunables::create_host_table(&self, ty: &TableType, style: &TableStyle) -> Result<VMTable, String>
pub fn wasmer::sys::BaseTunables::for_target(target: &Target) -> Self
pub fn wasmer::sys::BaseTunables::memory_style(&self, memory: &MemoryType) -> MemoryStyle
pub fn wasmer::sys::BaseTunables::table_style(&self, _table: &TableType) -> TableStyle
pub fn wasmer::sys::Exports::get_typed_function<Args, Rets>(&self, store: &impl AsStoreRef, name: &str) -> Result<TypedFunction<Args, Rets>, ExportError> where Args: WasmTypeList, Rets: WasmTypeList
pub fn wasmer::sys::Exports::get_with_generics<'a, T, Args, Rets>(&'a self, name: &str) -> Result<T, ExportError> where Args: WasmTypeList, Rets: WasmTypeList, T: ExportableWithGenerics<'a, Args, Rets>
pub fn wasmer::sys::Extern::from_vm_extern(store: &mut impl AsStoreMut, vm_extern: VMExtern) -> Self
pub fn wasmer::sys::Extern::to_vm_extern(&self) -> VMExtern
pub fn wasmer::sys::ExternRef::clone(&self) -> ExternRef
pub fn wasmer::sys::ExternRef::downcast<'a, T>(&self, store: &'a impl AsStoreRef) -> Option<&'a T> where T: Any + Send + Sync + 'static + Sized
pub fn wasmer::sys::ExternRef::fmt(&self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
pub fn wasmer::sys::ExternRef::is_from_store(&self, store: &impl AsStoreRef) -> bool
pub fn wasmer::sys::ExternRef::new<T>(store: &mut impl AsStoreMut, value: T) -> Self where T: Any + Send + Sync + 'static + Sized
pub fn wasmer::sys::FromToNativeWasmType::is_from_store(&self, _store: &impl AsStoreRef) -> bool
pub fn wasmer::sys::Function::from(other: TypedFunction<Args, Rets>) -> Self
pub fn wasmer::sys::Function::new<FT, F>(store: &mut impl AsStoreMut, ty: FT, func: F) -> Self where FT: Into<FunctionType>, F: Fn(&[Value]) -> Result<Vec<Value>, RuntimeError> + 'static + Send + Sync
pub fn wasmer::sys::Function::new_native_with_env<T: Send + 'static, F, Args, Rets>(store: &mut impl AsStoreMut, env: &FunctionEnv<T>, func: F) -> Self where F: HostFunction<T, Args, Rets, WithEnv> + 'static + Send + Sync, Args: WasmTypeList, Rets: WasmTypeList
pub fn wasmer::sys::Function::new_typed_with_env<T: Send + 'static, F, Args, Rets>(store: &mut impl AsStoreMut, env: &FunctionEnv<T>, func: F) -> Self where F: HostFunction<T, Args, Rets, WithEnv> + 'static + Send + Sync, Args: WasmTypeList, Rets: WasmTypeList
pub fn wasmer::sys::Function::ty(&self, store: &impl AsStoreRef) -> FunctionType
pub fn wasmer::sys::HostFunction::call_trampoline_address() -> VMTrampoline
pub fn wasmer::sys::HostFunction::function_body_ptr() -> *const VMFunctionBody
pub fn wasmer::sys::Imports::imports_for_module(&self, module: &Module) -> Result<Vec<Extern>, LinkError>
pub fn wasmer::sys::Instance::new_by_index(store: &mut impl AsStoreMut, module: &Module, externs: &[Extern]) -> Result<Self, InstantiationError>
pub fn wasmer::sys::InstantiationError::source(&self) -> std::option::Option<&(dyn std::error::Error + 'static)>
pub fn wasmer::sys::Memory::eq(&self, other: &Self) -> bool
pub fn wasmer::sys::Module::custom_sections<'a>(&'a self, name: &'a str) -> impl Iterator<Item = Box<[u8]>> + 'a
pub fn wasmer::sys::Module::from_file(store: &impl AsStoreRef, file: impl AsRef<Path>) -> Result<Self, IoCompileError>
pub fn wasmer::sys::Module::serialize_to_file(&self, path: impl AsRef<Path>) -> Result<(), SerializeError>
pub fn wasmer::sys::NativeWasmTypeInto::into_raw(self, store: &mut impl AsStoreMut) -> RawValue
pub fn wasmer::sys::Store::custom_trap_handler(&self, call: &dyn Fn(&TrapHandlerFn<'_>) -> bool) -> bool
pub fn wasmer::sys::Store::engine(&self) -> &Engine
pub fn wasmer::sys::Store::new(engine: impl Into<Engine>) -> Self
pub fn wasmer::sys::Store::new_with_engine(engine: impl Into<Engine>) -> Self
pub fn wasmer::sys::Store::new_with_tunables(engine: impl Into<Engine>, tunables: impl Tunables + Send + Sync + 'static) -> Self
pub fn wasmer::sys::Store::set_trap_handler(&mut self, handler: Option<Box<TrapHandlerFn<'static>>>)
pub fn wasmer::sys::Store::tunables(&self) -> &dyn Tunables
pub fn wasmer::sys::StoreMut::engine(&self) -> &Engine
pub fn wasmer::sys::StoreMut::tunables(&self) -> &dyn Tunables
pub fn wasmer::sys::StoreRef::engine(&self) -> &Engine
pub fn wasmer::sys::StoreRef::signal_handler(&self) -> Option<*const TrapHandlerFn<'static>>
pub fn wasmer::sys::StoreRef::tunables(&self) -> &dyn Tunables
pub fn wasmer::sys::Table::copy(store: &mut impl AsStoreMut, dst_table: &Self, dst_index: u32, src_table: &Self, src_index: u32, len: u32) -> Result<(), RuntimeError>
pub fn wasmer::sys::Value::as_raw(&self, store: &impl AsStoreRef) -> RawValue
pub fn wasmer::sys::Value::externref(&self) -> Option<&Option<ExternRef>>
pub fn wasmer::sys::Value::from(val: ExternRef) -> Self
pub fn wasmer::sys::Value::from(val: Option<ExternRef>) -> Self
pub fn wasmer::sys::Value::unwrap_externref(&self) -> &Option<ExternRef>
pub fn wasmer::sys::Value::unwrap_v128(&self) -> u128
pub fn wasmer::sys::Value::v128(&self) -> Option<u128>
pub fn wasmer::sys::WasmSlice::is_empty(self) -> bool
pub struct wasmer::sys::BaseTunables
pub struct field wasmer::sys::BaseTunables::dynamic_memory_offset_guard_size: u64
pub struct field wasmer::sys::BaseTunables::static_memory_bound: Pages
pub struct field wasmer::sys::BaseTunables::static_memory_offset_guard_size: u64
pub mod wasmer::sys::vm
pub trait wasmer::sys::CompilerConfig
pub trait wasmer::sys::FunctionMiddleware
pub trait wasmer::sys::HostFunction<T, Args, Rets, Kind> where Args: WasmTypeList, Rets: WasmTypeList, Kind: HostFunctionKind
pub trait wasmer::sys::ModuleMiddleware
pub trait wasmer::sys::Tunables
pub type wasmer::sys::ExternRef::Abi = usize
pub use wasmer::sys::Architecture
pub use wasmer::sys::Artifact
pub unsafe fn wasmer::sys::BaseTunables::create_vm_memory(&self, ty: &MemoryType, style: &MemoryStyle, vm_definition_location: NonNull<VMMemoryDefinition>) -> Result<VMMemory, MemoryError>
pub unsafe fn wasmer::sys::BaseTunables::create_vm_table(&self, ty: &TableType, style: &TableStyle, vm_definition_location: NonNull<VMTableDefinition>) -> Result<VMTable, String>
pub unsafe fn wasmer::sys::Module::deserialize_from_file(store: &impl AsStoreRef, path: impl AsRef<Path>) -> Result<Self, DeserializeError>
pub use wasmer::sys::CpuFeature
pub use wasmer::sys::CallingConvention
pub use wasmer::sys::Cranelift
pub use wasmer::sys::CraneliftOptLevel
pub unsafe fn wasmer::sys::WasmTypeList::from_slice(store: &mut impl AsStoreMut, slice: &[RawValue]) -> Result<Self, TryFromSliceError>
pub unsafe fn wasmer::sys::WasmTypeList::write_c_struct_to_ptr(c_struct: <Self as >::CStruct, ptr: *mut RawValue)
pub use wasmer::sys::FrameInfo
pub use wasmer::sys::LinkError
pub use wasmer::sys::Engine
pub use wasmer::sys::EngineBuilder
pub use wasmer::sys::Features
pub use wasmer::sys::MiddlewareError
pub unsafe fn wasmer::sys::Value::from_raw(store: &mut impl AsStoreMut, ty: Type, raw: RawValue) -> Self
pub use wasmer::sys::raise_user_trap
pub use wasmer::sys::MiddlewareReaderState
pub unsafe trait wasmer::sys::ValueTypeq
pub type wasmer::sys::WasmTypeList::ArrayAsMut<[RawValue]>
pub use wasmer::sys::OperatingSystem
pub use wasmer::sys::Target
pub use wasmer::sys::Triple
pub use wasmer::sys::ParseCpuFeatureError
pub unsafe fn wasmer::sys::NativeWasmTypeInto::from_raw(store: &mut impl AsStoreMut, raw: RawValue) -> Self
pub type wasmer::sys::Function::Abi = usize
pub use wasmer::sys::HOST
pub use wasmer::sys::vm::VMExtern
pub use wasmer::sys::vm::VMMemory
pub use wasmer::sys::vm::VMMemoryDefinition
pub use wasmer::sys::vm::VMTable
pub use wasmer::sys::vm::VMTableDefinition
pub use wasmer::sys::wasmparser
pub use wasmer::sys::wat2wasm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high High priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants