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

Fix wasm3-rs builds #48

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ impl<'rt> Module<'rt> {
unsafe { cstr_to_str(ffi::m3_GetModuleName(self.raw)) }
}

/// Compile all functions in the module.
pub fn compile(&mut self) -> Result<()> {
unsafe { Error::from_ffi_res(ffi::m3_CompileModule(self.raw)) }
}

/// Links wasi to this module.
#[cfg(feature = "wasi")]
pub fn link_wasi(&mut self) -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion wasm3-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cc = "1"
shlex = "0.1.1"

[build-dependencies.bindgen]
version = "0.59"
version = "0.64"
optional = true

[package.metadata.docs.rs]
Expand Down
10 changes: 5 additions & 5 deletions wasm3-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ fn gen_bindings() {
.arg("--no-layout-tests")
.arg("--default-enum-style=moduleconsts")
.arg("--no-doc-comments")
.arg("--whitelist-function")
.arg("--allowlist-function")
.arg(WHITELIST_REGEX_FUNCTION)
.arg("--whitelist-type")
.arg("--allowlist-type")
.arg(WHITELIST_REGEX_TYPE)
.arg("--whitelist-var")
.arg("--allowlist-var")
.arg(WHITELIST_REGEX_VAR)
.arg("--no-derive-debug");
for &ty in PRIMITIVES.iter() {
bindgen.arg("--blacklist-type").arg(ty);
bindgen.arg("--blocklist-type").arg(ty);
}
bindgen
.arg("-o")
Expand All @@ -65,7 +65,7 @@ fn gen_bindings() {
))
.arg("-Dd_m3LogOutput=0")
.arg("-Iwasm3/source");
let status = bindgen.status().expect("Unable to generate bindings");
let status = bindgen.status().unwrap_or_else(|error| panic!("Unable to generate bindings: {}", error.to_string()));
if !status.success() {
panic!("Failed to run bindgen: {:?}", status);
}
Expand Down
2 changes: 1 addition & 1 deletion wasm3-sys/wasm3
Submodule wasm3 updated 82 files
+109 −77 .github/workflows/tests.yml
+1 −0 .gitignore
+19 −7 CMakeLists.txt
+56 −44 README.md
+181 −0 build-cross.py
+39 −0 build.zig
+53 −0 docs/Cookbook.md
+3 −1 docs/Demos.md
+31 −1 docs/Development.md
+5 −5 docs/Interpreter.md
+ extra/logos/blynk.png
+0 −0 extra/logos/iden3.svg
+ extra/logos/losant.png
+ extra/logos/scailable.png
+0 −0 extra/logos/shareup_app.svg
+ extra/logos/wasmcloud.png
+ extra/logos/wowcube.png
+ extra/screenshot-android.png
+ extra/screenshot-ios.png
+ extra/txiki_js.png
+3 −3 platforms/android/README.md
+6 −6 platforms/android/app/build.gradle
+3 −3 platforms/android/build.gradle
+ platforms/android/gradle/wrapper/gradle-wrapper.jar
+1 −1 platforms/android/gradle/wrapper/gradle-wrapper.properties
+154 −103 platforms/android/gradlew
+4 −18 platforms/android/gradlew.bat
+15 −3 platforms/app/main.c
+1 −1 platforms/cosmopolitan/build.sh
+25 −4 platforms/cpp/README.md
+31 −8 platforms/cpp/main.cpp
+17 −0 platforms/cpp/wasm/test_prog.c
+ platforms/cpp/wasm/test_prog.wasm
+65 −22 platforms/cpp/wasm/test_prog.wasm.h
+90 −53 platforms/cpp/wasm3_cpp/include/wasm3_cpp.h
+1 −1 platforms/embedded/esp32-idf-wasi/README.md
+2 −2 platforms/embedded/esp32-idf-wasi/main/CMakeLists.txt
+229 −149 platforms/embedded/esp32-idf-wasi/main/m3_api_esp_wasi.c
+12 −7 platforms/embedded/esp32-idf-wasi/main/m3_api_esp_wasi.h
+9 −2 platforms/embedded/esp32-idf-wasi/main/main.cpp
+0 −0 platforms/embedded/esp32-idf-wasi/main/wasm3
+1 −0 platforms/embedded/particle/src/main.ino
+1 −1 platforms/ios/README.md
+2 −8 platforms/ios/wasm3.xcodeproj/project.pbxproj
+12 −43 platforms/ios/wasm3/main.c
+1 −1 platforms/openwrt/build/Makefile
+0 −3 source/CMakeLists.txt
+0 −2 source/m3_api_defs.h
+6 −1 source/m3_api_libc.c
+426 −59 source/m3_api_meta_wasi.c
+243 −59 source/m3_api_uvwasi.c
+19 −9 source/m3_api_wasi.c
+11 −1 source/m3_api_wasi.h
+11 −37 source/m3_bind.c
+23 −10 source/m3_code.c
+1 −1 source/m3_code.h
+300 −185 source/m3_compile.c
+28 −11 source/m3_compile.h
+19 −10 source/m3_config.h
+39 −12 source/m3_config_platforms.h
+41 −27 source/m3_core.c
+65 −14 source/m3_core.h
+0 −111 source/m3_emit.c
+0 −28 source/m3_emit.h
+137 −45 source/m3_env.c
+12 −1 source/m3_env.h
+4 −5 source/m3_exception.h
+1 −62 source/m3_exec.c
+101 −75 source/m3_exec.h
+24 −6 source/m3_exec_defs.h
+1 −1 source/m3_function.c
+1 −0 source/m3_function.h
+135 −84 source/m3_info.c
+2 −1 source/m3_info.h
+21 −21 source/m3_math_utils.h
+13 −6 source/m3_module.c
+0 −12 source/m3_optimize.c
+42 −17 source/m3_parse.c
+28 −12 source/wasm3.h
+24 −13 source/wasm3_defs.h
+3 −2 test/run-spec-test.py
+4 −7 test/run-wasi-test.py