diff --git a/MODULE.bazel b/MODULE.bazel index e39c216..85d528f 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,18 +6,17 @@ module( bazel_dep(name = "rules_cc", version = "0.0.9") bazel_dep(name = "bazel_skylib", version = "1.6.1") -bazel_dep(name = "ecsact_runtime", version = "0.6.9") -bazel_dep(name = "rules_ecsact", version = "0.5.1") +bazel_dep(name = "ecsact_runtime", version = "0.7.0") +bazel_dep(name = "rules_ecsact", version = "0.5.8") bazel_dep(name = "docopt.cpp", version = "0.6.2") bazel_dep(name = "magic_enum", version = "0.9.3") bazel_dep(name = "rules_wasmer", version = "0.1.1") -bazel_dep(name = "ecsact_cli", version = "0.3.4") +bazel_dep(name = "ecsact_cli", version = "0.3.19") +bazel_dep(name = "platforms", version = "0.0.10") bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True) bazel_dep(name = "hedron_compile_commands", dev_dependency = True) -bazel_dep(name = "platforms", version = "0.0.10") - git_override( module_name = "hedron_compile_commands", commit = "204aa593e002cbd177d30f11f54cff3559110bb9", diff --git a/ecsact/wasm/detail/guest_imports/env.hh b/ecsact/wasm/detail/guest_imports/env.hh index deff809..299bec1 100644 --- a/ecsact/wasm/detail/guest_imports/env.hh +++ b/ecsact/wasm/detail/guest_imports/env.hh @@ -48,10 +48,11 @@ const auto guest_env_module_imports = allowed_guest_imports_t{ "ecsact_system_execution_context_get", []() -> minst_import_resolve_func { return { - wasm_functype_new_3_0( + wasm_functype_new_4_0( wasm_valtype_new(WASM_I32), // context wasm_valtype_new(WASM_I32), // component_id - wasm_valtype_new(WASM_I32) // out_component_data + wasm_valtype_new(WASM_I32), // out_component_data + wasm_valtype_new(WASM_I32) // indexed_fields ), &wasm_ecsact_system_execution_context_get, }; @@ -61,10 +62,11 @@ const auto guest_env_module_imports = allowed_guest_imports_t{ "ecsact_system_execution_context_update", []() -> minst_import_resolve_func { return { - wasm_functype_new_3_0( + wasm_functype_new_4_0( wasm_valtype_new(WASM_I32), // context wasm_valtype_new(WASM_I32), // component_id - wasm_valtype_new(WASM_I32) // component_data + wasm_valtype_new(WASM_I32), // component_data + wasm_valtype_new(WASM_I32) // indexed_fields ), &wasm_ecsact_system_execution_context_update, }; @@ -74,9 +76,10 @@ const auto guest_env_module_imports = allowed_guest_imports_t{ "ecsact_system_execution_context_has", []() -> minst_import_resolve_func { return { - wasm_functype_new_2_0( + wasm_functype_new_3_0( wasm_valtype_new(WASM_I32), // context - wasm_valtype_new(WASM_I32) // component_id + wasm_valtype_new(WASM_I32), // component_id + wasm_valtype_new(WASM_I32) // indexed_fields ), &wasm_ecsact_system_execution_context_has, }; @@ -113,9 +116,10 @@ const auto guest_env_module_imports = allowed_guest_imports_t{ "ecsact_system_execution_context_remove", []() -> minst_import_resolve_func { return { - wasm_functype_new_2_0( + wasm_functype_new_3_0( wasm_valtype_new(WASM_I32), // context - wasm_valtype_new(WASM_I32) // component_id + wasm_valtype_new(WASM_I32), // component_id + wasm_valtype_new(WASM_I32) // indexed_fields ), &wasm_ecsact_system_execution_context_remove, }; diff --git a/ecsact/wasm/detail/wasi_fs.hh b/ecsact/wasm/detail/wasi_fs.hh index 50cfa58..69c0a4c 100644 --- a/ecsact/wasm/detail/wasi_fs.hh +++ b/ecsact/wasm/detail/wasi_fs.hh @@ -3,6 +3,7 @@ #include #include #include +#include #include "ecsact/wasm/detail/wasi.hh" namespace ecsact::wasm::detail::wasi::fs { diff --git a/ecsact/wasm/detail/wasm_ecsact_system_execution.cc b/ecsact/wasm/detail/wasm_ecsact_system_execution.cc index 482eadf..5c63bc6 100644 --- a/ecsact/wasm/detail/wasm_ecsact_system_execution.cc +++ b/ecsact/wasm/detail/wasm_ecsact_system_execution.cc @@ -111,9 +111,13 @@ wasm_trap_t* wasm_ecsact_system_execution_context_remove( ) { debug_trace_method("ecsact_system_execution_context_remove"); + auto ctx = get_execution_context(args->data[0]); + auto memory = get_execution_context_memory(args->data[0]); + ecsact_system_execution_context_remove( - get_execution_context(args->data[0]), - ecsact_id_from_wasm_i32(args->data[1]) + ctx, + ecsact_id_from_wasm_i32(args->data[1]), + get_void_ptr(args->data[2], memory) ); return nullptr; } @@ -130,7 +134,8 @@ wasm_trap_t* wasm_ecsact_system_execution_context_get( ecsact_system_execution_context_get( ctx, ecsact_id_from_wasm_i32(args->data[1]), - get_void_ptr(args->data[2], memory) + get_void_ptr(args->data[2], memory), + get_void_ptr(args->data[3], memory) ); return nullptr; @@ -148,7 +153,8 @@ wasm_trap_t* wasm_ecsact_system_execution_context_update( ecsact_system_execution_context_update( ctx, ecsact_id_from_wasm_i32(args->data[1]), - get_const_void_ptr(args->data[2], memory) + get_const_void_ptr(args->data[2], memory), + get_void_ptr(args->data[3], memory) ); return nullptr; @@ -160,9 +166,13 @@ wasm_trap_t* wasm_ecsact_system_execution_context_has( ) { debug_trace_method("ecsact_system_execution_context_has"); + auto ctx = get_execution_context(args->data[0]); + auto memory = get_execution_context_memory(args->data[0]); + bool has_component = ecsact_system_execution_context_has( - get_execution_context(args->data[0]), - ecsact_id_from_wasm_i32(args->data[1]) + ctx, + ecsact_id_from_wasm_i32(args->data[1]), + get_void_ptr(args->data[2], memory) ); results->data[0].kind = WASM_I32; diff --git a/test/.bazelrc b/test/.bazelrc index 7b7d578..a98f722 100644 --- a/test/.bazelrc +++ b/test/.bazelrc @@ -1,5 +1,8 @@ import %workspace%/../bazel/common.bazelrc +# emsdk needs 'py' in PATH +common:windows --action_env=PATH + common --@boost.dll//:use_std_fs common --@boost.process//:use_std_fs diff --git a/test/MODULE.bazel b/test/MODULE.bazel index 860f4ea..a78adaa 100644 --- a/test/MODULE.bazel +++ b/test/MODULE.bazel @@ -1,13 +1,13 @@ module(name = "ecsact_si_wasm_test") bazel_dep(name = "rules_cc", version = "0.0.9") -bazel_dep(name = "ecsact_runtime", version = "0.6.1") +bazel_dep(name = "ecsact_runtime", version = "0.7.0") bazel_dep(name = "rules_wasmer", version = "0.1.1") -bazel_dep(name = "ecsact_rt_entt", version = "0.3.1") -bazel_dep(name = "ecsact_lang_cpp", version = "0.4.1") -bazel_dep(name = "ecsact_interpret", version = "0.6.0") -bazel_dep(name = "ecsact_parse", version = "0.4.0") -bazel_dep(name = "ecsact_codegen", version = "0.2.0") +bazel_dep(name = "ecsact_rt_entt", version = "0.3.8") +bazel_dep(name = "ecsact_lang_cpp", version = "0.4.9") +bazel_dep(name = "ecsact_parse", version = "0.5.4") +bazel_dep(name = "ecsact_codegen", version = "0.4.3") +bazel_dep(name = "ecsact_interpret", version = "0.6.6") bazel_dep(name = "magic_enum", version = "0.9.3") bazel_dep(name = "boost.mp11", version = "1.83.0.bzl.1") bazel_dep(name = "boost.dll", version = "1.83.0.bzl.2")