From 81abd3cf182ba7779a708f2e418d84f87ecb7e9c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 17 May 2024 17:15:19 +0200 Subject: [PATCH 001/487] Improve cmake files of the cli plugins. --- source/cli/plugins/CMakeLists.txt | 36 ++++++++++++++++--- .../cli/plugins/cli_cmd_plugin/CMakeLists.txt | 14 -------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/source/cli/plugins/CMakeLists.txt b/source/cli/plugins/CMakeLists.txt index 8d9118445..85bf75fd9 100644 --- a/source/cli/plugins/CMakeLists.txt +++ b/source/cli/plugins/CMakeLists.txt @@ -3,11 +3,16 @@ if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_EXT OR NOT OPTION_BUILD_ return() endif() -# Extension sub-projects -add_subdirectory(cli_repl_plugin) -add_subdirectory(cli_cmd_plugin) -add_subdirectory(cli_core_plugin) -add_subdirectory(cli_sandbox_plugin) +# +# NodeJS Dependency +# + +find_package(NodeJS) + +if(NOT NodeJS_FOUND) + message(SEND_ERROR "NodeJS libraries not found") + return() +endif() # Generate output directories for CLI plugins execute_process( @@ -16,3 +21,24 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory "${PROJECT_OUTPUT_DIR}/plugins/cli/repl" COMMAND ${CMAKE_COMMAND} -E make_directory "${PROJECT_OUTPUT_DIR}/plugins/cli/cmd" ) + +# +# REPL Plugins +# + +add_subdirectory(cli_repl_plugin) +add_subdirectory(cli_core_plugin) + +# +# CMD Plugins +# + +# NodeJS added util.parseArgs([config]) in versions v18.3.0, v16.17.0 +# Check for compatibility, otherwise use fallback command parser in the CLI +if(NOT (NodeJS_VERSION VERSION_GREATER_EQUAL "18.3.0" OR (NodeJS_VERSION_MAJOR LESS 18 AND NodeJS_VERSION VERSION_GREATER_EQUAL "16.17.0"))) + message(WARNING "NodeJS version ${NodeJS_VERSION} does not support ${target}, at least v18.3.0 or v16.17.0 are required, using fallback command parser") + return() +endif() + +add_subdirectory(cli_cmd_plugin) +add_subdirectory(cli_sandbox_plugin) diff --git a/source/cli/plugins/cli_cmd_plugin/CMakeLists.txt b/source/cli/plugins/cli_cmd_plugin/CMakeLists.txt index 997a9ca39..5e929d896 100644 --- a/source/cli/plugins/cli_cmd_plugin/CMakeLists.txt +++ b/source/cli/plugins/cli_cmd_plugin/CMakeLists.txt @@ -3,13 +3,6 @@ if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_EXT OR NOT OPTION_BUILD_ return() endif() -find_package(NodeJS) - -if(NOT NodeJS_FOUND) - message(SEND_ERROR "NodeJS libraries not found") - return() -endif() - # # Plugin name and options # @@ -20,13 +13,6 @@ set(target cli_cmd_plugin) # Exit here if required dependencies are not met message(STATUS "Plugin ${target}") -# NodeJS added util.parseArgs([config]) in versions v18.3.0, v16.17.0 -# Check for compatibility, otherwise use fallback command parser in the CLI -if(NOT (NodeJS_VERSION VERSION_GREATER_EQUAL "18.3.0" OR (NodeJS_VERSION_MAJOR LESS 18 AND NodeJS_VERSION VERSION_GREATER_EQUAL "16.17.0"))) - message(WARNING "NodeJS version ${NodeJS_VERSION} does not support ${target}, at least v18.3.0 or v16.17.0 are required, using fallback command parser") - return() -endif() - # # Source # From 4768980f94582447847ef64e8b9caf85c35070ae Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 17 May 2024 17:15:32 +0200 Subject: [PATCH 002/487] Trying to solve macos issues. --- tools/metacall-environment.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 9c9a8611a..875bd0b8b 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -503,6 +503,8 @@ sub_nodejs(){ brew postinstall node@20 # Define node location NODE_PREFIX=$(brew --prefix node@20) + # Include binaries into PATH + export PATH="$NODE_PREFIX/bin:$PATH" # Configure NodeJS paths mkdir -p build From 6e09cc819f2380a8beec2bbe28b996c7a852e504 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 17 May 2024 17:21:20 +0200 Subject: [PATCH 003/487] First PoC for solving threading issues in node loader. --- .../node_loader/source/node_loader_impl.cpp | 157 ++++++++++++++---- source/tests/CMakeLists.txt | 1 + .../CMakeLists.txt | 147 ++++++++++++++++ .../source/main.cpp | 28 ++++ ...etacall_node_multithread_deadlock_test.cpp | 136 +++++++++++++++ 5 files changed, 436 insertions(+), 33 deletions(-) create mode 100644 source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt create mode 100644 source/tests/metacall_node_multithread_deadlock_test/source/main.cpp create mode 100644 source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index cba02cd78..a009a40ba 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -223,6 +223,7 @@ struct loader_impl_node_type loader_impl_async_initialize_safe initialize_safe; napi_threadsafe_function threadsafe_initialize; + /* TODO: Remove all napi_value and arguments from here -> */ napi_value execution_path_safe_ptr; loader_impl_async_execution_path_safe execution_path_safe; napi_threadsafe_function threadsafe_execution_path; @@ -243,8 +244,8 @@ struct loader_impl_node_type loader_impl_async_discover_safe discover_safe; napi_threadsafe_function threadsafe_discover; - napi_value func_call_safe_ptr; - loader_impl_async_func_call_safe func_call_safe; + // napi_value func_call_safe_ptr; + // loader_impl_async_func_call_safe func_call_safe; napi_threadsafe_function threadsafe_func_call; napi_value func_await_safe_ptr; @@ -266,10 +267,12 @@ struct loader_impl_node_type napi_value destroy_safe_ptr; loader_impl_async_destroy_safe destroy_safe; napi_threadsafe_function threadsafe_destroy; + /* TODO: -> To here*/ uv_thread_t thread; uv_loop_t *thread_loop; + /* TODO: Delete mutex and condition */ uv_mutex_t mutex; uv_cond_t cond; std::atomic_bool locked; @@ -372,6 +375,9 @@ struct loader_impl_async_func_call_safe_type size_t size; napi_value recv; function_return ret; + + uv_mutex_t mutex; + uv_cond_t cond; }; struct loader_impl_async_func_await_safe_type @@ -1360,6 +1366,35 @@ int function_node_interface_create(function func, function_impl impl) return (node_func->argv == NULL); } +/* TODO: Convert this into a templated lambda */ +void node_loader_impl_function_call_js_func_call_safe(napi_env env, napi_value js_callback, void *context, void *data) +{ + loader_impl_async_func_call_safe func_call_safe = static_cast(data); + + (void)js_callback; + (void)context; + + if (env != NULL && js_callback != NULL) + { + /* Lock the call safe mutex and get the parameters */ + uv_mutex_lock(&func_call_safe->mutex); + + /* Store environment for reentrant calls */ + func_call_safe->node_impl->env = env; + + /* Call to the implementation function */ + node_loader_impl_func_call_safe(env, func_call_safe); + + /* Clear environment */ + // func_call_cast.safe->node_impl->env = NULL; + + /* Signal function call condition */ + uv_cond_signal(&func_call_safe->cond); + + uv_mutex_unlock(&func_call_safe->mutex); + } +} + function_return function_node_interface_invoke(function func, function_impl impl, function_args args, size_t size) { loader_impl_node_function node_func = (loader_impl_node_function)impl; @@ -1367,31 +1402,52 @@ function_return function_node_interface_invoke(function func, function_impl impl if (node_func != NULL) { loader_impl_node node_impl = node_func->node_impl; - function_return ret = NULL; napi_status status; - /* Set up call safe arguments */ - node_impl->func_call_safe->node_impl = node_impl; - node_impl->func_call_safe->func = func; - node_impl->func_call_safe->node_func = node_func; - node_impl->func_call_safe->args = static_cast(args); - node_impl->func_call_safe->size = size; - node_impl->func_call_safe->recv = NULL; - node_impl->func_call_safe->ret = NULL; - /* Check if we are in the JavaScript thread */ if (node_impl->js_thread_id == std::this_thread::get_id()) { + loader_impl_async_func_call_safe_type func_call_safe; + + /* Set up call safe arguments */ + func_call_safe.node_impl = node_impl; + func_call_safe.func = func; + func_call_safe.node_func = node_func; + func_call_safe.args = static_cast(args); + func_call_safe.size = size; + func_call_safe.recv = NULL; + func_call_safe.ret = NULL; + /* We are already in the V8 thread, we can call safely */ - node_loader_impl_func_call_safe(node_impl->env, node_impl->func_call_safe); + node_loader_impl_func_call_safe(node_impl->env, &func_call_safe); /* Set up return of the function call */ - ret = node_impl->func_call_safe->ret; + return func_call_safe.ret; } + + /* TODO: Refactor this properly */ + /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) + // if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) { - node_impl->locked.store(true); + loader_impl_async_func_call_safe_type func_call_safe; + function_return ret = NULL; + + // node_impl->locked.store(true); + + /* Set up call safe arguments */ + func_call_safe.node_impl = node_impl; + func_call_safe.func = func; + func_call_safe.node_func = node_func; + func_call_safe.args = static_cast(args); + func_call_safe.size = size; + func_call_safe.recv = NULL; + func_call_safe.ret = NULL; + + uv_mutex_init(&func_call_safe.mutex); + uv_cond_init(&func_call_safe.cond); + + uv_mutex_lock(&func_call_safe.mutex); /* Acquire the thread safe function in order to do the call */ status = napi_acquire_threadsafe_function(node_impl->threadsafe_func_call); @@ -1402,13 +1458,24 @@ function_return function_node_interface_invoke(function func, function_impl impl } /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_func_call, nullptr, napi_tsfn_nonblocking); + status = napi_call_threadsafe_function(node_impl->threadsafe_func_call, &func_call_safe, napi_tsfn_nonblocking); if (status != napi_ok) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe function invoke function in NodeJS loader"); } + /* Wait for the execution of the safe call */ + uv_cond_wait(&func_call_safe.cond, &func_call_safe.mutex); + + /* Set up return of the function call */ + ret = func_call_safe.ret; + + // node_impl->locked.store(false); + + /* Unlock the mutex */ + uv_mutex_unlock(&func_call_safe.mutex); + /* Release call safe function */ status = napi_release_threadsafe_function(node_impl->threadsafe_func_call, napi_tsfn_release); @@ -1417,23 +1484,11 @@ function_return function_node_interface_invoke(function func, function_impl impl log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe function invoke function in NodeJS loader"); } - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); - - /* Set up return of the function call */ - ret = node_impl->func_call_safe->ret; - - node_impl->locked.store(false); + uv_mutex_destroy(&func_call_safe.mutex); + uv_cond_destroy(&func_call_safe.cond); - /* Unlock the mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in function_node_interface_invoke, the call has not been executed in order to avoid the deadlock"); + return ret; } - - return ret; } return NULL; @@ -3876,8 +3931,11 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi /* Safe function call */ { + /* TODO: Refactor this */ + static const char threadsafe_func_name_str[] = "node_loader_impl_async_func_call_safe"; + /* node_loader_impl_thread_safe_function_initialize( env, threadsafe_func_name_str, sizeof(threadsafe_func_name_str), @@ -3885,6 +3943,39 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi (loader_impl_async_func_call_safe_type **)(&node_impl->func_call_safe), &node_impl->func_call_safe_ptr, &node_impl->threadsafe_func_call); + */ + + /* + void node_loader_impl_thread_safe_function_initialize(napi_env env, + const char name[], size_t size, napi_value (*callback)(napi_env, napi_callback_info), T **data, + napi_value *ptr, napi_threadsafe_function *threadsafe_function) + */ + + napi_value func_call_safe_ptr; + + /* Initialize call safe function with context */ + status = napi_create_function(env, nullptr, 0, &node_loader_impl_async_func_call_safe, nullptr, &func_call_safe_ptr); + + node_loader_impl_exception(env, status); + + /* Create call safe function */ + napi_value threadsafe_func_name; + + status = napi_create_string_utf8(env, threadsafe_func_name_str, sizeof(threadsafe_func_name_str), &threadsafe_func_name); + + node_loader_impl_exception(env, status); + + // TODO: Does this number must be equivalent to the number of the threads of NodeJS? + unsigned int processor_count = std::thread::hardware_concurrency(); + + status = napi_create_threadsafe_function(env, func_call_safe_ptr, + nullptr, threadsafe_func_name, + 0, processor_count, + nullptr, nullptr, + nullptr, &node_loader_impl_function_call_js_func_call_safe, + &node_impl->threadsafe_func_call); + + node_loader_impl_exception(env, status); } /* Safe function await */ @@ -5389,7 +5480,7 @@ int node_loader_impl_destroy(loader_impl impl) delete node_impl->load_from_memory_safe; delete node_impl->clear_safe; delete node_impl->discover_safe; - delete node_impl->func_call_safe; + // delete node_impl->func_call_safe; delete node_impl->func_await_safe; delete node_impl->func_destroy_safe; delete node_impl->future_await_safe; diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index c35846272..9a1202a56 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -159,6 +159,7 @@ add_subdirectory(metacall_node_python_deadlock_test) # add_subdirectory(metacall_node_signal_handler_test) # Note: Not used anymore but leaving it here for reference to solve this: https://github.com/metacall/core/issues/121 add_subdirectory(metacall_node_native_code_test) add_subdirectory(metacall_node_extension_test) +add_subdirectory(metacall_node_multithread_deadlock_test) add_subdirectory(metacall_distributable_test) add_subdirectory(metacall_cast_test) add_subdirectory(metacall_init_fini_test) diff --git a/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt b/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt new file mode 100644 index 000000000..314015302 --- /dev/null +++ b/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt @@ -0,0 +1,147 @@ +# Check if this loader is enabled +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_NODE) + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-node-multithread-deadlock-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_node_multithread_deadlock_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::metacall +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Linker options +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $ +) + +# +# Define dependencies +# + +add_dependencies(${target} + node_loader +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} +) diff --git a/source/tests/metacall_node_multithread_deadlock_test/source/main.cpp b/source/tests/metacall_node_multithread_deadlock_test/source/main.cpp new file mode 100644 index 000000000..11ddf3f59 --- /dev/null +++ b/source/tests/metacall_node_multithread_deadlock_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp b/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp new file mode 100644 index 000000000..d1b33518e --- /dev/null +++ b/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp @@ -0,0 +1,136 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include +#include +#include + +#include +#include + +std::atomic success_callbacks{}; +static const int call_size = 200000; +static const int thread_size = 8; + +class metacall_node_multithread_deadlock_test : public testing::Test +{ +public: +}; + +void test_await(void) +{ + for (int i = 0; i < call_size; ++i) + { + void *future = metacall_await( + "f", + metacall_null_args, + [](void *result, void *data) -> void * { + EXPECT_NE((void *)NULL, (void *)result); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(result), (enum metacall_value_id)METACALL_DOUBLE); + + EXPECT_EQ((double)34.0, (double)metacall_value_to_double(result)); + + EXPECT_EQ((void *)NULL, (void *)data); + + ++success_callbacks; + + return metacall_value_create_double(15.0); + }, + [](void *, void *) -> void * { + int this_should_never_be_executed = 0; + + EXPECT_EQ((int)1, (int)this_should_never_be_executed); + + return NULL; + }, + NULL); + + EXPECT_NE((void *)NULL, (void *)future); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(future), (enum metacall_value_id)METACALL_FUTURE); + + metacall_value_destroy(future); + } +} + +void test_call(void) +{ + for (int i = 0; i < call_size; ++i) + { + void *result = metacallv_s("g", metacall_null_args, 0); + + EXPECT_NE((void *)NULL, (void *)result); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(result), (enum metacall_value_id)METACALL_DOUBLE); + + EXPECT_EQ((double)34.0, (double)metacall_value_to_double(result)); + + metacall_value_destroy(result); + + ++success_callbacks; + } +} + +TEST_F(metacall_node_multithread_deadlock_test, DefaultConstructor) +{ + metacall_print_info(); + + ASSERT_EQ((int)0, (int)metacall_initialize()); + +/* NodeJS */ +#if defined(OPTION_BUILD_LOADERS_NODE) + { + const char buffer[] = + "async function f() {\n" + "\treturn 34;\n" + "}\n" + "function g() {\n" + "\treturn 34;\n" + "}\n" + "module.exports = { f, g };\n"; + + EXPECT_EQ((int)0, (int)metacall_load_from_memory("node", buffer, sizeof(buffer), NULL)); + + std::thread threads[thread_size]; + + for (int i = 0; i < thread_size; ++i) + { + threads[i] = std::thread(test_call); + } + + for (int i = 0; i < thread_size; ++i) + { + threads[i].join(); + } + } +#endif /* OPTION_BUILD_LOADERS_NODE */ + + EXPECT_EQ((int)0, (int)metacall_destroy()); + +/* NodeJS */ +#if defined(OPTION_BUILD_LOADERS_NODE) + { + EXPECT_EQ((int)success_callbacks, (int)(call_size * thread_size)); + } +#endif /* OPTION_BUILD_LOADERS_NODE */ +} From 4773372afc38240f817c588d48eb8a89cf56f494 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 21 May 2024 18:55:28 +0200 Subject: [PATCH 004/487] Improve style, simplified a lot of things in node_loader. --- .../node_loader/source/node_loader_impl.cpp | 569 ++++++++++-------- 1 file changed, 322 insertions(+), 247 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index a009a40ba..2beb77180 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -212,109 +212,209 @@ union loader_impl_handle_safe_cast uv_handle_t *handle; }; -struct loader_impl_node_type +typedef struct loader_impl_node_function_type { - /* TODO: The current implementation may not support multi-isolate environments. We should test it. */ - napi_env env; /* Used for storing environment for reentrant calls */ - napi_ref global_ref; /* Store global reference */ - napi_ref function_table_object_ref; /* Store function table reference registered by the trampoline */ + loader_impl_node node_impl; + loader_impl impl; + napi_ref func_ref; + napi_value *argv; - napi_value initialize_safe_ptr; - loader_impl_async_initialize_safe initialize_safe; - napi_threadsafe_function threadsafe_initialize; +} * loader_impl_node_function; - /* TODO: Remove all napi_value and arguments from here -> */ - napi_value execution_path_safe_ptr; - loader_impl_async_execution_path_safe execution_path_safe; - napi_threadsafe_function threadsafe_execution_path; +typedef struct loader_impl_node_future_type +{ + loader_impl_node node_impl; + napi_ref promise_ref; - napi_value load_from_file_safe_ptr; - loader_impl_async_load_from_file_safe load_from_file_safe; - napi_threadsafe_function threadsafe_load_from_file; +} * loader_impl_node_future; - napi_value load_from_memory_safe_ptr; - loader_impl_async_load_from_memory_safe load_from_memory_safe; - napi_threadsafe_function threadsafe_load_from_memory; +template +struct loader_impl_async_safe_type +{ + uv_mutex_t mutex; + uv_cond_t cond; + T &args; - napi_value clear_safe_ptr; - loader_impl_async_clear_safe clear_safe; - napi_threadsafe_function threadsafe_clear; + loader_impl_async_safe_type(T &args) : + args(args) + { + uv_mutex_init(&mutex); + uv_cond_init(&cond); + } - napi_value discover_safe_ptr; - loader_impl_async_discover_safe discover_safe; - napi_threadsafe_function threadsafe_discover; + ~loader_impl_async_safe_type() + { + uv_mutex_destroy(&mutex); + uv_cond_destroy(&cond); + } - // napi_value func_call_safe_ptr; - // loader_impl_async_func_call_safe func_call_safe; - napi_threadsafe_function threadsafe_func_call; + void lock() + { + uv_mutex_lock(&mutex); + } - napi_value func_await_safe_ptr; - loader_impl_async_func_await_safe func_await_safe; - napi_threadsafe_function threadsafe_func_await; + void unlock() + { + uv_mutex_unlock(&mutex); + } - napi_value func_destroy_safe_ptr; - loader_impl_async_func_destroy_safe func_destroy_safe; - napi_threadsafe_function threadsafe_func_destroy; + void wait() + { + uv_cond_wait(&cond, &mutex); + } - napi_value future_await_safe_ptr; - loader_impl_async_future_await_safe future_await_safe; - napi_threadsafe_function threadsafe_future_await; + void notify() + { + uv_cond_signal(&cond); + } +}; - napi_value future_delete_safe_ptr; - loader_impl_async_future_delete_safe future_delete_safe; - napi_threadsafe_function threadsafe_future_delete; +template +struct loader_impl_async_safe_notify_type +{ + loader_impl_async_safe_type *async_safe; - napi_value destroy_safe_ptr; - loader_impl_async_destroy_safe destroy_safe; - napi_threadsafe_function threadsafe_destroy; - /* TODO: -> To here*/ + loader_impl_async_safe_notify_type(loader_impl_async_safe_type *async_safe) : + async_safe(async_safe) + { + async_safe->lock(); + } - uv_thread_t thread; - uv_loop_t *thread_loop; + ~loader_impl_async_safe_notify_type() + { + async_safe->notify(); + async_safe->unlock(); + } +}; - /* TODO: Delete mutex and condition */ - uv_mutex_t mutex; - uv_cond_t cond; - std::atomic_bool locked; +template +union node_loader_impl_func_call_js_safe_cast +{ + void (*func_ptr)(napi_env, T *); + void *context; - int stdin_copy; - int stdout_copy; - int stderr_copy; + node_loader_impl_func_call_js_safe_cast(void *context) : + context(context) {} + node_loader_impl_func_call_js_safe_cast(void (*func_ptr)(napi_env, T *)) : + func_ptr(func_ptr) {} +}; -#ifdef __ANDROID__ - int pfd[2]; - uv_thread_t thread_log_id; -#endif +template +void node_loader_impl_func_call_js_safe(napi_env env, napi_value js_callback, void *context, void *data) +{ + (void)js_callback; - int result; - const char *error_message; + if (env == NULL || js_callback == NULL || context == NULL || data == NULL) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid arguments passed to js thread safe function"); + } - /* TODO: This implementation won't work for multi-isolate environments. We should test it. */ - std::thread::id js_thread_id; + loader_impl_async_safe_type *async_safe = static_cast *>(data); + node_loader_impl_func_call_js_safe_cast safe_cast(context); + loader_impl_async_safe_notify_type notify(async_safe); - int64_t base_active_handles; - std::atomic_int64_t extra_active_handles; - uv_prepare_t destroy_prepare; - uv_check_t destroy_check; - std::atomic_bool event_loop_empty; - loader_impl impl; -}; + /* Store environment for reentrant calls */ + async_safe->args.node_impl->env = env; -typedef struct loader_impl_node_function_type -{ - loader_impl_node node_impl; - loader_impl impl; - napi_ref func_ref; - napi_value *argv; + /* Call to the implementation function */ + safe_cast.func_ptr(env, &async_safe->args); -} * loader_impl_node_function; + /* Clear environment */ + // async_safe->args->node_impl->env = NULL; +} -typedef struct loader_impl_node_future_type +static napi_value node_loader_impl_async_threadsafe_empty(napi_env, napi_callback_info) { - loader_impl_node node_impl; - napi_ref promise_ref; + /* This is a dirty hack in order to make the threadsafe API work properly, + * as soon as possible it will be good to return to the old method we used in NodeJS 8, + * it was better than this API + */ + return nullptr; +} -} * loader_impl_node_future; +template +struct loader_impl_threadsafe_type +{ + napi_threadsafe_function threadsafe_function; + + void initialize(napi_env env, std::string name, void (*safe_func_ptr)(napi_env, T *)) + { + napi_value func_safe_ptr; + + /* Initialize safe function with context */ + napi_status status = napi_create_function(env, nullptr, 0, &node_loader_impl_async_threadsafe_empty, nullptr, &func_safe_ptr); + + node_loader_impl_exception(env, status); + + /* Create safe function */ + napi_value threadsafe_func_name; + + status = napi_create_string_utf8(env, name.c_str(), name.length(), &threadsafe_func_name); + + node_loader_impl_exception(env, status); + + /* Use the amoun of available threads as initial thread count */ + unsigned int processor_count = std::thread::hardware_concurrency(); + + /* Cast the safe function */ + node_loader_impl_func_call_js_safe_cast safe_cast(safe_func_ptr); + + status = napi_create_threadsafe_function(env, func_safe_ptr, + nullptr, threadsafe_func_name, + 0, processor_count, + nullptr, nullptr, + safe_cast.context, &node_loader_impl_func_call_js_safe, + &threadsafe_function); + + node_loader_impl_exception(env, status); + } + + void invoke(loader_impl_async_safe_type &async_safe) + { + /* Lock the mutex */ + async_safe.lock(); + + /* Acquire the thread safe function in order to do the call */ + napi_status status = napi_acquire_threadsafe_function(threadsafe_function); + + if (status != napi_ok) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe function invoke function in NodeJS loader"); + } + + /* Execute the thread safe call in a nonblocking manner */ + status = napi_call_threadsafe_function(threadsafe_function, &async_safe, napi_tsfn_nonblocking); + + if (status != napi_ok) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe function invoke function in NodeJS loader"); + } + + /* Wait for the execution of the safe call */ + async_safe.wait(); + } + + void release(loader_impl_async_safe_type &async_safe) + { + /* Unlock the mutex */ + async_safe.unlock(); + + /* Release call safe function */ + napi_status status = napi_release_threadsafe_function(threadsafe_function, napi_tsfn_release); + + if (status != napi_ok) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe function invoke function in NodeJS loader"); + } + } + + void abort(napi_env env) + { + napi_status status = napi_release_threadsafe_function(threadsafe_function, napi_tsfn_abort); + + node_loader_impl_exception(env, status); + } +}; struct loader_impl_async_initialize_safe_type { @@ -376,8 +476,12 @@ struct loader_impl_async_func_call_safe_type napi_value recv; function_return ret; - uv_mutex_t mutex; - uv_cond_t cond; + loader_impl_async_func_call_safe_type(loader_impl_node node_impl, function func, loader_impl_node_function node_func, function_args args, size_t size) : + node_impl(node_impl), func(func), node_func(node_func), args(static_cast(args)), size(size), recv(NULL), ret(NULL) + { + } + + ~loader_impl_async_func_call_safe_type() {} }; struct loader_impl_async_func_await_safe_type @@ -406,6 +510,95 @@ struct loader_impl_async_future_await_safe_type future_return ret; }; +struct loader_impl_node_type +{ + /* TODO: The current implementation may not support multi-isolate environments. We should test it. */ + napi_env env; /* Used for storing environment for reentrant calls */ + napi_ref global_ref; /* Store global reference */ + napi_ref function_table_object_ref; /* Store function table reference registered by the trampoline */ + + /* TODO: Remove all napi_value and arguments from here -> */ + napi_value initialize_safe_ptr; + loader_impl_async_initialize_safe initialize_safe; + napi_threadsafe_function threadsafe_initialize; + + napi_value execution_path_safe_ptr; + loader_impl_async_execution_path_safe execution_path_safe; + napi_threadsafe_function threadsafe_execution_path; + + napi_value load_from_file_safe_ptr; + loader_impl_async_load_from_file_safe load_from_file_safe; + napi_threadsafe_function threadsafe_load_from_file; + + napi_value load_from_memory_safe_ptr; + loader_impl_async_load_from_memory_safe load_from_memory_safe; + napi_threadsafe_function threadsafe_load_from_memory; + + napi_value clear_safe_ptr; + loader_impl_async_clear_safe clear_safe; + napi_threadsafe_function threadsafe_clear; + + napi_value discover_safe_ptr; + loader_impl_async_discover_safe discover_safe; + napi_threadsafe_function threadsafe_discover; + + // napi_value func_call_safe_ptr; + // loader_impl_async_func_call_safe func_call_safe; + // napi_threadsafe_function threadsafe_func_call; + loader_impl_threadsafe_type threadsafe_func_call; + + napi_value func_await_safe_ptr; + loader_impl_async_func_await_safe func_await_safe; + napi_threadsafe_function threadsafe_func_await; + + napi_value func_destroy_safe_ptr; + loader_impl_async_func_destroy_safe func_destroy_safe; + napi_threadsafe_function threadsafe_func_destroy; + + napi_value future_await_safe_ptr; + loader_impl_async_future_await_safe future_await_safe; + napi_threadsafe_function threadsafe_future_await; + + napi_value future_delete_safe_ptr; + loader_impl_async_future_delete_safe future_delete_safe; + napi_threadsafe_function threadsafe_future_delete; + + napi_value destroy_safe_ptr; + loader_impl_async_destroy_safe destroy_safe; + napi_threadsafe_function threadsafe_destroy; + /* TODO: -> To here*/ + + uv_thread_t thread; + uv_loop_t *thread_loop; + + /* TODO: Delete mutex and condition */ + uv_mutex_t mutex; + uv_cond_t cond; + std::atomic_bool locked; + + int stdin_copy; + int stdout_copy; + int stderr_copy; + +#ifdef __ANDROID__ + int pfd[2]; + uv_thread_t thread_log_id; +#endif + + int result; + const char *error_message; + + /* TODO: This implementation won't work for multi-isolate environments. We should test it. */ + std::thread::id js_thread_id; + + int64_t base_active_handles; + std::atomic_int64_t extra_active_handles; + uv_prepare_t destroy_prepare; + uv_check_t destroy_check; + std::atomic_bool event_loop_empty; + loader_impl impl; +}; + typedef napi_value (*function_resolve_trampoline)(loader_impl_node, napi_env, function_resolve_callback, napi_value, napi_value, void *); typedef napi_value (*function_reject_trampoline)(loader_impl_node, napi_env, function_reject_callback, napi_value, napi_value, void *); @@ -486,8 +679,6 @@ static napi_value node_loader_impl_async_execution_path_safe(napi_env env, napi_ static void node_loader_impl_func_call_safe(napi_env env, loader_impl_async_func_call_safe func_call_safe); -static napi_value node_loader_impl_async_func_call_safe(napi_env env, napi_callback_info info); - static void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await_safe func_await_safe); static napi_value node_loader_impl_async_func_await_safe(napi_env env, napi_callback_info info); @@ -1366,132 +1557,49 @@ int function_node_interface_create(function func, function_impl impl) return (node_func->argv == NULL); } -/* TODO: Convert this into a templated lambda */ -void node_loader_impl_function_call_js_func_call_safe(napi_env env, napi_value js_callback, void *context, void *data) +template +struct loader_impl_threadsafe_invoke_type { - loader_impl_async_func_call_safe func_call_safe = static_cast(data); + loader_impl_threadsafe_type &threadsafe_func; + loader_impl_async_safe_type async_safe; - (void)js_callback; - (void)context; - - if (env != NULL && js_callback != NULL) + loader_impl_threadsafe_invoke_type(loader_impl_threadsafe_type &threadsafe_func, T &func_safe) : + threadsafe_func(threadsafe_func), async_safe(func_safe) { - /* Lock the call safe mutex and get the parameters */ - uv_mutex_lock(&func_call_safe->mutex); - - /* Store environment for reentrant calls */ - func_call_safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_func_call_safe(env, func_call_safe); - - /* Clear environment */ - // func_call_cast.safe->node_impl->env = NULL; - - /* Signal function call condition */ - uv_cond_signal(&func_call_safe->cond); + threadsafe_func.invoke(async_safe); + } - uv_mutex_unlock(&func_call_safe->mutex); + ~loader_impl_threadsafe_invoke_type() + { + threadsafe_func.release(async_safe); } -} +}; function_return function_node_interface_invoke(function func, function_impl impl, function_args args, size_t size) { - loader_impl_node_function node_func = (loader_impl_node_function)impl; + loader_impl_node_function node_func = static_cast(impl); - if (node_func != NULL) + if (node_func == NULL) { - loader_impl_node node_impl = node_func->node_impl; - napi_status status; - - /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) - { - loader_impl_async_func_call_safe_type func_call_safe; - - /* Set up call safe arguments */ - func_call_safe.node_impl = node_impl; - func_call_safe.func = func; - func_call_safe.node_func = node_func; - func_call_safe.args = static_cast(args); - func_call_safe.size = size; - func_call_safe.recv = NULL; - func_call_safe.ret = NULL; - - /* We are already in the V8 thread, we can call safely */ - node_loader_impl_func_call_safe(node_impl->env, &func_call_safe); - - /* Set up return of the function call */ - return func_call_safe.ret; - } - - /* TODO: Refactor this properly */ - - /* Lock the mutex and set the parameters */ - // if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - loader_impl_async_func_call_safe_type func_call_safe; - function_return ret = NULL; - - // node_impl->locked.store(true); - - /* Set up call safe arguments */ - func_call_safe.node_impl = node_impl; - func_call_safe.func = func; - func_call_safe.node_func = node_func; - func_call_safe.args = static_cast(args); - func_call_safe.size = size; - func_call_safe.recv = NULL; - func_call_safe.ret = NULL; - - uv_mutex_init(&func_call_safe.mutex); - uv_cond_init(&func_call_safe.cond); - - uv_mutex_lock(&func_call_safe.mutex); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_func_call); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe function invoke function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_func_call, &func_call_safe, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe function invoke function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&func_call_safe.cond, &func_call_safe.mutex); - - /* Set up return of the function call */ - ret = func_call_safe.ret; - - // node_impl->locked.store(false); - - /* Unlock the mutex */ - uv_mutex_unlock(&func_call_safe.mutex); - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_func_call, napi_tsfn_release); + return NULL; + } - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe function invoke function in NodeJS loader"); - } + loader_impl_node node_impl = node_func->node_impl; + loader_impl_async_func_call_safe_type func_call_safe(node_impl, func, node_func, args, size); - uv_mutex_destroy(&func_call_safe.mutex); - uv_cond_destroy(&func_call_safe.cond); + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_func_call_safe(node_impl->env, &func_call_safe); - return ret; - } + return func_call_safe.ret; } - return NULL; + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_func_call, func_call_safe); + + return func_call_safe.ret; } function_return function_node_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context) @@ -2098,39 +2206,6 @@ void node_loader_impl_func_call_safe(napi_env env, loader_impl_async_func_call_s } } -napi_value node_loader_impl_async_func_call_safe(napi_env env, napi_callback_info info) -{ - loader_impl_async_safe_cast func_call_cast = { NULL }; - napi_status status; - napi_value recv; - - status = napi_get_cb_info(env, info, nullptr, nullptr, &recv, &func_call_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock the call safe mutex and get the parameters */ - uv_mutex_lock(&func_call_cast.safe->node_impl->mutex); - - /* Store function recv for reentrant calls */ - func_call_cast.safe->recv = recv; - - /* Store environment for reentrant calls */ - func_call_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_func_call_safe(env, func_call_cast.safe); - - /* Clear environment */ - // func_call_cast.safe->node_impl->env = NULL; - - /* Signal function call condition */ - uv_cond_signal(&func_call_cast.safe->node_impl->cond); - - uv_mutex_unlock(&func_call_cast.safe->node_impl->mutex); - - return nullptr; -} - void node_loader_impl_async_func_await_finalize(napi_env, void *finalize_data, void *) { loader_impl_async_func_await_trampoline trampoline = static_cast(finalize_data); @@ -3933,7 +4008,7 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi { /* TODO: Refactor this */ - static const char threadsafe_func_name_str[] = "node_loader_impl_async_func_call_safe"; + // static const char threadsafe_func_name_str[] = "node_loader_impl_async_func_call_safe"; /* node_loader_impl_thread_safe_function_initialize( @@ -3951,31 +4026,33 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi napi_value *ptr, napi_threadsafe_function *threadsafe_function) */ - napi_value func_call_safe_ptr; + // napi_value func_call_safe_ptr; - /* Initialize call safe function with context */ - status = napi_create_function(env, nullptr, 0, &node_loader_impl_async_func_call_safe, nullptr, &func_call_safe_ptr); + // /* Initialize call safe function with context */ + // status = napi_create_function(env, nullptr, 0, &node_loader_impl_async_threadsafe_empty, nullptr, &func_call_safe_ptr); - node_loader_impl_exception(env, status); + // node_loader_impl_exception(env, status); - /* Create call safe function */ - napi_value threadsafe_func_name; + // /* Create call safe function */ + // napi_value threadsafe_func_name; - status = napi_create_string_utf8(env, threadsafe_func_name_str, sizeof(threadsafe_func_name_str), &threadsafe_func_name); + // status = napi_create_string_utf8(env, threadsafe_func_name_str, sizeof(threadsafe_func_name_str), &threadsafe_func_name); - node_loader_impl_exception(env, status); + // node_loader_impl_exception(env, status); - // TODO: Does this number must be equivalent to the number of the threads of NodeJS? - unsigned int processor_count = std::thread::hardware_concurrency(); + // // TODO: Does this number must be equivalent to the number of the threads of NodeJS? + // unsigned int processor_count = std::thread::hardware_concurrency(); - status = napi_create_threadsafe_function(env, func_call_safe_ptr, - nullptr, threadsafe_func_name, - 0, processor_count, - nullptr, nullptr, - nullptr, &node_loader_impl_function_call_js_func_call_safe, - &node_impl->threadsafe_func_call); + // status = napi_create_threadsafe_function(env, func_call_safe_ptr, + // nullptr, threadsafe_func_name, + // 0, processor_count, + // nullptr, nullptr, + // nullptr, &node_loader_impl_function_call_js_func_call_safe, + // &node_impl->threadsafe_func_call); - node_loader_impl_exception(env, status); + // node_loader_impl_exception(env, status); + + node_impl->threadsafe_func_call.initialize(env, "node_loader_impl_async_func_call_safe", &node_loader_impl_func_call_safe); } /* Safe function await */ @@ -5277,9 +5354,7 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env /* Safe function call */ { - status = napi_release_threadsafe_function(node_impl->threadsafe_func_call, napi_tsfn_abort); - - node_loader_impl_exception(env, status); + node_impl->threadsafe_func_call.abort(env); } /* Safe function await */ From 37f08e1f03c0991370954f8862164620de066ccd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 22 May 2024 01:16:10 +0200 Subject: [PATCH 005/487] Refactor completely node loader. --- .../node_loader/source/node_loader_impl.cpp | 1960 ++++------------- .../node_loader/source/node_loader_port.cpp | 227 +- 2 files changed, 499 insertions(+), 1688 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 2beb77180..2941b1800 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -159,45 +159,6 @@ extern bool linux_at_secure; #error "NodeJS version not supported" #endif -struct loader_impl_async_initialize_safe_type; -typedef struct loader_impl_async_initialize_safe_type *loader_impl_async_initialize_safe; - -struct loader_impl_async_execution_path_safe_type; -typedef struct loader_impl_async_execution_path_safe_type *loader_impl_async_execution_path_safe; - -struct loader_impl_async_load_from_file_safe_type; -typedef struct loader_impl_async_load_from_file_safe_type *loader_impl_async_load_from_file_safe; - -struct loader_impl_async_load_from_memory_safe_type; -typedef struct loader_impl_async_load_from_memory_safe_type *loader_impl_async_load_from_memory_safe; - -struct loader_impl_async_clear_safe_type; -typedef struct loader_impl_async_clear_safe_type *loader_impl_async_clear_safe; - -struct loader_impl_async_discover_function_safe_type; -typedef struct loader_impl_async_discover_function_safe_type *loader_impl_async_discover_function_safe; - -struct loader_impl_async_discover_safe_type; -typedef struct loader_impl_async_discover_safe_type *loader_impl_async_discover_safe; - -struct loader_impl_async_func_call_safe_type; -typedef struct loader_impl_async_func_call_safe_type *loader_impl_async_func_call_safe; - -struct loader_impl_async_func_await_safe_type; -typedef struct loader_impl_async_func_await_safe_type *loader_impl_async_func_await_safe; - -struct loader_impl_async_func_destroy_safe_type; -typedef struct loader_impl_async_func_destroy_safe_type *loader_impl_async_func_destroy_safe; - -struct loader_impl_async_future_await_safe_type; -typedef struct loader_impl_async_future_await_safe_type *loader_impl_async_future_await_safe; - -struct loader_impl_async_future_delete_safe_type; -typedef struct loader_impl_async_future_delete_safe_type *loader_impl_async_future_delete_safe; - -struct loader_impl_async_destroy_safe_type; -typedef struct loader_impl_async_destroy_safe_type *loader_impl_async_destroy_safe; - template union loader_impl_async_safe_cast { @@ -304,7 +265,7 @@ void node_loader_impl_func_call_js_safe(napi_env env, napi_value js_callback, vo { (void)js_callback; - if (env == NULL || js_callback == NULL || context == NULL || data == NULL) + if (env == nullptr || js_callback == nullptr || context == nullptr || data == nullptr) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid arguments passed to js thread safe function"); } @@ -320,7 +281,7 @@ void node_loader_impl_func_call_js_safe(napi_env env, napi_value js_callback, vo safe_cast.func_ptr(env, &async_safe->args); /* Clear environment */ - // async_safe->args->node_impl->env = NULL; + // async_safe->args->node_impl->env = nullptr; } static napi_value node_loader_impl_async_threadsafe_empty(napi_env, napi_callback_info) @@ -421,12 +382,18 @@ struct loader_impl_async_initialize_safe_type loader_impl_node node_impl; char *loader_library_path; int result; + + loader_impl_async_initialize_safe_type(loader_impl_node node_impl, char *loader_library_path) : + node_impl(node_impl), loader_library_path(loader_library_path), result(0) {} }; struct loader_impl_async_execution_path_safe_type { loader_impl_node node_impl; - char *path; + const char *path; + + loader_impl_async_execution_path_safe_type(loader_impl_node node_impl, const char *path) : + node_impl(node_impl), path(path) {} }; struct loader_impl_async_load_from_file_safe_type @@ -435,6 +402,9 @@ struct loader_impl_async_load_from_file_safe_type const loader_path *paths; size_t size; napi_ref handle_ref; + + loader_impl_async_load_from_file_safe_type(loader_impl_node node_impl, const loader_path *paths, size_t size) : + node_impl(node_impl), paths(paths), size(size), handle_ref(nullptr) {} }; struct loader_impl_async_load_from_memory_safe_type @@ -444,18 +414,27 @@ struct loader_impl_async_load_from_memory_safe_type const char *buffer; size_t size; napi_ref handle_ref; + + loader_impl_async_load_from_memory_safe_type(loader_impl_node node_impl, const char *name, const char *buffer, size_t size) : + node_impl(node_impl), name(name), buffer(buffer), size(size), handle_ref(nullptr) {} }; struct loader_impl_async_clear_safe_type { loader_impl_node node_impl; napi_ref handle_ref; + + loader_impl_async_clear_safe_type(loader_impl_node node_impl, napi_ref handle_ref) : + node_impl(node_impl), handle_ref(handle_ref) {} }; struct loader_impl_async_discover_function_safe_type { loader_impl_node node_impl; napi_value func; + + loader_impl_async_discover_function_safe_type(loader_impl_node node_impl, napi_value func) : + node_impl(node_impl), func(func) {} }; struct loader_impl_async_discover_safe_type @@ -464,6 +443,9 @@ struct loader_impl_async_discover_safe_type napi_ref handle_ref; context ctx; int result; + + loader_impl_async_discover_safe_type(loader_impl_node node_impl, napi_ref handle_ref, context ctx) : + node_impl(node_impl), handle_ref(handle_ref), ctx(ctx), result(0) {} }; struct loader_impl_async_func_call_safe_type @@ -477,11 +459,7 @@ struct loader_impl_async_func_call_safe_type function_return ret; loader_impl_async_func_call_safe_type(loader_impl_node node_impl, function func, loader_impl_node_function node_func, function_args args, size_t size) : - node_impl(node_impl), func(func), node_func(node_func), args(static_cast(args)), size(size), recv(NULL), ret(NULL) - { - } - - ~loader_impl_async_func_call_safe_type() {} + node_impl(node_impl), func(func), node_func(node_func), args(static_cast(args)), size(size), recv(nullptr), ret(NULL) {} }; struct loader_impl_async_func_await_safe_type @@ -496,6 +474,9 @@ struct loader_impl_async_func_await_safe_type void *context; napi_value recv; function_return ret; + + loader_impl_async_func_await_safe_type(loader_impl_node node_impl, function func, loader_impl_node_function node_func, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context) : + node_impl(node_impl), func(func), node_func(node_func), args(static_cast(args)), size(size), resolve_callback(resolve_callback), reject_callback(reject_callback), context(context), recv(nullptr), ret(NULL) {} }; struct loader_impl_async_future_await_safe_type @@ -508,73 +489,64 @@ struct loader_impl_async_future_await_safe_type void *context; napi_value recv; future_return ret; + + loader_impl_async_future_await_safe_type(loader_impl_node node_impl, future f, loader_impl_node_future node_future, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context) : + node_impl(node_impl), f(f), node_future(node_future), resolve_callback(resolve_callback), reject_callback(reject_callback), context(context), recv(nullptr), ret(NULL) {} }; -struct loader_impl_node_type +struct loader_impl_async_func_destroy_safe_type { - /* TODO: The current implementation may not support multi-isolate environments. We should test it. */ - napi_env env; /* Used for storing environment for reentrant calls */ - napi_ref global_ref; /* Store global reference */ - napi_ref function_table_object_ref; /* Store function table reference registered by the trampoline */ + loader_impl_node node_impl; + loader_impl_node_function node_func; - /* TODO: Remove all napi_value and arguments from here -> */ - napi_value initialize_safe_ptr; - loader_impl_async_initialize_safe initialize_safe; - napi_threadsafe_function threadsafe_initialize; + loader_impl_async_func_destroy_safe_type(loader_impl_node node_impl, loader_impl_node_function node_func) : + node_impl(node_impl), node_func(node_func) {} +}; - napi_value execution_path_safe_ptr; - loader_impl_async_execution_path_safe execution_path_safe; - napi_threadsafe_function threadsafe_execution_path; +struct loader_impl_async_future_delete_safe_type +{ + loader_impl_node node_impl; + future f; + loader_impl_node_future node_future; - napi_value load_from_file_safe_ptr; - loader_impl_async_load_from_file_safe load_from_file_safe; - napi_threadsafe_function threadsafe_load_from_file; + loader_impl_async_future_delete_safe_type(loader_impl_node node_impl, future f, loader_impl_node_future node_future) : + node_impl(node_impl), f(f), node_future(node_future) {} +}; - napi_value load_from_memory_safe_ptr; - loader_impl_async_load_from_memory_safe load_from_memory_safe; - napi_threadsafe_function threadsafe_load_from_memory; +struct loader_impl_async_destroy_safe_type +{ + loader_impl_node node_impl; + bool has_finished; - napi_value clear_safe_ptr; - loader_impl_async_clear_safe clear_safe; - napi_threadsafe_function threadsafe_clear; + loader_impl_async_destroy_safe_type(loader_impl_node node_impl) : + node_impl(node_impl), has_finished(false) {} +}; - napi_value discover_safe_ptr; - loader_impl_async_discover_safe discover_safe; - napi_threadsafe_function threadsafe_discover; +struct loader_impl_node_type +{ + /* TODO: The current implementation may not support multi-isolate environments. We should test it. */ + napi_env env; /* Used for storing environment for reentrant calls */ + napi_ref global_ref; /* Store global reference */ + napi_ref function_table_object_ref; /* Store function table reference registered by the trampoline */ - // napi_value func_call_safe_ptr; - // loader_impl_async_func_call_safe func_call_safe; - // napi_threadsafe_function threadsafe_func_call; + loader_impl_threadsafe_type threadsafe_initialize; + loader_impl_threadsafe_type threadsafe_execution_path; + loader_impl_threadsafe_type threadsafe_load_from_file; + loader_impl_threadsafe_type threadsafe_load_from_memory; + loader_impl_threadsafe_type threadsafe_clear; + loader_impl_threadsafe_type threadsafe_discover; loader_impl_threadsafe_type threadsafe_func_call; - - napi_value func_await_safe_ptr; - loader_impl_async_func_await_safe func_await_safe; - napi_threadsafe_function threadsafe_func_await; - - napi_value func_destroy_safe_ptr; - loader_impl_async_func_destroy_safe func_destroy_safe; - napi_threadsafe_function threadsafe_func_destroy; - - napi_value future_await_safe_ptr; - loader_impl_async_future_await_safe future_await_safe; - napi_threadsafe_function threadsafe_future_await; - - napi_value future_delete_safe_ptr; - loader_impl_async_future_delete_safe future_delete_safe; - napi_threadsafe_function threadsafe_future_delete; - - napi_value destroy_safe_ptr; - loader_impl_async_destroy_safe destroy_safe; - napi_threadsafe_function threadsafe_destroy; - /* TODO: -> To here*/ + loader_impl_threadsafe_type threadsafe_func_await; + loader_impl_threadsafe_type threadsafe_func_destroy; + loader_impl_threadsafe_type threadsafe_future_await; + loader_impl_threadsafe_type threadsafe_future_delete; + loader_impl_threadsafe_type threadsafe_destroy; uv_thread_t thread; uv_loop_t *thread_loop; - /* TODO: Delete mutex and condition */ uv_mutex_t mutex; uv_cond_t cond; - std::atomic_bool locked; int stdin_copy; int stdout_copy; @@ -613,24 +585,6 @@ typedef struct loader_impl_async_func_await_trampoline_type } * loader_impl_async_func_await_trampoline; -struct loader_impl_async_func_destroy_safe_type -{ - loader_impl_node node_impl; - loader_impl_node_function node_func; -}; - -struct loader_impl_async_future_delete_safe_type -{ - loader_impl_node node_impl; - future f; - loader_impl_node_future node_future; -}; - -struct loader_impl_async_destroy_safe_type -{ - loader_impl_node node_impl; -}; - typedef struct loader_impl_thread_type { loader_impl_node node_impl; @@ -669,53 +623,31 @@ static void future_node_interface_destroy(future f, future_impl impl); static future_interface future_node_singleton(void); /* JavaScript Thread Safe */ -static void node_loader_impl_initialize_safe(napi_env env, loader_impl_async_initialize_safe initialize_safe); - -static napi_value node_loader_impl_async_initialize_safe(napi_env env, napi_callback_info info); - -static void node_loader_impl_execution_path_safe(napi_env env, loader_impl_async_execution_path_safe execution_path_safe); - -static napi_value node_loader_impl_async_execution_path_safe(napi_env env, napi_callback_info info); - -static void node_loader_impl_func_call_safe(napi_env env, loader_impl_async_func_call_safe func_call_safe); - -static void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await_safe func_await_safe); - -static napi_value node_loader_impl_async_func_await_safe(napi_env env, napi_callback_info info); - -static void node_loader_impl_func_destroy_safe(napi_env env, loader_impl_async_func_destroy_safe func_destroy_safe); +static void node_loader_impl_initialize_safe(napi_env env, loader_impl_async_initialize_safe_type *initialize_safe); -static napi_value node_loader_impl_async_func_destroy_safe(napi_env env, napi_callback_info info); +static void node_loader_impl_execution_path_safe(napi_env env, loader_impl_async_execution_path_safe_type *execution_path_safe); -static void node_loader_impl_future_await_safe(napi_env env, loader_impl_async_future_await_safe future_await_safe); +static void node_loader_impl_func_call_safe(napi_env env, loader_impl_async_func_call_safe_type *func_call_safe); -static napi_value node_loader_impl_async_future_await_safe(napi_env env, napi_callback_info info); +static void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await_safe_type *func_await_safe); -static void node_loader_impl_future_delete_safe(napi_env env, loader_impl_async_future_delete_safe future_delete_safe); +static void node_loader_impl_func_destroy_safe(napi_env env, loader_impl_async_func_destroy_safe_type *func_destroy_safe); -static napi_value node_loader_impl_async_future_delete_safe(napi_env env, napi_callback_info info); +static void node_loader_impl_future_await_safe(napi_env env, loader_impl_async_future_await_safe_type *future_await_safe); -static void node_loader_impl_load_from_file_safe(napi_env env, loader_impl_async_load_from_file_safe load_from_file_safe); +static void node_loader_impl_future_delete_safe(napi_env env, loader_impl_async_future_delete_safe_type *future_delete_safe); -static napi_value node_loader_impl_async_load_from_file_safe(napi_env env, napi_callback_info info); +static void node_loader_impl_load_from_file_safe(napi_env env, loader_impl_async_load_from_file_safe_type *load_from_file_safe); -static void node_loader_impl_load_from_memory_safe(napi_env env, loader_impl_async_load_from_memory_safe load_from_memory_safe); +static void node_loader_impl_load_from_memory_safe(napi_env env, loader_impl_async_load_from_memory_safe_type *load_from_memory_safe); -static napi_value node_loader_impl_async_load_from_memory_safe(napi_env env, napi_callback_info info); +static void node_loader_impl_clear_safe(napi_env env, loader_impl_async_clear_safe_type *clear_safe); -static void node_loader_impl_clear_safe(napi_env env, loader_impl_async_clear_safe clear_safe); +static value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_discover_function_safe_type *discover_function_safe); -static napi_value node_loader_impl_async_clear_safe(napi_env env, napi_callback_info info); +static void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_safe_type *discover_safe); -static value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_discover_function_safe discover_function_safe); - -static void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_safe discover_safe); - -static napi_value node_loader_impl_async_discover_safe(napi_env env, napi_callback_info info); - -static void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe destroy_safe); - -static napi_value node_loader_impl_async_destroy_safe(napi_env env, napi_callback_info info); +static void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe_type *destroy_safe); static char *node_loader_impl_get_property_as_char(napi_env env, napi_value obj, const char *prop); @@ -752,7 +684,7 @@ void node_loader_impl_exception(napi_env env, napi_status status) { if (status != napi_pending_exception) { - const napi_extended_error_info *error_info = NULL; + const napi_extended_error_info *error_info = nullptr; bool pending; @@ -760,14 +692,14 @@ void node_loader_impl_exception(napi_env env, napi_status status) napi_is_exception_pending(env, &pending); - const char *message = (error_info != NULL && error_info->error_message != NULL) ? error_info->error_message : "Error message not available"; + const char *message = (error_info != nullptr && error_info->error_message != nullptr) ? error_info->error_message : "Error message not available"; /* TODO: Notify MetaCall error handling system when it is implemented */ /* ... */ if (pending) { - napi_throw_error(env, NULL, message); + napi_throw_error(env, nullptr, message); } } else @@ -775,8 +707,6 @@ void node_loader_impl_exception(napi_env env, napi_status status) napi_value error, message; bool result; napi_valuetype valuetype; - size_t length; - char *str; status = napi_get_and_clear_last_exception(env, &error); @@ -806,13 +736,15 @@ void node_loader_impl_exception(napi_env env, napi_status status) return; } - status = napi_get_value_string_utf8(env, message, NULL, 0, &length); + size_t length; + + status = napi_get_value_string_utf8(env, message, nullptr, 0, &length); node_loader_impl_exception(env, status); - str = static_cast(malloc(sizeof(char) * (length + 1))); + char *str = new char[length + 1]; - if (str == NULL) + if (str == nullptr) { /* TODO: Notify MetaCall error handling system when it is implemented */ return; @@ -832,7 +764,7 @@ void node_loader_impl_exception(napi_env env, napi_status status) node_loader_impl_exception(env, status); - free(str); + delete[] str; } } } @@ -845,7 +777,7 @@ value node_loader_impl_exception_value(loader_impl_node node_impl, napi_env env, { if (status != napi_pending_exception) { - const napi_extended_error_info *error_info = NULL; + const napi_extended_error_info *error_info = nullptr; bool pending; @@ -853,9 +785,9 @@ value node_loader_impl_exception_value(loader_impl_node node_impl, napi_env env, napi_is_exception_pending(env, &pending); - const char *message = (error_info != NULL && error_info->error_message != NULL) ? error_info->error_message : "Error message not available"; + const char *message = (error_info != nullptr && error_info->error_message != nullptr) ? error_info->error_message : "Error message not available"; - exception ex = exception_create_const(message, "ExceptionPending", (int64_t)(error_info != NULL ? error_info->error_code : status), ""); + exception ex = exception_create_const(message, "ExceptionPending", (int64_t)(error_info != nullptr ? error_info->error_code : status), ""); throwable th = throwable_create(value_create_exception(ex)); @@ -863,7 +795,7 @@ value node_loader_impl_exception_value(loader_impl_node node_impl, napi_env env, if (pending) { - napi_throw_error(env, NULL, message); + napi_throw_error(env, nullptr, message); } } else @@ -992,7 +924,7 @@ char *node_loader_impl_get_property_as_char(napi_env env, napi_value obj, const { napi_value prop_value = node_loader_impl_get_property_as_string(env, obj, prop); size_t length; - napi_status status = napi_get_value_string_utf8(env, prop_value, NULL, 0, &length); + napi_status status = napi_get_value_string_utf8(env, prop_value, nullptr, 0, &length); node_loader_impl_exception(env, status); @@ -1050,7 +982,7 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n { size_t length; - status = napi_get_value_string_utf8(env, v, NULL, 0, &length); + status = napi_get_value_string_utf8(env, v, nullptr, 0, &length); node_loader_impl_exception(env, status); @@ -1068,7 +1000,7 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n else if (valuetype == napi_symbol) { /* TODO */ - napi_throw_error(env, NULL, "NodeJS Loader symbol is not implemented"); + napi_throw_error(env, nullptr, "NodeJS Loader symbol is not implemented"); } else if (valuetype == napi_object) { @@ -1103,7 +1035,7 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n else if (napi_is_buffer(env, v, &result) == napi_ok && result == true) { /* TODO */ - napi_throw_error(env, NULL, "NodeJS Loader buffer is not implemented"); + napi_throw_error(env, nullptr, "NodeJS Loader buffer is not implemented"); } else if (napi_is_error(env, v, &result) == napi_ok && result == true) { @@ -1118,20 +1050,20 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n else if (napi_is_typedarray(env, v, &result) == napi_ok && result == true) { /* TODO */ - napi_throw_error(env, NULL, "NodeJS Loader typed array is not implemented"); + napi_throw_error(env, nullptr, "NodeJS Loader typed array is not implemented"); } else if (napi_is_dataview(env, v, &result) == napi_ok && result == true) { /* TODO */ - napi_throw_error(env, NULL, "NodeJS Loader data view is not implemented"); + napi_throw_error(env, nullptr, "NodeJS Loader data view is not implemented"); } else if (napi_is_promise(env, v, &result) == napi_ok && result == true) { - loader_impl_node_future node_future = static_cast(malloc(sizeof(struct loader_impl_node_future_type))); + loader_impl_node_future node_future = new loader_impl_node_future_type(); future f; - if (node_future == NULL) + if (node_future == nullptr) { return static_cast(NULL); } @@ -1140,7 +1072,7 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n if (f == NULL) { - free(node_future); + delete node_future; return static_cast(NULL); } @@ -1199,7 +1131,7 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n node_loader_impl_exception(env, status); /* Set key string in the tupla */ - status = napi_get_value_string_utf8(env, key, NULL, 0, &key_length); + status = napi_get_value_string_utf8(env, key, nullptr, 0, &key_length); node_loader_impl_exception(env, status); @@ -1238,7 +1170,7 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n else if (valuetype == napi_external) { /* Returns the previously allocated copy */ - void *c = NULL; + void *c = nullptr; status = napi_get_value_external(env, v, &c); @@ -1254,12 +1186,12 @@ napi_value node_loader_impl_napi_to_value_callback(napi_env env, napi_callback_i { size_t iterator, argc = 0; - napi_get_cb_info(env, info, &argc, NULL, NULL, NULL); + napi_get_cb_info(env, info, &argc, nullptr, nullptr, nullptr); napi_value *argv = new napi_value[argc]; void **args = new void *[argc]; napi_value recv; - loader_impl_async_safe_cast closure_cast = { NULL }; + loader_impl_async_safe_cast closure_cast = { nullptr }; napi_get_cb_info(env, info, &argc, argv, &recv, &closure_cast.ptr); @@ -1288,7 +1220,7 @@ napi_value node_loader_impl_napi_to_value_callback(napi_env env, napi_callback_i value_type_destroy(ret); /* Reset environment */ - // closure_cast.safe->node_impl->env = NULL; + // closure_cast.safe->node_impl->env = nullptr; delete[] argv; delete[] args; @@ -1442,7 +1374,7 @@ napi_value node_loader_impl_value_to_napi(loader_impl_node node_impl, napi_env e else if (id == TYPE_FUTURE) { /* TODO: Implement promise properly for await */ - napi_throw_error(env, NULL, "NodeJS Loader future is not implemented"); + napi_throw_error(env, nullptr, "NodeJS Loader future is not implemented"); } else if (id == TYPE_FUNCTION) { @@ -1451,7 +1383,7 @@ napi_value node_loader_impl_value_to_napi(loader_impl_node node_impl, napi_env e closure->func = value_type_copy(arg_value); closure->node_impl = node_impl; - status = napi_create_function(env, NULL, 0, node_loader_impl_napi_to_value_callback, closure, &v); + status = napi_create_function(env, nullptr, 0, node_loader_impl_napi_to_value_callback, closure, &v); node_loader_impl_exception(env, status); @@ -1466,7 +1398,7 @@ napi_value node_loader_impl_value_to_napi(loader_impl_node node_impl, napi_env e else if (id == TYPE_CLASS) { /* TODO */ - /* napi_throw_error(env, NULL, "NodeJS Loader class is not implemented"); */ + /* napi_throw_error(env, nullptr, "NodeJS Loader class is not implemented"); */ /* klass cls = value_to_class(arg_value); @@ -1477,7 +1409,7 @@ napi_value node_loader_impl_value_to_napi(loader_impl_node node_impl, napi_env e else if (id == TYPE_OBJECT) { /* TODO */ - napi_throw_error(env, NULL, "NodeJS Loader object is not implemented"); + napi_throw_error(env, nullptr, "NodeJS Loader object is not implemented"); } else if (id == TYPE_NULL) { @@ -1533,7 +1465,7 @@ napi_value node_loader_impl_value_to_napi(loader_impl_node node_impl, napi_env e error_str += type_id_name(id); error_str += "' to N-API"; - napi_throw_error(env, NULL, error_str.c_str()); + napi_throw_error(env, nullptr, error_str.c_str()); } return v; @@ -1546,15 +1478,15 @@ void node_loader_impl_env(loader_impl_node node_impl, napi_env env) int function_node_interface_create(function func, function_impl impl) { - loader_impl_node_function node_func = (loader_impl_node_function)impl; + loader_impl_node_function node_func = static_cast(impl); signature s = function_signature(func); const size_t args_size = signature_count(s); - node_func->argv = static_cast(malloc(sizeof(napi_value) * args_size)); + node_func->argv = new napi_value[args_size]; - return (node_func->argv == NULL); + return (node_func->argv == nullptr); } template @@ -1579,7 +1511,7 @@ function_return function_node_interface_invoke(function func, function_impl impl { loader_impl_node_function node_func = static_cast(impl); - if (node_func == NULL) + if (node_func == nullptr) { return NULL; } @@ -1604,158 +1536,62 @@ function_return function_node_interface_invoke(function func, function_impl impl function_return function_node_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context) { - loader_impl_node_function node_func = (loader_impl_node_function)impl; - - if (node_func != NULL) - { - loader_impl_node node_impl = node_func->node_impl; - function_return ret = NULL; - napi_status status; - - /* Set up await safe arguments */ - node_impl->func_await_safe->node_impl = node_impl; - node_impl->func_await_safe->func = func; - node_impl->func_await_safe->node_func = node_func; - node_impl->func_await_safe->args = static_cast(args); - node_impl->func_await_safe->size = size; - node_impl->func_await_safe->resolve_callback = resolve_callback; - node_impl->func_await_safe->reject_callback = reject_callback; - node_impl->func_await_safe->context = context; - node_impl->func_await_safe->recv = NULL; - node_impl->func_await_safe->ret = NULL; - - /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) - { - /* We are already in the V8 thread, we can call safely */ - node_loader_impl_func_await_safe(node_impl->env, node_impl->func_await_safe); - - /* Set up return of the function call */ - ret = node_impl->func_await_safe->ret; - } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_func_await); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe function await function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_func_await, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe function await function in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_func_await, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe function await function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); + loader_impl_node_function node_func = static_cast(impl); - /* Set up return of the function call */ - ret = node_impl->func_await_safe->ret; + if (node_func == nullptr) + { + return NULL; + } - node_impl->locked.store(false); + loader_impl_node node_impl = node_func->node_impl; + loader_impl_async_func_await_safe_type func_await_safe(node_impl, func, node_func, args, size, resolve_callback, reject_callback, context); - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in function_node_interface_await, the call has not been executed in order to avoid the deadlock"); - } + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_func_await_safe(node_impl->env, &func_await_safe); - return ret; + return func_await_safe.ret; } - return NULL; + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_func_await, func_await_safe); + + return func_await_safe.ret; } void function_node_interface_destroy(function func, function_impl impl) { - loader_impl_node_function node_func = (loader_impl_node_function)impl; + loader_impl_node_function node_func = static_cast(impl); (void)func; - if (node_func != NULL) + if (node_func == nullptr) { - if (loader_is_destroyed(node_func->impl) != 0) - { - loader_impl_node node_impl = node_func->node_impl; - napi_status status; - - /* Set up function destroy safe arguments */ - node_impl->func_destroy_safe->node_impl = node_impl; - node_impl->func_destroy_safe->node_func = node_func; - - /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) - { - /* We are already in the V8 thread, we can call safely */ - node_loader_impl_func_destroy_safe(node_impl->env, node_impl->func_destroy_safe); - } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_func_destroy); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe function destroy function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_func_destroy, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe function destroy function in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_func_destroy, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe function destroy function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); + return; + } - node_impl->locked.store(false); + loader_impl_node node_impl = node_func->node_impl; + loader_impl_async_func_destroy_safe_type func_destroy_safe(node_impl, node_func); - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in function_node_interface_destroy, the call has not been executed in order to avoid the deadlock"); - } - } + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_func_destroy_safe(node_impl->env, &func_destroy_safe); + } + else + { + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_func_destroy, func_destroy_safe); + } - /* Free node function arguments */ - free(node_func->argv); + /* Free node function arguments */ + delete[] node_func->argv; - /* Free node function */ - free(node_func); - } + /* Free node function */ + delete node_func; } function_interface function_node_singleton() @@ -1780,152 +1616,60 @@ int future_node_interface_create(future f, future_impl impl) future_return future_node_interface_await(future f, future_impl impl, future_resolve_callback resolve_callback, future_reject_callback reject_callback, void *context) { - loader_impl_node_future node_future = (loader_impl_node_future)impl; + loader_impl_node_future node_future = static_cast(impl); - if (node_future != NULL) + if (node_future == nullptr) { - loader_impl_node node_impl = node_future->node_impl; - function_return ret = NULL; - napi_status status; - - /* Set up await safe arguments */ - node_impl->future_await_safe->node_impl = node_impl; - node_impl->future_await_safe->f = f; - node_impl->future_await_safe->node_future = node_future; - node_impl->future_await_safe->resolve_callback = resolve_callback; - node_impl->future_await_safe->reject_callback = reject_callback; - node_impl->future_await_safe->context = context; - node_impl->future_await_safe->recv = NULL; - node_impl->future_await_safe->ret = NULL; - - /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) - { - /* We are already in the V8 thread, we can call safely */ - node_loader_impl_future_await_safe(node_impl->env, node_impl->future_await_safe); - - /* Set up return of the function call */ - ret = node_impl->future_await_safe->ret; - } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_future_await); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe function await future in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_future_await, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe function await future in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_future_await, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe function await future in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); - - /* Set up return of the function call */ - ret = node_impl->future_await_safe->ret; + return NULL; + } - node_impl->locked.store(false); + loader_impl_node node_impl = node_future->node_impl; + loader_impl_async_future_await_safe_type future_await_safe(node_impl, f, node_future, resolve_callback, reject_callback, context); - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in future_node_interface_await, the call has not been executed in order to avoid the deadlock"); - } + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_future_await_safe(node_impl->env, &future_await_safe); - return ret; + return future_await_safe.ret; } - return NULL; + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_future_await, future_await_safe); + + return future_await_safe.ret; } void future_node_interface_destroy(future f, future_impl impl) { - loader_impl_node_future node_future = (loader_impl_node_future)impl; + loader_impl_node_future node_future = static_cast(impl); - if (node_future != NULL) + if (node_future == nullptr) { - if (loader_is_destroyed(node_future->node_impl->impl) != 0) - { - loader_impl_node node_impl = node_future->node_impl; - napi_status status; - - /* Set up future delete safe arguments */ - node_impl->future_delete_safe->node_impl = node_impl; - node_impl->future_delete_safe->node_future = node_future; - node_impl->future_delete_safe->f = f; - - /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) - { - /* We are already in the V8 thread, we can call safely */ - node_loader_impl_future_delete_safe(node_impl->env, node_impl->future_delete_safe); - } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_future_delete); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe future destroy function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_future_delete, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe future destroy function in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_future_delete, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe future destroy function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); + return; + } - node_impl->locked.store(false); + if (loader_is_destroyed(node_future->node_impl->impl) != 0) + { + loader_impl_node node_impl = node_future->node_impl; + loader_impl_async_future_delete_safe_type future_delete_safe(node_impl, f, node_future); - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in future_node_interface_destroy, the call has not been executed in order to avoid the deadlock"); - } + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_future_delete_safe(node_impl->env, &future_delete_safe); + } + else + { + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_future_delete, future_delete_safe); } - - /* Free node future */ - free(node_future); } + + /* Free node future */ + delete node_future; } future_interface future_node_singleton() @@ -1939,7 +1683,7 @@ future_interface future_node_singleton() return &node_future_interface; } -void node_loader_impl_initialize_safe(napi_env env, loader_impl_async_initialize_safe initialize_safe) +void node_loader_impl_initialize_safe(napi_env env, loader_impl_async_initialize_safe_type *initialize_safe) { static const char initialize_str[] = "initialize"; napi_value function_table_object; @@ -2010,57 +1754,29 @@ void node_loader_impl_initialize_safe(napi_env env, loader_impl_async_initialize node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_initialize_safe(napi_env env, napi_callback_info info) +void node_loader_impl_execution_path_safe(napi_env env, loader_impl_async_execution_path_safe_type *execution_path_safe) { - loader_impl_async_safe_cast initialize_cast = { NULL }; + static const char execution_path_str[] = "execution_path"; + napi_value function_table_object; + napi_value execution_path_str_value; + bool result = false; + napi_handle_scope handle_scope; + loader_impl_node node_impl = execution_path_safe->node_impl; - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &initialize_cast.ptr); + /* Create scope */ + napi_status status = napi_open_handle_scope(env, &handle_scope); node_loader_impl_exception(env, status); - /* Lock node implementation mutex */ - uv_mutex_lock(&initialize_cast.safe->node_impl->mutex); + /* Get function table object from reference */ + status = napi_get_reference_value(env, node_impl->function_table_object_ref, &function_table_object); - /* Store environment for reentrant calls */ - initialize_cast.safe->node_impl->env = env; + node_loader_impl_exception(env, status); - /* Call to the implementation function */ - node_loader_impl_initialize_safe(env, initialize_cast.safe); + /* Create function string */ + status = napi_create_string_utf8(env, execution_path_str, sizeof(execution_path_str) - 1, &execution_path_str_value); - /* Clear environment */ - // initialize_cast.safe->node_impl->env = NULL; - - /* Signal start condition */ - uv_cond_signal(&initialize_cast.safe->node_impl->cond); - - uv_mutex_unlock(&initialize_cast.safe->node_impl->mutex); - - return nullptr; -} - -void node_loader_impl_execution_path_safe(napi_env env, loader_impl_async_execution_path_safe execution_path_safe) -{ - static const char execution_path_str[] = "execution_path"; - napi_value function_table_object; - napi_value execution_path_str_value; - bool result = false; - napi_handle_scope handle_scope; - loader_impl_node node_impl = execution_path_safe->node_impl; - - /* Create scope */ - napi_status status = napi_open_handle_scope(env, &handle_scope); - - node_loader_impl_exception(env, status); - - /* Get function table object from reference */ - status = napi_get_reference_value(env, node_impl->function_table_object_ref, &function_table_object); - - node_loader_impl_exception(env, status); - - /* Create function string */ - status = napi_create_string_utf8(env, execution_path_str, sizeof(execution_path_str) - 1, &execution_path_str_value); - - node_loader_impl_exception(env, status); + node_loader_impl_exception(env, status); /* Check if exists in the table */ status = napi_has_own_property(env, function_table_object, execution_path_str_value, &result); @@ -2109,35 +1825,7 @@ void node_loader_impl_execution_path_safe(napi_env env, loader_impl_async_execut node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_execution_path_safe(napi_env env, napi_callback_info info) -{ - loader_impl_async_safe_cast execution_path_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &execution_path_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&execution_path_cast.safe->node_impl->mutex); - - /* Store environment for reentrant calls */ - execution_path_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_execution_path_safe(env, execution_path_cast.safe); - - /* Clear environment */ - // execution_path_cast.safe->node_impl->env = NULL; - - /* Signal start condition */ - uv_cond_signal(&execution_path_cast.safe->node_impl->cond); - - uv_mutex_unlock(&execution_path_cast.safe->node_impl->mutex); - - return nullptr; -} - -void node_loader_impl_func_call_safe(napi_env env, loader_impl_async_func_call_safe func_call_safe) +void node_loader_impl_func_call_safe(napi_env env, loader_impl_async_func_call_safe_type *func_call_safe) { napi_handle_scope handle_scope; size_t args_size; @@ -2154,7 +1842,7 @@ void node_loader_impl_func_call_safe(napi_env env, loader_impl_async_func_call_s args = func_call_safe->args; /* Allocate dynamically more space for values in case of variable arguments */ - argv = args_size > signature_args_size ? static_cast(malloc(sizeof(napi_value) * args_size)) : node_func->argv; + argv = args_size > signature_args_size ? new napi_value[args_size] : node_func->argv; /* Create scope */ napi_status status = napi_open_handle_scope(env, &handle_scope); @@ -2202,7 +1890,7 @@ void node_loader_impl_func_call_safe(napi_env env, loader_impl_async_func_call_s if (args_size > signature_args_size) { - free(argv); + delete[] argv; } } @@ -2210,7 +1898,7 @@ void node_loader_impl_async_func_await_finalize(napi_env, void *finalize_data, v { loader_impl_async_func_await_trampoline trampoline = static_cast(finalize_data); - free(trampoline); + delete trampoline; } napi_value node_loader_impl_async_func_resolve(loader_impl_node node_impl, napi_env env, function_resolve_callback resolve, napi_value recv, napi_value v, void *context) @@ -2218,7 +1906,7 @@ napi_value node_loader_impl_async_func_resolve(loader_impl_node node_impl, napi_ napi_value result; value arg, ret; - if (node_impl == NULL || resolve == NULL) + if (node_impl == nullptr || resolve == NULL) { return nullptr; } @@ -2260,7 +1948,7 @@ napi_value node_loader_impl_async_func_reject(loader_impl_node node_impl, napi_e napi_value result; value arg, ret; - if (node_impl == NULL || reject == NULL) + if (node_impl == nullptr || reject == NULL) { return nullptr; } @@ -2297,7 +1985,7 @@ napi_value node_loader_impl_async_func_reject(loader_impl_node node_impl, napi_e return result; } -void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await_safe func_await_safe) +void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await_safe_type *func_await_safe) { static const char await_str[] = "await_function"; napi_value await_str_value; @@ -2345,9 +2033,9 @@ void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await else { /* Allocate trampoline object */ - loader_impl_async_func_await_trampoline trampoline = static_cast(malloc(sizeof(struct loader_impl_async_func_await_trampoline_type))); + loader_impl_async_func_await_trampoline trampoline = new loader_impl_async_func_await_trampoline_type(); - if (trampoline != NULL) + if (trampoline != nullptr) { size_t args_size; value *args; @@ -2380,7 +2068,7 @@ void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await node_func = func_await_safe->node_func; /* Allocate dynamically more space for values in case of variable arguments */ - func_argv = args_size > signature_args_size ? static_cast(malloc(sizeof(napi_value) * args_size)) : node_func->argv; + func_argv = args_size > signature_args_size ? new napi_value[args_size] : node_func->argv; /* Build parameters */ for (args_count = 0; args_count < args_size; ++args_count) @@ -2427,7 +2115,7 @@ void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await if (args_size > signature_args_size) { - free(func_argv); + delete[](func_argv); } } } @@ -2439,39 +2127,7 @@ void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_func_await_safe(napi_env env, napi_callback_info info) -{ - napi_value recv; - loader_impl_async_safe_cast func_await_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, &recv, &func_await_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&func_await_cast.safe->node_impl->mutex); - - /* Store function recv for reentrant calls */ - func_await_cast.safe->recv = recv; - - /* Store environment for reentrant calls */ - func_await_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_func_await_safe(env, func_await_cast.safe); - - /* Clear environment */ - // func_await_cast.safe->node_impl->env = NULL; - - /* Signal function await condition */ - uv_cond_signal(&func_await_cast.safe->node_impl->cond); - - uv_mutex_unlock(&func_await_cast.safe->node_impl->mutex); - - return nullptr; -} - -void node_loader_impl_func_destroy_safe(napi_env env, loader_impl_async_func_destroy_safe func_destroy_safe) +void node_loader_impl_func_destroy_safe(napi_env env, loader_impl_async_func_destroy_safe_type *func_destroy_safe) { uint32_t ref_count = 0; napi_handle_scope handle_scope; @@ -2501,35 +2157,7 @@ void node_loader_impl_func_destroy_safe(napi_env env, loader_impl_async_func_des node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_func_destroy_safe(napi_env env, napi_callback_info info) -{ - loader_impl_async_safe_cast func_destroy_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &func_destroy_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&func_destroy_cast.safe->node_impl->mutex); - - /* Store environment for reentrant calls */ - func_destroy_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_func_destroy_safe(env, func_destroy_cast.safe); - - /* Clear environment */ - // func_destroy_cast.safe->node_impl->env = NULL; - - /* Signal function destroy condition */ - uv_cond_signal(&func_destroy_cast.safe->node_impl->cond); - - uv_mutex_unlock(&func_destroy_cast.safe->node_impl->mutex); - - return nullptr; -} - -void node_loader_impl_future_await_safe(napi_env env, loader_impl_async_future_await_safe future_await_safe) +void node_loader_impl_future_await_safe(napi_env env, loader_impl_async_future_await_safe_type *future_await_safe) { static const char await_str[] = "await_future"; napi_value await_str_value; @@ -2577,9 +2205,9 @@ void node_loader_impl_future_await_safe(napi_env env, loader_impl_async_future_a else { /* Allocate trampoline object */ - loader_impl_async_func_await_trampoline trampoline = static_cast(malloc(sizeof(struct loader_impl_async_func_await_trampoline_type))); + loader_impl_async_func_await_trampoline trampoline = new loader_impl_async_func_await_trampoline_type(); - if (trampoline != NULL) + if (trampoline != nullptr) { /* Get function reference */ status = napi_get_reference_value(env, future_await_safe->node_future->promise_ref, &argv[0]); @@ -2599,7 +2227,7 @@ void node_loader_impl_future_await_safe(napi_env env, loader_impl_async_future_a node_loader_impl_exception(env, status); - status = napi_wrap(env, argv[1], static_cast(trampoline), &node_loader_impl_async_func_await_finalize, NULL, NULL); + status = napi_wrap(env, argv[1], static_cast(trampoline), &node_loader_impl_async_func_await_finalize, nullptr, nullptr); node_loader_impl_exception(env, status); @@ -2626,39 +2254,7 @@ void node_loader_impl_future_await_safe(napi_env env, loader_impl_async_future_a node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_future_await_safe(napi_env env, napi_callback_info info) -{ - napi_value recv; - loader_impl_async_safe_cast future_await_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, &recv, &future_await_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&future_await_cast.safe->node_impl->mutex); - - /* Store function recv for reentrant calls */ - future_await_cast.safe->recv = recv; - - /* Store environment for reentrant calls */ - future_await_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_future_await_safe(env, future_await_cast.safe); - - /* Clear environment */ - // future_await_cast.safe->node_impl->env = NULL; - - /* Signal function await condition */ - uv_cond_signal(&future_await_cast.safe->node_impl->cond); - - uv_mutex_unlock(&future_await_cast.safe->node_impl->mutex); - - return nullptr; -} - -void node_loader_impl_future_delete_safe(napi_env env, loader_impl_async_future_delete_safe future_delete_safe) +void node_loader_impl_future_delete_safe(napi_env env, loader_impl_async_future_delete_safe_type *future_delete_safe) { uint32_t ref_count = 0; napi_handle_scope handle_scope; @@ -2688,35 +2284,7 @@ void node_loader_impl_future_delete_safe(napi_env env, loader_impl_async_future_ node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_future_delete_safe(napi_env env, napi_callback_info info) -{ - loader_impl_async_safe_cast future_delete_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &future_delete_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&future_delete_cast.safe->node_impl->mutex); - - /* Store environment for reentrant calls */ - future_delete_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_future_delete_safe(env, future_delete_cast.safe); - - /* Clear environment */ - // future_delete_cast.safe->node_impl->env = NULL; - - /* Signal future delete condition */ - uv_cond_signal(&future_delete_cast.safe->node_impl->cond); - - uv_mutex_unlock(&future_delete_cast.safe->node_impl->mutex); - - return nullptr; -} - -void node_loader_impl_load_from_file_safe(napi_env env, loader_impl_async_load_from_file_safe load_from_file_safe) +void node_loader_impl_load_from_file_safe(napi_env env, loader_impl_async_load_from_file_safe_type *load_from_file_safe) { static const char load_from_file_str[] = "load_from_file"; napi_value function_table_object; @@ -2816,35 +2384,7 @@ void node_loader_impl_load_from_file_safe(napi_env env, loader_impl_async_load_f node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_load_from_file_safe(napi_env env, napi_callback_info info) -{ - loader_impl_async_safe_cast load_from_file_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &load_from_file_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&load_from_file_cast.safe->node_impl->mutex); - - /* Store environment for reentrant calls */ - load_from_file_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_load_from_file_safe(env, load_from_file_cast.safe); - - /* Clear environment */ - // load_from_file_cast.safe->node_impl->env = NULL; - - /* Signal load from file condition */ - uv_cond_signal(&load_from_file_cast.safe->node_impl->cond); - - uv_mutex_unlock(&load_from_file_cast.safe->node_impl->mutex); - - return nullptr; -} - -void node_loader_impl_load_from_memory_safe(napi_env env, loader_impl_async_load_from_memory_safe load_from_memory_safe) +void node_loader_impl_load_from_memory_safe(napi_env env, loader_impl_async_load_from_memory_safe_type *load_from_memory_safe) { static const char load_from_memory_str[] = "load_from_memory"; napi_value function_table_object; @@ -2937,35 +2477,7 @@ void node_loader_impl_load_from_memory_safe(napi_env env, loader_impl_async_load node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_load_from_memory_safe(napi_env env, napi_callback_info info) -{ - loader_impl_async_safe_cast load_from_memory_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &load_from_memory_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&load_from_memory_cast.safe->node_impl->mutex); - - /* Store environment for reentrant calls */ - load_from_memory_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_load_from_memory_safe(env, load_from_memory_cast.safe); - - /* Clear environment */ - // load_from_memory_cast.safe->node_impl->env = NULL; - - /* Signal load from memory condition */ - uv_cond_signal(&load_from_memory_cast.safe->node_impl->cond); - - uv_mutex_unlock(&load_from_memory_cast.safe->node_impl->mutex); - - return nullptr; -} - -void node_loader_impl_clear_safe(napi_env env, loader_impl_async_clear_safe clear_safe) +void node_loader_impl_clear_safe(napi_env env, loader_impl_async_clear_safe_type *clear_safe) { static const char clear_str[] = "clear"; napi_value function_table_object; @@ -3049,35 +2561,7 @@ void node_loader_impl_clear_safe(napi_env env, loader_impl_async_clear_safe clea node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_clear_safe(napi_env env, napi_callback_info info) -{ - loader_impl_async_safe_cast clear_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &clear_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&clear_cast.safe->node_impl->mutex); - - /* Store environment for reentrant calls */ - clear_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_clear_safe(env, clear_cast.safe); - - /* Clear environment */ - // clear_cast.safe->node_impl->env = NULL; - - /* Signal clear condition */ - uv_cond_signal(&clear_cast.safe->node_impl->cond); - - uv_mutex_unlock(&clear_cast.safe->node_impl->mutex); - - return nullptr; -} - -value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_discover_function_safe discover_function_safe) +value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_discover_function_safe_type *discover_function_safe) { static const char discover_function_str[] = "discover_function"; napi_value discover_function_str_value; @@ -3141,7 +2625,7 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di /* Convert return value (discover object) to context */ napi_value func_name; - char *func_name_str = NULL; + char *func_name_str = nullptr; bool has_name = false; status = napi_has_named_property(env, function_descriptor, "name", &has_name); @@ -3157,13 +2641,13 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di node_loader_impl_exception(env, status); - status = napi_get_value_string_utf8(env, func_name, NULL, 0, &func_name_length); + status = napi_get_value_string_utf8(env, func_name, nullptr, 0, &func_name_length); node_loader_impl_exception(env, status); if (func_name_length > 0) { - func_name_str = static_cast(malloc(sizeof(char) * (func_name_length + 1))); + func_name_str = new char[func_name_length + 1]; } /* Get function name */ @@ -3265,7 +2749,7 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di } /* Create node function */ - loader_impl_node_function node_func = static_cast(malloc(sizeof(struct loader_impl_node_function_type))); + loader_impl_node_function node_func = new loader_impl_node_function_type(); /* Create reference to function pointer */ status = napi_create_reference(env, discover_function_safe->func, 1, &node_func->func_ref); @@ -3294,19 +2778,19 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di if (has_ret) { size_t return_type_length; - char *return_type_str = NULL; + char *return_type_str = nullptr; /* Get return value string length */ - status = napi_get_value_string_utf8(env, function_ret, NULL, 0, &return_type_length); + status = napi_get_value_string_utf8(env, function_ret, nullptr, 0, &return_type_length); node_loader_impl_exception(env, status); if (return_type_length > 0) { - return_type_str = static_cast(malloc(sizeof(char) * (return_type_length + 1))); + return_type_str = new char[return_type_length + 1]; } - if (return_type_str != NULL) + if (return_type_str != nullptr) { /* Get parameter name string */ status = napi_get_value_string_utf8(env, function_ret, return_type_str, return_type_length + 1, &return_type_length); @@ -3316,7 +2800,7 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di /* TODO: Implement return type with impl (may need an important refactor) */ signature_set_return(s, /*loader_impl_type(discover_function_safe->impl, return_type_str)*/ NULL); - free(return_type_str); + delete[] return_type_str; } } @@ -3325,7 +2809,7 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di { napi_value parameter_name; size_t parameter_name_length; - char *parameter_name_str = NULL; + char *parameter_name_str = nullptr; /* Get signature parameter name */ status = napi_get_element(env, function_sig, arg_index, ¶meter_name); @@ -3333,13 +2817,13 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di node_loader_impl_exception(env, status); /* Get parameter name string length */ - status = napi_get_value_string_utf8(env, parameter_name, NULL, 0, ¶meter_name_length); + status = napi_get_value_string_utf8(env, parameter_name, nullptr, 0, ¶meter_name_length); node_loader_impl_exception(env, status); if (parameter_name_length > 0) { - parameter_name_str = static_cast(malloc(sizeof(char) * (parameter_name_length + 1))); + parameter_name_str = new char[parameter_name_length + 1]; } /* Get parameter name string */ @@ -3352,7 +2836,7 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di { napi_value parameter_type; size_t parameter_type_length; - char *parameter_type_str = NULL; + char *parameter_type_str = nullptr; /* Get signature parameter type */ status = napi_get_element(env, function_types, arg_index, ¶meter_type); @@ -3360,13 +2844,13 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di node_loader_impl_exception(env, status); /* Get parameter type string length */ - status = napi_get_value_string_utf8(env, parameter_type, NULL, 0, ¶meter_type_length); + status = napi_get_value_string_utf8(env, parameter_type, nullptr, 0, ¶meter_type_length); node_loader_impl_exception(env, status); if (parameter_type_length > 0) { - parameter_type_str = static_cast(malloc(sizeof(char) * (parameter_type_length + 1))); + parameter_type_str = new char[parameter_type_length + 1]; } /* Get parameter type string */ @@ -3375,21 +2859,21 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di node_loader_impl_exception(env, status); /* TODO: Implement parameter type with impl (may need an important refactor) */ - signature_set(s, (size_t)arg_index, parameter_name_str, /*loader_impl_type(discover_function_safe->impl, parameter_type_str)*/ NULL); + signature_set(s, static_cast(arg_index), parameter_name_str, /*loader_impl_type(discover_function_safe->impl, parameter_type_str)*/ NULL); - if (parameter_type_str != NULL) + if (parameter_type_str != nullptr) { - free(parameter_type_str); + delete[] parameter_type_str; } } else { - signature_set(s, (size_t)arg_index, parameter_name_str, NULL); + signature_set(s, static_cast(arg_index), parameter_name_str, NULL); } - if (parameter_name_str != NULL) + if (parameter_name_str != nullptr) { - free(parameter_name_str); + delete[] parameter_name_str; } } @@ -3398,12 +2882,12 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di } else { - free(node_func); + delete node_func; } - if (func_name_str != NULL) + if (func_name_str != nullptr) { - free(func_name_str); + delete[] func_name_str; } } @@ -3415,7 +2899,7 @@ value node_loader_impl_discover_function_safe(napi_env env, loader_impl_async_di return function_value; } -void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_safe discover_safe) +void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_safe_type *discover_safe) { static const char discover_str[] = "discover"; napi_value function_table_object; @@ -3494,22 +2978,22 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf { napi_value func_name; size_t func_name_length; - char *func_name_str = NULL; + char *func_name_str = nullptr; status = napi_get_element(env, func_names, index, &func_name); node_loader_impl_exception(env, status); - status = napi_get_value_string_utf8(env, func_name, NULL, 0, &func_name_length); + status = napi_get_value_string_utf8(env, func_name, nullptr, 0, &func_name_length); node_loader_impl_exception(env, status); if (func_name_length > 0) { - func_name_str = static_cast(malloc(sizeof(char) * (func_name_length + 1))); + func_name_str = new char[func_name_length + 1]; } - if (func_name_str != NULL) + if (func_name_str != nullptr) { napi_value function_descriptor; napi_value function_ptr; @@ -3630,7 +3114,7 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf } /* Create node function */ - loader_impl_node_function node_func = static_cast(malloc(sizeof(struct loader_impl_node_function_type))); + loader_impl_node_function node_func = new loader_impl_node_function_type(); /* Create reference to function pointer */ status = napi_create_reference(env, function_ptr, 1, &node_func->func_ref); @@ -3660,19 +3144,19 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf if (has_ret) { size_t return_type_length; - char *return_type_str = NULL; + char *return_type_str = nullptr; /* Get return value string length */ - status = napi_get_value_string_utf8(env, function_ret, NULL, 0, &return_type_length); + status = napi_get_value_string_utf8(env, function_ret, nullptr, 0, &return_type_length); node_loader_impl_exception(env, status); if (return_type_length > 0) { - return_type_str = static_cast(malloc(sizeof(char) * (return_type_length + 1))); + return_type_str = new char[return_type_length + 1]; } - if (return_type_str != NULL) + if (return_type_str != nullptr) { /* Get parameter name string */ status = napi_get_value_string_utf8(env, function_ret, return_type_str, return_type_length + 1, &return_type_length); @@ -3681,7 +3165,7 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf signature_set_return(s, loader_impl_type(discover_safe->node_impl->impl, return_type_str)); - free(return_type_str); + delete[] return_type_str; } } @@ -3690,7 +3174,7 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf { napi_value parameter_name; size_t parameter_name_length; - char *parameter_name_str = NULL; + char *parameter_name_str = nullptr; /* Get signature parameter name */ status = napi_get_element(env, function_sig, arg_index, ¶meter_name); @@ -3698,13 +3182,13 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf node_loader_impl_exception(env, status); /* Get parameter name string length */ - status = napi_get_value_string_utf8(env, parameter_name, NULL, 0, ¶meter_name_length); + status = napi_get_value_string_utf8(env, parameter_name, nullptr, 0, ¶meter_name_length); node_loader_impl_exception(env, status); if (parameter_name_length > 0) { - parameter_name_str = static_cast(malloc(sizeof(char) * (parameter_name_length + 1))); + parameter_name_str = new char[parameter_name_length + 1]; } /* Get parameter name string */ @@ -3717,7 +3201,7 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf { napi_value parameter_type; size_t parameter_type_length; - char *parameter_type_str = NULL; + char *parameter_type_str = nullptr; /* Get signature parameter type */ status = napi_get_element(env, function_types, arg_index, ¶meter_type); @@ -3725,13 +3209,13 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf node_loader_impl_exception(env, status); /* Get parameter type string length */ - status = napi_get_value_string_utf8(env, parameter_type, NULL, 0, ¶meter_type_length); + status = napi_get_value_string_utf8(env, parameter_type, nullptr, 0, ¶meter_type_length); node_loader_impl_exception(env, status); if (parameter_type_length > 0) { - parameter_type_str = static_cast(malloc(sizeof(char) * (parameter_type_length + 1))); + parameter_type_str = new char[parameter_type_length + 1]; } /* Get parameter type string */ @@ -3739,21 +3223,21 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf node_loader_impl_exception(env, status); - signature_set(s, (size_t)arg_index, parameter_name_str, loader_impl_type(discover_safe->node_impl->impl, parameter_type_str)); + signature_set(s, static_cast(arg_index), parameter_name_str, loader_impl_type(discover_safe->node_impl->impl, parameter_type_str)); - if (parameter_type_str != NULL) + if (parameter_type_str != nullptr) { - free(parameter_type_str); + delete[] parameter_type_str; } } else { - signature_set(s, (size_t)arg_index, parameter_name_str, NULL); + signature_set(s, static_cast(arg_index), parameter_name_str, NULL); } - if (parameter_name_str != NULL) + if (parameter_name_str != nullptr) { - free(parameter_name_str); + delete[] parameter_name_str; } } @@ -3768,12 +3252,12 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf } else { - free(node_func); + delete node_func; discover_safe->result = 1; break; } - free(func_name_str); + delete[] func_name_str; } } } @@ -3784,69 +3268,6 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf node_loader_impl_exception(env, status); } -napi_value node_loader_impl_async_discover_safe(napi_env env, napi_callback_info info) -{ - loader_impl_async_safe_cast discover_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &discover_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock node implementation mutex */ - uv_mutex_lock(&discover_cast.safe->node_impl->mutex); - - /* Store environment for reentrant calls */ - discover_cast.safe->node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_discover_safe(env, discover_cast.safe); - - /* Clear environment */ - // discover_cast.safe->node_impl->env = NULL; - - /* Signal discover condition */ - uv_cond_signal(&discover_cast.safe->node_impl->cond); - - uv_mutex_unlock(&discover_cast.safe->node_impl->mutex); - - return nullptr; -} - -template -void node_loader_impl_thread_safe_function_initialize(napi_env env, - const char name[], size_t size, napi_value (*callback)(napi_env, napi_callback_info), T **data, - napi_value *ptr, napi_threadsafe_function *threadsafe_function) -{ - napi_status status; - - /* Create func call function */ - *data = new T(); - - /* Initialize call safe function with context */ - status = napi_create_function(env, NULL, 0, callback, static_cast(*data), ptr); - - node_loader_impl_exception(env, status); - - /* Create call safe function */ - napi_value threadsafe_func_name; - - status = napi_create_string_utf8(env, name, size, &threadsafe_func_name); - - node_loader_impl_exception(env, status); - - // TODO: Does this number must be equivalent to the number of the threads of NodeJS? - unsigned int processor_count = std::thread::hardware_concurrency(); - - status = napi_create_threadsafe_function(env, *ptr, - nullptr, threadsafe_func_name, - 0, processor_count, - nullptr, nullptr, - nullptr, nullptr, - threadsafe_function); - - node_loader_impl_exception(env, status); -} - #if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1200) /* TODO: _Ret_maybenull_ HMODULE WINAPI GetModuleHandleW(_In_opt_ LPCWSTR lpModuleName); */ _Ret_maybenull_ HMODULE WINAPI get_module_handle_a_hook(_In_opt_ LPCSTR lpModuleName) @@ -3926,241 +3347,60 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi /* Initialize thread safe functions */ { - /* Safe initialize */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_initialize_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_initialize_safe, - (loader_impl_async_initialize_safe_type **)(&node_impl->initialize_safe), - &node_impl->initialize_safe_ptr, - &node_impl->threadsafe_initialize); - } - - /* Safe execution path */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_execution_path_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_execution_path_safe, - (loader_impl_async_execution_path_safe_type **)(&node_impl->execution_path_safe), - &node_impl->execution_path_safe_ptr, - &node_impl->threadsafe_execution_path); - } - - /* Safe load from file */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_load_from_file_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_load_from_file_safe, - (loader_impl_async_load_from_file_safe_type **)(&node_impl->load_from_file_safe), - &node_impl->load_from_file_safe_ptr, - &node_impl->threadsafe_load_from_file); - } + node_impl->threadsafe_initialize.initialize(env, "node_loader_impl_async_initialize_safe", &node_loader_impl_initialize_safe); + node_impl->threadsafe_execution_path.initialize(env, "node_loader_impl_async_execution_path_safe", &node_loader_impl_execution_path_safe); + node_impl->threadsafe_load_from_file.initialize(env, "node_loader_impl_async_load_from_file_safe", &node_loader_impl_load_from_file_safe); + node_impl->threadsafe_load_from_memory.initialize(env, "node_loader_impl_async_load_from_memory_safe", &node_loader_impl_load_from_memory_safe); + node_impl->threadsafe_clear.initialize(env, "node_loader_impl_async_clear_safe", &node_loader_impl_clear_safe); + node_impl->threadsafe_discover.initialize(env, "node_loader_impl_async_discover_safe", &node_loader_impl_discover_safe); + node_impl->threadsafe_func_call.initialize(env, "node_loader_impl_async_func_call_safe", &node_loader_impl_func_call_safe); + node_impl->threadsafe_func_await.initialize(env, "node_loader_impl_async_func_await_safe", &node_loader_impl_func_await_safe); + node_impl->threadsafe_func_destroy.initialize(env, "node_loader_impl_async_func_destroy_safe", &node_loader_impl_func_destroy_safe); + node_impl->threadsafe_future_await.initialize(env, "node_loader_impl_async_future_await_safe", &node_loader_impl_future_await_safe); + node_impl->threadsafe_future_delete.initialize(env, "node_loader_impl_async_future_delete_safe", &node_loader_impl_future_delete_safe); + node_impl->threadsafe_destroy.initialize(env, "node_loader_impl_async_destroy_safe", &node_loader_impl_destroy_safe); + } - /* Safe load from memory */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_load_from_memory_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_load_from_memory_safe, - (loader_impl_async_load_from_memory_safe_type **)(&node_impl->load_from_memory_safe), - &node_impl->load_from_memory_safe_ptr, - &node_impl->threadsafe_load_from_memory); - } +/* Run test function, this one can be called without thread safe mechanism */ +/* because it is run already in the correct V8 thread */ +#if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) + { + static const char test_str[] = "test"; + napi_value test_str_value; - /* Safe clear */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_clear_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_clear_safe, - (loader_impl_async_clear_safe_type **)(&node_impl->clear_safe), - &node_impl->clear_safe_ptr, - &node_impl->threadsafe_clear); - } + bool result = false; - /* Safe discover */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_discover_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_discover_safe, - (loader_impl_async_discover_safe_type **)(&node_impl->discover_safe), - &node_impl->discover_safe_ptr, - &node_impl->threadsafe_discover); - } + /* Retrieve test function from object table */ + status = napi_create_string_utf8(env, test_str, sizeof(test_str) - 1, &test_str_value); - /* Safe function call */ - { - /* TODO: Refactor this */ + node_loader_impl_exception(env, status); - // static const char threadsafe_func_name_str[] = "node_loader_impl_async_func_call_safe"; + status = napi_has_own_property(env, function_table_object, test_str_value, &result); - /* - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_func_call_safe, - (loader_impl_async_func_call_safe_type **)(&node_impl->func_call_safe), - &node_impl->func_call_safe_ptr, - &node_impl->threadsafe_func_call); - */ + node_loader_impl_exception(env, status); - /* - void node_loader_impl_thread_safe_function_initialize(napi_env env, - const char name[], size_t size, napi_value (*callback)(napi_env, napi_callback_info), T **data, - napi_value *ptr, napi_threadsafe_function *threadsafe_function) - */ + if (result == true) + { + napi_value function_trampoline_test; + napi_valuetype valuetype; - // napi_value func_call_safe_ptr; + status = napi_get_named_property(env, function_table_object, test_str, &function_trampoline_test); - // /* Initialize call safe function with context */ - // status = napi_create_function(env, nullptr, 0, &node_loader_impl_async_threadsafe_empty, nullptr, &func_call_safe_ptr); + node_loader_impl_exception(env, status); - // node_loader_impl_exception(env, status); + status = napi_typeof(env, function_trampoline_test, &valuetype); - // /* Create call safe function */ - // napi_value threadsafe_func_name; + node_loader_impl_exception(env, status); - // status = napi_create_string_utf8(env, threadsafe_func_name_str, sizeof(threadsafe_func_name_str), &threadsafe_func_name); + if (valuetype != napi_function) + { + napi_throw_type_error(env, nullptr, "Invalid function test in function table object"); + } - // node_loader_impl_exception(env, status); + /* Call to test function */ + napi_value return_value; - // // TODO: Does this number must be equivalent to the number of the threads of NodeJS? - // unsigned int processor_count = std::thread::hardware_concurrency(); - - // status = napi_create_threadsafe_function(env, func_call_safe_ptr, - // nullptr, threadsafe_func_name, - // 0, processor_count, - // nullptr, nullptr, - // nullptr, &node_loader_impl_function_call_js_func_call_safe, - // &node_impl->threadsafe_func_call); - - // node_loader_impl_exception(env, status); - - node_impl->threadsafe_func_call.initialize(env, "node_loader_impl_async_func_call_safe", &node_loader_impl_func_call_safe); - } - - /* Safe function await */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_func_await_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_func_await_safe, - (loader_impl_async_func_await_safe_type **)(&node_impl->func_await_safe), - &node_impl->func_await_safe_ptr, - &node_impl->threadsafe_func_await); - } - - /* Safe function destroy */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_func_destroy_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_func_destroy_safe, - (loader_impl_async_func_destroy_safe_type **)(&node_impl->func_destroy_safe), - &node_impl->func_destroy_safe_ptr, - &node_impl->threadsafe_func_destroy); - } - - /* Safe future await */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_future_await_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_future_await_safe, - (loader_impl_async_future_await_safe_type **)(&node_impl->future_await_safe), - &node_impl->future_await_safe_ptr, - &node_impl->threadsafe_future_await); - } - - /* Safe future delete */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_future_delete_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_future_delete_safe, - (loader_impl_async_future_delete_safe_type **)(&node_impl->future_delete_safe), - &node_impl->future_delete_safe_ptr, - &node_impl->threadsafe_future_delete); - } - - /* Safe destroy */ - { - static const char threadsafe_func_name_str[] = "node_loader_impl_async_destroy_safe"; - - node_loader_impl_thread_safe_function_initialize( - env, - threadsafe_func_name_str, sizeof(threadsafe_func_name_str), - &node_loader_impl_async_destroy_safe, - (loader_impl_async_destroy_safe_type **)(&node_impl->destroy_safe), - &node_impl->destroy_safe_ptr, - &node_impl->threadsafe_destroy); - } - } - -/* Run test function, this one can be called without thread safe mechanism */ -/* because it is run already in the correct V8 thread */ -#if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - { - static const char test_str[] = "test"; - napi_value test_str_value; - - bool result = false; - - /* Retrieve test function from object table */ - status = napi_create_string_utf8(env, test_str, sizeof(test_str) - 1, &test_str_value); - - node_loader_impl_exception(env, status); - - status = napi_has_own_property(env, function_table_object, test_str_value, &result); - - node_loader_impl_exception(env, status); - - if (result == true) - { - napi_value function_trampoline_test; - napi_valuetype valuetype; - - status = napi_get_named_property(env, function_table_object, test_str, &function_trampoline_test); - - node_loader_impl_exception(env, status); - - status = napi_typeof(env, function_trampoline_test, &valuetype); - - node_loader_impl_exception(env, status); - - if (valuetype != napi_function) - { - napi_throw_type_error(env, nullptr, "Invalid function test in function table object"); - } - - /* Call to test function */ - napi_value return_value; - - status = napi_call_function(env, global, function_trampoline_test, 0, nullptr, &return_value); + status = napi_call_function(env, global, function_trampoline_test, 0, nullptr, &return_value); node_loader_impl_exception(env, status); } @@ -4276,11 +3516,10 @@ void node_loader_impl_thread(void *data) return; } - node_impl_ptr_str_size = (size_t)node_impl_ptr_length + 1; - - node_impl_ptr_str = static_cast(malloc(sizeof(char) * node_impl_ptr_str_size)); + node_impl_ptr_str_size = static_cast(node_impl_ptr_length + 1); + node_impl_ptr_str = new char[node_impl_ptr_str_size]; - if (node_impl_ptr_str == NULL) + if (node_impl_ptr_str == nullptr) { /* Report error (TODO: Implement it with thread safe logs) */ node_impl->error_message = "Invalid node impl pointer initialization in NodeJS thread"; @@ -4299,7 +3538,6 @@ void node_loader_impl_thread(void *data) /* Get register pointer */ char *register_ptr_str; size_t register_ptr_str_size; - ssize_t register_ptr_length = snprintf(NULL, 0, "%p", (void *)&node_loader_impl_register); if (register_ptr_length <= 0) @@ -4316,13 +3554,12 @@ void node_loader_impl_thread(void *data) return; } - register_ptr_str_size = (size_t)register_ptr_length + 1; - - register_ptr_str = static_cast(malloc(sizeof(char) * register_ptr_str_size)); + register_ptr_str_size = static_cast(register_ptr_length + 1); + register_ptr_str = new char[register_ptr_str_size]; - if (register_ptr_str == NULL) + if (register_ptr_str == nullptr) { - free(node_impl_ptr_str); + delete[] node_impl_ptr_str; /* Report error (TODO: Implement it with thread safe logs) */ node_impl->error_message = "Invalid register pointer initialization in NodeJS thread"; @@ -4340,12 +3577,12 @@ void node_loader_impl_thread(void *data) /* Define argv_str contigously allocated with: executable name, bootstrap file, node impl pointer and register pointer */ size_t argv_str_size = exe_path_str_size + bootstrap_path_str_size + node_impl_ptr_str_size + register_ptr_str_size; - char *argv_str = static_cast(malloc(sizeof(char) * argv_str_size)); + char *argv_str = new char[argv_str_size]; - if (argv_str == NULL) + if (argv_str == nullptr) { - free(node_impl_ptr_str); - free(register_ptr_str); + delete[] node_impl_ptr_str; + delete[] register_ptr_str; /* Report error (TODO: Implement it with thread safe logs) */ node_impl->error_message = "Invalid argv initialization in NodeJS thread"; @@ -4367,8 +3604,8 @@ void node_loader_impl_thread(void *data) memcpy(&argv_str[exe_path_str_size + bootstrap_path_str_size], node_impl_ptr_str, node_impl_ptr_str_size); memcpy(&argv_str[exe_path_str_size + bootstrap_path_str_size + node_impl_ptr_str_size], register_ptr_str, register_ptr_str_size); - free(node_impl_ptr_str); - free(register_ptr_str); + delete[] node_impl_ptr_str; + delete[] register_ptr_str; /* Define argv */ char *argv[] = { @@ -4428,7 +3665,7 @@ void node_loader_impl_thread(void *data) uv_mutex_lock(&node_impl->mutex); node_impl->result = result; - free(argv_str); + delete[] argv_str; /* Unlock node implementation mutex */ uv_mutex_unlock(&node_impl->mutex); @@ -4508,7 +3745,7 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con } /* Initialize environment for reentrant calls */ - node_impl->env = NULL; + node_impl->env = nullptr; /* TODO: On error, delete dup, condition and mutex */ @@ -4553,9 +3790,6 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con return NULL; } - /* Initialize lock info */ - node_impl->locked.store(false); - /* Initialize execution result */ node_impl->result = 1; node_impl->error_message = NULL; @@ -4615,66 +3849,25 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con /* Call initialize function with thread safe */ { - napi_status status; + loader_impl_async_initialize_safe_type initialize_safe(node_impl, value_to_string(configuration_value(config, "loader_library_path"))); int result = 1; - /* Set up initialize safe arguments */ - node_impl->initialize_safe->node_impl = node_impl; - node_impl->initialize_safe->loader_library_path = value_to_string(configuration_value(config, "loader_library_path")); - node_impl->initialize_safe->result = 0; - /* Check if we are in the JavaScript thread */ if (node_impl->js_thread_id == std::this_thread::get_id()) { /* We are already in the V8 thread, we can call safely */ - node_loader_impl_initialize_safe(node_impl->env, node_impl->initialize_safe); + node_loader_impl_initialize_safe(node_impl->env, &initialize_safe); /* Set up return of the function call */ - result = node_impl->initialize_safe->result; + result = initialize_safe.result; } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) + else { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_initialize); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe initialize function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_initialize, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe initialize function in NodeJS loader"); - } - - /* Release initialize safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_initialize, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe initialize function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_initialize, initialize_safe); /* Set up return of the function call */ - result = node_impl->initialize_safe->result; - - node_impl->locked.store(false); - - /* Unlock the mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in node_loader_impl_initialize, the call has not been executed in order to avoid the deadlock"); + result = initialize_safe.result; } if (result != 0) @@ -4695,63 +3888,24 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con int node_loader_impl_execution_path(loader_impl impl, const loader_path path) { loader_impl_node node_impl = static_cast(loader_impl_get(impl)); - napi_status status; - if (node_impl == NULL) + if (node_impl == nullptr) { return 1; } - /* Set up load from file safe arguments */ - node_impl->execution_path_safe->node_impl = node_impl; - node_impl->execution_path_safe->path = (char *)path; + loader_impl_async_execution_path_safe_type execution_path_safe(node_impl, static_cast(path)); /* Check if we are in the JavaScript thread */ if (node_impl->js_thread_id == std::this_thread::get_id()) { /* We are already in the V8 thread, we can call safely */ - node_loader_impl_execution_path_safe(node_impl->env, node_impl->execution_path_safe); - } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_execution_path); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe load from file function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_execution_path, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe load from file function in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_execution_path, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe load from file function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); - - node_impl->locked.store(false); - - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); + node_loader_impl_execution_path_safe(node_impl->env, &execution_path_safe); } else { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in node_loader_impl_execution_path, the call has not been executed in order to avoid the deadlock"); + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_execution_path, execution_path_safe); } return 0; @@ -4760,150 +3914,53 @@ int node_loader_impl_execution_path(loader_impl impl, const loader_path path) loader_handle node_loader_impl_load_from_file(loader_impl impl, const loader_path paths[], size_t size) { loader_impl_node node_impl = static_cast(loader_impl_get(impl)); - napi_ref handle_ref = NULL; - napi_status status; - if (node_impl == NULL || size == 0) + if (node_impl == nullptr || size == 0) { return NULL; } - /* Set up load from file safe arguments */ - node_impl->load_from_file_safe->node_impl = node_impl; - node_impl->load_from_file_safe->paths = paths; - node_impl->load_from_file_safe->size = size; - node_impl->load_from_file_safe->handle_ref = NULL; + loader_impl_async_load_from_file_safe_type load_from_file_safe(node_impl, paths, size); /* Check if we are in the JavaScript thread */ if (node_impl->js_thread_id == std::this_thread::get_id()) { /* We are already in the V8 thread, we can call safely */ - node_loader_impl_load_from_file_safe(node_impl->env, node_impl->load_from_file_safe); + node_loader_impl_load_from_file_safe(node_impl->env, &load_from_file_safe); - /* Retreive the result handle */ - handle_ref = node_impl->load_from_file_safe->handle_ref; + return static_cast(load_from_file_safe.handle_ref); } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_load_from_file); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe load from file function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_load_from_file, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe load from file function in NodeJS loader"); - } - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_load_from_file, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe load from file function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); - - /* Retreive the result handle */ - handle_ref = node_impl->load_from_file_safe->handle_ref; - - node_impl->locked.store(false); - - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in node_loader_impl_load_from_file, the call has not been executed in order to avoid the deadlock"); - } + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_load_from_file, load_from_file_safe); - return static_cast(handle_ref); + return static_cast(load_from_file_safe.handle_ref); } loader_handle node_loader_impl_load_from_memory(loader_impl impl, const loader_name name, const char *buffer, size_t size) { loader_impl_node node_impl = static_cast(loader_impl_get(impl)); - napi_ref handle_ref = NULL; - napi_status status; - if (node_impl == NULL || buffer == NULL || size == 0) + if (node_impl == nullptr || buffer == NULL || size == 0) { return NULL; } - /* Set up load from memory safe arguments */ - node_impl->load_from_memory_safe->node_impl = node_impl; - node_impl->load_from_memory_safe->name = name; - node_impl->load_from_memory_safe->buffer = buffer; - node_impl->load_from_memory_safe->size = size; - node_impl->load_from_memory_safe->handle_ref = NULL; + loader_impl_async_load_from_memory_safe_type load_from_memory_safe(node_impl, name, buffer, size); /* Check if we are in the JavaScript thread */ if (node_impl->js_thread_id == std::this_thread::get_id()) { /* We are already in the V8 thread, we can call safely */ - node_loader_impl_load_from_memory_safe(node_impl->env, node_impl->load_from_memory_safe); + node_loader_impl_load_from_memory_safe(node_impl->env, &load_from_memory_safe); - /* Retreive the result handle */ - handle_ref = node_impl->load_from_memory_safe->handle_ref; + return static_cast(load_from_memory_safe.handle_ref); } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_load_from_memory); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe load from memory function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_load_from_memory, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe load from memory function in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_load_from_memory, napi_tsfn_release); - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe load from memory function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); - - /* Retreive the result handle */ - handle_ref = node_impl->load_from_memory_safe->handle_ref; - - node_impl->locked.store(false); - - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in node_loader_impl_load_from_memory, the call has not been executed in order to avoid the deadlock"); - } + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_load_from_memory, load_from_memory_safe); - return static_cast(handle_ref); + return static_cast(load_from_memory_safe.handle_ref); } loader_handle node_loader_impl_load_from_package(loader_impl impl, const loader_path path) @@ -4920,63 +3977,24 @@ int node_loader_impl_clear(loader_impl impl, loader_handle handle) { loader_impl_node node_impl = static_cast(loader_impl_get(impl)); napi_ref handle_ref = static_cast(handle); - napi_status status; if (node_impl == NULL || handle_ref == NULL) { return 1; } - /* Set up clear safe arguments */ - node_impl->clear_safe->node_impl = node_impl; - node_impl->clear_safe->handle_ref = handle_ref; + loader_impl_async_clear_safe_type clear_safe(node_impl, handle_ref); /* Check if we are in the JavaScript thread */ if (node_impl->js_thread_id == std::this_thread::get_id()) { /* We are already in the V8 thread, we can call safely */ - node_loader_impl_clear_safe(node_impl->env, node_impl->clear_safe); - } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_clear); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe clear function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_clear, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe clear function in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_clear, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe clear function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); - - node_impl->locked.store(false); - - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); + node_loader_impl_clear_safe(node_impl->env, &clear_safe); } else { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in node_loader_impl_clear, the call has not been executed in order to avoid the deadlock"); + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_clear, clear_safe); } return 0; @@ -4986,68 +4004,27 @@ int node_loader_impl_discover(loader_impl impl, loader_handle handle, context ct { loader_impl_node node_impl = static_cast(loader_impl_get(impl)); napi_ref handle_ref = static_cast(handle); - napi_status status; - if (node_impl == NULL || handle == NULL || ctx == NULL) + if (node_impl == nullptr || handle == nullptr || ctx == NULL) { return 1; } - /* Set up discover safe arguments */ - node_impl->discover_safe->node_impl = node_impl; - node_impl->discover_safe->handle_ref = handle_ref; - node_impl->discover_safe->ctx = ctx; - node_impl->discover_safe->result = 0; + loader_impl_async_discover_safe_type discover_safe(node_impl, handle_ref, ctx); /* Check if we are in the JavaScript thread */ if (node_impl->js_thread_id == std::this_thread::get_id()) { /* We are already in the V8 thread, we can call safely */ - node_loader_impl_discover_safe(node_impl->env, node_impl->discover_safe); - } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) - { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_discover); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe discover function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_discover, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe discover function in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_discover, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe discover function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); + node_loader_impl_discover_safe(node_impl->env, &discover_safe); - node_impl->locked.store(false); - - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); - } - else - { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in node_loader_impl_discover, the call has not been executed in order to avoid the deadlock"); + return discover_safe.result; } - return node_impl->discover_safe->result; + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_discover, discover_safe); + + return discover_safe.result; } #define container_of(ptr, type, member) \ @@ -5112,7 +4089,7 @@ static void node_loader_impl_destroy_check_cb(uv_check_t *handle) node_loader_impl_destroy_cb(node_impl); } -void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe destroy_safe) +void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe_type *destroy_safe) { napi_status status; napi_handle_scope handle_scope; @@ -5128,6 +4105,7 @@ void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe if (node_loader_impl_user_async_handles_count(node_impl) <= 0 || node_impl->event_loop_empty.load() == true) { node_loader_impl_destroy_safe_impl(node_impl, env); + destroy_safe->has_finished = true; } else { @@ -5248,38 +4226,6 @@ void node_loader_impl_print_handles(loader_impl_node node_impl) */ } -napi_value node_loader_impl_async_destroy_safe(napi_env env, napi_callback_info info) -{ - loader_impl_node node_impl; - loader_impl_async_safe_cast destroy_cast = { NULL }; - - napi_status status = napi_get_cb_info(env, info, nullptr, nullptr, nullptr, &destroy_cast.ptr); - - node_loader_impl_exception(env, status); - - /* Lock the call safe mutex and get the parameters */ - uv_mutex_lock(&destroy_cast.safe->node_impl->mutex); - - /* Store node impl reference because destroy_safe gets deteled after calling node_loader_impl_destroy_safe */ - node_impl = destroy_cast.safe->node_impl; - - /* Store environment for reentrant calls */ - node_impl->env = env; - - /* Call to the implementation function */ - node_loader_impl_destroy_safe(env, destroy_cast.safe); - - /* Clear environment */ - // node_impl->env = NULL; - - /* Signal destroy condition */ - uv_cond_signal(&node_impl->cond); - - uv_mutex_unlock(&node_impl->mutex); - - return nullptr; -} - #if 0 void node_loader_impl_walk(uv_handle_t *handle, void *arg) { @@ -5308,89 +4254,19 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env /* Destroy children loaders */ loader_unload_children(node_impl->impl); - /* Clear thread safe functions */ + /* Clear thread safe functions except by destroy one */ { - /* Safe initialize */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_initialize, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe execution path */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_execution_path, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe load from file */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_load_from_file, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe load from memory */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_load_from_memory, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe clear */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_clear, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe discover */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_discover, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe function call */ - { - node_impl->threadsafe_func_call.abort(env); - } - - /* Safe function await */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_func_await, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe function destroy */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_func_destroy, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe future await */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_future_await, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe future delete */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_future_delete, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } - - /* Safe destroy */ - { - status = napi_release_threadsafe_function(node_impl->threadsafe_destroy, napi_tsfn_abort); - - node_loader_impl_exception(env, status); - } + node_impl->threadsafe_initialize.abort(env); + node_impl->threadsafe_execution_path.abort(env); + node_impl->threadsafe_load_from_file.abort(env); + node_impl->threadsafe_load_from_memory.abort(env); + node_impl->threadsafe_clear.abort(env); + node_impl->threadsafe_discover.abort(env); + node_impl->threadsafe_func_call.abort(env); + node_impl->threadsafe_func_await.abort(env); + node_impl->threadsafe_func_destroy.abort(env); + node_impl->threadsafe_future_await.abort(env); + node_impl->threadsafe_future_delete.abort(env); } /* Clear persistent references */ @@ -5473,57 +4349,23 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env void node_loader_impl_try_destroy(loader_impl_node node_impl) { - napi_status status; - - /* Set up destroy safe arguments */ - node_impl->destroy_safe->node_impl = node_impl; + loader_impl_async_destroy_safe_type destroy_safe(node_impl); /* Check if we are in the JavaScript thread */ if (node_impl->js_thread_id == std::this_thread::get_id()) { /* We are already in the V8 thread, we can call safely */ - node_loader_impl_destroy_safe(node_impl->env, node_impl->destroy_safe); + node_loader_impl_destroy_safe(node_impl->env, &destroy_safe); } - /* Lock the mutex and set the parameters */ - else if (node_impl->locked.load() == false && uv_mutex_trylock(&node_impl->mutex) == 0) + else { - node_impl->locked.store(true); - - /* Acquire the thread safe function in order to do the call */ - status = napi_acquire_threadsafe_function(node_impl->threadsafe_destroy); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to aquire thread safe destroy function in NodeJS loader"); - } - - /* Execute the thread safe call in a nonblocking manner */ - status = napi_call_threadsafe_function(node_impl->threadsafe_destroy, nullptr, napi_tsfn_nonblocking); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to call to thread safe destroy function in NodeJS loader"); - } - - /* Release call safe function */ - status = napi_release_threadsafe_function(node_impl->threadsafe_destroy, napi_tsfn_release); - - if (status != napi_ok) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid to release thread safe destroy function in NodeJS loader"); - } - - /* Wait for the execution of the safe call */ - uv_cond_wait(&node_impl->cond, &node_impl->mutex); - - node_impl->locked.store(false); - - /* Unlock call safe mutex */ - uv_mutex_unlock(&node_impl->mutex); + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_destroy, destroy_safe); } - else + + if (destroy_safe.has_finished) { - log_write("metacall", LOG_LEVEL_ERROR, "Potential deadlock detected in node_loader_impl_destroy, the call has not been executed in order to avoid the deadlock"); + node_impl->threadsafe_destroy.abort(node_impl->env); } } @@ -5548,20 +4390,6 @@ int node_loader_impl_destroy(loader_impl impl) /* Clear mutex syncronization object */ uv_mutex_destroy(&node_impl->mutex); - /* Delete all safe pointers for the queues */ - delete node_impl->initialize_safe; - delete node_impl->execution_path_safe; - delete node_impl->load_from_file_safe; - delete node_impl->load_from_memory_safe; - delete node_impl->clear_safe; - delete node_impl->discover_safe; - // delete node_impl->func_call_safe; - delete node_impl->func_await_safe; - delete node_impl->func_destroy_safe; - delete node_impl->future_await_safe; - delete node_impl->future_delete_safe; - delete node_impl->destroy_safe; - #ifdef __ANDROID__ /* Close file descriptors */ close(node_impl->pfd[0]); diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index c0b32d299..6806c240c 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -49,11 +49,11 @@ napi_value node_loader_port_metacall(napi_env env, napi_callback_info info) { size_t argc = 0; - napi_get_cb_info(env, info, &argc, NULL, NULL, NULL); + napi_get_cb_info(env, info, &argc, nullptr, nullptr, nullptr); if (argc == 0) { - napi_throw_error(env, NULL, "Invalid number of arguments"); + napi_throw_error(env, nullptr, "Invalid number of arguments"); return nullptr; } @@ -62,17 +62,16 @@ napi_value node_loader_port_metacall(napi_env env, napi_callback_info info) void **args = new void *[argc - 1]; napi_value recv; - napi_get_cb_info(env, info, &argc, argv, &recv, NULL); + napi_get_cb_info(env, info, &argc, argv, &recv, nullptr); size_t name_length; - - napi_status status = napi_get_value_string_utf8(env, argv[0], NULL, 0, &name_length); + napi_status status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &name_length); char *name = new char[name_length + 1]; if (name == nullptr) { - napi_throw_error(env, NULL, "Invalid function name allocation"); + napi_throw_error(env, nullptr, "Invalid function name allocation"); return nullptr; } @@ -106,7 +105,7 @@ napi_value node_loader_port_metacall(napi_env env, napi_callback_info info) } /* Release current reference of the environment */ - // node_loader_impl_env(node_impl, NULL); + // node_loader_impl_env(node_impl, nullptr); for (size_t args_count = 0; args_count < argc - 1; ++args_count) { @@ -126,11 +125,11 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info { size_t argc = 0; - napi_get_cb_info(env, info, &argc, NULL, NULL, NULL); + napi_get_cb_info(env, info, &argc, nullptr, nullptr, nullptr); if (argc == 0) { - napi_throw_error(env, NULL, "Invalid number of arguments"); + napi_throw_error(env, nullptr, "Invalid number of arguments"); return nullptr; } @@ -139,17 +138,17 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info void **args = new void *[argc - 1]; napi_value recv; - napi_get_cb_info(env, info, &argc, argv, &recv, NULL); + napi_get_cb_info(env, info, &argc, argv, &recv, nullptr); size_t name_length; - napi_status status = napi_get_value_string_utf8(env, argv[0], NULL, 0, &name_length); + napi_status status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &name_length); char *name = new char[name_length + 1]; if (name == nullptr) { - napi_throw_error(env, NULL, "Invalid function name allocation"); + napi_throw_error(env, nullptr, "Invalid function name allocation"); return nullptr; } @@ -176,7 +175,7 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info if (ctx == nullptr) { - napi_throw_error(env, NULL, "Failed to allocate the promise context"); + napi_throw_error(env, nullptr, "Failed to allocate the promise context"); return nullptr; } @@ -188,7 +187,7 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info if (status != napi_ok) { - napi_throw_error(env, NULL, "Failed to create the promise"); + napi_throw_error(env, nullptr, "Failed to create the promise"); delete ctx; @@ -205,7 +204,7 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info if (status != napi_ok) { - napi_throw_error(ctx->env, NULL, "Failed to resolve the promise"); + napi_throw_error(ctx->env, nullptr, "Failed to resolve the promise"); } delete ctx; @@ -220,7 +219,7 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info if (status != napi_ok) { - napi_throw_error(ctx->env, NULL, "Failed to reject the promise"); + napi_throw_error(ctx->env, nullptr, "Failed to reject the promise"); } delete ctx; @@ -242,7 +241,7 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info */ /* Release current reference of the environment */ - // node_loader_impl_env(node_impl, NULL); + // node_loader_impl_env(node_impl, nullptr); for (size_t args_count = 0; args_count < argc - 1; ++args_count) { @@ -266,19 +265,18 @@ napi_value node_loader_port_metacall_load_from_file(napi_env env, napi_callback_ size_t argc = args_size, tag_length; napi_value argv[args_size]; uint32_t paths_size, path_index = 0; - char *tag; - napi_get_cb_info(env, info, &argc, argv, NULL, NULL); + napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - napi_get_value_string_utf8(env, argv[0], NULL, 0, &tag_length); + napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); if (tag_length == 0) { - napi_throw_error(env, NULL, "Invalid MetaCall tag"); - return NULL; + napi_throw_error(env, nullptr, "Invalid MetaCall tag"); + return nullptr; } - tag = new char[tag_length + 1]; + char *tag = new char[tag_length + 1]; napi_get_value_string_utf8(env, argv[0], tag, tag_length + 1, &tag_length); @@ -295,7 +293,7 @@ napi_value node_loader_port_metacall_load_from_file(napi_env env, napi_callback_ napi_get_element(env, argv[1], i, &path); - napi_get_value_string_utf8(env, path, NULL, 0, &path_length); + napi_get_value_string_utf8(env, path, nullptr, 0, &path_length); if (path_length != 0) { @@ -318,17 +316,17 @@ napi_value node_loader_port_metacall_load_from_file(napi_env env, napi_callback_ /* Store current reference of the environment */ node_loader_impl_env(node_impl, env); - if (metacall_load_from_file(tag, (const char **)paths, paths_size, NULL) != 0) + if (metacall_load_from_file(tag, const_cast(paths), paths_size, NULL) != 0) { - napi_throw_error(env, NULL, "MetaCall could not load from file"); + napi_throw_error(env, nullptr, "MetaCall could not load from file"); } /* Release current reference of the environment */ - // node_loader_impl_env(node_impl, NULL); + // node_loader_impl_env(node_impl, nullptr); } else { - napi_throw_error(env, NULL, "Invalid input paths"); + napi_throw_error(env, nullptr, "Invalid input paths"); } delete[] tag; @@ -340,7 +338,7 @@ napi_value node_loader_port_metacall_load_from_file(napi_env env, napi_callback_ delete[] paths; - return NULL; + return nullptr; } napi_value node_loader_port_metacall_load_from_file_export(napi_env env, napi_callback_info info) @@ -351,19 +349,18 @@ napi_value node_loader_port_metacall_load_from_file_export(napi_env env, napi_ca size_t argc = args_size, tag_length; napi_value argv[args_size]; uint32_t paths_size, path_index = 0; - char *tag; - napi_get_cb_info(env, info, &argc, argv, NULL, NULL); + napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); - napi_get_value_string_utf8(env, argv[0], NULL, 0, &tag_length); + napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); if (tag_length == 0) { - napi_throw_error(env, NULL, "Invalid MetaCall tag"); - return NULL; + napi_throw_error(env, nullptr, "Invalid MetaCall tag"); + return nullptr; } - tag = new char[tag_length + 1]; + char *tag = new char[tag_length + 1]; napi_get_value_string_utf8(env, argv[0], tag, tag_length + 1, &tag_length); @@ -380,7 +377,7 @@ napi_value node_loader_port_metacall_load_from_file_export(napi_env env, napi_ca napi_get_element(env, argv[1], i, &path); - napi_get_value_string_utf8(env, path, NULL, 0, &path_length); + napi_get_value_string_utf8(env, path, nullptr, 0, &path_length); if (path_length != 0) { @@ -401,22 +398,22 @@ napi_value node_loader_port_metacall_load_from_file_export(napi_env env, napi_ca { /* Obtain NodeJS loader implementation */ loader_impl impl = loader_get_impl(node_loader_tag); - node_impl = (loader_impl_node)loader_impl_get(impl); + node_impl = static_cast(loader_impl_get(impl)); /* Store current reference of the environment */ node_loader_impl_env(node_impl, env); - if (metacall_load_from_file(tag, (const char **)paths, paths_size, &handle) != 0) + if (metacall_load_from_file(tag, const_cast(paths), paths_size, &handle) != 0) { - napi_throw_error(env, NULL, "MetaCall could not load from file"); + napi_throw_error(env, nullptr, "MetaCall could not load from file"); } /* Release current reference of the environment */ - // node_loader_impl_env(node_impl, NULL); + // node_loader_impl_env(node_impl, nullptr); } else { - napi_throw_error(env, NULL, "Invalid input paths"); + napi_throw_error(env, nullptr, "Invalid input paths"); } delete[] tag; @@ -453,28 +450,26 @@ napi_value node_loader_port_metacall_load_from_file_export(napi_env env, napi_ca napi_value node_loader_port_metacall_load_from_memory(napi_env env, napi_callback_info info) { const size_t args_size = 2; - size_t argc = args_size, tag_length, script_length, script_size; + size_t argc = args_size, tag_length, script_length; napi_value argv[args_size]; - napi_status status; - char *tag, *script; // Get arguments - status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL); + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); node_loader_impl_exception(env, status); // Get tag length - status = napi_get_value_string_utf8(env, argv[0], NULL, 0, &tag_length); + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); node_loader_impl_exception(env, status); // Allocate tag - tag = static_cast(malloc(sizeof(char) * (tag_length + 1))); + char *tag = new char[tag_length + 1]; - if (tag == NULL) + if (tag == nullptr) { - napi_throw_error(env, NULL, "MetaCall could not load from memory, tag allocation failed"); - return NULL; + napi_throw_error(env, nullptr, "MetaCall could not load from memory, tag allocation failed"); + return nullptr; } // Get tag @@ -483,20 +478,20 @@ napi_value node_loader_port_metacall_load_from_memory(napi_env env, napi_callbac node_loader_impl_exception(env, status); // Get script length - status = napi_get_value_string_utf8(env, argv[1], NULL, 0, &script_length); + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &script_length); node_loader_impl_exception(env, status); - script_size = script_length + 1; + size_t script_size = script_length + 1; // Allocate script - script = static_cast(malloc(sizeof(char) * script_size)); + char *script = new char[script_size]; - if (script == NULL) + if (script == nullptr) { - free(tag); - napi_throw_error(env, NULL, "MetaCall could not load from memory, script allocation failed"); - return NULL; + delete[] tag; + napi_throw_error(env, nullptr, "MetaCall could not load from memory, script allocation failed"); + return nullptr; } // Get script @@ -514,44 +509,42 @@ napi_value node_loader_port_metacall_load_from_memory(napi_env env, napi_callbac // Load script from memory if (metacall_load_from_memory(tag, script, script_size, NULL) != 0) { - napi_throw_error(env, NULL, "MetaCall could not load from memory"); + napi_throw_error(env, nullptr, "MetaCall could not load from memory"); } /* Release current reference of the environment */ - // node_loader_impl_env(node_impl, NULL); + // node_loader_impl_env(node_impl, nullptr); - free(tag); - free(script); + delete[] tag; + delete[] script; /* TODO: Return value and logs */ - return NULL; + return nullptr; } napi_value node_loader_port_metacall_load_from_memory_export(napi_env env, napi_callback_info info) { const size_t args_size = 2; - size_t argc = args_size, tag_length, script_length, script_size; + size_t argc = args_size, tag_length, script_length; napi_value argv[args_size]; - napi_status status; - char *tag, *script; // Get arguments - status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL); + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); node_loader_impl_exception(env, status); // Get tag length - status = napi_get_value_string_utf8(env, argv[0], NULL, 0, &tag_length); + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); node_loader_impl_exception(env, status); // Allocate tag - tag = static_cast(malloc(sizeof(char) * (tag_length + 1))); + char *tag = new char[tag_length + 1]; - if (tag == NULL) + if (tag == nullptr) { - napi_throw_error(env, NULL, "MetaCall could not load from memory, tag allocation failed"); - return NULL; + napi_throw_error(env, nullptr, "MetaCall could not load from memory, tag allocation failed"); + return nullptr; } // Get tag @@ -560,20 +553,20 @@ napi_value node_loader_port_metacall_load_from_memory_export(napi_env env, napi_ node_loader_impl_exception(env, status); // Get script length - status = napi_get_value_string_utf8(env, argv[1], NULL, 0, &script_length); + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &script_length); node_loader_impl_exception(env, status); - script_size = script_length + 1; + size_t script_size = script_length + 1; // Allocate script - script = static_cast(malloc(sizeof(char) * script_size)); + char *script = new char[script_size]; - if (script == NULL) + if (script == nullptr) { - free(tag); - napi_throw_error(env, NULL, "MetaCall could not load from memory, script allocation failed"); - return NULL; + delete[] tag; + napi_throw_error(env, nullptr, "MetaCall could not load from memory, script allocation failed"); + return nullptr; } // Get script @@ -593,14 +586,14 @@ napi_value node_loader_port_metacall_load_from_memory_export(napi_env env, napi_ // Load script from memory if (metacall_load_from_memory(tag, script, script_size, &handle) != 0) { - napi_throw_error(env, NULL, "MetaCall could not load from memory"); + napi_throw_error(env, nullptr, "MetaCall could not load from memory"); } /* Release current reference of the environment */ - // node_loader_impl_env(node_impl, NULL); + // node_loader_impl_env(node_impl, nullptr); - free(tag); - free(script); + delete[] tag; + delete[] script; void *exports = metacall_handle_export(handle); @@ -626,26 +619,24 @@ napi_value node_loader_port_metacall_load_from_configuration(napi_env env, napi_ const size_t args_size = 1; size_t argc = args_size, path_length; napi_value argv[args_size]; - napi_status status; - char *path; // Get arguments - status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL); + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); node_loader_impl_exception(env, status); // Get tag length - status = napi_get_value_string_utf8(env, argv[0], NULL, 0, &path_length); + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &path_length); node_loader_impl_exception(env, status); // Allocate path - path = static_cast(malloc(sizeof(char) * (path_length + 1))); + char *path = new char[path_length + 1]; - if (path == NULL) + if (path == nullptr) { - napi_throw_error(env, NULL, "MetaCall could not load from configuration, path allocation failed"); - return NULL; + napi_throw_error(env, nullptr, "MetaCall could not load from configuration, path allocation failed"); + return nullptr; } // Get path @@ -655,7 +646,7 @@ napi_value node_loader_port_metacall_load_from_configuration(napi_env env, napi_ /* Obtain NodeJS loader implementation */ loader_impl impl = loader_get_impl(node_loader_tag); - loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + loader_impl_node node_impl = static_cast(loader_impl_get(impl)); /* Store current reference of the environment */ node_loader_impl_env(node_impl, env); @@ -667,18 +658,18 @@ napi_value node_loader_port_metacall_load_from_configuration(napi_env env, napi_ if (metacall_load_from_configuration(path, NULL, allocator) != 0) { - napi_throw_error(env, NULL, "MetaCall could not load from configuration"); + napi_throw_error(env, nullptr, "MetaCall could not load from configuration"); } metacall_allocator_destroy(allocator); /* Release current reference of the environment */ - // node_loader_impl_env(node_impl, NULL); + // node_loader_impl_env(node_impl, nullptr); - free(path); + delete[] path; /* TODO: Return value and logs */ - return NULL; + return nullptr; } napi_value node_loader_port_metacall_load_from_configuration_export(napi_env env, napi_callback_info info) @@ -686,26 +677,24 @@ napi_value node_loader_port_metacall_load_from_configuration_export(napi_env env const size_t args_size = 1; size_t argc = args_size, path_length; napi_value argv[args_size]; - napi_status status; - char *path; // Get arguments - status = napi_get_cb_info(env, info, &argc, argv, NULL, NULL); + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); node_loader_impl_exception(env, status); // Get tag length - status = napi_get_value_string_utf8(env, argv[0], NULL, 0, &path_length); + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &path_length); node_loader_impl_exception(env, status); // Allocate path - path = static_cast(malloc(sizeof(char) * (path_length + 1))); + char *path = new char[path_length + 1]; - if (path == NULL) + if (path == nullptr) { - napi_throw_error(env, NULL, "MetaCall could not load from configuration, path allocation failed"); - return NULL; + napi_throw_error(env, nullptr, "MetaCall could not load from configuration, path allocation failed"); + return nullptr; } // Get path @@ -715,7 +704,7 @@ napi_value node_loader_port_metacall_load_from_configuration_export(napi_env env /* Obtain NodeJS loader implementation */ loader_impl impl = loader_get_impl(node_loader_tag); - loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + loader_impl_node node_impl = static_cast(loader_impl_get(impl)); /* Store current reference of the environment */ node_loader_impl_env(node_impl, env); @@ -729,15 +718,15 @@ napi_value node_loader_port_metacall_load_from_configuration_export(napi_env env if (metacall_load_from_configuration(path, &handle, allocator) != 0) { - napi_throw_error(env, NULL, "MetaCall could not load from configuration"); + napi_throw_error(env, nullptr, "MetaCall could not load from configuration"); } metacall_allocator_destroy(allocator); /* Release current reference of the environment */ - // node_loader_impl_env(node_impl, NULL); + // node_loader_impl_env(node_impl, nullptr); - free(path); + delete[] path; void *exports = metacall_handle_export(handle); @@ -751,24 +740,18 @@ napi_value node_loader_port_metacall_load_from_configuration_export(napi_env env /* TODO: Add documentation */ napi_value node_loader_port_metacall_inspect(napi_env env, napi_callback_info) { - napi_value result; - size_t size = 0; - struct metacall_allocator_std_type std_ctx = { &malloc, &realloc, &free }; - void *allocator = metacall_allocator_create(METACALL_ALLOCATOR_STD, (void *)&std_ctx); - char *inspect_str = metacall_inspect(&size, allocator); - napi_status status; - if (!(inspect_str != NULL && size != 0)) { - napi_throw_error(env, NULL, "Invalid MetaCall inspect string"); + napi_throw_error(env, nullptr, "Invalid MetaCall inspect string"); } - status = napi_create_string_utf8(env, inspect_str, size - 1, &result); + napi_value result; + napi_status status = napi_create_string_utf8(env, inspect_str, size - 1, &result); node_loader_impl_exception(env, status); @@ -784,12 +767,12 @@ napi_value node_loader_port_metacall_logs(napi_env env, napi_callback_info) { struct metacall_log_stdio_type log_stdio = { stdout }; - if (metacall_log(METACALL_LOG_STDIO, (void *)&log_stdio) != 0) + if (metacall_log(METACALL_LOG_STDIO, static_cast(&log_stdio)) != 0) { - napi_throw_error(env, NULL, "MetaCall failed to initialize debug logs"); + napi_throw_error(env, nullptr, "MetaCall failed to initialize debug logs"); } - return NULL; + return nullptr; } /* TODO: Review documentation */ @@ -801,7 +784,7 @@ void node_loader_port_exports(napi_env env, napi_value exports) { \ const char PREPROCESSOR_CONCAT(function_str_, name)[] = PREPROCESSOR_STRINGIFY(name); \ napi_value PREPROCESSOR_CONCAT(function_, name); \ - napi_create_function(env, PREPROCESSOR_CONCAT(function_str_, name), sizeof(PREPROCESSOR_CONCAT(function_str_, name)) - 1, PREPROCESSOR_CONCAT(node_loader_port_, name), NULL, &PREPROCESSOR_CONCAT(function_, name)); \ + napi_create_function(env, PREPROCESSOR_CONCAT(function_str_, name), sizeof(PREPROCESSOR_CONCAT(function_str_, name)) - 1, PREPROCESSOR_CONCAT(node_loader_port_, name), nullptr, &PREPROCESSOR_CONCAT(function_, name)); \ napi_set_named_property(env, exports, PREPROCESSOR_CONCAT(function_str_, name), PREPROCESSOR_CONCAT(function_, name)); \ } while (0) @@ -833,9 +816,9 @@ napi_value node_loader_port_initialize(napi_env env, napi_value exports) if (metacall_initialize() != 0) { /* TODO: Show error message (when error handling is properly implemented in the core lib) */ - napi_throw_error(env, NULL, "MetaCall failed to initialize"); + napi_throw_error(env, nullptr, "MetaCall failed to initialize"); - return NULL; + return nullptr; } #endif From 1129214e756ec0dfd4fe182c34ec017c26a70528 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 22 May 2024 17:10:13 +0200 Subject: [PATCH 006/487] Solve more issues with node loader, the refactor is working now. --- .../node_loader/source/node_loader_impl.cpp | 27 ++++++++++--------- .../ts_loader/source/ts_loader_impl.cpp | 5 +--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 2941b1800..245773d8a 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -1572,19 +1572,22 @@ void function_node_interface_destroy(function func, function_impl impl) return; } - loader_impl_node node_impl = node_func->node_impl; - loader_impl_async_func_destroy_safe_type func_destroy_safe(node_impl, node_func); - - /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) - { - /* We are already in the V8 thread, we can call safely */ - node_loader_impl_func_destroy_safe(node_impl->env, &func_destroy_safe); - } - else + if (loader_is_destroyed(node_func->node_impl->impl) != 0) { - /* Submit the task to the async queue */ - loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_func_destroy, func_destroy_safe); + loader_impl_node node_impl = node_func->node_impl; + loader_impl_async_func_destroy_safe_type func_destroy_safe(node_impl, node_func); + + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_func_destroy_safe(node_impl->env, &func_destroy_safe); + } + else + { + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_func_destroy, func_destroy_safe); + } } /* Free node function arguments */ diff --git a/source/loaders/ts_loader/source/ts_loader_impl.cpp b/source/loaders/ts_loader/source/ts_loader_impl.cpp index 10af5b588..6be97f9f0 100644 --- a/source/loaders/ts_loader/source/ts_loader_impl.cpp +++ b/source/loaders/ts_loader/source/ts_loader_impl.cpp @@ -402,13 +402,10 @@ static void *ts_loader_impl_destroy_unload_children_cb(size_t size, void *args[] else { loader_impl impl = static_cast(metacall_value_to_ptr(args[0])); - /* TODO: Should we let Node Loader destroy our handle? */ - /*void *ts_impl = static_cast(loader_impl_get(impl));*/ loader_unload_children(impl); - /* TODO: Should we let Node Loader destroy our handle? */ - return metacall_value_create_bool(/*metacall_clear(ts_impl)*/ 1L); + return metacall_value_create_bool(1L); } } From 1edf4c4953dda3ff989b428f70612cfe79c0acaa Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 22 May 2024 17:10:33 +0200 Subject: [PATCH 007/487] Corrected message from cli command plugins. --- source/cli/plugins/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/cli/plugins/CMakeLists.txt b/source/cli/plugins/CMakeLists.txt index 85bf75fd9..2ca9c31fc 100644 --- a/source/cli/plugins/CMakeLists.txt +++ b/source/cli/plugins/CMakeLists.txt @@ -36,7 +36,7 @@ add_subdirectory(cli_core_plugin) # NodeJS added util.parseArgs([config]) in versions v18.3.0, v16.17.0 # Check for compatibility, otherwise use fallback command parser in the CLI if(NOT (NodeJS_VERSION VERSION_GREATER_EQUAL "18.3.0" OR (NodeJS_VERSION_MAJOR LESS 18 AND NodeJS_VERSION VERSION_GREATER_EQUAL "16.17.0"))) - message(WARNING "NodeJS version ${NodeJS_VERSION} does not support ${target}, at least v18.3.0 or v16.17.0 are required, using fallback command parser") + message(WARNING "NodeJS version ${NodeJS_VERSION} does not support CLI command line plugins, at least v18.3.0 or v16.17.0 are required, using fallback command parser") return() endif() From a2ee85abc608bfe570b935cf624b71a49d89bad8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 22 May 2024 17:35:36 +0200 Subject: [PATCH 008/487] Trying to solve issues with FindNodeJS.cmake. --- cmake/FindNodeJS.cmake | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/cmake/FindNodeJS.cmake b/cmake/FindNodeJS.cmake index 863e9f9b9..0e325fda1 100644 --- a/cmake/FindNodeJS.cmake +++ b/cmake/FindNodeJS.cmake @@ -289,10 +289,17 @@ if(NodeJS_INCLUDE_DIR) # Get node module version find_file(NodeJS_VERSION_FILE_PATH node_version.h PATHS ${NodeJS_INCLUDE_DIR} - PATH_SUFFIXES ${NodeJS_INCLUDE_SUFFIXES} DOC "NodeJS JavaScript Version Header" ) + if(NOT NodeJS_VERSION_FILE_PATH) + find_file(NodeJS_VERSION_FILE_PATH node_version.h + PATHS ${NodeJS_INCLUDE_DIR} + PATH_SUFFIXES ${NodeJS_INCLUDE_SUFFIXES} + DOC "NodeJS JavaScript Version Header" + ) + endif() + if(NodeJS_VERSION_FILE_PATH) file(READ ${NodeJS_VERSION_FILE_PATH} NodeJS_VERSION_FILE) @@ -367,21 +374,30 @@ if(NodeJS_MODULE_VERSION) if(NOT NodeJS_BUILD_FROM_SOURCE) message(STATUS "Searching NodeJS library version ${NodeJS_MODULE_VERSION}") - if(WIN32) - set(NodeJS_LIBRARY_PATH "C:/Program Files/nodejs") - else() - set(NodeJS_LIBRARY_PATH "/usr/local/lib") - endif() - - set(NodeJS_SYSTEM_LIBRARY_PATH "/lib/x86_64-linux-gnu" "/usr/lib/x86_64-linux-gnu") # TODO: Add others - # Find library find_library(NodeJS_LIBRARY NAMES ${NodeJS_LIBRARY_NAMES} - PATHS ${NodeJS_LIBRARY_PATH} ${NodeJS_SYSTEM_LIBRARY_PATH} + HINTS ${NodeJS_PATHS} + PATH_SUFFIXES lib DOC "NodeJS JavaScript Runtime Library" ) + if(NOT NodeJS_LIBRARY) + if(WIN32) + set(NodeJS_LIBRARY_PATH "C:/Program Files/nodejs") + else() + set(NodeJS_LIBRARY_PATH "/usr/local/lib" "/usr/lib") + endif() + + set(NodeJS_SYSTEM_LIBRARY_PATH "/lib/x86_64-linux-gnu" "/usr/lib/x86_64-linux-gnu") # TODO: Add others + + find_library(NodeJS_LIBRARY + NAMES ${NodeJS_LIBRARY_NAMES} + PATHS ${NodeJS_LIBRARY_PATH} ${NodeJS_SYSTEM_LIBRARY_PATH} + DOC "NodeJS JavaScript Runtime Library" + ) + endif() + if(NodeJS_LIBRARY) message(STATUS "NodeJS Library Found") endif() From 39f7016a3e178d3ff470660dc2f93e7634172769 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 23 May 2024 21:52:50 +0200 Subject: [PATCH 009/487] Solve issue with mac and npm. --- tools/metacall-environment.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 875bd0b8b..45fb41a6b 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -512,6 +512,9 @@ sub_nodejs(){ echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/bin/node" >> $CMAKE_CONFIG_PATH # echo "-DNodeJS_INCLUDE_DIR=$NODE_PREFIX/include/node" >> $CMAKE_CONFIG_PATH # echo "-DNodeJS_LIBRARY=$NODE_PREFIX/lib/libnode.93.dylib" >> $CMAKE_CONFIG_PATH + + # Configure NPM path + echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH fi } From f5950993ec8ae9b8fe08cf95fddf260e00b399e5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 28 May 2024 17:12:40 +0200 Subject: [PATCH 010/487] Solve issue with macos gnucobol. --- tools/metacall-environment.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 45fb41a6b..6f4f084f5 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -687,10 +687,10 @@ sub_cobol(){ $SUDO_CMD apk add --no-cache db ncurses fi elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then - brew install gnu-cobol + brew install gnucobol mkdir -p build CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" - COBOL_PREFIX=$(brew --prefix gnu-cobol) + COBOL_PREFIX=$(brew --prefix gnucobol) echo "-DCOBOL_EXECUTABLE=${COBOL_PREFIX}/bin/cobc" >> $CMAKE_CONFIG_PATH echo "-DCOBOL_INCLUDE_DIR=${COBOL_PREFIX}/include" >> $CMAKE_CONFIG_PATH echo "-DCOBOL_LIBRARY=${COBOL_PREFIX}/lib/libcob.dylib" >> $CMAKE_CONFIG_PATH From ab4385b19a3158f558536f3274533c7e3d0f1717 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 28 May 2024 17:13:30 +0200 Subject: [PATCH 011/487] Add suppressions for NodeJS and address sanitizer. --- source/tests/sanitizer/tsan.supp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/tests/sanitizer/tsan.supp b/source/tests/sanitizer/tsan.supp index 52d089548..5bd3dc515 100644 --- a/source/tests/sanitizer/tsan.supp +++ b/source/tests/sanitizer/tsan.supp @@ -21,6 +21,26 @@ race:v8::platform::DefaultJobState::~DefaultJobState race:v8::internal::ScavengerCollector::JobTask::~JobTask race:heap::base::Worklist, (unsigned short)256>::Local::Pop(std::pair*) # +# After version 108, NodeJS has started to fail without stack trace, for example: +# +# WARNING: ThreadSanitizer: data race (pid=5179) +# Write of size 8 at 0x723000007538 by thread T4: +# #0 operator delete(void*, unsigned long) ../../../../src/libsanitizer/tsan/tsan_new_delete.cpp:150 (libtsan.so.2+0x9b42b) (BuildId: f23ac1bd2939198f3fef776fd2a1312e536dcf1b) +# #1 (libnode.so.109+0xdb8fa9) (BuildId: fa61d14d9def07b0f94f901c16a182f9e3a944ae) +# +# Now if we use addr2line: +# +# addr2line -f -e /lib/x86_64-linux-gnu/libnode.so.109 0xdb8fa9 +# _ZN2v88platform16DefaultJobWorkerD0Ev +# ??:? +# +# The symbols are exactly the same of the well known suppressions already listed before +# I have tried compiling NodeJS with thread sanitizer support and also using llvm-symbolizer +# but I had no luck making those symbols work in the last stack traces, so for now.. I am going +# to suppress all data races from NodeJS in order to avoid false positives. +# +race:libnode* +# # Ruby # #called_from_lib:libruby* From d93a36b0e102f4e386f1283e8ffe2aa17610db96 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 28 May 2024 17:17:56 +0200 Subject: [PATCH 012/487] Disable test for cmd sandboxing if target is not found. --- source/cli/metacallcli/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/cli/metacallcli/CMakeLists.txt b/source/cli/metacallcli/CMakeLists.txt index 7df77fa87..2b15756eb 100644 --- a/source/cli/metacallcli/CMakeLists.txt +++ b/source/cli/metacallcli/CMakeLists.txt @@ -504,7 +504,7 @@ if(OPTION_BUILD_LOADERS AND OPTION_BUILD_LOADERS_TS AND OPTION_BUILD_SCRIPTS AND endif() endif() -if(OPTION_BUILD_LOADERS AND OPTION_BUILD_LOADERS_EXT AND OPTION_BUILD_EXTENSIONS AND OPTION_BUILD_LOADERS_NODE AND OPTION_BUILD_LOADERS_PY AND OPTION_BUILD_PLUGINS_SANDBOX AND PROJECT_OS_FAMILY STREQUAL unix) +if(OPTION_BUILD_LOADERS AND OPTION_BUILD_LOADERS_EXT AND OPTION_BUILD_EXTENSIONS AND OPTION_BUILD_LOADERS_NODE AND OPTION_BUILD_LOADERS_PY AND OPTION_BUILD_PLUGINS_SANDBOX AND PROJECT_OS_FAMILY STREQUAL unix AND TARGET cli_sandbox_plugin) if(NOT OPTION_BUILD_THREAD_SANITIZER AND NOT OPTION_BUILD_ADDRESS_SANITIZER) add_test(NAME ${target}-cmd-sandboxing COMMAND ${CMAKE_COMMAND} -E env $ --sandboxing --disable_time time.py From be5634529f1797cf58624bb8ef68c9a9dca9b435 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 30 May 2024 08:11:50 +0200 Subject: [PATCH 013/487] Add suppresion in tsan for python 10. --- source/tests/sanitizer/tsan.supp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/tests/sanitizer/tsan.supp b/source/tests/sanitizer/tsan.supp index 5bd3dc515..e8b6dd5c0 100644 --- a/source/tests/sanitizer/tsan.supp +++ b/source/tests/sanitizer/tsan.supp @@ -13,6 +13,10 @@ # #called_from_lib:libpython* # +# Suppress race condition from Python 10 async io: https://github.com/python/cpython/issues/116912 +race:sock_close +race:sock_send_impl +# # NodeJS # race:v8::platform::tracing::TracingController::GetCategoryGroupEnabled From 07643101fd6a5f333668a25b0391fba8462b3a94 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 30 May 2024 20:09:24 +0200 Subject: [PATCH 014/487] Solve properly tsan python race supression. --- source/tests/sanitizer/tsan.supp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/tests/sanitizer/tsan.supp b/source/tests/sanitizer/tsan.supp index e8b6dd5c0..a653d097e 100644 --- a/source/tests/sanitizer/tsan.supp +++ b/source/tests/sanitizer/tsan.supp @@ -14,6 +14,8 @@ #called_from_lib:libpython* # # Suppress race condition from Python 10 async io: https://github.com/python/cpython/issues/116912 +race:socketpair +race:socket_socketpair race:sock_close race:sock_send_impl # From b8667afb9f61181508ffaa3766baf92702afb421 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 30 May 2024 21:33:01 +0200 Subject: [PATCH 015/487] Add first version of node / python deadlock fix. --- .../include/node_loader/node_loader_impl.h | 2 + .../node_loader/source/node_loader_impl.cpp | 59 +++++++++++++++++++ .../node_loader/source/node_loader_port.cpp | 21 ++----- 3 files changed, 67 insertions(+), 15 deletions(-) diff --git a/source/loaders/node_loader/include/node_loader/node_loader_impl.h b/source/loaders/node_loader/include/node_loader/node_loader_impl.h index 26290cecf..b85b7392c 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_impl.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_impl.h @@ -55,6 +55,8 @@ NODE_LOADER_NO_EXPORT void node_loader_impl_exception(napi_env env, napi_status NODE_LOADER_NO_EXPORT void node_loader_impl_finalizer(napi_env env, napi_value v, void *data); +NODE_LOADER_NO_EXPORT void node_loader_impl_handle_promise(loader_impl_node node_impl, napi_env env, napi_deferred deferred, void *result, napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value), const char error_str[]); + NODE_LOADER_NO_EXPORT value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, napi_value recv, napi_value v); NODE_LOADER_NO_EXPORT napi_value node_loader_impl_value_to_napi(loader_impl_node node_impl, napi_env env, value arg); diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 245773d8a..05a8d2c28 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -513,6 +513,18 @@ struct loader_impl_async_future_delete_safe_type node_impl(node_impl), f(f), node_future(node_future) {} }; +struct loader_impl_async_handle_promise_safe_type +{ + loader_impl_node node_impl; + napi_deferred deferred; + void *result; + napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value); + const char *error_str; + + loader_impl_async_handle_promise_safe_type(loader_impl_node node_impl, napi_deferred deferred, void *result, napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value), const char error_str[]) : + node_impl(node_impl), deferred(deferred), result(result), deferred_fn(deferred_fn), error_str(error_str) {} +}; + struct loader_impl_async_destroy_safe_type { loader_impl_node node_impl; @@ -540,6 +552,7 @@ struct loader_impl_node_type loader_impl_threadsafe_type threadsafe_func_destroy; loader_impl_threadsafe_type threadsafe_future_await; loader_impl_threadsafe_type threadsafe_future_delete; + loader_impl_threadsafe_type threadsafe_handle_promise; loader_impl_threadsafe_type threadsafe_destroy; uv_thread_t thread; @@ -647,6 +660,8 @@ static value node_loader_impl_discover_function_safe(napi_env env, loader_impl_a static void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_safe_type *discover_safe); +static void node_loader_impl_handle_promise_safe(napi_env env, loader_impl_async_handle_promise_safe_type *handle_promise_safe); + static void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe_type *destroy_safe); static char *node_loader_impl_get_property_as_char(napi_env env, napi_value obj, const char *prop); @@ -2493,6 +2508,7 @@ void node_loader_impl_clear_safe(napi_env env, loader_impl_async_clear_safe_type napi_status status = napi_open_handle_scope(env, &handle_scope); node_loader_impl_exception(env, status); + /* Get function table object from reference */ status = napi_get_reference_value(env, clear_safe->node_impl->function_table_object_ref, &function_table_object); @@ -3271,6 +3287,30 @@ void node_loader_impl_discover_safe(napi_env env, loader_impl_async_discover_saf node_loader_impl_exception(env, status); } +void node_loader_impl_handle_promise_safe(napi_env env, loader_impl_async_handle_promise_safe_type *handle_promise_safe) +{ + napi_handle_scope handle_scope; + + /* Create scope */ + napi_status status = napi_open_handle_scope(env, &handle_scope); + + node_loader_impl_exception(env, status); + + /* Convert MetaCall value to napi value and call resolve or reject of NodeJS */ + napi_value js_result = node_loader_impl_value_to_napi(handle_promise_safe->node_impl, env, handle_promise_safe->result); + status = handle_promise_safe->deferred_fn(env, handle_promise_safe->deferred, js_result); + + if (status != napi_ok) + { + napi_throw_error(env, nullptr, handle_promise_safe->error_str); + } + + /* Close scope */ + status = napi_close_handle_scope(env, handle_scope); + + node_loader_impl_exception(env, status); +} + #if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1200) /* TODO: _Ret_maybenull_ HMODULE WINAPI GetModuleHandleW(_In_opt_ LPCWSTR lpModuleName); */ _Ret_maybenull_ HMODULE WINAPI get_module_handle_a_hook(_In_opt_ LPCSTR lpModuleName) @@ -3361,6 +3401,7 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi node_impl->threadsafe_func_destroy.initialize(env, "node_loader_impl_async_func_destroy_safe", &node_loader_impl_func_destroy_safe); node_impl->threadsafe_future_await.initialize(env, "node_loader_impl_async_future_await_safe", &node_loader_impl_future_await_safe); node_impl->threadsafe_future_delete.initialize(env, "node_loader_impl_async_future_delete_safe", &node_loader_impl_future_delete_safe); + node_impl->threadsafe_handle_promise.initialize(env, "node_loader_impl_async_handle_promise_safe", &node_loader_impl_handle_promise_safe); node_impl->threadsafe_destroy.initialize(env, "node_loader_impl_async_destroy_safe", &node_loader_impl_destroy_safe); } @@ -4030,6 +4071,23 @@ int node_loader_impl_discover(loader_impl impl, loader_handle handle, context ct return discover_safe.result; } +void node_loader_impl_handle_promise(loader_impl_node node_impl, napi_env env, napi_deferred deferred, void *result, napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value), const char error_str[]) +{ + loader_impl_async_handle_promise_safe_type handle_promise_safe(node_impl, deferred, result, deferred_fn, error_str); + + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_handle_promise_safe(env, &handle_promise_safe); + } + else + { + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_handle_promise, handle_promise_safe); + } +} + #define container_of(ptr, type, member) \ (type *)((char *)(ptr) - (char *)&((type *)0)->member) @@ -4270,6 +4328,7 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env node_impl->threadsafe_func_destroy.abort(env); node_impl->threadsafe_future_await.abort(env); node_impl->threadsafe_future_delete.abort(env); + node_impl->threadsafe_handle_promise.abort(env); } /* Clear persistent references */ diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index 6806c240c..ad8952230 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -198,14 +198,11 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info ctx->env = env; auto resolve = [](void *result, void *data) -> void * { + static const char promise_error_str[] = "Failed to resolve the promise"; + promise_context_type *ctx = static_cast(data); - napi_value js_result = node_loader_impl_value_to_napi(ctx->node_impl, ctx->env, result); - napi_status status = napi_resolve_deferred(ctx->env, ctx->deferred, js_result); - if (status != napi_ok) - { - napi_throw_error(ctx->env, nullptr, "Failed to resolve the promise"); - } + node_loader_impl_handle_promise(ctx->node_impl, ctx->env, ctx->deferred, result, &napi_resolve_deferred, promise_error_str); delete ctx; @@ -213,14 +210,11 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info }; auto reject = [](void *result, void *data) -> void * { + static const char promise_error_str[] = "Failed to reject the promise"; + promise_context_type *ctx = static_cast(data); - napi_value js_result = node_loader_impl_value_to_napi(ctx->node_impl, ctx->env, result); - napi_status status = napi_reject_deferred(ctx->env, ctx->deferred, js_result); - if (status != napi_ok) - { - napi_throw_error(ctx->env, nullptr, "Failed to reject the promise"); - } + node_loader_impl_handle_promise(ctx->node_impl, ctx->env, ctx->deferred, result, &napi_reject_deferred, promise_error_str); delete ctx; @@ -230,15 +224,12 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info /* Await to the function */ void *ret = metacall_await_s(name, args, argc - 1, resolve, reject, ctx); - /* TODO: Is this needed? */ - /* if (metacall_value_id(ret) == METACALL_THROWABLE) { napi_value result = node_loader_impl_value_to_napi(node_impl, env, ret); napi_throw(env, result); } - */ /* Release current reference of the environment */ // node_loader_impl_env(node_impl, nullptr); From c42ecd4f60a511d619e4c19fa446e36357f0f72c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 30 May 2024 21:51:13 +0200 Subject: [PATCH 016/487] Add sanitizer env var to a test. --- .../tests/metacall_configuration_exec_path_test/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt index c5a1b3a89..da3bc94fa 100644 --- a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt +++ b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt @@ -192,6 +192,7 @@ test_environment_variables(${target} "CONFIGURATION_PATH=${PY_CONFIGURATION_PATH}/global.json" "SERIAL_LIBRARY_PATH=${SERIAL_LIBRARY_PATH}" "DETOUR_LIBRARY_PATH=${DETOUR_LIBRARY_PATH}" + "${TESTS_SANITIZER_ENVIRONMENT_VARIABLES}" ) # From 92adb18ffd76f3250e8366104a8e50950dc4a89e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 7 Jun 2024 17:11:39 +0200 Subject: [PATCH 017/487] Initial version of node/py await. --- .../include/node_loader/node_loader_impl.h | 2 +- .../node_loader/source/node_loader_impl.cpp | 242 +++++++++++++----- .../node_loader/source/node_loader_port.cpp | 70 +---- 3 files changed, 184 insertions(+), 130 deletions(-) diff --git a/source/loaders/node_loader/include/node_loader/node_loader_impl.h b/source/loaders/node_loader/include/node_loader/node_loader_impl.h index b85b7392c..6aa1f3448 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_impl.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_impl.h @@ -55,7 +55,7 @@ NODE_LOADER_NO_EXPORT void node_loader_impl_exception(napi_env env, napi_status NODE_LOADER_NO_EXPORT void node_loader_impl_finalizer(napi_env env, napi_value v, void *data); -NODE_LOADER_NO_EXPORT void node_loader_impl_handle_promise(loader_impl_node node_impl, napi_env env, napi_deferred deferred, void *result, napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value), const char error_str[]); +NODE_LOADER_NO_EXPORT napi_value node_loader_impl_promise_await(loader_impl_node node_impl, napi_env env, const char *name, value *args, size_t size); NODE_LOADER_NO_EXPORT value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, napi_value recv, napi_value v); diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 05a8d2c28..5d55f1959 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -284,12 +284,37 @@ void node_loader_impl_func_call_js_safe(napi_env env, napi_value js_callback, vo // async_safe->args->node_impl->env = nullptr; } +template +void node_loader_impl_func_call_js_async_safe(napi_env env, napi_value js_callback, void *context, void *data) +{ + (void)js_callback; + + if (env == nullptr || context == nullptr || data == nullptr) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid arguments passed to js thread async safe function"); + return; + } + + T *args = static_cast(data); + node_loader_impl_func_call_js_safe_cast safe_cast(context); + + /* Store environment for reentrant calls */ + args->node_impl->env = env; + + /* Call to the implementation function */ + safe_cast.func_ptr(env, args); + + /* Clear environment */ + // async_safe->args->node_impl->env = nullptr; +} + static napi_value node_loader_impl_async_threadsafe_empty(napi_env, napi_callback_info) { /* This is a dirty hack in order to make the threadsafe API work properly, * as soon as possible it will be good to return to the old method we used in NodeJS 8, * it was better than this API */ + return nullptr; } @@ -513,18 +538,6 @@ struct loader_impl_async_future_delete_safe_type node_impl(node_impl), f(f), node_future(node_future) {} }; -struct loader_impl_async_handle_promise_safe_type -{ - loader_impl_node node_impl; - napi_deferred deferred; - void *result; - napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value); - const char *error_str; - - loader_impl_async_handle_promise_safe_type(loader_impl_node node_impl, napi_deferred deferred, void *result, napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value), const char error_str[]) : - node_impl(node_impl), deferred(deferred), result(result), deferred_fn(deferred_fn), error_str(error_str) {} -}; - struct loader_impl_async_destroy_safe_type { loader_impl_node node_impl; @@ -552,7 +565,6 @@ struct loader_impl_node_type loader_impl_threadsafe_type threadsafe_func_destroy; loader_impl_threadsafe_type threadsafe_future_await; loader_impl_threadsafe_type threadsafe_future_delete; - loader_impl_threadsafe_type threadsafe_handle_promise; loader_impl_threadsafe_type threadsafe_destroy; uv_thread_t thread; @@ -584,6 +596,73 @@ struct loader_impl_node_type loader_impl impl; }; +template +struct loader_impl_threadsafe_async_type +{ + uv_async_t async_handle; + bool initialized; + + int initialize(loader_impl_node node_impl, void (*async_cb)(uv_async_t *)) + { + int result = uv_async_init(node_impl->thread_loop, &async_handle, async_cb); + + initialized = (result == 0); + + return result; + } + + void invoke(T *data) + { + if (initialized) + { + async_handle.data = static_cast(data); + uv_async_send(&async_handle); + } + } + + void close(void (*close_cb)(uv_handle_t *handle)) + { + if (initialized) + { + union + { + uv_handle_t *handle; + uv_async_t *async; + } handle_cast; + + handle_cast.async = &async_handle; + + uv_close(handle_cast.handle, close_cb); + } + } +}; + +struct loader_impl_async_handle_promise_safe_type +{ + loader_impl_node node_impl; + napi_env env; + napi_deferred deferred; + void *result; + napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value); + const char *error_str; + loader_impl_threadsafe_async_type threadsafe_async; + + loader_impl_async_handle_promise_safe_type(loader_impl_node node_impl, napi_env env) : + node_impl(node_impl), env(env), result(NULL) {} + + ~loader_impl_async_handle_promise_safe_type() + { + threadsafe_async.close([](uv_handle_t *handle) { + loader_impl_async_handle_promise_safe_type *handle_promise_safe = static_cast(handle->data); + + if (handle_promise_safe->result != NULL) + { + metacall_value_destroy(handle_promise_safe->result); + } + }); + } +}; + typedef napi_value (*function_resolve_trampoline)(loader_impl_node, napi_env, function_resolve_callback, napi_value, napi_value, void *); typedef napi_value (*function_reject_trampoline)(loader_impl_node, napi_env, function_reject_callback, napi_value, napi_value, void *); @@ -3305,6 +3384,9 @@ void node_loader_impl_handle_promise_safe(napi_env env, loader_impl_async_handle napi_throw_error(env, nullptr, handle_promise_safe->error_str); } + /* Close the handle */ + delete handle_promise_safe; + /* Close scope */ status = napi_close_handle_scope(env, handle_scope); @@ -3401,7 +3483,6 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi node_impl->threadsafe_func_destroy.initialize(env, "node_loader_impl_async_func_destroy_safe", &node_loader_impl_func_destroy_safe); node_impl->threadsafe_future_await.initialize(env, "node_loader_impl_async_future_await_safe", &node_loader_impl_future_await_safe); node_impl->threadsafe_future_delete.initialize(env, "node_loader_impl_async_future_delete_safe", &node_loader_impl_future_delete_safe); - node_impl->threadsafe_handle_promise.initialize(env, "node_loader_impl_async_handle_promise_safe", &node_loader_impl_handle_promise_safe); node_impl->threadsafe_destroy.initialize(env, "node_loader_impl_async_destroy_safe", &node_loader_impl_destroy_safe); } @@ -4071,23 +4152,95 @@ int node_loader_impl_discover(loader_impl impl, loader_handle handle, context ct return discover_safe.result; } -void node_loader_impl_handle_promise(loader_impl_node node_impl, napi_env env, napi_deferred deferred, void *result, napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value), const char error_str[]) +void node_loader_impl_handle_promise(loader_impl_async_handle_promise_safe_type *handle_promise_safe, void *result, napi_status (*deferred_fn)(napi_env, napi_deferred, napi_value), const char error_str[]) { - loader_impl_async_handle_promise_safe_type handle_promise_safe(node_impl, deferred, result, deferred_fn, error_str); + handle_promise_safe->result = metacall_value_copy(result); + handle_promise_safe->deferred_fn = deferred_fn; + handle_promise_safe->error_str = error_str; /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) + if (handle_promise_safe->node_impl->js_thread_id == std::this_thread::get_id()) { /* We are already in the V8 thread, we can call safely */ - node_loader_impl_handle_promise_safe(env, &handle_promise_safe); + node_loader_impl_handle_promise_safe(handle_promise_safe->env, handle_promise_safe); } else { /* Submit the task to the async queue */ - loader_impl_threadsafe_invoke_type invoke(node_impl->threadsafe_handle_promise, handle_promise_safe); + if (handle_promise_safe->threadsafe_async.initialize(handle_promise_safe->node_impl, [](uv_async_t *handle) { + loader_impl_async_handle_promise_safe_type *handle_promise_safe = static_cast(handle->data); + node_loader_impl_handle_promise_safe(handle_promise_safe->env, handle_promise_safe); + }) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Filed to initialize promise safe async handle"); + } + else + { + handle_promise_safe->threadsafe_async.invoke(handle_promise_safe); + } } } +napi_value node_loader_impl_promise_await(loader_impl_node node_impl, napi_env env, const char *name, value *args, size_t size) +{ + loader_impl_async_handle_promise_safe_type *handle_promise_safe = new loader_impl_async_handle_promise_safe_type(node_impl, env); + + if (handle_promise_safe == nullptr) + { + napi_throw_error(env, nullptr, "Failed to allocate the promise context"); + + return nullptr; + } + + napi_value promise; + + /* Create the promise */ + napi_status status = napi_create_promise(env, &handle_promise_safe->deferred, &promise); + + if (status != napi_ok) + { + napi_throw_error(env, nullptr, "Failed to create the promise"); + + delete handle_promise_safe; + + return nullptr; + } + + auto resolve = [](void *result, void *data) -> void * { + static const char promise_error_str[] = "Failed to resolve the promise"; + + loader_impl_async_handle_promise_safe_type *handle_promise_safe = static_cast(data); + + node_loader_impl_handle_promise(handle_promise_safe, result, &napi_resolve_deferred, promise_error_str); + + return NULL; + }; + + auto reject = [](void *result, void *data) -> void * { + static const char promise_error_str[] = "Failed to reject the promise"; + + loader_impl_async_handle_promise_safe_type *handle_promise_safe = static_cast(data); + + node_loader_impl_handle_promise(handle_promise_safe, result, &napi_reject_deferred, promise_error_str); + + return NULL; + }; + + /* Await to the function */ + void *ret = metacall_await_s(name, args, size, resolve, reject, handle_promise_safe); + + if (metacall_value_id(ret) == METACALL_THROWABLE) + { + napi_value result = node_loader_impl_value_to_napi(node_impl, env, ret); + + napi_throw(env, result); + } + + node_loader_impl_finalizer(env, promise, ret); + + return promise; +} + #define container_of(ptr, type, member) \ (type *)((char *)(ptr) - (char *)&((type *)0)->member) @@ -4311,10 +4464,16 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env { uint32_t ref_count = 0; napi_status status; + napi_handle_scope handle_scope; /* Destroy children loaders */ loader_unload_children(node_impl->impl); + /* Create scope */ + status = napi_open_handle_scope(env, &handle_scope); + + node_loader_impl_exception(env, status); + /* Clear thread safe functions except by destroy one */ { node_impl->threadsafe_initialize.abort(env); @@ -4328,7 +4487,6 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env node_impl->threadsafe_func_destroy.abort(env); node_impl->threadsafe_future_await.abort(env); node_impl->threadsafe_future_delete.abort(env); - node_impl->threadsafe_handle_promise.abort(env); } /* Clear persistent references */ @@ -4358,48 +4516,10 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env node_loader_impl_exception(env, status); - /* Clear event loop */ - { - /* Stop event loop */ - uv_stop(node_impl->thread_loop); - - /* Clear event loop */ - /* uv_walk(node_impl->thread_loop, node_loader_impl_walk, NULL); */ - -#if 0 - /* TODO: For some reason, this deadlocks in NodeJS benchmark when mixing sync and async calls. - * It should be reviewed carefully and detect if NodeJS is finalizing properly on multiple cases. - * Disable it for now in order to make tests pass. - */ - while (uv_run(node_impl->thread_loop, UV_RUN_DEFAULT) != 0) - #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - { - node_loader_impl_print_handles(node_impl); - } - #else - ; - #endif - - /* Destroy node loop */ - if (uv_loop_alive(node_impl->thread_loop) != 0) - { - /* TODO: Make logs thread safe */ - /* log_write("metacall", LOG_LEVEL_ERROR, "NodeJS event loop should not be alive"); */ - printf("NodeJS Loader Error: NodeJS event loop should not be alive\n"); - fflush(stdout); - } -#endif + /* Close scope */ + status = napi_close_handle_scope(env, handle_scope); - /* This evaluates to true always due to stdin and stdout handles, - which are closed anyway on thread join. So it is removed by now. */ - if (uv_loop_close(node_impl->thread_loop) != UV_EBUSY) - { - /* TODO: Make logs thread safe */ - /* log_write("metacall", LOG_LEVEL_ERROR, "NodeJS event loop should not be busy"); */ - printf("NodeJS Loader Error: NodeJS event loop should be busy\n"); - fflush(stdout); - } - } + node_loader_impl_exception(env, status); /* NodeJS Loader needs to register that it is destroyed, because after this step * some destructors can be still triggered, before the node_loader->destroy() has diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index ad8952230..c77592ff6 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -36,13 +36,6 @@ #include -struct promise_context_type -{ - loader_impl_node node_impl; - napi_env env; - napi_deferred deferred; -}; - static const loader_tag node_loader_tag = "node"; napi_value node_loader_port_metacall(napi_env env, napi_callback_info info) @@ -171,65 +164,8 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info args[args_count - 1] = node_loader_impl_napi_to_value(node_impl, env, recv, argv[args_count]); } - promise_context_type *ctx = new promise_context_type(); - - if (ctx == nullptr) - { - napi_throw_error(env, nullptr, "Failed to allocate the promise context"); - - return nullptr; - } - - napi_value promise; - - /* Create the promise */ - status = napi_create_promise(env, &ctx->deferred, &promise); - - if (status != napi_ok) - { - napi_throw_error(env, nullptr, "Failed to create the promise"); - - delete ctx; - - return nullptr; - } - - ctx->node_impl = node_impl; - ctx->env = env; - - auto resolve = [](void *result, void *data) -> void * { - static const char promise_error_str[] = "Failed to resolve the promise"; - - promise_context_type *ctx = static_cast(data); - - node_loader_impl_handle_promise(ctx->node_impl, ctx->env, ctx->deferred, result, &napi_resolve_deferred, promise_error_str); - - delete ctx; - - return NULL; - }; - - auto reject = [](void *result, void *data) -> void * { - static const char promise_error_str[] = "Failed to reject the promise"; - - promise_context_type *ctx = static_cast(data); - - node_loader_impl_handle_promise(ctx->node_impl, ctx->env, ctx->deferred, result, &napi_reject_deferred, promise_error_str); - - delete ctx; - - return NULL; - }; - - /* Await to the function */ - void *ret = metacall_await_s(name, args, argc - 1, resolve, reject, ctx); - - if (metacall_value_id(ret) == METACALL_THROWABLE) - { - napi_value result = node_loader_impl_value_to_napi(node_impl, env, ret); - - napi_throw(env, result); - } + /* Call to metacall await and wrap the promise into NodeJS land */ + napi_value promise = node_loader_impl_promise_await(node_impl, env, name, args, argc - 1); /* Release current reference of the environment */ // node_loader_impl_env(node_impl, nullptr); @@ -239,8 +175,6 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info metacall_value_destroy(args[args_count]); } - node_loader_impl_finalizer(env, promise, ret); - delete[] argv; delete[] args; delete[] name; From c3b1385be4aa0fe34b553e7c8dbf97a555a80a02 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 11 Jun 2024 19:12:11 +0200 Subject: [PATCH 018/487] Add more complex test for mixing node and python await. --- source/tests/CMakeLists.txt | 5 +- .../CMakeLists.txt | 152 ++++++++++++++++++ .../source/main.cpp | 28 ++++ ...tacall_node_python_await_extended_test.cpp | 91 +++++++++++ 4 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 source/tests/metacall_node_python_await_extended_test/CMakeLists.txt create mode 100644 source/tests/metacall_node_python_await_extended_test/source/main.cpp create mode 100644 source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index 9a1202a56..b6c702669 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -150,6 +150,7 @@ add_subdirectory(metacall_node_fail_load_leak_test) add_subdirectory(metacall_node_typescript_test) add_subdirectory(metacall_node_python_async_after_destroy_test) add_subdirectory(metacall_node_python_await_test) +add_subdirectory(metacall_node_python_await_extended_test) add_subdirectory(metacall_node_python_exception_test) add_subdirectory(metacall_node_clear_mem_test) add_subdirectory(metacall_node_async_resources_test) @@ -190,9 +191,9 @@ add_subdirectory(metacall_python_relative_path_test) add_subdirectory(metacall_python_without_functions_test) add_subdirectory(metacall_python_builtins_test) add_subdirectory(metacall_python_async_test) -# TODO: add_subdirectory(metacall_python_await_test) +# TODO: add_subdirectory(metacall_python_await_test) # TODO: Implement metacall_await in Python Port add_subdirectory(metacall_python_exception_test) -# TODO: add_subdirectory(metacall_python_node_await_test) +# TODO: add_subdirectory(metacall_python_node_await_test) # TODO: Implement metacall_await in Python Port add_subdirectory(metacall_python_without_env_vars_test) add_subdirectory(metacall_map_test) add_subdirectory(metacall_map_await_test) diff --git a/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt b/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt new file mode 100644 index 000000000..af1945174 --- /dev/null +++ b/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt @@ -0,0 +1,152 @@ +# Check if this loader is enabled +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_NODE) + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-node-python-await-extended-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_node_python_await_extended_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::metacall +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} + + # NodeJS Port path + METACALL_NODE_PORT_PATH="${CMAKE_SOURCE_DIR}/source/ports/node_port/index.js" +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Linker options +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $ +) + +# +# Define dependencies +# + +add_dependencies(${target} + node_loader + py_loader +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} + ${PY_DEBUG_ENVIRONMENT_VARIABLES} +) diff --git a/source/tests/metacall_node_python_await_extended_test/source/main.cpp b/source/tests/metacall_node_python_await_extended_test/source/main.cpp new file mode 100644 index 000000000..11ddf3f59 --- /dev/null +++ b/source/tests/metacall_node_python_await_extended_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp b/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp new file mode 100644 index 000000000..3ce6d719d --- /dev/null +++ b/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp @@ -0,0 +1,91 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include +#include +#include + +class metacall_node_python_await_extended_test : public testing::Test +{ +public: +}; + +TEST_F(metacall_node_python_await_extended_test, DefaultConstructor) +{ + metacall_print_info(); + + ASSERT_EQ((int)0, (int)metacall_initialize()); + +/* NodeJS & Python */ +#if defined(OPTION_BUILD_LOADERS_NODE) && defined(OPTION_BUILD_LOADERS_PY) + { + static const char buffer[] = + /* NodeJS */ + "const { metacall_await, metacall_load_from_memory, metacall_inspect } = require('" METACALL_NODE_PORT_PATH "');\n" + "const util = require('util')\n" + "metacall_load_from_memory('py', `" + /* Python */ + "import sys\n" + "import threading\n" + "async def python_simple(n):\n" + "\tprint('inside python_simple', threading.current_thread().ident, ':', n)\n" + "\tsys.stdout.flush()\n" + "\treturn n\n" + // "import asyncio\n" + // "async def python_simple(n):\n" + // " await asyncio.sleep(1)\n" + // " return n\n" + "`);\n" + /* Debug */ + "console.log('--------------------------------------------------------------------')\n" + "console.log(util.inspect(metacall_inspect(), false, null, true))\n" + "console.log('--------------------------------------------------------------------')\n" + /* NodeJS Check */ + "const size = 10000;\n" + "let buffer = new SharedArrayBuffer(4);\n" + "let int32 = new Int32Array(buffer);\n" + "Atomics.store(int32, 0, 0);\n" + "process.on('exit', () => {\n" + " if (Atomics.load(int32, 0) != size) {\n" + " process.exit(3);\n" + " }\n" + "});\n" + /* NodeJS Promise */ + "for (let i = 0; i < size; i++) {\n" + " metacall_await('python_simple', 32).then(v => {\n" + " console.log('RESULT:', v, Atomics.load(int32, 0));\n" + " if (v !== 32) {\n" + " process.exit(1);\n" + " }\n" + " Atomics.add(int32, 0, 1);\n" + " }).catch(v => {\n" + " console.log('ERROR:', v);\n" + " process.exit(2);\n" + " });\n" + "}\n"; + + ASSERT_EQ((int)0, (int)metacall_load_from_memory("node", buffer, sizeof(buffer), NULL)); + } +#endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_PY */ + + EXPECT_EQ((int)0, (int)metacall_destroy()); +} From 9a911d44c03dbb96ee4a6eaddc03e1432c45d64f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 11 Jun 2024 22:51:01 +0200 Subject: [PATCH 019/487] Improve build system for the CLI. --- source/cli/CMakeLists.txt | 6 ++++++ source/cli/metacallcli/CMakeLists.txt | 6 ------ source/cli/plugins/CMakeLists.txt | 5 ----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/source/cli/CMakeLists.txt b/source/cli/CMakeLists.txt index 4f9751728..d6b10bf0d 100644 --- a/source/cli/CMakeLists.txt +++ b/source/cli/CMakeLists.txt @@ -4,6 +4,12 @@ if(NOT OPTION_BUILD_CLI) return() endif() +# Check if the dependency loaders are enabled +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_EXT OR NOT OPTION_BUILD_EXTENSIONS OR NOT OPTION_BUILD_LOADERS_NODE) + message(WARNING "The Extension and NodeJS Loaders are a dependency of the CLI, in order to compile the CLI, enable them with -DOPTION_BUILD_LOADERS_EXT=ON -DOPTION_BUILD_LOADERS_NODE=ON") + return() +endif() + # CLI applications add_subdirectory(metacallcli) add_subdirectory(plugins) diff --git a/source/cli/metacallcli/CMakeLists.txt b/source/cli/metacallcli/CMakeLists.txt index 2b15756eb..fe6679dc3 100644 --- a/source/cli/metacallcli/CMakeLists.txt +++ b/source/cli/metacallcli/CMakeLists.txt @@ -1,9 +1,3 @@ -# Check if this loader is enabled -if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_EXT OR NOT OPTION_BUILD_EXTENSIONS OR NOT OPTION_BUILD_LOADERS_NODE) - message(WARNING "The Extension and NodeJS loaders are a dependency of the CLI, in order to compile the CLI, enable them with -DOPTION_BUILD_LOADERS_EXT=ON -DOPTION_BUILD_LOADERS_NODE=ON") - return() -endif() - # # Executable name and options # diff --git a/source/cli/plugins/CMakeLists.txt b/source/cli/plugins/CMakeLists.txt index 2ca9c31fc..cf76080ce 100644 --- a/source/cli/plugins/CMakeLists.txt +++ b/source/cli/plugins/CMakeLists.txt @@ -1,8 +1,3 @@ -#Check if extension loader is enabled -if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_EXT OR NOT OPTION_BUILD_EXTENSIONS) - return() -endif() - # # NodeJS Dependency # From c25e6edd18f10f164e3ba54a725c009db3e7eac1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 19 Jun 2024 18:12:01 +0200 Subject: [PATCH 020/487] Trying to solve more issues from nodejs. --- .github/workflows/docker-hub.yml | 4 +- .../node_loader/bootstrap/lib/bootstrap.js | 15 ++- .../node_loader/source/node_loader_impl.cpp | 103 +++++++++++------- ...tacall_node_python_await_extended_test.cpp | 5 +- 4 files changed, 76 insertions(+), 51 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 12375d985..db4012ce6 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -8,6 +8,7 @@ on: push: branches: - master + - develop tags: - 'v*.*.*' @@ -44,9 +45,6 @@ jobs: bash ./docker-compose.sh push elif [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then bash ./docker-compose.sh version - else - echo "Failed to push the docker images" - exit 1 fi - name: Logout from DockerHub diff --git a/source/loaders/node_loader/bootstrap/lib/bootstrap.js b/source/loaders/node_loader/bootstrap/lib/bootstrap.js index 650a2b7ab..5582ab48e 100644 --- a/source/loaders/node_loader/bootstrap/lib/bootstrap.js +++ b/source/loaders/node_loader/bootstrap/lib/bootstrap.js @@ -6,26 +6,29 @@ const path = require('path'); const util = require('util'); const fs = require('fs'); -/* Require the JavaScript parser */ +// Require the JavaScript parser const espree = require(path.join(__dirname, 'node_modules', 'espree')); const node_require = Module.prototype.require; const node_resolve = require.resolve; const node_cache = require.cache; -/* Store in the module prototype the original functions for future use in derived loaders like TypeScript */ +// Store in the module prototype the original functions for future use in derived loaders like TypeScript Module.prototype.node_require = node_require; Module.prototype.node_resolve = node_resolve; Module.prototype.node_cache = node_cache; function node_loader_trampoline_initialize(loader_library_path) { + // Restore the argv (this is used for tricking node::Start method) + process.argv = [ process.argv[0] ]; + // Add current execution directory to the execution paths node_loader_trampoline_execution_path(process.cwd()); const paths = [ - /* Local version of MetaCall NodeJS Port */ + // Local version of MetaCall NodeJS Port 'metacall', - /* Optionally, use loader library path for global installed NodeJS Port */ + // Optionally, use loader library path for global installed NodeJS Port ...loader_library_path ? [ path.join(loader_library_path, 'node_modules', 'metacall', 'index.js') ] : [], ]; @@ -333,7 +336,7 @@ function node_loader_trampoline_discover(handle) { } function node_loader_trampoline_test(obj) { - /* Imporant: never trigger an async resource in this function */ + // Imporant: never trigger an async resource in this function if (obj !== undefined) { fs.writeSync(process.stdout.fd, `${util.inspect(obj, false, null, true)}\n`); } @@ -411,7 +414,7 @@ module.exports = ((impl, ptr) => { throw new Error('Process arguments (process.argv[2], process.argv[3]) not defined.'); } - /* Get trampoline from list of linked bindings */ + // Get trampoline from list of linked bindings const trampoline = process._linkedBinding('node_loader_trampoline_module'); const node_loader_ptr = trampoline.register(impl, ptr, { diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 5d55f1959..eb0150e18 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -99,9 +99,15 @@ extern char **environ; #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif -#include +/* NodeJS Includes */ #include +#ifdef NAPI_VERSION + #undef NAPI_VERSION +#endif + +#include + #include /* version: 6.2.414.50 */ #ifdef ENABLE_DEBUGGER_SUPPORT @@ -650,7 +656,7 @@ struct loader_impl_async_handle_promise_safe_type loader_impl_async_handle_promise_safe_type(loader_impl_node node_impl, napi_env env) : node_impl(node_impl), env(env), result(NULL) {} - ~loader_impl_async_handle_promise_safe_type() + void destroy() { threadsafe_async.close([](uv_handle_t *handle) { loader_impl_async_handle_promise_safe_type *handle_promise_safe = static_cast(handle->data); @@ -659,6 +665,8 @@ struct loader_impl_async_handle_promise_safe_type { metacall_value_destroy(handle_promise_safe->result); } + + delete handle_promise_safe; }); } }; @@ -772,6 +780,40 @@ static HMODULE (*get_module_handle_a_ptr)(_In_opt_ LPCSTR) = NULL; /* TODO: Impl /* -- Methods -- */ +#if 1 // NODE_MAJOR_VERSION < 18 + #if NODE_MAJOR_VERSION >= 12 + #define node_loader_impl_register_module_id node::ModuleFlags::kLinked + #else + #define node_loader_impl_register_module_id 0x02 /* NM_F_LINKED */ + #endif + + #define node_loader_impl_register_module(name, fn) \ + do \ + { \ + static napi_module node_loader_module = { \ + NAPI_MODULE_VERSION, \ + node_loader_impl_register_module_id, \ + __FILE__, \ + fn, \ + name, \ + NULL, \ + { 0 } \ + }; \ + napi_module_register(&node_loader_module); \ + } while (0) + +void node_loader_impl_register_linked_bindings() +{ + /* Initialize Node Loader Trampoline */ + node_loader_impl_register_module("node_loader_trampoline_module", node_loader_trampoline_initialize); + + /* Initialize Node Loader Port */ + node_loader_impl_register_module("node_loader_port_module", node_loader_port_initialize); +} +#else +// TODO: New register implementation +#endif + void node_loader_impl_exception(napi_env env, napi_status status) { if (status != napi_ok) @@ -3385,7 +3427,7 @@ void node_loader_impl_handle_promise_safe(napi_env env, loader_impl_async_handle } /* Close the handle */ - delete handle_promise_safe; + handle_promise_safe->destroy(); /* Close scope */ status = napi_close_handle_scope(env, handle_scope); @@ -3445,6 +3487,7 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi napi_value function_table_object; napi_value global; napi_status status; + napi_handle_scope handle_scope; /* Lock node implementation mutex */ uv_mutex_lock(&node_impl->mutex); @@ -3456,6 +3499,11 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi env = static_cast(env_ptr); function_table_object = static_cast(function_table_object_ptr); + /* Create scope */ + status = napi_open_handle_scope(env, &handle_scope); + + node_loader_impl_exception(env, status); + /* Make global object persistent */ status = napi_get_global(env, &global); @@ -3548,6 +3596,11 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi get_module_handle_a_ptr = (HMODULE(*)(_In_opt_ LPCSTR))node_loader_hook_import_address_table("kernel32.dll", "GetModuleHandleA", &get_module_handle_a_hook); #endif + /* Close scope */ + status = napi_close_handle_scope(env, handle_scope); + + node_loader_impl_exception(env, status); + /* Signal start condition */ uv_cond_signal(&node_impl->cond); @@ -3780,9 +3833,15 @@ void node_loader_impl_thread(void *data) #endif */ + // #if NODE_MAJOR_VERSION < 18 + node_loader_impl_register_linked_bindings(); + // #endif + /* Unlock node implementation mutex */ uv_mutex_unlock(&node_impl->mutex); + /* Register bindings for versions older than 18 */ + /* Start NodeJS runtime */ int result = node::Start(argc, reinterpret_cast(argv)); @@ -3824,44 +3883,6 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con (void)impl; - /* Initialize Node Loader Trampoline */ - { - static napi_module node_loader_trampoline_module = { - NAPI_MODULE_VERSION, -#if NODE_MAJOR_VERSION >= 12 - node::ModuleFlags::kLinked, -#else - 0x02, /* NM_F_LINKED */ -#endif - __FILE__, - node_loader_trampoline_initialize, - "node_loader_trampoline_module", - NULL, - { 0 } - }; - - napi_module_register(&node_loader_trampoline_module); - } - - /* Initialize Node Loader Port */ - { - static napi_module node_loader_port_module = { - NAPI_MODULE_VERSION, -#if NODE_MAJOR_VERSION >= 12 - node::ModuleFlags::kLinked, -#else - 0x02, /* NM_F_LINKED */ -#endif - __FILE__, - node_loader_port_initialize, - "node_loader_port_module", - NULL, - { 0 } - }; - - napi_module_register(&node_loader_port_module); - } - node_impl = new loader_impl_node_type(); if (node_impl == nullptr) diff --git a/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp b/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp index 3ce6d719d..ef20b69f4 100644 --- a/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp +++ b/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp @@ -46,8 +46,11 @@ TEST_F(metacall_node_python_await_extended_test, DefaultConstructor) /* Python */ "import sys\n" "import threading\n" + "counter = 0\n" "async def python_simple(n):\n" - "\tprint('inside python_simple', threading.current_thread().ident, ':', n)\n" + "\tglobal counter\n" + "\tprint('inside python_simple', threading.current_thread().ident, counter, ':', n)\n" + "\tcounter = counter + 1\n" "\tsys.stdout.flush()\n" "\treturn n\n" // "import asyncio\n" From 30dacb44bd50e378afdae51ea9d84943826e885c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 19 Jun 2024 19:13:47 +0200 Subject: [PATCH 021/487] Checking for async ref. --- source/loaders/node_loader/source/node_loader_impl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index eb0150e18..a3b62c4e4 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -638,7 +638,10 @@ struct loader_impl_threadsafe_async_type handle_cast.async = &async_handle; - uv_close(handle_cast.handle, close_cb); + if (uv_is_active(handle_cast.handle)) + { + uv_close(handle_cast.handle, close_cb); + } } } }; From 500f2b1a3188001ab55a34f6bb1230c98feecb10 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 19 Jun 2024 19:28:24 +0200 Subject: [PATCH 022/487] Trying to improve runtime builds and testing in linux. --- .github/workflows/docker-hub.yml | 4 +- .github/workflows/linux-test.yml | 2 +- tools/metacall-environment.sh | 8 ++-- tools/metacall-runtime.sh | 64 ++++++++++++++++++++++++++++++-- 4 files changed, 68 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index db4012ce6..12375d985 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -8,7 +8,6 @@ on: push: branches: - master - - develop tags: - 'v*.*.*' @@ -45,6 +44,9 @@ jobs: bash ./docker-compose.sh push elif [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then bash ./docker-compose.sh version + else + echo "Failed to push the docker images" + exit 1 fi - name: Logout from DockerHub diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 5f54ee07b..ac8bb78ce 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - name: Install, build and run tests - run: ./docker-compose.sh test + run: ./docker-compose.sh build env: METACALL_BUILD_TYPE: ${{ matrix.build }} METACALL_BASE_IMAGE: ${{ matrix.image }} diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 6f4f084f5..819a835d2 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -607,8 +607,8 @@ sub_c(){ case ${LINUX_DISTRO} in debian) - if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "bookworm" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then - # TODO: For now, bookworm || trixie == sid, change when bookworm || trixie is released + # For now trixie == sid, change when trixie is released + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then CODENAME="unstable" LINKNAME="" else @@ -779,8 +779,8 @@ sub_clangformat(){ case ${LINUX_DISTRO} in debian) - if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "bookworm" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then - # TODO: For now, bookworm || trixie == sid, change when bookworm || trixie is released + # For now trixie == sid, change when trixie is released + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then CODENAME="unstable" LINKNAME="" else diff --git a/tools/metacall-runtime.sh b/tools/metacall-runtime.sh index 6c1026602..5098c655a 100755 --- a/tools/metacall-runtime.sh +++ b/tools/metacall-runtime.sh @@ -202,7 +202,37 @@ sub_file(){ sub_rpc(){ echo "configure rpc" - sub_apt_install_hold libcurl4 + if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then + if [ "${LINUX_DISTRO}" = "debian" ] || [ "${LINUX_DISTRO}" = "ubuntu" ]; then + UBUNTU_CODENAME="" + CODENAME_FROM_ARGUMENTS="" + + # Obtain VERSION_CODENAME and UBUNTU_CODENAME (for Ubuntu and its derivatives) + . /etc/os-release + + case ${LINUX_DISTRO} in + debian) + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ]; then + CODENAME="unstable" + else + CODENAME="${VERSION_CODENAME}" + fi + ;; + *) + # Ubuntu and its derivatives + if [ -n "${UBUNTU_CODENAME}" ]; then + CODENAME="${UBUNTU_CODENAME}" + fi + ;; + esac + + if [ "${CODENAME}" = "trixie" ] || [ "${CODENAME}" = "unstable" ]; then + sub_apt_install_hold libcurl4t64 + else + sub_apt_install_hold libcurl4 + fi + fi + fi } # WebAssembly @@ -235,8 +265,8 @@ sub_c(){ case ${LINUX_DISTRO} in debian) - if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "bookworm" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then - # TODO: For now, bookworm || trixie == sid, change when bookworm || trixie is released + # For now trixie == sid, change when trixie is released + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then CODENAME="unstable" LINKNAME="" else @@ -293,7 +323,33 @@ sub_backtrace(){ if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then if [ "${LINUX_DISTRO}" = "debian" ] || [ "${LINUX_DISTRO}" = "ubuntu" ]; then - sub_apt_install_hold libdw1 + UBUNTU_CODENAME="" + CODENAME_FROM_ARGUMENTS="" + + # Obtain VERSION_CODENAME and UBUNTU_CODENAME (for Ubuntu and its derivatives) + . /etc/os-release + + case ${LINUX_DISTRO} in + debian) + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ]; then + CODENAME="unstable" + else + CODENAME="${VERSION_CODENAME}" + fi + ;; + *) + # Ubuntu and its derivatives + if [ -n "${UBUNTU_CODENAME}" ]; then + CODENAME="${UBUNTU_CODENAME}" + fi + ;; + esac + + if [ "${CODENAME}" = "trixie" ] || [ "${CODENAME}" = "unstable" ]; then + sub_apt_install_hold libdw1t64 libelf1t64 + else + sub_apt_install_hold libdw1 + fi elif [ "${LINUX_DISTRO}" = "alpine" ]; then $SUDO_CMD apk add --no-cache binutils fi From 956f8a82bef7be4667f68267dc9100b2fce51275 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 19 Jun 2024 19:33:12 +0200 Subject: [PATCH 023/487] Solve issue with port package. --- source/ports/node_port/package-lock.json | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/ports/node_port/package-lock.json b/source/ports/node_port/package-lock.json index 533660323..bfb3b0d1b 100644 --- a/source/ports/node_port/package-lock.json +++ b/source/ports/node_port/package-lock.json @@ -96,12 +96,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -287,9 +287,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -1010,12 +1010,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -1147,9 +1147,9 @@ "dev": true }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" From 4da180e7213f615e7b485528137a9b9443f1b264 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 19 Jun 2024 19:39:00 +0200 Subject: [PATCH 024/487] Solve issues. --- tools/metacall-environment.sh | 8 ++++---- tools/metacall-runtime.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 819a835d2..ad0315dc3 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -607,8 +607,8 @@ sub_c(){ case ${LINUX_DISTRO} in debian) - # For now trixie == sid, change when trixie is released - if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then + # For now bookworm || trixie == sid, change when trixie is released + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "bookworm" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then CODENAME="unstable" LINKNAME="" else @@ -779,8 +779,8 @@ sub_clangformat(){ case ${LINUX_DISTRO} in debian) - # For now trixie == sid, change when trixie is released - if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then + # For now bookworm || trixie == sid, change when trixie is released + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "bookworm" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then CODENAME="unstable" LINKNAME="" else diff --git a/tools/metacall-runtime.sh b/tools/metacall-runtime.sh index 5098c655a..77fc6e336 100755 --- a/tools/metacall-runtime.sh +++ b/tools/metacall-runtime.sh @@ -265,8 +265,8 @@ sub_c(){ case ${LINUX_DISTRO} in debian) - # For now trixie == sid, change when trixie is released - if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then + # For now bookworm || trixie == sid, change when trixie is released + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ] || [ "${VERSION_CODENAME}" = "bookworm" ] || [ "${VERSION_CODENAME}" = "trixie" ]; then CODENAME="unstable" LINKNAME="" else From 9565c4e25fe838b55b611eb66857a0600c059f5a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 19 Jun 2024 20:18:57 +0200 Subject: [PATCH 025/487] Solve another issue. --- source/loaders/node_loader/source/node_loader_impl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index a3b62c4e4..5d2f2510e 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -608,6 +608,9 @@ struct loader_impl_threadsafe_async_type uv_async_t async_handle; bool initialized; + loader_impl_threadsafe_async_type() : + initialized(false) {} + int initialize(loader_impl_node node_impl, void (*async_cb)(uv_async_t *)) { int result = uv_async_init(node_impl->thread_loop, &async_handle, async_cb); @@ -638,10 +641,7 @@ struct loader_impl_threadsafe_async_type handle_cast.async = &async_handle; - if (uv_is_active(handle_cast.handle)) - { - uv_close(handle_cast.handle, close_cb); - } + uv_close(handle_cast.handle, close_cb); } } }; From a3b961af64b6041ebfa92155fc0495e2becd66d2 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 19 Jun 2024 20:30:09 +0200 Subject: [PATCH 026/487] Solve issue with metacallcli. --- tools/cli/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cli/Dockerfile b/tools/cli/Dockerfile index 8eaebf293..ee1eaa943 100644 --- a/tools/cli/Dockerfile +++ b/tools/cli/Dockerfile @@ -46,7 +46,7 @@ ENV LOADER_LIBRARY_PATH=/usr/local/lib \ WORKDIR $LOADER_SCRIPT_PATH # Copy cli from builder -COPY --from=builder /usr/local/bin/metacallcli /usr/local/bin/metacallcli +COPY --from=builder /usr/local/bin/metacallcli* /usr/local/bin/metacallcli # Define entry point ENTRYPOINT [ "metacallcli" ] From 991564206c8b90d87c7b693b7ff1c387209753c7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 19 Jun 2024 23:20:23 +0200 Subject: [PATCH 027/487] Solve more bugs from runtime. --- tools/runtime/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/runtime/Dockerfile b/tools/runtime/Dockerfile index 301436b11..96e12e096 100644 --- a/tools/runtime/Dockerfile +++ b/tools/runtime/Dockerfile @@ -91,7 +91,7 @@ COPY --from=builder /usr/local/lib/plugins /usr/local/lib/plugins COPY --from=builder /usr/local/lib/node_modules/ /usr/local/lib/node_modules/ # Copy python dependencies (and port) from builder -COPY --from=builder /usr/local/lib/python3.11/dist-packages/metacall/ /usr/local/lib/python3.11/dist-packages/metacall/ +COPY --from=builder /usr/local/lib/python3.*/dist-packages/metacall/ /usr/local/lib/python3.*/dist-packages/metacall/ # Copy headers from builder COPY --from=builder /usr/local/include/metacall /usr/local/include/metacall From e585bf55f9fb685a0968c926d72a200bbd10330b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 27 Jun 2024 17:11:36 +0200 Subject: [PATCH 028/487] Trying to solve more leaks from nodejs. --- .../node_loader/source/node_loader_impl.cpp | 53 +------------------ source/tests/CMakeLists.txt | 13 ++++- 2 files changed, 14 insertions(+), 52 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 5d2f2510e..bfe6e90c4 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -785,9 +785,9 @@ static HMODULE (*get_module_handle_a_ptr)(_In_opt_ LPCSTR) = NULL; /* TODO: Impl #if 1 // NODE_MAJOR_VERSION < 18 #if NODE_MAJOR_VERSION >= 12 - #define node_loader_impl_register_module_id node::ModuleFlags::kLinked + #define node_loader_impl_register_module_id node::ModuleFlags::kLinked | 0x08 /* NM_F_DELETEME */ #else - #define node_loader_impl_register_module_id 0x02 /* NM_F_LINKED */ + #define node_loader_impl_register_module_id 0x02 | 0x08 /* NM_F_LINKED | NM_F_DELETEME */ #endif #define node_loader_impl_register_module(name, fn) \ @@ -2271,7 +2271,6 @@ void node_loader_impl_func_await_safe(napi_env env, loader_impl_async_func_await void node_loader_impl_func_destroy_safe(napi_env env, loader_impl_async_func_destroy_safe_type *func_destroy_safe) { - uint32_t ref_count = 0; napi_handle_scope handle_scope; /* Create scope */ @@ -2280,15 +2279,6 @@ void node_loader_impl_func_destroy_safe(napi_env env, loader_impl_async_func_des node_loader_impl_exception(env, status); /* Clear function persistent reference */ - status = napi_reference_unref(env, func_destroy_safe->node_func->func_ref, &ref_count); - - node_loader_impl_exception(env, status); - - if (ref_count != 0) - { - /* TODO: Error handling */ - } - status = napi_delete_reference(env, func_destroy_safe->node_func->func_ref); node_loader_impl_exception(env, status); @@ -2398,7 +2388,6 @@ void node_loader_impl_future_await_safe(napi_env env, loader_impl_async_future_a void node_loader_impl_future_delete_safe(napi_env env, loader_impl_async_future_delete_safe_type *future_delete_safe) { - uint32_t ref_count = 0; napi_handle_scope handle_scope; /* Create scope */ @@ -2407,15 +2396,6 @@ void node_loader_impl_future_delete_safe(napi_env env, loader_impl_async_future_ node_loader_impl_exception(env, status); /* Clear promise reference */ - status = napi_reference_unref(env, future_delete_safe->node_future->promise_ref, &ref_count); - - node_loader_impl_exception(env, status); - - if (ref_count != 0) - { - /* TODO: Error handling */ - } - status = napi_delete_reference(env, future_delete_safe->node_future->promise_ref); node_loader_impl_exception(env, status); @@ -2626,7 +2606,6 @@ void node_loader_impl_clear_safe(napi_env env, loader_impl_async_clear_safe_type napi_value clear_str_value; bool result = false; napi_handle_scope handle_scope; - uint32_t ref_count = 0; /* Create scope */ napi_status status = napi_open_handle_scope(env, &handle_scope); @@ -2685,15 +2664,6 @@ void node_loader_impl_clear_safe(napi_env env, loader_impl_async_clear_safe_type } /* Clear handle persistent reference */ - status = napi_reference_unref(env, clear_safe->handle_ref, &ref_count); - - node_loader_impl_exception(env, status); - - if (ref_count != 0) - { - /* TODO: Error handling */ - } - status = napi_delete_reference(env, clear_safe->handle_ref); node_loader_impl_exception(env, status); @@ -4486,7 +4456,6 @@ void node_loader_impl_walk(uv_handle_t *handle, void *arg) void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env) { - uint32_t ref_count = 0; napi_status status; napi_handle_scope handle_scope; @@ -4514,28 +4483,10 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env } /* Clear persistent references */ - status = napi_reference_unref(env, node_impl->global_ref, &ref_count); - - node_loader_impl_exception(env, status); - - if (ref_count != 0) - { - /* TODO: Error handling */ - } - status = napi_delete_reference(env, node_impl->global_ref); node_loader_impl_exception(env, status); - status = napi_reference_unref(env, node_impl->function_table_object_ref, &ref_count); - - node_loader_impl_exception(env, status); - - if (ref_count != 0) - { - /* TODO: Error handling */ - } - status = napi_delete_reference(env, node_impl->function_table_object_ref); node_loader_impl_exception(env, status); diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index b6c702669..40c474cd1 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -53,8 +53,8 @@ if(OPTION_TEST_MEMORYCHECK AND (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_T endif() if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER OR OPTION_BUILD_MEMORY_SANITIZER)) - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --leak-check=full") # set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --show-leak-kinds=all") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --leak-check=full") set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --trace-children=yes") set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --show-reachable=yes") set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --track-origins=yes") @@ -64,6 +64,11 @@ if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUI set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-python.supp") set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-node.supp") set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-wasm.supp") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-wasm.supp") + + # TODO: Implement automatic detection for valgrind suppressions and create a proper test suite for the CI + # set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=/usr/lib/valgrind/python3.supp") + # set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=/usr/lib/valgrind/debian.supp") # TODO: Memory check does not work properly with CoreCLR # @@ -88,6 +93,12 @@ if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUI --timeout 7200 COMMAND ${CMAKE_COMMAND} -E cat "${CMAKE_BINARY_DIR}/Testing/Temporary/MemoryChecker.*.log" ) + + # This is needed in order to allow valgrind to properly track malloc in Python + set(TESTS_ENVIRONMENT_VARIABLES + ${TESTS_ENVIRONMENT_VARIABLES} + "PYTHONMALLOC=malloc" + ) endif() # From 76f02c051c9bfd84926331f8ada8b9506a12f04d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 27 Jun 2024 18:01:08 +0200 Subject: [PATCH 029/487] Update version to v0.8.0. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8fd9b8c37..8adc70fdd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.11 \ No newline at end of file +0.8.0 \ No newline at end of file From 91b015dcf3b3409830d25abe69be41b06c566aed Mon Sep 17 00:00:00 2001 From: hulxv Date: Wed, 10 Jul 2024 02:23:57 +0300 Subject: [PATCH 030/487] test: adding test cases for incorrect size of script --- source/ports/rs_port/tests/inlines_test.rs | 9 +++++++++ source/ports/rs_port/tests/loaders_test.rs | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/source/ports/rs_port/tests/inlines_test.rs b/source/ports/rs_port/tests/inlines_test.rs index fa0f45e97..fe7c9cb15 100644 --- a/source/ports/rs_port/tests/inlines_test.rs +++ b/source/ports/rs_port/tests/inlines_test.rs @@ -12,16 +12,25 @@ fn inlines() { print("hello world") } } + if loaders::from_memory("py", "").is_ok() { + py! {print("hello world")} + } if loaders::from_memory("node", "").is_ok() { node! { console.log("hello world"); } } + if loaders::from_memory("node", "").is_ok() { + node! {console.log("hello world")} + } if loaders::from_memory("ts", "").is_ok() { ts! { console.log("hello world"); } } + if loaders::from_memory("ts", "").is_ok() { + ts! {console.log("hello world")} + } } diff --git a/source/ports/rs_port/tests/loaders_test.rs b/source/ports/rs_port/tests/loaders_test.rs index 75873d8c5..0ed57931b 100644 --- a/source/ports/rs_port/tests/loaders_test.rs +++ b/source/ports/rs_port/tests/loaders_test.rs @@ -8,9 +8,9 @@ use std::{ // Two different names to avoid conflicts when testing both load_from_memory and load_from_files // in a single test. -const SCRIPT1: &str = "function greet1() { return 'hi there!' } \nmodule.exports = { greet1 };"; +const SCRIPT1: &str = "function greet1() { return 'hi there!' } \nmodule.exports = { greet1 }"; const SCRIPT2: &str = "function greet2() { return 'hi there!' } \nmodule.exports = { greet2 };"; - +const SCRIPT3: &str = "console.log('Hello world')"; fn call_greet(test: &str, num: u32) { let out = metacall_no_arg::(format!("greet{}", num)).unwrap(); if out.as_str() == "hi there!" { @@ -25,8 +25,9 @@ fn call_greet(test: &str, num: u32) { fn load_from_memory_test() { loaders::from_memory("node", SCRIPT1).unwrap(); - call_greet("load_from_memory", 1); + + loaders::from_memory("node", SCRIPT3).unwrap(); } fn load_from_file_test() { @@ -51,7 +52,6 @@ fn load_from_file_test() { #[test] fn loaders() { let _d = switch::initialize().unwrap(); - // Testing load_from_memory load_from_memory_test(); From c7a3a12ab040d51937a6bf889c2fbd7416ea1d17 Mon Sep 17 00:00:00 2001 From: hulxv Date: Wed, 10 Jul 2024 02:24:17 +0300 Subject: [PATCH 031/487] fix: incorrectly calculating the size of script that is loaded from memory --- source/ports/rs_port/src/loaders.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/rs_port/src/loaders.rs b/source/ports/rs_port/src/loaders.rs index cf0cec127..eb691acbb 100644 --- a/source/ports/rs_port/src/loaders.rs +++ b/source/ports/rs_port/src/loaders.rs @@ -82,7 +82,7 @@ pub fn from_memory(tag: impl ToString, script: impl ToString) -> Result<(), Meta metacall_load_from_memory( c_tag.as_ptr(), c_script.as_ptr(), - script.len(), + script.len() + 1, ptr::null_mut(), ) } != 0 From ffe0b97769c8a1640e823c4500a5d6a217b0e832 Mon Sep 17 00:00:00 2001 From: Nitin Gouda <90847875+shaggyyy2002@users.noreply.github.com> Date: Wed, 24 Jul 2024 02:00:47 +0530 Subject: [PATCH 032/487] Linux CI Repository Dispatch Test added (#509) * Update windows-test.yml In this I have added the repository dispatch so that it will trigger the windows-dist repo, only if it passes all the windows tests mentioned * Update linux-test.yml * org name change * adding payoad to find tags * Update macos-test.yml * Update linux-test.yml * Update linux-test.yml * Update macos-test.yml * Update windows-test.yml --------- Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- .github/workflows/linux-test.yml | 13 +++++++++++++ .github/workflows/macos-test.yml | 13 +++++++++++++ .github/workflows/windows-test.yml | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index ac8bb78ce..ed89d93c0 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -35,3 +35,16 @@ jobs: env: METACALL_BUILD_TYPE: ${{ matrix.build }} METACALL_BASE_IMAGE: ${{ matrix.image }} + + trigger_dist_linux: + needs: linux-test + if: ${{ success() }} + runs-on: ubuntu-latest + steps: + - name: Linux Repository Dispatch + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + repository: metacall/distributable-linux + event-type: test-trigger + client-payload: '{"ref": "${{ github.ref }}"}' diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 8b9679863..1514383dd 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -95,3 +95,16 @@ jobs: bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS env: METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests + + trigger_dist_macos: + needs: mac-test + if: ${{ success() }} + runs-on: ubuntu-latest + steps: + - name: MacOS Repository Dispatch + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + repository: metacall/distributable-macos + event-type: test-trigger + client-payload: '{"ref": "${{ github.ref }}"}' diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index a46e1ebe4..2bbeaefb0 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -64,3 +64,16 @@ jobs: run: cmd.exe /c "powershell ..\tools\metacall-build.ps1 $Env:METACALL_BUILD_OPTIONS" env: METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests + + trigger_dist_windows: + needs: windows-test + if: ${{ success() }} + runs-on: ubuntu-latest + steps: + - name: Windows Repository Dispatch + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + repository: metacall/distributable-windows + event-type: test-trigger + client-payload: '{"ref": "${{ github.ref }}"}' From 1845a5187439e44a6f401b7083ebd9ca36a315cf Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 23 Jul 2024 23:36:03 +0200 Subject: [PATCH 033/487] Add base compatibility to python 3.12. --- source/loaders/py_loader/source/py_loader_impl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index a23bcac03..a6a838b06 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -283,6 +283,9 @@ static PyTypeObject py_loader_impl_dict_type = { 0, /* tp_version_tag */ 0, /* tp_finalize */ 0, /* tp_vectorcall */ +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 12 + 0 /* tp_watched */ +#endif }; /* Implements: if __name__ == "__main__": */ From d35d59155086c4a1ed31337320f7923a669abdfa Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 24 Jul 2024 07:47:13 +0200 Subject: [PATCH 034/487] Unified workflows for distributable dispatch. --- .github/workflows/distributable-dispatch.yml | 58 ++++++++++++++++++++ .github/workflows/linux-test.yml | 13 ----- .github/workflows/macos-test.yml | 13 ----- .github/workflows/windows-test.yml | 13 ----- 4 files changed, 58 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/distributable-dispatch.yml diff --git a/.github/workflows/distributable-dispatch.yml b/.github/workflows/distributable-dispatch.yml new file mode 100644 index 000000000..4287a0f41 --- /dev/null +++ b/.github/workflows/distributable-dispatch.yml @@ -0,0 +1,58 @@ +name: Distributable Dispatch + +on: + workflow_run: + workflows: ["Windows Test", "MacOS Test", "Linux Test", "Linux Sanitizer Test"] + types: + - completed + branches: ['v*.*.*', 'master'] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + windows-distributable: + name: Windows Distributable Dispatch + runs-on: ubuntu-latest + steps: + - name: Windows Workflow Dispatch + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: metacall + repo: distributable-windows + github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + workflow_file_name: ci.yml + wait_workflow: true + client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' + ref: ${{ github.head_ref || github.ref_name }} + + macos-distributable: + name: MacOS Distributable Dispatch + runs-on: ubuntu-latest + steps: + - name: MacOS Workflow Dispatch + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: metacall + repo: distributable-macos + github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + workflow_file_name: ci.yml + wait_workflow: true + client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' + ref: ${{ github.head_ref || github.ref_name }} + + linux-distributable: + name: Linux Distributable Dispatch + runs-on: ubuntu-latest + steps: + - name: Linux Workflow Dispatch + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: metacall + repo: distributable-linux + github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + workflow_file_name: ci.yml + wait_workflow: true + client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' + ref: ${{ github.head_ref || github.ref_name }} diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index ed89d93c0..ac8bb78ce 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -35,16 +35,3 @@ jobs: env: METACALL_BUILD_TYPE: ${{ matrix.build }} METACALL_BASE_IMAGE: ${{ matrix.image }} - - trigger_dist_linux: - needs: linux-test - if: ${{ success() }} - runs-on: ubuntu-latest - steps: - - name: Linux Repository Dispatch - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} - repository: metacall/distributable-linux - event-type: test-trigger - client-payload: '{"ref": "${{ github.ref }}"}' diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 1514383dd..8b9679863 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -95,16 +95,3 @@ jobs: bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS env: METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests - - trigger_dist_macos: - needs: mac-test - if: ${{ success() }} - runs-on: ubuntu-latest - steps: - - name: MacOS Repository Dispatch - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} - repository: metacall/distributable-macos - event-type: test-trigger - client-payload: '{"ref": "${{ github.ref }}"}' diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 2bbeaefb0..a46e1ebe4 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -64,16 +64,3 @@ jobs: run: cmd.exe /c "powershell ..\tools\metacall-build.ps1 $Env:METACALL_BUILD_OPTIONS" env: METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests - - trigger_dist_windows: - needs: windows-test - if: ${{ success() }} - runs-on: ubuntu-latest - steps: - - name: Windows Repository Dispatch - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} - repository: metacall/distributable-windows - event-type: test-trigger - client-payload: '{"ref": "${{ github.ref }}"}' From 315c7848b39dc8bd8eb17d3dcb94dbd16796238d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 25 Jul 2024 23:37:49 +0200 Subject: [PATCH 035/487] Add base for new threading model in py_loader. --- source/loaders/py_loader/CMakeLists.txt | 2 + .../include/py_loader/py_loader_threading.h | 40 +++ .../loaders/py_loader/source/py_loader_impl.c | 251 ++++++++++-------- .../loaders/py_loader/source/py_loader_port.c | 31 +++ .../py_loader/source/py_loader_threading.cpp | 145 ++++++++++ 5 files changed, 355 insertions(+), 114 deletions(-) create mode 100644 source/loaders/py_loader/include/py_loader/py_loader_threading.h create mode 100644 source/loaders/py_loader/source/py_loader_threading.cpp diff --git a/source/loaders/py_loader/CMakeLists.txt b/source/loaders/py_loader/CMakeLists.txt index 39136bb2f..2b8153e5d 100644 --- a/source/loaders/py_loader/CMakeLists.txt +++ b/source/loaders/py_loader/CMakeLists.txt @@ -87,12 +87,14 @@ set(headers ${include_path}/py_loader.h ${include_path}/py_loader_impl.h ${include_path}/py_loader_port.h + ${include_path}/py_loader_threading.h ) set(sources ${source_path}/py_loader.c ${source_path}/py_loader_impl.c ${source_path}/py_loader_port.c + ${source_path}/py_loader_threading.cpp ) # Group source files diff --git a/source/loaders/py_loader/include/py_loader/py_loader_threading.h b/source/loaders/py_loader/include/py_loader/py_loader_threading.h new file mode 100644 index 000000000..3f38fecac --- /dev/null +++ b/source/loaders/py_loader/include/py_loader/py_loader_threading.h @@ -0,0 +1,40 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading python code at run-time into a process. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef PY_LOADER_THREADING_H +#define PY_LOADER_THREADING_H 1 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +PY_LOADER_NO_EXPORT void py_loader_thread_initialize(void); + +PY_LOADER_NO_EXPORT void py_loader_thread_acquire(void); + +PY_LOADER_NO_EXPORT void py_loader_thread_release(void); + +#ifdef __cplusplus +} +#endif + +#endif /* PY_LOADER_THREADING_H */ diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index a6a838b06..b60a5acb0 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -35,6 +36,8 @@ #include +#include + #include #include @@ -337,6 +340,8 @@ void py_loader_impl_dict_dealloc(struct py_loader_impl_dict_obj *self) PyObject *py_loader_impl_finalizer_wrap_map(PyObject *obj, value v) { + py_loader_thread_acquire(); + PyObject *args = PyTuple_New(1); union py_loader_impl_dict_cast dict_cast = { &py_loader_impl_dict_type }; @@ -345,6 +350,8 @@ PyObject *py_loader_impl_finalizer_wrap_map(PyObject *obj, value v) PyObject *wrapper = PyObject_CallObject(dict_cast.object, args); Py_DECREF(args); + py_loader_thread_release(); + if (wrapper == NULL) { return NULL; @@ -360,6 +367,8 @@ PyObject *py_loader_impl_finalizer_wrap_map(PyObject *obj, value v) int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v) { + py_loader_thread_acquire(); + /* This can be only used for non-builtin modules, any builtin will fail to overwrite the destructor */ PyObject *v_capsule = PyCapsule_New(v, NULL, NULL); PyObject *destructor = PyCFunction_New(py_loader_impl_finalizer_defs, v_capsule); @@ -383,9 +392,13 @@ int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v) Py_XDECREF(v_capsule); } + py_loader_thread_release(); + return 1; } + py_loader_thread_release(); + return 0; } @@ -398,11 +411,9 @@ void py_loader_impl_value_invoke_state_finalize(value v, void *data) if (loader_is_destroyed(invoke_state->impl) != 0 && capsule != NULL) { - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); Py_DECREF(capsule); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); } free(invoke_state); @@ -420,8 +431,10 @@ void py_loader_impl_value_ptr_finalize(value v, void *data) if (loader_is_destroyed(impl) != 0) { + py_loader_thread_acquire(); PyObject *obj = (PyObject *)value_to_ptr(v); Py_XDECREF(obj); + py_loader_thread_release(); } } } @@ -443,11 +456,9 @@ void type_py_interface_destroy(type t, type_impl impl) if (Py_IsInitialized() != 0) { - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); Py_DECREF(builtin); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); } } @@ -509,11 +520,9 @@ void future_py_interface_destroy(future f, future_impl impl) { if (loader_is_destroyed(py_future->impl) != 0) { - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); Py_DECREF(py_future->future); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); } free(py_future); @@ -549,6 +558,8 @@ value py_object_interface_get(object obj, object_impl impl, struct accessor_type { (void)obj; + py_loader_thread_acquire(); + loader_impl_py_object py_object = (loader_impl_py_object)impl; PyObject *pyobject_object = py_object->obj; PyObject *key_py_str = PyUnicode_FromString(attribute_name(accessor->data.attr)); @@ -558,6 +569,8 @@ value py_object_interface_get(object obj, object_impl impl, struct accessor_type value v = py_loader_impl_capi_to_value(impl, generic_attr, py_loader_impl_capi_to_value_type(py_object->impl, generic_attr)); Py_XDECREF(generic_attr); + py_loader_thread_release(); + return v; } @@ -565,6 +578,8 @@ int py_object_interface_set(object obj, object_impl impl, struct accessor_type * { (void)obj; + py_loader_thread_acquire(); + loader_impl_py_object py_object = (loader_impl_py_object)impl; PyObject *pyobject_object = py_object->obj; PyObject *key_py_str = PyUnicode_FromString(attribute_name(accessor->data.attr)); @@ -573,6 +588,8 @@ int py_object_interface_set(object obj, object_impl impl, struct accessor_type * Py_DECREF(key_py_str); + py_loader_thread_release(); + return retval; } @@ -587,11 +604,15 @@ value py_object_interface_method_invoke(object obj, object_impl impl, method m, return NULL; } + value ret = NULL; + + py_loader_thread_acquire(); + PyObject *args_tuple = PyTuple_New(argc); if (args_tuple == NULL) { - return NULL; + goto release; } for (size_t i = 0; i < argc; i++) @@ -605,13 +626,16 @@ value py_object_interface_method_invoke(object obj, object_impl impl, method m, if (python_object == NULL) { - return NULL; + goto release; } - value ret = py_loader_impl_capi_to_value(impl, python_object, py_loader_impl_capi_to_value_type(obj_impl->impl, python_object)); + ret = py_loader_impl_capi_to_value(impl, python_object, py_loader_impl_capi_to_value_type(obj_impl->impl, python_object)); Py_XDECREF(python_object); +release: + py_loader_thread_release(); + return ret; } @@ -650,16 +674,16 @@ void py_object_interface_destroy(object obj, object_impl impl) { if (loader_is_destroyed(py_object->impl) != 0) { - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); + Py_XDECREF(py_object->obj); + py_loader_thread_release(); + if (py_object->obj_class != NULL) { value_type_destroy(py_object->obj_class); } - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); } free(py_object); @@ -713,10 +737,15 @@ object py_class_interface_constructor(klass cls, class_impl impl, const char *na py_obj->impl = py_cls->impl; py_obj->obj_class = NULL; + py_loader_thread_acquire(); + PyObject *args_tuple = PyTuple_New(argc); if (args_tuple == NULL) + { + py_loader_thread_release(); return NULL; + } for (size_t i = 0; i < argc; i++) { @@ -730,11 +759,13 @@ object py_class_interface_constructor(klass cls, class_impl impl, const char *na if (python_object == NULL) { + py_loader_thread_release(); object_destroy(obj); return NULL; } Py_INCREF(py_cls->cls); + py_loader_thread_release(); py_obj->obj = python_object; return obj; @@ -753,6 +784,8 @@ value py_class_interface_static_get(klass cls, class_impl impl, struct accessor_ return NULL; } + py_loader_thread_acquire(); + PyObject *key_py_str = PyUnicode_FromString(attr_name); PyObject *generic_attr = PyObject_GenericGetAttr(pyobject_class, key_py_str); Py_XDECREF(key_py_str); @@ -760,6 +793,8 @@ value py_class_interface_static_get(klass cls, class_impl impl, struct accessor_ value v = py_loader_impl_capi_to_value(impl, generic_attr, py_loader_impl_capi_to_value_type(py_class->impl, generic_attr)); Py_XDECREF(generic_attr); + py_loader_thread_release(); + return v; } @@ -769,7 +804,6 @@ int py_class_interface_static_set(klass cls, class_impl impl, struct accessor_ty loader_impl_py_class py_class = (loader_impl_py_class)impl; PyObject *pyobject_class = py_class->cls; - PyObject *pyvalue = py_loader_impl_value_to_capi(py_class->impl, value_type_id(v), v); char *attr_name = attribute_name(accessor->data.attr); if (attr_name == NULL) @@ -777,11 +811,16 @@ int py_class_interface_static_set(klass cls, class_impl impl, struct accessor_ty return 1; } + py_loader_thread_acquire(); + + PyObject *pyvalue = py_loader_impl_value_to_capi(py_class->impl, value_type_id(v), v); PyObject *key_py_str = PyUnicode_FromString(attr_name); int retval = PyObject_GenericSetAttr(pyobject_class, key_py_str, pyvalue); Py_DECREF(key_py_str); + py_loader_thread_release(); + return retval; } @@ -796,20 +835,23 @@ value py_class_interface_static_invoke(klass cls, class_impl impl, method m, cla return NULL; } + value ret = NULL; char *static_method_name = method_name(m); + py_loader_thread_acquire(); + PyObject *method = PyObject_GetAttrString(cls_impl->cls, static_method_name); if (method == NULL) { - return NULL; + goto cleanup; } PyObject *args_tuple = PyTuple_New(argc); if (args_tuple == NULL) { - return NULL; + goto cleanup; } for (size_t i = 0; i < argc; i++) @@ -824,10 +866,14 @@ value py_class_interface_static_invoke(klass cls, class_impl impl, method m, cla if (python_object == NULL) { - return NULL; + goto cleanup; } - return py_loader_impl_capi_to_value(impl, python_object, py_loader_impl_capi_to_value_type(cls_impl->impl, python_object)); + ret = py_loader_impl_capi_to_value(impl, python_object, py_loader_impl_capi_to_value_type(cls_impl->impl, python_object)); + +cleanup: + py_loader_thread_release(); + return ret; } value py_class_interface_static_await(klass cls, class_impl impl, method m, class_args args, size_t size, class_resolve_callback resolve, class_reject_callback reject, void *ctx) @@ -855,11 +901,9 @@ void py_class_interface_destroy(klass cls, class_impl impl) { if (loader_is_destroyed(py_class->impl) != 0) { - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); Py_XDECREF(py_class->cls); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); } free(py_class); @@ -1610,11 +1654,18 @@ PyObject *py_loader_impl_value_to_capi(loader_impl impl, type_id id, value v) return NULL; } -PyObject *py_task_callback_handler_impl_unsafe(PyThreadState *tstate, PyGILState_STATE gstate, PyObject *pyfuture) +PyObject *py_task_callback_handler_impl(PyObject *self, PyObject *pyfuture) { + py_loader_thread_acquire(); + + /* self will always be NULL */ + (void)self; + PyObject *capsule = PyObject_GetAttrString(pyfuture, "__metacall_capsule"); + if (capsule == NULL) { + py_loader_thread_release(); log_write("metacall", LOG_LEVEL_ERROR, "Invalid python capsule in task_callback_handler"); Py_RETURN_NONE; } @@ -1638,11 +1689,9 @@ PyObject *py_task_callback_handler_impl_unsafe(PyThreadState *tstate, PyGILState Py_DECREF(result); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); ret = callback_state->resolve_callback(v, callback_state->context); - tstate = PyEval_SaveThread(); - gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); } else { @@ -1672,17 +1721,18 @@ PyObject *py_task_callback_handler_impl_unsafe(PyThreadState *tstate, PyGILState v = value_create_null(); } - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); ret = callback_state->reject_callback(v, callback_state->context); - tstate = PyEval_SaveThread(); - gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); } loader_impl impl = callback_state->impl; - value_type_destroy(v); Py_DECREF(callback_state->coroutine); + + py_loader_thread_release(); + + value_type_destroy(v); value_type_destroy(callback_state->func_val); free(callback_state); @@ -1692,24 +1742,14 @@ PyObject *py_task_callback_handler_impl_unsafe(PyThreadState *tstate, PyGILState } else { - return py_loader_impl_value_to_capi(impl, value_type_id(ret), ret); - } -} + py_loader_thread_acquire(); -PyObject *py_task_callback_handler_impl(PyObject *self, PyObject *pyfuture) -{ - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + PyObject *py_result = py_loader_impl_value_to_capi(impl, value_type_id(ret), ret); - /* self will always be NULL */ - (void)self; - - PyObject *result = py_task_callback_handler_impl_unsafe(tstate, gstate, pyfuture); + py_loader_thread_release(); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); - - return result; + return py_result; + } } function_return function_py_interface_invoke(function func, function_impl impl, function_args args, size_t args_size) @@ -1719,10 +1759,10 @@ function_return function_py_interface_invoke(function func, function_impl impl, const size_t signature_args_size = signature_count(s); type ret_type = signature_get_return(s); loader_impl_py py_impl = loader_impl_get(py_func->impl); - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); value v = NULL; + py_loader_thread_acquire(); + /* Possibly a recursive call */ if (Py_EnterRecursiveCall(" while executing a function in Python Loader") != 0) { @@ -1779,8 +1819,7 @@ function_return function_py_interface_invoke(function func, function_impl impl, Py_DECREF(result); finalize: - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); return v; } @@ -1794,10 +1833,10 @@ function_return function_py_interface_await(function func, function_impl impl, f PyObject *pyfuture = NULL; size_t args_count; loader_impl_py py_impl = loader_impl_get(py_func->impl); - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); PyObject *tuple_args; + py_loader_thread_acquire(); + /* Allocate dynamically more space for values in case of variable arguments */ void **values = args_size > signature_args_size ? malloc(sizeof(void *) * args_size) : py_func->values; @@ -1911,8 +1950,7 @@ function_return function_py_interface_await(function func, function_impl impl, f Py_DECREF(pyfuture); Py_DECREF(tuple_args); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); return v; } @@ -1926,8 +1964,7 @@ function_return function_py_interface_await(function func, function_impl impl, f Py_XDECREF(pyfuture); Py_DECREF(tuple_args); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); return NULL; } @@ -1946,11 +1983,9 @@ void function_py_interface_destroy(function func, function_impl impl) if (loader_is_destroyed(py_func->impl) != 0) { - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); Py_DECREF(py_func->func); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); } free(py_func); @@ -2642,6 +2677,8 @@ int py_loader_impl_initialize_argv(loader_impl_py py_impl, int argc, char **argv static void PyCFunction_dealloc(PyObject *obj) { + py_loader_thread_acquire(); + /* Check if we are passing our own hook to the callback */ if (PyCFunction_Check(obj) && PyCFunction_GET_FUNCTION(obj) == py_loader_impl_function_type_invoke) { @@ -2654,7 +2691,9 @@ static void PyCFunction_dealloc(PyObject *obj) loader_impl_py_function_type_invoke_state invoke_state = PyCapsule_GetPointer(invoke_state_capsule, NULL); + py_loader_thread_release(); value_type_destroy(invoke_state->callback); + py_loader_thread_acquire(); Py_DECREF(invoke_state_capsule); @@ -2663,6 +2702,8 @@ static void PyCFunction_dealloc(PyObject *obj) /* Call to the original meth_dealloc function */ py_loader_impl_pycfunction_dealloc(obj); + + py_loader_thread_release(); } loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration config) @@ -2695,9 +2736,6 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi } #endif - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); - /* Hook the deallocation of PyCFunction */ py_loader_impl_pycfunction_dealloc = PyCFunction_Type.tp_dealloc; PyCFunction_Type.tp_dealloc = PyCFunction_dealloc; @@ -2778,8 +2816,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi goto error_after_asyncio_module; } - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_initialize(); /* Register initialization */ loader_initialization_register(impl); @@ -2823,8 +2860,6 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi #endif error_after_argv: error_after_sys_executable: - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); (void)py_loader_impl_finalize(py_impl); error_init_py: free(py_impl); @@ -2842,8 +2877,8 @@ int py_loader_impl_execution_path(loader_impl impl, const loader_path path) } int result = 0; - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + + py_loader_thread_acquire(); PyObject *system_paths = PySys_GetObject("path"); PyObject *current_path = PyUnicode_DecodeFSDefault(path); @@ -2871,8 +2906,7 @@ int py_loader_impl_execution_path(loader_impl impl, const loader_path path) clear_current_path: Py_DECREF(current_path); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); return result; } @@ -2941,16 +2975,15 @@ void py_loader_impl_module_destroy(loader_impl_py_handle_module module) void py_loader_impl_handle_destroy(loader_impl_py_handle py_handle) { - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); for (size_t iterator = 0; iterator < py_handle->size; ++iterator) { py_loader_impl_module_destroy(&py_handle->modules[iterator]); } - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); + free(py_handle->modules); free(py_handle); } @@ -3163,8 +3196,7 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path goto error_create_handle; } - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); /* Possibly a recursive call */ if (Py_EnterRecursiveCall(" while loading a module from file in Python Loader") != 0) @@ -3245,8 +3277,7 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path /* End of recursive call */ Py_LeaveRecursiveCall(); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); return (loader_handle)py_handle; @@ -3258,8 +3289,7 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path } Py_XDECREF(exception); error_recursive_call: - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); py_loader_impl_handle_destroy(py_handle); error_create_handle: return NULL; @@ -3293,8 +3323,7 @@ loader_handle py_loader_impl_load_from_memory(loader_impl impl, const loader_nam goto error_create_handle; } - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); /* Possibly a recursive call */ if (Py_EnterRecursiveCall(" while loading a module from memory in Python Loader") != 0) @@ -3317,8 +3346,7 @@ loader_handle py_loader_impl_load_from_memory(loader_impl impl, const loader_nam /* End of recursive call */ Py_LeaveRecursiveCall(); - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); log_write("metacall", LOG_LEVEL_DEBUG, "Python loader (%p) importing %s from memory module at (%p)", (void *)impl, name, (void *)py_handle->modules[0].instance); @@ -3329,8 +3357,7 @@ loader_handle py_loader_impl_load_from_memory(loader_impl impl, const loader_nam { PyErr_Clear(); } - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); + py_loader_thread_release(); py_loader_impl_handle_destroy(py_handle); error_create_handle: return NULL; @@ -3938,13 +3965,12 @@ static int py_loader_impl_validate_object(loader_impl impl, PyObject *obj, objec int py_loader_impl_discover_module(loader_impl impl, PyObject *module, context ctx) { - int ret = 1; - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); if (module == NULL || !PyModule_Check(module)) { - goto cleanup; + py_loader_thread_release(); + return 1; } // This should never fail since `module` is a valid module object @@ -3978,14 +4004,16 @@ int py_loader_impl_discover_module(loader_impl impl, PyObject *module, context c value v = value_create_class(c); if (scope_define(sp, cls_name, v) != 0) { + py_loader_thread_release(); value_type_destroy(v); - goto cleanup; + return 1; } } else { + py_loader_thread_release(); class_destroy(c); - goto cleanup; + return 1; } } else if (PyCallable_Check(module_dict_val)) @@ -3996,7 +4024,8 @@ int py_loader_impl_discover_module(loader_impl impl, PyObject *module, context c if (py_func == NULL) { - goto cleanup; + py_loader_thread_release(); + return 1; } Py_INCREF(module_dict_val); @@ -4013,24 +4042,22 @@ int py_loader_impl_discover_module(loader_impl impl, PyObject *module, context c value v = value_create_function(f); if (scope_define(sp, func_name, v) != 0) { + py_loader_thread_release(); value_type_destroy(v); - goto cleanup; + return 1; } } else { + py_loader_thread_release(); function_destroy(f); - goto cleanup; + return 1; } } } - ret = 0; - -cleanup: - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); - return ret; + py_loader_thread_release(); + return 0; } int py_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx) @@ -4253,8 +4280,7 @@ int py_loader_impl_destroy(loader_impl impl) /* Destroy children loaders */ loader_unload_children(impl); - PyThreadState *tstate = PyEval_SaveThread(); - PyGILState_STATE gstate = PyGILState_Ensure(); + py_loader_thread_acquire(); /* Stop event loop for async calls */ PyObject *args_tuple = PyTuple_New(1); @@ -4300,9 +4326,6 @@ int py_loader_impl_destroy(loader_impl impl) } #endif - PyGILState_Release(gstate); - PyEval_RestoreThread(tstate); - int result = py_loader_impl_finalize(py_impl); /* Unhook the deallocation of PyCFunction */ diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index 3cec97d2a..fad849e4b 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -22,6 +22,7 @@ #include #include +#include #include @@ -186,9 +187,13 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar } } + py_loader_thread_release(); + /* Execute the load from file call */ int ret = metacall_load_from_file(tag_str, (const char **)paths_str, paths_size, handle); + py_loader_thread_acquire(); + if (ret != 0) { result = handle == NULL ? py_loader_port_false() : py_loader_port_none(); @@ -326,9 +331,13 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject return py_loader_port_false(); } + py_loader_thread_release(); + /* Execute the load from package call */ int ret = metacall_load_from_package(tag_str, path_str, handle); + py_loader_thread_acquire(); + if (ret != 0) { result = handle == NULL ? py_loader_port_false() : py_loader_port_none(); @@ -453,8 +462,12 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) /* Execute the load from memory call */ { + py_loader_thread_release(); + int ret = metacall_load_from_memory(tag_str, (const char *)buffer_str, buffer_length + 1, NULL); + py_loader_thread_acquire(); + if (ret != 0) { return py_loader_port_false(); @@ -541,6 +554,8 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) { void *ret; + py_loader_thread_release(); + if (value_args != NULL) { ret = metacallv_s(name_str, value_args, args_size); @@ -550,6 +565,8 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) ret = metacallv_s(name_str, metacall_null_args, 0); } + py_loader_thread_acquire(); + if (ret == NULL) { result = py_loader_port_none(); @@ -558,7 +575,9 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) result = py_loader_impl_value_to_capi(impl, value_type_id(ret), ret); + py_loader_thread_release(); value_type_destroy(ret); + py_loader_thread_acquire(); if (result == NULL) { @@ -570,11 +589,15 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) clear: if (value_args != NULL) { + py_loader_thread_release(); + for (args_count = 0; args_count < args_size; ++args_count) { value_type_destroy(value_args[args_count]); } + py_loader_thread_acquire(); + free(value_args); } @@ -660,6 +683,8 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) { void *ret; + py_loader_thread_release(); + /* TODO: */ /* if (value_args != NULL) @@ -672,6 +697,8 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) } */ + py_loader_thread_acquire(); + if (ret == NULL) { result = py_loader_port_none(); @@ -717,9 +744,13 @@ static PyObject *py_loader_port_inspect(PyObject *self, PyObject *args) (void)self; (void)args; + py_loader_thread_release(); + /* Retrieve inspect data */ result_str = inspect_str = metacall_inspect(&size, allocator); + py_loader_thread_acquire(); + if (inspect_str == NULL || size == 0) { static const char empty[] = "{}"; diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp new file mode 100644 index 000000000..a55c93324 --- /dev/null +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -0,0 +1,145 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading python code at run-time into a process. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include + +#include + +#include +#include +#include +#include +#include + +struct py_thread_state +{ + uint64_t ref_count; + PyGILState_STATE gstate; + + py_thread_state() : + ref_count(1), gstate(PyGILState_Ensure()) {} + + ~py_thread_state() + { + PyGILState_Release(gstate); + } +}; + +static std::map thread_states; +static std::mutex thread_states_mutex; +static PyThreadState *main_thread_state = NULL; +static uint64_t main_thread_id = 0; +static std::atomic_uintmax_t main_thread_ref_count; + +void py_loader_thread_initialize() +{ + main_thread_state = PyEval_SaveThread(); + main_thread_id = thread_id_get_current(); + main_thread_ref_count = 0; +} + +void py_loader_thread_acquire() +{ + uint64_t current_thread_id = thread_id_get_current(); + + if (main_thread_id == current_thread_id) + { + if (main_thread_state != NULL) + { + uintmax_t ref_count = main_thread_ref_count++; + + if (ref_count == 0) + { + PyEval_RestoreThread(main_thread_state); + } + } + } + else + { + thread_states_mutex.lock(); + auto iterator = thread_states.find(current_thread_id); + + if (iterator == thread_states.end()) + { + thread_states_mutex.unlock(); + + py_thread_state *thread_state = new py_thread_state(); + + thread_states_mutex.lock(); + thread_states[current_thread_id] = thread_state; + thread_states_mutex.unlock(); + } + else + { + py_thread_state *thread_state = iterator->second; + ++thread_state->ref_count; + thread_states_mutex.unlock(); + } + } +} + +void py_loader_thread_release() +{ + uint64_t current_thread_id = thread_id_get_current(); + + if (main_thread_id == current_thread_id) + { + uint64_t ref_count = main_thread_ref_count.load(); + + if (ref_count > 0) + { + ref_count = --main_thread_ref_count; + + if (ref_count == 0) + { + main_thread_state = PyEval_SaveThread(); + } + } + } + else + { + thread_states_mutex.lock(); + auto iterator = thread_states.find(current_thread_id); + + if (iterator == thread_states.end()) + { + thread_states_mutex.unlock(); + } + else + { + py_thread_state *thread_state = iterator->second; + + if (thread_state->ref_count <= 1) + { + thread_states.erase(iterator); + thread_states_mutex.unlock(); + + delete thread_state; + } + else + { + --thread_state->ref_count; + thread_states_mutex.unlock(); + } + } + } +} From c69243743496f4c123ac1ddee49ef699337d1c68 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 26 Jul 2024 00:32:04 +0200 Subject: [PATCH 036/487] Update version of rapidjson. --- cmake/InstallRapidJSON.cmake | 8 +++----- source/serials/rapid_json_serial/CMakeLists.txt | 2 +- tools/metacall-environment.sh | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cmake/InstallRapidJSON.cmake b/cmake/InstallRapidJSON.cmake index 11af554ff..8b4bc960d 100644 --- a/cmake/InstallRapidJSON.cmake +++ b/cmake/InstallRapidJSON.cmake @@ -24,14 +24,12 @@ if(NOT RAPIDJSON_FOUND OR USE_BUNDLED_RAPIDJSON) if(NOT RAPIDJSON_VERSION OR USE_BUNDLED_RAPIDJSON) - set(RAPIDJSON_VERSION 232389d) - set(RAPIDJSON_URL_MD5 577d3495a07b66fcd4a2866c93831bc4) + set(RAPIDJSON_VERSION ab1842a2dae061284c0a62dca1cc6d5e7e37e346) endif() ExternalProject_Add(rapid-json-depends - DOWNLOAD_NAME RapidJSON-${RAPIDJSON_VERSION}.tar.gz - URL https://github.com/Tencent/rapidjson/archive/${RAPIDJSON_VERSION}.tar.gz - URL_MD5 ${RAPIDJSON_URL_MD5} + GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git" + GIT_TAG "${RAPIDJSON_VERSION}" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DRAPIDJSON_BUILD_DOC=Off diff --git a/source/serials/rapid_json_serial/CMakeLists.txt b/source/serials/rapid_json_serial/CMakeLists.txt index 442950bb9..c3f1d0d0c 100644 --- a/source/serials/rapid_json_serial/CMakeLists.txt +++ b/source/serials/rapid_json_serial/CMakeLists.txt @@ -8,7 +8,7 @@ endif() # External dependencies # -find_package(RapidJSON 1.1.0) +find_package(RapidJSON) if(NOT RAPIDJSON_FOUND) include(InstallRapidJSON) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index ad0315dc3..133dc6da9 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -254,7 +254,7 @@ sub_rapidjson(){ if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then git clone https://github.com/miloyip/rapidjson.git cd rapidjson - git checkout v1.1.0 + git checkout ab1842a2dae061284c0a62dca1cc6d5e7e37e346 mkdir build cd build cmake -DRAPIDJSON_BUILD_DOC=Off -DRAPIDJSON_BUILD_EXAMPLES=Off -DRAPIDJSON_BUILD_TESTS=Off .. From b2a871dc85d5f4b919d812ccd8ee46f1226c474e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 26 Jul 2024 01:09:44 +0200 Subject: [PATCH 037/487] Remove unnecesary mutex. --- .../py_loader/source/py_loader_threading.cpp | 45 ++++--------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index a55c93324..9fbe45190 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -25,9 +25,6 @@ #include #include -#include -#include -#include #include struct py_thread_state @@ -44,11 +41,10 @@ struct py_thread_state } }; -static std::map thread_states; -static std::mutex thread_states_mutex; static PyThreadState *main_thread_state = NULL; static uint64_t main_thread_id = 0; static std::atomic_uintmax_t main_thread_ref_count; +thread_local py_thread_state *current_thread_state = NULL; void py_loader_thread_initialize() { @@ -75,24 +71,13 @@ void py_loader_thread_acquire() } else { - thread_states_mutex.lock(); - auto iterator = thread_states.find(current_thread_id); - - if (iterator == thread_states.end()) + if (current_thread_state == NULL) { - thread_states_mutex.unlock(); - - py_thread_state *thread_state = new py_thread_state(); - - thread_states_mutex.lock(); - thread_states[current_thread_id] = thread_state; - thread_states_mutex.unlock(); + current_thread_state = new py_thread_state(); } else { - py_thread_state *thread_state = iterator->second; - ++thread_state->ref_count; - thread_states_mutex.unlock(); + ++current_thread_state->ref_count; } } } @@ -117,28 +102,16 @@ void py_loader_thread_release() } else { - thread_states_mutex.lock(); - auto iterator = thread_states.find(current_thread_id); - - if (iterator == thread_states.end()) + if (current_thread_state != NULL) { - thread_states_mutex.unlock(); - } - else - { - py_thread_state *thread_state = iterator->second; - - if (thread_state->ref_count <= 1) + if (current_thread_state->ref_count <= 1) { - thread_states.erase(iterator); - thread_states_mutex.unlock(); - - delete thread_state; + delete current_thread_state; + current_thread_state = NULL; } else { - --thread_state->ref_count; - thread_states_mutex.unlock(); + --current_thread_state->ref_count; } } } From 25178e795bb71df649bfb7173a92df6dbb7c79d4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 26 Jul 2024 01:30:29 +0200 Subject: [PATCH 038/487] Optimized single thread path py_loader. --- source/loaders/py_loader/source/py_loader_threading.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index 9fbe45190..ff8b5ec91 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -48,7 +48,6 @@ thread_local py_thread_state *current_thread_state = NULL; void py_loader_thread_initialize() { - main_thread_state = PyEval_SaveThread(); main_thread_id = thread_id_get_current(); main_thread_ref_count = 0; } @@ -93,11 +92,11 @@ void py_loader_thread_release() if (ref_count > 0) { ref_count = --main_thread_ref_count; + } - if (ref_count == 0) - { - main_thread_state = PyEval_SaveThread(); - } + if (ref_count == 0) + { + main_thread_state = PyEval_SaveThread(); } } else From cb183f2765670d704abd0a6ffd6037c7b2410257 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 26 Jul 2024 07:51:21 +0200 Subject: [PATCH 039/487] Update folders in MSVC. --- source/scripts/extension/CMakeLists.txt | 2 +- source/scripts/extension/{sum_extension => sum}/CMakeLists.txt | 2 +- .../include/sum_extension/sum_extension.h | 0 .../extension/{sum_extension => sum}/source/sum_extension.cpp | 0 source/scripts/node/gram/CMakeLists.txt | 2 +- source/scripts/node/ramda/CMakeLists.txt | 2 +- source/scripts/typescript/templating/CMakeLists.txt | 2 +- .../node_extension_test/CMakeLists.txt | 2 +- 8 files changed, 6 insertions(+), 6 deletions(-) rename source/scripts/extension/{sum_extension => sum}/CMakeLists.txt (98%) rename source/scripts/extension/{sum_extension => sum}/include/sum_extension/sum_extension.h (100%) rename source/scripts/extension/{sum_extension => sum}/source/sum_extension.cpp (100%) diff --git a/source/scripts/extension/CMakeLists.txt b/source/scripts/extension/CMakeLists.txt index 231d6d807..20591a99c 100644 --- a/source/scripts/extension/CMakeLists.txt +++ b/source/scripts/extension/CMakeLists.txt @@ -7,4 +7,4 @@ endif() # Sub-projects # -add_subdirectory(sum_extension) +add_subdirectory(sum) diff --git a/source/scripts/extension/sum_extension/CMakeLists.txt b/source/scripts/extension/sum/CMakeLists.txt similarity index 98% rename from source/scripts/extension/sum_extension/CMakeLists.txt rename to source/scripts/extension/sum/CMakeLists.txt index b6d23946f..223a70066 100644 --- a/source/scripts/extension/sum_extension/CMakeLists.txt +++ b/source/scripts/extension/sum/CMakeLists.txt @@ -82,7 +82,7 @@ generate_export_header(${target} set_target_properties(${target} PROPERTIES ${DEFAULT_PROJECT_OPTIONS} - FOLDER "${IDE_FOLDER}" + FOLDER "${IDE_FOLDER}/Extension" BUNDLE $<$:$<$>> ) diff --git a/source/scripts/extension/sum_extension/include/sum_extension/sum_extension.h b/source/scripts/extension/sum/include/sum_extension/sum_extension.h similarity index 100% rename from source/scripts/extension/sum_extension/include/sum_extension/sum_extension.h rename to source/scripts/extension/sum/include/sum_extension/sum_extension.h diff --git a/source/scripts/extension/sum_extension/source/sum_extension.cpp b/source/scripts/extension/sum/source/sum_extension.cpp similarity index 100% rename from source/scripts/extension/sum_extension/source/sum_extension.cpp rename to source/scripts/extension/sum/source/sum_extension.cpp diff --git a/source/scripts/node/gram/CMakeLists.txt b/source/scripts/node/gram/CMakeLists.txt index 55c2e0d4a..3cdce72ba 100644 --- a/source/scripts/node/gram/CMakeLists.txt +++ b/source/scripts/node/gram/CMakeLists.txt @@ -19,7 +19,7 @@ add_custom_target(nodejs-gram-depends set_target_properties(nodejs-gram-depends PROPERTIES ${DEFAULT_PROJECT_OPTIONS} - FOLDER "${IDE_FOLDER}" + FOLDER "${IDE_FOLDER}/NodeJS" ) # diff --git a/source/scripts/node/ramda/CMakeLists.txt b/source/scripts/node/ramda/CMakeLists.txt index 3e15315ad..46c963e2a 100644 --- a/source/scripts/node/ramda/CMakeLists.txt +++ b/source/scripts/node/ramda/CMakeLists.txt @@ -19,7 +19,7 @@ add_custom_target(nodejs-ramda-depends set_target_properties(nodejs-ramda-depends PROPERTIES ${DEFAULT_PROJECT_OPTIONS} - FOLDER "${IDE_FOLDER}" + FOLDER "${IDE_FOLDER}/NodeJS" ) # diff --git a/source/scripts/typescript/templating/CMakeLists.txt b/source/scripts/typescript/templating/CMakeLists.txt index 663750ee2..ca2e15fc9 100644 --- a/source/scripts/typescript/templating/CMakeLists.txt +++ b/source/scripts/typescript/templating/CMakeLists.txt @@ -19,7 +19,7 @@ add_custom_target(typescript-templating-depends set_target_properties(typescript-templating-depends PROPERTIES ${DEFAULT_PROJECT_OPTIONS} - FOLDER "${IDE_FOLDER}" + FOLDER "${IDE_FOLDER}/TypeScript" ) # diff --git a/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt b/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt index 7afb674bd..997208d44 100644 --- a/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt +++ b/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt @@ -93,7 +93,7 @@ generate_export_header(${target} set_target_properties(${target} PROPERTIES ${DEFAULT_PROJECT_OPTIONS} - FOLDER "Scripts" # Put it on scripts even if it is on tests folder + FOLDER "${IDE_FOLDER}" BUNDLE $<$:$<$>> # Set NodeJS extension properies From 408665547f464de441dd19a3d4db1ed0bb9b468c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Mon, 29 Jul 2024 02:44:04 -0400 Subject: [PATCH 040/487] Update distributable-dispatch.yml --- .github/workflows/distributable-dispatch.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/distributable-dispatch.yml b/.github/workflows/distributable-dispatch.yml index 4287a0f41..f82026bca 100644 --- a/.github/workflows/distributable-dispatch.yml +++ b/.github/workflows/distributable-dispatch.yml @@ -31,6 +31,16 @@ jobs: name: MacOS Distributable Dispatch runs-on: ubuntu-latest steps: + - name: Homebrew Workflow Dispatch + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: metacall + repo: homebrew + github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + workflow_file_name: ci.yml + wait_workflow: true + client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' + ref: ${{ github.head_ref || github.ref_name }} - name: MacOS Workflow Dispatch uses: convictional/trigger-workflow-and-wait@v1.6.1 with: From cc4bf98f1ef534d954ea18caf1458fc0fb650469 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Mon, 29 Jul 2024 02:45:43 -0400 Subject: [PATCH 041/487] Update distributable-dispatch.yml --- .github/workflows/distributable-dispatch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/distributable-dispatch.yml b/.github/workflows/distributable-dispatch.yml index f82026bca..f75ba76b2 100644 --- a/.github/workflows/distributable-dispatch.yml +++ b/.github/workflows/distributable-dispatch.yml @@ -37,7 +37,7 @@ jobs: owner: metacall repo: homebrew github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} - workflow_file_name: ci.yml + workflow_file_name: test.yml wait_workflow: true client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' ref: ${{ github.head_ref || github.ref_name }} From 47a89775fd7af4163a263e5a4d27aa72763ea1f9 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Mon, 29 Jul 2024 22:31:35 +0200 Subject: [PATCH 042/487] Add CI for rust crates. --- .github/workflows/release-rust.yml | 29 +++++++++++++++++++++++++++++ source/ports/rs_port/upload.sh | 18 +++++++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release-rust.yml diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml new file mode 100644 index 000000000..10baaf1e7 --- /dev/null +++ b/.github/workflows/release-rust.yml @@ -0,0 +1,29 @@ +name: Release Rust Crates + +on: + push: + branches: [ master, develop ] + paths: + - 'source/ports/rs_port/Cargo.toml' + - 'source/ports/rs_port/inline/Cargo.toml' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + +jobs: + release: + name: Release Rust Port + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Release the port + run: | + cd source/ports/rs_port + bash ./upload.sh diff --git a/source/ports/rs_port/upload.sh b/source/ports/rs_port/upload.sh index 9e132705b..95088beee 100644 --- a/source/ports/rs_port/upload.sh +++ b/source/ports/rs_port/upload.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # # MetaCall Rust Port Deploy Script by Parra Studios @@ -19,11 +19,19 @@ # limitations under the License. # -# TODO: Automate for CD/CI +function publish() { + local crate_version=`cargo search --quiet $1 | grep "$1" | head -n 1 | awk '{ print $3 }'` + local project_version=`cargo metadata --format-version=1 --no-deps | jq '.packages[0].version'` + + # Check if versions do not match, and if so, publish them + if [ ! "${crate_version}" = "${project_version}" ]; then + echo "Publishing ${crate_version} -> ${project_version}" + cargo publish --verbose --locked --token ${CARGO_REGISTRY_TOKEN} + fi +} # Publish -cargo login $TOKEN cd inline -cargo publish +publish metacall-inline cd .. -cargo publish +publish metacall From cbd6ff3fe3285e41200353125d5f876d0070fb80 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Mon, 29 Jul 2024 22:33:39 +0200 Subject: [PATCH 043/487] Update rs_port version. --- source/ports/rs_port/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index 9b3ef9b3d..fbe1da261 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.4.0" +version = "0.4.1" [lib] crate-type = ["lib"] From 5466970dd76d14422ca749e09b26759242b0512f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Mon, 29 Jul 2024 22:36:07 +0200 Subject: [PATCH 044/487] Add verbosity to the publish script. --- source/ports/rs_port/upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/rs_port/upload.sh b/source/ports/rs_port/upload.sh index 95088beee..a081a7037 100644 --- a/source/ports/rs_port/upload.sh +++ b/source/ports/rs_port/upload.sh @@ -25,7 +25,7 @@ function publish() { # Check if versions do not match, and if so, publish them if [ ! "${crate_version}" = "${project_version}" ]; then - echo "Publishing ${crate_version} -> ${project_version}" + echo "Publishing $1: ${crate_version} -> ${project_version}" cargo publish --verbose --locked --token ${CARGO_REGISTRY_TOKEN} fi } From 0a72e17e12a6dc868fc20b4addfb9a20e2b1310f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 31 Jul 2024 17:06:53 +0200 Subject: [PATCH 045/487] Trying to speedup threading. --- .../py_loader/source/py_loader_threading.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index ff8b5ec91..d65134e48 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -24,7 +24,6 @@ #include -#include #include struct py_thread_state @@ -43,24 +42,22 @@ struct py_thread_state static PyThreadState *main_thread_state = NULL; static uint64_t main_thread_id = 0; -static std::atomic_uintmax_t main_thread_ref_count; +static uint64_t main_thread_ref_count = 0; thread_local py_thread_state *current_thread_state = NULL; +thread_local uint64_t current_thread_id = thread_id_get_current(); void py_loader_thread_initialize() { main_thread_id = thread_id_get_current(); - main_thread_ref_count = 0; } void py_loader_thread_acquire() { - uint64_t current_thread_id = thread_id_get_current(); - if (main_thread_id == current_thread_id) { if (main_thread_state != NULL) { - uintmax_t ref_count = main_thread_ref_count++; + uint64_t ref_count = main_thread_ref_count++; if (ref_count == 0) { @@ -83,11 +80,9 @@ void py_loader_thread_acquire() void py_loader_thread_release() { - uint64_t current_thread_id = thread_id_get_current(); - if (main_thread_id == current_thread_id) { - uint64_t ref_count = main_thread_ref_count.load(); + uint64_t ref_count = main_thread_ref_count; if (ref_count > 0) { From 4d621a0269d604ea626811b72d3d5dae691b69a3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 31 Jul 2024 17:56:42 +0200 Subject: [PATCH 046/487] Trying to make python tests work. --- source/loaders/py_loader/source/py_loader_impl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index b60a5acb0..6fefea414 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2034,6 +2034,8 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) value_args[args_count] = py_loader_impl_capi_to_value(invoke_state->impl, arg, id); } + py_loader_thread_release(); + /* Execute the callback */ value ret = (value)function_call(value_to_function(invoke_state->callback), value_args, args_size); @@ -2048,11 +2050,15 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) free(value_args); } + py_loader_thread_acquire(); + /* Transform the return value into a python value */ if (ret != NULL) { PyObject *py_ret = py_loader_impl_value_to_capi(invoke_state->impl, value_type_id(ret), ret); + py_loader_thread_release(); value_type_destroy(ret); + py_loader_thread_acquire(); return py_ret; } From 238de8284b467a2fe6df2a733c7ee9a3e2be43a8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 6 Aug 2024 20:07:43 +0200 Subject: [PATCH 047/487] Trying to solve all issues from python. --- .../include/py_loader/py_loader_threading.h | 2 ++ .../loaders/py_loader/source/py_loader_impl.c | 18 ++++++++++++++++-- .../py_loader/source/py_loader_threading.cpp | 5 +++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/source/loaders/py_loader/include/py_loader/py_loader_threading.h b/source/loaders/py_loader/include/py_loader/py_loader_threading.h index 3f38fecac..6dbc9dc4d 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_threading.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_threading.h @@ -29,6 +29,8 @@ extern "C" { PY_LOADER_NO_EXPORT void py_loader_thread_initialize(void); +PY_LOADER_NO_EXPORT int py_loader_thread_is_main(void); + PY_LOADER_NO_EXPORT void py_loader_thread_acquire(void); PY_LOADER_NO_EXPORT void py_loader_thread_release(void); diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 6fefea414..31c11aa41 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2008,11 +2008,14 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) { static void *null_args[1] = { NULL }; + py_loader_thread_acquire(); + loader_impl_py_function_type_invoke_state invoke_state = PyCapsule_GetPointer(self, NULL); if (invoke_state == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Fatal error when invoking a function, state cannot be recovered, avoiding the function call"); + py_loader_thread_release(); Py_RETURN_NONE; } @@ -2023,6 +2026,7 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) if (value_args == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid allocation of arguments for callback"); + py_loader_thread_release(); Py_RETURN_NONE; } @@ -2036,6 +2040,13 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) py_loader_thread_release(); + int thread_state_saved = py_loader_thread_is_main() && PyGILState_Check(); + + if (thread_state_saved) + { + py_loader_thread_release(); + } + /* Execute the callback */ value ret = (value)function_call(value_to_function(invoke_state->callback), value_args, args_size); @@ -2050,15 +2061,18 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) free(value_args); } - py_loader_thread_acquire(); + if (thread_state_saved) + { + py_loader_thread_acquire(); + } /* Transform the return value into a python value */ if (ret != NULL) { + py_loader_thread_acquire(); PyObject *py_ret = py_loader_impl_value_to_capi(invoke_state->impl, value_type_id(ret), ret); py_loader_thread_release(); value_type_destroy(ret); - py_loader_thread_acquire(); return py_ret; } diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index d65134e48..1d432de4c 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -51,6 +51,11 @@ void py_loader_thread_initialize() main_thread_id = thread_id_get_current(); } +int py_loader_thread_is_main() +{ + return (int)(main_thread_id == current_thread_id); +} + void py_loader_thread_acquire() { if (main_thread_id == current_thread_id) From 90bfdb9507d738a8552948ee0821b5eb23ae83d5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 6 Aug 2024 20:27:40 +0200 Subject: [PATCH 048/487] Remove malloc from py thread state. --- .../py_loader/source/py_loader_threading.cpp | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index 1d432de4c..75f11f230 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -32,18 +32,36 @@ struct py_thread_state PyGILState_STATE gstate; py_thread_state() : - ref_count(1), gstate(PyGILState_Ensure()) {} + ref_count(0) {} - ~py_thread_state() + void ensure() { - PyGILState_Release(gstate); + if (ref_count == 0) + { + gstate = PyGILState_Ensure(); + } + + ++ref_count; + } + + void release() + { + if (ref_count > 0) + { + --ref_count; + + if (ref_count == 0) + { + PyGILState_Release(gstate); + } + } } }; static PyThreadState *main_thread_state = NULL; static uint64_t main_thread_id = 0; static uint64_t main_thread_ref_count = 0; -thread_local py_thread_state *current_thread_state = NULL; +thread_local py_thread_state current_thread_state; thread_local uint64_t current_thread_id = thread_id_get_current(); void py_loader_thread_initialize() @@ -72,14 +90,7 @@ void py_loader_thread_acquire() } else { - if (current_thread_state == NULL) - { - current_thread_state = new py_thread_state(); - } - else - { - ++current_thread_state->ref_count; - } + current_thread_state.ensure(); } } @@ -101,17 +112,6 @@ void py_loader_thread_release() } else { - if (current_thread_state != NULL) - { - if (current_thread_state->ref_count <= 1) - { - delete current_thread_state; - current_thread_state = NULL; - } - else - { - --current_thread_state->ref_count; - } - } + current_thread_state.release(); } } From 1952b8981a070b5296a0d2216394214c81c80f2b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 6 Aug 2024 23:06:20 +0200 Subject: [PATCH 049/487] Update funchook. --- source/detours/funchook_detour/CMakeLists.txt | 2 +- source/tests/detour_test/source/detour_test.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index ce677bae8..b9c304e1d 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -14,7 +14,7 @@ set(target_depends funchook_detour_depends) include(ExternalProject) -set(FUNCHOOK_VERSION 1.1.1) +set(FUNCHOOK_VERSION 1.1.3) if(WIN32) set(FUNCHOOK_LIBRARY_PREFIX "") diff --git a/source/tests/detour_test/source/detour_test.cpp b/source/tests/detour_test/source/detour_test.cpp index 3dca76491..3595eda99 100644 --- a/source/tests/detour_test/source/detour_test.cpp +++ b/source/tests/detour_test/source/detour_test.cpp @@ -35,22 +35,26 @@ static detour_handle handle; int hook_function(int x) { - EXPECT_EQ((int)2, (int)x); + EXPECT_EQ((int)128, (int)x); log_write("metacall", LOG_LEVEL_DEBUG, "Hook function %d", x); int (*target_function_ptr)(int) = (int (*)(int))detour_trampoline(handle); - return target_function_ptr(x + 4) + 2; + int result = target_function_ptr(x + 2) + 2; + + log_write("metacall", LOG_LEVEL_DEBUG, "Hook function result %d", result); + + return result; } int target_function(int x) { - EXPECT_EQ((int)6, (int)x); + EXPECT_EQ((int)130, (int)x); log_write("metacall", LOG_LEVEL_DEBUG, "Target function %d", x); - return 4; + return x; } TEST_F(detour_test, DefaultConstructor) @@ -80,7 +84,7 @@ TEST_F(detour_test, DefaultConstructor) EXPECT_NE((detour_handle)NULL, (detour_handle)handle); /* Call detour, it should call hooked function */ - EXPECT_EQ((int)6, (int)target_function(2)); + EXPECT_EQ((int)132, (int)target_function(128)); /* Uninstall detour */ EXPECT_EQ((int)0, (int)detour_uninstall(d, handle)); From f37de1d459e6e764da8f6f4cd97e496e836f04e0 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 7 Aug 2024 01:47:44 +0200 Subject: [PATCH 050/487] Make test timeout 1h. --- source/tests/CMakeLists.txt | 2 +- tools/metacall-build.ps1 | 2 +- tools/metacall-build.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index 40c474cd1..ec1a18162 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -90,7 +90,7 @@ if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUI --label-exclude MEMCHECK_IGNORE --force-new-ctest-process --test-action memcheck - --timeout 7200 + --timeout 3600 COMMAND ${CMAKE_COMMAND} -E cat "${CMAKE_BINARY_DIR}/Testing/Temporary/MemoryChecker.*.log" ) diff --git a/tools/metacall-build.ps1 b/tools/metacall-build.ps1 index aa292bf1e..d56181945 100755 --- a/tools/metacall-build.ps1 +++ b/tools/metacall-build.ps1 @@ -74,7 +74,7 @@ function Sub-Build { # Tests if (($BUILD_TESTS -eq 1) -or ($BUILD_BENCHMARKS -eq 1) -or ($BUILD_COVERAGE -eq 1)) { echo "Running the tests..." - ctest "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" --timeout 7200 --output-on-failure -C $BUILD_TYPE + ctest "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" --timeout 3600 --output-on-failure -C $BUILD_TYPE if (-not $?) { $RecentExitCode = $LASTEXITCODE diff --git a/tools/metacall-build.sh b/tools/metacall-build.sh index b59ad10e3..b876b597b 100755 --- a/tools/metacall-build.sh +++ b/tools/metacall-build.sh @@ -75,12 +75,12 @@ sub_build() { # Tests (coverage needs to run the tests) if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then - ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 7200 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE + ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 3600 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE fi # Coverage if [ $BUILD_COVERAGE = 1 ]; then - ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 7200 -T Coverage + ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 3600 -T Coverage gcovr -r ../source/ . --html-details coverage.html fi From 4543c7b6691de4bfd7d97c648fae4c64e02c0bfd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 13 Aug 2024 23:08:47 +0200 Subject: [PATCH 051/487] Comment out livelock test. --- source/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index ec1a18162..9c9bd3f89 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -161,7 +161,7 @@ add_subdirectory(metacall_node_fail_load_leak_test) add_subdirectory(metacall_node_typescript_test) add_subdirectory(metacall_node_python_async_after_destroy_test) add_subdirectory(metacall_node_python_await_test) -add_subdirectory(metacall_node_python_await_extended_test) +# add_subdirectory(metacall_node_python_await_extended_test) # TODO: https://github.com/metacall/core/issues/519 add_subdirectory(metacall_node_python_exception_test) add_subdirectory(metacall_node_clear_mem_test) add_subdirectory(metacall_node_async_resources_test) From 5bdd8923bf86325ac1efec3de5cb50d83a78c09e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 14 Aug 2024 00:54:00 +0200 Subject: [PATCH 052/487] Add base ci for crossplatform builds. --- .github/workflows/docker-hub-platform.yml | 130 ++++++++++++++++++++++ docker-compose.platform.yml | 41 +++++++ docker-compose.sh | 30 ++++- 3 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docker-hub-platform.yml create mode 100644 docker-compose.platform.yml diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml new file mode 100644 index 000000000..db8aa4e4f --- /dev/null +++ b/.github/workflows/docker-hub-platform.yml @@ -0,0 +1,130 @@ +name: Build and Push Docker Image for Multiple Platforms + +on: + # To enable manual triggering of this workflow + workflow_dispatch: + + # Trigger for pushes to master and tags + push: + branches: + - master + - develop + tags: + - 'v*.*.*' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + IMAGE_NAME: index.docker.io/metacall/core + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/arm64 + - linux/arm/v6 + - linux/arm/v7 + steps: + - name: Checkout the code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Define Platform Pair + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Docker Metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_NAME }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build MetaCall Docker Images + run: bash ./docker-compose.sh platform + + # # TODO: Build with alpine and provide multiple tags (debian & alpine) once all tests pass + # - name: Push MetaCall Docker Image to DockerHub + # run: | + # if [[ "${{ github.ref == 'refs/heads/master' }}" = true ]]; then + # bash ./docker-compose.sh push + # elif [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then + # bash ./docker-compose.sh version + # else + # echo "Failed to push the docker images" + # exit 1 + # fi + + # - name: Export Digest + # run: | + # mkdir -p /tmp/digests + # digest="${{ steps.build.outputs.digest }}" + # touch "/tmp/digests/${digest#sha256:}" + + # - name: Upload Digest + # uses: actions/upload-artifact@v4 + # with: + # name: digests-${{ env.PLATFORM_PAIR }} + # path: /tmp/digests/* + # if-no-files-found: error + # retention-days: 1 + + - name: Logout from DockerHub + run: docker logout + + # merge: + # runs-on: ubuntu-latest + # needs: + # - build + # steps: + # - name: Download digests + # uses: actions/download-artifact@v4 + # with: + # path: /tmp/digests + # pattern: digests-* + # merge-multiple: true + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Docker meta + # id: meta + # uses: docker/metadata-action@v5 + # with: + # images: ${{ env.IMAGE_NAME }} + + # - name: Login to DockerHub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKER_HUB_USERNAME }} + # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + # - name: Create manifest list and push + # working-directory: /tmp/digests + # run: | + # docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + # $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + + # - name: Inspect image + # run: | + # docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} diff --git a/docker-compose.platform.yml b/docker-compose.platform.yml new file mode 100644 index 000000000..b8b45ff8d --- /dev/null +++ b/docker-compose.platform.yml @@ -0,0 +1,41 @@ +# +# MetaCall Library by Parra Studios +# Docker compose infrastructure for MetaCall. +# +# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +version: "3.7" + +services: + deps: + image: metacall/core:deps + platform: + - ${METACALL_PLATFORM} + + dev: + image: metacall/core:dev + platform: + - ${METACALL_PLATFORM} + + runtime: + image: metacall/core:runtime + platform: + - ${METACALL_PLATFORM} + + cli: + image: metacall/core:cli + platform: + - ${METACALL_PLATFORM} diff --git a/docker-compose.sh b/docker-compose.sh index fb13d8b55..9c075acf8 100755 --- a/docker-compose.sh +++ b/docker-compose.sh @@ -199,8 +199,28 @@ sub_cache() { $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.cache.yml build cli } +# Build MetaCall Docker Compose with multi-platform specifier (link manually dockerignore files) +sub_platform() { + if [ -z "$METACALL_PLATFORM" ]; then + echo "Error: METACALL_PLATFORM variable not defined" + exit 1 + fi + + ln -sf tools/deps/.dockerignore .dockerignore + $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build deps + + ln -sf tools/dev/.dockerignore .dockerignore + $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build dev + + ln -sf tools/runtime/.dockerignore .dockerignore + $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build runtime + + ln -sf tools/cli/.dockerignore .dockerignore + $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build cli +} + # Push MetaCall Docker Compose -sub_push(){ +sub_push() { if [ -z "$IMAGE_NAME" ]; then echo "Error: IMAGE_NAME variable not defined" exit 1 @@ -228,7 +248,7 @@ sub_push(){ } # Version MetaCall Docker Compose -sub_version(){ +sub_version() { if [ -z "$IMAGE_NAME" ]; then echo "Error: IMAGE_NAME variable not defined" exit 1 @@ -258,7 +278,7 @@ sub_version(){ } # Pack MetaCall Docker Compose -sub_pack(){ +sub_pack() { if [ -z "$ARTIFACTS_PATH" ]; then echo "Error: ARTIFACTS_PATH variable not defined" exit 1 @@ -299,6 +319,7 @@ sub_help() { echo " test-memory-sanitizer" echo " coverage" echo " cache" + echo " platform" echo " push" echo " pack" echo "" @@ -335,6 +356,9 @@ case "$1" in cache) sub_cache ;; + platform) + sub_platform + ;; push) sub_push ;; From 69f9af6ffe60adeadc48bdcb67d9e93ec9db4cda Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 14 Aug 2024 00:57:07 +0200 Subject: [PATCH 053/487] Solve minor issue. --- .github/workflows/docker-hub-platform.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index db8aa4e4f..a75122bdf 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -8,7 +8,7 @@ on: push: branches: - master - - develop + - develop # TODO: Remove this tags: - 'v*.*.*' @@ -40,7 +40,7 @@ jobs: - name: Define Platform Pair run: | platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + echo "METACALL_PLATFORM=${platform//\//-}" >> $GITHUB_ENV - name: Docker Metadata id: meta @@ -84,7 +84,7 @@ jobs: # - name: Upload Digest # uses: actions/upload-artifact@v4 # with: - # name: digests-${{ env.PLATFORM_PAIR }} + # name: digests-${{ env.METACALL_PLATFORM }} # path: /tmp/digests/* # if-no-files-found: error # retention-days: 1 From e5c3dec595ffcf97d8428c97a4477f851d063b93 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 14 Aug 2024 01:02:52 +0200 Subject: [PATCH 054/487] Solve bugs on docker ci. --- .github/workflows/docker-hub-platform.yml | 11 ++++++----- docker-compose.platform.yml | 12 ++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index a75122bdf..f21dd1a69 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -1,4 +1,4 @@ -name: Build and Push Docker Image for Multiple Platforms +name: Build and Push Docker Image for Multiple Architectures on: # To enable manual triggering of this workflow @@ -37,10 +37,11 @@ jobs: with: fetch-depth: 0 - - name: Define Platform Pair + - name: Define Platform run: | - platform=${{ matrix.platform }} - echo "METACALL_PLATFORM=${platform//\//-}" >> $GITHUB_ENV + PLATFORM=${{ matrix.platform }} + echo "METACALL_PLATFORM=${PLATFORM}" >> $GITHUB_ENV + echo "METACALL_PLATFORM_PAIR=${PLATFORM//\//-}" >> $GITHUB_ENV - name: Docker Metadata id: meta @@ -84,7 +85,7 @@ jobs: # - name: Upload Digest # uses: actions/upload-artifact@v4 # with: - # name: digests-${{ env.METACALL_PLATFORM }} + # name: digests-${{ env.METACALL_PLATFORM_PAIR }} # path: /tmp/digests/* # if-no-files-found: error # retention-days: 1 diff --git a/docker-compose.platform.yml b/docker-compose.platform.yml index b8b45ff8d..46b3b0825 100644 --- a/docker-compose.platform.yml +++ b/docker-compose.platform.yml @@ -22,20 +22,16 @@ version: "3.7" services: deps: image: metacall/core:deps - platform: - - ${METACALL_PLATFORM} + platform: ${METACALL_PLATFORM} dev: image: metacall/core:dev - platform: - - ${METACALL_PLATFORM} + platform: ${METACALL_PLATFORM} runtime: image: metacall/core:runtime - platform: - - ${METACALL_PLATFORM} + platform: ${METACALL_PLATFORM} cli: image: metacall/core:cli - platform: - - ${METACALL_PLATFORM} + platform: ${METACALL_PLATFORM} From 3132a957eb1311dc2d0fe9eb1a940e1e3162f45c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 14 Aug 2024 03:05:29 +0200 Subject: [PATCH 055/487] Update ubuntu images. --- .env | 2 +- .github/workflows/docker-hub-platform.yml | 4 ++-- .github/workflows/linux-test.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 05231807a..2e5bae29a 100644 --- a/.env +++ b/.env @@ -23,4 +23,4 @@ COMPOSE_PROJECT_NAME='metacall' # Configure default variables METACALL_PATH=/usr/local/metacall METACALL_BUILD_TYPE=relwithdebinfo -METACALL_BASE_IMAGE=debian:trixie-slim # debian:bookworm-slim # ubuntu:jammy # ubuntu:mantic # alpine:3.17 +METACALL_BASE_IMAGE=debian:trixie-slim # debian:bookworm-slim # ubuntu:noble # ubuntu:jammy # alpine:3.17 diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index f21dd1a69..d90dd54b1 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -98,7 +98,7 @@ jobs: # needs: # - build # steps: - # - name: Download digests + # - name: Download Digests # uses: actions/download-artifact@v4 # with: # path: /tmp/digests @@ -108,7 +108,7 @@ jobs: # - name: Set up Docker Buildx # uses: docker/setup-buildx-action@v3 - # - name: Docker meta + # - name: Docker Metadata # id: meta # uses: docker/metadata-action@v5 # with: diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index ac8bb78ce..d36c887d7 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: build: [debug, release] - image: ["debian:trixie-slim", "debian:bookworm-slim", "ubuntu:jammy", "ubuntu:mantic"] # TODO: "alpine:3.17" + image: ["debian:trixie-slim", "debian:bookworm-slim", "ubuntu:noble", "ubuntu:jammy"] # TODO: "alpine:3.17" steps: - name: Check out the repository From 0a09f82157be9f0ec3cd55060f224fe002f0f0dc Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 14 Aug 2024 03:18:27 +0200 Subject: [PATCH 056/487] Solve issue with runtime on ubuntu noble. --- .github/workflows/linux-sanitizer.yml | 2 +- tools/metacall-runtime.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-sanitizer.yml b/.github/workflows/linux-sanitizer.yml index 378854ea9..25198eceb 100644 --- a/.github/workflows/linux-sanitizer.yml +++ b/.github/workflows/linux-sanitizer.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - image: ["debian:trixie-slim", "debian:bookworm-slim", "ubuntu:jammy", "ubuntu:mantic"] + image: ["debian:trixie-slim", "debian:bookworm-slim", "ubuntu:noble", "ubuntu:jammy"] sanitizer: [address-sanitizer, thread-sanitizer] # TODO: memory-sanitizer not supported by GCC env: diff --git a/tools/metacall-runtime.sh b/tools/metacall-runtime.sh index 77fc6e336..d0dbe095f 100755 --- a/tools/metacall-runtime.sh +++ b/tools/metacall-runtime.sh @@ -226,7 +226,7 @@ sub_rpc(){ ;; esac - if [ "${CODENAME}" = "trixie" ] || [ "${CODENAME}" = "unstable" ]; then + if [ "${CODENAME}" = "trixie" ] || [ "${CODENAME}" = "noble" ] || [ "${CODENAME}" = "unstable" ]; then sub_apt_install_hold libcurl4t64 else sub_apt_install_hold libcurl4 @@ -345,7 +345,7 @@ sub_backtrace(){ ;; esac - if [ "${CODENAME}" = "trixie" ] || [ "${CODENAME}" = "unstable" ]; then + if [ "${CODENAME}" = "trixie" ] || [ "${CODENAME}" = "noble" ] || [ "${CODENAME}" = "unstable" ]; then sub_apt_install_hold libdw1t64 libelf1t64 else sub_apt_install_hold libdw1 From b31ccab0cb15734c030e9ff3a6ad400b83067b8e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 14 Aug 2024 03:59:52 +0200 Subject: [PATCH 057/487] Solve issues with dotnet and noble. --- tools/metacall-environment.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 133dc6da9..10d473eff 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -362,6 +362,33 @@ sub_netcore7(){ $SUDO_CMD apt-get update $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends dotnet-sdk-7.0 elif [ "${LINUX_DISTRO}" = "ubuntu" ]; then + UBUNTU_CODENAME="" + CODENAME_FROM_ARGUMENTS="" + + # Obtain VERSION_CODENAME and UBUNTU_CODENAME (for Ubuntu and its derivatives) + . /etc/os-release + + case ${LINUX_DISTRO} in + debian) + if [ "${VERSION:-}" = "unstable" ] || [ "${VERSION:-}" = "testing" ]; then + CODENAME="unstable" + else + CODENAME="${VERSION_CODENAME}" + fi + ;; + *) + # Ubuntu and its derivatives + if [ -n "${UBUNTU_CODENAME}" ]; then + CODENAME="${UBUNTU_CODENAME}" + fi + ;; + esac + + if [ "${CODENAME}" = "noble" ]; then + $SUDO_CMD apt-get install -y --no-install-recommends software-properties-common + $SUDO_CMD add-apt-repository ppa:dotnet/backports + fi + $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends dotnet-sdk-7.0 elif [ "${LINUX_DISTRO}" = "alpine" ]; then $SUDO_CMD apk add --no-cache dotnet7-sdk From 649a0546a42ee638ca68ee0d470c6ea4e3bdeb3e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 14 Aug 2024 17:02:05 +0200 Subject: [PATCH 058/487] Improved node port and added metacallfms. --- .../node_loader/source/node_loader_port.cpp | 112 +++++++++++++++++- source/ports/node_port/index.d.ts | 1 + source/ports/node_port/index.js | 15 ++- source/ports/node_port/test.js | 2 +- source/ports/node_port/test/index.js | 9 ++ 5 files changed, 131 insertions(+), 8 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index c77592ff6..ed681f1e9 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -47,7 +47,6 @@ napi_value node_loader_port_metacall(napi_env env, napi_callback_info info) if (argc == 0) { napi_throw_error(env, nullptr, "Invalid number of arguments"); - return nullptr; } @@ -65,7 +64,8 @@ napi_value node_loader_port_metacall(napi_env env, napi_callback_info info) if (name == nullptr) { napi_throw_error(env, nullptr, "Invalid function name allocation"); - + delete[] argv; + delete[] args; return nullptr; } @@ -114,6 +114,105 @@ napi_value node_loader_port_metacall(napi_env env, napi_callback_info info) return result; } +napi_value node_loader_port_metacallfms(napi_env env, napi_callback_info info) +{ + size_t argc = 0; + + napi_get_cb_info(env, info, &argc, nullptr, nullptr, nullptr); + + if (argc != 2) + { + napi_throw_error(env, nullptr, "Invalid number of arguments"); + return nullptr; + } + + napi_value *argv = new napi_value[argc]; + napi_value recv; + + napi_get_cb_info(env, info, &argc, argv, &recv, nullptr); + + size_t name_length; + napi_status status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &name_length); + + char *name = new char[name_length + 1]; + + if (name == nullptr) + { + napi_throw_error(env, nullptr, "Invalid function name allocation"); + delete[] argv; + return nullptr; + } + + status = napi_get_value_string_utf8(env, argv[0], name, name_length + 1, &name_length); + + name[name_length] = '\0'; + + node_loader_impl_exception(env, status); + + void *func = metacall_function(name); + + if (func == NULL) + { + napi_throw_error(env, nullptr, "The function does not exist"); + delete[] argv; + delete[] name; + return nullptr; + } + + size_t buffer_length; + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &buffer_length); + + char *buffer = new char[buffer_length + 1]; + + if (buffer == nullptr) + { + napi_throw_error(env, nullptr, "Invalid function buffer allocation"); + delete[] argv; + delete[] name; + return nullptr; + } + + status = napi_get_value_string_utf8(env, argv[1], buffer, buffer_length + 1, &buffer_length); + + buffer[buffer_length] = '\0'; + + node_loader_impl_exception(env, status); + + /* Obtain NodeJS loader implementation */ + loader_impl impl = loader_get_impl(node_loader_tag); + loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + + /* Store current reference of the environment */ + node_loader_impl_env(node_impl, env); + + struct metacall_allocator_std_type std_ctx = { &std::malloc, &std::realloc, &std::free }; + + void *allocator = metacall_allocator_create(METACALL_ALLOCATOR_STD, (void *)&std_ctx); + + /* Call to the function */ + void *ret = metacallfms(func, buffer, buffer_length + 1, allocator); + + metacall_allocator_destroy(allocator); + + napi_value result = node_loader_impl_value_to_napi(node_impl, env, ret); + + if (metacall_value_id(ret) == METACALL_THROWABLE) + { + napi_throw(env, result); + } + + /* Release current reference of the environment */ + // node_loader_impl_env(node_impl, nullptr); + + metacall_value_destroy(ret); + + delete[] argv; + delete[] name; + delete[] buffer; + + return result; +} + napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info) { size_t argc = 0; @@ -123,7 +222,6 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info if (argc == 0) { napi_throw_error(env, nullptr, "Invalid number of arguments"); - return nullptr; } @@ -142,7 +240,8 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info if (name == nullptr) { napi_throw_error(env, nullptr, "Invalid function name allocation"); - + delete[] argv; + delete[] args; return nullptr; } @@ -414,8 +513,8 @@ napi_value node_loader_port_metacall_load_from_memory(napi_env env, napi_callbac if (script == nullptr) { - delete[] tag; napi_throw_error(env, nullptr, "MetaCall could not load from memory, script allocation failed"); + delete[] tag; return nullptr; } @@ -489,8 +588,8 @@ napi_value node_loader_port_metacall_load_from_memory_export(napi_env env, napi_ if (script == nullptr) { - delete[] tag; napi_throw_error(env, nullptr, "MetaCall could not load from memory, script allocation failed"); + delete[] tag; return nullptr; } @@ -715,6 +814,7 @@ void node_loader_port_exports(napi_env env, napi_value exports) #define NODE_LOADER_PORT_DECL_X_MACRO(x) \ x(metacall); \ + x(metacallfms); \ x(metacall_await); \ x(metacall_load_from_file); \ x(metacall_load_from_file_export); \ diff --git a/source/ports/node_port/index.d.ts b/source/ports/node_port/index.d.ts index 40f4c1c56..7b1d6d1bd 100644 --- a/source/ports/node_port/index.d.ts +++ b/source/ports/node_port/index.d.ts @@ -1,5 +1,6 @@ declare module 'metacall' { export function metacall(name: string, ...args: any): any; + export function metacallfms(name: string, buffer: string): any; export function metacall_load_from_file(tag: string, paths: string[]): number; export function metacall_load_from_file_export(tag: string, paths: string[]): any; export function metacall_load_from_memory(tag: string, code: string): number; diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 2aa604289..10fcbf24e 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -82,6 +82,18 @@ const metacall = (name, ...args) => { return addon.metacall(name, ...args); }; +const metacallfms = (name, buffer) => { + if (Object.prototype.toString.call(name) !== '[object String]') { + throw Error('Function name should be of string type.'); + } + + if (Object.prototype.toString.call(buffer) !== '[object String]') { + throw Error('Buffer should be of string type.'); + } + + return addon.metacallfms(name, buffer); +}; + const metacall_await = (name, ...args) => { if (Object.prototype.toString.call(name) !== '[object String]') { throw Error('Function name should be of string type.'); @@ -172,7 +184,7 @@ const metacall_handle = (tag, name) => { // TODO: This can be implemented with metacall_handle C API, meanwhile we use this trick const inspect = metacall_inspect(); - if (inspect === {} || inspect === undefined) { + if (inspect === undefined) { return null; } @@ -192,6 +204,7 @@ const metacall_require = (tag, name) => { /* Module exports */ const module_exports = { metacall, + metacallfms, metacall_await, metacall_inspect, metacall_load_from_file, diff --git a/source/ports/node_port/test.js b/source/ports/node_port/test.js index 1bab3e30b..fb04ea5b1 100644 --- a/source/ports/node_port/test.js +++ b/source/ports/node_port/test.js @@ -26,7 +26,7 @@ const mocha = new Mocha(); const testDir = path.resolve(__dirname, 'test'); fs.readdirSync(testDir).filter((file) => { - return file.substr(-3) === '.js'; + return path.extname(file) === '.js'; }).forEach((file) => { mocha.addFile( path.join(testDir, file) diff --git a/source/ports/node_port/test/index.js b/source/ports/node_port/test/index.js index 83d66e0f6..c6a71114c 100644 --- a/source/ports/node_port/test/index.js +++ b/source/ports/node_port/test/index.js @@ -24,6 +24,7 @@ const assert = require('assert'); const { metacall, + metacallfms, metacall_load_from_file, metacall_load_from_file_export, metacall_load_from_memory, @@ -37,6 +38,7 @@ describe('metacall', () => { describe('defined', () => { it('functions metacall and metacall_load_from_file must be defined', () => { assert.notStrictEqual(metacall, undefined); + assert.notStrictEqual(metacallfms, undefined); assert.notStrictEqual(metacall_load_from_memory, undefined); assert.notStrictEqual(metacall_load_from_file, undefined); assert.notStrictEqual(metacall_load_from_memory_export, undefined); @@ -280,6 +282,13 @@ describe('metacall', () => { } }); + describe('call by map', () => { + it('metacallfms (py)', () => { + assert.strictEqual(metacallfms('s_sum', '{"left":2,"right":2}'), 4); + assert.strictEqual(metacallfms('s_sum', '{"right":2,"left":2}'), 4); + }); + }); + describe('callback', () => { it('callback (py)', () => { const py_f = require('function.py'); From 9a198e9ec7a83e12b011aae4ab2c330859d0aea5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 14 Aug 2024 17:04:07 +0200 Subject: [PATCH 059/487] Update version to v0.8.1. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8adc70fdd..c18d72be3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.0 \ No newline at end of file +0.8.1 \ No newline at end of file From 7fed5700feeea3da08771300eb74a3b8161b6dcf Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 23 Aug 2024 00:02:58 +0200 Subject: [PATCH 060/487] Correct bug from plugin extension. --- .../source/plugin_extension.cpp | 7 + source/tests/CMakeLists.txt | 1 + .../CMakeLists.txt | 154 ++++++++++++++++++ .../source/main.cpp | 28 ++++ ...all_plugin_extension_invalid_path_test.cpp | 81 +++++++++ 5 files changed, 271 insertions(+) create mode 100644 source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt create mode 100644 source/tests/metacall_plugin_extension_invalid_path_test/source/main.cpp create mode 100644 source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp diff --git a/source/extensions/plugin_extension/source/plugin_extension.cpp b/source/extensions/plugin_extension/source/plugin_extension.cpp index 9bf4de4cc..c6f144138 100644 --- a/source/extensions/plugin_extension/source/plugin_extension.cpp +++ b/source/extensions/plugin_extension/source/plugin_extension.cpp @@ -67,6 +67,13 @@ void *plugin_load_from_path(size_t argc, void *args[], void *data) } std::string ext_path(metacall_value_to_string(args[0])); + + if (fs::is_directory(fs::path(ext_path)) == false) + { + log_write("metacall", LOG_LEVEL_WARNING, "Folder %s not found, plugins will not be loaded", ext_path.c_str()); + return metacall_value_create_int(4); + } + void **handle_ptr = NULL; if (argc == 2) diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index 9c9bd3f89..caa8c1495 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -261,6 +261,7 @@ add_subdirectory(metacall_ext_test) add_subdirectory(metacall_plugin_extension_test) add_subdirectory(metacall_plugin_extension_local_test) add_subdirectory(metacall_plugin_extension_destroy_order_test) +add_subdirectory(metacall_plugin_extension_invalid_path_test) add_subdirectory(metacall_cli_core_plugin_test) add_subdirectory(metacall_cli_core_plugin_await_test) add_subdirectory(metacall_backtrace_plugin_test) diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt new file mode 100644 index 000000000..bee880e7a --- /dev/null +++ b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt @@ -0,0 +1,154 @@ +# Check if this loader is enabled +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_EXT OR NOT OPTION_BUILD_EXTENSIONS OR NOT OPTION_BUILD_CLI) + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-plugin-extension-invalid-path-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_plugin_extension_invalid_path_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::metacall +) + +# +# Compile definitions +# + +set(METACALL_PLUGIN_PATH "${PROJECT_OUTPUT_DIR}/this/folder/does/not/exist") + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} + + # Plugin path + METACALL_PLUGIN_PATH="${METACALL_PLUGIN_PATH}" +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Linker options +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $ +) + +# +# Define dependencies +# + +add_dependencies(${target} + ext_loader + plugin_extension + cli_core_plugin # Requires cli_core_plugin (from CLI) for reproducing it +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} +) diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/source/main.cpp b/source/tests/metacall_plugin_extension_invalid_path_test/source/main.cpp new file mode 100644 index 000000000..11ddf3f59 --- /dev/null +++ b/source/tests/metacall_plugin_extension_invalid_path_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp b/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp new file mode 100644 index 000000000..d6dcd9b81 --- /dev/null +++ b/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp @@ -0,0 +1,81 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include +#include + +class metacall_plugin_extension_invalid_path_test : public testing::Test +{ +public: +}; + +TEST_F(metacall_plugin_extension_invalid_path_test, DefaultConstructor) +{ + metacall_print_info(); + + ASSERT_EQ((int)0, (int)metacall_initialize()); + + /* Extension */ + void *handle = metacall_plugin_extension(); + + ASSERT_NE((void *)NULL, (void *)handle); + + void *args[] = { + metacall_value_create_string(METACALL_PLUGIN_PATH, sizeof(METACALL_PLUGIN_PATH) - 1), + metacall_value_create_ptr(&handle) + }; + + void *result = metacallhv_s(handle, "plugin_load_from_path", args, sizeof(args) / sizeof(args[0])); + + ASSERT_NE((void *)NULL, (void *)result); + + EXPECT_EQ((enum metacall_value_id)METACALL_INT, (enum metacall_value_id)metacall_value_id(result)); + + EXPECT_EQ((int)4, (int)metacall_value_to_int(result)); + + metacall_value_destroy(args[0]); + metacall_value_destroy(args[1]); + metacall_value_destroy(result); + + /* Print inspect information */ + { + size_t size = 0; + + struct metacall_allocator_std_type std_ctx = { &std::malloc, &std::realloc, &std::free }; + + void *allocator = metacall_allocator_create(METACALL_ALLOCATOR_STD, (void *)&std_ctx); + + char *inspect_str = metacall_inspect(&size, allocator); + + EXPECT_NE((char *)NULL, (char *)inspect_str); + + EXPECT_GT((size_t)size, (size_t)0); + + std::cout << inspect_str << std::endl; + + metacall_allocator_free(allocator, inspect_str); + + metacall_allocator_destroy(allocator); + } + + EXPECT_EQ((int)0, (int)metacall_destroy()); +} From 5a58f26af81e443d968b1ce4b7bd89a5a7032d7b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 23 Aug 2024 00:03:39 +0200 Subject: [PATCH 061/487] Trying to solve distributable dispatch. --- .github/workflows/distributable-dispatch.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/distributable-dispatch.yml b/.github/workflows/distributable-dispatch.yml index f75ba76b2..af69f785f 100644 --- a/.github/workflows/distributable-dispatch.yml +++ b/.github/workflows/distributable-dispatch.yml @@ -15,6 +15,7 @@ jobs: windows-distributable: name: Windows Distributable Dispatch runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' steps: - name: Windows Workflow Dispatch uses: convictional/trigger-workflow-and-wait@v1.6.1 @@ -30,6 +31,7 @@ jobs: macos-distributable: name: MacOS Distributable Dispatch runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' steps: - name: Homebrew Workflow Dispatch uses: convictional/trigger-workflow-and-wait@v1.6.1 @@ -55,6 +57,7 @@ jobs: linux-distributable: name: Linux Distributable Dispatch runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' steps: - name: Linux Workflow Dispatch uses: convictional/trigger-workflow-and-wait@v1.6.1 From 6e3e6024cfe3efadb9888f7342684137101ff06b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 23 Aug 2024 00:04:51 +0200 Subject: [PATCH 062/487] Update version to v0.8.2. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c18d72be3..53a48a1e8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.1 \ No newline at end of file +0.8.2 \ No newline at end of file From 671b33be893e53ffa95d71df4e47bbe16368d90f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 23 Aug 2024 00:25:26 +0200 Subject: [PATCH 063/487] Simplified swig installation. --- tools/metacall-environment.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 10d473eff..9077dee10 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -114,27 +114,16 @@ sub_swig(){ if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then if [ "${LINUX_DISTRO}" = "debian" ] || [ "${LINUX_DISTRO}" = "ubuntu" ]; then - $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends g++ libpcre3-dev tar + $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends swig # Install Python Port Dependencies (TODO: This must be transformed into pip3 install metacall) $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends python3-setuptools elif [ "${LINUX_DISTRO}" = "alpine" ]; then - $SUDO_CMD apk add --no-cache g++ pcre-dev tar + $SUDO_CMD apk add --no-cache swig # Install Python Port Dependencies (TODO: This must be transformed into pip3 install metacall) $SUDO_CMD apk add --no-cache py3-setuptools fi - - wget http://prdownloads.sourceforge.net/swig/swig-4.0.1.tar.gz - - tar -xzf swig-4.0.1.tar.gz - cd swig-4.0.1 - ./configure --prefix=/usr/local - make -j$(getconf _NPROCESSORS_ONLN) - $SUDO_CMD make install - cd .. - rm -rf swig-4.0.1 - elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then brew install swig fi From 7882b525c2b9f73546bc9d1c578d769c752912de Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 23 Aug 2024 00:27:29 +0200 Subject: [PATCH 064/487] Do nothing if plugin dir does not exist. --- .../extensions/plugin_extension/source/plugin_extension.cpp | 4 ++-- .../source/metacall_plugin_extension_invalid_path_test.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/extensions/plugin_extension/source/plugin_extension.cpp b/source/extensions/plugin_extension/source/plugin_extension.cpp index c6f144138..3035b2b9e 100644 --- a/source/extensions/plugin_extension/source/plugin_extension.cpp +++ b/source/extensions/plugin_extension/source/plugin_extension.cpp @@ -70,8 +70,8 @@ void *plugin_load_from_path(size_t argc, void *args[], void *data) if (fs::is_directory(fs::path(ext_path)) == false) { - log_write("metacall", LOG_LEVEL_WARNING, "Folder %s not found, plugins will not be loaded", ext_path.c_str()); - return metacall_value_create_int(4); + /* If the directory does not exist, we do nothing */ + return metacall_value_create_int(0); } void **handle_ptr = NULL; diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp b/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp index d6dcd9b81..56731f996 100644 --- a/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp +++ b/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp @@ -50,7 +50,7 @@ TEST_F(metacall_plugin_extension_invalid_path_test, DefaultConstructor) EXPECT_EQ((enum metacall_value_id)METACALL_INT, (enum metacall_value_id)metacall_value_id(result)); - EXPECT_EQ((int)4, (int)metacall_value_to_int(result)); + EXPECT_EQ((int)0, (int)metacall_value_to_int(result)); metacall_value_destroy(args[0]); metacall_value_destroy(args[1]); From 08b27a580e82c711213a474e15c4b887e45c9754 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 23 Aug 2024 00:37:02 +0200 Subject: [PATCH 065/487] Update distributable dispatch workflows. --- .github/workflows/distributable-dispatch.yml | 71 -------------------- .github/workflows/linux-sanitizer.yml | 41 ----------- .github/workflows/linux-test.yml | 42 ++++++++++++ .github/workflows/macos-test.yml | 29 +++++++- .github/workflows/windows-test.yml | 17 +++++ 5 files changed, 87 insertions(+), 113 deletions(-) delete mode 100644 .github/workflows/distributable-dispatch.yml delete mode 100644 .github/workflows/linux-sanitizer.yml diff --git a/.github/workflows/distributable-dispatch.yml b/.github/workflows/distributable-dispatch.yml deleted file mode 100644 index af69f785f..000000000 --- a/.github/workflows/distributable-dispatch.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Distributable Dispatch - -on: - workflow_run: - workflows: ["Windows Test", "MacOS Test", "Linux Test", "Linux Sanitizer Test"] - types: - - completed - branches: ['v*.*.*', 'master'] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - windows-distributable: - name: Windows Distributable Dispatch - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' - steps: - - name: Windows Workflow Dispatch - uses: convictional/trigger-workflow-and-wait@v1.6.1 - with: - owner: metacall - repo: distributable-windows - github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} - workflow_file_name: ci.yml - wait_workflow: true - client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' - ref: ${{ github.head_ref || github.ref_name }} - - macos-distributable: - name: MacOS Distributable Dispatch - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' - steps: - - name: Homebrew Workflow Dispatch - uses: convictional/trigger-workflow-and-wait@v1.6.1 - with: - owner: metacall - repo: homebrew - github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} - workflow_file_name: test.yml - wait_workflow: true - client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' - ref: ${{ github.head_ref || github.ref_name }} - - name: MacOS Workflow Dispatch - uses: convictional/trigger-workflow-and-wait@v1.6.1 - with: - owner: metacall - repo: distributable-macos - github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} - workflow_file_name: ci.yml - wait_workflow: true - client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' - ref: ${{ github.head_ref || github.ref_name }} - - linux-distributable: - name: Linux Distributable Dispatch - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' - steps: - - name: Linux Workflow Dispatch - uses: convictional/trigger-workflow-and-wait@v1.6.1 - with: - owner: metacall - repo: distributable-linux - github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} - workflow_file_name: ci.yml - wait_workflow: true - client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' - ref: ${{ github.head_ref || github.ref_name }} diff --git a/.github/workflows/linux-sanitizer.yml b/.github/workflows/linux-sanitizer.yml deleted file mode 100644 index 25198eceb..000000000 --- a/.github/workflows/linux-sanitizer.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Linux Sanitizer Test - -on: - workflow_dispatch: - pull_request: - push: - tags: - - 'v*.*.*' - branches: - - master - - develop - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - linux-sanitizer-gcc: - name: Linux GCC Sanitizer Test - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - image: ["debian:trixie-slim", "debian:bookworm-slim", "ubuntu:noble", "ubuntu:jammy"] - sanitizer: [address-sanitizer, thread-sanitizer] # TODO: memory-sanitizer not supported by GCC - - env: - SANITIZER_SKIP_SUMMARY: 1 - - steps: - - name: Check out the repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install, build and run thread sanitizer tests - run: ./docker-compose.sh test-${{ matrix.sanitizer }} - env: - METACALL_BUILD_TYPE: debug - METACALL_BASE_IMAGE: ${{ matrix.image }} diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index d36c887d7..6a72e494a 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -35,3 +35,45 @@ jobs: env: METACALL_BUILD_TYPE: ${{ matrix.build }} METACALL_BASE_IMAGE: ${{ matrix.image }} + + linux-sanitizer-test: + name: Linux GCC Sanitizer Test + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + image: ["debian:trixie-slim", "debian:bookworm-slim", "ubuntu:noble", "ubuntu:jammy"] + sanitizer: [address-sanitizer, thread-sanitizer] # TODO: memory-sanitizer not supported by GCC + + env: + SANITIZER_SKIP_SUMMARY: 1 + + steps: + - name: Check out the repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install, build and run thread sanitizer tests + run: ./docker-compose.sh test-${{ matrix.sanitizer }} + env: + METACALL_BUILD_TYPE: debug + METACALL_BASE_IMAGE: ${{ matrix.image }} + + linux-distributable: + name: Linux Distributable Dispatch + needs: [linux-test, linux-sanitizer-test] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' + steps: + - name: Linux Workflow Dispatch + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: metacall + repo: distributable-linux + github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + workflow_file_name: ci.yml + wait_workflow: true + client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' + ref: ${{ github.head_ref || github.ref_name }} diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 8b9679863..e050cf1fb 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: true jobs: - mac-test: + macos-test: name: MacOS Clang Test runs-on: macos-latest @@ -95,3 +95,30 @@ jobs: bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS env: METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests + + macos-distributable: + name: MacOS Distributable Dispatch + needs: macos-test + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' + steps: + - name: Homebrew Workflow Dispatch + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: metacall + repo: homebrew + github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + workflow_file_name: test.yml + wait_workflow: true + client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' + ref: ${{ github.head_ref || github.ref_name }} + - name: MacOS Workflow Dispatch + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: metacall + repo: distributable-macos + github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + workflow_file_name: ci.yml + wait_workflow: true + client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' + ref: ${{ github.head_ref || github.ref_name }} diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index a46e1ebe4..41cd0ec4c 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -64,3 +64,20 @@ jobs: run: cmd.exe /c "powershell ..\tools\metacall-build.ps1 $Env:METACALL_BUILD_OPTIONS" env: METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests + + windows-distributable: + name: Windows Distributable Dispatch + needs: windows-test + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' + steps: + - name: Windows Workflow Dispatch + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: metacall + repo: distributable-windows + github_token: ${{ secrets.G_PERSONAL_ACCESS_TOKEN }} + workflow_file_name: ci.yml + wait_workflow: true + client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' + ref: ${{ github.head_ref || github.ref_name }} From 86fae81a02b56c97480a99b36ca7f5c5ab59c4f9 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 23 Aug 2024 00:46:52 +0200 Subject: [PATCH 066/487] Update metacall to v0.8.3. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 53a48a1e8..fab77af2a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.2 \ No newline at end of file +0.8.3 \ No newline at end of file From 3c9bffafcd346030879d093ec4c988664b05720d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 23 Aug 2024 01:57:43 +0200 Subject: [PATCH 067/487] Solve issue with ref on distributable dispatch. --- .github/workflows/linux-test.yml | 2 +- .github/workflows/macos-test.yml | 2 +- .github/workflows/windows-test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 6a72e494a..739b0044b 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -76,4 +76,4 @@ jobs: workflow_file_name: ci.yml wait_workflow: true client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' - ref: ${{ github.head_ref || github.ref_name }} + ref: master diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index e050cf1fb..15f09a95a 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -121,4 +121,4 @@ jobs: workflow_file_name: ci.yml wait_workflow: true client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' - ref: ${{ github.head_ref || github.ref_name }} + ref: master diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 41cd0ec4c..c7af6e0ee 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -80,4 +80,4 @@ jobs: workflow_file_name: ci.yml wait_workflow: true client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' - ref: ${{ github.head_ref || github.ref_name }} + ref: master From 24db326a5e49ecf01d8a6ffcab59698657fe6b06 Mon Sep 17 00:00:00 2001 From: ashpect Date: Sat, 24 Aug 2024 18:56:46 +0530 Subject: [PATCH 068/487] Fix bug --- .../metacall_plugin_extension_invalid_path_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt index bee880e7a..65eec2ce2 100644 --- a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if this loader is enabled -if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_EXT OR NOT OPTION_BUILD_EXTENSIONS OR NOT OPTION_BUILD_CLI) +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_EXT OR NOT OPTION_BUILD_EXTENSIONS OR NOT OPTION_BUILD_CLI OR NOT TARGET cli_core_plugin) return() endif() From 9a982a11366790bea3128772d16ed703d22efbcb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 11 Sep 2024 17:10:54 +0200 Subject: [PATCH 069/487] Minor bug in runtime script. --- tools/metacall-runtime.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/metacall-runtime.sh b/tools/metacall-runtime.sh index d0dbe095f..70855f10d 100755 --- a/tools/metacall-runtime.sh +++ b/tools/metacall-runtime.sh @@ -93,9 +93,9 @@ sub_python(){ cd $ROOT_DIR if [ "${BUILD_TYPE}" = "Debug" ]; then - sub_apt_install_hold python3-dbg libpython3-dbg + sub_apt_install_hold libpython3-dbg else - sub_apt_install_hold python3 + sub_apt_install_hold libpython3-dev fi } From 6a9b97cfadd21dfda45f5f1037fff49fb74359de Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 11 Sep 2024 17:31:13 +0200 Subject: [PATCH 070/487] Solve issue with python port install. --- source/ports/py_port/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index 100795d77..76e4dc2dd 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -114,7 +114,7 @@ } # Exclude base packages -exclude_packages = ['contrib', 'docs', 'tests', 'CMakeLists.txt'] +exclude_packages = ['contrib', 'docs', 'test', 'CMakeLists.txt'] # TODO: Review helper # # Detect if metacall port is already installed From d63e233648ffb919783d2711b09ea7dc1190ee70 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 11 Sep 2024 18:15:29 +0200 Subject: [PATCH 071/487] Improve runtime image. --- tools/runtime/Dockerfile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/runtime/Dockerfile b/tools/runtime/Dockerfile index 96e12e096..355e48397 100644 --- a/tools/runtime/Dockerfile +++ b/tools/runtime/Dockerfile @@ -82,16 +82,20 @@ RUN mkdir -p /usr/local/scripts \ && rm -rf $METACALL_PATH/metacall-runtime.sh # Copy libraries from builder -COPY --from=builder /usr/local/lib/*.so /usr/local/lib/*.so* /usr/local/lib/*.dll /usr/local/lib/*.js /usr/local/lib/*.ts /usr/local/lib/*.node /usr/local/lib/ - -# Copy plugins from builder -COPY --from=builder /usr/local/lib/plugins /usr/local/lib/plugins - -# Copy node dependencies (and port) from builder -COPY --from=builder /usr/local/lib/node_modules/ /usr/local/lib/node_modules/ - -# Copy python dependencies (and port) from builder -COPY --from=builder /usr/local/lib/python3.*/dist-packages/metacall/ /usr/local/lib/python3.*/dist-packages/metacall/ +COPY --from=builder /usr/local/lib/ /usr/local/lib/ + +# Delete unwanted files from libraries +RUN ls /usr/local/lib/ \ + | grep -v '.*\.so$' \ + | grep -v '.*\.so.*' \ + | grep -v '.*\.dll$' \ + | grep -v '.*\.js$' \ + | grep -v '.*\.ts$' \ + | grep -v '.*\.node$' \ + | grep -v '^plugins$' \ + | grep -v '^node_modules$' \ + | grep -v '^python3\..*' \ + | xargs rm -rf # Copy headers from builder COPY --from=builder /usr/local/include/metacall /usr/local/include/metacall From 63553d39c4aed6f6ee85abb505584a875f5b4740 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:10:47 -0400 Subject: [PATCH 072/487] Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows (#522) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4.1.7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f9000dfd..64fd01269 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: with: fetch-depth: 0 # To fetch all tags - name: Download built artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.7 with: name: built-artifacts path: ${{ env.ARTIFACTS_PATH }}/ From 95ed50ee85f439375e9092e30df8251780b1136b Mon Sep 17 00:00:00 2001 From: Mohamed Emad <73320969+hulxv@users.noreply.github.com> Date: Wed, 11 Sep 2024 23:11:08 +0300 Subject: [PATCH 073/487] docs(rs-port): improve `MetacallFuture` docs and clarify some points (#524) --- .../rs_port/src/types/metacall_future.rs | 116 +++++++++++++++--- 1 file changed, 102 insertions(+), 14 deletions(-) diff --git a/source/ports/rs_port/src/types/metacall_future.rs b/source/ports/rs_port/src/types/metacall_future.rs index 2f804acd7..46a8c436c 100644 --- a/source/ports/rs_port/src/types/metacall_future.rs +++ b/source/ports/rs_port/src/types/metacall_future.rs @@ -16,20 +16,40 @@ use std::{ pub type MetacallFutureHandler = fn(Box, Box); /// Represents MetacallFuture. Keep in mind that it's not supported to pass a future as an argument. -/// Usage example: ... +/// +/// ## **Usage example:** +/// +/// **Javascript Code:** +/// ```javascript +/// function doubleValueAfterTime(value, delay) { +/// return new Promise((resolve, reject) => { +/// setTimeout(() => { +/// if (typeof value === 'number') { +/// resolve(value * 2); // Resolves if the value is a number +/// } else { +/// reject('Error: The provided value is not a number.'); // Rejects if the value is not a number +/// } +/// }, delay); +/// }); +/// } /// ``` +/// +/// **Calling Example:** +/// ```rust /// use metacall::{MetacallValue, MetacallFuture, metacall}; -/// -/// fn resolve(result: impl MetacallValue, data: impl MetacallValue) { -/// println!("Resolve:: result: {:#?}, data: {:#?}", result, data); -/// } -/// -/// fn reject(result: impl MetacallValue, data: impl MetacallValue) { -/// println!("Reject:: result: {:#?}, data: {:#?}", result, data); +/// fn runner(x: i32) { +/// +/// fn resolve(result: impl MetacallValue, data: impl MetacallValue) { +/// println!("Resolve:: result: {:#?}, data: {:#?}", result, data); // +/// } +/// +/// fn reject(error: impl MetacallValue, data: impl MetacallValue) { +/// println!("Reject:: error: {:#?}, data: {:#?}", error, data); +/// } +/// +/// let future = metacall::("doubleValueAfterTime", [1, 2000]).unwrap(); +/// future.then(resolve).catch(reject).await_fut(); /// } -/// -/// let future = metacall::("async_function", [1]).unwrap(); -/// future.then(resolve).catch(reject).await_fut(); /// ``` #[repr(C)] pub struct MetacallFuture { @@ -141,20 +161,88 @@ impl MetacallFuture { } /// Adds a resolve callback. + /// + /// ## **Usage example:** + /// + /// + /// ```javascript + /// // Javascript script + /// + /// function func_always_rejects(value, delay) { + /// return new Promise((resolve) => { + /// resolve('Resolve message.'); + /// }); + /// } + /// ``` + /// **Calling Example:** + /// + /// ```rust + /// use metacall::{MetacallValue, MetacallFuture, metacall_no_args}; + /// fn calling() { + /// fn reject(result: impl MetacallValue, _: impl MetacallValue) { + /// println!("Resolve:: {:#?}", result); // Resolve:: "Resolve message" + /// } + /// + /// let future = metacall_no_args::("func_always_resolve").unwrap(); + /// future.then(resolve).catch(reject).await_fut(); + /// } + /// ``` pub fn then(mut self, resolve: MetacallFutureHandler) -> Self { self.resolve = Some(resolve); - + self } - + /// Adds a reject callback. + /// + /// ## **Usage example:** + /// + /// ```javascript + /// // Javascript script + /// function func_always_rejects(value, delay) { + /// return new Promise((_, reject) => { + /// reject('Error: Reject message.'); + /// }); + /// } + /// ``` + /// **Calling Example:** + /// ```rust + /// use metacall::{MetacallValue, MetacallFuture, metacall_no_args}; + /// fn calling() { + /// fn reject(error: impl MetacallValue, _: impl MetacallValue) { + /// println!("Reject:: error: {:#?}", error); // Reject:: error: "Error: Reject message" + /// } + /// + /// let future = metacall_no_args::("func_always_rejects").unwrap(); + /// future.then(resolve).catch(reject).await_fut(); + /// } + /// ``` pub fn catch(mut self, reject: MetacallFutureHandler) -> Self { self.reject = Some(reject); self } - /// Adds data. + /// Adds data to use it inside the `resolver` and `reject`. + /// + /// Example: + /// ```rust + /// use metacall::{MetacallValue, MetacallFuture, metacall}; + /// + /// fn run() { + /// let x = 10; + /// fn resolve(result: impl MetacallValue, data: impl MetacallValue) { + /// println!("X = {data}"); + /// } + /// + /// fn reject(result: impl MetacallValue, data: impl MetacallValue) { + /// println!("X = {data}"); + /// } + /// + /// let future = metacall::("async_function", [1]).unwrap(); + /// future.then(resolve).catch(reject),data(x).await_fut(); + /// } + /// ``` pub fn data(mut self, data: impl MetacallValue) -> Self { unsafe { drop(Box::from_raw(self.data)) }; From 6912869d08ce4e23f294eb4d4776b96cbe1459a5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Thu, 19 Sep 2024 01:32:48 +0200 Subject: [PATCH 074/487] Add base for binary install libnode. --- tools/metacall-environment.sh | 39 ++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 9077dee10..91d87ec4f 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -180,7 +180,7 @@ sub_python(){ pyenv install 3.11.1 pyenv global 3.11.1 pyenv rehash - mkdir -p build + mkdir -p "$ROOT_DIR/build" CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" ENV_FILE="$ROOT_DIR/build/.env" @@ -224,7 +224,7 @@ sub_ruby(){ elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then brew install ruby@3.2 brew link ruby@3.2 --force --overwrite - mkdir -p build + mkdir -p "$ROOT_DIR/build" CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" RUBY_PREFIX="$(brew --prefix ruby@3.2)" RUBY_VERSION="$(ruby -e 'puts RUBY_VERSION')" @@ -512,6 +512,29 @@ sub_nodejs(){ fi elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then # TODO: Fork https://github.com/puerts/backend-nodejs or let metacall build system compile NodeJS library itself + # if [ -z "${NodeJS_BUILD_FROM_SOURCE:-}" ]; then + # # Define node location + # NODE_PREFIX="$ROOT_DIR/build" + # # Include binaries into PATH + # export PATH="$NODE_PREFIX:$PATH" + + # # Create install path + # mkdir -p "$NODE_PREFIX" + # # Install NodeJS (TODO: Implement arm64 or amd64 detection into ${arch}) + # wget -qO- https://github.com/metacall/libnode/releases/download/v22.6.0/libnode-${arch}-macos.tar.xz | tar xvJ -C $NODE_PREFIX + # # Install NPM + # wget -qO- https://registry.npmjs.org/npm/-/npm-10.8.2.tgz | tar xvz -C $NODE_PREFIX + + # # Configure NodeJS paths + # mkdir -p "$ROOT_DIR/build" + # CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" + # echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/node" >> $CMAKE_CONFIG_PATH + # echo "-DNodeJS_LIBRARY=$NODE_PREFIX/libnode.127.dylib" >> $CMAKE_CONFIG_PATH + + # # Configure NPM path + # echo "-DNPM_ROOT=$NODE_PREFIX" >> $CMAKE_CONFIG_PATH + # else + brew install node@20 # Make node 20 the default brew link node@20 --force --overwrite @@ -523,7 +546,7 @@ sub_nodejs(){ export PATH="$NODE_PREFIX/bin:$PATH" # Configure NodeJS paths - mkdir -p build + mkdir -p "$ROOT_DIR/build" CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/bin/node" >> $CMAKE_CONFIG_PATH # echo "-DNodeJS_INCLUDE_DIR=$NODE_PREFIX/include/node" >> $CMAKE_CONFIG_PATH @@ -531,6 +554,8 @@ sub_nodejs(){ # Configure NPM path echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH + + # fi fi } @@ -598,7 +623,7 @@ sub_java(){ brew install openjdk@17 sudo ln -sfn $(brew --prefix openjdk@17)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk JAVA_PREFIX=$(/usr/libexec/java_home -v 17) - mkdir -p build + mkdir -p "$ROOT_DIR/build" CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" echo "-DJAVA_HOME=$JAVA_PREFIX" >> $CMAKE_CONFIG_PATH echo "-DJAVA_INCLUDE_PATH=$JAVA_PREFIX/include" >> $CMAKE_CONFIG_PATH @@ -660,7 +685,7 @@ sub_c(){ brew install libffi brew install llvm@$LLVM_VERSION_STRING brew link llvm@$LLVM_VERSION_STRING --force --overwrite - mkdir -p build + mkdir -p "$ROOT_DIR/build" CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" LIBCLANG_PREFIX=$(brew --prefix llvm@$LLVM_VERSION_STRING) echo "-DLibClang_INCLUDE_DIR=${LIBCLANG_PREFIX}/include" >> $CMAKE_CONFIG_PATH @@ -704,7 +729,7 @@ sub_cobol(){ fi elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then brew install gnucobol - mkdir -p build + mkdir -p "$ROOT_DIR/build" CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" COBOL_PREFIX=$(brew --prefix gnucobol) echo "-DCOBOL_EXECUTABLE=${COBOL_PREFIX}/bin/cobc" >> $CMAKE_CONFIG_PATH @@ -842,7 +867,7 @@ sub_backtrace(){ elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then brew install dwarfutils brew install libelf - mkdir -p build + mkdir -p "$ROOT_DIR/build" CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" LIBDWARD_PREFIX=$(brew --prefix dwarfutils) LIBELF_PREFIX=$(brew --prefix libelf) From 322af7e49f9688553ef9806d08af0396973af04a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 20 Sep 2024 08:43:38 +0200 Subject: [PATCH 075/487] Improve test in linux. --- .github/workflows/linux-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 739b0044b..50ccd3a1e 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - name: Install, build and run tests - run: ./docker-compose.sh build + run: ./docker-compose.sh test env: METACALL_BUILD_TYPE: ${{ matrix.build }} METACALL_BASE_IMAGE: ${{ matrix.image }} From 9dca44b7400820a9a5a5e0fd0ef4b7810f7ef6ec Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 20 Sep 2024 08:47:21 +0200 Subject: [PATCH 076/487] Improve linux tests. --- .github/workflows/linux-test.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux-test.yml b/.github/workflows/linux-test.yml index 50ccd3a1e..dd9af8673 100644 --- a/.github/workflows/linux-test.yml +++ b/.github/workflows/linux-test.yml @@ -30,7 +30,13 @@ jobs: with: fetch-depth: 0 - - name: Install, build and run tests + - name: Install, build and run tests (build) + run: ./docker-compose.sh build + env: + METACALL_BUILD_TYPE: ${{ matrix.build }} + METACALL_BASE_IMAGE: ${{ matrix.image }} + + - name: Install, build and run tests (test) run: ./docker-compose.sh test env: METACALL_BUILD_TYPE: ${{ matrix.build }} From fc1d577cd5ad281a40656c3c8303a16287bcf877 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:12:58 -0400 Subject: [PATCH 077/487] Update build.rs from Rust Port. --- source/ports/rs_port/build.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/ports/rs_port/build.rs b/source/ports/rs_port/build.rs index 6787eff43..4b7bcf309 100644 --- a/source/ports/rs_port/build.rs +++ b/source/ports/rs_port/build.rs @@ -24,10 +24,10 @@ fn main() { // When building from Cargo let profile = env::var("PROFILE").unwrap(); match profile.as_str() { - "debug" => { - println!("cargo:rustc-link-lib=dylib=metacalld"); - } - "release" => { + // "debug" => { + // println!("cargo:rustc-link-lib=dylib=metacalld"); + // } + "debug" | "release" => { println!("cargo:rustc-link-lib=dylib=metacall") } _ => { From 102581f80f48ad7aa95551bdf08dd9477f4320a1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:17:31 -0400 Subject: [PATCH 078/487] Update Rust Port version. --- source/ports/rs_port/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index fbe1da261..25789507b 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.4.1" +version = "0.4.2" [lib] crate-type = ["lib"] From 03126f2e48f1e9c4a8ca2a5c9a24e561dd11b1a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:15:15 -0400 Subject: [PATCH 079/487] Bump puma from 5.6.8 to 5.6.9 in /source/scripts/ruby/blog/source (#526) Bumps [puma](https://github.com/puma/puma) from 5.6.8 to 5.6.9. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v5.6.8...v5.6.9) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- source/scripts/ruby/blog/source/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/scripts/ruby/blog/source/Gemfile.lock b/source/scripts/ruby/blog/source/Gemfile.lock index e7f04849e..bebe894c2 100644 --- a/source/scripts/ruby/blog/source/Gemfile.lock +++ b/source/scripts/ruby/blog/source/Gemfile.lock @@ -76,11 +76,11 @@ GEM mini_mime (1.0.2) mini_portile2 (2.8.6) minitest (5.18.0) - nio4r (2.7.0) + nio4r (2.7.3) nokogiri (1.16.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) - puma (5.6.8) + puma (5.6.9) nio4r (~> 2.0) racc (1.7.3) rack (2.2.8.1) From 94752dbb76d05733c9cca40b736927827acaac18 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 29 Oct 2024 17:11:26 +0100 Subject: [PATCH 080/487] Avoid annoying message in CLI. --- .../cli_cmd_plugin/source/cli_cmd_plugin.js | 14 +++++++++++++- .../cli_repl_plugin/source/cli_repl_plugin.js | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js b/source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js index e5eb42121..07096c174 100644 --- a/source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js +++ b/source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js @@ -20,7 +20,19 @@ function command_initialize(plugin_path) { * }; */ const cmd_path = path.join(plugin_path, 'cli', 'cmd'); - const files = fs.readdirSync(cmd_path); + const files = (() => { + try { + return fs.readdirSync(cmd_path); + } catch (e) { + /* If the directory does not exist, return no files */ + if (e?.code === 'ENOENT') { + return [] + } + + /* Otherwise, rethrow the exception */ + throw e; + } + })(); for (const file of files) { const file_path = path.join(cmd_path, file); diff --git a/source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js b/source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js index 0ff4a09e3..e8d6f1c18 100644 --- a/source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js +++ b/source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js @@ -36,7 +36,19 @@ function repl_initialize(plugin_path) { * plugins/cli/repl/${plugin_name}/${plugin_name}_repl.js */ const repl_path = path.join(plugin_path, 'cli', 'repl'); - const files = fs.readdirSync(repl_path); + const files = (() => { + try { + return fs.readdirSync(repl_path); + } catch (e) { + /* If the directory does not exist, return no files */ + if (e?.code === 'ENOENT') { + return [] + } + + /* Otherwise, rethrow the exception */ + throw e; + } + })(); for (const file of files) { const file_path = path.join(repl_path, file); From ed0ea2c0453163cbd113b04f7936f798afbf4538 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 29 Oct 2024 19:44:18 +0100 Subject: [PATCH 081/487] Solve issues in CLI. --- source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js | 2 +- source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js b/source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js index 07096c174..2c2045dce 100644 --- a/source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js +++ b/source/cli/plugins/cli_cmd_plugin/source/cli_cmd_plugin.js @@ -25,7 +25,7 @@ function command_initialize(plugin_path) { return fs.readdirSync(cmd_path); } catch (e) { /* If the directory does not exist, return no files */ - if (e?.code === 'ENOENT') { + if (e !== undefined && e.code === 'ENOENT') { return [] } diff --git a/source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js b/source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js index e8d6f1c18..b49448e5d 100644 --- a/source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js +++ b/source/cli/plugins/cli_repl_plugin/source/cli_repl_plugin.js @@ -41,7 +41,7 @@ function repl_initialize(plugin_path) { return fs.readdirSync(repl_path); } catch (e) { /* If the directory does not exist, return no files */ - if (e?.code === 'ENOENT') { + if (e !== undefined && e.code === 'ENOENT') { return [] } From 7b71fbca7b4e704e6195b20ac6c903f32403f241 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 29 Oct 2024 22:19:07 +0100 Subject: [PATCH 082/487] Update version to v0.8.4. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fab77af2a..fcbb5375b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.3 \ No newline at end of file +0.8.4 \ No newline at end of file From f93ddb2e40fd5c0a227c15a87062f1497650de2e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 5 Nov 2024 18:07:16 +0100 Subject: [PATCH 083/487] Update version of python, add more coverage to macos, trying to solve issue in Python 3.13. --- .github/workflows/macos-test.yml | 3 ++- source/loaders/py_loader/source/py_loader_impl.c | 12 +++++++++++- tools/metacall-environment.sh | 16 +++++++++------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 15f09a95a..9ae08305b 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -17,11 +17,12 @@ concurrency: jobs: macos-test: name: MacOS Clang Test - runs-on: macos-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: + os: [macos-13, macos-14, macos-15] options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 31c11aa41..cd804cb69 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -45,6 +45,13 @@ #include +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE + #endif + #include +#endif + #define PY_LOADER_IMPL_FUNCTION_TYPE_INVOKE_FUNC "__py_loader_impl_function_type_invoke__" #define PY_LOADER_IMPL_FINALIZER_FUNC "__py_loader_impl_finalizer__" @@ -287,7 +294,10 @@ static PyTypeObject py_loader_impl_dict_type = { 0, /* tp_finalize */ 0, /* tp_vectorcall */ #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 12 - 0 /* tp_watched */ + 0, /* tp_watched */ +#endif +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 + 0, /* tp_versions_used */ #endif }; diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 91d87ec4f..3407c6b0b 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -177,8 +177,10 @@ sub_python(){ brew install pyenv openssl export PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig export PYTHON_CONFIGURE_OPTS="--enable-shared" - pyenv install 3.11.1 - pyenv global 3.11.1 + PYTHON_VERSION_SMALL="3.13" + PYTHON_VERSION="${PYTHON_VERSION_SMALL}.0" + pyenv install ${PYTHON_VERSION} + pyenv global ${PYTHON_VERSION} pyenv rehash mkdir -p "$ROOT_DIR/build" CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" @@ -187,11 +189,11 @@ sub_python(){ echo eval "$(pyenv init -)" >> $ENV_FILE . $ENV_FILE - echo "-DPython3_INCLUDE_DIRS=$HOME/.pyenv/versions/3.11.1/include/python3.11" >> $CMAKE_CONFIG_PATH - echo "-DPython3_LIBRARY=$HOME/.pyenv/versions/3.11.1/lib/libpython3.11.dylib" >> $CMAKE_CONFIG_PATH - echo "-DPython3_EXECUTABLE=$HOME/.pyenv/versions/3.11.1/bin/python3.11" >> $CMAKE_CONFIG_PATH - echo "-DPython3_ROOT=$HOME/.pyenv/versions/3.11.1" >> $CMAKE_CONFIG_PATH - echo "-DPython3_VERSION=3.11.1" >> $CMAKE_CONFIG_PATH + echo "-DPython3_INCLUDE_DIRS=$HOME/.pyenv/versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION_SMALL}" >> $CMAKE_CONFIG_PATH + echo "-DPython3_LIBRARY=$HOME/.pyenv/versions/${PYTHON_VERSION}/lib/libpython${PYTHON_VERSION_SMALL}.dylib" >> $CMAKE_CONFIG_PATH + echo "-DPython3_EXECUTABLE=$HOME/.pyenv/versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION_SMALL}" >> $CMAKE_CONFIG_PATH + echo "-DPython3_ROOT=$HOME/.pyenv/versions/${PYTHON_VERSION}" >> $CMAKE_CONFIG_PATH + echo "-DPython3_VERSION=${PYTHON_VERSION}" >> $CMAKE_CONFIG_PATH echo "-DPython3_FIND_FRAMEWORK=NEVER" >> $CMAKE_CONFIG_PATH pip3 install requests From b948b0cd3e86f5d2ad6e57e49588659f50c0a47f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 5 Nov 2024 19:17:00 +0100 Subject: [PATCH 084/487] Move python dict wrapper outside of impl in order to avoid name collision. --- source/loaders/py_loader/CMakeLists.txt | 2 + .../include/py_loader/py_loader_dict.h | 42 +++++ .../include/py_loader/py_loader_impl.h | 2 - .../loaders/py_loader/source/py_loader_dict.c | 172 ++++++++++++++++++ .../loaders/py_loader/source/py_loader_impl.c | 146 +-------------- .../loaders/py_loader/source/py_loader_port.c | 1 + 6 files changed, 219 insertions(+), 146 deletions(-) create mode 100644 source/loaders/py_loader/include/py_loader/py_loader_dict.h create mode 100644 source/loaders/py_loader/source/py_loader_dict.c diff --git a/source/loaders/py_loader/CMakeLists.txt b/source/loaders/py_loader/CMakeLists.txt index 2b8153e5d..eed3658bc 100644 --- a/source/loaders/py_loader/CMakeLists.txt +++ b/source/loaders/py_loader/CMakeLists.txt @@ -88,6 +88,7 @@ set(headers ${include_path}/py_loader_impl.h ${include_path}/py_loader_port.h ${include_path}/py_loader_threading.h + ${include_path}/py_loader_dict.h ) set(sources @@ -95,6 +96,7 @@ set(sources ${source_path}/py_loader_impl.c ${source_path}/py_loader_port.c ${source_path}/py_loader_threading.cpp + ${source_path}/py_loader_dict.c ) # Group source files diff --git a/source/loaders/py_loader/include/py_loader/py_loader_dict.h b/source/loaders/py_loader/include/py_loader/py_loader_dict.h new file mode 100644 index 000000000..f1cc908a9 --- /dev/null +++ b/source/loaders/py_loader/include/py_loader/py_loader_dict.h @@ -0,0 +1,42 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading python code at run-time into a process. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef PY_LOADER_DICT_H +#define PY_LOADER_DICT_H 1 + +#include + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +PY_LOADER_NO_EXPORT int py_loader_impl_dict_type_init(void); + +PY_LOADER_NO_EXPORT PyObject *py_loader_impl_finalizer_wrap_map(PyObject *obj, void *v); + +#ifdef __cplusplus +} +#endif + +#endif /* PY_LOADER_DICT_H */ diff --git a/source/loaders/py_loader/include/py_loader/py_loader_impl.h b/source/loaders/py_loader/include/py_loader/py_loader_impl.h index 7da3504a9..7ec76f33a 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_impl.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_impl.h @@ -58,8 +58,6 @@ PY_LOADER_NO_EXPORT value py_loader_impl_capi_to_value(loader_impl impl, PyObjec PY_LOADER_NO_EXPORT PyObject *py_loader_impl_value_to_capi(loader_impl impl, type_id id, value v); -PY_LOADER_NO_EXPORT PyObject *py_loader_impl_finalizer_wrap_map(PyObject *obj, value v); - PY_LOADER_NO_EXPORT int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v); #ifdef __cplusplus diff --git a/source/loaders/py_loader/source/py_loader_dict.c b/source/loaders/py_loader/source/py_loader_dict.c new file mode 100644 index 000000000..e68531ff4 --- /dev/null +++ b/source/loaders/py_loader/source/py_loader_dict.c @@ -0,0 +1,172 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading python code at run-time into a process. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include +#include + +#include + +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE + #endif + #include +#endif + +struct py_loader_impl_dict_obj +{ + PyDictObject dict; + value v; + PyObject *parent; +}; + +static void py_loader_impl_dict_dealloc(struct py_loader_impl_dict_obj *self); + +static PyObject *py_loader_impl_dict_sizeof(struct py_loader_impl_dict_obj *self, void *unused); + +static int py_loader_impl_dict_init(struct py_loader_impl_dict_obj *self, PyObject *args, PyObject *kwds); + +static struct PyMethodDef py_loader_impl_dict_methods[] = { + { "__sizeof__", (PyCFunction)py_loader_impl_dict_sizeof, METH_NOARGS, PyDoc_STR("Get size of dictionary.") }, + { NULL, NULL, 0, NULL } +}; + +union py_loader_impl_dict_cast +{ + PyTypeObject *type_object; + PyObject *object; +}; + +static PyTypeObject py_loader_impl_dict_type = { + PyVarObject_HEAD_INIT(NULL, 0) "DictWrapper", + sizeof(struct py_loader_impl_dict_obj), + 0, + (destructor)py_loader_impl_dict_dealloc, /* tp_dealloc */ + 0, /* tp_vectorcall_offset */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_as_async */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ + PyDoc_STR("Dict wrapper destructor hook"), /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + py_loader_impl_dict_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)py_loader_impl_dict_init, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ + 0, /* tp_version_tag */ + 0, /* tp_finalize */ + 0, /* tp_vectorcall */ +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 12 + 0, /* tp_watched */ +#endif +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 + 0, /* tp_versions_used */ +#endif +}; + +PyObject *py_loader_impl_dict_sizeof(struct py_loader_impl_dict_obj *self, void *Py_UNUSED(unused)) +{ + Py_ssize_t res; + + res = _PyDict_SizeOf((PyDictObject *)self); + res += sizeof(struct py_loader_impl_dict_obj) - sizeof(PyDictObject); + return PyLong_FromSsize_t(res); +} + +int py_loader_impl_dict_init(struct py_loader_impl_dict_obj *self, PyObject *args, PyObject *kwds) +{ + if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0) + return -1; + self->v = NULL; + return 0; +} + +void py_loader_impl_dict_dealloc(struct py_loader_impl_dict_obj *self) +{ + value_type_destroy(self->v); + Py_DECREF(self->parent); /* TODO: Review if this is correct or this line is unnecessary */ + + PyDict_Type.tp_dealloc((PyObject *)self); +} + +int py_loader_impl_dict_type_init() +{ + /* py_loader_impl_dict_type is derived from PyDict_Type */ + py_loader_impl_dict_type.tp_base = &PyDict_Type; + + return PyType_Ready(&py_loader_impl_dict_type); +} + +PyObject *py_loader_impl_finalizer_wrap_map(PyObject *obj, void *v) +{ + py_loader_thread_acquire(); + + PyObject *args = PyTuple_New(1); + union py_loader_impl_dict_cast dict_cast = { &py_loader_impl_dict_type }; + + PyTuple_SetItem(args, 0, obj); + Py_INCREF(obj); + PyObject *wrapper = PyObject_CallObject(dict_cast.object, args); + Py_DECREF(args); + + py_loader_thread_release(); + + if (wrapper == NULL) + { + return NULL; + } + + struct py_loader_impl_dict_obj *wrapper_obj = (struct py_loader_impl_dict_obj *)wrapper; + + wrapper_obj->v = v; + wrapper_obj->parent = obj; + + return wrapper; +} diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index cd804cb69..556ba0aa8 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -18,6 +18,7 @@ * */ +#include #include #include #include @@ -45,13 +46,6 @@ #include -#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE - #endif - #include -#endif - #define PY_LOADER_IMPL_FUNCTION_TYPE_INVOKE_FUNC "__py_loader_impl_function_type_invoke__" #define PY_LOADER_IMPL_FINALIZER_FUNC "__py_loader_impl_finalizer__" @@ -220,87 +214,6 @@ static PyMethodDef py_loader_impl_finalizer_defs[] = { { NULL, NULL, 0, NULL } }; -struct py_loader_impl_dict_obj -{ - PyDictObject dict; - value v; - PyObject *parent; -}; - -static void py_loader_impl_dict_dealloc(struct py_loader_impl_dict_obj *self); - -static PyObject *py_loader_impl_dict_sizeof(struct py_loader_impl_dict_obj *self, void *unused); - -static int py_loader_impl_dict_init(struct py_loader_impl_dict_obj *self, PyObject *args, PyObject *kwds); - -static struct PyMethodDef py_loader_impl_dict_methods[] = { - { "__sizeof__", (PyCFunction)py_loader_impl_dict_sizeof, METH_NOARGS, PyDoc_STR("Get size of dictionary.") }, - { NULL, NULL, 0, NULL } -}; - -union py_loader_impl_dict_cast -{ - PyTypeObject *type_object; - PyObject *object; -}; - -static PyTypeObject py_loader_impl_dict_type = { - PyVarObject_HEAD_INIT(NULL, 0) "DictWrapper", - sizeof(struct py_loader_impl_dict_obj), - 0, - (destructor)py_loader_impl_dict_dealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_as_async */ - 0, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - PyDoc_STR("Dict wrapper destructor hook"), /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - py_loader_impl_dict_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)py_loader_impl_dict_init, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ - 0, /* tp_del */ - 0, /* tp_version_tag */ - 0, /* tp_finalize */ - 0, /* tp_vectorcall */ -#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 12 - 0, /* tp_watched */ -#endif -#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 - 0, /* tp_versions_used */ -#endif -}; - /* Implements: if __name__ == "__main__": */ static int py_loader_impl_run_main = 1; static char *py_loader_impl_main_module = NULL; @@ -308,23 +221,6 @@ static char *py_loader_impl_main_module = NULL; /* Holds reference to the original PyCFunction.tp_dealloc method */ static void (*py_loader_impl_pycfunction_dealloc)(PyObject *) = NULL; -PyObject *py_loader_impl_dict_sizeof(struct py_loader_impl_dict_obj *self, void *Py_UNUSED(unused)) -{ - Py_ssize_t res; - - res = _PyDict_SizeOf((PyDictObject *)self); - res += sizeof(struct py_loader_impl_dict_obj) - sizeof(PyDictObject); - return PyLong_FromSsize_t(res); -} - -int py_loader_impl_dict_init(struct py_loader_impl_dict_obj *self, PyObject *args, PyObject *kwds) -{ - if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0) - return -1; - self->v = NULL; - return 0; -} - PyObject *py_loader_impl_finalizer_object_impl(PyObject *self, PyObject *Py_UNUSED(args)) { value v = PyCapsule_GetPointer(self, NULL); @@ -340,41 +236,6 @@ PyObject *py_loader_impl_finalizer_object_impl(PyObject *self, PyObject *Py_UNUS Py_RETURN_NONE; } -void py_loader_impl_dict_dealloc(struct py_loader_impl_dict_obj *self) -{ - value_type_destroy(self->v); - Py_DECREF(self->parent); /* TODO: Review if this is correct or this line is unnecessary */ - - PyDict_Type.tp_dealloc((PyObject *)self); -} - -PyObject *py_loader_impl_finalizer_wrap_map(PyObject *obj, value v) -{ - py_loader_thread_acquire(); - - PyObject *args = PyTuple_New(1); - union py_loader_impl_dict_cast dict_cast = { &py_loader_impl_dict_type }; - - PyTuple_SetItem(args, 0, obj); - Py_INCREF(obj); - PyObject *wrapper = PyObject_CallObject(dict_cast.object, args); - Py_DECREF(args); - - py_loader_thread_release(); - - if (wrapper == NULL) - { - return NULL; - } - - struct py_loader_impl_dict_obj *wrapper_obj = (struct py_loader_impl_dict_obj *)wrapper; - - wrapper_obj->v = v; - wrapper_obj->parent = obj; - - return wrapper; -} - int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v) { py_loader_thread_acquire(); @@ -2838,10 +2699,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi goto error_after_thread_background_module; } - /* py_loader_impl_dict_type is derived from PyDict_Type */ - py_loader_impl_dict_type.tp_base = &PyDict_Type; - - if (PyType_Ready(&py_loader_impl_dict_type) < 0) + if (py_loader_impl_dict_type_init() < 0) { goto error_after_asyncio_module; } diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index fad849e4b..136635c31 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -20,6 +20,7 @@ #include +#include #include #include #include From 24dfb255a9727263e6a122592b9483589c0ea509 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 5 Nov 2024 20:32:18 +0100 Subject: [PATCH 085/487] Solving issues with py dict. --- cmake/CompileOptions.cmake | 6 ++---- cmake/FindNodeJS.cmake | 9 +++++++-- .../loaders/py_loader/include/py_loader/py_loader_dict.h | 2 -- source/loaders/py_loader/source/py_loader_dict.c | 8 +++++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index 6895060d9..2d385762d 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -98,12 +98,10 @@ elseif(OPTION_BUILD_ADDRESS_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR set(TESTS_SANITIZER_ENVIRONMENT_VARIABLES "LSAN_OPTIONS=verbosity=1:log_threads=1:print_suppressions=false:suppressions=${CMAKE_SOURCE_DIR}/source/tests/sanitizer/lsan.supp" - # Specify use_sigaltstack=0 as CoreCLR uses own alternate stack for signal handlers (https://github.com/swgillespie/coreclr/commit/bec020aa466d08e49e007d0011b0e79f8f7c7a62) - # "ASAN_OPTIONS=use_sigaltstack=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" - # Specify handle_segv=0 and detect_leaks=0 for the JVM (https://blog.gypsyengineer.com/en/security/running-java-with-addresssanitizer.html) - # "ASAN_OPTIONS=detect_leaks=0:handle_segv=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" + # "ASAN_OPTIONS=handle_segv=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" + # Specify use_sigaltstack=0 as CoreCLR uses own alternate stack for signal handlers (https://github.com/swgillespie/coreclr/commit/bec020aa466d08e49e007d0011b0e79f8f7c7a62) "ASAN_OPTIONS=use_sigaltstack=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" ) set(SANITIZER_COMPILE_DEFINITIONS diff --git a/cmake/FindNodeJS.cmake b/cmake/FindNodeJS.cmake index 0e325fda1..a4c7db292 100644 --- a/cmake/FindNodeJS.cmake +++ b/cmake/FindNodeJS.cmake @@ -559,12 +559,17 @@ if(NOT NodeJS_LIBRARY) set(BUILD_DEBUG) set(BUILD_DEBUG_ASAN) + set(BUILD_DEBUG_ASAN_OPTIONS) if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") set(BUILD_DEBUG --debug) if(OPTION_BUILD_ADDRESS_SANITIZER) set(BUILD_DEBUG_ASAN --enable-asan) + + if("${NodeJS_VERSION_MAJOR}" GREATER_EQUAL "20") + set(BUILD_DEBUG_ASAN_OPTIONS ${CMAKE_COMMAND} -E env ASAN_OPTIONS=detect_container_overflow=0) + endif() endif() endif() @@ -585,12 +590,12 @@ if(NOT NodeJS_LIBRARY) if(N GREATER 1) execute_process( WORKING_DIRECTORY "${NodeJS_OUTPUT_PATH}" - COMMAND make -j${N} -C ${NodeJS_OUTPUT_PATH}/out BUILDTYPE=${CMAKE_BUILD_TYPE} V=1 + COMMAND ${BUILD_DEBUG_ASAN_OPTIONS} make -j${N} -C ${NodeJS_OUTPUT_PATH}/out BUILDTYPE=${CMAKE_BUILD_TYPE} V=1 ) else() execute_process( WORKING_DIRECTORY "${NodeJS_OUTPUT_PATH}" - COMMAND make -C ${NodeJS_OUTPUT_PATH}/out BUILDTYPE=${CMAKE_BUILD_TYPE} V=1 + COMMAND ${BUILD_DEBUG_ASAN_OPTIONS} make -C ${NodeJS_OUTPUT_PATH}/out BUILDTYPE=${CMAKE_BUILD_TYPE} V=1 ) endif() endif() diff --git a/source/loaders/py_loader/include/py_loader/py_loader_dict.h b/source/loaders/py_loader/include/py_loader/py_loader_dict.h index f1cc908a9..6c874786e 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_dict.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_dict.h @@ -23,8 +23,6 @@ #include -#include - #include #ifdef __cplusplus diff --git a/source/loaders/py_loader/source/py_loader_dict.c b/source/loaders/py_loader/source/py_loader_dict.c index e68531ff4..022ff7c9a 100644 --- a/source/loaders/py_loader/source/py_loader_dict.c +++ b/source/loaders/py_loader/source/py_loader_dict.c @@ -21,6 +21,8 @@ #include #include +#include + #include #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 @@ -33,7 +35,7 @@ struct py_loader_impl_dict_obj { PyDictObject dict; - value v; + void *v; PyObject *parent; }; @@ -130,13 +132,13 @@ int py_loader_impl_dict_init(struct py_loader_impl_dict_obj *self, PyObject *arg void py_loader_impl_dict_dealloc(struct py_loader_impl_dict_obj *self) { - value_type_destroy(self->v); + metacall_value_destroy(self->v); Py_DECREF(self->parent); /* TODO: Review if this is correct or this line is unnecessary */ PyDict_Type.tp_dealloc((PyObject *)self); } -int py_loader_impl_dict_type_init() +int py_loader_impl_dict_type_init(void) { /* py_loader_impl_dict_type is derived from PyDict_Type */ py_loader_impl_dict_type.tp_base = &PyDict_Type; From b3df606e66563bf0b6907a99709325dc011d2bea Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 5 Nov 2024 23:48:35 +0100 Subject: [PATCH 086/487] Trying to solve asan issues with macos-15. --- cmake/CompileOptions.cmake | 7 ++++++- source/tests/CMakeLists.txt | 2 +- tools/metacall-build.ps1 | 2 +- tools/metacall-build.sh | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index 2d385762d..28d300953 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -101,8 +101,13 @@ elseif(OPTION_BUILD_ADDRESS_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR # Specify handle_segv=0 and detect_leaks=0 for the JVM (https://blog.gypsyengineer.com/en/security/running-java-with-addresssanitizer.html) # "ASAN_OPTIONS=handle_segv=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" + # TODO: We should document each flag why is it used, because now we do not know what runtime has each requirement and why. + # Another option should be to separate by runtimes and only set up them on the ASAN tests that require them, + # because we do not need to disable all features on all tests, this may hide bugs in the core library for example. + # Specify use_sigaltstack=0 as CoreCLR uses own alternate stack for signal handlers (https://github.com/swgillespie/coreclr/commit/bec020aa466d08e49e007d0011b0e79f8f7c7a62) - "ASAN_OPTIONS=use_sigaltstack=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" + # Specify detect_container_overflow=0 as NodeJS 20.x triggers segmentation faults on MacOS 15 + "ASAN_OPTIONS=detect_container_overflow=0:use_sigaltstack=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" ) set(SANITIZER_COMPILE_DEFINITIONS "__ADDRESS_SANITIZER__=1" diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index caa8c1495..09cac815e 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -90,7 +90,7 @@ if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUI --label-exclude MEMCHECK_IGNORE --force-new-ctest-process --test-action memcheck - --timeout 3600 + --timeout 5400 COMMAND ${CMAKE_COMMAND} -E cat "${CMAKE_BINARY_DIR}/Testing/Temporary/MemoryChecker.*.log" ) diff --git a/tools/metacall-build.ps1 b/tools/metacall-build.ps1 index d56181945..483caa2ed 100755 --- a/tools/metacall-build.ps1 +++ b/tools/metacall-build.ps1 @@ -74,7 +74,7 @@ function Sub-Build { # Tests if (($BUILD_TESTS -eq 1) -or ($BUILD_BENCHMARKS -eq 1) -or ($BUILD_COVERAGE -eq 1)) { echo "Running the tests..." - ctest "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" --timeout 3600 --output-on-failure -C $BUILD_TYPE + ctest "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" --timeout 5400 --output-on-failure -C $BUILD_TYPE if (-not $?) { $RecentExitCode = $LASTEXITCODE diff --git a/tools/metacall-build.sh b/tools/metacall-build.sh index b876b597b..d2074c1af 100755 --- a/tools/metacall-build.sh +++ b/tools/metacall-build.sh @@ -75,12 +75,12 @@ sub_build() { # Tests (coverage needs to run the tests) if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then - ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 3600 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE + ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE fi # Coverage if [ $BUILD_COVERAGE = 1 ]; then - ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 3600 -T Coverage + ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 5400 -T Coverage gcovr -r ../source/ . --html-details coverage.html fi From 0eed8f9914eea850f375b1a0a6f640bf7e533360 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 6 Nov 2024 00:37:28 +0100 Subject: [PATCH 087/487] Update NodeJS version to 22. --- cmake/CompileOptions.cmake | 3 +-- tools/metacall-environment.sh | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index 28d300953..e1f03c5e8 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -106,8 +106,7 @@ elseif(OPTION_BUILD_ADDRESS_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR # because we do not need to disable all features on all tests, this may hide bugs in the core library for example. # Specify use_sigaltstack=0 as CoreCLR uses own alternate stack for signal handlers (https://github.com/swgillespie/coreclr/commit/bec020aa466d08e49e007d0011b0e79f8f7c7a62) - # Specify detect_container_overflow=0 as NodeJS 20.x triggers segmentation faults on MacOS 15 - "ASAN_OPTIONS=detect_container_overflow=0:use_sigaltstack=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" + "ASAN_OPTIONS=use_sigaltstack=0:symbolize=1:alloc_dealloc_mismatch=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:fast_unwind_on_malloc=0" ) set(SANITIZER_COMPILE_DEFINITIONS "__ADDRESS_SANITIZER__=1" diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 3407c6b0b..1e638e2dd 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -537,13 +537,13 @@ sub_nodejs(){ # echo "-DNPM_ROOT=$NODE_PREFIX" >> $CMAKE_CONFIG_PATH # else - brew install node@20 - # Make node 20 the default - brew link node@20 --force --overwrite + brew install node@22 + # Make node 22 the default + brew link node@22 --force --overwrite # Execute post install scripts - brew postinstall node@20 + brew postinstall node@22 # Define node location - NODE_PREFIX=$(brew --prefix node@20) + NODE_PREFIX=$(brew --prefix node@22) # Include binaries into PATH export PATH="$NODE_PREFIX/bin:$PATH" From 41c12263906d614052b01cb4e7aa6b473295bc7a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 6 Nov 2024 08:43:37 +0100 Subject: [PATCH 088/487] Remove macos-15 for now. --- .github/workflows/macos-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 9ae08305b..813f22cd8 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-13, macos-14, macos-15] + os: [macos-12, macos-13, macos-14] # TODO: macos-15 options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, @@ -31,7 +31,6 @@ jobs: ] env: - LTTNG_UST_REGISTER_TIMEOUT: 0 NUGET_XMLDOC_MODE: skip DOTNET_CLI_TELEMETRY_OPTOUT: "true" From 21216e9e110f210d8131026b87de57045a27fd1f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 6 Nov 2024 08:44:12 +0100 Subject: [PATCH 089/487] Update version to v0.8.5. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fcbb5375b..bbde4bee2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.4 \ No newline at end of file +0.8.5 \ No newline at end of file From 8d5c6579092c61f825f6790b296e37d4772bb8d2 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 6 Nov 2024 20:25:20 +0100 Subject: [PATCH 090/487] Solve issues in macos ci. --- .github/workflows/macos-test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 813f22cd8..50ad76470 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, macos-13, macos-14] # TODO: macos-15 + os: [macos-12, macos-13, macos-14] # TODO: macos-15: https://github.com/metacall/core/issues/530 options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, @@ -47,8 +47,9 @@ jobs: - name: Uninstall Ruby run: | - brew uninstall --force ruby - brew autoremove + brew uninstall --force --ignore-dependencies ruby + brew cleanup -s ruby + brew cleanup --prune-prefix RUBY_FRAMEWORK_DIR=$(xcrun --sdk macosx --show-sdk-path)/System/Library/Frameworks/Ruby.framework sudo rm -rf $RUBY_FRAMEWORK_DIR From 50d2b61ad6bb4c35ede76e59daa66a41807e322c Mon Sep 17 00:00:00 2001 From: Yasindu Dissanayake Date: Thu, 7 Nov 2024 01:06:24 +0530 Subject: [PATCH 091/487] Update release.yml (#531) --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64fd01269..24f963c9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true env: - GHR_VERSION: 0.12.0 + GHR_VERSION: 0.17.0 IMAGE_NAME: index.docker.io/metacall/core IMAGE_REGISTRY: index.docker.io ARTIFACTS_PATH: ./build-artifacts @@ -33,7 +33,7 @@ jobs: - name: Extract built artifacts run: bash ./docker-compose.sh pack - name: Upload built artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: built-artifacts path: ${{ env.ARTIFACTS_PATH }}/ @@ -48,7 +48,7 @@ jobs: with: fetch-depth: 0 # To fetch all tags - name: Download built artifacts - uses: actions/download-artifact@v4.1.7 + uses: actions/download-artifact@v4.1.8 with: name: built-artifacts path: ${{ env.ARTIFACTS_PATH }}/ From b1c346461e689b1faef45611e3e85459463b94f3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 8 Nov 2024 08:25:14 +0100 Subject: [PATCH 092/487] Trying to make mutliarch work. --- .github/workflows/docker-hub-platform.yml | 185 ++++++++++++---------- 1 file changed, 99 insertions(+), 86 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index d90dd54b1..d180abce2 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -1,14 +1,11 @@ name: Build and Push Docker Image for Multiple Architectures on: - # To enable manual triggering of this workflow - workflow_dispatch: - - # Trigger for pushes to master and tags + pull_request: push: branches: - master - - develop # TODO: Remove this + - develop tags: - 'v*.*.*' @@ -18,6 +15,7 @@ concurrency: env: IMAGE_NAME: index.docker.io/metacall/core + BUILDKIT_VERSION: 0.13.0 jobs: build: @@ -29,103 +27,118 @@ jobs: platform: - linux/amd64 - linux/arm64 - - linux/arm/v6 + - linux/riscv64 + - linux/ppc64le + - linux/s390x + - linux/386 - linux/arm/v7 + - linux/arm/v6 + # - linux/mips64le + # - linux/mips64 + steps: - name: Checkout the code uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Define Platform - run: | - PLATFORM=${{ matrix.platform }} - echo "METACALL_PLATFORM=${PLATFORM}" >> $GITHUB_ENV - echo "METACALL_PLATFORM_PAIR=${PLATFORM//\//-}" >> $GITHUB_ENV - - - name: Docker Metadata + - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.IMAGE_NAME }} - + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx + + - name: Docker Setup BuildX uses: docker/setup-buildx-action@v3 + with: + version: v${{ env.BUILDKIT_VERSION }} + + - name: Verify Docker BuildX Version + run: docker buildx version - - name: Login to DockerHub + - name: Authenticate to Docker registry + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Build MetaCall Docker Images - run: bash ./docker-compose.sh platform - - # # TODO: Build with alpine and provide multiple tags (debian & alpine) once all tests pass - # - name: Push MetaCall Docker Image to DockerHub - # run: | - # if [[ "${{ github.ref == 'refs/heads/master' }}" = true ]]; then - # bash ./docker-compose.sh push - # elif [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then - # bash ./docker-compose.sh version - # else - # echo "Failed to push the docker images" - # exit 1 - # fi - - # - name: Export Digest - # run: | - # mkdir -p /tmp/digests - # digest="${{ steps.build.outputs.digest }}" - # touch "/tmp/digests/${digest#sha256:}" - - # - name: Upload Digest - # uses: actions/upload-artifact@v4 - # with: - # name: digests-${{ env.METACALL_PLATFORM_PAIR }} - # path: /tmp/digests/* - # if-no-files-found: error - # retention-days: 1 - - - name: Logout from DockerHub - run: docker logout - - # merge: - # runs-on: ubuntu-latest - # needs: - # - build - # steps: - # - name: Download Digests - # uses: actions/download-artifact@v4 - # with: - # path: /tmp/digests - # pattern: digests-* - # merge-multiple: true - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - - # - name: Docker Metadata - # id: meta - # uses: docker/metadata-action@v5 - # with: - # images: ${{ env.IMAGE_NAME }} - - # - name: Login to DockerHub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKER_HUB_USERNAME }} - # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - # - name: Create manifest list and push - # working-directory: /tmp/digests - # run: | - # docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - # $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) - - # - name: Inspect image - # run: | - # docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} + env: + METACALL_PLATFORM: ${{ matrix.platform }} + run: | + ./docker-compose.sh platform + + - name: Export digests + if: github.event_name != 'pull_request' + run: | + PLATFORM=${{ matrix.platform }} + echo "PLATFORM=${PLATFORM//\//-}" >> $GITHUB_ENV + for tag in "deps" "dev" "runtime" "cli"; do + mkdir -p "/tmp/digests/${tag}" + digest="$(docker images --no-trunc --quiet metacall/core:$tag)" + touch "/tmp/digests/${tag}/${digest#sha256:}" + done + + - name: Upload digests + if: github.event_name != 'pull_request' + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + name: Merge digests for the manifest + runs-on: ubuntu-latest + if: github.event_name != 'pull_request' + needs: + - build + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: v${{ env.BUILDKIT_VERSION }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_NAME }} + + - name: Authenticate to Docker registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Create manifest list and push + if: github.ref != 'refs/heads/develop' + run: | + for tag in "deps" "dev" "runtime" "cli"; do + cd "/tmp/digests/${tag}" + IMAGE_HASHES=$(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + for image in $IMAGE_HASHES; do + docker push $image + done + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:$tag $IMAGE_HASHES + if [[ "${tag}" = "cli" ]]; then + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest $IMAGE_HASHES + if [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then + TAG=${GITHUB_REF#refs/*/} + VERSION=${TAG#v} + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:$VERSION $IMAGE_HASHES + fi + fi + done From 131b6f3dca05c20cb5fa79718088df1c41251427 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 8 Nov 2024 08:27:57 +0100 Subject: [PATCH 093/487] Solve issue with tokens docker. --- .github/workflows/docker-hub-platform.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index d180abce2..967159ff5 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -63,8 +63,8 @@ jobs: if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Build MetaCall Docker Images env: @@ -120,8 +120,8 @@ jobs: - name: Authenticate to Docker registry uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Create manifest list and push if: github.ref != 'refs/heads/develop' From ae37af7f5111587c882c7b136596335c132b5f3d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 8 Nov 2024 08:44:45 +0100 Subject: [PATCH 094/487] Improve docker multiplatform build condition. --- .github/workflows/docker-hub-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index 967159ff5..f9e97096b 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -124,7 +124,7 @@ jobs: password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Create manifest list and push - if: github.ref != 'refs/heads/develop' + if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/') run: | for tag in "deps" "dev" "runtime" "cli"; do cd "/tmp/digests/${tag}" From 04e0d732fa09dde93e495fdee221c06c22417fb5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 8 Nov 2024 17:04:03 +0100 Subject: [PATCH 095/487] Trying to solve issues with push on docker multiplatform. --- .github/workflows/docker-hub-platform.yml | 34 ++++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index f9e97096b..32f9fe5d2 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -72,6 +72,25 @@ jobs: run: | ./docker-compose.sh platform + # - name: Generate images + # if: github.event_name != 'pull_request' + # run: | + # for tag in "deps" "dev" "runtime" "cli"; do + # mkdir -p "/tmp/images/${tag}" + # digest="$(docker images --no-trunc --quiet metacall/core:${tag})" + # echo "FROM metacall/core:${tag}@${digest}" &> "/tmp/images/${tag}/Dockerfile" + # done + + # - name: Build and push by digest (deps) + # id: build + # uses: docker/build-push-action@v6 + # if: github.event_name != 'pull_request' + # with: + # context: /tmp/images/deps/Dockerfile + # platforms: ${{ matrix.platform }} + # labels: ${{ steps.meta.outputs.labels }} + # outputs: type=image,name=docker.io/${{ env.IMAGE_NAME }}:deps,push-by-digest=true,name-canonical=true,push=true + - name: Export digests if: github.event_name != 'pull_request' run: | @@ -79,7 +98,7 @@ jobs: echo "PLATFORM=${PLATFORM//\//-}" >> $GITHUB_ENV for tag in "deps" "dev" "runtime" "cli"; do mkdir -p "/tmp/digests/${tag}" - digest="$(docker images --no-trunc --quiet metacall/core:$tag)" + digest="$(docker images --no-trunc --quiet metacall/core:${tag})" touch "/tmp/digests/${tag}/${digest#sha256:}" done @@ -128,17 +147,18 @@ jobs: run: | for tag in "deps" "dev" "runtime" "cli"; do cd "/tmp/digests/${tag}" - IMAGE_HASHES=$(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) - for image in $IMAGE_HASHES; do - docker push $image + IMAGE_HASHES=$(printf '${{ env.IMAGE_NAME }}:${tag}@sha256:%s ' *) + for image in ${IMAGE_HASHES}; do + docker image tag ${image} ${{ env.IMAGE_NAME }}:${tag} + docker push ${{ env.IMAGE_NAME }}:${tag} done - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:$tag $IMAGE_HASHES + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${tag} ${IMAGE_HASHES} if [[ "${tag}" = "cli" ]]; then - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest $IMAGE_HASHES + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest ${IMAGE_HASHES} if [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then TAG=${GITHUB_REF#refs/*/} VERSION=${TAG#v} - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:$VERSION $IMAGE_HASHES + docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${VERSION} ${IMAGE_HASHES} fi fi done From ef34cb701fe0abc575b1df588f0ea7ece3fbf174 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 12 Nov 2024 22:01:04 +0100 Subject: [PATCH 096/487] Add support for C loader packages. --- .gitignore | 9 +- source/loaders/c_loader/CMakeLists.txt | 9 + .../loaders/c_loader/source/c_loader_impl.cpp | 491 ++++++++++++------ .../ext_loader/source/ext_loader_impl.cpp | 10 +- source/scripts/c/libloadtest/CMakeLists.txt | 34 +- .../c/libloadtest/source/libloadtest.cpp | 9 - .../c/libloadtest/source/libloadtest.ld | 1 - .../scripts/c/libloadtest/source/loadtest.cpp | 9 + .../source/{libloadtest.h => loadtest.h} | 8 + source/tests/CMakeLists.txt | 2 +- .../tests/metacall_c_lib_test/CMakeLists.txt | 1 + .../source/metacall_c_lib_test.cpp | 9 +- 12 files changed, 403 insertions(+), 189 deletions(-) delete mode 100644 source/scripts/c/libloadtest/source/libloadtest.cpp delete mode 100644 source/scripts/c/libloadtest/source/libloadtest.ld create mode 100644 source/scripts/c/libloadtest/source/loadtest.cpp rename source/scripts/c/libloadtest/source/{libloadtest.h => loadtest.h} (78%) diff --git a/.gitignore b/.gitignore index ed4bec293..f462998c4 100644 --- a/.gitignore +++ b/.gitignore @@ -47,18 +47,21 @@ _open-project.bat _start-cmake-gui.bat _start-cmd.bat +# macOS files +.DS_Store + # Local config unix .localconfig # Visual Studio Code .vscode +# Clang files +.cache + # Linked dockerignore file in main context .dockerignore !tools/deps/.dockerignore !tools/dev/.dockerignore !tools/runtime/.dockerignore !tools/cli/.dockerignore - -# macOS files -.DS_Store diff --git a/source/loaders/c_loader/CMakeLists.txt b/source/loaders/c_loader/CMakeLists.txt index e7a97d488..cc2c09210 100644 --- a/source/loaders/c_loader/CMakeLists.txt +++ b/source/loaders/c_loader/CMakeLists.txt @@ -190,6 +190,15 @@ target_compile_options(${target} INTERFACE ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 # Required for filesystem +) + # # Linker options # diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index f9a7b1775..76842034d 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -31,13 +31,27 @@ #include #include +#include + #include #include -#include +#if defined __has_include + #if __has_include() + #include +namespace fs = std::filesystem; + #elif __has_include() + #include +namespace fs = std::experimental::filesystem; + #else + #error "Missing the header." + #endif +#else + #error "C++ standard too old for compiling this file." +#endif + #include -#include #include #include @@ -60,16 +74,280 @@ typedef struct loader_impl_c_type } * loader_impl_c; -typedef struct loader_impl_c_handle_type +typedef struct loader_impl_c_handle_base_type { - TCCState *state; +public: std::vector files; + + virtual ~loader_impl_c_handle_base_type() {} + + virtual int discover(loader_impl impl, context ctx) = 0; + + virtual const void *symbol(std::string &name) = 0; + + void add(const loader_path path, size_t size) + { + if (this->is_ld_script(path, size) == false) + { + std::string filename(path, size); + + this->files.push_back(filename); + } + } + +private: + bool is_ld_script(const loader_path path, size_t size) + { + static const char extension[] = ".ld"; + + if (size > sizeof(extension)) + { + for (size_t ext_it = 0, path_it = size - sizeof(extension); path_it < size - 1; ++ext_it, ++path_it) + { + if (path[path_it] != extension[ext_it]) + { + return false; + } + } + } + + return true; + } + +} * loader_impl_c_handle_base; + +static void c_loader_impl_discover_symbols(void *ctx, const char *name, const void *addr); +static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_base c_handle, context ctx); + +typedef struct loader_impl_c_handle_tcc_type : loader_impl_c_handle_base_type +{ +public: + TCCState *state; std::map symbols; -} * loader_impl_c_handle; + loader_impl_c_handle_tcc_type() : + state(NULL) {} + + virtual ~loader_impl_c_handle_tcc_type() + { + if (this->state != NULL) + { + tcc_delete(this->state); + } + } + + bool initialize(loader_impl_c c_impl) + { + this->state = tcc_new(); + + if (this->state == NULL) + { + return false; + } + + /* JIT the code into memory */ + tcc_set_output_type(this->state, TCC_OUTPUT_MEMORY); + + /* Register runtime path for TCC (in order to find libtcc1.a and runtime objects) */ + if (!c_impl->libtcc_runtime_path.empty()) + { + tcc_set_lib_path(this->state, c_impl->libtcc_runtime_path.c_str()); + } + + /* Register execution paths */ + for (auto exec_path : c_impl->execution_paths) + { + tcc_add_include_path(this->state, exec_path.c_str()); + tcc_add_library_path(this->state, exec_path.c_str()); + } + + /* TODO */ + /* + #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) + tcc_enable_debug(this->state); + #endif + */ + + /* TODO: Add error handling */ + /* tcc_set_error_func */ + + /* TODO: Add some warnings? */ + /* tcc_set_warning */ + + /* tcc_add_include_path, tcc_add_library_path */ + const char *loader_lib_path = loader_library_path(); + const char *include_dir = "../include"; + char join_path[PORTABILITY_PATH_SIZE]; + char metacall_include_path[PORTABILITY_PATH_SIZE]; + + size_t join_path_size = portability_path_join(loader_lib_path, strlen(loader_lib_path) + 1, include_dir, strlen(include_dir) + 1, join_path, PORTABILITY_PATH_SIZE); + (void)portability_path_canonical(join_path, join_path_size, metacall_include_path, PORTABILITY_PATH_SIZE); + + /* Add metacall include path */ + tcc_add_include_path(this->state, metacall_include_path); + + /* Add metacall library path (in other to find metacall library) */ + if (!c_impl->libtcc_runtime_path.empty()) + { + tcc_add_library_path(this->state, c_impl->libtcc_runtime_path.c_str()); + } + + return true; + } + + virtual int discover(loader_impl impl, context ctx) + { + /* Get all symbols */ + tcc_list_symbols(this->state, static_cast(this), &c_loader_impl_discover_symbols); + + /* Parse the AST and register functions */ + return c_loader_impl_discover_ast(impl, this, ctx); + } + + virtual const void *symbol(std::string &name) + { + if (this->symbols.count(name) == 0) + { + return NULL; + } + + return this->symbols[name]; + } + +} * loader_impl_c_handle_tcc; + +typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_type +{ +public: + dynlink lib; + + loader_impl_c_handle_dynlink_type() : + lib(NULL) {} + + virtual ~loader_impl_c_handle_dynlink_type() + { + if (lib != NULL) + { + dynlink_unload(this->lib); + } + } + + bool initialize(loader_impl_c c_impl, const loader_path path) + { + std::string lib_path_str(path); + fs::path lib_path(lib_path_str); + + if (lib_path.is_absolute()) + { + fs::path lib_dir = lib_path.parent_path(); + std::string lib_name = fs::path(lib_path).filename().string(); + + this->load_dynlink(lib_dir, lib_name.c_str()); + + if (this->lib != NULL) + { + return this->add_header(lib_dir, lib_name); + } + } + else + { + for (auto exec_path : c_impl->execution_paths) + { + fs::path absolute_path(exec_path); + + absolute_path /= lib_path.parent_path(); + + std::string lib_name = lib_path.filename().string(); + + this->load_dynlink(absolute_path.c_str(), lib_name.c_str()); + + if (this->lib != NULL) + { + return this->add_header(absolute_path, lib_name); + } + } + } + + return false; + } + + virtual const void *symbol(std::string &name) + { + dynlink_symbol_addr symbol_address = NULL; + + if (dynlink_symbol(this->lib, name.c_str(), &symbol_address) != 0) + { + return NULL; + } + + return (const void *)(symbol_address); + } + +private: + void load_dynlink(fs::path path, const char *library_name) + { + /* This function will try to check if the library exists before loading it, + so we avoid error messages from dynlink when guessing the file path for relative load from file */ + dynlink_name_impl platform_name; + + dynlink_platform_name(library_name, platform_name); + + fs::path lib_path(path); + + lib_path /= platform_name; + + if (fs::exists(lib_path) == true) + { + this->lib = dynlink_load(path.string().c_str(), library_name, DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); + } + } + + bool add_header(fs::path path, std::string &lib_name) + { + static const char *extensions[] = { + ".h", + ".hh", + ".H", + ".hpp", + ".h++", + ".hxx", + "" /* No extension is also valid */ + }; + + path /= lib_name; + + for (auto extension : extensions) + { + fs::path header(path); + + header += extension; + + if (fs::exists(header)) + { + std::string header_str = header.string(); + + this->add(header_str.c_str(), header_str.length() + 1); + + return true; + } + } + + return false; + } + + virtual int discover(loader_impl impl, context ctx) + { + /* Parse the AST and register functions */ + return c_loader_impl_discover_ast(impl, this, ctx); + } + +} * loader_impl_c_handle_dynlink; typedef struct loader_impl_c_function_type { + loader_impl_c_function_type(const void *address) : + ret_type(NULL), arg_types(NULL), values(NULL), address(address) {} + ffi_cif cif; ffi_type *ret_type; ffi_type **arg_types; @@ -81,7 +359,7 @@ typedef struct loader_impl_c_function_type typedef struct c_loader_impl_discover_visitor_data_type { loader_impl impl; - loader_impl_c_handle c_handle; + loader_impl_c_handle_base c_handle; scope sp; int result; @@ -283,77 +561,11 @@ void c_loader_impl_function_closure(ffi_cif *cif, void *ret, void *args[], void delete[] values; } -static loader_impl_c_handle c_loader_impl_handle_create(loader_impl_c c_impl) +static void c_loader_impl_discover_symbols(void *ctx, const char *name, const void *addr) { - loader_impl_c_handle c_handle = new loader_impl_c_handle_type(); - - if (c_handle == nullptr) - { - return nullptr; - } - - c_handle->state = tcc_new(); - - if (c_handle->state == NULL) - { - delete c_handle; - return nullptr; - } - - /* JIT the code into memory */ - tcc_set_output_type(c_handle->state, TCC_OUTPUT_MEMORY); - - /* Register runtime path for TCC (in order to find libtcc1.a and runtime objects) */ - if (!c_impl->libtcc_runtime_path.empty()) - { - tcc_set_lib_path(c_handle->state, c_impl->libtcc_runtime_path.c_str()); - } - - /* Register execution paths */ - for (auto exec_path : c_impl->execution_paths) - { - tcc_add_include_path(c_handle->state, exec_path.c_str()); - tcc_add_library_path(c_handle->state, exec_path.c_str()); - } - - /* TODO */ - /* - #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - tcc_enable_debug(c_handle->state); - #endif - */ - - /* TODO: Add error handling */ - /* tcc_set_error_func */ - - /* TODO: Add some warnings? */ - /* tcc_set_warning */ - - /* tcc_add_include_path, tcc_add_library_path */ - const char *loader_lib_path = loader_library_path(); - const char *include_dir = "../include"; - char join_path[PORTABILITY_PATH_SIZE]; - char metacall_incl_path[PORTABILITY_PATH_SIZE]; - - size_t join_path_size = portability_path_join(loader_lib_path, strlen(loader_lib_path) + 1, include_dir, strlen(include_dir) + 1, join_path, PORTABILITY_PATH_SIZE); - (void)portability_path_canonical(join_path, join_path_size, metacall_incl_path, PORTABILITY_PATH_SIZE); - - /* Add metacall include path */ - tcc_add_include_path(c_handle->state, metacall_incl_path); - - /* Add metacall library path (in other to find metacall library) */ - if (!c_impl->libtcc_runtime_path.empty()) - { - tcc_add_library_path(c_handle->state, c_impl->libtcc_runtime_path.c_str()); - } + loader_impl_c_handle_tcc c_handle = static_cast(ctx); - return c_handle; -} - -static void c_loader_impl_handle_destroy(loader_impl_c_handle c_handle) -{ - tcc_delete(c_handle->state); - delete c_handle; + c_handle->symbols.insert(std::pair(name, addr)); } static bool c_loader_impl_file_exists(const loader_path path) @@ -749,7 +961,7 @@ type c_loader_impl_discover_type(loader_impl impl, CXCursor &cursor, CXType &cx_ return t; } -static int c_loader_impl_discover_signature(loader_impl impl, loader_impl_c_handle c_handle, scope sp, CXCursor cursor) +static int c_loader_impl_discover_signature(loader_impl impl, loader_impl_c_handle_base c_handle, scope sp, CXCursor cursor) { auto cursor_type = clang_getCursorType(cursor); auto func_name = c_loader_impl_cxstring_to_str(clang_getCursorSpelling(cursor)); @@ -759,15 +971,15 @@ static int c_loader_impl_discover_signature(loader_impl impl, loader_impl_c_hand symbol_name.insert(0, 1, '_'); #endif - if (c_handle->symbols.count(symbol_name) == 0) + const void *address = c_handle->symbol(symbol_name); + + if (address == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Symbol '%s' not found, skipping the function", func_name.c_str()); return 1; } - loader_impl_c_function c_function = new loader_impl_c_function_type(); - - c_function->address = c_handle->symbols[symbol_name]; + loader_impl_c_function c_function = new loader_impl_c_function_type(address); int num_args = clang_Cursor_getNumArguments(cursor); size_t args_size = num_args < 0 ? (size_t)0 : (size_t)num_args; @@ -837,7 +1049,7 @@ static CXChildVisitResult c_loader_impl_discover_visitor(CXCursor cursor, CXCurs return CXChildVisit_Continue; } -static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle c_handle, context ctx) +static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_base c_handle, context ctx) { c_loader_impl_discover_visitor_data_type data = { impl, @@ -871,42 +1083,14 @@ static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle c_h return data.result; } -static bool c_loader_impl_is_ld_script(const loader_path path, size_t size) -{ - static const char extension[] = ".ld"; - - if (size > sizeof(extension)) - { - for (size_t ext_it = 0, path_it = size - sizeof(extension); path_it < size - 1; ++ext_it, ++path_it) - { - if (path[path_it] != extension[ext_it]) - { - return false; - } - } - } - - return true; -} - -static void c_loader_impl_handle_add(loader_impl_c_handle c_handle, const loader_path path, size_t size) -{ - if (c_loader_impl_is_ld_script(path, size) == false) - { - std::string filename(path, size); - - c_handle->files.push_back(filename); - } -} - loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path paths[], size_t size) { loader_impl_c c_impl = static_cast(loader_impl_get(impl)); - loader_impl_c_handle c_handle = c_loader_impl_handle_create(c_impl); + loader_impl_c_handle_tcc c_handle = new loader_impl_c_handle_tcc_type(); - if (c_handle == nullptr) + if (c_handle->initialize(c_impl) == false) { - return NULL; + goto error; } for (size_t iterator = 0; iterator < size; ++iterator) @@ -919,11 +1103,10 @@ loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path p if (tcc_add_file(c_handle->state, paths[iterator]) == -1) { log_write("metacall", LOG_LEVEL_ERROR, "Failed to load file: %s", paths[iterator]); - c_loader_impl_handle_destroy(c_handle); - return NULL; + goto error; } - c_loader_impl_handle_add(c_handle, paths[iterator], path_size); + c_handle->add(paths[iterator], path_size); } else { @@ -935,19 +1118,21 @@ loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path p loader_path path; size_t path_size = portability_path_join(exec_path.c_str(), exec_path.length() + 1, paths[iterator], strnlen(paths[iterator], LOADER_PATH_SIZE) + 1, path, LOADER_PATH_SIZE); - if (c_loader_impl_file_exists(path) == true && tcc_add_file(c_handle->state, path) != -1) + if (c_loader_impl_file_exists(path) == true) { - c_loader_impl_handle_add(c_handle, path, path_size); - found = true; - break; + if (tcc_add_file(c_handle->state, path) != -1) + { + c_handle->add(path, path_size); + found = true; + break; + } } } if (found == false) { log_write("metacall", LOG_LEVEL_ERROR, "Failed to load file: %s", paths[iterator]); - c_loader_impl_handle_destroy(c_handle); - return NULL; + goto error; } } } @@ -955,99 +1140,85 @@ loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path p if (tcc_relocate(c_handle->state, TCC_RELOCATE_AUTO) == -1) { log_write("metacall", LOG_LEVEL_ERROR, "TCC failed to relocate"); - c_loader_impl_handle_destroy(c_handle); - return NULL; + goto error; } return c_handle; + +error: + delete c_handle; + return NULL; } loader_handle c_loader_impl_load_from_memory(loader_impl impl, const loader_name name, const char *buffer, size_t size) { loader_impl_c c_impl = static_cast(loader_impl_get(impl)); - loader_impl_c_handle c_handle = c_loader_impl_handle_create(c_impl); + loader_impl_c_handle_tcc c_handle = new loader_impl_c_handle_tcc_type(); /* Apparently TCC has an unsafe API for compiling strings */ (void)size; - if (c_handle == nullptr) + if (c_handle->initialize(c_impl) == false) { - return NULL; + goto error; } if (tcc_compile_string(c_handle->state, buffer) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Failed to compile the buffer: %s", name); - c_loader_impl_handle_destroy(c_handle); - return NULL; + goto error; } if (tcc_relocate(c_handle->state, TCC_RELOCATE_AUTO) == -1) { log_write("metacall", LOG_LEVEL_ERROR, "TCC failed to relocate"); - c_loader_impl_handle_destroy(c_handle); - return NULL; + goto error; } /* TODO: Load the buffer with the parser while iterating after loading it with TCC */ return c_handle; + +error: + delete c_handle; + return NULL; } loader_handle c_loader_impl_load_from_package(loader_impl impl, const loader_path path) { - /* TODO: Define what to do with this */ - /* - loader_impl_c_handle c_handle = c_loader_impl_handle_create(); + loader_impl_c c_impl = static_cast(loader_impl_get(impl)); + loader_impl_c_handle_dynlink c_handle = new loader_impl_c_handle_dynlink_type(); - if (c_handle == nullptr) + if (c_handle->initialize(c_impl, path) == false) { + delete c_handle; return NULL; } - (void)impl; - return c_handle; - */ - - (void)impl; - (void)path; - - return NULL; } int c_loader_impl_clear(loader_impl impl, loader_handle handle) { - loader_impl_c_handle c_handle = static_cast(handle); + loader_impl_c_handle_base c_handle = static_cast(handle); (void)impl; - if (c_handle != NULL) + if (c_handle == NULL) { - c_loader_impl_handle_destroy(c_handle); - - return 0; + return 1; } - return 1; -} - -static void c_loader_impl_discover_symbols(void *ctx, const char *name, const void *addr) -{ - loader_impl_c_handle c_handle = static_cast(ctx); + delete c_handle; - c_handle->symbols.insert(std::pair(name, addr)); + return 0; } int c_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx) { - loader_impl_c_handle c_handle = static_cast(handle); - - /* Get all symbols */ - tcc_list_symbols(c_handle->state, static_cast(c_handle), &c_loader_impl_discover_symbols); + loader_impl_c_handle_base c_handle = static_cast(handle); - /* Parse the AST and register functions */ - return c_loader_impl_discover_ast(impl, c_handle, ctx); + return c_handle->discover(impl, ctx); } int c_loader_impl_destroy(loader_impl impl) diff --git a/source/loaders/ext_loader/source/ext_loader_impl.cpp b/source/loaders/ext_loader/source/ext_loader_impl.cpp index 0b8f96ec8..25b8385a5 100644 --- a/source/loaders/ext_loader/source/ext_loader_impl.cpp +++ b/source/loaders/ext_loader/source/ext_loader_impl.cpp @@ -167,11 +167,11 @@ dynlink ext_loader_impl_load_from_file_dynlink(loader_impl_ext ext_impl, const l #endif fs::path lib_path(lib_path_str); - std::string lib_name = fs::path(lib_path).filename().string(); if (lib_path.is_absolute()) { fs::path lib_dir = lib_path.parent_path(); + std::string lib_name = fs::path(lib_path).filename().string(); return ext_loader_impl_load_from_file_dynlink(lib_dir.string().c_str(), lib_name.c_str()); } @@ -179,7 +179,13 @@ dynlink ext_loader_impl_load_from_file_dynlink(loader_impl_ext ext_impl, const l { for (auto exec_path : ext_impl->paths) { - dynlink lib = ext_loader_impl_load_from_file_dynlink(exec_path.string().c_str(), lib_name.c_str()); + fs::path absolute_path(exec_path); + + absolute_path /= lib_path.parent_path(); + + std::string lib_name = lib_path.filename().string(); + + dynlink lib = ext_loader_impl_load_from_file_dynlink(absolute_path.string().c_str(), lib_name.c_str()); if (lib != NULL) { diff --git a/source/scripts/c/libloadtest/CMakeLists.txt b/source/scripts/c/libloadtest/CMakeLists.txt index 9e298ecd5..8bb086779 100644 --- a/source/scripts/c/libloadtest/CMakeLists.txt +++ b/source/scripts/c/libloadtest/CMakeLists.txt @@ -2,14 +2,36 @@ # Configure C project # -c_project(libloadtest 0.1.0) - # Build the library -set(target c-libloadtest-shared) +set(target loadtest) + +c_project(${target} 0.1.0) add_library(${target} SHARED - source/libloadtest.cpp - source/libloadtest.h + source/loadtest.cpp + source/loadtest.h ) -set_property(TARGET ${target} PROPERTY CXX_STANDARD 11) +set_target_properties(${target} + PROPERTIES + CXX_STANDARD 11 + + # Define custom build output directory + LIBRARY_OUTPUT_DIRECTORY "${LOADER_SCRIPT_PATH}" + LIBRARY_OUTPUT_DIRECTORY_DEBUG "${LOADER_SCRIPT_PATH}" + LIBRARY_OUTPUT_DIRECTORY_RELEASE "${LOADER_SCRIPT_PATH}" + LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${LOADER_SCRIPT_PATH}" + LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL "${LOADER_SCRIPT_PATH}" + + RUNTIME_OUTPUT_DIRECTORY "${LOADER_SCRIPT_PATH}" + RUNTIME_OUTPUT_DIRECTORY_DEBUG "${LOADER_SCRIPT_PATH}" + RUNTIME_OUTPUT_DIRECTORY_RELEASE "${LOADER_SCRIPT_PATH}" + RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${LOADER_SCRIPT_PATH}" + RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${LOADER_SCRIPT_PATH}" + + ARCHIVE_OUTPUT_DIRECTORY "${LOADER_SCRIPT_PATH}" + ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${LOADER_SCRIPT_PATH}" + ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${LOADER_SCRIPT_PATH}" + ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${LOADER_SCRIPT_PATH}" + ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL "${LOADER_SCRIPT_PATH}" +) diff --git a/source/scripts/c/libloadtest/source/libloadtest.cpp b/source/scripts/c/libloadtest/source/libloadtest.cpp deleted file mode 100644 index e59db520d..000000000 --- a/source/scripts/c/libloadtest/source/libloadtest.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "libloadtest.h" -#include - -long call_cpp_func(void) -{ - std::vector v = { 7, 323, 16, 8 }; - - return v[1]; -} diff --git a/source/scripts/c/libloadtest/source/libloadtest.ld b/source/scripts/c/libloadtest/source/libloadtest.ld deleted file mode 100644 index 4745d78a3..000000000 --- a/source/scripts/c/libloadtest/source/libloadtest.ld +++ /dev/null @@ -1 +0,0 @@ -INPUT(-lloadtest) diff --git a/source/scripts/c/libloadtest/source/loadtest.cpp b/source/scripts/c/libloadtest/source/loadtest.cpp new file mode 100644 index 000000000..95fb3e3df --- /dev/null +++ b/source/scripts/c/libloadtest/source/loadtest.cpp @@ -0,0 +1,9 @@ +#include "loadtest.h" +#include + +long call_cpp_func(void) +{ + std::vector v = { 7, 323, 14, 8 }; + + return v[1]; +} diff --git a/source/scripts/c/libloadtest/source/libloadtest.h b/source/scripts/c/libloadtest/source/loadtest.h similarity index 78% rename from source/scripts/c/libloadtest/source/libloadtest.h rename to source/scripts/c/libloadtest/source/loadtest.h index 66ce2c65e..1434c2d59 100644 --- a/source/scripts/c/libloadtest/source/libloadtest.h +++ b/source/scripts/c/libloadtest/source/loadtest.h @@ -7,6 +7,14 @@ #define EXPORT __attribute__((visibility("default"))) #endif +#ifdef __cplusplus +extern "C" { +#endif + EXPORT long call_cpp_func(void); +#ifdef __cplusplus +} +#endif + #endif /* LIB_LOAD_TEST_H */ diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index 09cac815e..514cae104 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -253,7 +253,7 @@ add_subdirectory(metacall_rust_load_from_package_dep_test) add_subdirectory(metacall_rust_load_from_package_class_test) add_subdirectory(metacall_rust_class_test) add_subdirectory(metacall_c_test) -#add_subdirectory(metacall_c_lib_test) # TODO: TCC cannot list the symbols from the external libraries, neither static or shared +add_subdirectory(metacall_c_lib_test) add_subdirectory(metacall_version_test) add_subdirectory(metacall_dynlink_path_test) add_subdirectory(metacall_library_path_without_env_vars_test) diff --git a/source/tests/metacall_c_lib_test/CMakeLists.txt b/source/tests/metacall_c_lib_test/CMakeLists.txt index 218c61a20..60b3157a2 100644 --- a/source/tests/metacall_c_lib_test/CMakeLists.txt +++ b/source/tests/metacall_c_lib_test/CMakeLists.txt @@ -129,6 +129,7 @@ add_test(NAME ${target} add_dependencies(${target} c_loader + loadtest ) # diff --git a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp index bd658b3d8..01bfc4097 100644 --- a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp +++ b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp @@ -31,12 +31,7 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) { ASSERT_EQ((int)0, (int)metacall_initialize()); - const char *c_dep_scripts[] = { - "libloadtest.h", - "libloadtest.ld" - }; - - EXPECT_EQ((int)0, (int)metacall_load_from_file("c", c_dep_scripts, sizeof(c_dep_scripts) / sizeof(c_dep_scripts[0]), NULL)); + ASSERT_EQ((int)0, (int)metacall_load_from_package("c", "loadtest", NULL)); void *ret = metacall("call_cpp_func"); @@ -44,7 +39,7 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_LONG); - EXPECT_NE((long)metacall_value_to_long(ret), (long)323); + EXPECT_EQ((long)metacall_value_to_long(ret), (long)323); metacall_value_destroy(ret); From 6cc27dcd98a2424df6f2ca97643f9ce3a020c9e6 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Wed, 13 Nov 2024 20:32:48 +0100 Subject: [PATCH 097/487] Extended type support for c_loader, improve search of headers and libraries for c_loader, assuming now they are not in the same folder, add test with support for pointers to pointers in c_loader. --- .../loaders/c_loader/source/c_loader_impl.cpp | 59 +++++++++++++++++-- source/scripts/c/CMakeLists.txt | 2 +- .../scripts/c/libloadtest/source/loadtest.cpp | 9 --- .../{libloadtest => loadtest}/CMakeLists.txt | 0 source/scripts/c/loadtest/source/loadtest.cpp | 39 ++++++++++++ .../source/loadtest.h | 20 +++++++ .../source/metacall_c_lib_test.cpp | 50 ++++++++++++++++ 7 files changed, 165 insertions(+), 14 deletions(-) delete mode 100644 source/scripts/c/libloadtest/source/loadtest.cpp rename source/scripts/c/{libloadtest => loadtest}/CMakeLists.txt (100%) create mode 100644 source/scripts/c/loadtest/source/loadtest.cpp rename source/scripts/c/{libloadtest => loadtest}/source/loadtest.h (54%) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index 76842034d..d361c90c6 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -244,6 +244,7 @@ typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_typ this->load_dynlink(lib_dir, lib_name.c_str()); + /* If the path is absolute, we assume the header is in the same folder */ if (this->lib != NULL) { return this->add_header(lib_dir, lib_name); @@ -251,6 +252,8 @@ typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_typ } else { + bool header_found = false; + for (auto exec_path : c_impl->execution_paths) { fs::path absolute_path(exec_path); @@ -259,11 +262,23 @@ typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_typ std::string lib_name = lib_path.filename().string(); - this->load_dynlink(absolute_path.c_str(), lib_name.c_str()); + /* If the path is relative, we keep trying the exec_paths until we find the header, + * this is for solving situations where we have the header in /usr/local/include and + * the library in /usr/local/lib + */ + if (this->lib == NULL) + { + this->load_dynlink(absolute_path, lib_name.c_str()); + } + + if (header_found == false) + { + header_found = this->add_header(absolute_path, lib_name); + } - if (this->lib != NULL) + if (this->lib != NULL && header_found == true) { - return this->add_header(absolute_path, lib_name); + return true; } } } @@ -284,7 +299,7 @@ typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_typ } private: - void load_dynlink(fs::path path, const char *library_name) + void load_dynlink(fs::path &path, const char *library_name) { /* This function will try to check if the library exists before loading it, so we avoid error messages from dynlink when guessing the file path for relative load from file */ @@ -771,12 +786,46 @@ int c_loader_impl_initialize_types(loader_impl impl) const char *name; } type_id_name_pair[] = { { TYPE_BOOL, "bool" }, + { TYPE_CHAR, "char" }, + { TYPE_CHAR, "int8_t" }, + { TYPE_CHAR, "uint8_t" }, + { TYPE_CHAR, "int_least8_t" }, + { TYPE_CHAR, "uint_least8_t" }, + { TYPE_CHAR, "int_fast8_t" }, + { TYPE_CHAR, "uint_fast8_t" }, + { TYPE_SHORT, "short" }, + { TYPE_SHORT, "int16_t" }, + { TYPE_SHORT, "uint16_t" }, + { TYPE_SHORT, "int_least16_t" }, + { TYPE_SHORT, "uint_least16_t" }, + { TYPE_SHORT, "int_fast16_t" }, + { TYPE_SHORT, "uint_fast16_t" }, + { TYPE_INT, "int" }, + { TYPE_INT, "uint32_t" }, + { TYPE_INT, "int32_t" }, + { TYPE_INT, "int_least32_t" }, + { TYPE_INT, "uint_least32_t" }, + { TYPE_INT, "int_fast32_t" }, + { TYPE_INT, "uint_fast32_t" }, + { TYPE_LONG, "long" }, + { TYPE_LONG, "long long" }, + { TYPE_LONG, "uint64_t" }, + { TYPE_LONG, "int64_t" }, + { TYPE_LONG, "int_least64_t" }, + { TYPE_LONG, "uint_least64_t" }, + { TYPE_LONG, "int_fast64_t" }, + { TYPE_LONG, "uint_fast64_t" }, + { TYPE_LONG, "ptrdiff_t" }, + { TYPE_LONG, "intptr_t" }, + { TYPE_LONG, "uintptr_t" }, + { TYPE_FLOAT, "float" }, { TYPE_DOUBLE, "double" }, + { TYPE_INVALID, "void" } /* TODO: Do more types (and the unsigned versions too?) */ @@ -838,6 +887,8 @@ int c_loader_impl_execution_path(loader_impl impl, const loader_path path) { loader_impl_c c_impl = static_cast(loader_impl_get(impl)); + /* TODO: It would be interesting to support LD_LIBRARY_PATH or DYLD_LIBRARY_PATH + * on startup for supporting standard execution paths */ c_impl->execution_paths.push_back(path); return 0; diff --git a/source/scripts/c/CMakeLists.txt b/source/scripts/c/CMakeLists.txt index c395301ef..28cac118f 100644 --- a/source/scripts/c/CMakeLists.txt +++ b/source/scripts/c/CMakeLists.txt @@ -16,4 +16,4 @@ include(CProject) add_subdirectory(compiled) add_subdirectory(ffi) add_subdirectory(cbks) -add_subdirectory(libloadtest) +add_subdirectory(loadtest) diff --git a/source/scripts/c/libloadtest/source/loadtest.cpp b/source/scripts/c/libloadtest/source/loadtest.cpp deleted file mode 100644 index 95fb3e3df..000000000 --- a/source/scripts/c/libloadtest/source/loadtest.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "loadtest.h" -#include - -long call_cpp_func(void) -{ - std::vector v = { 7, 323, 14, 8 }; - - return v[1]; -} diff --git a/source/scripts/c/libloadtest/CMakeLists.txt b/source/scripts/c/loadtest/CMakeLists.txt similarity index 100% rename from source/scripts/c/libloadtest/CMakeLists.txt rename to source/scripts/c/loadtest/CMakeLists.txt diff --git a/source/scripts/c/loadtest/source/loadtest.cpp b/source/scripts/c/loadtest/source/loadtest.cpp new file mode 100644 index 000000000..537175040 --- /dev/null +++ b/source/scripts/c/loadtest/source/loadtest.cpp @@ -0,0 +1,39 @@ +#include "loadtest.h" +#include +#include + +long call_cpp_func(void) +{ + std::vector v = { 7, 323, 14, 8 }; + + return v[1]; +} + +int pair_list_init(pair_list **t) +{ + static const uint32_t size = 3; + + *t = new pair_list(); + + (*t)->size = size; + (*t)->pairs = new pair[(*t)->size]; + + for (uint32_t i = 0; i < size; ++i) + { + (*t)->pairs[i].i = i; + (*t)->pairs[i].d = (double)(((double)i) * 1.0); + } + + return 0; +} + +double pair_list_value(pair_list *t, uint32_t id) +{ + return t->pairs[id].d; +} + +void pair_list_destroy(pair_list *t) +{ + delete[] t->pairs; + delete t; +} diff --git a/source/scripts/c/libloadtest/source/loadtest.h b/source/scripts/c/loadtest/source/loadtest.h similarity index 54% rename from source/scripts/c/libloadtest/source/loadtest.h rename to source/scripts/c/loadtest/source/loadtest.h index 1434c2d59..85b8b28b7 100644 --- a/source/scripts/c/libloadtest/source/loadtest.h +++ b/source/scripts/c/loadtest/source/loadtest.h @@ -11,8 +11,28 @@ extern "C" { #endif +#include + +typedef struct +{ + uint32_t i; + double d; +} pair; + +typedef struct +{ + uint32_t size; + pair *pairs; +} pair_list; + EXPORT long call_cpp_func(void); +EXPORT int pair_list_init(pair_list **t); + +EXPORT double pair_list_value(pair_list *t, uint32_t id); + +EXPORT void pair_list_destroy(pair_list *t); + #ifdef __cplusplus } #endif diff --git a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp index 01bfc4097..87fb6c75d 100644 --- a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp +++ b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp @@ -43,5 +43,55 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) metacall_value_destroy(ret); + void *pair_list = NULL; + + void *args_init[] = { + metacall_value_create_ptr(&pair_list), + }; + + ret = metacallv("pair_list_init", args_init); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_INT); + + EXPECT_EQ((int)metacall_value_to_int(ret), (int)0); + + metacall_value_destroy(ret); + + metacall_value_destroy(args_init[0]); + + void *args_value[] = { + metacall_value_create_ptr(pair_list), + metacall_value_create_int(2) + }; + + ret = metacallv("pair_list_value", args_value); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_DOUBLE); + + EXPECT_EQ((double)metacall_value_to_double(ret), (double)2.0); + + metacall_value_destroy(ret); + + metacall_value_destroy(args_value[0]); + metacall_value_destroy(args_value[1]); + + void *args_destroy[] = { + metacall_value_create_ptr(pair_list), + }; + + ret = metacallv("pair_list_destroy", args_destroy); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_INVALID); + + metacall_value_destroy(ret); + + metacall_value_destroy(args_destroy[0]); + EXPECT_EQ((int)0, (int)metacall_destroy()); } From 7f51e0ab9eb0570fad4dd90a798b9fd79d52e7a4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 15 Nov 2024 01:03:14 +0100 Subject: [PATCH 098/487] Solve bug in c loader, improved python port add reference and dereference APIs in reflect. --- .../loaders/c_loader/source/c_loader_impl.cpp | 6 +- .../include/py_loader/py_loader_impl.h | 2 + .../loaders/py_loader/source/py_loader_impl.c | 40 ++-- .../loaders/py_loader/source/py_loader_port.c | 186 ++++++++++++++++++ .../include/metacall/metacall_value.h | 42 ++++ source/metacall/source/metacall_value.c | 10 + source/ports/py_port/metacall/__init__.py | 2 +- source/ports/py_port/metacall/api.py | 15 ++ .../reflect/include/reflect/reflect_value.h | 12 ++ .../include/reflect/reflect_value_type.h | 42 ++++ source/reflect/source/reflect_value.c | 18 ++ source/reflect/source/reflect_value_type.c | 14 ++ source/scripts/c/loadtest/source/loadtest.cpp | 5 + source/scripts/c/loadtest/source/loadtest.h | 2 + .../python/pointer/source/pointer.py.in | 15 ++ .../source/metacall_python_pointer_test.cpp | 31 +++ .../CMakeLists.txt | 152 ++++++++++++++ .../source/main.cpp | 28 +++ .../metacall_python_port_pointer_test.cpp | 109 ++++++++++ 19 files changed, 712 insertions(+), 19 deletions(-) create mode 100644 source/tests/metacall_python_port_pointer_test/CMakeLists.txt create mode 100644 source/tests/metacall_python_port_pointer_test/source/main.cpp create mode 100644 source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index d361c90c6..97db3fcc6 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -826,9 +826,9 @@ int c_loader_impl_initialize_types(loader_impl impl) { TYPE_FLOAT, "float" }, { TYPE_DOUBLE, "double" }, - { TYPE_INVALID, "void" } + { TYPE_NULL, "void" } - /* TODO: Do more types (and the unsigned versions too?) */ + /* TODO: Do more types */ }; size_t size = sizeof(type_id_name_pair) / sizeof(type_id_name_pair[0]); @@ -956,7 +956,7 @@ static type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXTyp return TYPE_INT; case CXType_Void: - return TYPE_INVALID; + return TYPE_NULL; case CXType_Enum: { CXCursor referenced = clang_isReference(cursor.kind) ? clang_getCursorReferenced(cursor) : cursor; diff --git a/source/loaders/py_loader/include/py_loader/py_loader_impl.h b/source/loaders/py_loader/include/py_loader/py_loader_impl.h index 7ec76f33a..efa286a6e 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_impl.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_impl.h @@ -60,6 +60,8 @@ PY_LOADER_NO_EXPORT PyObject *py_loader_impl_value_to_capi(loader_impl impl, typ PY_LOADER_NO_EXPORT int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v); +PY_LOADER_NO_EXPORT PyObject *py_loader_impl_capsule_new_null(void); + #ifdef __cplusplus } #endif diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 556ba0aa8..66be1c0b9 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -221,6 +221,9 @@ static char *py_loader_impl_main_module = NULL; /* Holds reference to the original PyCFunction.tp_dealloc method */ static void (*py_loader_impl_pycfunction_dealloc)(PyObject *) = NULL; +/* Implements PyCapsules with null value internally */ +static const char py_loader_capsule_null_id[] = "__metacall_capsule_null__"; + PyObject *py_loader_impl_finalizer_object_impl(PyObject *self, PyObject *Py_UNUSED(args)) { value v = PyCapsule_GetPointer(self, NULL); @@ -273,6 +276,14 @@ int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v) return 0; } +PyObject *py_loader_impl_capsule_new_null(void) +{ + /* We want to create a new capsule with contents set to NULL, but PyCapsule + * does not allow that, instead we are going to identify our NULL capsule with + * this configuration (setting the capsule to Py_None) */ + return PyCapsule_New(Py_None, py_loader_capsule_null_id, NULL); +} + void py_loader_impl_value_invoke_state_finalize(value v, void *data) { PyObject *capsule = (PyObject *)data; @@ -1142,17 +1153,17 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) } else if (id == TYPE_PTR) { - void *ptr = NULL; - -#if PY_MAJOR_VERSION == 2 + const char *name = PyCapsule_GetName(obj); + void *ptr = PyCapsule_GetPointer(obj, name); - /* TODO */ - -#elif PY_MAJOR_VERSION == 3 - ptr = PyCapsule_GetPointer(obj, NULL); - - v = value_create_ptr(ptr); -#endif + if (ptr == Py_None && name == py_loader_capsule_null_id) + { + v = value_create_ptr(NULL); + } + else + { + v = value_create_ptr(ptr); + } } else if (id == TYPE_FUNCTION) { @@ -1440,13 +1451,12 @@ PyObject *py_loader_impl_value_to_capi(loader_impl impl, type_id id, value v) { void *ptr = value_to_ptr(v); -#if PY_MAJOR_VERSION == 2 - - /* TODO */ + if (ptr == NULL) + { + return py_loader_impl_capsule_new_null(); + } -#elif PY_MAJOR_VERSION == 3 return PyCapsule_New(ptr, NULL, NULL); -#endif } else if (id == TYPE_FUTURE) { diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index 136635c31..a9cb3aa41 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -493,6 +493,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) /* Obtain Python loader implementation */ impl = loader_get_impl(py_loader_tag); + /* TODO: Remove this check when we implement this: https://github.com/metacall/core/issues/231 */ if (impl == NULL) { PyErr_SetString(PyExc_ValueError, "Invalid Python loader instance, MetaCall Port must be used from MetaCall CLI"); @@ -622,6 +623,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) /* Obtain Python loader implementation */ impl = loader_get_impl(py_loader_tag); + /* TODO: Remove this check when we implement this: https://github.com/metacall/core/issues/231 */ if (impl == NULL) { PyErr_SetString(PyExc_ValueError, "Invalid Python loader instance, MetaCall Port must be used from MetaCall CLI"); @@ -778,6 +780,184 @@ static PyObject *py_loader_port_inspect(PyObject *self, PyObject *args) return result; } +static PyObject *py_loader_port_value_create_ptr(PyObject *self, PyObject *args) +{ + static const char format[] = "O:metacall_value_create_ptr"; + PyObject *pointer; + + (void)self; + + /* Parse arguments */ + if (!PyArg_ParseTuple(args, (char *)format, &pointer)) + { + PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_value_create_ptr(None); or metacall_value_create_ptr(previous_allocated_ptr);"); + return py_loader_port_none(); + } + + if (!PyCapsule_CheckExact(pointer) && pointer != Py_None) + { + PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument must be None or a PyCapsule (i.e a previously allocated pointer)"); + return py_loader_port_none(); + } + + if (pointer == Py_None) + { + return py_loader_impl_capsule_new_null(); + } + else + { + /* Get capsule pointer */ + const char *name = PyCapsule_GetName(pointer); + void *pointer_addr = PyCapsule_GetPointer(pointer, name); + + /* Return a copy of the capsule */ + return PyCapsule_New(pointer_addr, name, NULL); + } +} + +static const char py_loader_capsule_reference_id[] = "__metacall_capsule_reference__"; + +static void py_loader_port_value_reference_destroy(PyObject *capsule) +{ + void *ref = PyCapsule_GetPointer(capsule, py_loader_capsule_reference_id); + void *v = PyCapsule_GetContext(capsule); + + metacall_value_destroy(ref); + metacall_value_destroy(v); +} + +static PyObject *py_loader_port_value_reference(PyObject *self, PyObject *args) +{ + static const char format[] = "O:metacall_value_reference"; + PyObject *obj; + loader_impl impl; + void *v, *ref; + PyObject *capsule; + + (void)self; + + /* Parse arguments */ + if (!PyArg_ParseTuple(args, (char *)format, &obj)) + { + PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_value_reference(obj);"); + goto error_none; + } + + /* Obtain Python loader implementation */ + impl = loader_get_impl(py_loader_tag); + + /* TODO: When using the port outside MetaCall this is going to segfault for functions and similar + * structures that require py loader internal structure to be initialized. For those cases, we + * must implement this: https://github.com/metacall/core/issues/231 + */ + v = py_loader_impl_capi_to_value(impl, obj, py_loader_impl_capi_to_value_type(impl, obj)); + + if (v == NULL) + { + PyErr_SetString(PyExc_ValueError, "Failed to convert the Python object to MetaCall value."); + goto error_none; + } + + ref = metacall_value_reference(v); + + if (ref == NULL) + { + PyErr_SetString(PyExc_ValueError, "Failed to create the reference from MetaCall value."); + goto error_value; + } + + capsule = PyCapsule_New(ref, py_loader_capsule_reference_id, &py_loader_port_value_reference_destroy); + + if (capsule == NULL) + { + goto error_ref; + } + + if (PyCapsule_SetContext(capsule, v) != 0) + { + goto error_ref; + } + + return capsule; + +error_ref: + metacall_value_destroy(ref); +error_value: + metacall_value_destroy(v); +error_none: + return py_loader_port_none(); +} + +static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args) +{ + static const char format[] = "O:metacall_value_dereference"; + PyObject *capsule; + const char *name = NULL; + void *ref, *v; + loader_impl impl; + PyObject *result; + + (void)self; + + /* Parse arguments */ + if (!PyArg_ParseTuple(args, (char *)format, &capsule)) + { + PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_value_dereference(ptr);"); + return py_loader_port_none(); + } + + /* Check if it is a valid reference */ + if (!PyCapsule_CheckExact(capsule)) + { + PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument must be a PyCapsule (i.e a previously allocated pointer)"); + return py_loader_port_none(); + } + + /* Check if it is a valid MetaCall reference */ + name = PyCapsule_GetName(capsule); + + if (name != py_loader_capsule_reference_id) + { + PyErr_SetString(PyExc_TypeError, "Invalid reference, argument must be a PyCapsule from MetaCall"); + return py_loader_port_none(); + } + + /* Get the reference */ + ref = PyCapsule_GetPointer(capsule, name); + + if (ref == NULL) + { + return py_loader_port_none(); + } + + /* Get the value */ + v = metacall_value_dereference(ref); + + /* Validate the result */ + if (v != PyCapsule_GetContext(capsule)) + { + PyErr_SetString(PyExc_TypeError, "Invalid reference, the PyCapsule context does not match the dereferenced value"); + return py_loader_port_none(); + } + + /* Obtain Python loader implementation */ + impl = loader_get_impl(py_loader_tag); + + /* TODO: When using the port outside MetaCall this is going to segfault for functions and similar + * structures that require py loader internal structure to be initialized. For those cases, we + * must implement this: https://github.com/metacall/core/issues/231 + */ + result = py_loader_impl_value_to_capi(impl, value_type_id(v), v); + + if (result == NULL) + { + PyErr_SetString(PyExc_ValueError, "Failed to convert the MetaCall value to Python object."); + return py_loader_port_none(); + } + + return result; +} + static PyMethodDef metacall_methods[] = { { "metacall_load_from_file", py_loader_port_load_from_file, METH_VARARGS, "Loads a script from file." }, @@ -793,6 +973,12 @@ static PyMethodDef metacall_methods[] = { "Get information about all loaded objects." }, { "metacall", py_loader_port_invoke, METH_VARARGS, "Call a function anonymously." }, + { "metacall_value_create_ptr", py_loader_port_value_create_ptr, METH_VARARGS, + "Create a new value of type Pointer." }, + { "metacall_value_reference", py_loader_port_value_reference, METH_VARARGS, + "Create a new value of type Pointer." }, + { "metacall_value_dereference", py_loader_port_value_dereference, METH_VARARGS, + "Get the data which a value of type Pointer is pointing to." }, { NULL, NULL, 0, NULL } }; diff --git a/source/metacall/include/metacall/metacall_value.h b/source/metacall/include/metacall/metacall_value.h index 0634e91bf..932cc75f0 100644 --- a/source/metacall/include/metacall/metacall_value.h +++ b/source/metacall/include/metacall/metacall_value.h @@ -394,6 +394,48 @@ METACALL_API const char *metacall_value_type_name(void *v); */ METACALL_API void *metacall_value_copy(void *v); +/** +* @brief +* Creates a new pointer value, with a reference to the +* data contained inside the value @v. For example: +* +* void *v = metacall_value_create_int(20); +* void *ptr = metacall_value_reference(v); +* +* In this case, void *ptr is a value equivalent to int*, +* and it points directly to the integer contained in void *v. +* Note that if we destroy the value @v, the reference will +* point to already freed memory, causing use-after-free when used. +* +* @param[in] v +* Reference to the value to be referenced +* +* @return +* A new value of type pointer, pointing to the @v data +*/ +METACALL_API void *metacall_value_reference(void *v); + +/** +* @brief +* If you pass a reference previously created (i.e a value of +* type pointer, pointing to another value), it returns the +* original value. It does not modify the memory of the values +* neither allocates anything. If the value @v is pointing to +* has been deleted, it will cause an use-after-free. For example: +* +* void *v = metacall_value_create_int(20); +* void *ptr = metacall_value_reference(v); +* void *w = metacall_value_dereference(ptr); +* assert(v == w); // Both are the same value +* +* @param[in] v +* Reference to the value to be dereferenced +* +* @return +* The value containing the data which ptr is pointing to +*/ +METACALL_API void *metacall_value_dereference(void *v); + /** * @brief * Copies the ownership from @src to @dst, including the finalizer, diff --git a/source/metacall/source/metacall_value.c b/source/metacall/source/metacall_value.c index 30222f3ed..b598e599b 100644 --- a/source/metacall/source/metacall_value.c +++ b/source/metacall/source/metacall_value.c @@ -223,6 +223,16 @@ void *metacall_value_copy(void *v) return value_type_copy(v); } +void *metacall_value_reference(void *v) +{ + return value_type_reference(v); +} + +void *metacall_value_dereference(void *v) +{ + return value_type_dereference(v); +} + void metacall_value_move(void *src, void *dst) { value_move(src, dst); diff --git a/source/ports/py_port/metacall/__init__.py b/source/ports/py_port/metacall/__init__.py index 230c1ae7c..ef8a6fd07 100644 --- a/source/ports/py_port/metacall/__init__.py +++ b/source/ports/py_port/metacall/__init__.py @@ -17,4 +17,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -from metacall.api import metacall, metacall_load_from_file, metacall_load_from_memory, metacall_load_from_package, metacall_inspect +from metacall.api import metacall, metacall_load_from_file, metacall_load_from_memory, metacall_load_from_package, metacall_inspect, metacall_value_create_ptr, metacall_value_reference, metacall_value_dereference diff --git a/source/ports/py_port/metacall/api.py b/source/ports/py_port/metacall/api.py index 9ffcea830..6bfb290cc 100644 --- a/source/ports/py_port/metacall/api.py +++ b/source/ports/py_port/metacall/api.py @@ -75,6 +75,18 @@ def metacall_inspect(): return dic return dict() +# Value API for handling pointers +def metacall_value_create_ptr(ptr): + return module.metacall_value_create_ptr(ptr) + +# Value API for getting the pointer to a value +def metacall_value_reference(v): + return module.metacall_value_reference(v) + +# Value API for getting the value of a pointer +def metacall_value_dereference(ptr): + return module.metacall_value_dereference(ptr) + # Monkey patching import builtins import types @@ -157,6 +169,9 @@ def generate_module(handle_name, handle): 'tsx': 'ts', # Rust Loader 'rs': 'rs', + # C Loader + 'c': 'c' + # Note: By default js extension uses NodeJS loader instead of JavaScript V8 # Probably in the future we can differenciate between them, but it is not trivial } diff --git a/source/reflect/include/reflect/reflect_value.h b/source/reflect/include/reflect/reflect_value.h index 208f09993..8b68387bb 100644 --- a/source/reflect/include/reflect/reflect_value.h +++ b/source/reflect/include/reflect/reflect_value.h @@ -169,6 +169,18 @@ REFLECT_API void value_finalizer(value v, value_finalizer_cb finalizer, void *fi */ REFLECT_API void *value_data(value v); +/** +* @brief +* From the data get the value pointer (inverse of value_data function) +* +* @param[in] data +* Reference to the data of a value +* +* @return +* Pointer to the container of the data @data +*/ +REFLECT_API value value_container(void *data); + /** * @brief * Convert value @v to memory block @data diff --git a/source/reflect/include/reflect/reflect_value_type.h b/source/reflect/include/reflect/reflect_value_type.h index 1a84aef99..fdb7856b7 100644 --- a/source/reflect/include/reflect/reflect_value_type.h +++ b/source/reflect/include/reflect/reflect_value_type.h @@ -71,6 +71,48 @@ REFLECT_API value value_type_create(const void *data, size_t bytes, type_id id); */ REFLECT_API value value_type_copy(value v); +/** +* @brief +* Creates a new pointer value, with a reference to the +* data contained inside the value @v. For example: +* +* value v = value_create_int(20); +* value ptr = value_type_reference(v); +* +* In this case, ptr is a value equivalent to int*, +* and it points directly to the integer contained in value v. +* Note that if we destroy the value @v, the reference will +* point to already freed memory, causing use-after-free when used. +* +* @param[in] v +* Reference to the value to be referenced +* +* @return +* A new value of type pointer, pointing to the @v data +*/ +REFLECT_API value value_type_reference(value v); + +/** +* @brief +* If you pass a reference previously created (i.e a value of +* type pointer, pointing to another value), it returns the +* original value. It does not modify the memory of the values +* neither allocates anything. If the value @v is pointing to +* has been deleted, it will cause an use-after-free. For example: +* +* value v = value_create_int(20); +* value ptr = value_type_reference(v); +* value w = value_type_dereference(ptr); +* assert(v == w); // Both are the same value +* +* @param[in] v +* Reference to the value to be dereferenced +* +* @return +* The value containing the data which ptr is pointing to +*/ +REFLECT_API value value_type_dereference(value v); + /** * @brief * Returns the size of the value type diff --git a/source/reflect/source/reflect_value.c b/source/reflect/source/reflect_value.c index 6d69506dc..8fa353752 100644 --- a/source/reflect/source/reflect_value.c +++ b/source/reflect/source/reflect_value.c @@ -200,9 +200,27 @@ void *value_data(value v) return NULL; } + /* Right now the memory layout is designed in a way that + * the first byte of the value is the data itself, so returning + * the value as (void *) has the same effect as accessing the data + */ return v; } +value value_container(void *data) +{ + if (data == NULL) + { + return NULL; + } + + /* Right now the memory layout is designed in a way that + * the first byte of the value is the data itself, so returning + * the data as (value) has the same effect as container_of(data, struct value, data) + */ + return (value)data; +} + void value_to(value v, void *data, size_t bytes) { void *src = value_data(v); diff --git a/source/reflect/source/reflect_value_type.c b/source/reflect/source/reflect_value_type.c index 537e2a805..dcae4ce6f 100644 --- a/source/reflect/source/reflect_value_type.c +++ b/source/reflect/source/reflect_value_type.c @@ -153,6 +153,20 @@ value value_type_copy(value v) return NULL; } +value value_type_reference(value v) +{ + void *data = value_data(v); + + return value_create_ptr(data); +} + +value value_type_dereference(value v) +{ + void *data = value_to_ptr(v); + + return value_container(data); +} + size_t value_type_size(value v) { size_t size = value_size(v); diff --git a/source/scripts/c/loadtest/source/loadtest.cpp b/source/scripts/c/loadtest/source/loadtest.cpp index 537175040..aa750670c 100644 --- a/source/scripts/c/loadtest/source/loadtest.cpp +++ b/source/scripts/c/loadtest/source/loadtest.cpp @@ -37,3 +37,8 @@ void pair_list_destroy(pair_list *t) delete[] t->pairs; delete t; } + +void modify_int_ptr(int *i) +{ + *i = 111; +} diff --git a/source/scripts/c/loadtest/source/loadtest.h b/source/scripts/c/loadtest/source/loadtest.h index 85b8b28b7..cb0552f23 100644 --- a/source/scripts/c/loadtest/source/loadtest.h +++ b/source/scripts/c/loadtest/source/loadtest.h @@ -33,6 +33,8 @@ EXPORT double pair_list_value(pair_list *t, uint32_t id); EXPORT void pair_list_destroy(pair_list *t); +EXPORT void modify_int_ptr(int *i); + #ifdef __cplusplus } #endif diff --git a/source/scripts/python/pointer/source/pointer.py.in b/source/scripts/python/pointer/source/pointer.py.in index 8c0d10d00..bf44b93cf 100644 --- a/source/scripts/python/pointer/source/pointer.py.in +++ b/source/scripts/python/pointer/source/pointer.py.in @@ -7,20 +7,35 @@ try: from metacall import metacall except ImportError as e: print('Error when loading MetaCall Python Port: ' + str(e)) + sys.stdout.flush() def python_set_value(t, value): print('Python python_set_value: ', type(t), t, value) + sys.stdout.flush() result = metacall('native_set_value', t, value) print('Python result from host native_set_value: ' + str(result), type(result)) + sys.stdout.flush() arr = metacall('native_get_value', t) print('Python result from host native_get_value: ' + str(arr), type(arr)) + sys.stdout.flush() if arr != [10, 50, 70]: print('Error: Invalid array values') return None return result + +def python_ret_null(ptr): + print('Python python_ret_null: ', type(ptr), ptr) + sys.stdout.flush() + + result = metacall('native_ret_null_ptr', ptr) + + print('Python native_ret_null_ptr: ', type(result), result) + sys.stdout.flush() + + return result diff --git a/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp b/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp index 8883a2d53..863ab1cdd 100644 --- a/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp +++ b/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp @@ -74,6 +74,18 @@ void *native_get_value(size_t argc, void *args[], void *data) return metacall_value_create_array(array, size); } +void *native_ret_null_ptr(size_t argc, void *args[], void *data) +{ + void *ptr = metacall_value_to_ptr(args[0]); + + EXPECT_EQ((void *)ptr, (void *)NULL); + + (void)argc; + (void)data; + + return metacall_value_create_ptr(NULL); +} + TEST_F(metacall_python_pointer_test, DefaultConstructor) { metacall_print_info(); @@ -89,6 +101,10 @@ TEST_F(metacall_python_pointer_test, DefaultConstructor) metacall_register("native_get_value", native_get_value, NULL, METACALL_ARRAY, 1, METACALL_PTR); EXPECT_NE((void *)NULL, (void *)metacall_function("native_get_value")); + + metacall_register("native_ret_null_ptr", native_ret_null_ptr, NULL, METACALL_PTR, 0); + + EXPECT_NE((void *)NULL, (void *)metacall_function("native_ret_null_ptr")); } /* Python */ @@ -126,6 +142,21 @@ TEST_F(metacall_python_pointer_test, DefaultConstructor) EXPECT_EQ((unsigned char)70U, (unsigned char)t.b); metacall_value_destroy(ret); + + void *args[] = { + metacall_value_create_ptr(NULL) + }; + + ret = metacallv("python_ret_null", args); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)METACALL_PTR, (enum metacall_value_id)metacall_value_id(ret)); + + EXPECT_EQ((void *)NULL, (void *)metacall_value_to_ptr(ret)); + + metacall_value_destroy(ret); + metacall_value_destroy(args[0]); } #endif /* OPTION_BUILD_LOADERS_PY */ diff --git a/source/tests/metacall_python_port_pointer_test/CMakeLists.txt b/source/tests/metacall_python_port_pointer_test/CMakeLists.txt new file mode 100644 index 000000000..d421bdbe7 --- /dev/null +++ b/source/tests/metacall_python_port_pointer_test/CMakeLists.txt @@ -0,0 +1,152 @@ +# Check if loaders are enabled +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_C OR NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_PY) + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-python-port-pointer-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_python_port_pointer_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::metacall +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} + + # Python Port path + METACALL_PYTHON_PORT_PATH="${CMAKE_SOURCE_DIR}/source/ports/py_port" +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Linker options +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $ +) + +# +# Define dependencies +# + +add_dependencies(${target} + py_loader + c_loader + loadtest +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} +) diff --git a/source/tests/metacall_python_port_pointer_test/source/main.cpp b/source/tests/metacall_python_port_pointer_test/source/main.cpp new file mode 100644 index 000000000..11ddf3f59 --- /dev/null +++ b/source/tests/metacall_python_port_pointer_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp b/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp new file mode 100644 index 000000000..48b45d6c5 --- /dev/null +++ b/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp @@ -0,0 +1,109 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include +#include +#include + +class metacall_python_port_pointer_test : public testing::Test +{ +public: +}; + +TEST_F(metacall_python_port_pointer_test, DefaultConstructor) +{ + metacall_print_info(); + + ASSERT_EQ((int)0, (int)metacall_initialize()); + + /* Test value reference and dereference */ + void *v = metacall_value_create_int(34551); + + ASSERT_EQ((enum metacall_value_id)METACALL_INT, (enum metacall_value_id)metacall_value_id(v)); + + void *ref = metacall_value_reference(v); + + ASSERT_EQ((enum metacall_value_id)METACALL_PTR, (enum metacall_value_id)metacall_value_id(ref)); + + int *int_ptr = (int *)metacall_value_to_ptr(ref); + + *int_ptr += 10; + + void *result = metacall_value_dereference(ref); + + ASSERT_EQ((enum metacall_value_id)METACALL_INT, (enum metacall_value_id)metacall_value_id(result)); + + ASSERT_EQ((int)34561, (int)metacall_value_to_int(result)); + + ASSERT_EQ((void *)v, (void *)result); + + /* Test Python reference and dereference */ + static const char buffer[] = + "import sys\n" + "sys.path.insert(0, '" METACALL_PYTHON_PORT_PATH "')\n" + "from metacall import metacall_load_from_package, metacall, metacall_value_create_ptr, metacall_value_reference, metacall_value_dereference\n" + "metacall_load_from_package('c', 'loadtest')\n" + + "def test() -> int:\n" + " print('Test start')\n" + " sys.stdout.flush()\n" + + " int_val = 324444\n" + " int_val_ref = metacall_value_reference(int_val)\n" + + " print(int_val_ref)\n" + " sys.stdout.flush()\n" + + " metacall('modify_int_ptr', int_val_ref)\n" + " int_val_deref = metacall_value_dereference(int_val_ref)\n" + + " print(int_val, '!=', int_val_deref)\n" + " sys.stdout.flush()\n" + + " return int_val_deref\n"; + + // "def test() -> int:\n" + // " print('Test start')\n" + // " sys.stdout.flush()\n" + // " list_pair = metacall_value_create_ptr(None)\n" + // " list_pair_ref = metacall_value_reference(list_pair)\n" + // " result = metacall('pair_list_init', list_pair_ref)\n" + // " print(result)\n" + // " sys.stdout.flush()\n" + // " list_pair = metacall_value_dereference(list_pair_ref)\n" + // " result = metacall('pair_list_value', list_pair)\n" + // " print(result)\n" + // " sys.stdout.flush()\n" + // " return result\n"; + + ASSERT_EQ((int)0, (int)metacall_load_from_memory("py", buffer, sizeof(buffer), NULL)); + + void *ret = metacall("test"); + + ASSERT_EQ((enum metacall_value_id)METACALL_LONG, (enum metacall_value_id)metacall_value_id(ret)); + + EXPECT_EQ((long)111L, (long)metacall_value_to_long(ret)); + + metacall_value_destroy(ret); + + EXPECT_EQ((int)0, (int)metacall_destroy()); +} From 2569acb1aa65d952804012916a8f4915941654bf Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 15 Nov 2024 08:54:18 +0100 Subject: [PATCH 099/487] Solve minor issue in C loader. --- source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp index 87fb6c75d..28e940a9b 100644 --- a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp +++ b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp @@ -87,7 +87,7 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_INVALID); + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); metacall_value_destroy(ret); From 433e3107112b6d8362aa03057dae20b96ff5b1a8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Fri, 15 Nov 2024 17:10:36 +0100 Subject: [PATCH 100/487] Solved issues in c loader and py port, add python port ci, add tests for python to c pointers. --- .github/workflows/release-python.yml | 29 ++++ .../loaders/py_loader/source/py_loader_port.c | 41 +---- source/ports/py_port/README.rst | 158 +++++++++++++++++- source/ports/py_port/VERSION | 1 + source/ports/py_port/setup.py | 32 ++-- .../ports/py_port/{run_tests.py => test.py} | 0 .../py_port/test/commands/py_port.txt.in | 2 +- source/ports/py_port/tox.ini | 10 +- source/ports/py_port/upload.sh | 30 ++-- source/scripts/c/loadtest/source/loadtest.cpp | 5 +- source/scripts/c/loadtest/source/loadtest.h | 2 +- source/tests/CMakeLists.txt | 1 + .../metacall_python_port_pointer_test.cpp | 47 ++++-- .../metacall_python_port_test/CMakeLists.txt | 2 +- 14 files changed, 272 insertions(+), 88 deletions(-) create mode 100644 .github/workflows/release-python.yml create mode 100644 source/ports/py_port/VERSION rename source/ports/py_port/{run_tests.py => test.py} (100%) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml new file mode 100644 index 000000000..c352504de --- /dev/null +++ b/.github/workflows/release-python.yml @@ -0,0 +1,29 @@ +name: Release Python Package + +on: + push: + branches: [ master, develop ] + paths: + - 'source/ports/py_port/setup.py' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + PYTHON_PIPY_USER: ${{ secrets.PYTHON_PIPY_USER }} + PYTHON_PIPY_PASSWORD: ${{ secrets.PYTHON_PIPY_PASSWORD }} + +jobs: + release: + name: Release Python Port + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Release the port + run: | + cd source/ports/py_port + bash ./upload.sh diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index a9cb3aa41..3ae0ac918 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -819,10 +819,8 @@ static const char py_loader_capsule_reference_id[] = "__metacall_capsule_referen static void py_loader_port_value_reference_destroy(PyObject *capsule) { - void *ref = PyCapsule_GetPointer(capsule, py_loader_capsule_reference_id); - void *v = PyCapsule_GetContext(capsule); + void *v = PyCapsule_GetPointer(capsule, py_loader_capsule_reference_id); - metacall_value_destroy(ref); metacall_value_destroy(v); } @@ -831,7 +829,7 @@ static PyObject *py_loader_port_value_reference(PyObject *self, PyObject *args) static const char format[] = "O:metacall_value_reference"; PyObject *obj; loader_impl impl; - void *v, *ref; + void *v; PyObject *capsule; (void)self; @@ -858,30 +856,15 @@ static PyObject *py_loader_port_value_reference(PyObject *self, PyObject *args) goto error_none; } - ref = metacall_value_reference(v); - - if (ref == NULL) - { - PyErr_SetString(PyExc_ValueError, "Failed to create the reference from MetaCall value."); - goto error_value; - } - - capsule = PyCapsule_New(ref, py_loader_capsule_reference_id, &py_loader_port_value_reference_destroy); + capsule = PyCapsule_New(v, py_loader_capsule_reference_id, &py_loader_port_value_reference_destroy); if (capsule == NULL) { - goto error_ref; - } - - if (PyCapsule_SetContext(capsule, v) != 0) - { - goto error_ref; + goto error_value; } return capsule; -error_ref: - metacall_value_destroy(ref); error_value: metacall_value_destroy(v); error_none: @@ -893,7 +876,7 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args static const char format[] = "O:metacall_value_dereference"; PyObject *capsule; const char *name = NULL; - void *ref, *v; + void *v; loader_impl impl; PyObject *result; @@ -922,21 +905,11 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args return py_loader_port_none(); } - /* Get the reference */ - ref = PyCapsule_GetPointer(capsule, name); - - if (ref == NULL) - { - return py_loader_port_none(); - } - /* Get the value */ - v = metacall_value_dereference(ref); + v = PyCapsule_GetPointer(capsule, name); - /* Validate the result */ - if (v != PyCapsule_GetContext(capsule)) + if (v == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid reference, the PyCapsule context does not match the dereferenced value"); return py_loader_port_none(); } diff --git a/source/ports/py_port/README.rst b/source/ports/py_port/README.rst index 2c6dfd9c7..c90d8c46b 100644 --- a/source/ports/py_port/README.rst +++ b/source/ports/py_port/README.rst @@ -13,7 +13,7 @@ transparently execute code from Python to any programming language, for example, calling JavaScript, NodeJS, Ruby or C# code from Python. Install -======== +======= Install MetaCall binaries first: @@ -28,7 +28,10 @@ Then install MetaCall Python package through MetaCall: metacall pip3 install metacall Example -======== +======= + +Calling Ruby from Python +------------------------ ``multiply.rb`` @@ -44,7 +47,7 @@ Example from metacall import metacall_load_from_file, metacall - metacall_load_from_file('rb', [ 'multiply.rb' ]); + metacall_load_from_file('rb', [ 'multiply.rb' ]) metacall('multiply', 3, 4); # 12 @@ -53,3 +56,152 @@ Running the example: .. code:: console metacall main.py + +Using pointers (calling to a C library) +--------------------------------------- + +For a simple case, let's imagine that we have a simple C function that +has an 'in' parameter and we want to pass a pointer to a long, from +Python side, and then store some value there for reading it later on. +Let's assume we have a ``loadtest.h`` and ``libloadtest.so`` and a C +function from this library could be this one: + +.. code:: c + + void modify_int_ptr(long *l) + { + *l = 111; + } + +Now if we want to call it from Python side, we should do the following: + +.. code:: py + + from metacall import metacall_load_from_package, metacall, metacall_value_reference, metacall_value_dereference + + # Load the library (we can configure the search paths for the .so and .lib with metacall_execution_path) + # metacall_execution_path('c', '/usr/local/include') + # metacall_execution_path('c', '/usr/local/lib') + metacall_load_from_package('c', 'loadtest') + + # Create value pointer (int *) + int_val = 324444 + int_val_ref = metacall_value_reference(int_val) + + # Pass the pointer to the function + metacall('modify_int_ptr', int_val_ref) + + # Get the value from pointer + int_val_deref = metacall_value_dereference(int_val_ref) + print(int_val_deref, '==', 111) + +For a more complex case, where we have an in/out parameter, for example +an opaque struct that we want to alloc from C side. First of all, with +the following header ``loadtest.h``: + +.. code:: c + + #ifndef LIB_LOAD_TEST_H + #define LIB_LOAD_TEST_H 1 + + #if defined(WIN32) || defined(_WIN32) + #define EXPORT __declspec(dllexport) + #else + #define EXPORT __attribute__((visibility("default"))) + #endif + + #ifdef __cplusplus + extern "C" { + #endif + + #include + + typedef struct + { + uint32_t i; + double d; + } pair; + + typedef struct + { + uint32_t size; + pair *pairs; + } pair_list; + + EXPORT int pair_list_init(pair_list **t); + + EXPORT double pair_list_value(pair_list *t, uint32_t id); + + EXPORT void pair_list_destroy(pair_list *t); + + #ifdef __cplusplus + } + #endif + + #endif /* LIB_LOAD_TEST_H */ + +With the following implementation ``loadtest.cpp``: + +.. code:: c + + #include "loadtest.h" + + int pair_list_init(pair_list **t) + { + static const uint32_t size = 3; + + *t = new pair_list(); + + (*t)->size = size; + (*t)->pairs = new pair[(*t)->size]; + + for (uint32_t i = 0; i < size; ++i) + { + (*t)->pairs[i].i = i; + (*t)->pairs[i].d = (double)(((double)i) * 1.0); + } + + return 0; + } + + double pair_list_value(pair_list *t, uint32_t id) + { + return t->pairs[id].d; + } + + void pair_list_destroy(pair_list *t) + { + delete[] t->pairs; + delete t; + } + +In this case the structs are not opaque, but they can be opaque and it +will work in the same way. Now, we can call those functions in the +following manner: + +.. code:: py + + from metacall import metacall_load_from_package, metacall, metacall_value_create_ptr, metacall_value_reference, metacall_value_dereference + + metacall_load_from_package('c', 'loadtest') + + # Create a pointer to void* set to NULL + list_pair = metacall_value_create_ptr(None) + + # Create a reference to it (void**) + list_pair_ref = metacall_value_reference(list_pair) + + # Call the function + result = metacall('pair_list_init', list_pair_ref) + + # Get the result updated (struct allocated) + list_pair = metacall_value_dereference(list_pair_ref) + + # Pass it to a function + result = metacall('pair_list_value', list_pair, 2) + + # Destroy it + metacall('pair_list_destroy', list_pair) + + # Here result will be 2.0 because is the third element in the array of pairs inside the struct + print(result, '==', 2.0) diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION new file mode 100644 index 000000000..09a3acfa1 --- /dev/null +++ b/source/ports/py_port/VERSION @@ -0,0 +1 @@ +0.6.0 \ No newline at end of file diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index 76e4dc2dd..e085fcfeb 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -32,6 +32,10 @@ with open(os.path.join(current_path, 'README.rst'), encoding='utf-8') as f: long_description = f.read() +# Get the version +with open(os.path.join(current_path, 'VERSION')) as f: + version = f.read() + # Define set up options options = { 'name': 'metacall', @@ -39,7 +43,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - 'version': '0.5.0', + 'version': version, 'description': 'A library for providing inter-language foreign function interface calls', 'long_description': long_description, @@ -82,6 +86,10 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ], # Keywords @@ -114,23 +122,23 @@ } # Exclude base packages -exclude_packages = ['contrib', 'docs', 'test', 'CMakeLists.txt'] +exclude_packages = ['contrib', 'docs', 'test', 'test.py' 'CMakeLists.txt', '.gitignore', 'upload.sh'] # TODO: Review helper # # Detect if metacall port is already installed # port_installed = False -# Append environment variable or default install path when building manually (TODO: Cross-platform paths) -sys.path.append(os.environ.get('PORT_LIBRARY_PATH', os.path.join(os.path.sep, 'usr', 'local', 'lib'))); +# # Append environment variable or default install path when building manually (TODO: Cross-platform paths) +# sys.path.append(os.environ.get('PORT_LIBRARY_PATH', os.path.join(os.path.sep, 'usr', 'local', 'lib'))); -# Find is MetaCall is installed as a distributable tarball (TODO: Cross-platform paths) -rootdir = os.path.join(os.path.sep, 'gnu', 'store') -regex = re.compile('.*-metacall-.*') +# # Find is MetaCall is installed as a distributable tarball (TODO: Cross-platform paths) +# rootdir = os.path.join(os.path.sep, 'gnu', 'store') +# regex = re.compile('.*-metacall-.*') -for root, dirs, _ in os.walk(rootdir): - for folder in dirs: - if regex.match(folder) and not folder.endswith('R'): - sys.path.append(os.path.join(rootdir, folder, 'lib')) +# for root, dirs, _ in os.walk(rootdir): +# for folder in dirs: +# if regex.match(folder) and not folder.endswith('R'): +# sys.path.append(os.path.join(rootdir, folder, 'lib')) # TODO: Review helper # # Find if module is installed @@ -171,7 +179,7 @@ # instead of the old one, but we keep the ./helper folder in order to provide future support for # extra commands, although the main idea is to keep the OS dependant install, this can be useful # for updating or doing Python related things. Meanwhile, it will be avoided. -exclude_packages.append('helper') +exclude_packages.extend(['helper', 'helper.py']) # TODO: Review helper # if port_installed == True: diff --git a/source/ports/py_port/run_tests.py b/source/ports/py_port/test.py similarity index 100% rename from source/ports/py_port/run_tests.py rename to source/ports/py_port/test.py diff --git a/source/ports/py_port/test/commands/py_port.txt.in b/source/ports/py_port/test/commands/py_port.txt.in index e2d332f6a..2a9019bbc 100644 --- a/source/ports/py_port/test/commands/py_port.txt.in +++ b/source/ports/py_port/test/commands/py_port.txt.in @@ -1,3 +1,3 @@ -load py ${CMAKE_CURRENT_SOURCE_DIR}/run_tests.py +load py ${CMAKE_CURRENT_SOURCE_DIR}/test.py call main() exit diff --git a/source/ports/py_port/tox.ini b/source/ports/py_port/tox.ini index 71c455d44..f56530bad 100644 --- a/source/ports/py_port/tox.ini +++ b/source/ports/py_port/tox.ini @@ -11,7 +11,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{26,27,33,34,35,36,37,38} +envlist = py{26,27,33,34,35,36,37,38,39,310,311,312,313} [testenv] basepython = @@ -24,15 +24,19 @@ basepython = py37: python3.7 py38: python3.8 py39: python3.9 + py310: python3.10 + py311: python3.11 + py312: python3.12 + py313: python3.13 deps = check-manifest - {py27,py33,py34,py35,py36,py37,py38,py39}: readme_renderer + {py27,py33,py34,py35,py36,py37,py38,py39,py310,py311,py312,py313}: readme_renderer flake8 pytest commands = check-manifest --ignore tox.ini,tests* # py26 doesn't have "setup.py check" - {py27,py33,py34,py35,py36,py37,py38,py39}: python setup.py check -m -r -s + {py27,py33,py34,py35,py36,py37,py38,py39,py310,py311,py312,py313}: python setup.py check -m -r -s flake8 . py.test tests [flake8] diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index e8e7b73fc..da8ea4e6a 100644 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # # MetaCall Python Port Deploy Script by Parra Studios @@ -19,20 +19,24 @@ # limitations under the License. # -# TODO: Update version in setup.py -# TODO: Automate for CD/CI +set -exuo pipefail -# Define exit code -fail=0 +PYPI_VERSION=$(curl -s https://pypi.org/rss/project/metacall/releases.xml | sed -n 's/\s*\([0-9.]*\).*/\1/p' | sed -n '2 p') +PORT_VERSION=$(cat VERSION) + +if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then + echo "Current package version is the same as PyPI version, skipping upload." + exit 0 +fi + +TWINE_USERNAME=${PYTHON_PYPI_USERNAME:-} +TWINE_PASSWORD=${PYTHON_PYPI_PASSWORD:-} # Install dependencies and upload MetaCall package -python3 -m pip install --user --upgrade twine setuptools wheel \ - && python3 setup.py sdist bdist_wheel \ - && python3 -m twine check dist/* \ - && python3 -m twine upload dist/* || fail=1 +python3 -m pip install --user --upgrade twine setuptools wheel +python3 setup.py sdist bdist_wheel +python3 -m twine check dist/* +python3 -m twine upload dist/* # Delete output -rm -rf dist/* build/* || fail=1 - -# Exit -exit ${fail} +rm -rf dist/* build/* diff --git a/source/scripts/c/loadtest/source/loadtest.cpp b/source/scripts/c/loadtest/source/loadtest.cpp index aa750670c..8dcb43ded 100644 --- a/source/scripts/c/loadtest/source/loadtest.cpp +++ b/source/scripts/c/loadtest/source/loadtest.cpp @@ -1,5 +1,4 @@ #include "loadtest.h" -#include <cstdint> #include <vector> long call_cpp_func(void) @@ -38,7 +37,7 @@ void pair_list_destroy(pair_list *t) delete t; } -void modify_int_ptr(int *i) +void modify_int_ptr(long *l) { - *i = 111; + *l = 111; } diff --git a/source/scripts/c/loadtest/source/loadtest.h b/source/scripts/c/loadtest/source/loadtest.h index cb0552f23..3e4f07274 100644 --- a/source/scripts/c/loadtest/source/loadtest.h +++ b/source/scripts/c/loadtest/source/loadtest.h @@ -33,7 +33,7 @@ EXPORT double pair_list_value(pair_list *t, uint32_t id); EXPORT void pair_list_destroy(pair_list *t); -EXPORT void modify_int_ptr(int *i); +EXPORT void modify_int_ptr(long *i); #ifdef __cplusplus } diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index 514cae104..003cd815e 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -195,6 +195,7 @@ add_subdirectory(metacall_python_loader_port_test) add_subdirectory(metacall_python_port_test) add_subdirectory(metacall_python_port_https_test) add_subdirectory(metacall_python_port_callback_test) +add_subdirectory(metacall_python_port_pointer_test) add_subdirectory(metacall_python_port_import_test) add_subdirectory(metacall_python_callback_test) add_subdirectory(metacall_python_fail_test) diff --git a/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp b/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp index 48b45d6c5..b2d57db4b 100644 --- a/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp +++ b/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp @@ -63,7 +63,7 @@ TEST_F(metacall_python_port_pointer_test, DefaultConstructor) "from metacall import metacall_load_from_package, metacall, metacall_value_create_ptr, metacall_value_reference, metacall_value_dereference\n" "metacall_load_from_package('c', 'loadtest')\n" - "def test() -> int:\n" + "def test_int_ptr() -> int:\n" " print('Test start')\n" " sys.stdout.flush()\n" @@ -79,25 +79,30 @@ TEST_F(metacall_python_port_pointer_test, DefaultConstructor) " print(int_val, '!=', int_val_deref)\n" " sys.stdout.flush()\n" - " return int_val_deref\n"; - - // "def test() -> int:\n" - // " print('Test start')\n" - // " sys.stdout.flush()\n" - // " list_pair = metacall_value_create_ptr(None)\n" - // " list_pair_ref = metacall_value_reference(list_pair)\n" - // " result = metacall('pair_list_init', list_pair_ref)\n" - // " print(result)\n" - // " sys.stdout.flush()\n" - // " list_pair = metacall_value_dereference(list_pair_ref)\n" - // " result = metacall('pair_list_value', list_pair)\n" - // " print(result)\n" - // " sys.stdout.flush()\n" - // " return result\n"; + " return int_val_deref\n" + + "def test_struct_ptr() -> float:\n" + " print('Test start')\n" + " sys.stdout.flush()\n" + + " list_pair = metacall_value_create_ptr(None)\n" + " list_pair_ref = metacall_value_reference(list_pair)\n" + " result = metacall('pair_list_init', list_pair_ref)\n" + " print(result)\n" + " sys.stdout.flush()\n" + + " list_pair = metacall_value_dereference(list_pair_ref)\n" + " result = metacall('pair_list_value', list_pair, 2)\n" + " print(result)\n" + " sys.stdout.flush()\n" + + " metacall('pair_list_destroy', list_pair)\n" + + " return result\n"; ASSERT_EQ((int)0, (int)metacall_load_from_memory("py", buffer, sizeof(buffer), NULL)); - void *ret = metacall("test"); + void *ret = metacall("test_int_ptr"); ASSERT_EQ((enum metacall_value_id)METACALL_LONG, (enum metacall_value_id)metacall_value_id(ret)); @@ -105,5 +110,13 @@ TEST_F(metacall_python_port_pointer_test, DefaultConstructor) metacall_value_destroy(ret); + ret = metacall("test_struct_ptr"); + + ASSERT_EQ((enum metacall_value_id)METACALL_DOUBLE, (enum metacall_value_id)metacall_value_id(ret)); + + EXPECT_EQ((double)2.0, (double)metacall_value_to_double(ret)); + + metacall_value_destroy(ret); + EXPECT_EQ((int)0, (int)metacall_destroy()); } diff --git a/source/tests/metacall_python_port_test/CMakeLists.txt b/source/tests/metacall_python_port_test/CMakeLists.txt index 0fc7b6e5b..ca0c027db 100644 --- a/source/tests/metacall_python_port_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_test/CMakeLists.txt @@ -97,7 +97,7 @@ target_compile_definitions(${target} ${DEFAULT_COMPILE_DEFINITIONS} # Python Port Test path - METACALL_PYTHON_PORT_TEST_PATH="${CMAKE_SOURCE_DIR}/source/ports/py_port/run_tests.py" + METACALL_PYTHON_PORT_TEST_PATH="${CMAKE_SOURCE_DIR}/source/ports/py_port/test.py" ) # From ac3c3f66d2004ef9b915f168cca02d15e1d8c360 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 21 Nov 2024 17:17:19 +0100 Subject: [PATCH 101/487] Initial commit, add base for NodeJS and constructor for MetaCall, still a lot of work to do. --- source/metacall/include/metacall/metacall.h | 6 +- source/metacall/source/metacall.c | 23 +++ source/portability/CMakeLists.txt | 5 +- .../include/portability/portability.h | 1 + ...ler_detection.h => portability_compiler.h} | 6 +- .../portability/portability_constructor.h | 79 ++++++++++ source/ports/node_port/CMakeLists.txt | 43 +++++- source/ports/node_port/index.js | 142 +++++++++++++----- 8 files changed, 253 insertions(+), 52 deletions(-) rename source/portability/include/portability/{portability_compiler_detection.h => portability_compiler.h} (99%) create mode 100644 source/portability/include/portability/portability_constructor.h diff --git a/source/metacall/include/metacall/metacall.h b/source/metacall/include/metacall/metacall.h index a1cea928f..3e841fdcf 100644 --- a/source/metacall/include/metacall/metacall.h +++ b/source/metacall/include/metacall/metacall.h @@ -58,10 +58,8 @@ struct metacall_initialize_configuration_type; struct metacall_initialize_configuration_type { - char *tag; - void *options; // TODO: We should use a MetaCall value MAP here and merge it with the configuration. - // By this way loaders will be able to access this information in the backend and we - // can use a weak API in order to implement this successfully + const char *tag; /* Tag referring to the loader */ + void *options; /* Value of type Map that will be merged merged into the configuration of the loader */ }; typedef void *(*metacall_await_callback)(void *, void *); diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 45ce6bf0f..45b949c70 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -35,6 +35,8 @@ #include <environment/environment_variable.h> +#include <portability/portability_constructor.h> + #include <stdio.h> #include <string.h> @@ -68,6 +70,27 @@ static int metacall_plugin_extension_load(void); static void *metacallv_method(void *target, const char *name, method_invoke_ptr call, vector v, void *args[], size_t size); static type_id *metacall_type_ids(void *args[], size_t size); +/* -- Costructors -- */ + +portability_constructor(metacall_constructor) +{ + const char *metacall_host = environment_variable_get("METACALL_HOST", NULL); + + if (metacall_host != NULL) + { + struct metacall_initialize_configuration_type config[] = { + { metacall_host, NULL /* TODO: Initialize the map and define { host: true } */ }, + { NULL, NULL } + }; + + if (metacall_initialize_ex(config) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall host constructor failed to initialize"); + exit(1); + } + } +} + /* -- Methods -- */ const char *metacall_serial(void) diff --git a/source/portability/CMakeLists.txt b/source/portability/CMakeLists.txt index 17d2b2159..2841f3aaa 100644 --- a/source/portability/CMakeLists.txt +++ b/source/portability/CMakeLists.txt @@ -35,16 +35,17 @@ set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") set(headers ${include_path}/portability.h ${include_path}/portability_assert.h - ${include_path}/portability_path.h + ${include_path}/portability_constructor.h ${include_path}/portability_executable_path.h ${include_path}/portability_library_path.h + ${include_path}/portability_path.h ) set(sources ${source_path}/portability.c - ${source_path}/portability_path.c ${source_path}/portability_executable_path.c ${source_path}/portability_library_path.c + ${source_path}/portability_path.c ) # Group source files diff --git a/source/portability/include/portability/portability.h b/source/portability/include/portability/portability.h index 6316fda48..75af3411b 100644 --- a/source/portability/include/portability/portability.h +++ b/source/portability/include/portability/portability.h @@ -27,6 +27,7 @@ #include <portability/portability_assert.h> #include <portability/portability_executable_path.h> +#include <portability/portability_library_path.h> #include <portability/portability_path.h> #ifdef __cplusplus diff --git a/source/portability/include/portability/portability_compiler_detection.h b/source/portability/include/portability/portability_compiler.h similarity index 99% rename from source/portability/include/portability/portability_compiler_detection.h rename to source/portability/include/portability/portability_compiler.h index ec2e4eaaa..871adf181 100644 --- a/source/portability/include/portability/portability_compiler_detection.h +++ b/source/portability/include/portability/portability_compiler.h @@ -18,8 +18,8 @@ * */ -#ifndef PORTABILITY_COMPILER_DETECTION_H -#define PORTABILITY_COMPILER_DETECTION_H 1 +#ifndef PORTABILITY_COMPILER_H +#define PORTABILITY_COMPILER_H 1 /* TODO: This needs to be implemented properly, including another file for architecture and operative system detection */ @@ -490,4 +490,4 @@ // PORTABILITY_THREAD_LOCAL not defined for this configuration. #endif -#endif /* PORTABILITY_COMPILER_DETECTION_H */ +#endif /* PORTABILITY_COMPILER_H */ diff --git a/source/portability/include/portability/portability_constructor.h b/source/portability/include/portability/portability_constructor.h new file mode 100644 index 000000000..9dc72a838 --- /dev/null +++ b/source/portability/include/portability/portability_constructor.h @@ -0,0 +1,79 @@ +/* + * Portability Library by Parra Studios + * A generic cross-platform portability utility. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef PORTABILITY_CONSTRUCTOR_H +#define PORTABILITY_CONSTRUCTOR_H 1 + +/* -- Headers -- */ + +#include <portability/portability_api.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* -- Headers -- */ + +#include <assert.h> + +#include <preprocessor/preprocessor_concatenation.h> +#include <preprocessor/preprocessor_stringify.h> + +/* -- Macros -- */ + +#ifndef portability_constructor + + #ifdef __cplusplus + #define portability_constructor(ctor) \ + static void ctor(void); \ + static struct PREPROCESSOR_CONCAT(ctor, _type) \ + { \ + PREPROCESSOR_CONCAT(ctor, _type) \ + (void) \ + { \ + ctor(); \ + } \ + } PREPROCESSOR_CONCAT(ctor, _ctor); \ + static void ctor(void) + #elif defined(_MSC_VER) + /* TODO: Test MSVC version in release mode */ + #pragma section(".CRT$XCU", read) + #define portability_constructor_impl(ctor, prefix) \ + static void ctor(void); \ + __declspec(allocate(".CRT$XCU")) void (*PREPROCESSOR_CONCAT(ctor, _ptr))(void) = ctor; \ + __pragma(comment(linker, "/include:" prefix PREPROCESSOR_STRINGIFY(ctor) "_ptr")) static void ctor(void) + #ifdef _WIN64 + #define portability_constructor(ctor) portability_constructor_impl(ctor, "") + #else + #define portability_constructor(ctor) portability_constructor_impl(ctor, "_") + #endif + #else + #define portability_constructor(ctor) \ + static void ctor(void) __attribute__((constructor)); \ + static void ctor(void) + #endif + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* PORTABILITY_CONSTRUCTOR_H */ diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index 2402d2a7f..9cbb94fbc 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -93,12 +93,6 @@ if(NOT OPTION_BUILD_CLI OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_ return() endif() -set(node_port_test "${target}_test") - -# -# Define test -# - if(OPTION_BUILD_THREAD_SANITIZER AND OPTION_BUILD_LOADERS_CS) # TODO: This test fails when run with thread sanitizer: # @@ -121,6 +115,14 @@ if(OPTION_BUILD_THREAD_SANITIZER AND OPTION_BUILD_LOADERS_CS) return() endif() +# +# Define test +# + +set(node_port_test "${target}_test") + +message(STATUS "Test ${node_port_test}") + add_test(NAME ${target} COMMAND ${CMAKE_COMMAND} -D "EXECUTABLE=$<TARGET_FILE:metacallcli>" -D "INPUT=${CMAKE_CURRENT_SOURCE_DIR}/test/commands/node_port.txt" -P "${CMAKE_SOURCE_DIR}/source/cli/metacallcli/test/commands/command_runner.cmake" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -213,3 +215,32 @@ test_environment_variables(${target} ${TESTS_ENVIRONMENT_VARIABLES_RS} ${TESTS_ENVIRONMENT_VARIABLES_OPENSSL} ) + +# +# Test importing NodeJS Port from node.exe +# + +set(node_port_test_exec "${node_port_test}_executable") + +message(STATUS "Test ${node_port_test_exec}") + +add_test(NAME ${node_port_test_exec} + COMMAND ${NodeJS_EXECUTABLE} test/index.js + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + +# Define test labels +set_property(TEST ${node_port_test_exec} + PROPERTY LABELS ${node_port_test_exec} +) + +# Environment variables +test_environment_variables(${node_port_test_exec} + "" + ${TESTS_ENVIRONMENT_VARIABLES} + ${TESTS_ENVIRONMENT_VARIABLES_COB} + ${TESTS_ENVIRONMENT_VARIABLES_C} + ${TESTS_ENVIRONMENT_VARIABLES_RS} + ${TESTS_ENVIRONMENT_VARIABLES_OPENSSL} + "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" +) diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 10fcbf24e..0120fbf61 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -22,55 +22,123 @@ const mod = require('module'); const path = require('path'); +const fs = require('fs').promises; const { URL } = require('url'); /* TODO: RPC Loader */ -const addon = (() => { - try { - /* This forces metacall port to be run always by metacall cli */ - return process._linkedBinding('node_loader_port_module'); - } catch (e) { - console.error('MetaCall failed to load, probably you are importing this file from NodeJS directly.'); - console.error('You should use MetaCall CLI instead. Install it from: https://github.com/metacall/install'); - throw e; - - /* TODO: Until we find a better way to do this, we should disable it */ - /* - const write = (data, cb) => { - if (!process.stdout.write(data)) { - process.stdout.once('drain', cb); - } else { - process.nextTick(cb); +async function findFilesRecursively(dirPattern, filePattern, depthLimit = Infinity) { + const stack = [{ dir: dirPattern, depth: 0 }]; + const files = []; + const dirRegex = new RegExp(dirPattern); + const fileRegex = new RegExp(filePattern); + + while (stack.length > 0) { + const { dir, depth } = stack.pop(); + + try { + if (!dirRegex.test(dir)) { + continue; } - }; - // Notify synchronously that we are launching MetaCall - write('NodeJS detected, launching MetaCall...\n', () => { - try { - const { spawnSync } = require('child_process'); - const args = [...process.argv]; + if (depth > depthLimit) { + continue; + } - args.shift(); + const items = await fs.readdir(dir); - const result = spawnSync('metacall', args, {}); + for (const item of items) { + const fullPath = path.join(dir, item); + const stat = await fs.stat(fullPath); - if (result.error && result.error.code === 'ENOENT') { - write('MetaCall not found. Please install MetaCall from: https://github.com/metacall/install and run it again.\n', () => { - process.exit(1); - }); + if (stat.isDirectory()) { + stack.push({ dir: fullPath, depth: depth + 1 }); + } else if (stat.isFile() && fileRegex.test(item)) { + files.push(fullPath); } + } + } catch (err) { + console.error(`Error reading directory ${dir}:`, err); + } + } - process.exit(result.status !== null ? result.status : 1); - } catch (e) { - const message = 'MetaCall failed to load, probably you are importing this file from NodeJS directly.\n' - + e.message + '\n' - + 'Install MetaCall from: https://github.com/metacall/install and run it again.\n'; + return files; +} - write(message, () => { - throw e; - }); +const platformInstallPaths = () => { + switch (process.platform) { + case 'win32': + return { + paths: [ path.join(process.env['LOCALAPPDATA'], 'MetaCall', 'metacall') ], + name: 'metacall.dll' } - }); + case 'darwin': + return { + paths: [ '/opt/homebrew/lib/', '/usr/local/lib/' ], + name: 'libmetacall.dylib' + } + case 'linux': + return { + paths: [ '/usr/local/lib/', '/gnu/lib/' ], + name: 'libmetacall.so' + } + } + + throw new Error(`Platform ${process.platform} not supported`) +} + +const searchPaths = () => { + const customPath = process.env['METACALL_INSTALL_PATH']; + + if (customPath) { + return { + paths: [ customPath ], + name: /^(lib)?metacall(d)?\.(so|dylib|dll)$/ + } + } + + return platformInstallPaths() +} + +const findLibrary = async () => { + const searchData = searchPaths(); + + for (const p of searchData.paths) { + const files = await findFilesRecursively(p, searchData.name, 0); + + if (files.length !== 0) { + return files[0]; + } + } + + throw new Error('MetaCall library not found, if you have it in a special folder, define it through METACALL_INSTALL_PATH') +} + +const addon = (() => { + try { + /* If the binding can be loaded, it means MetaCall is being + * imported from the node_loader, in that case the runtime + * was initialized by node_loader itself and we can proceed. + */ + return process._linkedBinding('node_loader_port_module'); + } catch (e) { + /* If the port cannot be found, it means MetaCall port has + * been imported for the first time from node.exe, the + * runtime in this case has been initialized by node.exe, + * and MetaCall is not initialized */ + process.env['METACALL_HOST'] = 'node'; + + findLibrary().then(library => { + const { constants } = require('os'); + const m = { exports: {} }; + + process.dlopen(m, library, constants.dlopen.RTLD_GLOBAL | constants.dlopen.RTLD_NOW); + + // TODO: What to do with m? should we use process._linkedBinding instead, no? + + }).catch(err => { + console.log(err); + process.exit(1); + }); } })(); From 3ed5d236280fd983782615866234231958d3f229 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 21 Nov 2024 23:32:02 +0100 Subject: [PATCH 102/487] Implemented cwd and options map. --- source/loader/source/loader_impl.c | 7 +- source/loader/source/loader_manager_impl.c | 12 ++- source/metacall/source/metacall.c | 19 ++++- source/portability/CMakeLists.txt | 2 + .../portability/portability_working_path.h | 54 ++++++++++++++ .../source/portability_working_path.c | 74 +++++++++++++++++++ 6 files changed, 159 insertions(+), 9 deletions(-) create mode 100644 source/portability/include/portability/portability_working_path.h create mode 100644 source/portability/source/portability_working_path.c diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index c6ccf3297..6b7bbafe3 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -87,7 +87,7 @@ struct loader_impl_type loader_impl_data data; /* Derived metadata provided by the loader, usually contains the data of the VM, Interpreter or JIT */ context ctx; /* Contains the objects, classes and functions loaded in the global scope of each loader */ set type_info_map; /* Stores a set indexed by type name of all of the types existing in the loader (global scope (TODO: may need refactor per handle)) */ - void *options; /* Additional initialization options passed in the initialize phase */ + value options; /* Additional initialization options passed in the initialize phase */ set exec_path_map; /* Set of execution paths passed by the end user */ }; @@ -1539,6 +1539,11 @@ void loader_impl_destroy_deallocate(loader_impl impl) context_destroy(impl->ctx); + if (impl->options != NULL) + { + value_type_destroy(impl->options); + } + free(impl); } diff --git a/source/loader/source/loader_manager_impl.c b/source/loader/source/loader_manager_impl.c index b22fa1527..f3f4375a6 100644 --- a/source/loader/source/loader_manager_impl.c +++ b/source/loader/source/loader_manager_impl.c @@ -26,8 +26,8 @@ #include <environment/environment_variable_path.h> -#include <portability/portability_executable_path.h> #include <portability/portability_path.h> +#include <portability/portability_working_path.h> #include <log/log.h> @@ -52,8 +52,8 @@ static void *loader_manager_impl_is_destroyed_ptr = NULL; vector loader_manager_impl_script_paths_initialize(void) { - portability_executable_path_str exe_path_str = { 0 }; - portability_executable_path_length exe_path_str_length = 0; + portability_working_path_str cwd_path_str = { 0 }; + portability_working_path_length cwd_path_str_length = 0; char *script_path = NULL; size_t script_path_size = 0; vector script_paths = vector_create_type(char *); @@ -63,11 +63,9 @@ vector loader_manager_impl_script_paths_initialize(void) return NULL; } - if (portability_executable_path(exe_path_str, &exe_path_str_length) == 0) + if (portability_working_path(cwd_path_str, &cwd_path_str_length) == 0) { - size_t exe_directory_size = portability_path_get_directory_inplace(exe_path_str, exe_path_str_length + 1); - - script_path = environment_variable_path_create(LOADER_SCRIPT_PATH, exe_path_str, exe_directory_size, &script_path_size); + script_path = environment_variable_path_create(LOADER_SCRIPT_PATH, cwd_path_str, cwd_path_str_length + 1, &script_path_size); } else { diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 45b949c70..171c18482 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -76,16 +76,33 @@ portability_constructor(metacall_constructor) { const char *metacall_host = environment_variable_get("METACALL_HOST", NULL); + /* We are running from a different host, initialize the loader of the host + * and redirect it to the existing symbols, also avoiding initialization + * and destruction of the runtime as it is being managed externally to MetaCall */ if (metacall_host != NULL) { + static const char host_str[] = "host"; + struct metacall_initialize_configuration_type config[] = { - { metacall_host, NULL /* TODO: Initialize the map and define { host: true } */ }, + { metacall_host, metacall_value_create_map(NULL, 1) }, { NULL, NULL } }; + /* Initialize the loader options with a map defining its options to { "host": true } */ + void **host_tuple, **options_map = metacall_value_to_map(config[0].options); + + options_map[0] = metacall_value_create_array(NULL, 2); + + host_tuple = metacall_value_to_array(options_map[0]); + + host_tuple[0] = metacall_value_create_string(host_str, sizeof(host_str) - 1); + host_tuple[1] = metacall_value_create_bool(1); + + /* Initialize MetaCall with extra options, defining the host properly */ if (metacall_initialize_ex(config) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "MetaCall host constructor failed to initialize"); + metacall_value_destroy(config[0].options); exit(1); } } diff --git a/source/portability/CMakeLists.txt b/source/portability/CMakeLists.txt index 2841f3aaa..cf4af64c6 100644 --- a/source/portability/CMakeLists.txt +++ b/source/portability/CMakeLists.txt @@ -38,6 +38,7 @@ set(headers ${include_path}/portability_constructor.h ${include_path}/portability_executable_path.h ${include_path}/portability_library_path.h + ${include_path}/portability_working_path.h ${include_path}/portability_path.h ) @@ -45,6 +46,7 @@ set(sources ${source_path}/portability.c ${source_path}/portability_executable_path.c ${source_path}/portability_library_path.c + ${source_path}/portability_working_path.c ${source_path}/portability_path.c ) diff --git a/source/portability/include/portability/portability_working_path.h b/source/portability/include/portability/portability_working_path.h new file mode 100644 index 000000000..00866a3a9 --- /dev/null +++ b/source/portability/include/portability/portability_working_path.h @@ -0,0 +1,54 @@ +/* + * Portability Library by Parra Studios + * A generic cross-platform portability utility. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef PORTABILITY_WORKING_PATH_H +#define PORTABILITY_WORKING_PATH_H 1 + +/* -- Headers -- */ + +#include <portability/portability_api.h> + +#include <portability/portability_path.h> + +/* -- Type Definitions -- */ + +typedef char portability_working_path_str[PORTABILITY_PATH_SIZE]; + +#if defined(WIN32) || defined(_WIN32) || \ + defined(__CYGWIN__) || defined(__CYGWIN32__) || \ + defined(__MINGW32__) || defined(__MINGW64__) +typedef DWORD portability_working_path_length; +#else +typedef size_t portability_working_path_length; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -- Methods -- */ + +PORTABILITY_API int portability_working_path(portability_working_path_str path, portability_working_path_length *length); + +#ifdef __cplusplus +} +#endif + +#endif /* PORTABILITY_WORKING_PATH_H */ diff --git a/source/portability/source/portability_working_path.c b/source/portability/source/portability_working_path.c new file mode 100644 index 000000000..1511cef35 --- /dev/null +++ b/source/portability/source/portability_working_path.c @@ -0,0 +1,74 @@ +/* + * Portability Library by Parra Studios + * A generic cross-platform portability utility. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <portability/portability_working_path.h> + +#include <string.h> + +#if defined(WIN32) || defined(_WIN32) || \ + defined(__CYGWIN__) || defined(__CYGWIN32__) || \ + defined(__MINGW32__) || defined(__MINGW64__) + #include <winbase.h> +#else + #include <unistd.h> +#endif + +int portability_working_path(portability_working_path_str path, portability_working_path_length *length) +{ + const portability_working_path_length path_max_length = PORTABILITY_PATH_SIZE; + + /* Reset the path */ + memset(path, 0, path_max_length); + +#if defined(WIN32) || defined(_WIN32) || \ + defined(__CYGWIN__) || defined(__CYGWIN32__) || \ + defined(__MINGW32__) || defined(__MINGW64__) + *length = GetCurrentDirectory(0, NULL); + + if (*length == 0) + { + /* TODO: DWORD dw = GetLastError(); */ + return 1; + } + + if (*length > path_max_length) + { + /* TODO: Handle error */ + return 1; + } + + if (GetCurrentDirectory(*length, path) == 0) + { + /* TODO: DWORD dw = GetLastError(); */ + return 1; + } +#else + if (getcwd(path, path_max_length) == NULL) + { + *length = 0; + /* TODO: Handle error */ + return 1; + } + + *length = strnlen(path, path_max_length); +#endif + + return 0; +} From 8e8fe8b46545a286f452cb0062db7db1aaeb3502 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 22 Nov 2024 13:25:37 +0100 Subject: [PATCH 103/487] Add functions for detecting host from loader side. --- source/loader/include/loader/loader.h | 10 +-- source/loader/include/loader/loader_impl.h | 6 +- source/loader/source/loader.c | 16 ++++- source/loader/source/loader_impl.c | 37 ++++++++++- source/loaders/node_loader/CMakeLists.txt | 4 +- .../node_loader/source/node_loader_impl.cpp | 39 ++++++------ .../node_loader/source/node_loader_port.cpp | 11 ---- source/metacall/source/metacall.c | 63 ++++++++++--------- 8 files changed, 118 insertions(+), 68 deletions(-) diff --git a/source/loader/include/loader/loader.h b/source/loader/include/loader/loader.h index b7fec73ec..3c31ba98d 100644 --- a/source/loader/include/loader/loader.h +++ b/source/loader/include/loader/loader.h @@ -33,10 +33,6 @@ extern "C" { #endif -/* -- Headers -- */ - -#include <stdlib.h> - /* -- Forward Declarations -- */ struct loader_type; @@ -81,7 +77,11 @@ LOADER_API void *loader_get_handle(const loader_tag tag, const char *name); LOADER_API void loader_set_options(const loader_tag tag, void *options); -LOADER_API void *loader_get_options(const loader_tag tag); +LOADER_API value loader_get_options(const loader_tag tag); + +LOADER_API value loader_get_option(const loader_tag tag, const char *field); + +LOADER_API int loader_get_option_host(const loader_tag tag); LOADER_API int loader_handle_initialize(loader_impl impl, const loader_path name, void **handle_ptr); diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index c6c8826d6..8eea205e2 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -67,7 +67,11 @@ LOADER_API void *loader_impl_get_handle(loader_impl impl, const char *name); LOADER_API void loader_impl_set_options(loader_impl impl, void *options); -LOADER_API void *loader_impl_get_options(loader_impl impl); +LOADER_API value loader_impl_get_options(loader_impl impl); + +LOADER_API value loader_impl_get_option(loader_impl impl, const char *field); + +LOADER_API int loader_impl_get_option_host(loader_impl impl); LOADER_API int loader_impl_handle_initialize(plugin_manager manager, plugin p, loader_impl impl, const loader_path name, void **handle_ptr); diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 82bb7d5a4..13b136445 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -547,13 +547,27 @@ void loader_set_options(const loader_tag tag, void *options) loader_impl_set_options(plugin_impl_type(p, loader_impl), options); } -void *loader_get_options(const loader_tag tag) +value loader_get_options(const loader_tag tag) { plugin p = loader_get_impl_plugin(tag); return loader_impl_get_options(plugin_impl_type(p, loader_impl)); } +value loader_get_option(const loader_tag tag, const char *field) +{ + plugin p = loader_get_impl_plugin(tag); + + return loader_impl_get_option(plugin_impl_type(p, loader_impl), field); +} + +int loader_get_option_host(const loader_tag tag) +{ + plugin p = loader_get_impl_plugin(tag); + + return loader_impl_get_option_host(plugin_impl_type(p, loader_impl)); +} + int loader_handle_initialize(loader_impl impl, const loader_path name, void **handle_ptr) { if (loader_initialize() == 1) diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 6b7bbafe3..80c58db32 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -1158,7 +1158,7 @@ void loader_impl_set_options(loader_impl impl, void *options) } } -void *loader_impl_get_options(loader_impl impl) +value loader_impl_get_options(loader_impl impl) { if (impl != NULL) { @@ -1168,6 +1168,41 @@ void *loader_impl_get_options(loader_impl impl) return NULL; } +value loader_impl_get_option(loader_impl impl, const char *field) +{ + value *options_map = value_to_map(impl->options); + size_t i, size = value_type_count(impl->options); + + for (i = 0; i < size; ++i) + { + value *options_tuple = value_to_array(options_map[i]); + + if (value_type_id(options_tuple[0]) == TYPE_STRING) + { + const char *str = value_to_string(options_tuple[0]); + + if (strncmp(str, field, value_type_size(options_tuple[0])) == 0) + { + return options_tuple[1]; + } + } + } + + return NULL; +} + +int loader_impl_get_option_host(loader_impl impl) +{ + value host = loader_impl_get_option(impl, "host"); + + if (host != NULL && value_type_id(host) == TYPE_BOOL) + { + return value_to_bool(host); + } + + return 0; +} + int loader_impl_handle_initialize(plugin_manager manager, plugin p, loader_impl impl, const loader_path name, void **handle_ptr) { if (impl != NULL) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 814f411f7..70108f53e 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -156,7 +156,9 @@ target_include_directories(${target} target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - ${NodeJS_LIBRARY} # NodeJS library + + # TODO: Implement delayed load + # ${NodeJS_LIBRARY} # NodeJS library PUBLIC ${DEFAULT_LIBRARIES} diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index bfe6e90c4..af983d29d 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -3937,34 +3937,37 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con config }; - /* Create NodeJS thread */ - if (uv_thread_create(&node_impl->thread, node_loader_impl_thread, &thread_data) != 0) + if (loader_impl_get_option_host(impl) == 0) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid NodeJS Thread creation"); + /* Create NodeJS thread */ + if (uv_thread_create(&node_impl->thread, node_loader_impl_thread, &thread_data) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid NodeJS Thread creation"); - /* TODO: Clear resources */ + /* TODO: Clear resources */ - delete node_impl; + delete node_impl; - return NULL; - } + return NULL; + } - /* Wait until start has been launch */ - uv_mutex_lock(&node_impl->mutex); + /* Wait until start has been launch */ + uv_mutex_lock(&node_impl->mutex); - uv_cond_wait(&node_impl->cond, &node_impl->mutex); + uv_cond_wait(&node_impl->cond, &node_impl->mutex); - if (node_impl->error_message != NULL) - { - uv_mutex_unlock(&node_impl->mutex); + if (node_impl->error_message != NULL) + { + uv_mutex_unlock(&node_impl->mutex); - /* TODO: Remove this when implementing thread safe */ - log_write("metacall", LOG_LEVEL_ERROR, node_impl->error_message); + /* TODO: Remove this when implementing thread safe */ + log_write("metacall", LOG_LEVEL_ERROR, node_impl->error_message); - return NULL; - } + return NULL; + } - uv_mutex_unlock(&node_impl->mutex); + uv_mutex_unlock(&node_impl->mutex); + } /* Call initialize function with thread safe */ { diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index ed681f1e9..8261f6bce 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -836,17 +836,6 @@ void node_loader_port_exports(napi_env env, napi_value exports) /* This function is called by NodeJs when the module is required */ napi_value node_loader_port_initialize(napi_env env, napi_value exports) { -/* Note: This should not be necessary because we do not allow to use ports outside MetaCall */ -#if 0 - if (metacall_initialize() != 0) - { - /* TODO: Show error message (when error handling is properly implemented in the core lib) */ - napi_throw_error(env, nullptr, "MetaCall failed to initialize"); - - return nullptr; - } -#endif - node_loader_port_exports(env, exports); return exports; diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 171c18482..8a9ad2eb9 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -74,36 +74,39 @@ static type_id *metacall_type_ids(void *args[], size_t size); portability_constructor(metacall_constructor) { - const char *metacall_host = environment_variable_get("METACALL_HOST", NULL); - - /* We are running from a different host, initialize the loader of the host - * and redirect it to the existing symbols, also avoiding initialization - * and destruction of the runtime as it is being managed externally to MetaCall */ - if (metacall_host != NULL) + if (metacall_initialize_flag == 1) { - static const char host_str[] = "host"; + const char *metacall_host = environment_variable_get("METACALL_HOST", NULL); - struct metacall_initialize_configuration_type config[] = { - { metacall_host, metacall_value_create_map(NULL, 1) }, - { NULL, NULL } - }; + /* We are running from a different host, initialize the loader of the host + * and redirect it to the existing symbols, also avoiding initialization + * and destruction of the runtime as it is being managed externally to MetaCall */ + if (metacall_host != NULL) + { + static const char host_str[] = "host"; - /* Initialize the loader options with a map defining its options to { "host": true } */ - void **host_tuple, **options_map = metacall_value_to_map(config[0].options); + struct metacall_initialize_configuration_type config[] = { + { metacall_host, metacall_value_create_map(NULL, 1) }, + { NULL, NULL } + }; - options_map[0] = metacall_value_create_array(NULL, 2); + /* Initialize the loader options with a map defining its options to { "host": true } */ + void **host_tuple, **options_map = metacall_value_to_map(config[0].options); - host_tuple = metacall_value_to_array(options_map[0]); + options_map[0] = metacall_value_create_array(NULL, 2); - host_tuple[0] = metacall_value_create_string(host_str, sizeof(host_str) - 1); - host_tuple[1] = metacall_value_create_bool(1); + host_tuple = metacall_value_to_array(options_map[0]); - /* Initialize MetaCall with extra options, defining the host properly */ - if (metacall_initialize_ex(config) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall host constructor failed to initialize"); - metacall_value_destroy(config[0].options); - exit(1); + host_tuple[0] = metacall_value_create_string(host_str, sizeof(host_str) - 1); + host_tuple[1] = metacall_value_create_bool(1); + + /* Initialize MetaCall with extra options, defining the host properly */ + if (metacall_initialize_ex(config) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall host constructor failed to initialize"); + metacall_value_destroy(config[0].options); + exit(1); + } } } } @@ -179,6 +182,13 @@ int metacall_initialize(void) { memory_allocator allocator; + if (metacall_initialize_flag == 0) + { + log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall already initialized"); + + return 0; + } + /* Initialize logs by default to stdout if none has been defined */ if (metacall_log_null_flag != 0 && log_size() == 0) { @@ -194,13 +204,6 @@ int metacall_initialize(void) log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall default logger to stdout initialized"); } - if (metacall_initialize_flag == 0) - { - log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall already initialized"); - - return 0; - } - log_write("metacall", LOG_LEVEL_DEBUG, "Initializing MetaCall"); /* Initialize MetaCall version environment variable */ From 355c12f1f274ad381d7bdc67186852ada4a73039 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 27 Nov 2024 23:01:13 +0100 Subject: [PATCH 104/487] Improve dynlink, trying to hook dlsym. --- .../include/cli_core_plugin/cli_core_plugin.h | 4 -- .../cli_sandbox_plugin/cli_sandbox_plugin.h | 4 -- .../include/funchook_detour/funchook_detour.h | 6 -- source/dynlink/CMakeLists.txt | 3 - source/dynlink/include/dynlink/dynlink.h | 1 - source/dynlink/include/dynlink/dynlink_impl.h | 4 -- .../include/dynlink/dynlink_impl_beos.h | 2 - .../include/dynlink/dynlink_impl_macos.h | 2 - .../dynlink/dynlink_impl_symbol_beos.h | 62 ------------------ .../dynlink/dynlink_impl_symbol_macos.h | 62 ------------------ .../dynlink/dynlink_impl_symbol_unix.h | 62 ------------------ .../dynlink/dynlink_impl_symbol_win32.h | 58 ----------------- .../include/dynlink/dynlink_impl_unix.h | 2 - .../include/dynlink/dynlink_impl_win32.h | 2 - .../include/dynlink/dynlink_interface.h | 21 ------- .../dynlink/include/dynlink/dynlink_symbol.h | 63 ------------------- source/dynlink/include/dynlink/dynlink_type.h | 17 +++++ source/dynlink/source/dynlink_impl_beos.c | 2 +- source/dynlink/source/dynlink_impl_macos.c | 3 +- source/dynlink/source/dynlink_impl_unix.c | 2 +- source/dynlink/source/dynlink_impl_win32.c | 2 +- source/dynlink/source/dynlink_symbol.c | 51 --------------- .../plugin_extension/plugin_extension.h | 4 -- .../c_loader/include/c_loader/c_loader.h | 6 -- .../include/cob_loader/cob_loader.h | 6 -- .../cr_loader/include/cr_loader/cr_loader.h | 6 -- .../cs_loader/include/cs_loader/cs_loader.h | 6 -- .../include/dart_loader/dart_loader.h | 6 -- .../include/ext_loader/ext_loader.h | 6 -- .../ext_loader/source/ext_loader_impl.cpp | 4 +- .../include/file_loader/file_loader.h | 6 -- .../include/java_loader/java_loader.h | 6 -- .../jl_loader/include/jl_loader/jl_loader.h | 6 -- .../js_loader/include/js_loader/js_loader.h | 6 -- .../include/jsm_loader/jsm_loader.h | 6 -- .../include/llvm_loader/llvm_loader.h | 6 -- .../include/lua_loader/lua_loader.h | 6 -- .../include/mock_loader/mock_loader.h | 6 -- source/loaders/node_loader/CMakeLists.txt | 2 +- .../include/node_loader/node_loader.h | 6 -- .../node_loader/source/node_loader_impl.cpp | 52 ++++++++------- .../py_loader/include/py_loader/py_loader.h | 6 -- .../rb_loader/include/rb_loader/rb_loader.h | 6 -- .../include/rpc_loader/rpc_loader.h | 6 -- .../rs_loader/include/rs_loader/rs_loader.h | 6 -- .../ts_loader/include/ts_loader/ts_loader.h | 6 -- .../include/wasm_loader/wasm_loader.h | 6 -- source/metacall/source/metacall.c | 59 +++++++++++++++++ source/plugin/source/plugin_descriptor.c | 2 +- source/plugin/source/plugin_loader.c | 9 ++- .../backtrace_plugin/backtrace_plugin.h | 4 -- .../include/sandbox_plugin/sandbox_plugin.h | 4 -- .../sum/include/sum_extension/sum_extension.h | 4 -- .../include/metacall_serial/metacall_serial.h | 6 -- .../rapid_json_serial/rapid_json_serial.h | 6 -- .../dynlink_test/source/dynlink_test.cpp | 6 +- 56 files changed, 120 insertions(+), 603 deletions(-) delete mode 100644 source/dynlink/include/dynlink/dynlink_impl_symbol_beos.h delete mode 100644 source/dynlink/include/dynlink/dynlink_impl_symbol_macos.h delete mode 100644 source/dynlink/include/dynlink/dynlink_impl_symbol_unix.h delete mode 100644 source/dynlink/include/dynlink/dynlink_impl_symbol_win32.h delete mode 100644 source/dynlink/include/dynlink/dynlink_symbol.h delete mode 100644 source/dynlink/source/dynlink_symbol.c diff --git a/source/cli/plugins/cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h b/source/cli/plugins/cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h index e27865d26..6c4446d9e 100644 --- a/source/cli/plugins/cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h +++ b/source/cli/plugins/cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h @@ -23,16 +23,12 @@ #include <cli_core_plugin/cli_core_plugin_api.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif CLI_CORE_PLUGIN_API int cli_core_plugin(void *loader, void *handle); -DYNLINK_SYMBOL_EXPORT(cli_core_plugin); - #ifdef __cplusplus } #endif diff --git a/source/cli/plugins/cli_sandbox_plugin/include/cli_sandbox_plugin/cli_sandbox_plugin.h b/source/cli/plugins/cli_sandbox_plugin/include/cli_sandbox_plugin/cli_sandbox_plugin.h index f0f1aa671..a11ef6abc 100644 --- a/source/cli/plugins/cli_sandbox_plugin/include/cli_sandbox_plugin/cli_sandbox_plugin.h +++ b/source/cli/plugins/cli_sandbox_plugin/include/cli_sandbox_plugin/cli_sandbox_plugin.h @@ -23,16 +23,12 @@ #include <cli_sandbox_plugin/cli_sandbox_plugin_api.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif CLI_SANDBOX_PLUGIN_API int cli_sandbox_plugin(void *loader, void *handle); -DYNLINK_SYMBOL_EXPORT(cli_sandbox_plugin); - #ifdef __cplusplus } #endif diff --git a/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h b/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h index b1967f77d..551ace90b 100644 --- a/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h +++ b/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h @@ -27,8 +27,6 @@ #include <detour/detour_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif @@ -45,8 +43,6 @@ extern "C" { */ FUNCHOOK_DETOUR_API detour_interface funchook_detour_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(funchook_detour_impl_interface_singleton); - /** * @brief * Provide the module information @@ -57,8 +53,6 @@ DYNLINK_SYMBOL_EXPORT(funchook_detour_impl_interface_singleton); */ FUNCHOOK_DETOUR_API const char *funchook_detour_print_info(void); -DYNLINK_SYMBOL_EXPORT(funchook_detour_print_info); - #ifdef __cplusplus } #endif diff --git a/source/dynlink/CMakeLists.txt b/source/dynlink/CMakeLists.txt index 0c1bd9294..dbb770bec 100644 --- a/source/dynlink/CMakeLists.txt +++ b/source/dynlink/CMakeLists.txt @@ -47,9 +47,7 @@ set(headers ${include_path}/dynlink.h ${include_path}/dynlink_flags.h ${include_path}/dynlink_impl.h - ${include_path}/dynlink_impl_symbol_${DYNLINK_IMPL_INTERFACE_NAME}.h ${include_path}/dynlink_impl_${DYNLINK_IMPL_INTERFACE_NAME}.h - ${include_path}/dynlink_symbol.h ) set(sources @@ -57,7 +55,6 @@ set(sources ${source_path}/dynlink_impl.c ${source_path}/dynlink_impl_${DYNLINK_IMPL_INTERFACE_NAME}.c ${source_path}/dynlink_interface.c - ${source_path}/dynlink_symbol.c ) # Group source files diff --git a/source/dynlink/include/dynlink/dynlink.h b/source/dynlink/include/dynlink/dynlink.h index 2b42705a6..77102c9e1 100644 --- a/source/dynlink/include/dynlink/dynlink.h +++ b/source/dynlink/include/dynlink/dynlink.h @@ -29,7 +29,6 @@ #include <dynlink/dynlink_flags.h> #include <dynlink/dynlink_interface.h> -#include <dynlink/dynlink_symbol.h> #ifdef __cplusplus extern "C" { diff --git a/source/dynlink/include/dynlink/dynlink_impl.h b/source/dynlink/include/dynlink/dynlink_impl.h index 3185db4aa..8f09c5195 100644 --- a/source/dynlink/include/dynlink/dynlink_impl.h +++ b/source/dynlink/include/dynlink/dynlink_impl.h @@ -33,10 +33,6 @@ extern "C" { #endif -/* -- Headers -- */ - -#include <stdlib.h> - /* -- Methods -- */ /** diff --git a/source/dynlink/include/dynlink/dynlink_impl_beos.h b/source/dynlink/include/dynlink/dynlink_impl_beos.h index f77adbb3e..60efcdc2a 100644 --- a/source/dynlink/include/dynlink/dynlink_impl_beos.h +++ b/source/dynlink/include/dynlink/dynlink_impl_beos.h @@ -25,8 +25,6 @@ #include <dynlink/dynlink_api.h> -#include <dynlink/dynlink_impl_symbol_beos.h> - #ifdef __cplusplus extern "C" { #endif diff --git a/source/dynlink/include/dynlink/dynlink_impl_macos.h b/source/dynlink/include/dynlink/dynlink_impl_macos.h index d2bce45dd..404235e30 100644 --- a/source/dynlink/include/dynlink/dynlink_impl_macos.h +++ b/source/dynlink/include/dynlink/dynlink_impl_macos.h @@ -25,8 +25,6 @@ #include <dynlink/dynlink_api.h> -#include <dynlink/dynlink_impl_symbol_macos.h> - #ifdef __cplusplus extern "C" { #endif diff --git a/source/dynlink/include/dynlink/dynlink_impl_symbol_beos.h b/source/dynlink/include/dynlink/dynlink_impl_symbol_beos.h deleted file mode 100644 index 6530fd895..000000000 --- a/source/dynlink/include/dynlink/dynlink_impl_symbol_beos.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Dynamic Link Library by Parra Studios - * A library for dynamic loading and linking shared objects at run-time. - * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef DYNLINK_IMPL_SYMBOL_BEOS_H -#define DYNLINK_IMPL_SYMBOL_BEOS_H 1 - -/* -- Headers -- */ - -#include <dynlink/dynlink_api.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* -- Definitions -- */ - -#define DYNLINK_SYMBOL_PREFIX \ - dynlink_symbol_ - -/* -- Macros -- */ - -#define DYNLINK_SYMBOL_EXPORT(name) \ - DYNLINK_API struct dynlink_symbol_addr_beos_type DYNLINK_SYMBOL_NAME(name) = { \ - (dynlink_symbol_addr_beos_impl)&name \ - } - -#define DYNLINK_SYMBOL_GET(name) \ - ((dynlink_symbol_addr_beos)(name))->symbol - -/* -- Type definitions -- */ - -typedef void (*dynlink_symbol_addr_beos_impl)(void); - -typedef struct dynlink_symbol_addr_beos_type -{ - dynlink_symbol_addr_beos_impl symbol; -} * dynlink_symbol_addr_beos; - -typedef dynlink_symbol_addr_beos dynlink_symbol_addr; - -#ifdef __cplusplus -} -#endif - -#endif /* DYNLINK_IMPL_SYMBOL_BEOS_H */ diff --git a/source/dynlink/include/dynlink/dynlink_impl_symbol_macos.h b/source/dynlink/include/dynlink/dynlink_impl_symbol_macos.h deleted file mode 100644 index 7d92286e6..000000000 --- a/source/dynlink/include/dynlink/dynlink_impl_symbol_macos.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Dynamic Link Library by Parra Studios - * A library for dynamic loading and linking shared objects at run-time. - * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef DYNLINK_IMPL_SYMBOL_MACOS_H -#define DYNLINK_IMPL_SYMBOL_MACOS_H 1 - -/* -- Headers -- */ - -#include <dynlink/dynlink_api.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* -- Definitions -- */ - -#define DYNLINK_SYMBOL_PREFIX \ - dynlink_symbol_ - -/* -- Macros -- */ - -#define DYNLINK_SYMBOL_EXPORT(name) \ - DYNLINK_API struct dynlink_symbol_addr_macos_type DYNLINK_SYMBOL_NAME(name) = { \ - (dynlink_symbol_addr_macos_impl)&name \ - } - -#define DYNLINK_SYMBOL_GET(name) \ - ((dynlink_symbol_addr_macos)(name))->symbol - -/* -- Type definitions -- */ - -typedef void (*dynlink_symbol_addr_macos_impl)(void); - -typedef struct dynlink_symbol_addr_macos_type -{ - dynlink_symbol_addr_macos_impl symbol; -} * dynlink_symbol_addr_macos; - -typedef dynlink_symbol_addr_macos dynlink_symbol_addr; - -#ifdef __cplusplus -} -#endif - -#endif /* DYNLINK_IMPL_SYMBOL_MACOS_H */ diff --git a/source/dynlink/include/dynlink/dynlink_impl_symbol_unix.h b/source/dynlink/include/dynlink/dynlink_impl_symbol_unix.h deleted file mode 100644 index 56a66a91b..000000000 --- a/source/dynlink/include/dynlink/dynlink_impl_symbol_unix.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Dynamic Link Library by Parra Studios - * A library for dynamic loading and linking shared objects at run-time. - * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef DYNLINK_IMPL_SYMBOL_UNIX_H -#define DYNLINK_IMPL_SYMBOL_UNIX_H 1 - -/* -- Headers -- */ - -#include <dynlink/dynlink_api.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* -- Definitions -- */ - -#define DYNLINK_SYMBOL_PREFIX \ - dynlink_symbol_ - -/* -- Macros -- */ - -#define DYNLINK_SYMBOL_EXPORT(name) \ - DYNLINK_API struct dynlink_symbol_addr_unix_type DYNLINK_SYMBOL_NAME(name) = { \ - (dynlink_symbol_addr_unix_impl)&name \ - } - -#define DYNLINK_SYMBOL_GET(name) \ - ((dynlink_symbol_addr_unix)(name))->symbol - -/* -- Type definitions -- */ - -typedef void (*dynlink_symbol_addr_unix_impl)(void); - -typedef struct dynlink_symbol_addr_unix_type -{ - dynlink_symbol_addr_unix_impl symbol; -} * dynlink_symbol_addr_unix; - -typedef dynlink_symbol_addr_unix dynlink_symbol_addr; - -#ifdef __cplusplus -} -#endif - -#endif /* DYNLINK_IMPL_SYMBOL_UNIX_H */ diff --git a/source/dynlink/include/dynlink/dynlink_impl_symbol_win32.h b/source/dynlink/include/dynlink/dynlink_impl_symbol_win32.h deleted file mode 100644 index 670ece371..000000000 --- a/source/dynlink/include/dynlink/dynlink_impl_symbol_win32.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Dynamic Link Library by Parra Studios - * A library for dynamic loading and linking shared objects at run-time. - * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef DYNLINK_IMPL_SYMBOL_WIN32_H -#define DYNLINK_IMPL_SYMBOL_WIN32_H 1 - -/* -- Headers -- */ - -#include <dynlink/dynlink_api.h> - -#include <preprocessor/preprocessor_concatenation.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* -- Definitions -- */ - -#define DYNLINK_SYMBOL_PREFIX - -/* -- Macros -- */ - -#define DYNLINK_SYMBOL_EXPORT(name) \ - DYNLINK_NO_EXPORT struct \ - { \ - char name; \ - } PREPROCESSOR_CONCAT(dynlink_no_export_, name) - -#define DYNLINK_SYMBOL_GET(name) name - -/* -- Type definitions -- */ - -typedef void (*dynlink_symbol_addr_win32)(void); - -typedef dynlink_symbol_addr_win32 dynlink_symbol_addr; - -#ifdef __cplusplus -} -#endif - -#endif /* DYNLINK_IMPL_SYMBOL_WIN32_H */ diff --git a/source/dynlink/include/dynlink/dynlink_impl_unix.h b/source/dynlink/include/dynlink/dynlink_impl_unix.h index 7cd53898b..cb239a1d8 100644 --- a/source/dynlink/include/dynlink/dynlink_impl_unix.h +++ b/source/dynlink/include/dynlink/dynlink_impl_unix.h @@ -25,8 +25,6 @@ #include <dynlink/dynlink_api.h> -#include <dynlink/dynlink_impl_symbol_unix.h> - #ifdef __cplusplus extern "C" { #endif diff --git a/source/dynlink/include/dynlink/dynlink_impl_win32.h b/source/dynlink/include/dynlink/dynlink_impl_win32.h index 17daeb711..9bd39af77 100644 --- a/source/dynlink/include/dynlink/dynlink_impl_win32.h +++ b/source/dynlink/include/dynlink/dynlink_impl_win32.h @@ -25,8 +25,6 @@ #include <dynlink/dynlink_api.h> -#include <dynlink/dynlink_impl_symbol_win32.h> - #ifdef __cplusplus extern "C" { #endif diff --git a/source/dynlink/include/dynlink/dynlink_interface.h b/source/dynlink/include/dynlink/dynlink_interface.h index b0f710c03..0a33fa608 100644 --- a/source/dynlink/include/dynlink/dynlink_interface.h +++ b/source/dynlink/include/dynlink/dynlink_interface.h @@ -28,18 +28,14 @@ #include <dynlink/dynlink_type.h> #if defined(WIN32) || defined(_WIN32) - #include <dynlink/dynlink_impl_symbol_win32.h> #include <dynlink/dynlink_impl_win32.h> #elif defined(unix) || defined(__unix__) || defined(__unix) || \ defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ (((defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__)) && (defined(MAC_OS_X_VERSION_10_15) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15))) - #include <dynlink/dynlink_impl_symbol_unix.h> #include <dynlink/dynlink_impl_unix.h> #elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) - #include <dynlink/dynlink_impl_symbol_macos.h> #include <dynlink/dynlink_impl_macos.h> #elif defined(__HAIKU__) || defined(__BEOS__) - #include <dynlink/dynlink_impl_symbol_beos.h> #include <dynlink/dynlink_impl_beos.h> #else #error "Unsupported platform for dynlink" @@ -50,27 +46,10 @@ #include <preprocessor/preprocessor_concatenation.h> #include <preprocessor/preprocessor_stringify.h> -#include <stdlib.h> - #ifdef __cplusplus extern "C" { #endif -/* -- Macros -- */ - -#define DYNLINK_SYMBOL_PREFIX_STR() \ - PREPROCESSOR_STRINGIFY_OR_EMPTY(DYNLINK_SYMBOL_PREFIX) - -#define DYNLINK_SYMBOL_NAME(name) \ - PREPROCESSOR_CONCAT(DYNLINK_SYMBOL_PREFIX, name) - -#define DYNLINK_SYMBOL_NAME_STR(name) \ - PREPROCESSOR_STRINGIFY(DYNLINK_SYMBOL_NAME(name)) - -#define DYNLINK_SYMBOL_STR(name) \ - DYNLINK_SYMBOL_PREFIX_STR() \ - name - /* -- Type definitions -- */ typedef dynlink_symbol_addr *dynlink_symbol_addr_ptr; diff --git a/source/dynlink/include/dynlink/dynlink_symbol.h b/source/dynlink/include/dynlink/dynlink_symbol.h deleted file mode 100644 index d0319663f..000000000 --- a/source/dynlink/include/dynlink/dynlink_symbol.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Dynamic Link Library by Parra Studios - * A library for dynamic loading and linking shared objects at run-time. - * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef DYNLINK_SYMBOL_H -#define DYNLINK_SYMBOL_H 1 - -/* -- Headers -- */ - -#include <dynlink/dynlink_api.h> - -#include <dynlink/dynlink_type.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* -- Definitions -- */ - -#define DYNLINK_SYMBOL_NAME_SIZE 0xFF - -/* -- Type Definitions -- */ - -typedef char dynlink_symbol_name_man[DYNLINK_SYMBOL_NAME_SIZE]; - -/* -- Methods -- */ - -/** -* @brief -* Get convert a symbol to name mangled for cross-platform dynamic loading -* -* @param[in] symbol_name -* Reference to name of the of dynamically linked shared object symbol -* -* @param[out] symbol_mangled -* Reference to mangled name of the of dynamically linked shared object symbol -* -* @return -* Returns zero if @symbol_name was correctly mangled -*/ -DYNLINK_API size_t dynlink_symbol_name_mangle(dynlink_symbol_name symbol_name, size_t symbol_name_length, dynlink_symbol_name_man symbol_mangled); - -#ifdef __cplusplus -} -#endif - -#endif /* DYNLINK_H */ diff --git a/source/dynlink/include/dynlink/dynlink_type.h b/source/dynlink/include/dynlink/dynlink_type.h index c883ec2da..7661172e7 100644 --- a/source/dynlink/include/dynlink/dynlink_type.h +++ b/source/dynlink/include/dynlink/dynlink_type.h @@ -44,6 +44,23 @@ typedef const char *dynlink_symbol_name; /**< Dynamically linked shared o typedef portability_library_path_str dynlink_library_path_str; /**< Dynamically linked shared object symbol name */ typedef void *dynlink_impl; /**< Dynamically linked shared object implementation */ typedef char dynlink_name_impl[PORTABILITY_PATH_SIZE]; /**< Allocated copy of dynamically linked shared object name */ +typedef void (*dynlink_symbol_addr)(void); /**< Function pointer referring to a symbol address */ + +/* -- Macros -- */ + +#define dynlink_symbol_cast(type, symbol, result) \ + do \ + { \ + union \ + { \ + type ptr; \ + dynlink_symbol_addr fn; \ + } cast; \ +\ + cast.ptr = (symbol); \ + (result) = cast.fn; \ +\ + } while (0) #ifdef __cplusplus } diff --git a/source/dynlink/source/dynlink_impl_beos.c b/source/dynlink/source/dynlink_impl_beos.c index 8ce81828f..bc28312af 100644 --- a/source/dynlink/source/dynlink_impl_beos.c +++ b/source/dynlink/source/dynlink_impl_beos.c @@ -85,7 +85,7 @@ int dynlink_impl_interface_symbol_beos(dynlink handle, dynlink_impl impl, dynlin return 1; } - *addr = (dynlink_symbol_addr)symbol; + dynlink_symbol_cast(void *, symbol, *addr); return (*addr == NULL); } diff --git a/source/dynlink/source/dynlink_impl_macos.c b/source/dynlink/source/dynlink_impl_macos.c index 6447c7390..672b39771 100644 --- a/source/dynlink/source/dynlink_impl_macos.c +++ b/source/dynlink/source/dynlink_impl_macos.c @@ -133,10 +133,11 @@ dynlink_impl dynlink_impl_interface_load_macos(dynlink handle) int dynlink_impl_interface_symbol_macos(dynlink handle, dynlink_impl impl, dynlink_symbol_name name, dynlink_symbol_addr *addr) { NSSymbol symbol = NSLookupSymbolInModule(impl, name); + void *symbol_addr = NSAddressOfSymbol(symbol); (void)handle; - *addr = (dynlink_symbol_addr)NSAddressOfSymbol(symbol); + dynlink_symbol_cast(void *, symbol_addr, *addr); return (*addr == NULL); } diff --git a/source/dynlink/source/dynlink_impl_unix.c b/source/dynlink/source/dynlink_impl_unix.c index a6455dd64..4c00300c6 100644 --- a/source/dynlink/source/dynlink_impl_unix.c +++ b/source/dynlink/source/dynlink_impl_unix.c @@ -105,7 +105,7 @@ int dynlink_impl_interface_symbol_unix(dynlink handle, dynlink_impl impl, dynlin (void)handle; - *addr = (dynlink_symbol_addr)symbol; + dynlink_symbol_cast(void *, symbol, *addr); return (*addr == NULL); } diff --git a/source/dynlink/source/dynlink_impl_win32.c b/source/dynlink/source/dynlink_impl_win32.c index 8ea74bb24..75d576f0f 100644 --- a/source/dynlink/source/dynlink_impl_win32.c +++ b/source/dynlink/source/dynlink_impl_win32.c @@ -76,7 +76,7 @@ int dynlink_impl_interface_symbol_win32(dynlink handle, dynlink_impl impl, dynli (void)handle; - *addr = (dynlink_symbol_addr)proc_addr; + dynlink_symbol_cast(FARPROC, proc_addr, *addr); return (*addr == NULL); } diff --git a/source/dynlink/source/dynlink_symbol.c b/source/dynlink/source/dynlink_symbol.c deleted file mode 100644 index 35ac3861d..000000000 --- a/source/dynlink/source/dynlink_symbol.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Dynamic Link Library by Parra Studios - * A library for dynamic loading and linking shared objects at run-time. - * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/* -- Headers -- */ - -#include <dynlink/dynlink_interface.h> -#include <dynlink/dynlink_symbol.h> - -#include <string.h> - -/* -- Methods -- */ - -size_t dynlink_symbol_name_mangle(dynlink_symbol_name symbol_name, size_t symbol_name_length, dynlink_symbol_name_man symbol_mangled) -{ - static const char symbol_prefix[] = DYNLINK_SYMBOL_PREFIX_STR(); - static size_t symbol_prefix_length = sizeof(symbol_prefix) - 1; - size_t length = symbol_name_length + symbol_prefix_length; - - if (symbol_mangled == NULL) - { - return length; - } - - if (symbol_prefix_length > 0) - { - memcpy(symbol_mangled, symbol_prefix, symbol_prefix_length); - } - - memcpy(&symbol_mangled[symbol_prefix_length], symbol_name, symbol_name_length); - - symbol_mangled[length] = '\0'; - - return length; -} diff --git a/source/extensions/plugin_extension/include/plugin_extension/plugin_extension.h b/source/extensions/plugin_extension/include/plugin_extension/plugin_extension.h index ef5d86dc5..7b6559913 100644 --- a/source/extensions/plugin_extension/include/plugin_extension/plugin_extension.h +++ b/source/extensions/plugin_extension/include/plugin_extension/plugin_extension.h @@ -23,16 +23,12 @@ #include <plugin_extension/plugin_extension_api.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif PLUGIN_EXTENSION_API int plugin_extension(void *loader, void *handle); -DYNLINK_SYMBOL_EXPORT(plugin_extension); - #ifdef __cplusplus } #endif diff --git a/source/loaders/c_loader/include/c_loader/c_loader.h b/source/loaders/c_loader/include/c_loader/c_loader.h index 0e083cb01..159d45a62 100644 --- a/source/loaders/c_loader/include/c_loader/c_loader.h +++ b/source/loaders/c_loader/include/c_loader/c_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif C_LOADER_API loader_impl_interface c_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(c_loader_impl_interface_singleton); - C_LOADER_API const char *c_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(c_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/cob_loader/include/cob_loader/cob_loader.h b/source/loaders/cob_loader/include/cob_loader/cob_loader.h index 92c6412aa..4344cf257 100644 --- a/source/loaders/cob_loader/include/cob_loader/cob_loader.h +++ b/source/loaders/cob_loader/include/cob_loader/cob_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif COB_LOADER_API loader_impl_interface cob_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(cob_loader_impl_interface_singleton); - COB_LOADER_API const char *cob_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(cob_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/cr_loader/include/cr_loader/cr_loader.h b/source/loaders/cr_loader/include/cr_loader/cr_loader.h index 628f387e6..33e01700f 100644 --- a/source/loaders/cr_loader/include/cr_loader/cr_loader.h +++ b/source/loaders/cr_loader/include/cr_loader/cr_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif CR_LOADER_API loader_impl_interface cr_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(cr_loader_impl_interface_singleton); - CR_LOADER_API const char *cr_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(cr_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/cs_loader/include/cs_loader/cs_loader.h b/source/loaders/cs_loader/include/cs_loader/cs_loader.h index 546a515ca..37aa49c71 100644 --- a/source/loaders/cs_loader/include/cs_loader/cs_loader.h +++ b/source/loaders/cs_loader/include/cs_loader/cs_loader.h @@ -13,20 +13,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif CS_LOADER_API loader_impl_interface cs_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(cs_loader_impl_interface_singleton); - CS_LOADER_API const char *cs_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(cs_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/dart_loader/include/dart_loader/dart_loader.h b/source/loaders/dart_loader/include/dart_loader/dart_loader.h index 8b6530480..15dab7185 100644 --- a/source/loaders/dart_loader/include/dart_loader/dart_loader.h +++ b/source/loaders/dart_loader/include/dart_loader/dart_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif DART_LOADER_API loader_impl_interface dart_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(dart_loader_impl_interface_singleton); - DART_LOADER_API const char *dart_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(dart_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/ext_loader/include/ext_loader/ext_loader.h b/source/loaders/ext_loader/include/ext_loader/ext_loader.h index 580ab2ff7..d1a9db118 100644 --- a/source/loaders/ext_loader/include/ext_loader/ext_loader.h +++ b/source/loaders/ext_loader/include/ext_loader/ext_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif EXT_LOADER_API loader_impl_interface ext_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(ext_loader_impl_interface_singleton); - EXT_LOADER_API const char *ext_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(ext_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/ext_loader/source/ext_loader_impl.cpp b/source/loaders/ext_loader/source/ext_loader_impl.cpp index 25b8385a5..caa235182 100644 --- a/source/loaders/ext_loader/source/ext_loader_impl.cpp +++ b/source/loaders/ext_loader/source/ext_loader_impl.cpp @@ -76,7 +76,7 @@ typedef struct loader_impl_ext_handle_type union loader_impl_function_cast { - void *ptr; + dynlink_symbol_addr ptr; int (*fn)(void *, void *); }; @@ -352,7 +352,7 @@ int ext_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx { loader_impl_function_cast function_cast; - function_cast.ptr = static_cast<void *>(ext.addr); + function_cast.ptr = ext.addr; if (function_cast.fn(impl, loader_impl_handle_container_of(impl, handle)) != 0) { diff --git a/source/loaders/file_loader/include/file_loader/file_loader.h b/source/loaders/file_loader/include/file_loader/file_loader.h index b596e1537..4fff999e2 100644 --- a/source/loaders/file_loader/include/file_loader/file_loader.h +++ b/source/loaders/file_loader/include/file_loader/file_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif FILE_LOADER_API loader_impl_interface file_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(file_loader_impl_interface_singleton); - FILE_LOADER_API const char *file_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(file_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/java_loader/include/java_loader/java_loader.h b/source/loaders/java_loader/include/java_loader/java_loader.h index 4db5d86c2..b0aaa901d 100644 --- a/source/loaders/java_loader/include/java_loader/java_loader.h +++ b/source/loaders/java_loader/include/java_loader/java_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif JAVA_LOADER_API loader_impl_interface java_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(java_loader_impl_interface_singleton); - JAVA_LOADER_API const char *java_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(java_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/jl_loader/include/jl_loader/jl_loader.h b/source/loaders/jl_loader/include/jl_loader/jl_loader.h index 574e09504..02d588657 100644 --- a/source/loaders/jl_loader/include/jl_loader/jl_loader.h +++ b/source/loaders/jl_loader/include/jl_loader/jl_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif JL_LOADER_API loader_impl_interface jl_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(jl_loader_impl_interface_singleton); - JL_LOADER_API const char *jl_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(jl_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/js_loader/include/js_loader/js_loader.h b/source/loaders/js_loader/include/js_loader/js_loader.h index 7af1acf54..7bbcce7f7 100644 --- a/source/loaders/js_loader/include/js_loader/js_loader.h +++ b/source/loaders/js_loader/include/js_loader/js_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif JS_LOADER_API loader_impl_interface js_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(js_loader_impl_interface_singleton); - JS_LOADER_API const char *js_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(js_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h b/source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h index b3d633549..6b74e7519 100644 --- a/source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h +++ b/source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif JSM_LOADER_API loader_impl_interface jsm_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(jsm_loader_impl_interface_singleton); - JSM_LOADER_API const char *jsm_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(jsm_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h b/source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h index db405edd8..e395b8ccc 100644 --- a/source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h +++ b/source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif LLVM_LOADER_API loader_impl_interface llvm_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(llvm_loader_impl_interface_singleton); - LLVM_LOADER_API const char *llvm_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(llvm_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/lua_loader/include/lua_loader/lua_loader.h b/source/loaders/lua_loader/include/lua_loader/lua_loader.h index f93ed5312..811750907 100644 --- a/source/loaders/lua_loader/include/lua_loader/lua_loader.h +++ b/source/loaders/lua_loader/include/lua_loader/lua_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif LUA_LOADER_API loader_impl_interface lua_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(lua_loader_impl_interface_singleton); - LUA_LOADER_API const char *lua_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(lua_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader.h b/source/loaders/mock_loader/include/mock_loader/mock_loader.h index f92e7d1dd..2f0302fdf 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif MOCK_LOADER_API loader_impl_interface mock_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(mock_loader_impl_interface_singleton); - MOCK_LOADER_API const char *mock_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(mock_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 70108f53e..a9bf13c67 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -158,7 +158,7 @@ target_link_libraries(${target} ${META_PROJECT_NAME}::metacall # MetaCall library # TODO: Implement delayed load - # ${NodeJS_LIBRARY} # NodeJS library + ${NodeJS_LIBRARY} # NodeJS library PUBLIC ${DEFAULT_LIBRARIES} diff --git a/source/loaders/node_loader/include/node_loader/node_loader.h b/source/loaders/node_loader/include/node_loader/node_loader.h index 866037639..84b1009be 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader.h +++ b/source/loaders/node_loader/include/node_loader/node_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif NODE_LOADER_API loader_impl_interface node_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(node_loader_impl_interface_singleton); - NODE_LOADER_API const char *node_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(node_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index af983d29d..720c7b1a2 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -783,27 +783,35 @@ static HMODULE (*get_module_handle_a_ptr)(_In_opt_ LPCSTR) = NULL; /* TODO: Impl /* -- Methods -- */ +#if NODE_MAJOR_VERSION >= 12 + #define node_loader_impl_register_module_id node::ModuleFlags::kLinked | 0x08 /* NM_F_DELETEME */ +#else + #define node_loader_impl_register_module_id 0x02 | 0x08 /* NM_F_LINKED | NM_F_DELETEME */ +#endif + #if 1 // NODE_MAJOR_VERSION < 18 - #if NODE_MAJOR_VERSION >= 12 - #define node_loader_impl_register_module_id node::ModuleFlags::kLinked | 0x08 /* NM_F_DELETEME */ - #else - #define node_loader_impl_register_module_id 0x02 | 0x08 /* NM_F_LINKED | NM_F_DELETEME */ - #endif + #define node_loader_impl_register_binding(module) \ + napi_module_register(&module) +#else + // TODO: This won't work, this must be run after NodeJS has initialized and passing the environment + #define node_loader_impl_register_binding(module) \ + AddLinkedBinding(nullptr, module) +#endif - #define node_loader_impl_register_module(name, fn) \ - do \ - { \ - static napi_module node_loader_module = { \ - NAPI_MODULE_VERSION, \ - node_loader_impl_register_module_id, \ - __FILE__, \ - fn, \ - name, \ - NULL, \ - { 0 } \ - }; \ - napi_module_register(&node_loader_module); \ - } while (0) +#define node_loader_impl_register_module(name, fn) \ + do \ + { \ + static napi_module node_loader_module = { \ + NAPI_MODULE_VERSION, \ + node_loader_impl_register_module_id, \ + __FILE__, \ + fn, \ + name, \ + NULL, \ + { 0 } \ + }; \ + node_loader_impl_register_binding(node_loader_module); \ + } while (0) void node_loader_impl_register_linked_bindings() { @@ -813,9 +821,6 @@ void node_loader_impl_register_linked_bindings() /* Initialize Node Loader Port */ node_loader_impl_register_module("node_loader_port_module", node_loader_port_initialize); } -#else -// TODO: New register implementation -#endif void node_loader_impl_exception(napi_env env, napi_status status) { @@ -3806,9 +3811,8 @@ void node_loader_impl_thread(void *data) #endif */ - // #if NODE_MAJOR_VERSION < 18 + /* Register bindings */ node_loader_impl_register_linked_bindings(); - // #endif /* Unlock node implementation mutex */ uv_mutex_unlock(&node_impl->mutex); diff --git a/source/loaders/py_loader/include/py_loader/py_loader.h b/source/loaders/py_loader/include/py_loader/py_loader.h index 0e655cdb8..cdc88d415 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader.h +++ b/source/loaders/py_loader/include/py_loader/py_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif PY_LOADER_API loader_impl_interface py_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(py_loader_impl_interface_singleton); - PY_LOADER_API const char *py_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(py_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader.h b/source/loaders/rb_loader/include/rb_loader/rb_loader.h index 49b53024c..4d727e507 100644 --- a/source/loaders/rb_loader/include/rb_loader/rb_loader.h +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif RB_LOADER_API loader_impl_interface rb_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(rb_loader_impl_interface_singleton); - RB_LOADER_API const char *rb_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(rb_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h b/source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h index de574b4b8..a4e399d16 100644 --- a/source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h +++ b/source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif RPC_LOADER_API loader_impl_interface rpc_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(rpc_loader_impl_interface_singleton); - RPC_LOADER_API const char *rpc_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(rpc_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/rs_loader/include/rs_loader/rs_loader.h b/source/loaders/rs_loader/include/rs_loader/rs_loader.h index 75f961a33..61e9c11e8 100644 --- a/source/loaders/rs_loader/include/rs_loader/rs_loader.h +++ b/source/loaders/rs_loader/include/rs_loader/rs_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif RS_LOADER_API loader_impl_interface rs_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(rs_loader_impl_interface_singleton); - RS_LOADER_API const char *rs_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(rs_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/ts_loader/include/ts_loader/ts_loader.h b/source/loaders/ts_loader/include/ts_loader/ts_loader.h index 812c4c249..b433fd941 100644 --- a/source/loaders/ts_loader/include/ts_loader/ts_loader.h +++ b/source/loaders/ts_loader/include/ts_loader/ts_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif TS_LOADER_API loader_impl_interface ts_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(ts_loader_impl_interface_singleton); - TS_LOADER_API const char *ts_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(ts_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h index b34e2a5d1..067ea4856 100644 --- a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h +++ b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h @@ -25,20 +25,14 @@ #include <loader/loader_impl_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif WASM_LOADER_API loader_impl_interface wasm_loader_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(wasm_loader_impl_interface_singleton); - WASM_LOADER_API const char *wasm_loader_print_info(void); -DYNLINK_SYMBOL_EXPORT(wasm_loader_print_info); - #ifdef __cplusplus } #endif diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 8a9ad2eb9..a5beb250c 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -72,6 +72,65 @@ static type_id *metacall_type_ids(void *args[], size_t size); /* -- Costructors -- */ +/* TODO: Test, abstract and remove this */ +/* +#include <dlfcn.h> + +extern void *__libc_dlsym(void *map, const char *name); +extern void *__libc_dlopen_mode(const char *name, int mode); + +typedef void *(*dynlink_dlsym_fn)(void *, const char *); + +static dynlink_dlsym_fn dynlink_dlsym_fn_ptr = NULL; + +int dynlink_dlsym_initialize(void) +{ + void *handle = __libc_dlopen_mode("libdl.so.2", RTLD_GLOBAL | RTLD_LAZY); + union + { + void *ptr; + dynlink_dlsym_fn fn; + } cast; + + if (handle == NULL) + { + return 1; + } + + cast.ptr = __libc_dlsym(handle, "dlsym"); + + if (cast.ptr == NULL) + { + return 1; + } + + dynlink_dlsym_fn_ptr = cast.fn; + + return 0; +} + +void *dynlink_dlsym(void *handle, const char *symbol) +{ + if (dynlink_dlsym_fn_ptr == NULL) + { + if (dynlink_dlsym_initialize() != 0) + { + return NULL; + } + } + + return dynlink_dlsym_fn_ptr(handle, symbol); +} + +void *dlsym(void *handle, const char *symbol) +{ + printf("HANDLE %p - Symbol: %s\n", handle, symbol); + + return dynlink_dlsym(handle, symbol); +} +*/ +/* TODO-END */ + portability_constructor(metacall_constructor) { if (metacall_initialize_flag == 1) diff --git a/source/plugin/source/plugin_descriptor.c b/source/plugin/source/plugin_descriptor.c index 491895e05..00f463079 100644 --- a/source/plugin/source/plugin_descriptor.c +++ b/source/plugin/source/plugin_descriptor.c @@ -65,7 +65,7 @@ plugin_descriptor plugin_descriptor_create(char *path, char *library_name, char return NULL; } - descriptor->iface_singleton = (void *(*)(void))DYNLINK_SYMBOL_GET(address); + descriptor->iface_singleton = (void *(*)(void))(address); if (descriptor->iface_singleton == NULL) { diff --git a/source/plugin/source/plugin_loader.c b/source/plugin/source/plugin_loader.c index 5212f7ebb..a88ccda71 100644 --- a/source/plugin/source/plugin_loader.c +++ b/source/plugin/source/plugin_loader.c @@ -178,20 +178,19 @@ char *plugin_loader_generate_library_name(const char *name, char *suffix) char *plugin_loader_generate_symbol_iface_name(const char *name, char *suffix) { size_t name_length = strlen(name); - size_t mangle_length = dynlink_symbol_name_mangle(name, name_length, NULL); size_t suffix_length = strlen(suffix); - char *symbol_iface_name = malloc(sizeof(char) * (mangle_length + suffix_length + 1)); + char *symbol_iface_name = malloc(sizeof(char) * (name_length + suffix_length + 1)); if (symbol_iface_name == NULL) { return NULL; } - dynlink_symbol_name_mangle(name, name_length, symbol_iface_name); + memcpy(symbol_iface_name, name, name_length); - memcpy(&symbol_iface_name[mangle_length], suffix, suffix_length); + memcpy(&symbol_iface_name[name_length], suffix, suffix_length); - symbol_iface_name[mangle_length + suffix_length] = '\0'; + symbol_iface_name[name_length + suffix_length] = '\0'; return symbol_iface_name; } diff --git a/source/plugins/backtrace_plugin/include/backtrace_plugin/backtrace_plugin.h b/source/plugins/backtrace_plugin/include/backtrace_plugin/backtrace_plugin.h index 5269713f9..7a2ce1f07 100644 --- a/source/plugins/backtrace_plugin/include/backtrace_plugin/backtrace_plugin.h +++ b/source/plugins/backtrace_plugin/include/backtrace_plugin/backtrace_plugin.h @@ -23,16 +23,12 @@ #include <backtrace_plugin/backtrace_plugin_api.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif BACKTRACE_PLUGIN_API int backtrace_plugin(void *loader, void *handle); -DYNLINK_SYMBOL_EXPORT(backtrace_plugin); - #ifdef __cplusplus } #endif diff --git a/source/plugins/sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h b/source/plugins/sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h index 12d8c2caf..68d6d23f4 100644 --- a/source/plugins/sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h +++ b/source/plugins/sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h @@ -23,16 +23,12 @@ #include <sandbox_plugin/sandbox_plugin_api.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif SANDBOX_PLUGIN_API int sandbox_plugin(void *loader, void *handle); -DYNLINK_SYMBOL_EXPORT(sandbox_plugin); - #ifdef __cplusplus } #endif diff --git a/source/scripts/extension/sum/include/sum_extension/sum_extension.h b/source/scripts/extension/sum/include/sum_extension/sum_extension.h index 4dd93bc04..386bd4d76 100644 --- a/source/scripts/extension/sum/include/sum_extension/sum_extension.h +++ b/source/scripts/extension/sum/include/sum_extension/sum_extension.h @@ -23,16 +23,12 @@ #include <sum_extension/sum_extension_api.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif SUM_EXTENSION_API int sum_extension(void *loader, void *handle); -DYNLINK_SYMBOL_EXPORT(sum_extension); - #ifdef __cplusplus } #endif diff --git a/source/serials/metacall_serial/include/metacall_serial/metacall_serial.h b/source/serials/metacall_serial/include/metacall_serial/metacall_serial.h index 5d4f2e119..fb80de34c 100644 --- a/source/serials/metacall_serial/include/metacall_serial/metacall_serial.h +++ b/source/serials/metacall_serial/include/metacall_serial/metacall_serial.h @@ -27,8 +27,6 @@ #include <serial/serial_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif @@ -45,8 +43,6 @@ extern "C" { */ METACALL_SERIAL_API serial_interface metacall_serial_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(metacall_serial_impl_interface_singleton); - /** * @brief * Provide the module information @@ -57,8 +53,6 @@ DYNLINK_SYMBOL_EXPORT(metacall_serial_impl_interface_singleton); */ METACALL_SERIAL_API const char *metacall_serial_print_info(void); -DYNLINK_SYMBOL_EXPORT(metacall_serial_print_info); - #ifdef __cplusplus } #endif diff --git a/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial.h b/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial.h index 51e32e3b8..106acb20e 100644 --- a/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial.h +++ b/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial.h @@ -27,8 +27,6 @@ #include <serial/serial_interface.h> -#include <dynlink/dynlink.h> - #ifdef __cplusplus extern "C" { #endif @@ -45,8 +43,6 @@ extern "C" { */ RAPID_JSON_SERIAL_API serial_interface rapid_json_serial_impl_interface_singleton(void); -DYNLINK_SYMBOL_EXPORT(rapid_json_serial_impl_interface_singleton); - /** * @brief * Provide the module information @@ -57,8 +53,6 @@ DYNLINK_SYMBOL_EXPORT(rapid_json_serial_impl_interface_singleton); */ RAPID_JSON_SERIAL_API const char *rapid_json_serial_print_info(void); -DYNLINK_SYMBOL_EXPORT(rapid_json_serial_print_info); - #ifdef __cplusplus } #endif diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index dc77a7c6b..3d69b74a2 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -68,17 +68,17 @@ TEST_F(dynlink_test, DefaultConstructor) { static dynlink_symbol_addr mock_loader_print_info_addr; - EXPECT_EQ((int)0, dynlink_symbol(handle, DYNLINK_SYMBOL_STR("mock_loader_print_info"), &mock_loader_print_info_addr)); + EXPECT_EQ((int)0, dynlink_symbol(handle, "mock_loader_print_info", &mock_loader_print_info_addr)); if (mock_loader_print_info_addr != NULL) { - mock_loader_print_func print = DYNLINK_SYMBOL_GET(mock_loader_print_info_addr); + mock_loader_print_func print = mock_loader_print_info_addr; log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)mock_loader_print_info_addr); - if (DYNLINK_SYMBOL_GET(mock_loader_print_info_addr) != NULL) + if (mock_loader_print_info_addr != NULL) { log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); } From cbbf4a45a81e306ab3374d3f81758c28c362aa15 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 28 Nov 2024 21:14:33 +0100 Subject: [PATCH 105/487] Solve issues from detours, plugin manager, fork safety and added support to mingw in dynlink. --- .../funchook_detour/scripts/download.bat.in | 6 +++--- .../detours/funchook_detour/scripts/download.sh.in | 10 ++++------ source/dynlink/source/dynlink_impl_win32.c | 6 ++++++ source/metacall/source/metacall_fork.c | 4 ++-- source/plugin/source/plugin_manager.c | 14 +++++++------- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/source/detours/funchook_detour/scripts/download.bat.in b/source/detours/funchook_detour/scripts/download.bat.in index 8f1fd3842..a2702001b 100755 --- a/source/detours/funchook_detour/scripts/download.bat.in +++ b/source/detours/funchook_detour/scripts/download.bat.in @@ -1,11 +1,11 @@ @echo on rem Download repository if it does not exist -if not exist @FUNCHOOK_SOURCE_DIR@/.git ( - if exist @FUNCHOOK_SOURCE_DIR@ ( +if not exist "@FUNCHOOK_SOURCE_DIR@/.git" ( + if exist "@FUNCHOOK_SOURCE_DIR@" ( rmdir /S /Q "@FUNCHOOK_SOURCE_DIR@" ) - "@GIT_EXECUTABLE@" clone --single-branch --branch v@FUNCHOOK_VERSION@ --recursive https://github.com/kubo/funchook.git @FUNCHOOK_SOURCE_DIR@ + "@GIT_EXECUTABLE@" clone --single-branch --branch v@FUNCHOOK_VERSION@ --recursive https://github.com/kubo/funchook.git "@FUNCHOOK_SOURCE_DIR@" ) rem Write empty CMake file to avoid cmake warnings diff --git a/source/detours/funchook_detour/scripts/download.sh.in b/source/detours/funchook_detour/scripts/download.sh.in index 946485c7b..122a268bf 100755 --- a/source/detours/funchook_detour/scripts/download.sh.in +++ b/source/detours/funchook_detour/scripts/download.sh.in @@ -1,11 +1,9 @@ #!/usr/bin/env sh # Download repository if it does not exist -if [ ! -d @FUNCHOOK_SOURCE_DIR@/.git ] -then - if [ -d @FUNCHOOK_SOURCE_DIR@ ] - then - rm -rf @FUNCHOOK_SOURCE_DIR@ +if [ ! -d "@FUNCHOOK_SOURCE_DIR@/.git" ]; then + if [ -d "@FUNCHOOK_SOURCE_DIR@" ]; then + rm -rf "@FUNCHOOK_SOURCE_DIR@" fi - @GIT_EXECUTABLE@ clone --single-branch --branch v@FUNCHOOK_VERSION@ --recursive https://github.com/kubo/funchook.git @FUNCHOOK_SOURCE_DIR@ + "@GIT_EXECUTABLE@" clone --single-branch --branch v@FUNCHOOK_VERSION@ --recursive https://github.com/kubo/funchook.git "@FUNCHOOK_SOURCE_DIR@" fi diff --git a/source/dynlink/source/dynlink_impl_win32.c b/source/dynlink/source/dynlink_impl_win32.c index 75d576f0f..60532c463 100644 --- a/source/dynlink/source/dynlink_impl_win32.c +++ b/source/dynlink/source/dynlink_impl_win32.c @@ -41,7 +41,13 @@ const char *dynlink_impl_interface_extension_win32(void) void dynlink_impl_interface_get_name_win32(dynlink_name name, dynlink_name_impl name_impl, size_t size) { +#if defined(__MINGW32__) || defined(__MINGW64__) + strncpy(name_impl, "lib", size); + + strncat(name_impl, name, size - 1); +#else strncpy(name_impl, name, size); +#endif strncat(name_impl, ".", size - 1); diff --git a/source/metacall/source/metacall_fork.c b/source/metacall/source/metacall_fork.c index 8eea459f8..67bcfd6a3 100644 --- a/source/metacall/source/metacall_fork.c +++ b/source/metacall/source/metacall_fork.c @@ -212,7 +212,7 @@ NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, void (*metacall_fork_func(void))(void) { - return (void (*)(void)) & fork; + return (void (*)(void))(&fork); } pid_t metacall_fork_hook(void) @@ -325,7 +325,7 @@ int metacall_fork_initialize(void) if (metacall_detour_handle == NULL) { - metacall_detour_handle = detour_install(metacall_detour, (void (*)(void))fork_func, (void (*)(void)) & metacall_fork_hook); + metacall_detour_handle = detour_install(metacall_detour, (void (*)(void))fork_func, (void (*)(void))(&metacall_fork_hook)); if (metacall_detour_handle == NULL) { diff --git a/source/plugin/source/plugin_manager.c b/source/plugin/source/plugin_manager.c index d3c06044b..f60155fe6 100644 --- a/source/plugin/source/plugin_manager.c +++ b/source/plugin/source/plugin_manager.c @@ -138,16 +138,16 @@ int plugin_manager_initialize(plugin_manager manager, const char *name, const ch return 1; } - } - /* On Windows, pass the library path to the loader so it can find the dependencies of the plugins */ - /* For more information: https://github.com/metacall/core/issues/479 */ + /* On Windows, pass the library path to the loader so it can find the dependencies of the plugins */ + /* For more information: https://github.com/metacall/core/issues/479 */ #if defined(WIN32) || defined(_WIN32) - if (SetDllDirectoryA(manager->library_path) == FALSE) - { - log_write("metacall", LOG_LEVEL_ERROR, "Failed to register the DLL directory %s; plugins with other dependant DLLs may fail to load", manager->library_path); - } + if (SetDllDirectoryA(manager->library_path) == FALSE) + { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to register the DLL directory %s; plugins with other dependant DLLs may fail to load", manager->library_path); + } #endif + } /* Initialize the plugin loader */ if (manager->l == NULL) From 1927c6252b4b9e6fc1bdfde0b93eb227184f3ab2 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 28 Nov 2024 23:58:12 +0100 Subject: [PATCH 106/487] Unified all detours modules, add a destructor in metacall module for detours, add base for metacall link. --- source/metacall/CMakeLists.txt | 2 + source/metacall/include/metacall/metacall.h | 10 ++ .../metacall/include/metacall/metacall_link.h | 58 ++++++++ source/metacall/source/metacall.c | 126 +++++++++--------- source/metacall/source/metacall_fork.c | 99 +++----------- source/metacall/source/metacall_link.c | 117 ++++++++++++++++ 6 files changed, 265 insertions(+), 147 deletions(-) create mode 100644 source/metacall/include/metacall/metacall_link.h create mode 100644 source/metacall/source/metacall_link.c diff --git a/source/metacall/CMakeLists.txt b/source/metacall/CMakeLists.txt index 87146dc9b..1ab5be1fa 100644 --- a/source/metacall/CMakeLists.txt +++ b/source/metacall/CMakeLists.txt @@ -56,6 +56,7 @@ set(headers ${include_path}/metacall_log.h ${include_path}/metacall_allocator.h ${include_path}/metacall_error.h + ${include_path}/metacall_link.h ) set(sources @@ -64,6 +65,7 @@ set(sources ${source_path}/metacall_log.c ${source_path}/metacall_allocator.c ${source_path}/metacall_error.c + ${source_path}/metacall_link.c ) if(OPTION_FORK_SAFE) diff --git a/source/metacall/include/metacall/metacall.h b/source/metacall/include/metacall/metacall.h index 3e841fdcf..2ad427ca3 100644 --- a/source/metacall/include/metacall/metacall.h +++ b/source/metacall/include/metacall/metacall.h @@ -28,6 +28,7 @@ #include <metacall/metacall_allocator.h> #include <metacall/metacall_def.h> #include <metacall/metacall_error.h> +#include <metacall/metacall_link.h> #include <metacall/metacall_log.h> #include <metacall/metacall_value.h> #include <metacall/metacall_version.h> @@ -96,6 +97,15 @@ METACALL_API extern void *metacall_null_args[1]; */ METACALL_API const char *metacall_serial(void); +/** +* @brief +* Returns default detour used by MetaCall +* +* @return +* Name of the detour to be used with detouring methods +*/ +METACALL_API const char *metacall_detour(void); + /** * @brief * Disables MetaCall logs, must be called before @metacall_initialize. diff --git a/source/metacall/include/metacall/metacall_link.h b/source/metacall/include/metacall/metacall_link.h new file mode 100644 index 000000000..b0665a824 --- /dev/null +++ b/source/metacall/include/metacall/metacall_link.h @@ -0,0 +1,58 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef METACALL_LINK_H +#define METACALL_LINK_H 1 + +/* -- Headers -- */ + +#include <metacall/metacall_api.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* -- Methods -- */ + +/** +* @brief +* Initialize link detours and allocate shared memory +* +* @return +* Zero if success, different from zero otherwise +*/ +METACALL_API int metacall_link_initialize(void); + +// TODO: Implement dlsym hook function table + +/** +* @brief +* Unregister link detours and destroy shared memory +* +* @return +* Zero if success, different from zero otherwise +*/ +METACALL_API int metacall_link_destroy(void); + +#ifdef __cplusplus +} +#endif + +#endif /* METACALL_LINK_H */ diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index a5beb250c..02ab3deaa 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -33,6 +33,8 @@ #include <serial/serial.h> +#include <detour/detour.h> + #include <environment/environment_variable.h> #include <portability/portability_constructor.h> @@ -44,6 +46,7 @@ #define METACALL_ARGS_SIZE 0x10 #define METACALL_SERIAL "rapid_json" +#define METACALL_DETOUR "funchook" /* -- Type Definitions -- */ @@ -69,68 +72,10 @@ static loader_path plugin_path = { 0 }; static int metacall_plugin_extension_load(void); static void *metacallv_method(void *target, const char *name, method_invoke_ptr call, vector v, void *args[], size_t size); static type_id *metacall_type_ids(void *args[], size_t size); +static void metacall_detour_destructor(void); /* -- Costructors -- */ -/* TODO: Test, abstract and remove this */ -/* -#include <dlfcn.h> - -extern void *__libc_dlsym(void *map, const char *name); -extern void *__libc_dlopen_mode(const char *name, int mode); - -typedef void *(*dynlink_dlsym_fn)(void *, const char *); - -static dynlink_dlsym_fn dynlink_dlsym_fn_ptr = NULL; - -int dynlink_dlsym_initialize(void) -{ - void *handle = __libc_dlopen_mode("libdl.so.2", RTLD_GLOBAL | RTLD_LAZY); - union - { - void *ptr; - dynlink_dlsym_fn fn; - } cast; - - if (handle == NULL) - { - return 1; - } - - cast.ptr = __libc_dlsym(handle, "dlsym"); - - if (cast.ptr == NULL) - { - return 1; - } - - dynlink_dlsym_fn_ptr = cast.fn; - - return 0; -} - -void *dynlink_dlsym(void *handle, const char *symbol) -{ - if (dynlink_dlsym_fn_ptr == NULL) - { - if (dynlink_dlsym_initialize() != 0) - { - return NULL; - } - } - - return dynlink_dlsym_fn_ptr(handle, symbol); -} - -void *dlsym(void *handle, const char *symbol) -{ - printf("HANDLE %p - Symbol: %s\n", handle, symbol); - - return dynlink_dlsym(handle, symbol); -} -*/ -/* TODO-END */ - portability_constructor(metacall_constructor) { if (metacall_initialize_flag == 1) @@ -179,6 +124,13 @@ const char *metacall_serial(void) return metacall_serial_str; } +const char *metacall_detour(void) +{ + static const char metacall_detour_str[] = METACALL_DETOUR; + + return metacall_detour_str; +} + void metacall_log_null(void) { metacall_log_null_flag = 0; @@ -237,6 +189,31 @@ int metacall_plugin_extension_load(void) return result; } +void metacall_detour_destructor(void) +{ + log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall detour destruction"); + + /* Destroy link */ + if (metacall_link_destroy() != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall link destruction"); + } + + /* Destroy fork */ +#ifdef METACALL_FORK_SAFE + if (metacall_config_flags & METACALL_FLAGS_FORK_SAFE) + { + if (metacall_fork_destroy() != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall fork destruction"); + } + } +#endif /* METACALL_FORK_SAFE */ + + /* Destroy detour */ + detour_destroy(); +} + int metacall_initialize(void) { memory_allocator allocator; @@ -272,18 +249,37 @@ int metacall_initialize(void) return 1; } -#ifdef METACALL_FORK_SAFE - if (metacall_config_flags & METACALL_FLAGS_FORK_SAFE) + /* Initialize detours */ { - if (metacall_fork_initialize() != 0) + if (detour_initialize() != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall fork initialization"); + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour initialization"); + return 1; } - log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall fork initialized"); - } + /* Initialize link */ + if (metacall_link_initialize() != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall link initialization"); + } + +#ifdef METACALL_FORK_SAFE + if (metacall_config_flags & METACALL_FLAGS_FORK_SAFE) + { + if (metacall_fork_initialize() != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall fork initialization"); + } + + log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall fork initialized"); + } #endif /* METACALL_FORK_SAFE */ + /* Define destructor for detouring (it must be executed at the end to prevent problems with fork mechanisms) */ + atexit(metacall_detour_destructor); + } + + /* Initialize configuration and serializer */ allocator = memory_allocator_std(&malloc, &realloc, &free); if (configuration_initialize(metacall_serial(), NULL, allocator) != 0) diff --git a/source/metacall/source/metacall_fork.c b/source/metacall/source/metacall_fork.c index 67bcfd6a3..379a1a61c 100644 --- a/source/metacall/source/metacall_fork.c +++ b/source/metacall/source/metacall_fork.c @@ -102,17 +102,11 @@ pid_t metacall_fork_hook(void); /* -- Private Variables -- */ -static const char metacall_fork_detour_name[] = "funchook"; - -static detour metacall_detour = NULL; - -static detour_handle metacall_detour_handle = NULL; +static detour_handle detour_fork_handle = NULL; static metacall_pre_fork_callback_ptr metacall_pre_fork_callback = NULL; static metacall_post_fork_callback_ptr metacall_post_fork_callback = NULL; -static int metacall_fork_flag = 1; - /* -- Methods -- */ #if defined(WIN32) || defined(_WIN32) || \ @@ -142,7 +136,7 @@ NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, HANDLE DebugPort, PRTL_USER_PROCESS_INFORMATION ProcessInformation) { - RtlCloneUserProcessPtr metacall_fork_trampoline = (RtlCloneUserProcessPtr)detour_trampoline(metacall_detour_handle); + RtlCloneUserProcessPtr metacall_fork_trampoline = (RtlCloneUserProcessPtr)detour_trampoline(detour_fork_handle); metacall_pre_fork_callback_ptr pre_callback = metacall_pre_fork_callback; metacall_post_fork_callback_ptr post_callback = metacall_post_fork_callback; @@ -159,7 +153,7 @@ NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, /* TODO: Context */ if (pre_callback(NULL) != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour pre callback invocation"); + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour pre fork callback invocation"); } } @@ -198,7 +192,7 @@ NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, /* TODO: Context */ if (post_callback(_getpid(), NULL) != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour post callback invocation"); + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour post fork callback invocation"); } } @@ -217,7 +211,7 @@ void (*metacall_fork_func(void))(void) pid_t metacall_fork_hook(void) { - pid_t (*metacall_fork_trampoline)(void) = (pid_t(*)(void))detour_trampoline(metacall_detour_handle); + pid_t (*metacall_fork_trampoline)(void) = (pid_t(*)(void))detour_trampoline(detour_fork_handle); metacall_pre_fork_callback_ptr pre_callback = metacall_pre_fork_callback; metacall_post_fork_callback_ptr post_callback = metacall_post_fork_callback; @@ -234,7 +228,7 @@ pid_t metacall_fork_hook(void) /* TODO: Context */ if (pre_callback(NULL) != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour pre callback invocation"); + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour pre fork callback invocation"); } } @@ -268,7 +262,7 @@ pid_t metacall_fork_hook(void) /* TODO: Context */ if (post_callback(pid, NULL) != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour post callback invocation"); + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour post fork callback invocation"); } } @@ -279,57 +273,17 @@ pid_t metacall_fork_hook(void) #error "Unknown metacall fork safety platform" #endif -static void metacall_fork_exit(void) -{ - log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall atexit triggered"); - - if (metacall_fork_destroy() != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall fork destruction"); - } - - log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall fork destroyed"); -} - int metacall_fork_initialize(void) { - void (*fork_func)(void) = metacall_fork_func(); - - if (fork_func == NULL) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid fork function pointer"); - - return 1; - } - - if (detour_initialize() != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour initialization"); - - return 1; - } - - if (metacall_detour == NULL) - { - metacall_detour = detour_create(metacall_fork_detour_name); + detour d = detour_create(metacall_detour()); - if (metacall_detour == NULL) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour creation"); - - metacall_fork_destroy(); - - return 1; - } - } - - if (metacall_detour_handle == NULL) + if (detour_fork_handle == NULL) { - metacall_detour_handle = detour_install(metacall_detour, (void (*)(void))fork_func, (void (*)(void))(&metacall_fork_hook)); + detour_fork_handle = detour_install(d, (void (*)(void))metacall_fork_func(), (void (*)(void))(&metacall_fork_hook)); - if (metacall_detour_handle == NULL) + if (detour_fork_handle == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour installation"); + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour fork installation"); metacall_fork_destroy(); @@ -337,13 +291,6 @@ int metacall_fork_initialize(void) } } - if (metacall_fork_flag == 1) - { - atexit(&metacall_fork_exit); - - metacall_fork_flag = 0; - } - return 0; } @@ -357,32 +304,20 @@ int metacall_fork_destroy(void) { int result = 0; - if (metacall_detour_handle != NULL) + if (detour_fork_handle != NULL) { - if (detour_uninstall(metacall_detour, metacall_detour_handle) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour uninstall"); - - result = 1; - } - - metacall_detour_handle = NULL; - } + detour d = detour_create(metacall_detour()); - if (metacall_detour != NULL) - { - if (detour_clear(metacall_detour) != 0) + if (detour_uninstall(d, detour_fork_handle) != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour clear"); + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour fork uninstall"); result = 1; } - metacall_detour = NULL; + detour_fork_handle = NULL; } - detour_destroy(); - metacall_pre_fork_callback = NULL; metacall_post_fork_callback = NULL; diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c new file mode 100644 index 000000000..82f0ca851 --- /dev/null +++ b/source/metacall/source/metacall_link.c @@ -0,0 +1,117 @@ +// /* +// * MetaCall Library by Parra Studios +// * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +// * +// * A library for providing a foreign function interface calls. +// * +// */ + +// /* -- Headers -- */ + +#include <metacall/metacall.h> +#include <metacall/metacall_link.h> + +#include <detour/detour.h> + +#include <log/log.h> + +#include <stdlib.h> + +/* -- Private Variables -- */ + +static detour_handle detour_link_handle = NULL; + +#if defined(WIN32) || defined(_WIN32) || \ + defined(__CYGWIN__) || defined(__CYGWIN32__) || \ + defined(__MINGW32__) || defined(__MINGW64__) + + #include <windows.h> + +void (*metacall_link_func(void))(void) +{ + return (void (*)(void))(&GetProcAddress); +} + +FARPROC metacall_link_hook(HMODULE handle, LPCSTR symbol) +{ + typedef FARPROC (*metacall_link_func_ptr)(HMODULE, LPCSTR); + + metacall_link_func_ptr metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); + + // TODO: Intercept if any, iterate hash map elements and invoke them + + return metacall_link_trampoline(handle, symbol); +} + +#elif defined(unix) || defined(__unix__) || defined(__unix) || \ + defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ + defined(__CYGWIN__) || defined(__CYGWIN32__) || \ + (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) + + #include <dlfcn.h> + +void (*metacall_link_func(void))(void) +{ + return (void (*)(void))(&dlsym); +} + +void *metacall_link_hook(void *handle, const char *symbol) +{ + typedef void *(*metacall_link_func_ptr)(void *, const char *); + + metacall_link_func_ptr metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); + + // TODO: Intercept if any, iterate hash map elements and invoke them + + return metacall_link_trampoline(handle, symbol); +} + +#else + #error "Unknown metacall link platform" +#endif + +/* -- Methods -- */ + +int metacall_link_initialize(void) +{ + detour d = detour_create(metacall_detour()); + + if (detour_link_handle == NULL) + { + detour_link_handle = detour_install(d, (void (*)(void))metacall_link_func(), (void (*)(void))(&metacall_link_hook)); + + if (detour_link_handle == NULL) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour link installation"); + + metacall_link_destroy(); + + return 1; + } + } + + return 0; +} + +int metacall_link_destroy(void) +{ + int result = 0; + + if (detour_link_handle != NULL) + { + detour d = detour_create(metacall_detour()); + + if (detour_uninstall(d, detour_link_handle) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour fork uninstall"); + + result = 1; + } + + detour_link_handle = NULL; + } + + // TODO: Destroy hash map + + return result; +} From d9604dd16296ccd1c050d7f1d3f6df3ce9040760 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 29 Nov 2024 00:55:44 +0100 Subject: [PATCH 107/487] Implemented metacall link table. --- source/dynlink/include/dynlink/dynlink_type.h | 14 +++ .../metacall/include/metacall/metacall_link.h | 33 +++++- source/metacall/source/metacall_fork.c | 14 ++- source/metacall/source/metacall_link.c | 103 ++++++++++++++++-- 4 files changed, 150 insertions(+), 14 deletions(-) diff --git a/source/dynlink/include/dynlink/dynlink_type.h b/source/dynlink/include/dynlink/dynlink_type.h index 7661172e7..5347eb51a 100644 --- a/source/dynlink/include/dynlink/dynlink_type.h +++ b/source/dynlink/include/dynlink/dynlink_type.h @@ -62,6 +62,20 @@ typedef void (*dynlink_symbol_addr)(void); /**< Function pointer referrin \ } while (0) +#define dynlink_symbol_uncast(fn, result) \ + do \ + { \ + union \ + { \ + void *ptr; \ + dynlink_symbol_addr fn; \ + } cast; \ +\ + cast.fn = (fn); \ + (result) = cast.ptr; \ +\ + } while (0) + #ifdef __cplusplus } #endif diff --git a/source/metacall/include/metacall/metacall_link.h b/source/metacall/include/metacall/metacall_link.h index b0665a824..9d5f7d890 100644 --- a/source/metacall/include/metacall/metacall_link.h +++ b/source/metacall/include/metacall/metacall_link.h @@ -40,7 +40,38 @@ extern "C" { */ METACALL_API int metacall_link_initialize(void); -// TODO: Implement dlsym hook function table +/** +* @brief +* Register a function pointer in order to allow function +* interposition when loading a library, if you register a +* function @symbol called 'foo', when you try to dlsym (or the equivalent +* on every platform), you will get the pointer to @fn, even if +* the symbol does not exist in the library, it will work. +* Function interposition is required in order to hook into runtimes +* and dynamically interpose our functions. +* +* @param[in] symbol +* Name of the function to be interposed +* +* @param[in] fn +* Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol +* +* @return +* Zero if success, different from zero otherwise +*/ +METACALL_API int metacall_link_register(const char *symbol, void (*fn)(void)); + +/** +* @brief +* Remove the hook previously registered +* +* @param[in] symbol +* Name of the function to be removed +* +* @return +* Zero if success, different from zero otherwise +*/ +METACALL_API int metacall_link_unregister(const char *symbol); /** * @brief diff --git a/source/metacall/source/metacall_fork.c b/source/metacall/source/metacall_fork.c index 379a1a61c..6cbe972e6 100644 --- a/source/metacall/source/metacall_fork.c +++ b/source/metacall/source/metacall_fork.c @@ -1,8 +1,20 @@ /* * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * - * A library for providing a foreign function interface calls. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * */ diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index 82f0ca851..d1343c52d 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -1,26 +1,44 @@ -// /* -// * MetaCall Library by Parra Studios -// * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> -// * -// * A library for providing a foreign function interface calls. -// * -// */ - -// /* -- Headers -- */ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* -- Headers -- */ #include <metacall/metacall.h> #include <metacall/metacall_link.h> #include <detour/detour.h> +#include <dynlink/dynlink_type.h> + #include <log/log.h> +#include <adt/adt_set.h> + #include <stdlib.h> /* -- Private Variables -- */ static detour_handle detour_link_handle = NULL; +static set metacall_link_table = NULL; + #if defined(WIN32) || defined(_WIN32) || \ defined(__CYGWIN__) || defined(__CYGWIN32__) || \ defined(__MINGW32__) || defined(__MINGW64__) @@ -38,7 +56,17 @@ FARPROC metacall_link_hook(HMODULE handle, LPCSTR symbol) metacall_link_func_ptr metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); - // TODO: Intercept if any, iterate hash map elements and invoke them + /* Intercept if any */ + void *ptr = set_get(metacall_link_table, (set_key)symbol); + + if (ptr != NULL) + { + dynlink_symbol_addr addr; + + dynlink_symbol_cast(void *, ptr, addr); + + return (FARPROC)addr; + } return metacall_link_trampoline(handle, symbol); } @@ -61,7 +89,15 @@ void *metacall_link_hook(void *handle, const char *symbol) metacall_link_func_ptr metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); - // TODO: Intercept if any, iterate hash map elements and invoke them + /* Intercept function if any */ + void *ptr = set_get(metacall_link_table, (set_key)symbol); + + log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall detour link interception: %s -> %p", symbol, ptr); + + if (ptr != NULL) + { + return ptr; + } return metacall_link_trampoline(handle, symbol); } @@ -90,9 +126,47 @@ int metacall_link_initialize(void) } } + if (metacall_link_table == NULL) + { + metacall_link_table = set_create(&hash_callback_str, &comparable_callback_str); + + if (metacall_link_table == NULL) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall failed to create link table"); + + metacall_link_destroy(); + + return 1; + } + } + return 0; } +int metacall_link_register(const char *symbol, void (*fn)(void)) +{ + void *ptr; + + if (metacall_link_table == NULL) + { + return 1; + } + + dynlink_symbol_uncast(fn, ptr); + + return set_insert(metacall_link_table, (set_key)symbol, ptr); +} + +int metacall_link_unregister(const char *symbol) +{ + if (metacall_link_table == NULL) + { + return 1; + } + + return (set_remove(metacall_link_table, (set_key)symbol) == NULL); +} + int metacall_link_destroy(void) { int result = 0; @@ -111,7 +185,12 @@ int metacall_link_destroy(void) detour_link_handle = NULL; } - // TODO: Destroy hash map + if (metacall_link_table != NULL) + { + set_destroy(metacall_link_table); + + metacall_link_table = NULL; + } return result; } From 83de5532b76c7b213567964b18f5ed4df329b035 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 4 Dec 2024 02:08:10 +0100 Subject: [PATCH 108/487] Initialization working properly on NodeJS. --- source/loader/include/loader/loader.h | 2 + source/loader/include/loader/loader_impl.h | 2 + source/loader/source/loader.c | 12 + source/loader/source/loader_impl.c | 2 - source/loaders/node_loader/CMakeLists.txt | 2 +- .../node_loader/bootstrap/lib/bootstrap.js | 20 +- .../include/node_loader/node_loader_impl.h | 2 + .../node_loader/node_loader_trampoline.h | 2 + .../node_loader/source/node_loader_impl.cpp | 468 +++++++++--------- .../node_loader/source/node_loader_port.cpp | 19 +- .../source/node_loader_trampoline.cpp | 28 ++ source/metacall/source/metacall.c | 11 + source/ports/node_port/index.js | 15 +- 13 files changed, 340 insertions(+), 245 deletions(-) diff --git a/source/loader/include/loader/loader.h b/source/loader/include/loader/loader.h index 3c31ba98d..a108b3c5c 100644 --- a/source/loader/include/loader/loader.h +++ b/source/loader/include/loader/loader.h @@ -51,6 +51,8 @@ LOADER_API void loader_initialization_register(loader_impl impl); LOADER_API int loader_initialize(void); +LOADER_NO_EXPORT int loader_initialize_host(const loader_tag tag); + LOADER_API int loader_is_initialized(const loader_tag tag); LOADER_API int loader_register(const char *name, loader_register_invoke invoke, function *func, type_id return_type, size_t arg_size, type_id args_type_id[]); diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index 8eea205e2..726cdf2ca 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -35,6 +35,8 @@ extern "C" { /* -- Methods -- */ +LOADER_NO_EXPORT int loader_impl_initialize(plugin_manager manager, plugin p, loader_impl impl); + LOADER_API int loader_impl_is_initialized(loader_impl impl); LOADER_API loader_impl loader_impl_create(const loader_tag tag); diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 13b136445..8fc490118 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -201,6 +201,18 @@ void loader_initialization_register_plugin(plugin p) } } +int loader_initialize_host(const loader_tag tag) +{ + plugin p = plugin_manager_get(&loader_manager, tag); + + if (p == NULL) + { + return 1; + } + + return loader_impl_initialize(&loader_manager, p, plugin_impl_type(p, loader_impl)); +} + int loader_is_initialized(const loader_tag tag) { plugin p = plugin_manager_get(&loader_manager, tag); diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 80c58db32..7d9bdbf4c 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -123,8 +123,6 @@ static configuration loader_impl_initialize_configuration(plugin p); static int loader_impl_initialize_registered(plugin_manager manager, plugin p); -static int loader_impl_initialize(plugin_manager manager, plugin p, loader_impl impl); - static loader_handle_impl loader_impl_load_handle(loader_impl impl, loader_impl_interface iface, loader_handle module, const char *path, size_t size); static int loader_impl_handle_init(loader_impl impl, const char *path, loader_handle_impl handle_impl, void **handle_ptr, int populated); diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index a9bf13c67..70108f53e 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -158,7 +158,7 @@ target_link_libraries(${target} ${META_PROJECT_NAME}::metacall # MetaCall library # TODO: Implement delayed load - ${NodeJS_LIBRARY} # NodeJS library + # ${NodeJS_LIBRARY} # NodeJS library PUBLIC ${DEFAULT_LIBRARIES} diff --git a/source/loaders/node_loader/bootstrap/lib/bootstrap.js b/source/loaders/node_loader/bootstrap/lib/bootstrap.js index 5582ab48e..4f2c5b766 100644 --- a/source/loaders/node_loader/bootstrap/lib/bootstrap.js +++ b/source/loaders/node_loader/bootstrap/lib/bootstrap.js @@ -408,14 +408,20 @@ function node_loader_trampoline_await_future(trampoline) { }; } -module.exports = ((impl, ptr) => { +const startup = (impl, ptr, trampoline_exports) => { try { if (typeof impl === 'undefined' || typeof ptr === 'undefined') { - throw new Error('Process arguments (process.argv[2], process.argv[3]) not defined.'); + throw new Error('Bootstrap startup arguments impl or ptr are not defined.'); } // Get trampoline from list of linked bindings - const trampoline = process._linkedBinding('node_loader_trampoline_module'); + const trampoline = (() => { + if (trampoline_exports) { + return trampoline_exports; + } + + return process._linkedBinding('node_loader_trampoline_module'); + })(); const node_loader_ptr = trampoline.register(impl, ptr, { 'initialize': node_loader_trampoline_initialize, @@ -433,4 +439,12 @@ module.exports = ((impl, ptr) => { } catch (ex) { console.log('Exception in bootstrap.js trampoline initialization:', ex); } +}; + +module.exports = ((impl, ptr) => { + if (impl === undefined || ptr === undefined) { + return startup; + } else { + return startup(impl, ptr); + } })(process.argv[2], process.argv[3]); diff --git a/source/loaders/node_loader/include/node_loader/node_loader_impl.h b/source/loaders/node_loader/include/node_loader/node_loader_impl.h index 6aa1f3448..b41893a62 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_impl.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_impl.h @@ -69,6 +69,8 @@ NODE_LOADER_NO_EXPORT void node_loader_impl_print_handles(loader_impl_node node_ NODE_LOADER_NO_EXPORT int64_t node_loader_impl_user_async_handles_count(loader_impl_node node_impl); +NODE_LOADER_NO_EXPORT napi_value node_loader_impl_register_bootstrap_startup(loader_impl_node node_impl, napi_env env); + #ifdef __cplusplus } #endif diff --git a/source/loaders/node_loader/include/node_loader/node_loader_trampoline.h b/source/loaders/node_loader/include/node_loader/node_loader_trampoline.h index 228d6f5c6..84ea34ccf 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_trampoline.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_trampoline.h @@ -33,6 +33,8 @@ typedef void *(*node_loader_trampoline_register_ptr)(void *, void *, void *); NODE_LOADER_NO_EXPORT napi_value node_loader_trampoline_initialize(napi_env env, napi_value exports); +NODE_LOADER_NO_EXPORT napi_value node_loader_trampoline_initialize_object(napi_env env); + #ifdef __cplusplus } #endif diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 720c7b1a2..053754289 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -77,9 +77,6 @@ extern char **environ; #include <cstring> #include <atomic> -#include <fstream> -#include <new> -#include <streambuf> #include <string> #include <thread> @@ -553,6 +550,118 @@ struct loader_impl_async_destroy_safe_type node_impl(node_impl), has_finished(false) {} }; +static void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *function_table_object_ptr); + +typedef struct node_loader_impl_startup_args_type +{ + /* Executable path */ + portability_executable_path_str exe_path_str = { 0 }; + portability_executable_path_length length = 0; + size_t exe_path_str_size = 0, exe_path_str_offset = 0; + + /* Bootstrap path */ + loader_path bootstrap_path_str = { 0 }; + size_t bootstrap_path_str_size = 0; + + /* The node_impl pointer */ + char *node_impl_ptr_str = nullptr; + size_t node_impl_ptr_str_size = 0; + + /* The register function pointer */ + char *register_ptr_str = nullptr; + size_t register_ptr_str_size = 0; + + node_loader_impl_startup_args_type() {} + + ~node_loader_impl_startup_args_type() + { + if (node_impl_ptr_str != nullptr) + { + delete[] node_impl_ptr_str; + } + + if (register_ptr_str != nullptr) + { + delete[] register_ptr_str; + } + } + + int initialize(loader_impl_node node_impl, configuration config) + { + /* Get the executable */ + if (portability_executable_path(exe_path_str, &length) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Node loader failed to retrieve the executable path (%s)", exe_path_str); + return 1; + } + + for (size_t iterator = 0; iterator <= (size_t)length; ++iterator) + { +#if defined(WIN32) || defined(_WIN32) + if (exe_path_str[iterator] == '\\') +#else + if (exe_path_str[iterator] == '/') +#endif + { + exe_path_str_offset = iterator + 1; + } + } + + exe_path_str_size = (size_t)length - exe_path_str_offset + 1; + + /* Get the bootstrap.js path */ + static const char bootstrap_file_str[] = "bootstrap.js"; + + if (node_loader_impl_bootstrap_path(bootstrap_file_str, sizeof(bootstrap_file_str) - 1, config, bootstrap_path_str, &bootstrap_path_str_size) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "LOADER_LIBRARY_PATH environment variable or loader_library_path field in configuration is not defined, bootstrap.js cannot be found"); + return 1; + } + + /* Get node impl pointer */ + ssize_t node_impl_ptr_length = snprintf(NULL, 0, "%p", (void *)node_impl); + + if (node_impl_ptr_length <= 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid node impl pointer length in NodeJS thread"); + return 1; + } + + node_impl_ptr_str_size = static_cast<size_t>(node_impl_ptr_length + 1); + node_impl_ptr_str = new char[node_impl_ptr_str_size]; + + if (node_impl_ptr_str == nullptr) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid node impl pointer initialization in NodeJS thread"); + return 1; + } + + snprintf(node_impl_ptr_str, node_impl_ptr_str_size, "%p", (void *)node_impl); + + /* Get register pointer */ + ssize_t register_ptr_length = snprintf(NULL, 0, "%p", (void *)&node_loader_impl_register); + + if (register_ptr_length <= 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid register pointer length in NodeJS thread"); + return 1; + } + + register_ptr_str_size = static_cast<size_t>(register_ptr_length + 1); + register_ptr_str = new char[register_ptr_str_size]; + + if (register_ptr_str == nullptr) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid register pointer initialization in NodeJS thread"); + return 1; + } + + snprintf(register_ptr_str, register_ptr_str_size, "%p", (void *)&node_loader_impl_register); + + return 0; + } +} * node_loader_impl_startup_args; + struct loader_impl_node_type { /* TODO: The current implementation may not support multi-isolate environments. We should test it. */ @@ -588,8 +697,8 @@ struct loader_impl_node_type uv_thread_t thread_log_id; #endif + node_loader_impl_startup_args_type thread_data; int result; - const char *error_message; /* TODO: This implementation won't work for multi-isolate environments. We should test it. */ std::thread::id js_thread_id; @@ -688,13 +797,6 @@ typedef struct loader_impl_async_func_await_trampoline_type } * loader_impl_async_func_await_trampoline; -typedef struct loader_impl_thread_type -{ - loader_impl_node node_impl; - configuration config; - -} * loader_impl_thread; - typedef struct loader_impl_napi_to_value_callback_closure_type { value func; @@ -702,6 +804,23 @@ typedef struct loader_impl_napi_to_value_callback_closure_type } * loader_impl_napi_to_value_callback_closure; +class loader_impl_napi_constructor +{ +public: + loader_impl_napi_constructor() + { + if (metacall_link_register("napi_register_module_v1", (void (*)(void))(&node_loader_port_initialize)) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Node loader failed register the link hook"); + } + } + + ~loader_impl_napi_constructor() {} +}; + +/* Initializer of napi_register_module_v1 */ +static loader_impl_napi_constructor loader_impl_napi_ctor; + /* Type conversion */ static napi_value node_loader_impl_napi_to_value_callback(napi_env env, napi_callback_info info); @@ -757,8 +876,6 @@ static void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destro static char *node_loader_impl_get_property_as_char(napi_env env, napi_value obj, const char *prop); /* Loader */ -static void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *function_table_object_ptr); - static void node_loader_impl_thread(void *data); #ifdef __ANDROID__ @@ -3590,185 +3707,30 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi void node_loader_impl_thread(void *data) { - loader_impl_thread thread_data = static_cast<loader_impl_thread>(data); - loader_impl_node node_impl = thread_data->node_impl; - configuration config = thread_data->config; + loader_impl_node node_impl = static_cast<loader_impl_node>(data); + node_loader_impl_startup_args args = &node_impl->thread_data; /* Lock node implementation mutex */ uv_mutex_lock(&node_impl->mutex); - /* TODO: Reimplement from here to ... */ - portability_executable_path_str exe_path_str = { 0 }; - portability_executable_path_length length = 0; - size_t exe_path_str_size = 0, exe_path_str_offset = 0; - - if (portability_executable_path(exe_path_str, &length) != 0) - { - /* Report error (TODO: Implement it with thread safe logs) */ - node_impl->error_message = "Node loader failed to retrieve the executable path"; - - /* TODO: Make logs thread safe */ - /* log_write("metacall", LOG_LEVEL_ERROR, "Node loader failed to retrieve the executable path (%s)", exe_path_str); */ - - /* Signal start condition */ - uv_cond_signal(&node_impl->cond); - - /* Unlock node implementation mutex */ - uv_mutex_unlock(&node_impl->mutex); - - return; - } - - for (size_t iterator = 0; iterator <= (size_t)length; ++iterator) - { -#if defined(WIN32) || defined(_WIN32) - if (exe_path_str[iterator] == '\\') -#else - if (exe_path_str[iterator] == '/') -#endif - { - exe_path_str_offset = iterator + 1; - } - } - - exe_path_str_size = (size_t)length - exe_path_str_offset + 1; - - /* Get the boostrap path */ - static const char bootstrap_file_str[] = "bootstrap.js"; - loader_path bootstrap_path_str = { 0 }; - size_t bootstrap_path_str_size = 0; - - if (node_loader_impl_bootstrap_path(bootstrap_file_str, sizeof(bootstrap_file_str) - 1, config, bootstrap_path_str, &bootstrap_path_str_size) != 0) - { - /* Report error (TODO: Implement it with thread safe logs) */ - node_impl->error_message = "LOADER_LIBRARY_PATH environment variable or loader_library_path field in configuration is not defined, bootstrap.js cannot be found"; - - /* Signal start condition */ - uv_cond_signal(&node_impl->cond); - - /* Unlock node implementation mutex */ - uv_mutex_unlock(&node_impl->mutex); - - return; - } - - /* Get node impl pointer */ - char *node_impl_ptr_str; - size_t node_impl_ptr_str_size; - - ssize_t node_impl_ptr_length = snprintf(NULL, 0, "%p", (void *)node_impl); - - if (node_impl_ptr_length <= 0) - { - /* Report error (TODO: Implement it with thread safe logs) */ - node_impl->error_message = "Invalid node impl pointer length in NodeJS thread"; - - /* Signal start condition */ - uv_cond_signal(&node_impl->cond); - - /* Unlock node implementation mutex */ - uv_mutex_unlock(&node_impl->mutex); - - return; - } - - node_impl_ptr_str_size = static_cast<size_t>(node_impl_ptr_length + 1); - node_impl_ptr_str = new char[node_impl_ptr_str_size]; - - if (node_impl_ptr_str == nullptr) - { - /* Report error (TODO: Implement it with thread safe logs) */ - node_impl->error_message = "Invalid node impl pointer initialization in NodeJS thread"; - - /* Signal start condition */ - uv_cond_signal(&node_impl->cond); - - /* Unlock node implementation mutex */ - uv_mutex_unlock(&node_impl->mutex); - - return; - } - - snprintf(node_impl_ptr_str, node_impl_ptr_str_size, "%p", (void *)node_impl); - - /* Get register pointer */ - char *register_ptr_str; - size_t register_ptr_str_size; - ssize_t register_ptr_length = snprintf(NULL, 0, "%p", (void *)&node_loader_impl_register); - - if (register_ptr_length <= 0) - { - /* Report error (TODO: Implement it with thread safe logs) */ - node_impl->error_message = "Invalid register pointer length in NodeJS thread"; - - /* Signal start condition */ - uv_cond_signal(&node_impl->cond); - - /* Unlock node implementation mutex */ - uv_mutex_unlock(&node_impl->mutex); - - return; - } - - register_ptr_str_size = static_cast<size_t>(register_ptr_length + 1); - register_ptr_str = new char[register_ptr_str_size]; - - if (register_ptr_str == nullptr) - { - delete[] node_impl_ptr_str; - - /* Report error (TODO: Implement it with thread safe logs) */ - node_impl->error_message = "Invalid register pointer initialization in NodeJS thread"; - - /* Signal start condition */ - uv_cond_signal(&node_impl->cond); - - /* Unlock node implementation mutex */ - uv_mutex_unlock(&node_impl->mutex); - - return; - } - - snprintf(register_ptr_str, register_ptr_str_size, "%p", (void *)&node_loader_impl_register); - /* Define argv_str contigously allocated with: executable name, bootstrap file, node impl pointer and register pointer */ - size_t argv_str_size = exe_path_str_size + bootstrap_path_str_size + node_impl_ptr_str_size + register_ptr_str_size; + size_t argv_str_size = args->exe_path_str_size + args->bootstrap_path_str_size + args->node_impl_ptr_str_size + args->register_ptr_str_size; char *argv_str = new char[argv_str_size]; - if (argv_str == nullptr) - { - delete[] node_impl_ptr_str; - delete[] register_ptr_str; - - /* Report error (TODO: Implement it with thread safe logs) */ - node_impl->error_message = "Invalid argv initialization in NodeJS thread"; - - /* Signal start condition */ - uv_cond_signal(&node_impl->cond); - - /* Unlock node implementation mutex */ - uv_mutex_unlock(&node_impl->mutex); - - return; - } - /* Initialize the argv string memory */ memset(argv_str, 0, sizeof(char) * argv_str_size); - memcpy(&argv_str[0], &exe_path_str[exe_path_str_offset], exe_path_str_size); - memcpy(&argv_str[exe_path_str_size], bootstrap_path_str, bootstrap_path_str_size); - memcpy(&argv_str[exe_path_str_size + bootstrap_path_str_size], node_impl_ptr_str, node_impl_ptr_str_size); - memcpy(&argv_str[exe_path_str_size + bootstrap_path_str_size + node_impl_ptr_str_size], register_ptr_str, register_ptr_str_size); - - delete[] node_impl_ptr_str; - delete[] register_ptr_str; + memcpy(&argv_str[0], &args->exe_path_str[args->exe_path_str_offset], args->exe_path_str_size); + memcpy(&argv_str[args->exe_path_str_size], args->bootstrap_path_str, args->bootstrap_path_str_size); + memcpy(&argv_str[args->exe_path_str_size + args->bootstrap_path_str_size], args->node_impl_ptr_str, args->node_impl_ptr_str_size); + memcpy(&argv_str[args->exe_path_str_size + args->bootstrap_path_str_size + args->node_impl_ptr_str_size], args->register_ptr_str, args->register_ptr_str_size); /* Define argv */ char *argv[] = { &argv_str[0], - &argv_str[exe_path_str_size], - &argv_str[exe_path_str_size + bootstrap_path_str_size], - &argv_str[exe_path_str_size + bootstrap_path_str_size + node_impl_ptr_str_size], + &argv_str[args->exe_path_str_size], + &argv_str[args->exe_path_str_size + args->bootstrap_path_str_size], + &argv_str[args->exe_path_str_size + args->bootstrap_path_str_size + args->node_impl_ptr_str_size], NULL }; @@ -3817,8 +3779,6 @@ void node_loader_impl_thread(void *data) /* Unlock node implementation mutex */ uv_mutex_unlock(&node_impl->mutex); - /* Register bindings for versions older than 18 */ - /* Start NodeJS runtime */ int result = node::Start(argc, reinterpret_cast<char **>(argv)); @@ -3915,7 +3875,6 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con /* Initialize execution result */ node_impl->result = 1; - node_impl->error_message = NULL; /* Initialize the reference to the loader so we can use it on the destruction */ node_impl->impl = impl; @@ -3936,15 +3895,19 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con } #endif - struct loader_impl_thread_type thread_data = { - node_impl, - config - }; + if (node_impl->thread_data.initialize(node_impl, config) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid startup arguments creation"); + + delete node_impl; + + return NULL; + } if (loader_impl_get_option_host(impl) == 0) { /* Create NodeJS thread */ - if (uv_thread_create(&node_impl->thread, node_loader_impl_thread, &thread_data) != 0) + if (uv_thread_create(&node_impl->thread, node_loader_impl_thread, node_impl) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid NodeJS Thread creation"); @@ -3960,50 +3923,45 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con uv_cond_wait(&node_impl->cond, &node_impl->mutex); - if (node_impl->error_message != NULL) - { - uv_mutex_unlock(&node_impl->mutex); - - /* TODO: Remove this when implementing thread safe */ - log_write("metacall", LOG_LEVEL_ERROR, node_impl->error_message); - - return NULL; - } - uv_mutex_unlock(&node_impl->mutex); - } - - /* Call initialize function with thread safe */ - { - loader_impl_async_initialize_safe_type initialize_safe(node_impl, value_to_string(configuration_value(config, "loader_library_path"))); - int result = 1; - /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) + /* Call initialize function with thread safe (only when not using host) */ { - /* We are already in the V8 thread, we can call safely */ - node_loader_impl_initialize_safe(node_impl->env, &initialize_safe); + loader_impl_async_initialize_safe_type initialize_safe(node_impl, value_to_string(configuration_value(config, "loader_library_path"))); + int result = 1; - /* Set up return of the function call */ - result = initialize_safe.result; - } - else - { - /* Submit the task to the async queue */ - loader_impl_threadsafe_invoke_type<loader_impl_async_initialize_safe_type> invoke(node_impl->threadsafe_initialize, initialize_safe); + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_initialize_safe(node_impl->env, &initialize_safe); - /* Set up return of the function call */ - result = initialize_safe.result; - } + /* Set up return of the function call */ + result = initialize_safe.result; + } + else + { + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type<loader_impl_async_initialize_safe_type> invoke(node_impl->threadsafe_initialize, initialize_safe); - if (result != 0) - { - /* TODO: Implement better error message */ - log_write("metacall", LOG_LEVEL_ERROR, "Call to initialization function node_loader_impl_async_initialize_safe failed"); + /* Set up return of the function call */ + result = initialize_safe.result; + } - /* TODO: Handle properly the error */ + if (result != 0) + { + /* TODO: Implement better error message */ + log_write("metacall", LOG_LEVEL_ERROR, "Call to initialization function node_loader_impl_async_initialize_safe failed"); + + /* TODO: Handle properly the error */ + } } } + else + { + // TODO: Set this to NULL and if in execution_path is null, delay the execution paths.. + node_impl->thread_loop = uv_default_loop(); + } /* Register initialization */ loader_initialization_register(impl); @@ -4011,29 +3969,65 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con return node_impl; } -int node_loader_impl_execution_path(loader_impl impl, const loader_path path) +napi_value node_loader_impl_register_bootstrap_startup(loader_impl_node node_impl, napi_env env) { - loader_impl_node node_impl = static_cast<loader_impl_node>(loader_impl_get(impl)); + node_loader_impl_startup_args args = &node_impl->thread_data; + napi_value argv[4], v; + napi_status status; - if (node_impl == nullptr) - { - return 1; - } + status = napi_create_array_with_length(env, 4, &v); + node_loader_impl_exception(env, status); - loader_impl_async_execution_path_safe_type execution_path_safe(node_impl, static_cast<const char *>(path)); + /* Convert bootstrap.js path to N-API value */ + status = napi_create_string_utf8(env, args->bootstrap_path_str, args->bootstrap_path_str_size - 1, &argv[0]); + node_loader_impl_exception(env, status); - /* Check if we are in the JavaScript thread */ - if (node_impl->js_thread_id == std::this_thread::get_id()) - { - /* We are already in the V8 thread, we can call safely */ - node_loader_impl_execution_path_safe(node_impl->env, &execution_path_safe); - } - else + /* Convert node impl to N-API value */ + status = napi_create_string_utf8(env, args->node_impl_ptr_str, args->node_impl_ptr_str_size - 1, &argv[1]); + node_loader_impl_exception(env, status); + + /* Convert register to N-API value */ + status = napi_create_string_utf8(env, args->register_ptr_str, args->register_ptr_str_size - 1, &argv[2]); + node_loader_impl_exception(env, status); + + /* Create trampoline exports */ + argv[3] = node_loader_trampoline_initialize_object(env); + + /* Set the values */ + for (size_t iterator = 0; iterator < 4; ++iterator) { - /* Submit the task to the async queue */ - loader_impl_threadsafe_invoke_type<loader_impl_async_execution_path_safe_type> invoke(node_impl->threadsafe_execution_path, execution_path_safe); + status = napi_set_element(env, v, iterator, argv[iterator]); + node_loader_impl_exception(env, status); } + return v; +} + +int node_loader_impl_execution_path(loader_impl impl, const loader_path path) +{ + // TODO: + + // loader_impl_node node_impl = static_cast<loader_impl_node>(loader_impl_get(impl)); + + // if (node_impl == nullptr) + // { + // return 1; + // } + + // loader_impl_async_execution_path_safe_type execution_path_safe(node_impl, static_cast<const char *>(path)); + + // /* Check if we are in the JavaScript thread */ + // if (node_impl->js_thread_id == std::this_thread::get_id()) + // { + // /* We are already in the V8 thread, we can call safely */ + // node_loader_impl_execution_path_safe(node_impl->env, &execution_path_safe); + // } + // else + // { + // /* Submit the task to the async queue */ + // loader_impl_threadsafe_invoke_type<loader_impl_async_execution_path_safe_type> invoke(node_impl->threadsafe_execution_path, execution_path_safe); + // } + return 0; } diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index 8261f6bce..2238c0ab3 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -799,6 +799,16 @@ napi_value node_loader_port_metacall_logs(napi_env env, napi_callback_info) return nullptr; } +napi_value node_loader_port_register_bootstrap_startup(napi_env env, napi_callback_info) +{ + /* Obtain NodeJS loader implementation */ + loader_impl impl = loader_get_impl(node_loader_tag); + loader_impl_node node_impl = static_cast<loader_impl_node>(loader_impl_get(impl)); + + /* Return all the values required for the bootstrap startup */ + return node_loader_impl_register_bootstrap_startup(node_impl, env); +} + /* TODO: Review documentation */ // This functions sets the necessary js functions that could be called in NodeJs void node_loader_port_exports(napi_env env, napi_value exports) @@ -823,7 +833,8 @@ void node_loader_port_exports(napi_env env, napi_value exports) x(metacall_load_from_configuration); \ x(metacall_load_from_configuration_export); \ x(metacall_inspect); \ - x(metacall_logs); + x(metacall_logs); \ + x(register_bootstrap_startup); /* Declare all the functions */ NODE_LOADER_PORT_DECL_X_MACRO(NODE_LOADER_PORT_DECL_FUNC) @@ -838,5 +849,11 @@ napi_value node_loader_port_initialize(napi_env env, napi_value exports) { node_loader_port_exports(env, exports); + /* Unregister NAPI Hook */ + if (metacall_link_unregister("napi_register_module_v1") != 0) + { + // TODO: Handle error + } + return exports; } diff --git a/source/loaders/node_loader/source/node_loader_trampoline.cpp b/source/loaders/node_loader/source/node_loader_trampoline.cpp index 184fbbcda..6314d2d30 100644 --- a/source/loaders/node_loader/source/node_loader_trampoline.cpp +++ b/source/loaders/node_loader/source/node_loader_trampoline.cpp @@ -427,3 +427,31 @@ napi_value node_loader_trampoline_initialize(napi_env env, napi_value exports) return exports; } + +#define NODE_LOADER_TRAMPOLINE_DECLARE_OBJ_METHOD(name, func) \ + do \ + { \ + napi_value func_value; \ + status = napi_create_function(env, name, NAPI_AUTO_LENGTH, func, nullptr, &func_value); \ + node_loader_impl_exception(env, status); \ + napi_set_named_property(env, obj, name, func_value); \ + node_loader_impl_exception(env, status); \ + } while (0) + +napi_value node_loader_trampoline_initialize_object(napi_env env) +{ + napi_value obj; + napi_status status; + + status = napi_create_object(env, &obj); + node_loader_impl_exception(env, status); + + NODE_LOADER_TRAMPOLINE_DECLARE_OBJ_METHOD("register", node_loader_trampoline_register); + NODE_LOADER_TRAMPOLINE_DECLARE_OBJ_METHOD("resolve", node_loader_trampoline_resolve); + NODE_LOADER_TRAMPOLINE_DECLARE_OBJ_METHOD("reject", node_loader_trampoline_reject); + NODE_LOADER_TRAMPOLINE_DECLARE_OBJ_METHOD("destroy", node_loader_trampoline_destroy); + NODE_LOADER_TRAMPOLINE_DECLARE_OBJ_METHOD("print", node_loader_trampoline_print); + NODE_LOADER_TRAMPOLINE_DECLARE_OBJ_METHOD("active_handles", node_loader_trampoline_active_handles); + + return obj; +} diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 02ab3deaa..d7d19f815 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -350,11 +350,22 @@ int metacall_initialize_ex(struct metacall_initialize_configuration_type initial if (impl == NULL) { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall failed to find '%s_loader'", initialize_config[index].tag); return 1; } loader_set_options(initialize_config[index].tag, initialize_config[index].options); + /* If we are initializing a loader as a host, we must initialize it */ + if (loader_get_option_host(initialize_config[index].tag)) + { + if (loader_initialize_host(initialize_config[index].tag) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall failed to initialize '%s_loader' as host", initialize_config[index].tag); + return 1; + } + } + ++index; } diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 0120fbf61..db45810f2 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -133,8 +133,21 @@ const addon = (() => { process.dlopen(m, library, constants.dlopen.RTLD_GLOBAL | constants.dlopen.RTLD_NOW); - // TODO: What to do with m? should we use process._linkedBinding instead, no? + /* Save argv */ + const argv = process.argv; + process.argv = []; + /* Pass the require function in order to import bootstrap.js and register it */ + const args = m.exports.register_bootstrap_startup(); + + const bootstrap = require(args[0]); + + bootstrap(args[1], args[2], args[3]); + + /* Restore argv */ + process.argv = argv; + + return m.exports; }).catch(err => { console.log(err); process.exit(1); From 7779200ec041e19e334a6ed6f0d4561b41f8985f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 4 Dec 2024 19:59:03 +0100 Subject: [PATCH 109/487] Add delayed execution paths in NodeJS. --- .../node_loader/source/node_loader_impl.cpp | 81 +++++++++++++------ .../node_loader/source/node_loader_port.cpp | 3 + 2 files changed, 59 insertions(+), 25 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 053754289..33a0ea036 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -684,6 +684,7 @@ struct loader_impl_node_type uv_thread_t thread; uv_loop_t *thread_loop; + std::vector<std::string> *delayed_execution_paths; uv_mutex_t mutex; uv_cond_t cond; @@ -3691,6 +3692,24 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi get_module_handle_a_ptr = (HMODULE(*)(_In_opt_ LPCSTR))node_loader_hook_import_address_table("kernel32.dll", "GetModuleHandleA", &get_module_handle_a_hook); #endif + /* On host mode, register delayed paths */ + if (node_impl->delayed_execution_paths != nullptr) + { + std::vector<std::string> *paths = node_impl->delayed_execution_paths; + + node_impl->delayed_execution_paths = nullptr; + + for (const std::string &path : *paths) + { + if (node_loader_impl_execution_path(node_impl->impl, path.c_str()) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to register a delayed execution path: %s", path.c_str()); + } + } + + delete paths; + } + /* Close scope */ status = napi_close_handle_scope(env, handle_scope); @@ -3736,8 +3755,7 @@ void node_loader_impl_thread(void *data) int argc = 4; - /* TODO: ... reimplement until here */ - + /* Initialize current thread event loop */ node_impl->thread_loop = uv_default_loop(); #if defined(__POSIX__) @@ -3956,11 +3974,17 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con /* TODO: Handle properly the error */ } } + + /* Initialize delayed execution paths to null, they are only used in host mode */ + node_impl->delayed_execution_paths = nullptr; } else { - // TODO: Set this to NULL and if in execution_path is null, delay the execution paths.. + /* Initialize current thread event loop */ node_impl->thread_loop = uv_default_loop(); + + /* Initialize delayed execution paths for register them once it has been initialized */ + node_impl->delayed_execution_paths = new std::vector<std::string>(); } /* Register initialization */ @@ -4005,28 +4029,35 @@ napi_value node_loader_impl_register_bootstrap_startup(loader_impl_node node_imp int node_loader_impl_execution_path(loader_impl impl, const loader_path path) { - // TODO: - - // loader_impl_node node_impl = static_cast<loader_impl_node>(loader_impl_get(impl)); - - // if (node_impl == nullptr) - // { - // return 1; - // } - - // loader_impl_async_execution_path_safe_type execution_path_safe(node_impl, static_cast<const char *>(path)); - - // /* Check if we are in the JavaScript thread */ - // if (node_impl->js_thread_id == std::this_thread::get_id()) - // { - // /* We are already in the V8 thread, we can call safely */ - // node_loader_impl_execution_path_safe(node_impl->env, &execution_path_safe); - // } - // else - // { - // /* Submit the task to the async queue */ - // loader_impl_threadsafe_invoke_type<loader_impl_async_execution_path_safe_type> invoke(node_impl->threadsafe_execution_path, execution_path_safe); - // } + loader_impl_node node_impl = static_cast<loader_impl_node>(loader_impl_get(impl)); + + if (node_impl == nullptr) + { + return 1; + } + + /* When using host mode, the paths are registered before NodeJS is properly initialized, + * delay the execution path registration until it is properly registered + */ + if (node_impl->delayed_execution_paths != nullptr) + { + node_impl->delayed_execution_paths->push_back(path); + return 0; + } + + loader_impl_async_execution_path_safe_type execution_path_safe(node_impl, static_cast<const char *>(path)); + + /* Check if we are in the JavaScript thread */ + if (node_impl->js_thread_id == std::this_thread::get_id()) + { + /* We are already in the V8 thread, we can call safely */ + node_loader_impl_execution_path_safe(node_impl->env, &execution_path_safe); + } + else + { + /* Submit the task to the async queue */ + loader_impl_threadsafe_invoke_type<loader_impl_async_execution_path_safe_type> invoke(node_impl->threadsafe_execution_path, execution_path_safe); + } return 0; } diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index 2238c0ab3..773e62cca 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -805,6 +805,9 @@ napi_value node_loader_port_register_bootstrap_startup(napi_env env, napi_callba loader_impl impl = loader_get_impl(node_loader_tag); loader_impl_node node_impl = static_cast<loader_impl_node>(loader_impl_get(impl)); + /* Define environment, required to initialize the runtime properly */ + node_loader_impl_env(node_impl, env); + /* Return all the values required for the bootstrap startup */ return node_loader_impl_register_bootstrap_startup(node_impl, env); } From 55a8553a6396f7f0791f8ec3921a2da9ccc05ea6 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 5 Dec 2024 18:35:10 +0100 Subject: [PATCH 110/487] Add base for destroy in node. --- .../node_loader/source/node_loader_impl.cpp | 74 ++++++++++++++----- 1 file changed, 57 insertions(+), 17 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 33a0ea036..b32154153 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -874,6 +874,8 @@ static void node_loader_impl_handle_promise_safe(napi_env env, loader_impl_async static void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe_type *destroy_safe); +static void node_loader_impl_destroy_hook(loader_impl_node node_impl); + static char *node_loader_impl_get_property_as_char(napi_env env, napi_value obj, const char *prop); /* Loader */ @@ -3708,6 +3710,9 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi } delete paths; + + /* Trigger destroy hook */ + node_loader_impl_destroy_hook(node_impl); } /* Close scope */ @@ -3985,6 +3990,9 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con /* Initialize delayed execution paths for register them once it has been initialized */ node_impl->delayed_execution_paths = new std::vector<std::string>(); + + /* Result will never be defined properly */ + node_impl->result = 0; } /* Register initialization */ @@ -4267,6 +4275,32 @@ napi_value node_loader_impl_promise_await(loader_impl_node node_impl, napi_env e return promise; } +static void node_loader_impl_destroy_close_cb(loader_impl_node node_impl, napi_env env) +{ + if (--node_impl->extra_active_handles == 0) + { + if (loader_impl_get_option_host(node_impl->impl) == 0) + { + node_loader_impl_try_destroy(node_impl); + } + else + { + node_impl->threadsafe_initialize.abort(env); + node_impl->threadsafe_execution_path.abort(env); + node_impl->threadsafe_load_from_file.abort(env); + node_impl->threadsafe_load_from_memory.abort(env); + node_impl->threadsafe_clear.abort(env); + node_impl->threadsafe_discover.abort(env); + node_impl->threadsafe_func_call.abort(env); + node_impl->threadsafe_func_await.abort(env); + node_impl->threadsafe_func_destroy.abort(env); + node_impl->threadsafe_future_await.abort(env); + node_impl->threadsafe_future_delete.abort(env); + node_impl->threadsafe_destroy.abort(env); + } + } +} + #define container_of(ptr, type, member) \ (type *)((char *)(ptr) - (char *)&((type *)0)->member) @@ -4275,10 +4309,7 @@ static void node_loader_impl_destroy_prepare_close_cb(uv_handle_t *handle) uv_prepare_t *prepare = (uv_prepare_t *)handle; loader_impl_node node_impl = container_of(prepare, struct loader_impl_node_type, destroy_prepare); - if (--node_impl->extra_active_handles == 0) - { - node_loader_impl_try_destroy(node_impl); - } + node_loader_impl_destroy_close_cb(node_impl, node_impl->env); } static void node_loader_impl_destroy_check_close_cb(uv_handle_t *handle) @@ -4286,10 +4317,7 @@ static void node_loader_impl_destroy_check_close_cb(uv_handle_t *handle) uv_check_t *check = (uv_check_t *)handle; loader_impl_node node_impl = container_of(check, struct loader_impl_node_type, destroy_check); - if (--node_impl->extra_active_handles == 0) - { - node_loader_impl_try_destroy(node_impl); - } + node_loader_impl_destroy_close_cb(node_impl, node_impl->env); } static void node_loader_impl_destroy_cb(loader_impl_node node_impl) @@ -4329,6 +4357,15 @@ static void node_loader_impl_destroy_check_cb(uv_check_t *handle) node_loader_impl_destroy_cb(node_impl); } +void node_loader_impl_destroy_hook(loader_impl_node node_impl) +{ + node_impl->extra_active_handles.store(2); + uv_prepare_init(node_impl->thread_loop, &node_impl->destroy_prepare); + uv_check_init(node_impl->thread_loop, &node_impl->destroy_check); + uv_prepare_start(&node_impl->destroy_prepare, &node_loader_impl_destroy_prepare_cb); + uv_check_start(&node_impl->destroy_check, &node_loader_impl_destroy_check_cb); +} + void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe_type *destroy_safe) { napi_status status; @@ -4349,11 +4386,7 @@ void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe_ } else { - node_impl->extra_active_handles.store(2); - uv_prepare_init(node_impl->thread_loop, &node_impl->destroy_prepare); - uv_check_init(node_impl->thread_loop, &node_impl->destroy_check); - uv_prepare_start(&node_impl->destroy_prepare, &node_loader_impl_destroy_prepare_cb); - uv_check_start(&node_impl->destroy_check, &node_loader_impl_destroy_check_cb); + node_loader_impl_destroy_hook(node_impl); } /* Close scope */ @@ -4500,6 +4533,7 @@ void node_loader_impl_destroy_safe_impl(loader_impl_node node_impl, napi_env env node_loader_impl_exception(env, status); /* Clear thread safe functions except by destroy one */ + if (loader_impl_get_option_host(node_impl->impl) == 0) { node_impl->threadsafe_initialize.abort(env); node_impl->threadsafe_execution_path.abort(env); @@ -4552,9 +4586,12 @@ void node_loader_impl_try_destroy(loader_impl_node node_impl) loader_impl_threadsafe_invoke_type<loader_impl_async_destroy_safe_type> invoke(node_impl->threadsafe_destroy, destroy_safe); } - if (destroy_safe.has_finished) + if (loader_impl_get_option_host(node_impl->impl) == 0) { - node_impl->threadsafe_destroy.abort(node_impl->env); + if (destroy_safe.has_finished) + { + node_impl->threadsafe_destroy.abort(node_impl->env); + } } } @@ -4570,8 +4607,11 @@ int node_loader_impl_destroy(loader_impl impl) /* Call destroy function with thread safe */ node_loader_impl_try_destroy(node_impl); - /* Wait for node thread to finish */ - uv_thread_join(&node_impl->thread); + if (loader_impl_get_option_host(impl) == 0) + { + /* Wait for node thread to finish */ + uv_thread_join(&node_impl->thread); + } /* Clear condition syncronization object */ uv_cond_destroy(&node_impl->cond); From 182b646062b4ffb855d984ca9ff80fc9710a842e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 11 Dec 2024 01:56:23 +0100 Subject: [PATCH 111/487] Improve rs port. --- source/ports/rs_port/.vscode/settings.json | 4 + source/ports/rs_port/CMakeLists.txt | 2 + source/ports/rs_port/README.md | 2 +- source/ports/rs_port/src/bindings.rs | 5644 +---------------- source/ports/rs_port/src/helpers.rs | 56 +- source/ports/rs_port/src/lib.rs | 6 +- source/ports/rs_port/src/loaders.rs | 24 +- source/ports/rs_port/src/macros.rs | 8 +- source/ports/rs_port/src/metacall.rs | 34 +- source/ports/rs_port/src/parsers.rs | 120 +- source/ports/rs_port/src/switch.rs | 14 +- .../ports/rs_port/src/types/metacall_class.rs | 94 +- .../ports/rs_port/src/types/metacall_error.rs | 46 +- .../rs_port/src/types/metacall_exception.rs | 60 +- .../rs_port/src/types/metacall_function.rs | 44 +- .../rs_port/src/types/metacall_future.rs | 94 +- .../ports/rs_port/src/types/metacall_null.rs | 12 +- .../rs_port/src/types/metacall_object.rs | 78 +- .../rs_port/src/types/metacall_pointer.rs | 50 +- .../ports/rs_port/src/types/metacall_value.rs | 240 +- .../rs_port/tests/invalid_loaders_test.rs | 8 +- source/ports/rs_port/tests/loaders_test.rs | 9 +- .../rs_port/tests/metacall_exception_test.rs | 6 +- source/ports/rs_port/tests/metacall_test.rs | 88 +- 24 files changed, 897 insertions(+), 5846 deletions(-) create mode 100644 source/ports/rs_port/.vscode/settings.json diff --git a/source/ports/rs_port/.vscode/settings.json b/source/ports/rs_port/.vscode/settings.json new file mode 100644 index 000000000..c57b92269 --- /dev/null +++ b/source/ports/rs_port/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "rust-analyzer.checkOnSave": true, + "rust-analyzer.check.command": "clippy" +} diff --git a/source/ports/rs_port/CMakeLists.txt b/source/ports/rs_port/CMakeLists.txt index 62e25e910..109d7df37 100644 --- a/source/ports/rs_port/CMakeLists.txt +++ b/source/ports/rs_port/CMakeLists.txt @@ -46,6 +46,8 @@ if(Rust_BINDGEN_EXECUTABLE) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${Rust_BINDGEN_EXECUTABLE} --no-include-path-detection + --allowlist-function 'metacall.*' + --rustified-enum 'metacall_.*' "${CMAKE_SOURCE_DIR}/source/metacall/include/metacall/metacall.h" -o "${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.rs" -- diff --git a/source/ports/rs_port/README.md b/source/ports/rs_port/README.md index 7c1006a6d..298bf9ab3 100644 --- a/source/ports/rs_port/README.md +++ b/source/ports/rs_port/README.md @@ -29,7 +29,7 @@ export function sum(a: number, b: number): number { use metacall::{switch, metacall, loaders}; fn main() { - // Initialize Metacall at the top + // Initialize MetaCall at the top let _metacall = switch::initialize().unwrap(); // Load the file diff --git a/source/ports/rs_port/src/bindings.rs b/source/ports/rs_port/src/bindings.rs index ceadd6e6e..fdfc35049 100644 --- a/source/ports/rs_port/src/bindings.rs +++ b/source/ports/rs_port/src/bindings.rs @@ -1,4407 +1,412 @@ -/* automatically generated by rust-bindgen 0.65.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ -pub const METACALL_H: u32 = 1; -pub const METACALL_ALLOCATOR_H: u32 = 1; -pub const _STDINT_H: u32 = 1; -pub const _FEATURES_H: u32 = 1; -pub const _DEFAULT_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; -pub const __USE_ISOC11: u32 = 1; -pub const __USE_ISOC99: u32 = 1; -pub const __USE_ISOC95: u32 = 1; -pub const __USE_POSIX_IMPLICITLY: u32 = 1; -pub const _POSIX_SOURCE: u32 = 1; -pub const _POSIX_C_SOURCE: u32 = 200809; -pub const __USE_POSIX: u32 = 1; -pub const __USE_POSIX2: u32 = 1; -pub const __USE_POSIX199309: u32 = 1; -pub const __USE_POSIX199506: u32 = 1; -pub const __USE_XOPEN2K: u32 = 1; -pub const __USE_XOPEN2K8: u32 = 1; -pub const _ATFILE_SOURCE: u32 = 1; -pub const __USE_MISC: u32 = 1; -pub const __USE_ATFILE: u32 = 1; -pub const __USE_FORTIFY_LEVEL: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; -pub const _STDC_PREDEF_H: u32 = 1; -pub const __STDC_IEC_559__: u32 = 1; -pub const __STDC_IEC_559_COMPLEX__: u32 = 1; -pub const __STDC_ISO_10646__: u32 = 201706; -pub const __GNU_LIBRARY__: u32 = 6; -pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 33; -pub const _SYS_CDEFS_H: u32 = 1; -pub const __glibc_c99_flexarr_available: u32 = 1; -pub const __WORDSIZE: u32 = 64; -pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; -pub const __SYSCALL_WORDSIZE: u32 = 64; -pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; -pub const __HAVE_GENERIC_SELECTION: u32 = 1; -pub const __GLIBC_USE_LIB_EXT2: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; -pub const _BITS_TYPES_H: u32 = 1; -pub const __TIMESIZE: u32 = 64; -pub const _BITS_TYPESIZES_H: u32 = 1; -pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; -pub const __INO_T_MATCHES_INO64_T: u32 = 1; -pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; -pub const __STATFS_MATCHES_STATFS64: u32 = 1; -pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const _BITS_TIME64_H: u32 = 1; -pub const _BITS_WCHAR_H: u32 = 1; -pub const _BITS_STDINT_INTN_H: u32 = 1; -pub const _BITS_STDINT_UINTN_H: u32 = 1; -pub const INT8_MIN: i32 = -128; -pub const INT16_MIN: i32 = -32768; -pub const INT32_MIN: i32 = -2147483648; -pub const INT8_MAX: u32 = 127; -pub const INT16_MAX: u32 = 32767; -pub const INT32_MAX: u32 = 2147483647; -pub const UINT8_MAX: u32 = 255; -pub const UINT16_MAX: u32 = 65535; -pub const UINT32_MAX: u32 = 4294967295; -pub const INT_LEAST8_MIN: i32 = -128; -pub const INT_LEAST16_MIN: i32 = -32768; -pub const INT_LEAST32_MIN: i32 = -2147483648; -pub const INT_LEAST8_MAX: u32 = 127; -pub const INT_LEAST16_MAX: u32 = 32767; -pub const INT_LEAST32_MAX: u32 = 2147483647; -pub const UINT_LEAST8_MAX: u32 = 255; -pub const UINT_LEAST16_MAX: u32 = 65535; -pub const UINT_LEAST32_MAX: u32 = 4294967295; -pub const INT_FAST8_MIN: i32 = -128; -pub const INT_FAST16_MIN: i64 = -9223372036854775808; -pub const INT_FAST32_MIN: i64 = -9223372036854775808; -pub const INT_FAST8_MAX: u32 = 127; -pub const INT_FAST16_MAX: u64 = 9223372036854775807; -pub const INT_FAST32_MAX: u64 = 9223372036854775807; -pub const UINT_FAST8_MAX: u32 = 255; -pub const UINT_FAST16_MAX: i32 = -1; -pub const UINT_FAST32_MAX: i32 = -1; -pub const INTPTR_MIN: i64 = -9223372036854775808; -pub const INTPTR_MAX: u64 = 9223372036854775807; -pub const UINTPTR_MAX: i32 = -1; -pub const PTRDIFF_MIN: i64 = -9223372036854775808; -pub const PTRDIFF_MAX: u64 = 9223372036854775807; -pub const SIG_ATOMIC_MIN: i32 = -2147483648; -pub const SIG_ATOMIC_MAX: u32 = 2147483647; -pub const SIZE_MAX: i32 = -1; -pub const WINT_MIN: u32 = 0; -pub const WINT_MAX: u32 = 4294967295; -pub const _STDLIB_H: u32 = 1; -pub const WNOHANG: u32 = 1; -pub const WUNTRACED: u32 = 2; -pub const WSTOPPED: u32 = 2; -pub const WEXITED: u32 = 4; -pub const WCONTINUED: u32 = 8; -pub const WNOWAIT: u32 = 16777216; -pub const __WNOTHREAD: u32 = 536870912; -pub const __WALL: u32 = 1073741824; -pub const __WCLONE: u32 = 2147483648; -pub const __W_CONTINUED: u32 = 65535; -pub const __WCOREFLAG: u32 = 128; -pub const __HAVE_FLOAT128: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128: u32 = 0; -pub const __HAVE_FLOAT64X: u32 = 1; -pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1; -pub const __HAVE_FLOAT16: u32 = 0; -pub const __HAVE_FLOAT32: u32 = 1; -pub const __HAVE_FLOAT64: u32 = 1; -pub const __HAVE_FLOAT32X: u32 = 1; -pub const __HAVE_FLOAT128X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT16: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0; -pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0; -pub const __ldiv_t_defined: u32 = 1; -pub const __lldiv_t_defined: u32 = 1; -pub const RAND_MAX: u32 = 2147483647; -pub const EXIT_FAILURE: u32 = 1; -pub const EXIT_SUCCESS: u32 = 0; -pub const _SYS_TYPES_H: u32 = 1; -pub const __clock_t_defined: u32 = 1; -pub const __clockid_t_defined: u32 = 1; -pub const __time_t_defined: u32 = 1; -pub const __timer_t_defined: u32 = 1; -pub const __BIT_TYPES_DEFINED__: u32 = 1; -pub const _ENDIAN_H: u32 = 1; -pub const _BITS_ENDIAN_H: u32 = 1; -pub const __LITTLE_ENDIAN: u32 = 1234; -pub const __BIG_ENDIAN: u32 = 4321; -pub const __PDP_ENDIAN: u32 = 3412; -pub const _BITS_ENDIANNESS_H: u32 = 1; -pub const __BYTE_ORDER: u32 = 1234; -pub const __FLOAT_WORD_ORDER: u32 = 1234; -pub const LITTLE_ENDIAN: u32 = 1234; -pub const BIG_ENDIAN: u32 = 4321; -pub const PDP_ENDIAN: u32 = 3412; -pub const BYTE_ORDER: u32 = 1234; -pub const _BITS_BYTESWAP_H: u32 = 1; -pub const _BITS_UINTN_IDENTITY_H: u32 = 1; -pub const _SYS_SELECT_H: u32 = 1; -pub const __sigset_t_defined: u32 = 1; -pub const __timeval_defined: u32 = 1; -pub const _STRUCT_TIMESPEC: u32 = 1; -pub const FD_SETSIZE: u32 = 1024; -pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; -pub const _THREAD_SHARED_TYPES_H: u32 = 1; -pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; -pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; -pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; -pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; -pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; -pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; -pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; -pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; -pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1; -pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; -pub const __have_pthread_attr_t: u32 = 1; -pub const _ALLOCA_H: u32 = 1; -pub const METACALL_DEF_H: u32 = 1; -pub const METACALL_FORK_SAFE: u32 = 1; -pub const METACALL_ERROR_H: u32 = 1; -pub const METACALL_LOG_H: u32 = 1; -pub const _STDIO_H: u32 = 1; -pub const _____fpos_t_defined: u32 = 1; -pub const ____mbstate_t_defined: u32 = 1; -pub const _____fpos64_t_defined: u32 = 1; -pub const ____FILE_defined: u32 = 1; -pub const __FILE_defined: u32 = 1; -pub const __struct_FILE_defined: u32 = 1; -pub const _IO_EOF_SEEN: u32 = 16; -pub const _IO_ERR_SEEN: u32 = 32; -pub const _IO_USER_LOCK: u32 = 32768; -pub const _IOFBF: u32 = 0; -pub const _IOLBF: u32 = 1; -pub const _IONBF: u32 = 2; -pub const BUFSIZ: u32 = 8192; -pub const EOF: i32 = -1; -pub const SEEK_SET: u32 = 0; -pub const SEEK_CUR: u32 = 1; -pub const SEEK_END: u32 = 2; -pub const P_tmpdir: &[u8; 5usize] = b"/tmp\0"; -pub const _BITS_STDIO_LIM_H: u32 = 1; -pub const L_tmpnam: u32 = 20; -pub const TMP_MAX: u32 = 238328; -pub const FILENAME_MAX: u32 = 4096; -pub const L_ctermid: u32 = 9; -pub const FOPEN_MAX: u32 = 16; -pub const METACALL_VALUE_H: u32 = 1; -pub const METACALL_VERSION_H: u32 = 1; -pub const METACALL_PROJECT_NAME: &[u8; 9usize] = b"MetaCall\0"; -pub const METACALL_PROJECT_DESCRIPTION: &[u8; 72usize] = - b"A library for providing inter-language foreign function interface calls\0"; -pub const METACALL_AUTHOR_ORGANIZATION: &[u8; 14usize] = b"MetaCall Inc.\0"; -pub const METACALL_AUTHOR_DOMAIN: &[u8; 21usize] = b"https://metacall.io//0"; -pub const METACALL_AUTHOR_MAINTAINER: &[u8; 17usize] = b"vic798@gmail.com\0"; -pub const METACALL_VERSION_MAJOR: &[u8; 2usize] = b"0\0"; -pub const METACALL_VERSION_MAJOR_ID: u32 = 0; -pub const METACALL_VERSION_MINOR: &[u8; 2usize] = b"7\0"; -pub const METACALL_VERSION_MINOR_ID: u32 = 7; -pub const METACALL_VERSION_PATCH: &[u8; 2usize] = b"4\0"; -pub const METACALL_VERSION_PATCH_ID: u32 = 4; -pub const METACALL_VERSION_REVISION: &[u8; 13usize] = b"e89fcbdb09d5\0"; -pub const METACALL_VERSION: &[u8; 6usize] = b"0.7.4\0"; -pub const METACALL_NAME_VERSION: &[u8; 31usize] = b"MetaCall v0.7.4 (e89fcbdb09d5)\0"; -pub const METACALL_FORK_H: u32 = 1; -pub const _UNISTD_H: u32 = 1; -pub const _POSIX_VERSION: u32 = 200809; -pub const __POSIX2_THIS_VERSION: u32 = 200809; -pub const _POSIX2_VERSION: u32 = 200809; -pub const _POSIX2_C_VERSION: u32 = 200809; -pub const _POSIX2_C_BIND: u32 = 200809; -pub const _POSIX2_C_DEV: u32 = 200809; -pub const _POSIX2_SW_DEV: u32 = 200809; -pub const _POSIX2_LOCALEDEF: u32 = 200809; -pub const _XOPEN_VERSION: u32 = 700; -pub const _XOPEN_XCU_VERSION: u32 = 4; -pub const _XOPEN_XPG2: u32 = 1; -pub const _XOPEN_XPG3: u32 = 1; -pub const _XOPEN_XPG4: u32 = 1; -pub const _XOPEN_UNIX: u32 = 1; -pub const _XOPEN_ENH_I18N: u32 = 1; -pub const _XOPEN_LEGACY: u32 = 1; -pub const _BITS_POSIX_OPT_H: u32 = 1; -pub const _POSIX_JOB_CONTROL: u32 = 1; -pub const _POSIX_SAVED_IDS: u32 = 1; -pub const _POSIX_PRIORITY_SCHEDULING: u32 = 200809; -pub const _POSIX_SYNCHRONIZED_IO: u32 = 200809; -pub const _POSIX_FSYNC: u32 = 200809; -pub const _POSIX_MAPPED_FILES: u32 = 200809; -pub const _POSIX_MEMLOCK: u32 = 200809; -pub const _POSIX_MEMLOCK_RANGE: u32 = 200809; -pub const _POSIX_MEMORY_PROTECTION: u32 = 200809; -pub const _POSIX_CHOWN_RESTRICTED: u32 = 0; -pub const _POSIX_VDISABLE: u8 = 0u8; -pub const _POSIX_NO_TRUNC: u32 = 1; -pub const _XOPEN_REALTIME: u32 = 1; -pub const _XOPEN_REALTIME_THREADS: u32 = 1; -pub const _XOPEN_SHM: u32 = 1; -pub const _POSIX_THREADS: u32 = 200809; -pub const _POSIX_REENTRANT_FUNCTIONS: u32 = 1; -pub const _POSIX_THREAD_SAFE_FUNCTIONS: u32 = 200809; -pub const _POSIX_THREAD_PRIORITY_SCHEDULING: u32 = 200809; -pub const _POSIX_THREAD_ATTR_STACKSIZE: u32 = 200809; -pub const _POSIX_THREAD_ATTR_STACKADDR: u32 = 200809; -pub const _POSIX_THREAD_PRIO_INHERIT: u32 = 200809; -pub const _POSIX_THREAD_PRIO_PROTECT: u32 = 200809; -pub const _POSIX_THREAD_ROBUST_PRIO_INHERIT: u32 = 200809; -pub const _POSIX_THREAD_ROBUST_PRIO_PROTECT: i32 = -1; -pub const _POSIX_SEMAPHORES: u32 = 200809; -pub const _POSIX_REALTIME_SIGNALS: u32 = 200809; -pub const _POSIX_ASYNCHRONOUS_IO: u32 = 200809; -pub const _POSIX_ASYNC_IO: u32 = 1; -pub const _LFS_ASYNCHRONOUS_IO: u32 = 1; -pub const _POSIX_PRIORITIZED_IO: u32 = 200809; -pub const _LFS64_ASYNCHRONOUS_IO: u32 = 1; -pub const _LFS_LARGEFILE: u32 = 1; -pub const _LFS64_LARGEFILE: u32 = 1; -pub const _LFS64_STDIO: u32 = 1; -pub const _POSIX_SHARED_MEMORY_OBJECTS: u32 = 200809; -pub const _POSIX_CPUTIME: u32 = 0; -pub const _POSIX_THREAD_CPUTIME: u32 = 0; -pub const _POSIX_REGEXP: u32 = 1; -pub const _POSIX_READER_WRITER_LOCKS: u32 = 200809; -pub const _POSIX_SHELL: u32 = 1; -pub const _POSIX_TIMEOUTS: u32 = 200809; -pub const _POSIX_SPIN_LOCKS: u32 = 200809; -pub const _POSIX_SPAWN: u32 = 200809; -pub const _POSIX_TIMERS: u32 = 200809; -pub const _POSIX_BARRIERS: u32 = 200809; -pub const _POSIX_MESSAGE_PASSING: u32 = 200809; -pub const _POSIX_THREAD_PROCESS_SHARED: u32 = 200809; -pub const _POSIX_MONOTONIC_CLOCK: u32 = 0; -pub const _POSIX_CLOCK_SELECTION: u32 = 200809; -pub const _POSIX_ADVISORY_INFO: u32 = 200809; -pub const _POSIX_IPV6: u32 = 200809; -pub const _POSIX_RAW_SOCKETS: u32 = 200809; -pub const _POSIX2_CHAR_TERM: u32 = 200809; -pub const _POSIX_SPORADIC_SERVER: i32 = -1; -pub const _POSIX_THREAD_SPORADIC_SERVER: i32 = -1; -pub const _POSIX_TRACE: i32 = -1; -pub const _POSIX_TRACE_EVENT_FILTER: i32 = -1; -pub const _POSIX_TRACE_INHERIT: i32 = -1; -pub const _POSIX_TRACE_LOG: i32 = -1; -pub const _POSIX_TYPED_MEMORY_OBJECTS: i32 = -1; -pub const _POSIX_V7_LPBIG_OFFBIG: i32 = -1; -pub const _POSIX_V6_LPBIG_OFFBIG: i32 = -1; -pub const _XBS5_LPBIG_OFFBIG: i32 = -1; -pub const _POSIX_V7_LP64_OFF64: u32 = 1; -pub const _POSIX_V6_LP64_OFF64: u32 = 1; -pub const _XBS5_LP64_OFF64: u32 = 1; -pub const __ILP32_OFF32_CFLAGS: &[u8; 5usize] = b"-m32\0"; -pub const __ILP32_OFF32_LDFLAGS: &[u8; 5usize] = b"-m32\0"; -pub const __ILP32_OFFBIG_CFLAGS: &[u8; 48usize] = - b"-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64\0"; -pub const __ILP32_OFFBIG_LDFLAGS: &[u8; 5usize] = b"-m32\0"; -pub const __LP64_OFF64_CFLAGS: &[u8; 5usize] = b"-m64\0"; -pub const __LP64_OFF64_LDFLAGS: &[u8; 5usize] = b"-m64\0"; -pub const STDIN_FILENO: u32 = 0; -pub const STDOUT_FILENO: u32 = 1; -pub const STDERR_FILENO: u32 = 2; -pub const R_OK: u32 = 4; -pub const W_OK: u32 = 2; -pub const X_OK: u32 = 1; -pub const F_OK: u32 = 0; -pub const L_SET: u32 = 0; -pub const L_INCR: u32 = 1; -pub const L_XTND: u32 = 2; -pub const _GETOPT_POSIX_H: u32 = 1; -pub const _GETOPT_CORE_H: u32 = 1; -pub const F_ULOCK: u32 = 0; -pub const F_LOCK: u32 = 1; -pub const F_TLOCK: u32 = 2; -pub const F_TEST: u32 = 3; -pub const METACALL_FLAGS_FORK_SAFE: u32 = 1; -pub type __u_char = ::std::os::raw::c_uchar; -pub type __u_short = ::std::os::raw::c_ushort; -pub type __u_int = ::std::os::raw::c_uint; -pub type __u_long = ::std::os::raw::c_ulong; -pub type __int8_t = ::std::os::raw::c_schar; -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __int16_t = ::std::os::raw::c_short; -pub type __uint16_t = ::std::os::raw::c_ushort; -pub type __int32_t = ::std::os::raw::c_int; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_long; -pub type __uint64_t = ::std::os::raw::c_ulong; -pub type __int_least8_t = __int8_t; -pub type __uint_least8_t = __uint8_t; -pub type __int_least16_t = __int16_t; -pub type __uint_least16_t = __uint16_t; -pub type __int_least32_t = __int32_t; -pub type __uint_least32_t = __uint32_t; -pub type __int_least64_t = __int64_t; -pub type __uint_least64_t = __uint64_t; -pub type __quad_t = ::std::os::raw::c_long; -pub type __u_quad_t = ::std::os::raw::c_ulong; -pub type __intmax_t = ::std::os::raw::c_long; -pub type __uintmax_t = ::std::os::raw::c_ulong; -pub type __dev_t = ::std::os::raw::c_ulong; -pub type __uid_t = ::std::os::raw::c_uint; -pub type __gid_t = ::std::os::raw::c_uint; -pub type __ino_t = ::std::os::raw::c_ulong; -pub type __ino64_t = ::std::os::raw::c_ulong; -pub type __mode_t = ::std::os::raw::c_uint; -pub type __nlink_t = ::std::os::raw::c_ulong; -pub type __off_t = ::std::os::raw::c_long; -pub type __off64_t = ::std::os::raw::c_long; pub type __pid_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __fsid_t { - pub __val: [::std::os::raw::c_int; 2usize], -} -#[test] -fn bindgen_test_layout___fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} -pub type __clock_t = ::std::os::raw::c_long; -pub type __rlim_t = ::std::os::raw::c_ulong; -pub type __rlim64_t = ::std::os::raw::c_ulong; -pub type __id_t = ::std::os::raw::c_uint; -pub type __time_t = ::std::os::raw::c_long; -pub type __useconds_t = ::std::os::raw::c_uint; -pub type __suseconds_t = ::std::os::raw::c_long; -pub type __suseconds64_t = ::std::os::raw::c_long; -pub type __daddr_t = ::std::os::raw::c_int; -pub type __key_t = ::std::os::raw::c_int; -pub type __clockid_t = ::std::os::raw::c_int; -pub type __timer_t = *mut ::std::os::raw::c_void; -pub type __blksize_t = ::std::os::raw::c_long; -pub type __blkcnt_t = ::std::os::raw::c_long; -pub type __blkcnt64_t = ::std::os::raw::c_long; -pub type __fsblkcnt_t = ::std::os::raw::c_ulong; -pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; -pub type __fsword_t = ::std::os::raw::c_long; -pub type __ssize_t = ::std::os::raw::c_long; -pub type __syscall_slong_t = ::std::os::raw::c_long; -pub type __syscall_ulong_t = ::std::os::raw::c_ulong; -pub type __loff_t = __off64_t; -pub type __caddr_t = *mut ::std::os::raw::c_char; -pub type __intptr_t = ::std::os::raw::c_long; -pub type __socklen_t = ::std::os::raw::c_uint; -pub type __sig_atomic_t = ::std::os::raw::c_int; -pub type int_least8_t = __int_least8_t; -pub type int_least16_t = __int_least16_t; -pub type int_least32_t = __int_least32_t; -pub type int_least64_t = __int_least64_t; -pub type uint_least8_t = __uint_least8_t; -pub type uint_least16_t = __uint_least16_t; -pub type uint_least32_t = __uint_least32_t; -pub type uint_least64_t = __uint_least64_t; -pub type int_fast8_t = ::std::os::raw::c_schar; -pub type int_fast16_t = ::std::os::raw::c_long; -pub type int_fast32_t = ::std::os::raw::c_long; -pub type int_fast64_t = ::std::os::raw::c_long; -pub type uint_fast8_t = ::std::os::raw::c_uchar; -pub type uint_fast16_t = ::std::os::raw::c_ulong; -pub type uint_fast32_t = ::std::os::raw::c_ulong; -pub type uint_fast64_t = ::std::os::raw::c_ulong; -pub type intmax_t = __intmax_t; -pub type uintmax_t = __uintmax_t; -pub type wchar_t = ::std::os::raw::c_int; -#[repr(C)] -#[repr(align(16))] -#[derive(Copy, Clone)] -pub union max_align_t { - pub __ll: ::std::os::raw::c_longlong, - pub __ld: u128, -} -#[test] -fn bindgen_test_layout_max_align_t() { - const UNINIT: ::std::mem::MaybeUninit<max_align_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<max_align_t>(), - 16usize, - concat!("Size of: ", stringify!(max_align_t)) - ); - assert_eq!( - ::std::mem::align_of::<max_align_t>(), - 16usize, - concat!("Alignment of ", stringify!(max_align_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__ll) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__ll) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__ld) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__ld) - ) - ); -} -extern "C" { - pub fn alloca(size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; -} -pub type _Float32 = f32; -pub type _Float64 = f64; -pub type _Float32x = f64; -pub type _Float64x = u128; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct div_t { - pub quot: ::std::os::raw::c_int, - pub rem: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_div_t() { - const UNINIT: ::std::mem::MaybeUninit<div_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<div_t>(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); - assert_eq!( - ::std::mem::align_of::<div_t>(), - 4usize, - concat!("Alignment of ", stringify!(div_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ldiv_t { - pub quot: ::std::os::raw::c_long, - pub rem: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_ldiv_t() { - const UNINIT: ::std::mem::MaybeUninit<ldiv_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<ldiv_t>(), - 16usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::<ldiv_t>(), - 8usize, - concat!("Alignment of ", stringify!(ldiv_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct lldiv_t { - pub quot: ::std::os::raw::c_longlong, - pub rem: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_lldiv_t() { - const UNINIT: ::std::mem::MaybeUninit<lldiv_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<lldiv_t>(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::<lldiv_t>(), - 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn __ctype_get_mb_cur_max() -> usize; -} -extern "C" { - pub fn atof(__nptr: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn atoi(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn atol(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn atoll(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtod( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - ) -> f64; -} -extern "C" { - pub fn strtof( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - ) -> f32; -} -extern "C" { - pub fn strtold( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - ) -> u128; -} -extern "C" { - pub fn strtol( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn strtoul( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strtoq( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtouq( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn strtoll( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtoull( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn l64a(__n: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn a64l(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -pub type u_char = __u_char; -pub type u_short = __u_short; -pub type u_int = __u_int; -pub type u_long = __u_long; -pub type quad_t = __quad_t; -pub type u_quad_t = __u_quad_t; -pub type fsid_t = __fsid_t; -pub type loff_t = __loff_t; -pub type ino_t = __ino_t; -pub type dev_t = __dev_t; -pub type gid_t = __gid_t; -pub type mode_t = __mode_t; -pub type nlink_t = __nlink_t; -pub type uid_t = __uid_t; -pub type off_t = __off_t; -pub type pid_t = __pid_t; -pub type id_t = __id_t; -pub type daddr_t = __daddr_t; -pub type caddr_t = __caddr_t; -pub type key_t = __key_t; -pub type clock_t = __clock_t; -pub type clockid_t = __clockid_t; -pub type time_t = __time_t; -pub type timer_t = __timer_t; -pub type ulong = ::std::os::raw::c_ulong; -pub type ushort = ::std::os::raw::c_ushort; -pub type uint = ::std::os::raw::c_uint; -pub type u_int8_t = __uint8_t; -pub type u_int16_t = __uint16_t; -pub type u_int32_t = __uint32_t; -pub type u_int64_t = __uint64_t; -pub type register_t = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sigset_t { - pub __val: [::std::os::raw::c_ulong; 16usize], -} -#[test] -fn bindgen_test_layout___sigset_t() { - const UNINIT: ::std::mem::MaybeUninit<__sigset_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sigset_t>(), - 128usize, - concat!("Size of: ", stringify!(__sigset_t)) - ); - assert_eq!( - ::std::mem::align_of::<__sigset_t>(), - 8usize, - concat!("Alignment of ", stringify!(__sigset_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sigset_t), - "::", - stringify!(__val) - ) - ); -} -pub type sigset_t = __sigset_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timeval { - pub tv_sec: __time_t, - pub tv_usec: __suseconds_t, -} -#[test] -fn bindgen_test_layout_timeval() { - const UNINIT: ::std::mem::MaybeUninit<timeval> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<timeval>(), - 16usize, - concat!("Size of: ", stringify!(timeval)) - ); - assert_eq!( - ::std::mem::align_of::<timeval>(), - 8usize, - concat!("Alignment of ", stringify!(timeval)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_usec) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timespec { - pub tv_sec: __time_t, - pub tv_nsec: __syscall_slong_t, -} -#[test] -fn bindgen_test_layout_timespec() { - const UNINIT: ::std::mem::MaybeUninit<timespec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<timespec>(), - 16usize, - concat!("Size of: ", stringify!(timespec)) - ); - assert_eq!( - ::std::mem::align_of::<timespec>(), - 8usize, - concat!("Alignment of ", stringify!(timespec)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_nsec) - ) - ); -} -pub type suseconds_t = __suseconds_t; -pub type __fd_mask = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct fd_set { - pub __fds_bits: [__fd_mask; 16usize], -} -#[test] -fn bindgen_test_layout_fd_set() { - const UNINIT: ::std::mem::MaybeUninit<fd_set> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<fd_set>(), - 128usize, - concat!("Size of: ", stringify!(fd_set)) - ); - assert_eq!( - ::std::mem::align_of::<fd_set>(), - 8usize, - concat!("Alignment of ", stringify!(fd_set)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__fds_bits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(fd_set), - "::", - stringify!(__fds_bits) - ) - ); -} -pub type fd_mask = __fd_mask; -extern "C" { - pub fn select( - __nfds: ::std::os::raw::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *mut timeval, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pselect( - __nfds: ::std::os::raw::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *const timespec, - __sigmask: *const __sigset_t, - ) -> ::std::os::raw::c_int; -} -pub type blksize_t = __blksize_t; -pub type blkcnt_t = __blkcnt_t; -pub type fsblkcnt_t = __fsblkcnt_t; -pub type fsfilcnt_t = __fsfilcnt_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_list { - pub __prev: *mut __pthread_internal_list, - pub __next: *mut __pthread_internal_list, -} -#[test] -fn bindgen_test_layout___pthread_internal_list() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_list> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_internal_list>(), - 16usize, - concat!("Size of: ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_internal_list>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__next) - ) - ); -} -pub type __pthread_list_t = __pthread_internal_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_slist { - pub __next: *mut __pthread_internal_slist, -} -#[test] -fn bindgen_test_layout___pthread_internal_slist() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_slist> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_internal_slist>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_internal_slist)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_internal_slist>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_slist)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_slist), - "::", - stringify!(__next) - ) - ); -} -pub type __pthread_slist_t = __pthread_internal_slist; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_mutex_s { - pub __lock: ::std::os::raw::c_int, - pub __count: ::std::os::raw::c_uint, - pub __owner: ::std::os::raw::c_int, - pub __nusers: ::std::os::raw::c_uint, - pub __kind: ::std::os::raw::c_int, - pub __spins: ::std::os::raw::c_short, - pub __elision: ::std::os::raw::c_short, - pub __list: __pthread_list_t, -} -#[test] -fn bindgen_test_layout___pthread_mutex_s() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_mutex_s> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_mutex_s>(), - 40usize, - concat!("Size of: ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_mutex_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__owner) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__nusers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__kind) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__spins) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__elision) as usize - ptr as usize }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__elision) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__list) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__list) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_rwlock_arch_t { - pub __readers: ::std::os::raw::c_uint, - pub __writers: ::std::os::raw::c_uint, - pub __wrphase_futex: ::std::os::raw::c_uint, - pub __writers_futex: ::std::os::raw::c_uint, - pub __pad3: ::std::os::raw::c_uint, - pub __pad4: ::std::os::raw::c_uint, - pub __cur_writer: ::std::os::raw::c_int, - pub __shared: ::std::os::raw::c_int, - pub __rwelision: ::std::os::raw::c_schar, - pub __pad1: [::std::os::raw::c_uchar; 7usize], - pub __pad2: ::std::os::raw::c_ulong, - pub __flags: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___pthread_rwlock_arch_t() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_rwlock_arch_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_rwlock_arch_t>(), - 56usize, - concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_rwlock_arch_t>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__readers) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__readers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__writers) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wrphase_futex) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__wrphase_futex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__writers_futex) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers_futex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad4) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad4) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cur_writer) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__cur_writer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__shared) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__shared) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__rwelision) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__rwelision) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize }, - 33usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__flags) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __pthread_cond_s { - pub __bindgen_anon_1: __pthread_cond_s__bindgen_ty_1, - pub __bindgen_anon_2: __pthread_cond_s__bindgen_ty_2, - pub __g_refs: [::std::os::raw::c_uint; 2usize], - pub __g_size: [::std::os::raw::c_uint; 2usize], - pub __g1_orig_size: ::std::os::raw::c_uint, - pub __wrefs: ::std::os::raw::c_uint, - pub __g_signals: [::std::os::raw::c_uint; 2usize], -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __pthread_cond_s__bindgen_ty_1 { - pub __wseq: ::std::os::raw::c_ulonglong, - pub __wseq32: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_cond_s__bindgen_ty_1__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(), - 8usize, - concat!( - "Size of: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(__low) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(__high) - ) - ); -} -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1), - "::", - stringify!(__wseq) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wseq32) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1), - "::", - stringify!(__wseq32) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __pthread_cond_s__bindgen_ty_2 { - pub __g1_start: ::std::os::raw::c_ulonglong, - pub __g1_start32: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_cond_s__bindgen_ty_2__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(), - 8usize, - concat!( - "Size of: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(__low) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(__high) - ) - ); -} -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_2)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2), - "::", - stringify!(__g1_start) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g1_start32) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2), - "::", - stringify!(__g1_start32) - ) - ); -} -#[test] -fn bindgen_test_layout___pthread_cond_s() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s>(), - 48usize, - concat!("Size of: ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_refs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_orig_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wrefs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_signals) - ) - ); -} -pub type __tss_t = ::std::os::raw::c_uint; -pub type __thrd_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __once_flag { - pub __data: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout___once_flag() { - const UNINIT: ::std::mem::MaybeUninit<__once_flag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__once_flag>(), - 4usize, - concat!("Size of: ", stringify!(__once_flag)) - ); - assert_eq!( - ::std::mem::align_of::<__once_flag>(), - 4usize, - concat!("Alignment of ", stringify!(__once_flag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__once_flag), - "::", - stringify!(__data) - ) - ); -} -pub type pthread_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutexattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pthread_mutexattr_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_mutexattr_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_mutexattr_t>(), - 4usize, - concat!("Size of: ", stringify!(pthread_mutexattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_mutexattr_t>(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutexattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_condattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pthread_condattr_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_condattr_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_condattr_t>(), - 4usize, - concat!("Size of: ", stringify!(pthread_condattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_condattr_t>(), - 4usize, - concat!("Alignment of ", stringify!(pthread_condattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__align) - ) - ); -} -pub type pthread_key_t = ::std::os::raw::c_uint; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_attr_t { - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_attr_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_attr_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_attr_t>(), - 56usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_attr_t>(), - 8usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutex_t { - pub __data: __pthread_mutex_s, - pub __size: [::std::os::raw::c_char; 40usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_mutex_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_mutex_t>(), - 40usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_mutex_t>(), - 8usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_cond_t { - pub __data: __pthread_cond_s, - pub __size: [::std::os::raw::c_char; 48usize], - pub __align: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_cond_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_cond_t>(), - 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_cond_t>(), - 8usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlock_t { - pub __data: __pthread_rwlock_arch_t, - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_rwlock_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_rwlock_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_rwlock_t>(), - 56usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_rwlock_t>(), - 8usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlockattr_t { - pub __size: [::std::os::raw::c_char; 8usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_rwlockattr_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_rwlockattr_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_rwlockattr_t>(), - 8usize, - concat!("Size of: ", stringify!(pthread_rwlockattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_rwlockattr_t>(), - 8usize, - concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__align) - ) - ); -} -pub type pthread_spinlock_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrier_t { - pub __size: [::std::os::raw::c_char; 32usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_barrier_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_barrier_t>(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_barrier_t>(), - 8usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrierattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pthread_barrierattr_t() { - const UNINIT: ::std::mem::MaybeUninit<pthread_barrierattr_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<pthread_barrierattr_t>(), - 4usize, - concat!("Size of: ", stringify!(pthread_barrierattr_t)) - ); - assert_eq!( - ::std::mem::align_of::<pthread_barrierattr_t>(), - 4usize, - concat!("Alignment of ", stringify!(pthread_barrierattr_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__align) - ) - ); -} -extern "C" { - pub fn random() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn srandom(__seed: ::std::os::raw::c_uint); -} -extern "C" { - pub fn initstate( - __seed: ::std::os::raw::c_uint, - __statebuf: *mut ::std::os::raw::c_char, - __statelen: usize, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn setstate(__statebuf: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct random_data { - pub fptr: *mut i32, - pub rptr: *mut i32, - pub state: *mut i32, - pub rand_type: ::std::os::raw::c_int, - pub rand_deg: ::std::os::raw::c_int, - pub rand_sep: ::std::os::raw::c_int, - pub end_ptr: *mut i32, -} -#[test] -fn bindgen_test_layout_random_data() { - const UNINIT: ::std::mem::MaybeUninit<random_data> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<random_data>(), - 48usize, - concat!("Size of: ", stringify!(random_data)) - ); - assert_eq!( - ::std::mem::align_of::<random_data>(), - 8usize, - concat!("Alignment of ", stringify!(random_data)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fptr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(fptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rand_type) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rand_deg) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_deg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rand_sep) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_sep) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end_ptr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(end_ptr) - ) - ); -} -extern "C" { - pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srandom_r( - __seed: ::std::os::raw::c_uint, - __buf: *mut random_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn initstate_r( - __seed: ::std::os::raw::c_uint, - __statebuf: *mut ::std::os::raw::c_char, - __statelen: usize, - __buf: *mut random_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setstate_r( - __statebuf: *mut ::std::os::raw::c_char, - __buf: *mut random_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rand() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srand(__seed: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rand_r(__seed: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn drand48() -> f64; -} -extern "C" { - pub fn erand48(__xsubi: *mut ::std::os::raw::c_ushort) -> f64; -} -extern "C" { - pub fn lrand48() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn nrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn mrand48() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn jrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn srand48(__seedval: ::std::os::raw::c_long); -} -extern "C" { - pub fn seed48(__seed16v: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; -} -extern "C" { - pub fn lcong48(__param: *mut ::std::os::raw::c_ushort); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct drand48_data { - pub __x: [::std::os::raw::c_ushort; 3usize], - pub __old_x: [::std::os::raw::c_ushort; 3usize], - pub __c: ::std::os::raw::c_ushort, - pub __init: ::std::os::raw::c_ushort, - pub __a: ::std::os::raw::c_ulonglong, -} -#[test] -fn bindgen_test_layout_drand48_data() { - const UNINIT: ::std::mem::MaybeUninit<drand48_data> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<drand48_data>(), - 24usize, - concat!("Size of: ", stringify!(drand48_data)) - ); - assert_eq!( - ::std::mem::align_of::<drand48_data>(), - 8usize, - concat!("Alignment of ", stringify!(drand48_data)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__x) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__x) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__old_x) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__old_x) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__c) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__c) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__init) as usize - ptr as usize }, - 14usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__init) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__a) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__a) - ) - ); -} -extern "C" { - pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn erand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut f64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lrand48_r( - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nrand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mrand48_r( - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn jrand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srand48_r( - __seedval: ::std::os::raw::c_long, - __buffer: *mut drand48_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn seed48_r( - __seed16v: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lcong48_r( - __param: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn malloc(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn calloc( - __nmemb: ::std::os::raw::c_ulong, - __size: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn realloc( - __ptr: *mut ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn reallocarray( - __ptr: *mut ::std::os::raw::c_void, - __nmemb: usize, - __size: usize, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn free(__ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn valloc(__size: usize) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn posix_memalign( - __memptr: *mut *mut ::std::os::raw::c_void, - __alignment: usize, - __size: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn aligned_alloc(__alignment: usize, __size: usize) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn abort() -> !; -} -extern "C" { - pub fn atexit(__func: ::std::option::Option<unsafe extern "C" fn()>) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn at_quick_exit( - __func: ::std::option::Option<unsafe extern "C" fn()>, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn on_exit( - __func: ::std::option::Option< - unsafe extern "C" fn( - __status: ::std::os::raw::c_int, - __arg: *mut ::std::os::raw::c_void, - ), - >, - __arg: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn exit(__status: ::std::os::raw::c_int) -> !; -} -extern "C" { - pub fn quick_exit(__status: ::std::os::raw::c_int) -> !; -} -extern "C" { - pub fn _Exit(__status: ::std::os::raw::c_int) -> !; -} -extern "C" { - pub fn getenv(__name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn putenv(__string: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setenv( - __name: *const ::std::os::raw::c_char, - __value: *const ::std::os::raw::c_char, - __replace: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn unsetenv(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearenv() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mktemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn mkstemp(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkstemps( - __template: *mut ::std::os::raw::c_char, - __suffixlen: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkdtemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn realpath( - __name: *const ::std::os::raw::c_char, - __resolved: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -pub type __compar_fn_t = ::std::option::Option< - unsafe extern "C" fn( - arg1: *const ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, ->; -extern "C" { - pub fn bsearch( - __key: *const ::std::os::raw::c_void, - __base: *const ::std::os::raw::c_void, - __nmemb: usize, - __size: usize, - __compar: __compar_fn_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn qsort( - __base: *mut ::std::os::raw::c_void, - __nmemb: usize, - __size: usize, - __compar: __compar_fn_t, - ); -} -extern "C" { - pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llabs(__x: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn div(__numer: ::std::os::raw::c_int, __denom: ::std::os::raw::c_int) -> div_t; -} -extern "C" { - pub fn ldiv(__numer: ::std::os::raw::c_long, __denom: ::std::os::raw::c_long) -> ldiv_t; -} -extern "C" { - pub fn lldiv( - __numer: ::std::os::raw::c_longlong, - __denom: ::std::os::raw::c_longlong, - ) -> lldiv_t; -} -extern "C" { - pub fn ecvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fcvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn gcvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn qecvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn qfcvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn qgcvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ecvt_r( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fcvt_r( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn qecvt_r( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn qfcvt_r( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbtowc( - __pwc: *mut wchar_t, - __s: *const ::std::os::raw::c_char, - __n: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wctomb(__s: *mut ::std::os::raw::c_char, __wchar: wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize) -> usize; -} -extern "C" { - pub fn wcstombs(__s: *mut ::std::os::raw::c_char, __pwcs: *const wchar_t, __n: usize) -> usize; -} -extern "C" { - pub fn rpmatch(__response: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getsubopt( - __optionp: *mut *mut ::std::os::raw::c_char, - __tokens: *const *mut ::std::os::raw::c_char, - __valuep: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getloadavg(__loadavg: *mut f64, __nelem: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -pub const metacall_allocator_id_METACALL_ALLOCATOR_STD: metacall_allocator_id = 0; -pub const metacall_allocator_id_METACALL_ALLOCATOR_NGINX: metacall_allocator_id = 1; -pub type metacall_allocator_id = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ngx_pool_s { - _unused: [u8; 0], -} -pub type metacall_allocator_std = *mut metacall_allocator_std_type; -pub type ngx_pool_t = ngx_pool_s; -pub type metacall_allocator_nginx = *mut metacall_allocator_nginx_type; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_allocator_std_type { - pub malloc: - ::std::option::Option<unsafe extern "C" fn(arg1: usize) -> *mut ::std::os::raw::c_void>, - pub realloc: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: usize, - ) -> *mut ::std::os::raw::c_void, - >, - pub free: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>, -} -#[test] -fn bindgen_test_layout_metacall_allocator_std_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_allocator_std_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_allocator_std_type>(), - 24usize, - concat!("Size of: ", stringify!(metacall_allocator_std_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_allocator_std_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_allocator_std_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).malloc) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_allocator_std_type), - "::", - stringify!(malloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).realloc) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_allocator_std_type), - "::", - stringify!(realloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).free) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(metacall_allocator_std_type), - "::", - stringify!(free) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_allocator_nginx_type { - pub pool: *mut ngx_pool_t, - pub palloc: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ngx_pool_t, arg2: usize) -> *mut ::std::os::raw::c_void, - >, - pub pcopy: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_void, - arg3: usize, - ) -> *mut ::std::os::raw::c_void, - >, - pub pfree: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ngx_pool_t, arg2: *mut ::std::os::raw::c_void) -> isize, - >, -} -#[test] -fn bindgen_test_layout_metacall_allocator_nginx_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_allocator_nginx_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_allocator_nginx_type>(), - 32usize, - concat!("Size of: ", stringify!(metacall_allocator_nginx_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_allocator_nginx_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_allocator_nginx_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pool) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_allocator_nginx_type), - "::", - stringify!(pool) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).palloc) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_allocator_nginx_type), - "::", - stringify!(palloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pcopy) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(metacall_allocator_nginx_type), - "::", - stringify!(pcopy) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pfree) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(metacall_allocator_nginx_type), - "::", - stringify!(pfree) - ) - ); -} -extern "C" { - #[doc = " @brief\n Create an allocator instance\n\n @param[in] allocator_id\n Type of allocator to be created\n\n @param[in] ctx\n Context of the allocator\n\n @return\n Pointer to allocator if success, null otherwise"] - pub fn metacall_allocator_create( - allocator_id: metacall_allocator_id, - ctx: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - #[doc = " @brief\n Reserve memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] size\n Size in bytes to be allocated\n\n @return\n Pointer to allocated data on success, null otherwise"] - pub fn metacall_allocator_alloc( - allocator: *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - #[doc = " @brief\n Reallocate memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Original pointer to data\n\n @param[in] size\n Original size in bytes\n\n @param[in] new_size\n New size in bytes to be reallocated\n\n @return\n Pointer to new reallocated data on success, null otherwise"] - pub fn metacall_allocator_realloc( - allocator: *mut ::std::os::raw::c_void, - data: *mut ::std::os::raw::c_void, - size: usize, - new_size: usize, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - #[doc = " @brief\n Free memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Pointer to data to be freed"] - pub fn metacall_allocator_free( - allocator: *mut ::std::os::raw::c_void, - data: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - #[doc = " @brief\n Destroy an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance"] - pub fn metacall_allocator_destroy(allocator: *mut ::std::os::raw::c_void); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_exception_type { - pub message: *const ::std::os::raw::c_char, - pub label: *const ::std::os::raw::c_char, - pub code: i64, - pub stacktrace: *const ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_metacall_exception_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_exception_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_exception_type>(), - 32usize, - concat!("Size of: ", stringify!(metacall_exception_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_exception_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_exception_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).message) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_exception_type), - "::", - stringify!(message) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_exception_type), - "::", - stringify!(label) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(metacall_exception_type), - "::", - stringify!(code) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stacktrace) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(metacall_exception_type), - "::", - stringify!(stacktrace) - ) - ); -} -pub type metacall_exception = *mut metacall_exception_type; -extern "C" { - #[doc = " @brief\n Retrieve the exception from a value, it can be either a throwable value with an exception inside or an exception itself\n\n @param[in] v\n Value that represents the exception to be retrieved\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to @v\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_error_from_value( - v: *mut ::std::os::raw::c_void, - ex: metacall_exception, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[doc = " @brief\n Retrieve last error that has happened after a call to any API from MetaCall\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to the internal MetaCall exception\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_error_last(ex: metacall_exception) -> ::std::os::raw::c_int; -} -extern "C" { - #[doc = " @brief\n Clear last error that has happened after a call to any API from MetaCall"] - pub fn metacall_error_clear(); -} -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = va_list; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __mbstate_t { - pub __count: ::std::os::raw::c_int, - pub __value: __mbstate_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __mbstate_t__bindgen_ty_1 { - pub __wch: ::std::os::raw::c_uint, - pub __wchb: [::std::os::raw::c_char; 4usize], -} -#[test] -fn bindgen_test_layout___mbstate_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wch) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wch) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wchb) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wchb) - ) - ); -} -#[test] -fn bindgen_test_layout___mbstate_t() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 8usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__value) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__value) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos_t { - pub __pos: __off_t, - pub __state: __mbstate_t, -} -#[test] -fn bindgen_test_layout__G_fpos_t() { - const UNINIT: ::std::mem::MaybeUninit<_G_fpos_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_G_fpos_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__state) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__state) - ) - ); -} -pub type __fpos_t = _G_fpos_t; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos64_t { - pub __pos: __off64_t, - pub __state: __mbstate_t, -} -#[test] -fn bindgen_test_layout__G_fpos64_t() { - const UNINIT: ::std::mem::MaybeUninit<_G_fpos64_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_G_fpos64_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos64_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__state) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__state) - ) - ); -} -pub type __fpos64_t = _G_fpos64_t; -pub type __FILE = _IO_FILE; -pub type FILE = _IO_FILE; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_marker { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_codecvt { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_wide_data { - _unused: [u8; 0], -} -pub type _IO_lock_t = ::std::os::raw::c_void; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_FILE { - pub _flags: ::std::os::raw::c_int, - pub _IO_read_ptr: *mut ::std::os::raw::c_char, - pub _IO_read_end: *mut ::std::os::raw::c_char, - pub _IO_read_base: *mut ::std::os::raw::c_char, - pub _IO_write_base: *mut ::std::os::raw::c_char, - pub _IO_write_ptr: *mut ::std::os::raw::c_char, - pub _IO_write_end: *mut ::std::os::raw::c_char, - pub _IO_buf_base: *mut ::std::os::raw::c_char, - pub _IO_buf_end: *mut ::std::os::raw::c_char, - pub _IO_save_base: *mut ::std::os::raw::c_char, - pub _IO_backup_base: *mut ::std::os::raw::c_char, - pub _IO_save_end: *mut ::std::os::raw::c_char, - pub _markers: *mut _IO_marker, - pub _chain: *mut _IO_FILE, - pub _fileno: ::std::os::raw::c_int, - pub _flags2: ::std::os::raw::c_int, - pub _old_offset: __off_t, - pub _cur_column: ::std::os::raw::c_ushort, - pub _vtable_offset: ::std::os::raw::c_schar, - pub _shortbuf: [::std::os::raw::c_char; 1usize], - pub _lock: *mut _IO_lock_t, - pub _offset: __off64_t, - pub _codecvt: *mut _IO_codecvt, - pub _wide_data: *mut _IO_wide_data, - pub _freeres_list: *mut _IO_FILE, - pub _freeres_buf: *mut ::std::os::raw::c_void, - pub __pad5: usize, - pub _mode: ::std::os::raw::c_int, - pub _unused2: [::std::os::raw::c_char; 20usize], -} -#[test] -fn bindgen_test_layout__IO_FILE() { - const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} -pub type fpos_t = __fpos_t; -extern "C" { - pub static mut stdin: *mut FILE; -} -extern "C" { - pub static mut stdout: *mut FILE; -} -extern "C" { - pub static mut stderr: *mut FILE; -} -extern "C" { - pub fn remove(__filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rename( - __old: *const ::std::os::raw::c_char, - __new: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn renameat( - __oldfd: ::std::os::raw::c_int, - __old: *const ::std::os::raw::c_char, - __newfd: ::std::os::raw::c_int, - __new: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn tmpfile() -> *mut FILE; -} -extern "C" { - pub fn tmpnam(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tmpnam_r(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tempnam( - __dir: *const ::std::os::raw::c_char, - __pfx: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fclose(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fflush(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fflush_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fopen( - __filename: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn freopen( - __filename: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - __stream: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn fdopen(__fd: ::std::os::raw::c_int, __modes: *const ::std::os::raw::c_char) - -> *mut FILE; -} -extern "C" { - pub fn fmemopen( - __s: *mut ::std::os::raw::c_void, - __len: usize, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn open_memstream( - __bufloc: *mut *mut ::std::os::raw::c_char, - __sizeloc: *mut usize, - ) -> *mut FILE; -} -extern "C" { - pub fn setbuf(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn setvbuf( - __stream: *mut FILE, - __buf: *mut ::std::os::raw::c_char, - __modes: ::std::os::raw::c_int, - __n: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuffer(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char, __size: usize); -} -extern "C" { - pub fn setlinebuf(__stream: *mut FILE); -} -extern "C" { - pub fn fprintf( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn printf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sprintf( - __s: *mut ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfprintf( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vprintf( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsprintf( - __s: *mut ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn snprintf( - __s: *mut ::std::os::raw::c_char, - __maxlen: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsnprintf( - __s: *mut ::std::os::raw::c_char, - __maxlen: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vdprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn dprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fscanf( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scanf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sscanf( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_fscanf"] - pub fn fscanf1( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_scanf"] - pub fn scanf1(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_sscanf"] - pub fn sscanf1( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfscanf( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vscanf( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsscanf( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vfscanf"] - pub fn vfscanf1( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vscanf"] - pub fn vscanf1( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vsscanf"] - pub fn vsscanf1( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getc(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar_unlocked() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar_unlocked(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getw(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putw(__w: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgets( - __s: *mut ::std::os::raw::c_char, - __n: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn __getdelim( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut usize, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn getdelim( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut usize, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn getline( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut usize, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn fputs(__s: *const ::std::os::raw::c_char, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn puts(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ungetc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fread( - __ptr: *mut ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - __n: ::std::os::raw::c_ulong, - __stream: *mut FILE, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn fwrite( - __ptr: *const ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - __n: ::std::os::raw::c_ulong, - __s: *mut FILE, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn fread_unlocked( - __ptr: *mut ::std::os::raw::c_void, - __size: usize, - __n: usize, - __stream: *mut FILE, - ) -> usize; -} -extern "C" { - pub fn fwrite_unlocked( - __ptr: *const ::std::os::raw::c_void, - __size: usize, - __n: usize, - __stream: *mut FILE, - ) -> usize; -} -extern "C" { - pub fn fseek( - __stream: *mut FILE, - __off: ::std::os::raw::c_long, - __whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftell(__stream: *mut FILE) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn rewind(__stream: *mut FILE); -} -extern "C" { - pub fn fseeko( - __stream: *mut FILE, - __off: __off_t, - __whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftello(__stream: *mut FILE) -> __off_t; -} -extern "C" { - pub fn fgetpos(__stream: *mut FILE, __pos: *mut fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fsetpos(__stream: *mut FILE, __pos: *const fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearerr(__stream: *mut FILE); -} -extern "C" { - pub fn feof(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearerr_unlocked(__stream: *mut FILE); -} -extern "C" { - pub fn feof_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn perror(__s: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn fileno(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fileno_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn popen( - __command: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn pclose(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ctermid(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn flockfile(__stream: *mut FILE); -} -extern "C" { - pub fn ftrylockfile(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn funlockfile(__stream: *mut FILE); +pub type pid_t = __pid_t; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum metacall_allocator_id { + METACALL_ALLOCATOR_STD = 0, + METACALL_ALLOCATOR_NGINX = 1, } -extern "C" { - pub fn __uflow(arg1: *mut FILE) -> ::std::os::raw::c_int; +unsafe extern "C" { + #[doc = " @brief\n Create an allocator instance\n\n @param[in] allocator_id\n Type of allocator to be created\n\n @param[in] ctx\n Context of the allocator\n\n @return\n Pointer to allocator if success, null otherwise"] + pub fn metacall_allocator_create( + allocator_id: metacall_allocator_id, + ctx: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; } -extern "C" { - pub fn __overflow(arg1: *mut FILE, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +unsafe extern "C" { + #[doc = " @brief\n Reserve memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] size\n Size in bytes to be allocated\n\n @return\n Pointer to allocated data on success, null otherwise"] + pub fn metacall_allocator_alloc( + allocator: *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; } -pub const metacall_log_id_METACALL_LOG_STDIO: metacall_log_id = 0; -pub const metacall_log_id_METACALL_LOG_FILE: metacall_log_id = 1; -pub const metacall_log_id_METACALL_LOG_SOCKET: metacall_log_id = 2; -pub const metacall_log_id_METACALL_LOG_SYSLOG: metacall_log_id = 3; -pub const metacall_log_id_METACALL_LOG_NGINX: metacall_log_id = 4; -pub const metacall_log_id_METACALL_LOG_CUSTOM: metacall_log_id = 5; -pub type metacall_log_id = ::std::os::raw::c_uint; -pub type metacall_log_stdio = *mut metacall_log_stdio_type; -pub type metacall_log_file = *mut metacall_log_file_type; -pub type metacall_log_socket = *mut metacall_log_socket_type; -pub type metacall_log_syslog = *mut metacall_log_syslog_type; -pub type metacall_log_nginx = *mut metacall_log_nginx_type; -pub type metacall_log_custom_va_list = *mut metacall_log_custom_va_list_type; -pub type metacall_log_custom = *mut metacall_log_custom_type; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_log_stdio_type { - pub stream: *mut FILE, -} -#[test] -fn bindgen_test_layout_metacall_log_stdio_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_log_stdio_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_log_stdio_type>(), - 8usize, - concat!("Size of: ", stringify!(metacall_log_stdio_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_log_stdio_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_log_stdio_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stream) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_stdio_type), - "::", - stringify!(stream) - ) - ); +unsafe extern "C" { + #[doc = " @brief\n Reallocate memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Original pointer to data\n\n @param[in] size\n Original size in bytes\n\n @param[in] new_size\n New size in bytes to be reallocated\n\n @return\n Pointer to new reallocated data on success, null otherwise"] + pub fn metacall_allocator_realloc( + allocator: *mut ::std::os::raw::c_void, + data: *mut ::std::os::raw::c_void, + size: usize, + new_size: usize, + ) -> *mut ::std::os::raw::c_void; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_log_file_type { - pub file_name: *const ::std::os::raw::c_char, - pub mode: *const ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_metacall_log_file_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_log_file_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_log_file_type>(), - 16usize, - concat!("Size of: ", stringify!(metacall_log_file_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_log_file_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_log_file_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).file_name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_file_type), - "::", - stringify!(file_name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_file_type), - "::", - stringify!(mode) - ) +unsafe extern "C" { + #[doc = " @brief\n Free memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Pointer to data to be freed"] + pub fn metacall_allocator_free( + allocator: *mut ::std::os::raw::c_void, + data: *mut ::std::os::raw::c_void, ); } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_log_socket_type { - pub ip: *const ::std::os::raw::c_char, - pub port: u16, -} -#[test] -fn bindgen_test_layout_metacall_log_socket_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_log_socket_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_log_socket_type>(), - 16usize, - concat!("Size of: ", stringify!(metacall_log_socket_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_log_socket_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_log_socket_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_socket_type), - "::", - stringify!(ip) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).port) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_socket_type), - "::", - stringify!(port) - ) - ); +unsafe extern "C" { + #[doc = " @brief\n Destroy an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance"] + pub fn metacall_allocator_destroy(allocator: *mut ::std::os::raw::c_void); } #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct metacall_log_syslog_type { - pub name: *const ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_metacall_log_syslog_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_log_syslog_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_log_syslog_type>(), - 8usize, - concat!("Size of: ", stringify!(metacall_log_syslog_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_log_syslog_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_log_syslog_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_syslog_type), - "::", - stringify!(name) - ) - ); +pub struct metacall_exception_type { + pub message: *const ::std::os::raw::c_char, + pub label: *const ::std::os::raw::c_char, + pub code: i64, + pub stacktrace: *const ::std::os::raw::c_char, } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_log_nginx_type { - pub log: *mut ::std::os::raw::c_void, - pub log_error: ::std::option::Option<unsafe extern "C" fn()>, - pub log_level: u16, -} -#[test] -fn bindgen_test_layout_metacall_log_nginx_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_log_nginx_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_log_nginx_type>(), - 24usize, - concat!("Size of: ", stringify!(metacall_log_nginx_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_log_nginx_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_log_nginx_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).log) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_nginx_type), - "::", - stringify!(log) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).log_error) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_nginx_type), - "::", - stringify!(log_error) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).log_level) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_nginx_type), - "::", - stringify!(log_level) - ) - ); +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of metacall_exception_type"][::std::mem::size_of::<metacall_exception_type>() - 32usize]; + ["Alignment of metacall_exception_type"] + [::std::mem::align_of::<metacall_exception_type>() - 8usize]; + ["Offset of field: metacall_exception_type::message"] + [::std::mem::offset_of!(metacall_exception_type, message) - 0usize]; + ["Offset of field: metacall_exception_type::label"] + [::std::mem::offset_of!(metacall_exception_type, label) - 8usize]; + ["Offset of field: metacall_exception_type::code"] + [::std::mem::offset_of!(metacall_exception_type, code) - 16usize]; + ["Offset of field: metacall_exception_type::stacktrace"] + [::std::mem::offset_of!(metacall_exception_type, stacktrace) - 24usize]; +}; +pub type metacall_exception = *mut metacall_exception_type; +unsafe extern "C" { + #[doc = " @brief\n Retrieve the exception from a value, it can be either a throwable value with an exception inside or an exception itself\n\n @param[in] v\n Value that represents the exception to be retrieved\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to @v\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_error_from_value( + v: *mut ::std::os::raw::c_void, + ex: metacall_exception, + ) -> ::std::os::raw::c_int; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_log_custom_va_list_type { - pub va: va_list, -} -#[test] -fn bindgen_test_layout_metacall_log_custom_va_list_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_log_custom_va_list_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_log_custom_va_list_type>(), - 24usize, - concat!("Size of: ", stringify!(metacall_log_custom_va_list_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_log_custom_va_list_type>(), - 8usize, - concat!( - "Alignment of ", - stringify!(metacall_log_custom_va_list_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).va) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_custom_va_list_type), - "::", - stringify!(va) - ) - ); +unsafe extern "C" { + #[doc = " @brief\n Retrieve last error that has happened after a call to any API from MetaCall\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to the internal MetaCall exception\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_error_last(ex: metacall_exception) -> ::std::os::raw::c_int; } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_log_custom_type { - pub context: *mut ::std::os::raw::c_void, - pub format_size: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_char, - arg3: u64, - arg4: usize, - arg5: *const ::std::os::raw::c_char, - arg6: *const ::std::os::raw::c_char, - arg7: *const ::std::os::raw::c_char, - arg8: *const ::std::os::raw::c_char, - arg9: metacall_log_custom_va_list, - ) -> usize, - >, - pub format_serialize: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - arg3: usize, - arg4: *const ::std::os::raw::c_char, - arg5: u64, - arg6: usize, - arg7: *const ::std::os::raw::c_char, - arg8: *const ::std::os::raw::c_char, - arg9: *const ::std::os::raw::c_char, - arg10: *const ::std::os::raw::c_char, - arg11: metacall_log_custom_va_list, - ) -> usize, - >, - pub format_deserialize: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_void, - arg3: usize, - arg4: *const ::std::os::raw::c_char, - arg5: u64, - arg6: usize, - arg7: *const ::std::os::raw::c_char, - arg8: *const ::std::os::raw::c_char, - arg9: *const ::std::os::raw::c_char, - arg10: *const ::std::os::raw::c_char, - arg11: metacall_log_custom_va_list, - ) -> usize, - >, - pub stream_write: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_char, - arg3: usize, - ) -> ::std::os::raw::c_int, - >, - pub stream_flush: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, - >, -} -#[test] -fn bindgen_test_layout_metacall_log_custom_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_log_custom_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_log_custom_type>(), - 48usize, - concat!("Size of: ", stringify!(metacall_log_custom_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_log_custom_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_log_custom_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_custom_type), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_custom_type), - "::", - stringify!(format_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format_serialize) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_custom_type), - "::", - stringify!(format_serialize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format_deserialize) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_custom_type), - "::", - stringify!(format_deserialize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stream_write) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_custom_type), - "::", - stringify!(stream_write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stream_flush) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(metacall_log_custom_type), - "::", - stringify!(stream_flush) - ) - ); +unsafe extern "C" { + #[doc = " @brief\n Clear last error that has happened after a call to any API from MetaCall"] + pub fn metacall_error_clear(); } -extern "C" { +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum metacall_log_id { + METACALL_LOG_STDIO = 0, + METACALL_LOG_FILE = 1, + METACALL_LOG_SOCKET = 2, + METACALL_LOG_SYSLOG = 3, + METACALL_LOG_NGINX = 4, + METACALL_LOG_CUSTOM = 5, +} +unsafe extern "C" { #[doc = " @brief\n Create a log instance\n\n @param[in] log_id\n Type of log to be created\n\n @param[in] ctx\n Context of the log (a pointer to metacall_log_{stdio, file, socket, syslog, nginx, custom}_type)\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_log( log_id: metacall_log_id, ctx: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -pub const metacall_value_id_METACALL_BOOL: metacall_value_id = 0; -pub const metacall_value_id_METACALL_CHAR: metacall_value_id = 1; -pub const metacall_value_id_METACALL_SHORT: metacall_value_id = 2; -pub const metacall_value_id_METACALL_INT: metacall_value_id = 3; -pub const metacall_value_id_METACALL_LONG: metacall_value_id = 4; -pub const metacall_value_id_METACALL_FLOAT: metacall_value_id = 5; -pub const metacall_value_id_METACALL_DOUBLE: metacall_value_id = 6; -pub const metacall_value_id_METACALL_STRING: metacall_value_id = 7; -pub const metacall_value_id_METACALL_BUFFER: metacall_value_id = 8; -pub const metacall_value_id_METACALL_ARRAY: metacall_value_id = 9; -pub const metacall_value_id_METACALL_MAP: metacall_value_id = 10; -pub const metacall_value_id_METACALL_PTR: metacall_value_id = 11; -pub const metacall_value_id_METACALL_FUTURE: metacall_value_id = 12; -pub const metacall_value_id_METACALL_FUNCTION: metacall_value_id = 13; -pub const metacall_value_id_METACALL_NULL: metacall_value_id = 14; -pub const metacall_value_id_METACALL_CLASS: metacall_value_id = 15; -pub const metacall_value_id_METACALL_OBJECT: metacall_value_id = 16; -pub const metacall_value_id_METACALL_EXCEPTION: metacall_value_id = 17; -pub const metacall_value_id_METACALL_THROWABLE: metacall_value_id = 18; -pub const metacall_value_id_METACALL_SIZE: metacall_value_id = 19; -pub const metacall_value_id_METACALL_INVALID: metacall_value_id = 20; -pub type metacall_value_id = ::std::os::raw::c_uint; -extern "C" { +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum metacall_value_id { + METACALL_BOOL = 0, + METACALL_CHAR = 1, + METACALL_SHORT = 2, + METACALL_INT = 3, + METACALL_LONG = 4, + METACALL_FLOAT = 5, + METACALL_DOUBLE = 6, + METACALL_STRING = 7, + METACALL_BUFFER = 8, + METACALL_ARRAY = 9, + METACALL_MAP = 10, + METACALL_PTR = 11, + METACALL_FUTURE = 12, + METACALL_FUNCTION = 13, + METACALL_NULL = 14, + METACALL_CLASS = 15, + METACALL_OBJECT = 16, + METACALL_EXCEPTION = 17, + METACALL_THROWABLE = 18, + METACALL_SIZE = 19, + METACALL_INVALID = 20, +} +unsafe extern "C" { #[doc = " @brief\n Create a value from boolean @b\n\n @param[in] b\n Boolean will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_bool(b: ::std::os::raw::c_uchar) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from char @c\n\n @param[in] c\n Character will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_char(c: ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from short @s\n\n @param[in] s\n Short will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_short(s: ::std::os::raw::c_short) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from integer @i\n\n @param[in] i\n Integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_int(i: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from long @l\n\n @param[in] l\n Long integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_long(l: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from single precision floating point number @f\n\n @param[in] f\n Float will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_float(f: f32) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from double precision floating point number @d\n\n @param[in] d\n Double will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_double(d: f64) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from a C string @str\n\n @param[in] str\n Constant string will be copied into value (needs to be null terminated)\n\n @param[in] length\n Length of the constant string\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_string( str_: *const ::std::os::raw::c_char, length: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value buffer from array @buffer\n\n @param[in] buffer\n Constant memory block will be copied into value array\n\n @param[in] size\n Size in bytes of data contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_buffer( buffer: *const ::std::os::raw::c_void, size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value array from array of values @values\n\n @param[in] values\n Constant array of values will be copied into value list\n\n @param[in] size\n Number of elements contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_array( values: *mut *const ::std::os::raw::c_void, size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value map from array of tuples @map\n\n @param[in] tuples\n Constant array of tuples will be copied into value map\n\n @param[in] size\n Number of elements contained in the map\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_map( tuples: *mut *const ::std::os::raw::c_void, size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from pointer @ptr\n\n @param[in] ptr\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_ptr( ptr: *const ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from future @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_future( f: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from function @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_function( f: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from function @f binding a closure @c to it\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @param[in] c\n Pointer to closure that will be binded into function @f\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_function_closure( f: *mut ::std::os::raw::c_void, c: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value of type null\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_null() -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from class @c\n\n @param[in] c\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_class( c: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from object @o\n\n @param[in] o\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_object( o: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from exception @ex\n\n @param[in] ex\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_exception( ex: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a value from throwable @th\n\n @param[in] th\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_throwable( th: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Returns the size of the value\n\n @param[in] v\n Reference to the value\n\n @return\n Size in bytes of the value"] pub fn metacall_value_size(v: *mut ::std::os::raw::c_void) -> usize; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Returns the amount of values this value contains\n\n @param[in] v\n Reference to the value\n\n @return\n Number of values @v represents"] pub fn metacall_value_count(v: *mut ::std::os::raw::c_void) -> usize; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide type id of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return type id assigned to value"] pub fn metacall_value_id(v: *mut ::std::os::raw::c_void) -> metacall_value_id; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide type id in a readable form (as string) of a type id\n\n @param[in] id\n Value type identifier\n\n @return\n Return string related to the type id"] pub fn metacall_value_id_name(id: metacall_value_id) -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide type id in a readable form (as string) of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return string related to the type id assigned to value"] pub fn metacall_value_type_name( v: *mut ::std::os::raw::c_void, ) -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Deep copies the value @v, the result copy resets\n the reference counter and ownership, including the finalizer\n\n @param[in] v\n Reference to the value to be copied\n\n @return\n Copy of the value @v on success, null otherwhise"] pub fn metacall_value_copy(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { + #[doc = " @brief\n Creates a new pointer value, with a reference to the\n data contained inside the value @v. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n\n In this case, void *ptr is a value equivalent to int*,\n and it points directly to the integer contained in void *v.\n Note that if we destroy the value @v, the reference will\n point to already freed memory, causing use-after-free when used.\n\n @param[in] v\n Reference to the value to be referenced\n\n @return\n A new value of type pointer, pointing to the @v data"] + pub fn metacall_value_reference(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n If you pass a reference previously created (i.e a value of\n type pointer, pointing to another value), it returns the\n original value. It does not modify the memory of the values\n neither allocates anything. If the value @v is pointing to\n has been deleted, it will cause an use-after-free. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n void *w = metacall_value_dereference(ptr);\n assert(v == w); // Both are the same value\n\n @param[in] v\n Reference to the value to be dereferenced\n\n @return\n The value containing the data which ptr is pointing to"] + pub fn metacall_value_dereference( + v: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { #[doc = " @brief\n Copies the ownership from @src to @dst, including the finalizer,\n and resets the owner and finalizer of @src\n\n @param[in] src\n Source value which will lose the ownership\n\n @param[in] dst\n Destination value which will recieve the ownership"] pub fn metacall_value_move(src: *mut ::std::os::raw::c_void, dest: *mut ::std::os::raw::c_void); } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to boolean\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to boolean"] pub fn metacall_value_to_bool(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_uchar; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to char\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to char"] pub fn metacall_value_to_char(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to short\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to short"] pub fn metacall_value_to_short(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_short; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to integer"] pub fn metacall_value_to_int(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to long integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to long integer"] pub fn metacall_value_to_long(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to single precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to float"] pub fn metacall_value_to_float(v: *mut ::std::os::raw::c_void) -> f32; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to double precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to dobule"] pub fn metacall_value_to_double(v: *mut ::std::os::raw::c_void) -> f64; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to string\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to C string (null terminated)"] pub fn metacall_value_to_string(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to buffer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to memory block"] pub fn metacall_value_to_buffer(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to array of values\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to array of values"] pub fn metacall_value_to_array( v: *mut ::std::os::raw::c_void, ) -> *mut *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to map\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to map (array of tuples (array of values))"] pub fn metacall_value_to_map( v: *mut ::std::os::raw::c_void, ) -> *mut *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to pointer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to pointer"] pub fn metacall_value_to_ptr(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to future\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to future"] pub fn metacall_value_to_future(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to function\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to function"] pub fn metacall_value_to_function( v: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to null\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to null"] pub fn metacall_value_to_null(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to class\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to class"] pub fn metacall_value_to_class(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to object\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to object"] pub fn metacall_value_to_object(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to exception\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to exception"] pub fn metacall_value_to_exception( v: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v to throwable\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to throwable"] pub fn metacall_value_to_throwable( v: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign boolean @b to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] b\n Boolean to be assigned to value @v\n\n @return\n Value with boolean @b assigned to it"] pub fn metacall_value_from_bool( v: *mut ::std::os::raw::c_void, b: ::std::os::raw::c_uchar, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign character @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Character to be assigned to value @v\n\n @return\n Value with char @c assigned to it"] pub fn metacall_value_from_char( v: *mut ::std::os::raw::c_void, c: ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign short @s to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] s\n Short to be assigned to value @v\n\n @return\n Value with short @s assigned to it"] pub fn metacall_value_from_short( v: *mut ::std::os::raw::c_void, s: ::std::os::raw::c_short, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign integer @i to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] i\n Integer to be assigned to value @v\n\n @return\n Value with integer @i assigned to it"] pub fn metacall_value_from_int( v: *mut ::std::os::raw::c_void, i: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign long integer @l to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] l\n Long integer to be assigned to value @v\n\n @return\n Value with long @l assigned to it"] pub fn metacall_value_from_long( v: *mut ::std::os::raw::c_void, l: ::std::os::raw::c_long, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign single precision floating point @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Float to be assigned to value @v\n\n @return\n Value with float @f assigned to it"] pub fn metacall_value_from_float( v: *mut ::std::os::raw::c_void, f: f32, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign double precision floating point @d to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] d\n Double to be assigned to value @v\n\n @return\n Value with double @d assigned to it"] pub fn metacall_value_from_double( v: *mut ::std::os::raw::c_void, d: f64, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign string @str to value @v, truncates to @v size if it is smaller\n than @length + 1. It does not add null terminator if truncated.\n\n @param[in] v\n Reference to the value\n\n @param[in] str\n Constant string to be assigned to value @v (it needs to be null terminated)\n\n @param[in] length\n Length of the constant string @str\n\n @return\n Value with string @str assigned to it"] pub fn metacall_value_from_string( v: *mut ::std::os::raw::c_void, @@ -4409,7 +414,7 @@ extern "C" { length: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign array @buffer to value buffer @v\n\n @param[in] v\n Reference to the value\n\n @param[in] buffer\n Constant array to be assigned to value @v\n\n @param[in] size\n Number of elements contained in @buffer\n\n @return\n Value with array @buffer assigned to it"] pub fn metacall_value_from_buffer( v: *mut ::std::os::raw::c_void, @@ -4417,7 +422,7 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign array of values @values to value array @v\n\n @param[in] v\n Reference to the value\n\n @param[in] values\n Constant array of values to be assigned to value array @v\n\n @param[in] size\n Number of values contained in constant array @values\n\n @return\n Value with array of values @values assigned to it"] pub fn metacall_value_from_array( v: *mut ::std::os::raw::c_void, @@ -4425,7 +430,7 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign array of values @values to value map @v\n\n @param[in] v\n Reference to the value\n\n @param[in] tuples\n Constant array of tuples to be assigned to value map @v\n\n @param[in] size\n Number of values contained in constant array @tuples\n\n @return\n Value with array of tuples @tuples assigned to it"] pub fn metacall_value_from_map( v: *mut ::std::os::raw::c_void, @@ -4433,970 +438,173 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign pointer reference @ptr to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ptr\n Pointer to be assigned to value @v\n\n @return\n Value with pointer @ptr assigned to it"] pub fn metacall_value_from_ptr( v: *mut ::std::os::raw::c_void, ptr: *const ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign future @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Future to be assigned to value @v\n\n @return\n Value with future @f assigned to it"] pub fn metacall_value_from_future( v: *mut ::std::os::raw::c_void, f: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign function @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Function to be assigned to value @v\n\n @return\n Value with function @f assigned to it"] pub fn metacall_value_from_function( v: *mut ::std::os::raw::c_void, f: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign null to value @v\n\n @param[in] v\n Reference to the value\n\n @return\n Value with null assigned to it"] pub fn metacall_value_from_null(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign class @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Class to be assigned to value @v\n\n @return\n Value with class @c assigned to it"] pub fn metacall_value_from_class( v: *mut ::std::os::raw::c_void, c: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign object @o to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] o\n Object to be assigned to value @v\n\n @return\n Value with object @o assigned to it"] pub fn metacall_value_from_object( v: *mut ::std::os::raw::c_void, o: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign exception @ex to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ex\n Exception to be assigned to value @v\n\n @return\n Value with exception @ex assigned to it"] pub fn metacall_value_from_exception( v: *mut ::std::os::raw::c_void, ex: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Assign throwable @th to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] th\n Throwable to be assigned to value @v\n\n @return\n Value with throwable @th assigned to it"] pub fn metacall_value_from_throwable( v: *mut ::std::os::raw::c_void, th: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Casts a value to a new type @id\n\n @param[in] v\n Reference to the value\n\n @param[in] id\n New type id of value to be casted\n\n @return\n Casted value or reference to @v if casting is between equivalent types"] pub fn metacall_value_cast( v: *mut ::std::os::raw::c_void, id: metacall_value_id, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to boolean\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to boolean"] pub fn metacall_value_cast_bool(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_uchar; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to char\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to char"] pub fn metacall_value_cast_char(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to short\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to short"] pub fn metacall_value_cast_short( v: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_short; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to int\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to int"] pub fn metacall_value_cast_int(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to long\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to long"] pub fn metacall_value_cast_long(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_long; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to float\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to float"] pub fn metacall_value_cast_float(v: *mut *mut ::std::os::raw::c_void) -> f32; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to double\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to double"] pub fn metacall_value_cast_double(v: *mut *mut ::std::os::raw::c_void) -> f64; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to string\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to a C string (null terminated)"] pub fn metacall_value_cast_string( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to buffer\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to buffer"] pub fn metacall_value_cast_buffer( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to array\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to array of values"] pub fn metacall_value_cast_array( v: *mut *mut ::std::os::raw::c_void, ) -> *mut *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to map\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to map"] pub fn metacall_value_cast_map( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to ptr\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to ptr"] pub fn metacall_value_cast_ptr( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to future\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to future"] pub fn metacall_value_cast_future( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to function\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to function"] pub fn metacall_value_cast_function( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to null\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to null"] pub fn metacall_value_cast_null( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to class\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to class"] pub fn metacall_value_cast_class( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to object\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to object"] pub fn metacall_value_cast_object( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to exception\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to exception"] pub fn metacall_value_cast_exception( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert value @v implicitly to throwable\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to throwable"] pub fn metacall_value_cast_throwable( v: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Destroy a value from scope stack\n\n @param[in] v\n Reference to the value"] pub fn metacall_value_destroy(v: *mut ::std::os::raw::c_void); } -pub type useconds_t = __useconds_t; -pub type socklen_t = __socklen_t; -extern "C" { - pub fn access( - __name: *const ::std::os::raw::c_char, - __type: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn faccessat( - __fd: ::std::os::raw::c_int, - __file: *const ::std::os::raw::c_char, - __type: ::std::os::raw::c_int, - __flag: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lseek( - __fd: ::std::os::raw::c_int, - __offset: __off_t, - __whence: ::std::os::raw::c_int, - ) -> __off_t; -} -extern "C" { - pub fn close(__fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn read( - __fd: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_void, - __nbytes: usize, - ) -> isize; -} -extern "C" { - pub fn write( - __fd: ::std::os::raw::c_int, - __buf: *const ::std::os::raw::c_void, - __n: usize, - ) -> isize; -} -extern "C" { - pub fn pread( - __fd: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_void, - __nbytes: usize, - __offset: __off_t, - ) -> isize; -} -extern "C" { - pub fn pwrite( - __fd: ::std::os::raw::c_int, - __buf: *const ::std::os::raw::c_void, - __n: usize, - __offset: __off_t, - ) -> isize; -} -extern "C" { - pub fn pipe(__pipedes: *mut ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn alarm(__seconds: ::std::os::raw::c_uint) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn sleep(__seconds: ::std::os::raw::c_uint) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn ualarm(__value: __useconds_t, __interval: __useconds_t) -> __useconds_t; -} -extern "C" { - pub fn usleep(__useconds: __useconds_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pause() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn chown( - __file: *const ::std::os::raw::c_char, - __owner: __uid_t, - __group: __gid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fchown( - __fd: ::std::os::raw::c_int, - __owner: __uid_t, - __group: __gid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lchown( - __file: *const ::std::os::raw::c_char, - __owner: __uid_t, - __group: __gid_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fchownat( - __fd: ::std::os::raw::c_int, - __file: *const ::std::os::raw::c_char, - __owner: __uid_t, - __group: __gid_t, - __flag: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn chdir(__path: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fchdir(__fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getcwd(__buf: *mut ::std::os::raw::c_char, __size: usize) - -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn getwd(__buf: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn dup(__fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn dup2(__fd: ::std::os::raw::c_int, __fd2: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; -} -extern "C" { - pub static mut __environ: *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn execve( - __path: *const ::std::os::raw::c_char, - __argv: *const *mut ::std::os::raw::c_char, - __envp: *const *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fexecve( - __fd: ::std::os::raw::c_int, - __argv: *const *mut ::std::os::raw::c_char, - __envp: *const *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn execv( - __path: *const ::std::os::raw::c_char, - __argv: *const *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn execle( - __path: *const ::std::os::raw::c_char, - __arg: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn execl( - __path: *const ::std::os::raw::c_char, - __arg: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn execvp( - __file: *const ::std::os::raw::c_char, - __argv: *const *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn execlp( - __file: *const ::std::os::raw::c_char, - __arg: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nice(__inc: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _exit(__status: ::std::os::raw::c_int) -> !; -} -pub const _PC_LINK_MAX: _bindgen_ty_1 = 0; -pub const _PC_MAX_CANON: _bindgen_ty_1 = 1; -pub const _PC_MAX_INPUT: _bindgen_ty_1 = 2; -pub const _PC_NAME_MAX: _bindgen_ty_1 = 3; -pub const _PC_PATH_MAX: _bindgen_ty_1 = 4; -pub const _PC_PIPE_BUF: _bindgen_ty_1 = 5; -pub const _PC_CHOWN_RESTRICTED: _bindgen_ty_1 = 6; -pub const _PC_NO_TRUNC: _bindgen_ty_1 = 7; -pub const _PC_VDISABLE: _bindgen_ty_1 = 8; -pub const _PC_SYNC_IO: _bindgen_ty_1 = 9; -pub const _PC_ASYNC_IO: _bindgen_ty_1 = 10; -pub const _PC_PRIO_IO: _bindgen_ty_1 = 11; -pub const _PC_SOCK_MAXBUF: _bindgen_ty_1 = 12; -pub const _PC_FILESIZEBITS: _bindgen_ty_1 = 13; -pub const _PC_REC_INCR_XFER_SIZE: _bindgen_ty_1 = 14; -pub const _PC_REC_MAX_XFER_SIZE: _bindgen_ty_1 = 15; -pub const _PC_REC_MIN_XFER_SIZE: _bindgen_ty_1 = 16; -pub const _PC_REC_XFER_ALIGN: _bindgen_ty_1 = 17; -pub const _PC_ALLOC_SIZE_MIN: _bindgen_ty_1 = 18; -pub const _PC_SYMLINK_MAX: _bindgen_ty_1 = 19; -pub const _PC_2_SYMLINKS: _bindgen_ty_1 = 20; -pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -pub const _SC_ARG_MAX: _bindgen_ty_2 = 0; -pub const _SC_CHILD_MAX: _bindgen_ty_2 = 1; -pub const _SC_CLK_TCK: _bindgen_ty_2 = 2; -pub const _SC_NGROUPS_MAX: _bindgen_ty_2 = 3; -pub const _SC_OPEN_MAX: _bindgen_ty_2 = 4; -pub const _SC_STREAM_MAX: _bindgen_ty_2 = 5; -pub const _SC_TZNAME_MAX: _bindgen_ty_2 = 6; -pub const _SC_JOB_CONTROL: _bindgen_ty_2 = 7; -pub const _SC_SAVED_IDS: _bindgen_ty_2 = 8; -pub const _SC_REALTIME_SIGNALS: _bindgen_ty_2 = 9; -pub const _SC_PRIORITY_SCHEDULING: _bindgen_ty_2 = 10; -pub const _SC_TIMERS: _bindgen_ty_2 = 11; -pub const _SC_ASYNCHRONOUS_IO: _bindgen_ty_2 = 12; -pub const _SC_PRIORITIZED_IO: _bindgen_ty_2 = 13; -pub const _SC_SYNCHRONIZED_IO: _bindgen_ty_2 = 14; -pub const _SC_FSYNC: _bindgen_ty_2 = 15; -pub const _SC_MAPPED_FILES: _bindgen_ty_2 = 16; -pub const _SC_MEMLOCK: _bindgen_ty_2 = 17; -pub const _SC_MEMLOCK_RANGE: _bindgen_ty_2 = 18; -pub const _SC_MEMORY_PROTECTION: _bindgen_ty_2 = 19; -pub const _SC_MESSAGE_PASSING: _bindgen_ty_2 = 20; -pub const _SC_SEMAPHORES: _bindgen_ty_2 = 21; -pub const _SC_SHARED_MEMORY_OBJECTS: _bindgen_ty_2 = 22; -pub const _SC_AIO_LISTIO_MAX: _bindgen_ty_2 = 23; -pub const _SC_AIO_MAX: _bindgen_ty_2 = 24; -pub const _SC_AIO_PRIO_DELTA_MAX: _bindgen_ty_2 = 25; -pub const _SC_DELAYTIMER_MAX: _bindgen_ty_2 = 26; -pub const _SC_MQ_OPEN_MAX: _bindgen_ty_2 = 27; -pub const _SC_MQ_PRIO_MAX: _bindgen_ty_2 = 28; -pub const _SC_VERSION: _bindgen_ty_2 = 29; -pub const _SC_PAGESIZE: _bindgen_ty_2 = 30; -pub const _SC_RTSIG_MAX: _bindgen_ty_2 = 31; -pub const _SC_SEM_NSEMS_MAX: _bindgen_ty_2 = 32; -pub const _SC_SEM_VALUE_MAX: _bindgen_ty_2 = 33; -pub const _SC_SIGQUEUE_MAX: _bindgen_ty_2 = 34; -pub const _SC_TIMER_MAX: _bindgen_ty_2 = 35; -pub const _SC_BC_BASE_MAX: _bindgen_ty_2 = 36; -pub const _SC_BC_DIM_MAX: _bindgen_ty_2 = 37; -pub const _SC_BC_SCALE_MAX: _bindgen_ty_2 = 38; -pub const _SC_BC_STRING_MAX: _bindgen_ty_2 = 39; -pub const _SC_COLL_WEIGHTS_MAX: _bindgen_ty_2 = 40; -pub const _SC_EQUIV_CLASS_MAX: _bindgen_ty_2 = 41; -pub const _SC_EXPR_NEST_MAX: _bindgen_ty_2 = 42; -pub const _SC_LINE_MAX: _bindgen_ty_2 = 43; -pub const _SC_RE_DUP_MAX: _bindgen_ty_2 = 44; -pub const _SC_CHARCLASS_NAME_MAX: _bindgen_ty_2 = 45; -pub const _SC_2_VERSION: _bindgen_ty_2 = 46; -pub const _SC_2_C_BIND: _bindgen_ty_2 = 47; -pub const _SC_2_C_DEV: _bindgen_ty_2 = 48; -pub const _SC_2_FORT_DEV: _bindgen_ty_2 = 49; -pub const _SC_2_FORT_RUN: _bindgen_ty_2 = 50; -pub const _SC_2_SW_DEV: _bindgen_ty_2 = 51; -pub const _SC_2_LOCALEDEF: _bindgen_ty_2 = 52; -pub const _SC_PII: _bindgen_ty_2 = 53; -pub const _SC_PII_XTI: _bindgen_ty_2 = 54; -pub const _SC_PII_SOCKET: _bindgen_ty_2 = 55; -pub const _SC_PII_INTERNET: _bindgen_ty_2 = 56; -pub const _SC_PII_OSI: _bindgen_ty_2 = 57; -pub const _SC_POLL: _bindgen_ty_2 = 58; -pub const _SC_SELECT: _bindgen_ty_2 = 59; -pub const _SC_UIO_MAXIOV: _bindgen_ty_2 = 60; -pub const _SC_IOV_MAX: _bindgen_ty_2 = 60; -pub const _SC_PII_INTERNET_STREAM: _bindgen_ty_2 = 61; -pub const _SC_PII_INTERNET_DGRAM: _bindgen_ty_2 = 62; -pub const _SC_PII_OSI_COTS: _bindgen_ty_2 = 63; -pub const _SC_PII_OSI_CLTS: _bindgen_ty_2 = 64; -pub const _SC_PII_OSI_M: _bindgen_ty_2 = 65; -pub const _SC_T_IOV_MAX: _bindgen_ty_2 = 66; -pub const _SC_THREADS: _bindgen_ty_2 = 67; -pub const _SC_THREAD_SAFE_FUNCTIONS: _bindgen_ty_2 = 68; -pub const _SC_GETGR_R_SIZE_MAX: _bindgen_ty_2 = 69; -pub const _SC_GETPW_R_SIZE_MAX: _bindgen_ty_2 = 70; -pub const _SC_LOGIN_NAME_MAX: _bindgen_ty_2 = 71; -pub const _SC_TTY_NAME_MAX: _bindgen_ty_2 = 72; -pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: _bindgen_ty_2 = 73; -pub const _SC_THREAD_KEYS_MAX: _bindgen_ty_2 = 74; -pub const _SC_THREAD_STACK_MIN: _bindgen_ty_2 = 75; -pub const _SC_THREAD_THREADS_MAX: _bindgen_ty_2 = 76; -pub const _SC_THREAD_ATTR_STACKADDR: _bindgen_ty_2 = 77; -pub const _SC_THREAD_ATTR_STACKSIZE: _bindgen_ty_2 = 78; -pub const _SC_THREAD_PRIORITY_SCHEDULING: _bindgen_ty_2 = 79; -pub const _SC_THREAD_PRIO_INHERIT: _bindgen_ty_2 = 80; -pub const _SC_THREAD_PRIO_PROTECT: _bindgen_ty_2 = 81; -pub const _SC_THREAD_PROCESS_SHARED: _bindgen_ty_2 = 82; -pub const _SC_NPROCESSORS_CONF: _bindgen_ty_2 = 83; -pub const _SC_NPROCESSORS_ONLN: _bindgen_ty_2 = 84; -pub const _SC_PHYS_PAGES: _bindgen_ty_2 = 85; -pub const _SC_AVPHYS_PAGES: _bindgen_ty_2 = 86; -pub const _SC_ATEXIT_MAX: _bindgen_ty_2 = 87; -pub const _SC_PASS_MAX: _bindgen_ty_2 = 88; -pub const _SC_XOPEN_VERSION: _bindgen_ty_2 = 89; -pub const _SC_XOPEN_XCU_VERSION: _bindgen_ty_2 = 90; -pub const _SC_XOPEN_UNIX: _bindgen_ty_2 = 91; -pub const _SC_XOPEN_CRYPT: _bindgen_ty_2 = 92; -pub const _SC_XOPEN_ENH_I18N: _bindgen_ty_2 = 93; -pub const _SC_XOPEN_SHM: _bindgen_ty_2 = 94; -pub const _SC_2_CHAR_TERM: _bindgen_ty_2 = 95; -pub const _SC_2_C_VERSION: _bindgen_ty_2 = 96; -pub const _SC_2_UPE: _bindgen_ty_2 = 97; -pub const _SC_XOPEN_XPG2: _bindgen_ty_2 = 98; -pub const _SC_XOPEN_XPG3: _bindgen_ty_2 = 99; -pub const _SC_XOPEN_XPG4: _bindgen_ty_2 = 100; -pub const _SC_CHAR_BIT: _bindgen_ty_2 = 101; -pub const _SC_CHAR_MAX: _bindgen_ty_2 = 102; -pub const _SC_CHAR_MIN: _bindgen_ty_2 = 103; -pub const _SC_INT_MAX: _bindgen_ty_2 = 104; -pub const _SC_INT_MIN: _bindgen_ty_2 = 105; -pub const _SC_LONG_BIT: _bindgen_ty_2 = 106; -pub const _SC_WORD_BIT: _bindgen_ty_2 = 107; -pub const _SC_MB_LEN_MAX: _bindgen_ty_2 = 108; -pub const _SC_NZERO: _bindgen_ty_2 = 109; -pub const _SC_SSIZE_MAX: _bindgen_ty_2 = 110; -pub const _SC_SCHAR_MAX: _bindgen_ty_2 = 111; -pub const _SC_SCHAR_MIN: _bindgen_ty_2 = 112; -pub const _SC_SHRT_MAX: _bindgen_ty_2 = 113; -pub const _SC_SHRT_MIN: _bindgen_ty_2 = 114; -pub const _SC_UCHAR_MAX: _bindgen_ty_2 = 115; -pub const _SC_UINT_MAX: _bindgen_ty_2 = 116; -pub const _SC_ULONG_MAX: _bindgen_ty_2 = 117; -pub const _SC_USHRT_MAX: _bindgen_ty_2 = 118; -pub const _SC_NL_ARGMAX: _bindgen_ty_2 = 119; -pub const _SC_NL_LANGMAX: _bindgen_ty_2 = 120; -pub const _SC_NL_MSGMAX: _bindgen_ty_2 = 121; -pub const _SC_NL_NMAX: _bindgen_ty_2 = 122; -pub const _SC_NL_SETMAX: _bindgen_ty_2 = 123; -pub const _SC_NL_TEXTMAX: _bindgen_ty_2 = 124; -pub const _SC_XBS5_ILP32_OFF32: _bindgen_ty_2 = 125; -pub const _SC_XBS5_ILP32_OFFBIG: _bindgen_ty_2 = 126; -pub const _SC_XBS5_LP64_OFF64: _bindgen_ty_2 = 127; -pub const _SC_XBS5_LPBIG_OFFBIG: _bindgen_ty_2 = 128; -pub const _SC_XOPEN_LEGACY: _bindgen_ty_2 = 129; -pub const _SC_XOPEN_REALTIME: _bindgen_ty_2 = 130; -pub const _SC_XOPEN_REALTIME_THREADS: _bindgen_ty_2 = 131; -pub const _SC_ADVISORY_INFO: _bindgen_ty_2 = 132; -pub const _SC_BARRIERS: _bindgen_ty_2 = 133; -pub const _SC_BASE: _bindgen_ty_2 = 134; -pub const _SC_C_LANG_SUPPORT: _bindgen_ty_2 = 135; -pub const _SC_C_LANG_SUPPORT_R: _bindgen_ty_2 = 136; -pub const _SC_CLOCK_SELECTION: _bindgen_ty_2 = 137; -pub const _SC_CPUTIME: _bindgen_ty_2 = 138; -pub const _SC_THREAD_CPUTIME: _bindgen_ty_2 = 139; -pub const _SC_DEVICE_IO: _bindgen_ty_2 = 140; -pub const _SC_DEVICE_SPECIFIC: _bindgen_ty_2 = 141; -pub const _SC_DEVICE_SPECIFIC_R: _bindgen_ty_2 = 142; -pub const _SC_FD_MGMT: _bindgen_ty_2 = 143; -pub const _SC_FIFO: _bindgen_ty_2 = 144; -pub const _SC_PIPE: _bindgen_ty_2 = 145; -pub const _SC_FILE_ATTRIBUTES: _bindgen_ty_2 = 146; -pub const _SC_FILE_LOCKING: _bindgen_ty_2 = 147; -pub const _SC_FILE_SYSTEM: _bindgen_ty_2 = 148; -pub const _SC_MONOTONIC_CLOCK: _bindgen_ty_2 = 149; -pub const _SC_MULTI_PROCESS: _bindgen_ty_2 = 150; -pub const _SC_SINGLE_PROCESS: _bindgen_ty_2 = 151; -pub const _SC_NETWORKING: _bindgen_ty_2 = 152; -pub const _SC_READER_WRITER_LOCKS: _bindgen_ty_2 = 153; -pub const _SC_SPIN_LOCKS: _bindgen_ty_2 = 154; -pub const _SC_REGEXP: _bindgen_ty_2 = 155; -pub const _SC_REGEX_VERSION: _bindgen_ty_2 = 156; -pub const _SC_SHELL: _bindgen_ty_2 = 157; -pub const _SC_SIGNALS: _bindgen_ty_2 = 158; -pub const _SC_SPAWN: _bindgen_ty_2 = 159; -pub const _SC_SPORADIC_SERVER: _bindgen_ty_2 = 160; -pub const _SC_THREAD_SPORADIC_SERVER: _bindgen_ty_2 = 161; -pub const _SC_SYSTEM_DATABASE: _bindgen_ty_2 = 162; -pub const _SC_SYSTEM_DATABASE_R: _bindgen_ty_2 = 163; -pub const _SC_TIMEOUTS: _bindgen_ty_2 = 164; -pub const _SC_TYPED_MEMORY_OBJECTS: _bindgen_ty_2 = 165; -pub const _SC_USER_GROUPS: _bindgen_ty_2 = 166; -pub const _SC_USER_GROUPS_R: _bindgen_ty_2 = 167; -pub const _SC_2_PBS: _bindgen_ty_2 = 168; -pub const _SC_2_PBS_ACCOUNTING: _bindgen_ty_2 = 169; -pub const _SC_2_PBS_LOCATE: _bindgen_ty_2 = 170; -pub const _SC_2_PBS_MESSAGE: _bindgen_ty_2 = 171; -pub const _SC_2_PBS_TRACK: _bindgen_ty_2 = 172; -pub const _SC_SYMLOOP_MAX: _bindgen_ty_2 = 173; -pub const _SC_STREAMS: _bindgen_ty_2 = 174; -pub const _SC_2_PBS_CHECKPOINT: _bindgen_ty_2 = 175; -pub const _SC_V6_ILP32_OFF32: _bindgen_ty_2 = 176; -pub const _SC_V6_ILP32_OFFBIG: _bindgen_ty_2 = 177; -pub const _SC_V6_LP64_OFF64: _bindgen_ty_2 = 178; -pub const _SC_V6_LPBIG_OFFBIG: _bindgen_ty_2 = 179; -pub const _SC_HOST_NAME_MAX: _bindgen_ty_2 = 180; -pub const _SC_TRACE: _bindgen_ty_2 = 181; -pub const _SC_TRACE_EVENT_FILTER: _bindgen_ty_2 = 182; -pub const _SC_TRACE_INHERIT: _bindgen_ty_2 = 183; -pub const _SC_TRACE_LOG: _bindgen_ty_2 = 184; -pub const _SC_LEVEL1_ICACHE_SIZE: _bindgen_ty_2 = 185; -pub const _SC_LEVEL1_ICACHE_ASSOC: _bindgen_ty_2 = 186; -pub const _SC_LEVEL1_ICACHE_LINESIZE: _bindgen_ty_2 = 187; -pub const _SC_LEVEL1_DCACHE_SIZE: _bindgen_ty_2 = 188; -pub const _SC_LEVEL1_DCACHE_ASSOC: _bindgen_ty_2 = 189; -pub const _SC_LEVEL1_DCACHE_LINESIZE: _bindgen_ty_2 = 190; -pub const _SC_LEVEL2_CACHE_SIZE: _bindgen_ty_2 = 191; -pub const _SC_LEVEL2_CACHE_ASSOC: _bindgen_ty_2 = 192; -pub const _SC_LEVEL2_CACHE_LINESIZE: _bindgen_ty_2 = 193; -pub const _SC_LEVEL3_CACHE_SIZE: _bindgen_ty_2 = 194; -pub const _SC_LEVEL3_CACHE_ASSOC: _bindgen_ty_2 = 195; -pub const _SC_LEVEL3_CACHE_LINESIZE: _bindgen_ty_2 = 196; -pub const _SC_LEVEL4_CACHE_SIZE: _bindgen_ty_2 = 197; -pub const _SC_LEVEL4_CACHE_ASSOC: _bindgen_ty_2 = 198; -pub const _SC_LEVEL4_CACHE_LINESIZE: _bindgen_ty_2 = 199; -pub const _SC_IPV6: _bindgen_ty_2 = 235; -pub const _SC_RAW_SOCKETS: _bindgen_ty_2 = 236; -pub const _SC_V7_ILP32_OFF32: _bindgen_ty_2 = 237; -pub const _SC_V7_ILP32_OFFBIG: _bindgen_ty_2 = 238; -pub const _SC_V7_LP64_OFF64: _bindgen_ty_2 = 239; -pub const _SC_V7_LPBIG_OFFBIG: _bindgen_ty_2 = 240; -pub const _SC_SS_REPL_MAX: _bindgen_ty_2 = 241; -pub const _SC_TRACE_EVENT_NAME_MAX: _bindgen_ty_2 = 242; -pub const _SC_TRACE_NAME_MAX: _bindgen_ty_2 = 243; -pub const _SC_TRACE_SYS_MAX: _bindgen_ty_2 = 244; -pub const _SC_TRACE_USER_EVENT_MAX: _bindgen_ty_2 = 245; -pub const _SC_XOPEN_STREAMS: _bindgen_ty_2 = 246; -pub const _SC_THREAD_ROBUST_PRIO_INHERIT: _bindgen_ty_2 = 247; -pub const _SC_THREAD_ROBUST_PRIO_PROTECT: _bindgen_ty_2 = 248; -pub type _bindgen_ty_2 = ::std::os::raw::c_uint; -pub const _CS_PATH: _bindgen_ty_3 = 0; -pub const _CS_V6_WIDTH_RESTRICTED_ENVS: _bindgen_ty_3 = 1; -pub const _CS_GNU_LIBC_VERSION: _bindgen_ty_3 = 2; -pub const _CS_GNU_LIBPTHREAD_VERSION: _bindgen_ty_3 = 3; -pub const _CS_V5_WIDTH_RESTRICTED_ENVS: _bindgen_ty_3 = 4; -pub const _CS_V7_WIDTH_RESTRICTED_ENVS: _bindgen_ty_3 = 5; -pub const _CS_LFS_CFLAGS: _bindgen_ty_3 = 1000; -pub const _CS_LFS_LDFLAGS: _bindgen_ty_3 = 1001; -pub const _CS_LFS_LIBS: _bindgen_ty_3 = 1002; -pub const _CS_LFS_LINTFLAGS: _bindgen_ty_3 = 1003; -pub const _CS_LFS64_CFLAGS: _bindgen_ty_3 = 1004; -pub const _CS_LFS64_LDFLAGS: _bindgen_ty_3 = 1005; -pub const _CS_LFS64_LIBS: _bindgen_ty_3 = 1006; -pub const _CS_LFS64_LINTFLAGS: _bindgen_ty_3 = 1007; -pub const _CS_XBS5_ILP32_OFF32_CFLAGS: _bindgen_ty_3 = 1100; -pub const _CS_XBS5_ILP32_OFF32_LDFLAGS: _bindgen_ty_3 = 1101; -pub const _CS_XBS5_ILP32_OFF32_LIBS: _bindgen_ty_3 = 1102; -pub const _CS_XBS5_ILP32_OFF32_LINTFLAGS: _bindgen_ty_3 = 1103; -pub const _CS_XBS5_ILP32_OFFBIG_CFLAGS: _bindgen_ty_3 = 1104; -pub const _CS_XBS5_ILP32_OFFBIG_LDFLAGS: _bindgen_ty_3 = 1105; -pub const _CS_XBS5_ILP32_OFFBIG_LIBS: _bindgen_ty_3 = 1106; -pub const _CS_XBS5_ILP32_OFFBIG_LINTFLAGS: _bindgen_ty_3 = 1107; -pub const _CS_XBS5_LP64_OFF64_CFLAGS: _bindgen_ty_3 = 1108; -pub const _CS_XBS5_LP64_OFF64_LDFLAGS: _bindgen_ty_3 = 1109; -pub const _CS_XBS5_LP64_OFF64_LIBS: _bindgen_ty_3 = 1110; -pub const _CS_XBS5_LP64_OFF64_LINTFLAGS: _bindgen_ty_3 = 1111; -pub const _CS_XBS5_LPBIG_OFFBIG_CFLAGS: _bindgen_ty_3 = 1112; -pub const _CS_XBS5_LPBIG_OFFBIG_LDFLAGS: _bindgen_ty_3 = 1113; -pub const _CS_XBS5_LPBIG_OFFBIG_LIBS: _bindgen_ty_3 = 1114; -pub const _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS: _bindgen_ty_3 = 1115; -pub const _CS_POSIX_V6_ILP32_OFF32_CFLAGS: _bindgen_ty_3 = 1116; -pub const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS: _bindgen_ty_3 = 1117; -pub const _CS_POSIX_V6_ILP32_OFF32_LIBS: _bindgen_ty_3 = 1118; -pub const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS: _bindgen_ty_3 = 1119; -pub const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: _bindgen_ty_3 = 1120; -pub const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: _bindgen_ty_3 = 1121; -pub const _CS_POSIX_V6_ILP32_OFFBIG_LIBS: _bindgen_ty_3 = 1122; -pub const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS: _bindgen_ty_3 = 1123; -pub const _CS_POSIX_V6_LP64_OFF64_CFLAGS: _bindgen_ty_3 = 1124; -pub const _CS_POSIX_V6_LP64_OFF64_LDFLAGS: _bindgen_ty_3 = 1125; -pub const _CS_POSIX_V6_LP64_OFF64_LIBS: _bindgen_ty_3 = 1126; -pub const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS: _bindgen_ty_3 = 1127; -pub const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: _bindgen_ty_3 = 1128; -pub const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: _bindgen_ty_3 = 1129; -pub const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS: _bindgen_ty_3 = 1130; -pub const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS: _bindgen_ty_3 = 1131; -pub const _CS_POSIX_V7_ILP32_OFF32_CFLAGS: _bindgen_ty_3 = 1132; -pub const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS: _bindgen_ty_3 = 1133; -pub const _CS_POSIX_V7_ILP32_OFF32_LIBS: _bindgen_ty_3 = 1134; -pub const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS: _bindgen_ty_3 = 1135; -pub const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS: _bindgen_ty_3 = 1136; -pub const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS: _bindgen_ty_3 = 1137; -pub const _CS_POSIX_V7_ILP32_OFFBIG_LIBS: _bindgen_ty_3 = 1138; -pub const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS: _bindgen_ty_3 = 1139; -pub const _CS_POSIX_V7_LP64_OFF64_CFLAGS: _bindgen_ty_3 = 1140; -pub const _CS_POSIX_V7_LP64_OFF64_LDFLAGS: _bindgen_ty_3 = 1141; -pub const _CS_POSIX_V7_LP64_OFF64_LIBS: _bindgen_ty_3 = 1142; -pub const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS: _bindgen_ty_3 = 1143; -pub const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS: _bindgen_ty_3 = 1144; -pub const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS: _bindgen_ty_3 = 1145; -pub const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS: _bindgen_ty_3 = 1146; -pub const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS: _bindgen_ty_3 = 1147; -pub const _CS_V6_ENV: _bindgen_ty_3 = 1148; -pub const _CS_V7_ENV: _bindgen_ty_3 = 1149; -pub type _bindgen_ty_3 = ::std::os::raw::c_uint; -extern "C" { - pub fn pathconf( - __path: *const ::std::os::raw::c_char, - __name: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn fpathconf( - __fd: ::std::os::raw::c_int, - __name: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn sysconf(__name: ::std::os::raw::c_int) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn confstr( - __name: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> usize; -} -extern "C" { - pub fn getpid() -> __pid_t; -} -extern "C" { - pub fn getppid() -> __pid_t; -} -extern "C" { - pub fn getpgrp() -> __pid_t; -} -extern "C" { - pub fn __getpgid(__pid: __pid_t) -> __pid_t; -} -extern "C" { - pub fn getpgid(__pid: __pid_t) -> __pid_t; -} -extern "C" { - pub fn setpgid(__pid: __pid_t, __pgid: __pid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setpgrp() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setsid() -> __pid_t; -} -extern "C" { - pub fn getsid(__pid: __pid_t) -> __pid_t; -} -extern "C" { - pub fn getuid() -> __uid_t; -} -extern "C" { - pub fn geteuid() -> __uid_t; -} -extern "C" { - pub fn getgid() -> __gid_t; -} -extern "C" { - pub fn getegid() -> __gid_t; -} -extern "C" { - pub fn getgroups(__size: ::std::os::raw::c_int, __list: *mut __gid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setuid(__uid: __uid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setreuid(__ruid: __uid_t, __euid: __uid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn seteuid(__uid: __uid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setgid(__gid: __gid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setregid(__rgid: __gid_t, __egid: __gid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setegid(__gid: __gid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fork() -> __pid_t; -} -extern "C" { - pub fn vfork() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ttyname(__fd: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ttyname_r( - __fd: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __buflen: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isatty(__fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ttyslot() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn link( - __from: *const ::std::os::raw::c_char, - __to: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn linkat( - __fromfd: ::std::os::raw::c_int, - __from: *const ::std::os::raw::c_char, - __tofd: ::std::os::raw::c_int, - __to: *const ::std::os::raw::c_char, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn symlink( - __from: *const ::std::os::raw::c_char, - __to: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn readlink( - __path: *const ::std::os::raw::c_char, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> isize; -} -extern "C" { - pub fn symlinkat( - __from: *const ::std::os::raw::c_char, - __tofd: ::std::os::raw::c_int, - __to: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn readlinkat( - __fd: ::std::os::raw::c_int, - __path: *const ::std::os::raw::c_char, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> isize; -} -extern "C" { - pub fn unlink(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn unlinkat( - __fd: ::std::os::raw::c_int, - __name: *const ::std::os::raw::c_char, - __flag: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rmdir(__path: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn tcgetpgrp(__fd: ::std::os::raw::c_int) -> __pid_t; -} -extern "C" { - pub fn tcsetpgrp(__fd: ::std::os::raw::c_int, __pgrp_id: __pid_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getlogin() -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn getlogin_r( - __name: *mut ::std::os::raw::c_char, - __name_len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setlogin(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub static mut optarg: *mut ::std::os::raw::c_char; -} -extern "C" { - pub static mut optind: ::std::os::raw::c_int; -} -extern "C" { - pub static mut opterr: ::std::os::raw::c_int; -} -extern "C" { - pub static mut optopt: ::std::os::raw::c_int; -} -extern "C" { - pub fn getopt( - ___argc: ::std::os::raw::c_int, - ___argv: *const *mut ::std::os::raw::c_char, - __shortopts: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn gethostname(__name: *mut ::std::os::raw::c_char, __len: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sethostname( - __name: *const ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sethostid(__id: ::std::os::raw::c_long) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getdomainname( - __name: *mut ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setdomainname( - __name: *const ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vhangup() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn revoke(__file: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn profil( - __sample_buffer: *mut ::std::os::raw::c_ushort, - __size: usize, - __offset: usize, - __scale: ::std::os::raw::c_uint, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn acct(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getusershell() -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn endusershell(); -} -extern "C" { - pub fn setusershell(); -} -extern "C" { - pub fn daemon( - __nochdir: ::std::os::raw::c_int, - __noclose: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn chroot(__path: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getpass(__prompt: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fsync(__fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn gethostid() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn sync(); -} -extern "C" { - pub fn getpagesize() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getdtablesize() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn truncate( - __file: *const ::std::os::raw::c_char, - __length: __off_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftruncate(__fd: ::std::os::raw::c_int, __length: __off_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn brk(__addr: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sbrk(__delta: isize) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn syscall(__sysno: ::std::os::raw::c_long, ...) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lockf( - __fd: ::std::os::raw::c_int, - __cmd: ::std::os::raw::c_int, - __len: __off_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fdatasync(__fildes: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn crypt( - __key: *const ::std::os::raw::c_char, - __salt: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn getentropy( - __buffer: *mut ::std::os::raw::c_void, - __length: usize, - ) -> ::std::os::raw::c_int; -} pub type metacall_pid = pid_t; pub type metacall_pre_fork_callback_ptr = ::std::option::Option< unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, @@ -5407,18 +615,18 @@ pub type metacall_post_fork_callback_ptr = ::std::option::Option< arg2: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Initialize fork detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_fork_initialize() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Set fork hook callback\n\n @param[in] pre_callback\n Callback to be called before fork detour is executed\n\n @param[in] post_callback\n Callback to be called after fork detour is executed"] pub fn metacall_fork( pre_callback: metacall_pre_fork_callback_ptr, post_callback: metacall_post_fork_callback_ptr, ); } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Unregister fork detours and destroy shared memory\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_fork_destroy() -> ::std::os::raw::c_int; } @@ -5428,48 +636,17 @@ pub struct metacall_initialize_configuration_type { pub tag: *mut ::std::os::raw::c_char, pub options: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_metacall_initialize_configuration_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_initialize_configuration_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_initialize_configuration_type>(), - 16usize, - concat!( - "Size of: ", - stringify!(metacall_initialize_configuration_type) - ) - ); - assert_eq!( - ::std::mem::align_of::<metacall_initialize_configuration_type>(), - 8usize, - concat!( - "Alignment of ", - stringify!(metacall_initialize_configuration_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_initialize_configuration_type), - "::", - stringify!(tag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_initialize_configuration_type), - "::", - stringify!(options) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of metacall_initialize_configuration_type"] + [::std::mem::size_of::<metacall_initialize_configuration_type>() - 16usize]; + ["Alignment of metacall_initialize_configuration_type"] + [::std::mem::align_of::<metacall_initialize_configuration_type>() - 8usize]; + ["Offset of field: metacall_initialize_configuration_type::tag"] + [::std::mem::offset_of!(metacall_initialize_configuration_type, tag) - 0usize]; + ["Offset of field: metacall_initialize_configuration_type::options"] + [::std::mem::offset_of!(metacall_initialize_configuration_type, options) - 8usize]; +}; pub type metacall_await_callback = ::std::option::Option< unsafe extern "C" fn( arg1: *mut ::std::os::raw::c_void, @@ -5482,42 +659,17 @@ pub struct metacall_await_callbacks_type { pub resolve: metacall_await_callback, pub reject: metacall_await_callback, } -#[test] -fn bindgen_test_layout_metacall_await_callbacks_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_await_callbacks_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_await_callbacks_type>(), - 16usize, - concat!("Size of: ", stringify!(metacall_await_callbacks_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_await_callbacks_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_await_callbacks_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).resolve) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_await_callbacks_type), - "::", - stringify!(resolve) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reject) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_await_callbacks_type), - "::", - stringify!(reject) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of metacall_await_callbacks_type"] + [::std::mem::size_of::<metacall_await_callbacks_type>() - 16usize]; + ["Alignment of metacall_await_callbacks_type"] + [::std::mem::align_of::<metacall_await_callbacks_type>() - 8usize]; + ["Offset of field: metacall_await_callbacks_type::resolve"] + [::std::mem::offset_of!(metacall_await_callbacks_type, resolve) - 0usize]; + ["Offset of field: metacall_await_callbacks_type::reject"] + [::std::mem::offset_of!(metacall_await_callbacks_type, reject) - 8usize]; +}; pub type metacall_await_callbacks = metacall_await_callbacks_type; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -5529,138 +681,77 @@ pub struct metacall_version_type { pub str_: *const ::std::os::raw::c_char, pub name: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_metacall_version_type() { - const UNINIT: ::std::mem::MaybeUninit<metacall_version_type> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<metacall_version_type>(), - 40usize, - concat!("Size of: ", stringify!(metacall_version_type)) - ); - assert_eq!( - ::std::mem::align_of::<metacall_version_type>(), - 8usize, - concat!("Alignment of ", stringify!(metacall_version_type)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).major) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(metacall_version_type), - "::", - stringify!(major) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).minor) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(metacall_version_type), - "::", - stringify!(minor) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).patch) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(metacall_version_type), - "::", - stringify!(patch) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).revision) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(metacall_version_type), - "::", - stringify!(revision) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).str_) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(metacall_version_type), - "::", - stringify!(str_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(metacall_version_type), - "::", - stringify!(name) - ) - ); -} -extern "C" { - pub static mut metacall_null_args: [*mut ::std::os::raw::c_void; 1usize]; -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of metacall_version_type"][::std::mem::size_of::<metacall_version_type>() - 40usize]; + ["Alignment of metacall_version_type"] + [::std::mem::align_of::<metacall_version_type>() - 8usize]; + ["Offset of field: metacall_version_type::major"] + [::std::mem::offset_of!(metacall_version_type, major) - 0usize]; + ["Offset of field: metacall_version_type::minor"] + [::std::mem::offset_of!(metacall_version_type, minor) - 4usize]; + ["Offset of field: metacall_version_type::patch"] + [::std::mem::offset_of!(metacall_version_type, patch) - 8usize]; + ["Offset of field: metacall_version_type::revision"] + [::std::mem::offset_of!(metacall_version_type, revision) - 16usize]; + ["Offset of field: metacall_version_type::str_"] + [::std::mem::offset_of!(metacall_version_type, str_) - 24usize]; + ["Offset of field: metacall_version_type::name"] + [::std::mem::offset_of!(metacall_version_type, name) - 32usize]; +}; +unsafe extern "C" { #[doc = " @brief\n Returns default serializer used by MetaCall\n\n @return\n Name of the serializer to be used with serialization methods"] pub fn metacall_serial() -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Disables MetaCall logs, must be called before @metacall_initialize.\n\n When initializing MetaCall, it initializes a default logs to stdout\n if none was defined. If you want to benchmark or simply disable this\n default logs, you can call to this function before @metacall_initialize."] pub fn metacall_log_null(); } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Flags to be set in MetaCall library\n\n @param[in] flags\n Combination of flags referring to definitions METACALL_FLAGS_*"] pub fn metacall_flags(flags: ::std::os::raw::c_int); } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Initialize MetaCall library\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_initialize() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Initialize MetaCall library with configuration arguments\n\n @param[in] initialize_config\n Extension of the script to be loaded in memory with data to be injected\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_initialize_ex( initialize_config: *mut metacall_initialize_configuration_type, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Initialize MetaCall application arguments\n\n @param[in] argc\n Number of additional parameters to be passed to the runtime when initializing\n\n @param[in] argv\n Additional parameters to be passed to the runtime when initializing (when using MetaCall as an application)"] pub fn metacall_initialize_args( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ); } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the number of arguments in which MetaCall was initialized\n\n @return\n An integer equal or greater than zero"] pub fn metacall_argc() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the arguments in which MetaCall was initialized\n\n @return\n A pointer to an array of strings with the additional arguments"] pub fn metacall_argv() -> *mut *mut ::std::os::raw::c_char; } -extern "C" { - #[doc = " @brief\n Check if script context is loaded by @tag\n\n @param[in] tag\n Extension of the script\n\n @return\n Zero if context is initialized, different from zero otherwise"] +unsafe extern "C" { + #[doc = " @brief\n Check if script context is loaded by @tag\n\n @param[in] tag\n Extension of the script (if tag is NULL, it returns the status of the whole MetaCall instance)\n\n @return\n Zero if context is initialized, different from zero otherwise"] pub fn metacall_is_initialized(tag: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Amount of function call arguments supported by MetaCall\n\n @return\n Number of arguments suported"] pub fn metacall_args_size() -> usize; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Set a execution path defined by @path to the extension script @tag\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path to be loaded\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_execution_path( tag: *const ::std::os::raw::c_char, path: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Set a execution path defined by @path to the extension script @tag with length\n\n @param[in] tag\n Extension of the script\n\n @param[in] tag_length\n Length of the extension of the tag\n\n @param[in] path\n Path to be loaded\n\n @param[in] path_length\n Length of the path\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_execution_path_s( tag: *const ::std::os::raw::c_char, @@ -5669,7 +760,7 @@ extern "C" { path_length: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Loads a script from file specified by @path\n\n @param[in] tag\n Extension of the script\n\n @param[in] paths\n Path array of files\n\n @param[in] size\n Size of the array @paths\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_file( tag: *const ::std::os::raw::c_char, @@ -5678,7 +769,7 @@ extern "C" { handle: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Loads a script from memory\n\n @param[in] tag\n Extension of the script\n\n @param[in] buffer\n Memory block representing the string of the script\n\n @param[in] size\n Memory block representing the string of the script\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_memory( tag: *const ::std::os::raw::c_char, @@ -5687,7 +778,7 @@ extern "C" { handle: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Loads a package of scrips from file specified by @path into loader defined by @extension\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path of the package\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_package( tag: *const ::std::os::raw::c_char, @@ -5695,7 +786,7 @@ extern "C" { handle: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Loads a a list of scrips from configuration specified by @path into loader\n with the following format:\n {\n \"language_id\": \"<tag>\",\n \"path\": \"<path>\",\n \"scripts\": [ \"<script0>\", \"<script1>\", ..., \"<scriptN>\" ]\n }\n\n @param[in] path\n Path of the configuration\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @param[in] allocator\n Pointer to allocator will allocate the configuration\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_configuration( path: *const ::std::os::raw::c_char, @@ -5703,14 +794,14 @@ extern "C" { allocator: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv( name: *const ::std::os::raw::c_char, args: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_s( name: *const ::std::os::raw::c_char, @@ -5718,7 +809,7 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallhv( handle: *mut ::std::os::raw::c_void, @@ -5726,7 +817,7 @@ extern "C" { args: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n Includes @size in order to allow variadic arguments or safe calls\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallhv_s( handle: *mut ::std::os::raw::c_void, @@ -5735,11 +826,11 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall(name: *const ::std::os::raw::c_char, ...) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt( name: *const ::std::os::raw::c_char, @@ -5747,7 +838,7 @@ extern "C" { ... ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_s( name: *const ::std::os::raw::c_char, @@ -5756,7 +847,7 @@ extern "C" { ... ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallht_s( handle: *mut ::std::os::raw::c_void, @@ -5766,18 +857,33 @@ extern "C" { ... ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the function by @name\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] pub fn metacall_function(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { + #[doc = " @brief\n Create an empty handler into a loader with name @name\n\n @param[in] loader\n Pointer to the loader which the handle belongs to\n\n @param[in] name\n Name of the handle\n\n @param[out] handle_ptr\n On success, returns the pointer to the handle created, otherwise NULL\n\n @return\n Return zero on success, different from zero on error"] + pub fn metacall_handle_initialize( + loader: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + handle_ptr: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Populate the objects of @handle_src into @handle_dest\n\n @param[inout] handle_dest\n Handle where the objects from @handle_src will be stored\n\n @param[in] handle_src\n Handle from where the objects will be copied\n\n @return\n Return zero on success, different from zero on error"] + pub fn metacall_handle_populate( + handle_dest: *mut ::std::os::raw::c_void, + handle_src: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { #[doc = " @brief\n Get the function by @name from @handle\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] pub fn metacall_handle_function( handle: *mut ::std::os::raw::c_void, name: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the function parameter type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n @param[in] parameter\n The index of the parameter to be retrieved\n\n @param[out] id\n The parameter type id that will be returned\n\n @return\n Return 0 if the @parameter index exists and @func is valid, 1 otherwhise"] pub fn metacall_function_parameter_type( func: *mut ::std::os::raw::c_void, @@ -5785,47 +891,47 @@ extern "C" { id: *mut metacall_value_id, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the function return type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n\n @param[out] id\n The value id of the return type of the function @func\n\n @return\n Return 0 if the @func is valid, 1 otherwhise"] pub fn metacall_function_return_type( func: *mut ::std::os::raw::c_void, id: *mut metacall_value_id, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get minimun mumber of arguments accepted by function @func\n\n @param[in] func\n Function reference\n\n @return\n Return mumber of arguments"] pub fn metacall_function_size(func: *mut ::std::os::raw::c_void) -> usize; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Check if the function @func is asynchronous or synchronous\n\n @param[in] func\n Function reference\n\n @return\n Return 0 if it is syncrhonous, 1 if it is asynchronous and -1 if the function is NULL"] pub fn metacall_function_async(func: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the handle by @name\n\n @param[in] tag\n Extension of the script\n\n @param[in] name\n Name of the handle\n\n @return\n Handle reference, null if the function does not exist"] pub fn metacall_handle( tag: *const ::std::os::raw::c_char, name: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get name of a @handle\n\n @param[in] handle\n Pointer to the handle to be retrieved\n\n @return\n String that references the handle"] pub fn metacall_handle_id(handle: *mut ::std::os::raw::c_void) -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Return a value representing the handle as a map of functions (or values)\n\n @param[in] handle\n Reference to the handle to be described\n\n @return\n A value of type map on success, null otherwise"] pub fn metacall_handle_export( handle: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfv( func: *mut ::std::os::raw::c_void, args: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of function arguments\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfv_s( func: *mut ::std::os::raw::c_void, @@ -5833,11 +939,11 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by variable arguments @va_args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallf(func: *mut ::std::os::raw::c_void, ...) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfs( func: *mut ::std::os::raw::c_void, @@ -5846,7 +952,7 @@ extern "C" { allocator: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfmv( func: *mut ::std::os::raw::c_void, @@ -5854,7 +960,7 @@ extern "C" { values: *mut *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfms( func: *mut ::std::os::raw::c_void, @@ -5863,7 +969,7 @@ extern "C" { allocator: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Register a function by name @name and arguments @va_args\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] va_args\n Varidic function parameter types\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall_register( name: *const ::std::os::raw::c_char, @@ -5880,7 +986,7 @@ extern "C" { ... ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall_registerv( name: *const ::std::os::raw::c_char, @@ -5897,11 +1003,15 @@ extern "C" { types: *mut metacall_value_id, ) -> ::std::os::raw::c_int; } -extern "C" { - #[doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] loader\n Opaque pointer to the loader in which you want to register the function (this allows to register the function into a different loader than the host)\n\n @param[in] context\n Opaque pointer to the context in which you want to register the function (if it is NULL, it will be defined on the global scope of the loader)\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Pointer to value containing the result of the call"] +unsafe extern "C" { + #[doc = " @brief\n Obtain the loader instance by @tag\n\n @param[in] tag\n Tag in which the loader is identified, normally it is the extension of the script\n\n @return\n Pointer the loader by @tag"] + pub fn metacall_loader(tag: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] loader\n Opaque pointer to the loader in which you want to register the function (this allows to register the function into a different loader than the host)\n\n @param[in] handle\n Opaque pointer to the handle in which you want to register the function (if it is NULL, it will be defined on the global scope of the loader)\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Zero if the function was registered properly, distinct from zero otherwise"] pub fn metacall_register_loaderv( loader: *mut ::std::os::raw::c_void, - context: *mut ::std::os::raw::c_void, + handle: *mut ::std::os::raw::c_void, name: *const ::std::os::raw::c_char, invoke: ::std::option::Option< unsafe extern "C" fn( @@ -5915,7 +1025,7 @@ extern "C" { types: *mut metacall_value_id, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await( name: *const ::std::os::raw::c_char, @@ -5935,7 +1045,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Awaits for a promise and registers a callback to be executed when a future is resolved\n\n @param[in] f\n The pointer to the future\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await_future( f: *mut ::std::os::raw::c_void, @@ -5954,7 +1064,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await_s( name: *const ::std::os::raw::c_char, @@ -5975,7 +1085,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await( func: *mut ::std::os::raw::c_void, @@ -5995,7 +1105,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await_s( func: *mut ::std::os::raw::c_void, @@ -6016,7 +1126,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func (offered without function pointers for languages without support to function pointers)\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] cb\n Pointer to struct containing the function pointers to reject and resolve that will be executed when task completion or error\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await_struct_s( func: *mut ::std::os::raw::c_void, @@ -6026,7 +1136,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] size\n Number of elements of the arrays @keys and @values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfmv_await( func: *mut ::std::os::raw::c_void, @@ -6047,7 +1157,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfmv_await_s( func: *mut ::std::os::raw::c_void, @@ -6069,7 +1179,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfs_await( func: *mut ::std::os::raw::c_void, @@ -6091,7 +1201,7 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfms_await( func: *mut ::std::os::raw::c_void, @@ -6113,11 +1223,11 @@ extern "C" { data: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the class by @name\n\n @param[in] name\n Name of the class\n\n @return\n Class reference, null if the class does not exist"] pub fn metacall_class(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a class method anonymously by value array @args (this procedure assumes there's no overloaded methods and does type conversion on values)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_class( cls: *mut ::std::os::raw::c_void, @@ -6126,7 +1236,7 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a class method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_class( cls: *mut ::std::os::raw::c_void, @@ -6136,7 +1246,7 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Create a new object instance from @cls by value array @args\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the new object\n\n @param[in] args\n Array of pointers constructor parameters\n\n @param[in] size\n Number of elements of constructor parameters\n\n @return\n Pointer to the new object value instance"] pub fn metacall_class_new( cls: *mut ::std::os::raw::c_void, @@ -6145,14 +1255,14 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get an attribute from @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the class attribute value or NULL if an error occurred"] pub fn metacall_class_static_get( cls: *mut ::std::os::raw::c_void, key: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Set an attribute to @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] pub fn metacall_class_static_set( cls: *mut ::std::os::raw::c_void, @@ -6160,7 +1270,7 @@ extern "C" { v: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call an object method anonymously by value array @args\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_object( obj: *mut ::std::os::raw::c_void, @@ -6169,7 +1279,7 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Call a object method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_object( obj: *mut ::std::os::raw::c_void, @@ -6179,14 +1289,14 @@ extern "C" { size: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get an attribute from @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the object attribute value or NULL if an error occurred"] pub fn metacall_object_get( obj: *mut ::std::os::raw::c_void, key: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Set an attribute to @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] pub fn metacall_object_set( obj: *mut ::std::os::raw::c_void, @@ -6194,19 +1304,23 @@ extern "C" { v: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the value contained by throwable object @th\n\n @param[in] th\n Pointer to the throwable object\n\n @return\n Pointer to the value inside of the throwable or NULL in case of error"] pub fn metacall_throwable_value(th: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide information about all loaded objects\n\n @param[out] size\n Size in bytes of return buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n String containing introspection information"] pub fn metacall_inspect( size: *mut usize, allocator: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { + #[doc = " @brief\n Provide information about all loaded objects as a value\n\n @return\n Value containing introspection information"] + pub fn metacall_inspect_value() -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { #[doc = " @brief\n Convert the value @v to serialized string\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] v\n Reference to the value\n\n @param[out] size\n Size of new allocated string\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n New allocated string containing stringified value"] pub fn metacall_serialize( name: *const ::std::os::raw::c_char, @@ -6215,7 +1329,7 @@ extern "C" { allocator: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Convert the string @buffer to value\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] buffer\n String to be deserialized\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n New allocated value representing the string (must be freed)"] pub fn metacall_deserialize( name: *const ::std::os::raw::c_char, @@ -6224,27 +1338,31 @@ extern "C" { allocator: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Clear handle from memory and unload related resources\n\n @param[in] handle\n Reference to the handle to be unloaded\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_clear(handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Get the plugin extension handle to be used for loading plugins\n\n @return\n Pointer to the extension handle, or null if it failed to load"] pub fn metacall_plugin_extension() -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { + #[doc = " @brief\n Get the handle containing all the functionality of the plugins from core\n\n @return\n Pointer to the core plugin handle, or null if it failed to load"] + pub fn metacall_plugin_core() -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { #[doc = " @brief\n Get the plugin extension path to be used for accessing the plugins folder\n\n @return\n String containing the core plugin path, or null if it failed to load the plugin extension"] pub fn metacall_plugin_path() -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Destroy MetaCall library\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_destroy() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide the module version struct\n\n @return\n Static struct containing unpacked version"] pub fn metacall_version() -> *const metacall_version_type; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is @major,\n I is @minor and P is @patch\n\n @param[in] major\n Unsigned integer representing major version\n\n @param[in] minor\n Unsigned integer representing minor version\n\n @param[in] patch\n Unsigned integer representing patch version\n\n @return\n Hexadecimal integer containing packed version"] pub fn metacall_version_hex_make( major: ::std::os::raw::c_uint, @@ -6252,87 +1370,23 @@ extern "C" { patch: ::std::os::raw::c_uint, ) -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is major,\n I is minor and P is patch\n\n @return\n Hexadecimal integer containing packed version"] pub fn metacall_version_hex() -> u32; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide the module version string\n\n @return\n Static string containing module version"] pub fn metacall_version_str() -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide the module version revision string\n\n @return\n Static string containing module version revision"] pub fn metacall_version_revision() -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide the module version name\n\n @return\n Static string containing module version name"] pub fn metacall_version_name() -> *const ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { #[doc = " @brief\n Provide the module information\n\n @return\n Static string containing module information"] pub fn metacall_print_info() -> *const ::std::os::raw::c_char; } -pub type __builtin_va_list = [__va_list_tag; 1usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __va_list_tag { - pub gp_offset: ::std::os::raw::c_uint, - pub fp_offset: ::std::os::raw::c_uint, - pub overflow_arg_area: *mut ::std::os::raw::c_void, - pub reg_save_area: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout___va_list_tag() { - const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - concat!("Size of: ", stringify!(__va_list_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__va_list_tag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} diff --git a/source/ports/rs_port/src/helpers.rs b/source/ports/rs_port/src/helpers.rs index 68941d180..8dc754416 100644 --- a/source/ports/rs_port/src/helpers.rs +++ b/source/ports/rs_port/src/helpers.rs @@ -1,12 +1,12 @@ -use crate::types::MetacallValue; +use crate::types::MetaCallValue; use std::any::Any; -pub trait MetacallDowncast: Any { +pub trait MetaCallDowncast: Any { fn into_any(self: Box<Self>) -> Box<dyn Any>; fn as_any(&self) -> &dyn Any; fn as_any_mut(&mut self) -> &mut dyn Any; } -impl<T: Any> MetacallDowncast for T { +impl<T: Any> MetaCallDowncast for T { fn into_any(self: Box<Self>) -> Box<dyn Any> { self } @@ -17,40 +17,40 @@ impl<T: Any> MetacallDowncast for T { self } } -impl dyn MetacallValue { +impl dyn MetaCallValue { /// Checks if the trait object is having the given type. - pub fn is<T: MetacallValue>(&self) -> bool { - MetacallDowncast::as_any(self).is::<T>() + pub fn is<T: MetaCallValue>(&self) -> bool { + MetaCallDowncast::as_any(self).is::<T>() } /// Downcasts the inner value of the trait object and returns the ownership. - pub fn downcast<T: MetacallValue>(self: Box<Self>) -> Result<T, Box<Self>> { + pub fn downcast<T: MetaCallValue>(self: Box<Self>) -> Result<T, Box<Self>> { if self.is::<T>() { - Ok(*MetacallDowncast::into_any(self).downcast::<T>().unwrap()) + Ok(*MetaCallDowncast::into_any(self).downcast::<T>().unwrap()) } else { Err(self) } } /// Downcasts the inner value of the trait object and returns a reference. - pub fn downcast_ref<T: MetacallValue>(&self) -> Option<&T> { - MetacallDowncast::as_any(self).downcast_ref::<T>() + pub fn downcast_ref<T: MetaCallValue>(&self) -> Option<&T> { + MetaCallDowncast::as_any(self).downcast_ref::<T>() } /// Downcasts the inner value of the trait object and returns a mutable reference. - pub fn downcast_mut<T: MetacallValue>(&mut self) -> Option<&mut T> { - MetacallDowncast::as_any_mut(self).downcast_mut::<T>() + pub fn downcast_mut<T: MetaCallValue>(&mut self) -> Option<&mut T> { + MetaCallDowncast::as_any_mut(self).downcast_mut::<T>() } } -pub trait MetacallSealed {} -impl<T: Clone> MetacallSealed for T {} -impl MetacallSealed for str {} -impl<T: Clone> MetacallSealed for [T] {} +pub trait MetaCallSealed {} +impl<T: Clone> MetaCallSealed for T {} +impl MetaCallSealed for str {} +impl<T: Clone> MetaCallSealed for [T] {} pub fn clone_box<T>(t: &T) -> Box<T> where - T: ?Sized + MetacallClone, + T: ?Sized + MetaCallClone, { unsafe { let mut fat_ptr = t as *const T; @@ -58,16 +58,16 @@ where assert_eq!(*data_ptr as *const (), t as *const T as *const ()); - *data_ptr = <T as MetacallClone>::clone_box(t); + *data_ptr = <T as MetaCallClone>::clone_box(t); Box::from_raw(fat_ptr as *mut T) } } -pub trait MetacallClone: MetacallSealed { +pub trait MetaCallClone: MetaCallSealed { fn clone_box(&self) -> *mut (); } -impl<T> MetacallClone for T +impl<T> MetaCallClone for T where T: Clone, { @@ -76,12 +76,12 @@ where } } -impl MetacallClone for str { +impl MetaCallClone for str { fn clone_box(&self) -> *mut () { Box::<str>::into_raw(Box::from(self)) as *mut () } } -impl<T> MetacallClone for [T] +impl<T> MetaCallClone for [T] where T: Clone, { @@ -89,27 +89,27 @@ where Box::<[T]>::into_raw(self.iter().cloned().collect()) as *mut () } } -impl<'c> Clone for Box<dyn MetacallValue + 'c> { +impl<'c> Clone for Box<dyn MetaCallValue + 'c> { fn clone(&self) -> Self { clone_box(&**self) } } -impl<'c> Clone for Box<dyn MetacallValue + Send + 'c> { +impl<'c> Clone for Box<dyn MetaCallValue + Send + 'c> { fn clone(&self) -> Self { clone_box(&**self) } } -impl<'c> Clone for Box<dyn MetacallValue + Sync + 'c> { +impl<'c> Clone for Box<dyn MetaCallValue + Sync + 'c> { fn clone(&self) -> Self { clone_box(&**self) } } -impl<'c> Clone for Box<dyn MetacallValue + Send + Sync + 'c> { +impl<'c> Clone for Box<dyn MetaCallValue + Send + Sync + 'c> { fn clone(&self) -> Self { clone_box(&**self) } } -pub fn metacall_implementer_to_traitobj(v: impl MetacallValue) -> Box<dyn MetacallValue> { - Box::new(v) as Box<dyn MetacallValue> +pub fn metacall_implementer_to_traitobj(v: impl MetaCallValue) -> Box<dyn MetaCallValue> { + Box::new(v) as Box<dyn MetaCallValue> } diff --git a/source/ports/rs_port/src/lib.rs b/source/ports/rs_port/src/lib.rs index bc4241007..796d89b2e 100644 --- a/source/ports/rs_port/src/lib.rs +++ b/source/ports/rs_port/src/lib.rs @@ -44,7 +44,7 @@ //! use metacall::{switch, metacall, loaders}; //! //! fn main() { -//! // Initialize Metacall at the top +//! // Initialize MetaCall at the top //! let _metacall = switch::initialize().unwrap(); //! //! // Load the file (Checkout the loaders module for loading multiple files @@ -63,7 +63,7 @@ pub(crate) mod helpers; pub(crate) mod parsers; pub(crate) use macros::private_macros::*; -/// Contains Metacall loaders from file and memory. Usage example: ... +/// Contains MetaCall loaders from file and memory. Usage example: ... /// ``` /// // Loading a single file with Nodejs. /// metacall::loaders::from_single_file("node", "index.js").unwrap(); @@ -91,7 +91,7 @@ pub use types::*; mod metacall_mod; pub use metacall_mod::*; -/// Contains Metacall language inliners. Usage example: ... +/// Contains MetaCall language inliners. Usage example: ... /// ``` /// // Python /// py! { diff --git a/source/ports/rs_port/src/loaders.rs b/source/ports/rs_port/src/loaders.rs index eb691acbb..bf5f4fb11 100644 --- a/source/ports/rs_port/src/loaders.rs +++ b/source/ports/rs_port/src/loaders.rs @@ -1,7 +1,7 @@ use crate::{ bindings::{metacall_load_from_file, metacall_load_from_memory}, cstring_enum, - types::MetacallLoaderError, + types::MetaCallLoaderError, }; use std::{ ffi::CString, @@ -17,7 +17,7 @@ use std::{ pub fn from_single_file( tag: impl ToString, script: impl AsRef<Path>, -) -> Result<(), MetacallLoaderError> { +) -> Result<(), MetaCallLoaderError> { from_file(tag, [script]) } /// Loads a script from file. Usage example: ... @@ -28,8 +28,8 @@ pub fn from_single_file( pub fn from_file( tag: impl ToString, scripts: impl IntoIterator<Item = impl AsRef<Path>>, -) -> Result<(), MetacallLoaderError> { - let c_tag = cstring_enum!(tag, MetacallLoaderError)?; +) -> Result<(), MetaCallLoaderError> { + let c_tag = cstring_enum!(tag, MetaCallLoaderError)?; let mut c_script: CString; let mut new_scripts: Vec<*const i8> = Vec::new(); @@ -38,15 +38,15 @@ pub fn from_file( let script_as_str = script_as_pathbuf.to_str().unwrap(); if !script_as_pathbuf.exists() { - return Err(MetacallLoaderError::FileNotFound(script_as_pathbuf)); + return Err(MetaCallLoaderError::FileNotFound(script_as_pathbuf)); } if !script_as_pathbuf.is_file() { - return Err(MetacallLoaderError::NotAFileOrPermissionDenied( + return Err(MetaCallLoaderError::NotAFileOrPermissionDenied( script_as_pathbuf, )); } - c_script = cstring_enum!(script_as_str, MetacallLoaderError)?; + c_script = cstring_enum!(script_as_str, MetaCallLoaderError)?; new_scripts.push(c_script.as_ptr()); } @@ -60,7 +60,7 @@ pub fn from_file( ) } != 0 { - return Err(MetacallLoaderError::FromFileFailure); + return Err(MetaCallLoaderError::FromFileFailure); } Ok(()) @@ -73,10 +73,10 @@ pub fn from_file( /// // A Nodejs script /// metacall::loaders::from_memory("node", script).unwrap(); /// ``` -pub fn from_memory(tag: impl ToString, script: impl ToString) -> Result<(), MetacallLoaderError> { +pub fn from_memory(tag: impl ToString, script: impl ToString) -> Result<(), MetaCallLoaderError> { let script = script.to_string(); - let c_tag = cstring_enum!(tag, MetacallLoaderError)?; - let c_script = cstring_enum!(script, MetacallLoaderError)?; + let c_tag = cstring_enum!(tag, MetaCallLoaderError)?; + let c_script = cstring_enum!(script, MetaCallLoaderError)?; if unsafe { metacall_load_from_memory( @@ -87,7 +87,7 @@ pub fn from_memory(tag: impl ToString, script: impl ToString) -> Result<(), Meta ) } != 0 { - return Err(MetacallLoaderError::FromMemoryFailure); + return Err(MetaCallLoaderError::FromMemoryFailure); } Ok(()) diff --git a/source/ports/rs_port/src/macros.rs b/source/ports/rs_port/src/macros.rs index 2604455fd..fd24a00f0 100644 --- a/source/ports/rs_port/src/macros.rs +++ b/source/ports/rs_port/src/macros.rs @@ -1,6 +1,6 @@ // Used for documentation. #[allow(unused_imports)] -use crate::MetacallValue; +use crate::MetaCallValue; pub(crate) mod private_macros { macro_rules! cstring_enum { @@ -9,7 +9,7 @@ pub(crate) mod private_macros { match ::std::ffi::CString::new(var.clone()) { Ok(str) => Ok(str), Err(err) => Err($enum::UnexpectedCStringConversionErr( - $crate::MetacallStringConversionError::new(var, err), + $crate::MetaCallStringConversionError::new(var, err), )), } }}; @@ -25,7 +25,7 @@ pub(crate) mod private_macros { let var = $var.to_string(); match ::std::ffi::CString::new(var.clone()) { Ok(str) => Ok(str), - Err(err) => Err($crate::MetacallStringConversionError::new(var, err)), + Err(err) => Err($crate::MetaCallStringConversionError::new(var, err)), } }}; @@ -40,7 +40,7 @@ pub(crate) mod private_macros { } #[macro_export] -/// Matches [MetacallValue](MetacallValue) trait object. For example: ... +/// Matches [MetaCallValue](MetaCallValue) trait object. For example: ... /// ``` /// use metacall::{metacall_untyped_no_arg, match_metacall_value}; /// diff --git a/source/ports/rs_port/src/metacall.rs b/source/ports/rs_port/src/metacall.rs index 72d7eb234..b05c8f851 100644 --- a/source/ports/rs_port/src/metacall.rs +++ b/source/ports/rs_port/src/metacall.rs @@ -1,7 +1,7 @@ use crate::{ bindings::{metacall_function, metacall_value_destroy, metacallfv_s}, cstring_enum, parsers, - types::{MetacallError, MetacallNull, MetacallValue}, + types::{MetaCallError, MetaCallNull, MetaCallValue}, }; use std::ffi::c_void; @@ -11,13 +11,13 @@ use crate::match_metacall_value; fn metacall_inner( func: impl ToString, - args: impl IntoIterator<Item = impl MetacallValue>, -) -> Result<*mut c_void, MetacallError> { - let c_function = cstring_enum!(func, MetacallError)?; + args: impl IntoIterator<Item = impl MetaCallValue>, +) -> Result<*mut c_void, MetaCallError> { + let c_function = cstring_enum!(func, MetaCallError)?; let c_func = unsafe { metacall_function(c_function.as_ptr()) }; if c_func.is_null() { - return Err(MetacallError::FunctionNotFound); + return Err(MetaCallError::FunctionNotFound); } let mut c_args = parsers::metacallobj_to_raw_args(args); @@ -32,7 +32,7 @@ fn metacall_inner( Ok(ret) } /// Calls a function same as [metacall](metacall) but returns a trait object -/// of [MetacallValue](MetacallValue). This is useful when you don't know the return +/// of [MetaCallValue](MetaCallValue). This is useful when you don't know the return /// type of that function or the function may return multiple types. Checkout /// [match_metacall_value](match_metacall_value) for unwrapping the inner value. For example: ... /// ``` @@ -40,8 +40,8 @@ fn metacall_inner( /// ``` pub fn metacall_untyped( func: impl ToString, - args: impl IntoIterator<Item = impl MetacallValue>, -) -> Result<Box<dyn MetacallValue>, MetacallError> { + args: impl IntoIterator<Item = impl MetaCallValue>, +) -> Result<Box<dyn MetaCallValue>, MetaCallError> { Ok(parsers::raw_to_metacallobj_untyped(metacall_inner( func, args, )?)) @@ -52,28 +52,28 @@ pub fn metacall_untyped( /// ``` pub fn metacall_untyped_no_arg( func: impl ToString, -) -> Result<Box<dyn MetacallValue>, MetacallError> { - metacall_untyped(func, [] as [MetacallNull; 0]) +) -> Result<Box<dyn MetaCallValue>, MetaCallError> { + metacall_untyped(func, [] as [MetaCallNull; 0]) } /// Calls a function with arguments. The generic parameter is the return type of the function -/// you're calling. Checkout [MetacallValue](MetacallValue) for possible types. +/// you're calling. Checkout [MetaCallValue](MetaCallValue) for possible types. /// For example: ... /// ``` /// let sum = metacall::metacall::<i32>("sum", [1, 2]).unwrap(); /// ``` -pub fn metacall<T: MetacallValue>( +pub fn metacall<T: MetaCallValue>( func: impl ToString, - args: impl IntoIterator<Item = impl MetacallValue>, -) -> Result<T, MetacallError> { + args: impl IntoIterator<Item = impl MetaCallValue>, +) -> Result<T, MetaCallError> { match parsers::raw_to_metacallobj::<T>(metacall_inner(func, args)?) { Ok(ret) => Ok(ret), - Err(original) => Err(MetacallError::FailedCasting(original)), + Err(original) => Err(MetaCallError::FailedCasting(original)), } } /// Calls a function same as [metacall](metacall) without passing any arguments. For example: ... /// ``` /// let greet = metacall::metacall_no_arg::<String>("greet").unwrap(); /// ``` -pub fn metacall_no_arg<T: MetacallValue>(func: impl ToString) -> Result<T, MetacallError> { - metacall::<T>(func, [] as [MetacallNull; 0]) +pub fn metacall_no_arg<T: MetaCallValue>(func: impl ToString) -> Result<T, MetaCallError> { + metacall::<T>(func, [] as [MetaCallNull; 0]) } diff --git a/source/ports/rs_port/src/parsers.rs b/source/ports/rs_port/src/parsers.rs index 06dd1cde7..597af56a6 100644 --- a/source/ports/rs_port/src/parsers.rs +++ b/source/ports/rs_port/src/parsers.rs @@ -1,26 +1,26 @@ use crate::{ bindings::metacall_value_id, types::{ - MetacallClass, MetacallException, MetacallFunction, MetacallFuture, MetacallNull, - MetacallObject, MetacallPointer, MetacallThrowable, MetacallValue, + MetaCallClass, MetaCallException, MetaCallFunction, MetaCallFuture, MetaCallNull, + MetaCallObject, MetaCallPointer, MetaCallThrowable, MetaCallValue, }, }; use std::{collections::HashMap, ffi::c_void}; -fn metacallobj_result_wrap<T: MetacallValue>( - v: Result<T, Box<dyn MetacallValue>>, -) -> Box<dyn MetacallValue> { +fn metacallobj_result_wrap<T: MetaCallValue>( + v: Result<T, Box<dyn MetaCallValue>>, +) -> Box<dyn MetaCallValue> { match v { - Ok(obj) => Box::new(obj) as Box<dyn MetacallValue>, + Ok(obj) => Box::new(obj) as Box<dyn MetaCallValue>, Err(original) => original, } } -pub fn raw_to_metacallobj<T: MetacallValue>(ret: *mut c_void) -> Result<T, Box<dyn MetacallValue>> { - let null = MetacallNull(); +pub fn raw_to_metacallobj<T: MetaCallValue>(ret: *mut c_void) -> Result<T, Box<dyn MetaCallValue>> { + let null = MetaCallNull(); if ret.is_null() { - if <T>::get_metacall_id() != 14 { + if <T>::get_metacall_id() != metacall_value_id::METACALL_NULL { return Err(metacallobj_result_wrap(Ok(null))); } else { return Ok(<T>::from_metacall_raw(ret).unwrap()); @@ -33,13 +33,13 @@ pub fn raw_to_metacallobj<T: MetacallValue>(ret: *mut c_void) -> Result<T, Box<d Err(raw_to_metacallobj_untyped(ret)) } } -pub fn raw_to_metacallobj_leak<T: MetacallValue>( +pub fn raw_to_metacallobj_leak<T: MetaCallValue>( ret: *mut c_void, -) -> Result<T, Box<dyn MetacallValue>> { - let null = MetacallNull(); +) -> Result<T, Box<dyn MetaCallValue>> { + let null = MetaCallNull(); if ret.is_null() { - if <T>::get_metacall_id() != 14 { + if <T>::get_metacall_id() != metacall_value_id::METACALL_NULL { return Err(metacallobj_result_wrap(Ok(null))); } else { return Ok(<T>::from_metacall_raw(ret).unwrap()); @@ -53,64 +53,62 @@ pub fn raw_to_metacallobj_leak<T: MetacallValue>( } } -pub fn raw_to_metacallobj_untyped(ret: *mut c_void) -> Box<dyn MetacallValue> { +pub fn raw_to_metacallobj_untyped(ret: *mut c_void) -> Box<dyn MetaCallValue> { match (ret.is_null(), unsafe { metacall_value_id(ret) }) { - (true, _) => metacallobj_result_wrap(MetacallNull::from_metacall_raw(ret)), - (_, 0) => metacallobj_result_wrap(bool::from_metacall_raw(ret)), - (_, 1) => metacallobj_result_wrap(char::from_metacall_raw(ret)), - (_, 2) => metacallobj_result_wrap(i16::from_metacall_raw(ret)), - (_, 3) => metacallobj_result_wrap(i32::from_metacall_raw(ret)), - (_, 4) => metacallobj_result_wrap(i64::from_metacall_raw(ret)), - (_, 5) => metacallobj_result_wrap(f32::from_metacall_raw(ret)), - (_, 6) => metacallobj_result_wrap(f64::from_metacall_raw(ret)), - (_, 7) => metacallobj_result_wrap(String::from_metacall_raw(ret)), - (_, 8) => metacallobj_result_wrap(<Vec<i8>>::from_metacall_raw(ret)), - (_, 9) => metacallobj_result_wrap(<Vec<MetacallNull>>::from_metacall_raw(ret)), - (_, 10) => metacallobj_result_wrap(<HashMap<String, MetacallNull>>::from_metacall_raw(ret)), - (_, 11) => metacallobj_result_wrap(<MetacallPointer>::from_metacall_raw(ret)), - (_, 12) => metacallobj_result_wrap(MetacallFuture::from_metacall_raw(ret)), - (_, 13) => metacallobj_result_wrap(MetacallFunction::from_metacall_raw(ret)), - (_, 14) => metacallobj_result_wrap(MetacallNull::from_metacall_raw(ret)), - (_, 15) => metacallobj_result_wrap(MetacallClass::from_metacall_raw(ret)), - (_, 16) => metacallobj_result_wrap(MetacallObject::from_metacall_raw(ret)), - (_, 17) => metacallobj_result_wrap(MetacallException::from_metacall_raw(ret)), - (_, 18) => metacallobj_result_wrap(MetacallThrowable::from_metacall_raw(ret)), - _ => metacallobj_result_wrap(MetacallNull::from_metacall_raw(ret)), + (true, _) => metacallobj_result_wrap(MetaCallNull::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_BOOL) => metacallobj_result_wrap(bool::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_CHAR) => metacallobj_result_wrap(char::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_SHORT) => metacallobj_result_wrap(i16::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_INT) => metacallobj_result_wrap(i32::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_LONG) => metacallobj_result_wrap(i64::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_FLOAT) => metacallobj_result_wrap(f32::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_DOUBLE) => metacallobj_result_wrap(f64::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_STRING) => metacallobj_result_wrap(String::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_BUFFER) => metacallobj_result_wrap(<Vec<i8>>::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_ARRAY) => metacallobj_result_wrap(<Vec<MetaCallNull>>::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_MAP) => metacallobj_result_wrap(<HashMap<String, MetaCallNull>>::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_PTR) => metacallobj_result_wrap(<MetaCallPointer>::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_FUTURE) => metacallobj_result_wrap(MetaCallFuture::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_FUNCTION) => metacallobj_result_wrap(MetaCallFunction::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_NULL) => metacallobj_result_wrap(MetaCallNull::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_CLASS) => metacallobj_result_wrap(MetaCallClass::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_OBJECT) => metacallobj_result_wrap(MetaCallObject::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_EXCEPTION) => metacallobj_result_wrap(MetaCallException::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_THROWABLE) => metacallobj_result_wrap(MetaCallThrowable::from_metacall_raw(ret)), + _ => metacallobj_result_wrap(MetaCallNull::from_metacall_raw(ret)), } } -pub fn raw_to_metacallobj_untyped_leak(ret: *mut c_void) -> Box<dyn MetacallValue> { +pub fn raw_to_metacallobj_untyped_leak(ret: *mut c_void) -> Box<dyn MetaCallValue> { match (ret.is_null(), unsafe { metacall_value_id(ret) }) { - (true, _) => metacallobj_result_wrap(MetacallNull::from_metacall_raw_leak(ret)), - (_, 0) => metacallobj_result_wrap(bool::from_metacall_raw_leak(ret)), - (_, 1) => metacallobj_result_wrap(char::from_metacall_raw_leak(ret)), - (_, 2) => metacallobj_result_wrap(i16::from_metacall_raw_leak(ret)), - (_, 3) => metacallobj_result_wrap(i32::from_metacall_raw_leak(ret)), - (_, 4) => metacallobj_result_wrap(i64::from_metacall_raw_leak(ret)), - (_, 5) => metacallobj_result_wrap(f32::from_metacall_raw_leak(ret)), - (_, 6) => metacallobj_result_wrap(f64::from_metacall_raw_leak(ret)), - (_, 7) => metacallobj_result_wrap(String::from_metacall_raw_leak(ret)), - (_, 8) => metacallobj_result_wrap(<Vec<i8>>::from_metacall_raw_leak(ret)), - (_, 9) => metacallobj_result_wrap(<Vec<MetacallNull>>::from_metacall_raw_leak(ret)), - (_, 10) => { - metacallobj_result_wrap(<HashMap<String, MetacallNull>>::from_metacall_raw_leak(ret)) - } - (_, 11) => metacallobj_result_wrap(<MetacallPointer>::from_metacall_raw_leak(ret)), - (_, 12) => metacallobj_result_wrap(MetacallFuture::from_metacall_raw_leak(ret)), - (_, 13) => metacallobj_result_wrap(MetacallFunction::from_metacall_raw_leak(ret)), - (_, 14) => metacallobj_result_wrap(MetacallNull::from_metacall_raw_leak(ret)), - (_, 15) => metacallobj_result_wrap(MetacallClass::from_metacall_raw_leak(ret)), - (_, 16) => metacallobj_result_wrap(MetacallObject::from_metacall_raw_leak(ret)), - (_, 17) => metacallobj_result_wrap(MetacallException::from_metacall_raw_leak(ret)), - (_, 18) => metacallobj_result_wrap(MetacallThrowable::from_metacall_raw_leak(ret)), - _ => metacallobj_result_wrap(MetacallNull::from_metacall_raw_leak(ret)), + (true, _) => metacallobj_result_wrap(MetaCallNull::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_BOOL) => metacallobj_result_wrap(bool::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_CHAR) => metacallobj_result_wrap(char::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_SHORT) => metacallobj_result_wrap(i16::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_INT) => metacallobj_result_wrap(i32::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_LONG) => metacallobj_result_wrap(i64::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_FLOAT) => metacallobj_result_wrap(f32::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_DOUBLE) => metacallobj_result_wrap(f64::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_STRING) => metacallobj_result_wrap(String::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_BUFFER) => metacallobj_result_wrap(<Vec<i8>>::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_ARRAY) => metacallobj_result_wrap(<Vec<MetaCallNull>>::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_MAP) => { metacallobj_result_wrap(<HashMap<String, MetaCallNull>>::from_metacall_raw_leak(ret)) } + (_, metacall_value_id::METACALL_PTR) => metacallobj_result_wrap(<MetaCallPointer>::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_FUTURE) => metacallobj_result_wrap(MetaCallFuture::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_FUNCTION) => metacallobj_result_wrap(MetaCallFunction::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_NULL) => metacallobj_result_wrap(MetaCallNull::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_CLASS) => metacallobj_result_wrap(MetaCallClass::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_OBJECT) => metacallobj_result_wrap(MetaCallObject::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_EXCEPTION) => metacallobj_result_wrap(MetaCallException::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_THROWABLE) => metacallobj_result_wrap(MetaCallThrowable::from_metacall_raw_leak(ret)), + _ => metacallobj_result_wrap(MetaCallNull::from_metacall_raw_leak(ret)), } } -pub fn metacallobj_to_raw(arg: impl MetacallValue) -> *mut c_void { +pub fn metacallobj_to_raw(arg: impl MetaCallValue) -> *mut c_void { arg.into_metacall_raw() } pub fn metacallobj_to_raw_args( - args: impl IntoIterator<Item = impl MetacallValue>, + args: impl IntoIterator<Item = impl MetaCallValue>, ) -> Vec<*mut c_void> { args.into_iter() .map(|arg| arg.into_metacall_raw()) diff --git a/source/ports/rs_port/src/switch.rs b/source/ports/rs_port/src/switch.rs index e99d96e02..d249a35c8 100644 --- a/source/ports/rs_port/src/switch.rs +++ b/source/ports/rs_port/src/switch.rs @@ -1,6 +1,6 @@ use crate::{ bindings::{metacall_destroy, metacall_initialize}, - types::MetacallInitError, + types::MetaCallInitError, }; use std::ffi::c_int; @@ -11,14 +11,14 @@ pub fn initialize_manually() -> c_int { unsafe { metacall_initialize() } } -pub struct MetacallAutoDestroy(pub fn() -> c_int); -impl Drop for MetacallAutoDestroy { +pub struct MetaCallAutoDestroy(pub fn() -> c_int); +impl Drop for MetaCallAutoDestroy { fn drop(&mut self) { self.0(); } } -/// Initializes Metacall. Always remember to store the output in a variable to avoid instant drop. +/// Initializes MetaCall. Always remember to store the output in a variable to avoid instant drop. /// For example: ... /// ``` /// // Initialize metacall at the top of your main function before loading your codes or @@ -27,10 +27,10 @@ impl Drop for MetacallAutoDestroy { /// /// /// ``` -pub fn initialize() -> Result<MetacallAutoDestroy, MetacallInitError> { +pub fn initialize() -> Result<MetaCallAutoDestroy, MetaCallInitError> { if initialize_manually() != 0 { - return Err(MetacallInitError::new()); + return Err(MetaCallInitError::new()); } - Ok(MetacallAutoDestroy(destroy_manually)) + Ok(MetaCallAutoDestroy(destroy_manually)) } diff --git a/source/ports/rs_port/src/types/metacall_class.rs b/source/ports/rs_port/src/types/metacall_class.rs index 97170b7a4..4f50faceb 100644 --- a/source/ports/rs_port/src/types/metacall_class.rs +++ b/source/ports/rs_port/src/types/metacall_class.rs @@ -1,6 +1,6 @@ use super::{ - MetacallClassFromNameError, MetacallError, MetacallGetAttributeError, MetacallNull, - MetacallObject, MetacallSetAttributeError, MetacallStringConversionError, MetacallValue, + MetaCallClassFromNameError, MetaCallError, MetaCallGetAttributeError, MetaCallNull, + MetaCallObject, MetaCallSetAttributeError, MetaCallStringConversionError, MetaCallValue, }; use crate::{bindings::*, cstring, cstring_enum, parsers}; use std::{ @@ -8,16 +8,16 @@ use std::{ fmt::{self, Debug, Formatter}, }; -/// Represents Metacall Class. You can get this type when returned by a function or get a class by its +/// Represents MetaCall Class. You can get this type when returned by a function or get a class by its /// name with [from_name](#method.from_name). -pub struct MetacallClass { +pub struct MetaCallClass { found_by_name: bool, leak: bool, value: *mut c_void, } -unsafe impl Send for MetacallClass {} -unsafe impl Sync for MetacallClass {} -impl Clone for MetacallClass { +unsafe impl Send for MetaCallClass {} +unsafe impl Sync for MetaCallClass {} +impl Clone for MetaCallClass { fn clone(&self) -> Self { Self { found_by_name: self.found_by_name, @@ -26,13 +26,13 @@ impl Clone for MetacallClass { } } } -impl Debug for MetacallClass { +impl Debug for MetaCallClass { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!(f, "MetacallClass {{ ... }}") + write!(f, "MetaCallClass {{ ... }}") } } -impl MetacallClass { +impl MetaCallClass { #[doc(hidden)] pub fn new_raw(value: *mut c_void) -> Self { Self { @@ -52,12 +52,12 @@ impl MetacallClass { } /// Gets a class by its name. - pub fn from_name(name: impl ToString) -> Result<Self, MetacallClassFromNameError> { - let c_name = cstring_enum!(name, MetacallClassFromNameError)?; + pub fn from_name(name: impl ToString) -> Result<Self, MetaCallClassFromNameError> { + let c_name = cstring_enum!(name, MetaCallClassFromNameError)?; let class = unsafe { metacall_class(c_name.as_ptr()) }; if class.is_null() { - return Err(MetacallClassFromNameError::ClassNotFound); + return Err(MetaCallClassFromNameError::ClassNotFound); } Ok(Self { @@ -75,12 +75,12 @@ impl MetacallClass { } } - /// Creates an [object](MetacallObject) of the class wtih constructor arguments. - pub fn create_object<T: MetacallValue>( + /// Creates an [object](MetaCallObject) of the class wtih constructor arguments. + pub fn create_object<T: MetaCallValue>( &self, name: impl ToString, constructor_args: impl IntoIterator<Item = T>, - ) -> Result<MetacallObject, MetacallStringConversionError> { + ) -> Result<MetaCallObject, MetaCallStringConversionError> { let c_name = cstring!(name)?; let mut c_args = parsers::metacallobj_to_raw_args(constructor_args); let obj = unsafe { @@ -96,41 +96,41 @@ impl MetacallClass { unsafe { metacall_value_destroy(c_arg) }; } - Ok(MetacallObject::new_raw(obj)) + Ok(MetaCallObject::new_raw(obj)) } - /// Creates an [object](MetacallObject) of the class wtihout constructor arguments. + /// Creates an [object](MetaCallObject) of the class wtihout constructor arguments. pub fn create_object_no_arg( &self, name: impl ToString, - ) -> Result<MetacallObject, MetacallStringConversionError> { - self.create_object::<MetacallNull>(name, []) + ) -> Result<MetaCallObject, MetaCallStringConversionError> { + self.create_object::<MetaCallNull>(name, []) } fn get_attribute_inner( &self, name: impl ToString, - ) -> Result<*mut c_void, MetacallGetAttributeError> { - let c_name = cstring_enum!(name, MetacallGetAttributeError)?; + ) -> Result<*mut c_void, MetaCallGetAttributeError> { + let c_name = cstring_enum!(name, MetaCallGetAttributeError)?; Ok(unsafe { metacall_class_static_get(self.value_to_class(), c_name.as_ptr()) }) } - /// Gets static attribute from a class without type casting([MetacallValue](MetacallValue)). + /// Gets static attribute from a class without type casting([MetaCallValue](MetaCallValue)). pub fn get_attribute_untyped( &self, name: impl ToString, - ) -> Result<Box<dyn MetacallValue>, MetacallGetAttributeError> { + ) -> Result<Box<dyn MetaCallValue>, MetaCallGetAttributeError> { Ok(parsers::raw_to_metacallobj_untyped( self.get_attribute_inner(name)?, )) } /// Gets static attribute from a class. - pub fn get_attribute<T: MetacallValue>( + pub fn get_attribute<T: MetaCallValue>( &self, name: impl ToString, - ) -> Result<T, MetacallGetAttributeError> { + ) -> Result<T, MetaCallGetAttributeError> { match parsers::raw_to_metacallobj::<T>(self.get_attribute_inner(name)?) { Ok(ret) => Ok(ret), - Err(original) => Err(MetacallGetAttributeError::FailedCasting(original)), + Err(original) => Err(MetaCallGetAttributeError::FailedCasting(original)), } } @@ -138,13 +138,13 @@ impl MetacallClass { pub fn set_attribute( &self, key: impl ToString, - value: impl MetacallValue, - ) -> Result<(), MetacallSetAttributeError> { - let c_key = cstring_enum!(key, MetacallSetAttributeError)?; + value: impl MetaCallValue, + ) -> Result<(), MetaCallSetAttributeError> { + let c_key = cstring_enum!(key, MetaCallSetAttributeError)?; let c_arg = parsers::metacallobj_to_raw(value); if unsafe { metacall_class_static_set(self.value_to_class(), c_key.as_ptr(), c_arg) } != 0 { - return Err(MetacallSetAttributeError::SetAttributeFailure); + return Err(MetaCallSetAttributeError::SetAttributeFailure); } unsafe { metacall_value_destroy(c_arg) }; @@ -152,12 +152,12 @@ impl MetacallClass { Ok(()) } - fn call_method_inner<T: MetacallValue>( + fn call_method_inner<T: MetaCallValue>( &self, name: impl ToString, args: impl IntoIterator<Item = T>, - ) -> Result<*mut c_void, MetacallError> { - let c_key = cstring_enum!(name, MetacallError)?; + ) -> Result<*mut c_void, MetaCallError> { + let c_key = cstring_enum!(name, MetaCallError)?; let mut c_args = parsers::metacallobj_to_raw_args(args); let ret = unsafe { metacallv_class( @@ -174,43 +174,43 @@ impl MetacallClass { Ok(ret) } - /// Calls a static class method witout type casting([MetacallValue](MetacallValue)). - pub fn call_method_untyped<T: MetacallValue>( + /// Calls a static class method witout type casting([MetaCallValue](MetaCallValue)). + pub fn call_method_untyped<T: MetaCallValue>( &self, name: impl ToString, args: impl IntoIterator<Item = T>, - ) -> Result<Box<dyn MetacallValue>, MetacallError> { + ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { Ok(parsers::raw_to_metacallobj_untyped( self.call_method_inner::<T>(name, args)?, )) } - /// Calls a static class method witout type casting([MetacallValue](MetacallValue)) and + /// Calls a static class method witout type casting([MetaCallValue](MetaCallValue)) and /// without passing arguments. - pub fn call_method_untyped_no_arg<T: MetacallValue>( + pub fn call_method_untyped_no_arg<T: MetaCallValue>( &self, name: impl ToString, - ) -> Result<Box<dyn MetacallValue>, MetacallError> { + ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { Ok(parsers::raw_to_metacallobj_untyped( self.call_method_inner::<T>(name, [])?, )) } /// Calls a static class method. - pub fn call_method<T: MetacallValue, U: MetacallValue>( + pub fn call_method<T: MetaCallValue, U: MetaCallValue>( &self, name: impl ToString, args: impl IntoIterator<Item = U>, - ) -> Result<T, MetacallError> { + ) -> Result<T, MetaCallError> { match parsers::raw_to_metacallobj::<T>(self.call_method_inner::<U>(name, args)?) { Ok(ret) => Ok(ret), - Err(original) => Err(MetacallError::FailedCasting(original)), + Err(original) => Err(MetaCallError::FailedCasting(original)), } } /// Calls a static class method without passing arguments. - pub fn call_method_no_arg<T: MetacallValue>( + pub fn call_method_no_arg<T: MetaCallValue>( &self, name: impl ToString, - ) -> Result<T, MetacallError> { - self.call_method::<T, MetacallNull>(name, []) + ) -> Result<T, MetaCallError> { + self.call_method::<T, MetaCallNull>(name, []) } #[doc(hidden)] @@ -221,7 +221,7 @@ impl MetacallClass { } } -impl Drop for MetacallClass { +impl Drop for MetaCallClass { fn drop(&mut self) { if !self.leak { unsafe { metacall_value_destroy(self.value) } diff --git a/source/ports/rs_port/src/types/metacall_error.rs b/source/ports/rs_port/src/types/metacall_error.rs index 690b9c16d..51b5e6006 100644 --- a/source/ports/rs_port/src/types/metacall_error.rs +++ b/source/ports/rs_port/src/types/metacall_error.rs @@ -1,35 +1,35 @@ -use super::MetacallValue; +use super::MetaCallValue; use std::{ffi::NulError, path::PathBuf}; #[derive(Debug, Clone)] -/// This error happens when it's not possible to initialize the Metacall core. You can check +/// This error happens when it's not possible to initialize the MetaCall core. You can check /// your logs for more information. -pub struct MetacallInitError; -impl MetacallInitError { +pub struct MetaCallInitError; +impl MetaCallInitError { #[doc(hidden)] pub fn new() -> Self { Self } } -impl Default for MetacallInitError { +impl Default for MetaCallInitError { fn default() -> Self { - MetacallInitError::new() + MetaCallInitError::new() } } -impl ToString for MetacallInitError { +impl ToString for MetaCallInitError { fn to_string(&self) -> String { - String::from("Failed to initialize Metacall!") + String::from("Failed to initialize MetaCall!") } } #[derive(Debug, Clone)] /// This error may happen when passing contains a null character. You can access the /// original string and the NulError throughout this struct. -pub struct MetacallStringConversionError { +pub struct MetaCallStringConversionError { pub original_string: String, pub nul_error: NulError, } -impl MetacallStringConversionError { +impl MetaCallStringConversionError { #[doc(hidden)] pub fn new(original_string: impl ToString, nul_error: NulError) -> Self { Self { @@ -38,7 +38,7 @@ impl MetacallStringConversionError { } } } -impl ToString for MetacallStringConversionError { +impl ToString for MetaCallStringConversionError { fn to_string(&self) -> String { self.original_string.clone() } @@ -46,38 +46,38 @@ impl ToString for MetacallStringConversionError { #[derive(Debug, Clone)] /// This error may happen when trying to call a function. -pub enum MetacallError { +pub enum MetaCallError { /// Function not found. FunctionNotFound, /// Failed to cast the return type as the type requested. - FailedCasting(Box<dyn MetacallValue>), + FailedCasting(Box<dyn MetaCallValue>), /// Null character detected. - UnexpectedCStringConversionErr(MetacallStringConversionError), + UnexpectedCStringConversionErr(MetaCallStringConversionError), } #[derive(Debug, Clone)] /// This error may happen when trying to set a class/object attribute. Check your logs /// if you get `SetAttributeFailure` error variant. -pub enum MetacallSetAttributeError { +pub enum MetaCallSetAttributeError { /// Failed to set the attribute. SetAttributeFailure, /// Null character detected. - UnexpectedCStringConversionErr(MetacallStringConversionError), + UnexpectedCStringConversionErr(MetaCallStringConversionError), } #[derive(Debug, Clone)] /// This error may happen when trying to get a class/object attribute. -pub enum MetacallGetAttributeError { +pub enum MetaCallGetAttributeError { /// Failed to cast the attribute as the type requested. - FailedCasting(Box<dyn MetacallValue>), + FailedCasting(Box<dyn MetaCallValue>), /// Null character detected. - UnexpectedCStringConversionErr(MetacallStringConversionError), + UnexpectedCStringConversionErr(MetaCallStringConversionError), } #[derive(Debug, Clone)] /// This error may happen when loading a code. Check your logs for more information if you /// get `FromFileFailure` or `FromMemoryFailure` error variant. -pub enum MetacallLoaderError { +pub enum MetaCallLoaderError { /// File not found. FileNotFound(PathBuf), /// Failed to load from file. @@ -87,14 +87,14 @@ pub enum MetacallLoaderError { /// Not a file or permission denied. NotAFileOrPermissionDenied(PathBuf), /// Null character detected. - UnexpectedCStringConversionErr(MetacallStringConversionError), + UnexpectedCStringConversionErr(MetaCallStringConversionError), } #[derive(Debug, Clone)] /// This error may happen when trying to get a class by its name. -pub enum MetacallClassFromNameError { +pub enum MetaCallClassFromNameError { /// Class not found. ClassNotFound, /// Null character detected. - UnexpectedCStringConversionErr(MetacallStringConversionError), + UnexpectedCStringConversionErr(MetaCallStringConversionError), } diff --git a/source/ports/rs_port/src/types/metacall_exception.rs b/source/ports/rs_port/src/types/metacall_exception.rs index eca20ef45..67a34e15a 100644 --- a/source/ports/rs_port/src/types/metacall_exception.rs +++ b/source/ports/rs_port/src/types/metacall_exception.rs @@ -1,4 +1,4 @@ -use super::{MetacallStringConversionError, MetacallValue}; +use super::{MetaCallStringConversionError, MetaCallValue}; use crate::{ bindings::{ metacall_exception_type, metacall_throwable_value, metacall_value_create_exception, @@ -12,15 +12,15 @@ use std::{ sync::Arc, }; -/// Represents Metacall exception. You can create an exception with [new](#method.new). -pub struct MetacallException { +/// Represents MetaCall exception. You can create an exception with [new](#method.new). +pub struct MetaCallException { exception_struct: Arc<metacall_exception_type>, leak: bool, value: *mut c_void, } -unsafe impl Send for MetacallException {} -unsafe impl Sync for MetacallException {} -impl Clone for MetacallException { +unsafe impl Send for MetaCallException {} +unsafe impl Sync for MetaCallException {} +impl Clone for MetaCallException { fn clone(&self) -> Self { Self { exception_struct: self.exception_struct.clone(), @@ -29,24 +29,24 @@ impl Clone for MetacallException { } } } -impl Debug for MetacallException { +impl Debug for MetaCallException { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!( f, - "MetacallException {}", + "MetaCallException {}", format!("{{ {} }}", self.to_string()) ) } } -impl MetacallException { +impl MetaCallException { /// Creates a new exception. pub fn new( message: impl ToString, label: impl ToString, stacktrace: impl ToString, code: i64, - ) -> Result<Self, MetacallStringConversionError> { + ) -> Result<Self, MetaCallStringConversionError> { let message = cstring!(message)?.into_raw(); let label = cstring!(label)?.into_raw(); let stacktrace = cstring!(stacktrace)?.into_raw(); @@ -118,24 +118,24 @@ impl MetacallException { #[derive(Debug, Clone)] /// Different types of Throwable value. -pub enum MetacallThrowableValue<T: MetacallValue> { +pub enum MetaCallThrowableValue<T: MetaCallValue> { /// Exception. - Exception(MetacallException), + Exception(MetaCallException), /// Other types. - Other(Box<dyn MetacallValue>), + Other(Box<dyn MetaCallValue>), /// Specified. Specified(T), } -/// Represents Metacall throwable. Keep in mind that it's not supported to pass a throwable as an argument. -pub struct MetacallThrowable { +/// Represents MetaCall throwable. Keep in mind that it's not supported to pass a throwable as an argument. +pub struct MetaCallThrowable { leak: bool, value_ptr: *mut c_void, value: *mut c_void, } -unsafe impl Send for MetacallThrowable {} -unsafe impl Sync for MetacallThrowable {} -impl Clone for MetacallThrowable { +unsafe impl Send for MetaCallThrowable {} +unsafe impl Sync for MetaCallThrowable {} +impl Clone for MetaCallThrowable { fn clone(&self) -> Self { Self { leak: true, @@ -144,17 +144,17 @@ impl Clone for MetacallThrowable { } } } -impl Debug for MetacallThrowable { +impl Debug for MetaCallThrowable { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!( f, - "MetacallThrowable {}", + "MetaCallThrowable {}", format!("{{ {} }}", self.to_string()) ) } } -impl MetacallThrowable { +impl MetaCallThrowable { #[doc(hidden)] pub fn new_raw(value_ptr: *mut c_void) -> Self { let throwable_value = @@ -177,9 +177,9 @@ impl MetacallThrowable { } } - /// Gets the throwable value without type casting([MetacallValue](MetacallValue)). - pub fn get_value_untyped(&self) -> Box<dyn MetacallValue> { - match parsers::raw_to_metacallobj::<MetacallException>(self.value) { + /// Gets the throwable value without type casting([MetaCallValue](MetaCallValue)). + pub fn get_value_untyped(&self) -> Box<dyn MetaCallValue> { + match parsers::raw_to_metacallobj::<MetaCallException>(self.value) { Ok(mut value) => { value.leak = true; @@ -189,7 +189,7 @@ impl MetacallThrowable { } } /// Gets the throwable value. - pub fn get_value<T: MetacallValue>(&self) -> Result<T, Box<dyn MetacallValue>> { + pub fn get_value<T: MetaCallValue>(&self) -> Result<T, Box<dyn MetaCallValue>> { match self.get_value_untyped().downcast::<T>() { Ok(value) => Ok(value), Err(original) => Err(original), @@ -201,11 +201,11 @@ impl MetacallThrowable { // It's not implemented in any loader as the time of writing this block of code. // Feel free to implement as any loader adopted accepting Throwable as an argument. - panic!("Passing MetacallThrowable as an argument is not supported!"); + panic!("Passing MetaCallThrowable as an argument is not supported!"); } } -impl ToString for MetacallException { +impl ToString for MetaCallException { fn to_string(&self) -> String { format!( "[Exception(code: `{}`)]: {}", @@ -214,21 +214,21 @@ impl ToString for MetacallException { ) } } -impl ToString for MetacallThrowable { +impl ToString for MetaCallThrowable { fn to_string(&self) -> String { let throwable_value = self.get_value_untyped(); format!("[Throwable]: {:#?}", throwable_value) } } -impl Drop for MetacallException { +impl Drop for MetaCallException { fn drop(&mut self) { if !self.leak { unsafe { metacall_value_destroy(self.value) } } } } -impl Drop for MetacallThrowable { +impl Drop for MetaCallThrowable { fn drop(&mut self) { unsafe { if !self.leak { diff --git a/source/ports/rs_port/src/types/metacall_function.rs b/source/ports/rs_port/src/types/metacall_function.rs index 6ce4489fd..4d5154e8c 100644 --- a/source/ports/rs_port/src/types/metacall_function.rs +++ b/source/ports/rs_port/src/types/metacall_function.rs @@ -1,4 +1,4 @@ -use super::{MetacallError, MetacallNull, MetacallValue}; +use super::{MetaCallError, MetaCallNull, MetaCallValue}; use crate::{ bindings::{metacall_value_destroy, metacall_value_to_function, metacallfv_s}, parsers, @@ -8,14 +8,14 @@ use std::{ fmt::{self, Debug, Formatter}, }; -/// Represents Metacall function. -pub struct MetacallFunction { +/// Represents MetaCall function. +pub struct MetaCallFunction { leak: bool, value: *mut c_void, } -unsafe impl Send for MetacallFunction {} -unsafe impl Sync for MetacallFunction {} -impl Clone for MetacallFunction { +unsafe impl Send for MetaCallFunction {} +unsafe impl Sync for MetaCallFunction {} +impl Clone for MetaCallFunction { fn clone(&self) -> Self { Self { leak: true, @@ -23,13 +23,13 @@ impl Clone for MetacallFunction { } } } -impl Debug for MetacallFunction { +impl Debug for MetaCallFunction { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!(f, "MetacallFunction {{ ... }}") + write!(f, "MetaCallFunction {{ ... }}") } } -impl MetacallFunction { +impl MetaCallFunction { #[doc(hidden)] pub fn new_raw(value: *mut c_void) -> Self { Self { leak: false, value } @@ -44,7 +44,7 @@ impl MetacallFunction { unsafe { metacall_value_to_function(self.value) } } - fn call_inner<T: MetacallValue>(&self, args: impl IntoIterator<Item = T>) -> *mut c_void { + fn call_inner<T: MetaCallValue>(&self, args: impl IntoIterator<Item = T>) -> *mut c_void { let mut c_args = parsers::metacallobj_to_raw_args(args); let ret: *mut c_void = unsafe { metacallfv_s(self.value_to_function(), c_args.as_mut_ptr(), 0) }; @@ -55,31 +55,31 @@ impl MetacallFunction { ret } - /// Calls the function with arguments and witout type casting([MetacallValue](MetacallValue)). - pub fn call_untyped<T: MetacallValue>( + /// Calls the function with arguments and witout type casting([MetaCallValue](MetaCallValue)). + pub fn call_untyped<T: MetaCallValue>( &self, args: impl IntoIterator<Item = T>, - ) -> Box<dyn MetacallValue> { + ) -> Box<dyn MetaCallValue> { parsers::raw_to_metacallobj_untyped(self.call_inner(args)) } /// Calls the function without passing arguments and witout type - /// casting([MetacallValue](MetacallValue)). - pub fn call_untyped_no_arg<T: MetacallValue>(&self) -> Box<dyn MetacallValue> { - parsers::raw_to_metacallobj_untyped(self.call_inner([] as [MetacallNull; 0])) + /// casting([MetaCallValue](MetaCallValue)). + pub fn call_untyped_no_arg<T: MetaCallValue>(&self) -> Box<dyn MetaCallValue> { + parsers::raw_to_metacallobj_untyped(self.call_inner([] as [MetaCallNull; 0])) } /// Calls the function with arguments. - pub fn call<T: MetacallValue, U: MetacallValue>( + pub fn call<T: MetaCallValue, U: MetaCallValue>( &self, args: impl IntoIterator<Item = U>, - ) -> Result<T, MetacallError> { + ) -> Result<T, MetaCallError> { match parsers::raw_to_metacallobj::<T>(self.call_inner(args)) { Ok(ret) => Ok(ret), - Err(original) => Err(MetacallError::FailedCasting(original)), + Err(original) => Err(MetaCallError::FailedCasting(original)), } } /// Calls the function without arguments. - pub fn call_no_arg<T: MetacallValue>(&self) -> Result<T, MetacallError> { - self.call::<T, MetacallNull>([]) + pub fn call_no_arg<T: MetaCallValue>(&self) -> Result<T, MetaCallError> { + self.call::<T, MetaCallNull>([]) } #[doc(hidden)] @@ -90,7 +90,7 @@ impl MetacallFunction { } } -impl Drop for MetacallFunction { +impl Drop for MetaCallFunction { fn drop(&mut self) { if !self.leak { unsafe { metacall_value_destroy(self.value) } diff --git a/source/ports/rs_port/src/types/metacall_future.rs b/source/ports/rs_port/src/types/metacall_future.rs index 46a8c436c..fa911d134 100644 --- a/source/ports/rs_port/src/types/metacall_future.rs +++ b/source/ports/rs_port/src/types/metacall_future.rs @@ -1,4 +1,4 @@ -use super::{MetacallNull, MetacallValue}; +use super::{MetaCallNull, MetaCallValue}; use crate::{ bindings::{metacall_await_future, metacall_value_destroy, metacall_value_to_future}, helpers, parsers, @@ -9,13 +9,13 @@ use std::{ ptr, }; -/// Function pointer type used for resolving/rejecting Metacall futures. The first argument is the result +/// Function pointer type used for resolving/rejecting MetaCall futures. The first argument is the result /// and the second argument is the data that you may want to access when the function gets called. -/// Checkout [MetacallFuture resolve](MetacallFuture#method.then) or -/// [MetacallFuture reject](MetacallFuture#method.catch) for usage. -pub type MetacallFutureHandler = fn(Box<dyn MetacallValue>, Box<dyn MetacallValue>); +/// Checkout [MetaCallFuture resolve](MetaCallFuture#method.then) or +/// [MetaCallFuture reject](MetaCallFuture#method.catch) for usage. +pub type MetaCallFutureHandler = fn(Box<dyn MetaCallValue>, Box<dyn MetaCallValue>); -/// Represents MetacallFuture. Keep in mind that it's not supported to pass a future as an argument. +/// Represents MetaCallFuture. Keep in mind that it's not supported to pass a future as an argument. /// /// ## **Usage example:** /// @@ -36,32 +36,32 @@ pub type MetacallFutureHandler = fn(Box<dyn MetacallValue>, Box<dyn MetacallValu /// /// **Calling Example:** /// ```rust -/// use metacall::{MetacallValue, MetacallFuture, metacall}; +/// use metacall::{MetaCallValue, MetaCallFuture, metacall}; /// fn runner(x: i32) { /// -/// fn resolve(result: impl MetacallValue, data: impl MetacallValue) { +/// fn resolve(result: impl MetaCallValue, data: impl MetaCallValue) { /// println!("Resolve:: result: {:#?}, data: {:#?}", result, data); // /// } /// -/// fn reject(error: impl MetacallValue, data: impl MetacallValue) { +/// fn reject(error: impl MetaCallValue, data: impl MetaCallValue) { /// println!("Reject:: error: {:#?}, data: {:#?}", error, data); /// } /// -/// let future = metacall::<MetacallFuture>("doubleValueAfterTime", [1, 2000]).unwrap(); +/// let future = metacall::<MetaCallFuture>("doubleValueAfterTime", [1, 2000]).unwrap(); /// future.then(resolve).catch(reject).await_fut(); /// } /// ``` #[repr(C)] -pub struct MetacallFuture { - data: *mut dyn MetacallValue, +pub struct MetaCallFuture { + data: *mut dyn MetaCallValue, leak: bool, - reject: Option<MetacallFutureHandler>, - resolve: Option<MetacallFutureHandler>, + reject: Option<MetaCallFutureHandler>, + resolve: Option<MetaCallFutureHandler>, value: *mut c_void, } -unsafe impl Send for MetacallFuture {} -unsafe impl Sync for MetacallFuture {} -impl Clone for MetacallFuture { +unsafe impl Send for MetaCallFuture {} +unsafe impl Sync for MetaCallFuture {} +impl Clone for MetaCallFuture { fn clone(&self) -> Self { Self { data: self.data, @@ -72,10 +72,10 @@ impl Clone for MetacallFuture { } } } -impl Debug for MetacallFuture { +impl Debug for MetaCallFuture { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { let boxed_data = unsafe { Box::from_raw(self.data) }; - let data = if boxed_data.is::<MetacallNull>() { + let data = if boxed_data.is::<MetaCallNull>() { None } else { Some(format!("{:#?}", boxed_data)) @@ -93,7 +93,7 @@ impl Debug for MetacallFuture { "Some" }; - f.debug_struct("MetacallFuture") + f.debug_struct("MetaCallFuture") .field("data", &data) .field("resolve", &resolve) .field("reject", &reject) @@ -101,17 +101,17 @@ impl Debug for MetacallFuture { } } -type MetacallFutureFFIData = ( +type MetaCallFutureFFIData = ( // Resolve - Option<MetacallFutureHandler>, + Option<MetaCallFutureHandler>, // Reject - Option<MetacallFutureHandler>, + Option<MetaCallFutureHandler>, // User data - *mut dyn MetacallValue, + *mut dyn MetaCallValue, ); unsafe extern "C" fn resolver(resolve_data: *mut c_void, upper_data: *mut c_void) -> *mut c_void { - let (resolve, _, data) = *Box::from_raw(upper_data as *mut MetacallFutureFFIData); + let (resolve, _, data) = *Box::from_raw(upper_data as *mut MetaCallFutureFFIData); let user_data = Box::from_raw(data); (resolve.unwrap())( @@ -122,7 +122,7 @@ unsafe extern "C" fn resolver(resolve_data: *mut c_void, upper_data: *mut c_void ptr::null_mut() } unsafe extern "C" fn rejecter(reject_data: *mut c_void, upper_data: *mut c_void) -> *mut c_void { - let (_, reject, data) = *Box::from_raw(upper_data as *mut MetacallFutureFFIData); + let (_, reject, data) = *Box::from_raw(upper_data as *mut MetaCallFutureFFIData); let user_data = Box::from_raw(data); (reject.unwrap())( @@ -133,9 +133,9 @@ unsafe extern "C" fn rejecter(reject_data: *mut c_void, upper_data: *mut c_void) ptr::null_mut() } -impl MetacallFuture { - fn create_null_data() -> *mut dyn MetacallValue { - Box::into_raw(helpers::metacall_implementer_to_traitobj(MetacallNull())) +impl MetaCallFuture { + fn create_null_data() -> *mut dyn MetaCallValue { + Box::into_raw(helpers::metacall_implementer_to_traitobj(MetaCallNull())) } #[doc(hidden)] @@ -177,17 +177,17 @@ impl MetacallFuture { /// **Calling Example:** /// /// ```rust - /// use metacall::{MetacallValue, MetacallFuture, metacall_no_args}; + /// use metacall::{MetaCallValue, MetaCallFuture, metacall_no_args}; /// fn calling() { - /// fn reject(result: impl MetacallValue, _: impl MetacallValue) { + /// fn reject(result: impl MetaCallValue, _: impl MetaCallValue) { /// println!("Resolve:: {:#?}", result); // Resolve:: "Resolve message" /// } /// - /// let future = metacall_no_args::<MetacallFuture>("func_always_resolve").unwrap(); + /// let future = metacall_no_args::<MetaCallFuture>("func_always_resolve").unwrap(); /// future.then(resolve).catch(reject).await_fut(); /// } /// ``` - pub fn then(mut self, resolve: MetacallFutureHandler) -> Self { + pub fn then(mut self, resolve: MetaCallFutureHandler) -> Self { self.resolve = Some(resolve); self @@ -207,17 +207,17 @@ impl MetacallFuture { /// ``` /// **Calling Example:** /// ```rust - /// use metacall::{MetacallValue, MetacallFuture, metacall_no_args}; + /// use metacall::{MetaCallValue, MetaCallFuture, metacall_no_args}; /// fn calling() { - /// fn reject(error: impl MetacallValue, _: impl MetacallValue) { + /// fn reject(error: impl MetaCallValue, _: impl MetaCallValue) { /// println!("Reject:: error: {:#?}", error); // Reject:: error: "Error: Reject message" /// } /// - /// let future = metacall_no_args::<MetacallFuture>("func_always_rejects").unwrap(); + /// let future = metacall_no_args::<MetaCallFuture>("func_always_rejects").unwrap(); /// future.then(resolve).catch(reject).await_fut(); /// } /// ``` - pub fn catch(mut self, reject: MetacallFutureHandler) -> Self { + pub fn catch(mut self, reject: MetaCallFutureHandler) -> Self { self.reject = Some(reject); self @@ -227,26 +227,26 @@ impl MetacallFuture { /// /// Example: /// ```rust - /// use metacall::{MetacallValue, MetacallFuture, metacall}; + /// use metacall::{MetaCallValue, MetaCallFuture, metacall}; /// /// fn run() { /// let x = 10; - /// fn resolve(result: impl MetacallValue, data: impl MetacallValue) { + /// fn resolve(result: impl MetaCallValue, data: impl MetaCallValue) { /// println!("X = {data}"); /// } /// - /// fn reject(result: impl MetacallValue, data: impl MetacallValue) { + /// fn reject(result: impl MetaCallValue, data: impl MetaCallValue) { /// println!("X = {data}"); /// } /// - /// let future = metacall::<MetacallFuture>("async_function", [1]).unwrap(); + /// let future = metacall::<MetaCallFuture>("async_function", [1]).unwrap(); /// future.then(resolve).catch(reject),data(x).await_fut(); /// } /// ``` - pub fn data(mut self, data: impl MetacallValue) -> Self { + pub fn data(mut self, data: impl MetaCallValue) -> Self { unsafe { drop(Box::from_raw(self.data)) }; - self.data = Box::into_raw(Box::new(data) as Box<dyn MetacallValue>); + self.data = Box::into_raw(Box::new(data) as Box<dyn MetaCallValue>); self } @@ -275,8 +275,8 @@ impl MetacallFuture { // ==20664== by 0x17B549: alloc::alloc::Global::alloc_impl (alloc.rs:175) // ==20664== by 0x17B342: allocate (alloc.rs:235) // ==20664== by 0x17B342: alloc::alloc::exchange_malloc (alloc.rs:324) - // ==20664== by 0x1873D0: new<(core::option::Option<fn(alloc::boxed::Box<dyn metacall::types::metacall_value::MetacallValue, alloc::alloc::Global>, alloc::boxed::Box<dyn metacall::types::metacall_value::MetacallValue, alloc::alloc::Global>)>, core::option::Option<fn(alloc::boxed::Box<dyn metacall::types::metacall_value::MetacallValue, alloc::alloc::Global>, alloc::boxed::Box<dyn metacall::types::metacall_value::MetacallValue, alloc::alloc::Global>)>, *mut dyn metacall::types::metacall_value::MetacallValue)> (boxed.rs:217) - // ==20664== by 0x1873D0: metacall::types::metacall_future::MetacallFuture::await_fut (metacall_future.rs:182) + // ==20664== by 0x1873D0: new<(core::option::Option<fn(alloc::boxed::Box<dyn metacall::types::metacall_value::MetaCallValue, alloc::alloc::Global>, alloc::boxed::Box<dyn metacall::types::metacall_value::MetaCallValue, alloc::alloc::Global>)>, core::option::Option<fn(alloc::boxed::Box<dyn metacall::types::metacall_value::MetaCallValue, alloc::alloc::Global>, alloc::boxed::Box<dyn metacall::types::metacall_value::MetaCallValue, alloc::alloc::Global>)>, *mut dyn metacall::types::metacall_value::MetaCallValue)> (boxed.rs:217) + // ==20664== by 0x1873D0: metacall::types::metacall_future::MetaCallFuture::await_fut (metacall_future.rs:182) // ==20664== by 0x1296E6: metacall_test::test_future::{{closure}} (metacall_test.rs:202) // ==20664== by 0x1286A2: metacall_test::generate_test_custom_validation (metacall_test.rs:42) // ==20664== by 0x12625A: metacall_test::test_future (metacall_test.rs:193) @@ -298,11 +298,11 @@ impl MetacallFuture { // It's not implemented in any loader as the time of writing this block of code. // Feel free to implement as any loader adopted accepting Future as an argument. - panic!("Passing MetacallFuture as an argument is not supported!"); + panic!("Passing MetaCallFuture as an argument is not supported!"); } } -impl Drop for MetacallFuture { +impl Drop for MetaCallFuture { fn drop(&mut self) { if !self.leak { unsafe { metacall_value_destroy(self.value) }; diff --git a/source/ports/rs_port/src/types/metacall_null.rs b/source/ports/rs_port/src/types/metacall_null.rs index 32c7bb462..51ae70d40 100644 --- a/source/ports/rs_port/src/types/metacall_null.rs +++ b/source/ports/rs_port/src/types/metacall_null.rs @@ -8,16 +8,16 @@ use std::{ /// Represents NULL. // This is a zero-sized struct. It doesn't allocate any memory and will only create a null pointer // when needed. -pub struct MetacallNull(); -unsafe impl Send for MetacallNull {} -unsafe impl Sync for MetacallNull {} -impl Debug for MetacallNull { +pub struct MetaCallNull(); +unsafe impl Send for MetaCallNull {} +unsafe impl Sync for MetaCallNull {} +impl Debug for MetaCallNull { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!(f, "MetacallNull {{ }}") + write!(f, "MetaCallNull {{ }}") } } -impl MetacallNull { +impl MetaCallNull { #[doc(hidden)] pub fn into_raw(self) -> *mut c_void { unsafe { metacall_value_create_null() } diff --git a/source/ports/rs_port/src/types/metacall_object.rs b/source/ports/rs_port/src/types/metacall_object.rs index cdad1ba50..6ae3d9892 100644 --- a/source/ports/rs_port/src/types/metacall_object.rs +++ b/source/ports/rs_port/src/types/metacall_object.rs @@ -1,6 +1,6 @@ use super::{ - MetacallError, MetacallGetAttributeError, MetacallNull, MetacallSetAttributeError, - MetacallValue, + MetaCallError, MetaCallGetAttributeError, MetaCallNull, MetaCallSetAttributeError, + MetaCallValue, }; use crate::{ bindings::{ @@ -16,17 +16,17 @@ use std::{ // Used for documentation. #[allow(unused_imports)] -use super::MetacallClass; +use super::MetaCallClass; -/// Represents Metacall Object. You can get this type when returned by a function or create one from -/// a class with [create_object](MetacallClass#method.create_object). -pub struct MetacallObject { +/// Represents MetaCall Object. You can get this type when returned by a function or create one from +/// a class with [create_object](MetaCallClass#method.create_object). +pub struct MetaCallObject { value: *mut c_void, leak: bool, } -unsafe impl Send for MetacallObject {} -unsafe impl Sync for MetacallObject {} -impl Clone for MetacallObject { +unsafe impl Send for MetaCallObject {} +unsafe impl Sync for MetaCallObject {} +impl Clone for MetaCallObject { fn clone(&self) -> Self { Self { leak: true, @@ -34,13 +34,13 @@ impl Clone for MetacallObject { } } } -impl Debug for MetacallObject { +impl Debug for MetaCallObject { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!(f, "MetacallObject {{ ... }}") + write!(f, "MetaCallObject {{ ... }}") } } -impl MetacallObject { +impl MetaCallObject { #[doc(hidden)] pub fn new_raw(value: *mut c_void) -> Self { Self { value, leak: false } @@ -54,28 +54,28 @@ impl MetacallObject { fn get_attribute_inner( &self, name: impl ToString, - ) -> Result<*mut c_void, MetacallGetAttributeError> { - let c_name = cstring_enum!(name, MetacallGetAttributeError)?; + ) -> Result<*mut c_void, MetaCallGetAttributeError> { + let c_name = cstring_enum!(name, MetaCallGetAttributeError)?; Ok(unsafe { metacall_object_get(metacall_value_to_object(self.value), c_name.as_ptr()) }) } - /// Gets attribute from an object without type casting([MetacallValue](MetacallValue)). + /// Gets attribute from an object without type casting([MetaCallValue](MetaCallValue)). pub fn get_attribute_untyped( &self, name: impl ToString, - ) -> Result<Box<dyn MetacallValue>, MetacallGetAttributeError> { + ) -> Result<Box<dyn MetaCallValue>, MetaCallGetAttributeError> { Ok(parsers::raw_to_metacallobj_untyped( self.get_attribute_inner(name)?, )) } /// Gets attribute from an object. - pub fn get_attribute<T: MetacallValue>( + pub fn get_attribute<T: MetaCallValue>( &self, name: impl ToString, - ) -> Result<T, MetacallGetAttributeError> { + ) -> Result<T, MetaCallGetAttributeError> { match parsers::raw_to_metacallobj::<T>(self.get_attribute_inner(name)?) { Ok(ret) => Ok(ret), - Err(original) => Err(MetacallGetAttributeError::FailedCasting(original)), + Err(original) => Err(MetaCallGetAttributeError::FailedCasting(original)), } } @@ -83,15 +83,15 @@ impl MetacallObject { pub fn set_attribute( &self, key: impl ToString, - value: impl MetacallValue, - ) -> Result<(), MetacallSetAttributeError> { - let c_key = cstring_enum!(key, MetacallSetAttributeError)?; + value: impl MetaCallValue, + ) -> Result<(), MetaCallSetAttributeError> { + let c_key = cstring_enum!(key, MetaCallSetAttributeError)?; let c_arg = parsers::metacallobj_to_raw(value); if unsafe { metacall_object_set(metacall_value_to_object(self.value), c_key.as_ptr(), c_arg) } != 0 { - return Err(MetacallSetAttributeError::SetAttributeFailure); + return Err(MetaCallSetAttributeError::SetAttributeFailure); } unsafe { metacall_value_destroy(c_arg) }; @@ -99,12 +99,12 @@ impl MetacallObject { Ok(()) } - fn call_method_inner<T: MetacallValue>( + fn call_method_inner<T: MetaCallValue>( &self, key: impl ToString, args: impl IntoIterator<Item = T>, - ) -> Result<*mut c_void, MetacallError> { - let c_key = cstring_enum!(key, MetacallError)?; + ) -> Result<*mut c_void, MetaCallError> { + let c_key = cstring_enum!(key, MetaCallError)?; let mut c_args = parsers::metacallobj_to_raw_args(args); let ret = unsafe { metacallv_object( @@ -121,43 +121,43 @@ impl MetacallObject { Ok(ret) } - /// Calls an object method witout type casting([MetacallValue](MetacallValue)). - pub fn call_method_untyped<T: MetacallValue>( + /// Calls an object method witout type casting([MetaCallValue](MetaCallValue)). + pub fn call_method_untyped<T: MetaCallValue>( &self, key: impl ToString, args: impl IntoIterator<Item = T>, - ) -> Result<Box<dyn MetacallValue>, MetacallError> { + ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { Ok(parsers::raw_to_metacallobj_untyped( self.call_method_inner::<T>(key, args)?, )) } - /// Calls an object method witout type casting([MetacallValue](MetacallValue)) and + /// Calls an object method witout type casting([MetaCallValue](MetaCallValue)) and /// without passing arguments. - pub fn call_method_untyped_no_arg<T: MetacallValue>( + pub fn call_method_untyped_no_arg<T: MetaCallValue>( &self, key: impl ToString, - ) -> Result<Box<dyn MetacallValue>, MetacallError> { + ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { Ok(parsers::raw_to_metacallobj_untyped( self.call_method_inner::<T>(key, [])?, )) } /// Calls an object method. - pub fn call_method<T: MetacallValue, U: MetacallValue>( + pub fn call_method<T: MetaCallValue, U: MetaCallValue>( &self, key: impl ToString, args: impl IntoIterator<Item = U>, - ) -> Result<T, MetacallError> { + ) -> Result<T, MetaCallError> { match parsers::raw_to_metacallobj::<T>(self.call_method_inner::<U>(key, args)?) { Ok(ret) => Ok(ret), - Err(original) => Err(MetacallError::FailedCasting(original)), + Err(original) => Err(MetaCallError::FailedCasting(original)), } } /// Calls an object method without passing arguments. - pub fn call_method_no_arg<T: MetacallValue>( + pub fn call_method_no_arg<T: MetaCallValue>( &self, key: impl ToString, - ) -> Result<T, MetacallError> { - self.call_method::<T, MetacallNull>(key, []) + ) -> Result<T, MetaCallError> { + self.call_method::<T, MetaCallNull>(key, []) } #[doc(hidden)] @@ -168,7 +168,7 @@ impl MetacallObject { } } -impl Drop for MetacallObject { +impl Drop for MetaCallObject { fn drop(&mut self) { if !self.leak { unsafe { metacall_value_destroy(self.value) } diff --git a/source/ports/rs_port/src/types/metacall_pointer.rs b/source/ports/rs_port/src/types/metacall_pointer.rs index fc2f62088..802aa153a 100644 --- a/source/ports/rs_port/src/types/metacall_pointer.rs +++ b/source/ports/rs_port/src/types/metacall_pointer.rs @@ -1,24 +1,24 @@ -use super::MetacallValue; +use super::MetaCallValue; use crate::{ bindings::{metacall_value_create_ptr, metacall_value_destroy, metacall_value_to_ptr}, - MetacallNull, + MetaCallNull, }; use std::{ ffi::c_void, fmt::{self, Debug, Formatter}, }; -/// Represents Metacall pointer. This type cannot be used in other languages. This type is highly +/// Represents MetaCall pointer. This type cannot be used in other languages. This type is highly /// unsafe so be careful! -pub struct MetacallPointer { +pub struct MetaCallPointer { leak: bool, - rust_value: *mut Box<dyn MetacallValue>, + rust_value: *mut Box<dyn MetaCallValue>, rust_value_leak: bool, value: *mut c_void, } -unsafe impl Send for MetacallPointer {} -unsafe impl Sync for MetacallPointer {} -impl Clone for MetacallPointer { +unsafe impl Send for MetaCallPointer {} +unsafe impl Sync for MetaCallPointer {} +impl Clone for MetaCallPointer { fn clone(&self) -> Self { Self { leak: true, @@ -28,29 +28,29 @@ impl Clone for MetacallPointer { } } } -impl Debug for MetacallPointer { +impl Debug for MetaCallPointer { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { let boxed_value = unsafe { Box::from_raw(self.rust_value) }; - let value = if (*boxed_value).is::<MetacallNull>() { + let value = if (*boxed_value).is::<MetaCallNull>() { None } else { Some(format!("{:#?}", boxed_value)) }; Box::leak(boxed_value); - f.debug_struct("MetacallPointer") + f.debug_struct("MetaCallPointer") .field("value", &value) .finish() } } -impl MetacallPointer { - fn get_rust_value_ptr(value: *mut c_void) -> *mut Box<dyn MetacallValue> { - unsafe { metacall_value_to_ptr(value) as *mut Box<dyn MetacallValue> } +impl MetaCallPointer { + fn get_rust_value_ptr(value: *mut c_void) -> *mut Box<dyn MetaCallValue> { + unsafe { metacall_value_to_ptr(value) as *mut Box<dyn MetaCallValue> } } #[doc(hidden)] - pub fn new_raw(value: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + pub fn new_raw(value: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self { leak: false, rust_value: Self::get_rust_value_ptr(value), @@ -60,7 +60,7 @@ impl MetacallPointer { } #[doc(hidden)] - pub fn new_raw_leak(value: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + pub fn new_raw_leak(value: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self { leak: true, rust_value: Self::get_rust_value_ptr(value), @@ -69,9 +69,9 @@ impl MetacallPointer { }) } - /// Creates a new Metacall pointer and casts it to T. - pub fn new(ptr: impl MetacallValue) -> Self { - let rust_value = Box::into_raw(Box::new(Box::new(ptr) as Box<dyn MetacallValue>)); + /// Creates a new MetaCall pointer and casts it to T. + pub fn new(ptr: impl MetaCallValue) -> Self { + let rust_value = Box::into_raw(Box::new(Box::new(ptr) as Box<dyn MetaCallValue>)); Self { leak: false, @@ -81,15 +81,15 @@ impl MetacallPointer { } } - /// Consumes the Metacall pointer and returns ownership of the value without type - /// casting([MetacallValue](MetacallValue)). - pub fn get_value_untyped(mut self) -> Box<dyn MetacallValue> { + /// Consumes the MetaCall pointer and returns ownership of the value without type + /// casting([MetaCallValue](MetaCallValue)). + pub fn get_value_untyped(mut self) -> Box<dyn MetaCallValue> { self.rust_value_leak = true; unsafe { *Box::from_raw(self.rust_value) } } - /// Consumes the Metacall pointer and returns ownership of the value. - pub fn get_value<T: MetacallValue>(self) -> Result<T, Box<dyn MetacallValue>> { + /// Consumes the MetaCall pointer and returns ownership of the value. + pub fn get_value<T: MetaCallValue>(self) -> Result<T, Box<dyn MetaCallValue>> { match self.get_value_untyped().downcast::<T>() { Ok(rust_value) => Ok(rust_value), Err(original) => Err(original), @@ -105,7 +105,7 @@ impl MetacallPointer { } } -impl Drop for MetacallPointer { +impl Drop for MetaCallPointer { fn drop(&mut self) { if !self.leak { unsafe { metacall_value_destroy(self.value) } diff --git a/source/ports/rs_port/src/types/metacall_value.rs b/source/ports/rs_port/src/types/metacall_value.rs index a1ee9775e..e6b914a50 100644 --- a/source/ports/rs_port/src/types/metacall_value.rs +++ b/source/ports/rs_port/src/types/metacall_value.rs @@ -1,11 +1,11 @@ use super::{ - MetacallClass, MetacallException, MetacallFunction, MetacallFuture, MetacallNull, - MetacallObject, MetacallPointer, MetacallThrowable, + MetaCallClass, MetaCallException, MetaCallFunction, MetaCallFuture, MetaCallNull, + MetaCallObject, MetaCallPointer, MetaCallThrowable, }; use crate::{ bindings::*, cstring, - helpers::{MetacallClone, MetacallDowncast}, + helpers::{MetaCallClone, MetaCallDowncast}, match_metacall_value, parsers, }; use std::{ @@ -15,7 +15,7 @@ use std::{ slice, }; -/// Trait of any possible object in Metacall. +/// Trait of any possible object in MetaCall. /// Checkout [match_metacall_value](match_metacall_value) macro for /// matching trait objects of this trait. Let' see what types we can use with an example: ... /// ``` @@ -50,31 +50,31 @@ use std::{ /// hashmap.insert(String::from("hi"), String::from("there!")); /// metacall::metacall_untyped("x", [hashmap]); /// // pointer -/// metacall::metacall_untyped("x", [metacall::MetacallPointer::new(String::from("hi"))]); +/// metacall::metacall_untyped("x", [metacall::MetaCallPointer::new(String::from("hi"))]); /// // future? /// // nope! you can't pass a future! /// // function /// metacall::metacall_untyped("x", [ -/// metacall::metacall_no_arg::<metacall::MetacallFunction>("my_async_function").unwrap() +/// metacall::metacall_no_arg::<metacall::MetaCallFunction>("my_async_function").unwrap() /// ]); /// // null -/// metacall::metacall_untyped("x", [metacall::MetacallNull()]); +/// metacall::metacall_untyped("x", [metacall::MetaCallNull()]); /// // class -/// metacall::metacall_untyped("x", [metacall::MetacallClass::from_name("MyClass").unwrap()]); +/// metacall::metacall_untyped("x", [metacall::MetaCallClass::from_name("MyClass").unwrap()]); /// // object -/// let class = metacall::MetacallClass::from_name("MyClass").unwrap(); +/// let class = metacall::MetaCallClass::from_name("MyClass").unwrap(); /// metacall::metacall_untyped("x", [class.create_object_no_arg("myObject").unwrap()]); /// // exception /// metacall::metacall_untyped("x", [ -/// metacall::metacall_no_arg::<metacall::MetacallException>("my_function").unwrap() +/// metacall::metacall_no_arg::<metacall::MetaCallException>("my_function").unwrap() /// ]); /// // throwable? /// // nope! you can't pass a throwable! /// ``` -pub trait MetacallValue: MetacallClone + MetacallDowncast + Debug { +pub trait MetaCallValue: MetaCallClone + MetaCallDowncast + Debug { // It tries to convert the raw pointer to the value or return a trait object on failure. #[doc(hidden)] - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> where Self: Sized, { @@ -86,24 +86,24 @@ pub trait MetacallValue: MetacallClone + MetacallDowncast + Debug { } // Same as `from_metacall_raw` but doesn't free the memory on drop and leaks. #[doc(hidden)] - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> where Self: Sized; - // It returns the enum index of Metacall Protocol in the core. It's used for faster type matching. + // It returns the enum index of MetaCall Protocol in the core. It's used for faster type matching. #[doc(hidden)] - fn get_metacall_id() -> u32 + fn get_metacall_id() -> metacall_value_id where Self: Sized; // It converts the value to a raw value known by the metacall core. #[doc(hidden)] fn into_metacall_raw(self) -> *mut c_void; } -/// Equivalent to Metacall boolean type. -impl MetacallValue for bool { - fn get_metacall_id() -> u32 { - 0 +/// Equivalent to MetaCall boolean type. +impl MetaCallValue for bool { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_BOOL } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let value = unsafe { metacall_value_to_bool(v) != 0 }; Ok(value) @@ -112,12 +112,12 @@ impl MetacallValue for bool { unsafe { metacall_value_create_bool((self as c_int).try_into().unwrap()) } } } -/// Equivalent to Metacall char type. -impl MetacallValue for char { - fn get_metacall_id() -> u32 { - 1 +/// Equivalent to MetaCall char type. +impl MetaCallValue for char { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_CHAR } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let value = unsafe { metacall_value_to_char(v) as u8 as char }; Ok(value) @@ -126,12 +126,12 @@ impl MetacallValue for char { unsafe { metacall_value_create_char(self as c_char) } } } -/// Equivalent to Metacall short type. -impl MetacallValue for i16 { - fn get_metacall_id() -> u32 { - 2 +/// Equivalent to MetaCall short type. +impl MetaCallValue for i16 { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_SHORT } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let value = unsafe { metacall_value_to_short(v) }; Ok(value) @@ -140,12 +140,12 @@ impl MetacallValue for i16 { unsafe { metacall_value_create_short(self) } } } -/// Equivalent to Metacall int type. -impl MetacallValue for i32 { - fn get_metacall_id() -> u32 { - 3 +/// Equivalent to MetaCall int type. +impl MetaCallValue for i32 { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_INT } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let value = unsafe { metacall_value_to_int(v) }; Ok(value) @@ -154,12 +154,12 @@ impl MetacallValue for i32 { unsafe { metacall_value_create_int(self) } } } -/// Equivalent to Metacall long type. -impl MetacallValue for i64 { - fn get_metacall_id() -> u32 { - 4 +/// Equivalent to MetaCall long type. +impl MetaCallValue for i64 { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_LONG } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let value = unsafe { metacall_value_to_long(v) }; Ok(value) @@ -168,12 +168,12 @@ impl MetacallValue for i64 { unsafe { metacall_value_create_long(self) } } } -/// Equivalent to Metacall float type. -impl MetacallValue for f32 { - fn get_metacall_id() -> u32 { - 5 +/// Equivalent to MetaCall float type. +impl MetaCallValue for f32 { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_FLOAT } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let value = unsafe { metacall_value_to_float(v) }; Ok(value) @@ -182,12 +182,12 @@ impl MetacallValue for f32 { unsafe { metacall_value_create_float(self) } } } -/// Equivalent to Metacall double type. -impl MetacallValue for f64 { - fn get_metacall_id() -> u32 { - 6 +/// Equivalent to MetaCall double type. +impl MetaCallValue for f64 { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_DOUBLE } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let value = unsafe { metacall_value_to_double(v) }; Ok(value) @@ -196,12 +196,12 @@ impl MetacallValue for f64 { unsafe { metacall_value_create_double(self) } } } -/// Equivalent to Metacall string type. -impl MetacallValue for String { - fn get_metacall_id() -> u32 { - 7 +/// Equivalent to MetaCall string type. +impl MetaCallValue for String { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_STRING } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let c_str = unsafe { CStr::from_ptr(metacall_value_to_string(v)) }; let value = String::from(c_str.to_str().unwrap()); @@ -213,12 +213,12 @@ impl MetacallValue for String { unsafe { metacall_value_create_string(raw.as_ptr(), self.len()) } } } -/// Equivalent to Metacall buffer type. -impl MetacallValue for Vec<i8> { - fn get_metacall_id() -> u32 { - 8 +/// Equivalent to MetaCall buffer type. +impl MetaCallValue for Vec<i8> { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_BUFFER } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(unsafe { slice::from_raw_parts( metacall_value_to_buffer(v) as *mut c_char, @@ -231,17 +231,17 @@ impl MetacallValue for Vec<i8> { unsafe { metacall_value_create_buffer(self.as_mut_ptr() as *mut c_void, self.len()) } } } -/// Equivalent to Metacall array type. -impl<T: MetacallValue + Clone> MetacallValue for Vec<T> { - fn get_metacall_id() -> u32 { - 9 +/// Equivalent to MetaCall array type. +impl<T: MetaCallValue + Clone> MetaCallValue for Vec<T> { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_ARRAY } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let count = unsafe { metacall_value_count(v) }; let vec = unsafe { slice::from_raw_parts(metacall_value_to_array(v), count) } .iter() .map(|element| parsers::raw_to_metacallobj_leak(*element)) - .collect::<Result<Vec<T>, Box<dyn MetacallValue>>>()?; + .collect::<Result<Vec<T>, Box<dyn MetaCallValue>>>()?; Ok(vec) } @@ -254,12 +254,12 @@ impl<T: MetacallValue + Clone> MetacallValue for Vec<T> { unsafe { metacall_value_create_array(array.as_mut_ptr(), array.len()) } } } -/// Equivalent to Metacall map type. -impl<T: MetacallValue + Clone> MetacallValue for HashMap<String, T> { - fn get_metacall_id() -> u32 { - 10 +/// Equivalent to MetaCall map type. +impl<T: MetaCallValue + Clone> MetaCallValue for HashMap<String, T> { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_MAP } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { unsafe { let mut hashmap = HashMap::new(); for map_value in @@ -307,122 +307,122 @@ impl<T: MetacallValue + Clone> MetacallValue for HashMap<String, T> { unsafe { metacall_value_create_map(hashmap.as_mut_ptr(), hashmap.len()) } } } -/// Equivalent to Metacall pointer type. -impl MetacallValue for MetacallPointer { - fn get_metacall_id() -> u32 { - 11 +/// Equivalent to MetaCall pointer type. +impl MetaCallValue for MetaCallPointer { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_PTR } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Self::new_raw_leak(v) } - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Self::new_raw(v) } fn into_metacall_raw(self) -> *mut c_void { self.into_raw() } } -/// Equivalent to Metacall future type. -impl MetacallValue for MetacallFuture { - fn get_metacall_id() -> u32 { - 12 +/// Equivalent to MetaCall future type. +impl MetaCallValue for MetaCallFuture { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_FUTURE } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw_leak(v)) } - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw(v)) } fn into_metacall_raw(self) -> *mut c_void { self.into_raw() } } -/// Equivalent to Metacall function type. -impl MetacallValue for MetacallFunction { - fn get_metacall_id() -> u32 { - 13 +/// Equivalent to MetaCall function type. +impl MetaCallValue for MetaCallFunction { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_FUNCTION } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw_leak(v)) } - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw(v)) } fn into_metacall_raw(self) -> *mut c_void { self.into_raw() } } -/// Equivalent to Metacall null type. -impl MetacallValue for MetacallNull { - fn get_metacall_id() -> u32 { - 14 +/// Equivalent to MetaCall null type. +impl MetaCallValue for MetaCallNull { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_NULL } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { unsafe { metacall_value_destroy(v) }; - Ok(MetacallNull()) + Ok(MetaCallNull()) } - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Self::from_metacall_raw_leak(v) } fn into_metacall_raw(self) -> *mut c_void { self.into_raw() } } -/// Equivalent to Metacall class type. -impl MetacallValue for MetacallClass { - fn get_metacall_id() -> u32 { - 15 +/// Equivalent to MetaCall class type. +impl MetaCallValue for MetaCallClass { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_CLASS } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw_leak(v)) } - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw(v)) } fn into_metacall_raw(self) -> *mut c_void { self.into_raw() } } -/// Equivalent to Metacall object type. -impl MetacallValue for MetacallObject { - fn get_metacall_id() -> u32 { - 16 +/// Equivalent to MetaCall object type. +impl MetaCallValue for MetaCallObject { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_OBJECT } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw_leak(v)) } - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw(v)) } fn into_metacall_raw(self) -> *mut c_void { self.into_raw() } } -/// Equivalent to Metacall exception type. -impl MetacallValue for MetacallException { - fn get_metacall_id() -> u32 { - 17 +/// Equivalent to MetaCall exception type. +impl MetaCallValue for MetaCallException { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_EXCEPTION } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw_leak(v)) } - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw(v)) } fn into_metacall_raw(self) -> *mut c_void { self.into_raw() } } -/// Equivalent to Metacall throwable type. -impl MetacallValue for MetacallThrowable { - fn get_metacall_id() -> u32 { - 18 +/// Equivalent to MetaCall throwable type. +impl MetaCallValue for MetaCallThrowable { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_THROWABLE } - fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw_leak(v)) } - fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetacallValue>> { + fn from_metacall_raw(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { Ok(Self::new_raw(v)) } fn into_metacall_raw(self) -> *mut c_void { diff --git a/source/ports/rs_port/tests/invalid_loaders_test.rs b/source/ports/rs_port/tests/invalid_loaders_test.rs index e98418c23..80c8fc7e2 100644 --- a/source/ports/rs_port/tests/invalid_loaders_test.rs +++ b/source/ports/rs_port/tests/invalid_loaders_test.rs @@ -1,4 +1,4 @@ -use metacall::{loaders, switch, MetacallLoaderError}; +use metacall::{loaders, switch, MetaCallLoaderError}; use std::env; #[test] @@ -9,7 +9,7 @@ fn invalid_loaders() { let inavlid_file = scripts_dir.join("whatever.yeet"); let valid_file = scripts_dir.join("script.js"); - if let Err(MetacallLoaderError::FileNotFound(_)) = + if let Err(MetaCallLoaderError::FileNotFound(_)) = loaders::from_single_file("random", inavlid_file) { // Everything Ok @@ -17,7 +17,7 @@ fn invalid_loaders() { panic!("Expected the loader fail with `FileNotFound` error variant!"); } - if let Err(MetacallLoaderError::FromFileFailure) = + if let Err(MetaCallLoaderError::FromFileFailure) = loaders::from_single_file("random", valid_file) { // Everything Ok @@ -25,7 +25,7 @@ fn invalid_loaders() { panic!("Expected the loader fail with `FromFileFailure` error variant!"); } - if let Err(MetacallLoaderError::FromMemoryFailure) = + if let Err(MetaCallLoaderError::FromMemoryFailure) = loaders::from_memory("random", "Invalid code!") { // Everything Ok diff --git a/source/ports/rs_port/tests/loaders_test.rs b/source/ports/rs_port/tests/loaders_test.rs index 0ed57931b..b0f65392f 100644 --- a/source/ports/rs_port/tests/loaders_test.rs +++ b/source/ports/rs_port/tests/loaders_test.rs @@ -13,14 +13,7 @@ const SCRIPT2: &str = "function greet2() { return 'hi there!' } \nmodule.exports const SCRIPT3: &str = "console.log('Hello world')"; fn call_greet(test: &str, num: u32) { let out = metacall_no_arg::<String>(format!("greet{}", num)).unwrap(); - if out.as_str() == "hi there!" { - return (); - } else { - panic!( - "Invalid output of the function! Expected `hi there!` but received `{}`.", - test - ); - } + assert_eq!(out.as_str(), "hi there!", "Testing {}", test); } fn load_from_memory_test() { diff --git a/source/ports/rs_port/tests/metacall_exception_test.rs b/source/ports/rs_port/tests/metacall_exception_test.rs index 5933b59c0..975ec96fe 100644 --- a/source/ports/rs_port/tests/metacall_exception_test.rs +++ b/source/ports/rs_port/tests/metacall_exception_test.rs @@ -8,10 +8,10 @@ fn inlines() { let tests_dir = env::current_dir().unwrap().join("tests/scripts"); let js_test_file = tests_dir.join("script.js"); - if let Ok(_) = loaders::from_single_file("node", js_test_file) { + if loaders::from_single_file("node", js_test_file).is_ok() { // This should not generate a segmentation fault let val = - metacall::metacall_no_arg::<metacall::MetacallException>("test_exception").unwrap(); + metacall::metacall_no_arg::<metacall::MetaCallException>("test_exception").unwrap(); let cloned_val_1 = val.clone(); let cloned_val_2 = val.clone(); @@ -25,7 +25,7 @@ fn inlines() { // Neither this should not generate a segmentation fault let val = - metacall::metacall_no_arg::<metacall::MetacallException>("test_exception").unwrap(); + metacall::metacall_no_arg::<metacall::MetaCallException>("test_exception").unwrap(); let cloned_val_1 = val.clone(); let cloned_val_2 = val.clone(); diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index 82c0b2229..8a0940b6b 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -1,14 +1,14 @@ use metacall::{ - loaders, switch, MetacallClass, MetacallException, MetacallFunction, MetacallFuture, - MetacallNull, MetacallObject, MetacallPointer, MetacallThrowable, MetacallValue, + loaders, switch, MetaCallClass, MetaCallException, MetaCallFunction, MetaCallFuture, + MetaCallNull, MetaCallObject, MetaCallPointer, MetaCallThrowable, MetaCallValue, }; use std::{collections::HashMap, env, fmt::Debug}; -fn generate_test<T: MetacallValue + PartialEq + Debug + Clone>( +fn generate_test<T: MetaCallValue + PartialEq + Debug + Clone>( name: impl ToString, expected: T, ) -> T { - let test = if !(Box::new(expected.clone()) as Box<dyn MetacallValue>).is::<MetacallNull>() { + let test = if !(Box::new(expected.clone()) as Box<dyn MetaCallValue>).is::<MetaCallNull>() { ::metacall::metacall::<T>(name, [expected.clone()]) } else { ::metacall::metacall_no_arg::<T>(name) @@ -25,14 +25,14 @@ fn generate_test<T: MetacallValue + PartialEq + Debug + Clone>( expected } -fn generate_test_custom_validation<T: MetacallValue + Debug>( +fn generate_test_custom_validation<T: MetaCallValue + Debug>( name: impl ToString, expected_type: impl ToString, - expected_value: impl MetacallValue + Clone, + expected_value: impl MetaCallValue + Clone, validator: impl FnOnce(T), ) { - let expected_value_boxed = Box::new(expected_value.clone()) as Box<dyn MetacallValue>; - let test = if !expected_value_boxed.is::<MetacallNull>() { + let expected_value_boxed = Box::new(expected_value.clone()) as Box<dyn MetaCallValue>; + let test = if !expected_value_boxed.is::<MetaCallNull>() { ::metacall::metacall::<T>(name, [expected_value]) } else { ::metacall::metacall_no_arg::<T>(name) @@ -66,19 +66,19 @@ fn test_char() { generate_test::<char>("test_char", 'Z'); } fn test_short() { - generate_test::<i16>("test_short", 12345 as i16); + generate_test::<i16>("test_short", 12345_i16); } fn test_int() { - generate_test::<i32>("test_int", 12345 as i32); + generate_test::<i32>("test_int", 12345_i32); } fn test_long() { - generate_test::<i64>("test_long", 12345 as i64); + generate_test::<i64>("test_long", 12345_i64); } fn test_float() { - generate_test::<f32>("test_float", 1.2345 as f32); + generate_test::<f32>("test_float", 1.2345_f32); } fn test_double() { - generate_test::<f64>("test_double", 1.2345 as f64); + generate_test::<f64>("test_double", 1.2345_f64); } fn test_string() { generate_test::<String>( @@ -140,10 +140,10 @@ fn test_array() { fn test_pointer() { let expected_value = String::from("hi there!"); - generate_test_custom_validation::<MetacallPointer>( + generate_test_custom_validation::<MetaCallPointer>( "return_the_argument_py", "pointer", - MetacallPointer::new(expected_value.clone()), + MetaCallPointer::new(expected_value.clone()), |pointer| { let receieved_value = pointer.get_value::<String>().unwrap(); @@ -154,7 +154,7 @@ fn test_pointer() { ); } fn test_future() { - fn validate(upper_result: Box<dyn MetacallValue>, upper_data: Box<dyn MetacallValue>) { + fn validate(upper_result: Box<dyn MetaCallValue>, upper_data: Box<dyn MetaCallValue>) { match upper_data.downcast::<String>() { Ok(ret) => { if ret.as_str() != "data" { @@ -178,24 +178,24 @@ fn test_future() { } } - generate_test_custom_validation::<MetacallFuture>( + generate_test_custom_validation::<MetaCallFuture>( "test_future_resolve", "future", - MetacallNull(), + MetaCallNull(), move |future| { - fn resolve(result: Box<dyn MetacallValue>, data: Box<dyn MetacallValue>) { + fn resolve(result: Box<dyn MetaCallValue>, data: Box<dyn MetaCallValue>) { validate(result, data); } future.then(resolve).data(String::from("data")).await_fut(); }, ); - generate_test_custom_validation::<MetacallFuture>( + generate_test_custom_validation::<MetaCallFuture>( "test_future_reject", "future", - MetacallNull(), + MetaCallNull(), move |future| { - fn reject(result: Box<dyn MetacallValue>, data: Box<dyn MetacallValue>) { + fn reject(result: Box<dyn MetaCallValue>, data: Box<dyn MetaCallValue>) { validate(result, data); } @@ -204,12 +204,12 @@ fn test_future() { ); } fn test_function() { - generate_test_custom_validation::<MetacallFunction>( + generate_test_custom_validation::<MetaCallFunction>( "test_function", "function", - MetacallNull(), + MetaCallNull(), |upper_function| { - generate_test_custom_validation::<MetacallFunction>( + generate_test_custom_validation::<MetaCallFunction>( "return_the_argument_py", "function", upper_function, @@ -225,9 +225,9 @@ fn test_function() { ); } fn test_null() { - metacall::metacall::<MetacallNull>("return_the_argument_py", [MetacallNull()]).unwrap(); + metacall::metacall::<MetaCallNull>("return_the_argument_py", [MetaCallNull()]).unwrap(); } -fn class_test_inner(class: MetacallClass) { +fn class_test_inner(class: MetaCallClass) { let attr = class.get_attribute::<String>("hi").unwrap(); if attr.as_str() != "there!" { invalid_return_value("there!", attr); @@ -250,12 +250,12 @@ fn class_test_inner(class: MetacallClass) { object_test_inner(new_obj); } fn test_class() { - generate_test_custom_validation::<MetacallClass>( + generate_test_custom_validation::<MetaCallClass>( "test_class", "class", - MetacallNull(), + MetaCallNull(), |upper_class| { - generate_test_custom_validation::<MetacallClass>( + generate_test_custom_validation::<MetaCallClass>( "return_the_argument_py", "class", upper_class, @@ -264,9 +264,9 @@ fn test_class() { }, ); - class_test_inner(MetacallClass::from_name("TestClass").unwrap()); + class_test_inner(MetaCallClass::from_name("TestClass").unwrap()); } -fn object_test_inner(object: MetacallObject) { +fn object_test_inner(object: MetaCallObject) { object .set_attribute("hi2", String::from("there!2!")) .unwrap(); @@ -282,12 +282,12 @@ fn object_test_inner(object: MetacallObject) { } } fn test_object() { - generate_test_custom_validation::<MetacallObject>( + generate_test_custom_validation::<MetaCallObject>( "test_object", "object", - MetacallNull(), + MetaCallNull(), |upper_object| { - generate_test_custom_validation::<MetacallObject>( + generate_test_custom_validation::<MetaCallObject>( "return_the_argument_py", "object", upper_object, @@ -297,12 +297,12 @@ fn test_object() { ); } fn test_exception() { - generate_test_custom_validation::<MetacallException>( + generate_test_custom_validation::<MetaCallException>( "test_exception", "exception", - MetacallNull(), + MetaCallNull(), |upper_exception| { - generate_test_custom_validation::<MetacallException>( + generate_test_custom_validation::<MetaCallException>( "return_the_argument_js", "exception", upper_exception, @@ -317,13 +317,13 @@ fn test_exception() { ); } fn test_throwable() { - generate_test_custom_validation::<MetacallThrowable>( + generate_test_custom_validation::<MetaCallThrowable>( "test_throwable", "throwable", - MetacallNull(), + MetaCallNull(), |throwable| { let exception_message = throwable - .get_value::<MetacallException>() + .get_value::<MetaCallException>() .unwrap() .get_message(); if exception_message.as_str() != "hi there!" { @@ -342,13 +342,13 @@ fn metacall() { let c_test_file = tests_dir.join("script.c"); let py_test_file = tests_dir.join("script.py"); - if let Ok(_) = loaders::from_single_file("py", py_test_file) { + if loaders::from_single_file("py", py_test_file).is_ok() { test_buffer(); test_class(); test_object(); test_pointer(); } - if let Ok(_) = loaders::from_single_file("c", c_test_file) { + if loaders::from_single_file("c", c_test_file).is_ok() { test_char(); test_double(); test_float(); @@ -356,7 +356,7 @@ fn metacall() { test_long(); test_short(); } - if let Ok(_) = loaders::from_single_file("node", js_test_file) { + if loaders::from_single_file("node", js_test_file).is_ok() { test_array(); test_bool(); test_exception(); From d901405d22ff93accbf798aebea3e3dd93ca5ec5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Dec 2024 02:49:02 +0100 Subject: [PATCH 112/487] Add minor improvements to rs_port. --- source/ports/rs_port/.vscode/settings.json | 4 + source/ports/rs_port/src/parsers.rs | 152 +++++++++++++----- .../rs_port/src/types/metacall_future.rs | 44 ++--- 3 files changed, 140 insertions(+), 60 deletions(-) diff --git a/source/ports/rs_port/.vscode/settings.json b/source/ports/rs_port/.vscode/settings.json index c57b92269..8a76e8562 100644 --- a/source/ports/rs_port/.vscode/settings.json +++ b/source/ports/rs_port/.vscode/settings.json @@ -1,4 +1,8 @@ { + "[rust]": { + "editor.defaultFormatter": "rust-lang.rust-analyzer", + "editor.formatOnSave": true + }, "rust-analyzer.checkOnSave": true, "rust-analyzer.check.command": "clippy" } diff --git a/source/ports/rs_port/src/parsers.rs b/source/ports/rs_port/src/parsers.rs index 597af56a6..4a711d1fa 100644 --- a/source/ports/rs_port/src/parsers.rs +++ b/source/ports/rs_port/src/parsers.rs @@ -56,50 +56,126 @@ pub fn raw_to_metacallobj_leak<T: MetaCallValue>( pub fn raw_to_metacallobj_untyped(ret: *mut c_void) -> Box<dyn MetaCallValue> { match (ret.is_null(), unsafe { metacall_value_id(ret) }) { (true, _) => metacallobj_result_wrap(MetaCallNull::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_BOOL) => metacallobj_result_wrap(bool::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_CHAR) => metacallobj_result_wrap(char::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_SHORT) => metacallobj_result_wrap(i16::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_INT) => metacallobj_result_wrap(i32::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_LONG) => metacallobj_result_wrap(i64::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_FLOAT) => metacallobj_result_wrap(f32::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_DOUBLE) => metacallobj_result_wrap(f64::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_STRING) => metacallobj_result_wrap(String::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_BUFFER) => metacallobj_result_wrap(<Vec<i8>>::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_ARRAY) => metacallobj_result_wrap(<Vec<MetaCallNull>>::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_MAP) => metacallobj_result_wrap(<HashMap<String, MetaCallNull>>::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_PTR) => metacallobj_result_wrap(<MetaCallPointer>::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_FUTURE) => metacallobj_result_wrap(MetaCallFuture::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_FUNCTION) => metacallobj_result_wrap(MetaCallFunction::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_NULL) => metacallobj_result_wrap(MetaCallNull::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_CLASS) => metacallobj_result_wrap(MetaCallClass::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_OBJECT) => metacallobj_result_wrap(MetaCallObject::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_EXCEPTION) => metacallobj_result_wrap(MetaCallException::from_metacall_raw(ret)), - (_, metacall_value_id::METACALL_THROWABLE) => metacallobj_result_wrap(MetaCallThrowable::from_metacall_raw(ret)), + (_, metacall_value_id::METACALL_BOOL) => { + metacallobj_result_wrap(bool::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_CHAR) => { + metacallobj_result_wrap(char::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_SHORT) => { + metacallobj_result_wrap(i16::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_INT) => { + metacallobj_result_wrap(i32::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_LONG) => { + metacallobj_result_wrap(i64::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_FLOAT) => { + metacallobj_result_wrap(f32::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_DOUBLE) => { + metacallobj_result_wrap(f64::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_STRING) => { + metacallobj_result_wrap(String::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_BUFFER) => { + metacallobj_result_wrap(<Vec<i8>>::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_ARRAY) => { + metacallobj_result_wrap(<Vec<MetaCallNull>>::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_MAP) => { + metacallobj_result_wrap(<HashMap<String, MetaCallNull>>::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_PTR) => { + metacallobj_result_wrap(<MetaCallPointer>::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_FUTURE) => { + metacallobj_result_wrap(MetaCallFuture::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_FUNCTION) => { + metacallobj_result_wrap(MetaCallFunction::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_NULL) => { + metacallobj_result_wrap(MetaCallNull::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_CLASS) => { + metacallobj_result_wrap(MetaCallClass::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_OBJECT) => { + metacallobj_result_wrap(MetaCallObject::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_EXCEPTION) => { + metacallobj_result_wrap(MetaCallException::from_metacall_raw(ret)) + } + (_, metacall_value_id::METACALL_THROWABLE) => { + metacallobj_result_wrap(MetaCallThrowable::from_metacall_raw(ret)) + } _ => metacallobj_result_wrap(MetaCallNull::from_metacall_raw(ret)), } } pub fn raw_to_metacallobj_untyped_leak(ret: *mut c_void) -> Box<dyn MetaCallValue> { match (ret.is_null(), unsafe { metacall_value_id(ret) }) { (true, _) => metacallobj_result_wrap(MetaCallNull::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_BOOL) => metacallobj_result_wrap(bool::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_CHAR) => metacallobj_result_wrap(char::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_SHORT) => metacallobj_result_wrap(i16::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_INT) => metacallobj_result_wrap(i32::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_LONG) => metacallobj_result_wrap(i64::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_FLOAT) => metacallobj_result_wrap(f32::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_DOUBLE) => metacallobj_result_wrap(f64::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_STRING) => metacallobj_result_wrap(String::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_BUFFER) => metacallobj_result_wrap(<Vec<i8>>::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_ARRAY) => metacallobj_result_wrap(<Vec<MetaCallNull>>::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_MAP) => { metacallobj_result_wrap(<HashMap<String, MetaCallNull>>::from_metacall_raw_leak(ret)) } - (_, metacall_value_id::METACALL_PTR) => metacallobj_result_wrap(<MetaCallPointer>::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_FUTURE) => metacallobj_result_wrap(MetaCallFuture::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_FUNCTION) => metacallobj_result_wrap(MetaCallFunction::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_NULL) => metacallobj_result_wrap(MetaCallNull::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_CLASS) => metacallobj_result_wrap(MetaCallClass::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_OBJECT) => metacallobj_result_wrap(MetaCallObject::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_EXCEPTION) => metacallobj_result_wrap(MetaCallException::from_metacall_raw_leak(ret)), - (_, metacall_value_id::METACALL_THROWABLE) => metacallobj_result_wrap(MetaCallThrowable::from_metacall_raw_leak(ret)), + (_, metacall_value_id::METACALL_BOOL) => { + metacallobj_result_wrap(bool::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_CHAR) => { + metacallobj_result_wrap(char::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_SHORT) => { + metacallobj_result_wrap(i16::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_INT) => { + metacallobj_result_wrap(i32::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_LONG) => { + metacallobj_result_wrap(i64::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_FLOAT) => { + metacallobj_result_wrap(f32::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_DOUBLE) => { + metacallobj_result_wrap(f64::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_STRING) => { + metacallobj_result_wrap(String::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_BUFFER) => { + metacallobj_result_wrap(<Vec<i8>>::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_ARRAY) => { + metacallobj_result_wrap(<Vec<MetaCallNull>>::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_MAP) => { + metacallobj_result_wrap(<HashMap<String, MetaCallNull>>::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_PTR) => { + metacallobj_result_wrap(<MetaCallPointer>::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_FUTURE) => { + metacallobj_result_wrap(MetaCallFuture::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_FUNCTION) => { + metacallobj_result_wrap(MetaCallFunction::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_NULL) => { + metacallobj_result_wrap(MetaCallNull::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_CLASS) => { + metacallobj_result_wrap(MetaCallClass::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_OBJECT) => { + metacallobj_result_wrap(MetaCallObject::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_EXCEPTION) => { + metacallobj_result_wrap(MetaCallException::from_metacall_raw_leak(ret)) + } + (_, metacall_value_id::METACALL_THROWABLE) => { + metacallobj_result_wrap(MetaCallThrowable::from_metacall_raw_leak(ret)) + } _ => metacallobj_result_wrap(MetaCallNull::from_metacall_raw_leak(ret)), } } diff --git a/source/ports/rs_port/src/types/metacall_future.rs b/source/ports/rs_port/src/types/metacall_future.rs index fa911d134..23556c613 100644 --- a/source/ports/rs_port/src/types/metacall_future.rs +++ b/source/ports/rs_port/src/types/metacall_future.rs @@ -16,9 +16,9 @@ use std::{ pub type MetaCallFutureHandler = fn(Box<dyn MetaCallValue>, Box<dyn MetaCallValue>); /// Represents MetaCallFuture. Keep in mind that it's not supported to pass a future as an argument. -/// +/// /// ## **Usage example:** -/// +/// /// **Javascript Code:** /// ```javascript /// function doubleValueAfterTime(value, delay) { @@ -33,20 +33,20 @@ pub type MetaCallFutureHandler = fn(Box<dyn MetaCallValue>, Box<dyn MetaCallValu /// }); /// } /// ``` -/// +/// /// **Calling Example:** /// ```rust /// use metacall::{MetaCallValue, MetaCallFuture, metacall}; /// fn runner(x: i32) { -/// +/// /// fn resolve(result: impl MetaCallValue, data: impl MetaCallValue) { -/// println!("Resolve:: result: {:#?}, data: {:#?}", result, data); // +/// println!("Resolve:: result: {:#?}, data: {:#?}", result, data); // /// } -/// +/// /// fn reject(error: impl MetaCallValue, data: impl MetaCallValue) { /// println!("Reject:: error: {:#?}, data: {:#?}", error, data); /// } -/// +/// /// let future = metacall::<MetaCallFuture>("doubleValueAfterTime", [1, 2000]).unwrap(); /// future.then(resolve).catch(reject).await_fut(); /// } @@ -161,47 +161,47 @@ impl MetaCallFuture { } /// Adds a resolve callback. - /// + /// /// ## **Usage example:** - /// - /// + /// + /// /// ```javascript /// // Javascript script - /// + /// /// function func_always_rejects(value, delay) { /// return new Promise((resolve) => { - /// resolve('Resolve message.'); + /// resolve('Resolve message.'); /// }); /// } /// ``` /// **Calling Example:** - /// + /// /// ```rust /// use metacall::{MetaCallValue, MetaCallFuture, metacall_no_args}; /// fn calling() { /// fn reject(result: impl MetaCallValue, _: impl MetaCallValue) { /// println!("Resolve:: {:#?}", result); // Resolve:: "Resolve message" /// } - /// + /// /// let future = metacall_no_args::<MetaCallFuture>("func_always_resolve").unwrap(); /// future.then(resolve).catch(reject).await_fut(); /// } /// ``` pub fn then(mut self, resolve: MetaCallFutureHandler) -> Self { self.resolve = Some(resolve); - + self } - + /// Adds a reject callback. - /// + /// /// ## **Usage example:** - /// + /// /// ```javascript /// // Javascript script /// function func_always_rejects(value, delay) { /// return new Promise((_, reject) => { - /// reject('Error: Reject message.'); + /// reject('Error: Reject message.'); /// }); /// } /// ``` @@ -212,7 +212,7 @@ impl MetaCallFuture { /// fn reject(error: impl MetaCallValue, _: impl MetaCallValue) { /// println!("Reject:: error: {:#?}", error); // Reject:: error: "Error: Reject message" /// } - /// + /// /// let future = metacall_no_args::<MetaCallFuture>("func_always_rejects").unwrap(); /// future.then(resolve).catch(reject).await_fut(); /// } @@ -224,11 +224,11 @@ impl MetaCallFuture { } /// Adds data to use it inside the `resolver` and `reject`. - /// + /// /// Example: /// ```rust /// use metacall::{MetaCallValue, MetaCallFuture, metacall}; - /// + /// /// fn run() { /// let x = 10; /// fn resolve(result: impl MetaCallValue, data: impl MetaCallValue) { From 125d2e1100fae82e2e02bf2bbd0bb961ca1fbaa1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Dec 2024 17:37:34 +0100 Subject: [PATCH 113/487] Improve rs_port tests and improve memory leak detection for valgrind. --- cmake/CompileOptions.cmake | 32 +++++++++++++++ source/CMakeLists.txt | 1 + .../loaders/c_loader/source/c_loader_impl.cpp | 1 + source/ports/rs_port/CMakeLists.txt | 29 +++++++++----- source/ports/rs_port/tests/metacall_test.rs | 12 +++--- source/ports/rs_port/valgrind-rust.supp | 39 +++++++++++++++++++ source/tests/CMakeLists.txt | 23 ----------- 7 files changed, 98 insertions(+), 39 deletions(-) create mode 100644 source/ports/rs_port/valgrind-rust.supp diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index e1f03c5e8..f569a6c16 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -73,8 +73,40 @@ if(OPTION_TEST_MEMORYCHECK) set(MEMORYCHECK_COMPILE_DEFINITIONS "__MEMORYCHECK__=1" ) + + set(MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full") + # set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --show-leak-kinds=all") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --trace-children=yes") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --show-reachable=yes") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --track-origins=yes") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --num-callers=100") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --smc-check=all-non-file") # for JITs + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_SOURCE_DIR}/source/tests/memcheck/valgrind-dl.supp") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_SOURCE_DIR}/source/tests/memcheck/valgrind-python.supp") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_SOURCE_DIR}/source/tests/memcheck/valgrind-node.supp") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_SOURCE_DIR}/source/tests/memcheck/valgrind-wasm.supp") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_SOURCE_DIR}/source/tests/memcheck/valgrind-wasm.supp") + + # TODO: Implement automatic detection for valgrind suppressions and create a proper test suite for the CI + set(MEMORYCHECK_ADDITIONAL_SUPPRESSIONS + "/usr/lib/valgrind/python3.supp" + "/usr/lib/valgrind/debian.supp" + ) + + foreach(SUPPRESSION ${MEMORYCHECK_ADDITIONAL_SUPPRESSIONS}) + if(EXISTS "${SUPPRESSION}") + set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${SUPPRESSION}") + endif() + endforeach() + + # This is needed in order to allow valgrind to properly track malloc in Python + set(TESTS_MEMCHECK_ENVIRONMENT_VARIABLES + "PYTHONMALLOC=malloc" + ) else() set(MEMORYCHECK_COMPILE_DEFINITIONS) + set(MEMORYCHECK_COMMAND_OPTIONS) + set(TESTS_MEMCHECK_ENVIRONMENT_VARIABLES) endif() # ThreadSanitizer is incompatible with AddressSanitizer and LeakSanitizer diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 96ce56f95..13cb953f5 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -65,6 +65,7 @@ set(TESTS_ENVIRONMENT_VARIABLES ${TESTS_DETOUR_ENVIRONMENT_VARIABLES} ${TESTS_PORT_ENVIRONMENT_VARIABLES} ${TESTS_SANITIZER_ENVIRONMENT_VARIABLES} + ${TESTS_MEMCHECK_ENVIRONMENT_VARIABLES} ${EXTRA_ENVIRONMENT_VARIABLES} ) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index 97db3fcc6..52ead7b7c 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -1121,6 +1121,7 @@ static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_bas if (unit == nullptr) { log_write("metacall", LOG_LEVEL_ERROR, "Unable to parse translation unit of: %s", file.c_str()); + clang_disposeIndex(index); return -1; } diff --git a/source/ports/rs_port/CMakeLists.txt b/source/ports/rs_port/CMakeLists.txt index 109d7df37..26c7a4d71 100644 --- a/source/ports/rs_port/CMakeLists.txt +++ b/source/ports/rs_port/CMakeLists.txt @@ -80,10 +80,7 @@ if(OPTION_BUILD_ADDRESS_SANITIZER AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" "${Rust_TOOLCHAIN_TRIPLET}" STREQUAL "x86_64-unknown-linux-gnu") set(RS_PORT_RUN_INSTRUMENTED_TEST ON) set(RUSTUP_NIGTHLY_INSTALL_SRC ON) - set(SANITIZER_FLAGS - CMAKE_ADDRESS_SANITIZER=1 - RUSTFLAGS=-Zsanitizer=address - ) + set(SANITIZER_FLAGS "RUSTFLAGS=-Zsanitizer=address") set(NIGHTLY_FLAGS +nightly-${RS_PORT_INSTRUMENTATION_NIGHTLY_VERSION} ) @@ -100,10 +97,7 @@ elseif(OPTION_BUILD_THREAD_SANITIZER AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Cla "${Rust_TOOLCHAIN_TRIPLET}" STREQUAL "x86_64-unknown-linux-gnu") set(RS_PORT_RUN_INSTRUMENTED_TEST ON) set(RUSTUP_NIGTHLY_INSTALL_SRC ON) - set(SANITIZER_FLAGS - CMAKE_THREAD_SANITIZER=1 - RUSTFLAGS=-Zsanitizer=thread - ) + set(SANITIZER_FLAGS "RUSTFLAGS=-Zsanitizer=thread") set(NIGHTLY_FLAGS +nightly-${RS_PORT_INSTRUMENTATION_NIGHTLY_VERSION} ) @@ -154,8 +148,22 @@ if((OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER) AND NOT RS_ return() endif() +# If we have cargo-valgrind, run the tests with it +if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER)) + # Check if cargo-valgrind is installed + execute_process( + COMMAND ${Rust_CARGO_EXECUTABLE} install --list + OUTPUT_VARIABLE CARGO_VALGRIND_INSTALL + ) + string(FIND "${CARGO_VALGRIND_INSTALL}" "cargo-valgrind" CARGO_VALGRIND_INSTALLED) + if(NOT ${CARGO_VALGRIND_INSTALLED} EQUAL -1) + set(CARGO_VALGRIND valgrind) + set(CARGO_VALGRIND_FLAGS "VALGRINDFLAGS=${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/valgrind-rust.supp") + endif() +endif() + add_test(NAME ${target} - COMMAND ${Rust_CARGO_EXECUTABLE} ${NIGHTLY_FLAGS} test ${BUILD_STD_FLAGS} + COMMAND ${Rust_CARGO_EXECUTABLE} ${CARGO_VALGRIND} ${NIGHTLY_FLAGS} test ${BUILD_STD_FLAGS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) @@ -177,5 +185,6 @@ test_environment_variables(${target} "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" "PROJECT_OUTPUT_DIR=${PROJECT_OUTPUT_DIR}" "RUST_BACKTRACE=1" - ${SANITIZER_FLAGS} + "${SANITIZER_FLAGS}" + "${CARGO_VALGRIND_FLAGS}" ) diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index 8a0940b6b..01843548f 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -347,6 +347,12 @@ fn metacall() { test_class(); test_object(); test_pointer(); + test_array(); + test_bool(); + test_function(); + test_map(); + test_string(); + test_null(); } if loaders::from_single_file("c", c_test_file).is_ok() { test_char(); @@ -357,13 +363,7 @@ fn metacall() { test_short(); } if loaders::from_single_file("node", js_test_file).is_ok() { - test_array(); - test_bool(); test_exception(); - test_function(); - test_map(); - test_null(); - test_string(); test_throwable(); test_future(); } diff --git a/source/ports/rs_port/valgrind-rust.supp b/source/ports/rs_port/valgrind-rust.supp new file mode 100644 index 000000000..ccebd61ef --- /dev/null +++ b/source/ports/rs_port/valgrind-rust.supp @@ -0,0 +1,39 @@ +{ + Ignore memory leaked from lang_start_internal. + Memcheck:Leak + ... + fun:new_inner + ... +} + +# Ignore leaks from loaders depenecies for now, we want to debug the port only +{ + Ignore leaks from C Loader. + Memcheck:Leak + ... + obj:*/libc_loader*.so +} +{ + Ignore leaks from C Loader depends Clang. + Memcheck:Leak + ... + obj:*/libclang-*.so.* +} +{ + Ignore leaks from C Loader depends LLVM. + Memcheck:Leak + ... + obj:*/libLLVM-*.so.* +} +{ + Ignore leaks from NodeJS Loader. + Memcheck:Leak + ... + obj:*/libnode_loader*.so +} +{ + Ignore leaks from Python Loader depends CPython. + Memcheck:Leak + ... + obj:*/libpython*.so.* +} diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index 003cd815e..eb70ae1c7 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -53,23 +53,6 @@ if(OPTION_TEST_MEMORYCHECK AND (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_T endif() if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER OR OPTION_BUILD_MEMORY_SANITIZER)) - # set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --show-leak-kinds=all") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --leak-check=full") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --trace-children=yes") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --show-reachable=yes") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --track-origins=yes") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --num-callers=100") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --smc-check=all-non-file") # for JITs - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-dl.supp") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-python.supp") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-node.supp") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-wasm.supp") - set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CMAKE_CURRENT_SOURCE_DIR}/memcheck/valgrind-wasm.supp") - - # TODO: Implement automatic detection for valgrind suppressions and create a proper test suite for the CI - # set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=/usr/lib/valgrind/python3.supp") - # set(MEMORYCHECK_COMMAND_OPTIONS "${MEMORYCHECK_COMMAND_OPTIONS} --suppressions=/usr/lib/valgrind/debian.supp") - # TODO: Memory check does not work properly with CoreCLR # # Remove MEMCHECK_IGNORE label from the following tests: @@ -93,12 +76,6 @@ if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUI --timeout 5400 COMMAND ${CMAKE_COMMAND} -E cat "${CMAKE_BINARY_DIR}/Testing/Temporary/MemoryChecker.*.log" ) - - # This is needed in order to allow valgrind to properly track malloc in Python - set(TESTS_ENVIRONMENT_VARIABLES - ${TESTS_ENVIRONMENT_VARIABLES} - "PYTHONMALLOC=malloc" - ) endif() # From 0d89542ae7b7f21184b4b106887802bbbb2639e3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Dec 2024 17:57:41 +0100 Subject: [PATCH 114/487] =?UTF-8?q?Minor=20improvement=20from=20last=20com?= =?UTF-8?q?mit.=C2=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ports/rs_port/tests/metacall_test.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index 01843548f..91b852678 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -341,15 +341,15 @@ fn metacall() { let js_test_file = tests_dir.join("script.js"); let c_test_file = tests_dir.join("script.c"); let py_test_file = tests_dir.join("script.py"); + let py_loaded = loaders::from_single_file("py", py_test_file).is_ok(); - if loaders::from_single_file("py", py_test_file).is_ok() { + if py_loaded { test_buffer(); test_class(); test_object(); test_pointer(); test_array(); test_bool(); - test_function(); test_map(); test_string(); test_null(); @@ -366,5 +366,8 @@ fn metacall() { test_exception(); test_throwable(); test_future(); + if py_loaded { + test_function(); + } } } From 5cd005c69209d3b58e9063b6d9654818090082f6 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Dec 2024 19:54:11 +0100 Subject: [PATCH 115/487] Improve valgrind suppressions for rs_port. --- source/ports/rs_port/valgrind-rust.supp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/source/ports/rs_port/valgrind-rust.supp b/source/ports/rs_port/valgrind-rust.supp index ccebd61ef..dbff07045 100644 --- a/source/ports/rs_port/valgrind-rust.supp +++ b/source/ports/rs_port/valgrind-rust.supp @@ -1,3 +1,4 @@ +# Ignore Rust runtime leaks { Ignore memory leaked from lang_start_internal. Memcheck:Leak @@ -7,12 +8,6 @@ } # Ignore leaks from loaders depenecies for now, we want to debug the port only -{ - Ignore leaks from C Loader. - Memcheck:Leak - ... - obj:*/libc_loader*.so -} { Ignore leaks from C Loader depends Clang. Memcheck:Leak @@ -25,12 +20,6 @@ ... obj:*/libLLVM-*.so.* } -{ - Ignore leaks from NodeJS Loader. - Memcheck:Leak - ... - obj:*/libnode_loader*.so -} { Ignore leaks from Python Loader depends CPython. Memcheck:Leak From f258548ca159828381d4ec8456adc54e0976d158 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Dec 2024 20:46:42 +0100 Subject: [PATCH 116/487] Clippy improvements to rs_port. --- source/ports/rs_port/src/helpers.rs | 8 ++--- .../ports/rs_port/src/types/metacall_error.rs | 18 ++++++----- .../rs_port/src/types/metacall_exception.rs | 31 +++++++++---------- .../rs_port/src/types/metacall_pointer.rs | 2 +- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/source/ports/rs_port/src/helpers.rs b/source/ports/rs_port/src/helpers.rs index 8dc754416..69cfb132c 100644 --- a/source/ports/rs_port/src/helpers.rs +++ b/source/ports/rs_port/src/helpers.rs @@ -89,22 +89,22 @@ where Box::<[T]>::into_raw(self.iter().cloned().collect()) as *mut () } } -impl<'c> Clone for Box<dyn MetaCallValue + 'c> { +impl Clone for Box<dyn MetaCallValue + '_> { fn clone(&self) -> Self { clone_box(&**self) } } -impl<'c> Clone for Box<dyn MetaCallValue + Send + 'c> { +impl Clone for Box<dyn MetaCallValue + Send + '_> { fn clone(&self) -> Self { clone_box(&**self) } } -impl<'c> Clone for Box<dyn MetaCallValue + Sync + 'c> { +impl Clone for Box<dyn MetaCallValue + Sync + '_> { fn clone(&self) -> Self { clone_box(&**self) } } -impl<'c> Clone for Box<dyn MetaCallValue + Send + Sync + 'c> { +impl Clone for Box<dyn MetaCallValue + Send + Sync + '_> { fn clone(&self) -> Self { clone_box(&**self) } diff --git a/source/ports/rs_port/src/types/metacall_error.rs b/source/ports/rs_port/src/types/metacall_error.rs index 51b5e6006..7c3e85484 100644 --- a/source/ports/rs_port/src/types/metacall_error.rs +++ b/source/ports/rs_port/src/types/metacall_error.rs @@ -1,5 +1,5 @@ use super::MetaCallValue; -use std::{ffi::NulError, path::PathBuf}; +use std::{ffi::NulError, fmt, path::PathBuf}; #[derive(Debug, Clone)] /// This error happens when it's not possible to initialize the MetaCall core. You can check @@ -16,9 +16,9 @@ impl Default for MetaCallInitError { MetaCallInitError::new() } } -impl ToString for MetaCallInitError { - fn to_string(&self) -> String { - String::from("Failed to initialize MetaCall!") +impl fmt::Display for MetaCallInitError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Failed to initialize MetaCall") } } @@ -38,9 +38,13 @@ impl MetaCallStringConversionError { } } } -impl ToString for MetaCallStringConversionError { - fn to_string(&self) -> String { - self.original_string.clone() +impl fmt::Display for MetaCallStringConversionError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "Failed to convert string: {}", + self.original_string.clone() + ) } } diff --git a/source/ports/rs_port/src/types/metacall_exception.rs b/source/ports/rs_port/src/types/metacall_exception.rs index 67a34e15a..56905d9e5 100644 --- a/source/ports/rs_port/src/types/metacall_exception.rs +++ b/source/ports/rs_port/src/types/metacall_exception.rs @@ -12,14 +12,19 @@ use std::{ sync::Arc, }; +unsafe impl Send for metacall_exception_type {} +unsafe impl Sync for metacall_exception_type {} + /// Represents MetaCall exception. You can create an exception with [new](#method.new). pub struct MetaCallException { exception_struct: Arc<metacall_exception_type>, leak: bool, value: *mut c_void, } + unsafe impl Send for MetaCallException {} unsafe impl Sync for MetaCallException {} + impl Clone for MetaCallException { fn clone(&self) -> Self { Self { @@ -31,11 +36,7 @@ impl Clone for MetaCallException { } impl Debug for MetaCallException { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!( - f, - "MetaCallException {}", - format!("{{ {} }}", self.to_string()) - ) + write!(f, "MetaCallException: {}", self) } } @@ -146,11 +147,7 @@ impl Clone for MetaCallThrowable { } impl Debug for MetaCallThrowable { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!( - f, - "MetaCallThrowable {}", - format!("{{ {} }}", self.to_string()) - ) + write!(f, "MetaCallThrowable: {}", self) } } @@ -205,19 +202,21 @@ impl MetaCallThrowable { } } -impl ToString for MetaCallException { - fn to_string(&self) -> String { - format!( +impl fmt::Display for MetaCallException { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, "[Exception(code: `{}`)]: {}", self.get_code(), self.get_message() ) } } -impl ToString for MetaCallThrowable { - fn to_string(&self) -> String { + +impl fmt::Display for MetaCallThrowable { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let throwable_value = self.get_value_untyped(); - format!("[Throwable]: {:#?}", throwable_value) + write!(f, "[Throwable]: {:#?}", throwable_value) } } diff --git a/source/ports/rs_port/src/types/metacall_pointer.rs b/source/ports/rs_port/src/types/metacall_pointer.rs index 802aa153a..55ccc6386 100644 --- a/source/ports/rs_port/src/types/metacall_pointer.rs +++ b/source/ports/rs_port/src/types/metacall_pointer.rs @@ -22,7 +22,7 @@ impl Clone for MetaCallPointer { fn clone(&self) -> Self { Self { leak: true, - rust_value: self.rust_value.clone(), + rust_value: self.rust_value, rust_value_leak: true, value: self.value, } From 3b9134206e7c7a99847bd286540be8c65522fae8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 13 Dec 2024 01:33:49 +0100 Subject: [PATCH 117/487] Add debugging environment for valgrind, refactored the code a bit, first attempt for MetaCallFuture, vscode debugging in process. --- source/ports/rs_port/.gitignore | 3 ++ source/ports/rs_port/.vscode/launch.json | 5 ++ source/ports/rs_port/CMakeLists.txt | 22 +++++++++ source/ports/rs_port/README.md | 2 +- source/ports/rs_port/inline/src/lib.rs | 2 +- .../ports/rs_port/src/{parsers.rs => cast.rs} | 48 +++++++++++++++++++ source/ports/rs_port/src/helpers.rs | 4 -- source/ports/rs_port/src/init.rs | 46 ++++++++++++++++++ source/ports/rs_port/src/lib.rs | 20 ++++---- .../ports/rs_port/src/{loaders.rs => load.rs} | 6 +-- source/ports/rs_port/src/metacall.rs | 8 ++-- source/ports/rs_port/src/switch.rs | 36 -------------- .../ports/rs_port/src/types/metacall_class.rs | 18 +++---- .../ports/rs_port/src/types/metacall_error.rs | 19 ++++---- .../rs_port/src/types/metacall_exception.rs | 6 +-- .../rs_port/src/types/metacall_function.rs | 10 ++-- .../rs_port/src/types/metacall_future.rs | 37 +++++++++----- .../rs_port/src/types/metacall_object.rs | 16 +++---- .../ports/rs_port/src/types/metacall_value.rs | 10 ++-- source/ports/rs_port/tests/inlines_test.rs | 19 ++++---- .../rs_port/tests/invalid_loaders_test.rs | 13 ++--- source/ports/rs_port/tests/loaders_test.rs | 13 +++-- .../rs_port/tests/metacall_exception_test.rs | 8 ++-- source/ports/rs_port/tests/metacall_test.rs | 35 +++++++++----- source/ports/rs_port/valgrind-rust.supp | 12 +++++ 25 files changed, 275 insertions(+), 143 deletions(-) rename source/ports/rs_port/src/{parsers.rs => cast.rs} (76%) create mode 100644 source/ports/rs_port/src/init.rs rename source/ports/rs_port/src/{loaders.rs => load.rs} (92%) delete mode 100644 source/ports/rs_port/src/switch.rs diff --git a/source/ports/rs_port/.gitignore b/source/ports/rs_port/.gitignore index b073af27e..2545ccd0a 100644 --- a/source/ports/rs_port/.gitignore +++ b/source/ports/rs_port/.gitignore @@ -19,3 +19,6 @@ include/ # Not ignore .vscode !.vscode + +# Ignore .env file autogenerated by CMake +.vscode/.env diff --git a/source/ports/rs_port/.vscode/launch.json b/source/ports/rs_port/.vscode/launch.json index cf34a1c92..684cfc347 100644 --- a/source/ports/rs_port/.vscode/launch.json +++ b/source/ports/rs_port/.vscode/launch.json @@ -21,6 +21,7 @@ } }, "args": [], + "envFile": "${workspaceFolder}${/}.vscode${/}.env", "cwd": "${workspaceFolder}" }, { @@ -40,6 +41,7 @@ } }, "args": [], + "envFile": "${workspaceFolder}${/}.vscode${/}.env", "cwd": "${workspaceFolder}" }, { @@ -59,6 +61,7 @@ } }, "args": [], + "envFile": "${workspaceFolder}${/}.vscode${/}.env", "cwd": "${workspaceFolder}" }, { @@ -78,6 +81,7 @@ } }, "args": [], + "envFile": "${workspaceFolder}${/}.vscode${/}.env", "cwd": "${workspaceFolder}" }, { @@ -97,6 +101,7 @@ } }, "args": [], + "envFile": "${workspaceFolder}${/}.vscode${/}.env", "cwd": "${workspaceFolder}" } ] diff --git a/source/ports/rs_port/CMakeLists.txt b/source/ports/rs_port/CMakeLists.txt index 26c7a4d71..afdc3f82b 100644 --- a/source/ports/rs_port/CMakeLists.txt +++ b/source/ports/rs_port/CMakeLists.txt @@ -178,6 +178,7 @@ project_library_path(TEST_LIB_PATH ${PROJECT_OUTPUT_DIR} ) +# Define environment variables test_environment_variables(${target} "" ${TESTS_ENVIRONMENT_VARIABLES} @@ -188,3 +189,24 @@ test_environment_variables(${target} "${SANITIZER_FLAGS}" "${CARGO_VALGRIND_FLAGS}" ) + +# Create .env file for supporting vscode debugging +set(RS_PORT_DEBUG_ENVIRONMENT_VARIABLES + "LOADER_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" + "LOADER_SCRIPT_PATH=${PROJECT_OUTPUT_DIR}/scripts" + "CONFIGURATION_PATH=${PROJECT_OUTPUT_DIR}/configurations/global.json" + "SERIAL_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" + "DETOUR_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" + "PORT_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" + "${PROJECT_LIBRARY_PATH_NAME}=${TEST_LIB_PATH}" + "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" + "PROJECT_OUTPUT_DIR=${PROJECT_OUTPUT_DIR}" +) + +set(RS_PORT_ENVIRONMENT_VARIABLES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/.vscode/.env") + +file(WRITE ${RS_PORT_ENVIRONMENT_VARIABLES_FILE} "") + +foreach(ENV_VAR IN LISTS RS_PORT_DEBUG_ENVIRONMENT_VARIABLES) + file(APPEND ${RS_PORT_ENVIRONMENT_VARIABLES_FILE} "${ENV_VAR}\n") +endforeach() diff --git a/source/ports/rs_port/README.md b/source/ports/rs_port/README.md index 298bf9ab3..06f77ab06 100644 --- a/source/ports/rs_port/README.md +++ b/source/ports/rs_port/README.md @@ -33,7 +33,7 @@ fn main() { let _metacall = switch::initialize().unwrap(); // Load the file - loaders::from_single_file("ts", "sum.ts").unwrap(); + load::from_single_file("ts", "sum.ts").unwrap(); // Call the sum function let sum = metacall::<f64>("sum", [1.0, 2.0]).unwrap(); diff --git a/source/ports/rs_port/inline/src/lib.rs b/source/ports/rs_port/inline/src/lib.rs index 2e9fd1a5e..bb9358d5a 100644 --- a/source/ports/rs_port/inline/src/lib.rs +++ b/source/ports/rs_port/inline/src/lib.rs @@ -10,7 +10,7 @@ macro_rules! gen_inline_macro { let buffer = token_stream_input.to_string(); let result = quote! {{ - ::metacall::loaders::from_memory(stringify!($name), #buffer.to_string()).unwrap() + ::metacall::load::from_memory(stringify!($name), #buffer.to_string()).unwrap() }}; result.into() diff --git a/source/ports/rs_port/src/parsers.rs b/source/ports/rs_port/src/cast.rs similarity index 76% rename from source/ports/rs_port/src/parsers.rs rename to source/ports/rs_port/src/cast.rs index 4a711d1fa..51574fdf1 100644 --- a/source/ports/rs_port/src/parsers.rs +++ b/source/ports/rs_port/src/cast.rs @@ -190,3 +190,51 @@ pub fn metacallobj_to_raw_args( .map(|arg| arg.into_metacall_raw()) .collect::<Vec<*mut c_void>>() } + +pub fn metacallobj_untyped_to_raw(ret: Box<dyn MetaCallValue>) -> Option<*mut c_void> { + if let Some(v) = ret.downcast_ref::<bool>() { + return Some(v.into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<char>() { + return Some(v.into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<i16>() { + return Some(v.into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<i32>() { + return Some(v.into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<i64>() { + return Some(v.into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<f32>() { + return Some(v.into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<f64>() { + return Some(v.into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<String>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<Vec<i8>>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<Vec<MetaCallNull>>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<HashMap<String, MetaCallNull>>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<MetaCallPointer>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<MetaCallFuture>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<MetaCallFunction>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<MetaCallNull>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<MetaCallClass>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<MetaCallObject>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<MetaCallException>() { + return Some(v.clone().into_metacall_raw()); + } else if let Some(v) = ret.downcast_ref::<MetaCallThrowable>() { + return Some(v.clone().into_metacall_raw()); + } + + None +} + +pub fn metacall_implementer_to_traitobj(v: impl MetaCallValue) -> Box<dyn MetaCallValue> { + Box::new(v) as Box<dyn MetaCallValue> +} diff --git a/source/ports/rs_port/src/helpers.rs b/source/ports/rs_port/src/helpers.rs index 69cfb132c..3e435b2e2 100644 --- a/source/ports/rs_port/src/helpers.rs +++ b/source/ports/rs_port/src/helpers.rs @@ -109,7 +109,3 @@ impl Clone for Box<dyn MetaCallValue + Send + Sync + '_> { clone_box(&**self) } } - -pub fn metacall_implementer_to_traitobj(v: impl MetaCallValue) -> Box<dyn MetaCallValue> { - Box::new(v) as Box<dyn MetaCallValue> -} diff --git a/source/ports/rs_port/src/init.rs b/source/ports/rs_port/src/init.rs new file mode 100644 index 000000000..da09899a2 --- /dev/null +++ b/source/ports/rs_port/src/init.rs @@ -0,0 +1,46 @@ +use crate::{ + bindings::{metacall_destroy, metacall_initialize, metacall_is_initialized}, + types::MetaCallInitError, +}; +use std::{ffi::c_int, ptr}; + +pub struct MetaCallDestroy(unsafe extern "C" fn() -> c_int); + +impl Drop for MetaCallDestroy { + fn drop(&mut self) { + let code = unsafe { self.0() }; + + if code != 0 { + panic!("MetaCall failed to destroy with code: {}", code) + } + } +} + +/// Initializes MetaCall. Always remember to store the output in a variable to avoid instant drop. +/// For example: ... +/// ``` +/// // Initialize metacall at the top of your main function before loading your codes or +/// // calling any function. +/// let _metacall = metacall::initialize().unwrap(); +/// +/// +/// ``` +pub fn initialize() -> Result<MetaCallDestroy, MetaCallInitError> { + let code = unsafe { metacall_initialize() }; + + if code != 0 { + return Err(MetaCallInitError::new(code)); + } + + Ok(MetaCallDestroy(metacall_destroy)) +} + +pub fn is_initialized() -> bool { + let initialized = unsafe { metacall_is_initialized(ptr::null_mut()) }; + + if initialized == 0 { + return true; + } + + false +} diff --git a/source/ports/rs_port/src/lib.rs b/source/ports/rs_port/src/lib.rs index 796d89b2e..0f1f282a0 100644 --- a/source/ports/rs_port/src/lib.rs +++ b/source/ports/rs_port/src/lib.rs @@ -49,7 +49,7 @@ //! //! // Load the file (Checkout the loaders module for loading multiple files //! // or loading from string) -//! loaders::from_single_file("ts", "sum.ts").unwrap(); +//! load::from_single_file("ts", "sum.ts").unwrap(); //! //! // Call the sum function (Also checkout other metacall functions) //! let sum = metacall::<f64>("sum", [1.0, 2.0]).unwrap(); @@ -59,34 +59,38 @@ //! //! ``` +pub(crate) mod cast; pub(crate) mod helpers; -pub(crate) mod parsers; pub(crate) use macros::private_macros::*; /// Contains MetaCall loaders from file and memory. Usage example: ... /// ``` /// // Loading a single file with Nodejs. -/// metacall::loaders::from_single_file("node", "index.js").unwrap(); +/// metacall::load::from_single_file("node", "index.js").unwrap(); /// /// // Loading multiple files with Nodejs. -/// metacall::loaders::from_file("node", ["index.js", "main.js"]).unwrap(); +/// metacall::load::from_file("node", ["index.js", "main.js"]).unwrap(); /// /// // Loading a string with Nodejs. /// let script = "function greet() { return 'hi there!' }; module.exports = { greet };"; -/// metacall::loaders::from_memory("node", script).unwrap(); +/// metacall::load::from_memory("node", script).unwrap(); /// ``` -pub mod loaders; +pub mod load; mod types; -pub use switch::initialize; #[doc(hidden)] pub mod macros; #[doc(hidden)] -pub mod switch; pub use types::*; +#[doc(hidden)] +mod init; + +pub use init::initialize; +pub use init::is_initialized; + #[path = "metacall.rs"] mod metacall_mod; pub use metacall_mod::*; diff --git a/source/ports/rs_port/src/loaders.rs b/source/ports/rs_port/src/load.rs similarity index 92% rename from source/ports/rs_port/src/loaders.rs rename to source/ports/rs_port/src/load.rs index bf5f4fb11..4c9f8cc55 100644 --- a/source/ports/rs_port/src/loaders.rs +++ b/source/ports/rs_port/src/load.rs @@ -12,7 +12,7 @@ use std::{ /// Loads a script from a single file. Usage example: ... /// ``` /// // A Nodejs script -/// metacall::loaders::from_single_file("node", "index.js").unwrap(); +/// metacall::load::from_single_file("node", "index.js").unwrap(); /// ``` pub fn from_single_file( tag: impl ToString, @@ -23,7 +23,7 @@ pub fn from_single_file( /// Loads a script from file. Usage example: ... /// ``` /// // A Nodejs script -/// metacall::loaders::from_file("node", ["index.js", "main.js"]).unwrap(); +/// metacall::load::from_file("node", ["index.js", "main.js"]).unwrap(); /// ``` pub fn from_file( tag: impl ToString, @@ -71,7 +71,7 @@ pub fn from_file( /// let script = "function greet() { return 'hi there!' }; module.exports = { greet };"; /// /// // A Nodejs script -/// metacall::loaders::from_memory("node", script).unwrap(); +/// metacall::load::from_memory("node", script).unwrap(); /// ``` pub fn from_memory(tag: impl ToString, script: impl ToString) -> Result<(), MetaCallLoaderError> { let script = script.to_string(); diff --git a/source/ports/rs_port/src/metacall.rs b/source/ports/rs_port/src/metacall.rs index b05c8f851..f6e75c307 100644 --- a/source/ports/rs_port/src/metacall.rs +++ b/source/ports/rs_port/src/metacall.rs @@ -1,6 +1,6 @@ use crate::{ bindings::{metacall_function, metacall_value_destroy, metacallfv_s}, - cstring_enum, parsers, + cast, cstring_enum, types::{MetaCallError, MetaCallNull, MetaCallValue}, }; use std::ffi::c_void; @@ -20,7 +20,7 @@ fn metacall_inner( return Err(MetaCallError::FunctionNotFound); } - let mut c_args = parsers::metacallobj_to_raw_args(args); + let mut c_args = cast::metacallobj_to_raw_args(args); let args_length = c_args.len(); let ret = unsafe { metacallfv_s(c_func, c_args.as_mut_ptr(), args_length) }; @@ -42,7 +42,7 @@ pub fn metacall_untyped( func: impl ToString, args: impl IntoIterator<Item = impl MetaCallValue>, ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { - Ok(parsers::raw_to_metacallobj_untyped(metacall_inner( + Ok(cast::raw_to_metacallobj_untyped(metacall_inner( func, args, )?)) } @@ -65,7 +65,7 @@ pub fn metacall<T: MetaCallValue>( func: impl ToString, args: impl IntoIterator<Item = impl MetaCallValue>, ) -> Result<T, MetaCallError> { - match parsers::raw_to_metacallobj::<T>(metacall_inner(func, args)?) { + match cast::raw_to_metacallobj::<T>(metacall_inner(func, args)?) { Ok(ret) => Ok(ret), Err(original) => Err(MetaCallError::FailedCasting(original)), } diff --git a/source/ports/rs_port/src/switch.rs b/source/ports/rs_port/src/switch.rs deleted file mode 100644 index d249a35c8..000000000 --- a/source/ports/rs_port/src/switch.rs +++ /dev/null @@ -1,36 +0,0 @@ -use crate::{ - bindings::{metacall_destroy, metacall_initialize}, - types::MetaCallInitError, -}; -use std::ffi::c_int; - -pub fn destroy_manually() -> c_int { - unsafe { metacall_destroy() } -} -pub fn initialize_manually() -> c_int { - unsafe { metacall_initialize() } -} - -pub struct MetaCallAutoDestroy(pub fn() -> c_int); -impl Drop for MetaCallAutoDestroy { - fn drop(&mut self) { - self.0(); - } -} - -/// Initializes MetaCall. Always remember to store the output in a variable to avoid instant drop. -/// For example: ... -/// ``` -/// // Initialize metacall at the top of your main function before loading your codes or -/// // calling any function. -/// let _metacall = metacall::initialize().unwrap(); -/// -/// -/// ``` -pub fn initialize() -> Result<MetaCallAutoDestroy, MetaCallInitError> { - if initialize_manually() != 0 { - return Err(MetaCallInitError::new()); - } - - Ok(MetaCallAutoDestroy(destroy_manually)) -} diff --git a/source/ports/rs_port/src/types/metacall_class.rs b/source/ports/rs_port/src/types/metacall_class.rs index 4f50faceb..ad421d5d7 100644 --- a/source/ports/rs_port/src/types/metacall_class.rs +++ b/source/ports/rs_port/src/types/metacall_class.rs @@ -2,7 +2,7 @@ use super::{ MetaCallClassFromNameError, MetaCallError, MetaCallGetAttributeError, MetaCallNull, MetaCallObject, MetaCallSetAttributeError, MetaCallStringConversionError, MetaCallValue, }; -use crate::{bindings::*, cstring, cstring_enum, parsers}; +use crate::{bindings::*, cast, cstring, cstring_enum}; use std::{ ffi::c_void, fmt::{self, Debug, Formatter}, @@ -82,7 +82,7 @@ impl MetaCallClass { constructor_args: impl IntoIterator<Item = T>, ) -> Result<MetaCallObject, MetaCallStringConversionError> { let c_name = cstring!(name)?; - let mut c_args = parsers::metacallobj_to_raw_args(constructor_args); + let mut c_args = cast::metacallobj_to_raw_args(constructor_args); let obj = unsafe { metacall_class_new( self.value_to_class(), @@ -119,7 +119,7 @@ impl MetaCallClass { &self, name: impl ToString, ) -> Result<Box<dyn MetaCallValue>, MetaCallGetAttributeError> { - Ok(parsers::raw_to_metacallobj_untyped( + Ok(cast::raw_to_metacallobj_untyped( self.get_attribute_inner(name)?, )) } @@ -128,7 +128,7 @@ impl MetaCallClass { &self, name: impl ToString, ) -> Result<T, MetaCallGetAttributeError> { - match parsers::raw_to_metacallobj::<T>(self.get_attribute_inner(name)?) { + match cast::raw_to_metacallobj::<T>(self.get_attribute_inner(name)?) { Ok(ret) => Ok(ret), Err(original) => Err(MetaCallGetAttributeError::FailedCasting(original)), } @@ -142,7 +142,7 @@ impl MetaCallClass { ) -> Result<(), MetaCallSetAttributeError> { let c_key = cstring_enum!(key, MetaCallSetAttributeError)?; - let c_arg = parsers::metacallobj_to_raw(value); + let c_arg = cast::metacallobj_to_raw(value); if unsafe { metacall_class_static_set(self.value_to_class(), c_key.as_ptr(), c_arg) } != 0 { return Err(MetaCallSetAttributeError::SetAttributeFailure); } @@ -158,7 +158,7 @@ impl MetaCallClass { args: impl IntoIterator<Item = T>, ) -> Result<*mut c_void, MetaCallError> { let c_key = cstring_enum!(name, MetaCallError)?; - let mut c_args = parsers::metacallobj_to_raw_args(args); + let mut c_args = cast::metacallobj_to_raw_args(args); let ret = unsafe { metacallv_class( self.value_to_class(), @@ -180,7 +180,7 @@ impl MetaCallClass { name: impl ToString, args: impl IntoIterator<Item = T>, ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { - Ok(parsers::raw_to_metacallobj_untyped( + Ok(cast::raw_to_metacallobj_untyped( self.call_method_inner::<T>(name, args)?, )) } @@ -190,7 +190,7 @@ impl MetaCallClass { &self, name: impl ToString, ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { - Ok(parsers::raw_to_metacallobj_untyped( + Ok(cast::raw_to_metacallobj_untyped( self.call_method_inner::<T>(name, [])?, )) } @@ -200,7 +200,7 @@ impl MetaCallClass { name: impl ToString, args: impl IntoIterator<Item = U>, ) -> Result<T, MetaCallError> { - match parsers::raw_to_metacallobj::<T>(self.call_method_inner::<U>(name, args)?) { + match cast::raw_to_metacallobj::<T>(self.call_method_inner::<U>(name, args)?) { Ok(ret) => Ok(ret), Err(original) => Err(MetaCallError::FailedCasting(original)), } diff --git a/source/ports/rs_port/src/types/metacall_error.rs b/source/ports/rs_port/src/types/metacall_error.rs index 7c3e85484..7b03ef80a 100644 --- a/source/ports/rs_port/src/types/metacall_error.rs +++ b/source/ports/rs_port/src/types/metacall_error.rs @@ -1,24 +1,23 @@ use super::MetaCallValue; -use std::{ffi::NulError, fmt, path::PathBuf}; +use std::{ + ffi::{c_int, NulError}, + fmt, + path::PathBuf, +}; #[derive(Debug, Clone)] /// This error happens when it's not possible to initialize the MetaCall core. You can check /// your logs for more information. -pub struct MetaCallInitError; +pub struct MetaCallInitError(c_int); impl MetaCallInitError { #[doc(hidden)] - pub fn new() -> Self { - Self - } -} -impl Default for MetaCallInitError { - fn default() -> Self { - MetaCallInitError::new() + pub fn new(code: c_int) -> Self { + Self(code) } } impl fmt::Display for MetaCallInitError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Failed to initialize MetaCall") + write!(f, "Failed to initialize MetaCall with code: {}", self.0) } } diff --git a/source/ports/rs_port/src/types/metacall_exception.rs b/source/ports/rs_port/src/types/metacall_exception.rs index 56905d9e5..c3bf662cc 100644 --- a/source/ports/rs_port/src/types/metacall_exception.rs +++ b/source/ports/rs_port/src/types/metacall_exception.rs @@ -4,7 +4,7 @@ use crate::{ metacall_exception_type, metacall_throwable_value, metacall_value_create_exception, metacall_value_destroy, metacall_value_to_exception, metacall_value_to_throwable, }, - cstring, helpers, parsers, + cast, cstring, }; use std::{ ffi::{c_char, c_void, CStr}, @@ -176,11 +176,11 @@ impl MetaCallThrowable { /// Gets the throwable value without type casting([MetaCallValue](MetaCallValue)). pub fn get_value_untyped(&self) -> Box<dyn MetaCallValue> { - match parsers::raw_to_metacallobj::<MetaCallException>(self.value) { + match cast::raw_to_metacallobj::<MetaCallException>(self.value) { Ok(mut value) => { value.leak = true; - helpers::metacall_implementer_to_traitobj(value) + cast::metacall_implementer_to_traitobj(value) } Err(original) => original, } diff --git a/source/ports/rs_port/src/types/metacall_function.rs b/source/ports/rs_port/src/types/metacall_function.rs index 4d5154e8c..9f74d6941 100644 --- a/source/ports/rs_port/src/types/metacall_function.rs +++ b/source/ports/rs_port/src/types/metacall_function.rs @@ -1,7 +1,7 @@ use super::{MetaCallError, MetaCallNull, MetaCallValue}; use crate::{ bindings::{metacall_value_destroy, metacall_value_to_function, metacallfv_s}, - parsers, + cast, }; use std::{ ffi::c_void, @@ -45,7 +45,7 @@ impl MetaCallFunction { } fn call_inner<T: MetaCallValue>(&self, args: impl IntoIterator<Item = T>) -> *mut c_void { - let mut c_args = parsers::metacallobj_to_raw_args(args); + let mut c_args = cast::metacallobj_to_raw_args(args); let ret: *mut c_void = unsafe { metacallfv_s(self.value_to_function(), c_args.as_mut_ptr(), 0) }; @@ -60,19 +60,19 @@ impl MetaCallFunction { &self, args: impl IntoIterator<Item = T>, ) -> Box<dyn MetaCallValue> { - parsers::raw_to_metacallobj_untyped(self.call_inner(args)) + cast::raw_to_metacallobj_untyped(self.call_inner(args)) } /// Calls the function without passing arguments and witout type /// casting([MetaCallValue](MetaCallValue)). pub fn call_untyped_no_arg<T: MetaCallValue>(&self) -> Box<dyn MetaCallValue> { - parsers::raw_to_metacallobj_untyped(self.call_inner([] as [MetaCallNull; 0])) + cast::raw_to_metacallobj_untyped(self.call_inner([] as [MetaCallNull; 0])) } /// Calls the function with arguments. pub fn call<T: MetaCallValue, U: MetaCallValue>( &self, args: impl IntoIterator<Item = U>, ) -> Result<T, MetaCallError> { - match parsers::raw_to_metacallobj::<T>(self.call_inner(args)) { + match cast::raw_to_metacallobj::<T>(self.call_inner(args)) { Ok(ret) => Ok(ret), Err(original) => Err(MetaCallError::FailedCasting(original)), } diff --git a/source/ports/rs_port/src/types/metacall_future.rs b/source/ports/rs_port/src/types/metacall_future.rs index 23556c613..4ac814034 100644 --- a/source/ports/rs_port/src/types/metacall_future.rs +++ b/source/ports/rs_port/src/types/metacall_future.rs @@ -1,19 +1,24 @@ +use self::cast::metacallobj_untyped_to_raw; + use super::{MetaCallNull, MetaCallValue}; use crate::{ - bindings::{metacall_await_future, metacall_value_destroy, metacall_value_to_future}, - helpers, parsers, + bindings::{ + metacall_await_future, metacall_value_create_null, metacall_value_destroy, + metacall_value_to_future, + }, + cast, }; use std::{ + any::Any, ffi::c_void, fmt::{self, Debug, Formatter}, - ptr, }; /// Function pointer type used for resolving/rejecting MetaCall futures. The first argument is the result /// and the second argument is the data that you may want to access when the function gets called. /// Checkout [MetaCallFuture resolve](MetaCallFuture#method.then) or /// [MetaCallFuture reject](MetaCallFuture#method.catch) for usage. -pub type MetaCallFutureHandler = fn(Box<dyn MetaCallValue>, Box<dyn MetaCallValue>); +pub type MetaCallFutureHandler = fn(Box<dyn MetaCallValue>, Box<dyn Any>) -> Box<dyn MetaCallValue>; /// Represents MetaCallFuture. Keep in mind that it's not supported to pass a future as an argument. /// @@ -107,35 +112,43 @@ type MetaCallFutureFFIData = ( // Reject Option<MetaCallFutureHandler>, // User data - *mut dyn MetaCallValue, + *mut dyn Any, ); unsafe extern "C" fn resolver(resolve_data: *mut c_void, upper_data: *mut c_void) -> *mut c_void { let (resolve, _, data) = *Box::from_raw(upper_data as *mut MetaCallFutureFFIData); let user_data = Box::from_raw(data); - (resolve.unwrap())( - parsers::raw_to_metacallobj_untyped_leak(resolve_data), + let result = (resolve.unwrap())( + cast::raw_to_metacallobj_untyped_leak(resolve_data), user_data, ); - ptr::null_mut() + if let Some(ret) = metacallobj_untyped_to_raw(result) { + return ret; + } + + unsafe { metacall_value_create_null() } } unsafe extern "C" fn rejecter(reject_data: *mut c_void, upper_data: *mut c_void) -> *mut c_void { let (_, reject, data) = *Box::from_raw(upper_data as *mut MetaCallFutureFFIData); let user_data = Box::from_raw(data); - (reject.unwrap())( - parsers::raw_to_metacallobj_untyped_leak(reject_data), + let result = (reject.unwrap())( + cast::raw_to_metacallobj_untyped_leak(reject_data), user_data, ); - ptr::null_mut() + if let Some(ret) = metacallobj_untyped_to_raw(result) { + return ret; + } + + unsafe { metacall_value_create_null() } } impl MetaCallFuture { fn create_null_data() -> *mut dyn MetaCallValue { - Box::into_raw(helpers::metacall_implementer_to_traitobj(MetaCallNull())) + Box::into_raw(cast::metacall_implementer_to_traitobj(MetaCallNull())) } #[doc(hidden)] diff --git a/source/ports/rs_port/src/types/metacall_object.rs b/source/ports/rs_port/src/types/metacall_object.rs index 6ae3d9892..54683bdda 100644 --- a/source/ports/rs_port/src/types/metacall_object.rs +++ b/source/ports/rs_port/src/types/metacall_object.rs @@ -7,7 +7,7 @@ use crate::{ metacall_object_get, metacall_object_set, metacall_value_destroy, metacall_value_to_object, metacallv_object, }, - cstring_enum, parsers, + cast, cstring_enum, }; use std::{ ffi::c_void, @@ -64,7 +64,7 @@ impl MetaCallObject { &self, name: impl ToString, ) -> Result<Box<dyn MetaCallValue>, MetaCallGetAttributeError> { - Ok(parsers::raw_to_metacallobj_untyped( + Ok(cast::raw_to_metacallobj_untyped( self.get_attribute_inner(name)?, )) } @@ -73,7 +73,7 @@ impl MetaCallObject { &self, name: impl ToString, ) -> Result<T, MetaCallGetAttributeError> { - match parsers::raw_to_metacallobj::<T>(self.get_attribute_inner(name)?) { + match cast::raw_to_metacallobj::<T>(self.get_attribute_inner(name)?) { Ok(ret) => Ok(ret), Err(original) => Err(MetaCallGetAttributeError::FailedCasting(original)), } @@ -86,7 +86,7 @@ impl MetaCallObject { value: impl MetaCallValue, ) -> Result<(), MetaCallSetAttributeError> { let c_key = cstring_enum!(key, MetaCallSetAttributeError)?; - let c_arg = parsers::metacallobj_to_raw(value); + let c_arg = cast::metacallobj_to_raw(value); if unsafe { metacall_object_set(metacall_value_to_object(self.value), c_key.as_ptr(), c_arg) } != 0 @@ -105,7 +105,7 @@ impl MetaCallObject { args: impl IntoIterator<Item = T>, ) -> Result<*mut c_void, MetaCallError> { let c_key = cstring_enum!(key, MetaCallError)?; - let mut c_args = parsers::metacallobj_to_raw_args(args); + let mut c_args = cast::metacallobj_to_raw_args(args); let ret = unsafe { metacallv_object( metacall_value_to_object(self.value), @@ -127,7 +127,7 @@ impl MetaCallObject { key: impl ToString, args: impl IntoIterator<Item = T>, ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { - Ok(parsers::raw_to_metacallobj_untyped( + Ok(cast::raw_to_metacallobj_untyped( self.call_method_inner::<T>(key, args)?, )) } @@ -137,7 +137,7 @@ impl MetaCallObject { &self, key: impl ToString, ) -> Result<Box<dyn MetaCallValue>, MetaCallError> { - Ok(parsers::raw_to_metacallobj_untyped( + Ok(cast::raw_to_metacallobj_untyped( self.call_method_inner::<T>(key, [])?, )) } @@ -147,7 +147,7 @@ impl MetaCallObject { key: impl ToString, args: impl IntoIterator<Item = U>, ) -> Result<T, MetaCallError> { - match parsers::raw_to_metacallobj::<T>(self.call_method_inner::<U>(key, args)?) { + match cast::raw_to_metacallobj::<T>(self.call_method_inner::<U>(key, args)?) { Ok(ret) => Ok(ret), Err(original) => Err(MetaCallError::FailedCasting(original)), } diff --git a/source/ports/rs_port/src/types/metacall_value.rs b/source/ports/rs_port/src/types/metacall_value.rs index e6b914a50..97a669567 100644 --- a/source/ports/rs_port/src/types/metacall_value.rs +++ b/source/ports/rs_port/src/types/metacall_value.rs @@ -4,9 +4,9 @@ use super::{ }; use crate::{ bindings::*, - cstring, + cast, cstring, helpers::{MetaCallClone, MetaCallDowncast}, - match_metacall_value, parsers, + match_metacall_value, }; use std::{ collections::HashMap, @@ -240,7 +240,7 @@ impl<T: MetaCallValue + Clone> MetaCallValue for Vec<T> { let count = unsafe { metacall_value_count(v) }; let vec = unsafe { slice::from_raw_parts(metacall_value_to_array(v), count) } .iter() - .map(|element| parsers::raw_to_metacallobj_leak(*element)) + .map(|element| cast::raw_to_metacallobj_leak(*element)) .collect::<Result<Vec<T>, Box<dyn MetaCallValue>>>()?; Ok(vec) @@ -266,7 +266,7 @@ impl<T: MetaCallValue + Clone> MetaCallValue for HashMap<String, T> { slice::from_raw_parts(metacall_value_to_map(v), metacall_value_count(v)).iter() { let m_pair = slice::from_raw_parts(metacall_value_to_array(*map_value), 2); - let key = match_metacall_value!(parsers::raw_to_metacallobj_untyped_leak(m_pair[0]), { + let key = match_metacall_value!(cast::raw_to_metacallobj_untyped_leak(m_pair[0]), { str: String => str, num: i16 => num.to_string(), num: i32 => num.to_string(), @@ -275,7 +275,7 @@ impl<T: MetaCallValue + Clone> MetaCallValue for HashMap<String, T> { num: f64 => num.to_string(), _ => String::from("Invalid key!") }); - let val = match parsers::raw_to_metacallobj_leak::<T>(m_pair[1]) { + let val = match cast::raw_to_metacallobj_leak::<T>(m_pair[1]) { Ok(parsed) => parsed, Err(original) => { return Err(original); diff --git a/source/ports/rs_port/tests/inlines_test.rs b/source/ports/rs_port/tests/inlines_test.rs index fe7c9cb15..ff5f48308 100644 --- a/source/ports/rs_port/tests/inlines_test.rs +++ b/source/ports/rs_port/tests/inlines_test.rs @@ -1,36 +1,39 @@ use metacall::{ + initialize, inline::{node, py, ts}, - loaders, switch, + is_initialized, load, }; #[test] fn inlines() { - let _d = switch::initialize().unwrap(); + let _d = initialize().unwrap(); - if loaders::from_memory("py", "").is_ok() { + assert!(is_initialized()); + + if load::from_memory("py", "").is_ok() { py! { print("hello world") } } - if loaders::from_memory("py", "").is_ok() { + if load::from_memory("py", "").is_ok() { py! {print("hello world")} } - if loaders::from_memory("node", "").is_ok() { + if load::from_memory("node", "").is_ok() { node! { console.log("hello world"); } } - if loaders::from_memory("node", "").is_ok() { + if load::from_memory("node", "").is_ok() { node! {console.log("hello world")} } - if loaders::from_memory("ts", "").is_ok() { + if load::from_memory("ts", "").is_ok() { ts! { console.log("hello world"); } } - if loaders::from_memory("ts", "").is_ok() { + if load::from_memory("ts", "").is_ok() { ts! {console.log("hello world")} } } diff --git a/source/ports/rs_port/tests/invalid_loaders_test.rs b/source/ports/rs_port/tests/invalid_loaders_test.rs index 80c8fc7e2..ec58d0bcb 100644 --- a/source/ports/rs_port/tests/invalid_loaders_test.rs +++ b/source/ports/rs_port/tests/invalid_loaders_test.rs @@ -1,24 +1,25 @@ -use metacall::{loaders, switch, MetaCallLoaderError}; +use metacall::{initialize, is_initialized, load, MetaCallLoaderError}; use std::env; #[test] fn invalid_loaders() { - let _d = switch::initialize().unwrap(); + let _d = initialize().unwrap(); + + assert!(is_initialized()); let scripts_dir = env::current_dir().unwrap().join("tests/scripts"); let inavlid_file = scripts_dir.join("whatever.yeet"); let valid_file = scripts_dir.join("script.js"); if let Err(MetaCallLoaderError::FileNotFound(_)) = - loaders::from_single_file("random", inavlid_file) + load::from_single_file("random", inavlid_file) { // Everything Ok } else { panic!("Expected the loader fail with `FileNotFound` error variant!"); } - if let Err(MetaCallLoaderError::FromFileFailure) = - loaders::from_single_file("random", valid_file) + if let Err(MetaCallLoaderError::FromFileFailure) = load::from_single_file("random", valid_file) { // Everything Ok } else { @@ -26,7 +27,7 @@ fn invalid_loaders() { } if let Err(MetaCallLoaderError::FromMemoryFailure) = - loaders::from_memory("random", "Invalid code!") + load::from_memory("random", "Invalid code!") { // Everything Ok } else { diff --git a/source/ports/rs_port/tests/loaders_test.rs b/source/ports/rs_port/tests/loaders_test.rs index b0f65392f..c45c4c17b 100644 --- a/source/ports/rs_port/tests/loaders_test.rs +++ b/source/ports/rs_port/tests/loaders_test.rs @@ -1,4 +1,4 @@ -use metacall::{loaders, metacall_no_arg, switch}; +use metacall::{initialize, is_initialized, load, metacall_no_arg}; use std::{ env, fs::{self, File}, @@ -17,10 +17,10 @@ fn call_greet(test: &str, num: u32) { } fn load_from_memory_test() { - loaders::from_memory("node", SCRIPT1).unwrap(); + load::from_memory("node", SCRIPT1).unwrap(); call_greet("load_from_memory", 1); - loaders::from_memory("node", SCRIPT3).unwrap(); + load::from_memory("node", SCRIPT3).unwrap(); } fn load_from_file_test() { @@ -34,7 +34,7 @@ fn load_from_file_test() { temp_js.write_all(SCRIPT2.as_bytes()).unwrap(); temp_js.flush().unwrap(); - loaders::from_single_file("node", temp_js_path).unwrap(); + load::from_single_file("node", temp_js_path).unwrap(); call_greet("load_from_file", 2); @@ -44,7 +44,10 @@ fn load_from_file_test() { #[test] fn loaders() { - let _d = switch::initialize().unwrap(); + let _d = initialize().unwrap(); + + assert!(is_initialized()); + // Testing load_from_memory load_from_memory_test(); diff --git a/source/ports/rs_port/tests/metacall_exception_test.rs b/source/ports/rs_port/tests/metacall_exception_test.rs index 975ec96fe..780aba056 100644 --- a/source/ports/rs_port/tests/metacall_exception_test.rs +++ b/source/ports/rs_port/tests/metacall_exception_test.rs @@ -1,14 +1,16 @@ -use metacall::{loaders, switch}; +use metacall::{initialize, is_initialized, load}; use std::env; #[test] fn inlines() { - let _d = switch::initialize().unwrap(); + let _d = initialize().unwrap(); + + assert!(is_initialized()); let tests_dir = env::current_dir().unwrap().join("tests/scripts"); let js_test_file = tests_dir.join("script.js"); - if loaders::from_single_file("node", js_test_file).is_ok() { + if load::from_single_file("node", js_test_file).is_ok() { // This should not generate a segmentation fault let val = metacall::metacall_no_arg::<metacall::MetaCallException>("test_exception").unwrap(); diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index 91b852678..dddb2440d 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -1,8 +1,9 @@ use metacall::{ - loaders, switch, MetaCallClass, MetaCallException, MetaCallFunction, MetaCallFuture, - MetaCallNull, MetaCallObject, MetaCallPointer, MetaCallThrowable, MetaCallValue, + initialize, is_initialized, load, MetaCallClass, MetaCallException, MetaCallFunction, + MetaCallFuture, MetaCallNull, MetaCallObject, MetaCallPointer, MetaCallThrowable, + MetaCallValue, }; -use std::{collections::HashMap, env, fmt::Debug}; +use std::{any::Any, collections::HashMap, env, fmt::Debug}; fn generate_test<T: MetaCallValue + PartialEq + Debug + Clone>( name: impl ToString, @@ -154,7 +155,7 @@ fn test_pointer() { ); } fn test_future() { - fn validate(upper_result: Box<dyn MetaCallValue>, upper_data: Box<dyn MetaCallValue>) { + fn validate(upper_result: Box<dyn MetaCallValue>, upper_data: Box<dyn Any>) { match upper_data.downcast::<String>() { Ok(ret) => { if ret.as_str() != "data" { @@ -183,8 +184,12 @@ fn test_future() { "future", MetaCallNull(), move |future| { - fn resolve(result: Box<dyn MetaCallValue>, data: Box<dyn MetaCallValue>) { - validate(result, data); + fn resolve( + result: Box<dyn MetaCallValue>, + data: Box<dyn Any>, + ) -> Box<dyn MetaCallValue> { + validate(result.clone(), data); + result.clone() } future.then(resolve).data(String::from("data")).await_fut(); @@ -195,8 +200,12 @@ fn test_future() { "future", MetaCallNull(), move |future| { - fn reject(result: Box<dyn MetaCallValue>, data: Box<dyn MetaCallValue>) { - validate(result, data); + fn reject( + result: Box<dyn MetaCallValue>, + data: Box<dyn Any>, + ) -> Box<dyn MetaCallValue> { + validate(result.clone(), data); + result.clone() } future.catch(reject).data(String::from("data")).await_fut(); @@ -335,13 +344,15 @@ fn test_throwable() { #[test] fn metacall() { - let _d = switch::initialize().unwrap(); + let _d = initialize().unwrap(); + + assert!(is_initialized()); let tests_dir = env::current_dir().unwrap().join("tests/scripts"); let js_test_file = tests_dir.join("script.js"); let c_test_file = tests_dir.join("script.c"); let py_test_file = tests_dir.join("script.py"); - let py_loaded = loaders::from_single_file("py", py_test_file).is_ok(); + let py_loaded = load::from_single_file("py", py_test_file).is_ok(); if py_loaded { test_buffer(); @@ -354,7 +365,7 @@ fn metacall() { test_string(); test_null(); } - if loaders::from_single_file("c", c_test_file).is_ok() { + if load::from_single_file("c", c_test_file).is_ok() { test_char(); test_double(); test_float(); @@ -362,7 +373,7 @@ fn metacall() { test_long(); test_short(); } - if loaders::from_single_file("node", js_test_file).is_ok() { + if load::from_single_file("node", js_test_file).is_ok() { test_exception(); test_throwable(); test_future(); diff --git a/source/ports/rs_port/valgrind-rust.supp b/source/ports/rs_port/valgrind-rust.supp index dbff07045..262760cd5 100644 --- a/source/ports/rs_port/valgrind-rust.supp +++ b/source/ports/rs_port/valgrind-rust.supp @@ -7,6 +7,18 @@ ... } +# Ignore ld leaks +{ + Ignore dynamic linker leaks. + Memcheck:Leak + ... + fun:add_dependency + fun:_dl_lookup_symbol_x + fun:_dl_fixup + fun:_dl_runtime_resolve_xsave + ... +} + # Ignore leaks from loaders depenecies for now, we want to debug the port only { Ignore leaks from C Loader depends Clang. From 269e72f441b381b9d3c63aec723aee0566454e0b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 13 Dec 2024 17:05:26 +0100 Subject: [PATCH 118/487] Solve issues with future signature. --- source/ports/rs_port/.cargo/.gitkeep | 0 source/ports/rs_port/.gitignore | 3 ++- source/ports/rs_port/CMakeLists.txt | 16 +++++++++++-- source/ports/rs_port/config.toml | 3 +++ .../rs_port/src/types/metacall_future.rs | 17 +++++--------- source/ports/rs_port/tests/metacall_test.rs | 23 +++++++++++++++++++ source/ports/rs_port/tests/scripts/script.c | 6 ++++- 7 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 source/ports/rs_port/.cargo/.gitkeep create mode 100644 source/ports/rs_port/config.toml diff --git a/source/ports/rs_port/.cargo/.gitkeep b/source/ports/rs_port/.cargo/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/source/ports/rs_port/.gitignore b/source/ports/rs_port/.gitignore index 2545ccd0a..388388c11 100644 --- a/source/ports/rs_port/.gitignore +++ b/source/ports/rs_port/.gitignore @@ -20,5 +20,6 @@ include/ # Not ignore .vscode !.vscode -# Ignore .env file autogenerated by CMake +# Ignore .env and config.toml file autogenerated by CMake .vscode/.env +.cargo/config.toml diff --git a/source/ports/rs_port/CMakeLists.txt b/source/ports/rs_port/CMakeLists.txt index afdc3f82b..536856f87 100644 --- a/source/ports/rs_port/CMakeLists.txt +++ b/source/ports/rs_port/CMakeLists.txt @@ -199,8 +199,6 @@ set(RS_PORT_DEBUG_ENVIRONMENT_VARIABLES "DETOUR_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" "PORT_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" "${PROJECT_LIBRARY_PATH_NAME}=${TEST_LIB_PATH}" - "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" - "PROJECT_OUTPUT_DIR=${PROJECT_OUTPUT_DIR}" ) set(RS_PORT_ENVIRONMENT_VARIABLES_FILE "${CMAKE_CURRENT_SOURCE_DIR}/.vscode/.env") @@ -210,3 +208,17 @@ file(WRITE ${RS_PORT_ENVIRONMENT_VARIABLES_FILE} "") foreach(ENV_VAR IN LISTS RS_PORT_DEBUG_ENVIRONMENT_VARIABLES) file(APPEND ${RS_PORT_ENVIRONMENT_VARIABLES_FILE} "${ENV_VAR}\n") endforeach() + +# Create config.toml for supporting vscode debugging +set(RS_PORT_BUILD_ENVIRONMENT_VARIABLES + "CMAKE_BUILD_TYPE = { value = \"${CMAKE_BUILD_TYPE}\", force = true }" + "PROJECT_OUTPUT_DIR = { value = \"${PROJECT_OUTPUT_DIR}\", force = true }" +) + +set(RS_PORT_CONFIG_ENV_FILE "${CMAKE_CURRENT_SOURCE_DIR}/config.toml") + +file(WRITE ${RS_PORT_CONFIG_ENV_FILE} "[env]\n") + +foreach(ENV_VAR IN LISTS RS_PORT_BUILD_ENVIRONMENT_VARIABLES) + file(APPEND ${RS_PORT_CONFIG_ENV_FILE} "${ENV_VAR}\n") +endforeach() diff --git a/source/ports/rs_port/config.toml b/source/ports/rs_port/config.toml new file mode 100644 index 000000000..f0d75af73 --- /dev/null +++ b/source/ports/rs_port/config.toml @@ -0,0 +1,3 @@ +[env] +CMAKE_BUILD_TYPE = { value = "Debug", force = true } +PROJECT_OUTPUT_DIR = { value = "/media/sf_koyanisqaatsi/metacall-core-rs-port-improved/build", force = true } diff --git a/source/ports/rs_port/src/types/metacall_future.rs b/source/ports/rs_port/src/types/metacall_future.rs index 4ac814034..de051d0d5 100644 --- a/source/ports/rs_port/src/types/metacall_future.rs +++ b/source/ports/rs_port/src/types/metacall_future.rs @@ -12,6 +12,7 @@ use std::{ any::Any, ffi::c_void, fmt::{self, Debug, Formatter}, + ptr::null_mut, }; /// Function pointer type used for resolving/rejecting MetaCall futures. The first argument is the result @@ -58,7 +59,7 @@ pub type MetaCallFutureHandler = fn(Box<dyn MetaCallValue>, Box<dyn Any>) -> Box /// ``` #[repr(C)] pub struct MetaCallFuture { - data: *mut dyn MetaCallValue, + data: *mut dyn Any, leak: bool, reject: Option<MetaCallFutureHandler>, resolve: Option<MetaCallFutureHandler>, @@ -147,14 +148,10 @@ unsafe extern "C" fn rejecter(reject_data: *mut c_void, upper_data: *mut c_void) } impl MetaCallFuture { - fn create_null_data() -> *mut dyn MetaCallValue { - Box::into_raw(cast::metacall_implementer_to_traitobj(MetaCallNull())) - } - #[doc(hidden)] pub fn new_raw(value: *mut c_void) -> Self { Self { - data: Self::create_null_data(), + data: null_mut::<()>(), leak: false, reject: None, resolve: None, @@ -165,7 +162,7 @@ impl MetaCallFuture { #[doc(hidden)] pub fn new_raw_leak(value: *mut c_void) -> Self { Self { - data: Self::create_null_data(), + data: null_mut::<()>(), leak: true, reject: None, resolve: None, @@ -256,10 +253,8 @@ impl MetaCallFuture { /// future.then(resolve).catch(reject),data(x).await_fut(); /// } /// ``` - pub fn data(mut self, data: impl MetaCallValue) -> Self { - unsafe { drop(Box::from_raw(self.data)) }; - - self.data = Box::into_raw(Box::new(data) as Box<dyn MetaCallValue>); + pub fn data<T: 'static>(mut self, data: T) -> Self { + self.data = Box::into_raw(Box::new(data)); self } diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index dddb2440d..ad6389262 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -81,6 +81,27 @@ fn test_float() { fn test_double() { generate_test::<f64>("test_double", 1.2345_f64); } +// TODO +// fn test_mixed_numbers() { +// let result = ::metacall::metacall::<i64>( +// "test_mixed_numbers", +// [ +// Box::new(1 as i16) as Box<dyn MetaCallValue>, +// Box::new(2 as i32) as Box<dyn MetaCallValue>, +// Box::new(3 as i64) as Box<dyn MetaCallValue>, +// ], +// ); + +// // TODO +// // ::metacall::metacall::<i64>("test_mixed_numbers", [1_i16, 2_i32, 3_i64]); +// // ::metacall::metacall::<i64>("test_mixed_numbers", (1_i16, 2_i32, 3_i64)); + +// assert!(result.is_ok()); + +// if let Ok(ret) = result { +// assert_eq!(ret, 6_i64) +// } +// } fn test_string() { generate_test::<String>( "return_the_argument_py", @@ -372,6 +393,8 @@ fn metacall() { test_int(); test_long(); test_short(); + // TODO + // test_mixed_numbers(); } if load::from_single_file("node", js_test_file).is_ok() { test_exception(); diff --git a/source/ports/rs_port/tests/scripts/script.c b/source/ports/rs_port/tests/scripts/script.c index 9d7a2391e..f7968479a 100644 --- a/source/ports/rs_port/tests/scripts/script.c +++ b/source/ports/rs_port/tests/scripts/script.c @@ -21,4 +21,8 @@ float test_float(float num) double test_double(double num) { return num; -} \ No newline at end of file +} +long test_mixed_numbers(short s, int i, long l) +{ + return l + (long)i + (long)s; +} From 7c68c5495fffb3857737d80fa0522a8b8d63c5c4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 14 Dec 2024 10:38:18 +0100 Subject: [PATCH 119/487] Add documentation to the CMake file in rs_port. --- source/ports/rs_port/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/ports/rs_port/CMakeLists.txt b/source/ports/rs_port/CMakeLists.txt index 536856f87..2b2f5635d 100644 --- a/source/ports/rs_port/CMakeLists.txt +++ b/source/ports/rs_port/CMakeLists.txt @@ -149,6 +149,15 @@ if((OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER) AND NOT RS_ endif() # If we have cargo-valgrind, run the tests with it +# For installing it, first install valgrind on your system, then run: +# cargo install cargo-valgrind +# It will install the tooling necesary for running with valgrind. +# For debugging the project run: +# +# cmake -DCMAKE_BUILD_TYPE=Debug -DOPTION_BUILD_PORTS=ON \ +# -DOPTION_BUILD_PORTS_RS=ON -DOPTION_TEST_MEMORYCHECK .. +# +# You can also add loaders for this command so you can test with them. if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER)) # Check if cargo-valgrind is installed execute_process( @@ -162,6 +171,9 @@ if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUI endif() endif() +# For running one test only, you can add: +# --test=metacall_test --package=metacall +# To the command, and it will run metacall_test only add_test(NAME ${target} COMMAND ${Rust_CARGO_EXECUTABLE} ${CARGO_VALGRIND} ${NIGHTLY_FLAGS} test ${BUILD_STD_FLAGS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} From 176a624210d0cc319098bcda2cf0d8aeae481bcd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 14 Dec 2024 10:40:00 +0100 Subject: [PATCH 120/487] Remove macos-12. --- .github/workflows/macos-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 50ad76470..64a768757 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-12, macos-13, macos-14] # TODO: macos-15: https://github.com/metacall/core/issues/530 + os: [macos-13, macos-14] # TODO: macos-15: https://github.com/metacall/core/issues/530 options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, From f305c0772928bd606c3143f6511d423ae8e60e56 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 14 Dec 2024 10:44:13 +0100 Subject: [PATCH 121/487] Add more doc in rs_port. --- source/ports/rs_port/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/ports/rs_port/CMakeLists.txt b/source/ports/rs_port/CMakeLists.txt index 2b2f5635d..54fbcbca1 100644 --- a/source/ports/rs_port/CMakeLists.txt +++ b/source/ports/rs_port/CMakeLists.txt @@ -158,6 +158,12 @@ endif() # -DOPTION_BUILD_PORTS_RS=ON -DOPTION_TEST_MEMORYCHECK .. # # You can also add loaders for this command so you can test with them. +# Finally, build and run the tests: +# +# make -j8 rs_port +# ctest -VV -R rs_port +# +# CTest will run the tests and show valgrind output if there is any error. if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER)) # Check if cargo-valgrind is installed execute_process( From a4b6b61b0d942ff35cd76b36e347db14d6d5ac42 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 17 Dec 2024 23:00:18 +0100 Subject: [PATCH 122/487] Solve issue with tools environment.sh for deprecated apt-key. --- tools/metacall-environment.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 1e638e2dd..304fa6a02 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -671,7 +671,7 @@ sub_c(){ ;; esac - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | $SUDO_CMD apt-key add + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | $SUDO_CMD tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc $SUDO_CMD sh -c "echo \"deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain${LINKNAME}-${LLVM_VERSION_STRING} main\" >> /etc/apt/sources.list" $SUDO_CMD sh -c "echo \"deb-src http://apt.llvm.org/${CODENAME}/ llvm-toolchain${LINKNAME}-${LLVM_VERSION_STRING} main\" >> /etc/apt/sources.list" $SUDO_CMD apt-get update @@ -843,7 +843,7 @@ sub_clangformat(){ ;; esac - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | $SUDO_CMD apt-key add + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | $SUDO_CMD tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc $SUDO_CMD sh -c "echo \"deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain${LINKNAME}-${LLVM_VERSION_STRING} main\" >> /etc/apt/sources.list" $SUDO_CMD sh -c "echo \"deb-src http://apt.llvm.org/${CODENAME}/ llvm-toolchain${LINKNAME}-${LLVM_VERSION_STRING} main\" >> /etc/apt/sources.list" $SUDO_CMD apt-get update From 57853f5d9f6e36a0b003365f6e177158345091cf Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:23:06 -0500 Subject: [PATCH 123/487] Update upload.sh --- source/ports/py_port/upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index da8ea4e6a..02204ed5f 100644 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -36,7 +36,7 @@ TWINE_PASSWORD=${PYTHON_PYPI_PASSWORD:-} python3 -m pip install --user --upgrade twine setuptools wheel python3 setup.py sdist bdist_wheel python3 -m twine check dist/* -python3 -m twine upload dist/* +python3 -m twine upload -u ${TWINE_USERNAME} -p ${TWINE_PASSWORD} dist/* # Delete output rm -rf dist/* build/* From 232c8cdcda21462e8aa05019babba606116aa012 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:23:31 -0500 Subject: [PATCH 124/487] Update upload.sh --- source/ports/py_port/upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index 02204ed5f..c0150efbd 100644 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -36,7 +36,7 @@ TWINE_PASSWORD=${PYTHON_PYPI_PASSWORD:-} python3 -m pip install --user --upgrade twine setuptools wheel python3 setup.py sdist bdist_wheel python3 -m twine check dist/* -python3 -m twine upload -u ${TWINE_USERNAME} -p ${TWINE_PASSWORD} dist/* +python3 -m twine upload -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" dist/* # Delete output rm -rf dist/* build/* From 6566c70db3778e4450ee47077561eb890d5f860b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 00:30:41 +0100 Subject: [PATCH 125/487] Update ci of python. --- .github/workflows/release-python.yml | 2 +- source/ports/py_port/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index c352504de..1401f88be 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -4,7 +4,7 @@ on: push: branches: [ master, develop ] paths: - - 'source/ports/py_port/setup.py' + - 'source/ports/py_port/VERSION' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION index 09a3acfa1..5d4294b91 100644 --- a/source/ports/py_port/VERSION +++ b/source/ports/py_port/VERSION @@ -1 +1 @@ -0.6.0 \ No newline at end of file +0.5.1 \ No newline at end of file From e6d251461e69208c27421eedc10007a798bdf7db Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 01:03:00 +0100 Subject: [PATCH 126/487] Testing python again. --- source/ports/py_port/VERSION | 2 +- source/ports/py_port/upload.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION index 5d4294b91..09a3acfa1 100644 --- a/source/ports/py_port/VERSION +++ b/source/ports/py_port/VERSION @@ -1 +1 @@ -0.5.1 \ No newline at end of file +0.6.0 \ No newline at end of file diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index c0150efbd..fcc066e48 100644 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -29,12 +29,13 @@ if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then exit 0 fi -TWINE_USERNAME=${PYTHON_PYPI_USERNAME:-} +TWINE_USERNAME=${PYTHON_PYPI_USER:-} TWINE_PASSWORD=${PYTHON_PYPI_PASSWORD:-} # Install dependencies and upload MetaCall package python3 -m pip install --user --upgrade twine setuptools wheel -python3 setup.py sdist bdist_wheel +# python3 setup.py sdist bdist_wheel +python3 -m build python3 -m twine check dist/* python3 -m twine upload -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" dist/* From f74bc85a61f383571585bbbe86b6794117b7f185 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 01:11:42 +0100 Subject: [PATCH 127/487] Errors solved in py release. --- .github/workflows/release-python.yml | 7 +++---- source/ports/py_port/VERSION | 2 +- source/ports/py_port/upload.sh | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 1401f88be..2c7c10a28 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -10,10 +10,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -env: - PYTHON_PIPY_USER: ${{ secrets.PYTHON_PIPY_USER }} - PYTHON_PIPY_PASSWORD: ${{ secrets.PYTHON_PIPY_PASSWORD }} - jobs: release: name: Release Python Port @@ -24,6 +20,9 @@ jobs: with: fetch-depth: 0 - name: Release the port + env: + PYTHON_PYPI_USER: ${{ secrets.PYTHON_PYPI_USER }} + PYTHON_PYPI_PASSWORD: ${{ secrets.PYTHON_PYPI_PASSWORD }} run: | cd source/ports/py_port bash ./upload.sh diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION index 09a3acfa1..5d4294b91 100644 --- a/source/ports/py_port/VERSION +++ b/source/ports/py_port/VERSION @@ -1 +1 @@ -0.6.0 \ No newline at end of file +0.5.1 \ No newline at end of file diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index fcc066e48..30f6e8334 100644 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -34,8 +34,7 @@ TWINE_PASSWORD=${PYTHON_PYPI_PASSWORD:-} # Install dependencies and upload MetaCall package python3 -m pip install --user --upgrade twine setuptools wheel -# python3 setup.py sdist bdist_wheel -python3 -m build +python3 setup.py sdist bdist_wheel python3 -m twine check dist/* python3 -m twine upload -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" dist/* From a136a9740fde6e37f9cad907ce4b95ac6beee952 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 01:14:44 +0100 Subject: [PATCH 128/487] Try again. --- source/ports/py_port/VERSION | 2 +- source/ports/py_port/upload.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION index 5d4294b91..09a3acfa1 100644 --- a/source/ports/py_port/VERSION +++ b/source/ports/py_port/VERSION @@ -1 +1 @@ -0.5.1 \ No newline at end of file +0.6.0 \ No newline at end of file diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index 30f6e8334..0ca8eb397 100644 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -29,14 +29,14 @@ if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then exit 0 fi -TWINE_USERNAME=${PYTHON_PYPI_USER:-} -TWINE_PASSWORD=${PYTHON_PYPI_PASSWORD:-} +export TWINE_USERNAME=${PYTHON_PYPI_USER:-} +export TWINE_PASSWORD=${PYTHON_PYPI_PASSWORD:-} # Install dependencies and upload MetaCall package python3 -m pip install --user --upgrade twine setuptools wheel python3 setup.py sdist bdist_wheel python3 -m twine check dist/* -python3 -m twine upload -u "${TWINE_USERNAME}" -p "${TWINE_PASSWORD}" dist/* +python3 -m twine upload dist/* # Delete output rm -rf dist/* build/* From 60adf392d8ffd5b807eb78ed8c01e65b63b4b5e7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 01:52:22 +0100 Subject: [PATCH 129/487] Try again python. --- .github/workflows/release-python.yml | 8 ++------ source/ports/py_port/VERSION | 2 +- source/ports/py_port/upload.sh | 7 ++----- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 2c7c10a28..52f6f4c88 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -20,9 +20,5 @@ jobs: with: fetch-depth: 0 - name: Release the port - env: - PYTHON_PYPI_USER: ${{ secrets.PYTHON_PYPI_USER }} - PYTHON_PYPI_PASSWORD: ${{ secrets.PYTHON_PYPI_PASSWORD }} - run: | - cd source/ports/py_port - bash ./upload.sh + working-directory: source/ports/py_port + run: ./upload.sh diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION index 09a3acfa1..5d4294b91 100644 --- a/source/ports/py_port/VERSION +++ b/source/ports/py_port/VERSION @@ -1 +1 @@ -0.6.0 \ No newline at end of file +0.5.1 \ No newline at end of file diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index 0ca8eb397..d24895dc4 100644 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -29,12 +29,9 @@ if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then exit 0 fi -export TWINE_USERNAME=${PYTHON_PYPI_USER:-} -export TWINE_PASSWORD=${PYTHON_PYPI_PASSWORD:-} - # Install dependencies and upload MetaCall package -python3 -m pip install --user --upgrade twine setuptools wheel -python3 setup.py sdist bdist_wheel +python3 -m pip install --user --upgrade twine setuptools wheel build +python3 -m build python3 -m twine check dist/* python3 -m twine upload dist/* From 8fa2125bf139c9aacfd1aa36831b6de89ca3bc87 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 01:55:58 +0100 Subject: [PATCH 130/487] Add premissions. --- source/ports/py_port/VERSION | 2 +- source/ports/py_port/upload.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 source/ports/py_port/upload.sh diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION index 5d4294b91..09a3acfa1 100644 --- a/source/ports/py_port/VERSION +++ b/source/ports/py_port/VERSION @@ -1 +1 @@ -0.5.1 \ No newline at end of file +0.6.0 \ No newline at end of file diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh old mode 100644 new mode 100755 From d3894f29b08cdbf089839016361ef103da7bedd6 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 01:59:20 +0100 Subject: [PATCH 131/487] Update release python. --- source/ports/py_port/VERSION | 2 +- source/ports/py_port/upload.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION index 09a3acfa1..5d4294b91 100644 --- a/source/ports/py_port/VERSION +++ b/source/ports/py_port/VERSION @@ -1 +1 @@ -0.6.0 \ No newline at end of file +0.5.1 \ No newline at end of file diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index d24895dc4..2ca4f09fd 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -30,8 +30,9 @@ if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then fi # Install dependencies and upload MetaCall package -python3 -m pip install --user --upgrade twine setuptools wheel build -python3 -m build +python3 -m pip install --user --upgrade twine setuptools wheel # build +# python3 -m build +python3 setup.py sdist bdist_wheel python3 -m twine check dist/* python3 -m twine upload dist/* From f79dddae1edb192c590ef3bd9734aef1cfce0085 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 02:03:09 +0100 Subject: [PATCH 132/487] Update version. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index bbde4bee2..120f53215 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.5 \ No newline at end of file +0.8.6 \ No newline at end of file From 8c9d615c45acf15534ac880902a4c1ddec142ab1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Dec 2024 02:22:34 +0100 Subject: [PATCH 133/487] Version v0.8.7. --- VERSION | 2 +- source/ports/node_port/index.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 120f53215..35864a97f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.6 \ No newline at end of file +0.8.7 \ No newline at end of file diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 10fcbf24e..8d690b6d8 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -271,6 +271,11 @@ const available_tags = new Set([...Object.values(file_extensions_to_tag), ...Obj /* Override require */ mod.prototype.require = function (name) { + /* Try to load itself */ + if (name === 'metacall') { + return module_exports; + } + // TODO: // /* Check if the module is an URL */ // try { From 9bbc9a63844e072609ec05ce24113afdafa387b7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 19 Dec 2024 03:34:31 +0100 Subject: [PATCH 134/487] Host destruction working properly with nodejs. --- source/loader/source/loader.c | 13 ++++++++- source/loaders/node_loader/CMakeLists.txt | 2 +- .../node_loader/bootstrap/lib/bootstrap.js | 6 ++++ .../node_loader/source/node_loader_impl.cpp | 6 ++-- .../source/node_loader_trampoline.cpp | 1 - source/metacall/source/metacall.c | 9 ++++++ source/metacall/source/metacall_link.c | 3 +- source/ports/node_port/CMakeLists.txt | 2 +- source/ports/node_port/index.js | 28 ++++++++++--------- 9 files changed, 49 insertions(+), 21 deletions(-) diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 8fc490118..73803e7ed 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -210,7 +210,18 @@ int loader_initialize_host(const loader_tag tag) return 1; } - return loader_impl_initialize(&loader_manager, p, plugin_impl_type(p, loader_impl)); + if (loader_impl_initialize(&loader_manager, p, plugin_impl_type(p, loader_impl)) != 0) + { + return 1; + } + else + { + loader_manager_impl manager_impl = plugin_manager_impl_type(&loader_manager, loader_manager_impl); + + manager_impl->host = p; + + return 0; + } } int loader_is_initialized(const loader_tag tag) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 70108f53e..a9bf13c67 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -158,7 +158,7 @@ target_link_libraries(${target} ${META_PROJECT_NAME}::metacall # MetaCall library # TODO: Implement delayed load - # ${NodeJS_LIBRARY} # NodeJS library + ${NodeJS_LIBRARY} # NodeJS library PUBLIC ${DEFAULT_LIBRARIES} diff --git a/source/loaders/node_loader/bootstrap/lib/bootstrap.js b/source/loaders/node_loader/bootstrap/lib/bootstrap.js index 4f2c5b766..8201b220a 100644 --- a/source/loaders/node_loader/bootstrap/lib/bootstrap.js +++ b/source/loaders/node_loader/bootstrap/lib/bootstrap.js @@ -436,6 +436,12 @@ const startup = (impl, ptr, trampoline_exports) => { 'await_function': node_loader_trampoline_await_function(trampoline), 'await_future': node_loader_trampoline_await_future(trampoline), }); + + // This function must destroy all the loaders but + // delaying the NodeJS Loader library unloading + if (trampoline_exports) { + process.on('exit', () => trampoline.destroy(node_loader_ptr)); + } } catch (ex) { console.log('Exception in bootstrap.js trampoline initialization:', ex); } diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index b32154153..281221d40 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -4604,11 +4604,11 @@ int node_loader_impl_destroy(loader_impl impl) return 1; } - /* Call destroy function with thread safe */ - node_loader_impl_try_destroy(node_impl); - if (loader_impl_get_option_host(impl) == 0) { + /* Call destroy function with thread safe */ + node_loader_impl_try_destroy(node_impl); + /* Wait for node thread to finish */ uv_thread_join(&node_impl->thread); } diff --git a/source/loaders/node_loader/source/node_loader_trampoline.cpp b/source/loaders/node_loader/source/node_loader_trampoline.cpp index 6314d2d30..7ed654358 100644 --- a/source/loaders/node_loader/source/node_loader_trampoline.cpp +++ b/source/loaders/node_loader/source/node_loader_trampoline.cpp @@ -244,7 +244,6 @@ napi_value node_loader_trampoline_reject(napi_env env, napi_callback_info info) napi_value node_loader_trampoline_destroy(napi_env env, napi_callback_info info) { napi_status status; - const size_t args_size = 1; size_t argc = args_size; napi_value recv; diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index d7d19f815..0962d974e 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -72,6 +72,7 @@ static loader_path plugin_path = { 0 }; static int metacall_plugin_extension_load(void); static void *metacallv_method(void *target, const char *name, method_invoke_ptr call, vector v, void *args[], size_t size); static type_id *metacall_type_ids(void *args[], size_t size); +static void metacall_destructor(void); static void metacall_detour_destructor(void); /* -- Costructors -- */ @@ -111,10 +112,18 @@ portability_constructor(metacall_constructor) metacall_value_destroy(config[0].options); exit(1); } + + /* Register the destructor on exit */ + atexit(metacall_destructor); } } } +void metacall_destructor(void) +{ + metacall_destroy(); +} + /* -- Methods -- */ const char *metacall_serial(void) diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index d1343c52d..9bad2939a 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -92,7 +92,8 @@ void *metacall_link_hook(void *handle, const char *symbol) /* Intercept function if any */ void *ptr = set_get(metacall_link_table, (set_key)symbol); - log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall detour link interception: %s -> %p", symbol, ptr); + /* TODO: Disable logs here until log is completely thread safe and async signal safe */ + /* log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall detour link interception: %s -> %p", symbol, ptr); */ if (ptr != NULL) { diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index 9cbb94fbc..c6531650a 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -225,7 +225,7 @@ set(node_port_test_exec "${node_port_test}_executable") message(STATUS "Test ${node_port_test_exec}") add_test(NAME ${node_port_test_exec} - COMMAND ${NodeJS_EXECUTABLE} test/index.js + COMMAND ${NodeJS_EXECUTABLE} -e "require('./test.js').main()" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index f96f870d7..2372b3fd5 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -22,10 +22,10 @@ const mod = require('module'); const path = require('path'); -const fs = require('fs').promises; +const fs = require('fs'); const { URL } = require('url'); /* TODO: RPC Loader */ -async function findFilesRecursively(dirPattern, filePattern, depthLimit = Infinity) { +const findFilesRecursively = (dirPattern, filePattern, depthLimit = Infinity) => { const stack = [{ dir: dirPattern, depth: 0 }]; const files = []; const dirRegex = new RegExp(dirPattern); @@ -43,11 +43,11 @@ async function findFilesRecursively(dirPattern, filePattern, depthLimit = Infini continue; } - const items = await fs.readdir(dir); + const items = fs.readdirSync(dir); for (const item of items) { const fullPath = path.join(dir, item); - const stat = await fs.stat(fullPath); + const stat = fs.statSync(fullPath); if (stat.isDirectory()) { stack.push({ dir: fullPath, depth: depth + 1 }); @@ -61,7 +61,7 @@ async function findFilesRecursively(dirPattern, filePattern, depthLimit = Infini } return files; -} +}; const platformInstallPaths = () => { switch (process.platform) { @@ -83,7 +83,7 @@ const platformInstallPaths = () => { } throw new Error(`Platform ${process.platform} not supported`) -} +}; const searchPaths = () => { const customPath = process.env['METACALL_INSTALL_PATH']; @@ -96,13 +96,13 @@ const searchPaths = () => { } return platformInstallPaths() -} +}; -const findLibrary = async () => { +const findLibrary = () => { const searchData = searchPaths(); for (const p of searchData.paths) { - const files = await findFilesRecursively(p, searchData.name, 0); + const files = findFilesRecursively(p, searchData.name, 0); if (files.length !== 0) { return files[0]; @@ -110,7 +110,7 @@ const findLibrary = async () => { } throw new Error('MetaCall library not found, if you have it in a special folder, define it through METACALL_INSTALL_PATH') -} +}; const addon = (() => { try { @@ -127,7 +127,9 @@ const addon = (() => { */ process.env['METACALL_HOST'] = 'node'; - findLibrary().then(library => { + try { + const library = findLibrary(); + const { constants } = require('os'); const m = { exports: {} }; @@ -148,10 +150,10 @@ const addon = (() => { process.argv = argv; return m.exports; - }).catch(err => { + } catch (err) { console.log(err); process.exit(1); - }); + } } })(); From 10f72e1810ec872ec202b550945ff3f1b8538622 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 19 Dec 2024 17:17:01 +0100 Subject: [PATCH 135/487] Add preload of sanitizers for node tests with node executable. --- cmake/CompileOptions.cmake | 33 +++++++++++++++++++++++++++ source/ports/node_port/CMakeLists.txt | 1 + 2 files changed, 34 insertions(+) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index f569a6c16..a5610945c 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -149,6 +149,39 @@ else() set(SANITIZER_COMPILE_DEFINITIONS) endif() +if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") + if(OPTION_BUILD_THREAD_SANITIZER) + execute_process(COMMAND ${CMAKE_C_COMPILER} -print-file-name=libtsan${CMAKE_SHARED_LIBRARY_SUFFIX} OUTPUT_VARIABLE LIBTSAN_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) + set(SANITIZER_LIBRARIES_PATH + "${LIBTSAN_PATH}" + ) + elseif(OPTION_BUILD_MEMORY_SANITIZER) + set(SANITIZER_LIBRARIES_PATH) # TODO + elseif(OPTION_BUILD_ADDRESS_SANITIZER) + execute_process(COMMAND ${CMAKE_C_COMPILER} -print-file-name=libasan${CMAKE_SHARED_LIBRARY_SUFFIX} OUTPUT_VARIABLE LIBASAN_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${CMAKE_C_COMPILER} -print-file-name=libubsan${CMAKE_SHARED_LIBRARY_SUFFIX} OUTPUT_VARIABLE LIBUBSAN_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) + set(SANITIZER_LIBRARIES_PATH + "${LIBASAN_PATH}" + "${LIBUBSAN_PATH}" + ) + endif() +endif() + +if(SANITIZER_LIBRARIES_PATH) + if(PROJECT_OS_LINUX) + list(JOIN SANITIZER_LIBRARIES_PATH " " SANITIZER_LIBRARIES_PATH_JOINED) + set(TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES + "LD_PRELOAD=${SANITIZER_LIBRARIES_PATH_JOINED}" + ) + elseif(PROJECT_OS_FAMILY MATCHES "macos") + list(JOIN SANITIZER_LIBRARIES_PATH ":" SANITIZER_LIBRARIES_PATH_JOINED) + set(TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES + "DYLD_INSERT_LIBRARIES=${SANITIZER_LIBRARIES_PATH_JOINED}" + "DYLD_FORCE_FLAT_NAMESPACE=1" + ) + endif() +endif() + if((PROJECT_OS_WIN AND MSVC) OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # MSVC and Clang do not require to link manually the sanitizer libraries set(SANITIZER_LIBRARIES) diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index c6531650a..5ddccd023 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -243,4 +243,5 @@ test_environment_variables(${node_port_test_exec} ${TESTS_ENVIRONMENT_VARIABLES_RS} ${TESTS_ENVIRONMENT_VARIABLES_OPENSSL} "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) From ad08aec46e52cde5df25bacba4db040baff7f10c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 19 Dec 2024 17:18:27 +0100 Subject: [PATCH 136/487] Change metacall_destroy signature, improved bugs with atexit. --- .../source/metacall_cs_call_bench.cpp | 4 +++- .../source/metacall_node_call_bench.cpp | 4 +++- .../source/metacall_py_call_bench.cpp | 5 +---- .../source/metacall_py_init_bench.cpp | 5 +---- .../source/metacall_rb_call_bench.cpp | 5 +---- source/cli/metacallcli/source/application.cpp | 7 +------ source/examples/metacalllog/main.cpp | 4 +++- source/metacall/include/metacall/metacall.h | 5 +---- source/metacall/source/metacall.c | 19 +++++-------------- source/metacall/source/metacall_fork.c | 10 ++-------- .../src/main/java/metacall/Bindings.java | 2 +- source/ports/rs_port/src/bindings.rs | 4 ++-- source/ports/rs_port/src/init.rs | 10 +++------- .../ports/zig_port/src/metacall-bindings.zig | 2 +- source/ports/zig_port/src/root.zig | 9 ++------- .../ports/zig_port/src/tests/integrated.zig | 2 +- .../source/metacall_backtrace_plugin_test.cpp | 2 +- .../source/metacall_c_lib_test.cpp | 2 +- .../source/metacall_c_test.cpp | 2 +- .../source/metacall_callback_complex_test.cpp | 2 +- .../source/metacall_cast_test.cpp | 2 +- .../source/metacall_clear_test.cpp | 2 +- .../metacall_cli_core_plugin_await_test.cpp | 2 +- .../source/metacall_cli_core_plugin_test.cpp | 2 +- .../source/metacall_cobol_test.cpp | 2 +- .../metacall_configuration_default_test.cpp | 2 +- .../metacall_configuration_exec_path_test.cpp | 2 +- .../metacall_cs_test/source/environment.cpp | 2 +- .../source/metacall_csharp_function_test.cpp | 2 +- .../metacall_csharp_static_class_test.cpp | 2 +- .../source/metacall_depends_test.cpp | 2 +- .../source/metacall_distributable_test.cpp | 2 +- .../source/metacall_ducktype_test.cpp | 2 +- .../metacall_duplicated_handle_test.cpp | 2 +- .../metacall_duplicated_symbols_test.cpp | 2 +- .../source/metacall_ext_test.cpp | 2 +- .../source/metacall_file_fail_test.cpp | 2 +- .../source/metacall_file_glob_test.cpp | 2 +- .../source/metacall_file_test.cpp | 2 +- .../source/metacall_fork_test.cpp | 2 +- .../source/metacall_function_test.cpp | 2 +- .../source/metacall_handle_export_test.cpp | 2 +- .../source/metacall_handle_get_test.cpp | 2 +- .../source/metacall_init_fini_test.cpp | 2 +- ..._initialize_destroy_multiple_node_test.cpp | 6 +++--- ...acall_initialize_destroy_multiple_test.cpp | 6 +++--- .../source/metacall_initialize_ex_test.cpp | 2 +- .../source/metacall_initialize_test.cpp | 2 +- .../source/metacall_inspect_test.cpp | 2 +- .../source/environment.cpp | 2 +- .../source/metacall_invalid_loader_test.cpp | 2 +- .../source/metacall_java_test.cpp | 2 +- .../source/metacall_julia_test.cpp | 2 +- ...all_library_path_without_env_vars_test.cpp | 2 +- .../source/metacall_llvm_test.cpp | 2 +- .../metacall_load_configuration_fail_test.cpp | 2 +- ...ll_load_configuration_node_python_test.cpp | 2 +- ...ll_load_configuration_python_node_test.cpp | 2 +- ...acall_load_configuration_relative_test.cpp | 2 +- .../metacall_load_configuration_test.cpp | 2 +- .../metacall_load_memory_empty_test.cpp | 2 +- .../source/metacall_load_memory_test.cpp | 2 +- .../source/metacall_logs_test.cpp | 2 +- .../source/metacall_lua_test.cpp | 2 +- .../source/metacall_map_await_test.cpp | 2 +- .../source/metacall_map_test.cpp | 2 +- .../metacall_node_async_multiple_test.cpp | 2 +- .../metacall_node_async_resources_test.cpp | 2 +- .../source/metacall_node_async_test.cpp | 2 +- .../source/metacall_node_await_chain_test.cpp | 2 +- .../source/metacall_node_call_test.cpp | 2 +- .../source/metacall_node_callback_test.cpp | 2 +- .../source/metacall_node_clear_mem_test.cpp | 2 +- .../metacall_node_default_export_test.cpp | 2 +- .../metacall_node_event_loop_signal_test.cpp | 2 +- .../source/metacall_node_event_loop_test.cpp | 2 +- .../source/metacall_node_exception_test.cpp | 2 +- .../source/metacall_node_extension_test.cpp | 2 +- .../metacall_node_fail_env_var_test.cpp | 2 +- .../metacall_node_fail_load_leak_test.cpp | 2 +- .../source/metacall_node_fail_test.cpp | 2 +- .../source/metacall_node_inline_test.cpp | 2 +- ...etacall_node_multithread_deadlock_test.cpp | 2 +- .../source/metacall_node_native_code_test.cpp | 2 +- .../source/metacall_node_port_await_test.cpp | 2 +- .../source/metacall_node_port_rs_test.cpp | 2 +- .../source/metacall_node_port_test.cpp | 2 +- ...l_node_python_async_after_destroy_test.cpp | 2 +- ...tacall_node_python_await_extended_test.cpp | 2 +- .../metacall_node_python_await_test.cpp | 2 +- .../metacall_node_python_deadlock_test.cpp | 2 +- .../metacall_node_python_exception_test.cpp | 2 +- .../metacall_node_python_port_mock_test.cpp | 2 +- .../metacall_node_python_port_ruby_test.cpp | 2 +- .../source/metacall_node_python_ruby_test.cpp | 2 +- .../source/metacall_node_reentrant_test.cpp | 2 +- .../metacall_node_signal_handler_test.cpp | 2 +- .../source/metacall_node_test.cpp | 2 +- .../source/metacall_node_typescript_test.cpp | 2 +- ...ll_plugin_extension_destroy_order_test.cpp | 2 +- ...all_plugin_extension_invalid_path_test.cpp | 2 +- .../metacall_plugin_extension_local_test.cpp | 2 +- .../source/metacall_plugin_extension_test.cpp | 2 +- .../source/metacall_python_async_test.cpp | 2 +- .../source/metacall_python_await_test.cpp | 2 +- .../source/metacall_python_builtins_test.cpp | 2 +- .../source/metacall_python_callback_test.cpp | 2 +- .../source/metacall_python_dict_test.cpp | 2 +- .../source/metacall_python_exception_test.cpp | 2 +- .../source/metacall_python_fail_test.cpp | 2 +- .../source/metacall_python_gc_test.cpp | 2 +- .../metacall_python_loader_port_test.cpp | 2 +- .../source/metacall_python_model_test.cpp | 2 +- .../metacall_python_node_await_test.cpp | 2 +- .../metacall_python_object_class_test.cpp | 2 +- .../source/metacall_python_open_test.cpp | 2 +- .../source/metacall_python_pointer_test.cpp | 2 +- .../metacall_python_port_callback_test.cpp | 2 +- .../metacall_python_port_https_test.cpp | 2 +- .../metacall_python_port_import_test.cpp | 2 +- .../metacall_python_port_pointer_test.cpp | 2 +- .../source/metacall_python_port_test.cpp | 2 +- .../source/metacall_python_reentrant_test.cpp | 2 +- .../metacall_python_relative_path_test.cpp | 2 +- .../source/metacall_python_test.cpp | 2 +- .../source/metacall_python_varargs_test.cpp | 2 +- .../metacall_python_without_env_vars_test.cpp | 2 +- ...metacall_python_without_functions_test.cpp | 2 +- .../source/metacall_reinitialize_test.cpp | 2 +- .../source/metacall_reload_functions_test.cpp | 2 +- .../source/metacall_return_monad_test.cpp | 2 +- .../source/metacall_rpc_test.cpp | 2 +- .../source/metacall_ruby_fail_empty_test.cpp | 2 +- .../source/metacall_ruby_fail_test.cpp | 2 +- .../metacall_ruby_object_class_test.cpp | 2 +- .../metacall_ruby_parser_integration_test.cpp | 2 +- .../metacall_ruby_rails_integration_test.cpp | 2 +- .../source/metacall_ruby_test.cpp | 2 +- .../source/metacall_rust_class_test.cpp | 2 +- .../metacall_rust_load_from_mem_test.cpp | 2 +- ...call_rust_load_from_package_class_test.cpp | 2 +- ...tacall_rust_load_from_package_dep_test.cpp | 2 +- .../metacall_rust_load_from_package_test.cpp | 2 +- .../source/metacall_rust_test.cpp | 2 +- .../source/metacall_sandbox_plugin_test.cpp | 18 +++++++++--------- .../metacall_test/source/metacall_test.cpp | 2 +- .../source/metacall_test_split.cpp | 4 ++-- .../metacall_typescript_call_map_test.cpp | 2 +- .../metacall_typescript_jsx_default_test.cpp | 2 +- .../source/metacall_typescript_node_test.cpp | 2 +- .../metacall_typescript_require_test.cpp | 2 +- .../source/metacall_typescript_test.cpp | 2 +- ...metacall_typescript_tsx_loop_fail_test.cpp | 2 +- .../source/metacall_typescript_tsx_test.cpp | 2 +- .../source/metacall_wasm_test.cpp | 2 +- 155 files changed, 183 insertions(+), 218 deletions(-) diff --git a/source/benchmarks/metacall_cs_call_bench/source/metacall_cs_call_bench.cpp b/source/benchmarks/metacall_cs_call_bench/source/metacall_cs_call_bench.cpp index e16f199a8..d0acd24cc 100644 --- a/source/benchmarks/metacall_cs_call_bench/source/metacall_cs_call_bench.cpp +++ b/source/benchmarks/metacall_cs_call_bench/source/metacall_cs_call_bench.cpp @@ -186,5 +186,7 @@ int main(int argc, char **argv) ::benchmark::RunSpecifiedBenchmarks(); - return metacall_destroy(); + metacall_destroy(); + + return 0; } diff --git a/source/benchmarks/metacall_node_call_bench/source/metacall_node_call_bench.cpp b/source/benchmarks/metacall_node_call_bench/source/metacall_node_call_bench.cpp index f66efa2ab..15861f525 100644 --- a/source/benchmarks/metacall_node_call_bench/source/metacall_node_call_bench.cpp +++ b/source/benchmarks/metacall_node_call_bench/source/metacall_node_call_bench.cpp @@ -292,5 +292,7 @@ int main(int argc, char **argv) } #endif /* OPTION_BUILD_LOADERS_NODE */ - return metacall_destroy(); + metacall_destroy(); + + return 0; } diff --git a/source/benchmarks/metacall_py_call_bench/source/metacall_py_call_bench.cpp b/source/benchmarks/metacall_py_call_bench/source/metacall_py_call_bench.cpp index 399ebe239..74d0bc7c5 100644 --- a/source/benchmarks/metacall_py_call_bench/source/metacall_py_call_bench.cpp +++ b/source/benchmarks/metacall_py_call_bench/source/metacall_py_call_bench.cpp @@ -178,10 +178,7 @@ int main(int argc, char *argv[]) ::benchmark::RunSpecifiedBenchmarks(); ::benchmark::Shutdown(); - if (metacall_destroy() != 0) - { - return 4; - } + metacall_destroy(); return 0; } diff --git a/source/benchmarks/metacall_py_init_bench/source/metacall_py_init_bench.cpp b/source/benchmarks/metacall_py_init_bench/source/metacall_py_init_bench.cpp index 7021aad6b..ee60fee48 100644 --- a/source/benchmarks/metacall_py_init_bench/source/metacall_py_init_bench.cpp +++ b/source/benchmarks/metacall_py_init_bench/source/metacall_py_init_bench.cpp @@ -130,10 +130,7 @@ BENCHMARK_DEFINE_F(metacall_py_init_bench, destroy) /* Python */ #if defined(OPTION_BUILD_LOADERS_PY) { - if (metacall_destroy() != 0) - { - state.SkipWithError("Error destroying MetaCall"); - } + metacall_destroy(); } #endif /* OPTION_BUILD_LOADERS_PY */ } diff --git a/source/benchmarks/metacall_rb_call_bench/source/metacall_rb_call_bench.cpp b/source/benchmarks/metacall_rb_call_bench/source/metacall_rb_call_bench.cpp index ddcfd2795..903530eae 100644 --- a/source/benchmarks/metacall_rb_call_bench/source/metacall_rb_call_bench.cpp +++ b/source/benchmarks/metacall_rb_call_bench/source/metacall_rb_call_bench.cpp @@ -198,10 +198,7 @@ int main(int argc, char *argv[]) ::benchmark::RunSpecifiedBenchmarks(); ::benchmark::Shutdown(); - if (metacall_destroy() != 0) - { - return 4; - } + metacall_destroy(); return 0; } diff --git a/source/cli/metacallcli/source/application.cpp b/source/cli/metacallcli/source/application.cpp index b1b22761b..0ba037683 100644 --- a/source/cli/metacallcli/source/application.cpp +++ b/source/cli/metacallcli/source/application.cpp @@ -299,12 +299,7 @@ application::application(int argc, char *argv[]) : application::~application() { - int result = metacall_destroy(); - - if (result != 0) - { - std::cout << "Error while destroying MetaCall, exit code: " << result << std::endl; - } + metacall_destroy(); } void application::arguments_parse(std::vector<std::string> &arguments) diff --git a/source/examples/metacalllog/main.cpp b/source/examples/metacalllog/main.cpp index e7b47deea..0b4ac01a9 100644 --- a/source/examples/metacalllog/main.cpp +++ b/source/examples/metacalllog/main.cpp @@ -143,5 +143,7 @@ int main(int, char *[]) /* Here you can load some scripts */ - return metacall_destroy(); + metacall_destroy(); + + return 0; } diff --git a/source/metacall/include/metacall/metacall.h b/source/metacall/include/metacall/metacall.h index 2ad427ca3..b7788e223 100644 --- a/source/metacall/include/metacall/metacall.h +++ b/source/metacall/include/metacall/metacall.h @@ -1488,11 +1488,8 @@ METACALL_API const char *metacall_plugin_path(void); /** * @brief * Destroy MetaCall library -* -* @return -* Zero if success, different from zero otherwise */ -METACALL_API int metacall_destroy(void); +METACALL_API void metacall_destroy(void); /** * @brief diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 0962d974e..3fcc54b8c 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -72,7 +72,6 @@ static loader_path plugin_path = { 0 }; static int metacall_plugin_extension_load(void); static void *metacallv_method(void *target, const char *name, method_invoke_ptr call, vector v, void *args[], size_t size); static type_id *metacall_type_ids(void *args[], size_t size); -static void metacall_destructor(void); static void metacall_detour_destructor(void); /* -- Costructors -- */ @@ -114,16 +113,11 @@ portability_constructor(metacall_constructor) } /* Register the destructor on exit */ - atexit(metacall_destructor); + atexit(metacall_destroy); } } } -void metacall_destructor(void) -{ - metacall_destroy(); -} - /* -- Methods -- */ const char *metacall_serial(void) @@ -200,8 +194,6 @@ int metacall_plugin_extension_load(void) void metacall_detour_destructor(void) { - log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall detour destruction"); - /* Destroy link */ if (metacall_link_destroy() != 0) { @@ -2364,7 +2356,7 @@ const char *metacall_plugin_path(void) return plugin_path; } -int metacall_destroy(void) +void metacall_destroy(void) { if (metacall_initialize_flag == 0) { @@ -2374,17 +2366,16 @@ int metacall_destroy(void) /* Destroy configurations */ configuration_destroy(); - metacall_initialize_flag = 1; - /* Print stats from functions, classes, objects and exceptions */ reflect_memory_tracker_debug(); /* Set to null the plugin extension and core plugin handles */ plugin_extension_handle = NULL; plugin_core_handle = NULL; - } - return 0; + /* Set initialization flag to destroyed */ + metacall_initialize_flag = 1; + } } const struct metacall_version_type *metacall_version(void) diff --git a/source/metacall/source/metacall_fork.c b/source/metacall/source/metacall_fork.c index 6cbe972e6..cd1ec5022 100644 --- a/source/metacall/source/metacall_fork.c +++ b/source/metacall/source/metacall_fork.c @@ -172,10 +172,7 @@ NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall process fork auto destroy"); /* Destroy metacall before the fork */ - if (metacall_destroy() != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall fork auto destruction"); - } + metacall_destroy(); /* Execute the real fork */ result = metacall_fork_trampoline(ProcessFlags, ProcessSecurityDescriptor, ThreadSecurityDescriptor, DebugPort, ProcessInformation); @@ -247,10 +244,7 @@ pid_t metacall_fork_hook(void) log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall process fork auto destroy"); /* Destroy metacall before the fork */ - if (metacall_destroy() != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall fork auto destruction fail"); - } + metacall_destroy(); /* Execute the real fork */ pid = metacall_fork_trampoline(); diff --git a/source/ports/java_port/src/main/java/metacall/Bindings.java b/source/ports/java_port/src/main/java/metacall/Bindings.java index b1de4d1c4..71b93a729 100644 --- a/source/ports/java_port/src/main/java/metacall/Bindings.java +++ b/source/ports/java_port/src/main/java/metacall/Bindings.java @@ -31,7 +31,7 @@ public interface Bindings extends Library SizeT metacall_function_size(Pointer func); int metacall_function_async(Pointer func); - int metacall_destroy(); + void metacall_destroy(); //metacall_value.h Pointer metacall_value_create_int(int i); diff --git a/source/ports/rs_port/src/bindings.rs b/source/ports/rs_port/src/bindings.rs index fdfc35049..c4319b2ac 100644 --- a/source/ports/rs_port/src/bindings.rs +++ b/source/ports/rs_port/src/bindings.rs @@ -1355,8 +1355,8 @@ unsafe extern "C" { pub fn metacall_plugin_path() -> *const ::std::os::raw::c_char; } unsafe extern "C" { - #[doc = " @brief\n Destroy MetaCall library\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_destroy() -> ::std::os::raw::c_int; + #[doc = " @brief\n Destroy MetaCall library\n"] + pub fn metacall_destroy(); } unsafe extern "C" { #[doc = " @brief\n Provide the module version struct\n\n @return\n Static struct containing unpacked version"] diff --git a/source/ports/rs_port/src/init.rs b/source/ports/rs_port/src/init.rs index da09899a2..fb578600a 100644 --- a/source/ports/rs_port/src/init.rs +++ b/source/ports/rs_port/src/init.rs @@ -2,17 +2,13 @@ use crate::{ bindings::{metacall_destroy, metacall_initialize, metacall_is_initialized}, types::MetaCallInitError, }; -use std::{ffi::c_int, ptr}; +use std::ptr; -pub struct MetaCallDestroy(unsafe extern "C" fn() -> c_int); +pub struct MetaCallDestroy(unsafe extern "C" fn()); impl Drop for MetaCallDestroy { fn drop(&mut self) { - let code = unsafe { self.0() }; - - if code != 0 { - panic!("MetaCall failed to destroy with code: {}", code) - } + unsafe { self.0() } } } diff --git a/source/ports/zig_port/src/metacall-bindings.zig b/source/ports/zig_port/src/metacall-bindings.zig index 05243d242..0615eb723 100644 --- a/source/ports/zig_port/src/metacall-bindings.zig +++ b/source/ports/zig_port/src/metacall-bindings.zig @@ -1325,7 +1325,7 @@ pub extern fn metacall_deserialize(name: [*c]const u8, buffer: [*c]const u8, siz pub extern fn metacall_clear(handle: ?*anyopaque) c_int; pub extern fn metacall_plugin_extension() ?*anyopaque; pub extern fn metacall_plugin_path() [*c]const u8; -pub extern fn metacall_destroy() c_int; +pub extern fn metacall_destroy() void; pub extern fn metacall_version() [*c]const struct_metacall_version_type; pub extern fn metacall_version_hex_make(major: c_uint, minor: c_uint, patch: c_uint) u32; pub extern fn metacall_version_hex() u32; diff --git a/source/ports/zig_port/src/root.zig b/source/ports/zig_port/src/root.zig index bb88c3da0..6bc5054e0 100644 --- a/source/ports/zig_port/src/root.zig +++ b/source/ports/zig_port/src/root.zig @@ -9,13 +9,8 @@ pub fn init() !void { return error.FailedToInitMetacall; } /// Deinitializes MetaCall and returns an error if didn't succeed. -pub fn destroy() !void { - if (mb.metacall_destroy() != 0) - return error.FailedToDeinitMetacall; -} -/// Deinitializes MetaCall. -pub fn deinit() void { - _ = destroy() catch {}; +pub fn destroy() void { + mb.metacall_destroy(); } /// Loads files into MetaCall, strings should be null-terminated. diff --git a/source/ports/zig_port/src/tests/integrated.zig b/source/ports/zig_port/src/tests/integrated.zig index 8ee7089f3..70b46b798 100644 --- a/source/ports/zig_port/src/tests/integrated.zig +++ b/source/ports/zig_port/src/tests/integrated.zig @@ -38,5 +38,5 @@ pub fn main() !void { try std.testing.expect(ret_string.?[0] == 'h'); try std.testing.expect(ret_string.?[1] == 'i'); - defer metacall.deinit(); + defer metacall.destroy(); } diff --git a/source/tests/metacall_backtrace_plugin_test/source/metacall_backtrace_plugin_test.cpp b/source/tests/metacall_backtrace_plugin_test/source/metacall_backtrace_plugin_test.cpp index 900c8b0a2..6f70caf08 100644 --- a/source/tests/metacall_backtrace_plugin_test/source/metacall_backtrace_plugin_test.cpp +++ b/source/tests/metacall_backtrace_plugin_test/source/metacall_backtrace_plugin_test.cpp @@ -60,5 +60,5 @@ TEST_F(metacall_backtrace_plugin_test, DefaultConstructor) /* Generate a segmentation fault in order to catch it by backtrace plugin */ EXPECT_DEATH({ badass_function(); }, ""); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp index 28e940a9b..83aa1a8de 100644 --- a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp +++ b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp @@ -93,5 +93,5 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) metacall_value_destroy(args_destroy[0]); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_c_test/source/metacall_c_test.cpp b/source/tests/metacall_c_test/source/metacall_c_test.cpp index 2aff37a27..dc4cc606b 100644 --- a/source/tests/metacall_c_test/source/metacall_c_test.cpp +++ b/source/tests/metacall_c_test/source/metacall_c_test.cpp @@ -153,5 +153,5 @@ TEST_F(metacall_c_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_callback_complex_test/source/metacall_callback_complex_test.cpp b/source/tests/metacall_callback_complex_test/source/metacall_callback_complex_test.cpp index e608f1dcd..daf5717e5 100644 --- a/source/tests/metacall_callback_complex_test/source/metacall_callback_complex_test.cpp +++ b/source/tests/metacall_callback_complex_test/source/metacall_callback_complex_test.cpp @@ -151,5 +151,5 @@ TEST_F(metacall_callback_complex_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_cast_test/source/metacall_cast_test.cpp b/source/tests/metacall_cast_test/source/metacall_cast_test.cpp index 12cd28065..c22c55cc7 100644 --- a/source/tests/metacall_cast_test/source/metacall_cast_test.cpp +++ b/source/tests/metacall_cast_test/source/metacall_cast_test.cpp @@ -106,5 +106,5 @@ TEST_F(metacall_cast_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_clear_test/source/metacall_clear_test.cpp b/source/tests/metacall_clear_test/source/metacall_clear_test.cpp index 8c59a5bab..0a59ea23a 100644 --- a/source/tests/metacall_clear_test/source/metacall_clear_test.cpp +++ b/source/tests/metacall_clear_test/source/metacall_clear_test.cpp @@ -76,5 +76,5 @@ TEST_F(metacall_clear_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_cli_core_plugin_await_test/source/metacall_cli_core_plugin_await_test.cpp b/source/tests/metacall_cli_core_plugin_await_test/source/metacall_cli_core_plugin_await_test.cpp index 05b98823b..49a813bc5 100644 --- a/source/tests/metacall_cli_core_plugin_await_test/source/metacall_cli_core_plugin_await_test.cpp +++ b/source/tests/metacall_cli_core_plugin_await_test/source/metacall_cli_core_plugin_await_test.cpp @@ -123,5 +123,5 @@ TEST_F(metacall_cli_core_plugin_await_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_cli_core_plugin_test/source/metacall_cli_core_plugin_test.cpp b/source/tests/metacall_cli_core_plugin_test/source/metacall_cli_core_plugin_test.cpp index ec178460c..e86f93051 100644 --- a/source/tests/metacall_cli_core_plugin_test/source/metacall_cli_core_plugin_test.cpp +++ b/source/tests/metacall_cli_core_plugin_test/source/metacall_cli_core_plugin_test.cpp @@ -386,5 +386,5 @@ TEST_F(metacall_cli_core_plugin_test, DefaultConstructor) metacall_allocator_destroy(allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_cobol_test/source/metacall_cobol_test.cpp b/source/tests/metacall_cobol_test/source/metacall_cobol_test.cpp index 7158b3bb6..d6aae1a2c 100644 --- a/source/tests/metacall_cobol_test/source/metacall_cobol_test.cpp +++ b/source/tests/metacall_cobol_test/source/metacall_cobol_test.cpp @@ -91,5 +91,5 @@ TEST_F(metacall_cobol_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_configuration_default_test/source/metacall_configuration_default_test.cpp b/source/tests/metacall_configuration_default_test/source/metacall_configuration_default_test.cpp index af04b08dc..e852b0f58 100644 --- a/source/tests/metacall_configuration_default_test/source/metacall_configuration_default_test.cpp +++ b/source/tests/metacall_configuration_default_test/source/metacall_configuration_default_test.cpp @@ -33,5 +33,5 @@ TEST_F(metacall_configuration_default_test, DefaultConstructor) ASSERT_EQ((int)0, (int)metacall_initialize()); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp b/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp index 48d998782..92fa6eac5 100644 --- a/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp +++ b/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp @@ -55,5 +55,5 @@ TEST_F(metacall_configuration_exec_path_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_cs_test/source/environment.cpp b/source/tests/metacall_cs_test/source/environment.cpp index 1753b9cd5..1affa4ae7 100644 --- a/source/tests/metacall_cs_test/source/environment.cpp +++ b/source/tests/metacall_cs_test/source/environment.cpp @@ -40,5 +40,5 @@ void environment::SetUp() void environment::TearDown() { - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_csharp_function_test/source/metacall_csharp_function_test.cpp b/source/tests/metacall_csharp_function_test/source/metacall_csharp_function_test.cpp index aaa0b4e96..799a1dc18 100644 --- a/source/tests/metacall_csharp_function_test/source/metacall_csharp_function_test.cpp +++ b/source/tests/metacall_csharp_function_test/source/metacall_csharp_function_test.cpp @@ -75,5 +75,5 @@ TEST_F(metacall_csharp_function_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_csharp_static_class_test/source/metacall_csharp_static_class_test.cpp b/source/tests/metacall_csharp_static_class_test/source/metacall_csharp_static_class_test.cpp index 5057a6efb..653616db1 100644 --- a/source/tests/metacall_csharp_static_class_test/source/metacall_csharp_static_class_test.cpp +++ b/source/tests/metacall_csharp_static_class_test/source/metacall_csharp_static_class_test.cpp @@ -79,5 +79,5 @@ TEST_F(metacall_csharp_static_class_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_depends_test/source/metacall_depends_test.cpp b/source/tests/metacall_depends_test/source/metacall_depends_test.cpp index 69fff39b4..0f82dd0da 100644 --- a/source/tests/metacall_depends_test/source/metacall_depends_test.cpp +++ b/source/tests/metacall_depends_test/source/metacall_depends_test.cpp @@ -82,5 +82,5 @@ TEST_F(metacall_depends_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp b/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp index 03300dbb6..7aaec074b 100644 --- a/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp +++ b/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp @@ -276,5 +276,5 @@ TEST_F(metacall_distributable_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_C */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp b/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp index 4f404762e..f912c0465 100644 --- a/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp +++ b/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp @@ -386,5 +386,5 @@ TEST_F(metacall_ducktype_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_JS */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_duplicated_handle_test/source/metacall_duplicated_handle_test.cpp b/source/tests/metacall_duplicated_handle_test/source/metacall_duplicated_handle_test.cpp index 370c3e565..72c2a2ad5 100644 --- a/source/tests/metacall_duplicated_handle_test/source/metacall_duplicated_handle_test.cpp +++ b/source/tests/metacall_duplicated_handle_test/source/metacall_duplicated_handle_test.cpp @@ -105,5 +105,5 @@ TEST_F(metacall_duplicated_handle_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_duplicated_symbols_test/source/metacall_duplicated_symbols_test.cpp b/source/tests/metacall_duplicated_symbols_test/source/metacall_duplicated_symbols_test.cpp index 26ce8456a..4306bd1ba 100644 --- a/source/tests/metacall_duplicated_symbols_test/source/metacall_duplicated_symbols_test.cpp +++ b/source/tests/metacall_duplicated_symbols_test/source/metacall_duplicated_symbols_test.cpp @@ -155,5 +155,5 @@ TEST_F(metacall_duplicated_symbols_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY + OPTION_BUILD_LOADERS_RB */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_ext_test/source/metacall_ext_test.cpp b/source/tests/metacall_ext_test/source/metacall_ext_test.cpp index 4a1501728..5894a3278 100644 --- a/source/tests/metacall_ext_test/source/metacall_ext_test.cpp +++ b/source/tests/metacall_ext_test/source/metacall_ext_test.cpp @@ -75,5 +75,5 @@ TEST_F(metacall_ext_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_file_fail_test/source/metacall_file_fail_test.cpp b/source/tests/metacall_file_fail_test/source/metacall_file_fail_test.cpp index ce3a62f7b..f5f4a0ba4 100644 --- a/source/tests/metacall_file_fail_test/source/metacall_file_fail_test.cpp +++ b/source/tests/metacall_file_fail_test/source/metacall_file_fail_test.cpp @@ -69,5 +69,5 @@ TEST_F(metacall_file_fail_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_file_glob_test/source/metacall_file_glob_test.cpp b/source/tests/metacall_file_glob_test/source/metacall_file_glob_test.cpp index 23edddd06..a5f3a2d2a 100644 --- a/source/tests/metacall_file_glob_test/source/metacall_file_glob_test.cpp +++ b/source/tests/metacall_file_glob_test/source/metacall_file_glob_test.cpp @@ -70,5 +70,5 @@ TEST_F(metacall_file_glob_test, DefaultConstructor) metacall_allocator_destroy(config_allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_file_test/source/metacall_file_test.cpp b/source/tests/metacall_file_test/source/metacall_file_test.cpp index 029e8f0f6..aa635963c 100644 --- a/source/tests/metacall_file_test/source/metacall_file_test.cpp +++ b/source/tests/metacall_file_test/source/metacall_file_test.cpp @@ -77,5 +77,5 @@ TEST_F(metacall_file_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_fork_test/source/metacall_fork_test.cpp b/source/tests/metacall_fork_test/source/metacall_fork_test.cpp index 07c9e8734..c4f18db15 100644 --- a/source/tests/metacall_fork_test/source/metacall_fork_test.cpp +++ b/source/tests/metacall_fork_test/source/metacall_fork_test.cpp @@ -169,5 +169,5 @@ TEST_F(metacall_fork_test, DefaultConstructor) EXPECT_EQ((int)1, (int)pre_callback_fired); EXPECT_EQ((int)1, (int)post_callback_fired); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_function_test/source/metacall_function_test.cpp b/source/tests/metacall_function_test/source/metacall_function_test.cpp index 60c52efb1..2d015ea7f 100644 --- a/source/tests/metacall_function_test/source/metacall_function_test.cpp +++ b/source/tests/metacall_function_test/source/metacall_function_test.cpp @@ -272,5 +272,5 @@ TEST_F(metacall_function_test, DefaultConstructor) metacall_value_destroy(c_callback_factorial_impl_value); metacall_value_destroy(c_callback_factorial_value); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_handle_export_test/source/metacall_handle_export_test.cpp b/source/tests/metacall_handle_export_test/source/metacall_handle_export_test.cpp index 0c5fc5773..5c19f588a 100644 --- a/source/tests/metacall_handle_export_test/source/metacall_handle_export_test.cpp +++ b/source/tests/metacall_handle_export_test/source/metacall_handle_export_test.cpp @@ -139,5 +139,5 @@ TEST_F(metacall_handle_export_test, DefaultConstructor) metacall_allocator_destroy(allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp b/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp index c1d25836c..fb9202aba 100644 --- a/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp +++ b/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp @@ -158,5 +158,5 @@ TEST_F(metacall_handle_get_test, DefaultConstructor) metacall_allocator_destroy(allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_init_fini_test/source/metacall_init_fini_test.cpp b/source/tests/metacall_init_fini_test/source/metacall_init_fini_test.cpp index 2290009dd..eba4e7206 100644 --- a/source/tests/metacall_init_fini_test/source/metacall_init_fini_test.cpp +++ b/source/tests/metacall_init_fini_test/source/metacall_init_fini_test.cpp @@ -55,5 +55,5 @@ TEST_F(metacall_init_fini_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_initialize_destroy_multiple_node_test/source/metacall_initialize_destroy_multiple_node_test.cpp b/source/tests/metacall_initialize_destroy_multiple_node_test/source/metacall_initialize_destroy_multiple_node_test.cpp index 12d008293..a38e64885 100644 --- a/source/tests/metacall_initialize_destroy_multiple_node_test/source/metacall_initialize_destroy_multiple_node_test.cpp +++ b/source/tests/metacall_initialize_destroy_multiple_node_test/source/metacall_initialize_destroy_multiple_node_test.cpp @@ -51,13 +51,13 @@ TEST_F(metacall_initialize_destroy_multiple_node_test, DefaultConstructor) ASSERT_EQ((int)0, (int)metacall_is_initialized(tag)); - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); ASSERT_EQ((int)1, (int)metacall_is_initialized(tag)); } #endif /* OPTION_BUILD_LOADERS_NODE */ - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_initialize_destroy_multiple_test/source/metacall_initialize_destroy_multiple_test.cpp b/source/tests/metacall_initialize_destroy_multiple_test/source/metacall_initialize_destroy_multiple_test.cpp index df51f5d94..337923b15 100644 --- a/source/tests/metacall_initialize_destroy_multiple_test/source/metacall_initialize_destroy_multiple_test.cpp +++ b/source/tests/metacall_initialize_destroy_multiple_test/source/metacall_initialize_destroy_multiple_test.cpp @@ -51,13 +51,13 @@ TEST_F(metacall_initialize_destroy_multiple_test, DefaultConstructor) ASSERT_EQ((int)0, (int)metacall_is_initialized(tag)); - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); ASSERT_EQ((int)1, (int)metacall_is_initialized(tag)); } #endif /* OPTION_BUILD_LOADERS_MOCK */ - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_initialize_ex_test/source/metacall_initialize_ex_test.cpp b/source/tests/metacall_initialize_ex_test/source/metacall_initialize_ex_test.cpp index 8c9e2930b..c26f24374 100644 --- a/source/tests/metacall_initialize_ex_test/source/metacall_initialize_ex_test.cpp +++ b/source/tests/metacall_initialize_ex_test/source/metacall_initialize_ex_test.cpp @@ -61,5 +61,5 @@ TEST_F(metacall_initialize_ex_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_MOCK */ - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_initialize_test/source/metacall_initialize_test.cpp b/source/tests/metacall_initialize_test/source/metacall_initialize_test.cpp index ba4ab42b9..e1b67c480 100644 --- a/source/tests/metacall_initialize_test/source/metacall_initialize_test.cpp +++ b/source/tests/metacall_initialize_test/source/metacall_initialize_test.cpp @@ -49,5 +49,5 @@ TEST_F(metacall_initialize_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_MOCK */ - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_inspect_test/source/metacall_inspect_test.cpp b/source/tests/metacall_inspect_test/source/metacall_inspect_test.cpp index 06b1c220b..a759571d7 100644 --- a/source/tests/metacall_inspect_test/source/metacall_inspect_test.cpp +++ b/source/tests/metacall_inspect_test/source/metacall_inspect_test.cpp @@ -134,5 +134,5 @@ TEST_F(metacall_inspect_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_integration_test/source/environment.cpp b/source/tests/metacall_integration_test/source/environment.cpp index 8ac160cf2..3c2a0bb9a 100644 --- a/source/tests/metacall_integration_test/source/environment.cpp +++ b/source/tests/metacall_integration_test/source/environment.cpp @@ -36,5 +36,5 @@ void environment::SetUp() void environment::TearDown() { - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_invalid_loader_test/source/metacall_invalid_loader_test.cpp b/source/tests/metacall_invalid_loader_test/source/metacall_invalid_loader_test.cpp index 92edc0f2d..dc472134f 100644 --- a/source/tests/metacall_invalid_loader_test/source/metacall_invalid_loader_test.cpp +++ b/source/tests/metacall_invalid_loader_test/source/metacall_invalid_loader_test.cpp @@ -48,5 +48,5 @@ TEST_F(metacall_invalid_loader_test, DefaultConstructor) ASSERT_EQ((int)1, (int)metacall_is_initialized("invalid")); - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_java_test/source/metacall_java_test.cpp b/source/tests/metacall_java_test/source/metacall_java_test.cpp index c934cd173..d6a44287c 100644 --- a/source/tests/metacall_java_test/source/metacall_java_test.cpp +++ b/source/tests/metacall_java_test/source/metacall_java_test.cpp @@ -412,5 +412,5 @@ TEST_F(metacall_java_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_julia_test/source/metacall_julia_test.cpp b/source/tests/metacall_julia_test/source/metacall_julia_test.cpp index 1b9e21cdf..384ea1ec5 100644 --- a/source/tests/metacall_julia_test/source/metacall_julia_test.cpp +++ b/source/tests/metacall_julia_test/source/metacall_julia_test.cpp @@ -98,5 +98,5 @@ TEST_F(metacall_julia_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_library_path_without_env_vars_test/source/metacall_library_path_without_env_vars_test.cpp b/source/tests/metacall_library_path_without_env_vars_test/source/metacall_library_path_without_env_vars_test.cpp index a64b4464c..dade10d5e 100644 --- a/source/tests/metacall_library_path_without_env_vars_test/source/metacall_library_path_without_env_vars_test.cpp +++ b/source/tests/metacall_library_path_without_env_vars_test/source/metacall_library_path_without_env_vars_test.cpp @@ -45,5 +45,5 @@ TEST_F(metacall_library_path_without_env_vars_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_MOCK */ - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp b/source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp index 446161e60..8d0100c17 100644 --- a/source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp +++ b/source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp @@ -99,5 +99,5 @@ TEST_F(metacall_llvm_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_load_configuration_fail_test/source/metacall_load_configuration_fail_test.cpp b/source/tests/metacall_load_configuration_fail_test/source/metacall_load_configuration_fail_test.cpp index 8632cb274..cdd57d852 100644 --- a/source/tests/metacall_load_configuration_fail_test/source/metacall_load_configuration_fail_test.cpp +++ b/source/tests/metacall_load_configuration_fail_test/source/metacall_load_configuration_fail_test.cpp @@ -72,5 +72,5 @@ TEST_F(metacall_load_configuration_fail_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_load_configuration_node_python_test/source/metacall_load_configuration_node_python_test.cpp b/source/tests/metacall_load_configuration_node_python_test/source/metacall_load_configuration_node_python_test.cpp index 92a253b9a..b9665efec 100644 --- a/source/tests/metacall_load_configuration_node_python_test/source/metacall_load_configuration_node_python_test.cpp +++ b/source/tests/metacall_load_configuration_node_python_test/source/metacall_load_configuration_node_python_test.cpp @@ -55,5 +55,5 @@ TEST_F(metacall_load_configuration_node_python_test, DefaultConstructor) EXPECT_EQ((double)5.0, (double)metacall_value_to_double(ret)); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_load_configuration_python_node_test/source/metacall_load_configuration_python_node_test.cpp b/source/tests/metacall_load_configuration_python_node_test/source/metacall_load_configuration_python_node_test.cpp index ae64810d4..005ee1e33 100644 --- a/source/tests/metacall_load_configuration_python_node_test/source/metacall_load_configuration_python_node_test.cpp +++ b/source/tests/metacall_load_configuration_python_node_test/source/metacall_load_configuration_python_node_test.cpp @@ -62,5 +62,5 @@ TEST_F(metacall_load_configuration_python_node_test, DefaultConstructor) metacall_allocator_destroy(config_allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_load_configuration_relative_test/source/metacall_load_configuration_relative_test.cpp b/source/tests/metacall_load_configuration_relative_test/source/metacall_load_configuration_relative_test.cpp index c14a1ceda..7527de857 100644 --- a/source/tests/metacall_load_configuration_relative_test/source/metacall_load_configuration_relative_test.cpp +++ b/source/tests/metacall_load_configuration_relative_test/source/metacall_load_configuration_relative_test.cpp @@ -65,5 +65,5 @@ TEST_F(metacall_load_configuration_relative_test, DefaultConstructor) metacall_allocator_destroy(config_allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp b/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp index d3fc377c4..da91461a7 100644 --- a/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp +++ b/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp @@ -254,5 +254,5 @@ TEST_F(metacall_load_configuration_test, DefaultConstructor) metacall_allocator_destroy(config_allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_load_memory_empty_test/source/metacall_load_memory_empty_test.cpp b/source/tests/metacall_load_memory_empty_test/source/metacall_load_memory_empty_test.cpp index ee424fed8..d00723446 100644 --- a/source/tests/metacall_load_memory_empty_test/source/metacall_load_memory_empty_test.cpp +++ b/source/tests/metacall_load_memory_empty_test/source/metacall_load_memory_empty_test.cpp @@ -67,5 +67,5 @@ TEST_F(metacall_load_memory_empty_test, DefaultConstructor) /* Non existent loader */ ASSERT_EQ((int)1, (int)metacall_load_from_memory("asdfghjk", buffer, sizeof(buffer), NULL)); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_load_memory_test/source/metacall_load_memory_test.cpp b/source/tests/metacall_load_memory_test/source/metacall_load_memory_test.cpp index b65eeb92e..1201ddaa4 100644 --- a/source/tests/metacall_load_memory_test/source/metacall_load_memory_test.cpp +++ b/source/tests/metacall_load_memory_test/source/metacall_load_memory_test.cpp @@ -157,5 +157,5 @@ TEST_F(metacall_load_memory_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_JS */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_logs_test/source/metacall_logs_test.cpp b/source/tests/metacall_logs_test/source/metacall_logs_test.cpp index 15c14c4ce..9c352db70 100644 --- a/source/tests/metacall_logs_test/source/metacall_logs_test.cpp +++ b/source/tests/metacall_logs_test/source/metacall_logs_test.cpp @@ -40,5 +40,5 @@ TEST_F(metacall_logs_test, DefaultConstructor) ASSERT_EQ((int)0, (int)metacall_initialize()); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_lua_test/source/metacall_lua_test.cpp b/source/tests/metacall_lua_test/source/metacall_lua_test.cpp index e229265f7..50baf66e3 100644 --- a/source/tests/metacall_lua_test/source/metacall_lua_test.cpp +++ b/source/tests/metacall_lua_test/source/metacall_lua_test.cpp @@ -110,5 +110,5 @@ TEST_F(metacall_lua_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp b/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp index 8c3646f92..11243d861 100644 --- a/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp +++ b/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp @@ -263,7 +263,7 @@ TEST_F(metacall_map_await_test, DefaultConstructor) metacall_allocator_destroy(allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); /* NodeJS */ #if defined(OPTION_BUILD_LOADERS_NODE) diff --git a/source/tests/metacall_map_test/source/metacall_map_test.cpp b/source/tests/metacall_map_test/source/metacall_map_test.cpp index ceb829c78..5aceb11fd 100644 --- a/source/tests/metacall_map_test/source/metacall_map_test.cpp +++ b/source/tests/metacall_map_test/source/metacall_map_test.cpp @@ -210,5 +210,5 @@ TEST_F(metacall_map_test, DefaultConstructor) metacall_allocator_destroy(allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_async_multiple_test/source/metacall_node_async_multiple_test.cpp b/source/tests/metacall_node_async_multiple_test/source/metacall_node_async_multiple_test.cpp index 629b1c789..db398273c 100644 --- a/source/tests/metacall_node_async_multiple_test/source/metacall_node_async_multiple_test.cpp +++ b/source/tests/metacall_node_async_multiple_test/source/metacall_node_async_multiple_test.cpp @@ -198,7 +198,7 @@ TEST_F(metacall_node_async_multiple_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); /* NodeJS */ #if defined(OPTION_BUILD_LOADERS_NODE) diff --git a/source/tests/metacall_node_async_resources_test/source/metacall_node_async_resources_test.cpp b/source/tests/metacall_node_async_resources_test/source/metacall_node_async_resources_test.cpp index 4a979174e..dc256cc03 100644 --- a/source/tests/metacall_node_async_resources_test/source/metacall_node_async_resources_test.cpp +++ b/source/tests/metacall_node_async_resources_test/source/metacall_node_async_resources_test.cpp @@ -46,5 +46,5 @@ TEST_F(metacall_node_event_loop_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_async_test/source/metacall_node_async_test.cpp b/source/tests/metacall_node_async_test/source/metacall_node_async_test.cpp index 8c125563f..51c0843a5 100644 --- a/source/tests/metacall_node_async_test/source/metacall_node_async_test.cpp +++ b/source/tests/metacall_node_async_test/source/metacall_node_async_test.cpp @@ -252,7 +252,7 @@ TEST_F(metacall_node_async_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); /* NodeJS */ #if defined(OPTION_BUILD_LOADERS_NODE) diff --git a/source/tests/metacall_node_await_chain_test/source/metacall_node_await_chain_test.cpp b/source/tests/metacall_node_await_chain_test/source/metacall_node_await_chain_test.cpp index 308dff2bf..bf57f21f5 100644 --- a/source/tests/metacall_node_await_chain_test/source/metacall_node_await_chain_test.cpp +++ b/source/tests/metacall_node_await_chain_test/source/metacall_node_await_chain_test.cpp @@ -95,7 +95,7 @@ TEST_F(metacall_node_await_chain_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); EXPECT_EQ((unsigned int)3, (unsigned int)callbacks_executed); } diff --git a/source/tests/metacall_node_call_test/source/metacall_node_call_test.cpp b/source/tests/metacall_node_call_test/source/metacall_node_call_test.cpp index 7d1fbd59a..3608330ee 100644 --- a/source/tests/metacall_node_call_test/source/metacall_node_call_test.cpp +++ b/source/tests/metacall_node_call_test/source/metacall_node_call_test.cpp @@ -67,5 +67,5 @@ TEST_F(metacall_node_call_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_callback_test/source/metacall_node_callback_test.cpp b/source/tests/metacall_node_callback_test/source/metacall_node_callback_test.cpp index a8a4bd900..f89070ac2 100644 --- a/source/tests/metacall_node_callback_test/source/metacall_node_callback_test.cpp +++ b/source/tests/metacall_node_callback_test/source/metacall_node_callback_test.cpp @@ -66,5 +66,5 @@ TEST_F(metacall_node_callback_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_clear_mem_test/source/metacall_node_clear_mem_test.cpp b/source/tests/metacall_node_clear_mem_test/source/metacall_node_clear_mem_test.cpp index 17e38ea18..713933581 100644 --- a/source/tests/metacall_node_clear_mem_test/source/metacall_node_clear_mem_test.cpp +++ b/source/tests/metacall_node_clear_mem_test/source/metacall_node_clear_mem_test.cpp @@ -64,5 +64,5 @@ TEST_F(metacall_node_clear_mem_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_default_export_test/source/metacall_node_default_export_test.cpp b/source/tests/metacall_node_default_export_test/source/metacall_node_default_export_test.cpp index 6e51c13c1..ac9bd4bd2 100644 --- a/source/tests/metacall_node_default_export_test/source/metacall_node_default_export_test.cpp +++ b/source/tests/metacall_node_default_export_test/source/metacall_node_default_export_test.cpp @@ -83,5 +83,5 @@ TEST_F(metacall_node_default_export_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_event_loop_signal_test/source/metacall_node_event_loop_signal_test.cpp b/source/tests/metacall_node_event_loop_signal_test/source/metacall_node_event_loop_signal_test.cpp index 5cf2feeb3..463aabc6b 100644 --- a/source/tests/metacall_node_event_loop_signal_test/source/metacall_node_event_loop_signal_test.cpp +++ b/source/tests/metacall_node_event_loop_signal_test/source/metacall_node_event_loop_signal_test.cpp @@ -54,5 +54,5 @@ TEST_F(metacall_node_event_loop_signal_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_event_loop_test/source/metacall_node_event_loop_test.cpp b/source/tests/metacall_node_event_loop_test/source/metacall_node_event_loop_test.cpp index 350386b0c..88e019798 100644 --- a/source/tests/metacall_node_event_loop_test/source/metacall_node_event_loop_test.cpp +++ b/source/tests/metacall_node_event_loop_test/source/metacall_node_event_loop_test.cpp @@ -46,5 +46,5 @@ TEST_F(metacall_node_event_loop_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp b/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp index a82a9ed6c..794056a01 100644 --- a/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp +++ b/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp @@ -75,5 +75,5 @@ TEST_F(metacall_node_exception_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp b/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp index f091bf53c..6514b0c75 100644 --- a/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp +++ b/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp @@ -79,5 +79,5 @@ TEST_F(metacall_node_extension_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_fail_env_var_test/source/metacall_node_fail_env_var_test.cpp b/source/tests/metacall_node_fail_env_var_test/source/metacall_node_fail_env_var_test.cpp index 6c3e0f255..5803e2920 100644 --- a/source/tests/metacall_node_fail_env_var_test/source/metacall_node_fail_env_var_test.cpp +++ b/source/tests/metacall_node_fail_env_var_test/source/metacall_node_fail_env_var_test.cpp @@ -66,5 +66,5 @@ TEST_F(metacall_node_fail_env_var_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_fail_load_leak_test/source/metacall_node_fail_load_leak_test.cpp b/source/tests/metacall_node_fail_load_leak_test/source/metacall_node_fail_load_leak_test.cpp index a9c44e1f6..b99d94d2b 100644 --- a/source/tests/metacall_node_fail_load_leak_test/source/metacall_node_fail_load_leak_test.cpp +++ b/source/tests/metacall_node_fail_load_leak_test/source/metacall_node_fail_load_leak_test.cpp @@ -70,5 +70,5 @@ TEST_F(metacall_node_fail_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_fail_test/source/metacall_node_fail_test.cpp b/source/tests/metacall_node_fail_test/source/metacall_node_fail_test.cpp index d065434d0..5b1038755 100644 --- a/source/tests/metacall_node_fail_test/source/metacall_node_fail_test.cpp +++ b/source/tests/metacall_node_fail_test/source/metacall_node_fail_test.cpp @@ -71,5 +71,5 @@ TEST_F(metacall_node_fail_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_inline_test/source/metacall_node_inline_test.cpp b/source/tests/metacall_node_inline_test/source/metacall_node_inline_test.cpp index c8f9f767c..4148ae1fb 100644 --- a/source/tests/metacall_node_inline_test/source/metacall_node_inline_test.cpp +++ b/source/tests/metacall_node_inline_test/source/metacall_node_inline_test.cpp @@ -81,5 +81,5 @@ TEST_F(metacall_node_inline_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp b/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp index d1b33518e..133d949dd 100644 --- a/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp +++ b/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp @@ -125,7 +125,7 @@ TEST_F(metacall_node_multithread_deadlock_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); /* NodeJS */ #if defined(OPTION_BUILD_LOADERS_NODE) diff --git a/source/tests/metacall_node_native_code_test/source/metacall_node_native_code_test.cpp b/source/tests/metacall_node_native_code_test/source/metacall_node_native_code_test.cpp index 83bd3466b..bbf7fcf5d 100644 --- a/source/tests/metacall_node_native_code_test/source/metacall_node_native_code_test.cpp +++ b/source/tests/metacall_node_native_code_test/source/metacall_node_native_code_test.cpp @@ -68,5 +68,5 @@ TEST_F(metacall_node_unsupported_features_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_port_await_test/source/metacall_node_port_await_test.cpp b/source/tests/metacall_node_port_await_test/source/metacall_node_port_await_test.cpp index 34d49f16e..00766eb88 100644 --- a/source/tests/metacall_node_port_await_test/source/metacall_node_port_await_test.cpp +++ b/source/tests/metacall_node_port_await_test/source/metacall_node_port_await_test.cpp @@ -71,5 +71,5 @@ TEST_F(metacall_node_port_await_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_port_rs_test/source/metacall_node_port_rs_test.cpp b/source/tests/metacall_node_port_rs_test/source/metacall_node_port_rs_test.cpp index 3c34a8094..4c57bb201 100644 --- a/source/tests/metacall_node_port_rs_test/source/metacall_node_port_rs_test.cpp +++ b/source/tests/metacall_node_port_rs_test/source/metacall_node_port_rs_test.cpp @@ -55,5 +55,5 @@ TEST_F(metacall_node_port_rs_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_RS */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp b/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp index 3b3552186..5cfb285a2 100644 --- a/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp +++ b/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp @@ -85,5 +85,5 @@ TEST_F(metacall_node_port_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_python_async_after_destroy_test/source/metacall_node_python_async_after_destroy_test.cpp b/source/tests/metacall_node_python_async_after_destroy_test/source/metacall_node_python_async_after_destroy_test.cpp index 464e9b750..43cdbde33 100644 --- a/source/tests/metacall_node_python_async_after_destroy_test/source/metacall_node_python_async_after_destroy_test.cpp +++ b/source/tests/metacall_node_python_async_after_destroy_test/source/metacall_node_python_async_after_destroy_test.cpp @@ -65,5 +65,5 @@ TEST_F(metacall_node_python_async_after_destroy_test, DefaultConstructor) * https://github.com/metacall/core/commit/9b64ee533079fa0d543fc346fb7149d1086451f0 * https://github.com/metacall/core/commit/22bd999c281f23aac04cea7df435a836631706da */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp b/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp index ef20b69f4..57e9c143b 100644 --- a/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp +++ b/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp @@ -90,5 +90,5 @@ TEST_F(metacall_node_python_await_extended_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_python_await_test/source/metacall_node_python_await_test.cpp b/source/tests/metacall_node_python_await_test/source/metacall_node_python_await_test.cpp index 2f7160c5d..b140752ac 100644 --- a/source/tests/metacall_node_python_await_test/source/metacall_node_python_await_test.cpp +++ b/source/tests/metacall_node_python_await_test/source/metacall_node_python_await_test.cpp @@ -84,5 +84,5 @@ TEST_F(metacall_node_python_await_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_python_deadlock_test/source/metacall_node_python_deadlock_test.cpp b/source/tests/metacall_node_python_deadlock_test/source/metacall_node_python_deadlock_test.cpp index 95c5f2d9b..4b9ce4866 100644 --- a/source/tests/metacall_node_python_deadlock_test/source/metacall_node_python_deadlock_test.cpp +++ b/source/tests/metacall_node_python_deadlock_test/source/metacall_node_python_deadlock_test.cpp @@ -54,5 +54,5 @@ TEST_F(metacall_node_python_deadlock_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_python_exception_test/source/metacall_node_python_exception_test.cpp b/source/tests/metacall_node_python_exception_test/source/metacall_node_python_exception_test.cpp index abe3e4a49..69ed55884 100644 --- a/source/tests/metacall_node_python_exception_test/source/metacall_node_python_exception_test.cpp +++ b/source/tests/metacall_node_python_exception_test/source/metacall_node_python_exception_test.cpp @@ -59,5 +59,5 @@ TEST_F(metacall_node_python_exception_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp b/source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp index c1db00da3..7670e8d89 100644 --- a/source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp +++ b/source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp @@ -64,5 +64,5 @@ TEST_F(metacall_node_python_port_mock_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_PY && OPTION_BUILD_LOADERS_MOCK */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_python_port_ruby_test/source/metacall_node_python_port_ruby_test.cpp b/source/tests/metacall_node_python_port_ruby_test/source/metacall_node_python_port_ruby_test.cpp index 87ce31cb0..0b4edc45c 100644 --- a/source/tests/metacall_node_python_port_ruby_test/source/metacall_node_python_port_ruby_test.cpp +++ b/source/tests/metacall_node_python_port_ruby_test/source/metacall_node_python_port_ruby_test.cpp @@ -59,5 +59,5 @@ TEST_F(metacall_node_python_port_ruby_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_PY && OPTION_BUILD_LOADERS_RB */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp b/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp index 246e93b8a..a3ff9fe7e 100644 --- a/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp +++ b/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp @@ -110,5 +110,5 @@ TEST_F(metacall_node_python_ruby_test, DefaultConstructor) EXPECT_EQ((int)success_callbacks, (int)1); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_reentrant_test/source/metacall_node_reentrant_test.cpp b/source/tests/metacall_node_reentrant_test/source/metacall_node_reentrant_test.cpp index 2f32965ec..cfac3514f 100644 --- a/source/tests/metacall_node_reentrant_test/source/metacall_node_reentrant_test.cpp +++ b/source/tests/metacall_node_reentrant_test/source/metacall_node_reentrant_test.cpp @@ -119,5 +119,5 @@ TEST_F(metacall_node_reentrant_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_signal_handler_test/source/metacall_node_signal_handler_test.cpp b/source/tests/metacall_node_signal_handler_test/source/metacall_node_signal_handler_test.cpp index 8dd995d8d..869a6fd1e 100644 --- a/source/tests/metacall_node_signal_handler_test/source/metacall_node_signal_handler_test.cpp +++ b/source/tests/metacall_node_signal_handler_test/source/metacall_node_signal_handler_test.cpp @@ -127,7 +127,7 @@ TEST_F(metacall_node_signal_handler_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); EXPECT_EQ((bool)callback_result.load(), (bool)true); EXPECT_EQ((bool)signal_result.load(), (bool)true); diff --git a/source/tests/metacall_node_test/source/metacall_node_test.cpp b/source/tests/metacall_node_test/source/metacall_node_test.cpp index 1b7b595b6..f63f67c2c 100644 --- a/source/tests/metacall_node_test/source/metacall_node_test.cpp +++ b/source/tests/metacall_node_test/source/metacall_node_test.cpp @@ -143,5 +143,5 @@ TEST_F(metacall_node_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_node_typescript_test/source/metacall_node_typescript_test.cpp b/source/tests/metacall_node_typescript_test/source/metacall_node_typescript_test.cpp index 49ddae7f9..984705f86 100644 --- a/source/tests/metacall_node_typescript_test/source/metacall_node_typescript_test.cpp +++ b/source/tests/metacall_node_typescript_test/source/metacall_node_typescript_test.cpp @@ -138,5 +138,5 @@ TEST_F(metacall_node_typescript_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_plugin_extension_destroy_order_test/source/metacall_plugin_extension_destroy_order_test.cpp b/source/tests/metacall_plugin_extension_destroy_order_test/source/metacall_plugin_extension_destroy_order_test.cpp index d738fa05a..0ad0838ab 100644 --- a/source/tests/metacall_plugin_extension_destroy_order_test/source/metacall_plugin_extension_destroy_order_test.cpp +++ b/source/tests/metacall_plugin_extension_destroy_order_test/source/metacall_plugin_extension_destroy_order_test.cpp @@ -77,5 +77,5 @@ TEST_F(metacall_plugin_destroy_order_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp b/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp index 56731f996..fe30dd53e 100644 --- a/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp +++ b/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp @@ -77,5 +77,5 @@ TEST_F(metacall_plugin_extension_invalid_path_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_plugin_extension_local_test/source/metacall_plugin_extension_local_test.cpp b/source/tests/metacall_plugin_extension_local_test/source/metacall_plugin_extension_local_test.cpp index cb49d030b..b7a6680f6 100644 --- a/source/tests/metacall_plugin_extension_local_test/source/metacall_plugin_extension_local_test.cpp +++ b/source/tests/metacall_plugin_extension_local_test/source/metacall_plugin_extension_local_test.cpp @@ -119,5 +119,5 @@ TEST_F(metacall_plugin_extension_local_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_plugin_extension_test/source/metacall_plugin_extension_test.cpp b/source/tests/metacall_plugin_extension_test/source/metacall_plugin_extension_test.cpp index 73a726997..975e70590 100644 --- a/source/tests/metacall_plugin_extension_test/source/metacall_plugin_extension_test.cpp +++ b/source/tests/metacall_plugin_extension_test/source/metacall_plugin_extension_test.cpp @@ -117,5 +117,5 @@ TEST_F(metacall_plugin_extension_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_async_test/source/metacall_python_async_test.cpp b/source/tests/metacall_python_async_test/source/metacall_python_async_test.cpp index 2b5680982..736753c3d 100644 --- a/source/tests/metacall_python_async_test/source/metacall_python_async_test.cpp +++ b/source/tests/metacall_python_async_test/source/metacall_python_async_test.cpp @@ -160,5 +160,5 @@ TEST_F(metacall_python_async_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_await_test/source/metacall_python_await_test.cpp b/source/tests/metacall_python_await_test/source/metacall_python_await_test.cpp index 79d1a7d47..355e71288 100644 --- a/source/tests/metacall_python_await_test/source/metacall_python_await_test.cpp +++ b/source/tests/metacall_python_await_test/source/metacall_python_await_test.cpp @@ -68,5 +68,5 @@ TEST_F(metacall_python_await_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_builtins_test/source/metacall_python_builtins_test.cpp b/source/tests/metacall_python_builtins_test/source/metacall_python_builtins_test.cpp index e3fb30711..5ba74c839 100644 --- a/source/tests/metacall_python_builtins_test/source/metacall_python_builtins_test.cpp +++ b/source/tests/metacall_python_builtins_test/source/metacall_python_builtins_test.cpp @@ -77,5 +77,5 @@ TEST_F(metacall_python_builtins_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_callback_test/source/metacall_python_callback_test.cpp b/source/tests/metacall_python_callback_test/source/metacall_python_callback_test.cpp index c183c575e..b62c2d021 100644 --- a/source/tests/metacall_python_callback_test/source/metacall_python_callback_test.cpp +++ b/source/tests/metacall_python_callback_test/source/metacall_python_callback_test.cpp @@ -66,5 +66,5 @@ TEST_F(metacall_python_callback_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp b/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp index af0ec1aa5..b5cb079b9 100644 --- a/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp +++ b/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp @@ -169,5 +169,5 @@ TEST_F(metacall_python_dict_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp b/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp index 1a5f92cec..05726d9a4 100644 --- a/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp +++ b/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp @@ -72,5 +72,5 @@ TEST_F(metacall_python_exception_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_fail_test/source/metacall_python_fail_test.cpp b/source/tests/metacall_python_fail_test/source/metacall_python_fail_test.cpp index b36822b37..f35f187b8 100644 --- a/source/tests/metacall_python_fail_test/source/metacall_python_fail_test.cpp +++ b/source/tests/metacall_python_fail_test/source/metacall_python_fail_test.cpp @@ -93,5 +93,5 @@ TEST_F(metacall_python_fail_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp b/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp index 14e5fdc74..d7f1fc308 100644 --- a/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp +++ b/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp @@ -63,5 +63,5 @@ TEST_F(metacall_python_gc_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp b/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp index 05619bf63..bc151f7d9 100644 --- a/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp +++ b/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp @@ -131,5 +131,5 @@ TEST_F(metacall_python_loader_port_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_model_test/source/metacall_python_model_test.cpp b/source/tests/metacall_python_model_test/source/metacall_python_model_test.cpp index 1ab58c5db..503e0f6c0 100644 --- a/source/tests/metacall_python_model_test/source/metacall_python_model_test.cpp +++ b/source/tests/metacall_python_model_test/source/metacall_python_model_test.cpp @@ -82,5 +82,5 @@ TEST_F(metacall_python_model_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_node_await_test/source/metacall_python_node_await_test.cpp b/source/tests/metacall_python_node_await_test/source/metacall_python_node_await_test.cpp index 5b1d15b30..219b8b4a6 100644 --- a/source/tests/metacall_python_node_await_test/source/metacall_python_node_await_test.cpp +++ b/source/tests/metacall_python_node_await_test/source/metacall_python_node_await_test.cpp @@ -71,5 +71,5 @@ TEST_F(metacall_python_node_await_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_NODE && OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp b/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp index c2117aeb1..b1f6d18fb 100644 --- a/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp +++ b/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp @@ -203,5 +203,5 @@ TEST_F(metacall_python_class_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp b/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp index 0a273681e..23b30971f 100644 --- a/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp +++ b/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp @@ -94,5 +94,5 @@ TEST_F(metacall_python_open_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp b/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp index 863ab1cdd..93afe1d31 100644 --- a/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp +++ b/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp @@ -160,5 +160,5 @@ TEST_F(metacall_python_pointer_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_port_callback_test/source/metacall_python_port_callback_test.cpp b/source/tests/metacall_python_port_callback_test/source/metacall_python_port_callback_test.cpp index b3f5b8598..0cf39bfe3 100644 --- a/source/tests/metacall_python_port_callback_test/source/metacall_python_port_callback_test.cpp +++ b/source/tests/metacall_python_port_callback_test/source/metacall_python_port_callback_test.cpp @@ -67,5 +67,5 @@ TEST_F(metacall_python_port_callback_test, DefaultConstructor) metacall_value_destroy(ret); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_port_https_test/source/metacall_python_port_https_test.cpp b/source/tests/metacall_python_port_https_test/source/metacall_python_port_https_test.cpp index f552efa14..b005ffa1b 100644 --- a/source/tests/metacall_python_port_https_test/source/metacall_python_port_https_test.cpp +++ b/source/tests/metacall_python_port_https_test/source/metacall_python_port_https_test.cpp @@ -71,5 +71,5 @@ TEST_F(metacall_python_port_https_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_port_import_test/source/metacall_python_port_import_test.cpp b/source/tests/metacall_python_port_import_test/source/metacall_python_port_import_test.cpp index bfb2fa4e8..0b15fa977 100644 --- a/source/tests/metacall_python_port_import_test/source/metacall_python_port_import_test.cpp +++ b/source/tests/metacall_python_port_import_test/source/metacall_python_port_import_test.cpp @@ -118,5 +118,5 @@ TEST_F(metacall_python_port_import_test, metacall_node_ramda_case_1) ASSERT_NE((void *)handle, (void *)NULL); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp b/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp index b2d57db4b..2e48f5607 100644 --- a/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp +++ b/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp @@ -118,5 +118,5 @@ TEST_F(metacall_python_port_pointer_test, DefaultConstructor) metacall_value_destroy(ret); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp b/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp index e901d7245..d562fd89e 100644 --- a/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp +++ b/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp @@ -52,5 +52,5 @@ TEST_F(metacall_python_port_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_reentrant_test/source/metacall_python_reentrant_test.cpp b/source/tests/metacall_python_reentrant_test/source/metacall_python_reentrant_test.cpp index 33328a637..fa6dae3f6 100644 --- a/source/tests/metacall_python_reentrant_test/source/metacall_python_reentrant_test.cpp +++ b/source/tests/metacall_python_reentrant_test/source/metacall_python_reentrant_test.cpp @@ -76,5 +76,5 @@ TEST_F(metacall_python_reentrant_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_relative_path_test/source/metacall_python_relative_path_test.cpp b/source/tests/metacall_python_relative_path_test/source/metacall_python_relative_path_test.cpp index 5d0505a56..f1f7ce4bb 100644 --- a/source/tests/metacall_python_relative_path_test/source/metacall_python_relative_path_test.cpp +++ b/source/tests/metacall_python_relative_path_test/source/metacall_python_relative_path_test.cpp @@ -72,5 +72,5 @@ TEST_F(metacall_python_dict_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_test/source/metacall_python_test.cpp b/source/tests/metacall_python_test/source/metacall_python_test.cpp index 97a6bb3ef..35dfb9e41 100644 --- a/source/tests/metacall_python_test/source/metacall_python_test.cpp +++ b/source/tests/metacall_python_test/source/metacall_python_test.cpp @@ -77,5 +77,5 @@ TEST_F(metacall_python_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_varargs_test/source/metacall_python_varargs_test.cpp b/source/tests/metacall_python_varargs_test/source/metacall_python_varargs_test.cpp index 539c7e02b..d5a2ee376 100644 --- a/source/tests/metacall_python_varargs_test/source/metacall_python_varargs_test.cpp +++ b/source/tests/metacall_python_varargs_test/source/metacall_python_varargs_test.cpp @@ -102,5 +102,5 @@ TEST_F(metacall_python_varargs_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_without_env_vars_test/source/metacall_python_without_env_vars_test.cpp b/source/tests/metacall_python_without_env_vars_test/source/metacall_python_without_env_vars_test.cpp index 7a0c6c118..9c35499a7 100644 --- a/source/tests/metacall_python_without_env_vars_test/source/metacall_python_without_env_vars_test.cpp +++ b/source/tests/metacall_python_without_env_vars_test/source/metacall_python_without_env_vars_test.cpp @@ -45,5 +45,5 @@ TEST_F(metacall_python_without_env_vars_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_python_without_functions_test/source/metacall_python_without_functions_test.cpp b/source/tests/metacall_python_without_functions_test/source/metacall_python_without_functions_test.cpp index 8dd69eafa..7c4ec16a4 100644 --- a/source/tests/metacall_python_without_functions_test/source/metacall_python_without_functions_test.cpp +++ b/source/tests/metacall_python_without_functions_test/source/metacall_python_without_functions_test.cpp @@ -66,5 +66,5 @@ TEST_F(metacall_python_without_functions_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_reinitialize_test/source/metacall_reinitialize_test.cpp b/source/tests/metacall_reinitialize_test/source/metacall_reinitialize_test.cpp index e1324ba7f..d3cade323 100644 --- a/source/tests/metacall_reinitialize_test/source/metacall_reinitialize_test.cpp +++ b/source/tests/metacall_reinitialize_test/source/metacall_reinitialize_test.cpp @@ -61,6 +61,6 @@ TEST_F(metacall_reinitialize_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_MOCK */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } } diff --git a/source/tests/metacall_reload_functions_test/source/metacall_reload_functions_test.cpp b/source/tests/metacall_reload_functions_test/source/metacall_reload_functions_test.cpp index 85fee11c5..ae4bc3905 100644 --- a/source/tests/metacall_reload_functions_test/source/metacall_reload_functions_test.cpp +++ b/source/tests/metacall_reload_functions_test/source/metacall_reload_functions_test.cpp @@ -170,5 +170,5 @@ TEST_F(metacall_reload_functions_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp b/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp index 63b65fe2f..ad07a1db8 100644 --- a/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp +++ b/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp @@ -129,5 +129,5 @@ TEST_F(metacall_return_monad_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp b/source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp index 0984befcd..51fb948f2 100644 --- a/source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp +++ b/source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp @@ -87,5 +87,5 @@ TEST_F(metacall_rpc_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_RPC */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_ruby_fail_empty_test/source/metacall_ruby_fail_empty_test.cpp b/source/tests/metacall_ruby_fail_empty_test/source/metacall_ruby_fail_empty_test.cpp index b9cb7dfd2..96b4f5c15 100644 --- a/source/tests/metacall_ruby_fail_empty_test/source/metacall_ruby_fail_empty_test.cpp +++ b/source/tests/metacall_ruby_fail_empty_test/source/metacall_ruby_fail_empty_test.cpp @@ -69,5 +69,5 @@ TEST_F(metacall_ruby_fail_empty_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_ruby_fail_test/source/metacall_ruby_fail_test.cpp b/source/tests/metacall_ruby_fail_test/source/metacall_ruby_fail_test.cpp index b7228a7e9..2fe3de533 100644 --- a/source/tests/metacall_ruby_fail_test/source/metacall_ruby_fail_test.cpp +++ b/source/tests/metacall_ruby_fail_test/source/metacall_ruby_fail_test.cpp @@ -50,5 +50,5 @@ TEST_F(metacall_ruby_fail_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_RB */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_ruby_object_class_test/source/metacall_ruby_object_class_test.cpp b/source/tests/metacall_ruby_object_class_test/source/metacall_ruby_object_class_test.cpp index ca8ca3c14..c471d2406 100644 --- a/source/tests/metacall_ruby_object_class_test/source/metacall_ruby_object_class_test.cpp +++ b/source/tests/metacall_ruby_object_class_test/source/metacall_ruby_object_class_test.cpp @@ -160,5 +160,5 @@ TEST_F(metacall_ruby_object_class_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp b/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp index e9fd2d082..295697da2 100644 --- a/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp +++ b/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp @@ -80,5 +80,5 @@ TEST_F(metacall_ruby_parser_integration_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_RB */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_ruby_rails_integration_test/source/metacall_ruby_rails_integration_test.cpp b/source/tests/metacall_ruby_rails_integration_test/source/metacall_ruby_rails_integration_test.cpp index 91fb3fb4c..66b0fa747 100644 --- a/source/tests/metacall_ruby_rails_integration_test/source/metacall_ruby_rails_integration_test.cpp +++ b/source/tests/metacall_ruby_rails_integration_test/source/metacall_ruby_rails_integration_test.cpp @@ -59,5 +59,5 @@ TEST_F(metacall_ruby_integration_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_RB */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp b/source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp index e22eb5dbb..adb9a7007 100644 --- a/source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp +++ b/source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp @@ -37,5 +37,5 @@ TEST_F(metacall_ruby_test, DefaultConstructor) EXPECT_EQ((int)0, (int)metacall_load_from_file("rb", rb_scripts, sizeof(rb_scripts) / sizeof(rb_scripts[0]), NULL)); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_rust_class_test/source/metacall_rust_class_test.cpp b/source/tests/metacall_rust_class_test/source/metacall_rust_class_test.cpp index 64d4627bf..cb0c537a0 100644 --- a/source/tests/metacall_rust_class_test/source/metacall_rust_class_test.cpp +++ b/source/tests/metacall_rust_class_test/source/metacall_rust_class_test.cpp @@ -103,5 +103,5 @@ TEST_F(metacall_rust_class_test, DefaultConstructor) // metacall_value_destroy(book_class); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_rust_load_from_mem_test/source/metacall_rust_load_from_mem_test.cpp b/source/tests/metacall_rust_load_from_mem_test/source/metacall_rust_load_from_mem_test.cpp index fccdcee34..5a2f5b440 100644 --- a/source/tests/metacall_rust_load_from_mem_test/source/metacall_rust_load_from_mem_test.cpp +++ b/source/tests/metacall_rust_load_from_mem_test/source/metacall_rust_load_from_mem_test.cpp @@ -69,5 +69,5 @@ TEST_F(metacall_rust_load_from_mem_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_rust_load_from_package_class_test/source/metacall_rust_load_from_package_class_test.cpp b/source/tests/metacall_rust_load_from_package_class_test/source/metacall_rust_load_from_package_class_test.cpp index db6f6de38..6d6ed2bfc 100644 --- a/source/tests/metacall_rust_load_from_package_class_test/source/metacall_rust_load_from_package_class_test.cpp +++ b/source/tests/metacall_rust_load_from_package_class_test/source/metacall_rust_load_from_package_class_test.cpp @@ -102,5 +102,5 @@ TEST_F(metacall_rust_load_from_mem_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp b/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp index c239fd1cc..dc578bb42 100644 --- a/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp +++ b/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp @@ -65,5 +65,5 @@ TEST_F(metacall_rust_load_from_package_dep_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp b/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp index 7f639f4bc..776ce0ebb 100644 --- a/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp +++ b/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp @@ -168,5 +168,5 @@ TEST_F(metacall_rust_load_from_mem_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_rust_test/source/metacall_rust_test.cpp b/source/tests/metacall_rust_test/source/metacall_rust_test.cpp index cbe3e2ef9..b0a2e9407 100644 --- a/source/tests/metacall_rust_test/source/metacall_rust_test.cpp +++ b/source/tests/metacall_rust_test/source/metacall_rust_test.cpp @@ -187,5 +187,5 @@ TEST_F(metacall_rust_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_sandbox_plugin_test/source/metacall_sandbox_plugin_test.cpp b/source/tests/metacall_sandbox_plugin_test/source/metacall_sandbox_plugin_test.cpp index 824da2ae1..6d0f186a1 100644 --- a/source/tests/metacall_sandbox_plugin_test/source/metacall_sandbox_plugin_test.cpp +++ b/source/tests/metacall_sandbox_plugin_test/source/metacall_sandbox_plugin_test.cpp @@ -291,7 +291,7 @@ TEST_F(metacall_sandbox_plugin_test, DefaultConstructor) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } /* [Note] This test blocks all the gtest context, so you should comment it to allow testing for other test cases */ @@ -330,7 +330,7 @@ TEST_F(metacall_sandbox_plugin_test, SANDBOX_IO_DISABLE_TEST) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } TEST_F(metacall_sandbox_plugin_test, SANDBOX_SOCKETS_DISABLE_TEST) @@ -381,7 +381,7 @@ TEST_F(metacall_sandbox_plugin_test, SANDBOX_SOCKETS_DISABLE_TEST) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } TEST_F(metacall_sandbox_plugin_test, SANDBOX_IPC_DISABLE_TEST) @@ -432,7 +432,7 @@ TEST_F(metacall_sandbox_plugin_test, SANDBOX_IPC_DISABLE_TEST) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } TEST_F(metacall_sandbox_plugin_test, SANDBOX_PROCESS_DISABLE_TEST) @@ -470,7 +470,7 @@ TEST_F(metacall_sandbox_plugin_test, SANDBOX_PROCESS_DISABLE_TEST) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } TEST_F(metacall_sandbox_plugin_test, SANDBOX_FILESYSTEMS_DISABLE_TEST) @@ -508,7 +508,7 @@ TEST_F(metacall_sandbox_plugin_test, SANDBOX_FILESYSTEMS_DISABLE_TEST) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } TEST_F(metacall_sandbox_plugin_test, SANDBOX_TIME_DISABLE_TEST) @@ -559,7 +559,7 @@ TEST_F(metacall_sandbox_plugin_test, SANDBOX_TIME_DISABLE_TEST) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } TEST_F(metacall_sandbox_plugin_test, SANDBOX_MEMORY_DISABLE_TEST) @@ -597,7 +597,7 @@ TEST_F(metacall_sandbox_plugin_test, SANDBOX_MEMORY_DISABLE_TEST) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } TEST_F(metacall_sandbox_plugin_test, SANDBOX_SIGNALS_DISABLE_TEST) @@ -648,5 +648,5 @@ TEST_F(metacall_sandbox_plugin_test, SANDBOX_SIGNALS_DISABLE_TEST) metacall_value_destroy(args[0]); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_test/source/metacall_test.cpp b/source/tests/metacall_test/source/metacall_test.cpp index 4deebb150..cf9d864a2 100644 --- a/source/tests/metacall_test/source/metacall_test.cpp +++ b/source/tests/metacall_test/source/metacall_test.cpp @@ -605,5 +605,5 @@ TEST_F(metacall_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_test/source/metacall_test_split.cpp b/source/tests/metacall_test/source/metacall_test_split.cpp index 1064365b1..dead0c91e 100644 --- a/source/tests/metacall_test/source/metacall_test_split.cpp +++ b/source/tests/metacall_test/source/metacall_test_split.cpp @@ -44,7 +44,7 @@ TEST_F(metacall_test, DefaultConstructor) EXPECT_EQ((int)0, (int)metacall_initialize()); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } class metacall_loader_test : public testing::Test @@ -63,7 +63,7 @@ class metacall_loader_test : public testing::Test ~metacall_loader_test() { - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } }; diff --git a/source/tests/metacall_typescript_call_map_test/source/metacall_typescript_call_map_test.cpp b/source/tests/metacall_typescript_call_map_test/source/metacall_typescript_call_map_test.cpp index 923f8e048..d9cf65a80 100644 --- a/source/tests/metacall_typescript_call_map_test/source/metacall_typescript_call_map_test.cpp +++ b/source/tests/metacall_typescript_call_map_test/source/metacall_typescript_call_map_test.cpp @@ -79,5 +79,5 @@ TEST_F(metacall_typescript_call_map_test, DefaultConstructor) metacall_allocator_destroy(allocator); - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_typescript_jsx_default_test/source/metacall_typescript_jsx_default_test.cpp b/source/tests/metacall_typescript_jsx_default_test/source/metacall_typescript_jsx_default_test.cpp index 7ac88e6da..0930ddff3 100644 --- a/source/tests/metacall_typescript_jsx_default_test/source/metacall_typescript_jsx_default_test.cpp +++ b/source/tests/metacall_typescript_jsx_default_test/source/metacall_typescript_jsx_default_test.cpp @@ -47,5 +47,5 @@ TEST_F(metacall_typescript_jsx_default_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_TS */ - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_typescript_node_test/source/metacall_typescript_node_test.cpp b/source/tests/metacall_typescript_node_test/source/metacall_typescript_node_test.cpp index 9f51a73c4..95a65c98b 100644 --- a/source/tests/metacall_typescript_node_test/source/metacall_typescript_node_test.cpp +++ b/source/tests/metacall_typescript_node_test/source/metacall_typescript_node_test.cpp @@ -138,5 +138,5 @@ TEST_F(metacall_typescript_node_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_typescript_require_test/source/metacall_typescript_require_test.cpp b/source/tests/metacall_typescript_require_test/source/metacall_typescript_require_test.cpp index 8ec87717f..13d90c515 100644 --- a/source/tests/metacall_typescript_require_test/source/metacall_typescript_require_test.cpp +++ b/source/tests/metacall_typescript_require_test/source/metacall_typescript_require_test.cpp @@ -77,5 +77,5 @@ TEST_F(metacall_typescript_require_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_typescript_test/source/metacall_typescript_test.cpp b/source/tests/metacall_typescript_test/source/metacall_typescript_test.cpp index 60d186821..8b3488797 100644 --- a/source/tests/metacall_typescript_test/source/metacall_typescript_test.cpp +++ b/source/tests/metacall_typescript_test/source/metacall_typescript_test.cpp @@ -126,5 +126,5 @@ TEST_F(metacall_typescript_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_typescript_tsx_loop_fail_test/source/metacall_typescript_tsx_loop_fail_test.cpp b/source/tests/metacall_typescript_tsx_loop_fail_test/source/metacall_typescript_tsx_loop_fail_test.cpp index 1635e15a0..8256b3481 100644 --- a/source/tests/metacall_typescript_tsx_loop_fail_test/source/metacall_typescript_tsx_loop_fail_test.cpp +++ b/source/tests/metacall_typescript_tsx_loop_fail_test/source/metacall_typescript_tsx_loop_fail_test.cpp @@ -68,5 +68,5 @@ TEST_F(metacall_tsx_loop_fail_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp b/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp index 82a9dc0c6..0723b6eed 100644 --- a/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp +++ b/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp @@ -79,5 +79,5 @@ TEST_F(metacall_tsx_test, DefaultConstructor) metacall_allocator_destroy(allocator); } - EXPECT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } diff --git a/source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp b/source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp index eb49b144c..2c5515ed8 100644 --- a/source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp +++ b/source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp @@ -192,5 +192,5 @@ TEST_F(metacall_wasm_test, Default) ASSERT_EQ((int)1, (int)metacall_load_from_file("wasm", modules, sizeof(modules) / sizeof(modules[0]), NULL)); } - ASSERT_EQ((int)0, (int)metacall_destroy()); + metacall_destroy(); } From 5b592ac0e9a8e498e3e706623d0a788276f566e0 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 14 Jan 2025 17:12:21 +0100 Subject: [PATCH 137/487] Add NodeJS support for load_from_package and execution_path, add test with libgit2, solve issues c_loader. --- cmake/FindLibGit2.cmake | 78 ++++++ .../loaders/c_loader/source/c_loader_impl.cpp | 47 +++- .../node_loader/source/node_loader_port.cpp | 261 ++++++++++++++++++ source/ports/node_port/index.d.ts | 3 + source/ports/node_port/index.js | 39 +++ source/tests/CMakeLists.txt | 1 + .../CMakeLists.txt | 167 +++++++++++ .../source/main.cpp | 28 ++ .../source/metacall_node_port_c_lib_test.cpp | 57 ++++ tools/metacall-environment.ps1 | 21 ++ tools/metacall-environment.sh | 17 +- 11 files changed, 711 insertions(+), 8 deletions(-) create mode 100644 cmake/FindLibGit2.cmake create mode 100644 source/tests/metacall_node_port_c_lib_test/CMakeLists.txt create mode 100644 source/tests/metacall_node_port_c_lib_test/source/main.cpp create mode 100644 source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp diff --git a/cmake/FindLibGit2.cmake b/cmake/FindLibGit2.cmake new file mode 100644 index 000000000..787b5319c --- /dev/null +++ b/cmake/FindLibGit2.cmake @@ -0,0 +1,78 @@ +# +# CMake Find LibGit2 Library by Parra Studios +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# + +# Find libgit2 library and include paths +# +# LibGit2_FOUND - True if LibGit2 was found +# LibGit2_INCLUDE_DIR - LibGit2 headers path +# LibGit2_VERSION - LibGit2 version +# LibGit2_VERSION_MAJOR - LibGit2 major version +# LibGit2_VERSION_MINOR - LibGit2 minor version +# LibGit2_VERSION_REVISION - LibGit2 patch version +# LibGit2_LIBRARY - LibGit2 shared library +# LibGit2_LIBRARY_DIR - LibGit2 shared library folder +# + +# Prevent vervosity if already included +if(LibGit2_LIBRARY) + set(LibGit2_FIND_QUIETLY TRUE) +endif() + +# Include package manager +include(FindPackageHandleStandardArgs) + +# Find via PkgConfig +find_package(PkgConfig QUIET) +pkg_check_modules(PKG_GIT2 QUIET libgit2) + +if(NOT LibGit2_DEFINITIONS) + set(LibGit2_DEFINITIONS ${PKG_GIT2_CFLAGS_OTHER}) +endif() + +if(NOT LibGit2_INCLUDE_DIR) + find_path(LibGit2_INCLUDE_DIR + NAMES git2.h + HINTS ${PKG_GIT2_INCLUDE_DIRS} + ) +endif() + +if(NOT LibGit2_VERSION AND LibGit2_INCLUDE_DIR) + file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_MAJOR REGEX "^#define LIBGIT2_VER_MAJOR +([0-9]+)") + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_MAJOR ${LibGit2_VERSION_MAJOR}) + + file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_MINOR REGEX "^#define LIBGIT2_VER_MINOR +([0-9]+)") + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_MINOR ${LibGit2_VERSION_MINOR}) + + file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_REVISION REGEX "^#define LIBGIT2_VER_REVISION +([0-9]+)") + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_REVISION ${LibGit2_VERSION_REVISION}) + + set(LibGit2_VERSION "${LibGit2_VERSION_MAJOR}.${LibGit2_VERSION_MINOR}.${LibGit2_VERSION_REVISION}") +endif() + +if(NOT LibGit2_LIBRARY) + find_library(LibGit2_LIBRARY + NAMES git2 + HINTS ${PKG_GIT2_LIBRARY_DIRS} + ) +endif() + +set(LibGit2_LIBRARIES ${LibGit2_LIBRARY}) +set(LibGit2_INCLUDE_DIRS ${LibGit2_INCLUDE_DIR}) +get_filename_component(LibGit2_LIBRARY_DIR ${LibGit2_LIBRARY} DIRECTORY) + +# Define package +find_package_handle_standard_args(LibGit2 + FOUND_VAR + LibGit2_FOUND + REQUIRED_VARS + LibGit2_LIBRARY + LibGit2_LIBRARY_DIR + LibGit2_INCLUDE_DIR + LibGit2_INCLUDE_DIRS + VERSION_VAR + LibGit2_VERSION +) + +mark_as_advanced(LibGit2_LIBRARY LibGit2_LIBRARY_DIR LibGit2_INCLUDE_DIR) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index 52ead7b7c..4ad6689bf 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -81,6 +81,8 @@ typedef struct loader_impl_c_handle_base_type virtual ~loader_impl_c_handle_base_type() {} + virtual bool recursive_includes() = 0; + virtual int discover(loader_impl impl, context ctx) = 0; virtual const void *symbol(std::string &name) = 0; @@ -136,6 +138,11 @@ typedef struct loader_impl_c_handle_tcc_type : loader_impl_c_handle_base_type } } + bool recursive_includes() + { + return false; + } + bool initialize(loader_impl_c c_impl) { this->state = tcc_new(); @@ -232,6 +239,11 @@ typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_typ } } + bool recursive_includes() + { + return true; + } + bool initialize(loader_impl_c c_impl, const loader_path path) { std::string lib_path_str(path); @@ -1022,12 +1034,18 @@ static int c_loader_impl_discover_signature(loader_impl impl, loader_impl_c_hand symbol_name.insert(0, 1, '_'); #endif + if (scope_get(sp, symbol_name.c_str()) != NULL) + { + log_write("metacall", LOG_LEVEL_WARNING, "Symbol '%s' redefined, skipping the function", func_name.c_str()); + return 0; + } + const void *address = c_handle->symbol(symbol_name); if (address == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Symbol '%s' not found, skipping the function", func_name.c_str()); - return 1; + log_write("metacall", LOG_LEVEL_WARNING, "Symbol '%s' not found, skipping the function", func_name.c_str()); + return 0; } loader_impl_c_function c_function = new loader_impl_c_function_type(address); @@ -1080,9 +1098,13 @@ static CXChildVisitResult c_loader_impl_discover_visitor(CXCursor cursor, CXCurs { c_loader_impl_discover_visitor_data visitor_data = static_cast<c_loader_impl_discover_visitor_data>(data); - if (clang_Location_isFromMainFile(clang_getCursorLocation(cursor)) == 0) + /* Include recursively when disabled, include only the header inlcuded is populated when enabled */ + if (visitor_data->c_handle->recursive_includes() == false) { - return CXChildVisit_Continue; + if (clang_Location_isFromMainFile(clang_getCursorLocation(cursor)) == 0) + { + return CXChildVisit_Continue; + } } CXCursorKind kind = clang_getCursorKind(cursor); @@ -1102,6 +1124,7 @@ static CXChildVisitResult c_loader_impl_discover_visitor(CXCursor cursor, CXCurs static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_base c_handle, context ctx) { + loader_impl_c c_impl = static_cast<loader_impl_c>(loader_impl_get(impl)); c_loader_impl_discover_visitor_data_type data = { impl, c_handle, @@ -1109,12 +1132,24 @@ static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_bas 0 }; + std::vector<std::string> includes; + std::vector<const char *> command_line_args; + + /* Otherwise, check the execution paths */ + for (auto exec_path : c_impl->execution_paths) + { + includes.push_back("-I" + exec_path); + command_line_args.push_back(includes.back().c_str()); + } + for (std::string file : c_handle->files) { - CXIndex index = clang_createIndex(0, 0); + /* Define the command line arguments (simulating compiler flags) */ + CXIndex index = clang_createIndex(0, 1); CXTranslationUnit unit = clang_parseTranslationUnit( index, - file.c_str(), nullptr, 0, + file.c_str(), + command_line_args.data(), command_line_args.size(), nullptr, 0, CXTranslationUnit_None); diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index ed681f1e9..a072f934f 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -281,6 +281,94 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info return promise; } +/** +* @brief +* Define an execution path into a runtime +* +* @param[in] env +* N-API reference to the enviroment +* +* @param[in] info +* Reference to the call information +* +* @return +* TODO: Not implemented yet +*/ +napi_value node_loader_port_metacall_execution_path(napi_env env, napi_callback_info info) +{ + const size_t args_size = 2; + size_t argc = args_size, tag_length, path_length; + napi_value argv[args_size]; + + /* Get arguments */ + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); + + node_loader_impl_exception(env, status); + + /* Get tag length */ + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); + + node_loader_impl_exception(env, status); + + /* Allocate tag */ + char *tag = new char[tag_length + 1]; + + if (tag == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not define an execution path, tag allocation failed"); + return nullptr; + } + + /* Get tag */ + status = napi_get_value_string_utf8(env, argv[0], tag, tag_length + 1, &tag_length); + + node_loader_impl_exception(env, status); + + /* Get path length */ + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &path_length); + + node_loader_impl_exception(env, status); + + size_t path_size = path_length + 1; + + /* Allocate path */ + char *path = new char[path_size]; + + if (path == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not define an execution path, path allocation failed"); + delete[] tag; + return nullptr; + } + + /* Get path */ + status = napi_get_value_string_utf8(env, argv[1], path, path_size, &path_length); + + node_loader_impl_exception(env, status); + + /* Obtain NodeJS loader implementation */ + loader_impl impl = loader_get_impl(node_loader_tag); + loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + + /* Store current reference of the environment */ + node_loader_impl_env(node_impl, env); + + /* Define execution path */ + if (metacall_execution_path(tag, path) != 0) + { + napi_throw_error(env, nullptr, "MetaCall could not define an execution path"); + } + + /* Release current reference of the environment */ + // node_loader_impl_env(node_impl, nullptr); + + delete[] tag; + delete[] path; + + /* TODO: Return value and logs */ + return nullptr; +} + napi_value node_loader_port_metacall_load_from_file(napi_env env, napi_callback_info info) { /* TODO: Detect if input argument types are valid */ @@ -628,6 +716,176 @@ napi_value node_loader_port_metacall_load_from_memory_export(napi_env env, napi_ return v_exports; } +/** +* @brief +* Load a package by tag +* +* @param[in] env +* N-API reference to the enviroment +* +* @param[in] info +* Reference to the call information +* +* @return +* TODO: Not implemented yet +*/ +napi_value node_loader_port_metacall_load_from_package(napi_env env, napi_callback_info info) +{ + const size_t args_size = 2; + size_t argc = args_size, tag_length, package_length; + napi_value argv[args_size]; + + /* Get arguments */ + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); + + node_loader_impl_exception(env, status); + + /* Get tag length */ + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); + + node_loader_impl_exception(env, status); + + /* Allocate tag */ + char *tag = new char[tag_length + 1]; + + if (tag == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not load from package, tag allocation failed"); + return nullptr; + } + + /* Get tag */ + status = napi_get_value_string_utf8(env, argv[0], tag, tag_length + 1, &tag_length); + + node_loader_impl_exception(env, status); + + /* Get package length */ + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &package_length); + + node_loader_impl_exception(env, status); + + size_t package_size = package_length + 1; + + /* Allocate package */ + char *package = new char[package_size]; + + if (package == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not load from package, package allocation failed"); + delete[] tag; + return nullptr; + } + + /* Get package */ + status = napi_get_value_string_utf8(env, argv[1], package, package_size, &package_length); + + node_loader_impl_exception(env, status); + + /* Obtain NodeJS loader implementation */ + loader_impl impl = loader_get_impl(node_loader_tag); + loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + + /* Store current reference of the environment */ + node_loader_impl_env(node_impl, env); + + /* Load the package */ + if (metacall_load_from_package(tag, package, NULL) != 0) + { + napi_throw_error(env, nullptr, "MetaCall could not load a package"); + } + + /* Release current reference of the environment */ + // node_loader_impl_env(node_impl, nullptr); + + delete[] tag; + delete[] package; + + /* TODO: Return value and logs */ + return nullptr; +} + +napi_value node_loader_port_metacall_load_from_package_export(napi_env env, napi_callback_info info) +{ + const size_t args_size = 2; + size_t argc = args_size, tag_length, package_length; + napi_value argv[args_size]; + + /* Get arguments */ + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); + + node_loader_impl_exception(env, status); + + /* Get tag length */ + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); + + node_loader_impl_exception(env, status); + + /* Allocate tag */ + char *tag = new char[tag_length + 1]; + + if (tag == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not load from memory, tag allocation failed"); + return nullptr; + } + + /* Get tag */ + status = napi_get_value_string_utf8(env, argv[0], tag, tag_length + 1, &tag_length); + + node_loader_impl_exception(env, status); + + /* Get package length */ + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &package_length); + + node_loader_impl_exception(env, status); + + size_t package_size = package_length + 1; + + /* Allocate package */ + char *package = new char[package_size]; + + if (package == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not load from package, package allocation failed"); + delete[] tag; + return nullptr; + } + + /* Get package */ + status = napi_get_value_string_utf8(env, argv[1], package, package_size, &package_length); + + node_loader_impl_exception(env, status); + + /* Obtain NodeJS loader implementation */ + loader_impl impl = loader_get_impl(node_loader_tag); + loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + + /* Store current reference of the environment */ + node_loader_impl_env(node_impl, env); + + void *handle = NULL; + + /* Load package from package */ + if (metacall_load_from_package(tag, package, &handle) != 0) + { + napi_throw_error(env, nullptr, "MetaCall could not load from package"); + } + + /* Release current reference of the environment */ + // node_loader_impl_env(node_impl, nullptr); + + delete[] tag; + delete[] package; + + void *exports = metacall_handle_export(handle); + + napi_value v_exports = node_loader_impl_value_to_napi(node_impl, env, exports); + + node_loader_impl_finalizer(env, v_exports, exports); + + return v_exports; +} + /** * @brief * Loads a script from configuration path @@ -816,10 +1074,13 @@ void node_loader_port_exports(napi_env env, napi_value exports) x(metacall); \ x(metacallfms); \ x(metacall_await); \ + x(metacall_execution_path); \ x(metacall_load_from_file); \ x(metacall_load_from_file_export); \ x(metacall_load_from_memory); \ x(metacall_load_from_memory_export); \ + x(metacall_load_from_package); \ + x(metacall_load_from_package_export); \ x(metacall_load_from_configuration); \ x(metacall_load_from_configuration_export); \ x(metacall_inspect); \ diff --git a/source/ports/node_port/index.d.ts b/source/ports/node_port/index.d.ts index 7b1d6d1bd..3be9a4809 100644 --- a/source/ports/node_port/index.d.ts +++ b/source/ports/node_port/index.d.ts @@ -1,10 +1,13 @@ declare module 'metacall' { export function metacall(name: string, ...args: any): any; export function metacallfms(name: string, buffer: string): any; + export function metacall_execution_path(tag: string, path: string): number; export function metacall_load_from_file(tag: string, paths: string[]): number; export function metacall_load_from_file_export(tag: string, paths: string[]): any; export function metacall_load_from_memory(tag: string, code: string): number; export function metacall_load_from_memory_export(tag: string, code: string): any; + export function metacall_load_from_package(tag: string, pkg: string): number; + export function metacall_load_from_package_export(tag: string, pkg: string): any; export function metacall_load_from_configuration(path: string): number; export function metacall_load_from_configuration_export(path: string): any; export function metacall_inspect(): any; diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 8d690b6d8..6d15c028e 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -102,6 +102,18 @@ const metacall_await = (name, ...args) => { return addon.metacall_await(name, ...args); }; +const metacall_execution_path = (tag, path) => { + if (Object.prototype.toString.call(tag) !== '[object String]') { + throw Error('Tag should be a string indicating the id of the loader to be used [py, rb, cs, js, node, mock...].'); + } + + if (Object.prototype.toString.call(path) !== '[object String]') { + throw Error('The path should be of string type.'); + } + + return addon.metacall_execution_path(tag, path); +}; + const metacall_load_from_file = (tag, paths) => { if (Object.prototype.toString.call(tag) !== '[object String]') { throw Error('Tag should be a string indicating the id of the loader to be used [py, rb, cs, js, node, mock...].'); @@ -150,6 +162,30 @@ const metacall_load_from_memory_export = (tag, code) => { return addon.metacall_load_from_memory_export(tag, code); }; +const metacall_load_from_package = (tag, pkg) => { + if (Object.prototype.toString.call(tag) !== '[object String]') { + throw Error('Tag should be a string indicating the id of the loader to be used [py, rb, cs, js, node, mock...].'); + } + + if (Object.prototype.toString.call(pkg) !== '[object String]') { + throw Error('Package should be a string with the id or path to the package.'); + } + + return addon.metacall_load_from_package(tag, pkg); +}; + +const metacall_load_from_package_export = (tag, pkg) => { + if (Object.prototype.toString.call(tag) !== '[object String]') { + throw Error('Tag should be a string indicating the id of the loader to be used [py, rb, cs, js, node, mock...].'); + } + + if (Object.prototype.toString.call(pkg) !== '[object String]') { + throw Error('Package should be a string with the id or path to the package.'); + } + + return addon.metacall_load_from_package_export(tag, pkg); +}; + const metacall_load_from_configuration = (path) => { if (Object.prototype.toString.call(path) !== '[object String]') { throw Error('Path should be a string indicating the path where the metacall.json is located.'); @@ -207,10 +243,13 @@ const module_exports = { metacallfms, metacall_await, metacall_inspect, + metacall_execution_path, metacall_load_from_file, metacall_load_from_file_export, metacall_load_from_memory, metacall_load_from_memory_export, + metacall_load_from_package, + metacall_load_from_package_export, metacall_load_from_configuration, metacall_load_from_configuration_export, metacall_handle, diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index eb70ae1c7..aca1cfdaa 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -128,6 +128,7 @@ add_subdirectory(metacall_node_reentrant_test) add_subdirectory(metacall_node_port_test) add_subdirectory(metacall_node_port_await_test) add_subdirectory(metacall_node_port_rs_test) +add_subdirectory(metacall_node_port_c_lib_test) add_subdirectory(metacall_node_python_port_mock_test) add_subdirectory(metacall_node_python_port_ruby_test) add_subdirectory(metacall_node_python_ruby_test) diff --git a/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt new file mode 100644 index 000000000..0f4436b10 --- /dev/null +++ b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt @@ -0,0 +1,167 @@ +# Check if this loader is enabled +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_LOADERS_C OR NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_NODE) + return() +endif() + +# +# External dependencies +# + +find_package(LibGit2) + +if(NOT LibGit2_FOUND) + message(WARNING "LibGit2 libraries not found, skipping test metacall-node-port-c-lib-test") + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-node-port-c-lib-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_node_port_c_lib_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::metacall +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} + + # NodeJS Port path + METACALL_NODE_PORT_PATH="${CMAKE_SOURCE_DIR}/source/ports/node_port/index.js" + + # LibGit2 paths + LIBGIT2_LIBRARY_DIR="${LibGit2_LIBRARY_DIR}" + LIBGIT2_INCLUDE_DIR="${LibGit2_INCLUDE_DIR}" +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Linker options +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $<TARGET_FILE:${target}> +) + +# +# Define dependencies +# + +add_dependencies(${target} + node_port + node_loader + c_loader +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} +) diff --git a/source/tests/metacall_node_port_c_lib_test/source/main.cpp b/source/tests/metacall_node_port_c_lib_test/source/main.cpp new file mode 100644 index 000000000..11ddf3f59 --- /dev/null +++ b/source/tests/metacall_node_port_c_lib_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp b/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp new file mode 100644 index 000000000..faa944974 --- /dev/null +++ b/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp @@ -0,0 +1,57 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +#include <metacall/metacall.h> +#include <metacall/metacall_loaders.h> +#include <metacall/metacall_value.h> + +class metacall_node_port_c_lib_test : public testing::Test +{ +public: +}; + +TEST_F(metacall_node_port_c_lib_test, DefaultConstructor) +{ + metacall_print_info(); + + ASSERT_EQ((int)0, (int)metacall_initialize()); + + static const char buffer[] = + /* NodeJS */ + "const assert = require('assert');\n" + "const { metacall_execution_path, metacall_load_from_package_export } = require('" METACALL_NODE_PORT_PATH "');\n" + /* C Lib Paths */ + "metacall_execution_path('c', '" LIBGIT2_INCLUDE_DIR "');\n" + "metacall_execution_path('c', '" LIBGIT2_LIBRARY_DIR "');\n" + /* C Lib Require */ + "const git2 = metacall_load_from_package_export('c', 'git2');\n" + "const { git_libgit2_init, git_libgit2_shutdown } = git2;\n" + "console.log(git2);\n" + /* C Lib Assert */ + "assert(git_libgit2_init() >= 0, 'libgit2 initialization failed');\n" + "git_libgit2_shutdown();\n" + "\n"; + + ASSERT_EQ((int)0, (int)metacall_load_from_memory("node", buffer, sizeof(buffer), NULL)); + + metacall_destroy(); +} diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index 1638de22c..dd2191520 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -126,6 +126,27 @@ function Set-Nodejs { Write-Output "-DNodeJS_EXECUTABLE=""$NodeDir/node.exe""" >> $EnvOpts Write-Output "-DNodeJS_LIBRARY_NAME=""libnode.dll""" >> $EnvOpts Write-Output "-DNodeJS_LIBRARY_NAME_PATH=""$NodeDir/lib/libnode.dll""" >> $EnvOpts + + if ($Arguments -contains "c") { + # Required for test source/tests/metacall_node_port_c_lib_test + if (!(Test-Path -Path "$DepsDir\libgit2")) { + # Clone libgit2 + git clone --depth 1 --branch v1.8.4 https://github.com/libgit2/libgit2 + } + + $InstallDir = "$DepsDir\libgit2\build\dist" + + mkdir "$DepsDir\libgit2\build" + mkdir "$InstallDir" + Set-Location "$DepsDir\libgit2\build" + + cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=OFF -DBUILD_CLI=OFF .. + cmake --build . "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" + cmake --install . --prefix "$InstallDir" + + Write-Output "-DLibGit2_LIBRARY=""$InstallDir\lib\git2.lib""" >> $EnvOpts + Write-Output "-DLibGit2_INCLUDE_DIR=""$InstallDir\include""" >> $EnvOpts + } } function Set-Java { diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 304fa6a02..d2983330b 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -464,11 +464,18 @@ sub_nodejs(){ cd $ROOT_DIR if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then + if [ $INSTALL_C = 1 ]; then + # Required for test source/tests/metacall_node_port_c_lib_test + INSTALL_LIBGIT2="libgit2-dev" + else + INSTALL_LIBGIT2="" + fi + if [ "${LINUX_DISTRO}" = "debian" ] || [ "${LINUX_DISTRO}" = "ubuntu" ]; then # Note that Python is required for GYP - $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends python3 g++ make nodejs npm curl + $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends python3 g++ make nodejs npm curl $INSTALL_LIBGIT2 elif [ "${LINUX_DISTRO}" = "alpine" ]; then - $SUDO_CMD apk add --no-cache python3 g++ make nodejs nodejs-dev npm curl + $SUDO_CMD apk add --no-cache python3 g++ make nodejs nodejs-dev npm curl $INSTALL_LIBGIT2 # Build dependencies (note libexecinfo-dev is not available in Alpine 3.17) $SUDO_CMD apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main linux-headers libexecinfo libexecinfo-dev @@ -557,6 +564,12 @@ sub_nodejs(){ # Configure NPM path echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH + if [ $INSTALL_C = 1 ]; then + # Required for test source/tests/metacall_node_port_c_lib_test + brew install libgit2@1.8 + brew link libgit2@1.8 --force --overwrite + fi + # fi fi } From 0fe22954b27534e32a51c8b2a021c87b50cce7d1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 14 Jan 2025 17:12:21 +0100 Subject: [PATCH 138/487] Add NodeJS support for load_from_package and execution_path, add test with libgit2, solve issues c_loader. --- cmake/FindLibGit2.cmake | 78 ++++++ .../loaders/c_loader/source/c_loader_impl.cpp | 47 +++- .../node_loader/source/node_loader_port.cpp | 261 ++++++++++++++++++ source/ports/node_port/index.d.ts | 3 + source/ports/node_port/index.js | 39 +++ source/tests/CMakeLists.txt | 1 + .../CMakeLists.txt | 167 +++++++++++ .../source/main.cpp | 28 ++ .../source/metacall_node_port_c_lib_test.cpp | 57 ++++ tools/metacall-environment.ps1 | 21 ++ tools/metacall-environment.sh | 17 +- 11 files changed, 711 insertions(+), 8 deletions(-) create mode 100644 cmake/FindLibGit2.cmake create mode 100644 source/tests/metacall_node_port_c_lib_test/CMakeLists.txt create mode 100644 source/tests/metacall_node_port_c_lib_test/source/main.cpp create mode 100644 source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp diff --git a/cmake/FindLibGit2.cmake b/cmake/FindLibGit2.cmake new file mode 100644 index 000000000..787b5319c --- /dev/null +++ b/cmake/FindLibGit2.cmake @@ -0,0 +1,78 @@ +# +# CMake Find LibGit2 Library by Parra Studios +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# + +# Find libgit2 library and include paths +# +# LibGit2_FOUND - True if LibGit2 was found +# LibGit2_INCLUDE_DIR - LibGit2 headers path +# LibGit2_VERSION - LibGit2 version +# LibGit2_VERSION_MAJOR - LibGit2 major version +# LibGit2_VERSION_MINOR - LibGit2 minor version +# LibGit2_VERSION_REVISION - LibGit2 patch version +# LibGit2_LIBRARY - LibGit2 shared library +# LibGit2_LIBRARY_DIR - LibGit2 shared library folder +# + +# Prevent vervosity if already included +if(LibGit2_LIBRARY) + set(LibGit2_FIND_QUIETLY TRUE) +endif() + +# Include package manager +include(FindPackageHandleStandardArgs) + +# Find via PkgConfig +find_package(PkgConfig QUIET) +pkg_check_modules(PKG_GIT2 QUIET libgit2) + +if(NOT LibGit2_DEFINITIONS) + set(LibGit2_DEFINITIONS ${PKG_GIT2_CFLAGS_OTHER}) +endif() + +if(NOT LibGit2_INCLUDE_DIR) + find_path(LibGit2_INCLUDE_DIR + NAMES git2.h + HINTS ${PKG_GIT2_INCLUDE_DIRS} + ) +endif() + +if(NOT LibGit2_VERSION AND LibGit2_INCLUDE_DIR) + file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_MAJOR REGEX "^#define LIBGIT2_VER_MAJOR +([0-9]+)") + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_MAJOR ${LibGit2_VERSION_MAJOR}) + + file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_MINOR REGEX "^#define LIBGIT2_VER_MINOR +([0-9]+)") + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_MINOR ${LibGit2_VERSION_MINOR}) + + file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_REVISION REGEX "^#define LIBGIT2_VER_REVISION +([0-9]+)") + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_REVISION ${LibGit2_VERSION_REVISION}) + + set(LibGit2_VERSION "${LibGit2_VERSION_MAJOR}.${LibGit2_VERSION_MINOR}.${LibGit2_VERSION_REVISION}") +endif() + +if(NOT LibGit2_LIBRARY) + find_library(LibGit2_LIBRARY + NAMES git2 + HINTS ${PKG_GIT2_LIBRARY_DIRS} + ) +endif() + +set(LibGit2_LIBRARIES ${LibGit2_LIBRARY}) +set(LibGit2_INCLUDE_DIRS ${LibGit2_INCLUDE_DIR}) +get_filename_component(LibGit2_LIBRARY_DIR ${LibGit2_LIBRARY} DIRECTORY) + +# Define package +find_package_handle_standard_args(LibGit2 + FOUND_VAR + LibGit2_FOUND + REQUIRED_VARS + LibGit2_LIBRARY + LibGit2_LIBRARY_DIR + LibGit2_INCLUDE_DIR + LibGit2_INCLUDE_DIRS + VERSION_VAR + LibGit2_VERSION +) + +mark_as_advanced(LibGit2_LIBRARY LibGit2_LIBRARY_DIR LibGit2_INCLUDE_DIR) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index 52ead7b7c..4ad6689bf 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -81,6 +81,8 @@ typedef struct loader_impl_c_handle_base_type virtual ~loader_impl_c_handle_base_type() {} + virtual bool recursive_includes() = 0; + virtual int discover(loader_impl impl, context ctx) = 0; virtual const void *symbol(std::string &name) = 0; @@ -136,6 +138,11 @@ typedef struct loader_impl_c_handle_tcc_type : loader_impl_c_handle_base_type } } + bool recursive_includes() + { + return false; + } + bool initialize(loader_impl_c c_impl) { this->state = tcc_new(); @@ -232,6 +239,11 @@ typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_typ } } + bool recursive_includes() + { + return true; + } + bool initialize(loader_impl_c c_impl, const loader_path path) { std::string lib_path_str(path); @@ -1022,12 +1034,18 @@ static int c_loader_impl_discover_signature(loader_impl impl, loader_impl_c_hand symbol_name.insert(0, 1, '_'); #endif + if (scope_get(sp, symbol_name.c_str()) != NULL) + { + log_write("metacall", LOG_LEVEL_WARNING, "Symbol '%s' redefined, skipping the function", func_name.c_str()); + return 0; + } + const void *address = c_handle->symbol(symbol_name); if (address == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Symbol '%s' not found, skipping the function", func_name.c_str()); - return 1; + log_write("metacall", LOG_LEVEL_WARNING, "Symbol '%s' not found, skipping the function", func_name.c_str()); + return 0; } loader_impl_c_function c_function = new loader_impl_c_function_type(address); @@ -1080,9 +1098,13 @@ static CXChildVisitResult c_loader_impl_discover_visitor(CXCursor cursor, CXCurs { c_loader_impl_discover_visitor_data visitor_data = static_cast<c_loader_impl_discover_visitor_data>(data); - if (clang_Location_isFromMainFile(clang_getCursorLocation(cursor)) == 0) + /* Include recursively when disabled, include only the header inlcuded is populated when enabled */ + if (visitor_data->c_handle->recursive_includes() == false) { - return CXChildVisit_Continue; + if (clang_Location_isFromMainFile(clang_getCursorLocation(cursor)) == 0) + { + return CXChildVisit_Continue; + } } CXCursorKind kind = clang_getCursorKind(cursor); @@ -1102,6 +1124,7 @@ static CXChildVisitResult c_loader_impl_discover_visitor(CXCursor cursor, CXCurs static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_base c_handle, context ctx) { + loader_impl_c c_impl = static_cast<loader_impl_c>(loader_impl_get(impl)); c_loader_impl_discover_visitor_data_type data = { impl, c_handle, @@ -1109,12 +1132,24 @@ static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_bas 0 }; + std::vector<std::string> includes; + std::vector<const char *> command_line_args; + + /* Otherwise, check the execution paths */ + for (auto exec_path : c_impl->execution_paths) + { + includes.push_back("-I" + exec_path); + command_line_args.push_back(includes.back().c_str()); + } + for (std::string file : c_handle->files) { - CXIndex index = clang_createIndex(0, 0); + /* Define the command line arguments (simulating compiler flags) */ + CXIndex index = clang_createIndex(0, 1); CXTranslationUnit unit = clang_parseTranslationUnit( index, - file.c_str(), nullptr, 0, + file.c_str(), + command_line_args.data(), command_line_args.size(), nullptr, 0, CXTranslationUnit_None); diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index 773e62cca..4a4e22421 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -281,6 +281,94 @@ napi_value node_loader_port_metacall_await(napi_env env, napi_callback_info info return promise; } +/** +* @brief +* Define an execution path into a runtime +* +* @param[in] env +* N-API reference to the enviroment +* +* @param[in] info +* Reference to the call information +* +* @return +* TODO: Not implemented yet +*/ +napi_value node_loader_port_metacall_execution_path(napi_env env, napi_callback_info info) +{ + const size_t args_size = 2; + size_t argc = args_size, tag_length, path_length; + napi_value argv[args_size]; + + /* Get arguments */ + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); + + node_loader_impl_exception(env, status); + + /* Get tag length */ + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); + + node_loader_impl_exception(env, status); + + /* Allocate tag */ + char *tag = new char[tag_length + 1]; + + if (tag == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not define an execution path, tag allocation failed"); + return nullptr; + } + + /* Get tag */ + status = napi_get_value_string_utf8(env, argv[0], tag, tag_length + 1, &tag_length); + + node_loader_impl_exception(env, status); + + /* Get path length */ + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &path_length); + + node_loader_impl_exception(env, status); + + size_t path_size = path_length + 1; + + /* Allocate path */ + char *path = new char[path_size]; + + if (path == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not define an execution path, path allocation failed"); + delete[] tag; + return nullptr; + } + + /* Get path */ + status = napi_get_value_string_utf8(env, argv[1], path, path_size, &path_length); + + node_loader_impl_exception(env, status); + + /* Obtain NodeJS loader implementation */ + loader_impl impl = loader_get_impl(node_loader_tag); + loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + + /* Store current reference of the environment */ + node_loader_impl_env(node_impl, env); + + /* Define execution path */ + if (metacall_execution_path(tag, path) != 0) + { + napi_throw_error(env, nullptr, "MetaCall could not define an execution path"); + } + + /* Release current reference of the environment */ + // node_loader_impl_env(node_impl, nullptr); + + delete[] tag; + delete[] path; + + /* TODO: Return value and logs */ + return nullptr; +} + napi_value node_loader_port_metacall_load_from_file(napi_env env, napi_callback_info info) { /* TODO: Detect if input argument types are valid */ @@ -628,6 +716,176 @@ napi_value node_loader_port_metacall_load_from_memory_export(napi_env env, napi_ return v_exports; } +/** +* @brief +* Load a package by tag +* +* @param[in] env +* N-API reference to the enviroment +* +* @param[in] info +* Reference to the call information +* +* @return +* TODO: Not implemented yet +*/ +napi_value node_loader_port_metacall_load_from_package(napi_env env, napi_callback_info info) +{ + const size_t args_size = 2; + size_t argc = args_size, tag_length, package_length; + napi_value argv[args_size]; + + /* Get arguments */ + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); + + node_loader_impl_exception(env, status); + + /* Get tag length */ + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); + + node_loader_impl_exception(env, status); + + /* Allocate tag */ + char *tag = new char[tag_length + 1]; + + if (tag == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not load from package, tag allocation failed"); + return nullptr; + } + + /* Get tag */ + status = napi_get_value_string_utf8(env, argv[0], tag, tag_length + 1, &tag_length); + + node_loader_impl_exception(env, status); + + /* Get package length */ + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &package_length); + + node_loader_impl_exception(env, status); + + size_t package_size = package_length + 1; + + /* Allocate package */ + char *package = new char[package_size]; + + if (package == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not load from package, package allocation failed"); + delete[] tag; + return nullptr; + } + + /* Get package */ + status = napi_get_value_string_utf8(env, argv[1], package, package_size, &package_length); + + node_loader_impl_exception(env, status); + + /* Obtain NodeJS loader implementation */ + loader_impl impl = loader_get_impl(node_loader_tag); + loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + + /* Store current reference of the environment */ + node_loader_impl_env(node_impl, env); + + /* Load the package */ + if (metacall_load_from_package(tag, package, NULL) != 0) + { + napi_throw_error(env, nullptr, "MetaCall could not load a package"); + } + + /* Release current reference of the environment */ + // node_loader_impl_env(node_impl, nullptr); + + delete[] tag; + delete[] package; + + /* TODO: Return value and logs */ + return nullptr; +} + +napi_value node_loader_port_metacall_load_from_package_export(napi_env env, napi_callback_info info) +{ + const size_t args_size = 2; + size_t argc = args_size, tag_length, package_length; + napi_value argv[args_size]; + + /* Get arguments */ + napi_status status = napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr); + + node_loader_impl_exception(env, status); + + /* Get tag length */ + status = napi_get_value_string_utf8(env, argv[0], nullptr, 0, &tag_length); + + node_loader_impl_exception(env, status); + + /* Allocate tag */ + char *tag = new char[tag_length + 1]; + + if (tag == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not load from memory, tag allocation failed"); + return nullptr; + } + + /* Get tag */ + status = napi_get_value_string_utf8(env, argv[0], tag, tag_length + 1, &tag_length); + + node_loader_impl_exception(env, status); + + /* Get package length */ + status = napi_get_value_string_utf8(env, argv[1], nullptr, 0, &package_length); + + node_loader_impl_exception(env, status); + + size_t package_size = package_length + 1; + + /* Allocate package */ + char *package = new char[package_size]; + + if (package == nullptr) + { + napi_throw_error(env, nullptr, "MetaCall could not load from package, package allocation failed"); + delete[] tag; + return nullptr; + } + + /* Get package */ + status = napi_get_value_string_utf8(env, argv[1], package, package_size, &package_length); + + node_loader_impl_exception(env, status); + + /* Obtain NodeJS loader implementation */ + loader_impl impl = loader_get_impl(node_loader_tag); + loader_impl_node node_impl = (loader_impl_node)loader_impl_get(impl); + + /* Store current reference of the environment */ + node_loader_impl_env(node_impl, env); + + void *handle = NULL; + + /* Load package from package */ + if (metacall_load_from_package(tag, package, &handle) != 0) + { + napi_throw_error(env, nullptr, "MetaCall could not load from package"); + } + + /* Release current reference of the environment */ + // node_loader_impl_env(node_impl, nullptr); + + delete[] tag; + delete[] package; + + void *exports = metacall_handle_export(handle); + + napi_value v_exports = node_loader_impl_value_to_napi(node_impl, env, exports); + + node_loader_impl_finalizer(env, v_exports, exports); + + return v_exports; +} + /** * @brief * Loads a script from configuration path @@ -829,10 +1087,13 @@ void node_loader_port_exports(napi_env env, napi_value exports) x(metacall); \ x(metacallfms); \ x(metacall_await); \ + x(metacall_execution_path); \ x(metacall_load_from_file); \ x(metacall_load_from_file_export); \ x(metacall_load_from_memory); \ x(metacall_load_from_memory_export); \ + x(metacall_load_from_package); \ + x(metacall_load_from_package_export); \ x(metacall_load_from_configuration); \ x(metacall_load_from_configuration_export); \ x(metacall_inspect); \ diff --git a/source/ports/node_port/index.d.ts b/source/ports/node_port/index.d.ts index 7b1d6d1bd..3be9a4809 100644 --- a/source/ports/node_port/index.d.ts +++ b/source/ports/node_port/index.d.ts @@ -1,10 +1,13 @@ declare module 'metacall' { export function metacall(name: string, ...args: any): any; export function metacallfms(name: string, buffer: string): any; + export function metacall_execution_path(tag: string, path: string): number; export function metacall_load_from_file(tag: string, paths: string[]): number; export function metacall_load_from_file_export(tag: string, paths: string[]): any; export function metacall_load_from_memory(tag: string, code: string): number; export function metacall_load_from_memory_export(tag: string, code: string): any; + export function metacall_load_from_package(tag: string, pkg: string): number; + export function metacall_load_from_package_export(tag: string, pkg: string): any; export function metacall_load_from_configuration(path: string): number; export function metacall_load_from_configuration_export(path: string): any; export function metacall_inspect(): any; diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 2372b3fd5..296e33e68 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -185,6 +185,18 @@ const metacall_await = (name, ...args) => { return addon.metacall_await(name, ...args); }; +const metacall_execution_path = (tag, path) => { + if (Object.prototype.toString.call(tag) !== '[object String]') { + throw Error('Tag should be a string indicating the id of the loader to be used [py, rb, cs, js, node, mock...].'); + } + + if (Object.prototype.toString.call(path) !== '[object String]') { + throw Error('The path should be of string type.'); + } + + return addon.metacall_execution_path(tag, path); +}; + const metacall_load_from_file = (tag, paths) => { if (Object.prototype.toString.call(tag) !== '[object String]') { throw Error('Tag should be a string indicating the id of the loader to be used [py, rb, cs, js, node, mock...].'); @@ -233,6 +245,30 @@ const metacall_load_from_memory_export = (tag, code) => { return addon.metacall_load_from_memory_export(tag, code); }; +const metacall_load_from_package = (tag, pkg) => { + if (Object.prototype.toString.call(tag) !== '[object String]') { + throw Error('Tag should be a string indicating the id of the loader to be used [py, rb, cs, js, node, mock...].'); + } + + if (Object.prototype.toString.call(pkg) !== '[object String]') { + throw Error('Package should be a string with the id or path to the package.'); + } + + return addon.metacall_load_from_package(tag, pkg); +}; + +const metacall_load_from_package_export = (tag, pkg) => { + if (Object.prototype.toString.call(tag) !== '[object String]') { + throw Error('Tag should be a string indicating the id of the loader to be used [py, rb, cs, js, node, mock...].'); + } + + if (Object.prototype.toString.call(pkg) !== '[object String]') { + throw Error('Package should be a string with the id or path to the package.'); + } + + return addon.metacall_load_from_package_export(tag, pkg); +}; + const metacall_load_from_configuration = (path) => { if (Object.prototype.toString.call(path) !== '[object String]') { throw Error('Path should be a string indicating the path where the metacall.json is located.'); @@ -290,10 +326,13 @@ const module_exports = { metacallfms, metacall_await, metacall_inspect, + metacall_execution_path, metacall_load_from_file, metacall_load_from_file_export, metacall_load_from_memory, metacall_load_from_memory_export, + metacall_load_from_package, + metacall_load_from_package_export, metacall_load_from_configuration, metacall_load_from_configuration_export, metacall_handle, diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index eb70ae1c7..aca1cfdaa 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -128,6 +128,7 @@ add_subdirectory(metacall_node_reentrant_test) add_subdirectory(metacall_node_port_test) add_subdirectory(metacall_node_port_await_test) add_subdirectory(metacall_node_port_rs_test) +add_subdirectory(metacall_node_port_c_lib_test) add_subdirectory(metacall_node_python_port_mock_test) add_subdirectory(metacall_node_python_port_ruby_test) add_subdirectory(metacall_node_python_ruby_test) diff --git a/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt new file mode 100644 index 000000000..0f4436b10 --- /dev/null +++ b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt @@ -0,0 +1,167 @@ +# Check if this loader is enabled +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_LOADERS_C OR NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_NODE) + return() +endif() + +# +# External dependencies +# + +find_package(LibGit2) + +if(NOT LibGit2_FOUND) + message(WARNING "LibGit2 libraries not found, skipping test metacall-node-port-c-lib-test") + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-node-port-c-lib-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_node_port_c_lib_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::metacall +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} + + # NodeJS Port path + METACALL_NODE_PORT_PATH="${CMAKE_SOURCE_DIR}/source/ports/node_port/index.js" + + # LibGit2 paths + LIBGIT2_LIBRARY_DIR="${LibGit2_LIBRARY_DIR}" + LIBGIT2_INCLUDE_DIR="${LibGit2_INCLUDE_DIR}" +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Linker options +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $<TARGET_FILE:${target}> +) + +# +# Define dependencies +# + +add_dependencies(${target} + node_port + node_loader + c_loader +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} +) diff --git a/source/tests/metacall_node_port_c_lib_test/source/main.cpp b/source/tests/metacall_node_port_c_lib_test/source/main.cpp new file mode 100644 index 000000000..11ddf3f59 --- /dev/null +++ b/source/tests/metacall_node_port_c_lib_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp b/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp new file mode 100644 index 000000000..faa944974 --- /dev/null +++ b/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp @@ -0,0 +1,57 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +#include <metacall/metacall.h> +#include <metacall/metacall_loaders.h> +#include <metacall/metacall_value.h> + +class metacall_node_port_c_lib_test : public testing::Test +{ +public: +}; + +TEST_F(metacall_node_port_c_lib_test, DefaultConstructor) +{ + metacall_print_info(); + + ASSERT_EQ((int)0, (int)metacall_initialize()); + + static const char buffer[] = + /* NodeJS */ + "const assert = require('assert');\n" + "const { metacall_execution_path, metacall_load_from_package_export } = require('" METACALL_NODE_PORT_PATH "');\n" + /* C Lib Paths */ + "metacall_execution_path('c', '" LIBGIT2_INCLUDE_DIR "');\n" + "metacall_execution_path('c', '" LIBGIT2_LIBRARY_DIR "');\n" + /* C Lib Require */ + "const git2 = metacall_load_from_package_export('c', 'git2');\n" + "const { git_libgit2_init, git_libgit2_shutdown } = git2;\n" + "console.log(git2);\n" + /* C Lib Assert */ + "assert(git_libgit2_init() >= 0, 'libgit2 initialization failed');\n" + "git_libgit2_shutdown();\n" + "\n"; + + ASSERT_EQ((int)0, (int)metacall_load_from_memory("node", buffer, sizeof(buffer), NULL)); + + metacall_destroy(); +} diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index 1638de22c..dd2191520 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -126,6 +126,27 @@ function Set-Nodejs { Write-Output "-DNodeJS_EXECUTABLE=""$NodeDir/node.exe""" >> $EnvOpts Write-Output "-DNodeJS_LIBRARY_NAME=""libnode.dll""" >> $EnvOpts Write-Output "-DNodeJS_LIBRARY_NAME_PATH=""$NodeDir/lib/libnode.dll""" >> $EnvOpts + + if ($Arguments -contains "c") { + # Required for test source/tests/metacall_node_port_c_lib_test + if (!(Test-Path -Path "$DepsDir\libgit2")) { + # Clone libgit2 + git clone --depth 1 --branch v1.8.4 https://github.com/libgit2/libgit2 + } + + $InstallDir = "$DepsDir\libgit2\build\dist" + + mkdir "$DepsDir\libgit2\build" + mkdir "$InstallDir" + Set-Location "$DepsDir\libgit2\build" + + cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=OFF -DBUILD_CLI=OFF .. + cmake --build . "-j$((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors)" + cmake --install . --prefix "$InstallDir" + + Write-Output "-DLibGit2_LIBRARY=""$InstallDir\lib\git2.lib""" >> $EnvOpts + Write-Output "-DLibGit2_INCLUDE_DIR=""$InstallDir\include""" >> $EnvOpts + } } function Set-Java { diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 304fa6a02..d2983330b 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -464,11 +464,18 @@ sub_nodejs(){ cd $ROOT_DIR if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then + if [ $INSTALL_C = 1 ]; then + # Required for test source/tests/metacall_node_port_c_lib_test + INSTALL_LIBGIT2="libgit2-dev" + else + INSTALL_LIBGIT2="" + fi + if [ "${LINUX_DISTRO}" = "debian" ] || [ "${LINUX_DISTRO}" = "ubuntu" ]; then # Note that Python is required for GYP - $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends python3 g++ make nodejs npm curl + $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends python3 g++ make nodejs npm curl $INSTALL_LIBGIT2 elif [ "${LINUX_DISTRO}" = "alpine" ]; then - $SUDO_CMD apk add --no-cache python3 g++ make nodejs nodejs-dev npm curl + $SUDO_CMD apk add --no-cache python3 g++ make nodejs nodejs-dev npm curl $INSTALL_LIBGIT2 # Build dependencies (note libexecinfo-dev is not available in Alpine 3.17) $SUDO_CMD apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main linux-headers libexecinfo libexecinfo-dev @@ -557,6 +564,12 @@ sub_nodejs(){ # Configure NPM path echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH + if [ $INSTALL_C = 1 ]; then + # Required for test source/tests/metacall_node_port_c_lib_test + brew install libgit2@1.8 + brew link libgit2@1.8 --force --overwrite + fi + # fi fi } From 50c27f21a5d5cb5ead48716cbca48f6f5189ea6e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 29 Jan 2025 21:07:21 +0100 Subject: [PATCH 139/487] Add loader config with dependencies. --- CMakeLists.txt | 5 +- source/configuration/CMakeLists.txt | 10 +- source/loaders/CMakeLists.txt | 173 +++++++++++++++--- source/loaders/cs_loader/CMakeLists.txt | 13 +- .../loaders/cs_loader/data/cs_loader.json.in | 4 +- source/loaders/loader.json.in | 5 + source/loaders/node_loader/CMakeLists.txt | 27 ++- source/plugin/source/plugin_manager.c | 2 +- 8 files changed, 197 insertions(+), 42 deletions(-) create mode 100644 source/loaders/loader.json.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 6896e14f1..75da78355 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ # # CMake version -cmake_minimum_required(VERSION 3.14 FATAL_ERROR) +cmake_minimum_required(VERSION 3.15 FATAL_ERROR) # Include cmake modules @@ -241,6 +241,9 @@ else() endif() endif() +# Export compile commands +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # # CTest configuration # diff --git a/source/configuration/CMakeLists.txt b/source/configuration/CMakeLists.txt index c38ca6feb..2332f0682 100644 --- a/source/configuration/CMakeLists.txt +++ b/source/configuration/CMakeLists.txt @@ -180,17 +180,19 @@ target_link_libraries(${target} function(configurations_write config_dir config_path) set(CONFIGURATION_GLOBAL "{") - if(OPTION_BUILD_LOADERS) - set(CONFIGURATION_GLOBAL_LOADERS 0) + # TODO: Make this automatic for all loaders + if(OPTION_BUILD_LOADERS) if(OPTION_BUILD_LOADERS_CS) set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"cs_loader\":\"${config_dir}/cs_loader.json\",") - set(CONFIGURATION_GLOBAL_LOADERS 1) + endif() + + if(OPTION_BUILD_LOADERS_NODE) + set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"node_loader\":\"${config_dir}/node_loader.json\",") endif() #if(OPTION_BUILD_LOADERS_JS) # set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"js_loader\":\"${config_dir}/js_loader.json\",") - # set(CONFIGURATION_GLOBAL_LOADERS 1) #endif() endif() diff --git a/source/loaders/CMakeLists.txt b/source/loaders/CMakeLists.txt index 2d992ee6f..2798d2722 100644 --- a/source/loaders/CMakeLists.txt +++ b/source/loaders/CMakeLists.txt @@ -26,6 +26,141 @@ option(OPTION_BUILD_LOADERS_RPC "Build cURL Remote Procedure Call loader plugin. option(OPTION_BUILD_LOADERS_TS "Build TypeScript 3.9.7 Runtime loader plugin." OFF) option(OPTION_BUILD_LOADERS_WASM "Build WebAssembly Virtual Machine loader plugin." OFF) +# +# Configuration for loaders +# +# The following list of macros is used for generating a configuration file which includes +# dependencies, this is required because now loaders can either load the dependencies or +# use the existing dependencies if MetaCall is being loaded from python.exe, node.exe +# or similar... so we require to delay the loader dependencies until we know if +# their dependencies are already present. +# +# This set of macros provies a flexible way of defining the configuration and dependencies. +# +# 1) The most basic case, let's assume we have the dependencies in the system, like in Python: +# +# loader_configuration_begin(py_loader) +# loader_configuration_deps(python "${Python3_LIBRARY}") +# loader_configuartion_end() +# +# 2) Maybe you want to have multiple paths for a library: +# +# loader_configuration_begin(node_loader) +# loader_configuration_deps(node "/path/to/libnode.so" "/alternative/path/to/libnode.so") +# loader_configuartion_end() +# +# 3) Or the dependencies are compiled by you and you so you have different folders for +# for development (build folder) and for when installing it: +# +# loader_configuration_begin(node_loader) +# loader_configuration_deps(node "/path/to/build/folder/libnode.so") +# loader_configuartion_end_development() +# +# loader_configuration_begin(node_loader) +# loader_configuration_deps(node "/path/to/install/folder/libnode.so") +# loader_configuartion_end_install() +# +# 4) Or you have a custom template because your loader needs a configuration with more fields: +# +# loader_configuration_begin(cs_loader) +# loader_configuration_deps(netcore "/path/to/build/folder/libnetcore.so") +# loader_configuartion_end() +# +# You can do any combination of those for defining the configuration of your loaders. +# + +# Define loader template configuration +set(LOADER_CONFIGURATION_DEFAULT_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/loader.json.in") + +# Define loader configuration for a specific loader +macro(loader_configuration_begin TARGET) + set(LOADER_DEPENDENCIES "") + + # Optional argument for template + if(${ARGV0}) + set(LOADER_CONFIGURATION_TEMPLATE "${ARGV0}") + else() + set(LOADER_CONFIGURATION_TEMPLATE "${LOADER_CONFIGURATION_DEFAULT_TEMPLATE}") + endif() + + set(LOADER_CONFIGURATION_TARGET "${TARGET}") +endmacro() + +# Generate configuration with dependencies for a loader +# +# node_loader: +# "node": [ "/path/to/libnode.so", "/alternative/path/to/libnode.so" ], +# +# c_loader: +# "libffi": [ ... ], +# "libclang": [ ... ], +# "libtcc": [ ... ] +macro(loader_configuration_deps LIBRARY) + # Add new line from previous dependency + if(NOT "${LOADER_DEPENDENCIES}" STREQUAL "") + string(APPEND LOADER_DEPENDENCIES ",\n\t\t") + endif() + + # Define the library + string(APPEND LOADER_DEPENDENCIES "\"${LIBRARY}\": [") + + # Define the paths + set(FIRST_ARGUMENT 0) + foreach(DEPENDENCY IN ITEMS ${ARGN}) + if(${FIRST_ARGUMENT} EQUAL 0) + # Set first path + string(APPEND LOADER_DEPENDENCIES "\"${DEPENDENCY}\"") + set(FIRST_ARGUMENT 1) + else() + # Set the rest of the paths + string(APPEND LOADER_DEPENDENCIES ", \"${DEPENDENCY}\"") + endif() + endforeach() + + # Finalize the list + string(APPEND LOADER_DEPENDENCIES "]") +endmacro() + +# Commit development version +macro(loader_configuartion_end_development) + if(NOT DEFINED LOADER_CONFIGURATION_TEMPLATE OR NOT DEFINED LOADER_CONFIGURATION_TARGET) + return() + endif() + + configure_file(${LOADER_CONFIGURATION_TEMPLATE} ${CONFIGURATION_DIR}/${LOADER_CONFIGURATION_TARGET}.json) + + unset(LOADER_DEPENDENCIES) + unset(LOADER_CONFIGURATION_TEMPLATE) + unset(LOADER_CONFIGURATION_TARGET) +endmacro() + +# Commit install version +macro(loader_configuartion_end_install) + if(NOT DEFINED LOADER_CONFIGURATION_TEMPLATE OR NOT DEFINED LOADER_CONFIGURATION_TARGET) + return() + endif() + + configure_file(${LOADER_CONFIGURATION_TEMPLATE} ${CONFIGURATION_DIR}/install/configurations/${LOADER_CONFIGURATION_TARGET}.json) + + unset(LOADER_DEPENDENCIES) + unset(LOADER_CONFIGURATION_TEMPLATE) + unset(LOADER_CONFIGURATION_TARGET) +endmacro() + +# Commit both versions +macro(loader_configuartion_end) + if(NOT DEFINED LOADER_CONFIGURATION_TEMPLATE OR NOT DEFINED LOADER_CONFIGURATION_TARGET) + return() + endif() + + configure_file(${LOADER_CONFIGURATION_TEMPLATE} ${CONFIGURATION_DIR}/${LOADER_CONFIGURATION_TARGET}.json) + configure_file(${LOADER_CONFIGURATION_TEMPLATE} ${CONFIGURATION_DIR}/install/configurations/${LOADER_CONFIGURATION_TARGET}.json) + + unset(LOADER_DEPENDENCIES) + unset(LOADER_CONFIGURATION_TEMPLATE) + unset(LOADER_CONFIGURATION_TARGET) +endmacro() + # Plugin packages add_subdirectory(c_loader) # Foreign Function Interface library add_subdirectory(cob_loader) # GNU/Cobol 2.2 Runtime @@ -49,34 +184,18 @@ add_subdirectory(rpc_loader) # cURL Remote Procedure Call add_subdirectory(ts_loader) # TypeScript 3.9.7 add_subdirectory(wasm_loader) # WebAssembly Virtual Machine -# Optionally enable loader dependencies utility -macro(add_loader_dependencies target) - set(loaders_map_c_loader OPTION_BUILD_LOADERS_C) - set(loaders_map_cob_loader OPTION_BUILD_LOADERS_COB) - set(loaders_map_cr_loader OPTION_BUILD_LOADERS_CR) - set(loaders_map_cs_loader OPTION_BUILD_LOADERS_DART) - set(loaders_map_dart_loader OPTION_BUILD_LOADERS_CS) - set(loaders_map_ext_loader OPTION_BUILD_LOADERS_EXT) - set(loaders_map_file_loader OPTION_BUILD_LOADERS_FILE) - set(loaders_map_java_loader OPTION_BUILD_LOADERS_JAVA) - set(loaders_map_jl_loader OPTION_BUILD_LOADERS_JL) - set(loaders_map_jsm_loader OPTION_BUILD_LOADERS_JSM) - set(loaders_map_js_loader OPTION_BUILD_LOADERS_JS) - set(loaders_map_llvm_loader OPTION_BUILD_LOADERS_LLVM) - set(loaders_map_lua_loader OPTION_BUILD_LOADERS_LUA) - set(loaders_map_mock_loader OPTION_BUILD_LOADERS_MOCK) - set(loaders_map_node_loader OPTION_BUILD_LOADERS_NODE) - set(loaders_map_py_loader OPTION_BUILD_LOADERS_PY) - set(loaders_map_rb_loader OPTION_BUILD_LOADERS_RB) - set(loaders_map_rs_loader OPTION_BUILD_LOADERS_RS) - set(loaders_map_rpc_loader OPTION_BUILD_LOADERS_RPC) - set(loaders_map_ts_loader OPTION_BUILD_LOADERS_TS) - set(loaders_map_wasm_loader OPTION_BUILD_LOADERS_WASM) - +# Optionally enable loader dependencies utility (for tests) +macro(add_loader_dependencies TARGET) set(LOADERS_LIST) - foreach(loader ${ARGN}) - if(${loaders_map_${loader}}) + foreach(LOADER ${ARGN}) + # Loaders come in the form of: py_loader, node_loader, ... + # Convert them into OPTION_BUILD_LOADERS_PY, OPTION_BUILD_LOADERS_NODE, ... + string(REPLACE "_loader" "" LOADER_TAG "${LOADER}") + string(TOUPPER "${LOADER_TAG}" LOADER_TAG) + + # Check if the loader is enabled + if(${OPTION_BUILD_LOADERS_${LOADER_TAG}}) set(LOADERS_LIST ${LOADERS_LIST} ${loader} @@ -85,6 +204,6 @@ macro(add_loader_dependencies target) endforeach() if(LOADERS_LIST) - add_dependencies(${target} ${LOADERS_LIST}) + add_dependencies(${TARGET} ${LOADERS_LIST}) endif() endmacro() diff --git a/source/loaders/cs_loader/CMakeLists.txt b/source/loaders/cs_loader/CMakeLists.txt index 3eedab81b..8486486e6 100644 --- a/source/loaders/cs_loader/CMakeLists.txt +++ b/source/loaders/cs_loader/CMakeLists.txt @@ -235,13 +235,18 @@ target_link_libraries(${target} # Configuration # +set(CS_LOADER_CONFIG_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/data/cs_loader.json.in") string(REPLACE "\\" "/" DOTNET_CORE_PATH "${DOTNET_CORE_PATH}") -set(DOTNET_CORE_LOADER_ASSEMBLY_PATH ${PROJECT_OUTPUT_DIR}/CSLoader.dll) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/cs_loader.json.in ${CONFIGURATION_DIR}/cs_loader.json) +# Development +loader_configuration_begin(cs_loader "${CS_LOADER_CONFIG_TEMPLATE}") +set(DOTNET_CORE_LOADER_ASSEMBLY_PATH ${PROJECT_OUTPUT_DIR}/CSLoader.dll) +loader_configuartion_end_development() -set(DOTNET_CORE_LOADER_ASSEMBLY_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/CSLoader.dll) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/cs_loader.json.in ${CONFIGURATION_DIR}/install/configurations/cs_loader.json) +# Install +loader_configuration_begin(cs_loader "${CS_LOADER_CONFIG_TEMPLATE}") +set(DOTNET_CORE_LOADER_ASSEMBLY_PATH ${PROJECT_OUTPUT_DIR}/CSLoader.dll) +loader_configuartion_end_install() # # Deployment diff --git a/source/loaders/cs_loader/data/cs_loader.json.in b/source/loaders/cs_loader/data/cs_loader.json.in index b701dec8b..a570e0868 100644 --- a/source/loaders/cs_loader/data/cs_loader.json.in +++ b/source/loaders/cs_loader/data/cs_loader.json.in @@ -1,4 +1,4 @@ { - "dotnet_root":"@DOTNET_CORE_PATH@", - "dotnet_loader_assembly_path":"@DOTNET_CORE_LOADER_ASSEMBLY_PATH@" + "dotnet_root": "@DOTNET_CORE_PATH@", + "dotnet_loader_assembly_path": "@DOTNET_CORE_LOADER_ASSEMBLY_PATH@" } diff --git a/source/loaders/loader.json.in b/source/loaders/loader.json.in new file mode 100644 index 000000000..dfb183afd --- /dev/null +++ b/source/loaders/loader.json.in @@ -0,0 +1,5 @@ +{ + "dependencies": { + @LOADER_DEPENDENCIES@ + } +} diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index a9bf13c67..0a3b26775 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -157,9 +157,6 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - # TODO: Implement delayed load - ${NodeJS_LIBRARY} # NodeJS library - PUBLIC ${DEFAULT_LIBRARIES} @@ -227,6 +224,8 @@ install(TARGETS ${target} ARCHIVE DESTINATION ${INSTALL_LIB} COMPONENT dev ) +set(NodeJS_LIBRARY_DEVELOPMENT "${NodeJS_LIBRARY}") + # Runtime (pack NodeJS DLL in windows) # TODO: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies # TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da @@ -236,10 +235,32 @@ if(NodeJS_LIBRARY_NAME_PATH AND WIN32) DESTINATION ${INSTALL_LIB} COMPONENT runtime ) + + get_filename_component(NodeJS_LIBRARY_NAME "${NodeJS_LIBRARY_NAME_PATH}" NAME) + set(NodeJS_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${NodeJS_LIBRARY_NAME}") elseif(NodeJS_BUILD_FROM_SOURCE AND NOT WIN32) install(FILES "${NodeJS_LIBRARY}" DESTINATION ${INSTALL_LIB} COMPONENT runtime ) + + get_filename_component(NodeJS_LIBRARY_NAME "${NodeJS_LIBRARY}" NAME) + set(NodeJS_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${NodeJS_LIBRARY_NAME}") +else() + set(NodeJS_LIBRARY_INSTALL "${NodeJS_LIBRARY}") endif() + +# +# Configuration +# + +# Development +loader_configuration_begin(node_loader) +loader_configuration_deps(node "${NodeJS_LIBRARY_DEVELOPMENT}") +loader_configuartion_end_development() + +# Install +loader_configuration_begin(node_loader) +loader_configuration_deps(node "${NodeJS_LIBRARY_INSTALL}") +loader_configuartion_end_install() diff --git a/source/plugin/source/plugin_manager.c b/source/plugin/source/plugin_manager.c index f60155fe6..353eaded5 100644 --- a/source/plugin/source/plugin_manager.c +++ b/source/plugin/source/plugin_manager.c @@ -31,7 +31,7 @@ #include <string.h> #if defined(WIN32) || defined(_WIN32) - #include <winbase.h> + #include <winbase.h> /* SetDllDirectoryA */ #endif /* -- Declarations -- */ From 3f53257980d9e60a6d6b5d8d492199d21c209e2a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Jan 2025 17:06:04 +0100 Subject: [PATCH 140/487] Use always Python3. --- source/tests/metacall_node_port_test/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/tests/metacall_node_port_test/CMakeLists.txt b/source/tests/metacall_node_port_test/CMakeLists.txt index 6ffc2981b..9c6c12b5b 100644 --- a/source/tests/metacall_node_port_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_test/CMakeLists.txt @@ -193,15 +193,15 @@ add_dependencies(${target} set(NodeJS_EXECUTABLE_ONLY ON) find_package(NodeJS) -find_package(Python COMPONENTS Interpreter) +find_package(Python3 COMPONENTS Interpreter) -if(NodeJS_FOUND AND Python_Interpreter_FOUND) +if(NodeJS_FOUND AND Python3_Interpreter_FOUND) execute_process( COMMAND ${NodeJS_EXECUTABLE} -e "console.log(process.versions.openssl)" OUTPUT_VARIABLE NODEJS_OPENSSL_VERSION ) execute_process( - COMMAND ${Python_EXECUTABLE} -c "import ssl; print(ssl.OPENSSL_VERSION.split()[1])" + COMMAND ${Python3_EXECUTABLE} -c "import ssl; print(ssl.OPENSSL_VERSION.split()[1])" OUTPUT_VARIABLE PYTHON_OPENSSL_VERSION ) From 911e7a35b4db722075d342bd170444f9424cc224 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Jan 2025 17:07:37 +0100 Subject: [PATCH 141/487] Solve issues Python 3.13. --- .../loaders/py_loader/source/py_loader_impl.c | 11 +++++++---- .../metacall_python_object_class_test.cpp | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 66be1c0b9..0c495ee07 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -685,7 +685,6 @@ int py_class_interface_static_set(klass cls, class_impl impl, struct accessor_ty (void)cls; loader_impl_py_class py_class = (loader_impl_py_class)impl; - PyObject *pyobject_class = py_class->cls; char *attr_name = attribute_name(accessor->data.attr); if (attr_name == NULL) @@ -695,15 +694,15 @@ int py_class_interface_static_set(klass cls, class_impl impl, struct accessor_ty py_loader_thread_acquire(); - PyObject *pyvalue = py_loader_impl_value_to_capi(py_class->impl, value_type_id(v), v); + PyObject *py_value = py_loader_impl_value_to_capi(py_class->impl, value_type_id(v), v); PyObject *key_py_str = PyUnicode_FromString(attr_name); - int retval = PyObject_GenericSetAttr(pyobject_class, key_py_str, pyvalue); + int result = PyObject_SetAttr(py_class->cls, key_py_str, py_value); Py_DECREF(key_py_str); py_loader_thread_release(); - return retval; + return result; } value py_class_interface_static_invoke(klass cls, class_impl impl, method m, class_args args, size_t argc) @@ -2640,7 +2639,11 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi /* Hook the deallocation of PyCFunction */ py_loader_impl_pycfunction_dealloc = PyCFunction_Type.tp_dealloc; PyCFunction_Type.tp_dealloc = PyCFunction_dealloc; + + /* TODO: This does not work after 3.13, is it really needed for this hook? */ +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 13 PyType_Modified(&PyCFunction_Type); +#endif if (py_loader_impl_initialize_sys_executable(py_impl) != 0) { diff --git a/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp b/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp index b1f6d18fb..a5a3439c2 100644 --- a/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp +++ b/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp @@ -149,6 +149,24 @@ TEST_F(metacall_python_class_test, DefaultConstructor) ASSERT_EQ((enum metacall_value_id)METACALL_STRING, (enum metacall_value_id)metacall_value_id(ret_value)); metacall_value_destroy(static_method_args[0]); metacall_value_destroy(ret_value); + + // Get and Set + void *param2 = metacall_class_static_get(myclass, "b"); + ASSERT_EQ((enum metacall_value_id)METACALL_LONG, (enum metacall_value_id)metacall_value_id(param2)); + ASSERT_EQ((long)44444L, (long)metacall_value_to_long(param2)); + + metacall_value_destroy(param2); + + void *long_value = metacall_value_create_long(5555L); + int retcode = metacall_class_static_set(myclass, "b", long_value); + metacall_value_destroy(long_value); + ASSERT_EQ((int)0, int(retcode)); + + param2 = metacall_class_static_get(myclass, "b"); + ASSERT_EQ((enum metacall_value_id)METACALL_LONG, (enum metacall_value_id)metacall_value_id(param2)); + ASSERT_EQ((long)5555L, (long)metacall_value_to_long(param2)); + + metacall_value_destroy(param2); } { From aa13d6ce0b94675f1f3a6cc7f8e4bc929b9004bb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Jan 2025 17:08:09 +0100 Subject: [PATCH 142/487] Implement dependencies for loaders. --- source/dynlink/include/dynlink/dynlink.h | 15 +++ source/dynlink/source/dynlink.c | 24 ++++ source/loader/include/loader/loader_impl.h | 2 + .../include/loader/loader_impl_interface.h | 2 - source/loader/source/loader.c | 7 ++ source/loader/source/loader_impl.c | 116 +++++++++++++----- source/loaders/CMakeLists.txt | 5 +- 7 files changed, 139 insertions(+), 32 deletions(-) diff --git a/source/dynlink/include/dynlink/dynlink.h b/source/dynlink/include/dynlink/dynlink.h index 77102c9e1..d1bdaf8d0 100644 --- a/source/dynlink/include/dynlink/dynlink.h +++ b/source/dynlink/include/dynlink/dynlink.h @@ -63,6 +63,21 @@ DYNLINK_API const char *dynlink_extension(void); */ DYNLINK_API dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_flags flags); +/** +* @brief +* Load a dynamically linked shared object with absolute path +* +* @param[in] path +* Path where is located the shared object (absolute) +* +* @param[in] flags +* Dynamic linking flags +* +* @return +* A handle to the dynamically linked shared object +*/ +DYNLINK_API dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags); + /** * @brief * Retreive the name of the dynamically linked shared object diff --git a/source/dynlink/source/dynlink.c b/source/dynlink/source/dynlink.c index 4ae3b801d..bc2a6b843 100644 --- a/source/dynlink/source/dynlink.c +++ b/source/dynlink/source/dynlink.c @@ -90,6 +90,30 @@ dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_flags flags) return NULL; } +dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags) +{ + dynlink handle = malloc(sizeof(struct dynlink_type)); + + if (handle == NULL) + { + return NULL; + } + + strncpy(handle->name_impl, path, strnlen(path, PORTABILITY_PATH_SIZE) + 1); + + handle->flags = flags; + + handle->impl = dynlink_impl_load(handle); + + if (handle->impl == NULL) + { + free(handle); + return NULL; + } + + return handle; +} + dynlink_name dynlink_get_name(dynlink handle) { if (handle != NULL) diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index 726cdf2ca..c4f6c8706 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -43,6 +43,8 @@ LOADER_API loader_impl loader_impl_create(const loader_tag tag); LOADER_API loader_impl loader_impl_create_host(const loader_tag tag); +LOADER_API int loader_impl_dependencies(loader_impl impl); + LOADER_API void loader_impl_attach(loader_impl impl, plugin p); LOADER_API plugin loader_impl_plugin(loader_impl impl); diff --git a/source/loader/include/loader/loader_impl_interface.h b/source/loader/include/loader/loader_impl_interface.h index 7033b2d5c..1e56f3ac8 100644 --- a/source/loader/include/loader/loader_impl_interface.h +++ b/source/loader/include/loader/loader_impl_interface.h @@ -35,8 +35,6 @@ extern "C" { #endif -#include <stdlib.h> - struct loader_impl_type; typedef struct loader_impl_type *loader_impl; diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 73803e7ed..e29ef684f 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -264,6 +264,13 @@ plugin loader_get_impl_plugin(const loader_tag tag) goto loader_create_error; } + /* Dynamic link loader dependencies if it is not host */ + if (loader_impl_get_option_host(impl) == 0) + { + loader_impl_dependencies(impl); + } + + /* Dynamic link the loader */ p = plugin_manager_create(&loader_manager, tag, impl, &loader_impl_destroy_dtor); if (p == NULL) diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 7d9bdbf4c..7db5c35d5 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -89,6 +89,7 @@ struct loader_impl_type set type_info_map; /* Stores a set indexed by type name of all of the types existing in the loader (global scope (TODO: may need refactor per handle)) */ value options; /* Additional initialization options passed in the initialize phase */ set exec_path_map; /* Set of execution paths passed by the end user */ + configuration config; /* Reference to the loader configuration, it contains execution_paths, dependencies and additional info */ }; struct loader_handle_impl_type @@ -119,7 +120,7 @@ struct loader_impl_metadata_cb_iterator_type static loader_impl loader_impl_allocate(const loader_tag tag); -static configuration loader_impl_initialize_configuration(plugin p); +static configuration loader_impl_initialize_configuration(const loader_tag tag); static int loader_impl_initialize_registered(plugin_manager manager, plugin p); @@ -258,50 +259,110 @@ plugin loader_impl_plugin(loader_impl impl) return NULL; } -void loader_impl_configuration(loader_impl_interface iface, loader_impl impl, configuration config) +void loader_impl_configuration_execution_paths(loader_impl_interface iface, loader_impl impl) { - value execution_paths_value = configuration_value_type(config, "execution_paths", TYPE_ARRAY); + value execution_paths_value = configuration_value_type(impl->config, "execution_paths", TYPE_ARRAY); if (execution_paths_value != NULL) { size_t size = value_type_count(execution_paths_value); value *execution_paths_array = value_to_array(execution_paths_value); + size_t iterator; - if (execution_paths_array != NULL) + for (iterator = 0; iterator < size; ++iterator) { - size_t iterator; + if (value_type_id(execution_paths_array[iterator]) == TYPE_STRING) + { + const char *str = value_to_string(execution_paths_array[iterator]); + size_t str_size = value_type_size(execution_paths_array[iterator]); + + if (str != NULL) + { + loader_path execution_path; + + strncpy(execution_path, str, str_size > LOADER_PATH_SIZE ? LOADER_PATH_SIZE : str_size); + + iface->execution_path(impl, execution_path); + } + } + } + } +} + +int loader_impl_dependencies(loader_impl impl) +{ + /* Dependencies have the following format */ + /* + { + "dependencies": { + "node": ["/usr/lib/x86_64-linux-gnu/libnode.so.72"] + } + } + */ + value dependencies_value = configuration_value_type(impl->config, "dependencies", TYPE_MAP); - for (iterator = 0; iterator < size; ++iterator) + if (dependencies_value != NULL) + { + size_t size = value_type_count(dependencies_value); + value *dependencies_map = value_to_map(dependencies_value); + size_t iterator; + + for (iterator = 0; iterator < size; ++iterator) + { + if (value_type_id(dependencies_map[iterator]) == TYPE_ARRAY) { - if (execution_paths_array[iterator] != NULL) + value *library_tuple = value_to_array(dependencies_map[iterator]); + + if (value_type_id(library_tuple[1]) == TYPE_ARRAY) { - const char *str = value_to_string(execution_paths_array[iterator]); - size_t str_size = value_type_size(execution_paths_array[iterator]); + value *paths_array = value_to_array(library_tuple[1]); + size_t paths_size = value_type_count(library_tuple[1]); + size_t path; + int found = 0; - if (str != NULL) + for (path = 0; path < paths_size; ++path) { - loader_path execution_path; + if (value_type_id(paths_array[iterator]) == TYPE_STRING) + { + const char *library_path = value_to_string(paths_array[iterator]); - strncpy(execution_path, str, str_size > LOADER_PATH_SIZE ? LOADER_PATH_SIZE : str_size); + if (library_path != NULL) + { + dynlink handle = dynlink_load_absolute(library_path, DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); - iface->execution_path(impl, execution_path); + if (handle != NULL) + { + found = 1; + break; + } + } + } + } + + if (!found) + { + const char *dependency = value_type_id(library_tuple[0]) == TYPE_STRING ? value_to_string(library_tuple[0]) : "unknown_library"; + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load dependency '%s' from loader configuration '%s.json'", dependency, plugin_name(impl->p)); + return 1; } } } } } + + return 0; } -configuration loader_impl_initialize_configuration(plugin p) +configuration loader_impl_initialize_configuration(const loader_tag tag) { static const char configuration_key_suffix[] = "_loader"; #define CONFIGURATION_KEY_SIZE ((size_t)sizeof(configuration_key_suffix) + LOADER_TAG_SIZE - 1) char configuration_key[CONFIGURATION_KEY_SIZE]; /* Retrieve the configuration key: <tag>_loader */ - size_t tag_size = strnlen(plugin_name(p), LOADER_TAG_SIZE) + 1; + size_t tag_size = strnlen(tag, LOADER_TAG_SIZE) + 1; - strncpy(configuration_key, plugin_name(p), tag_size); + strncpy(configuration_key, tag, tag_size); strncat(configuration_key, configuration_key_suffix, CONFIGURATION_KEY_SIZE - tag_size); #undef CONFIGURATION_KEY_SIZE @@ -331,7 +392,6 @@ int loader_impl_initialize_registered(plugin_manager manager, plugin p) int loader_impl_initialize(plugin_manager manager, plugin p, loader_impl impl) { static const char loader_library_path[] = "loader_library_path"; - configuration config; value loader_library_path_value = NULL; char *library_path = NULL; vector script_paths, paths; @@ -341,9 +401,6 @@ int loader_impl_initialize(plugin_manager manager, plugin p, loader_impl impl) return 0; } - /* Get the configuration of the loader */ - config = loader_impl_initialize_configuration(p); - /* Retrieve the library path */ library_path = plugin_manager_library_path(manager); @@ -355,19 +412,19 @@ int loader_impl_initialize(plugin_manager manager, plugin p, loader_impl impl) */ /* Check if the configuration has a custom loader_library_path, otherwise set it up */ - if (config != NULL && configuration_value_type(config, loader_library_path, TYPE_STRING) == NULL) + if (impl->config != NULL && configuration_value_type(impl->config, loader_library_path, TYPE_STRING) == NULL) { loader_library_path_value = value_create_string(library_path, strnlen(library_path, LOADER_PATH_SIZE)); - configuration_define(config, loader_library_path, loader_library_path_value); + configuration_define(impl->config, loader_library_path, loader_library_path_value); } /* Call to the loader initialize method */ - impl->data = loader_iface(p)->initialize(impl, config); + impl->data = loader_iface(p)->initialize(impl, impl->config); /* Undefine the library path field from config */ - if (config != NULL && loader_library_path_value != NULL) + if (impl->config != NULL && loader_library_path_value != NULL) { - configuration_undefine(config, loader_library_path); + configuration_undefine(impl->config, loader_library_path); value_type_destroy(loader_library_path_value); } @@ -390,9 +447,9 @@ int loader_impl_initialize(plugin_manager manager, plugin p, loader_impl impl) impl->init = 0; - if (config != NULL) + if (impl->config != NULL) { - loader_impl_configuration(loader_iface(p), impl, config); + loader_impl_configuration_execution_paths(loader_iface(p), impl); } /* The scripts path priority order is the following: @@ -402,7 +459,7 @@ int loader_impl_initialize(plugin_manager manager, plugin p, loader_impl impl) */ /* Load the library path as execution path */ - loader_library_path_value = configuration_value_type(config, loader_library_path, TYPE_STRING); + loader_library_path_value = configuration_value_type(impl->config, loader_library_path, TYPE_STRING); if (loader_library_path_value != NULL) { @@ -470,6 +527,9 @@ loader_impl loader_impl_create(const loader_tag tag) impl->init = 1; impl->options = NULL; + /* Get the configuration of the loader */ + impl->config = loader_impl_initialize_configuration(tag); + return impl; } diff --git a/source/loaders/CMakeLists.txt b/source/loaders/CMakeLists.txt index 2798d2722..edcb03e08 100644 --- a/source/loaders/CMakeLists.txt +++ b/source/loaders/CMakeLists.txt @@ -75,10 +75,11 @@ set(LOADER_CONFIGURATION_DEFAULT_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/loader.js # Define loader configuration for a specific loader macro(loader_configuration_begin TARGET) set(LOADER_DEPENDENCIES "") + set(OPTIONAL_TEMPLATE "${ARGV1}") # Optional argument for template - if(${ARGV0}) - set(LOADER_CONFIGURATION_TEMPLATE "${ARGV0}") + if(NOT "${ARGV1}" STREQUAL "") + set(LOADER_CONFIGURATION_TEMPLATE "${ARGV1}") else() set(LOADER_CONFIGURATION_TEMPLATE "${LOADER_CONFIGURATION_DEFAULT_TEMPLATE}") endif() From 1f4881607bd1b8d5afebc5f0c9c36946e98e16d3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 3 Feb 2025 22:36:03 +0100 Subject: [PATCH 143/487] Change link options. --- source/adt/CMakeLists.txt | 2 +- source/benchmarks/log_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_cs_call_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_node_call_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_py_call_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_py_init_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_rb_call_bench/CMakeLists.txt | 2 +- source/cli/metacallcli/CMakeLists.txt | 2 +- source/cli/plugins/cli_core_plugin/CMakeLists.txt | 2 +- source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt | 2 +- source/configuration/CMakeLists.txt | 2 +- source/detour/CMakeLists.txt | 2 +- source/detours/funchook_detour/CMakeLists.txt | 2 +- source/dynlink/CMakeLists.txt | 2 +- source/environment/CMakeLists.txt | 2 +- source/examples/metacallgui/CMakeLists.txt | 2 +- source/examples/metacalllog/CMakeLists.txt | 2 +- source/examples/metacallquine/CMakeLists.txt | 2 +- source/examples/metacallweb/CMakeLists.txt | 2 +- source/extensions/plugin_extension/CMakeLists.txt | 2 +- source/filesystem/CMakeLists.txt | 2 +- source/format/CMakeLists.txt | 2 +- source/loader/CMakeLists.txt | 2 +- source/loaders/c_loader/CMakeLists.txt | 2 +- source/loaders/cob_loader/CMakeLists.txt | 2 +- source/loaders/cr_loader/CMakeLists.txt | 2 +- source/loaders/cs_loader/CMakeLists.txt | 2 +- source/loaders/dart_loader/CMakeLists.txt | 2 +- source/loaders/ext_loader/CMakeLists.txt | 2 +- source/loaders/file_loader/CMakeLists.txt | 2 +- source/loaders/java_loader/CMakeLists.txt | 2 +- source/loaders/jl_loader/CMakeLists.txt | 2 +- source/loaders/js_loader/CMakeLists.txt | 2 +- source/loaders/jsm_loader/CMakeLists.txt | 2 +- source/loaders/llvm_loader/CMakeLists.txt | 2 +- source/loaders/lua_loader/CMakeLists.txt | 2 +- source/loaders/mock_loader/CMakeLists.txt | 2 +- source/loaders/node_loader/CMakeLists.txt | 7 ++++++- source/loaders/py_loader/CMakeLists.txt | 2 +- source/loaders/rb_loader/CMakeLists.txt | 2 +- source/loaders/rpc_loader/CMakeLists.txt | 2 +- source/loaders/rs_loader/CMakeLists.txt | 2 +- source/loaders/ts_loader/CMakeLists.txt | 2 +- source/loaders/wasm_loader/CMakeLists.txt | 2 +- source/log/CMakeLists.txt | 2 +- source/memory/CMakeLists.txt | 2 +- source/metacall/CMakeLists.txt | 2 +- source/plugin/CMakeLists.txt | 2 +- source/plugins/backtrace_plugin/CMakeLists.txt | 2 +- source/plugins/sandbox_plugin/CMakeLists.txt | 2 +- source/portability/CMakeLists.txt | 2 +- source/ports/cxx_port/CMakeLists.txt | 2 +- source/ports/js_port/CMakeLists.txt | 7 ++----- source/ports/rb_port/CMakeLists.txt | 3 +-- source/preprocessor/CMakeLists.txt | 2 +- source/reflect/CMakeLists.txt | 2 +- source/scripts/extension/sum/CMakeLists.txt | 2 +- source/serial/CMakeLists.txt | 2 +- source/serials/metacall_serial/CMakeLists.txt | 2 +- source/serials/rapid_json_serial/CMakeLists.txt | 2 +- source/tests/adt_map_test/CMakeLists.txt | 2 +- source/tests/adt_set_test/CMakeLists.txt | 2 +- source/tests/adt_trie_test/CMakeLists.txt | 2 +- source/tests/adt_vector_test/CMakeLists.txt | 2 +- source/tests/configuration_test/CMakeLists.txt | 2 +- source/tests/detour_test/CMakeLists.txt | 2 +- source/tests/dynlink_test/CMakeLists.txt | 2 +- source/tests/environment_test/CMakeLists.txt | 2 +- source/tests/log_custom_test/CMakeLists.txt | 2 +- source/tests/log_test/CMakeLists.txt | 2 +- source/tests/metacall_backtrace_plugin_test/CMakeLists.txt | 2 +- source/tests/metacall_c_lib_test/CMakeLists.txt | 2 +- source/tests/metacall_c_test/CMakeLists.txt | 2 +- source/tests/metacall_callback_complex_test/CMakeLists.txt | 2 +- source/tests/metacall_cast_test/CMakeLists.txt | 2 +- source/tests/metacall_clear_test/CMakeLists.txt | 2 +- .../metacall_cli_core_plugin_await_test/CMakeLists.txt | 2 +- source/tests/metacall_cli_core_plugin_test/CMakeLists.txt | 2 +- source/tests/metacall_cobol_test/CMakeLists.txt | 2 +- .../metacall_configuration_default_test/CMakeLists.txt | 2 +- .../metacall_configuration_exec_path_test/CMakeLists.txt | 2 +- source/tests/metacall_cs_test/CMakeLists.txt | 2 +- source/tests/metacall_csharp_function_test/CMakeLists.txt | 2 +- .../tests/metacall_csharp_static_class_test/CMakeLists.txt | 2 +- source/tests/metacall_depends_test/CMakeLists.txt | 2 +- source/tests/metacall_distributable_test/CMakeLists.txt | 2 +- source/tests/metacall_ducktype_test/CMakeLists.txt | 2 +- .../tests/metacall_duplicated_handle_test/CMakeLists.txt | 2 +- .../tests/metacall_duplicated_symbols_test/CMakeLists.txt | 2 +- source/tests/metacall_dynlink_path_test/CMakeLists.txt | 2 +- source/tests/metacall_ext_test/CMakeLists.txt | 2 +- source/tests/metacall_file_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_file_glob_test/CMakeLists.txt | 2 +- source/tests/metacall_file_test/CMakeLists.txt | 2 +- source/tests/metacall_fork_test/CMakeLists.txt | 2 +- source/tests/metacall_function_test/CMakeLists.txt | 2 +- source/tests/metacall_handle_export_test/CMakeLists.txt | 2 +- source/tests/metacall_handle_get_test/CMakeLists.txt | 2 +- source/tests/metacall_init_fini_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- source/tests/metacall_initialize_ex_test/CMakeLists.txt | 2 +- source/tests/metacall_initialize_test/CMakeLists.txt | 2 +- source/tests/metacall_inspect_test/CMakeLists.txt | 2 +- source/tests/metacall_integration_test/CMakeLists.txt | 2 +- source/tests/metacall_invalid_loader_test/CMakeLists.txt | 2 +- source/tests/metacall_java_test/CMakeLists.txt | 2 +- source/tests/metacall_julia_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- source/tests/metacall_llvm_test/CMakeLists.txt | 2 +- .../metacall_load_configuration_fail_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../tests/metacall_load_configuration_test/CMakeLists.txt | 2 +- .../tests/metacall_load_memory_empty_test/CMakeLists.txt | 2 +- source/tests/metacall_load_memory_test/CMakeLists.txt | 2 +- source/tests/metacall_logs_test/CMakeLists.txt | 2 +- source/tests/metacall_lua_test/CMakeLists.txt | 2 +- source/tests/metacall_map_await_test/CMakeLists.txt | 2 +- source/tests/metacall_map_test/CMakeLists.txt | 2 +- .../tests/metacall_node_async_multiple_test/CMakeLists.txt | 2 +- .../metacall_node_async_resources_test/CMakeLists.txt | 2 +- source/tests/metacall_node_async_test/CMakeLists.txt | 2 +- source/tests/metacall_node_await_chain_test/CMakeLists.txt | 2 +- source/tests/metacall_node_call_test/CMakeLists.txt | 2 +- source/tests/metacall_node_callback_test/CMakeLists.txt | 2 +- source/tests/metacall_node_clear_mem_test/CMakeLists.txt | 2 +- .../tests/metacall_node_default_export_test/CMakeLists.txt | 2 +- .../metacall_node_event_loop_signal_test/CMakeLists.txt | 2 +- source/tests/metacall_node_event_loop_test/CMakeLists.txt | 2 +- source/tests/metacall_node_exception_test/CMakeLists.txt | 2 +- source/tests/metacall_node_extension_test/CMakeLists.txt | 2 +- .../node_extension_test/CMakeLists.txt | 2 +- .../tests/metacall_node_fail_env_var_test/CMakeLists.txt | 2 +- .../tests/metacall_node_fail_load_leak_test/CMakeLists.txt | 2 +- source/tests/metacall_node_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_node_inline_test/CMakeLists.txt | 2 +- .../metacall_node_multithread_deadlock_test/CMakeLists.txt | 2 +- source/tests/metacall_node_native_code_test/CMakeLists.txt | 2 +- source/tests/metacall_node_port_await_test/CMakeLists.txt | 2 +- source/tests/metacall_node_port_c_lib_test/CMakeLists.txt | 2 +- source/tests/metacall_node_port_rs_test/CMakeLists.txt | 2 +- source/tests/metacall_node_port_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../tests/metacall_node_python_await_test/CMakeLists.txt | 2 +- .../metacall_node_python_deadlock_test/CMakeLists.txt | 2 +- .../metacall_node_python_exception_test/CMakeLists.txt | 2 +- .../metacall_node_python_port_mock_test/CMakeLists.txt | 2 +- .../metacall_node_python_port_ruby_test/CMakeLists.txt | 2 +- source/tests/metacall_node_python_ruby_test/CMakeLists.txt | 2 +- source/tests/metacall_node_reentrant_test/CMakeLists.txt | 2 +- .../tests/metacall_node_signal_handler_test/CMakeLists.txt | 2 +- source/tests/metacall_node_test/CMakeLists.txt | 2 +- source/tests/metacall_node_typescript_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../metacall_plugin_extension_local_test/CMakeLists.txt | 2 +- source/tests/metacall_plugin_extension_test/CMakeLists.txt | 2 +- source/tests/metacall_python_async_test/CMakeLists.txt | 2 +- source/tests/metacall_python_await_test/CMakeLists.txt | 2 +- source/tests/metacall_python_builtins_test/CMakeLists.txt | 2 +- source/tests/metacall_python_callback_test/CMakeLists.txt | 2 +- source/tests/metacall_python_dict_test/CMakeLists.txt | 2 +- source/tests/metacall_python_exception_test/CMakeLists.txt | 2 +- source/tests/metacall_python_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_python_gc_test/CMakeLists.txt | 2 +- .../tests/metacall_python_loader_port_test/CMakeLists.txt | 2 +- source/tests/metacall_python_model_test/CMakeLists.txt | 2 +- .../tests/metacall_python_node_await_test/CMakeLists.txt | 2 +- .../tests/metacall_python_object_class_test/CMakeLists.txt | 2 +- source/tests/metacall_python_open_test/CMakeLists.txt | 2 +- source/tests/metacall_python_pointer_test/CMakeLists.txt | 2 +- .../metacall_python_port_callback_test/CMakeLists.txt | 2 +- .../tests/metacall_python_port_https_test/CMakeLists.txt | 2 +- .../tests/metacall_python_port_import_test/CMakeLists.txt | 2 +- .../tests/metacall_python_port_pointer_test/CMakeLists.txt | 2 +- source/tests/metacall_python_port_test/CMakeLists.txt | 2 +- source/tests/metacall_python_reentrant_test/CMakeLists.txt | 2 +- .../metacall_python_relative_path_test/CMakeLists.txt | 2 +- source/tests/metacall_python_test/CMakeLists.txt | 2 +- source/tests/metacall_python_varargs_test/CMakeLists.txt | 2 +- .../metacall_python_without_env_vars_test/CMakeLists.txt | 2 +- .../metacall_python_without_functions_test/CMakeLists.txt | 2 +- source/tests/metacall_reinitialize_test/CMakeLists.txt | 2 +- source/tests/metacall_reload_functions_test/CMakeLists.txt | 2 +- source/tests/metacall_return_monad_test/CMakeLists.txt | 2 +- source/tests/metacall_rpc_test/CMakeLists.txt | 2 +- source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt | 2 +- source/tests/metacall_ruby_fail_test/CMakeLists.txt | 2 +- .../tests/metacall_ruby_object_class_test/CMakeLists.txt | 2 +- .../metacall_ruby_parser_integration_test/CMakeLists.txt | 2 +- .../metacall_ruby_rails_integration_test/CMakeLists.txt | 2 +- source/tests/metacall_ruby_test/CMakeLists.txt | 2 +- source/tests/metacall_rust_class_test/CMakeLists.txt | 2 +- .../tests/metacall_rust_load_from_mem_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../metacall_rust_load_from_package_test/CMakeLists.txt | 2 +- source/tests/metacall_rust_test/CMakeLists.txt | 2 +- source/tests/metacall_sandbox_plugin_test/CMakeLists.txt | 2 +- source/tests/metacall_test/CMakeLists.txt | 2 +- .../tests/metacall_typescript_call_map_test/CMakeLists.txt | 2 +- .../metacall_typescript_jsx_default_test/CMakeLists.txt | 2 +- source/tests/metacall_typescript_node_test/CMakeLists.txt | 2 +- .../tests/metacall_typescript_require_test/CMakeLists.txt | 2 +- source/tests/metacall_typescript_test/CMakeLists.txt | 2 +- .../metacall_typescript_tsx_loop_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_typescript_tsx_test/CMakeLists.txt | 2 +- source/tests/metacall_version_test/CMakeLists.txt | 2 +- source/tests/metacall_wasm_python_port_test/CMakeLists.txt | 2 +- source/tests/metacall_wasm_test/CMakeLists.txt | 2 +- source/tests/portability_path_test/CMakeLists.txt | 2 +- source/tests/preprocessor_test/CMakeLists.txt | 2 +- source/tests/rb_loader_parser_test/CMakeLists.txt | 2 +- source/tests/reflect_function_test/CMakeLists.txt | 2 +- source/tests/reflect_metadata_test/CMakeLists.txt | 2 +- source/tests/reflect_object_class_test/CMakeLists.txt | 2 +- source/tests/reflect_scope_test/CMakeLists.txt | 2 +- source/tests/reflect_value_cast_test/CMakeLists.txt | 2 +- source/tests/serial_test/CMakeLists.txt | 2 +- source/threading/CMakeLists.txt | 2 +- source/version/CMakeLists.txt | 2 +- 225 files changed, 231 insertions(+), 230 deletions(-) diff --git a/source/adt/CMakeLists.txt b/source/adt/CMakeLists.txt index 122513f58..e97f2f59b 100644 --- a/source/adt/CMakeLists.txt +++ b/source/adt/CMakeLists.txt @@ -164,7 +164,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/benchmarks/log_bench/CMakeLists.txt b/source/benchmarks/log_bench/CMakeLists.txt index 63f7c901e..1c1175337 100644 --- a/source/benchmarks/log_bench/CMakeLists.txt +++ b/source/benchmarks/log_bench/CMakeLists.txt @@ -108,7 +108,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_cs_call_bench/CMakeLists.txt b/source/benchmarks/metacall_cs_call_bench/CMakeLists.txt index 618c9a7ee..751b4a034 100644 --- a/source/benchmarks/metacall_cs_call_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_cs_call_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_node_call_bench/CMakeLists.txt b/source/benchmarks/metacall_node_call_bench/CMakeLists.txt index 37aa30436..8b9c696bb 100644 --- a/source/benchmarks/metacall_node_call_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_node_call_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt b/source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt index 1807f755a..0c0ee17bc 100644 --- a/source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt @@ -121,7 +121,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_py_call_bench/CMakeLists.txt b/source/benchmarks/metacall_py_call_bench/CMakeLists.txt index 898bddd69..bbc6b3376 100644 --- a/source/benchmarks/metacall_py_call_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_py_call_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_py_init_bench/CMakeLists.txt b/source/benchmarks/metacall_py_init_bench/CMakeLists.txt index 9933482d1..1aff472c3 100644 --- a/source/benchmarks/metacall_py_init_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_py_init_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_rb_call_bench/CMakeLists.txt b/source/benchmarks/metacall_rb_call_bench/CMakeLists.txt index 5643afe0b..fc66c3230 100644 --- a/source/benchmarks/metacall_rb_call_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_rb_call_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/cli/metacallcli/CMakeLists.txt b/source/cli/metacallcli/CMakeLists.txt index fe6679dc3..227a81cfd 100644 --- a/source/cli/metacallcli/CMakeLists.txt +++ b/source/cli/metacallcli/CMakeLists.txt @@ -139,7 +139,7 @@ target_compile_features(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/cli/plugins/cli_core_plugin/CMakeLists.txt b/source/cli/plugins/cli_core_plugin/CMakeLists.txt index 2dd38f06d..1e353e4d4 100644 --- a/source/cli/plugins/cli_core_plugin/CMakeLists.txt +++ b/source/cli/plugins/cli_core_plugin/CMakeLists.txt @@ -180,7 +180,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt b/source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt index e4d16acd2..3c777caf8 100644 --- a/source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt +++ b/source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt @@ -175,7 +175,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/configuration/CMakeLists.txt b/source/configuration/CMakeLists.txt index 2332f0682..6c5204d8f 100644 --- a/source/configuration/CMakeLists.txt +++ b/source/configuration/CMakeLists.txt @@ -164,7 +164,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/detour/CMakeLists.txt b/source/detour/CMakeLists.txt index 0a8a4e5d7..fafc41c6f 100644 --- a/source/detour/CMakeLists.txt +++ b/source/detour/CMakeLists.txt @@ -157,7 +157,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index b9c304e1d..a822ca631 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -221,7 +221,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/dynlink/CMakeLists.txt b/source/dynlink/CMakeLists.txt index dbb770bec..33a62eaa7 100644 --- a/source/dynlink/CMakeLists.txt +++ b/source/dynlink/CMakeLists.txt @@ -168,7 +168,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/environment/CMakeLists.txt b/source/environment/CMakeLists.txt index 243a97849..34c36271b 100644 --- a/source/environment/CMakeLists.txt +++ b/source/environment/CMakeLists.txt @@ -150,7 +150,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/examples/metacallgui/CMakeLists.txt b/source/examples/metacallgui/CMakeLists.txt index 5ad975790..8bfa9b958 100644 --- a/source/examples/metacallgui/CMakeLists.txt +++ b/source/examples/metacallgui/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/examples/metacalllog/CMakeLists.txt b/source/examples/metacalllog/CMakeLists.txt index 5a4c04da4..5a180105b 100644 --- a/source/examples/metacalllog/CMakeLists.txt +++ b/source/examples/metacalllog/CMakeLists.txt @@ -93,7 +93,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/examples/metacallquine/CMakeLists.txt b/source/examples/metacallquine/CMakeLists.txt index 9254a6b79..299a45762 100644 --- a/source/examples/metacallquine/CMakeLists.txt +++ b/source/examples/metacallquine/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/examples/metacallweb/CMakeLists.txt b/source/examples/metacallweb/CMakeLists.txt index 7e6a5f7fe..b4e9c095d 100644 --- a/source/examples/metacallweb/CMakeLists.txt +++ b/source/examples/metacallweb/CMakeLists.txt @@ -99,7 +99,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/extensions/plugin_extension/CMakeLists.txt b/source/extensions/plugin_extension/CMakeLists.txt index 0ef36ecd1..6873958a2 100644 --- a/source/extensions/plugin_extension/CMakeLists.txt +++ b/source/extensions/plugin_extension/CMakeLists.txt @@ -161,7 +161,7 @@ target_compile_features(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/filesystem/CMakeLists.txt b/source/filesystem/CMakeLists.txt index 397193fde..472863df3 100644 --- a/source/filesystem/CMakeLists.txt +++ b/source/filesystem/CMakeLists.txt @@ -181,7 +181,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/format/CMakeLists.txt b/source/format/CMakeLists.txt index d9f880e1a..46d4ba545 100644 --- a/source/format/CMakeLists.txt +++ b/source/format/CMakeLists.txt @@ -147,7 +147,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loader/CMakeLists.txt b/source/loader/CMakeLists.txt index 852575a60..dad99a6b7 100644 --- a/source/loader/CMakeLists.txt +++ b/source/loader/CMakeLists.txt @@ -170,7 +170,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/c_loader/CMakeLists.txt b/source/loaders/c_loader/CMakeLists.txt index cc2c09210..729466872 100644 --- a/source/loaders/c_loader/CMakeLists.txt +++ b/source/loaders/c_loader/CMakeLists.txt @@ -203,7 +203,7 @@ target_compile_features(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/cob_loader/CMakeLists.txt b/source/loaders/cob_loader/CMakeLists.txt index cd0327d7c..19890f7d5 100644 --- a/source/loaders/cob_loader/CMakeLists.txt +++ b/source/loaders/cob_loader/CMakeLists.txt @@ -162,7 +162,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/cr_loader/CMakeLists.txt b/source/loaders/cr_loader/CMakeLists.txt index 9a40a3bef..b0ab7ba89 100644 --- a/source/loaders/cr_loader/CMakeLists.txt +++ b/source/loaders/cr_loader/CMakeLists.txt @@ -154,7 +154,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/cs_loader/CMakeLists.txt b/source/loaders/cs_loader/CMakeLists.txt index 8486486e6..c872d0f24 100644 --- a/source/loaders/cs_loader/CMakeLists.txt +++ b/source/loaders/cs_loader/CMakeLists.txt @@ -222,7 +222,7 @@ target_compile_features(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/dart_loader/CMakeLists.txt b/source/loaders/dart_loader/CMakeLists.txt index 7cff11bd5..6355e44cd 100644 --- a/source/loaders/dart_loader/CMakeLists.txt +++ b/source/loaders/dart_loader/CMakeLists.txt @@ -165,7 +165,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/ext_loader/CMakeLists.txt b/source/loaders/ext_loader/CMakeLists.txt index bb850b7ab..b2a9545f9 100644 --- a/source/loaders/ext_loader/CMakeLists.txt +++ b/source/loaders/ext_loader/CMakeLists.txt @@ -163,7 +163,7 @@ target_compile_features(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/file_loader/CMakeLists.txt b/source/loaders/file_loader/CMakeLists.txt index eac4491f7..0f03daec2 100644 --- a/source/loaders/file_loader/CMakeLists.txt +++ b/source/loaders/file_loader/CMakeLists.txt @@ -154,7 +154,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/java_loader/CMakeLists.txt b/source/loaders/java_loader/CMakeLists.txt index 7c26d1871..c9b4d5857 100644 --- a/source/loaders/java_loader/CMakeLists.txt +++ b/source/loaders/java_loader/CMakeLists.txt @@ -175,7 +175,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/jl_loader/CMakeLists.txt b/source/loaders/jl_loader/CMakeLists.txt index e7a4a3f81..8c1109f2f 100644 --- a/source/loaders/jl_loader/CMakeLists.txt +++ b/source/loaders/jl_loader/CMakeLists.txt @@ -180,7 +180,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/js_loader/CMakeLists.txt b/source/loaders/js_loader/CMakeLists.txt index e5a963fb0..dfa627ff9 100644 --- a/source/loaders/js_loader/CMakeLists.txt +++ b/source/loaders/js_loader/CMakeLists.txt @@ -171,7 +171,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/jsm_loader/CMakeLists.txt b/source/loaders/jsm_loader/CMakeLists.txt index 3993e4b1f..36accd7ed 100644 --- a/source/loaders/jsm_loader/CMakeLists.txt +++ b/source/loaders/jsm_loader/CMakeLists.txt @@ -169,7 +169,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/llvm_loader/CMakeLists.txt b/source/loaders/llvm_loader/CMakeLists.txt index 0b31d18fc..7755ecf18 100644 --- a/source/loaders/llvm_loader/CMakeLists.txt +++ b/source/loaders/llvm_loader/CMakeLists.txt @@ -169,7 +169,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/lua_loader/CMakeLists.txt b/source/loaders/lua_loader/CMakeLists.txt index bd1c7fd72..6a735bbd7 100644 --- a/source/loaders/lua_loader/CMakeLists.txt +++ b/source/loaders/lua_loader/CMakeLists.txt @@ -167,7 +167,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/mock_loader/CMakeLists.txt b/source/loaders/mock_loader/CMakeLists.txt index 72a8dfbcb..60cd93043 100644 --- a/source/loaders/mock_loader/CMakeLists.txt +++ b/source/loaders/mock_loader/CMakeLists.txt @@ -154,7 +154,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 0a3b26775..d4af40596 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -157,6 +157,9 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library + # TODO: Implement workaround to the problem: "PE32 file format does not support weak linkage" + # $<$<BOOL:${WIN32}>:${NodeJS_LIBRARY}> # NodeJS library + PUBLIC ${DEFAULT_LIBRARIES} @@ -195,8 +198,10 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE + # TODO: MacOS + # $<$<BOOL:${APPLE}>:-Wl,-undefined=dynamic_lookup> PUBLIC ${DEFAULT_LINKER_OPTIONS} diff --git a/source/loaders/py_loader/CMakeLists.txt b/source/loaders/py_loader/CMakeLists.txt index eed3658bc..105bfae2c 100644 --- a/source/loaders/py_loader/CMakeLists.txt +++ b/source/loaders/py_loader/CMakeLists.txt @@ -209,7 +209,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/rb_loader/CMakeLists.txt b/source/loaders/rb_loader/CMakeLists.txt index 787fb3a17..8259079b4 100644 --- a/source/loaders/rb_loader/CMakeLists.txt +++ b/source/loaders/rb_loader/CMakeLists.txt @@ -186,7 +186,7 @@ endif() # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/rpc_loader/CMakeLists.txt b/source/loaders/rpc_loader/CMakeLists.txt index 9ebdc58c0..c81839aef 100644 --- a/source/loaders/rpc_loader/CMakeLists.txt +++ b/source/loaders/rpc_loader/CMakeLists.txt @@ -171,7 +171,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/rs_loader/CMakeLists.txt b/source/loaders/rs_loader/CMakeLists.txt index e6b4bbcff..4c97cf599 100644 --- a/source/loaders/rs_loader/CMakeLists.txt +++ b/source/loaders/rs_loader/CMakeLists.txt @@ -177,7 +177,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/ts_loader/CMakeLists.txt b/source/loaders/ts_loader/CMakeLists.txt index 4869091dd..076f40dc7 100644 --- a/source/loaders/ts_loader/CMakeLists.txt +++ b/source/loaders/ts_loader/CMakeLists.txt @@ -164,7 +164,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/wasm_loader/CMakeLists.txt b/source/loaders/wasm_loader/CMakeLists.txt index 1dd721fec..20ada2d79 100644 --- a/source/loaders/wasm_loader/CMakeLists.txt +++ b/source/loaders/wasm_loader/CMakeLists.txt @@ -174,7 +174,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/log/CMakeLists.txt b/source/log/CMakeLists.txt index becaf85fb..79c9c9ff9 100644 --- a/source/log/CMakeLists.txt +++ b/source/log/CMakeLists.txt @@ -219,7 +219,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/memory/CMakeLists.txt b/source/memory/CMakeLists.txt index fa7b05c03..17a4b1b1c 100644 --- a/source/memory/CMakeLists.txt +++ b/source/memory/CMakeLists.txt @@ -161,7 +161,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/metacall/CMakeLists.txt b/source/metacall/CMakeLists.txt index 1ab5be1fa..e04b167e8 100644 --- a/source/metacall/CMakeLists.txt +++ b/source/metacall/CMakeLists.txt @@ -242,7 +242,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/plugin/CMakeLists.txt b/source/plugin/CMakeLists.txt index 168286404..c46756f36 100644 --- a/source/plugin/CMakeLists.txt +++ b/source/plugin/CMakeLists.txt @@ -163,7 +163,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/plugins/backtrace_plugin/CMakeLists.txt b/source/plugins/backtrace_plugin/CMakeLists.txt index e434b7303..866e7b923 100644 --- a/source/plugins/backtrace_plugin/CMakeLists.txt +++ b/source/plugins/backtrace_plugin/CMakeLists.txt @@ -216,7 +216,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/plugins/sandbox_plugin/CMakeLists.txt b/source/plugins/sandbox_plugin/CMakeLists.txt index 8d271bf3f..1197f9760 100644 --- a/source/plugins/sandbox_plugin/CMakeLists.txt +++ b/source/plugins/sandbox_plugin/CMakeLists.txt @@ -196,7 +196,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/portability/CMakeLists.txt b/source/portability/CMakeLists.txt index cf4af64c6..fab62a921 100644 --- a/source/portability/CMakeLists.txt +++ b/source/portability/CMakeLists.txt @@ -156,7 +156,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/ports/cxx_port/CMakeLists.txt b/source/ports/cxx_port/CMakeLists.txt index 076fe1bf1..07b94e752 100644 --- a/source/ports/cxx_port/CMakeLists.txt +++ b/source/ports/cxx_port/CMakeLists.txt @@ -147,7 +147,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/ports/js_port/CMakeLists.txt b/source/ports/js_port/CMakeLists.txt index bae7efb73..447e1fc10 100644 --- a/source/ports/js_port/CMakeLists.txt +++ b/source/ports/js_port/CMakeLists.txt @@ -213,11 +213,8 @@ target_compile_options(${SWIG_MODULE_${target}_REAL_NAME} # Linker options # -target_link_libraries(${SWIG_MODULE_${target}_REAL_NAME} +add_link_options(${SWIG_MODULE_${target}_REAL_NAME} PRIVATE - ${V8_LIBRARIES} # V8 libraries - - ${META_PROJECT_NAME}::metacall PUBLIC ${DEFAULT_LINKER_OPTIONS} @@ -383,7 +380,7 @@ target_compile_options(${js_port_test} # Linker options # -target_link_libraries(${js_port_test} +add_link_options(${js_port_test} PRIVATE PUBLIC diff --git a/source/ports/rb_port/CMakeLists.txt b/source/ports/rb_port/CMakeLists.txt index 1d2cbf5be..0e9e574fc 100644 --- a/source/ports/rb_port/CMakeLists.txt +++ b/source/ports/rb_port/CMakeLists.txt @@ -237,9 +237,8 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${SWIG_MODULE_${target}_REAL_NAME} +add_link_options(${SWIG_MODULE_${target}_REAL_NAME} PRIVATE - ${META_PROJECT_NAME}::metacall PUBLIC ${DEFAULT_LINKER_OPTIONS} diff --git a/source/preprocessor/CMakeLists.txt b/source/preprocessor/CMakeLists.txt index da28c94b7..e3c7016ad 100644 --- a/source/preprocessor/CMakeLists.txt +++ b/source/preprocessor/CMakeLists.txt @@ -179,7 +179,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/reflect/CMakeLists.txt b/source/reflect/CMakeLists.txt index ed13aa98b..04921ad52 100644 --- a/source/reflect/CMakeLists.txt +++ b/source/reflect/CMakeLists.txt @@ -203,7 +203,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/scripts/extension/sum/CMakeLists.txt b/source/scripts/extension/sum/CMakeLists.txt index 223a70066..c076de1e1 100644 --- a/source/scripts/extension/sum/CMakeLists.txt +++ b/source/scripts/extension/sum/CMakeLists.txt @@ -152,7 +152,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/serial/CMakeLists.txt b/source/serial/CMakeLists.txt index 6636295d7..9a7a5b1e1 100644 --- a/source/serial/CMakeLists.txt +++ b/source/serial/CMakeLists.txt @@ -158,7 +158,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/serials/metacall_serial/CMakeLists.txt b/source/serials/metacall_serial/CMakeLists.txt index 0a981ebd3..66160ee09 100644 --- a/source/serials/metacall_serial/CMakeLists.txt +++ b/source/serials/metacall_serial/CMakeLists.txt @@ -158,7 +158,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/serials/rapid_json_serial/CMakeLists.txt b/source/serials/rapid_json_serial/CMakeLists.txt index c3f1d0d0c..aa2b18935 100644 --- a/source/serials/rapid_json_serial/CMakeLists.txt +++ b/source/serials/rapid_json_serial/CMakeLists.txt @@ -191,7 +191,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/tests/adt_map_test/CMakeLists.txt b/source/tests/adt_map_test/CMakeLists.txt index 65c947a0c..45bca49c8 100644 --- a/source/tests/adt_map_test/CMakeLists.txt +++ b/source/tests/adt_map_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/adt_set_test/CMakeLists.txt b/source/tests/adt_set_test/CMakeLists.txt index b56b9e7d9..21972409d 100644 --- a/source/tests/adt_set_test/CMakeLists.txt +++ b/source/tests/adt_set_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/adt_trie_test/CMakeLists.txt b/source/tests/adt_trie_test/CMakeLists.txt index b59489c70..28305388b 100644 --- a/source/tests/adt_trie_test/CMakeLists.txt +++ b/source/tests/adt_trie_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/adt_vector_test/CMakeLists.txt b/source/tests/adt_vector_test/CMakeLists.txt index f01ad35d0..cc085cb1b 100644 --- a/source/tests/adt_vector_test/CMakeLists.txt +++ b/source/tests/adt_vector_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/configuration_test/CMakeLists.txt b/source/tests/configuration_test/CMakeLists.txt index 2e9e6d996..e749dc9c5 100644 --- a/source/tests/configuration_test/CMakeLists.txt +++ b/source/tests/configuration_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/detour_test/CMakeLists.txt b/source/tests/detour_test/CMakeLists.txt index b22067a44..1e96fa5a0 100644 --- a/source/tests/detour_test/CMakeLists.txt +++ b/source/tests/detour_test/CMakeLists.txt @@ -121,7 +121,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/dynlink_test/CMakeLists.txt b/source/tests/dynlink_test/CMakeLists.txt index f8375ae69..53718d407 100644 --- a/source/tests/dynlink_test/CMakeLists.txt +++ b/source/tests/dynlink_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/environment_test/CMakeLists.txt b/source/tests/environment_test/CMakeLists.txt index 2b314418b..7a7575d46 100644 --- a/source/tests/environment_test/CMakeLists.txt +++ b/source/tests/environment_test/CMakeLists.txt @@ -107,7 +107,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/log_custom_test/CMakeLists.txt b/source/tests/log_custom_test/CMakeLists.txt index f79f04b9d..4793ab64a 100644 --- a/source/tests/log_custom_test/CMakeLists.txt +++ b/source/tests/log_custom_test/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/log_test/CMakeLists.txt b/source/tests/log_test/CMakeLists.txt index dfcb40b5e..8fe8cca09 100644 --- a/source/tests/log_test/CMakeLists.txt +++ b/source/tests/log_test/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt b/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt index 31ff00540..2d5ad256a 100644 --- a/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_c_lib_test/CMakeLists.txt b/source/tests/metacall_c_lib_test/CMakeLists.txt index 60b3157a2..d4d7aa561 100644 --- a/source/tests/metacall_c_lib_test/CMakeLists.txt +++ b/source/tests/metacall_c_lib_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_c_test/CMakeLists.txt b/source/tests/metacall_c_test/CMakeLists.txt index da8b42575..76188b304 100644 --- a/source/tests/metacall_c_test/CMakeLists.txt +++ b/source/tests/metacall_c_test/CMakeLists.txt @@ -124,7 +124,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_callback_complex_test/CMakeLists.txt b/source/tests/metacall_callback_complex_test/CMakeLists.txt index 2edd78b98..c6c54a96a 100644 --- a/source/tests/metacall_callback_complex_test/CMakeLists.txt +++ b/source/tests/metacall_callback_complex_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cast_test/CMakeLists.txt b/source/tests/metacall_cast_test/CMakeLists.txt index 73c8f9d98..4880ebe39 100644 --- a/source/tests/metacall_cast_test/CMakeLists.txt +++ b/source/tests/metacall_cast_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_clear_test/CMakeLists.txt b/source/tests/metacall_clear_test/CMakeLists.txt index a40a1ebc9..32591ebc4 100644 --- a/source/tests/metacall_clear_test/CMakeLists.txt +++ b/source/tests/metacall_clear_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt b/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt index 5c2f4b739..8bb9fa0bc 100644 --- a/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt +++ b/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt @@ -123,7 +123,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt b/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt index 5da0b4cf3..1f50fb8ca 100644 --- a/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cobol_test/CMakeLists.txt b/source/tests/metacall_cobol_test/CMakeLists.txt index 6dddd7b9f..1c66d2dd2 100644 --- a/source/tests/metacall_cobol_test/CMakeLists.txt +++ b/source/tests/metacall_cobol_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_configuration_default_test/CMakeLists.txt b/source/tests/metacall_configuration_default_test/CMakeLists.txt index f82aca6df..589eeb1d1 100644 --- a/source/tests/metacall_configuration_default_test/CMakeLists.txt +++ b/source/tests/metacall_configuration_default_test/CMakeLists.txt @@ -129,7 +129,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt index da3bc94fa..af15809f2 100644 --- a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt +++ b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cs_test/CMakeLists.txt b/source/tests/metacall_cs_test/CMakeLists.txt index f92b705a7..5859e5a82 100644 --- a/source/tests/metacall_cs_test/CMakeLists.txt +++ b/source/tests/metacall_cs_test/CMakeLists.txt @@ -117,7 +117,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_csharp_function_test/CMakeLists.txt b/source/tests/metacall_csharp_function_test/CMakeLists.txt index 1d641d00d..e89890969 100644 --- a/source/tests/metacall_csharp_function_test/CMakeLists.txt +++ b/source/tests/metacall_csharp_function_test/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_csharp_static_class_test/CMakeLists.txt b/source/tests/metacall_csharp_static_class_test/CMakeLists.txt index 6280b8f98..1c43f950a 100644 --- a/source/tests/metacall_csharp_static_class_test/CMakeLists.txt +++ b/source/tests/metacall_csharp_static_class_test/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_depends_test/CMakeLists.txt b/source/tests/metacall_depends_test/CMakeLists.txt index c94dbeae7..4fab09eae 100644 --- a/source/tests/metacall_depends_test/CMakeLists.txt +++ b/source/tests/metacall_depends_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_distributable_test/CMakeLists.txt b/source/tests/metacall_distributable_test/CMakeLists.txt index bf924ad61..257189724 100644 --- a/source/tests/metacall_distributable_test/CMakeLists.txt +++ b/source/tests/metacall_distributable_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ducktype_test/CMakeLists.txt b/source/tests/metacall_ducktype_test/CMakeLists.txt index 61d3ac4bf..11eed7096 100644 --- a/source/tests/metacall_ducktype_test/CMakeLists.txt +++ b/source/tests/metacall_ducktype_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_duplicated_handle_test/CMakeLists.txt b/source/tests/metacall_duplicated_handle_test/CMakeLists.txt index c86f54169..12424e225 100644 --- a/source/tests/metacall_duplicated_handle_test/CMakeLists.txt +++ b/source/tests/metacall_duplicated_handle_test/CMakeLists.txt @@ -114,7 +114,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt b/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt index c53907078..3b17aa0ac 100644 --- a/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt +++ b/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_dynlink_path_test/CMakeLists.txt b/source/tests/metacall_dynlink_path_test/CMakeLists.txt index ecc76c6f7..722d234a7 100644 --- a/source/tests/metacall_dynlink_path_test/CMakeLists.txt +++ b/source/tests/metacall_dynlink_path_test/CMakeLists.txt @@ -115,7 +115,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ext_test/CMakeLists.txt b/source/tests/metacall_ext_test/CMakeLists.txt index e75e6ff9f..b80533149 100644 --- a/source/tests/metacall_ext_test/CMakeLists.txt +++ b/source/tests/metacall_ext_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_file_fail_test/CMakeLists.txt b/source/tests/metacall_file_fail_test/CMakeLists.txt index e58b57b69..7e8d50072 100644 --- a/source/tests/metacall_file_fail_test/CMakeLists.txt +++ b/source/tests/metacall_file_fail_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_file_glob_test/CMakeLists.txt b/source/tests/metacall_file_glob_test/CMakeLists.txt index fde9870d6..ae886d214 100644 --- a/source/tests/metacall_file_glob_test/CMakeLists.txt +++ b/source/tests/metacall_file_glob_test/CMakeLists.txt @@ -123,7 +123,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_file_test/CMakeLists.txt b/source/tests/metacall_file_test/CMakeLists.txt index ad378539d..5f1673554 100644 --- a/source/tests/metacall_file_test/CMakeLists.txt +++ b/source/tests/metacall_file_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_fork_test/CMakeLists.txt b/source/tests/metacall_fork_test/CMakeLists.txt index 34ebb8a12..d7f19ff1e 100644 --- a/source/tests/metacall_fork_test/CMakeLists.txt +++ b/source/tests/metacall_fork_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_function_test/CMakeLists.txt b/source/tests/metacall_function_test/CMakeLists.txt index ad6e4fe58..fbe8d14ea 100644 --- a/source/tests/metacall_function_test/CMakeLists.txt +++ b/source/tests/metacall_function_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_handle_export_test/CMakeLists.txt b/source/tests/metacall_handle_export_test/CMakeLists.txt index d734ebe09..7320e8e92 100644 --- a/source/tests/metacall_handle_export_test/CMakeLists.txt +++ b/source/tests/metacall_handle_export_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_handle_get_test/CMakeLists.txt b/source/tests/metacall_handle_get_test/CMakeLists.txt index dd5aa471e..7a6576f36 100644 --- a/source/tests/metacall_handle_get_test/CMakeLists.txt +++ b/source/tests/metacall_handle_get_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_init_fini_test/CMakeLists.txt b/source/tests/metacall_init_fini_test/CMakeLists.txt index 86f467105..4b75590d1 100644 --- a/source/tests/metacall_init_fini_test/CMakeLists.txt +++ b/source/tests/metacall_init_fini_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt b/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt index b91de9c5c..65a685801 100644 --- a/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt b/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt index 1fbd5c0e4..9b19bbb70 100644 --- a/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_initialize_ex_test/CMakeLists.txt b/source/tests/metacall_initialize_ex_test/CMakeLists.txt index 18d0f1e58..3aa9967e4 100644 --- a/source/tests/metacall_initialize_ex_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_ex_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_initialize_test/CMakeLists.txt b/source/tests/metacall_initialize_test/CMakeLists.txt index 2d231d616..fb1b6abfb 100644 --- a/source/tests/metacall_initialize_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_inspect_test/CMakeLists.txt b/source/tests/metacall_inspect_test/CMakeLists.txt index 7f5664fbb..3deb9cd29 100644 --- a/source/tests/metacall_inspect_test/CMakeLists.txt +++ b/source/tests/metacall_inspect_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_integration_test/CMakeLists.txt b/source/tests/metacall_integration_test/CMakeLists.txt index b3236cb02..7314bdebd 100644 --- a/source/tests/metacall_integration_test/CMakeLists.txt +++ b/source/tests/metacall_integration_test/CMakeLists.txt @@ -117,7 +117,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_invalid_loader_test/CMakeLists.txt b/source/tests/metacall_invalid_loader_test/CMakeLists.txt index 3d0941cba..d3d16ec7a 100644 --- a/source/tests/metacall_invalid_loader_test/CMakeLists.txt +++ b/source/tests/metacall_invalid_loader_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_java_test/CMakeLists.txt b/source/tests/metacall_java_test/CMakeLists.txt index b7e52cab4..b1e2810fa 100644 --- a/source/tests/metacall_java_test/CMakeLists.txt +++ b/source/tests/metacall_java_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_julia_test/CMakeLists.txt b/source/tests/metacall_julia_test/CMakeLists.txt index 701fb1b89..c5f59d1e9 100644 --- a/source/tests/metacall_julia_test/CMakeLists.txt +++ b/source/tests/metacall_julia_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt b/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt index 1bc31a11a..552b2ecc2 100644 --- a/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt +++ b/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_llvm_test/CMakeLists.txt b/source/tests/metacall_llvm_test/CMakeLists.txt index acc723fdc..31b0c3d35 100644 --- a/source/tests/metacall_llvm_test/CMakeLists.txt +++ b/source/tests/metacall_llvm_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt b/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt index d25581f20..9d3f8e8ab 100644 --- a/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt @@ -114,7 +114,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt b/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt index cb1dcf870..86917f395 100644 --- a/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt b/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt index 9191bf4f3..b7588a561 100644 --- a/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt @@ -116,7 +116,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt b/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt index efaabddc6..90d3754bc 100644 --- a/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_test/CMakeLists.txt b/source/tests/metacall_load_configuration_test/CMakeLists.txt index a37dec752..04dca70c3 100644 --- a/source/tests/metacall_load_configuration_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_memory_empty_test/CMakeLists.txt b/source/tests/metacall_load_memory_empty_test/CMakeLists.txt index 0cb67b3d9..719056eae 100644 --- a/source/tests/metacall_load_memory_empty_test/CMakeLists.txt +++ b/source/tests/metacall_load_memory_empty_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_memory_test/CMakeLists.txt b/source/tests/metacall_load_memory_test/CMakeLists.txt index c85b9c10d..014b7823f 100644 --- a/source/tests/metacall_load_memory_test/CMakeLists.txt +++ b/source/tests/metacall_load_memory_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_logs_test/CMakeLists.txt b/source/tests/metacall_logs_test/CMakeLists.txt index 068c0cf21..514da4c48 100644 --- a/source/tests/metacall_logs_test/CMakeLists.txt +++ b/source/tests/metacall_logs_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_lua_test/CMakeLists.txt b/source/tests/metacall_lua_test/CMakeLists.txt index d8d2cfc01..164aeeb3c 100644 --- a/source/tests/metacall_lua_test/CMakeLists.txt +++ b/source/tests/metacall_lua_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_map_await_test/CMakeLists.txt b/source/tests/metacall_map_await_test/CMakeLists.txt index c70decf95..7cb62f098 100644 --- a/source/tests/metacall_map_await_test/CMakeLists.txt +++ b/source/tests/metacall_map_await_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_map_test/CMakeLists.txt b/source/tests/metacall_map_test/CMakeLists.txt index 72cbbcab0..ffe8d92c5 100644 --- a/source/tests/metacall_map_test/CMakeLists.txt +++ b/source/tests/metacall_map_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_async_multiple_test/CMakeLists.txt b/source/tests/metacall_node_async_multiple_test/CMakeLists.txt index 7fc6365c9..2e5f9a135 100644 --- a/source/tests/metacall_node_async_multiple_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_multiple_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_async_resources_test/CMakeLists.txt b/source/tests/metacall_node_async_resources_test/CMakeLists.txt index f57aeb377..6fafa70d2 100644 --- a/source/tests/metacall_node_async_resources_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_resources_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_async_test/CMakeLists.txt b/source/tests/metacall_node_async_test/CMakeLists.txt index 43e43eb6a..d6a4050aa 100644 --- a/source/tests/metacall_node_async_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_await_chain_test/CMakeLists.txt b/source/tests/metacall_node_await_chain_test/CMakeLists.txt index 8fc2574d9..8b15b75da 100644 --- a/source/tests/metacall_node_await_chain_test/CMakeLists.txt +++ b/source/tests/metacall_node_await_chain_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_call_test/CMakeLists.txt b/source/tests/metacall_node_call_test/CMakeLists.txt index 1c86441a0..f0ac1da58 100644 --- a/source/tests/metacall_node_call_test/CMakeLists.txt +++ b/source/tests/metacall_node_call_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_callback_test/CMakeLists.txt b/source/tests/metacall_node_callback_test/CMakeLists.txt index 6c50252a1..1249cc38e 100644 --- a/source/tests/metacall_node_callback_test/CMakeLists.txt +++ b/source/tests/metacall_node_callback_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_clear_mem_test/CMakeLists.txt b/source/tests/metacall_node_clear_mem_test/CMakeLists.txt index 511ce96e6..c91655dc4 100644 --- a/source/tests/metacall_node_clear_mem_test/CMakeLists.txt +++ b/source/tests/metacall_node_clear_mem_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_default_export_test/CMakeLists.txt b/source/tests/metacall_node_default_export_test/CMakeLists.txt index 4e1f5477b..93468e1ad 100644 --- a/source/tests/metacall_node_default_export_test/CMakeLists.txt +++ b/source/tests/metacall_node_default_export_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt b/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt index b47b5650d..7c2922950 100644 --- a/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt +++ b/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_event_loop_test/CMakeLists.txt b/source/tests/metacall_node_event_loop_test/CMakeLists.txt index ddbf38c2c..a0d1ae8ce 100644 --- a/source/tests/metacall_node_event_loop_test/CMakeLists.txt +++ b/source/tests/metacall_node_event_loop_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_exception_test/CMakeLists.txt b/source/tests/metacall_node_exception_test/CMakeLists.txt index f203c824c..f2a47f44e 100644 --- a/source/tests/metacall_node_exception_test/CMakeLists.txt +++ b/source/tests/metacall_node_exception_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_extension_test/CMakeLists.txt b/source/tests/metacall_node_extension_test/CMakeLists.txt index 33c372ae8..538385f34 100644 --- a/source/tests/metacall_node_extension_test/CMakeLists.txt +++ b/source/tests/metacall_node_extension_test/CMakeLists.txt @@ -114,7 +114,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt b/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt index 997208d44..ebd286752 100644 --- a/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt +++ b/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt @@ -173,7 +173,7 @@ target_compile_options(${target} # Linker options # -target_link_options(${target} +add_link_options(${target} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/IGNORE:4199> $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> diff --git a/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt b/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt index 0e629197c..9125c4a7b 100644 --- a/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt b/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt index 35d46706a..0477424f8 100644 --- a/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_fail_test/CMakeLists.txt b/source/tests/metacall_node_fail_test/CMakeLists.txt index cdb112b96..fe06183eb 100644 --- a/source/tests/metacall_node_fail_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_inline_test/CMakeLists.txt b/source/tests/metacall_node_inline_test/CMakeLists.txt index 8d86c00ca..9f7829362 100644 --- a/source/tests/metacall_node_inline_test/CMakeLists.txt +++ b/source/tests/metacall_node_inline_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt b/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt index 314015302..c7c06a689 100644 --- a/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt +++ b/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_native_code_test/CMakeLists.txt b/source/tests/metacall_node_native_code_test/CMakeLists.txt index e915ed3b7..59f982c4c 100644 --- a/source/tests/metacall_node_native_code_test/CMakeLists.txt +++ b/source/tests/metacall_node_native_code_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_port_await_test/CMakeLists.txt b/source/tests/metacall_node_port_await_test/CMakeLists.txt index 7afce5c27..1b87b2f23 100644 --- a/source/tests/metacall_node_port_await_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_await_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt index 0f4436b10..6fb0c363a 100644 --- a/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt @@ -128,7 +128,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_port_rs_test/CMakeLists.txt b/source/tests/metacall_node_port_rs_test/CMakeLists.txt index 2882f8630..081c44abc 100644 --- a/source/tests/metacall_node_port_rs_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_rs_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_port_test/CMakeLists.txt b/source/tests/metacall_node_port_test/CMakeLists.txt index 9c6c12b5b..2d83ab674 100644 --- a/source/tests/metacall_node_port_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt b/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt index f08873f6e..435ed2445 100644 --- a/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt b/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt index af1945174..6c88f35e3 100644 --- a/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_await_test/CMakeLists.txt b/source/tests/metacall_node_python_await_test/CMakeLists.txt index 70da8a544..09f86f6ba 100644 --- a/source/tests/metacall_node_python_await_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_await_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt b/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt index 4f2cd49f9..0e896b1dc 100644 --- a/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_exception_test/CMakeLists.txt b/source/tests/metacall_node_python_exception_test/CMakeLists.txt index af4c39982..49aee2178 100644 --- a/source/tests/metacall_node_python_exception_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_exception_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt b/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt index 2179b2e2b..5cee029fe 100644 --- a/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt @@ -116,7 +116,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt b/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt index d6299a6ae..faa5e03e8 100644 --- a/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt @@ -116,7 +116,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_ruby_test/CMakeLists.txt b/source/tests/metacall_node_python_ruby_test/CMakeLists.txt index 20f09c16a..dbcd8c316 100644 --- a/source/tests/metacall_node_python_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_ruby_test/CMakeLists.txt @@ -122,7 +122,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_reentrant_test/CMakeLists.txt b/source/tests/metacall_node_reentrant_test/CMakeLists.txt index 02e497681..27cdea516 100644 --- a/source/tests/metacall_node_reentrant_test/CMakeLists.txt +++ b/source/tests/metacall_node_reentrant_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_signal_handler_test/CMakeLists.txt b/source/tests/metacall_node_signal_handler_test/CMakeLists.txt index 29cc2a68c..312d29679 100644 --- a/source/tests/metacall_node_signal_handler_test/CMakeLists.txt +++ b/source/tests/metacall_node_signal_handler_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_test/CMakeLists.txt b/source/tests/metacall_node_test/CMakeLists.txt index c5f3c1219..3c311060a 100644 --- a/source/tests/metacall_node_test/CMakeLists.txt +++ b/source/tests/metacall_node_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_typescript_test/CMakeLists.txt b/source/tests/metacall_node_typescript_test/CMakeLists.txt index 2a0c79ccc..4a80ab646 100644 --- a/source/tests/metacall_node_typescript_test/CMakeLists.txt +++ b/source/tests/metacall_node_typescript_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt index c0d8779c4..29f56547c 100644 --- a/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt @@ -122,7 +122,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt index 65eec2ce2..a4328a9cc 100644 --- a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt @@ -115,7 +115,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt index 3a96bccef..438ce9105 100644 --- a/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_plugin_extension_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_test/CMakeLists.txt index 4c4bc887c..3b783b815 100644 --- a/source/tests/metacall_plugin_extension_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_async_test/CMakeLists.txt b/source/tests/metacall_python_async_test/CMakeLists.txt index a93607cc8..3438c0ff4 100644 --- a/source/tests/metacall_python_async_test/CMakeLists.txt +++ b/source/tests/metacall_python_async_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_await_test/CMakeLists.txt b/source/tests/metacall_python_await_test/CMakeLists.txt index 13cddb5d2..9e77a645c 100644 --- a/source/tests/metacall_python_await_test/CMakeLists.txt +++ b/source/tests/metacall_python_await_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_builtins_test/CMakeLists.txt b/source/tests/metacall_python_builtins_test/CMakeLists.txt index 2e13c4e70..8d99ccf6c 100644 --- a/source/tests/metacall_python_builtins_test/CMakeLists.txt +++ b/source/tests/metacall_python_builtins_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_callback_test/CMakeLists.txt b/source/tests/metacall_python_callback_test/CMakeLists.txt index eab775d3e..702009b82 100644 --- a/source/tests/metacall_python_callback_test/CMakeLists.txt +++ b/source/tests/metacall_python_callback_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_dict_test/CMakeLists.txt b/source/tests/metacall_python_dict_test/CMakeLists.txt index ed59ef059..0f08317ff 100644 --- a/source/tests/metacall_python_dict_test/CMakeLists.txt +++ b/source/tests/metacall_python_dict_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_exception_test/CMakeLists.txt b/source/tests/metacall_python_exception_test/CMakeLists.txt index 85f131f27..904d8a573 100644 --- a/source/tests/metacall_python_exception_test/CMakeLists.txt +++ b/source/tests/metacall_python_exception_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_fail_test/CMakeLists.txt b/source/tests/metacall_python_fail_test/CMakeLists.txt index 73c4b15a8..b8950664c 100644 --- a/source/tests/metacall_python_fail_test/CMakeLists.txt +++ b/source/tests/metacall_python_fail_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_gc_test/CMakeLists.txt b/source/tests/metacall_python_gc_test/CMakeLists.txt index 01d197ada..4155fec42 100644 --- a/source/tests/metacall_python_gc_test/CMakeLists.txt +++ b/source/tests/metacall_python_gc_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_loader_port_test/CMakeLists.txt b/source/tests/metacall_python_loader_port_test/CMakeLists.txt index e1c2b3f45..63bcdad97 100644 --- a/source/tests/metacall_python_loader_port_test/CMakeLists.txt +++ b/source/tests/metacall_python_loader_port_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_model_test/CMakeLists.txt b/source/tests/metacall_python_model_test/CMakeLists.txt index d7d554d84..86155738c 100644 --- a/source/tests/metacall_python_model_test/CMakeLists.txt +++ b/source/tests/metacall_python_model_test/CMakeLists.txt @@ -122,7 +122,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_node_await_test/CMakeLists.txt b/source/tests/metacall_python_node_await_test/CMakeLists.txt index 4b2cb58b3..b4cf36b3c 100644 --- a/source/tests/metacall_python_node_await_test/CMakeLists.txt +++ b/source/tests/metacall_python_node_await_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_object_class_test/CMakeLists.txt b/source/tests/metacall_python_object_class_test/CMakeLists.txt index 0fb055b61..71dea28cf 100644 --- a/source/tests/metacall_python_object_class_test/CMakeLists.txt +++ b/source/tests/metacall_python_object_class_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_open_test/CMakeLists.txt b/source/tests/metacall_python_open_test/CMakeLists.txt index 2011c17a7..8569b85cd 100644 --- a/source/tests/metacall_python_open_test/CMakeLists.txt +++ b/source/tests/metacall_python_open_test/CMakeLists.txt @@ -131,7 +131,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_pointer_test/CMakeLists.txt b/source/tests/metacall_python_pointer_test/CMakeLists.txt index 911c8d2e8..9c807909a 100644 --- a/source/tests/metacall_python_pointer_test/CMakeLists.txt +++ b/source/tests/metacall_python_pointer_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_callback_test/CMakeLists.txt b/source/tests/metacall_python_port_callback_test/CMakeLists.txt index c2d356b14..6ba38e2c5 100644 --- a/source/tests/metacall_python_port_callback_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_callback_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_https_test/CMakeLists.txt b/source/tests/metacall_python_port_https_test/CMakeLists.txt index 5760efabc..961f0af9a 100644 --- a/source/tests/metacall_python_port_https_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_https_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_import_test/CMakeLists.txt b/source/tests/metacall_python_port_import_test/CMakeLists.txt index 68b706515..285dea5cc 100644 --- a/source/tests/metacall_python_port_import_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_import_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_pointer_test/CMakeLists.txt b/source/tests/metacall_python_port_pointer_test/CMakeLists.txt index d421bdbe7..55188da8f 100644 --- a/source/tests/metacall_python_port_pointer_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_pointer_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_test/CMakeLists.txt b/source/tests/metacall_python_port_test/CMakeLists.txt index ca0c027db..1caa130fa 100644 --- a/source/tests/metacall_python_port_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_reentrant_test/CMakeLists.txt b/source/tests/metacall_python_reentrant_test/CMakeLists.txt index 727a99c1d..f196c4f9d 100644 --- a/source/tests/metacall_python_reentrant_test/CMakeLists.txt +++ b/source/tests/metacall_python_reentrant_test/CMakeLists.txt @@ -114,7 +114,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_relative_path_test/CMakeLists.txt b/source/tests/metacall_python_relative_path_test/CMakeLists.txt index 667570f67..e6ddb6028 100644 --- a/source/tests/metacall_python_relative_path_test/CMakeLists.txt +++ b/source/tests/metacall_python_relative_path_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_test/CMakeLists.txt b/source/tests/metacall_python_test/CMakeLists.txt index 6302b85c2..77631a1fe 100644 --- a/source/tests/metacall_python_test/CMakeLists.txt +++ b/source/tests/metacall_python_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_varargs_test/CMakeLists.txt b/source/tests/metacall_python_varargs_test/CMakeLists.txt index 4fa048b64..9143fc44e 100644 --- a/source/tests/metacall_python_varargs_test/CMakeLists.txt +++ b/source/tests/metacall_python_varargs_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt b/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt index 5ffd8ffed..1a100f4ad 100644 --- a/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt +++ b/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_without_functions_test/CMakeLists.txt b/source/tests/metacall_python_without_functions_test/CMakeLists.txt index 47b97fb0a..540595104 100644 --- a/source/tests/metacall_python_without_functions_test/CMakeLists.txt +++ b/source/tests/metacall_python_without_functions_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_reinitialize_test/CMakeLists.txt b/source/tests/metacall_reinitialize_test/CMakeLists.txt index 82aa0d962..f57b6b85f 100644 --- a/source/tests/metacall_reinitialize_test/CMakeLists.txt +++ b/source/tests/metacall_reinitialize_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_reload_functions_test/CMakeLists.txt b/source/tests/metacall_reload_functions_test/CMakeLists.txt index 07845beb4..4474e902e 100644 --- a/source/tests/metacall_reload_functions_test/CMakeLists.txt +++ b/source/tests/metacall_reload_functions_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_return_monad_test/CMakeLists.txt b/source/tests/metacall_return_monad_test/CMakeLists.txt index 94aa6644f..91874ed62 100644 --- a/source/tests/metacall_return_monad_test/CMakeLists.txt +++ b/source/tests/metacall_return_monad_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rpc_test/CMakeLists.txt b/source/tests/metacall_rpc_test/CMakeLists.txt index 78553d0e8..8fef52d0f 100644 --- a/source/tests/metacall_rpc_test/CMakeLists.txt +++ b/source/tests/metacall_rpc_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt b/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt index 588142060..1fe56e79a 100644 --- a/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_fail_test/CMakeLists.txt b/source/tests/metacall_ruby_fail_test/CMakeLists.txt index 375bfffee..211d238b3 100644 --- a/source/tests/metacall_ruby_fail_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_fail_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_object_class_test/CMakeLists.txt b/source/tests/metacall_ruby_object_class_test/CMakeLists.txt index 3467e7165..fc9e50765 100644 --- a/source/tests/metacall_ruby_object_class_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_object_class_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt b/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt index 9cabe6b27..e933746a3 100644 --- a/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt b/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt index fd57bc523..3f19f74b4 100644 --- a/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_test/CMakeLists.txt b/source/tests/metacall_ruby_test/CMakeLists.txt index e954b12fd..267af49c8 100644 --- a/source/tests/metacall_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_class_test/CMakeLists.txt b/source/tests/metacall_rust_class_test/CMakeLists.txt index 46e5e8953..c968d3174 100644 --- a/source/tests/metacall_rust_class_test/CMakeLists.txt +++ b/source/tests/metacall_rust_class_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt index e873e59af..46488ba4d 100644 --- a/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt index 1d06c81f3..757198c39 100644 --- a/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt index 4c4e3d8b9..3b47f2f3e 100644 --- a/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt index 8a938e300..c77fcfa35 100644 --- a/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_test/CMakeLists.txt b/source/tests/metacall_rust_test/CMakeLists.txt index c868f44c3..543fac1de 100644 --- a/source/tests/metacall_rust_test/CMakeLists.txt +++ b/source/tests/metacall_rust_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt b/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt index e6c39e792..351a271b7 100644 --- a/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt @@ -127,7 +127,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_test/CMakeLists.txt b/source/tests/metacall_test/CMakeLists.txt index b9afa8da8..932f43008 100644 --- a/source/tests/metacall_test/CMakeLists.txt +++ b/source/tests/metacall_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_call_map_test/CMakeLists.txt b/source/tests/metacall_typescript_call_map_test/CMakeLists.txt index 2d60cbe62..55f940a6f 100644 --- a/source/tests/metacall_typescript_call_map_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_call_map_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt b/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt index 3f76973e6..1f88419a8 100644 --- a/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_node_test/CMakeLists.txt b/source/tests/metacall_typescript_node_test/CMakeLists.txt index b6347d049..ba02a30ff 100644 --- a/source/tests/metacall_typescript_node_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_node_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_require_test/CMakeLists.txt b/source/tests/metacall_typescript_require_test/CMakeLists.txt index 48af41357..7ac9c1033 100644 --- a/source/tests/metacall_typescript_require_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_require_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_test/CMakeLists.txt b/source/tests/metacall_typescript_test/CMakeLists.txt index 73b56edcd..92ac58a70 100644 --- a/source/tests/metacall_typescript_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt b/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt index 0eab47ceb..f88d202b5 100644 --- a/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_tsx_test/CMakeLists.txt b/source/tests/metacall_typescript_tsx_test/CMakeLists.txt index 2be3b225b..2f1c5273f 100644 --- a/source/tests/metacall_typescript_tsx_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_tsx_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_version_test/CMakeLists.txt b/source/tests/metacall_version_test/CMakeLists.txt index f519f674e..1b89dd1e8 100644 --- a/source/tests/metacall_version_test/CMakeLists.txt +++ b/source/tests/metacall_version_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_wasm_python_port_test/CMakeLists.txt b/source/tests/metacall_wasm_python_port_test/CMakeLists.txt index 988752170..e179a04e1 100644 --- a/source/tests/metacall_wasm_python_port_test/CMakeLists.txt +++ b/source/tests/metacall_wasm_python_port_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_wasm_test/CMakeLists.txt b/source/tests/metacall_wasm_test/CMakeLists.txt index 2d1d0b0f3..8a928bef8 100644 --- a/source/tests/metacall_wasm_test/CMakeLists.txt +++ b/source/tests/metacall_wasm_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/portability_path_test/CMakeLists.txt b/source/tests/portability_path_test/CMakeLists.txt index bc736b07d..ea98857af 100644 --- a/source/tests/portability_path_test/CMakeLists.txt +++ b/source/tests/portability_path_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/preprocessor_test/CMakeLists.txt b/source/tests/preprocessor_test/CMakeLists.txt index f6533c008..17efabee8 100644 --- a/source/tests/preprocessor_test/CMakeLists.txt +++ b/source/tests/preprocessor_test/CMakeLists.txt @@ -106,7 +106,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/rb_loader_parser_test/CMakeLists.txt b/source/tests/rb_loader_parser_test/CMakeLists.txt index 3242839e2..30cb37c5a 100644 --- a/source/tests/rb_loader_parser_test/CMakeLists.txt +++ b/source/tests/rb_loader_parser_test/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_function_test/CMakeLists.txt b/source/tests/reflect_function_test/CMakeLists.txt index 3a7ae3a80..202dca6ac 100644 --- a/source/tests/reflect_function_test/CMakeLists.txt +++ b/source/tests/reflect_function_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_metadata_test/CMakeLists.txt b/source/tests/reflect_metadata_test/CMakeLists.txt index 375080bea..07291ac50 100644 --- a/source/tests/reflect_metadata_test/CMakeLists.txt +++ b/source/tests/reflect_metadata_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_object_class_test/CMakeLists.txt b/source/tests/reflect_object_class_test/CMakeLists.txt index 6b515aec6..14d331f17 100644 --- a/source/tests/reflect_object_class_test/CMakeLists.txt +++ b/source/tests/reflect_object_class_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_scope_test/CMakeLists.txt b/source/tests/reflect_scope_test/CMakeLists.txt index ba08a0cd7..dfb712094 100644 --- a/source/tests/reflect_scope_test/CMakeLists.txt +++ b/source/tests/reflect_scope_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_value_cast_test/CMakeLists.txt b/source/tests/reflect_value_cast_test/CMakeLists.txt index aa40caae6..616715e7f 100644 --- a/source/tests/reflect_value_cast_test/CMakeLists.txt +++ b/source/tests/reflect_value_cast_test/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/serial_test/CMakeLists.txt b/source/tests/serial_test/CMakeLists.txt index 2cf1c6bce..eb56ea1e1 100644 --- a/source/tests/serial_test/CMakeLists.txt +++ b/source/tests/serial_test/CMakeLists.txt @@ -124,7 +124,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/threading/CMakeLists.txt b/source/threading/CMakeLists.txt index a0109ce8d..7486dced9 100644 --- a/source/threading/CMakeLists.txt +++ b/source/threading/CMakeLists.txt @@ -178,7 +178,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC diff --git a/source/version/CMakeLists.txt b/source/version/CMakeLists.txt index d62729c68..235dd1e3a 100644 --- a/source/version/CMakeLists.txt +++ b/source/version/CMakeLists.txt @@ -151,7 +151,7 @@ target_compile_options(${target} # Linker options # -target_link_libraries(${target} +add_link_options(${target} PRIVATE PUBLIC From ab80538e77ac7d69f684160bb1b01b5c69285376 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 3 Feb 2025 22:38:15 +0100 Subject: [PATCH 144/487] Add base for supporting weak symbols on node loader. --- source/loaders/node_loader/CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index d4af40596..5324ea73c 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -157,9 +157,6 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - # TODO: Implement workaround to the problem: "PE32 file format does not support weak linkage" - # $<$<BOOL:${WIN32}>:${NodeJS_LIBRARY}> # NodeJS library - PUBLIC ${DEFAULT_LIBRARIES} @@ -200,8 +197,10 @@ target_compile_options(${target} add_link_options(${target} PRIVATE - # TODO: MacOS - # $<$<BOOL:${APPLE}>:-Wl,-undefined=dynamic_lookup> + $<$<CXX_COMPILER_ID:MSVC>:/IGNORE:4199> + $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> + $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> + $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> PUBLIC ${DEFAULT_LINKER_OPTIONS} From ce9b9e66eb4840e184ace22c309f1dca35659c88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:41:45 -0500 Subject: [PATCH 145/487] Bump store2 in /source/scripts/node/gram/source/gram (#541) Bumps [store2](https://github.com/nbubna/store) from 2.12.0 to 2.14.4. - [Commits](https://github.com/nbubna/store/compare/2.12.0...2.14.4) --- updated-dependencies: - dependency-name: store2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../scripts/node/gram/source/gram/package-lock.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/scripts/node/gram/source/gram/package-lock.json b/source/scripts/node/gram/source/gram/package-lock.json index 27be43c05..1f9839313 100644 --- a/source/scripts/node/gram/source/gram/package-lock.json +++ b/source/scripts/node/gram/source/gram/package-lock.json @@ -310,9 +310,10 @@ } }, "node_modules/store2": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/store2/-/store2-2.12.0.tgz", - "integrity": "sha512-7t+/wpKLanLzSnQPX8WAcuLCCeuSHoWdQuh9SB3xD0kNOM38DNf+0Oa+wmvxmYueRzkmh6IcdKFtvTa+ecgPDw==" + "version": "2.14.4", + "resolved": "https://registry.npmjs.org/store2/-/store2-2.14.4.tgz", + "integrity": "sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw==", + "license": "MIT" }, "node_modules/telegram": { "version": "1.7.19", @@ -669,9 +670,9 @@ "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" }, "store2": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/store2/-/store2-2.12.0.tgz", - "integrity": "sha512-7t+/wpKLanLzSnQPX8WAcuLCCeuSHoWdQuh9SB3xD0kNOM38DNf+0Oa+wmvxmYueRzkmh6IcdKFtvTa+ecgPDw==" + "version": "2.14.4", + "resolved": "https://registry.npmjs.org/store2/-/store2-2.14.4.tgz", + "integrity": "sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw==" }, "telegram": { "version": "1.7.19", From cd1cb340510da17e568f893d7bfdbecf211d1d2b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 3 Feb 2025 23:17:41 +0100 Subject: [PATCH 146/487] Solve issue of NodeJS with MSVC. --- source/loaders/node_loader/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 5324ea73c..f1803877a 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -157,6 +157,8 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library + $<$<CXX_COMPILER_ID:MSVC>:${NodeJS_LIBRARY}> # NodeJS library + PUBLIC ${DEFAULT_LIBRARIES} @@ -197,9 +199,6 @@ target_compile_options(${target} add_link_options(${target} PRIVATE - $<$<CXX_COMPILER_ID:MSVC>:/IGNORE:4199> - $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> - $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> PUBLIC From a6c0144d8b16e6190948859502356c9b218424f3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 5 Feb 2025 06:15:55 +0100 Subject: [PATCH 147/487] Add thread safety for metacall link. --- source/detour/source/detour.c | 5 ++++ source/metacall/source/metacall_link.c | 30 ++++++++++++++++--- .../threading/threading_atomic_ref_count.h | 2 +- .../include/threading/threading_mutex.h | 16 +++++----- .../threading/source/threading_mutex_macos.c | 8 ++--- .../source/threading_mutex_pthread.c | 10 +++---- .../threading/source/threading_mutex_win32.c | 12 ++++---- 7 files changed, 54 insertions(+), 29 deletions(-) diff --git a/source/detour/source/detour.c b/source/detour/source/detour.c index 3eeb57d6d..5503f4494 100644 --- a/source/detour/source/detour.c +++ b/source/detour/source/detour.c @@ -67,6 +67,11 @@ const char *detour_name(detour d) void (*detour_trampoline(detour_handle handle))(void) { + if (handle == NULL) + { + return NULL; + } + return handle->target; } diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index 9bad2939a..1124c9d2d 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -25,6 +25,8 @@ #include <detour/detour.h> +#include <threading/threading_mutex.h> + #include <dynlink/dynlink_type.h> #include <log/log.h> @@ -36,8 +38,8 @@ /* -- Private Variables -- */ static detour_handle detour_link_handle = NULL; - static set metacall_link_table = NULL; +static threading_mutex_type link_mutex = THREADING_MUTEX_INITIALIZE; #if defined(WIN32) || defined(_WIN32) || \ defined(__CYGWIN__) || defined(__CYGWIN32__) || \ @@ -54,10 +56,18 @@ FARPROC metacall_link_hook(HMODULE handle, LPCSTR symbol) { typedef FARPROC (*metacall_link_func_ptr)(HMODULE, LPCSTR); - metacall_link_func_ptr metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); + metacall_link_func_ptr metacall_link_trampoline; + + void *ptr; + + threading_mutex_lock(&link_mutex); + + metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); /* Intercept if any */ - void *ptr = set_get(metacall_link_table, (set_key)symbol); + ptr = set_get(metacall_link_table, (set_key)symbol); + + threading_mutex_unlock(&link_mutex); if (ptr != NULL) { @@ -87,7 +97,11 @@ void *metacall_link_hook(void *handle, const char *symbol) { typedef void *(*metacall_link_func_ptr)(void *, const char *); - metacall_link_func_ptr metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); + metacall_link_func_ptr metacall_link_trampoline; + + threading_mutex_lock(&link_mutex); + + metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); /* Intercept function if any */ void *ptr = set_get(metacall_link_table, (set_key)symbol); @@ -95,6 +109,8 @@ void *metacall_link_hook(void *handle, const char *symbol) /* TODO: Disable logs here until log is completely thread safe and async signal safe */ /* log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall detour link interception: %s -> %p", symbol, ptr); */ + threading_mutex_unlock(&link_mutex); + if (ptr != NULL) { return ptr; @@ -172,6 +188,8 @@ int metacall_link_destroy(void) { int result = 0; + threading_mutex_lock(&link_mutex); + if (detour_link_handle != NULL) { detour d = detour_create(metacall_detour()); @@ -193,5 +211,9 @@ int metacall_link_destroy(void) metacall_link_table = NULL; } + threading_mutex_unlock(&link_mutex); + + threading_mutex_destroy(&link_mutex); + return result; } diff --git a/source/threading/include/threading/threading_atomic_ref_count.h b/source/threading/include/threading/threading_atomic_ref_count.h index afdae715b..9e152bb0a 100644 --- a/source/threading/include/threading/threading_atomic_ref_count.h +++ b/source/threading/include/threading/threading_atomic_ref_count.h @@ -50,7 +50,7 @@ struct threading_atomic_ref_count_type { #if defined(__THREAD_SANITIZER__) uintmax_t count; - struct threading_mutex_type m; + threading_mutex_type m; #else atomic_uintmax_t count; #endif diff --git a/source/threading/include/threading/threading_mutex.h b/source/threading/include/threading/threading_mutex.h index 174e5772e..b8762b25c 100644 --- a/source/threading/include/threading/threading_mutex.h +++ b/source/threading/include/threading/threading_mutex.h @@ -33,6 +33,10 @@ extern "C" { #if defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) #include <windows.h> + #define THREADING_MUTEX_INITIALIZE \ + { \ + 0 \ + } typedef CRITICAL_SECTION threading_mutex_impl_type; #elif (defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux) || defined(__gnu_linux__) || defined(__TOS_LINUX__)) || \ defined(__FreeBSD__) || \ @@ -41,10 +45,12 @@ typedef CRITICAL_SECTION threading_mutex_impl_type; (defined(bsdi) || defined(__bsdi__)) || \ defined(__DragonFly__) #include <pthread.h> + #define THREADING_MUTEX_INITIALIZE PTHREAD_MUTEX_INITIALIZER typedef pthread_mutex_t threading_mutex_impl_type; #elif (defined(__MACOS__) || defined(macintosh) || defined(Macintosh) || defined(__TOS_MACOS__)) || \ (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) #include <os/lock.h> + #define THREADING_MUTEX_INITIALIZE OS_UNFAIR_LOCK_INIT typedef os_unfair_lock threading_mutex_impl_type; #else #error "Platform not supported for mutex implementation" @@ -52,16 +58,10 @@ typedef os_unfair_lock threading_mutex_impl_type; #include <string.h> -/* -- Member Data -- */ - -struct threading_mutex_type -{ - threading_mutex_impl_type impl; -}; - /* -- Type Definitions -- */ -typedef struct threading_mutex_type *threading_mutex; +typedef threading_mutex_impl_type threading_mutex_type; +typedef threading_mutex_type *threading_mutex; /* -- Methods -- */ diff --git a/source/threading/source/threading_mutex_macos.c b/source/threading/source/threading_mutex_macos.c index e8fe44047..dbcdd2218 100644 --- a/source/threading/source/threading_mutex_macos.c +++ b/source/threading/source/threading_mutex_macos.c @@ -26,21 +26,21 @@ int threading_mutex_initialize(threading_mutex m) { - memset(&m->impl, 0, sizeof(os_unfair_lock)); + memset(m, 0, sizeof(os_unfair_lock)); return 0; } int threading_mutex_lock(threading_mutex m) { - os_unfair_lock_lock(&m->impl); + os_unfair_lock_lock(m); return 0; } int threading_mutex_try_lock(threading_mutex m) { - if (os_unfair_lock_trylock(&m->impl) == false) + if (os_unfair_lock_trylock(m) == false) { return 1; } @@ -50,7 +50,7 @@ int threading_mutex_try_lock(threading_mutex m) int threading_mutex_unlock(threading_mutex m) { - os_unfair_lock_unlock(&m->impl); + os_unfair_lock_unlock(m); return 0; } diff --git a/source/threading/source/threading_mutex_pthread.c b/source/threading/source/threading_mutex_pthread.c index 3a288830e..3536387eb 100644 --- a/source/threading/source/threading_mutex_pthread.c +++ b/source/threading/source/threading_mutex_pthread.c @@ -24,25 +24,25 @@ int threading_mutex_initialize(threading_mutex m) { - return pthread_mutex_init(&m->impl, NULL); + return pthread_mutex_init(m, NULL); } int threading_mutex_lock(threading_mutex m) { - return pthread_mutex_lock(&m->impl); + return pthread_mutex_lock(m); } int threading_mutex_try_lock(threading_mutex m) { - return pthread_mutex_trylock(&m->impl); + return pthread_mutex_trylock(m); } int threading_mutex_unlock(threading_mutex m) { - return pthread_mutex_unlock(&m->impl); + return pthread_mutex_unlock(m); } int threading_mutex_destroy(threading_mutex m) { - return pthread_mutex_destroy(&m->impl); + return pthread_mutex_destroy(m); } diff --git a/source/threading/source/threading_mutex_win32.c b/source/threading/source/threading_mutex_win32.c index 16739c50d..19cdef9fe 100644 --- a/source/threading/source/threading_mutex_win32.c +++ b/source/threading/source/threading_mutex_win32.c @@ -22,25 +22,23 @@ #include <threading/threading_mutex.h> -#include <stdlib.h> - int threading_mutex_initialize(threading_mutex m) { - InitializeCriticalSection(&m->impl); + InitializeCriticalSection(m); return 0; } int threading_mutex_lock(threading_mutex m) { - EnterCriticalSection(&m->impl); + EnterCriticalSection(m); return 0; } int threading_mutex_try_lock(threading_mutex m) { - if (TryEnterCriticalSection(&m->impl) == 0) + if (TryEnterCriticalSection(m) == 0) { return 1; } @@ -50,14 +48,14 @@ int threading_mutex_try_lock(threading_mutex m) int threading_mutex_unlock(threading_mutex m) { - LeaveCriticalSection(&m->impl); + LeaveCriticalSection(m); return 0; } int threading_mutex_destroy(threading_mutex m) { - DeleteCriticalSection(&m->impl); + DeleteCriticalSection(m); return 0; } From 64a6150f48a00975420a3a37a7724d65db8f5a23 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 5 Feb 2025 06:16:24 +0100 Subject: [PATCH 148/487] Add proper link flags for node_loader on macos. --- source/loaders/node_loader/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index f1803877a..d372ccdb0 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -199,7 +199,7 @@ target_compile_options(${target} add_link_options(${target} PRIVATE - $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> + $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> PUBLIC ${DEFAULT_LINKER_OPTIONS} From f6789193db2945857e15b942aa44fbde34959d1a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 12 Feb 2025 23:22:29 +0100 Subject: [PATCH 149/487] Add basic atexit support in portability. --- source/log/CMakeLists.txt | 1 + source/log/source/log_singleton.c | 4 +- source/metacall/CMakeLists.txt | 4 +- source/metacall/source/metacall.c | 8 +- source/metacall/source/metacall_link.c | 11 +- source/portability/CMakeLists.txt | 2 + .../include/portability/portability_atexit.h | 63 ++++++++ .../portability/source/portability_atexit.c | 139 ++++++++++++++++++ 8 files changed, 226 insertions(+), 6 deletions(-) create mode 100644 source/portability/include/portability/portability_atexit.h create mode 100644 source/portability/source/portability_atexit.c diff --git a/source/log/CMakeLists.txt b/source/log/CMakeLists.txt index 79c9c9ff9..556c17aae 100644 --- a/source/log/CMakeLists.txt +++ b/source/log/CMakeLists.txt @@ -180,6 +180,7 @@ target_link_libraries(${target} ${META_PROJECT_NAME}::preprocessor ${META_PROJECT_NAME}::format ${META_PROJECT_NAME}::threading + ${META_PROJECT_NAME}::portability PUBLIC ${DEFAULT_LIBRARIES} diff --git a/source/log/source/log_singleton.c b/source/log/source/log_singleton.c index 39d326e64..4b7863d8a 100644 --- a/source/log/source/log_singleton.c +++ b/source/log/source/log_singleton.c @@ -9,6 +9,8 @@ #include <log/log_map.h> #include <log/log_singleton.h> +#include <portability/portability_atexit.h> + #include <stdlib.h> /* -- Definitions -- */ @@ -98,7 +100,7 @@ log_singleton log_singleton_instance_impl(void) abort(); } - if (atexit(&log_atexit_callback) != 0) + if (portability_atexit_register(&log_atexit_callback) != 0) { if (log_singleton_destroy() != 0) { diff --git a/source/metacall/CMakeLists.txt b/source/metacall/CMakeLists.txt index e04b167e8..ec669d7f0 100644 --- a/source/metacall/CMakeLists.txt +++ b/source/metacall/CMakeLists.txt @@ -200,6 +200,8 @@ target_link_libraries(${target} PUBLIC ${DEFAULT_LIBRARIES} + $<$<BOOL:${BUILD_SHARED_LIBS}>:${CMAKE_DL_LIBS}> # Native dynamic load library + INTERFACE ) @@ -248,8 +250,6 @@ add_link_options(${target} PUBLIC ${DEFAULT_LINKER_OPTIONS} - $<$<BOOL:${BUILD_SHARED_LIBS}>:${CMAKE_DL_LIBS}> # Native dynamic load library - INTERFACE ) diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 3fcc54b8c..2fdc314b5 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -37,6 +37,7 @@ #include <environment/environment_variable.h> +#include <portability/portability_atexit.h> #include <portability/portability_constructor.h> #include <stdio.h> @@ -82,6 +83,9 @@ portability_constructor(metacall_constructor) { const char *metacall_host = environment_variable_get("METACALL_HOST", NULL); + /* Initialize at exit handlers */ + portability_atexit_initialize(); + /* We are running from a different host, initialize the loader of the host * and redirect it to the existing symbols, also avoiding initialization * and destruction of the runtime as it is being managed externally to MetaCall */ @@ -113,7 +117,7 @@ portability_constructor(metacall_constructor) } /* Register the destructor on exit */ - atexit(metacall_destroy); + portability_atexit_register(metacall_destroy); } } } @@ -277,7 +281,7 @@ int metacall_initialize(void) #endif /* METACALL_FORK_SAFE */ /* Define destructor for detouring (it must be executed at the end to prevent problems with fork mechanisms) */ - atexit(metacall_detour_destructor); + portability_atexit_register(metacall_detour_destructor); } /* Initialize configuration and serializer */ diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index 1124c9d2d..946d37a39 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -99,12 +99,14 @@ void *metacall_link_hook(void *handle, const char *symbol) metacall_link_func_ptr metacall_link_trampoline; + void *ptr; + threading_mutex_lock(&link_mutex); metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); /* Intercept function if any */ - void *ptr = set_get(metacall_link_table, (set_key)symbol); + ptr = set_get(metacall_link_table, (set_key)symbol); /* TODO: Disable logs here until log is completely thread safe and async signal safe */ /* log_write("metacall", LOG_LEVEL_DEBUG, "MetaCall detour link interception: %s -> %p", symbol, ptr); */ @@ -129,6 +131,13 @@ int metacall_link_initialize(void) { detour d = detour_create(metacall_detour()); + if (threading_mutex_initialize(&link_mutex) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid link mutex initialization"); + + return 1; + } + if (detour_link_handle == NULL) { detour_link_handle = detour_install(d, (void (*)(void))metacall_link_func(), (void (*)(void))(&metacall_link_hook)); diff --git a/source/portability/CMakeLists.txt b/source/portability/CMakeLists.txt index fab62a921..65b9dd1f2 100644 --- a/source/portability/CMakeLists.txt +++ b/source/portability/CMakeLists.txt @@ -40,6 +40,7 @@ set(headers ${include_path}/portability_library_path.h ${include_path}/portability_working_path.h ${include_path}/portability_path.h + ${include_path}/portability_atexit.h ) set(sources @@ -48,6 +49,7 @@ set(sources ${source_path}/portability_library_path.c ${source_path}/portability_working_path.c ${source_path}/portability_path.c + ${source_path}/portability_atexit.c ) # Group source files diff --git a/source/portability/include/portability/portability_atexit.h b/source/portability/include/portability/portability_atexit.h new file mode 100644 index 000000000..78c107b1a --- /dev/null +++ b/source/portability/include/portability/portability_atexit.h @@ -0,0 +1,63 @@ +/* + * Portability Library by Parra Studios + * A generic cross-platform portability utility. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef PORTABILITY_ATEXIT_H +#define PORTABILITY_ATEXIT_H 1 + +/* -- Headers -- */ + +#include <portability/portability_api.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* -- Type Definitions -- */ + +typedef void (*portability_atexit_fn)(void); + +/* -- Methods -- */ + +/** +* @brief +* Initialize atexit instance for custom at exit handlers +* +* @return +* Zero if success, different from zero otherwise +*/ +PORTABILITY_API int portability_atexit_initialize(void); + +/** +* @brief +* Register handler to be run at exit +* +* @param[in] handler +* Function pointer to the handler that will be executed at exit +* +* @return +* Zero if success, different from zero otherwise +*/ +PORTABILITY_API int portability_atexit_register(portability_atexit_fn handler); + +#ifdef __cplusplus +} +#endif + +#endif /* PORTABILITY_ATEXIT_H */ diff --git a/source/portability/source/portability_atexit.c b/source/portability/source/portability_atexit.c new file mode 100644 index 000000000..d08ee3653 --- /dev/null +++ b/source/portability/source/portability_atexit.c @@ -0,0 +1,139 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* -- Headers -- */ + +#include <portability/portability_atexit.h> + +#include <stdlib.h> + +/* -- Member Data -- */ + +struct atexit_node_type +{ + portability_atexit_fn handler; + struct atexit_node_type *next; +}; + +/* -- Private Variables -- */ + +static struct atexit_node_type *atexit_list = NULL; + +/* -- Private Methods -- */ + +static void portability_atexit_destroy(void) +{ + if (atexit_list != NULL) + { + do + { + struct atexit_node_type *prev = atexit_list; + + atexit_list = prev->next; + + if (prev->handler != NULL) + { + prev->handler(); + } + + free(prev); + } while (atexit_list != NULL); + + atexit_list = NULL; + } +} + +/* -- Methods -- */ + +int portability_atexit_initialize(void) +{ + static int atexit_registered = 0; + + if (atexit_list == NULL) + { + atexit_list = malloc(sizeof(struct atexit_node_type)); + + if (atexit_list == NULL) + { + return 1; + } + + atexit_list->handler = NULL; + atexit_list->next = NULL; + } + + if (atexit_registered == 0) + { + atexit(&portability_atexit_destroy); + atexit_registered = 1; + } + + return 0; +} + +int portability_atexit_register(portability_atexit_fn handler) +{ + if (atexit_list == NULL) + { + return 1; + } + + if (atexit_list->handler == NULL) + { + atexit_list->handler = handler; + } + else + { + struct atexit_node_type *iterator = atexit_list; + + /* Find the last or duplicates */ + for (;;) + { + if (iterator->handler == handler) + { + /* Already registered, skip */ + return 1; + } + + if (iterator->next == NULL) + { + break; + } + + iterator = iterator->next; + } + + /* Allocate the new node */ + struct atexit_node_type *node = malloc(sizeof(struct atexit_node_type)); + + if (node == NULL) + { + return 1; + } + + node->handler = handler; + node->next = atexit_list; + + /* Insert it at the begining */ + atexit_list = node; + } + + return 0; +} From 9ba88287f5b33f3205e0c92b99c904d8842fa1b4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 13 Feb 2025 00:37:25 +0200 Subject: [PATCH 150/487] Revert "Bump store2 in /source/scripts/node/gram/source/gram (#541)" This reverts commit ce9b9e66eb4840e184ace22c309f1dca35659c88. --- .../scripts/node/gram/source/gram/package-lock.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/scripts/node/gram/source/gram/package-lock.json b/source/scripts/node/gram/source/gram/package-lock.json index 1f9839313..27be43c05 100644 --- a/source/scripts/node/gram/source/gram/package-lock.json +++ b/source/scripts/node/gram/source/gram/package-lock.json @@ -310,10 +310,9 @@ } }, "node_modules/store2": { - "version": "2.14.4", - "resolved": "https://registry.npmjs.org/store2/-/store2-2.14.4.tgz", - "integrity": "sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw==", - "license": "MIT" + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/store2/-/store2-2.12.0.tgz", + "integrity": "sha512-7t+/wpKLanLzSnQPX8WAcuLCCeuSHoWdQuh9SB3xD0kNOM38DNf+0Oa+wmvxmYueRzkmh6IcdKFtvTa+ecgPDw==" }, "node_modules/telegram": { "version": "1.7.19", @@ -670,9 +669,9 @@ "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" }, "store2": { - "version": "2.14.4", - "resolved": "https://registry.npmjs.org/store2/-/store2-2.14.4.tgz", - "integrity": "sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw==" + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/store2/-/store2-2.12.0.tgz", + "integrity": "sha512-7t+/wpKLanLzSnQPX8WAcuLCCeuSHoWdQuh9SB3xD0kNOM38DNf+0Oa+wmvxmYueRzkmh6IcdKFtvTa+ecgPDw==" }, "telegram": { "version": "1.7.19", From 037296f7a901e0949fe438ff371a86c5b161d52a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 12 Feb 2025 23:54:02 +0100 Subject: [PATCH 151/487] Add init of atexit in logs. --- source/log/source/log_singleton.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/log/source/log_singleton.c b/source/log/source/log_singleton.c index 4b7863d8a..cd6aefa40 100644 --- a/source/log/source/log_singleton.c +++ b/source/log/source/log_singleton.c @@ -100,6 +100,9 @@ log_singleton log_singleton_instance_impl(void) abort(); } + /* Initialize at exit handlers */ + portability_atexit_initialize(); + if (portability_atexit_register(&log_atexit_callback) != 0) { if (log_singleton_destroy() != 0) From fc940c78d0b8446498def1c16047f4037904825c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 13 Feb 2025 17:20:33 +0100 Subject: [PATCH 152/487] Solve issue with windows lib names. --- source/loaders/node_loader/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index d372ccdb0..4dd360fe0 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -240,6 +240,7 @@ if(NodeJS_LIBRARY_NAME_PATH AND WIN32) ) get_filename_component(NodeJS_LIBRARY_NAME "${NodeJS_LIBRARY_NAME_PATH}" NAME) + set(NodeJS_LIBRARY_DEVELOPMENT "${NodeJS_LIBRARY_NAME_PATH}") set(NodeJS_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${NodeJS_LIBRARY_NAME}") elseif(NodeJS_BUILD_FROM_SOURCE AND NOT WIN32) install(FILES From 690556db102cf1ea6deeaf9eaa392327cc788aa2 Mon Sep 17 00:00:00 2001 From: Adarsh Dubey <84132532+inclinedadarsh@users.noreply.github.com> Date: Sat, 15 Feb 2025 18:06:21 +0000 Subject: [PATCH 153/487] feat: Add C loader support for node_port --- source/ports/node_port/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 6d15c028e..2e4271c50 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -289,6 +289,8 @@ const file_extensions_to_tag = { tsx: 'ts', /* Rust Loader */ rs: 'rs', + /* C Loader */ + c: 'c', /* Note: By default js extension uses NodeJS loader instead of JavaScript V8 */ /* Probably in the future we can differenciate between them, but it is not trivial */ From d4fbdb211c8adc0c0a3f9da04e97607836cd125f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 21 Feb 2025 00:58:50 +0100 Subject: [PATCH 154/487] Improve node port types. --- source/ports/node_port/index.d.ts | 40 +++++++++++++++++++------------ 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/source/ports/node_port/index.d.ts b/source/ports/node_port/index.d.ts index 3be9a4809..e9fe6b2a2 100644 --- a/source/ports/node_port/index.d.ts +++ b/source/ports/node_port/index.d.ts @@ -1,16 +1,26 @@ -declare module 'metacall' { - export function metacall(name: string, ...args: any): any; - export function metacallfms(name: string, buffer: string): any; - export function metacall_execution_path(tag: string, path: string): number; - export function metacall_load_from_file(tag: string, paths: string[]): number; - export function metacall_load_from_file_export(tag: string, paths: string[]): any; - export function metacall_load_from_memory(tag: string, code: string): number; - export function metacall_load_from_memory_export(tag: string, code: string): any; - export function metacall_load_from_package(tag: string, pkg: string): number; - export function metacall_load_from_package_export(tag: string, pkg: string): any; - export function metacall_load_from_configuration(path: string): number; - export function metacall_load_from_configuration_export(path: string): any; - export function metacall_inspect(): any; - export function metacall_handle(tag: string, name: string): any; - export function metacall_logs(): void; +declare module "metacall" { + export function metacall(name: string, ...args: any): any; + export function metacallfms(name: string, buffer: string): any; + export function metacall_await(name: string, ...args: any): any; + export function metacall_execution_path(tag: string, path: string): number; + export function metacall_load_from_file(tag: string, paths: string[]): number; + export function metacall_load_from_file_export( + tag: string, + paths: string[] + ): any; + export function metacall_load_from_memory(tag: string, code: string): number; + export function metacall_load_from_memory_export( + tag: string, + code: string + ): any; + export function metacall_load_from_package(tag: string, pkg: string): number; + export function metacall_load_from_package_export( + tag: string, + pkg: string + ): any; + export function metacall_load_from_configuration(path: string): number; + export function metacall_load_from_configuration_export(path: string): any; + export function metacall_inspect(): any; // TODO: Implement return type + export function metacall_handle(tag: string, name: string): any; + export function metacall_logs(): void; } From 7587d8ace357e510422e77d07f865f5c3f796d23 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 21 Feb 2025 00:59:33 +0100 Subject: [PATCH 155/487] Solve issues with funchook and rapid_json. --- cmake/InstallRapidJSON.cmake | 18 ++++++------- source/detours/CMakeLists.txt | 2 +- source/detours/funchook_detour/CMakeLists.txt | 25 +++++++------------ .../funchook_detour/scripts/download.bat.in | 12 --------- .../funchook_detour/scripts/download.sh.in | 9 ------- source/tests/detour_test/CMakeLists.txt | 2 +- .../tests/metacall_fork_test/CMakeLists.txt | 2 +- 7 files changed, 20 insertions(+), 50 deletions(-) delete mode 100755 source/detours/funchook_detour/scripts/download.bat.in delete mode 100755 source/detours/funchook_detour/scripts/download.sh.in diff --git a/cmake/InstallRapidJSON.cmake b/cmake/InstallRapidJSON.cmake index 8b4bc960d..44938fceb 100644 --- a/cmake/InstallRapidJSON.cmake +++ b/cmake/InstallRapidJSON.cmake @@ -28,19 +28,17 @@ if(NOT RAPIDJSON_FOUND OR USE_BUNDLED_RAPIDJSON) endif() ExternalProject_Add(rapid-json-depends - GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git" - GIT_TAG "${RAPIDJSON_VERSION}" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> - -DRAPIDJSON_BUILD_DOC=Off - -DRAPIDJSON_BUILD_EXAMPLES=Off - -DRAPIDJSON_BUILD_TESTS=Off - TEST_COMMAND "" + GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git" + GIT_TAG "${RAPIDJSON_VERSION}" + BUILD_COMMAND "" + CONFIGURE_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" ) - ExternalProject_Get_Property(rapid-json-depends INSTALL_DIR) + ExternalProject_Get_Property(rapid-json-depends SOURCE_DIR) - set(RAPIDJSON_ROOT_DIR ${INSTALL_DIR}) + set(RAPIDJSON_ROOT_DIR ${SOURCE_DIR}) set(RAPIDJSON_INCLUDE_DIRS ${RAPIDJSON_ROOT_DIR}/include) set(RAPIDJSON_FOUND TRUE) diff --git a/source/detours/CMakeLists.txt b/source/detours/CMakeLists.txt index 366f9f42c..c1f851b97 100644 --- a/source/detours/CMakeLists.txt +++ b/source/detours/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if detours are enabled -if(NOT OPTION_FORK_SAFE OR NOT OPTION_BUILD_DETOURS) +if(NOT OPTION_BUILD_DETOURS) return() endif() diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index a822ca631..74c39ef67 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if this detour is enabled -if(NOT OPTION_FORK_SAFE OR NOT OPTION_BUILD_DETOURS OR NOT OPTION_BUILD_DETOURS_FUNCHOOK) +if(NOT OPTION_BUILD_DETOURS OR NOT OPTION_BUILD_DETOURS_FUNCHOOK) return() endif() @@ -17,43 +17,36 @@ include(ExternalProject) set(FUNCHOOK_VERSION 1.1.3) if(WIN32) - set(FUNCHOOK_LIBRARY_PREFIX "") set(FUNCHOOK_LIBRARY_SUFFIX "lib") set(FUNCHOOK_LIBRARY_INSTALL_SUFFIX "dll") elseif(APPLE) - set(FUNCHOOK_LIBRARY_PREFIX "lib") set(FUNCHOOK_LIBRARY_SUFFIX "dylib") - set(FUNCHOOK_LIBRARY_INSTALL_SUFFIX "dylib") else() - set(FUNCHOOK_LIBRARY_PREFIX "lib") set(FUNCHOOK_LIBRARY_SUFFIX "so") - set(FUNCHOOK_LIBRARY_INSTALL_SUFFIX "so") endif() set(FUNCHOOK_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/funchook/src/funchook") if(WIN32) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/download.bat.in ${CMAKE_CURRENT_BINARY_DIR}/download.bat @ONLY) - set(FUNCHOOK_DOWNLOAD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/download.bat) set(FUNCHOOK_BUILD_TARGET "INSTALL") + set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/funchook_dll.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") else() - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/download.sh.in ${CMAKE_CURRENT_BINARY_DIR}/download.sh @ONLY) - set(FUNCHOOK_DOWNLOAD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/download.sh) set(FUNCHOOK_BUILD_TARGET "install") + set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_LIBRARY_DIR}") endif() set(FUNCHOOK_INSTALL_DIR "${PROJECT_OUTPUT_DIR}") +set(FUNCHOOK_CMAKE_INSTALL_BINDIR "${PROJECT_OUTPUT_DIR}") set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include") -set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_PREFIX}funchook.${FUNCHOOK_LIBRARY_SUFFIX}") -set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_PREFIX}funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") -ExternalProject_Add( - ${target_depends} +ExternalProject_Add(${target_depends} PREFIX funchook SOURCE_DIR ${FUNCHOOK_SOURCE_DIR} INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} - DOWNLOAD_COMMAND ${FUNCHOOK_DOWNLOAD_COMMAND} - CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . + DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" + CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_INSTALL_BINDIR=${FUNCHOOK_CMAKE_INSTALL_BINDIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} UPDATE_COMMAND "" BUILD_IN_SOURCE ON diff --git a/source/detours/funchook_detour/scripts/download.bat.in b/source/detours/funchook_detour/scripts/download.bat.in deleted file mode 100755 index a2702001b..000000000 --- a/source/detours/funchook_detour/scripts/download.bat.in +++ /dev/null @@ -1,12 +0,0 @@ -@echo on - -rem Download repository if it does not exist -if not exist "@FUNCHOOK_SOURCE_DIR@/.git" ( - if exist "@FUNCHOOK_SOURCE_DIR@" ( - rmdir /S /Q "@FUNCHOOK_SOURCE_DIR@" - ) - "@GIT_EXECUTABLE@" clone --single-branch --branch v@FUNCHOOK_VERSION@ --recursive https://github.com/kubo/funchook.git "@FUNCHOOK_SOURCE_DIR@" -) - -rem Write empty CMake file to avoid cmake warnings -copy /y nul "@FUNCHOOK_SOURCE_DIR@/CMakeLists.txt" diff --git a/source/detours/funchook_detour/scripts/download.sh.in b/source/detours/funchook_detour/scripts/download.sh.in deleted file mode 100755 index 122a268bf..000000000 --- a/source/detours/funchook_detour/scripts/download.sh.in +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env sh - -# Download repository if it does not exist -if [ ! -d "@FUNCHOOK_SOURCE_DIR@/.git" ]; then - if [ -d "@FUNCHOOK_SOURCE_DIR@" ]; then - rm -rf "@FUNCHOOK_SOURCE_DIR@" - fi - "@GIT_EXECUTABLE@" clone --single-branch --branch v@FUNCHOOK_VERSION@ --recursive https://github.com/kubo/funchook.git "@FUNCHOOK_SOURCE_DIR@" -fi diff --git a/source/tests/detour_test/CMakeLists.txt b/source/tests/detour_test/CMakeLists.txt index 1e96fa5a0..b84f0f4a5 100644 --- a/source/tests/detour_test/CMakeLists.txt +++ b/source/tests/detour_test/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if detours are enabled -if(NOT OPTION_FORK_SAFE OR NOT OPTION_BUILD_DETOURS OR NOT OPTION_BUILD_DETOURS_FUNCHOOK) +if(NOT OPTION_BUILD_DETOURS OR NOT OPTION_BUILD_DETOURS_FUNCHOOK) return() endif() diff --git a/source/tests/metacall_fork_test/CMakeLists.txt b/source/tests/metacall_fork_test/CMakeLists.txt index d7f19ff1e..0c526d744 100644 --- a/source/tests/metacall_fork_test/CMakeLists.txt +++ b/source/tests/metacall_fork_test/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if detours are enabled -if(NOT OPTION_BUILD_DETOURS OR NOT OPTION_FORK_SAFE) +if(NOT OPTION_FORK_SAFE OR NOT OPTION_BUILD_DETOURS) return() endif() From b8e6f32a752d1ef3afa9be341c8d84586638fdb8 Mon Sep 17 00:00:00 2001 From: Yasindu Dissanayake <yasiyd2@gmail.com> Date: Fri, 21 Feb 2025 13:11:28 +0530 Subject: [PATCH 156/487] Add Workflow for Multi-Architecture Docker Image Build, Push, and Manifest Management (#535) * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Fix issue in tag --------- Co-authored-by: Yasindu Dissanayake <mr.yash@petalmail.com> Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- .github/workflows/docker-hub-platform.yml | 181 +++++++++++----------- 1 file changed, 89 insertions(+), 92 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index 32f9fe5d2..db4f323f1 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -14,7 +14,9 @@ concurrency: cancel-in-progress: true env: - IMAGE_NAME: index.docker.io/metacall/core + DOCKER_REGISTRY: index.docker.io + DOCKER_USERNAME: metacall + IMAGE_NAME: core BUILDKIT_VERSION: 0.13.0 jobs: @@ -26,41 +28,28 @@ jobs: matrix: platform: - linux/amd64 + - linux/386 - linux/arm64 - linux/riscv64 - linux/ppc64le - linux/s390x - - linux/386 - linux/arm/v7 - linux/arm/v6 - # - linux/mips64le - # - linux/mips64 - steps: - - name: Checkout the code + - name: Checkout Repository uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.IMAGE_NAME }} - - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - name: Docker Setup BuildX + - name: Set up Docker BuildX uses: docker/setup-buildx-action@v3 with: version: v${{ env.BUILDKIT_VERSION }} - - name: Verify Docker BuildX Version - run: docker buildx version - - - name: Authenticate to Docker registry - if: github.event_name != 'pull_request' + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} @@ -72,93 +61,101 @@ jobs: run: | ./docker-compose.sh platform - # - name: Generate images - # if: github.event_name != 'pull_request' - # run: | - # for tag in "deps" "dev" "runtime" "cli"; do - # mkdir -p "/tmp/images/${tag}" - # digest="$(docker images --no-trunc --quiet metacall/core:${tag})" - # echo "FROM metacall/core:${tag}@${digest}" &> "/tmp/images/${tag}/Dockerfile" - # done - - # - name: Build and push by digest (deps) - # id: build - # uses: docker/build-push-action@v6 - # if: github.event_name != 'pull_request' - # with: - # context: /tmp/images/deps/Dockerfile - # platforms: ${{ matrix.platform }} - # labels: ${{ steps.meta.outputs.labels }} - # outputs: type=image,name=docker.io/${{ env.IMAGE_NAME }}:deps,push-by-digest=true,name-canonical=true,push=true - - - name: Export digests - if: github.event_name != 'pull_request' + - name: Tag Platform Images run: | - PLATFORM=${{ matrix.platform }} - echo "PLATFORM=${PLATFORM//\//-}" >> $GITHUB_ENV + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + echo "Platform Tag: ${platform_tag}" for tag in "deps" "dev" "runtime" "cli"; do - mkdir -p "/tmp/digests/${tag}" - digest="$(docker images --no-trunc --quiet metacall/core:${tag})" - touch "/tmp/digests/${tag}/${digest#sha256:}" + docker tag metacall/${IMAGE_NAME}:${tag} \ + ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} done - - name: Upload digests - if: github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 - with: - name: digests-${{ env.PLATFORM }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 + - name: Push Platform Images + run: | + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + for tag in "deps" "dev" "runtime" "cli"; do + echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" + docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + done - merge: - name: Merge digests for the manifest + - name: Run Tests + run: | + set -exuo pipefail + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + cat <<EOF > Dockerfile.test + FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} + RUN echo "console.log('abcde')" > script.js + RUN metacallcli script.js + EOF + + docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . + docker run --rm --platform=${{ matrix.platform }} test-image + + manifest: + name: Create and Push Manifest Lists + needs: build runs-on: ubuntu-latest - if: github.event_name != 'pull_request' - needs: - - build steps: - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: v${{ env.BUILDKIT_VERSION }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.IMAGE_NAME }} - - - name: Authenticate to Docker registry + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Create manifest list and push - if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/') + - name: Create and Push Manifest Lists run: | for tag in "deps" "dev" "runtime" "cli"; do - cd "/tmp/digests/${tag}" - IMAGE_HASHES=$(printf '${{ env.IMAGE_NAME }}:${tag}@sha256:%s ' *) - for image in ${IMAGE_HASHES}; do - docker image tag ${image} ${{ env.IMAGE_NAME }}:${tag} - docker push ${{ env.IMAGE_NAME }}:${tag} + echo "Creating manifest for tag: $tag" + platform_tags="" + for platform in "linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" + done + echo "Creating manifest with tags: ${platform_tags}" + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} + done + + - name: Create Version Specific Tags + if: startsWith(github.ref, 'refs/tags/') + run: | + VERSION=${GITHUB_REF#refs/tags/v} + tags=("deps" "dev" "runtime" "cli") + platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + for tag in "${tags[@]}"; do + platform_tags="" + for platform in "${platforms[@]}"; do + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} + done + + cli_platform_tags="" + for platform in ${{ matrix.platform }}; do + cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest + + cleanup: + name: Cleanup Platform Specific Tags + needs: [build, manifest] + runs-on: ubuntu-latest + if: always() + steps: + - name: Remove Platform-Specific Tags + run: | + platforms=("linux-amd64" "linux-386" "linux-arm64" "linux-riscv64" "linux-ppc64le" "linux-s390x" "linux-arm-v7" "linux-arm-v6") + tags=("deps" "dev" "runtime" "cli") + + for platform in "${platforms[@]}"; do + for tag in "${tags[@]}"; do + tag_to_delete="${tag}-${platform}" + echo "Deleting tag: ${tag_to_delete}" + + curl -X DELETE \ + -H "Authorization: Bearer ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" \ + "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" done - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${tag} ${IMAGE_HASHES} - if [[ "${tag}" = "cli" ]]; then - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest ${IMAGE_HASHES} - if [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then - TAG=${GITHUB_REF#refs/*/} - VERSION=${TAG#v} - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${VERSION} ${IMAGE_HASHES} - fi - fi done From 12c3077e09b62d6d86817310b7a3a8f9ec9e3a0f Mon Sep 17 00:00:00 2001 From: Yasindu Dissanayake <yasiyd2@gmail.com> Date: Fri, 21 Feb 2025 13:11:28 +0530 Subject: [PATCH 157/487] Add Workflow for Multi-Architecture Docker Image Build, Push, and Manifest Management (#535) * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Update docker-hub-platform.yml * Fix issue in tag --------- Co-authored-by: Yasindu Dissanayake <mr.yash@petalmail.com> Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- .github/workflows/docker-hub-platform.yml | 181 +++++++++++----------- 1 file changed, 89 insertions(+), 92 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index 32f9fe5d2..db4f323f1 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -14,7 +14,9 @@ concurrency: cancel-in-progress: true env: - IMAGE_NAME: index.docker.io/metacall/core + DOCKER_REGISTRY: index.docker.io + DOCKER_USERNAME: metacall + IMAGE_NAME: core BUILDKIT_VERSION: 0.13.0 jobs: @@ -26,41 +28,28 @@ jobs: matrix: platform: - linux/amd64 + - linux/386 - linux/arm64 - linux/riscv64 - linux/ppc64le - linux/s390x - - linux/386 - linux/arm/v7 - linux/arm/v6 - # - linux/mips64le - # - linux/mips64 - steps: - - name: Checkout the code + - name: Checkout Repository uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.IMAGE_NAME }} - - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - name: Docker Setup BuildX + - name: Set up Docker BuildX uses: docker/setup-buildx-action@v3 with: version: v${{ env.BUILDKIT_VERSION }} - - name: Verify Docker BuildX Version - run: docker buildx version - - - name: Authenticate to Docker registry - if: github.event_name != 'pull_request' + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} @@ -72,93 +61,101 @@ jobs: run: | ./docker-compose.sh platform - # - name: Generate images - # if: github.event_name != 'pull_request' - # run: | - # for tag in "deps" "dev" "runtime" "cli"; do - # mkdir -p "/tmp/images/${tag}" - # digest="$(docker images --no-trunc --quiet metacall/core:${tag})" - # echo "FROM metacall/core:${tag}@${digest}" &> "/tmp/images/${tag}/Dockerfile" - # done - - # - name: Build and push by digest (deps) - # id: build - # uses: docker/build-push-action@v6 - # if: github.event_name != 'pull_request' - # with: - # context: /tmp/images/deps/Dockerfile - # platforms: ${{ matrix.platform }} - # labels: ${{ steps.meta.outputs.labels }} - # outputs: type=image,name=docker.io/${{ env.IMAGE_NAME }}:deps,push-by-digest=true,name-canonical=true,push=true - - - name: Export digests - if: github.event_name != 'pull_request' + - name: Tag Platform Images run: | - PLATFORM=${{ matrix.platform }} - echo "PLATFORM=${PLATFORM//\//-}" >> $GITHUB_ENV + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + echo "Platform Tag: ${platform_tag}" for tag in "deps" "dev" "runtime" "cli"; do - mkdir -p "/tmp/digests/${tag}" - digest="$(docker images --no-trunc --quiet metacall/core:${tag})" - touch "/tmp/digests/${tag}/${digest#sha256:}" + docker tag metacall/${IMAGE_NAME}:${tag} \ + ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} done - - name: Upload digests - if: github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 - with: - name: digests-${{ env.PLATFORM }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 + - name: Push Platform Images + run: | + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + for tag in "deps" "dev" "runtime" "cli"; do + echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" + docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + done - merge: - name: Merge digests for the manifest + - name: Run Tests + run: | + set -exuo pipefail + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + cat <<EOF > Dockerfile.test + FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} + RUN echo "console.log('abcde')" > script.js + RUN metacallcli script.js + EOF + + docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . + docker run --rm --platform=${{ matrix.platform }} test-image + + manifest: + name: Create and Push Manifest Lists + needs: build runs-on: ubuntu-latest - if: github.event_name != 'pull_request' - needs: - - build steps: - - name: Download digests - uses: actions/download-artifact@v4 - with: - path: /tmp/digests - pattern: digests-* - merge-multiple: true - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: v${{ env.BUILDKIT_VERSION }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.IMAGE_NAME }} - - - name: Authenticate to Docker registry + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Create manifest list and push - if: github.ref == 'refs/heads/master' || contains(github.ref, 'refs/tags/') + - name: Create and Push Manifest Lists run: | for tag in "deps" "dev" "runtime" "cli"; do - cd "/tmp/digests/${tag}" - IMAGE_HASHES=$(printf '${{ env.IMAGE_NAME }}:${tag}@sha256:%s ' *) - for image in ${IMAGE_HASHES}; do - docker image tag ${image} ${{ env.IMAGE_NAME }}:${tag} - docker push ${{ env.IMAGE_NAME }}:${tag} + echo "Creating manifest for tag: $tag" + platform_tags="" + for platform in "linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" + done + echo "Creating manifest with tags: ${platform_tags}" + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} + done + + - name: Create Version Specific Tags + if: startsWith(github.ref, 'refs/tags/') + run: | + VERSION=${GITHUB_REF#refs/tags/v} + tags=("deps" "dev" "runtime" "cli") + platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + for tag in "${tags[@]}"; do + platform_tags="" + for platform in "${platforms[@]}"; do + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} + done + + cli_platform_tags="" + for platform in ${{ matrix.platform }}; do + cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest + + cleanup: + name: Cleanup Platform Specific Tags + needs: [build, manifest] + runs-on: ubuntu-latest + if: always() + steps: + - name: Remove Platform-Specific Tags + run: | + platforms=("linux-amd64" "linux-386" "linux-arm64" "linux-riscv64" "linux-ppc64le" "linux-s390x" "linux-arm-v7" "linux-arm-v6") + tags=("deps" "dev" "runtime" "cli") + + for platform in "${platforms[@]}"; do + for tag in "${tags[@]}"; do + tag_to_delete="${tag}-${platform}" + echo "Deleting tag: ${tag_to_delete}" + + curl -X DELETE \ + -H "Authorization: Bearer ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" \ + "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" done - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${tag} ${IMAGE_HASHES} - if [[ "${tag}" = "cli" ]]; then - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest ${IMAGE_HASHES} - if [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then - TAG=${GITHUB_REF#refs/*/} - VERSION=${TAG#v} - docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:${VERSION} ${IMAGE_HASHES} - fi - fi done From d89b966e93bd4326085499b0d13b6038e932c2a5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 24 Feb 2025 23:36:56 +0100 Subject: [PATCH 158/487] Trying to solve issues macos. --- source/loaders/node_loader/CMakeLists.txt | 5 ++++- source/ports/node_port/index.js | 11 +++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 4dd360fe0..1f88155f1 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -172,6 +172,9 @@ target_link_libraries(${target} target_compile_definitions(${target} PRIVATE $<$<BOOL:${WIN32}>:NODEJS_LIBRARY_NAME="${NodeJS_LIBRARY_NAME}"> + $<$<NOT:$<BOOL:${MSVC}>>:_LARGEFILE_SOURCE> + $<$<NOT:$<BOOL:${MSVC}>>:_FILE_OFFSET_BITS=64> + $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:_DARWIN_USE_64_BIT_INODE=1> PUBLIC $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${target_upper}_STATIC_DEFINE> @@ -199,7 +202,7 @@ target_compile_options(${target} add_link_options(${target} PRIVATE - $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> + $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> PUBLIC ${DEFAULT_LINKER_OPTIONS} diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 296e33e68..44c264ae9 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -25,20 +25,15 @@ const path = require('path'); const fs = require('fs'); const { URL } = require('url'); /* TODO: RPC Loader */ -const findFilesRecursively = (dirPattern, filePattern, depthLimit = Infinity) => { - const stack = [{ dir: dirPattern, depth: 0 }]; +const findFilesRecursively = (directory, filePattern, depthLimit = Infinity) => { + const stack = [{ dir: directory, depth: 0 }]; const files = []; - const dirRegex = new RegExp(dirPattern); const fileRegex = new RegExp(filePattern); while (stack.length > 0) { const { dir, depth } = stack.pop(); try { - if (!dirRegex.test(dir)) { - continue; - } - if (depth > depthLimit) { continue; } @@ -56,7 +51,7 @@ const findFilesRecursively = (dirPattern, filePattern, depthLimit = Infinity) => } } } catch (err) { - console.error(`Error reading directory ${dir}:`, err); + console.error(`Error reading directory '${dir}' while searching for MetaCall Library:`, err); } } From d73b40a3d129e783c7980da13ff8dfd8f6557768 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 24 Feb 2025 23:44:54 +0100 Subject: [PATCH 159/487] Solve issues in platform delete tag. --- .github/workflows/docker-hub-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index db4f323f1..d97b7d738 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -155,7 +155,7 @@ jobs: echo "Deleting tag: ${tag_to_delete}" curl -X DELETE \ - -H "Authorization: Bearer ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" \ - "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" + -u "${{ secrets.DOCKER_HUB_USERNAME }}:${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" \ + "https://cloud.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" done done From dfeb5595ba3431d9860f6a6017a1c5bca5887d2e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 01:08:03 +0100 Subject: [PATCH 160/487] Trying to test macos. --- source/loaders/node_loader/CMakeLists.txt | 4 +++- .../node_extension_test/CMakeLists.txt | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 1f88155f1..1592c141c 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -202,7 +202,9 @@ target_compile_options(${target} add_link_options(${target} PRIVATE - $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> + # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> + # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> + -Wl,-undefined,dynamic_lookup PUBLIC ${DEFAULT_LINKER_OPTIONS} diff --git a/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt b/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt index ebd286752..9cbd47bc1 100644 --- a/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt +++ b/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt @@ -177,7 +177,6 @@ add_link_options(${target} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/IGNORE:4199> $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> - $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> PUBLIC From 2a92f107dde115aaa5f49acdd03a6b81db193233 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 17:03:45 +0100 Subject: [PATCH 161/487] Trying to solve delete tag in multiplatform builds. --- .github/workflows/docker-hub-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index d97b7d738..b3d706e38 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -156,6 +156,6 @@ jobs: curl -X DELETE \ -u "${{ secrets.DOCKER_HUB_USERNAME }}:${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" \ - "https://cloud.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" + "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" done done From 0a40c7e407cefde43a7ce3a373fabf678adaab66 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 17:04:12 +0100 Subject: [PATCH 162/487] Set up backtrace plugin for Guix. --- .../plugins/backtrace_plugin/CMakeLists.txt | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/source/plugins/backtrace_plugin/CMakeLists.txt b/source/plugins/backtrace_plugin/CMakeLists.txt index 866e7b923..3d39838c1 100644 --- a/source/plugins/backtrace_plugin/CMakeLists.txt +++ b/source/plugins/backtrace_plugin/CMakeLists.txt @@ -7,27 +7,28 @@ endif() # External dependencies # -include(FetchContent) +if(NOT OPTION_BUILD_GUIX) + include(FetchContent) -FetchContent_Declare(BackwardCpp - GIT_REPOSITORY https://github.com/bombela/backward-cpp - GIT_TAG f30744bcf726ea3735df7ecf9e9de9ddac540283 -) + FetchContent_Declare(BackwardCpp + GIT_REPOSITORY https://github.com/bombela/backward-cpp + GIT_TAG f30744bcf726ea3735df7ecf9e9de9ddac540283 + ) -FetchContent_MakeAvailable(BackwardCpp) + FetchContent_MakeAvailable(BackwardCpp) -FetchContent_GetProperties(BackwardCpp - SOURCE_DIR BackwardCpp_SOURCE - POPULATED BackwardCpp_POPULATED -) + FetchContent_GetProperties(BackwardCpp + SOURCE_DIR BackwardCpp_SOURCE + POPULATED BackwardCpp_POPULATED + ) -if(NOT BackwardCpp_POPULATED) - FetchContent_Populate(backward-cpp) + if(NOT BackwardCpp_POPULATED) + FetchContent_Populate(backward-cpp) + endif() endif() if(NOT BackwardCpp_POPULATED OR NOT BackwardCpp_SOURCE) message(STATUS "BackwardCpp could not be installed, trying to find it on the system") - return() endif() find_package(Backward From 72599a0795e3caaa857a6cdcbc18f108a3f0dad7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 17:04:56 +0100 Subject: [PATCH 163/487] MacOS with prebuilt node. --- tools/metacall-environment.sh | 105 ++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index d2983330b..ee77b05d0 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -70,6 +70,13 @@ case "$(uname -s)" in *) OPERATIVE_SYSTEM="Unknown" esac +# Architecture detection +case "$(uname -m)" in + x86_64) ARCHITECTURE="amd64";; + arm64) ARCHITECTURE="arm64";; + *) ARCHITECTURE="Unknown";; +esac + # Check out for sudo if [ "`id -u`" = '0' ]; then SUDO_CMD="" @@ -520,57 +527,55 @@ sub_nodejs(){ $SUDO_CMD apk del .build-nodejs-python-deps fi elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then - # TODO: Fork https://github.com/puerts/backend-nodejs or let metacall build system compile NodeJS library itself - # if [ -z "${NodeJS_BUILD_FROM_SOURCE:-}" ]; then - # # Define node location - # NODE_PREFIX="$ROOT_DIR/build" - # # Include binaries into PATH - # export PATH="$NODE_PREFIX:$PATH" - - # # Create install path - # mkdir -p "$NODE_PREFIX" - # # Install NodeJS (TODO: Implement arm64 or amd64 detection into ${arch}) - # wget -qO- https://github.com/metacall/libnode/releases/download/v22.6.0/libnode-${arch}-macos.tar.xz | tar xvJ -C $NODE_PREFIX - # # Install NPM - # wget -qO- https://registry.npmjs.org/npm/-/npm-10.8.2.tgz | tar xvz -C $NODE_PREFIX - - # # Configure NodeJS paths - # mkdir -p "$ROOT_DIR/build" - # CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" - # echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/node" >> $CMAKE_CONFIG_PATH - # echo "-DNodeJS_LIBRARY=$NODE_PREFIX/libnode.127.dylib" >> $CMAKE_CONFIG_PATH - - # # Configure NPM path - # echo "-DNPM_ROOT=$NODE_PREFIX" >> $CMAKE_CONFIG_PATH - # else - - brew install node@22 - # Make node 22 the default - brew link node@22 --force --overwrite - # Execute post install scripts - brew postinstall node@22 - # Define node location - NODE_PREFIX=$(brew --prefix node@22) - # Include binaries into PATH - export PATH="$NODE_PREFIX/bin:$PATH" - - # Configure NodeJS paths - mkdir -p "$ROOT_DIR/build" - CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" - echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/bin/node" >> $CMAKE_CONFIG_PATH - # echo "-DNodeJS_INCLUDE_DIR=$NODE_PREFIX/include/node" >> $CMAKE_CONFIG_PATH - # echo "-DNodeJS_LIBRARY=$NODE_PREFIX/lib/libnode.93.dylib" >> $CMAKE_CONFIG_PATH - - # Configure NPM path - echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH - - if [ $INSTALL_C = 1 ]; then - # Required for test source/tests/metacall_node_port_c_lib_test - brew install libgit2@1.8 - brew link libgit2@1.8 --force --overwrite + # Build either using pre-compiled binaries or building node from source + if [ -z "${NodeJS_BUILD_FROM_SOURCE:-}" ]; then + # Define node location + NODE_PREFIX="$ROOT_DIR/build" + # Include binaries into PATH + export PATH="$NODE_PREFIX:$PATH" + + # Create install path + mkdir -p "$NODE_PREFIX" + + # Install NodeJS + wget -qO- https://github.com/metacall/libnode/releases/download/v22.6.0/libnode-${ARCHITECTURE}-macos.tar.xz | tar xvJ -C $NODE_PREFIX + + # Install NPM + wget -qO- https://registry.npmjs.org/npm/-/npm-10.8.2.tgz | tar xvz -C $NODE_PREFIX + + # Configure NodeJS paths + mkdir -p "$ROOT_DIR/build" + CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" + echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/node" >> $CMAKE_CONFIG_PATH + echo "-DNodeJS_LIBRARY=$NODE_PREFIX/libnode.127.dylib" >> $CMAKE_CONFIG_PATH + + # Configure NPM path + echo "-DNPM_ROOT=$NODE_PREFIX" >> $CMAKE_CONFIG_PATH + else + brew install node@22 + # Make node 22 the default + brew link node@22 --force --overwrite + # Execute post install scripts + brew postinstall node@22 + # Define node location + NODE_PREFIX=$(brew --prefix node@22) + # Include binaries into PATH + export PATH="$NODE_PREFIX/bin:$PATH" + + # Configure NodeJS paths + mkdir -p "$ROOT_DIR/build" + CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" + echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/bin/node" >> $CMAKE_CONFIG_PATH + + # Configure NPM path + echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH + + if [ $INSTALL_C = 1 ]; then + # Required for test source/tests/metacall_node_port_c_lib_test + brew install libgit2@1.8 + brew link libgit2@1.8 --force --overwrite + fi fi - - # fi fi } From 7121254002143aecf1badc1018334321822b51cb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 17:05:10 +0100 Subject: [PATCH 164/487] Add debug for makefile. --- source/loaders/node_loader/CMakeLists.txt | 1 - tools/metacall-configure.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 1592c141c..57ddc909d 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -204,7 +204,6 @@ add_link_options(${target} PRIVATE # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> - -Wl,-undefined,dynamic_lookup PUBLIC ${DEFAULT_LINKER_OPTIONS} diff --git a/tools/metacall-configure.sh b/tools/metacall-configure.sh index 206bc1e47..83eb973f2 100755 --- a/tools/metacall-configure.sh +++ b/tools/metacall-configure.sh @@ -532,7 +532,7 @@ sub_configure() { BUILD_STRING="$BUILD_STRING -DCMAKE_BUILD_TYPE=$BUILD_TYPE" # Execute CMake - cmake -Wno-dev -DOPTION_GIT_HOOKS=Off $BUILD_STRING .. + cmake -Wno-dev -DCMAKE_VERBOSE_MAKEFILE=ON -DOPTION_GIT_HOOKS=Off $BUILD_STRING .. } sub_help() { From bd1b230f054e700a6b161dd91a6dd24fa81965dc Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 17:18:31 +0100 Subject: [PATCH 165/487] Solve npm issues macos. --- tools/metacall-environment.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index ee77b05d0..19e4e7fd2 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -532,7 +532,7 @@ sub_nodejs(){ # Define node location NODE_PREFIX="$ROOT_DIR/build" # Include binaries into PATH - export PATH="$NODE_PREFIX:$PATH" + export PATH="$NODE_PREFIX:$NODE_PREFIX/bin:$PATH" # Create install path mkdir -p "$NODE_PREFIX" @@ -550,7 +550,7 @@ sub_nodejs(){ echo "-DNodeJS_LIBRARY=$NODE_PREFIX/libnode.127.dylib" >> $CMAKE_CONFIG_PATH # Configure NPM path - echo "-DNPM_ROOT=$NODE_PREFIX" >> $CMAKE_CONFIG_PATH + echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH else brew install node@22 # Make node 22 the default From b1fca384079b64b12ed7fec208f35cdcf9e2ffd4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 17:37:25 +0100 Subject: [PATCH 166/487] Solve more npn issues. --- tools/metacall-environment.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 19e4e7fd2..f209566e1 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -588,6 +588,11 @@ sub_typescript(){ $SUDO_CMD npm i react@latest -g $SUDO_CMD npm i react-dom@latest -g elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then + if [ -z "${NodeJS_BUILD_FROM_SOURCE:-}" ]; then + # Include NPM binaries into PATH + export PATH="$ROOT_DIR/build/bin:$PATH" + fi + # Install React dependencies in order to run the tests npm i react@latest -g npm i react-dom@latest -g From 62c181c5ef1138fe9513a8b1f9d5274ed7839072 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 18:06:14 +0100 Subject: [PATCH 167/487] Trying to solve macos. --- tools/metacall-environment.sh | 65 +++++++++++++---------------------- 1 file changed, 24 insertions(+), 41 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index f209566e1..25a24eae0 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -527,54 +527,42 @@ sub_nodejs(){ $SUDO_CMD apk del .build-nodejs-python-deps fi elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then + # Install NodeJS (required for source build or NPM itself) + brew install node@22 + # Make node 22 the default + brew link node@22 --force --overwrite + # Execute post install scripts + brew postinstall node@22 + # Define node location + NODE_PREFIX=$(brew --prefix node@22) + + # Configure NodeJS paths + mkdir -p "$ROOT_DIR/build" + CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" + + # Configure NPM path + echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH + # Build either using pre-compiled binaries or building node from source if [ -z "${NodeJS_BUILD_FROM_SOURCE:-}" ]; then # Define node location NODE_PREFIX="$ROOT_DIR/build" - # Include binaries into PATH - export PATH="$NODE_PREFIX:$NODE_PREFIX/bin:$PATH" - - # Create install path - mkdir -p "$NODE_PREFIX" - # Install NodeJS wget -qO- https://github.com/metacall/libnode/releases/download/v22.6.0/libnode-${ARCHITECTURE}-macos.tar.xz | tar xvJ -C $NODE_PREFIX - - # Install NPM - wget -qO- https://registry.npmjs.org/npm/-/npm-10.8.2.tgz | tar xvz -C $NODE_PREFIX - - # Configure NodeJS paths - mkdir -p "$ROOT_DIR/build" - CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" + # Configure NodeJS path echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/node" >> $CMAKE_CONFIG_PATH - echo "-DNodeJS_LIBRARY=$NODE_PREFIX/libnode.127.dylib" >> $CMAKE_CONFIG_PATH - - # Configure NPM path - echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH + echo "-DNodeJS_LIBRARY=$NODE_PREFIX/libnode.so" >> $CMAKE_CONFIG_PATH else - brew install node@22 - # Make node 22 the default - brew link node@22 --force --overwrite - # Execute post install scripts - brew postinstall node@22 - # Define node location - NODE_PREFIX=$(brew --prefix node@22) # Include binaries into PATH export PATH="$NODE_PREFIX/bin:$PATH" - - # Configure NodeJS paths - mkdir -p "$ROOT_DIR/build" - CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" + # Define executable path echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/bin/node" >> $CMAKE_CONFIG_PATH + fi - # Configure NPM path - echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH - - if [ $INSTALL_C = 1 ]; then - # Required for test source/tests/metacall_node_port_c_lib_test - brew install libgit2@1.8 - brew link libgit2@1.8 --force --overwrite - fi + if [ $INSTALL_C = 1 ]; then + # Required for test source/tests/metacall_node_port_c_lib_test + brew install libgit2@1.8 + brew link libgit2@1.8 --force --overwrite fi fi } @@ -588,11 +576,6 @@ sub_typescript(){ $SUDO_CMD npm i react@latest -g $SUDO_CMD npm i react-dom@latest -g elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then - if [ -z "${NodeJS_BUILD_FROM_SOURCE:-}" ]; then - # Include NPM binaries into PATH - export PATH="$ROOT_DIR/build/bin:$PATH" - fi - # Install React dependencies in order to run the tests npm i react@latest -g npm i react-dom@latest -g From 2baa0f4e5563d55358d857cf07ea20bd1f14c1fd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 18:17:12 +0100 Subject: [PATCH 168/487] Breaks make builds. --- tools/metacall-configure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/metacall-configure.sh b/tools/metacall-configure.sh index 83eb973f2..206bc1e47 100755 --- a/tools/metacall-configure.sh +++ b/tools/metacall-configure.sh @@ -532,7 +532,7 @@ sub_configure() { BUILD_STRING="$BUILD_STRING -DCMAKE_BUILD_TYPE=$BUILD_TYPE" # Execute CMake - cmake -Wno-dev -DCMAKE_VERBOSE_MAKEFILE=ON -DOPTION_GIT_HOOKS=Off $BUILD_STRING .. + cmake -Wno-dev -DOPTION_GIT_HOOKS=Off $BUILD_STRING .. } sub_help() { From c97a026f25a989bdecdd0a8169f485f7631aa993 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 18:40:54 +0100 Subject: [PATCH 169/487] Solving issues with libnode. --- tools/metacall-environment.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 25a24eae0..64982d14e 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -548,10 +548,10 @@ sub_nodejs(){ # Define node location NODE_PREFIX="$ROOT_DIR/build" # Install NodeJS - wget -qO- https://github.com/metacall/libnode/releases/download/v22.6.0/libnode-${ARCHITECTURE}-macos.tar.xz | tar xvJ -C $NODE_PREFIX + wget -qO- https://github.com/metacall/libnode/releases/download/v22.9.0/libnode-${ARCHITECTURE}-macos.tar.xz | tar xvJ -C $NODE_PREFIX # Configure NodeJS path echo "-DNodeJS_EXECUTABLE=$NODE_PREFIX/node" >> $CMAKE_CONFIG_PATH - echo "-DNodeJS_LIBRARY=$NODE_PREFIX/libnode.so" >> $CMAKE_CONFIG_PATH + echo "-DNodeJS_LIBRARY=$NODE_PREFIX/libnode.dylib" >> $CMAKE_CONFIG_PATH else # Include binaries into PATH export PATH="$NODE_PREFIX/bin:$PATH" From 662cb9b2fc6d85540922c8f1580398255cb5f262 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 20:47:58 +0100 Subject: [PATCH 170/487] Trying to make node_loader work on macos. --- source/loaders/node_loader/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 57ddc909d..7df496c11 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -192,6 +192,7 @@ target_compile_options(${target} PUBLIC ${DEFAULT_COMPILE_OPTIONS} + -Wl,-undefined,dynamic_lookup INTERFACE ) From 67b2b5b45a14c665323ed6b42a08a7618d11ca1e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 21:00:52 +0100 Subject: [PATCH 171/487] Trying to make node_loader work on macos 2. --- cmake/CompileOptions.cmake | 2 ++ source/loaders/node_loader/CMakeLists.txt | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index a5610945c..c89fb8982 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -410,3 +410,5 @@ elseif(PROJECT_OS_HAIKU) -lpthread ) endif() + +set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -undefined dynamic_lookup") diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 7df496c11..57ddc909d 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -192,7 +192,6 @@ target_compile_options(${target} PUBLIC ${DEFAULT_COMPILE_OPTIONS} - -Wl,-undefined,dynamic_lookup INTERFACE ) From 7735599b3e7cd5da9be60a33f4090c6df54a4a63 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 21:18:34 +0100 Subject: [PATCH 172/487] Trying to make node_loader work on macos 3. --- cmake/CompileOptions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index c89fb8982..dfcecbe2a 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -411,4 +411,4 @@ elseif(PROJECT_OS_HAIKU) ) endif() -set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -undefined dynamic_lookup") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,dynamic_lookup") From 3f737b02bdfea4e454220511a0c34fd6f2058071 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 21:41:54 +0100 Subject: [PATCH 173/487] Trying to make node_loader work on macos 4. --- cmake/CompileOptions.cmake | 2 -- source/loaders/node_loader/CMakeLists.txt | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index dfcecbe2a..a5610945c 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -410,5 +410,3 @@ elseif(PROJECT_OS_HAIKU) -lpthread ) endif() - -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,dynamic_lookup") diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 57ddc909d..a448d8907 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -200,16 +200,18 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} - PRIVATE - # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> - # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> +set_target_properties(${target} PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup") - PUBLIC - ${DEFAULT_LINKER_OPTIONS} +# add_link_options(${target} +# PRIVATE +# # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> +# # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> - INTERFACE -) +# PUBLIC +# ${DEFAULT_LINKER_OPTIONS} + +# INTERFACE +# ) # # Standard options From 18e4aec6865ace48aa4415d633c1c9fa78b91b97 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 21:59:37 +0100 Subject: [PATCH 174/487] Trying to make node_loader work on macos 5. --- source/loaders/node_loader/CMakeLists.txt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index a448d8907..5536fa202 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -200,18 +200,15 @@ target_compile_options(${target} # Linker options # -set_target_properties(${target} PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup") - -# add_link_options(${target} -# PRIVATE -# # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> -# # $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup> +target_link_options(${target} + PRIVATE + $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> -# PUBLIC -# ${DEFAULT_LINKER_OPTIONS} + PUBLIC + ${DEFAULT_LINKER_OPTIONS} -# INTERFACE -# ) + INTERFACE +) # # Standard options From 7fbcce04056d9161e54f6b4f4da0fc9d01e3a4a6 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 22:45:43 +0100 Subject: [PATCH 175/487] Solve issues with macos link. --- source/adt/CMakeLists.txt | 2 +- source/benchmarks/log_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_cs_call_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_node_call_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_py_call_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_py_init_bench/CMakeLists.txt | 2 +- source/benchmarks/metacall_rb_call_bench/CMakeLists.txt | 2 +- source/cli/metacallcli/CMakeLists.txt | 2 +- source/cli/plugins/cli_core_plugin/CMakeLists.txt | 2 +- source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt | 2 +- source/configuration/CMakeLists.txt | 2 +- source/detour/CMakeLists.txt | 2 +- source/detours/funchook_detour/CMakeLists.txt | 2 +- source/dynlink/CMakeLists.txt | 2 +- source/environment/CMakeLists.txt | 2 +- source/examples/metacallgui/CMakeLists.txt | 2 +- source/examples/metacalllog/CMakeLists.txt | 2 +- source/examples/metacallquine/CMakeLists.txt | 2 +- source/examples/metacallweb/CMakeLists.txt | 2 +- source/extensions/plugin_extension/CMakeLists.txt | 2 +- source/filesystem/CMakeLists.txt | 2 +- source/format/CMakeLists.txt | 2 +- source/loader/CMakeLists.txt | 2 +- source/loaders/c_loader/CMakeLists.txt | 2 +- source/loaders/cob_loader/CMakeLists.txt | 2 +- source/loaders/cr_loader/CMakeLists.txt | 2 +- source/loaders/cs_loader/CMakeLists.txt | 2 +- source/loaders/dart_loader/CMakeLists.txt | 2 +- source/loaders/ext_loader/CMakeLists.txt | 2 +- source/loaders/file_loader/CMakeLists.txt | 2 +- source/loaders/java_loader/CMakeLists.txt | 2 +- source/loaders/jl_loader/CMakeLists.txt | 2 +- source/loaders/js_loader/CMakeLists.txt | 2 +- source/loaders/jsm_loader/CMakeLists.txt | 2 +- source/loaders/llvm_loader/CMakeLists.txt | 2 +- source/loaders/lua_loader/CMakeLists.txt | 2 +- source/loaders/mock_loader/CMakeLists.txt | 2 +- source/loaders/py_loader/CMakeLists.txt | 2 +- source/loaders/rb_loader/CMakeLists.txt | 2 +- source/loaders/rpc_loader/CMakeLists.txt | 2 +- source/loaders/rs_loader/CMakeLists.txt | 2 +- source/loaders/ts_loader/CMakeLists.txt | 2 +- source/loaders/wasm_loader/CMakeLists.txt | 2 +- source/log/CMakeLists.txt | 2 +- source/memory/CMakeLists.txt | 2 +- source/metacall/CMakeLists.txt | 2 +- source/plugin/CMakeLists.txt | 2 +- source/plugins/backtrace_plugin/CMakeLists.txt | 2 +- source/plugins/sandbox_plugin/CMakeLists.txt | 2 +- source/portability/CMakeLists.txt | 2 +- source/ports/cxx_port/CMakeLists.txt | 2 +- source/ports/js_port/CMakeLists.txt | 4 ++-- source/ports/rb_port/CMakeLists.txt | 2 +- source/preprocessor/CMakeLists.txt | 2 +- source/reflect/CMakeLists.txt | 2 +- source/scripts/extension/sum/CMakeLists.txt | 2 +- source/serial/CMakeLists.txt | 2 +- source/serials/metacall_serial/CMakeLists.txt | 2 +- source/serials/rapid_json_serial/CMakeLists.txt | 2 +- source/tests/adt_map_test/CMakeLists.txt | 2 +- source/tests/adt_set_test/CMakeLists.txt | 2 +- source/tests/adt_trie_test/CMakeLists.txt | 2 +- source/tests/adt_vector_test/CMakeLists.txt | 2 +- source/tests/configuration_test/CMakeLists.txt | 2 +- source/tests/detour_test/CMakeLists.txt | 2 +- source/tests/dynlink_test/CMakeLists.txt | 2 +- source/tests/environment_test/CMakeLists.txt | 2 +- source/tests/log_custom_test/CMakeLists.txt | 2 +- source/tests/log_test/CMakeLists.txt | 2 +- source/tests/metacall_backtrace_plugin_test/CMakeLists.txt | 2 +- source/tests/metacall_c_lib_test/CMakeLists.txt | 2 +- source/tests/metacall_c_test/CMakeLists.txt | 2 +- source/tests/metacall_callback_complex_test/CMakeLists.txt | 2 +- source/tests/metacall_cast_test/CMakeLists.txt | 2 +- source/tests/metacall_clear_test/CMakeLists.txt | 2 +- .../tests/metacall_cli_core_plugin_await_test/CMakeLists.txt | 2 +- source/tests/metacall_cli_core_plugin_test/CMakeLists.txt | 2 +- source/tests/metacall_cobol_test/CMakeLists.txt | 2 +- .../tests/metacall_configuration_default_test/CMakeLists.txt | 2 +- .../metacall_configuration_exec_path_test/CMakeLists.txt | 2 +- source/tests/metacall_cs_test/CMakeLists.txt | 2 +- source/tests/metacall_csharp_function_test/CMakeLists.txt | 2 +- source/tests/metacall_csharp_static_class_test/CMakeLists.txt | 2 +- source/tests/metacall_depends_test/CMakeLists.txt | 2 +- source/tests/metacall_distributable_test/CMakeLists.txt | 2 +- source/tests/metacall_ducktype_test/CMakeLists.txt | 2 +- source/tests/metacall_duplicated_handle_test/CMakeLists.txt | 2 +- source/tests/metacall_duplicated_symbols_test/CMakeLists.txt | 2 +- source/tests/metacall_dynlink_path_test/CMakeLists.txt | 2 +- source/tests/metacall_ext_test/CMakeLists.txt | 2 +- source/tests/metacall_file_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_file_glob_test/CMakeLists.txt | 2 +- source/tests/metacall_file_test/CMakeLists.txt | 2 +- source/tests/metacall_fork_test/CMakeLists.txt | 2 +- source/tests/metacall_function_test/CMakeLists.txt | 2 +- source/tests/metacall_handle_export_test/CMakeLists.txt | 2 +- source/tests/metacall_handle_get_test/CMakeLists.txt | 2 +- source/tests/metacall_init_fini_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../metacall_initialize_destroy_multiple_test/CMakeLists.txt | 2 +- source/tests/metacall_initialize_ex_test/CMakeLists.txt | 2 +- source/tests/metacall_initialize_test/CMakeLists.txt | 2 +- source/tests/metacall_inspect_test/CMakeLists.txt | 2 +- source/tests/metacall_integration_test/CMakeLists.txt | 2 +- source/tests/metacall_invalid_loader_test/CMakeLists.txt | 2 +- source/tests/metacall_java_test/CMakeLists.txt | 2 +- source/tests/metacall_julia_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- source/tests/metacall_llvm_test/CMakeLists.txt | 2 +- .../metacall_load_configuration_fail_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../metacall_load_configuration_relative_test/CMakeLists.txt | 2 +- source/tests/metacall_load_configuration_test/CMakeLists.txt | 2 +- source/tests/metacall_load_memory_empty_test/CMakeLists.txt | 2 +- source/tests/metacall_load_memory_test/CMakeLists.txt | 2 +- source/tests/metacall_logs_test/CMakeLists.txt | 2 +- source/tests/metacall_lua_test/CMakeLists.txt | 2 +- source/tests/metacall_map_await_test/CMakeLists.txt | 2 +- source/tests/metacall_map_test/CMakeLists.txt | 2 +- source/tests/metacall_node_async_multiple_test/CMakeLists.txt | 2 +- .../tests/metacall_node_async_resources_test/CMakeLists.txt | 2 +- source/tests/metacall_node_async_test/CMakeLists.txt | 2 +- source/tests/metacall_node_await_chain_test/CMakeLists.txt | 2 +- source/tests/metacall_node_call_test/CMakeLists.txt | 2 +- source/tests/metacall_node_callback_test/CMakeLists.txt | 2 +- source/tests/metacall_node_clear_mem_test/CMakeLists.txt | 2 +- source/tests/metacall_node_default_export_test/CMakeLists.txt | 2 +- .../tests/metacall_node_event_loop_signal_test/CMakeLists.txt | 2 +- source/tests/metacall_node_event_loop_test/CMakeLists.txt | 2 +- source/tests/metacall_node_exception_test/CMakeLists.txt | 2 +- source/tests/metacall_node_extension_test/CMakeLists.txt | 2 +- .../node_extension_test/CMakeLists.txt | 2 +- source/tests/metacall_node_fail_env_var_test/CMakeLists.txt | 2 +- source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt | 2 +- source/tests/metacall_node_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_node_inline_test/CMakeLists.txt | 2 +- .../metacall_node_multithread_deadlock_test/CMakeLists.txt | 2 +- source/tests/metacall_node_native_code_test/CMakeLists.txt | 2 +- source/tests/metacall_node_port_await_test/CMakeLists.txt | 2 +- source/tests/metacall_node_port_c_lib_test/CMakeLists.txt | 2 +- source/tests/metacall_node_port_rs_test/CMakeLists.txt | 2 +- source/tests/metacall_node_port_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../metacall_node_python_await_extended_test/CMakeLists.txt | 2 +- source/tests/metacall_node_python_await_test/CMakeLists.txt | 2 +- .../tests/metacall_node_python_deadlock_test/CMakeLists.txt | 2 +- .../tests/metacall_node_python_exception_test/CMakeLists.txt | 2 +- .../tests/metacall_node_python_port_mock_test/CMakeLists.txt | 2 +- .../tests/metacall_node_python_port_ruby_test/CMakeLists.txt | 2 +- source/tests/metacall_node_python_ruby_test/CMakeLists.txt | 2 +- source/tests/metacall_node_reentrant_test/CMakeLists.txt | 2 +- source/tests/metacall_node_signal_handler_test/CMakeLists.txt | 2 +- source/tests/metacall_node_test/CMakeLists.txt | 2 +- source/tests/metacall_node_typescript_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../tests/metacall_plugin_extension_local_test/CMakeLists.txt | 2 +- source/tests/metacall_plugin_extension_test/CMakeLists.txt | 2 +- source/tests/metacall_python_async_test/CMakeLists.txt | 2 +- source/tests/metacall_python_await_test/CMakeLists.txt | 2 +- source/tests/metacall_python_builtins_test/CMakeLists.txt | 2 +- source/tests/metacall_python_callback_test/CMakeLists.txt | 2 +- source/tests/metacall_python_dict_test/CMakeLists.txt | 2 +- source/tests/metacall_python_exception_test/CMakeLists.txt | 2 +- source/tests/metacall_python_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_python_gc_test/CMakeLists.txt | 2 +- source/tests/metacall_python_loader_port_test/CMakeLists.txt | 2 +- source/tests/metacall_python_model_test/CMakeLists.txt | 2 +- source/tests/metacall_python_node_await_test/CMakeLists.txt | 2 +- source/tests/metacall_python_object_class_test/CMakeLists.txt | 2 +- source/tests/metacall_python_open_test/CMakeLists.txt | 2 +- source/tests/metacall_python_pointer_test/CMakeLists.txt | 2 +- .../tests/metacall_python_port_callback_test/CMakeLists.txt | 2 +- source/tests/metacall_python_port_https_test/CMakeLists.txt | 2 +- source/tests/metacall_python_port_import_test/CMakeLists.txt | 2 +- source/tests/metacall_python_port_pointer_test/CMakeLists.txt | 2 +- source/tests/metacall_python_port_test/CMakeLists.txt | 2 +- source/tests/metacall_python_reentrant_test/CMakeLists.txt | 2 +- .../tests/metacall_python_relative_path_test/CMakeLists.txt | 2 +- source/tests/metacall_python_test/CMakeLists.txt | 2 +- source/tests/metacall_python_varargs_test/CMakeLists.txt | 2 +- .../metacall_python_without_env_vars_test/CMakeLists.txt | 2 +- .../metacall_python_without_functions_test/CMakeLists.txt | 2 +- source/tests/metacall_reinitialize_test/CMakeLists.txt | 2 +- source/tests/metacall_reload_functions_test/CMakeLists.txt | 2 +- source/tests/metacall_return_monad_test/CMakeLists.txt | 2 +- source/tests/metacall_rpc_test/CMakeLists.txt | 2 +- source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt | 2 +- source/tests/metacall_ruby_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_ruby_object_class_test/CMakeLists.txt | 2 +- .../metacall_ruby_parser_integration_test/CMakeLists.txt | 2 +- .../tests/metacall_ruby_rails_integration_test/CMakeLists.txt | 2 +- source/tests/metacall_ruby_test/CMakeLists.txt | 2 +- source/tests/metacall_rust_class_test/CMakeLists.txt | 2 +- source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt | 2 +- .../metacall_rust_load_from_package_class_test/CMakeLists.txt | 2 +- .../metacall_rust_load_from_package_dep_test/CMakeLists.txt | 2 +- .../tests/metacall_rust_load_from_package_test/CMakeLists.txt | 2 +- source/tests/metacall_rust_test/CMakeLists.txt | 2 +- source/tests/metacall_sandbox_plugin_test/CMakeLists.txt | 2 +- source/tests/metacall_test/CMakeLists.txt | 2 +- source/tests/metacall_typescript_call_map_test/CMakeLists.txt | 2 +- .../tests/metacall_typescript_jsx_default_test/CMakeLists.txt | 2 +- source/tests/metacall_typescript_node_test/CMakeLists.txt | 2 +- source/tests/metacall_typescript_require_test/CMakeLists.txt | 2 +- source/tests/metacall_typescript_test/CMakeLists.txt | 2 +- .../metacall_typescript_tsx_loop_fail_test/CMakeLists.txt | 2 +- source/tests/metacall_typescript_tsx_test/CMakeLists.txt | 2 +- source/tests/metacall_version_test/CMakeLists.txt | 2 +- source/tests/metacall_wasm_python_port_test/CMakeLists.txt | 2 +- source/tests/metacall_wasm_test/CMakeLists.txt | 2 +- source/tests/portability_path_test/CMakeLists.txt | 2 +- source/tests/preprocessor_test/CMakeLists.txt | 2 +- source/tests/rb_loader_parser_test/CMakeLists.txt | 2 +- source/tests/reflect_function_test/CMakeLists.txt | 2 +- source/tests/reflect_metadata_test/CMakeLists.txt | 2 +- source/tests/reflect_object_class_test/CMakeLists.txt | 2 +- source/tests/reflect_scope_test/CMakeLists.txt | 2 +- source/tests/reflect_value_cast_test/CMakeLists.txt | 2 +- source/tests/serial_test/CMakeLists.txt | 2 +- source/threading/CMakeLists.txt | 2 +- source/version/CMakeLists.txt | 2 +- 224 files changed, 225 insertions(+), 225 deletions(-) diff --git a/source/adt/CMakeLists.txt b/source/adt/CMakeLists.txt index e97f2f59b..6083509df 100644 --- a/source/adt/CMakeLists.txt +++ b/source/adt/CMakeLists.txt @@ -164,7 +164,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/benchmarks/log_bench/CMakeLists.txt b/source/benchmarks/log_bench/CMakeLists.txt index 1c1175337..f1ba5575e 100644 --- a/source/benchmarks/log_bench/CMakeLists.txt +++ b/source/benchmarks/log_bench/CMakeLists.txt @@ -108,7 +108,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_cs_call_bench/CMakeLists.txt b/source/benchmarks/metacall_cs_call_bench/CMakeLists.txt index 751b4a034..80db3ce39 100644 --- a/source/benchmarks/metacall_cs_call_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_cs_call_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_node_call_bench/CMakeLists.txt b/source/benchmarks/metacall_node_call_bench/CMakeLists.txt index 8b9c696bb..16ae8e768 100644 --- a/source/benchmarks/metacall_node_call_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_node_call_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt b/source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt index 0c0ee17bc..08605fb08 100644 --- a/source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_py_c_api_bench/CMakeLists.txt @@ -121,7 +121,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_py_call_bench/CMakeLists.txt b/source/benchmarks/metacall_py_call_bench/CMakeLists.txt index bbc6b3376..9ed674422 100644 --- a/source/benchmarks/metacall_py_call_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_py_call_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_py_init_bench/CMakeLists.txt b/source/benchmarks/metacall_py_init_bench/CMakeLists.txt index 1aff472c3..eb9ecb2c7 100644 --- a/source/benchmarks/metacall_py_init_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_py_init_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/benchmarks/metacall_rb_call_bench/CMakeLists.txt b/source/benchmarks/metacall_rb_call_bench/CMakeLists.txt index fc66c3230..4833bad0d 100644 --- a/source/benchmarks/metacall_rb_call_bench/CMakeLists.txt +++ b/source/benchmarks/metacall_rb_call_bench/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/cli/metacallcli/CMakeLists.txt b/source/cli/metacallcli/CMakeLists.txt index 227a81cfd..7d2183283 100644 --- a/source/cli/metacallcli/CMakeLists.txt +++ b/source/cli/metacallcli/CMakeLists.txt @@ -139,7 +139,7 @@ target_compile_features(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/cli/plugins/cli_core_plugin/CMakeLists.txt b/source/cli/plugins/cli_core_plugin/CMakeLists.txt index 1e353e4d4..680417f11 100644 --- a/source/cli/plugins/cli_core_plugin/CMakeLists.txt +++ b/source/cli/plugins/cli_core_plugin/CMakeLists.txt @@ -180,7 +180,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt b/source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt index 3c777caf8..de380e948 100644 --- a/source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt +++ b/source/cli/plugins/cli_sandbox_plugin/CMakeLists.txt @@ -175,7 +175,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/configuration/CMakeLists.txt b/source/configuration/CMakeLists.txt index 6c5204d8f..4097b1d54 100644 --- a/source/configuration/CMakeLists.txt +++ b/source/configuration/CMakeLists.txt @@ -164,7 +164,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/detour/CMakeLists.txt b/source/detour/CMakeLists.txt index fafc41c6f..19e3a6919 100644 --- a/source/detour/CMakeLists.txt +++ b/source/detour/CMakeLists.txt @@ -157,7 +157,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index 74c39ef67..afd225e3d 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -214,7 +214,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/dynlink/CMakeLists.txt b/source/dynlink/CMakeLists.txt index 33a62eaa7..8a9d6aed6 100644 --- a/source/dynlink/CMakeLists.txt +++ b/source/dynlink/CMakeLists.txt @@ -168,7 +168,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/environment/CMakeLists.txt b/source/environment/CMakeLists.txt index 34c36271b..28b99aa95 100644 --- a/source/environment/CMakeLists.txt +++ b/source/environment/CMakeLists.txt @@ -150,7 +150,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/examples/metacallgui/CMakeLists.txt b/source/examples/metacallgui/CMakeLists.txt index 8bfa9b958..485521f88 100644 --- a/source/examples/metacallgui/CMakeLists.txt +++ b/source/examples/metacallgui/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/examples/metacalllog/CMakeLists.txt b/source/examples/metacalllog/CMakeLists.txt index 5a180105b..6b4f8d234 100644 --- a/source/examples/metacalllog/CMakeLists.txt +++ b/source/examples/metacalllog/CMakeLists.txt @@ -93,7 +93,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/examples/metacallquine/CMakeLists.txt b/source/examples/metacallquine/CMakeLists.txt index 299a45762..0da78c404 100644 --- a/source/examples/metacallquine/CMakeLists.txt +++ b/source/examples/metacallquine/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/examples/metacallweb/CMakeLists.txt b/source/examples/metacallweb/CMakeLists.txt index b4e9c095d..6c81c8b2e 100644 --- a/source/examples/metacallweb/CMakeLists.txt +++ b/source/examples/metacallweb/CMakeLists.txt @@ -99,7 +99,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/extensions/plugin_extension/CMakeLists.txt b/source/extensions/plugin_extension/CMakeLists.txt index 6873958a2..31baf3fba 100644 --- a/source/extensions/plugin_extension/CMakeLists.txt +++ b/source/extensions/plugin_extension/CMakeLists.txt @@ -161,7 +161,7 @@ target_compile_features(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/filesystem/CMakeLists.txt b/source/filesystem/CMakeLists.txt index 472863df3..56024183d 100644 --- a/source/filesystem/CMakeLists.txt +++ b/source/filesystem/CMakeLists.txt @@ -181,7 +181,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/format/CMakeLists.txt b/source/format/CMakeLists.txt index 46d4ba545..1bf3e2c7f 100644 --- a/source/format/CMakeLists.txt +++ b/source/format/CMakeLists.txt @@ -147,7 +147,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loader/CMakeLists.txt b/source/loader/CMakeLists.txt index dad99a6b7..953a5f3ef 100644 --- a/source/loader/CMakeLists.txt +++ b/source/loader/CMakeLists.txt @@ -170,7 +170,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/c_loader/CMakeLists.txt b/source/loaders/c_loader/CMakeLists.txt index 729466872..e418078d9 100644 --- a/source/loaders/c_loader/CMakeLists.txt +++ b/source/loaders/c_loader/CMakeLists.txt @@ -203,7 +203,7 @@ target_compile_features(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/cob_loader/CMakeLists.txt b/source/loaders/cob_loader/CMakeLists.txt index 19890f7d5..a22cbf01e 100644 --- a/source/loaders/cob_loader/CMakeLists.txt +++ b/source/loaders/cob_loader/CMakeLists.txt @@ -162,7 +162,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/cr_loader/CMakeLists.txt b/source/loaders/cr_loader/CMakeLists.txt index b0ab7ba89..305875d48 100644 --- a/source/loaders/cr_loader/CMakeLists.txt +++ b/source/loaders/cr_loader/CMakeLists.txt @@ -154,7 +154,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/cs_loader/CMakeLists.txt b/source/loaders/cs_loader/CMakeLists.txt index c872d0f24..37b4a7ac2 100644 --- a/source/loaders/cs_loader/CMakeLists.txt +++ b/source/loaders/cs_loader/CMakeLists.txt @@ -222,7 +222,7 @@ target_compile_features(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/dart_loader/CMakeLists.txt b/source/loaders/dart_loader/CMakeLists.txt index 6355e44cd..b6b48df1f 100644 --- a/source/loaders/dart_loader/CMakeLists.txt +++ b/source/loaders/dart_loader/CMakeLists.txt @@ -165,7 +165,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/ext_loader/CMakeLists.txt b/source/loaders/ext_loader/CMakeLists.txt index b2a9545f9..3efbb1d66 100644 --- a/source/loaders/ext_loader/CMakeLists.txt +++ b/source/loaders/ext_loader/CMakeLists.txt @@ -163,7 +163,7 @@ target_compile_features(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/file_loader/CMakeLists.txt b/source/loaders/file_loader/CMakeLists.txt index 0f03daec2..0a3ec02b3 100644 --- a/source/loaders/file_loader/CMakeLists.txt +++ b/source/loaders/file_loader/CMakeLists.txt @@ -154,7 +154,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/java_loader/CMakeLists.txt b/source/loaders/java_loader/CMakeLists.txt index c9b4d5857..c59eaa59a 100644 --- a/source/loaders/java_loader/CMakeLists.txt +++ b/source/loaders/java_loader/CMakeLists.txt @@ -175,7 +175,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/jl_loader/CMakeLists.txt b/source/loaders/jl_loader/CMakeLists.txt index 8c1109f2f..d628b69cd 100644 --- a/source/loaders/jl_loader/CMakeLists.txt +++ b/source/loaders/jl_loader/CMakeLists.txt @@ -180,7 +180,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/js_loader/CMakeLists.txt b/source/loaders/js_loader/CMakeLists.txt index dfa627ff9..c6e599df2 100644 --- a/source/loaders/js_loader/CMakeLists.txt +++ b/source/loaders/js_loader/CMakeLists.txt @@ -171,7 +171,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/jsm_loader/CMakeLists.txt b/source/loaders/jsm_loader/CMakeLists.txt index 36accd7ed..00266a3f2 100644 --- a/source/loaders/jsm_loader/CMakeLists.txt +++ b/source/loaders/jsm_loader/CMakeLists.txt @@ -169,7 +169,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/llvm_loader/CMakeLists.txt b/source/loaders/llvm_loader/CMakeLists.txt index 7755ecf18..954eba5d1 100644 --- a/source/loaders/llvm_loader/CMakeLists.txt +++ b/source/loaders/llvm_loader/CMakeLists.txt @@ -169,7 +169,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/lua_loader/CMakeLists.txt b/source/loaders/lua_loader/CMakeLists.txt index 6a735bbd7..6816c8284 100644 --- a/source/loaders/lua_loader/CMakeLists.txt +++ b/source/loaders/lua_loader/CMakeLists.txt @@ -167,7 +167,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/mock_loader/CMakeLists.txt b/source/loaders/mock_loader/CMakeLists.txt index 60cd93043..6fb2c80dc 100644 --- a/source/loaders/mock_loader/CMakeLists.txt +++ b/source/loaders/mock_loader/CMakeLists.txt @@ -154,7 +154,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/py_loader/CMakeLists.txt b/source/loaders/py_loader/CMakeLists.txt index 105bfae2c..b2957ff0f 100644 --- a/source/loaders/py_loader/CMakeLists.txt +++ b/source/loaders/py_loader/CMakeLists.txt @@ -209,7 +209,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/rb_loader/CMakeLists.txt b/source/loaders/rb_loader/CMakeLists.txt index 8259079b4..e74b89540 100644 --- a/source/loaders/rb_loader/CMakeLists.txt +++ b/source/loaders/rb_loader/CMakeLists.txt @@ -186,7 +186,7 @@ endif() # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/rpc_loader/CMakeLists.txt b/source/loaders/rpc_loader/CMakeLists.txt index c81839aef..8cbb72f12 100644 --- a/source/loaders/rpc_loader/CMakeLists.txt +++ b/source/loaders/rpc_loader/CMakeLists.txt @@ -171,7 +171,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/rs_loader/CMakeLists.txt b/source/loaders/rs_loader/CMakeLists.txt index 4c97cf599..aa84cbcce 100644 --- a/source/loaders/rs_loader/CMakeLists.txt +++ b/source/loaders/rs_loader/CMakeLists.txt @@ -177,7 +177,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/ts_loader/CMakeLists.txt b/source/loaders/ts_loader/CMakeLists.txt index 076f40dc7..b76112250 100644 --- a/source/loaders/ts_loader/CMakeLists.txt +++ b/source/loaders/ts_loader/CMakeLists.txt @@ -164,7 +164,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/loaders/wasm_loader/CMakeLists.txt b/source/loaders/wasm_loader/CMakeLists.txt index 20ada2d79..c51d56713 100644 --- a/source/loaders/wasm_loader/CMakeLists.txt +++ b/source/loaders/wasm_loader/CMakeLists.txt @@ -174,7 +174,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/log/CMakeLists.txt b/source/log/CMakeLists.txt index 556c17aae..bce9dc593 100644 --- a/source/log/CMakeLists.txt +++ b/source/log/CMakeLists.txt @@ -220,7 +220,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/memory/CMakeLists.txt b/source/memory/CMakeLists.txt index 17a4b1b1c..043812e4a 100644 --- a/source/memory/CMakeLists.txt +++ b/source/memory/CMakeLists.txt @@ -161,7 +161,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/metacall/CMakeLists.txt b/source/metacall/CMakeLists.txt index ec669d7f0..7aefaabd1 100644 --- a/source/metacall/CMakeLists.txt +++ b/source/metacall/CMakeLists.txt @@ -244,7 +244,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/plugin/CMakeLists.txt b/source/plugin/CMakeLists.txt index c46756f36..871d222b3 100644 --- a/source/plugin/CMakeLists.txt +++ b/source/plugin/CMakeLists.txt @@ -163,7 +163,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/plugins/backtrace_plugin/CMakeLists.txt b/source/plugins/backtrace_plugin/CMakeLists.txt index 3d39838c1..ba955b7d8 100644 --- a/source/plugins/backtrace_plugin/CMakeLists.txt +++ b/source/plugins/backtrace_plugin/CMakeLists.txt @@ -217,7 +217,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/plugins/sandbox_plugin/CMakeLists.txt b/source/plugins/sandbox_plugin/CMakeLists.txt index 1197f9760..e570a9528 100644 --- a/source/plugins/sandbox_plugin/CMakeLists.txt +++ b/source/plugins/sandbox_plugin/CMakeLists.txt @@ -196,7 +196,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/portability/CMakeLists.txt b/source/portability/CMakeLists.txt index 65b9dd1f2..1855258d2 100644 --- a/source/portability/CMakeLists.txt +++ b/source/portability/CMakeLists.txt @@ -158,7 +158,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/ports/cxx_port/CMakeLists.txt b/source/ports/cxx_port/CMakeLists.txt index 07b94e752..bc450a068 100644 --- a/source/ports/cxx_port/CMakeLists.txt +++ b/source/ports/cxx_port/CMakeLists.txt @@ -147,7 +147,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/ports/js_port/CMakeLists.txt b/source/ports/js_port/CMakeLists.txt index 447e1fc10..8613fc33b 100644 --- a/source/ports/js_port/CMakeLists.txt +++ b/source/ports/js_port/CMakeLists.txt @@ -213,7 +213,7 @@ target_compile_options(${SWIG_MODULE_${target}_REAL_NAME} # Linker options # -add_link_options(${SWIG_MODULE_${target}_REAL_NAME} +target_link_options(${SWIG_MODULE_${target}_REAL_NAME} PRIVATE PUBLIC @@ -380,7 +380,7 @@ target_compile_options(${js_port_test} # Linker options # -add_link_options(${js_port_test} +target_link_options(${js_port_test} PRIVATE PUBLIC diff --git a/source/ports/rb_port/CMakeLists.txt b/source/ports/rb_port/CMakeLists.txt index 0e9e574fc..d22778818 100644 --- a/source/ports/rb_port/CMakeLists.txt +++ b/source/ports/rb_port/CMakeLists.txt @@ -237,7 +237,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${SWIG_MODULE_${target}_REAL_NAME} +target_link_options(${SWIG_MODULE_${target}_REAL_NAME} PRIVATE PUBLIC diff --git a/source/preprocessor/CMakeLists.txt b/source/preprocessor/CMakeLists.txt index e3c7016ad..a850683fc 100644 --- a/source/preprocessor/CMakeLists.txt +++ b/source/preprocessor/CMakeLists.txt @@ -179,7 +179,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/reflect/CMakeLists.txt b/source/reflect/CMakeLists.txt index 04921ad52..0131e0453 100644 --- a/source/reflect/CMakeLists.txt +++ b/source/reflect/CMakeLists.txt @@ -203,7 +203,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/scripts/extension/sum/CMakeLists.txt b/source/scripts/extension/sum/CMakeLists.txt index c076de1e1..735866c14 100644 --- a/source/scripts/extension/sum/CMakeLists.txt +++ b/source/scripts/extension/sum/CMakeLists.txt @@ -152,7 +152,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/serial/CMakeLists.txt b/source/serial/CMakeLists.txt index 9a7a5b1e1..87de042a1 100644 --- a/source/serial/CMakeLists.txt +++ b/source/serial/CMakeLists.txt @@ -158,7 +158,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/serials/metacall_serial/CMakeLists.txt b/source/serials/metacall_serial/CMakeLists.txt index 66160ee09..5a11cbc8e 100644 --- a/source/serials/metacall_serial/CMakeLists.txt +++ b/source/serials/metacall_serial/CMakeLists.txt @@ -158,7 +158,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/serials/rapid_json_serial/CMakeLists.txt b/source/serials/rapid_json_serial/CMakeLists.txt index aa2b18935..29fd739aa 100644 --- a/source/serials/rapid_json_serial/CMakeLists.txt +++ b/source/serials/rapid_json_serial/CMakeLists.txt @@ -191,7 +191,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/tests/adt_map_test/CMakeLists.txt b/source/tests/adt_map_test/CMakeLists.txt index 45bca49c8..29ae7e7e9 100644 --- a/source/tests/adt_map_test/CMakeLists.txt +++ b/source/tests/adt_map_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/adt_set_test/CMakeLists.txt b/source/tests/adt_set_test/CMakeLists.txt index 21972409d..d46b7064f 100644 --- a/source/tests/adt_set_test/CMakeLists.txt +++ b/source/tests/adt_set_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/adt_trie_test/CMakeLists.txt b/source/tests/adt_trie_test/CMakeLists.txt index 28305388b..1bac7e403 100644 --- a/source/tests/adt_trie_test/CMakeLists.txt +++ b/source/tests/adt_trie_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/adt_vector_test/CMakeLists.txt b/source/tests/adt_vector_test/CMakeLists.txt index cc085cb1b..dab9ae9a6 100644 --- a/source/tests/adt_vector_test/CMakeLists.txt +++ b/source/tests/adt_vector_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/configuration_test/CMakeLists.txt b/source/tests/configuration_test/CMakeLists.txt index e749dc9c5..c9f804954 100644 --- a/source/tests/configuration_test/CMakeLists.txt +++ b/source/tests/configuration_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/detour_test/CMakeLists.txt b/source/tests/detour_test/CMakeLists.txt index b84f0f4a5..7b722beeb 100644 --- a/source/tests/detour_test/CMakeLists.txt +++ b/source/tests/detour_test/CMakeLists.txt @@ -121,7 +121,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/dynlink_test/CMakeLists.txt b/source/tests/dynlink_test/CMakeLists.txt index 53718d407..d0e0d844d 100644 --- a/source/tests/dynlink_test/CMakeLists.txt +++ b/source/tests/dynlink_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/environment_test/CMakeLists.txt b/source/tests/environment_test/CMakeLists.txt index 7a7575d46..ec3e14449 100644 --- a/source/tests/environment_test/CMakeLists.txt +++ b/source/tests/environment_test/CMakeLists.txt @@ -107,7 +107,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/log_custom_test/CMakeLists.txt b/source/tests/log_custom_test/CMakeLists.txt index 4793ab64a..73ef1f64a 100644 --- a/source/tests/log_custom_test/CMakeLists.txt +++ b/source/tests/log_custom_test/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/log_test/CMakeLists.txt b/source/tests/log_test/CMakeLists.txt index 8fe8cca09..d3f70ddc3 100644 --- a/source/tests/log_test/CMakeLists.txt +++ b/source/tests/log_test/CMakeLists.txt @@ -109,7 +109,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt b/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt index 2d5ad256a..013b1d742 100644 --- a/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_c_lib_test/CMakeLists.txt b/source/tests/metacall_c_lib_test/CMakeLists.txt index d4d7aa561..eace7e1da 100644 --- a/source/tests/metacall_c_lib_test/CMakeLists.txt +++ b/source/tests/metacall_c_lib_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_c_test/CMakeLists.txt b/source/tests/metacall_c_test/CMakeLists.txt index 76188b304..7599f98cb 100644 --- a/source/tests/metacall_c_test/CMakeLists.txt +++ b/source/tests/metacall_c_test/CMakeLists.txt @@ -124,7 +124,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_callback_complex_test/CMakeLists.txt b/source/tests/metacall_callback_complex_test/CMakeLists.txt index c6c54a96a..00183a9c2 100644 --- a/source/tests/metacall_callback_complex_test/CMakeLists.txt +++ b/source/tests/metacall_callback_complex_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cast_test/CMakeLists.txt b/source/tests/metacall_cast_test/CMakeLists.txt index 4880ebe39..ec7b1876b 100644 --- a/source/tests/metacall_cast_test/CMakeLists.txt +++ b/source/tests/metacall_cast_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_clear_test/CMakeLists.txt b/source/tests/metacall_clear_test/CMakeLists.txt index 32591ebc4..bb461a5e9 100644 --- a/source/tests/metacall_clear_test/CMakeLists.txt +++ b/source/tests/metacall_clear_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt b/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt index 8bb9fa0bc..9c444e084 100644 --- a/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt +++ b/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt @@ -123,7 +123,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt b/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt index 1f50fb8ca..8de5b40ef 100644 --- a/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cobol_test/CMakeLists.txt b/source/tests/metacall_cobol_test/CMakeLists.txt index 1c66d2dd2..c524b462c 100644 --- a/source/tests/metacall_cobol_test/CMakeLists.txt +++ b/source/tests/metacall_cobol_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_configuration_default_test/CMakeLists.txt b/source/tests/metacall_configuration_default_test/CMakeLists.txt index 589eeb1d1..571fc6786 100644 --- a/source/tests/metacall_configuration_default_test/CMakeLists.txt +++ b/source/tests/metacall_configuration_default_test/CMakeLists.txt @@ -129,7 +129,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt index af15809f2..e63ff23b9 100644 --- a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt +++ b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_cs_test/CMakeLists.txt b/source/tests/metacall_cs_test/CMakeLists.txt index 5859e5a82..084e5f819 100644 --- a/source/tests/metacall_cs_test/CMakeLists.txt +++ b/source/tests/metacall_cs_test/CMakeLists.txt @@ -117,7 +117,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_csharp_function_test/CMakeLists.txt b/source/tests/metacall_csharp_function_test/CMakeLists.txt index e89890969..53e8df1ac 100644 --- a/source/tests/metacall_csharp_function_test/CMakeLists.txt +++ b/source/tests/metacall_csharp_function_test/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_csharp_static_class_test/CMakeLists.txt b/source/tests/metacall_csharp_static_class_test/CMakeLists.txt index 1c43f950a..9b04dac50 100644 --- a/source/tests/metacall_csharp_static_class_test/CMakeLists.txt +++ b/source/tests/metacall_csharp_static_class_test/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_depends_test/CMakeLists.txt b/source/tests/metacall_depends_test/CMakeLists.txt index 4fab09eae..ddc10ae8d 100644 --- a/source/tests/metacall_depends_test/CMakeLists.txt +++ b/source/tests/metacall_depends_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_distributable_test/CMakeLists.txt b/source/tests/metacall_distributable_test/CMakeLists.txt index 257189724..87354950d 100644 --- a/source/tests/metacall_distributable_test/CMakeLists.txt +++ b/source/tests/metacall_distributable_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ducktype_test/CMakeLists.txt b/source/tests/metacall_ducktype_test/CMakeLists.txt index 11eed7096..d092bc229 100644 --- a/source/tests/metacall_ducktype_test/CMakeLists.txt +++ b/source/tests/metacall_ducktype_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_duplicated_handle_test/CMakeLists.txt b/source/tests/metacall_duplicated_handle_test/CMakeLists.txt index 12424e225..977c38726 100644 --- a/source/tests/metacall_duplicated_handle_test/CMakeLists.txt +++ b/source/tests/metacall_duplicated_handle_test/CMakeLists.txt @@ -114,7 +114,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt b/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt index 3b17aa0ac..8ad6ff0c3 100644 --- a/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt +++ b/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_dynlink_path_test/CMakeLists.txt b/source/tests/metacall_dynlink_path_test/CMakeLists.txt index 722d234a7..70537e13e 100644 --- a/source/tests/metacall_dynlink_path_test/CMakeLists.txt +++ b/source/tests/metacall_dynlink_path_test/CMakeLists.txt @@ -115,7 +115,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ext_test/CMakeLists.txt b/source/tests/metacall_ext_test/CMakeLists.txt index b80533149..c7df0805a 100644 --- a/source/tests/metacall_ext_test/CMakeLists.txt +++ b/source/tests/metacall_ext_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_file_fail_test/CMakeLists.txt b/source/tests/metacall_file_fail_test/CMakeLists.txt index 7e8d50072..fb4c65e7b 100644 --- a/source/tests/metacall_file_fail_test/CMakeLists.txt +++ b/source/tests/metacall_file_fail_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_file_glob_test/CMakeLists.txt b/source/tests/metacall_file_glob_test/CMakeLists.txt index ae886d214..b5479a0f3 100644 --- a/source/tests/metacall_file_glob_test/CMakeLists.txt +++ b/source/tests/metacall_file_glob_test/CMakeLists.txt @@ -123,7 +123,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_file_test/CMakeLists.txt b/source/tests/metacall_file_test/CMakeLists.txt index 5f1673554..7be85a2a6 100644 --- a/source/tests/metacall_file_test/CMakeLists.txt +++ b/source/tests/metacall_file_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_fork_test/CMakeLists.txt b/source/tests/metacall_fork_test/CMakeLists.txt index 0c526d744..47d389592 100644 --- a/source/tests/metacall_fork_test/CMakeLists.txt +++ b/source/tests/metacall_fork_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_function_test/CMakeLists.txt b/source/tests/metacall_function_test/CMakeLists.txt index fbe8d14ea..2584da52b 100644 --- a/source/tests/metacall_function_test/CMakeLists.txt +++ b/source/tests/metacall_function_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_handle_export_test/CMakeLists.txt b/source/tests/metacall_handle_export_test/CMakeLists.txt index 7320e8e92..762cb174b 100644 --- a/source/tests/metacall_handle_export_test/CMakeLists.txt +++ b/source/tests/metacall_handle_export_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_handle_get_test/CMakeLists.txt b/source/tests/metacall_handle_get_test/CMakeLists.txt index 7a6576f36..73178da78 100644 --- a/source/tests/metacall_handle_get_test/CMakeLists.txt +++ b/source/tests/metacall_handle_get_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_init_fini_test/CMakeLists.txt b/source/tests/metacall_init_fini_test/CMakeLists.txt index 4b75590d1..bb1783bf3 100644 --- a/source/tests/metacall_init_fini_test/CMakeLists.txt +++ b/source/tests/metacall_init_fini_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt b/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt index 65a685801..3d0c2ffde 100644 --- a/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt b/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt index 9b19bbb70..2de694d0a 100644 --- a/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_initialize_ex_test/CMakeLists.txt b/source/tests/metacall_initialize_ex_test/CMakeLists.txt index 3aa9967e4..94332f3b4 100644 --- a/source/tests/metacall_initialize_ex_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_ex_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_initialize_test/CMakeLists.txt b/source/tests/metacall_initialize_test/CMakeLists.txt index fb1b6abfb..f8b5b901a 100644 --- a/source/tests/metacall_initialize_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_inspect_test/CMakeLists.txt b/source/tests/metacall_inspect_test/CMakeLists.txt index 3deb9cd29..ff5eaf740 100644 --- a/source/tests/metacall_inspect_test/CMakeLists.txt +++ b/source/tests/metacall_inspect_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_integration_test/CMakeLists.txt b/source/tests/metacall_integration_test/CMakeLists.txt index 7314bdebd..55b69ede2 100644 --- a/source/tests/metacall_integration_test/CMakeLists.txt +++ b/source/tests/metacall_integration_test/CMakeLists.txt @@ -117,7 +117,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_invalid_loader_test/CMakeLists.txt b/source/tests/metacall_invalid_loader_test/CMakeLists.txt index d3d16ec7a..8186d9362 100644 --- a/source/tests/metacall_invalid_loader_test/CMakeLists.txt +++ b/source/tests/metacall_invalid_loader_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_java_test/CMakeLists.txt b/source/tests/metacall_java_test/CMakeLists.txt index b1e2810fa..d9000eeb6 100644 --- a/source/tests/metacall_java_test/CMakeLists.txt +++ b/source/tests/metacall_java_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_julia_test/CMakeLists.txt b/source/tests/metacall_julia_test/CMakeLists.txt index c5f59d1e9..32dc65a6d 100644 --- a/source/tests/metacall_julia_test/CMakeLists.txt +++ b/source/tests/metacall_julia_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt b/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt index 552b2ecc2..e38ecba46 100644 --- a/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt +++ b/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_llvm_test/CMakeLists.txt b/source/tests/metacall_llvm_test/CMakeLists.txt index 31b0c3d35..76f79b68c 100644 --- a/source/tests/metacall_llvm_test/CMakeLists.txt +++ b/source/tests/metacall_llvm_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt b/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt index 9d3f8e8ab..3a6293c6d 100644 --- a/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt @@ -114,7 +114,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt b/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt index 86917f395..f38f63ffb 100644 --- a/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt b/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt index b7588a561..5d1c09042 100644 --- a/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt @@ -116,7 +116,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt b/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt index 90d3754bc..4cb9cfb73 100644 --- a/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_configuration_test/CMakeLists.txt b/source/tests/metacall_load_configuration_test/CMakeLists.txt index 04dca70c3..52f0a339f 100644 --- a/source/tests/metacall_load_configuration_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_memory_empty_test/CMakeLists.txt b/source/tests/metacall_load_memory_empty_test/CMakeLists.txt index 719056eae..18371653f 100644 --- a/source/tests/metacall_load_memory_empty_test/CMakeLists.txt +++ b/source/tests/metacall_load_memory_empty_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_load_memory_test/CMakeLists.txt b/source/tests/metacall_load_memory_test/CMakeLists.txt index 014b7823f..7e45abf25 100644 --- a/source/tests/metacall_load_memory_test/CMakeLists.txt +++ b/source/tests/metacall_load_memory_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_logs_test/CMakeLists.txt b/source/tests/metacall_logs_test/CMakeLists.txt index 514da4c48..35386f0f7 100644 --- a/source/tests/metacall_logs_test/CMakeLists.txt +++ b/source/tests/metacall_logs_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_lua_test/CMakeLists.txt b/source/tests/metacall_lua_test/CMakeLists.txt index 164aeeb3c..b9b6a62c2 100644 --- a/source/tests/metacall_lua_test/CMakeLists.txt +++ b/source/tests/metacall_lua_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_map_await_test/CMakeLists.txt b/source/tests/metacall_map_await_test/CMakeLists.txt index 7cb62f098..b36cdee47 100644 --- a/source/tests/metacall_map_await_test/CMakeLists.txt +++ b/source/tests/metacall_map_await_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_map_test/CMakeLists.txt b/source/tests/metacall_map_test/CMakeLists.txt index ffe8d92c5..6022a8abd 100644 --- a/source/tests/metacall_map_test/CMakeLists.txt +++ b/source/tests/metacall_map_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_async_multiple_test/CMakeLists.txt b/source/tests/metacall_node_async_multiple_test/CMakeLists.txt index 2e5f9a135..fe9cea8ae 100644 --- a/source/tests/metacall_node_async_multiple_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_multiple_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_async_resources_test/CMakeLists.txt b/source/tests/metacall_node_async_resources_test/CMakeLists.txt index 6fafa70d2..a3edb0a50 100644 --- a/source/tests/metacall_node_async_resources_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_resources_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_async_test/CMakeLists.txt b/source/tests/metacall_node_async_test/CMakeLists.txt index d6a4050aa..3a29a55a4 100644 --- a/source/tests/metacall_node_async_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_await_chain_test/CMakeLists.txt b/source/tests/metacall_node_await_chain_test/CMakeLists.txt index 8b15b75da..2b34facf9 100644 --- a/source/tests/metacall_node_await_chain_test/CMakeLists.txt +++ b/source/tests/metacall_node_await_chain_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_call_test/CMakeLists.txt b/source/tests/metacall_node_call_test/CMakeLists.txt index f0ac1da58..361544791 100644 --- a/source/tests/metacall_node_call_test/CMakeLists.txt +++ b/source/tests/metacall_node_call_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_callback_test/CMakeLists.txt b/source/tests/metacall_node_callback_test/CMakeLists.txt index 1249cc38e..2fa56024b 100644 --- a/source/tests/metacall_node_callback_test/CMakeLists.txt +++ b/source/tests/metacall_node_callback_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_clear_mem_test/CMakeLists.txt b/source/tests/metacall_node_clear_mem_test/CMakeLists.txt index c91655dc4..249b9066b 100644 --- a/source/tests/metacall_node_clear_mem_test/CMakeLists.txt +++ b/source/tests/metacall_node_clear_mem_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_default_export_test/CMakeLists.txt b/source/tests/metacall_node_default_export_test/CMakeLists.txt index 93468e1ad..56d39f320 100644 --- a/source/tests/metacall_node_default_export_test/CMakeLists.txt +++ b/source/tests/metacall_node_default_export_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt b/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt index 7c2922950..dbb6410c1 100644 --- a/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt +++ b/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_event_loop_test/CMakeLists.txt b/source/tests/metacall_node_event_loop_test/CMakeLists.txt index a0d1ae8ce..805dd2a9b 100644 --- a/source/tests/metacall_node_event_loop_test/CMakeLists.txt +++ b/source/tests/metacall_node_event_loop_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_exception_test/CMakeLists.txt b/source/tests/metacall_node_exception_test/CMakeLists.txt index f2a47f44e..707e52942 100644 --- a/source/tests/metacall_node_exception_test/CMakeLists.txt +++ b/source/tests/metacall_node_exception_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_extension_test/CMakeLists.txt b/source/tests/metacall_node_extension_test/CMakeLists.txt index 538385f34..1aac1018e 100644 --- a/source/tests/metacall_node_extension_test/CMakeLists.txt +++ b/source/tests/metacall_node_extension_test/CMakeLists.txt @@ -114,7 +114,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt b/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt index 9cbd47bc1..1efbefcc0 100644 --- a/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt +++ b/source/tests/metacall_node_extension_test/node_extension_test/CMakeLists.txt @@ -173,7 +173,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/IGNORE:4199> $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> diff --git a/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt b/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt index 9125c4a7b..e8310a78c 100644 --- a/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt b/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt index 0477424f8..aaed9e522 100644 --- a/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_fail_test/CMakeLists.txt b/source/tests/metacall_node_fail_test/CMakeLists.txt index fe06183eb..62fb239d4 100644 --- a/source/tests/metacall_node_fail_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_inline_test/CMakeLists.txt b/source/tests/metacall_node_inline_test/CMakeLists.txt index 9f7829362..af8f0c8b5 100644 --- a/source/tests/metacall_node_inline_test/CMakeLists.txt +++ b/source/tests/metacall_node_inline_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt b/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt index c7c06a689..6f3f91f47 100644 --- a/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt +++ b/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_native_code_test/CMakeLists.txt b/source/tests/metacall_node_native_code_test/CMakeLists.txt index 59f982c4c..31b61509e 100644 --- a/source/tests/metacall_node_native_code_test/CMakeLists.txt +++ b/source/tests/metacall_node_native_code_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_port_await_test/CMakeLists.txt b/source/tests/metacall_node_port_await_test/CMakeLists.txt index 1b87b2f23..c72587ba4 100644 --- a/source/tests/metacall_node_port_await_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_await_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt index 6fb0c363a..3c13cf6be 100644 --- a/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt @@ -128,7 +128,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_port_rs_test/CMakeLists.txt b/source/tests/metacall_node_port_rs_test/CMakeLists.txt index 081c44abc..1f4f82043 100644 --- a/source/tests/metacall_node_port_rs_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_rs_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_port_test/CMakeLists.txt b/source/tests/metacall_node_port_test/CMakeLists.txt index 2d83ab674..86dadd93d 100644 --- a/source/tests/metacall_node_port_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt b/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt index 435ed2445..6388179f7 100644 --- a/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt b/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt index 6c88f35e3..e7576cb18 100644 --- a/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_await_test/CMakeLists.txt b/source/tests/metacall_node_python_await_test/CMakeLists.txt index 09f86f6ba..2edadbea7 100644 --- a/source/tests/metacall_node_python_await_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_await_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt b/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt index 0e896b1dc..4e1fb4b71 100644 --- a/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_exception_test/CMakeLists.txt b/source/tests/metacall_node_python_exception_test/CMakeLists.txt index 49aee2178..f759a0b30 100644 --- a/source/tests/metacall_node_python_exception_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_exception_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt b/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt index 5cee029fe..105e401fc 100644 --- a/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt @@ -116,7 +116,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt b/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt index faa5e03e8..06e1e46bb 100644 --- a/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt @@ -116,7 +116,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_python_ruby_test/CMakeLists.txt b/source/tests/metacall_node_python_ruby_test/CMakeLists.txt index dbcd8c316..a9756c091 100644 --- a/source/tests/metacall_node_python_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_ruby_test/CMakeLists.txt @@ -122,7 +122,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_reentrant_test/CMakeLists.txt b/source/tests/metacall_node_reentrant_test/CMakeLists.txt index 27cdea516..a4ec68f52 100644 --- a/source/tests/metacall_node_reentrant_test/CMakeLists.txt +++ b/source/tests/metacall_node_reentrant_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_signal_handler_test/CMakeLists.txt b/source/tests/metacall_node_signal_handler_test/CMakeLists.txt index 312d29679..16e7cbd5e 100644 --- a/source/tests/metacall_node_signal_handler_test/CMakeLists.txt +++ b/source/tests/metacall_node_signal_handler_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_test/CMakeLists.txt b/source/tests/metacall_node_test/CMakeLists.txt index 3c311060a..238ccbd4c 100644 --- a/source/tests/metacall_node_test/CMakeLists.txt +++ b/source/tests/metacall_node_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_node_typescript_test/CMakeLists.txt b/source/tests/metacall_node_typescript_test/CMakeLists.txt index 4a80ab646..f0858d246 100644 --- a/source/tests/metacall_node_typescript_test/CMakeLists.txt +++ b/source/tests/metacall_node_typescript_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt index 29f56547c..f11064599 100644 --- a/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt @@ -122,7 +122,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt index a4328a9cc..fc0d79660 100644 --- a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt @@ -115,7 +115,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt index 438ce9105..20f25e9fd 100644 --- a/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_plugin_extension_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_test/CMakeLists.txt index 3b783b815..a6eead001 100644 --- a/source/tests/metacall_plugin_extension_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_async_test/CMakeLists.txt b/source/tests/metacall_python_async_test/CMakeLists.txt index 3438c0ff4..3acc0f211 100644 --- a/source/tests/metacall_python_async_test/CMakeLists.txt +++ b/source/tests/metacall_python_async_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_await_test/CMakeLists.txt b/source/tests/metacall_python_await_test/CMakeLists.txt index 9e77a645c..767eda765 100644 --- a/source/tests/metacall_python_await_test/CMakeLists.txt +++ b/source/tests/metacall_python_await_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_builtins_test/CMakeLists.txt b/source/tests/metacall_python_builtins_test/CMakeLists.txt index 8d99ccf6c..d9ca104c3 100644 --- a/source/tests/metacall_python_builtins_test/CMakeLists.txt +++ b/source/tests/metacall_python_builtins_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_callback_test/CMakeLists.txt b/source/tests/metacall_python_callback_test/CMakeLists.txt index 702009b82..4f7a4e1b3 100644 --- a/source/tests/metacall_python_callback_test/CMakeLists.txt +++ b/source/tests/metacall_python_callback_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_dict_test/CMakeLists.txt b/source/tests/metacall_python_dict_test/CMakeLists.txt index 0f08317ff..8cc1916d7 100644 --- a/source/tests/metacall_python_dict_test/CMakeLists.txt +++ b/source/tests/metacall_python_dict_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_exception_test/CMakeLists.txt b/source/tests/metacall_python_exception_test/CMakeLists.txt index 904d8a573..31109d355 100644 --- a/source/tests/metacall_python_exception_test/CMakeLists.txt +++ b/source/tests/metacall_python_exception_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_fail_test/CMakeLists.txt b/source/tests/metacall_python_fail_test/CMakeLists.txt index b8950664c..fdf0097ed 100644 --- a/source/tests/metacall_python_fail_test/CMakeLists.txt +++ b/source/tests/metacall_python_fail_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_gc_test/CMakeLists.txt b/source/tests/metacall_python_gc_test/CMakeLists.txt index 4155fec42..dea0f4ae2 100644 --- a/source/tests/metacall_python_gc_test/CMakeLists.txt +++ b/source/tests/metacall_python_gc_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_loader_port_test/CMakeLists.txt b/source/tests/metacall_python_loader_port_test/CMakeLists.txt index 63bcdad97..82bfb7529 100644 --- a/source/tests/metacall_python_loader_port_test/CMakeLists.txt +++ b/source/tests/metacall_python_loader_port_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_model_test/CMakeLists.txt b/source/tests/metacall_python_model_test/CMakeLists.txt index 86155738c..59494beac 100644 --- a/source/tests/metacall_python_model_test/CMakeLists.txt +++ b/source/tests/metacall_python_model_test/CMakeLists.txt @@ -122,7 +122,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_node_await_test/CMakeLists.txt b/source/tests/metacall_python_node_await_test/CMakeLists.txt index b4cf36b3c..9995c37e0 100644 --- a/source/tests/metacall_python_node_await_test/CMakeLists.txt +++ b/source/tests/metacall_python_node_await_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_object_class_test/CMakeLists.txt b/source/tests/metacall_python_object_class_test/CMakeLists.txt index 71dea28cf..475a515ca 100644 --- a/source/tests/metacall_python_object_class_test/CMakeLists.txt +++ b/source/tests/metacall_python_object_class_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_open_test/CMakeLists.txt b/source/tests/metacall_python_open_test/CMakeLists.txt index 8569b85cd..ce067050d 100644 --- a/source/tests/metacall_python_open_test/CMakeLists.txt +++ b/source/tests/metacall_python_open_test/CMakeLists.txt @@ -131,7 +131,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_pointer_test/CMakeLists.txt b/source/tests/metacall_python_pointer_test/CMakeLists.txt index 9c807909a..4beab7b92 100644 --- a/source/tests/metacall_python_pointer_test/CMakeLists.txt +++ b/source/tests/metacall_python_pointer_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_callback_test/CMakeLists.txt b/source/tests/metacall_python_port_callback_test/CMakeLists.txt index 6ba38e2c5..95ddf1ad7 100644 --- a/source/tests/metacall_python_port_callback_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_callback_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_https_test/CMakeLists.txt b/source/tests/metacall_python_port_https_test/CMakeLists.txt index 961f0af9a..fa4127119 100644 --- a/source/tests/metacall_python_port_https_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_https_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_import_test/CMakeLists.txt b/source/tests/metacall_python_port_import_test/CMakeLists.txt index 285dea5cc..8d1d94f1c 100644 --- a/source/tests/metacall_python_port_import_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_import_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_pointer_test/CMakeLists.txt b/source/tests/metacall_python_port_pointer_test/CMakeLists.txt index 55188da8f..463a4e5b6 100644 --- a/source/tests/metacall_python_port_pointer_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_pointer_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_port_test/CMakeLists.txt b/source/tests/metacall_python_port_test/CMakeLists.txt index 1caa130fa..431379d4a 100644 --- a/source/tests/metacall_python_port_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_test/CMakeLists.txt @@ -113,7 +113,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_reentrant_test/CMakeLists.txt b/source/tests/metacall_python_reentrant_test/CMakeLists.txt index f196c4f9d..8f6a82e07 100644 --- a/source/tests/metacall_python_reentrant_test/CMakeLists.txt +++ b/source/tests/metacall_python_reentrant_test/CMakeLists.txt @@ -114,7 +114,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_relative_path_test/CMakeLists.txt b/source/tests/metacall_python_relative_path_test/CMakeLists.txt index e6ddb6028..2a5ad0ff8 100644 --- a/source/tests/metacall_python_relative_path_test/CMakeLists.txt +++ b/source/tests/metacall_python_relative_path_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_test/CMakeLists.txt b/source/tests/metacall_python_test/CMakeLists.txt index 77631a1fe..5fb1bec57 100644 --- a/source/tests/metacall_python_test/CMakeLists.txt +++ b/source/tests/metacall_python_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_varargs_test/CMakeLists.txt b/source/tests/metacall_python_varargs_test/CMakeLists.txt index 9143fc44e..bae80e62d 100644 --- a/source/tests/metacall_python_varargs_test/CMakeLists.txt +++ b/source/tests/metacall_python_varargs_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt b/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt index 1a100f4ad..9e871cf89 100644 --- a/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt +++ b/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_python_without_functions_test/CMakeLists.txt b/source/tests/metacall_python_without_functions_test/CMakeLists.txt index 540595104..a4f92966a 100644 --- a/source/tests/metacall_python_without_functions_test/CMakeLists.txt +++ b/source/tests/metacall_python_without_functions_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_reinitialize_test/CMakeLists.txt b/source/tests/metacall_reinitialize_test/CMakeLists.txt index f57b6b85f..73beda512 100644 --- a/source/tests/metacall_reinitialize_test/CMakeLists.txt +++ b/source/tests/metacall_reinitialize_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_reload_functions_test/CMakeLists.txt b/source/tests/metacall_reload_functions_test/CMakeLists.txt index 4474e902e..4398e0a2d 100644 --- a/source/tests/metacall_reload_functions_test/CMakeLists.txt +++ b/source/tests/metacall_reload_functions_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_return_monad_test/CMakeLists.txt b/source/tests/metacall_return_monad_test/CMakeLists.txt index 91874ed62..54f90028d 100644 --- a/source/tests/metacall_return_monad_test/CMakeLists.txt +++ b/source/tests/metacall_return_monad_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rpc_test/CMakeLists.txt b/source/tests/metacall_rpc_test/CMakeLists.txt index 8fef52d0f..091cd4196 100644 --- a/source/tests/metacall_rpc_test/CMakeLists.txt +++ b/source/tests/metacall_rpc_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt b/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt index 1fe56e79a..4503b7df1 100644 --- a/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_fail_test/CMakeLists.txt b/source/tests/metacall_ruby_fail_test/CMakeLists.txt index 211d238b3..7211d396e 100644 --- a/source/tests/metacall_ruby_fail_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_fail_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_object_class_test/CMakeLists.txt b/source/tests/metacall_ruby_object_class_test/CMakeLists.txt index fc9e50765..50908e439 100644 --- a/source/tests/metacall_ruby_object_class_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_object_class_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt b/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt index e933746a3..49a899ecf 100644 --- a/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt b/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt index 3f19f74b4..a2afac751 100644 --- a/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt @@ -118,7 +118,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_ruby_test/CMakeLists.txt b/source/tests/metacall_ruby_test/CMakeLists.txt index 267af49c8..41d084aad 100644 --- a/source/tests/metacall_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_class_test/CMakeLists.txt b/source/tests/metacall_rust_class_test/CMakeLists.txt index c968d3174..dd529756f 100644 --- a/source/tests/metacall_rust_class_test/CMakeLists.txt +++ b/source/tests/metacall_rust_class_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt index 46488ba4d..efcfafdcb 100644 --- a/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt index 757198c39..33b0b2909 100644 --- a/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt index 3b47f2f3e..3f9d02f86 100644 --- a/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt index c77fcfa35..e46e552dd 100644 --- a/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_rust_test/CMakeLists.txt b/source/tests/metacall_rust_test/CMakeLists.txt index 543fac1de..9b0cfc8b3 100644 --- a/source/tests/metacall_rust_test/CMakeLists.txt +++ b/source/tests/metacall_rust_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt b/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt index 351a271b7..67732e310 100644 --- a/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt @@ -127,7 +127,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_test/CMakeLists.txt b/source/tests/metacall_test/CMakeLists.txt index 932f43008..4d75fe9b7 100644 --- a/source/tests/metacall_test/CMakeLists.txt +++ b/source/tests/metacall_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_call_map_test/CMakeLists.txt b/source/tests/metacall_typescript_call_map_test/CMakeLists.txt index 55f940a6f..46f491804 100644 --- a/source/tests/metacall_typescript_call_map_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_call_map_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt b/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt index 1f88419a8..a41409a5b 100644 --- a/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_node_test/CMakeLists.txt b/source/tests/metacall_typescript_node_test/CMakeLists.txt index ba02a30ff..95954f202 100644 --- a/source/tests/metacall_typescript_node_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_node_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_require_test/CMakeLists.txt b/source/tests/metacall_typescript_require_test/CMakeLists.txt index 7ac9c1033..2e1e327bd 100644 --- a/source/tests/metacall_typescript_require_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_require_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_test/CMakeLists.txt b/source/tests/metacall_typescript_test/CMakeLists.txt index 92ac58a70..1ad8d87d3 100644 --- a/source/tests/metacall_typescript_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt b/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt index f88d202b5..59789903b 100644 --- a/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_typescript_tsx_test/CMakeLists.txt b/source/tests/metacall_typescript_tsx_test/CMakeLists.txt index 2f1c5273f..b6732071c 100644 --- a/source/tests/metacall_typescript_tsx_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_tsx_test/CMakeLists.txt @@ -111,7 +111,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_version_test/CMakeLists.txt b/source/tests/metacall_version_test/CMakeLists.txt index 1b89dd1e8..8b3465541 100644 --- a/source/tests/metacall_version_test/CMakeLists.txt +++ b/source/tests/metacall_version_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_wasm_python_port_test/CMakeLists.txt b/source/tests/metacall_wasm_python_port_test/CMakeLists.txt index e179a04e1..09c1efe10 100644 --- a/source/tests/metacall_wasm_python_port_test/CMakeLists.txt +++ b/source/tests/metacall_wasm_python_port_test/CMakeLists.txt @@ -112,7 +112,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/metacall_wasm_test/CMakeLists.txt b/source/tests/metacall_wasm_test/CMakeLists.txt index 8a928bef8..5aeb8ca0a 100644 --- a/source/tests/metacall_wasm_test/CMakeLists.txt +++ b/source/tests/metacall_wasm_test/CMakeLists.txt @@ -110,7 +110,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/portability_path_test/CMakeLists.txt b/source/tests/portability_path_test/CMakeLists.txt index ea98857af..37274fd9e 100644 --- a/source/tests/portability_path_test/CMakeLists.txt +++ b/source/tests/portability_path_test/CMakeLists.txt @@ -105,7 +105,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/preprocessor_test/CMakeLists.txt b/source/tests/preprocessor_test/CMakeLists.txt index 17efabee8..68470eab2 100644 --- a/source/tests/preprocessor_test/CMakeLists.txt +++ b/source/tests/preprocessor_test/CMakeLists.txt @@ -106,7 +106,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/rb_loader_parser_test/CMakeLists.txt b/source/tests/rb_loader_parser_test/CMakeLists.txt index 30cb37c5a..4e6162aa5 100644 --- a/source/tests/rb_loader_parser_test/CMakeLists.txt +++ b/source/tests/rb_loader_parser_test/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_function_test/CMakeLists.txt b/source/tests/reflect_function_test/CMakeLists.txt index 202dca6ac..9beb3781a 100644 --- a/source/tests/reflect_function_test/CMakeLists.txt +++ b/source/tests/reflect_function_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_metadata_test/CMakeLists.txt b/source/tests/reflect_metadata_test/CMakeLists.txt index 07291ac50..37e635bc6 100644 --- a/source/tests/reflect_metadata_test/CMakeLists.txt +++ b/source/tests/reflect_metadata_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_object_class_test/CMakeLists.txt b/source/tests/reflect_object_class_test/CMakeLists.txt index 14d331f17..77f837183 100644 --- a/source/tests/reflect_object_class_test/CMakeLists.txt +++ b/source/tests/reflect_object_class_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_scope_test/CMakeLists.txt b/source/tests/reflect_scope_test/CMakeLists.txt index dfb712094..0a4bd718c 100644 --- a/source/tests/reflect_scope_test/CMakeLists.txt +++ b/source/tests/reflect_scope_test/CMakeLists.txt @@ -119,7 +119,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/reflect_value_cast_test/CMakeLists.txt b/source/tests/reflect_value_cast_test/CMakeLists.txt index 616715e7f..46e51f3ae 100644 --- a/source/tests/reflect_value_cast_test/CMakeLists.txt +++ b/source/tests/reflect_value_cast_test/CMakeLists.txt @@ -125,7 +125,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/tests/serial_test/CMakeLists.txt b/source/tests/serial_test/CMakeLists.txt index eb56ea1e1..8b32df06a 100644 --- a/source/tests/serial_test/CMakeLists.txt +++ b/source/tests/serial_test/CMakeLists.txt @@ -124,7 +124,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} ) diff --git a/source/threading/CMakeLists.txt b/source/threading/CMakeLists.txt index 7486dced9..830545d85 100644 --- a/source/threading/CMakeLists.txt +++ b/source/threading/CMakeLists.txt @@ -178,7 +178,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC diff --git a/source/version/CMakeLists.txt b/source/version/CMakeLists.txt index 235dd1e3a..ff0bed815 100644 --- a/source/version/CMakeLists.txt +++ b/source/version/CMakeLists.txt @@ -151,7 +151,7 @@ target_compile_options(${target} # Linker options # -add_link_options(${target} +target_link_options(${target} PRIVATE PUBLIC From 0a19cc732b67d686752b5fd49e74f1daffa6b39c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 23:37:46 +0100 Subject: [PATCH 176/487] Remove googletest. --- tools/metacall-environment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 64982d14e..4df23f6ad 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -110,7 +110,7 @@ sub_base(){ $SUDO_CMD apk add --no-cache g++ make git cmake gtest-dev wget gnupg ca-certificates fi elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then - brew install llvm cmake git googletest wget gnupg ca-certificates + brew install llvm cmake git wget gnupg ca-certificates # googletest fi } From 30ac8a9b9f54bbbc80226ddb2b1c5c73e9a87fa1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 23:43:50 +0100 Subject: [PATCH 177/487] Add debug info for build. --- tools/metacall-build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/metacall-build.sh b/tools/metacall-build.sh index d2074c1af..196bdfb64 100755 --- a/tools/metacall-build.sh +++ b/tools/metacall-build.sh @@ -73,6 +73,9 @@ sub_build() { # Build the project make -j$(getconf _NPROCESSORS_ONLN) + # Debug the make output + ls -la + # Tests (coverage needs to run the tests) if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE From a36aa9166d3d4ef94433546f8f63451c2dcad007 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Feb 2025 23:59:11 +0100 Subject: [PATCH 178/487] Remove gtest. --- tools/metacall-environment.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 4df23f6ad..92cbd780f 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -104,13 +104,13 @@ sub_base(){ if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then if [ "${LINUX_DISTRO}" = "debian" ] || [ "${LINUX_DISTRO}" = "ubuntu" ]; then $SUDO_CMD apt-get update - $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends build-essential git cmake libgtest-dev wget apt-utils apt-transport-https gnupg dirmngr ca-certificates + $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends build-essential git cmake wget apt-utils apt-transport-https gnupg dirmngr ca-certificates elif [ "${LINUX_DISTRO}" = "alpine" ]; then $SUDO_CMD apk update - $SUDO_CMD apk add --no-cache g++ make git cmake gtest-dev wget gnupg ca-certificates + $SUDO_CMD apk add --no-cache g++ make git cmake wget gnupg ca-certificates fi elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then - brew install llvm cmake git wget gnupg ca-certificates # googletest + brew install llvm cmake git wget gnupg ca-certificates fi } From 3f8ecf50c78c894e1f72585b763e66ebdc6237a8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 00:07:17 +0100 Subject: [PATCH 179/487] Add more debug macos. --- tools/metacall-build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/metacall-build.sh b/tools/metacall-build.sh index 196bdfb64..4796146df 100755 --- a/tools/metacall-build.sh +++ b/tools/metacall-build.sh @@ -75,6 +75,7 @@ sub_build() { # Debug the make output ls -la + find . -name "*funchook*" # Tests (coverage needs to run the tests) if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then From fbb2aa7d202b7ab4d2343e5978cefffe208ffa46 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 00:20:14 +0100 Subject: [PATCH 180/487] Solve issues with libfunchook. --- source/detours/funchook_detour/CMakeLists.txt | 13 ++++++++++--- tools/metacall-build.sh | 4 ---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index afd225e3d..d50fcb4ae 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -33,12 +33,11 @@ if(WIN32) set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") else() set(FUNCHOOK_BUILD_TARGET "install") - set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/lib/libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_LIBRARY_DIR}") endif() set(FUNCHOOK_INSTALL_DIR "${PROJECT_OUTPUT_DIR}") -set(FUNCHOOK_CMAKE_INSTALL_BINDIR "${PROJECT_OUTPUT_DIR}") set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include") ExternalProject_Add(${target_depends} @@ -46,7 +45,15 @@ ExternalProject_Add(${target_depends} SOURCE_DIR ${FUNCHOOK_SOURCE_DIR} INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" - CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_INSTALL_BINDIR=${FUNCHOOK_CMAKE_INSTALL_BINDIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . + CMAKE_ARGS + -G "${CMAKE_GENERATOR}" + -DCMAKE_BUILD_PARALLEL_LEVEL=1 + -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON + -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DFUNCHOOK_BUILD_SHARED=ON + -DFUNCHOOK_BUILD_TESTS=OFF + -DFUNCHOOK_BUILD_STATIC=OFF BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} UPDATE_COMMAND "" BUILD_IN_SOURCE ON diff --git a/tools/metacall-build.sh b/tools/metacall-build.sh index 4796146df..d2074c1af 100755 --- a/tools/metacall-build.sh +++ b/tools/metacall-build.sh @@ -73,10 +73,6 @@ sub_build() { # Build the project make -j$(getconf _NPROCESSORS_ONLN) - # Debug the make output - ls -la - find . -name "*funchook*" - # Tests (coverage needs to run the tests) if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE From 04220ad5b038da8263aa4015598363daa83213eb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 00:34:39 +0100 Subject: [PATCH 181/487] Solve more issues funchook. --- source/detours/funchook_detour/CMakeLists.txt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index d50fcb4ae..7811dce8b 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -45,15 +45,7 @@ ExternalProject_Add(${target_depends} SOURCE_DIR ${FUNCHOOK_SOURCE_DIR} INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" - CMAKE_ARGS - -G "${CMAKE_GENERATOR}" - -DCMAKE_BUILD_PARALLEL_LEVEL=1 - -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON - -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DFUNCHOOK_BUILD_SHARED=ON - -DFUNCHOOK_BUILD_TESTS=OFF - -DFUNCHOOK_BUILD_STATIC=OFF + CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} UPDATE_COMMAND "" BUILD_IN_SOURCE ON From 837033273b640d6771389171c90b120e0878576b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 00:49:02 +0100 Subject: [PATCH 182/487] Solving issues funchook. --- source/detours/funchook_detour/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index 7811dce8b..bf9ba843d 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -33,7 +33,7 @@ if(WIN32) set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") else() set(FUNCHOOK_BUILD_TARGET "install") - set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/lib/libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_LIBRARY_DIR}") endif() @@ -43,10 +43,10 @@ set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include") ExternalProject_Add(${target_depends} PREFIX funchook SOURCE_DIR ${FUNCHOOK_SOURCE_DIR} - INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} + # INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . - BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} + BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" # --target ${FUNCHOOK_BUILD_TARGET} UPDATE_COMMAND "" BUILD_IN_SOURCE ON LOG_DOWNLOAD ON From 49fb30a6ea18e7aef960618e3be85cf4b52a2b91 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 01:02:59 +0100 Subject: [PATCH 183/487] Solving funchook. --- source/detours/funchook_detour/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index bf9ba843d..6291f09db 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -46,7 +46,7 @@ ExternalProject_Add(${target_depends} # INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . - BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" # --target ${FUNCHOOK_BUILD_TARGET} + BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" UPDATE_COMMAND "" BUILD_IN_SOURCE ON LOG_DOWNLOAD ON From bebf51eaa80d2ba77c136930a01eca0474a3b69d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 01:10:18 +0100 Subject: [PATCH 184/487] Disable install. --- source/detours/funchook_detour/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index 6291f09db..eceb90a5e 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -46,7 +46,7 @@ ExternalProject_Add(${target_depends} # INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . - BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" + BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} # && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" UPDATE_COMMAND "" BUILD_IN_SOURCE ON LOG_DOWNLOAD ON From 74899d377d062d3c5aec490f6e329d43ef849634 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 01:10:55 +0100 Subject: [PATCH 185/487] Disable install 2. --- source/detours/funchook_detour/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index eceb90a5e..de2c1f55b 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -43,10 +43,10 @@ set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include") ExternalProject_Add(${target_depends} PREFIX funchook SOURCE_DIR ${FUNCHOOK_SOURCE_DIR} - # INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} + INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . - BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} # && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" + BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" UPDATE_COMMAND "" BUILD_IN_SOURCE ON LOG_DOWNLOAD ON From 1b881169d96c063a157c2ce5f92d2929a21a3868 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 01:28:32 +0100 Subject: [PATCH 186/487] Trying something. --- source/detours/funchook_detour/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index de2c1f55b..837487fd6 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -46,7 +46,7 @@ ExternalProject_Add(${target_depends} INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . - BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" + BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} # && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" UPDATE_COMMAND "" BUILD_IN_SOURCE ON LOG_DOWNLOAD ON From a07199a5ac0f88a0b87a12b64d7b9cd6f791ec30 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 01:42:50 +0100 Subject: [PATCH 187/487] Solving issues funchook. --- source/detours/funchook_detour/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index 837487fd6..bb17e9612 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -30,14 +30,17 @@ set(FUNCHOOK_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/funchook/src/funchook") if(WIN32) set(FUNCHOOK_BUILD_TARGET "INSTALL") set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/funchook_dll.${FUNCHOOK_LIBRARY_SUFFIX}") - set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") + set(FUNCHOOK_LIBRARY_INSTALL_NAME "funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") + set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") else() set(FUNCHOOK_BUILD_TARGET "install") - set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_INSTALL_NAME "libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_LIBRARY_DIR}") endif() set(FUNCHOOK_INSTALL_DIR "${PROJECT_OUTPUT_DIR}") +set(FUNCHOOK_LIBRARY "${FUNCHOOK_INSTALL_DIR}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include") ExternalProject_Add(${target_depends} @@ -46,7 +49,8 @@ ExternalProject_Add(${target_depends} INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . - BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target ${FUNCHOOK_BUILD_TARGET} # && ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" + BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" UPDATE_COMMAND "" BUILD_IN_SOURCE ON LOG_DOWNLOAD ON @@ -174,7 +178,7 @@ target_include_directories(${target} target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - ${FUNCHOOK_LIBRARY_DIR} # FuncHook libraries + ${FUNCHOOK_LIBRARY} # FuncHook libraries PUBLIC ${DEFAULT_LIBRARIES} @@ -228,7 +232,7 @@ target_link_options(${target} # Dependency install(FILES - ${FUNCHOOK_LIBRARY_INSTALL_DIR} + ${FUNCHOOK_LIBRARY} DESTINATION ${INSTALL_LIB} COMPONENT runtime ) From 7cb91d1b489d10fe9efb98a247f6d2af407f01bb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 17:10:44 +0100 Subject: [PATCH 188/487] Testing platform ci. --- .github/workflows/docker-hub-platform.yml | 239 +++++++++++----------- 1 file changed, 120 insertions(+), 119 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index b3d706e38..88100ac34 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -20,127 +20,127 @@ env: BUILDKIT_VERSION: 0.13.0 jobs: - build: - name: Build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - platform: - - linux/amd64 - - linux/386 - - linux/arm64 - - linux/riscv64 - - linux/ppc64le - - linux/s390x - - linux/arm/v7 - - linux/arm/v6 - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - version: v${{ env.BUILDKIT_VERSION }} - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Build MetaCall Docker Images - env: - METACALL_PLATFORM: ${{ matrix.platform }} - run: | - ./docker-compose.sh platform - - - name: Tag Platform Images - run: | - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - echo "Platform Tag: ${platform_tag}" - for tag in "deps" "dev" "runtime" "cli"; do - docker tag metacall/${IMAGE_NAME}:${tag} \ - ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} - done - - - name: Push Platform Images - run: | - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - for tag in "deps" "dev" "runtime" "cli"; do - echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" - docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} - done - - - name: Run Tests - run: | - set -exuo pipefail - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - cat <<EOF > Dockerfile.test - FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} - RUN echo "console.log('abcde')" > script.js - RUN metacallcli script.js - EOF - - docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . - docker run --rm --platform=${{ matrix.platform }} test-image - - manifest: - name: Create and Push Manifest Lists - needs: build - runs-on: ubuntu-latest - steps: - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Create and Push Manifest Lists - run: | - for tag in "deps" "dev" "runtime" "cli"; do - echo "Creating manifest for tag: $tag" - platform_tags="" - for platform in "linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6"; do - platform_tag=$(echo "${platform}" | tr '/' '-') - platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" - done - echo "Creating manifest with tags: ${platform_tags}" - docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} ${platform_tags} --amend - docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} - done - - - name: Create Version Specific Tags - if: startsWith(github.ref, 'refs/tags/') - run: | - VERSION=${GITHUB_REF#refs/tags/v} - tags=("deps" "dev" "runtime" "cli") - platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") - for tag in "${tags[@]}"; do - platform_tags="" - for platform in "${platforms[@]}"; do - platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform}" - done - docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend - docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} - done - - cli_platform_tags="" - for platform in ${{ matrix.platform }}; do - cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform}" - done - docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend - docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest + # build: + # name: Build + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # platform: + # - linux/amd64 + # - linux/386 + # - linux/arm64 + # - linux/riscv64 + # - linux/ppc64le + # - linux/s390x + # - linux/arm/v7 + # - linux/arm/v6 + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + + # - name: Set up Docker BuildX + # uses: docker/setup-buildx-action@v3 + # with: + # version: v${{ env.BUILDKIT_VERSION }} + + # - name: Login to Docker Hub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKER_HUB_USERNAME }} + # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + # - name: Build MetaCall Docker Images + # env: + # METACALL_PLATFORM: ${{ matrix.platform }} + # run: | + # ./docker-compose.sh platform + + # - name: Tag Platform Images + # run: | + # platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + # echo "Platform Tag: ${platform_tag}" + # for tag in "deps" "dev" "runtime" "cli"; do + # docker tag metacall/${IMAGE_NAME}:${tag} \ + # ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + # done + + # - name: Push Platform Images + # run: | + # platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + # for tag in "deps" "dev" "runtime" "cli"; do + # echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" + # docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + # done + + # - name: Run Tests + # run: | + # set -exuo pipefail + # platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + # cat <<EOF > Dockerfile.test + # FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} + # RUN echo "console.log('abcde')" > script.js + # RUN metacallcli script.js + # EOF + + # docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . + # docker run --rm --platform=${{ matrix.platform }} test-image + + # manifest: + # name: Create and Push Manifest Lists + # needs: build + # runs-on: ubuntu-latest + # steps: + # - name: Login to Docker Hub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKER_HUB_USERNAME }} + # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + # - name: Create and Push Manifest Lists + # run: | + # for tag in "deps" "dev" "runtime" "cli"; do + # echo "Creating manifest for tag: $tag" + # platform_tags="" + # for platform in "linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6"; do + # platform_tag=$(echo "${platform}" | tr '/' '-') + # platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" + # done + # echo "Creating manifest with tags: ${platform_tags}" + # docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} ${platform_tags} --amend + # docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} + # done + + # - name: Create Version Specific Tags + # if: startsWith(github.ref, 'refs/tags/') + # run: | + # VERSION=${GITHUB_REF#refs/tags/v} + # tags=("deps" "dev" "runtime" "cli") + # platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + # for tag in "${tags[@]}"; do + # platform_tags="" + # for platform in "${platforms[@]}"; do + # platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform}" + # done + # docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend + # docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} + # done + + # cli_platform_tags="" + # for platform in ${{ matrix.platform }}; do + # cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform}" + # done + # docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend + # docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest cleanup: name: Cleanup Platform Specific Tags - needs: [build, manifest] + # needs: [build, manifest] runs-on: ubuntu-latest if: always() steps: @@ -153,9 +153,10 @@ jobs: for tag in "${tags[@]}"; do tag_to_delete="${tag}-${platform}" echo "Deleting tag: ${tag_to_delete}" + echo "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" curl -X DELETE \ - -u "${{ secrets.DOCKER_HUB_USERNAME }}:${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.DOCKER_HUB_ACCESS_TOKEN_DELETE }}" \ "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" done done From cd131792ee400948343b24fb78cc2ff15aac168d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 17:25:52 +0100 Subject: [PATCH 189/487] Enabled github platform. --- .github/workflows/docker-hub-platform.yml | 236 +++++++++++----------- 1 file changed, 118 insertions(+), 118 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index 88100ac34..6a004d1eb 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -20,127 +20,127 @@ env: BUILDKIT_VERSION: 0.13.0 jobs: - # build: - # name: Build - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # matrix: - # platform: - # - linux/amd64 - # - linux/386 - # - linux/arm64 - # - linux/riscv64 - # - linux/ppc64le - # - linux/s390x - # - linux/arm/v7 - # - linux/arm/v6 - # steps: - # - name: Checkout Repository - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - - # - name: Set up Docker BuildX - # uses: docker/setup-buildx-action@v3 - # with: - # version: v${{ env.BUILDKIT_VERSION }} - - # - name: Login to Docker Hub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKER_HUB_USERNAME }} - # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - # - name: Build MetaCall Docker Images - # env: - # METACALL_PLATFORM: ${{ matrix.platform }} - # run: | - # ./docker-compose.sh platform - - # - name: Tag Platform Images - # run: | - # platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - # echo "Platform Tag: ${platform_tag}" - # for tag in "deps" "dev" "runtime" "cli"; do - # docker tag metacall/${IMAGE_NAME}:${tag} \ - # ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} - # done - - # - name: Push Platform Images - # run: | - # platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - # for tag in "deps" "dev" "runtime" "cli"; do - # echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" - # docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} - # done - - # - name: Run Tests - # run: | - # set -exuo pipefail - # platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - # cat <<EOF > Dockerfile.test - # FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} - # RUN echo "console.log('abcde')" > script.js - # RUN metacallcli script.js - # EOF - - # docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . - # docker run --rm --platform=${{ matrix.platform }} test-image - - # manifest: - # name: Create and Push Manifest Lists - # needs: build - # runs-on: ubuntu-latest - # steps: - # - name: Login to Docker Hub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKER_HUB_USERNAME }} - # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - # - name: Create and Push Manifest Lists - # run: | - # for tag in "deps" "dev" "runtime" "cli"; do - # echo "Creating manifest for tag: $tag" - # platform_tags="" - # for platform in "linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6"; do - # platform_tag=$(echo "${platform}" | tr '/' '-') - # platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" - # done - # echo "Creating manifest with tags: ${platform_tags}" - # docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} ${platform_tags} --amend - # docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} - # done - - # - name: Create Version Specific Tags - # if: startsWith(github.ref, 'refs/tags/') - # run: | - # VERSION=${GITHUB_REF#refs/tags/v} - # tags=("deps" "dev" "runtime" "cli") - # platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") - # for tag in "${tags[@]}"; do - # platform_tags="" - # for platform in "${platforms[@]}"; do - # platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform}" - # done - # docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend - # docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} - # done - - # cli_platform_tags="" - # for platform in ${{ matrix.platform }}; do - # cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform}" - # done - # docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend - # docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest + build: + name: Build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/386 + - linux/arm64 + - linux/riscv64 + - linux/ppc64le + - linux/s390x + - linux/arm/v7 + - linux/arm/v6 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + version: v${{ env.BUILDKIT_VERSION }} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build MetaCall Docker Images + env: + METACALL_PLATFORM: ${{ matrix.platform }} + run: | + ./docker-compose.sh platform + + - name: Tag Platform Images + run: | + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + echo "Platform Tag: ${platform_tag}" + for tag in "deps" "dev" "runtime" "cli"; do + docker tag metacall/${IMAGE_NAME}:${tag} \ + ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + done + + - name: Push Platform Images + run: | + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + for tag in "deps" "dev" "runtime" "cli"; do + echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" + docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + done + + - name: Run Tests + run: | + set -exuo pipefail + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + cat <<EOF > Dockerfile.test + FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} + RUN echo "console.log('abcde')" > script.js + RUN metacallcli script.js + EOF + + docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . + docker run --rm --platform=${{ matrix.platform }} test-image + + manifest: + name: Create and Push Manifest Lists + needs: build + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Create and Push Manifest Lists + run: | + for tag in "deps" "dev" "runtime" "cli"; do + echo "Creating manifest for tag: $tag" + platform_tags="" + for platform in "linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" + done + echo "Creating manifest with tags: ${platform_tags}" + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} + done + + - name: Create Version Specific Tags + if: startsWith(github.ref, 'refs/tags/') + run: | + VERSION=${GITHUB_REF#refs/tags/v} + tags=("deps" "dev" "runtime" "cli") + platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + for tag in "${tags[@]}"; do + platform_tags="" + for platform in "${platforms[@]}"; do + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} + done + + cli_platform_tags="" + for platform in ${{ matrix.platform }}; do + cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest cleanup: name: Cleanup Platform Specific Tags - # needs: [build, manifest] + needs: [build, manifest] runs-on: ubuntu-latest if: always() steps: From 53620afdbf158b9be6451670cf724446d11cef60 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 21:55:54 +0100 Subject: [PATCH 190/487] Add dynamic detection of asan paths. --- cmake/CompileOptions.cmake | 40 +++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index a5610945c..0dad28d80 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -149,17 +149,51 @@ else() set(SANITIZER_COMPILE_DEFINITIONS) endif() +function(find_sanitizer NAME LINK_OPTION) + string(TOUPPER "${NAME}" NAME_UPPER) + set(SANITIZER_PROGRAM_CODE "int main() {return 0;}") + message(STATUS "${CMAKE_CURRENT_BINARY_DIR}/sanitizer_locate.cpp") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/sanitizer_locate.cpp" "${SANITIZER_PROGRAM_CODE}") + + try_compile( + STATUS + ${PROJECT_OUTPUT_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/sanitizer_locate.cpp + OUTPUT_VARIABLE SANITIZER_COMPILER_OUTPUT + LINK_OPTIONS ${LINK_OPTION} + COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/sanitizer_locate + ) + + if(NOT STATUS) + message(FATAL_ERROR "Could not find location for lib${NAME}: ${SANITIZER_COMPILER_OUTPUT}") + return() + endif() + + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES ${CMAKE_CURRENT_BINARY_DIR}/sanitizer_locate + RESOLVED_DEPENDENCIES_VAR SANITIZER_PROGRAM_LIBRARIES + ) + + foreach(DEPENDENCY IN LISTS SANITIZER_PROGRAM_LIBRARIES) + string(FIND "${DEPENDENCY}" "${NAME}" POSITION) + if(POSITION GREATER -1) + set(LIB${NAME_UPPER}_PATH "${DEPENDENCY}" PARENT_SCOPE) + return() + endif() + endforeach() +endfunction() + if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") if(OPTION_BUILD_THREAD_SANITIZER) - execute_process(COMMAND ${CMAKE_C_COMPILER} -print-file-name=libtsan${CMAKE_SHARED_LIBRARY_SUFFIX} OUTPUT_VARIABLE LIBTSAN_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) + find_sanitizer(tsan -fsanitize=thread) set(SANITIZER_LIBRARIES_PATH "${LIBTSAN_PATH}" ) elseif(OPTION_BUILD_MEMORY_SANITIZER) set(SANITIZER_LIBRARIES_PATH) # TODO elseif(OPTION_BUILD_ADDRESS_SANITIZER) - execute_process(COMMAND ${CMAKE_C_COMPILER} -print-file-name=libasan${CMAKE_SHARED_LIBRARY_SUFFIX} OUTPUT_VARIABLE LIBASAN_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND ${CMAKE_C_COMPILER} -print-file-name=libubsan${CMAKE_SHARED_LIBRARY_SUFFIX} OUTPUT_VARIABLE LIBUBSAN_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) + find_sanitizer(asan -fsanitize=address) + find_sanitizer(ubsan -fsanitize=undefined) set(SANITIZER_LIBRARIES_PATH "${LIBASAN_PATH}" "${LIBUBSAN_PATH}" From f8c7b4cfd958f98fe5ecad1e94ee4c2502caca5e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 26 Feb 2025 22:44:21 +0100 Subject: [PATCH 191/487] Solve issues on funchook windows. --- cmake/CompileOptions.cmake | 1 - source/detours/funchook_detour/CMakeLists.txt | 13 ++++++++----- source/loaders/node_loader/CMakeLists.txt | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index 0dad28d80..e72d648a1 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -152,7 +152,6 @@ endif() function(find_sanitizer NAME LINK_OPTION) string(TOUPPER "${NAME}" NAME_UPPER) set(SANITIZER_PROGRAM_CODE "int main() {return 0;}") - message(STATUS "${CMAKE_CURRENT_BINARY_DIR}/sanitizer_locate.cpp") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/sanitizer_locate.cpp" "${SANITIZER_PROGRAM_CODE}") try_compile( diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index bb17e9612..2f953a411 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -29,18 +29,21 @@ set(FUNCHOOK_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/funchook/src/funchook") if(WIN32) set(FUNCHOOK_BUILD_TARGET "INSTALL") - set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/funchook_dll.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_NAME "funchook_dll.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${FUNCHOOK_LIBRARY_NAME}") set(FUNCHOOK_LIBRARY_INSTALL_NAME "funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") else() set(FUNCHOOK_BUILD_TARGET "install") - set(FUNCHOOK_LIBRARY_INSTALL_NAME "libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") - set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") + set(FUNCHOOK_LIBRARY_NAME "libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") + set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_NAME}") + set(FUNCHOOK_LIBRARY_INSTALL_NAME "${FUNCHOOK_LIBRARY_NAME}") set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_LIBRARY_DIR}") endif() set(FUNCHOOK_INSTALL_DIR "${PROJECT_OUTPUT_DIR}") -set(FUNCHOOK_LIBRARY "${FUNCHOOK_INSTALL_DIR}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") +set(FUNCHOOK_LIBRARY "${PROJECT_OUTPUT_DIR}/${FUNCHOOK_LIBRARY_NAME}") +set(FUNCHOOK_LIBRARY_INSTALL "${PROJECT_OUTPUT_DIR}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include") ExternalProject_Add(${target_depends} @@ -232,7 +235,7 @@ target_link_options(${target} # Dependency install(FILES - ${FUNCHOOK_LIBRARY} + ${FUNCHOOK_LIBRARY_INSTALL} DESTINATION ${INSTALL_LIB} COMPONENT runtime ) diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 5536fa202..e557fba41 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -157,6 +157,7 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library + # TODO: Replace this by /FORCE:UNRESOLVED on MSVC for later on resolving it ourselves? $<$<CXX_COMPILER_ID:MSVC>:${NodeJS_LIBRARY}> # NodeJS library PUBLIC From 06d548199898bd39a96672a5e19559428a816558 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 27 Feb 2025 19:40:44 +0100 Subject: [PATCH 192/487] Solve issues in funchook windows. --- source/detours/funchook_detour/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/funchook_detour/CMakeLists.txt index 2f953a411..ac782f31d 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/funchook_detour/CMakeLists.txt @@ -30,19 +30,18 @@ set(FUNCHOOK_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/funchook/src/funchook") if(WIN32) set(FUNCHOOK_BUILD_TARGET "INSTALL") set(FUNCHOOK_LIBRARY_NAME "funchook_dll.${FUNCHOOK_LIBRARY_SUFFIX}") - set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${FUNCHOOK_LIBRARY_NAME}") + set(FUNCHOOK_LIBRARY "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${FUNCHOOK_LIBRARY_NAME}") set(FUNCHOOK_LIBRARY_INSTALL_NAME "funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") else() set(FUNCHOOK_BUILD_TARGET "install") set(FUNCHOOK_LIBRARY_NAME "libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") - set(FUNCHOOK_LIBRARY_DIR "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_NAME}") + set(FUNCHOOK_LIBRARY "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_NAME}") set(FUNCHOOK_LIBRARY_INSTALL_NAME "${FUNCHOOK_LIBRARY_NAME}") - set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_LIBRARY_DIR}") + set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_LIBRARY}") endif() set(FUNCHOOK_INSTALL_DIR "${PROJECT_OUTPUT_DIR}") -set(FUNCHOOK_LIBRARY "${PROJECT_OUTPUT_DIR}/${FUNCHOOK_LIBRARY_NAME}") set(FUNCHOOK_LIBRARY_INSTALL "${PROJECT_OUTPUT_DIR}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include") From 120a38322c6142dfbc1e1499ef7d03826c8b236a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 27 Feb 2025 19:41:18 +0100 Subject: [PATCH 193/487] Solve issues in github platform. --- .github/workflows/docker-hub-platform.yml | 57 ++++++++++++++--------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml index 6a004d1eb..123c572b4 100644 --- a/.github/workflows/docker-hub-platform.yml +++ b/.github/workflows/docker-hub-platform.yml @@ -94,6 +94,8 @@ jobs: manifest: name: Create and Push Manifest Lists needs: build + # Only run when master or when tagging a version + if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' runs-on: ubuntu-latest steps: - name: Login to Docker Hub @@ -104,10 +106,15 @@ jobs: - name: Create and Push Manifest Lists run: | - for tag in "deps" "dev" "runtime" "cli"; do + tags=("deps" "dev" "runtime" "cli") + platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + + echo "Create all the tags by platform" + + for tag in "${tags[@]}"; do echo "Creating manifest for tag: $tag" platform_tags="" - for platform in "linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6"; do + for platform in "${platforms[@]}"; do platform_tag=$(echo "${platform}" | tr '/' '-') platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" done @@ -116,28 +123,32 @@ jobs: docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} done - - name: Create Version Specific Tags - if: startsWith(github.ref, 'refs/tags/') - run: | - VERSION=${GITHUB_REF#refs/tags/v} - tags=("deps" "dev" "runtime" "cli") - platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") - for tag in "${tags[@]}"; do - platform_tags="" - for platform in "${platforms[@]}"; do - platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform}" - done - docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend - docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} - done + echo "Create the latest tag" cli_platform_tags="" - for platform in ${{ matrix.platform }}; do - cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform}" + for platform in ${platforms[@]}"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag}" done docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest + if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" = true ]]; then + VERSION=${GITHUB_REF#refs/tags/v} + + echo "Create the version ${VERSION} tag" + + for tag in "${tags[@]}"; do + platform_tags="" + for platform in "${platforms[@]}"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} + done + fi + cleanup: name: Cleanup Platform Specific Tags needs: [build, manifest] @@ -146,12 +157,14 @@ jobs: steps: - name: Remove Platform-Specific Tags run: | - platforms=("linux-amd64" "linux-386" "linux-arm64" "linux-riscv64" "linux-ppc64le" "linux-s390x" "linux-arm-v7" "linux-arm-v6") tags=("deps" "dev" "runtime" "cli") + platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + + for tag in "${tags[@]}"; do + for platform in "${platforms[@]}"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + tag_to_delete="${tag}-${platform_tag}" - for platform in "${platforms[@]}"; do - for tag in "${tags[@]}"; do - tag_to_delete="${tag}-${platform}" echo "Deleting tag: ${tag_to_delete}" echo "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" From 95a2663abd3a5be0aa1cf03fcfd02843dae44349 Mon Sep 17 00:00:00 2001 From: -NoName <108888519+Bishoywadea@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:47:41 +0200 Subject: [PATCH 194/487] fxing linux ci after updating tinycc (#553) * adding C to macos CI and updating tcc commit sha * adding branch to ci triggers * modifying md5 hash for tinycc * typo in MD5 * replace TCC_RELOCATE_AUTO in the code * update code according to new signature of tcc_relocate function * remove branch name from macos ci * remove branch from linux ci * remove branch from windows ci * remove c from macos ci * Update metacall-environment.sh --------- Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- cmake/InstallLibTCC.cmake | 4 ++-- source/loaders/c_loader/source/c_loader_impl.cpp | 4 ++-- tools/metacall-environment.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/InstallLibTCC.cmake b/cmake/InstallLibTCC.cmake index 096f447c9..ca33a0c10 100644 --- a/cmake/InstallLibTCC.cmake +++ b/cmake/InstallLibTCC.cmake @@ -125,7 +125,7 @@ else() endif() set(LIBTCC_TARGET libtcc-depends) -set(LIBTCC_COMMIT_SHA "afc1362") +set(LIBTCC_COMMIT_SHA "6ec4a10") if(PROJECT_OS_FAMILY STREQUAL macos) # TODO: --disable-static is not working on MacOS, this should be reported or further investigated, remove this when it is solved set(LIBTTC_LIBRARY_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}tcc${CMAKE_STATIC_LIBRARY_SUFFIX}") @@ -146,7 +146,7 @@ set(LIBTTC_RUNTIME_FILES ExternalProject_Add(${LIBTCC_TARGET} DOWNLOAD_NAME tinycc.tar.gz URL https://github.com/metacall/tinycc/archive/${LIBTCC_COMMIT_SHA}.tar.gz - URL_MD5 5582b17ee5848aeec28bee13773843f7 + URL_MD5 1d25d1a07a39c6d6671b7221d5286dc1 CONFIGURE_COMMAND ${LIBTCC_CONFIGURE} BUILD_COMMAND ${LIBTCC_BUILD} BUILD_IN_SOURCE true diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index 4ad6689bf..819bcceea 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -1224,7 +1224,7 @@ loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path p } } - if (tcc_relocate(c_handle->state, TCC_RELOCATE_AUTO) == -1) + if (tcc_relocate(c_handle->state) == -1) { log_write("metacall", LOG_LEVEL_ERROR, "TCC failed to relocate"); goto error; @@ -1256,7 +1256,7 @@ loader_handle c_loader_impl_load_from_memory(loader_impl impl, const loader_name goto error; } - if (tcc_relocate(c_handle->state, TCC_RELOCATE_AUTO) == -1) + if (tcc_relocate(c_handle->state) == -1) { log_write("metacall", LOG_LEVEL_ERROR, "TCC failed to relocate"); goto error; diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 92cbd780f..1c1524e28 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -643,10 +643,10 @@ sub_java(){ # C sub_c(){ echo "configure c" + cd $ROOT_DIR + LLVM_VERSION_STRING=14 if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then - LLVM_VERSION_STRING=14 - if [ "${LINUX_DISTRO}" = "debian" ]; then UBUNTU_CODENAME="" CODENAME_FROM_ARGUMENTS="" From 3a5ae97267d11ff8b53f6cbec918faca50b6edd9 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 28 Feb 2025 08:54:33 +0100 Subject: [PATCH 195/487] Disable cross compiling macos on tcc. --- cmake/InstallLibTCC.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/InstallLibTCC.cmake b/cmake/InstallLibTCC.cmake index ca33a0c10..18483bba2 100644 --- a/cmake/InstallLibTCC.cmake +++ b/cmake/InstallLibTCC.cmake @@ -84,7 +84,7 @@ elseif(PROJECT_OS_FAMILY STREQUAL macos) # AddressSanitizer can not provide additional info. # SUMMARY: AddressSanitizer: BUS (libsystem_c.dylib:x86_64+0x3647db0f) in off32 - set(LIBTCC_CONFIGURE ./configure --prefix=${LIBTCC_INSTALL_PREFIX} ${LIBTCC_DEBUG} --enable-cross) # --disable-static + set(LIBTCC_CONFIGURE ./configure --prefix=${LIBTCC_INSTALL_PREFIX} ${LIBTCC_DEBUG}) # --disable-static elseif(PROJECT_OS_FAMILY STREQUAL win32) if(PROJECT_OS_NAME STREQUAL MinGW) set(LIBTCC_CONFIGURE ./configure --prefix=${LIBTCC_INSTALL_PREFIX} ${LIBTCC_DEBUG} --config-mingw32 --disable-static) From 6b2936c20d231e291c203e79fc53deb1dc58c8c1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 28 Feb 2025 08:55:53 +0100 Subject: [PATCH 196/487] Add support for c in macos. --- .github/workflows/macos-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 64a768757..f46dd9256 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -77,7 +77,7 @@ jobs: - name: Set up the environment run: sh ./tools/metacall-environment.sh $METACALL_INSTALL_OPTIONS env: - METACALL_INSTALL_OPTIONS: base python nodejs typescript java ruby wasm rpc file cobol go backtrace #netcore5 c rust rapidjson funchook swig pack # clangformat v8rep51 coverage + METACALL_INSTALL_OPTIONS: base python nodejs typescript c java ruby wasm rpc file cobol go backtrace #netcore5 c rust rapidjson funchook swig pack # clangformat v8rep51 coverage - name: Configure run: | @@ -85,7 +85,7 @@ jobs: . .env bash ../tools/metacall-configure.sh $METACALL_CONFIGURE_OPTIONS env: - METACALL_CONFIGURE_OPTIONS: ${{ matrix.options.build }} ${{ matrix.options.sanitizer }} scripts ports tests python nodejs typescript java ruby wasm rpc file cobol go benchmarks install # netcore5 c rust examples pack # v8 coverage + METACALL_CONFIGURE_OPTIONS: ${{ matrix.options.build }} ${{ matrix.options.sanitizer }} scripts ports tests python nodejs typescript c java ruby wasm rpc file cobol go benchmarks install # netcore5 c rust examples pack # v8 coverage - name: Build working-directory: ./build From cecb0c2f529fb447c0f1b81aa1cfe9ad458db863 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 28 Feb 2025 17:06:48 +0100 Subject: [PATCH 197/487] Multiplatform builds for docker by default. --- .github/workflows/docker-hub-platform.yml | 175 ---------------------- .github/workflows/docker-hub.yml | 170 ++++++++++++++++++--- .github/workflows/macos-test.yml | 4 +- 3 files changed, 148 insertions(+), 201 deletions(-) delete mode 100644 .github/workflows/docker-hub-platform.yml diff --git a/.github/workflows/docker-hub-platform.yml b/.github/workflows/docker-hub-platform.yml deleted file mode 100644 index 123c572b4..000000000 --- a/.github/workflows/docker-hub-platform.yml +++ /dev/null @@ -1,175 +0,0 @@ -name: Build and Push Docker Image for Multiple Architectures - -on: - pull_request: - push: - branches: - - master - - develop - tags: - - 'v*.*.*' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - DOCKER_REGISTRY: index.docker.io - DOCKER_USERNAME: metacall - IMAGE_NAME: core - BUILDKIT_VERSION: 0.13.0 - -jobs: - build: - name: Build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - platform: - - linux/amd64 - - linux/386 - - linux/arm64 - - linux/riscv64 - - linux/ppc64le - - linux/s390x - - linux/arm/v7 - - linux/arm/v6 - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - version: v${{ env.BUILDKIT_VERSION }} - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Build MetaCall Docker Images - env: - METACALL_PLATFORM: ${{ matrix.platform }} - run: | - ./docker-compose.sh platform - - - name: Tag Platform Images - run: | - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - echo "Platform Tag: ${platform_tag}" - for tag in "deps" "dev" "runtime" "cli"; do - docker tag metacall/${IMAGE_NAME}:${tag} \ - ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} - done - - - name: Push Platform Images - run: | - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - for tag in "deps" "dev" "runtime" "cli"; do - echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" - docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} - done - - - name: Run Tests - run: | - set -exuo pipefail - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - cat <<EOF > Dockerfile.test - FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} - RUN echo "console.log('abcde')" > script.js - RUN metacallcli script.js - EOF - - docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . - docker run --rm --platform=${{ matrix.platform }} test-image - - manifest: - name: Create and Push Manifest Lists - needs: build - # Only run when master or when tagging a version - if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' - runs-on: ubuntu-latest - steps: - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Create and Push Manifest Lists - run: | - tags=("deps" "dev" "runtime" "cli") - platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") - - echo "Create all the tags by platform" - - for tag in "${tags[@]}"; do - echo "Creating manifest for tag: $tag" - platform_tags="" - for platform in "${platforms[@]}"; do - platform_tag=$(echo "${platform}" | tr '/' '-') - platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" - done - echo "Creating manifest with tags: ${platform_tags}" - docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} ${platform_tags} --amend - docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} - done - - echo "Create the latest tag" - - cli_platform_tags="" - for platform in ${platforms[@]}"; do - platform_tag=$(echo "${platform}" | tr '/' '-') - cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag}" - done - docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend - docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest - - if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" = true ]]; then - VERSION=${GITHUB_REF#refs/tags/v} - - echo "Create the version ${VERSION} tag" - - for tag in "${tags[@]}"; do - platform_tags="" - for platform in "${platforms[@]}"; do - platform_tag=$(echo "${platform}" | tr '/' '-') - platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" - done - docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend - docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} - done - fi - - cleanup: - name: Cleanup Platform Specific Tags - needs: [build, manifest] - runs-on: ubuntu-latest - if: always() - steps: - - name: Remove Platform-Specific Tags - run: | - tags=("deps" "dev" "runtime" "cli") - platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") - - for tag in "${tags[@]}"; do - for platform in "${platforms[@]}"; do - platform_tag=$(echo "${platform}" | tr '/' '-') - tag_to_delete="${tag}-${platform_tag}" - - echo "Deleting tag: ${tag_to_delete}" - echo "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" - - curl -X DELETE \ - -H "Authorization: Bearer ${{ secrets.DOCKER_HUB_ACCESS_TOKEN_DELETE }}" \ - "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" - done - done diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 12375d985..123c572b4 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -1,13 +1,11 @@ -name: Build and Push Docker Image +name: Build and Push Docker Image for Multiple Architectures on: - # To enable manual triggering of this workflow - workflow_dispatch: - - # Trigger for pushes to master and tags + pull_request: push: branches: - master + - develop tags: - 'v*.*.*' @@ -16,38 +14,162 @@ concurrency: cancel-in-progress: true env: - IMAGE_NAME: index.docker.io/metacall/core + DOCKER_REGISTRY: index.docker.io + DOCKER_USERNAME: metacall + IMAGE_NAME: core + BUILDKIT_VERSION: 0.13.0 jobs: build: - runs-on: ubuntu-latest name: Build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/386 + - linux/arm64 + - linux/riscv64 + - linux/ppc64le + - linux/s390x + - linux/arm/v7 + - linux/arm/v6 steps: - - name: Checkout the code + - name: Checkout Repository uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Login to DockerHub - run: docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" -p "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v3 + with: + version: v${{ env.BUILDKIT_VERSION }} - - name: Pull MetaCall Docker Images - run: bash ./docker-compose.sh pull + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Build MetaCall Docker Images - run: bash ./docker-compose.sh build + env: + METACALL_PLATFORM: ${{ matrix.platform }} + run: | + ./docker-compose.sh platform + + - name: Tag Platform Images + run: | + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + echo "Platform Tag: ${platform_tag}" + for tag in "deps" "dev" "runtime" "cli"; do + docker tag metacall/${IMAGE_NAME}:${tag} \ + ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + done + + - name: Push Platform Images + run: | + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + for tag in "deps" "dev" "runtime" "cli"; do + echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" + docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + done - # TODO: Build with alpine and provide multiple tags (debian & alpine) once all tests pass - - name: Push MetaCall Docker Image to DockerHub + - name: Run Tests run: | - if [[ "${{ github.ref == 'refs/heads/master' }}" = true ]]; then - bash ./docker-compose.sh push - elif [[ "${{ contains(github.ref, 'refs/tags/') }}" = true ]]; then - bash ./docker-compose.sh version - else - echo "Failed to push the docker images" - exit 1 + set -exuo pipefail + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + cat <<EOF > Dockerfile.test + FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} + RUN echo "console.log('abcde')" > script.js + RUN metacallcli script.js + EOF + + docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . + docker run --rm --platform=${{ matrix.platform }} test-image + + manifest: + name: Create and Push Manifest Lists + needs: build + # Only run when master or when tagging a version + if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Create and Push Manifest Lists + run: | + tags=("deps" "dev" "runtime" "cli") + platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + + echo "Create all the tags by platform" + + for tag in "${tags[@]}"; do + echo "Creating manifest for tag: $tag" + platform_tags="" + for platform in "${platforms[@]}"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" + done + echo "Creating manifest with tags: ${platform_tags}" + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} + done + + echo "Create the latest tag" + + cli_platform_tags="" + for platform in ${platforms[@]}"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + cli_platform_tags="${cli_platform_tags} ${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest ${cli_platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:latest + + if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" = true ]]; then + VERSION=${GITHUB_REF#refs/tags/v} + + echo "Create the version ${VERSION} tag" + + for tag in "${tags[@]}"; do + platform_tags="" + for platform in "${platforms[@]}"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + platform_tags="${platform_tags} ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag}" + done + docker manifest create ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} ${platform_tags} --amend + docker manifest push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${VERSION}-${tag} + done fi - - name: Logout from DockerHub - run: docker logout + cleanup: + name: Cleanup Platform Specific Tags + needs: [build, manifest] + runs-on: ubuntu-latest + if: always() + steps: + - name: Remove Platform-Specific Tags + run: | + tags=("deps" "dev" "runtime" "cli") + platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + + for tag in "${tags[@]}"; do + for platform in "${platforms[@]}"; do + platform_tag=$(echo "${platform}" | tr '/' '-') + tag_to_delete="${tag}-${platform_tag}" + + echo "Deleting tag: ${tag_to_delete}" + echo "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" + + curl -X DELETE \ + -H "Authorization: Bearer ${{ secrets.DOCKER_HUB_ACCESS_TOKEN_DELETE }}" \ + "https://hub.docker.com/v2/repositories/$%7BDOCKER_USERNAME%7D/$%7BIMAGE_NAME%7D/tags/$%7Btag_to_delete%7D/" + done + done diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index f46dd9256..64a768757 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -77,7 +77,7 @@ jobs: - name: Set up the environment run: sh ./tools/metacall-environment.sh $METACALL_INSTALL_OPTIONS env: - METACALL_INSTALL_OPTIONS: base python nodejs typescript c java ruby wasm rpc file cobol go backtrace #netcore5 c rust rapidjson funchook swig pack # clangformat v8rep51 coverage + METACALL_INSTALL_OPTIONS: base python nodejs typescript java ruby wasm rpc file cobol go backtrace #netcore5 c rust rapidjson funchook swig pack # clangformat v8rep51 coverage - name: Configure run: | @@ -85,7 +85,7 @@ jobs: . .env bash ../tools/metacall-configure.sh $METACALL_CONFIGURE_OPTIONS env: - METACALL_CONFIGURE_OPTIONS: ${{ matrix.options.build }} ${{ matrix.options.sanitizer }} scripts ports tests python nodejs typescript c java ruby wasm rpc file cobol go benchmarks install # netcore5 c rust examples pack # v8 coverage + METACALL_CONFIGURE_OPTIONS: ${{ matrix.options.build }} ${{ matrix.options.sanitizer }} scripts ports tests python nodejs typescript java ruby wasm rpc file cobol go benchmarks install # netcore5 c rust examples pack # v8 coverage - name: Build working-directory: ./build From 6273bc7126ce8b1e3634de7b094e228d8dc92348 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 28 Feb 2025 17:07:18 +0100 Subject: [PATCH 198/487] Base support for llvm / c loader macos. --- tools/metacall-environment.sh | 1 - tools/metacall-runtime.sh | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 1c1524e28..28c9a6934 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -686,7 +686,6 @@ sub_c(){ $SUDO_CMD apt-get install -y --no-install-recommends libffi-dev libclang-${LLVM_VERSION_STRING}-dev elif [ "${LINUX_DISTRO}" = "alpine" ]; then $SUDO_CMD apk add --no-cache libffi-dev - $SUDO_CMD apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing tcc $SUDO_CMD apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main clang-libs=13.0.1-r1 clang-dev=13.0.1-r1 fi elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then diff --git a/tools/metacall-runtime.sh b/tools/metacall-runtime.sh index 70855f10d..aad251243 100755 --- a/tools/metacall-runtime.sh +++ b/tools/metacall-runtime.sh @@ -252,10 +252,10 @@ sub_java(){ # C sub_c(){ echo "configure c" + cd $ROOT_DIR + LLVM_VERSION_STRING=14 if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then - LLVM_VERSION_STRING=14 - if [ "${LINUX_DISTRO}" = "debian" ]; then UBUNTU_CODENAME="" CODENAME_FROM_ARGUMENTS="" @@ -293,9 +293,19 @@ sub_c(){ sub_apt_install_hold libffi libclang-${LLVM_VERSION_STRING} elif [ "${LINUX_DISTRO}" = "ubuntu" ]; then sub_apt_install_hold libffi libclang-${LLVM_VERSION_STRING} + elif [ "${LINUX_DISTRO}" = "alpine" ]; then + $SUDO_CMD apk add --no-cache libffi-dev + $SUDO_CMD apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main clang-libs=13.0.1-r1 clang-dev=13.0.1-r1 fi - - # TODO: Implement Alpine and Darwin + elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then + brew install libffi + brew install llvm@$LLVM_VERSION_STRING + brew link llvm@$LLVM_VERSION_STRING --force --overwrite + mkdir -p "$ROOT_DIR/build" + CMAKE_CONFIG_PATH="$ROOT_DIR/build/CMakeConfig.txt" + LIBCLANG_PREFIX=$(brew --prefix llvm@$LLVM_VERSION_STRING) + echo "-DLibClang_INCLUDE_DIR=${LIBCLANG_PREFIX}/include" >> $CMAKE_CONFIG_PATH + echo "-DLibClang_LIBRARY=${LIBCLANG_PREFIX}/lib/libclang.dylib" >> $CMAKE_CONFIG_PATH fi } From 064ac362563135d95f84a604587a8b9d6ae665b3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 3 Mar 2025 18:35:05 +0100 Subject: [PATCH 199/487] Update version to v0.8.8. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 35864a97f..5c5cbb3b8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.7 \ No newline at end of file +0.8.8 \ No newline at end of file From 7a954ca874b6e95e2579566bd29e22be46254e43 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 11 Mar 2025 20:30:40 +0100 Subject: [PATCH 200/487] Minor improvement to git2. --- cmake/FindLibGit2.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/FindLibGit2.cmake b/cmake/FindLibGit2.cmake index 787b5319c..f9f4497e3 100644 --- a/cmake/FindLibGit2.cmake +++ b/cmake/FindLibGit2.cmake @@ -27,6 +27,10 @@ include(FindPackageHandleStandardArgs) find_package(PkgConfig QUIET) pkg_check_modules(PKG_GIT2 QUIET libgit2) +if(NOT PKG_GIT2_FOUND) + return() +endif() + if(NOT LibGit2_DEFINITIONS) set(LibGit2_DEFINITIONS ${PKG_GIT2_CFLAGS_OTHER}) endif() From af9cad19dd29a5fad4fcba71ac6e1c52f589165b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 11 Mar 2025 20:42:46 +0100 Subject: [PATCH 201/487] Update copyright. --- .env | 2 +- CMakeLists.txt | 2 +- Dockerfile | 2 +- LICENSE | 2 +- cmake/CMakeDebug.cmake | 2 +- cmake/CheckCCompilerFlagStackSmashing.cmake | 2 +- cmake/CheckCXXCompilerFlagStackSmashing.cmake | 2 +- cmake/Coverage.cmake | 2 +- cmake/FindCobol.cmake | 2 +- cmake/FindCoreCLR.cmake | 2 +- cmake/FindDotNET.cmake | 2 +- cmake/FindGBench.cmake | 2 +- cmake/FindJulia.cmake | 2 +- cmake/FindLibClang.cmake | 2 +- cmake/FindLibFFI.cmake | 2 +- cmake/FindLibTCC.cmake | 2 +- cmake/FindMetaCall.cmake | 2 +- cmake/FindNPM.cmake | 2 +- cmake/FindNodeJS.cmake | 2 +- cmake/FindPatchelf.cmake | 2 +- cmake/FindRapidJSON.cmake | 2 +- cmake/FindRust.cmake | 2 +- cmake/FindSpiderMonkey.cmake | 2 +- cmake/FindV8.cmake | 2 +- cmake/FindWasmtime.cmake | 2 +- cmake/FindZig.cmake | 2 +- cmake/InstallGBench.cmake | 2 +- cmake/InstallGTest.cmake | 2 +- cmake/InstallLibTCC.cmake | 2 +- cmake/InstallPatchelf.cmake | 2 +- cmake/InstallRapidJSON.cmake | 2 +- cmake/Portability.cmake | 2 +- cmake/ScriptProject.cmake | 2 +- cmake/SecurityFlags.cmake | 2 +- cmake/TestEnvironmentVariables.cmake | 2 +- cmake/Warnings.cmake | 2 +- deploy/packages/postinst | 2 +- docker-compose.cache.yml | 2 +- docker-compose.platform.yml | 2 +- docker-compose.sh | 2 +- docker-compose.test.yml | 2 +- docker-compose.yml | 2 +- docs/README.md | 2 +- metacall-config-version.cmake.in | 2 +- metacall-config.cmake.in | 2 +- source/adt/include/adt/adt.h | 2 +- source/adt/include/adt/adt_bucket.h | 2 +- source/adt/include/adt/adt_comparable.h | 2 +- source/adt/include/adt/adt_hash.h | 2 +- source/adt/include/adt/adt_map.h | 2 +- source/adt/include/adt/adt_set.h | 2 +- source/adt/include/adt/adt_string.h | 2 +- source/adt/include/adt/adt_trie.h | 2 +- source/adt/include/adt/adt_vector.h | 2 +- source/adt/source/adt.c | 4 ++-- source/adt/source/adt_bucket.c | 2 +- source/adt/source/adt_comparable.c | 2 +- source/adt/source/adt_hash.c | 2 +- source/adt/source/adt_map.c | 2 +- source/adt/source/adt_set.c | 2 +- source/adt/source/adt_trie.c | 2 +- source/adt/source/adt_vector.c | 2 +- source/benchmarks/log_bench/source/log_bench.cpp | 2 +- .../metacall_cs_call_bench/source/metacall_cs_call_bench.cpp | 2 +- .../source/metacall_node_call_bench.cpp | 2 +- .../source/metacall_py_c_api_bench.cpp | 2 +- .../metacall_py_call_bench/source/metacall_py_call_bench.cpp | 2 +- .../metacall_py_init_bench/source/metacall_py_init_bench.cpp | 2 +- .../metacall_rb_call_bench/source/metacall_rb_call_bench.cpp | 2 +- source/cli/metacallcli/include/metacallcli/application.hpp | 2 +- source/cli/metacallcli/source/application.cpp | 2 +- source/cli/metacallcli/source/main.cpp | 2 +- .../cli_cmd_plugin/include/cli_cmd_plugin/cli_cmd_plugin.hpp | 2 +- .../cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h | 2 +- source/cli/plugins/cli_core_plugin/source/cli_core_plugin.cpp | 4 ++-- .../include/cli_sandbox_plugin/cli_sandbox_plugin.h | 2 +- .../plugins/cli_sandbox_plugin/source/cli_sandbox_plugin.cpp | 2 +- source/configuration/include/configuration/configuration.h | 2 +- .../configuration/include/configuration/configuration_impl.h | 2 +- .../include/configuration/configuration_object.h | 2 +- .../include/configuration/configuration_object_handle.h | 2 +- .../include/configuration/configuration_singleton.h | 2 +- source/configuration/source/configuration.c | 4 ++-- source/configuration/source/configuration_impl.c | 2 +- source/configuration/source/configuration_object.c | 2 +- source/configuration/source/configuration_singleton.c | 2 +- source/detour/include/detour/detour.h | 2 +- source/detour/include/detour/detour_handle.h | 2 +- source/detour/include/detour/detour_interface.h | 2 +- source/detour/source/detour.c | 4 ++-- .../funchook_detour/include/funchook_detour/funchook_detour.h | 2 +- .../include/funchook_detour/funchook_detour_impl.h | 2 +- source/detours/funchook_detour/source/funchook_detour.c | 4 ++-- source/detours/funchook_detour/source/funchook_detour_impl.c | 2 +- source/dynlink/include/dynlink/dynlink.h | 2 +- source/dynlink/include/dynlink/dynlink_flags.h | 2 +- source/dynlink/include/dynlink/dynlink_impl.h | 2 +- source/dynlink/include/dynlink/dynlink_impl_beos.h | 2 +- source/dynlink/include/dynlink/dynlink_impl_macos.h | 2 +- source/dynlink/include/dynlink/dynlink_impl_unix.h | 2 +- source/dynlink/include/dynlink/dynlink_impl_win32.h | 2 +- source/dynlink/include/dynlink/dynlink_interface.h | 2 +- source/dynlink/include/dynlink/dynlink_type.h | 2 +- source/dynlink/source/dynlink.c | 4 ++-- source/dynlink/source/dynlink_impl.c | 2 +- source/dynlink/source/dynlink_impl_beos.c | 2 +- source/dynlink/source/dynlink_impl_macos.c | 2 +- source/dynlink/source/dynlink_impl_unix.c | 2 +- source/dynlink/source/dynlink_impl_win32.c | 2 +- source/dynlink/source/dynlink_interface.c | 2 +- source/environment/include/environment/environment.h | 2 +- source/environment/include/environment/environment_variable.h | 2 +- .../include/environment/environment_variable_path.h | 2 +- source/environment/source/environment.c | 4 ++-- source/environment/source/environment_variable.c | 2 +- source/environment/source/environment_variable_path.c | 2 +- source/examples/metacalllog/main.cpp | 2 +- source/examples/metacallquine/main.cpp | 2 +- source/examples/metacallweb/main.cpp | 2 +- .../include/plugin_extension/plugin_extension.h | 2 +- .../extensions/plugin_extension/source/plugin_extension.cpp | 2 +- source/filesystem/include/filesystem/filesystem.h | 2 +- .../include/filesystem/filesystem_directory_descriptor.h | 2 +- .../include/filesystem/filesystem_file_descriptor.h | 2 +- source/filesystem/source/filesystem.c | 4 ++-- source/filesystem/source/filesystem_directory_descriptor.c | 2 +- source/filesystem/source/filesystem_file_descriptor.c | 2 +- source/format/include/format/format.h | 2 +- source/format/include/format/format_print.h | 2 +- source/format/include/format/format_specifier.h | 2 +- source/format/source/format.c | 4 ++-- source/loader/include/loader/loader.h | 2 +- source/loader/include/loader/loader_handle.h | 2 +- source/loader/include/loader/loader_host.h | 2 +- source/loader/include/loader/loader_impl.h | 2 +- source/loader/include/loader/loader_impl_data.h | 2 +- source/loader/include/loader/loader_impl_interface.h | 2 +- source/loader/include/loader/loader_manager_impl.h | 2 +- source/loader/include/loader/loader_naming.h | 2 +- source/loader/source/loader.c | 4 ++-- source/loader/source/loader_host.c | 2 +- source/loader/source/loader_impl.c | 2 +- source/loader/source/loader_manager_impl.c | 2 +- source/loaders/c_loader/include/c_loader/c_loader.h | 2 +- source/loaders/c_loader/include/c_loader/c_loader_impl.h | 2 +- source/loaders/c_loader/source/c_loader.c | 4 ++-- source/loaders/c_loader/source/c_loader_impl.cpp | 2 +- source/loaders/cob_loader/include/cob_loader/cob_loader.h | 2 +- .../loaders/cob_loader/include/cob_loader/cob_loader_impl.h | 2 +- source/loaders/cob_loader/source/cob_loader.c | 4 ++-- source/loaders/cob_loader/source/cob_loader_impl.cpp | 2 +- source/loaders/cr_loader/crystal/cr_loader_impl.cr | 2 +- source/loaders/cr_loader/crystal/main.cr | 2 +- source/loaders/cr_loader/crystal/metacall.cr | 2 +- source/loaders/cr_loader/include/cr_loader/cr_loader.h | 2 +- source/loaders/cr_loader/include/cr_loader/cr_loader_impl.h | 2 +- .../loaders/cr_loader/include/cr_loader/cr_loader_impl_main.h | 2 +- source/loaders/cr_loader/source/cr_loader.c | 4 ++-- source/loaders/cs_loader/include/cs_loader/defs.h | 2 +- source/loaders/cs_loader/include/cs_loader/host_environment.h | 2 +- source/loaders/cs_loader/include/cs_loader/netcore.h | 2 +- source/loaders/cs_loader/include/cs_loader/netcore_linux.h | 2 +- source/loaders/cs_loader/include/cs_loader/netcore_win.h | 2 +- source/loaders/cs_loader/include/cs_loader/simple_netcore.h | 2 +- source/loaders/cs_loader/include/cs_loader/string_buffer.h | 2 +- source/loaders/cs_loader/include/cs_loader/utils.hpp | 2 +- source/loaders/cs_loader/source/cs_loader.c | 2 +- source/loaders/cs_loader/source/cs_loader_impl.c | 2 +- source/loaders/cs_loader/source/host_environment.cpp | 2 +- source/loaders/cs_loader/source/netcore.cpp | 2 +- source/loaders/cs_loader/source/netcore_linux.cpp | 2 +- source/loaders/cs_loader/source/simple_netcore.cpp | 2 +- source/loaders/cs_loader/source/string_buffer.cpp | 2 +- source/loaders/dart_loader/include/dart_loader/dart_loader.h | 2 +- .../dart_loader/include/dart_loader/dart_loader_impl.h | 2 +- source/loaders/dart_loader/source/dart_loader.c | 4 ++-- source/loaders/dart_loader/source/dart_loader_impl.cc | 2 +- source/loaders/ext_loader/include/ext_loader/ext_loader.h | 2 +- .../loaders/ext_loader/include/ext_loader/ext_loader_impl.h | 2 +- source/loaders/ext_loader/source/ext_loader.c | 4 ++-- source/loaders/ext_loader/source/ext_loader_impl.cpp | 2 +- source/loaders/file_loader/include/file_loader/file_loader.h | 2 +- .../file_loader/include/file_loader/file_loader_impl.h | 2 +- source/loaders/file_loader/source/file_loader.c | 4 ++-- source/loaders/file_loader/source/file_loader_impl.c | 2 +- source/loaders/java_loader/include/java_loader/java_loader.h | 2 +- .../java_loader/include/java_loader/java_loader_impl.h | 2 +- source/loaders/java_loader/source/java_loader.c | 4 ++-- source/loaders/java_loader/source/java_loader_impl.cpp | 2 +- source/loaders/jl_loader/bootstrap/lib/bootstrap.jl | 2 +- source/loaders/jl_loader/include/jl_loader/jl_loader.h | 2 +- source/loaders/jl_loader/include/jl_loader/jl_loader_impl.h | 2 +- source/loaders/jl_loader/source/jl_loader.c | 4 ++-- source/loaders/jl_loader/source/jl_loader_impl.cpp | 2 +- source/loaders/js_loader/include/js_loader/js_loader.h | 2 +- source/loaders/js_loader/include/js_loader/js_loader_impl.h | 2 +- .../js_loader/include/js_loader/js_loader_impl_guard.hpp | 2 +- source/loaders/js_loader/source/js_loader.c | 4 ++-- source/loaders/js_loader/source/js_loader_impl.cpp | 2 +- source/loaders/js_loader/source/js_loader_impl_guard.cpp | 2 +- source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h | 2 +- .../loaders/jsm_loader/include/jsm_loader/jsm_loader_impl.h | 2 +- source/loaders/jsm_loader/source/jsm_loader.c | 4 ++-- source/loaders/jsm_loader/source/jsm_loader_impl.cpp | 2 +- source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h | 2 +- .../llvm_loader/include/llvm_loader/llvm_loader_impl.h | 2 +- source/loaders/llvm_loader/source/llvm_loader.c | 4 ++-- source/loaders/llvm_loader/source/llvm_loader_impl.cpp | 2 +- source/loaders/loaders.h.in | 2 +- source/loaders/lua_loader/include/lua_loader/lua_loader.h | 2 +- .../loaders/lua_loader/include/lua_loader/lua_loader_impl.h | 2 +- source/loaders/lua_loader/source/lua_loader.c | 4 ++-- source/loaders/lua_loader/source/lua_loader_impl.c | 2 +- source/loaders/mock_loader/include/mock_loader/mock_loader.h | 2 +- .../mock_loader/include/mock_loader/mock_loader_descriptor.h | 2 +- .../mock_loader/include/mock_loader/mock_loader_export.h | 2 +- .../mock_loader/include/mock_loader/mock_loader_function.h | 2 +- .../include/mock_loader/mock_loader_function_interface.h | 2 +- .../mock_loader/include/mock_loader/mock_loader_handle.h | 2 +- .../mock_loader/include/mock_loader/mock_loader_impl.h | 2 +- .../mock_loader/include/mock_loader/mock_loader_interface.h | 2 +- .../mock_loader/include/mock_loader/mock_loader_print.h | 2 +- source/loaders/mock_loader/source/mock_loader.c | 4 ++-- source/loaders/mock_loader/source/mock_loader_descriptor.c | 2 +- source/loaders/mock_loader/source/mock_loader_export.c | 2 +- source/loaders/mock_loader/source/mock_loader_function.c | 2 +- .../mock_loader/source/mock_loader_function_interface.c | 2 +- source/loaders/mock_loader/source/mock_loader_handle.c | 2 +- source/loaders/mock_loader/source/mock_loader_impl.c | 2 +- source/loaders/mock_loader/source/mock_loader_interface.c | 2 +- source/loaders/mock_loader/source/mock_loader_print.c | 4 ++-- source/loaders/node_loader/include/node_loader/node_loader.h | 2 +- .../node_loader/include/node_loader/node_loader_bootstrap.h | 2 +- .../node_loader/include/node_loader/node_loader_impl.h | 2 +- .../node_loader/include/node_loader/node_loader_port.h | 2 +- .../node_loader/include/node_loader/node_loader_trampoline.h | 2 +- .../include/node_loader/node_loader_win32_delay_load.h | 2 +- source/loaders/node_loader/source/node_loader.c | 4 ++-- source/loaders/node_loader/source/node_loader_impl.cpp | 2 +- source/loaders/node_loader/source/node_loader_port.cpp | 2 +- source/loaders/node_loader/source/node_loader_trampoline.cpp | 2 +- source/loaders/py_loader/include/py_loader/py_loader.h | 2 +- source/loaders/py_loader/include/py_loader/py_loader_dict.h | 2 +- source/loaders/py_loader/include/py_loader/py_loader_impl.h | 2 +- source/loaders/py_loader/include/py_loader/py_loader_port.h | 2 +- .../loaders/py_loader/include/py_loader/py_loader_threading.h | 2 +- source/loaders/py_loader/source/py_loader.c | 4 ++-- source/loaders/py_loader/source/py_loader_dict.c | 2 +- source/loaders/py_loader/source/py_loader_impl.c | 2 +- source/loaders/py_loader/source/py_loader_port.c | 2 +- source/loaders/py_loader/source/py_loader_threading.cpp | 2 +- source/loaders/rb_loader/include/rb_loader/rb_loader.h | 2 +- source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h | 2 +- .../rb_loader/include/rb_loader/rb_loader_impl_parser.h | 2 +- source/loaders/rb_loader/source/rb_loader.c | 4 ++-- source/loaders/rb_loader/source/rb_loader_impl.c | 2 +- source/loaders/rb_loader/source/rb_loader_impl_parser.c | 2 +- source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h | 2 +- .../loaders/rpc_loader/include/rpc_loader/rpc_loader_impl.h | 2 +- source/loaders/rpc_loader/source/rpc_loader.c | 4 ++-- source/loaders/rpc_loader/source/rpc_loader_impl.cpp | 2 +- source/loaders/rs_loader/include/rs_loader/rs_loader.h | 2 +- source/loaders/rs_loader/include/rs_loader/rs_loader_impl.h | 2 +- source/loaders/rs_loader/source/rs_loader.c | 4 ++-- source/loaders/ts_loader/include/ts_loader/ts_loader.h | 2 +- source/loaders/ts_loader/include/ts_loader/ts_loader_impl.h | 2 +- source/loaders/ts_loader/source/ts_loader.c | 4 ++-- source/loaders/ts_loader/source/ts_loader_impl.cpp | 2 +- source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h | 2 +- .../wasm_loader/include/wasm_loader/wasm_loader_function.h | 2 +- .../wasm_loader/include/wasm_loader/wasm_loader_handle.h | 2 +- .../wasm_loader/include/wasm_loader/wasm_loader_impl.h | 2 +- source/loaders/wasm_loader/source/wasm_loader.c | 4 ++-- source/loaders/wasm_loader/source/wasm_loader_impl.c | 2 +- source/log/include/log/log.h | 2 +- source/log/include/log/log_aspect.h | 2 +- source/log/include/log/log_aspect_format.h | 2 +- source/log/include/log/log_aspect_schedule.h | 2 +- source/log/include/log/log_aspect_storage.h | 2 +- source/log/include/log/log_aspect_stream.h | 2 +- source/log/include/log/log_handle.h | 2 +- source/log/include/log/log_impl.h | 2 +- source/log/include/log/log_level.h | 2 +- source/log/include/log/log_map.h | 2 +- source/log/include/log/log_policy.h | 2 +- source/log/include/log/log_policy_format.h | 2 +- source/log/include/log/log_policy_format_binary.h | 2 +- source/log/include/log/log_policy_format_custom.h | 2 +- source/log/include/log/log_policy_format_text.h | 2 +- source/log/include/log/log_policy_schedule.h | 2 +- source/log/include/log/log_policy_schedule_async.h | 2 +- source/log/include/log/log_policy_schedule_sync.h | 2 +- source/log/include/log/log_policy_storage.h | 2 +- source/log/include/log/log_policy_storage_batch.h | 2 +- source/log/include/log/log_policy_storage_sequential.h | 2 +- source/log/include/log/log_policy_stream.h | 2 +- source/log/include/log/log_policy_stream_custom.h | 2 +- source/log/include/log/log_policy_stream_file.h | 2 +- source/log/include/log/log_policy_stream_nginx.h | 2 +- source/log/include/log/log_policy_stream_socket.h | 2 +- source/log/include/log/log_policy_stream_stdio.h | 2 +- source/log/include/log/log_policy_stream_syslog.h | 2 +- source/log/include/log/log_preprocessor.h | 2 +- source/log/include/log/log_record.h | 2 +- source/log/include/log/log_singleton.h | 2 +- source/log/include/log/log_valid_size.h | 2 +- source/log/source/log.c | 4 ++-- source/log/source/log_aspect.c | 2 +- source/log/source/log_aspect_format.c | 2 +- source/log/source/log_aspect_schedule.c | 2 +- source/log/source/log_aspect_storage.c | 2 +- source/log/source/log_aspect_stream.c | 2 +- source/log/source/log_handle.c | 2 +- source/log/source/log_impl.c | 2 +- source/log/source/log_level.c | 2 +- source/log/source/log_map.c | 2 +- source/log/source/log_policy.c | 2 +- source/log/source/log_policy_format.c | 2 +- source/log/source/log_policy_format_binary.c | 2 +- source/log/source/log_policy_format_custom.c | 2 +- source/log/source/log_policy_format_text.c | 2 +- source/log/source/log_policy_schedule.c | 2 +- source/log/source/log_policy_schedule_async.c | 2 +- source/log/source/log_policy_schedule_sync.c | 2 +- source/log/source/log_policy_storage.c | 2 +- source/log/source/log_policy_storage_batch.c | 2 +- source/log/source/log_policy_storage_sequential.c | 2 +- source/log/source/log_policy_stream.c | 2 +- source/log/source/log_policy_stream_custom.c | 2 +- source/log/source/log_policy_stream_file.c | 2 +- source/log/source/log_policy_stream_nginx.c | 2 +- source/log/source/log_policy_stream_socket.c | 2 +- source/log/source/log_policy_stream_stdio.c | 2 +- source/log/source/log_policy_stream_syslog.c | 2 +- source/log/source/log_record.c | 2 +- source/log/source/log_singleton.c | 2 +- source/log/source/log_valid_size.c | 2 +- source/memory/include/memory/memory.h | 2 +- source/memory/include/memory/memory_allocator.h | 2 +- source/memory/include/memory/memory_allocator_iface.h | 2 +- source/memory/include/memory/memory_allocator_impl.h | 2 +- source/memory/include/memory/memory_allocator_nginx.h | 2 +- source/memory/include/memory/memory_allocator_nginx_impl.h | 2 +- source/memory/include/memory/memory_allocator_std.h | 2 +- source/memory/include/memory/memory_allocator_std_impl.h | 2 +- source/memory/source/memory.c | 4 ++-- source/memory/source/memory_allocator.c | 2 +- source/memory/source/memory_allocator_nginx.c | 2 +- source/memory/source/memory_allocator_nginx_impl.c | 2 +- source/memory/source/memory_allocator_std.c | 2 +- source/memory/source/memory_allocator_std_impl.c | 2 +- source/metacall/include/metacall/metacall.h | 2 +- source/metacall/include/metacall/metacall_allocator.h | 2 +- source/metacall/include/metacall/metacall_error.h | 2 +- source/metacall/include/metacall/metacall_fork.h | 2 +- source/metacall/include/metacall/metacall_link.h | 2 +- source/metacall/include/metacall/metacall_log.h | 2 +- source/metacall/include/metacall/metacall_value.h | 2 +- source/metacall/metacall_def.h.in | 2 +- source/metacall/source/metacall.c | 4 ++-- source/metacall/source/metacall_allocator.c | 2 +- source/metacall/source/metacall_error.c | 2 +- source/metacall/source/metacall_fork.c | 2 +- source/metacall/source/metacall_link.c | 2 +- source/metacall/source/metacall_log.c | 2 +- source/metacall/source/metacall_value.c | 2 +- source/plugin/include/plugin/plugin.h | 2 +- source/plugin/include/plugin/plugin_descriptor.h | 2 +- source/plugin/include/plugin/plugin_impl.h | 2 +- source/plugin/include/plugin/plugin_interface.hpp | 2 +- source/plugin/include/plugin/plugin_loader.h | 2 +- source/plugin/include/plugin/plugin_manager.h | 2 +- source/plugin/source/plugin.c | 4 ++-- source/plugin/source/plugin_descriptor.c | 2 +- source/plugin/source/plugin_impl.c | 2 +- source/plugin/source/plugin_loader.c | 2 +- source/plugin/source/plugin_manager.c | 2 +- .../include/backtrace_plugin/backtrace_plugin.h | 2 +- source/plugins/backtrace_plugin/source/backtrace_plugin.cpp | 2 +- source/plugins/sandbox_plugin/cmake/FindLibSecComp.cmake | 2 +- .../sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h | 2 +- source/plugins/sandbox_plugin/source/sandbox_plugin.cpp | 2 +- source/portability/include/portability/portability.h | 2 +- source/portability/include/portability/portability_assert.h | 2 +- source/portability/include/portability/portability_atexit.h | 2 +- source/portability/include/portability/portability_compiler.h | 2 +- .../portability/include/portability/portability_constructor.h | 2 +- .../include/portability/portability_executable_path.h | 2 +- .../include/portability/portability_library_path.h | 2 +- source/portability/include/portability/portability_path.h | 2 +- .../include/portability/portability_working_path.h | 2 +- source/portability/source/portability.c | 4 ++-- source/portability/source/portability_atexit.c | 2 +- source/portability/source/portability_executable_path.c | 2 +- source/portability/source/portability_library_path.c | 2 +- source/portability/source/portability_path.c | 2 +- source/portability/source/portability_working_path.c | 2 +- source/ports/CMakeLists.txt | 2 +- source/ports/cxx_port/include/metacall/metacall.hpp | 2 +- source/ports/cxx_port/inline/metacall/metacall.inl | 2 +- source/ports/cxx_port/source/metacall.cpp | 2 +- source/ports/go_port/source/await.go | 2 +- source/ports/go_port/source/go_port.go | 2 +- source/ports/go_port/source/pointer.go | 2 +- source/ports/js_port/include/js_port/js_port.h | 2 +- source/ports/js_port/interface/js_port/js_port.i | 2 +- source/ports/js_port/interface/js_port/js_port_impl.i | 2 +- source/ports/js_port/source/js_port.c | 2 +- source/ports/js_port/test/main.cpp | 2 +- source/ports/nim_port/LICENSE | 2 +- source/ports/node_port/LICENSE | 2 +- source/ports/node_port/index.js | 2 +- source/ports/node_port/test.js | 2 +- source/ports/node_port/test/index.js | 2 +- source/ports/node_port/upload.sh | 2 +- source/ports/py_port/LICENSE.txt | 2 +- source/ports/py_port/helper/__init__.py | 2 +- source/ports/py_port/metacall/__init__.py | 2 +- source/ports/py_port/metacall/api.py | 2 +- source/ports/py_port/metacall/module_linux.py | 2 +- source/ports/py_port/metacall/module_win32.py | 2 +- source/ports/py_port/setup.py | 2 +- source/ports/py_port/upload.sh | 2 +- source/ports/rb_port/include/rb_port/rb_port.h | 2 +- source/ports/rb_port/interface/rb_port/rb_port.i | 2 +- source/ports/rb_port/interface/rb_port/rb_port_impl.i | 2 +- source/ports/rb_port/source/rb_port.c | 2 +- source/ports/rs_port/LICENSE.txt | 2 +- source/ports/rs_port/src/lib.rs | 2 +- source/ports/rs_port/upload.sh | 2 +- source/preprocessor/cmake/preprocessor_arguments.cmake | 2 +- source/preprocessor/cmake/preprocessor_arithmetic.cmake | 2 +- source/preprocessor/cmake/preprocessor_boolean.cmake | 2 +- source/preprocessor/cmake/preprocessor_for.cmake | 2 +- source/preprocessor/cmake/preprocessor_template.cmake | 2 +- source/preprocessor/cmake/preprocessor_template.h.in | 2 +- source/preprocessor/include/preprocessor/preprocessor.h | 2 +- .../include/preprocessor/preprocessor_arguments.h | 2 +- .../include/preprocessor/preprocessor_arithmetic.h | 2 +- source/preprocessor/include/preprocessor/preprocessor_bit.h | 2 +- .../preprocessor/include/preprocessor/preprocessor_boolean.h | 2 +- source/preprocessor/include/preprocessor/preprocessor_comma.h | 2 +- .../include/preprocessor/preprocessor_comparison.h | 2 +- .../include/preprocessor/preprocessor_complement.h | 2 +- .../include/preprocessor/preprocessor_concatenation.h | 2 +- .../include/preprocessor/preprocessor_detection.h | 2 +- source/preprocessor/include/preprocessor/preprocessor_empty.h | 2 +- source/preprocessor/include/preprocessor/preprocessor_for.h | 2 +- source/preprocessor/include/preprocessor/preprocessor_if.h | 2 +- .../preprocessor/include/preprocessor/preprocessor_serial.h | 2 +- .../include/preprocessor/preprocessor_stringify.h | 2 +- source/preprocessor/include/preprocessor/preprocessor_tuple.h | 2 +- source/preprocessor/source/preprocessor.c | 4 ++-- source/reflect/include/reflect/reflect.h | 2 +- source/reflect/include/reflect/reflect_accessor.h | 2 +- source/reflect/include/reflect/reflect_async.h | 2 +- source/reflect/include/reflect/reflect_attribute.h | 2 +- source/reflect/include/reflect/reflect_attribute_decl.h | 2 +- source/reflect/include/reflect/reflect_class.h | 2 +- source/reflect/include/reflect/reflect_class_decl.h | 2 +- source/reflect/include/reflect/reflect_class_visibility.h | 2 +- source/reflect/include/reflect/reflect_constructor.h | 2 +- source/reflect/include/reflect/reflect_constructor_decl.h | 2 +- source/reflect/include/reflect/reflect_context.h | 2 +- source/reflect/include/reflect/reflect_exception.h | 2 +- source/reflect/include/reflect/reflect_function.h | 2 +- source/reflect/include/reflect/reflect_future.h | 2 +- source/reflect/include/reflect/reflect_memory_tracker.h | 2 +- source/reflect/include/reflect/reflect_method.h | 2 +- source/reflect/include/reflect/reflect_method_decl.h | 2 +- source/reflect/include/reflect/reflect_object.h | 2 +- source/reflect/include/reflect/reflect_scope.h | 2 +- source/reflect/include/reflect/reflect_signature.h | 2 +- source/reflect/include/reflect/reflect_throwable.h | 2 +- source/reflect/include/reflect/reflect_type.h | 2 +- source/reflect/include/reflect/reflect_type_id.h | 2 +- source/reflect/include/reflect/reflect_value.h | 2 +- source/reflect/include/reflect/reflect_value_type.h | 2 +- source/reflect/include/reflect/reflect_value_type_cast.h | 2 +- source/reflect/include/reflect/reflect_value_type_demotion.h | 2 +- source/reflect/include/reflect/reflect_value_type_id_size.h | 2 +- source/reflect/include/reflect/reflect_value_type_promotion.h | 2 +- source/reflect/source/reflect.c | 4 ++-- source/reflect/source/reflect_attribute.c | 2 +- source/reflect/source/reflect_class.c | 2 +- source/reflect/source/reflect_class_visibility.c | 2 +- source/reflect/source/reflect_constructor.c | 2 +- source/reflect/source/reflect_context.c | 2 +- source/reflect/source/reflect_exception.c | 2 +- source/reflect/source/reflect_function.c | 2 +- source/reflect/source/reflect_future.c | 2 +- source/reflect/source/reflect_memory_tracker.c | 2 +- source/reflect/source/reflect_method.c | 2 +- source/reflect/source/reflect_object.c | 2 +- source/reflect/source/reflect_scope.c | 2 +- source/reflect/source/reflect_signature.c | 2 +- source/reflect/source/reflect_throwable.c | 2 +- source/reflect/source/reflect_type.c | 2 +- source/reflect/source/reflect_type_id.c | 2 +- source/reflect/source/reflect_value.c | 2 +- source/reflect/source/reflect_value_type.c | 2 +- source/reflect/source/reflect_value_type_cast.c | 2 +- source/reflect/source/reflect_value_type_demotion.c | 2 +- source/reflect/source/reflect_value_type_id_size.c | 2 +- source/reflect/source/reflect_value_type_promotion.c | 2 +- source/scripts/c/cmake/CProject.cmake | 2 +- source/scripts/c/cmake/CProject.cmake.in | 2 +- source/scripts/cobol/cmake/CobolProject.cmake | 2 +- source/scripts/cobol/cmake/CobolProject.cmake.in | 2 +- source/scripts/csharp/cmake/CSharpProject.cmake | 2 +- source/scripts/csharp/cmake/CSharpProject.cmake.in | 2 +- source/scripts/csharp/cmake/CSharpProject.json.in | 2 +- .../extension/sum/include/sum_extension/sum_extension.h | 2 +- source/scripts/extension/sum/source/sum_extension.cpp | 2 +- source/scripts/file/cmake/FileProject.cmake | 2 +- source/scripts/file/cmake/FileProject.cmake.in | 2 +- source/scripts/java/cmake/JavaJarProject.cmake.in | 2 +- source/scripts/java/cmake/JavaProject.cmake | 2 +- source/scripts/java/cmake/JavaProject.cmake.in | 2 +- source/scripts/javascript/cmake/JavaScriptProject.cmake | 2 +- source/scripts/javascript/cmake/JavaScriptProject.cmake.in | 2 +- source/scripts/javascript/cmake/JavaScriptProject.json.in | 2 +- source/scripts/julia/cmake/JuliaProject.cmake | 2 +- source/scripts/julia/cmake/JuliaProject.cmake.in | 2 +- source/scripts/llvm/cmake/LLVMProject.cmake | 2 +- source/scripts/llvm/cmake/LLVMProject.cmake.in | 2 +- source/scripts/lua/cmake/LuaProject.cmake | 2 +- source/scripts/lua/cmake/LuaProject.cmake.in | 2 +- source/scripts/node/cmake/NodeJSProject.cmake | 2 +- source/scripts/node/cmake/NodeJSProject.cmake.in | 2 +- source/scripts/node/cmake/NodeJSProject.json.in | 2 +- source/scripts/python/cmake/PythonProject.cmake | 2 +- source/scripts/python/cmake/PythonProject.cmake.in | 2 +- source/scripts/python/cmake/PythonProject.py.in | 2 +- source/scripts/python/rsasample/source/rsasample.py | 2 +- source/scripts/python/rsasample/source/sample/rsa_strings.py | 2 +- source/scripts/rpc/cmake/RPCProject.cmake | 2 +- source/scripts/rpc/cmake/RPCProject.cmake.in | 2 +- source/scripts/ruby/cmake/RubyProject.cmake | 2 +- source/scripts/ruby/cmake/RubyProject.cmake.in | 2 +- source/scripts/ruby/cmake/RubyProject.rb.in | 2 +- source/scripts/rust/cmake/RustProject.cmake | 2 +- source/scripts/rust/cmake/RustProject.cmake.in | 2 +- source/scripts/typescript/cmake/TypeScriptProject.cmake | 2 +- source/scripts/typescript/cmake/TypeScriptProject.cmake.in | 2 +- source/scripts/typescript/cmake/TypeScriptProject.json.in | 2 +- source/scripts/wasm/cmake/WasmProject.cmake | 2 +- source/scripts/wasm/cmake/WasmProject.cmake.in | 2 +- source/serial/include/serial/serial.h | 2 +- source/serial/include/serial/serial_handle.h | 2 +- source/serial/include/serial/serial_interface.h | 2 +- source/serial/source/serial.c | 4 ++-- .../metacall_serial/include/metacall_serial/metacall_serial.h | 2 +- .../include/metacall_serial/metacall_serial_impl.h | 2 +- .../metacall_serial/metacall_serial_impl_deserialize.h | 2 +- .../include/metacall_serial/metacall_serial_impl_serialize.h | 2 +- source/serials/metacall_serial/source/metacall_serial.c | 4 ++-- source/serials/metacall_serial/source/metacall_serial_impl.c | 2 +- .../metacall_serial/source/metacall_serial_impl_deserialize.c | 2 +- .../metacall_serial/source/metacall_serial_impl_serialize.c | 2 +- .../include/rapid_json_serial/rapid_json_serial.h | 2 +- .../include/rapid_json_serial/rapid_json_serial_impl.h | 2 +- source/serials/rapid_json_serial/source/rapid_json_serial.c | 4 ++-- .../rapid_json_serial/source/rapid_json_serial_impl.cpp | 2 +- source/tests/adt_map_test/source/adt_map_test.cpp | 2 +- source/tests/adt_map_test/source/main.cpp | 2 +- source/tests/adt_set_test/source/adt_set_test.cpp | 2 +- source/tests/adt_set_test/source/main.cpp | 2 +- source/tests/adt_trie_test/source/adt_trie_test.cpp | 2 +- source/tests/adt_trie_test/source/main.cpp | 2 +- source/tests/adt_vector_test/source/adt_vector_test.cpp | 2 +- source/tests/adt_vector_test/source/main.cpp | 2 +- source/tests/configuration_test/source/configuration_test.cpp | 2 +- source/tests/configuration_test/source/main.cpp | 2 +- source/tests/detour_test/source/detour_test.cpp | 2 +- source/tests/detour_test/source/main.cpp | 2 +- source/tests/dynlink_test/source/dynlink_test.cpp | 2 +- source/tests/dynlink_test/source/main.cpp | 2 +- source/tests/environment_test/source/environment_test.cpp | 2 +- source/tests/environment_test/source/main.cpp | 2 +- source/tests/log_custom_test/source/log_custom_test.cpp | 2 +- source/tests/log_custom_test/source/main.cpp | 2 +- source/tests/log_test/source/log_test.cpp | 2 +- source/tests/log_test/source/main.cpp | 2 +- source/tests/metacall_backtrace_plugin_test/source/main.cpp | 2 +- .../source/metacall_backtrace_plugin_test.cpp | 2 +- source/tests/metacall_c_lib_test/source/main.cpp | 2 +- .../tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp | 2 +- source/tests/metacall_c_test/source/main.cpp | 2 +- source/tests/metacall_c_test/source/metacall_c_test.cpp | 2 +- source/tests/metacall_callback_complex_test/source/main.cpp | 2 +- .../source/metacall_callback_complex_test.cpp | 2 +- source/tests/metacall_cast_test/source/main.cpp | 2 +- source/tests/metacall_cast_test/source/metacall_cast_test.cpp | 2 +- source/tests/metacall_clear_test/source/main.cpp | 2 +- .../tests/metacall_clear_test/source/metacall_clear_test.cpp | 2 +- .../tests/metacall_cli_core_plugin_await_test/source/main.cpp | 2 +- .../source/metacall_cli_core_plugin_await_test.cpp | 2 +- source/tests/metacall_cli_core_plugin_test/source/main.cpp | 2 +- .../source/metacall_cli_core_plugin_test.cpp | 2 +- source/tests/metacall_cobol_test/source/main.cpp | 2 +- .../tests/metacall_cobol_test/source/metacall_cobol_test.cpp | 2 +- .../tests/metacall_configuration_default_test/source/main.cpp | 2 +- .../source/metacall_configuration_default_test.cpp | 2 +- .../metacall_configuration_exec_path_test/source/main.cpp | 2 +- .../source/metacall_configuration_exec_path_test.cpp | 2 +- .../metacall_cs_test/include/metacall-cs-test/environment.hpp | 2 +- source/tests/metacall_cs_test/source/environment.cpp | 2 +- source/tests/metacall_cs_test/source/main.cpp | 2 +- source/tests/metacall_cs_test/source/metacall_cs_test.cpp | 2 +- source/tests/metacall_csharp_function_test/source/main.cpp | 2 +- .../source/metacall_csharp_function_test.cpp | 2 +- .../tests/metacall_csharp_static_class_test/source/main.cpp | 2 +- .../source/metacall_csharp_static_class_test.cpp | 2 +- source/tests/metacall_depends_test/source/main.cpp | 2 +- .../metacall_depends_test/source/metacall_depends_test.cpp | 2 +- source/tests/metacall_distributable_test/source/main.cpp | 2 +- .../source/metacall_distributable_test.cpp | 2 +- source/tests/metacall_ducktype_test/source/main.cpp | 2 +- .../metacall_ducktype_test/source/metacall_ducktype_test.cpp | 2 +- source/tests/metacall_duplicated_handle_test/source/main.cpp | 2 +- .../source/metacall_duplicated_handle_test.cpp | 2 +- source/tests/metacall_duplicated_symbols_test/source/main.cpp | 2 +- .../source/metacall_duplicated_symbols_test.cpp | 2 +- source/tests/metacall_dynlink_path_test/source/main.cpp | 2 +- .../source/metacall_dynlink_path_test.cpp | 2 +- source/tests/metacall_ext_test/source/main.cpp | 2 +- source/tests/metacall_ext_test/source/metacall_ext_test.cpp | 2 +- source/tests/metacall_file_fail_test/source/main.cpp | 2 +- .../source/metacall_file_fail_test.cpp | 2 +- source/tests/metacall_file_glob_test/source/main.cpp | 2 +- .../source/metacall_file_glob_test.cpp | 2 +- source/tests/metacall_file_test/source/main.cpp | 2 +- source/tests/metacall_file_test/source/metacall_file_test.cpp | 2 +- source/tests/metacall_fork_test/source/main.cpp | 2 +- source/tests/metacall_fork_test/source/metacall_fork_test.cpp | 2 +- source/tests/metacall_function_test/source/main.cpp | 2 +- .../metacall_function_test/source/metacall_function_test.cpp | 2 +- source/tests/metacall_handle_export_test/source/main.cpp | 2 +- .../source/metacall_handle_export_test.cpp | 2 +- source/tests/metacall_handle_get_test/source/main.cpp | 2 +- .../source/metacall_handle_get_test.cpp | 2 +- source/tests/metacall_init_fini_test/source/main.cpp | 2 +- .../source/metacall_init_fini_test.cpp | 2 +- .../source/main.cpp | 2 +- .../source/metacall_initialize_destroy_multiple_node_test.cpp | 2 +- .../metacall_initialize_destroy_multiple_test/source/main.cpp | 2 +- .../source/metacall_initialize_destroy_multiple_test.cpp | 2 +- source/tests/metacall_initialize_ex_test/source/main.cpp | 2 +- .../source/metacall_initialize_ex_test.cpp | 2 +- source/tests/metacall_initialize_test/source/main.cpp | 2 +- .../source/metacall_initialize_test.cpp | 2 +- source/tests/metacall_inspect_test/source/main.cpp | 2 +- .../metacall_inspect_test/source/metacall_inspect_test.cpp | 2 +- .../include/metacall-integration-test/environment.hpp | 2 +- source/tests/metacall_integration_test/source/environment.cpp | 2 +- source/tests/metacall_integration_test/source/main.cpp | 2 +- .../source/metacall_integration_test.cpp | 2 +- source/tests/metacall_invalid_loader_test/source/main.cpp | 2 +- .../source/metacall_invalid_loader_test.cpp | 2 +- source/tests/metacall_java_test/source/main.cpp | 2 +- source/tests/metacall_java_test/source/metacall_java_test.cpp | 2 +- source/tests/metacall_julia_test/source/main.cpp | 2 +- .../tests/metacall_julia_test/source/metacall_julia_test.cpp | 2 +- .../source/main.cpp | 2 +- .../source/metacall_library_path_without_env_vars_test.cpp | 2 +- source/tests/metacall_llvm_test/source/main.cpp | 2 +- source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp | 2 +- .../metacall_load_configuration_fail_test/source/main.cpp | 2 +- .../source/metacall_load_configuration_fail_test.cpp | 2 +- .../source/main.cpp | 2 +- .../source/metacall_load_configuration_node_python_test.cpp | 2 +- .../source/main.cpp | 2 +- .../source/metacall_load_configuration_python_node_test.cpp | 2 +- .../metacall_load_configuration_relative_test.h.in | 2 +- .../metacall_load_configuration_relative_test/source/main.cpp | 2 +- .../source/metacall_load_configuration_relative_test.cpp | 2 +- source/tests/metacall_load_configuration_test/source/main.cpp | 2 +- .../source/metacall_load_configuration_test.cpp | 2 +- source/tests/metacall_load_memory_empty_test/source/main.cpp | 2 +- .../source/metacall_load_memory_empty_test.cpp | 2 +- source/tests/metacall_load_memory_test/source/main.cpp | 2 +- .../source/metacall_load_memory_test.cpp | 2 +- source/tests/metacall_logs_test/source/main.cpp | 2 +- source/tests/metacall_logs_test/source/metacall_logs_test.cpp | 2 +- source/tests/metacall_lua_test/source/main.cpp | 2 +- source/tests/metacall_lua_test/source/metacall_lua_test.cpp | 2 +- source/tests/metacall_map_await_test/source/main.cpp | 2 +- .../source/metacall_map_await_test.cpp | 2 +- source/tests/metacall_map_test/source/main.cpp | 2 +- source/tests/metacall_map_test/source/metacall_map_test.cpp | 2 +- .../tests/metacall_node_async_multiple_test/source/main.cpp | 2 +- .../source/metacall_node_async_multiple_test.cpp | 2 +- .../tests/metacall_node_async_resources_test/source/main.cpp | 2 +- .../source/metacall_node_async_resources_test.cpp | 2 +- source/tests/metacall_node_async_test/source/main.cpp | 2 +- .../source/metacall_node_async_test.cpp | 2 +- source/tests/metacall_node_await_chain_test/source/main.cpp | 2 +- .../source/metacall_node_await_chain_test.cpp | 2 +- source/tests/metacall_node_call_test/source/main.cpp | 2 +- .../source/metacall_node_call_test.cpp | 2 +- source/tests/metacall_node_callback_test/source/main.cpp | 2 +- .../source/metacall_node_callback_test.cpp | 2 +- source/tests/metacall_node_clear_mem_test/source/main.cpp | 2 +- .../source/metacall_node_clear_mem_test.cpp | 2 +- .../tests/metacall_node_default_export_test/source/main.cpp | 2 +- .../source/metacall_node_default_export_test.cpp | 2 +- .../metacall_node_event_loop_signal_test/source/main.cpp | 2 +- .../source/metacall_node_event_loop_signal_test.cpp | 2 +- source/tests/metacall_node_event_loop_test/source/main.cpp | 2 +- .../source/metacall_node_event_loop_test.cpp | 2 +- source/tests/metacall_node_exception_test/source/main.cpp | 2 +- .../source/metacall_node_exception_test.cpp | 2 +- .../node_extension_test/source/node_extension_test.c | 2 +- .../source/node_extension_test_win32_delay_load.cpp | 2 +- source/tests/metacall_node_extension_test/source/main.cpp | 2 +- .../source/metacall_node_extension_test.cpp | 2 +- source/tests/metacall_node_fail_env_var_test/source/main.cpp | 2 +- .../source/metacall_node_fail_env_var_test.cpp | 2 +- .../tests/metacall_node_fail_load_leak_test/source/main.cpp | 2 +- .../source/metacall_node_fail_load_leak_test.cpp | 2 +- source/tests/metacall_node_fail_test/source/main.cpp | 2 +- .../source/metacall_node_fail_test.cpp | 2 +- source/tests/metacall_node_inline_test/source/main.cpp | 2 +- .../source/metacall_node_inline_test.cpp | 2 +- .../metacall_node_multithread_deadlock_test/source/main.cpp | 2 +- .../source/metacall_node_multithread_deadlock_test.cpp | 2 +- source/tests/metacall_node_native_code_test/source/main.cpp | 2 +- .../source/metacall_node_native_code_test.cpp | 2 +- source/tests/metacall_node_port_await_test/source/main.cpp | 2 +- .../source/metacall_node_port_await_test.cpp | 2 +- source/tests/metacall_node_port_c_lib_test/source/main.cpp | 2 +- .../source/metacall_node_port_c_lib_test.cpp | 2 +- source/tests/metacall_node_port_rs_test/source/main.cpp | 2 +- .../source/metacall_node_port_rs_test.cpp | 2 +- source/tests/metacall_node_port_test/source/main.cpp | 2 +- .../source/metacall_node_port_test.cpp | 2 +- .../source/main.cpp | 2 +- .../source/metacall_node_python_async_after_destroy_test.cpp | 2 +- .../metacall_node_python_await_extended_test/source/main.cpp | 2 +- .../source/metacall_node_python_await_extended_test.cpp | 2 +- source/tests/metacall_node_python_await_test/source/main.cpp | 2 +- .../source/metacall_node_python_await_test.cpp | 2 +- .../tests/metacall_node_python_deadlock_test/source/main.cpp | 2 +- .../source/metacall_node_python_deadlock_test.cpp | 2 +- .../tests/metacall_node_python_exception_test/source/main.cpp | 2 +- .../source/metacall_node_python_exception_test.cpp | 2 +- .../tests/metacall_node_python_port_mock_test/source/main.cpp | 2 +- .../source/metacall_node_python_port_mock_test.cpp | 2 +- .../tests/metacall_node_python_port_ruby_test/source/main.cpp | 2 +- .../source/metacall_node_python_port_ruby_test.cpp | 2 +- source/tests/metacall_node_python_ruby_test/source/main.cpp | 2 +- .../source/metacall_node_python_ruby_test.cpp | 2 +- source/tests/metacall_node_reentrant_test/source/main.cpp | 2 +- .../source/metacall_node_reentrant_test.cpp | 2 +- .../tests/metacall_node_signal_handler_test/source/main.cpp | 2 +- .../source/metacall_node_signal_handler_test.cpp | 2 +- source/tests/metacall_node_test/source/main.cpp | 2 +- source/tests/metacall_node_test/source/metacall_node_test.cpp | 2 +- source/tests/metacall_node_typescript_test/source/main.cpp | 2 +- .../source/metacall_node_typescript_test.cpp | 2 +- .../source/main.cpp | 2 +- .../source/metacall_plugin_extension_destroy_order_test.cpp | 2 +- .../source/main.cpp | 2 +- .../source/metacall_plugin_extension_invalid_path_test.cpp | 2 +- .../metacall_plugin_extension_local_test/source/main.cpp | 2 +- .../source/metacall_plugin_extension_local_test.cpp | 2 +- source/tests/metacall_plugin_extension_test/source/main.cpp | 2 +- .../source/metacall_plugin_extension_test.cpp | 2 +- source/tests/metacall_python_await_test/source/main.cpp | 2 +- .../source/metacall_python_await_test.cpp | 2 +- source/tests/metacall_python_builtins_test/source/main.cpp | 2 +- .../source/metacall_python_builtins_test.cpp | 2 +- source/tests/metacall_python_callback_test/source/main.cpp | 2 +- .../source/metacall_python_callback_test.cpp | 2 +- source/tests/metacall_python_dict_test/source/main.cpp | 2 +- .../source/metacall_python_dict_test.cpp | 2 +- source/tests/metacall_python_exception_test/source/main.cpp | 2 +- .../source/metacall_python_exception_test.cpp | 2 +- source/tests/metacall_python_fail_test/source/main.cpp | 2 +- .../source/metacall_python_fail_test.cpp | 2 +- source/tests/metacall_python_gc_test/source/main.cpp | 2 +- .../source/metacall_python_gc_test.cpp | 2 +- source/tests/metacall_python_loader_port_test/source/main.cpp | 2 +- .../source/metacall_python_loader_port_test.cpp | 2 +- source/tests/metacall_python_model_test/source/main.cpp | 2 +- .../source/metacall_python_model_test.cpp | 2 +- source/tests/metacall_python_node_await_test/source/main.cpp | 2 +- .../source/metacall_python_node_await_test.cpp | 2 +- .../tests/metacall_python_object_class_test/source/main.cpp | 2 +- .../source/metacall_python_object_class_test.cpp | 2 +- source/tests/metacall_python_open_test/source/main.cpp | 2 +- .../source/metacall_python_open_test.cpp | 2 +- source/tests/metacall_python_pointer_test/source/main.cpp | 2 +- .../source/metacall_python_pointer_test.cpp | 2 +- .../tests/metacall_python_port_callback_test/source/main.cpp | 2 +- .../source/metacall_python_port_callback_test.cpp | 2 +- source/tests/metacall_python_port_https_test/source/main.cpp | 2 +- .../source/metacall_python_port_https_test.cpp | 2 +- source/tests/metacall_python_port_import_test/source/main.cpp | 2 +- .../source/metacall_python_port_import_test.cpp | 2 +- .../tests/metacall_python_port_pointer_test/source/main.cpp | 2 +- .../source/metacall_python_port_pointer_test.cpp | 2 +- source/tests/metacall_python_port_test/source/main.cpp | 2 +- .../source/metacall_python_port_test.cpp | 2 +- source/tests/metacall_python_reentrant_test/source/main.cpp | 2 +- .../source/metacall_python_reentrant_test.cpp | 2 +- .../tests/metacall_python_relative_path_test/source/main.cpp | 2 +- .../source/metacall_python_relative_path_test.cpp | 2 +- source/tests/metacall_python_test/source/main.cpp | 2 +- .../metacall_python_test/source/metacall_python_test.cpp | 2 +- source/tests/metacall_python_varargs_test/source/main.cpp | 2 +- .../source/metacall_python_varargs_test.cpp | 2 +- .../metacall_python_without_env_vars_test/source/main.cpp | 2 +- .../source/metacall_python_without_env_vars_test.cpp | 2 +- .../metacall_python_without_functions_test/source/main.cpp | 2 +- .../source/metacall_python_without_functions_test.cpp | 2 +- source/tests/metacall_reinitialize_test/source/main.cpp | 2 +- .../source/metacall_reinitialize_test.cpp | 2 +- source/tests/metacall_reload_functions_test/source/main.cpp | 2 +- .../source/metacall_reload_functions_test.cpp | 2 +- source/tests/metacall_return_monad_test/source/main.cpp | 2 +- .../source/metacall_return_monad_test.cpp | 2 +- source/tests/metacall_rpc_test/source/main.cpp | 2 +- source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp | 2 +- source/tests/metacall_ruby_fail_empty_test/source/main.cpp | 2 +- .../source/metacall_ruby_fail_empty_test.cpp | 2 +- source/tests/metacall_ruby_fail_test/source/main.cpp | 2 +- .../source/metacall_ruby_fail_test.cpp | 2 +- source/tests/metacall_ruby_object_class_test/source/main.cpp | 2 +- .../source/metacall_ruby_object_class_test.cpp | 2 +- .../metacall_ruby_parser_integration_test/source/main.cpp | 2 +- .../source/metacall_ruby_parser_integration_test.cpp | 2 +- .../metacall_ruby_rails_integration_test/source/main.cpp | 2 +- .../source/metacall_ruby_rails_integration_test.cpp | 2 +- source/tests/metacall_ruby_test/source/main.cpp | 2 +- source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp | 2 +- source/tests/metacall_rust_class_test/source/main.cpp | 2 +- .../source/metacall_rust_class_test.cpp | 2 +- source/tests/metacall_rust_load_from_mem_test/source/main.cpp | 2 +- .../source/metacall_rust_load_from_mem_test.cpp | 2 +- .../source/main.cpp | 2 +- .../source/metacall_rust_load_from_package_class_test.cpp | 2 +- .../metacall_rust_load_from_package_dep_test/source/main.cpp | 2 +- .../source/metacall_rust_load_from_package_dep_test.cpp | 2 +- .../metacall_rust_load_from_package_test/source/main.cpp | 2 +- .../source/metacall_rust_load_from_package_test.cpp | 2 +- source/tests/metacall_rust_test/source/main.cpp | 2 +- source/tests/metacall_rust_test/source/metacall_rust_test.cpp | 2 +- source/tests/metacall_sandbox_plugin_test/source/main.cpp | 2 +- .../source/metacall_sandbox_plugin_test.cpp | 2 +- source/tests/metacall_test/source/main.cpp | 2 +- source/tests/metacall_test/source/metacall_test.cpp | 2 +- source/tests/metacall_test/source/metacall_test_split.cpp | 2 +- .../tests/metacall_typescript_call_map_test/source/main.cpp | 2 +- .../source/metacall_typescript_call_map_test.cpp | 2 +- .../metacall_typescript_jsx_default_test/source/main.cpp | 2 +- .../source/metacall_typescript_jsx_default_test.cpp | 2 +- source/tests/metacall_typescript_node_test/source/main.cpp | 2 +- .../source/metacall_typescript_node_test.cpp | 2 +- source/tests/metacall_typescript_require_test/source/main.cpp | 2 +- .../source/metacall_typescript_require_test.cpp | 2 +- source/tests/metacall_typescript_test/source/main.cpp | 2 +- .../source/metacall_typescript_test.cpp | 2 +- .../metacall_typescript_tsx_loop_fail_test/source/main.cpp | 2 +- .../source/metacall_typescript_tsx_loop_fail_test.cpp | 2 +- source/tests/metacall_typescript_tsx_test/source/main.cpp | 2 +- .../source/metacall_typescript_tsx_test.cpp | 2 +- source/tests/metacall_version_test/source/main.cpp | 2 +- .../metacall_version_test/source/metacall_version_test.cpp | 2 +- source/tests/metacall_wasm_python_port_test/source/main.cpp | 2 +- .../source/metacall_wasm_python_port_test.cpp | 2 +- source/tests/metacall_wasm_test/source/main.cpp | 2 +- source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp | 2 +- source/tests/portability_path_test/source/main.cpp | 2 +- .../portability_path_test/source/portability_path_test.cpp | 2 +- source/tests/preprocessor_test/source/main.cpp | 2 +- source/tests/preprocessor_test/source/preprocessor_test.cpp | 2 +- source/tests/rb_loader_parser_test/source/main.cpp | 2 +- .../rb_loader_parser_test/source/rb_loader_parser_test.cpp | 2 +- source/tests/reflect_function_test/source/main.cpp | 2 +- .../reflect_function_test/source/reflect_function_test.cpp | 2 +- source/tests/reflect_metadata_test/source/main.cpp | 2 +- .../reflect_metadata_test/source/reflect_metadata_test.cpp | 2 +- source/tests/reflect_object_class_test/source/main.cpp | 2 +- .../source/reflect_object_class_test.cpp | 2 +- source/tests/reflect_scope_test/source/main.cpp | 2 +- source/tests/reflect_scope_test/source/reflect_scope_test.cpp | 2 +- source/tests/reflect_value_cast_test/source/main.cpp | 2 +- .../source/reflect_value_cast_bool_test.cpp | 2 +- .../source/reflect_value_cast_char_test.cpp | 2 +- .../source/reflect_value_cast_double_test.cpp | 2 +- .../source/reflect_value_cast_float_test.cpp | 2 +- .../source/reflect_value_cast_int_test.cpp | 2 +- .../source/reflect_value_cast_long_test.cpp | 2 +- .../source/reflect_value_cast_short_test.cpp | 2 +- source/tests/serial_test/source/main.cpp | 2 +- source/tests/serial_test/source/serial_test.cpp | 2 +- source/threading/include/threading/threading.h | 2 +- source/threading/include/threading/threading_atomic.h | 2 +- .../threading/include/threading/threading_atomic_ref_count.h | 2 +- source/threading/include/threading/threading_atomic_win32.h | 2 +- source/threading/include/threading/threading_mutex.h | 2 +- source/threading/include/threading/threading_thread_id.h | 2 +- source/threading/source/threading.c | 4 ++-- source/threading/source/threading_mutex_macos.c | 2 +- source/threading/source/threading_mutex_pthread.c | 2 +- source/threading/source/threading_mutex_win32.c | 2 +- source/threading/source/threading_thread_id.c | 2 +- source/version/include/version/version.h | 2 +- source/version/include/version/version.h.in | 2 +- source/version/source/version.c | 4 ++-- tools/cli/Dockerfile | 2 +- tools/deps/Dockerfile | 2 +- tools/dev/Dockerfile | 2 +- tools/metacall-build.ps1 | 2 +- tools/metacall-build.sh | 2 +- tools/metacall-configure.ps1 | 2 +- tools/metacall-configure.sh | 2 +- tools/metacall-environment.ps1 | 2 +- tools/metacall-environment.sh | 2 +- tools/metacall-license.sh | 4 ++-- tools/metacall-runtime.sh | 2 +- tools/metacall-sanitizer.sh | 2 +- tools/runtime/Dockerfile | 2 +- 925 files changed, 969 insertions(+), 969 deletions(-) diff --git a/.env b/.env index 2e5bae29a..cf3ae699c 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker image infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/CMakeLists.txt b/CMakeLists.txt index 75da78355..f543559e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # A library for providing a foreing function interface calls. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/Dockerfile b/Dockerfile index 915d0f4a5..a81cfd453 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker image infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/LICENSE b/LICENSE index 2e591e57a..d56ad81fa 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmake/CMakeDebug.cmake b/cmake/CMakeDebug.cmake index 632183fa1..dd80a221b 100644 --- a/cmake/CMakeDebug.cmake +++ b/cmake/CMakeDebug.cmake @@ -2,7 +2,7 @@ # CMake Debug Utilities by Parra Studios # CMake debugging utilities and inspection facilities. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/CheckCCompilerFlagStackSmashing.cmake b/cmake/CheckCCompilerFlagStackSmashing.cmake index 1662f4023..ea31ed5d7 100644 --- a/cmake/CheckCCompilerFlagStackSmashing.cmake +++ b/cmake/CheckCCompilerFlagStackSmashing.cmake @@ -2,7 +2,7 @@ # Compiler checker for stack smashing flags by Parra Studios # Tests if a defined stack smashing security flag is available. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/CheckCXXCompilerFlagStackSmashing.cmake b/cmake/CheckCXXCompilerFlagStackSmashing.cmake index eff0c6bfa..9fa7f9589 100644 --- a/cmake/CheckCXXCompilerFlagStackSmashing.cmake +++ b/cmake/CheckCXXCompilerFlagStackSmashing.cmake @@ -2,7 +2,7 @@ # Compiler checker for stack smashing flags by Parra Studios # Tests if a defined stack smashing security flag is available. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/Coverage.cmake b/cmake/Coverage.cmake index e363f5a58..4a15b0efc 100644 --- a/cmake/Coverage.cmake +++ b/cmake/Coverage.cmake @@ -2,7 +2,7 @@ # Coverage CMake support by Parra Studios # Cross-compiler code coverage utility. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindCobol.cmake b/cmake/FindCobol.cmake index 4a943d074..c85a5cb46 100644 --- a/cmake/FindCobol.cmake +++ b/cmake/FindCobol.cmake @@ -2,7 +2,7 @@ # CMake Find GNU/Cobol by Parra Studios # CMake script to find GNU/Cobol compiler and runtime. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindCoreCLR.cmake b/cmake/FindCoreCLR.cmake index 1ae2a4455..884d3c113 100644 --- a/cmake/FindCoreCLR.cmake +++ b/cmake/FindCoreCLR.cmake @@ -2,7 +2,7 @@ # CMake Find CoreCLR NET Engine by Parra Studios # CMake script to find CoreCLR NET Engine. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindDotNET.cmake b/cmake/FindDotNET.cmake index 859b4977b..57c2d4dc9 100644 --- a/cmake/FindDotNET.cmake +++ b/cmake/FindDotNET.cmake @@ -2,7 +2,7 @@ # CMake Find Dot NET Engine by Parra Studios # CMake script to find DotNET Engine. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindGBench.cmake b/cmake/FindGBench.cmake index 958402979..74eacb0b8 100644 --- a/cmake/FindGBench.cmake +++ b/cmake/FindGBench.cmake @@ -2,7 +2,7 @@ # CMake Find Google Benchmark by Parra Studios # CMake script to find Google Benchmark library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindJulia.cmake b/cmake/FindJulia.cmake index 355774846..bf3c30d3b 100644 --- a/cmake/FindJulia.cmake +++ b/cmake/FindJulia.cmake @@ -2,7 +2,7 @@ # CMake Find Julia Runtime by Parra Studios # CMake script to find Julia runtime. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindLibClang.cmake b/cmake/FindLibClang.cmake index 9b07a6b36..bbf4d2c25 100644 --- a/cmake/FindLibClang.cmake +++ b/cmake/FindLibClang.cmake @@ -2,7 +2,7 @@ # CMake Find Clang library by Parra Studios # CMake script to find Clang C API library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindLibFFI.cmake b/cmake/FindLibFFI.cmake index b86cf7d8d..313925b13 100644 --- a/cmake/FindLibFFI.cmake +++ b/cmake/FindLibFFI.cmake @@ -2,7 +2,7 @@ # CMake Find Foreing Function Interface library by Parra Studios # CMake script to find FFI library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindLibTCC.cmake b/cmake/FindLibTCC.cmake index c75c69419..83c2e4ac5 100644 --- a/cmake/FindLibTCC.cmake +++ b/cmake/FindLibTCC.cmake @@ -2,7 +2,7 @@ # CMake Find Tiny C Compiler library by Parra Studios # CMake script to find TCC library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindMetaCall.cmake b/cmake/FindMetaCall.cmake index f25310921..f974e9509 100644 --- a/cmake/FindMetaCall.cmake +++ b/cmake/FindMetaCall.cmake @@ -2,7 +2,7 @@ # CMake Find MetaCall library by Parra Studios # CMake script to find and include MetaCall library for development. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindNPM.cmake b/cmake/FindNPM.cmake index 1cdcda92d..2a61990e2 100644 --- a/cmake/FindNPM.cmake +++ b/cmake/FindNPM.cmake @@ -2,7 +2,7 @@ # CMake Find NPM by Parra Studios # CMake script to find NodeJS Package Manager. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindNodeJS.cmake b/cmake/FindNodeJS.cmake index a4c7db292..1bec27069 100644 --- a/cmake/FindNodeJS.cmake +++ b/cmake/FindNodeJS.cmake @@ -1,6 +1,6 @@ # # CMake Find NodeJS JavaScript Runtime by Parra Studios -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Find NodeJS executable and include paths diff --git a/cmake/FindPatchelf.cmake b/cmake/FindPatchelf.cmake index af0dd619c..044cd412d 100644 --- a/cmake/FindPatchelf.cmake +++ b/cmake/FindPatchelf.cmake @@ -2,7 +2,7 @@ # CMake Find Patchelf by Parra Studios # CMake script to find Patchelf executable. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindRapidJSON.cmake b/cmake/FindRapidJSON.cmake index af111fafe..26b0d6b1e 100644 --- a/cmake/FindRapidJSON.cmake +++ b/cmake/FindRapidJSON.cmake @@ -2,7 +2,7 @@ # CMake Find RapidJSON by Parra Studios # CMake script to find RapidJSON library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindRust.cmake b/cmake/FindRust.cmake index 58e61876c..c9ef316aa 100644 --- a/cmake/FindRust.cmake +++ b/cmake/FindRust.cmake @@ -2,7 +2,7 @@ # CMake Find Rust by Parra Studios # CMake script to find Rust compiler and tools. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindSpiderMonkey.cmake b/cmake/FindSpiderMonkey.cmake index 8da1d5254..a952c9e4e 100644 --- a/cmake/FindSpiderMonkey.cmake +++ b/cmake/FindSpiderMonkey.cmake @@ -2,7 +2,7 @@ # CMake Find Mozilla SpiderMonkey JavaScript Engine by Parra Studios # CMake script to find Mozilla SpiderMonkey Javascript Engine. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindV8.cmake b/cmake/FindV8.cmake index a995b1d3c..aedb8a8d7 100644 --- a/cmake/FindV8.cmake +++ b/cmake/FindV8.cmake @@ -2,7 +2,7 @@ # CMake Find V8 Google JavaScript Engine by Parra Studios # CMake script to find V8 JavaScript Engine. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/FindWasmtime.cmake b/cmake/FindWasmtime.cmake index a68272c0c..bf086293a 100644 --- a/cmake/FindWasmtime.cmake +++ b/cmake/FindWasmtime.cmake @@ -1,6 +1,6 @@ # # CMake Find Wasmtime WebAssembly Runtime by Parra Studios -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Find Wasmtime library and include paths diff --git a/cmake/FindZig.cmake b/cmake/FindZig.cmake index 286ec5f53..cb2764032 100644 --- a/cmake/FindZig.cmake +++ b/cmake/FindZig.cmake @@ -2,7 +2,7 @@ # CMake Find Zig by Parra Studios # CMake script to find Zig compiler and tools. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/InstallGBench.cmake b/cmake/InstallGBench.cmake index 5d6956a53..ccf3073d7 100644 --- a/cmake/InstallGBench.cmake +++ b/cmake/InstallGBench.cmake @@ -2,7 +2,7 @@ # CMake Install Google Benchmark by Parra Studios # CMake script to install Google Benchmark library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/InstallGTest.cmake b/cmake/InstallGTest.cmake index f6d025c79..7977751f0 100644 --- a/cmake/InstallGTest.cmake +++ b/cmake/InstallGTest.cmake @@ -2,7 +2,7 @@ # CMake Install Google Test by Parra Studios # CMake script to install Google Test library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/InstallLibTCC.cmake b/cmake/InstallLibTCC.cmake index 18483bba2..23a780e26 100644 --- a/cmake/InstallLibTCC.cmake +++ b/cmake/InstallLibTCC.cmake @@ -2,7 +2,7 @@ # CMake Install Tiny C Compiler by Parra Studios # CMake script to install TCC library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/InstallPatchelf.cmake b/cmake/InstallPatchelf.cmake index a001e136d..72b44a952 100644 --- a/cmake/InstallPatchelf.cmake +++ b/cmake/InstallPatchelf.cmake @@ -2,7 +2,7 @@ # CMake Find Patchelf by Parra Studios # CMake script to find Patchelf executable. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/InstallRapidJSON.cmake b/cmake/InstallRapidJSON.cmake index 44938fceb..41c302027 100644 --- a/cmake/InstallRapidJSON.cmake +++ b/cmake/InstallRapidJSON.cmake @@ -2,7 +2,7 @@ # CMake Install RapidJSON by Parra Studios # CMake script to install RapidJSON library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/Portability.cmake b/cmake/Portability.cmake index 75dc09c2f..86193291c 100644 --- a/cmake/Portability.cmake +++ b/cmake/Portability.cmake @@ -2,7 +2,7 @@ # Portability CMake support by Parra Studios # Cross-platform and architecture detection utility. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/ScriptProject.cmake b/cmake/ScriptProject.cmake index b078526fe..fb7d13835 100644 --- a/cmake/ScriptProject.cmake +++ b/cmake/ScriptProject.cmake @@ -2,7 +2,7 @@ # Script project generator by Parra Studios # Generates a script project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/SecurityFlags.cmake b/cmake/SecurityFlags.cmake index 515dc6f85..b31ccbbf7 100644 --- a/cmake/SecurityFlags.cmake +++ b/cmake/SecurityFlags.cmake @@ -2,7 +2,7 @@ # Compiler and linker options for hardening flags by Parra Studios # Enables hardening security flags if available. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/TestEnvironmentVariables.cmake b/cmake/TestEnvironmentVariables.cmake index 43189a72e..1255f2bb4 100644 --- a/cmake/TestEnvironmentVariables.cmake +++ b/cmake/TestEnvironmentVariables.cmake @@ -2,7 +2,7 @@ # Test Environment Variables by Parra Studios # Utility for defining cross-platform environment variables in tests. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/cmake/Warnings.cmake b/cmake/Warnings.cmake index 5c9b44da7..685d3b6a8 100644 --- a/cmake/Warnings.cmake +++ b/cmake/Warnings.cmake @@ -2,7 +2,7 @@ # Cross-compiler warning utility by Parra Studios # Utility to enable cross-compiler warnings. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/deploy/packages/postinst b/deploy/packages/postinst index d798c724d..8ae7a6fa6 100755 --- a/deploy/packages/postinst +++ b/deploy/packages/postinst @@ -4,7 +4,7 @@ # MetaCall Dependencies Bash Script by Parra Studios # Remove all packages and unused data from MetaCall building and testing. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/docker-compose.cache.yml b/docker-compose.cache.yml index 231525f1c..63b1b455c 100644 --- a/docker-compose.cache.yml +++ b/docker-compose.cache.yml @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker compose infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/docker-compose.platform.yml b/docker-compose.platform.yml index 46b3b0825..b22964bf5 100644 --- a/docker-compose.platform.yml +++ b/docker-compose.platform.yml @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker compose infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/docker-compose.sh b/docker-compose.sh index 9c075acf8..f2f134230 100755 --- a/docker-compose.sh +++ b/docker-compose.sh @@ -4,7 +4,7 @@ # MetaCall Build Bash Script by Parra Studios # Build and install bash script utility for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/docker-compose.test.yml b/docker-compose.test.yml index db095b533..5dadee3cb 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker compose infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/docker-compose.yml b/docker-compose.yml index d7383d654..38e167b44 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker compose infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/docs/README.md b/docs/README.md index ff4002b4b..446569788 100644 --- a/docs/README.md +++ b/docs/README.md @@ -868,7 +868,7 @@ Where `script.js` is a script contained in host folder `$HOME/metacall` that wil **METACALL** is licensed under **[Apache License Version 2.0](/LICENSE)**. -> Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <<vic798@gmail.com>> +> Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <<vic798@gmail.com>> > > Licensed under the Apache License, Version 2.0 (the "License"); > you may not use this file except in compliance with the License. diff --git a/metacall-config-version.cmake.in b/metacall-config-version.cmake.in index c26ac86e9..a25c169f2 100644 --- a/metacall-config-version.cmake.in +++ b/metacall-config-version.cmake.in @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # A library for providing a foreing function interface calls. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/metacall-config.cmake.in b/metacall-config.cmake.in index b7f9f5b16..eb193eed4 100644 --- a/metacall-config.cmake.in +++ b/metacall-config.cmake.in @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # A library for providing a foreing function interface calls. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/adt/include/adt/adt.h b/source/adt/include/adt/adt.h index e957f0fc9..040bd1fc5 100644 --- a/source/adt/include/adt/adt.h +++ b/source/adt/include/adt/adt.h @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/include/adt/adt_bucket.h b/source/adt/include/adt/adt_bucket.h index 52a536aa1..4fb799f18 100644 --- a/source/adt/include/adt/adt_bucket.h +++ b/source/adt/include/adt/adt_bucket.h @@ -1,6 +1,6 @@ /* * Abstract Data Type Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A abstract data type library providing generic containers. * diff --git a/source/adt/include/adt/adt_comparable.h b/source/adt/include/adt/adt_comparable.h index d6ede6627..54fc2d2b8 100644 --- a/source/adt/include/adt/adt_comparable.h +++ b/source/adt/include/adt/adt_comparable.h @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/include/adt/adt_hash.h b/source/adt/include/adt/adt_hash.h index d2eefc611..3601d4676 100644 --- a/source/adt/include/adt/adt_hash.h +++ b/source/adt/include/adt/adt_hash.h @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/include/adt/adt_map.h b/source/adt/include/adt/adt_map.h index 351ce57fd..8fe9e1c5e 100644 --- a/source/adt/include/adt/adt_map.h +++ b/source/adt/include/adt/adt_map.h @@ -1,6 +1,6 @@ /* * Abstract Data Type Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A abstract data type library providing generic containers. * diff --git a/source/adt/include/adt/adt_set.h b/source/adt/include/adt/adt_set.h index a69457d69..64af95176 100644 --- a/source/adt/include/adt/adt_set.h +++ b/source/adt/include/adt/adt_set.h @@ -1,6 +1,6 @@ /* * Abstract Data Type Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A abstract data type library providing generic containers. * diff --git a/source/adt/include/adt/adt_string.h b/source/adt/include/adt/adt_string.h index 3ef21e06b..1b50369a8 100644 --- a/source/adt/include/adt/adt_string.h +++ b/source/adt/include/adt/adt_string.h @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/include/adt/adt_trie.h b/source/adt/include/adt/adt_trie.h index f6eec21a9..899e1f929 100644 --- a/source/adt/include/adt/adt_trie.h +++ b/source/adt/include/adt/adt_trie.h @@ -1,6 +1,6 @@ /* * Abstract Data Type Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A abstract data type library providing generic containers. * diff --git a/source/adt/include/adt/adt_vector.h b/source/adt/include/adt/adt_vector.h index 7cb7404b4..d72717168 100644 --- a/source/adt/include/adt/adt_vector.h +++ b/source/adt/include/adt/adt_vector.h @@ -1,6 +1,6 @@ /* * Abstract Data Type Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A abstract data type library providing generic containers. * diff --git a/source/adt/source/adt.c b/source/adt/source/adt.c index 227fbb9c9..eeaf24322 100644 --- a/source/adt/source/adt.c +++ b/source/adt/source/adt.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ const char *adt_print_info(void) { static const char adt_info[] = "Abstract Data Type Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef ADT_STATIC_DEFINE "Compiled as static library type" diff --git a/source/adt/source/adt_bucket.c b/source/adt/source/adt_bucket.c index fa039301d..98f739875 100644 --- a/source/adt/source/adt_bucket.c +++ b/source/adt/source/adt_bucket.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/source/adt_comparable.c b/source/adt/source/adt_comparable.c index 0b7133621..037be1f9b 100644 --- a/source/adt/source/adt_comparable.c +++ b/source/adt/source/adt_comparable.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/source/adt_hash.c b/source/adt/source/adt_hash.c index 766c68c47..2800af3b6 100644 --- a/source/adt/source/adt_hash.c +++ b/source/adt/source/adt_hash.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/source/adt_map.c b/source/adt/source/adt_map.c index 75d5bcdab..9f54b623f 100644 --- a/source/adt/source/adt_map.c +++ b/source/adt/source/adt_map.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/source/adt_set.c b/source/adt/source/adt_set.c index a25d6d8a0..d7f38ea95 100644 --- a/source/adt/source/adt_set.c +++ b/source/adt/source/adt_set.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/source/adt_trie.c b/source/adt/source/adt_trie.c index 71065b6ea..12b934243 100644 --- a/source/adt/source/adt_trie.c +++ b/source/adt/source/adt_trie.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/adt/source/adt_vector.c b/source/adt/source/adt_vector.c index d4a725773..0047cc118 100644 --- a/source/adt/source/adt_vector.c +++ b/source/adt/source/adt_vector.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/benchmarks/log_bench/source/log_bench.cpp b/source/benchmarks/log_bench/source/log_bench.cpp index 9ca700767..73bb489fe 100644 --- a/source/benchmarks/log_bench/source/log_bench.cpp +++ b/source/benchmarks/log_bench/source/log_bench.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/benchmarks/metacall_cs_call_bench/source/metacall_cs_call_bench.cpp b/source/benchmarks/metacall_cs_call_bench/source/metacall_cs_call_bench.cpp index d0acd24cc..179dfaf6c 100644 --- a/source/benchmarks/metacall_cs_call_bench/source/metacall_cs_call_bench.cpp +++ b/source/benchmarks/metacall_cs_call_bench/source/metacall_cs_call_bench.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/benchmarks/metacall_node_call_bench/source/metacall_node_call_bench.cpp b/source/benchmarks/metacall_node_call_bench/source/metacall_node_call_bench.cpp index 15861f525..16d2c987b 100644 --- a/source/benchmarks/metacall_node_call_bench/source/metacall_node_call_bench.cpp +++ b/source/benchmarks/metacall_node_call_bench/source/metacall_node_call_bench.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/benchmarks/metacall_py_c_api_bench/source/metacall_py_c_api_bench.cpp b/source/benchmarks/metacall_py_c_api_bench/source/metacall_py_c_api_bench.cpp index de8f43d8b..e1db6bb14 100644 --- a/source/benchmarks/metacall_py_c_api_bench/source/metacall_py_c_api_bench.cpp +++ b/source/benchmarks/metacall_py_c_api_bench/source/metacall_py_c_api_bench.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/benchmarks/metacall_py_call_bench/source/metacall_py_call_bench.cpp b/source/benchmarks/metacall_py_call_bench/source/metacall_py_call_bench.cpp index 74d0bc7c5..68b0bf589 100644 --- a/source/benchmarks/metacall_py_call_bench/source/metacall_py_call_bench.cpp +++ b/source/benchmarks/metacall_py_call_bench/source/metacall_py_call_bench.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/benchmarks/metacall_py_init_bench/source/metacall_py_init_bench.cpp b/source/benchmarks/metacall_py_init_bench/source/metacall_py_init_bench.cpp index ee60fee48..9a1ef4a88 100644 --- a/source/benchmarks/metacall_py_init_bench/source/metacall_py_init_bench.cpp +++ b/source/benchmarks/metacall_py_init_bench/source/metacall_py_init_bench.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/benchmarks/metacall_rb_call_bench/source/metacall_rb_call_bench.cpp b/source/benchmarks/metacall_rb_call_bench/source/metacall_rb_call_bench.cpp index 903530eae..4dc75e942 100644 --- a/source/benchmarks/metacall_rb_call_bench/source/metacall_rb_call_bench.cpp +++ b/source/benchmarks/metacall_rb_call_bench/source/metacall_rb_call_bench.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/cli/metacallcli/include/metacallcli/application.hpp b/source/cli/metacallcli/include/metacallcli/application.hpp index 0fc2f788d..c2e7863a8 100644 --- a/source/cli/metacallcli/include/metacallcli/application.hpp +++ b/source/cli/metacallcli/include/metacallcli/application.hpp @@ -1,6 +1,6 @@ /* * MetaCall Command Line Interface by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A command line interface example as metacall wrapper. * diff --git a/source/cli/metacallcli/source/application.cpp b/source/cli/metacallcli/source/application.cpp index 0ba037683..0f439da61 100644 --- a/source/cli/metacallcli/source/application.cpp +++ b/source/cli/metacallcli/source/application.cpp @@ -1,6 +1,6 @@ /* * MetaCall Command Line Interface by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A command line interface example as metacall wrapper. * diff --git a/source/cli/metacallcli/source/main.cpp b/source/cli/metacallcli/source/main.cpp index 1821d04b5..8c41f1915 100644 --- a/source/cli/metacallcli/source/main.cpp +++ b/source/cli/metacallcli/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Command Line Interface by Parra Studios * A command line interface example as metacall wrapper. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/cli/plugins/cli_cmd_plugin/include/cli_cmd_plugin/cli_cmd_plugin.hpp b/source/cli/plugins/cli_cmd_plugin/include/cli_cmd_plugin/cli_cmd_plugin.hpp index 9565754ca..3a82b7846 100644 --- a/source/cli/plugins/cli_cmd_plugin/include/cli_cmd_plugin/cli_cmd_plugin.hpp +++ b/source/cli/plugins/cli_cmd_plugin/include/cli_cmd_plugin/cli_cmd_plugin.hpp @@ -2,7 +2,7 @@ * CLI Command Plugin by Parra Studios * A plugin implementing command line functionality for MetaCall CLI. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/cli/plugins/cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h b/source/cli/plugins/cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h index 6c4446d9e..5f43a1358 100644 --- a/source/cli/plugins/cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h +++ b/source/cli/plugins/cli_core_plugin/include/cli_core_plugin/cli_core_plugin.h @@ -2,7 +2,7 @@ * CLI Core Plugin by Parra Studios * A plugin implementing core functionality for MetaCall CLI. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/cli/plugins/cli_core_plugin/source/cli_core_plugin.cpp b/source/cli/plugins/cli_core_plugin/source/cli_core_plugin.cpp index 5563fc426..ea19c681d 100644 --- a/source/cli/plugins/cli_core_plugin/source/cli_core_plugin.cpp +++ b/source/cli/plugins/cli_core_plugin/source/cli_core_plugin.cpp @@ -2,7 +2,7 @@ * CLI Core Plugin by Parra Studios * A plugin implementing core functionality for MetaCall CLI. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ std::cout << "MetaCall Command Line Interface by Parra Studios" << std::endl; \ std::cout << "A command line interface for MetaCall Core" << std::endl; \ std::cout << std::endl; \ - std::cout << "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>" << std::endl; \ + std::cout << "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>" << std::endl; \ } while (0) template <typename result_type, typename cast_func_type> diff --git a/source/cli/plugins/cli_sandbox_plugin/include/cli_sandbox_plugin/cli_sandbox_plugin.h b/source/cli/plugins/cli_sandbox_plugin/include/cli_sandbox_plugin/cli_sandbox_plugin.h index a11ef6abc..f731ac1c0 100644 --- a/source/cli/plugins/cli_sandbox_plugin/include/cli_sandbox_plugin/cli_sandbox_plugin.h +++ b/source/cli/plugins/cli_sandbox_plugin/include/cli_sandbox_plugin/cli_sandbox_plugin.h @@ -2,7 +2,7 @@ * CLI Sandbox Plugin by Parra Studios * A plugin implementing sandboxing functionality for MetaCall CLI. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/cli/plugins/cli_sandbox_plugin/source/cli_sandbox_plugin.cpp b/source/cli/plugins/cli_sandbox_plugin/source/cli_sandbox_plugin.cpp index f7a78b130..8a5390fab 100644 --- a/source/cli/plugins/cli_sandbox_plugin/source/cli_sandbox_plugin.cpp +++ b/source/cli/plugins/cli_sandbox_plugin/source/cli_sandbox_plugin.cpp @@ -2,7 +2,7 @@ * CLI Sandbox Plugin by Parra Studios * A plugin implementing sandboxing functionality for MetaCall CLI. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/configuration/include/configuration/configuration.h b/source/configuration/include/configuration/configuration.h index 9182d8a09..3fa7811fa 100644 --- a/source/configuration/include/configuration/configuration.h +++ b/source/configuration/include/configuration/configuration.h @@ -1,6 +1,6 @@ /* * Configuration Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple configuration formats. * diff --git a/source/configuration/include/configuration/configuration_impl.h b/source/configuration/include/configuration/configuration_impl.h index bac8d2e89..7c733b762 100644 --- a/source/configuration/include/configuration/configuration_impl.h +++ b/source/configuration/include/configuration/configuration_impl.h @@ -2,7 +2,7 @@ * Configuration Library by Parra Studios * A cross-platform library for managing multiple configuration formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/configuration/include/configuration/configuration_object.h b/source/configuration/include/configuration/configuration_object.h index d98e920dd..2c22e6eb2 100644 --- a/source/configuration/include/configuration/configuration_object.h +++ b/source/configuration/include/configuration/configuration_object.h @@ -2,7 +2,7 @@ * Configuration Library by Parra Studios * A cross-platform library for managing multiple configuration formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/configuration/include/configuration/configuration_object_handle.h b/source/configuration/include/configuration/configuration_object_handle.h index 73bfc7f04..67b5011b9 100644 --- a/source/configuration/include/configuration/configuration_object_handle.h +++ b/source/configuration/include/configuration/configuration_object_handle.h @@ -2,7 +2,7 @@ * Configuration Library by Parra Studios * A cross-platform library for managing multiple configuration formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/configuration/include/configuration/configuration_singleton.h b/source/configuration/include/configuration/configuration_singleton.h index 44b1e52d1..5dbc6fa83 100644 --- a/source/configuration/include/configuration/configuration_singleton.h +++ b/source/configuration/include/configuration/configuration_singleton.h @@ -1,6 +1,6 @@ /* * Configuration Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple configuration formats. * diff --git a/source/configuration/source/configuration.c b/source/configuration/source/configuration.c index 0d287e7b3..365fdaf0c 100644 --- a/source/configuration/source/configuration.c +++ b/source/configuration/source/configuration.c @@ -1,6 +1,6 @@ /* * Configuration Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple configuration formats. * @@ -254,7 +254,7 @@ const char *configuration_print_info(void) { static const char configuration_info[] = "Configuration Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef CONFIGURATION_STATIC_DEFINE "Compiled as static library type" diff --git a/source/configuration/source/configuration_impl.c b/source/configuration/source/configuration_impl.c index 137645119..ca61ed14b 100644 --- a/source/configuration/source/configuration_impl.c +++ b/source/configuration/source/configuration_impl.c @@ -1,6 +1,6 @@ /* * Configuration Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple configuration formats. * diff --git a/source/configuration/source/configuration_object.c b/source/configuration/source/configuration_object.c index f7044c97b..2509992bf 100644 --- a/source/configuration/source/configuration_object.c +++ b/source/configuration/source/configuration_object.c @@ -1,6 +1,6 @@ /* * Configuration Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple configuration formats. * diff --git a/source/configuration/source/configuration_singleton.c b/source/configuration/source/configuration_singleton.c index 5b3181267..ea440cc7c 100644 --- a/source/configuration/source/configuration_singleton.c +++ b/source/configuration/source/configuration_singleton.c @@ -1,6 +1,6 @@ /* * Configuration Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple configuration formats. * diff --git a/source/detour/include/detour/detour.h b/source/detour/include/detour/detour.h index d061bf19b..fca7d3ee1 100644 --- a/source/detour/include/detour/detour.h +++ b/source/detour/include/detour/detour.h @@ -1,6 +1,6 @@ /* * Detour Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library providing detours, function hooks and trampolines. * diff --git a/source/detour/include/detour/detour_handle.h b/source/detour/include/detour/detour_handle.h index 7e9dde1b8..28f21848d 100644 --- a/source/detour/include/detour/detour_handle.h +++ b/source/detour/include/detour/detour_handle.h @@ -2,7 +2,7 @@ * Detour Library by Parra Studios * A cross-platform library providing detours, function hooks and trampolines. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/detour/include/detour/detour_interface.h b/source/detour/include/detour/detour_interface.h index 425ba151d..5207622ba 100644 --- a/source/detour/include/detour/detour_interface.h +++ b/source/detour/include/detour/detour_interface.h @@ -2,7 +2,7 @@ * Detour Library by Parra Studios * A cross-platform library providing detours, function hooks and trampolines. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/detour/source/detour.c b/source/detour/source/detour.c index 5503f4494..9da330372 100644 --- a/source/detour/source/detour.c +++ b/source/detour/source/detour.c @@ -1,6 +1,6 @@ /* * Detour Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library providing detours, function hooks and trampolines. * @@ -169,7 +169,7 @@ const char *detour_print_info(void) { static const char detour_info[] = "Detour Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef DETOUR_STATIC_DEFINE "Compiled as static library type" diff --git a/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h b/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h index 551ace90b..98a71ea43 100644 --- a/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h +++ b/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h @@ -2,7 +2,7 @@ * Detour Library by Parra Studios * A cross-platform library providing detours, function hooks and trampolines. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/detours/funchook_detour/include/funchook_detour/funchook_detour_impl.h b/source/detours/funchook_detour/include/funchook_detour/funchook_detour_impl.h index 33b68d9e1..37cb640cd 100644 --- a/source/detours/funchook_detour/include/funchook_detour/funchook_detour_impl.h +++ b/source/detours/funchook_detour/include/funchook_detour/funchook_detour_impl.h @@ -2,7 +2,7 @@ * Detour Library by Parra Studios * A cross-platform library providing detours, function hooks and trampolines. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/detours/funchook_detour/source/funchook_detour.c b/source/detours/funchook_detour/source/funchook_detour.c index 93b680165..9a15057fa 100644 --- a/source/detours/funchook_detour/source/funchook_detour.c +++ b/source/detours/funchook_detour/source/funchook_detour.c @@ -1,6 +1,6 @@ /* * Detour Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library providing detours, function hooks and trampolines. * @@ -31,7 +31,7 @@ const char *funchook_detour_print_info(void) { static const char funchook_detour_info[] = "FuncHook Detour Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef FUNCHOOK_DETOUR_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/detours/funchook_detour/source/funchook_detour_impl.c b/source/detours/funchook_detour/source/funchook_detour_impl.c index 3eccf9545..83c25a1dc 100644 --- a/source/detours/funchook_detour/source/funchook_detour_impl.c +++ b/source/detours/funchook_detour/source/funchook_detour_impl.c @@ -1,6 +1,6 @@ /* * Detour Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library providing detours, function hooks and trampolines. * diff --git a/source/dynlink/include/dynlink/dynlink.h b/source/dynlink/include/dynlink/dynlink.h index d1bdaf8d0..28080638a 100644 --- a/source/dynlink/include/dynlink/dynlink.h +++ b/source/dynlink/include/dynlink/dynlink.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/include/dynlink/dynlink_flags.h b/source/dynlink/include/dynlink/dynlink_flags.h index 9b870abae..2f64619e7 100644 --- a/source/dynlink/include/dynlink/dynlink_flags.h +++ b/source/dynlink/include/dynlink/dynlink_flags.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/include/dynlink/dynlink_impl.h b/source/dynlink/include/dynlink/dynlink_impl.h index 8f09c5195..f6af1d6fb 100644 --- a/source/dynlink/include/dynlink/dynlink_impl.h +++ b/source/dynlink/include/dynlink/dynlink_impl.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/include/dynlink/dynlink_impl_beos.h b/source/dynlink/include/dynlink/dynlink_impl_beos.h index 60efcdc2a..52b2bea36 100644 --- a/source/dynlink/include/dynlink/dynlink_impl_beos.h +++ b/source/dynlink/include/dynlink/dynlink_impl_beos.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/include/dynlink/dynlink_impl_macos.h b/source/dynlink/include/dynlink/dynlink_impl_macos.h index 404235e30..51a7ec6cb 100644 --- a/source/dynlink/include/dynlink/dynlink_impl_macos.h +++ b/source/dynlink/include/dynlink/dynlink_impl_macos.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/include/dynlink/dynlink_impl_unix.h b/source/dynlink/include/dynlink/dynlink_impl_unix.h index cb239a1d8..972b23c90 100644 --- a/source/dynlink/include/dynlink/dynlink_impl_unix.h +++ b/source/dynlink/include/dynlink/dynlink_impl_unix.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/include/dynlink/dynlink_impl_win32.h b/source/dynlink/include/dynlink/dynlink_impl_win32.h index 9bd39af77..a44fb9d82 100644 --- a/source/dynlink/include/dynlink/dynlink_impl_win32.h +++ b/source/dynlink/include/dynlink/dynlink_impl_win32.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/include/dynlink/dynlink_interface.h b/source/dynlink/include/dynlink/dynlink_interface.h index 0a33fa608..80b34fc39 100644 --- a/source/dynlink/include/dynlink/dynlink_interface.h +++ b/source/dynlink/include/dynlink/dynlink_interface.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/include/dynlink/dynlink_type.h b/source/dynlink/include/dynlink/dynlink_type.h index 5347eb51a..cc759e25f 100644 --- a/source/dynlink/include/dynlink/dynlink_type.h +++ b/source/dynlink/include/dynlink/dynlink_type.h @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/source/dynlink.c b/source/dynlink/source/dynlink.c index bc2a6b843..16266c163 100644 --- a/source/dynlink/source/dynlink.c +++ b/source/dynlink/source/dynlink.c @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -196,7 +196,7 @@ const char *dynlink_print_info(void) { static const char dynlink_info[] = "Dynamic Link Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef DYNLINK_STATIC_DEFINE "Compiled as static library type" diff --git a/source/dynlink/source/dynlink_impl.c b/source/dynlink/source/dynlink_impl.c index 2c2da41e6..86092ad43 100644 --- a/source/dynlink/source/dynlink_impl.c +++ b/source/dynlink/source/dynlink_impl.c @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/source/dynlink_impl_beos.c b/source/dynlink/source/dynlink_impl_beos.c index bc28312af..7f9adbbae 100644 --- a/source/dynlink/source/dynlink_impl_beos.c +++ b/source/dynlink/source/dynlink_impl_beos.c @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/source/dynlink_impl_macos.c b/source/dynlink/source/dynlink_impl_macos.c index 672b39771..4cfe04209 100644 --- a/source/dynlink/source/dynlink_impl_macos.c +++ b/source/dynlink/source/dynlink_impl_macos.c @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/source/dynlink_impl_unix.c b/source/dynlink/source/dynlink_impl_unix.c index 4c00300c6..8892797f9 100644 --- a/source/dynlink/source/dynlink_impl_unix.c +++ b/source/dynlink/source/dynlink_impl_unix.c @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/source/dynlink_impl_win32.c b/source/dynlink/source/dynlink_impl_win32.c index 60532c463..8009aea54 100644 --- a/source/dynlink/source/dynlink_impl_win32.c +++ b/source/dynlink/source/dynlink_impl_win32.c @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/dynlink/source/dynlink_interface.c b/source/dynlink/source/dynlink_interface.c index f35642217..adc7b623a 100644 --- a/source/dynlink/source/dynlink_interface.c +++ b/source/dynlink/source/dynlink_interface.c @@ -2,7 +2,7 @@ * Dynamic Link Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/environment/include/environment/environment.h b/source/environment/include/environment/environment.h index fab2ee2be..7646f3f82 100644 --- a/source/environment/include/environment/environment.h +++ b/source/environment/include/environment/environment.h @@ -2,7 +2,7 @@ * Environment Library by Parra Studios * A cross-platform library for supporting platform specific environment features. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/environment/include/environment/environment_variable.h b/source/environment/include/environment/environment_variable.h index 11332c09a..730dc3c85 100644 --- a/source/environment/include/environment/environment_variable.h +++ b/source/environment/include/environment/environment_variable.h @@ -2,7 +2,7 @@ * Environment Library by Parra Studios * A cross-platform library for supporting platform specific environment features. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/environment/include/environment/environment_variable_path.h b/source/environment/include/environment/environment_variable_path.h index 5b5f83da4..d5492d8f6 100644 --- a/source/environment/include/environment/environment_variable_path.h +++ b/source/environment/include/environment/environment_variable_path.h @@ -2,7 +2,7 @@ * Environment Library by Parra Studios * A cross-platform library for supporting platform specific environment features. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/environment/source/environment.c b/source/environment/source/environment.c index ae95bac49..e5c3270e8 100644 --- a/source/environment/source/environment.c +++ b/source/environment/source/environment.c @@ -2,7 +2,7 @@ * Environment Library by Parra Studios * A cross-platform library for supporting platform specific environment features. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ const char *environment_print_info(void) { static const char environment_info[] = "Format Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef LOG_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/environment/source/environment_variable.c b/source/environment/source/environment_variable.c index d608cee43..9323e0163 100644 --- a/source/environment/source/environment_variable.c +++ b/source/environment/source/environment_variable.c @@ -2,7 +2,7 @@ * Environment Library by Parra Studios * A cross-platform library for supporting platform specific environment features. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/environment/source/environment_variable_path.c b/source/environment/source/environment_variable_path.c index 8bfd3d50c..53f492dc3 100644 --- a/source/environment/source/environment_variable_path.c +++ b/source/environment/source/environment_variable_path.c @@ -2,7 +2,7 @@ * Environment Library by Parra Studios * A cross-platform library for supporting platform specific environment features. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/examples/metacalllog/main.cpp b/source/examples/metacalllog/main.cpp index 0b4ac01a9..397d6bf37 100644 --- a/source/examples/metacalllog/main.cpp +++ b/source/examples/metacalllog/main.cpp @@ -2,7 +2,7 @@ * MetaCall Log by Parra Studios * Example of advanced logging in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/examples/metacallquine/main.cpp b/source/examples/metacallquine/main.cpp index a06008caf..639d69e77 100644 --- a/source/examples/metacallquine/main.cpp +++ b/source/examples/metacallquine/main.cpp @@ -2,7 +2,7 @@ * MetaCall Quine by Parra Studios * A quine relay proof of concept intercomunicating between multiple programming languages. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/examples/metacallweb/main.cpp b/source/examples/metacallweb/main.cpp index f9f1cbb1e..e82ba481a 100644 --- a/source/examples/metacallweb/main.cpp +++ b/source/examples/metacallweb/main.cpp @@ -2,7 +2,7 @@ * MetaCall Web Service by Parra Studios * A complete web service example using metacall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/extensions/plugin_extension/include/plugin_extension/plugin_extension.h b/source/extensions/plugin_extension/include/plugin_extension/plugin_extension.h index 7b6559913..f009d3342 100644 --- a/source/extensions/plugin_extension/include/plugin_extension/plugin_extension.h +++ b/source/extensions/plugin_extension/include/plugin_extension/plugin_extension.h @@ -2,7 +2,7 @@ * Extension Library by Parra Studios * An extension for loading a folder of plugins based on metacall.json files. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/extensions/plugin_extension/source/plugin_extension.cpp b/source/extensions/plugin_extension/source/plugin_extension.cpp index 3035b2b9e..f787bdfe3 100644 --- a/source/extensions/plugin_extension/source/plugin_extension.cpp +++ b/source/extensions/plugin_extension/source/plugin_extension.cpp @@ -2,7 +2,7 @@ * Extension Library by Parra Studios * An extension for loading a folder of plugins based on metacall.json files. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/filesystem/include/filesystem/filesystem.h b/source/filesystem/include/filesystem/filesystem.h index 1bcc454f9..0fead8285 100644 --- a/source/filesystem/include/filesystem/filesystem.h +++ b/source/filesystem/include/filesystem/filesystem.h @@ -2,7 +2,7 @@ * File System Library by Parra Studios * A cross-platform library for managing file system, paths and files. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/filesystem/include/filesystem/filesystem_directory_descriptor.h b/source/filesystem/include/filesystem/filesystem_directory_descriptor.h index e4315e3f3..358329de2 100644 --- a/source/filesystem/include/filesystem/filesystem_directory_descriptor.h +++ b/source/filesystem/include/filesystem/filesystem_directory_descriptor.h @@ -2,7 +2,7 @@ * File System Library by Parra Studios * A cross-platform library for managing file system, paths and files. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/filesystem/include/filesystem/filesystem_file_descriptor.h b/source/filesystem/include/filesystem/filesystem_file_descriptor.h index 65469a983..043be0534 100644 --- a/source/filesystem/include/filesystem/filesystem_file_descriptor.h +++ b/source/filesystem/include/filesystem/filesystem_file_descriptor.h @@ -2,7 +2,7 @@ * File System Library by Parra Studios * A cross-platform library for managing file system, paths and files. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/filesystem/source/filesystem.c b/source/filesystem/source/filesystem.c index 47d17ec11..b9e2df00f 100644 --- a/source/filesystem/source/filesystem.c +++ b/source/filesystem/source/filesystem.c @@ -1,6 +1,6 @@ /* * File System Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing file system, paths and files. * @@ -154,7 +154,7 @@ const char *filesystem_print_info(void) { static const char filesystem_info[] = "File System Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef FILESYSTEM_STATIC_DEFINE "Compiled as static library type" diff --git a/source/filesystem/source/filesystem_directory_descriptor.c b/source/filesystem/source/filesystem_directory_descriptor.c index 22d531fe1..7d7f16154 100644 --- a/source/filesystem/source/filesystem_directory_descriptor.c +++ b/source/filesystem/source/filesystem_directory_descriptor.c @@ -2,7 +2,7 @@ * File System Library by Parra Studios * A cross-platform library for managing file system, paths and files. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/filesystem/source/filesystem_file_descriptor.c b/source/filesystem/source/filesystem_file_descriptor.c index 04f92c9eb..f03603279 100644 --- a/source/filesystem/source/filesystem_file_descriptor.c +++ b/source/filesystem/source/filesystem_file_descriptor.c @@ -2,7 +2,7 @@ * File System Library by Parra Studios * A cross-platform library for managing file system, paths and files. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/format/include/format/format.h b/source/format/include/format/format.h index 239a1c74d..81138d96b 100644 --- a/source/format/include/format/format.h +++ b/source/format/include/format/format.h @@ -2,7 +2,7 @@ * Format Library by Parra Studios * A cross-platform library for supporting formatted input / output. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/format/include/format/format_print.h b/source/format/include/format/format_print.h index 0ad41f5a6..c30f995e8 100644 --- a/source/format/include/format/format_print.h +++ b/source/format/include/format/format_print.h @@ -2,7 +2,7 @@ * Format Library by Parra Studios * A cross-platform library for supporting formatted input / output. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/format/include/format/format_specifier.h b/source/format/include/format/format_specifier.h index ff9344e57..947c51eb4 100644 --- a/source/format/include/format/format_specifier.h +++ b/source/format/include/format/format_specifier.h @@ -2,7 +2,7 @@ * Format Library by Parra Studios * A cross-platform library for supporting formatted input / output. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/format/source/format.c b/source/format/source/format.c index ef5deb66f..cf35393df 100644 --- a/source/format/source/format.c +++ b/source/format/source/format.c @@ -2,7 +2,7 @@ * Format Library by Parra Studios * A cross-platform library for supporting formatted input / output. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ const char *format_print_info(void) { static const char format_info[] = "Format Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef FORMAT_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loader/include/loader/loader.h b/source/loader/include/loader/loader.h index a108b3c5c..b4b8816a3 100644 --- a/source/loader/include/loader/loader.h +++ b/source/loader/include/loader/loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/include/loader/loader_handle.h b/source/loader/include/loader/loader_handle.h index 68fc94ae7..1d388fff9 100644 --- a/source/loader/include/loader/loader_handle.h +++ b/source/loader/include/loader/loader_handle.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/include/loader/loader_host.h b/source/loader/include/loader/loader_host.h index ce41c3c3d..e5844e125 100644 --- a/source/loader/include/loader/loader_host.h +++ b/source/loader/include/loader/loader_host.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index c4f6c8706..f7c7d56cb 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/include/loader/loader_impl_data.h b/source/loader/include/loader/loader_impl_data.h index 814888676..d99928032 100644 --- a/source/loader/include/loader/loader_impl_data.h +++ b/source/loader/include/loader/loader_impl_data.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/include/loader/loader_impl_interface.h b/source/loader/include/loader/loader_impl_interface.h index 1e56f3ac8..7fa5e1b0c 100644 --- a/source/loader/include/loader/loader_impl_interface.h +++ b/source/loader/include/loader/loader_impl_interface.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/include/loader/loader_manager_impl.h b/source/loader/include/loader/loader_manager_impl.h index 4e1253c12..124aaf55c 100644 --- a/source/loader/include/loader/loader_manager_impl.h +++ b/source/loader/include/loader/loader_manager_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/include/loader/loader_naming.h b/source/loader/include/loader/loader_naming.h index e49b52807..b04627f78 100644 --- a/source/loader/include/loader/loader_naming.h +++ b/source/loader/include/loader/loader_naming.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index e29ef684f..02ec13573 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -854,7 +854,7 @@ const char *loader_print_info(void) { static const char loader_info[] = "Loader Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loader/source/loader_host.c b/source/loader/source/loader_host.c index 28f9ebf72..440e3d36a 100644 --- a/source/loader/source/loader_host.c +++ b/source/loader/source/loader_host.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 7db5c35d5..2ad8034d8 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loader/source/loader_manager_impl.c b/source/loader/source/loader_manager_impl.c index f3f4375a6..7e6308d4b 100644 --- a/source/loader/source/loader_manager_impl.c +++ b/source/loader/source/loader_manager_impl.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/c_loader/include/c_loader/c_loader.h b/source/loaders/c_loader/include/c_loader/c_loader.h index 159d45a62..9d92fd0f7 100644 --- a/source/loaders/c_loader/include/c_loader/c_loader.h +++ b/source/loaders/c_loader/include/c_loader/c_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading c code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/c_loader/include/c_loader/c_loader_impl.h b/source/loaders/c_loader/include/c_loader/c_loader_impl.h index fa9b9fafa..46de1b4ac 100644 --- a/source/loaders/c_loader/include/c_loader/c_loader_impl.h +++ b/source/loaders/c_loader/include/c_loader/c_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading c code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/c_loader/source/c_loader.c b/source/loaders/c_loader/source/c_loader.c index 42ace7dc0..328db89cc 100644 --- a/source/loaders/c_loader/source/c_loader.c +++ b/source/loaders/c_loader/source/c_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading c code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *c_loader_print_info(void) { static const char c_loader_info[] = "C Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef C_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index 819bcceea..f9530b7ab 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading c code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cob_loader/include/cob_loader/cob_loader.h b/source/loaders/cob_loader/include/cob_loader/cob_loader.h index 4344cf257..f7a3b7d66 100644 --- a/source/loaders/cob_loader/include/cob_loader/cob_loader.h +++ b/source/loaders/cob_loader/include/cob_loader/cob_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading cobol code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cob_loader/include/cob_loader/cob_loader_impl.h b/source/loaders/cob_loader/include/cob_loader/cob_loader_impl.h index 71a50c949..5822c4008 100644 --- a/source/loaders/cob_loader/include/cob_loader/cob_loader_impl.h +++ b/source/loaders/cob_loader/include/cob_loader/cob_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading cobol code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cob_loader/source/cob_loader.c b/source/loaders/cob_loader/source/cob_loader.c index 450fc82a0..ddeb4851e 100644 --- a/source/loaders/cob_loader/source/cob_loader.c +++ b/source/loaders/cob_loader/source/cob_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading cobol code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *cob_loader_print_info(void) { static const char cob_loader_info[] = "Cobol Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef COB_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/cob_loader/source/cob_loader_impl.cpp b/source/loaders/cob_loader/source/cob_loader_impl.cpp index 6fff1d471..b74589782 100644 --- a/source/loaders/cob_loader/source/cob_loader_impl.cpp +++ b/source/loaders/cob_loader/source/cob_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading cobol code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cr_loader/crystal/cr_loader_impl.cr b/source/loaders/cr_loader/crystal/cr_loader_impl.cr index 8f1274f98..34c33a319 100644 --- a/source/loaders/cr_loader/crystal/cr_loader_impl.cr +++ b/source/loaders/cr_loader/crystal/cr_loader_impl.cr @@ -2,7 +2,7 @@ # Loader Library by Parra Studios # A plugin for loading crystal code at run-time into a process. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/loaders/cr_loader/crystal/main.cr b/source/loaders/cr_loader/crystal/main.cr index 3068b919b..4060807e1 100644 --- a/source/loaders/cr_loader/crystal/main.cr +++ b/source/loaders/cr_loader/crystal/main.cr @@ -2,7 +2,7 @@ # Loader Library by Parra Studios # A plugin for loading crystal code at run-time into a process. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/loaders/cr_loader/crystal/metacall.cr b/source/loaders/cr_loader/crystal/metacall.cr index a6b306d71..d266a534a 100644 --- a/source/loaders/cr_loader/crystal/metacall.cr +++ b/source/loaders/cr_loader/crystal/metacall.cr @@ -2,7 +2,7 @@ # Loader Library by Parra Studios # A plugin for loading crystal code at run-time into a process. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/loaders/cr_loader/include/cr_loader/cr_loader.h b/source/loaders/cr_loader/include/cr_loader/cr_loader.h index 33e01700f..936dade8a 100644 --- a/source/loaders/cr_loader/include/cr_loader/cr_loader.h +++ b/source/loaders/cr_loader/include/cr_loader/cr_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading crystal code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cr_loader/include/cr_loader/cr_loader_impl.h b/source/loaders/cr_loader/include/cr_loader/cr_loader_impl.h index 7abbf29ab..daa8e1edb 100644 --- a/source/loaders/cr_loader/include/cr_loader/cr_loader_impl.h +++ b/source/loaders/cr_loader/include/cr_loader/cr_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading crystal code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cr_loader/include/cr_loader/cr_loader_impl_main.h b/source/loaders/cr_loader/include/cr_loader/cr_loader_impl_main.h index c4142210e..9c3009088 100644 --- a/source/loaders/cr_loader/include/cr_loader/cr_loader_impl_main.h +++ b/source/loaders/cr_loader/include/cr_loader/cr_loader_impl_main.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading crystal code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cr_loader/source/cr_loader.c b/source/loaders/cr_loader/source/cr_loader.c index 8788d6a7a..f96bbe3b5 100644 --- a/source/loaders/cr_loader/source/cr_loader.c +++ b/source/loaders/cr_loader/source/cr_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading crystal code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *cr_loader_print_info(void) { static const char cr_loader_info[] = "Crystal Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef CR_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/cs_loader/include/cs_loader/defs.h b/source/loaders/cs_loader/include/cs_loader/defs.h index ba5502800..9498288aa 100644 --- a/source/loaders/cs_loader/include/cs_loader/defs.h +++ b/source/loaders/cs_loader/include/cs_loader/defs.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/include/cs_loader/host_environment.h b/source/loaders/cs_loader/include/cs_loader/host_environment.h index 27f57baa3..81388cab5 100644 --- a/source/loaders/cs_loader/include/cs_loader/host_environment.h +++ b/source/loaders/cs_loader/include/cs_loader/host_environment.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/include/cs_loader/netcore.h b/source/loaders/cs_loader/include/cs_loader/netcore.h index a61d3a2e0..3d5cf0b5f 100644 --- a/source/loaders/cs_loader/include/cs_loader/netcore.h +++ b/source/loaders/cs_loader/include/cs_loader/netcore.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/include/cs_loader/netcore_linux.h b/source/loaders/cs_loader/include/cs_loader/netcore_linux.h index 803d656d8..09369c389 100644 --- a/source/loaders/cs_loader/include/cs_loader/netcore_linux.h +++ b/source/loaders/cs_loader/include/cs_loader/netcore_linux.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/include/cs_loader/netcore_win.h b/source/loaders/cs_loader/include/cs_loader/netcore_win.h index ae9ee3f4c..8de3705bc 100644 --- a/source/loaders/cs_loader/include/cs_loader/netcore_win.h +++ b/source/loaders/cs_loader/include/cs_loader/netcore_win.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/include/cs_loader/simple_netcore.h b/source/loaders/cs_loader/include/cs_loader/simple_netcore.h index 557d83df2..01582ec94 100644 --- a/source/loaders/cs_loader/include/cs_loader/simple_netcore.h +++ b/source/loaders/cs_loader/include/cs_loader/simple_netcore.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/include/cs_loader/string_buffer.h b/source/loaders/cs_loader/include/cs_loader/string_buffer.h index 8b0b387e8..a89ecf6dc 100644 --- a/source/loaders/cs_loader/include/cs_loader/string_buffer.h +++ b/source/loaders/cs_loader/include/cs_loader/string_buffer.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/include/cs_loader/utils.hpp b/source/loaders/cs_loader/include/cs_loader/utils.hpp index 60311047e..1a36b45e9 100644 --- a/source/loaders/cs_loader/include/cs_loader/utils.hpp +++ b/source/loaders/cs_loader/include/cs_loader/utils.hpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/source/cs_loader.c b/source/loaders/cs_loader/source/cs_loader.c index f13e90e8d..4b19bd505 100644 --- a/source/loaders/cs_loader/source/cs_loader.c +++ b/source/loaders/cs_loader/source/cs_loader.c @@ -34,7 +34,7 @@ const char *cs_loader_print_info(void) { static const char cs_loader_info[] = "Net Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef CS_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/cs_loader/source/cs_loader_impl.c b/source/loaders/cs_loader/source/cs_loader_impl.c index e33bb466b..96508759c 100644 --- a/source/loaders/cs_loader/source/cs_loader_impl.c +++ b/source/loaders/cs_loader/source/cs_loader_impl.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/source/host_environment.cpp b/source/loaders/cs_loader/source/host_environment.cpp index ba6e51d0e..9254891e2 100644 --- a/source/loaders/cs_loader/source/host_environment.cpp +++ b/source/loaders/cs_loader/source/host_environment.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/source/netcore.cpp b/source/loaders/cs_loader/source/netcore.cpp index 831853825..b3eb9561d 100644 --- a/source/loaders/cs_loader/source/netcore.cpp +++ b/source/loaders/cs_loader/source/netcore.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/source/netcore_linux.cpp b/source/loaders/cs_loader/source/netcore_linux.cpp index 68e6f0fdc..8f8c38bcd 100644 --- a/source/loaders/cs_loader/source/netcore_linux.cpp +++ b/source/loaders/cs_loader/source/netcore_linux.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/source/simple_netcore.cpp b/source/loaders/cs_loader/source/simple_netcore.cpp index 852b0d804..93e82b2ad 100644 --- a/source/loaders/cs_loader/source/simple_netcore.cpp +++ b/source/loaders/cs_loader/source/simple_netcore.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/cs_loader/source/string_buffer.cpp b/source/loaders/cs_loader/source/string_buffer.cpp index e482f8b4d..b5a2ab919 100644 --- a/source/loaders/cs_loader/source/string_buffer.cpp +++ b/source/loaders/cs_loader/source/string_buffer.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading net code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/dart_loader/include/dart_loader/dart_loader.h b/source/loaders/dart_loader/include/dart_loader/dart_loader.h index 15dab7185..1f8809455 100644 --- a/source/loaders/dart_loader/include/dart_loader/dart_loader.h +++ b/source/loaders/dart_loader/include/dart_loader/dart_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading dart code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/dart_loader/include/dart_loader/dart_loader_impl.h b/source/loaders/dart_loader/include/dart_loader/dart_loader_impl.h index 7e19d115b..f89691f7f 100644 --- a/source/loaders/dart_loader/include/dart_loader/dart_loader_impl.h +++ b/source/loaders/dart_loader/include/dart_loader/dart_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading dart code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/dart_loader/source/dart_loader.c b/source/loaders/dart_loader/source/dart_loader.c index df693fc41..c1486b9a8 100644 --- a/source/loaders/dart_loader/source/dart_loader.c +++ b/source/loaders/dart_loader/source/dart_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading dart code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *dart_loader_print_info(void) { static const char dart_loader_info[] = "Dart Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef DART_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/dart_loader/source/dart_loader_impl.cc b/source/loaders/dart_loader/source/dart_loader_impl.cc index 92dac094b..750d52cc7 100644 --- a/source/loaders/dart_loader/source/dart_loader_impl.cc +++ b/source/loaders/dart_loader/source/dart_loader_impl.cc @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading dart code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/ext_loader/include/ext_loader/ext_loader.h b/source/loaders/ext_loader/include/ext_loader/ext_loader.h index d1a9db118..0ca69aafb 100644 --- a/source/loaders/ext_loader/include/ext_loader/ext_loader.h +++ b/source/loaders/ext_loader/include/ext_loader/ext_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading extension code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/ext_loader/include/ext_loader/ext_loader_impl.h b/source/loaders/ext_loader/include/ext_loader/ext_loader_impl.h index 7ba734567..08ef3c118 100644 --- a/source/loaders/ext_loader/include/ext_loader/ext_loader_impl.h +++ b/source/loaders/ext_loader/include/ext_loader/ext_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading extension code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/ext_loader/source/ext_loader.c b/source/loaders/ext_loader/source/ext_loader.c index 0f2fa35fa..54dd4aa0d 100644 --- a/source/loaders/ext_loader/source/ext_loader.c +++ b/source/loaders/ext_loader/source/ext_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading extension code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *ext_loader_print_info(void) { static const char ext_loader_info[] = "Extension Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef FILE_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/ext_loader/source/ext_loader_impl.cpp b/source/loaders/ext_loader/source/ext_loader_impl.cpp index caa235182..c41db8f1b 100644 --- a/source/loaders/ext_loader/source/ext_loader_impl.cpp +++ b/source/loaders/ext_loader/source/ext_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading extension code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/file_loader/include/file_loader/file_loader.h b/source/loaders/file_loader/include/file_loader/file_loader.h index 4fff999e2..a2fc929b4 100644 --- a/source/loaders/file_loader/include/file_loader/file_loader.h +++ b/source/loaders/file_loader/include/file_loader/file_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading file code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/file_loader/include/file_loader/file_loader_impl.h b/source/loaders/file_loader/include/file_loader/file_loader_impl.h index f54d81b45..fd37c415c 100644 --- a/source/loaders/file_loader/include/file_loader/file_loader_impl.h +++ b/source/loaders/file_loader/include/file_loader/file_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading file code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/file_loader/source/file_loader.c b/source/loaders/file_loader/source/file_loader.c index ec13b8d4c..1646c1abf 100644 --- a/source/loaders/file_loader/source/file_loader.c +++ b/source/loaders/file_loader/source/file_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading file code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *file_loader_print_info(void) { static const char file_loader_info[] = "File Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef FILE_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/file_loader/source/file_loader_impl.c b/source/loaders/file_loader/source/file_loader_impl.c index c6596d2ff..74bad1328 100644 --- a/source/loaders/file_loader/source/file_loader_impl.c +++ b/source/loaders/file_loader/source/file_loader_impl.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading file code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/java_loader/include/java_loader/java_loader.h b/source/loaders/java_loader/include/java_loader/java_loader.h index b0aaa901d..d241030cd 100644 --- a/source/loaders/java_loader/include/java_loader/java_loader.h +++ b/source/loaders/java_loader/include/java_loader/java_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading java code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/java_loader/include/java_loader/java_loader_impl.h b/source/loaders/java_loader/include/java_loader/java_loader_impl.h index 2232b5641..36d42df35 100644 --- a/source/loaders/java_loader/include/java_loader/java_loader_impl.h +++ b/source/loaders/java_loader/include/java_loader/java_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading java code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/java_loader/source/java_loader.c b/source/loaders/java_loader/source/java_loader.c index 9f802a875..36126eb2e 100644 --- a/source/loaders/java_loader/source/java_loader.c +++ b/source/loaders/java_loader/source/java_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading java code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *java_loader_print_info(void) { static const char java_loader_info[] = "C Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef JAVA_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/java_loader/source/java_loader_impl.cpp b/source/loaders/java_loader/source/java_loader_impl.cpp index 0baa237f9..1714679c7 100644 --- a/source/loaders/java_loader/source/java_loader_impl.cpp +++ b/source/loaders/java_loader/source/java_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading java code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/jl_loader/bootstrap/lib/bootstrap.jl b/source/loaders/jl_loader/bootstrap/lib/bootstrap.jl index dfefa917d..0b838303b 100644 --- a/source/loaders/jl_loader/bootstrap/lib/bootstrap.jl +++ b/source/loaders/jl_loader/bootstrap/lib/bootstrap.jl @@ -2,7 +2,7 @@ # Loader Library by Parra Studios # A plugin for loading Julia code at run-time into a process. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/loaders/jl_loader/include/jl_loader/jl_loader.h b/source/loaders/jl_loader/include/jl_loader/jl_loader.h index 02d588657..b77da20f2 100644 --- a/source/loaders/jl_loader/include/jl_loader/jl_loader.h +++ b/source/loaders/jl_loader/include/jl_loader/jl_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading Julia code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/jl_loader/include/jl_loader/jl_loader_impl.h b/source/loaders/jl_loader/include/jl_loader/jl_loader_impl.h index 6abcd5ab0..e40530c9b 100644 --- a/source/loaders/jl_loader/include/jl_loader/jl_loader_impl.h +++ b/source/loaders/jl_loader/include/jl_loader/jl_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading Julia code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/jl_loader/source/jl_loader.c b/source/loaders/jl_loader/source/jl_loader.c index 681987384..dfee6cf03 100644 --- a/source/loaders/jl_loader/source/jl_loader.c +++ b/source/loaders/jl_loader/source/jl_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading Julia code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *jl_loader_print_info(void) { static const char jl_loader_info[] = "Julia Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef JL_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/jl_loader/source/jl_loader_impl.cpp b/source/loaders/jl_loader/source/jl_loader_impl.cpp index 9c9620e89..cb042d711 100644 --- a/source/loaders/jl_loader/source/jl_loader_impl.cpp +++ b/source/loaders/jl_loader/source/jl_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading Julia code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/js_loader/include/js_loader/js_loader.h b/source/loaders/js_loader/include/js_loader/js_loader.h index 7bbcce7f7..7da9697a9 100644 --- a/source/loaders/js_loader/include/js_loader/js_loader.h +++ b/source/loaders/js_loader/include/js_loader/js_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/js_loader/include/js_loader/js_loader_impl.h b/source/loaders/js_loader/include/js_loader/js_loader_impl.h index 78926f39e..ce79543eb 100644 --- a/source/loaders/js_loader/include/js_loader/js_loader_impl.h +++ b/source/loaders/js_loader/include/js_loader/js_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/js_loader/include/js_loader/js_loader_impl_guard.hpp b/source/loaders/js_loader/include/js_loader/js_loader_impl_guard.hpp index 5105ba6ba..18198c69c 100644 --- a/source/loaders/js_loader/include/js_loader/js_loader_impl_guard.hpp +++ b/source/loaders/js_loader/include/js_loader/js_loader_impl_guard.hpp @@ -3,7 +3,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/js_loader/source/js_loader.c b/source/loaders/js_loader/source/js_loader.c index eaf44404d..4cb6c5c30 100644 --- a/source/loaders/js_loader/source/js_loader.c +++ b/source/loaders/js_loader/source/js_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *js_loader_print_info(void) { static const char js_loader_info[] = "Javascript Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef JS_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/js_loader/source/js_loader_impl.cpp b/source/loaders/js_loader/source/js_loader_impl.cpp index 845a4f5a0..ccc79a820 100644 --- a/source/loaders/js_loader/source/js_loader_impl.cpp +++ b/source/loaders/js_loader/source/js_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/js_loader/source/js_loader_impl_guard.cpp b/source/loaders/js_loader/source/js_loader_impl_guard.cpp index 0d7c19976..c3d4e8208 100644 --- a/source/loaders/js_loader/source/js_loader_impl_guard.cpp +++ b/source/loaders/js_loader/source/js_loader_impl_guard.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h b/source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h index 6b74e7519..19f98f33d 100644 --- a/source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h +++ b/source/loaders/jsm_loader/include/jsm_loader/jsm_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/jsm_loader/include/jsm_loader/jsm_loader_impl.h b/source/loaders/jsm_loader/include/jsm_loader/jsm_loader_impl.h index 015e4830a..6cc08d96d 100644 --- a/source/loaders/jsm_loader/include/jsm_loader/jsm_loader_impl.h +++ b/source/loaders/jsm_loader/include/jsm_loader/jsm_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/jsm_loader/source/jsm_loader.c b/source/loaders/jsm_loader/source/jsm_loader.c index 175269eff..3725797aa 100644 --- a/source/loaders/jsm_loader/source/jsm_loader.c +++ b/source/loaders/jsm_loader/source/jsm_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ const char *jsm_loader_print_info(void) { static const char jsm_loader_info[] = "Javascript Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef JSM_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/jsm_loader/source/jsm_loader_impl.cpp b/source/loaders/jsm_loader/source/jsm_loader_impl.cpp index 591f352f9..f5ff0bddf 100644 --- a/source/loaders/jsm_loader/source/jsm_loader_impl.cpp +++ b/source/loaders/jsm_loader/source/jsm_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading javascript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h b/source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h index e395b8ccc..b8cf75aca 100644 --- a/source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h +++ b/source/loaders/llvm_loader/include/llvm_loader/llvm_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading LLVM code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/llvm_loader/include/llvm_loader/llvm_loader_impl.h b/source/loaders/llvm_loader/include/llvm_loader/llvm_loader_impl.h index d5949a9f1..b9637ae90 100644 --- a/source/loaders/llvm_loader/include/llvm_loader/llvm_loader_impl.h +++ b/source/loaders/llvm_loader/include/llvm_loader/llvm_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading LLVM code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/llvm_loader/source/llvm_loader.c b/source/loaders/llvm_loader/source/llvm_loader.c index 0ffb622c4..4d3e8abd1 100644 --- a/source/loaders/llvm_loader/source/llvm_loader.c +++ b/source/loaders/llvm_loader/source/llvm_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading LLVM code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *llvm_loader_print_info(void) { static const char llvm_loader_info[] = "LLVM Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef llvm_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/llvm_loader/source/llvm_loader_impl.cpp b/source/loaders/llvm_loader/source/llvm_loader_impl.cpp index bad187313..f6bfd1d21 100644 --- a/source/loaders/llvm_loader/source/llvm_loader_impl.cpp +++ b/source/loaders/llvm_loader/source/llvm_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading LLVM code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/loaders.h.in b/source/loaders/loaders.h.in index d5d9dec8e..f3b24b6ed 100644 --- a/source/loaders/loaders.h.in +++ b/source/loaders/loaders.h.in @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A library for loading executable code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/lua_loader/include/lua_loader/lua_loader.h b/source/loaders/lua_loader/include/lua_loader/lua_loader.h index 811750907..9179d5e50 100644 --- a/source/loaders/lua_loader/include/lua_loader/lua_loader.h +++ b/source/loaders/lua_loader/include/lua_loader/lua_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading lua code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/lua_loader/include/lua_loader/lua_loader_impl.h b/source/loaders/lua_loader/include/lua_loader/lua_loader_impl.h index 8861c9ba1..4c0897218 100644 --- a/source/loaders/lua_loader/include/lua_loader/lua_loader_impl.h +++ b/source/loaders/lua_loader/include/lua_loader/lua_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading lua code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/lua_loader/source/lua_loader.c b/source/loaders/lua_loader/source/lua_loader.c index fa56317ac..b7cc942aa 100644 --- a/source/loaders/lua_loader/source/lua_loader.c +++ b/source/loaders/lua_loader/source/lua_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading lua code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *lua_loader_print_info(void) { static const char lua_loader_info[] = "Lua Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef LUA_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/lua_loader/source/lua_loader_impl.c b/source/loaders/lua_loader/source/lua_loader_impl.c index 63f8fdd66..58d89f20a 100644 --- a/source/loaders/lua_loader/source/lua_loader_impl.c +++ b/source/loaders/lua_loader/source/lua_loader_impl.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading lua code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader.h b/source/loaders/mock_loader/include/mock_loader/mock_loader.h index 2f0302fdf..e2c17c49e 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader_descriptor.h b/source/loaders/mock_loader/include/mock_loader/mock_loader_descriptor.h index 5be793472..9c48015f3 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader_descriptor.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader_descriptor.h @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading mock code at run-time into a process. * diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader_export.h b/source/loaders/mock_loader/include/mock_loader/mock_loader_export.h index 3c474f8b1..6da9c5cb1 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader_export.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader_export.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader_function.h b/source/loaders/mock_loader/include/mock_loader/mock_loader_function.h index ee3c9e7bb..8ea6d3031 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader_function.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader_function.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader_function_interface.h b/source/loaders/mock_loader/include/mock_loader/mock_loader_function_interface.h index ffcc0449a..ece86e5fe 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader_function_interface.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader_function_interface.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader_handle.h b/source/loaders/mock_loader/include/mock_loader/mock_loader_handle.h index 62322b452..d0c7f23e1 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader_handle.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader_handle.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader_impl.h b/source/loaders/mock_loader/include/mock_loader/mock_loader_impl.h index 2d8992c73..e064db708 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader_impl.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader_interface.h b/source/loaders/mock_loader/include/mock_loader/mock_loader_interface.h index bb3dd7a47..f8b9bb5ea 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader_interface.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader_interface.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/include/mock_loader/mock_loader_print.h b/source/loaders/mock_loader/include/mock_loader/mock_loader_print.h index 09785d67b..727d39ad7 100644 --- a/source/loaders/mock_loader/include/mock_loader/mock_loader_print.h +++ b/source/loaders/mock_loader/include/mock_loader/mock_loader_print.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/source/mock_loader.c b/source/loaders/mock_loader/source/mock_loader.c index 949ac2289..6dddee2a3 100644 --- a/source/loaders/mock_loader/source/mock_loader.c +++ b/source/loaders/mock_loader/source/mock_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *mock_loader_print_info(void) { static const char mock_loader_info[] = "Mock Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef MOCK_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/mock_loader/source/mock_loader_descriptor.c b/source/loaders/mock_loader/source/mock_loader_descriptor.c index 74e8f76c2..c88c90abb 100644 --- a/source/loaders/mock_loader/source/mock_loader_descriptor.c +++ b/source/loaders/mock_loader/source/mock_loader_descriptor.c @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading mock code at run-time into a process. * diff --git a/source/loaders/mock_loader/source/mock_loader_export.c b/source/loaders/mock_loader/source/mock_loader_export.c index 7623d3285..e79fcfcda 100644 --- a/source/loaders/mock_loader/source/mock_loader_export.c +++ b/source/loaders/mock_loader/source/mock_loader_export.c @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading mock code at run-time into a process. * diff --git a/source/loaders/mock_loader/source/mock_loader_function.c b/source/loaders/mock_loader/source/mock_loader_function.c index 7b2d8a64c..f8a88864f 100644 --- a/source/loaders/mock_loader/source/mock_loader_function.c +++ b/source/loaders/mock_loader/source/mock_loader_function.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/source/mock_loader_function_interface.c b/source/loaders/mock_loader/source/mock_loader_function_interface.c index 7310fa415..92ead2583 100644 --- a/source/loaders/mock_loader/source/mock_loader_function_interface.c +++ b/source/loaders/mock_loader/source/mock_loader_function_interface.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/source/mock_loader_handle.c b/source/loaders/mock_loader/source/mock_loader_handle.c index 816048396..567ff4607 100644 --- a/source/loaders/mock_loader/source/mock_loader_handle.c +++ b/source/loaders/mock_loader/source/mock_loader_handle.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/source/mock_loader_impl.c b/source/loaders/mock_loader/source/mock_loader_impl.c index e63c7a1f1..7f8940e54 100644 --- a/source/loaders/mock_loader/source/mock_loader_impl.c +++ b/source/loaders/mock_loader/source/mock_loader_impl.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading mock code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/mock_loader/source/mock_loader_interface.c b/source/loaders/mock_loader/source/mock_loader_interface.c index 11368a61a..0d24545f1 100644 --- a/source/loaders/mock_loader/source/mock_loader_interface.c +++ b/source/loaders/mock_loader/source/mock_loader_interface.c @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading mock code at run-time into a process. * diff --git a/source/loaders/mock_loader/source/mock_loader_print.c b/source/loaders/mock_loader/source/mock_loader_print.c index c1a27cb27..1539d5dbc 100644 --- a/source/loaders/mock_loader/source/mock_loader_print.c +++ b/source/loaders/mock_loader/source/mock_loader_print.c @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading mock code at run-time into a process. * @@ -14,7 +14,7 @@ const char *mock_loader_print_info(void) { static const char mock_loader_info[] = "Mock Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef MOCK_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/node_loader/include/node_loader/node_loader.h b/source/loaders/node_loader/include/node_loader/node_loader.h index 84b1009be..fc9af4c42 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader.h +++ b/source/loaders/node_loader/include/node_loader/node_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading nodejs code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/node_loader/include/node_loader/node_loader_bootstrap.h b/source/loaders/node_loader/include/node_loader/node_loader_bootstrap.h index 58e51d904..1178d1473 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_bootstrap.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_bootstrap.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading nodejs code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/node_loader/include/node_loader/node_loader_impl.h b/source/loaders/node_loader/include/node_loader/node_loader_impl.h index b41893a62..094f3b24e 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_impl.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading nodejs code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/node_loader/include/node_loader/node_loader_port.h b/source/loaders/node_loader/include/node_loader/node_loader_port.h index effd3f06a..0555f1247 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_port.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_port.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading nodejs code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/node_loader/include/node_loader/node_loader_trampoline.h b/source/loaders/node_loader/include/node_loader/node_loader_trampoline.h index 84ea34ccf..09c4ec6a3 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_trampoline.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_trampoline.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading nodejs code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/node_loader/include/node_loader/node_loader_win32_delay_load.h b/source/loaders/node_loader/include/node_loader/node_loader_win32_delay_load.h index 73fcb6f57..47d425cee 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_win32_delay_load.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_win32_delay_load.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading nodejs code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/node_loader/source/node_loader.c b/source/loaders/node_loader/source/node_loader.c index e768a8f89..96b5b37bf 100644 --- a/source/loaders/node_loader/source/node_loader.c +++ b/source/loaders/node_loader/source/node_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading nodejs code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *node_loader_print_info(void) { static const char node_loader_info[] = "Javascript Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef JS_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 281221d40..e15575fec 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading nodejs code at run-time into a process. * diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index 4a4e22421..f96f1f295 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -2,7 +2,7 @@ * MetaCall NodeJS Port by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/node_loader/source/node_loader_trampoline.cpp b/source/loaders/node_loader/source/node_loader_trampoline.cpp index 7ed654358..9083223a1 100644 --- a/source/loaders/node_loader/source/node_loader_trampoline.cpp +++ b/source/loaders/node_loader/source/node_loader_trampoline.cpp @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading nodejs code at run-time into a process. * diff --git a/source/loaders/py_loader/include/py_loader/py_loader.h b/source/loaders/py_loader/include/py_loader/py_loader.h index cdc88d415..54b151586 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader.h +++ b/source/loaders/py_loader/include/py_loader/py_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/py_loader/include/py_loader/py_loader_dict.h b/source/loaders/py_loader/include/py_loader/py_loader_dict.h index 6c874786e..be17ab153 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_dict.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_dict.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/py_loader/include/py_loader/py_loader_impl.h b/source/loaders/py_loader/include/py_loader/py_loader_impl.h index efa286a6e..f06b3d603 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_impl.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/py_loader/include/py_loader/py_loader_port.h b/source/loaders/py_loader/include/py_loader/py_loader_port.h index 8e4e18eb2..07dd6589f 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_port.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_port.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/py_loader/include/py_loader/py_loader_threading.h b/source/loaders/py_loader/include/py_loader/py_loader_threading.h index 6dbc9dc4d..b4f0fb499 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_threading.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_threading.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/py_loader/source/py_loader.c b/source/loaders/py_loader/source/py_loader.c index f3bf421fb..ecdc14e00 100644 --- a/source/loaders/py_loader/source/py_loader.c +++ b/source/loaders/py_loader/source/py_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *py_loader_print_info(void) { static const char py_loader_info[] = "Python Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef PY_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/py_loader/source/py_loader_dict.c b/source/loaders/py_loader/source/py_loader_dict.c index 022ff7c9a..2982a4367 100644 --- a/source/loaders/py_loader/source/py_loader_dict.c +++ b/source/loaders/py_loader/source/py_loader_dict.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 0c495ee07..79d655d01 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index 3ae0ac918..3bece75cd 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index 75f11f230..c49add1c3 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader.h b/source/loaders/rb_loader/include/rb_loader/rb_loader.h index 4d727e507..52e07d650 100644 --- a/source/loaders/rb_loader/include/rb_loader/rb_loader.h +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h b/source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h index 39b2744d0..3a86aaaa9 100644 --- a/source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader_impl_parser.h b/source/loaders/rb_loader/include/rb_loader/rb_loader_impl_parser.h index 77a232b2a..6a854d079 100644 --- a/source/loaders/rb_loader/include/rb_loader/rb_loader_impl_parser.h +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader_impl_parser.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rb_loader/source/rb_loader.c b/source/loaders/rb_loader/source/rb_loader.c index 7bea40663..8603917e3 100644 --- a/source/loaders/rb_loader/source/rb_loader.c +++ b/source/loaders/rb_loader/source/rb_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *rb_loader_print_info(void) { static const char rb_loader_info[] = "Ruby Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef RB_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 6cb99ae05..ea3f817ae 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading ruby code at run-time into a process. * diff --git a/source/loaders/rb_loader/source/rb_loader_impl_parser.c b/source/loaders/rb_loader/source/rb_loader_impl_parser.c index dc8cd5dde..3f3759d01 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl_parser.c +++ b/source/loaders/rb_loader/source/rb_loader_impl_parser.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h b/source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h index a4e399d16..a5d71dca5 100644 --- a/source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h +++ b/source/loaders/rpc_loader/include/rpc_loader/rpc_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading rpc endpoints at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rpc_loader/include/rpc_loader/rpc_loader_impl.h b/source/loaders/rpc_loader/include/rpc_loader/rpc_loader_impl.h index 12d580e6a..85e9d9fde 100644 --- a/source/loaders/rpc_loader/include/rpc_loader/rpc_loader_impl.h +++ b/source/loaders/rpc_loader/include/rpc_loader/rpc_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading rpc endpoints at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rpc_loader/source/rpc_loader.c b/source/loaders/rpc_loader/source/rpc_loader.c index c5fb1cba6..91055fbf5 100644 --- a/source/loaders/rpc_loader/source/rpc_loader.c +++ b/source/loaders/rpc_loader/source/rpc_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading rpc endpoints at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *rpc_loader_print_info(void) { static const char rpc_loader_info[] = "RPC Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef RPC_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/rpc_loader/source/rpc_loader_impl.cpp b/source/loaders/rpc_loader/source/rpc_loader_impl.cpp index 4ae44faf2..abb4b55aa 100644 --- a/source/loaders/rpc_loader/source/rpc_loader_impl.cpp +++ b/source/loaders/rpc_loader/source/rpc_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading rpc endpoints at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use thiz file except in compliance with the License. diff --git a/source/loaders/rs_loader/include/rs_loader/rs_loader.h b/source/loaders/rs_loader/include/rs_loader/rs_loader.h index 61e9c11e8..6d8a75468 100644 --- a/source/loaders/rs_loader/include/rs_loader/rs_loader.h +++ b/source/loaders/rs_loader/include/rs_loader/rs_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading rust code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rs_loader/include/rs_loader/rs_loader_impl.h b/source/loaders/rs_loader/include/rs_loader/rs_loader_impl.h index 1f34c3048..3890545e5 100644 --- a/source/loaders/rs_loader/include/rs_loader/rs_loader_impl.h +++ b/source/loaders/rs_loader/include/rs_loader/rs_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading rust code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/rs_loader/source/rs_loader.c b/source/loaders/rs_loader/source/rs_loader.c index dc8317e36..3bd606253 100644 --- a/source/loaders/rs_loader/source/rs_loader.c +++ b/source/loaders/rs_loader/source/rs_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading rust code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,7 @@ const char *rs_loader_print_info(void) { static const char rs_loader_info[] = "Rust Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef RS_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/ts_loader/include/ts_loader/ts_loader.h b/source/loaders/ts_loader/include/ts_loader/ts_loader.h index b433fd941..e30ce52c3 100644 --- a/source/loaders/ts_loader/include/ts_loader/ts_loader.h +++ b/source/loaders/ts_loader/include/ts_loader/ts_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading TypeScript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/ts_loader/include/ts_loader/ts_loader_impl.h b/source/loaders/ts_loader/include/ts_loader/ts_loader_impl.h index d96bb8235..1cab73388 100644 --- a/source/loaders/ts_loader/include/ts_loader/ts_loader_impl.h +++ b/source/loaders/ts_loader/include/ts_loader/ts_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading TypeScript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/ts_loader/source/ts_loader.c b/source/loaders/ts_loader/source/ts_loader.c index b93b632b3..2afd1d79c 100644 --- a/source/loaders/ts_loader/source/ts_loader.c +++ b/source/loaders/ts_loader/source/ts_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading TypeScript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *ts_loader_print_info(void) { static const char ts_loader_info[] = "TypeScript Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef TS_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/ts_loader/source/ts_loader_impl.cpp b/source/loaders/ts_loader/source/ts_loader_impl.cpp index 6be97f9f0..57f9a42f0 100644 --- a/source/loaders/ts_loader/source/ts_loader_impl.cpp +++ b/source/loaders/ts_loader/source/ts_loader_impl.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading TypeScript code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h index 067ea4856..a7f481ffd 100644 --- a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h +++ b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading WebAssembly code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_function.h b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_function.h index a8a59fd64..a427503b9 100644 --- a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_function.h +++ b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_function.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading WebAssembly code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_handle.h b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_handle.h index e775e0076..411aa0095 100644 --- a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_handle.h +++ b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_handle.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading WebAssembly code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_impl.h b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_impl.h index 8750a5515..de0c63000 100644 --- a/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_impl.h +++ b/source/loaders/wasm_loader/include/wasm_loader/wasm_loader_impl.h @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading WebAssembly code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/loaders/wasm_loader/source/wasm_loader.c b/source/loaders/wasm_loader/source/wasm_loader.c index f28af43b8..6ac5fbabc 100644 --- a/source/loaders/wasm_loader/source/wasm_loader.c +++ b/source/loaders/wasm_loader/source/wasm_loader.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading WebAssembly code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ const char *wasm_loader_print_info(void) { static const char wasm_loader_info[] = "WebAssembly Loader Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef wasm_LOADER_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/loaders/wasm_loader/source/wasm_loader_impl.c b/source/loaders/wasm_loader/source/wasm_loader_impl.c index 3073bb4f1..558ea0215 100644 --- a/source/loaders/wasm_loader/source/wasm_loader_impl.c +++ b/source/loaders/wasm_loader/source/wasm_loader_impl.c @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading WebAssembly code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/include/log/log.h b/source/log/include/log/log.h index f39afdb64..784b60555 100644 --- a/source/log/include/log/log.h +++ b/source/log/include/log/log.h @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/include/log/log_aspect.h b/source/log/include/log/log_aspect.h index 9112d29d6..649dd56fa 100644 --- a/source/log/include/log/log_aspect.h +++ b/source/log/include/log/log_aspect.h @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/include/log/log_aspect_format.h b/source/log/include/log/log_aspect_format.h index da4ef2ca2..9f0804491 100644 --- a/source/log/include/log/log_aspect_format.h +++ b/source/log/include/log/log_aspect_format.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_aspect_schedule.h b/source/log/include/log/log_aspect_schedule.h index 96c04c7ba..9345d498e 100644 --- a/source/log/include/log/log_aspect_schedule.h +++ b/source/log/include/log/log_aspect_schedule.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_aspect_storage.h b/source/log/include/log/log_aspect_storage.h index c7909bbe4..dba947576 100644 --- a/source/log/include/log/log_aspect_storage.h +++ b/source/log/include/log/log_aspect_storage.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_aspect_stream.h b/source/log/include/log/log_aspect_stream.h index e667ba6eb..4a9fe93b0 100644 --- a/source/log/include/log/log_aspect_stream.h +++ b/source/log/include/log/log_aspect_stream.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_handle.h b/source/log/include/log/log_handle.h index f5c1256c9..24fbe6633 100644 --- a/source/log/include/log/log_handle.h +++ b/source/log/include/log/log_handle.h @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/include/log/log_impl.h b/source/log/include/log/log_impl.h index 49121ef1d..567ac3558 100644 --- a/source/log/include/log/log_impl.h +++ b/source/log/include/log/log_impl.h @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/include/log/log_level.h b/source/log/include/log/log_level.h index 02598159c..fe5658d16 100644 --- a/source/log/include/log/log_level.h +++ b/source/log/include/log/log_level.h @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/include/log/log_map.h b/source/log/include/log/log_map.h index 58504eef0..91a8388c0 100644 --- a/source/log/include/log/log_map.h +++ b/source/log/include/log/log_map.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy.h b/source/log/include/log/log_policy.h index 2340673c3..b0d558cb8 100644 --- a/source/log/include/log/log_policy.h +++ b/source/log/include/log/log_policy.h @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/include/log/log_policy_format.h b/source/log/include/log/log_policy_format.h index d31fc1874..9047688c0 100644 --- a/source/log/include/log/log_policy_format.h +++ b/source/log/include/log/log_policy_format.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_format_binary.h b/source/log/include/log/log_policy_format_binary.h index f2811526e..896ba96ff 100644 --- a/source/log/include/log/log_policy_format_binary.h +++ b/source/log/include/log/log_policy_format_binary.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_format_custom.h b/source/log/include/log/log_policy_format_custom.h index e58d96c73..4112ab177 100644 --- a/source/log/include/log/log_policy_format_custom.h +++ b/source/log/include/log/log_policy_format_custom.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_format_text.h b/source/log/include/log/log_policy_format_text.h index 83e041a74..f764fa6ec 100644 --- a/source/log/include/log/log_policy_format_text.h +++ b/source/log/include/log/log_policy_format_text.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_schedule.h b/source/log/include/log/log_policy_schedule.h index 85d212135..c3a53c0d2 100644 --- a/source/log/include/log/log_policy_schedule.h +++ b/source/log/include/log/log_policy_schedule.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_schedule_async.h b/source/log/include/log/log_policy_schedule_async.h index 1acc0992a..92826e61b 100644 --- a/source/log/include/log/log_policy_schedule_async.h +++ b/source/log/include/log/log_policy_schedule_async.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_schedule_sync.h b/source/log/include/log/log_policy_schedule_sync.h index dea6dc2a1..451b20ce4 100644 --- a/source/log/include/log/log_policy_schedule_sync.h +++ b/source/log/include/log/log_policy_schedule_sync.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_storage.h b/source/log/include/log/log_policy_storage.h index 21ed8cb43..04ba13e6e 100644 --- a/source/log/include/log/log_policy_storage.h +++ b/source/log/include/log/log_policy_storage.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_storage_batch.h b/source/log/include/log/log_policy_storage_batch.h index cb5839a82..6f14bbd3f 100644 --- a/source/log/include/log/log_policy_storage_batch.h +++ b/source/log/include/log/log_policy_storage_batch.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_storage_sequential.h b/source/log/include/log/log_policy_storage_sequential.h index 6ec9c39c7..7233f2dba 100644 --- a/source/log/include/log/log_policy_storage_sequential.h +++ b/source/log/include/log/log_policy_storage_sequential.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_stream.h b/source/log/include/log/log_policy_stream.h index 2bd99a4c5..239e646f1 100644 --- a/source/log/include/log/log_policy_stream.h +++ b/source/log/include/log/log_policy_stream.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_stream_custom.h b/source/log/include/log/log_policy_stream_custom.h index e8d718fbb..7322e1f4c 100644 --- a/source/log/include/log/log_policy_stream_custom.h +++ b/source/log/include/log/log_policy_stream_custom.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_stream_file.h b/source/log/include/log/log_policy_stream_file.h index d901f4916..466195f47 100644 --- a/source/log/include/log/log_policy_stream_file.h +++ b/source/log/include/log/log_policy_stream_file.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_stream_nginx.h b/source/log/include/log/log_policy_stream_nginx.h index 70d0da145..22eb7036d 100644 --- a/source/log/include/log/log_policy_stream_nginx.h +++ b/source/log/include/log/log_policy_stream_nginx.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_stream_socket.h b/source/log/include/log/log_policy_stream_socket.h index 3fc593297..be98efbe0 100644 --- a/source/log/include/log/log_policy_stream_socket.h +++ b/source/log/include/log/log_policy_stream_socket.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_stream_stdio.h b/source/log/include/log/log_policy_stream_stdio.h index 20d118796..dd6f543c9 100644 --- a/source/log/include/log/log_policy_stream_stdio.h +++ b/source/log/include/log/log_policy_stream_stdio.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_policy_stream_syslog.h b/source/log/include/log/log_policy_stream_syslog.h index 558e5de77..a5fab536d 100644 --- a/source/log/include/log/log_policy_stream_syslog.h +++ b/source/log/include/log/log_policy_stream_syslog.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_preprocessor.h b/source/log/include/log/log_preprocessor.h index e2dfb62dc..66676cd21 100644 --- a/source/log/include/log/log_preprocessor.h +++ b/source/log/include/log/log_preprocessor.h @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/include/log/log_record.h b/source/log/include/log/log_record.h index 4250471e3..c93967af7 100644 --- a/source/log/include/log/log_record.h +++ b/source/log/include/log/log_record.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_singleton.h b/source/log/include/log/log_singleton.h index 23edd30a8..31dce2ddb 100644 --- a/source/log/include/log/log_singleton.h +++ b/source/log/include/log/log_singleton.h @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/include/log/log_valid_size.h b/source/log/include/log/log_valid_size.h index d822da16a..29cfdd547 100644 --- a/source/log/include/log/log_valid_size.h +++ b/source/log/include/log/log_valid_size.h @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/source/log.c b/source/log/source/log.c index 3d22b4541..6643b7b89 100644 --- a/source/log/source/log.c +++ b/source/log/source/log.c @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -248,7 +248,7 @@ const char *log_print_info(void) { static const char log_info[] = "Logger Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef LOG_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/log/source/log_aspect.c b/source/log/source/log_aspect.c index aeb11efe5..360077dc8 100644 --- a/source/log/source/log_aspect.c +++ b/source/log/source/log_aspect.c @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/source/log_aspect_format.c b/source/log/source/log_aspect_format.c index 4aa81b0cc..f28dfe262 100644 --- a/source/log/source/log_aspect_format.c +++ b/source/log/source/log_aspect_format.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_aspect_schedule.c b/source/log/source/log_aspect_schedule.c index d951f8aee..421d6e9ec 100644 --- a/source/log/source/log_aspect_schedule.c +++ b/source/log/source/log_aspect_schedule.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_aspect_storage.c b/source/log/source/log_aspect_storage.c index ce23ac891..f6ffeb15d 100644 --- a/source/log/source/log_aspect_storage.c +++ b/source/log/source/log_aspect_storage.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_aspect_stream.c b/source/log/source/log_aspect_stream.c index 01cfac361..2a1aaa57d 100644 --- a/source/log/source/log_aspect_stream.c +++ b/source/log/source/log_aspect_stream.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_handle.c b/source/log/source/log_handle.c index e79c9a1dd..ff691fc45 100644 --- a/source/log/source/log_handle.c +++ b/source/log/source/log_handle.c @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/source/log_impl.c b/source/log/source/log_impl.c index 875321d73..6b412c20c 100644 --- a/source/log/source/log_impl.c +++ b/source/log/source/log_impl.c @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/source/log_level.c b/source/log/source/log_level.c index 17b453dbe..a11a790af 100644 --- a/source/log/source/log_level.c +++ b/source/log/source/log_level.c @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/source/log_map.c b/source/log/source/log_map.c index 6bbbcc569..8796e0515 100644 --- a/source/log/source/log_map.c +++ b/source/log/source/log_map.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy.c b/source/log/source/log_policy.c index 5afce576a..7b569330a 100644 --- a/source/log/source/log_policy.c +++ b/source/log/source/log_policy.c @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/log/source/log_policy_format.c b/source/log/source/log_policy_format.c index a54e306f9..f02907228 100644 --- a/source/log/source/log_policy_format.c +++ b/source/log/source/log_policy_format.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_format_binary.c b/source/log/source/log_policy_format_binary.c index 3730e91f1..4c4774521 100644 --- a/source/log/source/log_policy_format_binary.c +++ b/source/log/source/log_policy_format_binary.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_format_custom.c b/source/log/source/log_policy_format_custom.c index 7cb4b8a93..459eb9437 100644 --- a/source/log/source/log_policy_format_custom.c +++ b/source/log/source/log_policy_format_custom.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_format_text.c b/source/log/source/log_policy_format_text.c index 0ae0e13ed..1deea2c22 100644 --- a/source/log/source/log_policy_format_text.c +++ b/source/log/source/log_policy_format_text.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_schedule.c b/source/log/source/log_policy_schedule.c index 211400762..491b7111e 100644 --- a/source/log/source/log_policy_schedule.c +++ b/source/log/source/log_policy_schedule.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_schedule_async.c b/source/log/source/log_policy_schedule_async.c index 27f0ba3f2..a3164f299 100644 --- a/source/log/source/log_policy_schedule_async.c +++ b/source/log/source/log_policy_schedule_async.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_schedule_sync.c b/source/log/source/log_policy_schedule_sync.c index 9d6c78b60..1e5683f2f 100644 --- a/source/log/source/log_policy_schedule_sync.c +++ b/source/log/source/log_policy_schedule_sync.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_storage.c b/source/log/source/log_policy_storage.c index 9a95e52a1..9f7373790 100644 --- a/source/log/source/log_policy_storage.c +++ b/source/log/source/log_policy_storage.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_storage_batch.c b/source/log/source/log_policy_storage_batch.c index d34f9e794..c763875ea 100644 --- a/source/log/source/log_policy_storage_batch.c +++ b/source/log/source/log_policy_storage_batch.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_storage_sequential.c b/source/log/source/log_policy_storage_sequential.c index 1abb17e27..20ef428a0 100644 --- a/source/log/source/log_policy_storage_sequential.c +++ b/source/log/source/log_policy_storage_sequential.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_stream.c b/source/log/source/log_policy_stream.c index 1792d80b6..fa65c9504 100644 --- a/source/log/source/log_policy_stream.c +++ b/source/log/source/log_policy_stream.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_stream_custom.c b/source/log/source/log_policy_stream_custom.c index d20bd4761..de0a61789 100644 --- a/source/log/source/log_policy_stream_custom.c +++ b/source/log/source/log_policy_stream_custom.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_stream_file.c b/source/log/source/log_policy_stream_file.c index 8453d46fb..28770a67d 100644 --- a/source/log/source/log_policy_stream_file.c +++ b/source/log/source/log_policy_stream_file.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_stream_nginx.c b/source/log/source/log_policy_stream_nginx.c index 5309c1408..6d75b4937 100644 --- a/source/log/source/log_policy_stream_nginx.c +++ b/source/log/source/log_policy_stream_nginx.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_stream_socket.c b/source/log/source/log_policy_stream_socket.c index bc99b80e4..d433286de 100644 --- a/source/log/source/log_policy_stream_socket.c +++ b/source/log/source/log_policy_stream_socket.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_stream_stdio.c b/source/log/source/log_policy_stream_stdio.c index 610a2c5e4..cea63699d 100644 --- a/source/log/source/log_policy_stream_stdio.c +++ b/source/log/source/log_policy_stream_stdio.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_policy_stream_syslog.c b/source/log/source/log_policy_stream_syslog.c index 22aefbef1..3cae6c9f0 100644 --- a/source/log/source/log_policy_stream_syslog.c +++ b/source/log/source/log_policy_stream_syslog.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_record.c b/source/log/source/log_record.c index bdb6f2a6c..f99237b63 100644 --- a/source/log/source/log_record.c +++ b/source/log/source/log_record.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_singleton.c b/source/log/source/log_singleton.c index cd6aefa40..63e63f2d0 100644 --- a/source/log/source/log_singleton.c +++ b/source/log/source/log_singleton.c @@ -1,6 +1,6 @@ /* * Logger Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic logger library providing application execution reports. * diff --git a/source/log/source/log_valid_size.c b/source/log/source/log_valid_size.c index 5583c000c..96db31c69 100644 --- a/source/log/source/log_valid_size.c +++ b/source/log/source/log_valid_size.c @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/include/memory/memory.h b/source/memory/include/memory/memory.h index e1ce6a244..ec664adb5 100644 --- a/source/memory/include/memory/memory.h +++ b/source/memory/include/memory/memory.h @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/include/memory/memory_allocator.h b/source/memory/include/memory/memory_allocator.h index b8448027e..668177a07 100644 --- a/source/memory/include/memory/memory_allocator.h +++ b/source/memory/include/memory/memory_allocator.h @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/include/memory/memory_allocator_iface.h b/source/memory/include/memory/memory_allocator_iface.h index 9249b263b..b87cf8c98 100644 --- a/source/memory/include/memory/memory_allocator_iface.h +++ b/source/memory/include/memory/memory_allocator_iface.h @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/include/memory/memory_allocator_impl.h b/source/memory/include/memory/memory_allocator_impl.h index 73c4369b2..5476e6a3e 100644 --- a/source/memory/include/memory/memory_allocator_impl.h +++ b/source/memory/include/memory/memory_allocator_impl.h @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/include/memory/memory_allocator_nginx.h b/source/memory/include/memory/memory_allocator_nginx.h index 4bb005c0a..2e35fd648 100644 --- a/source/memory/include/memory/memory_allocator_nginx.h +++ b/source/memory/include/memory/memory_allocator_nginx.h @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/include/memory/memory_allocator_nginx_impl.h b/source/memory/include/memory/memory_allocator_nginx_impl.h index 73aa5a4f2..b2dff3bb2 100644 --- a/source/memory/include/memory/memory_allocator_nginx_impl.h +++ b/source/memory/include/memory/memory_allocator_nginx_impl.h @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/include/memory/memory_allocator_std.h b/source/memory/include/memory/memory_allocator_std.h index 0f27a83fe..779bce088 100644 --- a/source/memory/include/memory/memory_allocator_std.h +++ b/source/memory/include/memory/memory_allocator_std.h @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/include/memory/memory_allocator_std_impl.h b/source/memory/include/memory/memory_allocator_std_impl.h index 20fc8bb45..f25819d55 100644 --- a/source/memory/include/memory/memory_allocator_std_impl.h +++ b/source/memory/include/memory/memory_allocator_std_impl.h @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/source/memory.c b/source/memory/source/memory.c index cb41b078b..87107f32f 100644 --- a/source/memory/source/memory.c +++ b/source/memory/source/memory.c @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ const char *memory_print_info(void) { static const char memory_info[] = "Memory Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef MEMORY_STATIC_DEFINE "Compiled as static library type" diff --git a/source/memory/source/memory_allocator.c b/source/memory/source/memory_allocator.c index c6962d83a..5d853b30a 100644 --- a/source/memory/source/memory_allocator.c +++ b/source/memory/source/memory_allocator.c @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/source/memory_allocator_nginx.c b/source/memory/source/memory_allocator_nginx.c index 000dffb4b..dc5385648 100644 --- a/source/memory/source/memory_allocator_nginx.c +++ b/source/memory/source/memory_allocator_nginx.c @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/source/memory_allocator_nginx_impl.c b/source/memory/source/memory_allocator_nginx_impl.c index 5acec5ef1..cd5534a97 100644 --- a/source/memory/source/memory_allocator_nginx_impl.c +++ b/source/memory/source/memory_allocator_nginx_impl.c @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/source/memory_allocator_std.c b/source/memory/source/memory_allocator_std.c index 9d5bf5807..ce755c4fd 100644 --- a/source/memory/source/memory_allocator_std.c +++ b/source/memory/source/memory_allocator_std.c @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/memory/source/memory_allocator_std_impl.c b/source/memory/source/memory_allocator_std_impl.c index 5d1cebf03..77b36f8a8 100644 --- a/source/memory/source/memory_allocator_std_impl.c +++ b/source/memory/source/memory_allocator_std_impl.c @@ -2,7 +2,7 @@ * Memory Library by Parra Studios * A generic cross-platform memory utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/include/metacall/metacall.h b/source/metacall/include/metacall/metacall.h index b7788e223..8ef64fd3e 100644 --- a/source/metacall/include/metacall/metacall.h +++ b/source/metacall/include/metacall/metacall.h @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/include/metacall/metacall_allocator.h b/source/metacall/include/metacall/metacall_allocator.h index 46fc614c4..c7d8017c6 100644 --- a/source/metacall/include/metacall/metacall_allocator.h +++ b/source/metacall/include/metacall/metacall_allocator.h @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/include/metacall/metacall_error.h b/source/metacall/include/metacall/metacall_error.h index e65d5f986..ae030b965 100644 --- a/source/metacall/include/metacall/metacall_error.h +++ b/source/metacall/include/metacall/metacall_error.h @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/include/metacall/metacall_fork.h b/source/metacall/include/metacall/metacall_fork.h index 0cbfb86d1..fd9915fce 100644 --- a/source/metacall/include/metacall/metacall_fork.h +++ b/source/metacall/include/metacall/metacall_fork.h @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/include/metacall/metacall_link.h b/source/metacall/include/metacall/metacall_link.h index 9d5f7d890..fc4f3a2c4 100644 --- a/source/metacall/include/metacall/metacall_link.h +++ b/source/metacall/include/metacall/metacall_link.h @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/include/metacall/metacall_log.h b/source/metacall/include/metacall/metacall_log.h index ee28ccdbc..582ed8ea5 100644 --- a/source/metacall/include/metacall/metacall_log.h +++ b/source/metacall/include/metacall/metacall_log.h @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/include/metacall/metacall_value.h b/source/metacall/include/metacall/metacall_value.h index 932cc75f0..eda910b12 100644 --- a/source/metacall/include/metacall/metacall_value.h +++ b/source/metacall/include/metacall/metacall_value.h @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/metacall_def.h.in b/source/metacall/metacall_def.h.in index 3486a1cea..3e9d92a83 100644 --- a/source/metacall/metacall_def.h.in +++ b/source/metacall/metacall_def.h.in @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 2fdc314b5..dec8182d2 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -2438,7 +2438,7 @@ const char *metacall_print_info(void) { static const char metacall_info[] = "MetaCall Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef METACALL_STATIC_DEFINE "Compiled as static library type" diff --git a/source/metacall/source/metacall_allocator.c b/source/metacall/source/metacall_allocator.c index ee88cdd54..7500b9f82 100644 --- a/source/metacall/source/metacall_allocator.c +++ b/source/metacall/source/metacall_allocator.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/source/metacall_error.c b/source/metacall/source/metacall_error.c index e6833fc52..4bceddc72 100644 --- a/source/metacall/source/metacall_error.c +++ b/source/metacall/source/metacall_error.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/source/metacall_fork.c b/source/metacall/source/metacall_fork.c index cd1ec5022..422c00a0e 100644 --- a/source/metacall/source/metacall_fork.c +++ b/source/metacall/source/metacall_fork.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index 946d37a39..3526c6b18 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/source/metacall_log.c b/source/metacall/source/metacall_log.c index 0678f738d..c2acb82b0 100644 --- a/source/metacall/source/metacall_log.c +++ b/source/metacall/source/metacall_log.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/metacall/source/metacall_value.c b/source/metacall/source/metacall_value.c index b598e599b..821b6bc25 100644 --- a/source/metacall/source/metacall_value.c +++ b/source/metacall/source/metacall_value.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/include/plugin/plugin.h b/source/plugin/include/plugin/plugin.h index 8f856a36f..17464f042 100644 --- a/source/plugin/include/plugin/plugin.h +++ b/source/plugin/include/plugin/plugin.h @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/include/plugin/plugin_descriptor.h b/source/plugin/include/plugin/plugin_descriptor.h index 47eb54fc8..770f081b1 100644 --- a/source/plugin/include/plugin/plugin_descriptor.h +++ b/source/plugin/include/plugin/plugin_descriptor.h @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/include/plugin/plugin_impl.h b/source/plugin/include/plugin/plugin_impl.h index 3a0d108b2..c74706197 100644 --- a/source/plugin/include/plugin/plugin_impl.h +++ b/source/plugin/include/plugin/plugin_impl.h @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/include/plugin/plugin_interface.hpp b/source/plugin/include/plugin/plugin_interface.hpp index c3719abfb..8ec817755 100644 --- a/source/plugin/include/plugin/plugin_interface.hpp +++ b/source/plugin/include/plugin/plugin_interface.hpp @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/include/plugin/plugin_loader.h b/source/plugin/include/plugin/plugin_loader.h index 2113010cb..486291861 100644 --- a/source/plugin/include/plugin/plugin_loader.h +++ b/source/plugin/include/plugin/plugin_loader.h @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/include/plugin/plugin_manager.h b/source/plugin/include/plugin/plugin_manager.h index 8698733b5..724db1c30 100644 --- a/source/plugin/include/plugin/plugin_manager.h +++ b/source/plugin/include/plugin/plugin_manager.h @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/source/plugin.c b/source/plugin/source/plugin.c index 4089f2d02..b8b325cbc 100644 --- a/source/plugin/source/plugin.c +++ b/source/plugin/source/plugin.c @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ const char *plugin_print_info(void) { static const char plugin_info[] = "Plugin Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef PLUGIN_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/plugin/source/plugin_descriptor.c b/source/plugin/source/plugin_descriptor.c index 00f463079..2a5ff1d12 100644 --- a/source/plugin/source/plugin_descriptor.c +++ b/source/plugin/source/plugin_descriptor.c @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/source/plugin_impl.c b/source/plugin/source/plugin_impl.c index 785a55834..1de83e55f 100644 --- a/source/plugin/source/plugin_impl.c +++ b/source/plugin/source/plugin_impl.c @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/source/plugin_loader.c b/source/plugin/source/plugin_loader.c index a88ccda71..7b3ff0774 100644 --- a/source/plugin/source/plugin_loader.c +++ b/source/plugin/source/plugin_loader.c @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugin/source/plugin_manager.c b/source/plugin/source/plugin_manager.c index 353eaded5..94e6cc5d3 100644 --- a/source/plugin/source/plugin_manager.c +++ b/source/plugin/source/plugin_manager.c @@ -2,7 +2,7 @@ * Plugin Library by Parra Studios * A library for plugins at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugins/backtrace_plugin/include/backtrace_plugin/backtrace_plugin.h b/source/plugins/backtrace_plugin/include/backtrace_plugin/backtrace_plugin.h index 7a2ce1f07..8277dc2e4 100644 --- a/source/plugins/backtrace_plugin/include/backtrace_plugin/backtrace_plugin.h +++ b/source/plugins/backtrace_plugin/include/backtrace_plugin/backtrace_plugin.h @@ -2,7 +2,7 @@ * Backtrace Plugin by Parra Studios * A plugin implementing backtracing functionality for MetaCall Core. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugins/backtrace_plugin/source/backtrace_plugin.cpp b/source/plugins/backtrace_plugin/source/backtrace_plugin.cpp index c3e826fd3..16f8fe0ff 100644 --- a/source/plugins/backtrace_plugin/source/backtrace_plugin.cpp +++ b/source/plugins/backtrace_plugin/source/backtrace_plugin.cpp @@ -2,7 +2,7 @@ * Backtrace Plugin by Parra Studios * A plugin implementing backtracing functionality for MetaCall Core. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugins/sandbox_plugin/cmake/FindLibSecComp.cmake b/source/plugins/sandbox_plugin/cmake/FindLibSecComp.cmake index 9293d405e..8265541fa 100644 --- a/source/plugins/sandbox_plugin/cmake/FindLibSecComp.cmake +++ b/source/plugins/sandbox_plugin/cmake/FindLibSecComp.cmake @@ -2,7 +2,7 @@ # CMake Find LibSecComp library by Parra Studios # CMake script to find SecComp library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/plugins/sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h b/source/plugins/sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h index 68d6d23f4..1fc338afe 100644 --- a/source/plugins/sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h +++ b/source/plugins/sandbox_plugin/include/sandbox_plugin/sandbox_plugin.h @@ -2,7 +2,7 @@ * Sandbox Plugin by Parra Studios * A plugin implementing sandboxing functionality for MetaCall Core. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/plugins/sandbox_plugin/source/sandbox_plugin.cpp b/source/plugins/sandbox_plugin/source/sandbox_plugin.cpp index 06eed5fd9..884342633 100644 --- a/source/plugins/sandbox_plugin/source/sandbox_plugin.cpp +++ b/source/plugins/sandbox_plugin/source/sandbox_plugin.cpp @@ -2,7 +2,7 @@ * Sandbox Plugin by Parra Studios * A plugin implementing sandboxing functionality for MetaCall Core. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability.h b/source/portability/include/portability/portability.h index 75af3411b..f440b5050 100644 --- a/source/portability/include/portability/portability.h +++ b/source/portability/include/portability/portability.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability_assert.h b/source/portability/include/portability/portability_assert.h index bb90a39b5..60e67d122 100644 --- a/source/portability/include/portability/portability_assert.h +++ b/source/portability/include/portability/portability_assert.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability_atexit.h b/source/portability/include/portability/portability_atexit.h index 78c107b1a..dc1ad0356 100644 --- a/source/portability/include/portability/portability_atexit.h +++ b/source/portability/include/portability/portability_atexit.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability_compiler.h b/source/portability/include/portability/portability_compiler.h index 871adf181..3fa5481cc 100644 --- a/source/portability/include/portability/portability_compiler.h +++ b/source/portability/include/portability/portability_compiler.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability_constructor.h b/source/portability/include/portability/portability_constructor.h index 9dc72a838..bb2879473 100644 --- a/source/portability/include/portability/portability_constructor.h +++ b/source/portability/include/portability/portability_constructor.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability_executable_path.h b/source/portability/include/portability/portability_executable_path.h index 15494b002..0813ef3d5 100644 --- a/source/portability/include/portability/portability_executable_path.h +++ b/source/portability/include/portability/portability_executable_path.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability_library_path.h b/source/portability/include/portability/portability_library_path.h index e31bd7d49..5e266a5a3 100644 --- a/source/portability/include/portability/portability_library_path.h +++ b/source/portability/include/portability/portability_library_path.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability_path.h b/source/portability/include/portability/portability_path.h index 5453c37ad..36885514a 100644 --- a/source/portability/include/portability/portability_path.h +++ b/source/portability/include/portability/portability_path.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/include/portability/portability_working_path.h b/source/portability/include/portability/portability_working_path.h index 00866a3a9..15c8d5af5 100644 --- a/source/portability/include/portability/portability_working_path.h +++ b/source/portability/include/portability/portability_working_path.h @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/source/portability.c b/source/portability/source/portability.c index 7c57003ff..4893aff52 100644 --- a/source/portability/source/portability.c +++ b/source/portability/source/portability.c @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ const char *portability_print_info(void) { static const char portability_info[] = "Portability Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef PORTABILITY_STATIC_DEFINE "Compiled as static library type" diff --git a/source/portability/source/portability_atexit.c b/source/portability/source/portability_atexit.c index d08ee3653..5dafc48a9 100644 --- a/source/portability/source/portability_atexit.c +++ b/source/portability/source/portability_atexit.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/source/portability_executable_path.c b/source/portability/source/portability_executable_path.c index 7c63917d7..b5492bfc6 100644 --- a/source/portability/source/portability_executable_path.c +++ b/source/portability/source/portability_executable_path.c @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index a8b763cb2..8bf167036 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/source/portability_path.c b/source/portability/source/portability_path.c index 3a1a02ac7..9e5232c27 100644 --- a/source/portability/source/portability_path.c +++ b/source/portability/source/portability_path.c @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/portability/source/portability_working_path.c b/source/portability/source/portability_working_path.c index 1511cef35..b571b6f0a 100644 --- a/source/portability/source/portability_working_path.c +++ b/source/portability/source/portability_working_path.c @@ -2,7 +2,7 @@ * Portability Library by Parra Studios * A generic cross-platform portability utility. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/CMakeLists.txt b/source/ports/CMakeLists.txt index c27949d5f..056f9e97a 100644 --- a/source/ports/CMakeLists.txt +++ b/source/ports/CMakeLists.txt @@ -2,7 +2,7 @@ # MetaCall Ports by Parra Studios # A complete infrastructure for supporting multiple language bindings in MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/cxx_port/include/metacall/metacall.hpp b/source/ports/cxx_port/include/metacall/metacall.hpp index 8e2a1ef66..7995efa3e 100644 --- a/source/ports/cxx_port/include/metacall/metacall.hpp +++ b/source/ports/cxx_port/include/metacall/metacall.hpp @@ -2,7 +2,7 @@ * Format Library by Parra Studios * A cross-platform library for supporting formatted input / output. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/cxx_port/inline/metacall/metacall.inl b/source/ports/cxx_port/inline/metacall/metacall.inl index 743c6a0c8..7789dff86 100644 --- a/source/ports/cxx_port/inline/metacall/metacall.inl +++ b/source/ports/cxx_port/inline/metacall/metacall.inl @@ -2,7 +2,7 @@ * Format Library by Parra Studios * A cross-platform library for supporting formatted input / output. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/cxx_port/source/metacall.cpp b/source/ports/cxx_port/source/metacall.cpp index d1a7cbe8f..80f7ea357 100644 --- a/source/ports/cxx_port/source/metacall.cpp +++ b/source/ports/cxx_port/source/metacall.cpp @@ -2,7 +2,7 @@ * Format Library by Parra Studios * A cross-platform library for supporting formatted input / output. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/go_port/source/await.go b/source/ports/go_port/source/await.go index 11661b2dc..2f1ecea86 100644 --- a/source/ports/go_port/source/await.go +++ b/source/ports/go_port/source/await.go @@ -2,7 +2,7 @@ * MetaCall Go Port by Parra Studios * A frontend for Go language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/go_port/source/go_port.go b/source/ports/go_port/source/go_port.go index 4a7e12574..21692582a 100644 --- a/source/ports/go_port/source/go_port.go +++ b/source/ports/go_port/source/go_port.go @@ -2,7 +2,7 @@ * MetaCall Go Port by Parra Studios * A frontend for Go language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/go_port/source/pointer.go b/source/ports/go_port/source/pointer.go index 5317378ec..6bbac8dbf 100644 --- a/source/ports/go_port/source/pointer.go +++ b/source/ports/go_port/source/pointer.go @@ -2,7 +2,7 @@ * MetaCall Go Port by Parra Studios * A frontend for Go language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/js_port/include/js_port/js_port.h b/source/ports/js_port/include/js_port/js_port.h index 245d537f1..20b6be901 100644 --- a/source/ports/js_port/include/js_port/js_port.h +++ b/source/ports/js_port/include/js_port/js_port.h @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/js_port/interface/js_port/js_port.i b/source/ports/js_port/interface/js_port/js_port.i index be171c710..bb6a9e17b 100644 --- a/source/ports/js_port/interface/js_port/js_port.i +++ b/source/ports/js_port/interface/js_port/js_port.i @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/js_port/interface/js_port/js_port_impl.i b/source/ports/js_port/interface/js_port/js_port_impl.i index 711d560a4..994d68923 100644 --- a/source/ports/js_port/interface/js_port/js_port_impl.i +++ b/source/ports/js_port/interface/js_port/js_port_impl.i @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/js_port/source/js_port.c b/source/ports/js_port/source/js_port.c index a2a304400..3ac626eed 100644 --- a/source/ports/js_port/source/js_port.c +++ b/source/ports/js_port/source/js_port.c @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/js_port/test/main.cpp b/source/ports/js_port/test/main.cpp index ea4d06e98..5338c2829 100644 --- a/source/ports/js_port/test/main.cpp +++ b/source/ports/js_port/test/main.cpp @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/nim_port/LICENSE b/source/ports/nim_port/LICENSE index 2e591e57a..d56ad81fa 100644 --- a/source/ports/nim_port/LICENSE +++ b/source/ports/nim_port/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/ports/node_port/LICENSE b/source/ports/node_port/LICENSE index 2e591e57a..d56ad81fa 100644 --- a/source/ports/node_port/LICENSE +++ b/source/ports/node_port/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 9e3b5793f..0df0a7590 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -2,7 +2,7 @@ * MetaCall NodeJS Port by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/node_port/test.js b/source/ports/node_port/test.js index fb04ea5b1..6dd49fbc3 100644 --- a/source/ports/node_port/test.js +++ b/source/ports/node_port/test.js @@ -2,7 +2,7 @@ * MetaCall NodeJS Port by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/node_port/test/index.js b/source/ports/node_port/test/index.js index c6a71114c..e7ef89a58 100644 --- a/source/ports/node_port/test/index.js +++ b/source/ports/node_port/test/index.js @@ -2,7 +2,7 @@ * MetaCall NodeJS Port by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/node_port/upload.sh b/source/ports/node_port/upload.sh index 297ced5a9..a38301bd8 100755 --- a/source/ports/node_port/upload.sh +++ b/source/ports/node_port/upload.sh @@ -4,7 +4,7 @@ # MetaCall NodeJS Port Deploy Script by Parra Studios # Script utility for deploying MetaCall NodeJS Port to NPM. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/py_port/LICENSE.txt b/source/ports/py_port/LICENSE.txt index 2e591e57a..d56ad81fa 100644 --- a/source/ports/py_port/LICENSE.txt +++ b/source/ports/py_port/LICENSE.txt @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/ports/py_port/helper/__init__.py b/source/ports/py_port/helper/__init__.py index e410e7868..3534e2a45 100644 --- a/source/ports/py_port/helper/__init__.py +++ b/source/ports/py_port/helper/__init__.py @@ -3,7 +3,7 @@ # MetaCall Python Port by Parra Studios # A frontend for Python language bindings in MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/py_port/metacall/__init__.py b/source/ports/py_port/metacall/__init__.py index ef8a6fd07..412cd2dd1 100644 --- a/source/ports/py_port/metacall/__init__.py +++ b/source/ports/py_port/metacall/__init__.py @@ -3,7 +3,7 @@ # MetaCall Python Port by Parra Studios # A frontend for Python language bindings in MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/py_port/metacall/api.py b/source/ports/py_port/metacall/api.py index 6bfb290cc..1c1d328b8 100644 --- a/source/ports/py_port/metacall/api.py +++ b/source/ports/py_port/metacall/api.py @@ -3,7 +3,7 @@ # MetaCall Python Port by Parra Studios # A frontend for Python language bindings in MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/py_port/metacall/module_linux.py b/source/ports/py_port/metacall/module_linux.py index 0a18b3260..cf9fdd634 100644 --- a/source/ports/py_port/metacall/module_linux.py +++ b/source/ports/py_port/metacall/module_linux.py @@ -3,7 +3,7 @@ # MetaCall Python Port by Parra Studios # A frontend for Python language bindings in MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/py_port/metacall/module_win32.py b/source/ports/py_port/metacall/module_win32.py index aed098254..4c5c8e4e8 100644 --- a/source/ports/py_port/metacall/module_win32.py +++ b/source/ports/py_port/metacall/module_win32.py @@ -3,7 +3,7 @@ # MetaCall Python Port by Parra Studios # A frontend for Python language bindings in MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index e085fcfeb..d34742d73 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -3,7 +3,7 @@ # MetaCall Python Port by Parra Studios # A frontend for Python language bindings in MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index 2ca4f09fd..5e8635432 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -4,7 +4,7 @@ # MetaCall Python Port Deploy Script by Parra Studios # Script utility for deploying MetaCall Python Port to PyPi. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/ports/rb_port/include/rb_port/rb_port.h b/source/ports/rb_port/include/rb_port/rb_port.h index d2682f4b8..8e88024dd 100644 --- a/source/ports/rb_port/include/rb_port/rb_port.h +++ b/source/ports/rb_port/include/rb_port/rb_port.h @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/rb_port/interface/rb_port/rb_port.i b/source/ports/rb_port/interface/rb_port/rb_port.i index 7316e756f..6968ab129 100644 --- a/source/ports/rb_port/interface/rb_port/rb_port.i +++ b/source/ports/rb_port/interface/rb_port/rb_port.i @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/rb_port/interface/rb_port/rb_port_impl.i b/source/ports/rb_port/interface/rb_port/rb_port_impl.i index bd0820f2b..ddbd3e705 100644 --- a/source/ports/rb_port/interface/rb_port/rb_port_impl.i +++ b/source/ports/rb_port/interface/rb_port/rb_port_impl.i @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/rb_port/source/rb_port.c b/source/ports/rb_port/source/rb_port.c index 81e52cbcf..b9a5fc4d3 100644 --- a/source/ports/rb_port/source/rb_port.c +++ b/source/ports/rb_port/source/rb_port.c @@ -2,7 +2,7 @@ * MetaCall SWIG Wrapper by Parra Studios * A complete infrastructure for supporting multiple language bindings in MetaCall. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/rs_port/LICENSE.txt b/source/ports/rs_port/LICENSE.txt index 2e591e57a..d56ad81fa 100644 --- a/source/ports/rs_port/LICENSE.txt +++ b/source/ports/rs_port/LICENSE.txt @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016-2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/source/ports/rs_port/src/lib.rs b/source/ports/rs_port/src/lib.rs index 0f1f282a0..ac93df572 100644 --- a/source/ports/rs_port/src/lib.rs +++ b/source/ports/rs_port/src/lib.rs @@ -9,7 +9,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/ports/rs_port/upload.sh b/source/ports/rs_port/upload.sh index a081a7037..c85fac147 100644 --- a/source/ports/rs_port/upload.sh +++ b/source/ports/rs_port/upload.sh @@ -4,7 +4,7 @@ # MetaCall Rust Port Deploy Script by Parra Studios # Script utility for deploying MetaCall Rust Port to Crates. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/preprocessor/cmake/preprocessor_arguments.cmake b/source/preprocessor/cmake/preprocessor_arguments.cmake index 38014c9b8..fa35626a3 100644 --- a/source/preprocessor/cmake/preprocessor_arguments.cmake +++ b/source/preprocessor/cmake/preprocessor_arguments.cmake @@ -2,7 +2,7 @@ # Preprocessor Library by Parra Studios # A generic header-only preprocessor metaprogramming library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/preprocessor/cmake/preprocessor_arithmetic.cmake b/source/preprocessor/cmake/preprocessor_arithmetic.cmake index eca9525db..3c3b33f6b 100644 --- a/source/preprocessor/cmake/preprocessor_arithmetic.cmake +++ b/source/preprocessor/cmake/preprocessor_arithmetic.cmake @@ -2,7 +2,7 @@ # Preprocessor Library by Parra Studios # A generic header-only preprocessor metaprogramming library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/preprocessor/cmake/preprocessor_boolean.cmake b/source/preprocessor/cmake/preprocessor_boolean.cmake index 444336b64..f4dda84e0 100644 --- a/source/preprocessor/cmake/preprocessor_boolean.cmake +++ b/source/preprocessor/cmake/preprocessor_boolean.cmake @@ -2,7 +2,7 @@ # Preprocessor Library by Parra Studios # A generic header-only preprocessor metaprogramming library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/preprocessor/cmake/preprocessor_for.cmake b/source/preprocessor/cmake/preprocessor_for.cmake index abded5af5..883276b6e 100644 --- a/source/preprocessor/cmake/preprocessor_for.cmake +++ b/source/preprocessor/cmake/preprocessor_for.cmake @@ -2,7 +2,7 @@ # Preprocessor Library by Parra Studios # A generic header-only preprocessor metaprogramming library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/preprocessor/cmake/preprocessor_template.cmake b/source/preprocessor/cmake/preprocessor_template.cmake index 11d99a682..782e5b07c 100644 --- a/source/preprocessor/cmake/preprocessor_template.cmake +++ b/source/preprocessor/cmake/preprocessor_template.cmake @@ -2,7 +2,7 @@ # Preprocessor Library by Parra Studios # A generic header-only preprocessor metaprogramming library. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/preprocessor/cmake/preprocessor_template.h.in b/source/preprocessor/cmake/preprocessor_template.h.in index 41b0d1825..59c527067 100644 --- a/source/preprocessor/cmake/preprocessor_template.h.in +++ b/source/preprocessor/cmake/preprocessor_template.h.in @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/preprocessor/include/preprocessor/preprocessor.h b/source/preprocessor/include/preprocessor/preprocessor.h index e223cf40f..62c66cbcf 100644 --- a/source/preprocessor/include/preprocessor/preprocessor.h +++ b/source/preprocessor/include/preprocessor/preprocessor.h @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/preprocessor/include/preprocessor/preprocessor_arguments.h b/source/preprocessor/include/preprocessor/preprocessor_arguments.h index 2f114d913..c78bc4e06 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_arguments.h +++ b/source/preprocessor/include/preprocessor/preprocessor_arguments.h @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/preprocessor/include/preprocessor/preprocessor_arithmetic.h b/source/preprocessor/include/preprocessor/preprocessor_arithmetic.h index b1a9c9647..6b7974ba4 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_arithmetic.h +++ b/source/preprocessor/include/preprocessor/preprocessor_arithmetic.h @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/preprocessor/include/preprocessor/preprocessor_bit.h b/source/preprocessor/include/preprocessor/preprocessor_bit.h index f2aee9d4d..952078a2a 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_bit.h +++ b/source/preprocessor/include/preprocessor/preprocessor_bit.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_boolean.h b/source/preprocessor/include/preprocessor/preprocessor_boolean.h index e042d9ff5..3cb26ad41 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_boolean.h +++ b/source/preprocessor/include/preprocessor/preprocessor_boolean.h @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/preprocessor/include/preprocessor/preprocessor_comma.h b/source/preprocessor/include/preprocessor/preprocessor_comma.h index 62ce258cc..cf4a4b972 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_comma.h +++ b/source/preprocessor/include/preprocessor/preprocessor_comma.h @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/preprocessor/include/preprocessor/preprocessor_comparison.h b/source/preprocessor/include/preprocessor/preprocessor_comparison.h index b4839e124..5308f0699 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_comparison.h +++ b/source/preprocessor/include/preprocessor/preprocessor_comparison.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_complement.h b/source/preprocessor/include/preprocessor/preprocessor_complement.h index a7300fc45..78b6688bf 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_complement.h +++ b/source/preprocessor/include/preprocessor/preprocessor_complement.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_concatenation.h b/source/preprocessor/include/preprocessor/preprocessor_concatenation.h index f54986f00..4f63401fa 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_concatenation.h +++ b/source/preprocessor/include/preprocessor/preprocessor_concatenation.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_detection.h b/source/preprocessor/include/preprocessor/preprocessor_detection.h index 630676506..d64e51134 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_detection.h +++ b/source/preprocessor/include/preprocessor/preprocessor_detection.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_empty.h b/source/preprocessor/include/preprocessor/preprocessor_empty.h index 0ce59a48c..91f774f9a 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_empty.h +++ b/source/preprocessor/include/preprocessor/preprocessor_empty.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_for.h b/source/preprocessor/include/preprocessor/preprocessor_for.h index b391df429..89821d92d 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_for.h +++ b/source/preprocessor/include/preprocessor/preprocessor_for.h @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/preprocessor/include/preprocessor/preprocessor_if.h b/source/preprocessor/include/preprocessor/preprocessor_if.h index 622397e89..9a491f60d 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_if.h +++ b/source/preprocessor/include/preprocessor/preprocessor_if.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_serial.h b/source/preprocessor/include/preprocessor/preprocessor_serial.h index b4e222c1a..6b64c2d7c 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_serial.h +++ b/source/preprocessor/include/preprocessor/preprocessor_serial.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_stringify.h b/source/preprocessor/include/preprocessor/preprocessor_stringify.h index 322b2806a..4cb637c33 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_stringify.h +++ b/source/preprocessor/include/preprocessor/preprocessor_stringify.h @@ -1,6 +1,6 @@ /* * Preprocessor Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A generic header-only preprocessor metaprogramming library. * diff --git a/source/preprocessor/include/preprocessor/preprocessor_tuple.h b/source/preprocessor/include/preprocessor/preprocessor_tuple.h index 817ecd3bf..1c8ba1ead 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_tuple.h +++ b/source/preprocessor/include/preprocessor/preprocessor_tuple.h @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/preprocessor/source/preprocessor.c b/source/preprocessor/source/preprocessor.c index e6730f45c..d9124af87 100644 --- a/source/preprocessor/source/preprocessor.c +++ b/source/preprocessor/source/preprocessor.c @@ -2,7 +2,7 @@ * Preprocessor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ const char *preprocessor_print_info(void) { static const char preprocessor_info[] = "Preprocessor Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef PREPROCSSOR_STATIC_DEFINE "Compiled as static library type" diff --git a/source/reflect/include/reflect/reflect.h b/source/reflect/include/reflect/reflect.h index 469e1b8c5..967df3baf 100644 --- a/source/reflect/include/reflect/reflect.h +++ b/source/reflect/include/reflect/reflect.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_accessor.h b/source/reflect/include/reflect/reflect_accessor.h index 0dd824051..8b6b7db34 100644 --- a/source/reflect/include/reflect/reflect_accessor.h +++ b/source/reflect/include/reflect/reflect_accessor.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_async.h b/source/reflect/include/reflect/reflect_async.h index 0ce7ed423..09b9a2e59 100644 --- a/source/reflect/include/reflect/reflect_async.h +++ b/source/reflect/include/reflect/reflect_async.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_attribute.h b/source/reflect/include/reflect/reflect_attribute.h index 72c1ecdae..0a628a30c 100644 --- a/source/reflect/include/reflect/reflect_attribute.h +++ b/source/reflect/include/reflect/reflect_attribute.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_attribute_decl.h b/source/reflect/include/reflect/reflect_attribute_decl.h index d3bb74370..61bc8dffb 100644 --- a/source/reflect/include/reflect/reflect_attribute_decl.h +++ b/source/reflect/include/reflect/reflect_attribute_decl.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_class.h b/source/reflect/include/reflect/reflect_class.h index 5056602f0..16aa01f36 100644 --- a/source/reflect/include/reflect/reflect_class.h +++ b/source/reflect/include/reflect/reflect_class.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_class_decl.h b/source/reflect/include/reflect/reflect_class_decl.h index 44c739433..4252569d7 100644 --- a/source/reflect/include/reflect/reflect_class_decl.h +++ b/source/reflect/include/reflect/reflect_class_decl.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_class_visibility.h b/source/reflect/include/reflect/reflect_class_visibility.h index c5641a28a..5a557782d 100644 --- a/source/reflect/include/reflect/reflect_class_visibility.h +++ b/source/reflect/include/reflect/reflect_class_visibility.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_constructor.h b/source/reflect/include/reflect/reflect_constructor.h index cfccebdf0..d0fc0de02 100644 --- a/source/reflect/include/reflect/reflect_constructor.h +++ b/source/reflect/include/reflect/reflect_constructor.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_constructor_decl.h b/source/reflect/include/reflect/reflect_constructor_decl.h index 54ebace01..74565b45b 100644 --- a/source/reflect/include/reflect/reflect_constructor_decl.h +++ b/source/reflect/include/reflect/reflect_constructor_decl.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_context.h b/source/reflect/include/reflect/reflect_context.h index 93b078246..00c3fa015 100644 --- a/source/reflect/include/reflect/reflect_context.h +++ b/source/reflect/include/reflect/reflect_context.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_exception.h b/source/reflect/include/reflect/reflect_exception.h index 89dedc55f..81ff9a3a8 100644 --- a/source/reflect/include/reflect/reflect_exception.h +++ b/source/reflect/include/reflect/reflect_exception.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_function.h b/source/reflect/include/reflect/reflect_function.h index ccfdfbda0..c085541a8 100644 --- a/source/reflect/include/reflect/reflect_function.h +++ b/source/reflect/include/reflect/reflect_function.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_future.h b/source/reflect/include/reflect/reflect_future.h index 9c93fb046..891c1c8c2 100644 --- a/source/reflect/include/reflect/reflect_future.h +++ b/source/reflect/include/reflect/reflect_future.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_memory_tracker.h b/source/reflect/include/reflect/reflect_memory_tracker.h index 7aefbc224..19ce78342 100644 --- a/source/reflect/include/reflect/reflect_memory_tracker.h +++ b/source/reflect/include/reflect/reflect_memory_tracker.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_method.h b/source/reflect/include/reflect/reflect_method.h index 18be52a15..cbcb688fb 100644 --- a/source/reflect/include/reflect/reflect_method.h +++ b/source/reflect/include/reflect/reflect_method.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_method_decl.h b/source/reflect/include/reflect/reflect_method_decl.h index a20a0f2ee..48cc778ce 100644 --- a/source/reflect/include/reflect/reflect_method_decl.h +++ b/source/reflect/include/reflect/reflect_method_decl.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_object.h b/source/reflect/include/reflect/reflect_object.h index 84ab9cc79..6536d89eb 100644 --- a/source/reflect/include/reflect/reflect_object.h +++ b/source/reflect/include/reflect/reflect_object.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_scope.h b/source/reflect/include/reflect/reflect_scope.h index 8b5fe5e9d..98ea815de 100644 --- a/source/reflect/include/reflect/reflect_scope.h +++ b/source/reflect/include/reflect/reflect_scope.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_signature.h b/source/reflect/include/reflect/reflect_signature.h index e5e424460..7982e9940 100644 --- a/source/reflect/include/reflect/reflect_signature.h +++ b/source/reflect/include/reflect/reflect_signature.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_throwable.h b/source/reflect/include/reflect/reflect_throwable.h index fdc12b4fe..fe6a40e31 100644 --- a/source/reflect/include/reflect/reflect_throwable.h +++ b/source/reflect/include/reflect/reflect_throwable.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_type.h b/source/reflect/include/reflect/reflect_type.h index e7048a220..80bbc8b7a 100644 --- a/source/reflect/include/reflect/reflect_type.h +++ b/source/reflect/include/reflect/reflect_type.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_type_id.h b/source/reflect/include/reflect/reflect_type_id.h index 45930c1b6..0028b3357 100644 --- a/source/reflect/include/reflect/reflect_type_id.h +++ b/source/reflect/include/reflect/reflect_type_id.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_value.h b/source/reflect/include/reflect/reflect_value.h index 8b68387bb..249770027 100644 --- a/source/reflect/include/reflect/reflect_value.h +++ b/source/reflect/include/reflect/reflect_value.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_value_type.h b/source/reflect/include/reflect/reflect_value_type.h index fdb7856b7..ce4cf58a2 100644 --- a/source/reflect/include/reflect/reflect_value_type.h +++ b/source/reflect/include/reflect/reflect_value_type.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_value_type_cast.h b/source/reflect/include/reflect/reflect_value_type_cast.h index 734b1d749..22b7420b2 100644 --- a/source/reflect/include/reflect/reflect_value_type_cast.h +++ b/source/reflect/include/reflect/reflect_value_type_cast.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_value_type_demotion.h b/source/reflect/include/reflect/reflect_value_type_demotion.h index f2aad7af2..a3060f289 100644 --- a/source/reflect/include/reflect/reflect_value_type_demotion.h +++ b/source/reflect/include/reflect/reflect_value_type_demotion.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_value_type_id_size.h b/source/reflect/include/reflect/reflect_value_type_id_size.h index 88c5a1437..294897d89 100644 --- a/source/reflect/include/reflect/reflect_value_type_id_size.h +++ b/source/reflect/include/reflect/reflect_value_type_id_size.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/include/reflect/reflect_value_type_promotion.h b/source/reflect/include/reflect/reflect_value_type_promotion.h index 21ba8da10..c8b59d307 100644 --- a/source/reflect/include/reflect/reflect_value_type_promotion.h +++ b/source/reflect/include/reflect/reflect_value_type_promotion.h @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect.c b/source/reflect/source/reflect.c index c8c283d11..724628a0d 100644 --- a/source/reflect/source/reflect.c +++ b/source/reflect/source/reflect.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ const char *reflect_print_info(void) { static const char reflect_info[] = "Reflect Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef REFLECT_STATIC_DEFINE "Compiled as static library type" diff --git a/source/reflect/source/reflect_attribute.c b/source/reflect/source/reflect_attribute.c index 7f4421ff1..420ff150e 100644 --- a/source/reflect/source/reflect_attribute.c +++ b/source/reflect/source/reflect_attribute.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_class.c b/source/reflect/source/reflect_class.c index 650318b76..77ea42baa 100644 --- a/source/reflect/source/reflect_class.c +++ b/source/reflect/source/reflect_class.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_class_visibility.c b/source/reflect/source/reflect_class_visibility.c index e32a3d504..93cd90c86 100644 --- a/source/reflect/source/reflect_class_visibility.c +++ b/source/reflect/source/reflect_class_visibility.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_constructor.c b/source/reflect/source/reflect_constructor.c index bb264e1a6..c12a9c25f 100644 --- a/source/reflect/source/reflect_constructor.c +++ b/source/reflect/source/reflect_constructor.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_context.c b/source/reflect/source/reflect_context.c index bf203b8b4..e0e7ee326 100644 --- a/source/reflect/source/reflect_context.c +++ b/source/reflect/source/reflect_context.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_exception.c b/source/reflect/source/reflect_exception.c index 122503121..179aa237a 100644 --- a/source/reflect/source/reflect_exception.c +++ b/source/reflect/source/reflect_exception.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_function.c b/source/reflect/source/reflect_function.c index 692ca28d5..d64ab1c90 100644 --- a/source/reflect/source/reflect_function.c +++ b/source/reflect/source/reflect_function.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_future.c b/source/reflect/source/reflect_future.c index e2b7ebb92..86ab560ab 100644 --- a/source/reflect/source/reflect_future.c +++ b/source/reflect/source/reflect_future.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_memory_tracker.c b/source/reflect/source/reflect_memory_tracker.c index ba1344057..e810571fe 100644 --- a/source/reflect/source/reflect_memory_tracker.c +++ b/source/reflect/source/reflect_memory_tracker.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_method.c b/source/reflect/source/reflect_method.c index 7f47a2b41..e4b4bc688 100644 --- a/source/reflect/source/reflect_method.c +++ b/source/reflect/source/reflect_method.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_object.c b/source/reflect/source/reflect_object.c index 6d64cbcd9..1938d55ec 100644 --- a/source/reflect/source/reflect_object.c +++ b/source/reflect/source/reflect_object.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_scope.c b/source/reflect/source/reflect_scope.c index f7d82f35c..a8fbe4944 100644 --- a/source/reflect/source/reflect_scope.c +++ b/source/reflect/source/reflect_scope.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_signature.c b/source/reflect/source/reflect_signature.c index 94536d8d1..04c7ba3d6 100644 --- a/source/reflect/source/reflect_signature.c +++ b/source/reflect/source/reflect_signature.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_throwable.c b/source/reflect/source/reflect_throwable.c index 56929e0ed..d64c76740 100644 --- a/source/reflect/source/reflect_throwable.c +++ b/source/reflect/source/reflect_throwable.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_type.c b/source/reflect/source/reflect_type.c index ea46ed69e..ed7786b79 100644 --- a/source/reflect/source/reflect_type.c +++ b/source/reflect/source/reflect_type.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_type_id.c b/source/reflect/source/reflect_type_id.c index 1b5f99d20..b168dd6fa 100644 --- a/source/reflect/source/reflect_type_id.c +++ b/source/reflect/source/reflect_type_id.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_value.c b/source/reflect/source/reflect_value.c index 8fa353752..6b8b19b6b 100644 --- a/source/reflect/source/reflect_value.c +++ b/source/reflect/source/reflect_value.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_value_type.c b/source/reflect/source/reflect_value_type.c index dcae4ce6f..6775aac44 100644 --- a/source/reflect/source/reflect_value_type.c +++ b/source/reflect/source/reflect_value_type.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_value_type_cast.c b/source/reflect/source/reflect_value_type_cast.c index 126ddcd6e..7b7410da3 100644 --- a/source/reflect/source/reflect_value_type_cast.c +++ b/source/reflect/source/reflect_value_type_cast.c @@ -1,6 +1,6 @@ /* * Reflect Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A library for provide reflection and metadata representation. * diff --git a/source/reflect/source/reflect_value_type_demotion.c b/source/reflect/source/reflect_value_type_demotion.c index 01f25a038..580c81385 100644 --- a/source/reflect/source/reflect_value_type_demotion.c +++ b/source/reflect/source/reflect_value_type_demotion.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_value_type_id_size.c b/source/reflect/source/reflect_value_type_id_size.c index 2ad67dc0b..bf18225cd 100644 --- a/source/reflect/source/reflect_value_type_id_size.c +++ b/source/reflect/source/reflect_value_type_id_size.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/reflect/source/reflect_value_type_promotion.c b/source/reflect/source/reflect_value_type_promotion.c index f7d255028..2eb66183f 100644 --- a/source/reflect/source/reflect_value_type_promotion.c +++ b/source/reflect/source/reflect_value_type_promotion.c @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/scripts/c/cmake/CProject.cmake b/source/scripts/c/cmake/CProject.cmake index 473c00be6..a68a08c41 100644 --- a/source/scripts/c/cmake/CProject.cmake +++ b/source/scripts/c/cmake/CProject.cmake @@ -2,7 +2,7 @@ # C project generator by Parra Studios # Generates a C project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/c/cmake/CProject.cmake.in b/source/scripts/c/cmake/CProject.cmake.in index 7ebe35208..0a81fe64b 100644 --- a/source/scripts/c/cmake/CProject.cmake.in +++ b/source/scripts/c/cmake/CProject.cmake.in @@ -2,7 +2,7 @@ # C project generator by Parra Studios # Generates a C project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/cobol/cmake/CobolProject.cmake b/source/scripts/cobol/cmake/CobolProject.cmake index 0e860b289..509053219 100644 --- a/source/scripts/cobol/cmake/CobolProject.cmake +++ b/source/scripts/cobol/cmake/CobolProject.cmake @@ -2,7 +2,7 @@ # Cobol project generator by Parra Studios # Generates a Cobol project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/cobol/cmake/CobolProject.cmake.in b/source/scripts/cobol/cmake/CobolProject.cmake.in index 5392b9d53..a982974ee 100644 --- a/source/scripts/cobol/cmake/CobolProject.cmake.in +++ b/source/scripts/cobol/cmake/CobolProject.cmake.in @@ -2,7 +2,7 @@ # Cobol project generator by Parra Studios # Generates a Cobol project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/csharp/cmake/CSharpProject.cmake b/source/scripts/csharp/cmake/CSharpProject.cmake index add3f9a83..9d8d9c708 100644 --- a/source/scripts/csharp/cmake/CSharpProject.cmake +++ b/source/scripts/csharp/cmake/CSharpProject.cmake @@ -2,7 +2,7 @@ # CSharp project generator by Parra Studios # Generates a csharp project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/csharp/cmake/CSharpProject.cmake.in b/source/scripts/csharp/cmake/CSharpProject.cmake.in index d405caf5d..63cd335d8 100644 --- a/source/scripts/csharp/cmake/CSharpProject.cmake.in +++ b/source/scripts/csharp/cmake/CSharpProject.cmake.in @@ -2,7 +2,7 @@ # CSharp project generator by Parra Studios # Generates a csharp project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/csharp/cmake/CSharpProject.json.in b/source/scripts/csharp/cmake/CSharpProject.json.in index 0a0ae67d4..2e0402571 100644 --- a/source/scripts/csharp/cmake/CSharpProject.json.in +++ b/source/scripts/csharp/cmake/CSharpProject.json.in @@ -3,7 +3,7 @@ # CSharp project generator by Parra Studios # Generates a csharp project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/extension/sum/include/sum_extension/sum_extension.h b/source/scripts/extension/sum/include/sum_extension/sum_extension.h index 386bd4d76..f3f966fc7 100644 --- a/source/scripts/extension/sum/include/sum_extension/sum_extension.h +++ b/source/scripts/extension/sum/include/sum_extension/sum_extension.h @@ -2,7 +2,7 @@ * Extension Library by Parra Studios * An extension for sum numbers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/scripts/extension/sum/source/sum_extension.cpp b/source/scripts/extension/sum/source/sum_extension.cpp index e4856306d..1c707b93d 100644 --- a/source/scripts/extension/sum/source/sum_extension.cpp +++ b/source/scripts/extension/sum/source/sum_extension.cpp @@ -2,7 +2,7 @@ * Extension Library by Parra Studios * An extension for sum numbers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/scripts/file/cmake/FileProject.cmake b/source/scripts/file/cmake/FileProject.cmake index 3ee6aedaa..e8a3e1356 100644 --- a/source/scripts/file/cmake/FileProject.cmake +++ b/source/scripts/file/cmake/FileProject.cmake @@ -2,7 +2,7 @@ # File project generator by Parra Studios # Generates a file project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/file/cmake/FileProject.cmake.in b/source/scripts/file/cmake/FileProject.cmake.in index 7a4129442..ff059ec85 100644 --- a/source/scripts/file/cmake/FileProject.cmake.in +++ b/source/scripts/file/cmake/FileProject.cmake.in @@ -2,7 +2,7 @@ # File project generator by Parra Studios # Generates a file project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/java/cmake/JavaJarProject.cmake.in b/source/scripts/java/cmake/JavaJarProject.cmake.in index 03bad21cd..d6c0d8747 100644 --- a/source/scripts/java/cmake/JavaJarProject.cmake.in +++ b/source/scripts/java/cmake/JavaJarProject.cmake.in @@ -2,7 +2,7 @@ # Java project generator by Parra Studios # Generates a java project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/java/cmake/JavaProject.cmake b/source/scripts/java/cmake/JavaProject.cmake index 46e4b0c30..51874c909 100644 --- a/source/scripts/java/cmake/JavaProject.cmake +++ b/source/scripts/java/cmake/JavaProject.cmake @@ -2,7 +2,7 @@ # Java project generator by Parra Studios # Generates a java project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/java/cmake/JavaProject.cmake.in b/source/scripts/java/cmake/JavaProject.cmake.in index 5d2472b85..0b74b6bdf 100644 --- a/source/scripts/java/cmake/JavaProject.cmake.in +++ b/source/scripts/java/cmake/JavaProject.cmake.in @@ -2,7 +2,7 @@ # Java project generator by Parra Studios # Generates a java project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/javascript/cmake/JavaScriptProject.cmake b/source/scripts/javascript/cmake/JavaScriptProject.cmake index f7dd907d3..d5762770b 100644 --- a/source/scripts/javascript/cmake/JavaScriptProject.cmake +++ b/source/scripts/javascript/cmake/JavaScriptProject.cmake @@ -2,7 +2,7 @@ # JavaScript project generator by Parra Studios # Generates a javascript project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/javascript/cmake/JavaScriptProject.cmake.in b/source/scripts/javascript/cmake/JavaScriptProject.cmake.in index d0da4daae..91375592f 100644 --- a/source/scripts/javascript/cmake/JavaScriptProject.cmake.in +++ b/source/scripts/javascript/cmake/JavaScriptProject.cmake.in @@ -2,7 +2,7 @@ # JavaScript project generator by Parra Studios # Generates a javascript project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/javascript/cmake/JavaScriptProject.json.in b/source/scripts/javascript/cmake/JavaScriptProject.json.in index ea997c6ec..82ff04239 100644 --- a/source/scripts/javascript/cmake/JavaScriptProject.json.in +++ b/source/scripts/javascript/cmake/JavaScriptProject.json.in @@ -3,7 +3,7 @@ # JavaScript project generator by Parra Studios # Generates a javascript project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/julia/cmake/JuliaProject.cmake b/source/scripts/julia/cmake/JuliaProject.cmake index 770e8cfc3..3e5f2af41 100644 --- a/source/scripts/julia/cmake/JuliaProject.cmake +++ b/source/scripts/julia/cmake/JuliaProject.cmake @@ -2,7 +2,7 @@ # Julia project generator by Parra Studios # Generates a Julia project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/julia/cmake/JuliaProject.cmake.in b/source/scripts/julia/cmake/JuliaProject.cmake.in index 95aa5c339..b4f049b2e 100644 --- a/source/scripts/julia/cmake/JuliaProject.cmake.in +++ b/source/scripts/julia/cmake/JuliaProject.cmake.in @@ -2,7 +2,7 @@ # Julia project generator by Parra Studios # Generates a Julia project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/llvm/cmake/LLVMProject.cmake b/source/scripts/llvm/cmake/LLVMProject.cmake index 7f2a70d33..173360dfc 100644 --- a/source/scripts/llvm/cmake/LLVMProject.cmake +++ b/source/scripts/llvm/cmake/LLVMProject.cmake @@ -2,7 +2,7 @@ # LLVM project generator by Parra Studios # Generates a LLVM project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/llvm/cmake/LLVMProject.cmake.in b/source/scripts/llvm/cmake/LLVMProject.cmake.in index 9a6ad7770..bc379d3b0 100644 --- a/source/scripts/llvm/cmake/LLVMProject.cmake.in +++ b/source/scripts/llvm/cmake/LLVMProject.cmake.in @@ -2,7 +2,7 @@ # LLVM project generator by Parra Studios # Generates a LLVM project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/lua/cmake/LuaProject.cmake b/source/scripts/lua/cmake/LuaProject.cmake index da4ee1247..46c8b8103 100644 --- a/source/scripts/lua/cmake/LuaProject.cmake +++ b/source/scripts/lua/cmake/LuaProject.cmake @@ -2,7 +2,7 @@ # Lua project generator by Parra Studios # Generates a lua project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/lua/cmake/LuaProject.cmake.in b/source/scripts/lua/cmake/LuaProject.cmake.in index 8bc5b2eec..bc094e00f 100644 --- a/source/scripts/lua/cmake/LuaProject.cmake.in +++ b/source/scripts/lua/cmake/LuaProject.cmake.in @@ -2,7 +2,7 @@ # Lua project generator by Parra Studios # Generates a Lua project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/node/cmake/NodeJSProject.cmake b/source/scripts/node/cmake/NodeJSProject.cmake index 60a093c88..32dc8e45f 100644 --- a/source/scripts/node/cmake/NodeJSProject.cmake +++ b/source/scripts/node/cmake/NodeJSProject.cmake @@ -2,7 +2,7 @@ # NodeJS project generator by Parra Studios # Generates a nodejs project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/node/cmake/NodeJSProject.cmake.in b/source/scripts/node/cmake/NodeJSProject.cmake.in index f9c3d86a6..da69b7730 100644 --- a/source/scripts/node/cmake/NodeJSProject.cmake.in +++ b/source/scripts/node/cmake/NodeJSProject.cmake.in @@ -2,7 +2,7 @@ # NodeJS project generator by Parra Studios # Generates a NodeJS project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/node/cmake/NodeJSProject.json.in b/source/scripts/node/cmake/NodeJSProject.json.in index 980b150d3..80006864d 100644 --- a/source/scripts/node/cmake/NodeJSProject.json.in +++ b/source/scripts/node/cmake/NodeJSProject.json.in @@ -3,7 +3,7 @@ # NodeJS project generator by Parra Studios # Generates a nodejs project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/python/cmake/PythonProject.cmake b/source/scripts/python/cmake/PythonProject.cmake index ae14b9f78..7e3813368 100644 --- a/source/scripts/python/cmake/PythonProject.cmake +++ b/source/scripts/python/cmake/PythonProject.cmake @@ -2,7 +2,7 @@ # Python project generator by Parra Studios # Generates a python project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/python/cmake/PythonProject.cmake.in b/source/scripts/python/cmake/PythonProject.cmake.in index b423832f8..97fba6ced 100644 --- a/source/scripts/python/cmake/PythonProject.cmake.in +++ b/source/scripts/python/cmake/PythonProject.cmake.in @@ -2,7 +2,7 @@ # Python project generator by Parra Studios # Generates a python project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/python/cmake/PythonProject.py.in b/source/scripts/python/cmake/PythonProject.py.in index cba8a94de..521db16ce 100644 --- a/source/scripts/python/cmake/PythonProject.py.in +++ b/source/scripts/python/cmake/PythonProject.py.in @@ -4,7 +4,7 @@ # Python project generator by Parra Studios # Generates a python project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/python/rsasample/source/rsasample.py b/source/scripts/python/rsasample/source/rsasample.py index b1aa868c7..fb9ccbfc0 100644 --- a/source/scripts/python/rsasample/source/rsasample.py +++ b/source/scripts/python/rsasample/source/rsasample.py @@ -4,7 +4,7 @@ # RSA String Encriptation Decriptation Sample by Parra Studios # Python RSA encriptation decriptation sample. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/python/rsasample/source/sample/rsa_strings.py b/source/scripts/python/rsasample/source/sample/rsa_strings.py index 80591575d..b4ccfcb36 100644 --- a/source/scripts/python/rsasample/source/sample/rsa_strings.py +++ b/source/scripts/python/rsasample/source/sample/rsa_strings.py @@ -4,7 +4,7 @@ # RSA String Encriptation Decriptation Sample by Parra Studios # Python RSA encriptation decriptation sample. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/rpc/cmake/RPCProject.cmake b/source/scripts/rpc/cmake/RPCProject.cmake index 38f4bac0c..a1a89df77 100644 --- a/source/scripts/rpc/cmake/RPCProject.cmake +++ b/source/scripts/rpc/cmake/RPCProject.cmake @@ -2,7 +2,7 @@ # RPC project generator by Parra Studios # Generates a rpc project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/rpc/cmake/RPCProject.cmake.in b/source/scripts/rpc/cmake/RPCProject.cmake.in index 0a5b9e215..4eb4d931e 100644 --- a/source/scripts/rpc/cmake/RPCProject.cmake.in +++ b/source/scripts/rpc/cmake/RPCProject.cmake.in @@ -2,7 +2,7 @@ # RPC project generator by Parra Studios # Generates a RPC project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/ruby/cmake/RubyProject.cmake b/source/scripts/ruby/cmake/RubyProject.cmake index bfa73a1f4..12f50be55 100644 --- a/source/scripts/ruby/cmake/RubyProject.cmake +++ b/source/scripts/ruby/cmake/RubyProject.cmake @@ -2,7 +2,7 @@ # Ruby project generator by Parra Studios # Generates a ruby project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/ruby/cmake/RubyProject.cmake.in b/source/scripts/ruby/cmake/RubyProject.cmake.in index 7c81d8203..2bf28ee0a 100644 --- a/source/scripts/ruby/cmake/RubyProject.cmake.in +++ b/source/scripts/ruby/cmake/RubyProject.cmake.in @@ -2,7 +2,7 @@ # Ruby project generator by Parra Studios # Generates a ruby project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/ruby/cmake/RubyProject.rb.in b/source/scripts/ruby/cmake/RubyProject.rb.in index 66fe0cf54..0e8ae4100 100644 --- a/source/scripts/ruby/cmake/RubyProject.rb.in +++ b/source/scripts/ruby/cmake/RubyProject.rb.in @@ -4,7 +4,7 @@ # Ruby project generator by Parra Studios # Generates a ruby project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/rust/cmake/RustProject.cmake b/source/scripts/rust/cmake/RustProject.cmake index 5694e29e5..762f8dd09 100644 --- a/source/scripts/rust/cmake/RustProject.cmake +++ b/source/scripts/rust/cmake/RustProject.cmake @@ -2,7 +2,7 @@ # Rust project generator by Parra Studios # Generates a Rust project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/rust/cmake/RustProject.cmake.in b/source/scripts/rust/cmake/RustProject.cmake.in index c1a52cef5..c61e9f3d7 100644 --- a/source/scripts/rust/cmake/RustProject.cmake.in +++ b/source/scripts/rust/cmake/RustProject.cmake.in @@ -2,7 +2,7 @@ # WebAssembly project generator by Parra Studios # Generates a WebAssembly project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/typescript/cmake/TypeScriptProject.cmake b/source/scripts/typescript/cmake/TypeScriptProject.cmake index 7d25517ba..525b083d0 100644 --- a/source/scripts/typescript/cmake/TypeScriptProject.cmake +++ b/source/scripts/typescript/cmake/TypeScriptProject.cmake @@ -2,7 +2,7 @@ # TypeScript project generator by Parra Studios # Generates a typescript project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/typescript/cmake/TypeScriptProject.cmake.in b/source/scripts/typescript/cmake/TypeScriptProject.cmake.in index b07786e8c..55efff893 100644 --- a/source/scripts/typescript/cmake/TypeScriptProject.cmake.in +++ b/source/scripts/typescript/cmake/TypeScriptProject.cmake.in @@ -2,7 +2,7 @@ # TypeScript project generator by Parra Studios # Generates a typescript project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/typescript/cmake/TypeScriptProject.json.in b/source/scripts/typescript/cmake/TypeScriptProject.json.in index f609c81ec..e709dbb6d 100644 --- a/source/scripts/typescript/cmake/TypeScriptProject.json.in +++ b/source/scripts/typescript/cmake/TypeScriptProject.json.in @@ -3,7 +3,7 @@ # TypeScript project generator by Parra Studios # Generates a typescript project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/wasm/cmake/WasmProject.cmake b/source/scripts/wasm/cmake/WasmProject.cmake index 776675b04..aa326a740 100644 --- a/source/scripts/wasm/cmake/WasmProject.cmake +++ b/source/scripts/wasm/cmake/WasmProject.cmake @@ -2,7 +2,7 @@ # WebAssembly project generator by Parra Studios # Generates a WebAssembly project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/scripts/wasm/cmake/WasmProject.cmake.in b/source/scripts/wasm/cmake/WasmProject.cmake.in index b3a3c0265..630c875be 100644 --- a/source/scripts/wasm/cmake/WasmProject.cmake.in +++ b/source/scripts/wasm/cmake/WasmProject.cmake.in @@ -2,7 +2,7 @@ # WebAssembly project generator by Parra Studios # Generates a WebAssembly project embedded into CMake. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/source/serial/include/serial/serial.h b/source/serial/include/serial/serial.h index 720640c4c..f10f9ea76 100644 --- a/source/serial/include/serial/serial.h +++ b/source/serial/include/serial/serial.h @@ -1,6 +1,6 @@ /* * Serial Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple serialization and deserialization formats. * diff --git a/source/serial/include/serial/serial_handle.h b/source/serial/include/serial/serial_handle.h index fa4bdc66f..9c049fcbc 100644 --- a/source/serial/include/serial/serial_handle.h +++ b/source/serial/include/serial/serial_handle.h @@ -2,7 +2,7 @@ * Serial Library by Parra Studios * A cross-platform library for managing multiple serialization and deserialization formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/serial/include/serial/serial_interface.h b/source/serial/include/serial/serial_interface.h index e06b55a16..f83a0af8e 100644 --- a/source/serial/include/serial/serial_interface.h +++ b/source/serial/include/serial/serial_interface.h @@ -1,6 +1,6 @@ /* * Serial Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple serialization and deserialization formats. * diff --git a/source/serial/source/serial.c b/source/serial/source/serial.c index 74bbb0186..7a7e71fab 100644 --- a/source/serial/source/serial.c +++ b/source/serial/source/serial.c @@ -1,6 +1,6 @@ /* * Serial Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple serialization and deserialization formats. * @@ -144,7 +144,7 @@ const char *serial_print_info(void) { static const char serial_info[] = "Serial Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef SERIAL_STATIC_DEFINE "Compiled as static library type" diff --git a/source/serials/metacall_serial/include/metacall_serial/metacall_serial.h b/source/serials/metacall_serial/include/metacall_serial/metacall_serial.h index fb80de34c..d6aece4e7 100644 --- a/source/serials/metacall_serial/include/metacall_serial/metacall_serial.h +++ b/source/serials/metacall_serial/include/metacall_serial/metacall_serial.h @@ -2,7 +2,7 @@ * Serial Library by Parra Studios * A cross-platform library for managing multiple serialization and deserialization formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl.h b/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl.h index 541fe4bd6..8dd25ce64 100644 --- a/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl.h +++ b/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl.h @@ -1,6 +1,6 @@ /* * Serial Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple serialization and deserialization formats. * diff --git a/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl_deserialize.h b/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl_deserialize.h index 6f3d0a3f0..f6324b441 100644 --- a/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl_deserialize.h +++ b/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl_deserialize.h @@ -2,7 +2,7 @@ * Serial Library by Parra Studios * A cross-platform library for managing multiple serialization and deserialization formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl_serialize.h b/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl_serialize.h index dbe14b590..21c0eb060 100644 --- a/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl_serialize.h +++ b/source/serials/metacall_serial/include/metacall_serial/metacall_serial_impl_serialize.h @@ -2,7 +2,7 @@ * Serial Library by Parra Studios * A cross-platform library for managing multiple serialization and deserialization formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/serials/metacall_serial/source/metacall_serial.c b/source/serials/metacall_serial/source/metacall_serial.c index 2bf699644..70b16af39 100644 --- a/source/serials/metacall_serial/source/metacall_serial.c +++ b/source/serials/metacall_serial/source/metacall_serial.c @@ -1,6 +1,6 @@ /* * Serial Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple serialization and deserialization formats. * @@ -32,7 +32,7 @@ const char *metacall_serial_print_info(void) { static const char metacall_serial_info[] = "MetaCall Native Format Serial Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef METACALL_SERIAL_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/serials/metacall_serial/source/metacall_serial_impl.c b/source/serials/metacall_serial/source/metacall_serial_impl.c index 1c69c47c6..8e48d1e7d 100644 --- a/source/serials/metacall_serial/source/metacall_serial_impl.c +++ b/source/serials/metacall_serial/source/metacall_serial_impl.c @@ -1,6 +1,6 @@ /* * Serial Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple serialization and deserialization formats. * diff --git a/source/serials/metacall_serial/source/metacall_serial_impl_deserialize.c b/source/serials/metacall_serial/source/metacall_serial_impl_deserialize.c index 2487545d7..3f415ade3 100644 --- a/source/serials/metacall_serial/source/metacall_serial_impl_deserialize.c +++ b/source/serials/metacall_serial/source/metacall_serial_impl_deserialize.c @@ -2,7 +2,7 @@ * Serial Library by Parra Studios * A cross-platform library for managing multiple serialization and deserialization formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/serials/metacall_serial/source/metacall_serial_impl_serialize.c b/source/serials/metacall_serial/source/metacall_serial_impl_serialize.c index 93852bbe6..e618f935e 100644 --- a/source/serials/metacall_serial/source/metacall_serial_impl_serialize.c +++ b/source/serials/metacall_serial/source/metacall_serial_impl_serialize.c @@ -2,7 +2,7 @@ * Serial Library by Parra Studios * A cross-platform library for managing multiple serialization and deserialization formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial.h b/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial.h index 106acb20e..12bfd5343 100644 --- a/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial.h +++ b/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial.h @@ -2,7 +2,7 @@ * Serial Library by Parra Studios * A cross-platform library for managing multiple serialization and deserialization formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial_impl.h b/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial_impl.h index 936bcd34d..7d7fda83e 100644 --- a/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial_impl.h +++ b/source/serials/rapid_json_serial/include/rapid_json_serial/rapid_json_serial_impl.h @@ -2,7 +2,7 @@ * Serial Library by Parra Studios * A cross-platform library for managing multiple serialization and deserialization formats. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/serials/rapid_json_serial/source/rapid_json_serial.c b/source/serials/rapid_json_serial/source/rapid_json_serial.c index 12760dca9..e7671b55a 100644 --- a/source/serials/rapid_json_serial/source/rapid_json_serial.c +++ b/source/serials/rapid_json_serial/source/rapid_json_serial.c @@ -1,6 +1,6 @@ /* * Serial Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple serialization and deserialization formats. * @@ -32,7 +32,7 @@ const char *rapid_json_serial_print_info(void) { static const char rapid_json_serial_info[] = "Rapid JSON Serial Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef RAPID_JSON_SERIAL_STATIC_DEFINE "Compiled as static library type\n" diff --git a/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp b/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp index a196b672a..973c06da3 100644 --- a/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp +++ b/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp @@ -1,6 +1,6 @@ /* * Serial Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A cross-platform library for managing multiple serialization and deserialization formats. * diff --git a/source/tests/adt_map_test/source/adt_map_test.cpp b/source/tests/adt_map_test/source/adt_map_test.cpp index 72124f34d..9fb876427 100644 --- a/source/tests/adt_map_test/source/adt_map_test.cpp +++ b/source/tests/adt_map_test/source/adt_map_test.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/adt_map_test/source/main.cpp b/source/tests/adt_map_test/source/main.cpp index 1888b3214..24fae6af6 100644 --- a/source/tests/adt_map_test/source/main.cpp +++ b/source/tests/adt_map_test/source/main.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/adt_set_test/source/adt_set_test.cpp b/source/tests/adt_set_test/source/adt_set_test.cpp index 98edb9c55..b148b7a2e 100644 --- a/source/tests/adt_set_test/source/adt_set_test.cpp +++ b/source/tests/adt_set_test/source/adt_set_test.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/adt_set_test/source/main.cpp b/source/tests/adt_set_test/source/main.cpp index 1888b3214..24fae6af6 100644 --- a/source/tests/adt_set_test/source/main.cpp +++ b/source/tests/adt_set_test/source/main.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/adt_trie_test/source/adt_trie_test.cpp b/source/tests/adt_trie_test/source/adt_trie_test.cpp index 86eb08760..cb1edbf28 100644 --- a/source/tests/adt_trie_test/source/adt_trie_test.cpp +++ b/source/tests/adt_trie_test/source/adt_trie_test.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/adt_trie_test/source/main.cpp b/source/tests/adt_trie_test/source/main.cpp index 1888b3214..24fae6af6 100644 --- a/source/tests/adt_trie_test/source/main.cpp +++ b/source/tests/adt_trie_test/source/main.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/adt_vector_test/source/adt_vector_test.cpp b/source/tests/adt_vector_test/source/adt_vector_test.cpp index a33447137..816c3bcf5 100644 --- a/source/tests/adt_vector_test/source/adt_vector_test.cpp +++ b/source/tests/adt_vector_test/source/adt_vector_test.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/adt_vector_test/source/main.cpp b/source/tests/adt_vector_test/source/main.cpp index 1888b3214..24fae6af6 100644 --- a/source/tests/adt_vector_test/source/main.cpp +++ b/source/tests/adt_vector_test/source/main.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/configuration_test/source/configuration_test.cpp b/source/tests/configuration_test/source/configuration_test.cpp index 657f8dff2..056d99493 100644 --- a/source/tests/configuration_test/source/configuration_test.cpp +++ b/source/tests/configuration_test/source/configuration_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/configuration_test/source/main.cpp b/source/tests/configuration_test/source/main.cpp index 4e6c7d262..4b3063b2f 100644 --- a/source/tests/configuration_test/source/main.cpp +++ b/source/tests/configuration_test/source/main.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/detour_test/source/detour_test.cpp b/source/tests/detour_test/source/detour_test.cpp index 3595eda99..6b84295fd 100644 --- a/source/tests/detour_test/source/detour_test.cpp +++ b/source/tests/detour_test/source/detour_test.cpp @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/detour_test/source/main.cpp b/source/tests/detour_test/source/main.cpp index d678d80ae..ccd0ee35a 100644 --- a/source/tests/detour_test/source/main.cpp +++ b/source/tests/detour_test/source/main.cpp @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index 3d69b74a2..ed6aec997 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/dynlink_test/source/main.cpp b/source/tests/dynlink_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/dynlink_test/source/main.cpp +++ b/source/tests/dynlink_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/environment_test/source/environment_test.cpp b/source/tests/environment_test/source/environment_test.cpp index 4b484a242..dee634141 100644 --- a/source/tests/environment_test/source/environment_test.cpp +++ b/source/tests/environment_test/source/environment_test.cpp @@ -2,7 +2,7 @@ * Format Library by Parra Studios * A cross-platform library for supporting platform specific environment features. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/environment_test/source/main.cpp b/source/tests/environment_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/environment_test/source/main.cpp +++ b/source/tests/environment_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/log_custom_test/source/log_custom_test.cpp b/source/tests/log_custom_test/source/log_custom_test.cpp index 98af5d1b0..51754be99 100644 --- a/source/tests/log_custom_test/source/log_custom_test.cpp +++ b/source/tests/log_custom_test/source/log_custom_test.cpp @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/log_custom_test/source/main.cpp b/source/tests/log_custom_test/source/main.cpp index d678d80ae..ccd0ee35a 100644 --- a/source/tests/log_custom_test/source/main.cpp +++ b/source/tests/log_custom_test/source/main.cpp @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/log_test/source/log_test.cpp b/source/tests/log_test/source/log_test.cpp index 8f2939f74..2a1505e71 100644 --- a/source/tests/log_test/source/log_test.cpp +++ b/source/tests/log_test/source/log_test.cpp @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/log_test/source/main.cpp b/source/tests/log_test/source/main.cpp index d678d80ae..ccd0ee35a 100644 --- a/source/tests/log_test/source/main.cpp +++ b/source/tests/log_test/source/main.cpp @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_backtrace_plugin_test/source/main.cpp b/source/tests/metacall_backtrace_plugin_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_backtrace_plugin_test/source/main.cpp +++ b/source/tests/metacall_backtrace_plugin_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_backtrace_plugin_test/source/metacall_backtrace_plugin_test.cpp b/source/tests/metacall_backtrace_plugin_test/source/metacall_backtrace_plugin_test.cpp index 6f70caf08..ff2844f7a 100644 --- a/source/tests/metacall_backtrace_plugin_test/source/metacall_backtrace_plugin_test.cpp +++ b/source/tests/metacall_backtrace_plugin_test/source/metacall_backtrace_plugin_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_c_lib_test/source/main.cpp b/source/tests/metacall_c_lib_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_c_lib_test/source/main.cpp +++ b/source/tests/metacall_c_lib_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp index 83aa1a8de..cabe0100b 100644 --- a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp +++ b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_c_test/source/main.cpp b/source/tests/metacall_c_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_c_test/source/main.cpp +++ b/source/tests/metacall_c_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_c_test/source/metacall_c_test.cpp b/source/tests/metacall_c_test/source/metacall_c_test.cpp index dc4cc606b..46cce764e 100644 --- a/source/tests/metacall_c_test/source/metacall_c_test.cpp +++ b/source/tests/metacall_c_test/source/metacall_c_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_callback_complex_test/source/main.cpp b/source/tests/metacall_callback_complex_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_callback_complex_test/source/main.cpp +++ b/source/tests/metacall_callback_complex_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_callback_complex_test/source/metacall_callback_complex_test.cpp b/source/tests/metacall_callback_complex_test/source/metacall_callback_complex_test.cpp index daf5717e5..9906b0824 100644 --- a/source/tests/metacall_callback_complex_test/source/metacall_callback_complex_test.cpp +++ b/source/tests/metacall_callback_complex_test/source/metacall_callback_complex_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cast_test/source/main.cpp b/source/tests/metacall_cast_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_cast_test/source/main.cpp +++ b/source/tests/metacall_cast_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cast_test/source/metacall_cast_test.cpp b/source/tests/metacall_cast_test/source/metacall_cast_test.cpp index c22c55cc7..9b73a35de 100644 --- a/source/tests/metacall_cast_test/source/metacall_cast_test.cpp +++ b/source/tests/metacall_cast_test/source/metacall_cast_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_clear_test/source/main.cpp b/source/tests/metacall_clear_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_clear_test/source/main.cpp +++ b/source/tests/metacall_clear_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_clear_test/source/metacall_clear_test.cpp b/source/tests/metacall_clear_test/source/metacall_clear_test.cpp index 0a59ea23a..f6dbc7fcb 100644 --- a/source/tests/metacall_clear_test/source/metacall_clear_test.cpp +++ b/source/tests/metacall_clear_test/source/metacall_clear_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cli_core_plugin_await_test/source/main.cpp b/source/tests/metacall_cli_core_plugin_await_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_cli_core_plugin_await_test/source/main.cpp +++ b/source/tests/metacall_cli_core_plugin_await_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cli_core_plugin_await_test/source/metacall_cli_core_plugin_await_test.cpp b/source/tests/metacall_cli_core_plugin_await_test/source/metacall_cli_core_plugin_await_test.cpp index 49a813bc5..04461e788 100644 --- a/source/tests/metacall_cli_core_plugin_await_test/source/metacall_cli_core_plugin_await_test.cpp +++ b/source/tests/metacall_cli_core_plugin_await_test/source/metacall_cli_core_plugin_await_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cli_core_plugin_test/source/main.cpp b/source/tests/metacall_cli_core_plugin_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_cli_core_plugin_test/source/main.cpp +++ b/source/tests/metacall_cli_core_plugin_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cli_core_plugin_test/source/metacall_cli_core_plugin_test.cpp b/source/tests/metacall_cli_core_plugin_test/source/metacall_cli_core_plugin_test.cpp index e86f93051..7b116647c 100644 --- a/source/tests/metacall_cli_core_plugin_test/source/metacall_cli_core_plugin_test.cpp +++ b/source/tests/metacall_cli_core_plugin_test/source/metacall_cli_core_plugin_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cobol_test/source/main.cpp b/source/tests/metacall_cobol_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_cobol_test/source/main.cpp +++ b/source/tests/metacall_cobol_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cobol_test/source/metacall_cobol_test.cpp b/source/tests/metacall_cobol_test/source/metacall_cobol_test.cpp index d6aae1a2c..5f74c003c 100644 --- a/source/tests/metacall_cobol_test/source/metacall_cobol_test.cpp +++ b/source/tests/metacall_cobol_test/source/metacall_cobol_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_configuration_default_test/source/main.cpp b/source/tests/metacall_configuration_default_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_configuration_default_test/source/main.cpp +++ b/source/tests/metacall_configuration_default_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_configuration_default_test/source/metacall_configuration_default_test.cpp b/source/tests/metacall_configuration_default_test/source/metacall_configuration_default_test.cpp index e852b0f58..5cee9a0e7 100644 --- a/source/tests/metacall_configuration_default_test/source/metacall_configuration_default_test.cpp +++ b/source/tests/metacall_configuration_default_test/source/metacall_configuration_default_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_configuration_exec_path_test/source/main.cpp b/source/tests/metacall_configuration_exec_path_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_configuration_exec_path_test/source/main.cpp +++ b/source/tests/metacall_configuration_exec_path_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp b/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp index 92fa6eac5..7458311c0 100644 --- a/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp +++ b/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cs_test/include/metacall-cs-test/environment.hpp b/source/tests/metacall_cs_test/include/metacall-cs-test/environment.hpp index 0cac3e1fa..b2efb0121 100644 --- a/source/tests/metacall_cs_test/include/metacall-cs-test/environment.hpp +++ b/source/tests/metacall_cs_test/include/metacall-cs-test/environment.hpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cs_test/source/environment.cpp b/source/tests/metacall_cs_test/source/environment.cpp index 1affa4ae7..acd33b3c5 100644 --- a/source/tests/metacall_cs_test/source/environment.cpp +++ b/source/tests/metacall_cs_test/source/environment.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cs_test/source/main.cpp b/source/tests/metacall_cs_test/source/main.cpp index 86fc12374..41f8024b4 100644 --- a/source/tests/metacall_cs_test/source/main.cpp +++ b/source/tests/metacall_cs_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_cs_test/source/metacall_cs_test.cpp b/source/tests/metacall_cs_test/source/metacall_cs_test.cpp index 5e87a637c..769382b15 100644 --- a/source/tests/metacall_cs_test/source/metacall_cs_test.cpp +++ b/source/tests/metacall_cs_test/source/metacall_cs_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_csharp_function_test/source/main.cpp b/source/tests/metacall_csharp_function_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_csharp_function_test/source/main.cpp +++ b/source/tests/metacall_csharp_function_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_csharp_function_test/source/metacall_csharp_function_test.cpp b/source/tests/metacall_csharp_function_test/source/metacall_csharp_function_test.cpp index 799a1dc18..541ff5476 100644 --- a/source/tests/metacall_csharp_function_test/source/metacall_csharp_function_test.cpp +++ b/source/tests/metacall_csharp_function_test/source/metacall_csharp_function_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_csharp_static_class_test/source/main.cpp b/source/tests/metacall_csharp_static_class_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_csharp_static_class_test/source/main.cpp +++ b/source/tests/metacall_csharp_static_class_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_csharp_static_class_test/source/metacall_csharp_static_class_test.cpp b/source/tests/metacall_csharp_static_class_test/source/metacall_csharp_static_class_test.cpp index 653616db1..bfaf4f744 100644 --- a/source/tests/metacall_csharp_static_class_test/source/metacall_csharp_static_class_test.cpp +++ b/source/tests/metacall_csharp_static_class_test/source/metacall_csharp_static_class_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_depends_test/source/main.cpp b/source/tests/metacall_depends_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_depends_test/source/main.cpp +++ b/source/tests/metacall_depends_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_depends_test/source/metacall_depends_test.cpp b/source/tests/metacall_depends_test/source/metacall_depends_test.cpp index 0f82dd0da..4ec81006c 100644 --- a/source/tests/metacall_depends_test/source/metacall_depends_test.cpp +++ b/source/tests/metacall_depends_test/source/metacall_depends_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_distributable_test/source/main.cpp b/source/tests/metacall_distributable_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_distributable_test/source/main.cpp +++ b/source/tests/metacall_distributable_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp b/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp index 7aaec074b..59138c84e 100644 --- a/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp +++ b/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ducktype_test/source/main.cpp b/source/tests/metacall_ducktype_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_ducktype_test/source/main.cpp +++ b/source/tests/metacall_ducktype_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp b/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp index f912c0465..b9555204a 100644 --- a/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp +++ b/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_duplicated_handle_test/source/main.cpp b/source/tests/metacall_duplicated_handle_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_duplicated_handle_test/source/main.cpp +++ b/source/tests/metacall_duplicated_handle_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_duplicated_handle_test/source/metacall_duplicated_handle_test.cpp b/source/tests/metacall_duplicated_handle_test/source/metacall_duplicated_handle_test.cpp index 72c2a2ad5..ebd9e5732 100644 --- a/source/tests/metacall_duplicated_handle_test/source/metacall_duplicated_handle_test.cpp +++ b/source/tests/metacall_duplicated_handle_test/source/metacall_duplicated_handle_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_duplicated_symbols_test/source/main.cpp b/source/tests/metacall_duplicated_symbols_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_duplicated_symbols_test/source/main.cpp +++ b/source/tests/metacall_duplicated_symbols_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_duplicated_symbols_test/source/metacall_duplicated_symbols_test.cpp b/source/tests/metacall_duplicated_symbols_test/source/metacall_duplicated_symbols_test.cpp index 4306bd1ba..07fb659c9 100644 --- a/source/tests/metacall_duplicated_symbols_test/source/metacall_duplicated_symbols_test.cpp +++ b/source/tests/metacall_duplicated_symbols_test/source/metacall_duplicated_symbols_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_dynlink_path_test/source/main.cpp b/source/tests/metacall_dynlink_path_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_dynlink_path_test/source/main.cpp +++ b/source/tests/metacall_dynlink_path_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_dynlink_path_test/source/metacall_dynlink_path_test.cpp b/source/tests/metacall_dynlink_path_test/source/metacall_dynlink_path_test.cpp index 645b93dad..ac6239501 100644 --- a/source/tests/metacall_dynlink_path_test/source/metacall_dynlink_path_test.cpp +++ b/source/tests/metacall_dynlink_path_test/source/metacall_dynlink_path_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ext_test/source/main.cpp b/source/tests/metacall_ext_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_ext_test/source/main.cpp +++ b/source/tests/metacall_ext_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ext_test/source/metacall_ext_test.cpp b/source/tests/metacall_ext_test/source/metacall_ext_test.cpp index 5894a3278..dde1efd0f 100644 --- a/source/tests/metacall_ext_test/source/metacall_ext_test.cpp +++ b/source/tests/metacall_ext_test/source/metacall_ext_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_file_fail_test/source/main.cpp b/source/tests/metacall_file_fail_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_file_fail_test/source/main.cpp +++ b/source/tests/metacall_file_fail_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_file_fail_test/source/metacall_file_fail_test.cpp b/source/tests/metacall_file_fail_test/source/metacall_file_fail_test.cpp index f5f4a0ba4..426e44002 100644 --- a/source/tests/metacall_file_fail_test/source/metacall_file_fail_test.cpp +++ b/source/tests/metacall_file_fail_test/source/metacall_file_fail_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_file_glob_test/source/main.cpp b/source/tests/metacall_file_glob_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_file_glob_test/source/main.cpp +++ b/source/tests/metacall_file_glob_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_file_glob_test/source/metacall_file_glob_test.cpp b/source/tests/metacall_file_glob_test/source/metacall_file_glob_test.cpp index a5f3a2d2a..85377d72d 100644 --- a/source/tests/metacall_file_glob_test/source/metacall_file_glob_test.cpp +++ b/source/tests/metacall_file_glob_test/source/metacall_file_glob_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_file_test/source/main.cpp b/source/tests/metacall_file_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_file_test/source/main.cpp +++ b/source/tests/metacall_file_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_file_test/source/metacall_file_test.cpp b/source/tests/metacall_file_test/source/metacall_file_test.cpp index aa635963c..15658125f 100644 --- a/source/tests/metacall_file_test/source/metacall_file_test.cpp +++ b/source/tests/metacall_file_test/source/metacall_file_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_fork_test/source/main.cpp b/source/tests/metacall_fork_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_fork_test/source/main.cpp +++ b/source/tests/metacall_fork_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_fork_test/source/metacall_fork_test.cpp b/source/tests/metacall_fork_test/source/metacall_fork_test.cpp index c4f18db15..2b288b12f 100644 --- a/source/tests/metacall_fork_test/source/metacall_fork_test.cpp +++ b/source/tests/metacall_fork_test/source/metacall_fork_test.cpp @@ -1,6 +1,6 @@ /* * MetaCall Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A library for providing a foreign function interface calls. * diff --git a/source/tests/metacall_function_test/source/main.cpp b/source/tests/metacall_function_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_function_test/source/main.cpp +++ b/source/tests/metacall_function_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_function_test/source/metacall_function_test.cpp b/source/tests/metacall_function_test/source/metacall_function_test.cpp index 2d015ea7f..950bf6b1a 100644 --- a/source/tests/metacall_function_test/source/metacall_function_test.cpp +++ b/source/tests/metacall_function_test/source/metacall_function_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_handle_export_test/source/main.cpp b/source/tests/metacall_handle_export_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_handle_export_test/source/main.cpp +++ b/source/tests/metacall_handle_export_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_handle_export_test/source/metacall_handle_export_test.cpp b/source/tests/metacall_handle_export_test/source/metacall_handle_export_test.cpp index 5c19f588a..3d1afe184 100644 --- a/source/tests/metacall_handle_export_test/source/metacall_handle_export_test.cpp +++ b/source/tests/metacall_handle_export_test/source/metacall_handle_export_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_handle_get_test/source/main.cpp b/source/tests/metacall_handle_get_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_handle_get_test/source/main.cpp +++ b/source/tests/metacall_handle_get_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp b/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp index fb9202aba..fff68579b 100644 --- a/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp +++ b/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_init_fini_test/source/main.cpp b/source/tests/metacall_init_fini_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_init_fini_test/source/main.cpp +++ b/source/tests/metacall_init_fini_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_init_fini_test/source/metacall_init_fini_test.cpp b/source/tests/metacall_init_fini_test/source/metacall_init_fini_test.cpp index eba4e7206..b7c64132b 100644 --- a/source/tests/metacall_init_fini_test/source/metacall_init_fini_test.cpp +++ b/source/tests/metacall_init_fini_test/source/metacall_init_fini_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_initialize_destroy_multiple_node_test/source/main.cpp b/source/tests/metacall_initialize_destroy_multiple_node_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_initialize_destroy_multiple_node_test/source/main.cpp +++ b/source/tests/metacall_initialize_destroy_multiple_node_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_initialize_destroy_multiple_node_test/source/metacall_initialize_destroy_multiple_node_test.cpp b/source/tests/metacall_initialize_destroy_multiple_node_test/source/metacall_initialize_destroy_multiple_node_test.cpp index a38e64885..3435254d1 100644 --- a/source/tests/metacall_initialize_destroy_multiple_node_test/source/metacall_initialize_destroy_multiple_node_test.cpp +++ b/source/tests/metacall_initialize_destroy_multiple_node_test/source/metacall_initialize_destroy_multiple_node_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_initialize_destroy_multiple_test/source/main.cpp b/source/tests/metacall_initialize_destroy_multiple_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_initialize_destroy_multiple_test/source/main.cpp +++ b/source/tests/metacall_initialize_destroy_multiple_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_initialize_destroy_multiple_test/source/metacall_initialize_destroy_multiple_test.cpp b/source/tests/metacall_initialize_destroy_multiple_test/source/metacall_initialize_destroy_multiple_test.cpp index 337923b15..8a57d1352 100644 --- a/source/tests/metacall_initialize_destroy_multiple_test/source/metacall_initialize_destroy_multiple_test.cpp +++ b/source/tests/metacall_initialize_destroy_multiple_test/source/metacall_initialize_destroy_multiple_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_initialize_ex_test/source/main.cpp b/source/tests/metacall_initialize_ex_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_initialize_ex_test/source/main.cpp +++ b/source/tests/metacall_initialize_ex_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_initialize_ex_test/source/metacall_initialize_ex_test.cpp b/source/tests/metacall_initialize_ex_test/source/metacall_initialize_ex_test.cpp index c26f24374..d2d9a2ce0 100644 --- a/source/tests/metacall_initialize_ex_test/source/metacall_initialize_ex_test.cpp +++ b/source/tests/metacall_initialize_ex_test/source/metacall_initialize_ex_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_initialize_test/source/main.cpp b/source/tests/metacall_initialize_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_initialize_test/source/main.cpp +++ b/source/tests/metacall_initialize_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_initialize_test/source/metacall_initialize_test.cpp b/source/tests/metacall_initialize_test/source/metacall_initialize_test.cpp index e1b67c480..598f6f1ea 100644 --- a/source/tests/metacall_initialize_test/source/metacall_initialize_test.cpp +++ b/source/tests/metacall_initialize_test/source/metacall_initialize_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_inspect_test/source/main.cpp b/source/tests/metacall_inspect_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_inspect_test/source/main.cpp +++ b/source/tests/metacall_inspect_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_inspect_test/source/metacall_inspect_test.cpp b/source/tests/metacall_inspect_test/source/metacall_inspect_test.cpp index a759571d7..36e95f5f7 100644 --- a/source/tests/metacall_inspect_test/source/metacall_inspect_test.cpp +++ b/source/tests/metacall_inspect_test/source/metacall_inspect_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_integration_test/include/metacall-integration-test/environment.hpp b/source/tests/metacall_integration_test/include/metacall-integration-test/environment.hpp index 0cac3e1fa..b2efb0121 100644 --- a/source/tests/metacall_integration_test/include/metacall-integration-test/environment.hpp +++ b/source/tests/metacall_integration_test/include/metacall-integration-test/environment.hpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_integration_test/source/environment.cpp b/source/tests/metacall_integration_test/source/environment.cpp index 3c2a0bb9a..810c4af68 100644 --- a/source/tests/metacall_integration_test/source/environment.cpp +++ b/source/tests/metacall_integration_test/source/environment.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_integration_test/source/main.cpp b/source/tests/metacall_integration_test/source/main.cpp index 4f6907151..7205061c4 100644 --- a/source/tests/metacall_integration_test/source/main.cpp +++ b/source/tests/metacall_integration_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_integration_test/source/metacall_integration_test.cpp b/source/tests/metacall_integration_test/source/metacall_integration_test.cpp index 637163e98..629f2b667 100644 --- a/source/tests/metacall_integration_test/source/metacall_integration_test.cpp +++ b/source/tests/metacall_integration_test/source/metacall_integration_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for dynamic loading and linking shared objects at run-time. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_invalid_loader_test/source/main.cpp b/source/tests/metacall_invalid_loader_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_invalid_loader_test/source/main.cpp +++ b/source/tests/metacall_invalid_loader_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_invalid_loader_test/source/metacall_invalid_loader_test.cpp b/source/tests/metacall_invalid_loader_test/source/metacall_invalid_loader_test.cpp index dc472134f..3ae84d146 100644 --- a/source/tests/metacall_invalid_loader_test/source/metacall_invalid_loader_test.cpp +++ b/source/tests/metacall_invalid_loader_test/source/metacall_invalid_loader_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_java_test/source/main.cpp b/source/tests/metacall_java_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_java_test/source/main.cpp +++ b/source/tests/metacall_java_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_java_test/source/metacall_java_test.cpp b/source/tests/metacall_java_test/source/metacall_java_test.cpp index d6a44287c..996ff70ca 100644 --- a/source/tests/metacall_java_test/source/metacall_java_test.cpp +++ b/source/tests/metacall_java_test/source/metacall_java_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_julia_test/source/main.cpp b/source/tests/metacall_julia_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_julia_test/source/main.cpp +++ b/source/tests/metacall_julia_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_julia_test/source/metacall_julia_test.cpp b/source/tests/metacall_julia_test/source/metacall_julia_test.cpp index 384ea1ec5..d85bd9ad0 100644 --- a/source/tests/metacall_julia_test/source/metacall_julia_test.cpp +++ b/source/tests/metacall_julia_test/source/metacall_julia_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_library_path_without_env_vars_test/source/main.cpp b/source/tests/metacall_library_path_without_env_vars_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_library_path_without_env_vars_test/source/main.cpp +++ b/source/tests/metacall_library_path_without_env_vars_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_library_path_without_env_vars_test/source/metacall_library_path_without_env_vars_test.cpp b/source/tests/metacall_library_path_without_env_vars_test/source/metacall_library_path_without_env_vars_test.cpp index dade10d5e..f971670af 100644 --- a/source/tests/metacall_library_path_without_env_vars_test/source/metacall_library_path_without_env_vars_test.cpp +++ b/source/tests/metacall_library_path_without_env_vars_test/source/metacall_library_path_without_env_vars_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_llvm_test/source/main.cpp b/source/tests/metacall_llvm_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_llvm_test/source/main.cpp +++ b/source/tests/metacall_llvm_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp b/source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp index 8d0100c17..fe1e96125 100644 --- a/source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp +++ b/source/tests/metacall_llvm_test/source/metacall_llvm_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_fail_test/source/main.cpp b/source/tests/metacall_load_configuration_fail_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_load_configuration_fail_test/source/main.cpp +++ b/source/tests/metacall_load_configuration_fail_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_fail_test/source/metacall_load_configuration_fail_test.cpp b/source/tests/metacall_load_configuration_fail_test/source/metacall_load_configuration_fail_test.cpp index cdd57d852..0fe69549c 100644 --- a/source/tests/metacall_load_configuration_fail_test/source/metacall_load_configuration_fail_test.cpp +++ b/source/tests/metacall_load_configuration_fail_test/source/metacall_load_configuration_fail_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_node_python_test/source/main.cpp b/source/tests/metacall_load_configuration_node_python_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_load_configuration_node_python_test/source/main.cpp +++ b/source/tests/metacall_load_configuration_node_python_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_node_python_test/source/metacall_load_configuration_node_python_test.cpp b/source/tests/metacall_load_configuration_node_python_test/source/metacall_load_configuration_node_python_test.cpp index b9665efec..09d50c593 100644 --- a/source/tests/metacall_load_configuration_node_python_test/source/metacall_load_configuration_node_python_test.cpp +++ b/source/tests/metacall_load_configuration_node_python_test/source/metacall_load_configuration_node_python_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_python_node_test/source/main.cpp b/source/tests/metacall_load_configuration_python_node_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_load_configuration_python_node_test/source/main.cpp +++ b/source/tests/metacall_load_configuration_python_node_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_python_node_test/source/metacall_load_configuration_python_node_test.cpp b/source/tests/metacall_load_configuration_python_node_test/source/metacall_load_configuration_python_node_test.cpp index 005ee1e33..ece10c5b2 100644 --- a/source/tests/metacall_load_configuration_python_node_test/source/metacall_load_configuration_python_node_test.cpp +++ b/source/tests/metacall_load_configuration_python_node_test/source/metacall_load_configuration_python_node_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_relative_test/include/metacall_load_configuration_relative_test/metacall_load_configuration_relative_test.h.in b/source/tests/metacall_load_configuration_relative_test/include/metacall_load_configuration_relative_test/metacall_load_configuration_relative_test.h.in index 8bfcd166d..79701d0f7 100644 --- a/source/tests/metacall_load_configuration_relative_test/include/metacall_load_configuration_relative_test/metacall_load_configuration_relative_test.h.in +++ b/source/tests/metacall_load_configuration_relative_test/include/metacall_load_configuration_relative_test/metacall_load_configuration_relative_test.h.in @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_relative_test/source/main.cpp b/source/tests/metacall_load_configuration_relative_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_load_configuration_relative_test/source/main.cpp +++ b/source/tests/metacall_load_configuration_relative_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_relative_test/source/metacall_load_configuration_relative_test.cpp b/source/tests/metacall_load_configuration_relative_test/source/metacall_load_configuration_relative_test.cpp index 7527de857..be9556f5e 100644 --- a/source/tests/metacall_load_configuration_relative_test/source/metacall_load_configuration_relative_test.cpp +++ b/source/tests/metacall_load_configuration_relative_test/source/metacall_load_configuration_relative_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_test/source/main.cpp b/source/tests/metacall_load_configuration_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_load_configuration_test/source/main.cpp +++ b/source/tests/metacall_load_configuration_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp b/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp index da91461a7..5562783fa 100644 --- a/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp +++ b/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_memory_empty_test/source/main.cpp b/source/tests/metacall_load_memory_empty_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_load_memory_empty_test/source/main.cpp +++ b/source/tests/metacall_load_memory_empty_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_memory_empty_test/source/metacall_load_memory_empty_test.cpp b/source/tests/metacall_load_memory_empty_test/source/metacall_load_memory_empty_test.cpp index d00723446..4adffb8e4 100644 --- a/source/tests/metacall_load_memory_empty_test/source/metacall_load_memory_empty_test.cpp +++ b/source/tests/metacall_load_memory_empty_test/source/metacall_load_memory_empty_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_memory_test/source/main.cpp b/source/tests/metacall_load_memory_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_load_memory_test/source/main.cpp +++ b/source/tests/metacall_load_memory_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_load_memory_test/source/metacall_load_memory_test.cpp b/source/tests/metacall_load_memory_test/source/metacall_load_memory_test.cpp index 1201ddaa4..9610ddf73 100644 --- a/source/tests/metacall_load_memory_test/source/metacall_load_memory_test.cpp +++ b/source/tests/metacall_load_memory_test/source/metacall_load_memory_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_logs_test/source/main.cpp b/source/tests/metacall_logs_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_logs_test/source/main.cpp +++ b/source/tests/metacall_logs_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_logs_test/source/metacall_logs_test.cpp b/source/tests/metacall_logs_test/source/metacall_logs_test.cpp index 9c352db70..179554ab2 100644 --- a/source/tests/metacall_logs_test/source/metacall_logs_test.cpp +++ b/source/tests/metacall_logs_test/source/metacall_logs_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_lua_test/source/main.cpp b/source/tests/metacall_lua_test/source/main.cpp index 3f4f3377f..7832a6323 100644 --- a/source/tests/metacall_lua_test/source/main.cpp +++ b/source/tests/metacall_lua_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_lua_test/source/metacall_lua_test.cpp b/source/tests/metacall_lua_test/source/metacall_lua_test.cpp index 50baf66e3..63c84b437 100644 --- a/source/tests/metacall_lua_test/source/metacall_lua_test.cpp +++ b/source/tests/metacall_lua_test/source/metacall_lua_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_map_await_test/source/main.cpp b/source/tests/metacall_map_await_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_map_await_test/source/main.cpp +++ b/source/tests/metacall_map_await_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp b/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp index 11243d861..7c68df229 100644 --- a/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp +++ b/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_map_test/source/main.cpp b/source/tests/metacall_map_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_map_test/source/main.cpp +++ b/source/tests/metacall_map_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_map_test/source/metacall_map_test.cpp b/source/tests/metacall_map_test/source/metacall_map_test.cpp index 5aceb11fd..5f98a5a5f 100644 --- a/source/tests/metacall_map_test/source/metacall_map_test.cpp +++ b/source/tests/metacall_map_test/source/metacall_map_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_async_multiple_test/source/main.cpp b/source/tests/metacall_node_async_multiple_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_async_multiple_test/source/main.cpp +++ b/source/tests/metacall_node_async_multiple_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_async_multiple_test/source/metacall_node_async_multiple_test.cpp b/source/tests/metacall_node_async_multiple_test/source/metacall_node_async_multiple_test.cpp index db398273c..157a31a02 100644 --- a/source/tests/metacall_node_async_multiple_test/source/metacall_node_async_multiple_test.cpp +++ b/source/tests/metacall_node_async_multiple_test/source/metacall_node_async_multiple_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_async_resources_test/source/main.cpp b/source/tests/metacall_node_async_resources_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_async_resources_test/source/main.cpp +++ b/source/tests/metacall_node_async_resources_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_async_resources_test/source/metacall_node_async_resources_test.cpp b/source/tests/metacall_node_async_resources_test/source/metacall_node_async_resources_test.cpp index dc256cc03..82d217897 100644 --- a/source/tests/metacall_node_async_resources_test/source/metacall_node_async_resources_test.cpp +++ b/source/tests/metacall_node_async_resources_test/source/metacall_node_async_resources_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_async_test/source/main.cpp b/source/tests/metacall_node_async_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_async_test/source/main.cpp +++ b/source/tests/metacall_node_async_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_async_test/source/metacall_node_async_test.cpp b/source/tests/metacall_node_async_test/source/metacall_node_async_test.cpp index 51c0843a5..e7a839535 100644 --- a/source/tests/metacall_node_async_test/source/metacall_node_async_test.cpp +++ b/source/tests/metacall_node_async_test/source/metacall_node_async_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_await_chain_test/source/main.cpp b/source/tests/metacall_node_await_chain_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_await_chain_test/source/main.cpp +++ b/source/tests/metacall_node_await_chain_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_await_chain_test/source/metacall_node_await_chain_test.cpp b/source/tests/metacall_node_await_chain_test/source/metacall_node_await_chain_test.cpp index bf57f21f5..1efdd4682 100644 --- a/source/tests/metacall_node_await_chain_test/source/metacall_node_await_chain_test.cpp +++ b/source/tests/metacall_node_await_chain_test/source/metacall_node_await_chain_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_call_test/source/main.cpp b/source/tests/metacall_node_call_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_call_test/source/main.cpp +++ b/source/tests/metacall_node_call_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_call_test/source/metacall_node_call_test.cpp b/source/tests/metacall_node_call_test/source/metacall_node_call_test.cpp index 3608330ee..7117e0941 100644 --- a/source/tests/metacall_node_call_test/source/metacall_node_call_test.cpp +++ b/source/tests/metacall_node_call_test/source/metacall_node_call_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_callback_test/source/main.cpp b/source/tests/metacall_node_callback_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_callback_test/source/main.cpp +++ b/source/tests/metacall_node_callback_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_callback_test/source/metacall_node_callback_test.cpp b/source/tests/metacall_node_callback_test/source/metacall_node_callback_test.cpp index f89070ac2..a49f61313 100644 --- a/source/tests/metacall_node_callback_test/source/metacall_node_callback_test.cpp +++ b/source/tests/metacall_node_callback_test/source/metacall_node_callback_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_clear_mem_test/source/main.cpp b/source/tests/metacall_node_clear_mem_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_clear_mem_test/source/main.cpp +++ b/source/tests/metacall_node_clear_mem_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_clear_mem_test/source/metacall_node_clear_mem_test.cpp b/source/tests/metacall_node_clear_mem_test/source/metacall_node_clear_mem_test.cpp index 713933581..ae6388577 100644 --- a/source/tests/metacall_node_clear_mem_test/source/metacall_node_clear_mem_test.cpp +++ b/source/tests/metacall_node_clear_mem_test/source/metacall_node_clear_mem_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_default_export_test/source/main.cpp b/source/tests/metacall_node_default_export_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_default_export_test/source/main.cpp +++ b/source/tests/metacall_node_default_export_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_default_export_test/source/metacall_node_default_export_test.cpp b/source/tests/metacall_node_default_export_test/source/metacall_node_default_export_test.cpp index ac9bd4bd2..890c8b872 100644 --- a/source/tests/metacall_node_default_export_test/source/metacall_node_default_export_test.cpp +++ b/source/tests/metacall_node_default_export_test/source/metacall_node_default_export_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_event_loop_signal_test/source/main.cpp b/source/tests/metacall_node_event_loop_signal_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_event_loop_signal_test/source/main.cpp +++ b/source/tests/metacall_node_event_loop_signal_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_event_loop_signal_test/source/metacall_node_event_loop_signal_test.cpp b/source/tests/metacall_node_event_loop_signal_test/source/metacall_node_event_loop_signal_test.cpp index 463aabc6b..54d7cb8fa 100644 --- a/source/tests/metacall_node_event_loop_signal_test/source/metacall_node_event_loop_signal_test.cpp +++ b/source/tests/metacall_node_event_loop_signal_test/source/metacall_node_event_loop_signal_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_event_loop_test/source/main.cpp b/source/tests/metacall_node_event_loop_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_event_loop_test/source/main.cpp +++ b/source/tests/metacall_node_event_loop_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_event_loop_test/source/metacall_node_event_loop_test.cpp b/source/tests/metacall_node_event_loop_test/source/metacall_node_event_loop_test.cpp index 88e019798..306cda37b 100644 --- a/source/tests/metacall_node_event_loop_test/source/metacall_node_event_loop_test.cpp +++ b/source/tests/metacall_node_event_loop_test/source/metacall_node_event_loop_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_exception_test/source/main.cpp b/source/tests/metacall_node_exception_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_exception_test/source/main.cpp +++ b/source/tests/metacall_node_exception_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp b/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp index 794056a01..9de810277 100644 --- a/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp +++ b/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test.c b/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test.c index a9b08fed4..a0df94bea 100644 --- a/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test.c +++ b/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test.c @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test_win32_delay_load.cpp b/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test_win32_delay_load.cpp index 8ab28a9ac..a19afc563 100644 --- a/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test_win32_delay_load.cpp +++ b/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test_win32_delay_load.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_extension_test/source/main.cpp b/source/tests/metacall_node_extension_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_extension_test/source/main.cpp +++ b/source/tests/metacall_node_extension_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp b/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp index 6514b0c75..4e0986485 100644 --- a/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp +++ b/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_fail_env_var_test/source/main.cpp b/source/tests/metacall_node_fail_env_var_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_fail_env_var_test/source/main.cpp +++ b/source/tests/metacall_node_fail_env_var_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_fail_env_var_test/source/metacall_node_fail_env_var_test.cpp b/source/tests/metacall_node_fail_env_var_test/source/metacall_node_fail_env_var_test.cpp index 5803e2920..b6ef3dc8a 100644 --- a/source/tests/metacall_node_fail_env_var_test/source/metacall_node_fail_env_var_test.cpp +++ b/source/tests/metacall_node_fail_env_var_test/source/metacall_node_fail_env_var_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_fail_load_leak_test/source/main.cpp b/source/tests/metacall_node_fail_load_leak_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_fail_load_leak_test/source/main.cpp +++ b/source/tests/metacall_node_fail_load_leak_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_fail_load_leak_test/source/metacall_node_fail_load_leak_test.cpp b/source/tests/metacall_node_fail_load_leak_test/source/metacall_node_fail_load_leak_test.cpp index b99d94d2b..a47ec3c22 100644 --- a/source/tests/metacall_node_fail_load_leak_test/source/metacall_node_fail_load_leak_test.cpp +++ b/source/tests/metacall_node_fail_load_leak_test/source/metacall_node_fail_load_leak_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_fail_test/source/main.cpp b/source/tests/metacall_node_fail_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_fail_test/source/main.cpp +++ b/source/tests/metacall_node_fail_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_fail_test/source/metacall_node_fail_test.cpp b/source/tests/metacall_node_fail_test/source/metacall_node_fail_test.cpp index 5b1038755..e052ed25b 100644 --- a/source/tests/metacall_node_fail_test/source/metacall_node_fail_test.cpp +++ b/source/tests/metacall_node_fail_test/source/metacall_node_fail_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_inline_test/source/main.cpp b/source/tests/metacall_node_inline_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_inline_test/source/main.cpp +++ b/source/tests/metacall_node_inline_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_inline_test/source/metacall_node_inline_test.cpp b/source/tests/metacall_node_inline_test/source/metacall_node_inline_test.cpp index 4148ae1fb..1c578f6ea 100644 --- a/source/tests/metacall_node_inline_test/source/metacall_node_inline_test.cpp +++ b/source/tests/metacall_node_inline_test/source/metacall_node_inline_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_multithread_deadlock_test/source/main.cpp b/source/tests/metacall_node_multithread_deadlock_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_multithread_deadlock_test/source/main.cpp +++ b/source/tests/metacall_node_multithread_deadlock_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp b/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp index 133d949dd..39ff07dab 100644 --- a/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp +++ b/source/tests/metacall_node_multithread_deadlock_test/source/metacall_node_multithread_deadlock_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_native_code_test/source/main.cpp b/source/tests/metacall_node_native_code_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_native_code_test/source/main.cpp +++ b/source/tests/metacall_node_native_code_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_native_code_test/source/metacall_node_native_code_test.cpp b/source/tests/metacall_node_native_code_test/source/metacall_node_native_code_test.cpp index bbf7fcf5d..4366808cc 100644 --- a/source/tests/metacall_node_native_code_test/source/metacall_node_native_code_test.cpp +++ b/source/tests/metacall_node_native_code_test/source/metacall_node_native_code_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_port_await_test/source/main.cpp b/source/tests/metacall_node_port_await_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_port_await_test/source/main.cpp +++ b/source/tests/metacall_node_port_await_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_port_await_test/source/metacall_node_port_await_test.cpp b/source/tests/metacall_node_port_await_test/source/metacall_node_port_await_test.cpp index 00766eb88..43cb8e8db 100644 --- a/source/tests/metacall_node_port_await_test/source/metacall_node_port_await_test.cpp +++ b/source/tests/metacall_node_port_await_test/source/metacall_node_port_await_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_port_c_lib_test/source/main.cpp b/source/tests/metacall_node_port_c_lib_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_port_c_lib_test/source/main.cpp +++ b/source/tests/metacall_node_port_c_lib_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp b/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp index faa944974..7070bbf98 100644 --- a/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp +++ b/source/tests/metacall_node_port_c_lib_test/source/metacall_node_port_c_lib_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_port_rs_test/source/main.cpp b/source/tests/metacall_node_port_rs_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_port_rs_test/source/main.cpp +++ b/source/tests/metacall_node_port_rs_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_port_rs_test/source/metacall_node_port_rs_test.cpp b/source/tests/metacall_node_port_rs_test/source/metacall_node_port_rs_test.cpp index 4c57bb201..dc54f4d0c 100644 --- a/source/tests/metacall_node_port_rs_test/source/metacall_node_port_rs_test.cpp +++ b/source/tests/metacall_node_port_rs_test/source/metacall_node_port_rs_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_port_test/source/main.cpp b/source/tests/metacall_node_port_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_port_test/source/main.cpp +++ b/source/tests/metacall_node_port_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp b/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp index 5cfb285a2..cfe35e8b5 100644 --- a/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp +++ b/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_async_after_destroy_test/source/main.cpp b/source/tests/metacall_node_python_async_after_destroy_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_python_async_after_destroy_test/source/main.cpp +++ b/source/tests/metacall_node_python_async_after_destroy_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_async_after_destroy_test/source/metacall_node_python_async_after_destroy_test.cpp b/source/tests/metacall_node_python_async_after_destroy_test/source/metacall_node_python_async_after_destroy_test.cpp index 43cdbde33..71ebbcdea 100644 --- a/source/tests/metacall_node_python_async_after_destroy_test/source/metacall_node_python_async_after_destroy_test.cpp +++ b/source/tests/metacall_node_python_async_after_destroy_test/source/metacall_node_python_async_after_destroy_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_await_extended_test/source/main.cpp b/source/tests/metacall_node_python_await_extended_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_python_await_extended_test/source/main.cpp +++ b/source/tests/metacall_node_python_await_extended_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp b/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp index 57e9c143b..d773f0ba7 100644 --- a/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp +++ b/source/tests/metacall_node_python_await_extended_test/source/metacall_node_python_await_extended_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_await_test/source/main.cpp b/source/tests/metacall_node_python_await_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_python_await_test/source/main.cpp +++ b/source/tests/metacall_node_python_await_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_await_test/source/metacall_node_python_await_test.cpp b/source/tests/metacall_node_python_await_test/source/metacall_node_python_await_test.cpp index b140752ac..9e63b1aa3 100644 --- a/source/tests/metacall_node_python_await_test/source/metacall_node_python_await_test.cpp +++ b/source/tests/metacall_node_python_await_test/source/metacall_node_python_await_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_deadlock_test/source/main.cpp b/source/tests/metacall_node_python_deadlock_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_python_deadlock_test/source/main.cpp +++ b/source/tests/metacall_node_python_deadlock_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_deadlock_test/source/metacall_node_python_deadlock_test.cpp b/source/tests/metacall_node_python_deadlock_test/source/metacall_node_python_deadlock_test.cpp index 4b9ce4866..d5cca59f2 100644 --- a/source/tests/metacall_node_python_deadlock_test/source/metacall_node_python_deadlock_test.cpp +++ b/source/tests/metacall_node_python_deadlock_test/source/metacall_node_python_deadlock_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_exception_test/source/main.cpp b/source/tests/metacall_node_python_exception_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_python_exception_test/source/main.cpp +++ b/source/tests/metacall_node_python_exception_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_exception_test/source/metacall_node_python_exception_test.cpp b/source/tests/metacall_node_python_exception_test/source/metacall_node_python_exception_test.cpp index 69ed55884..73f59386c 100644 --- a/source/tests/metacall_node_python_exception_test/source/metacall_node_python_exception_test.cpp +++ b/source/tests/metacall_node_python_exception_test/source/metacall_node_python_exception_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_port_mock_test/source/main.cpp b/source/tests/metacall_node_python_port_mock_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_python_port_mock_test/source/main.cpp +++ b/source/tests/metacall_node_python_port_mock_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp b/source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp index 7670e8d89..b1c9b76b4 100644 --- a/source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp +++ b/source/tests/metacall_node_python_port_mock_test/source/metacall_node_python_port_mock_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_port_ruby_test/source/main.cpp b/source/tests/metacall_node_python_port_ruby_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_python_port_ruby_test/source/main.cpp +++ b/source/tests/metacall_node_python_port_ruby_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_port_ruby_test/source/metacall_node_python_port_ruby_test.cpp b/source/tests/metacall_node_python_port_ruby_test/source/metacall_node_python_port_ruby_test.cpp index 0b4edc45c..19acb40e9 100644 --- a/source/tests/metacall_node_python_port_ruby_test/source/metacall_node_python_port_ruby_test.cpp +++ b/source/tests/metacall_node_python_port_ruby_test/source/metacall_node_python_port_ruby_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_ruby_test/source/main.cpp b/source/tests/metacall_node_python_ruby_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_python_ruby_test/source/main.cpp +++ b/source/tests/metacall_node_python_ruby_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp b/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp index a3ff9fe7e..0ba5f3ba3 100644 --- a/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp +++ b/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_reentrant_test/source/main.cpp b/source/tests/metacall_node_reentrant_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_reentrant_test/source/main.cpp +++ b/source/tests/metacall_node_reentrant_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_reentrant_test/source/metacall_node_reentrant_test.cpp b/source/tests/metacall_node_reentrant_test/source/metacall_node_reentrant_test.cpp index cfac3514f..09f0c7af6 100644 --- a/source/tests/metacall_node_reentrant_test/source/metacall_node_reentrant_test.cpp +++ b/source/tests/metacall_node_reentrant_test/source/metacall_node_reentrant_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_signal_handler_test/source/main.cpp b/source/tests/metacall_node_signal_handler_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_signal_handler_test/source/main.cpp +++ b/source/tests/metacall_node_signal_handler_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_signal_handler_test/source/metacall_node_signal_handler_test.cpp b/source/tests/metacall_node_signal_handler_test/source/metacall_node_signal_handler_test.cpp index 869a6fd1e..61e1ef075 100644 --- a/source/tests/metacall_node_signal_handler_test/source/metacall_node_signal_handler_test.cpp +++ b/source/tests/metacall_node_signal_handler_test/source/metacall_node_signal_handler_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_test/source/main.cpp b/source/tests/metacall_node_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_test/source/main.cpp +++ b/source/tests/metacall_node_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_test/source/metacall_node_test.cpp b/source/tests/metacall_node_test/source/metacall_node_test.cpp index f63f67c2c..f38954e09 100644 --- a/source/tests/metacall_node_test/source/metacall_node_test.cpp +++ b/source/tests/metacall_node_test/source/metacall_node_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_typescript_test/source/main.cpp b/source/tests/metacall_node_typescript_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_node_typescript_test/source/main.cpp +++ b/source/tests/metacall_node_typescript_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_node_typescript_test/source/metacall_node_typescript_test.cpp b/source/tests/metacall_node_typescript_test/source/metacall_node_typescript_test.cpp index 984705f86..8bf39ee56 100644 --- a/source/tests/metacall_node_typescript_test/source/metacall_node_typescript_test.cpp +++ b/source/tests/metacall_node_typescript_test/source/metacall_node_typescript_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_plugin_extension_destroy_order_test/source/main.cpp b/source/tests/metacall_plugin_extension_destroy_order_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_plugin_extension_destroy_order_test/source/main.cpp +++ b/source/tests/metacall_plugin_extension_destroy_order_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_plugin_extension_destroy_order_test/source/metacall_plugin_extension_destroy_order_test.cpp b/source/tests/metacall_plugin_extension_destroy_order_test/source/metacall_plugin_extension_destroy_order_test.cpp index 0ad0838ab..7d094870c 100644 --- a/source/tests/metacall_plugin_extension_destroy_order_test/source/metacall_plugin_extension_destroy_order_test.cpp +++ b/source/tests/metacall_plugin_extension_destroy_order_test/source/metacall_plugin_extension_destroy_order_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/source/main.cpp b/source/tests/metacall_plugin_extension_invalid_path_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_plugin_extension_invalid_path_test/source/main.cpp +++ b/source/tests/metacall_plugin_extension_invalid_path_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp b/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp index fe30dd53e..31fec9d9b 100644 --- a/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp +++ b/source/tests/metacall_plugin_extension_invalid_path_test/source/metacall_plugin_extension_invalid_path_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_plugin_extension_local_test/source/main.cpp b/source/tests/metacall_plugin_extension_local_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_plugin_extension_local_test/source/main.cpp +++ b/source/tests/metacall_plugin_extension_local_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_plugin_extension_local_test/source/metacall_plugin_extension_local_test.cpp b/source/tests/metacall_plugin_extension_local_test/source/metacall_plugin_extension_local_test.cpp index b7a6680f6..060200f35 100644 --- a/source/tests/metacall_plugin_extension_local_test/source/metacall_plugin_extension_local_test.cpp +++ b/source/tests/metacall_plugin_extension_local_test/source/metacall_plugin_extension_local_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_plugin_extension_test/source/main.cpp b/source/tests/metacall_plugin_extension_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_plugin_extension_test/source/main.cpp +++ b/source/tests/metacall_plugin_extension_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_plugin_extension_test/source/metacall_plugin_extension_test.cpp b/source/tests/metacall_plugin_extension_test/source/metacall_plugin_extension_test.cpp index 975e70590..4d1d4ac99 100644 --- a/source/tests/metacall_plugin_extension_test/source/metacall_plugin_extension_test.cpp +++ b/source/tests/metacall_plugin_extension_test/source/metacall_plugin_extension_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_await_test/source/main.cpp b/source/tests/metacall_python_await_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_await_test/source/main.cpp +++ b/source/tests/metacall_python_await_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_await_test/source/metacall_python_await_test.cpp b/source/tests/metacall_python_await_test/source/metacall_python_await_test.cpp index 355e71288..71ff8b6f5 100644 --- a/source/tests/metacall_python_await_test/source/metacall_python_await_test.cpp +++ b/source/tests/metacall_python_await_test/source/metacall_python_await_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_builtins_test/source/main.cpp b/source/tests/metacall_python_builtins_test/source/main.cpp index 3f4f3377f..7832a6323 100644 --- a/source/tests/metacall_python_builtins_test/source/main.cpp +++ b/source/tests/metacall_python_builtins_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_builtins_test/source/metacall_python_builtins_test.cpp b/source/tests/metacall_python_builtins_test/source/metacall_python_builtins_test.cpp index 5ba74c839..a806d0442 100644 --- a/source/tests/metacall_python_builtins_test/source/metacall_python_builtins_test.cpp +++ b/source/tests/metacall_python_builtins_test/source/metacall_python_builtins_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_callback_test/source/main.cpp b/source/tests/metacall_python_callback_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_callback_test/source/main.cpp +++ b/source/tests/metacall_python_callback_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_callback_test/source/metacall_python_callback_test.cpp b/source/tests/metacall_python_callback_test/source/metacall_python_callback_test.cpp index b62c2d021..fa15992d9 100644 --- a/source/tests/metacall_python_callback_test/source/metacall_python_callback_test.cpp +++ b/source/tests/metacall_python_callback_test/source/metacall_python_callback_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_dict_test/source/main.cpp b/source/tests/metacall_python_dict_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_dict_test/source/main.cpp +++ b/source/tests/metacall_python_dict_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp b/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp index b5cb079b9..cab84c549 100644 --- a/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp +++ b/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_exception_test/source/main.cpp b/source/tests/metacall_python_exception_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_exception_test/source/main.cpp +++ b/source/tests/metacall_python_exception_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp b/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp index 05726d9a4..8d902ced5 100644 --- a/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp +++ b/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_fail_test/source/main.cpp b/source/tests/metacall_python_fail_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_fail_test/source/main.cpp +++ b/source/tests/metacall_python_fail_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_fail_test/source/metacall_python_fail_test.cpp b/source/tests/metacall_python_fail_test/source/metacall_python_fail_test.cpp index f35f187b8..7ef4531f6 100644 --- a/source/tests/metacall_python_fail_test/source/metacall_python_fail_test.cpp +++ b/source/tests/metacall_python_fail_test/source/metacall_python_fail_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_gc_test/source/main.cpp b/source/tests/metacall_python_gc_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_gc_test/source/main.cpp +++ b/source/tests/metacall_python_gc_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp b/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp index d7f1fc308..3e21db1ab 100644 --- a/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp +++ b/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_loader_port_test/source/main.cpp b/source/tests/metacall_python_loader_port_test/source/main.cpp index 3f4f3377f..7832a6323 100644 --- a/source/tests/metacall_python_loader_port_test/source/main.cpp +++ b/source/tests/metacall_python_loader_port_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp b/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp index bc151f7d9..106797f36 100644 --- a/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp +++ b/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_model_test/source/main.cpp b/source/tests/metacall_python_model_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_model_test/source/main.cpp +++ b/source/tests/metacall_python_model_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_model_test/source/metacall_python_model_test.cpp b/source/tests/metacall_python_model_test/source/metacall_python_model_test.cpp index 503e0f6c0..ca200e45b 100644 --- a/source/tests/metacall_python_model_test/source/metacall_python_model_test.cpp +++ b/source/tests/metacall_python_model_test/source/metacall_python_model_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_node_await_test/source/main.cpp b/source/tests/metacall_python_node_await_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_node_await_test/source/main.cpp +++ b/source/tests/metacall_python_node_await_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_node_await_test/source/metacall_python_node_await_test.cpp b/source/tests/metacall_python_node_await_test/source/metacall_python_node_await_test.cpp index 219b8b4a6..168f3517c 100644 --- a/source/tests/metacall_python_node_await_test/source/metacall_python_node_await_test.cpp +++ b/source/tests/metacall_python_node_await_test/source/metacall_python_node_await_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_object_class_test/source/main.cpp b/source/tests/metacall_python_object_class_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_object_class_test/source/main.cpp +++ b/source/tests/metacall_python_object_class_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp b/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp index a5a3439c2..092c58927 100644 --- a/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp +++ b/source/tests/metacall_python_object_class_test/source/metacall_python_object_class_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_open_test/source/main.cpp b/source/tests/metacall_python_open_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_open_test/source/main.cpp +++ b/source/tests/metacall_python_open_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp b/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp index 23b30971f..3eda60fe5 100644 --- a/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp +++ b/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_pointer_test/source/main.cpp b/source/tests/metacall_python_pointer_test/source/main.cpp index 3f4f3377f..7832a6323 100644 --- a/source/tests/metacall_python_pointer_test/source/main.cpp +++ b/source/tests/metacall_python_pointer_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp b/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp index 93afe1d31..cd7edd2e2 100644 --- a/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp +++ b/source/tests/metacall_python_pointer_test/source/metacall_python_pointer_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_callback_test/source/main.cpp b/source/tests/metacall_python_port_callback_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_port_callback_test/source/main.cpp +++ b/source/tests/metacall_python_port_callback_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_callback_test/source/metacall_python_port_callback_test.cpp b/source/tests/metacall_python_port_callback_test/source/metacall_python_port_callback_test.cpp index 0cf39bfe3..c0fd5e5b2 100644 --- a/source/tests/metacall_python_port_callback_test/source/metacall_python_port_callback_test.cpp +++ b/source/tests/metacall_python_port_callback_test/source/metacall_python_port_callback_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_https_test/source/main.cpp b/source/tests/metacall_python_port_https_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_port_https_test/source/main.cpp +++ b/source/tests/metacall_python_port_https_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_https_test/source/metacall_python_port_https_test.cpp b/source/tests/metacall_python_port_https_test/source/metacall_python_port_https_test.cpp index b005ffa1b..e6082d2fe 100644 --- a/source/tests/metacall_python_port_https_test/source/metacall_python_port_https_test.cpp +++ b/source/tests/metacall_python_port_https_test/source/metacall_python_port_https_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_import_test/source/main.cpp b/source/tests/metacall_python_port_import_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_port_import_test/source/main.cpp +++ b/source/tests/metacall_python_port_import_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_import_test/source/metacall_python_port_import_test.cpp b/source/tests/metacall_python_port_import_test/source/metacall_python_port_import_test.cpp index 0b15fa977..23b93ca1a 100644 --- a/source/tests/metacall_python_port_import_test/source/metacall_python_port_import_test.cpp +++ b/source/tests/metacall_python_port_import_test/source/metacall_python_port_import_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_pointer_test/source/main.cpp b/source/tests/metacall_python_port_pointer_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_port_pointer_test/source/main.cpp +++ b/source/tests/metacall_python_port_pointer_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp b/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp index 2e48f5607..fd6214d1d 100644 --- a/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp +++ b/source/tests/metacall_python_port_pointer_test/source/metacall_python_port_pointer_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_test/source/main.cpp b/source/tests/metacall_python_port_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_port_test/source/main.cpp +++ b/source/tests/metacall_python_port_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp b/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp index d562fd89e..a86f7f111 100644 --- a/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp +++ b/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_reentrant_test/source/main.cpp b/source/tests/metacall_python_reentrant_test/source/main.cpp index 3f4f3377f..7832a6323 100644 --- a/source/tests/metacall_python_reentrant_test/source/main.cpp +++ b/source/tests/metacall_python_reentrant_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_reentrant_test/source/metacall_python_reentrant_test.cpp b/source/tests/metacall_python_reentrant_test/source/metacall_python_reentrant_test.cpp index fa6dae3f6..ae1d10759 100644 --- a/source/tests/metacall_python_reentrant_test/source/metacall_python_reentrant_test.cpp +++ b/source/tests/metacall_python_reentrant_test/source/metacall_python_reentrant_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_relative_path_test/source/main.cpp b/source/tests/metacall_python_relative_path_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_relative_path_test/source/main.cpp +++ b/source/tests/metacall_python_relative_path_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_relative_path_test/source/metacall_python_relative_path_test.cpp b/source/tests/metacall_python_relative_path_test/source/metacall_python_relative_path_test.cpp index f1f7ce4bb..0c44179d6 100644 --- a/source/tests/metacall_python_relative_path_test/source/metacall_python_relative_path_test.cpp +++ b/source/tests/metacall_python_relative_path_test/source/metacall_python_relative_path_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_test/source/main.cpp b/source/tests/metacall_python_test/source/main.cpp index 3f4f3377f..7832a6323 100644 --- a/source/tests/metacall_python_test/source/main.cpp +++ b/source/tests/metacall_python_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_test/source/metacall_python_test.cpp b/source/tests/metacall_python_test/source/metacall_python_test.cpp index 35dfb9e41..690bf226a 100644 --- a/source/tests/metacall_python_test/source/metacall_python_test.cpp +++ b/source/tests/metacall_python_test/source/metacall_python_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_varargs_test/source/main.cpp b/source/tests/metacall_python_varargs_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_varargs_test/source/main.cpp +++ b/source/tests/metacall_python_varargs_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_varargs_test/source/metacall_python_varargs_test.cpp b/source/tests/metacall_python_varargs_test/source/metacall_python_varargs_test.cpp index d5a2ee376..e640a1f50 100644 --- a/source/tests/metacall_python_varargs_test/source/metacall_python_varargs_test.cpp +++ b/source/tests/metacall_python_varargs_test/source/metacall_python_varargs_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_without_env_vars_test/source/main.cpp b/source/tests/metacall_python_without_env_vars_test/source/main.cpp index 3f4f3377f..7832a6323 100644 --- a/source/tests/metacall_python_without_env_vars_test/source/main.cpp +++ b/source/tests/metacall_python_without_env_vars_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_without_env_vars_test/source/metacall_python_without_env_vars_test.cpp b/source/tests/metacall_python_without_env_vars_test/source/metacall_python_without_env_vars_test.cpp index 9c35499a7..05ec48089 100644 --- a/source/tests/metacall_python_without_env_vars_test/source/metacall_python_without_env_vars_test.cpp +++ b/source/tests/metacall_python_without_env_vars_test/source/metacall_python_without_env_vars_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading python code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_without_functions_test/source/main.cpp b/source/tests/metacall_python_without_functions_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_python_without_functions_test/source/main.cpp +++ b/source/tests/metacall_python_without_functions_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_python_without_functions_test/source/metacall_python_without_functions_test.cpp b/source/tests/metacall_python_without_functions_test/source/metacall_python_without_functions_test.cpp index 7c4ec16a4..9e84dbe51 100644 --- a/source/tests/metacall_python_without_functions_test/source/metacall_python_without_functions_test.cpp +++ b/source/tests/metacall_python_without_functions_test/source/metacall_python_without_functions_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_reinitialize_test/source/main.cpp b/source/tests/metacall_reinitialize_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_reinitialize_test/source/main.cpp +++ b/source/tests/metacall_reinitialize_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_reinitialize_test/source/metacall_reinitialize_test.cpp b/source/tests/metacall_reinitialize_test/source/metacall_reinitialize_test.cpp index d3cade323..da47af990 100644 --- a/source/tests/metacall_reinitialize_test/source/metacall_reinitialize_test.cpp +++ b/source/tests/metacall_reinitialize_test/source/metacall_reinitialize_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_reload_functions_test/source/main.cpp b/source/tests/metacall_reload_functions_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_reload_functions_test/source/main.cpp +++ b/source/tests/metacall_reload_functions_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_reload_functions_test/source/metacall_reload_functions_test.cpp b/source/tests/metacall_reload_functions_test/source/metacall_reload_functions_test.cpp index ae4bc3905..be227cf3d 100644 --- a/source/tests/metacall_reload_functions_test/source/metacall_reload_functions_test.cpp +++ b/source/tests/metacall_reload_functions_test/source/metacall_reload_functions_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_return_monad_test/source/main.cpp b/source/tests/metacall_return_monad_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_return_monad_test/source/main.cpp +++ b/source/tests/metacall_return_monad_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp b/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp index ad07a1db8..dfcf6e70c 100644 --- a/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp +++ b/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rpc_test/source/main.cpp b/source/tests/metacall_rpc_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_rpc_test/source/main.cpp +++ b/source/tests/metacall_rpc_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp b/source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp index 51fb948f2..670911293 100644 --- a/source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp +++ b/source/tests/metacall_rpc_test/source/metacall_rpc_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_fail_empty_test/source/main.cpp b/source/tests/metacall_ruby_fail_empty_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_ruby_fail_empty_test/source/main.cpp +++ b/source/tests/metacall_ruby_fail_empty_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_fail_empty_test/source/metacall_ruby_fail_empty_test.cpp b/source/tests/metacall_ruby_fail_empty_test/source/metacall_ruby_fail_empty_test.cpp index 96b4f5c15..5ab21e63e 100644 --- a/source/tests/metacall_ruby_fail_empty_test/source/metacall_ruby_fail_empty_test.cpp +++ b/source/tests/metacall_ruby_fail_empty_test/source/metacall_ruby_fail_empty_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_fail_test/source/main.cpp b/source/tests/metacall_ruby_fail_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_ruby_fail_test/source/main.cpp +++ b/source/tests/metacall_ruby_fail_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_fail_test/source/metacall_ruby_fail_test.cpp b/source/tests/metacall_ruby_fail_test/source/metacall_ruby_fail_test.cpp index 2fe3de533..24c11d798 100644 --- a/source/tests/metacall_ruby_fail_test/source/metacall_ruby_fail_test.cpp +++ b/source/tests/metacall_ruby_fail_test/source/metacall_ruby_fail_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_object_class_test/source/main.cpp b/source/tests/metacall_ruby_object_class_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_ruby_object_class_test/source/main.cpp +++ b/source/tests/metacall_ruby_object_class_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_object_class_test/source/metacall_ruby_object_class_test.cpp b/source/tests/metacall_ruby_object_class_test/source/metacall_ruby_object_class_test.cpp index c471d2406..05d7f272c 100644 --- a/source/tests/metacall_ruby_object_class_test/source/metacall_ruby_object_class_test.cpp +++ b/source/tests/metacall_ruby_object_class_test/source/metacall_ruby_object_class_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_parser_integration_test/source/main.cpp b/source/tests/metacall_ruby_parser_integration_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_ruby_parser_integration_test/source/main.cpp +++ b/source/tests/metacall_ruby_parser_integration_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp b/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp index 295697da2..b269fd9c2 100644 --- a/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp +++ b/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_rails_integration_test/source/main.cpp b/source/tests/metacall_ruby_rails_integration_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_ruby_rails_integration_test/source/main.cpp +++ b/source/tests/metacall_ruby_rails_integration_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_rails_integration_test/source/metacall_ruby_rails_integration_test.cpp b/source/tests/metacall_ruby_rails_integration_test/source/metacall_ruby_rails_integration_test.cpp index 66b0fa747..5d04ac435 100644 --- a/source/tests/metacall_ruby_rails_integration_test/source/metacall_ruby_rails_integration_test.cpp +++ b/source/tests/metacall_ruby_rails_integration_test/source/metacall_ruby_rails_integration_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_test/source/main.cpp b/source/tests/metacall_ruby_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_ruby_test/source/main.cpp +++ b/source/tests/metacall_ruby_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp b/source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp index adb9a7007..cf8bcf49e 100644 --- a/source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp +++ b/source/tests/metacall_ruby_test/source/metacall_ruby_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_class_test/source/main.cpp b/source/tests/metacall_rust_class_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_rust_class_test/source/main.cpp +++ b/source/tests/metacall_rust_class_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_class_test/source/metacall_rust_class_test.cpp b/source/tests/metacall_rust_class_test/source/metacall_rust_class_test.cpp index cb0c537a0..235841a99 100644 --- a/source/tests/metacall_rust_class_test/source/metacall_rust_class_test.cpp +++ b/source/tests/metacall_rust_class_test/source/metacall_rust_class_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_load_from_mem_test/source/main.cpp b/source/tests/metacall_rust_load_from_mem_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_rust_load_from_mem_test/source/main.cpp +++ b/source/tests/metacall_rust_load_from_mem_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_load_from_mem_test/source/metacall_rust_load_from_mem_test.cpp b/source/tests/metacall_rust_load_from_mem_test/source/metacall_rust_load_from_mem_test.cpp index 5a2f5b440..ab09ed72b 100644 --- a/source/tests/metacall_rust_load_from_mem_test/source/metacall_rust_load_from_mem_test.cpp +++ b/source/tests/metacall_rust_load_from_mem_test/source/metacall_rust_load_from_mem_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_load_from_package_class_test/source/main.cpp b/source/tests/metacall_rust_load_from_package_class_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_rust_load_from_package_class_test/source/main.cpp +++ b/source/tests/metacall_rust_load_from_package_class_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_load_from_package_class_test/source/metacall_rust_load_from_package_class_test.cpp b/source/tests/metacall_rust_load_from_package_class_test/source/metacall_rust_load_from_package_class_test.cpp index 6d6ed2bfc..d4f927d5b 100644 --- a/source/tests/metacall_rust_load_from_package_class_test/source/metacall_rust_load_from_package_class_test.cpp +++ b/source/tests/metacall_rust_load_from_package_class_test/source/metacall_rust_load_from_package_class_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_load_from_package_dep_test/source/main.cpp b/source/tests/metacall_rust_load_from_package_dep_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_rust_load_from_package_dep_test/source/main.cpp +++ b/source/tests/metacall_rust_load_from_package_dep_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp b/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp index dc578bb42..bc2d7930c 100644 --- a/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp +++ b/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_load_from_package_test/source/main.cpp b/source/tests/metacall_rust_load_from_package_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_rust_load_from_package_test/source/main.cpp +++ b/source/tests/metacall_rust_load_from_package_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp b/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp index 776ce0ebb..37f6394bb 100644 --- a/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp +++ b/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_test/source/main.cpp b/source/tests/metacall_rust_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/metacall_rust_test/source/main.cpp +++ b/source/tests/metacall_rust_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_rust_test/source/metacall_rust_test.cpp b/source/tests/metacall_rust_test/source/metacall_rust_test.cpp index b0a2e9407..85b9253da 100644 --- a/source/tests/metacall_rust_test/source/metacall_rust_test.cpp +++ b/source/tests/metacall_rust_test/source/metacall_rust_test.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_sandbox_plugin_test/source/main.cpp b/source/tests/metacall_sandbox_plugin_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_sandbox_plugin_test/source/main.cpp +++ b/source/tests/metacall_sandbox_plugin_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_sandbox_plugin_test/source/metacall_sandbox_plugin_test.cpp b/source/tests/metacall_sandbox_plugin_test/source/metacall_sandbox_plugin_test.cpp index 6d0f186a1..3cd32dcf0 100644 --- a/source/tests/metacall_sandbox_plugin_test/source/metacall_sandbox_plugin_test.cpp +++ b/source/tests/metacall_sandbox_plugin_test/source/metacall_sandbox_plugin_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_test/source/main.cpp b/source/tests/metacall_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_test/source/main.cpp +++ b/source/tests/metacall_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_test/source/metacall_test.cpp b/source/tests/metacall_test/source/metacall_test.cpp index cf9d864a2..3f250b3cd 100644 --- a/source/tests/metacall_test/source/metacall_test.cpp +++ b/source/tests/metacall_test/source/metacall_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_test/source/metacall_test_split.cpp b/source/tests/metacall_test/source/metacall_test_split.cpp index dead0c91e..49d0fc8f1 100644 --- a/source/tests/metacall_test/source/metacall_test_split.cpp +++ b/source/tests/metacall_test/source/metacall_test_split.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_call_map_test/source/main.cpp b/source/tests/metacall_typescript_call_map_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_typescript_call_map_test/source/main.cpp +++ b/source/tests/metacall_typescript_call_map_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_call_map_test/source/metacall_typescript_call_map_test.cpp b/source/tests/metacall_typescript_call_map_test/source/metacall_typescript_call_map_test.cpp index d9cf65a80..82af7b294 100644 --- a/source/tests/metacall_typescript_call_map_test/source/metacall_typescript_call_map_test.cpp +++ b/source/tests/metacall_typescript_call_map_test/source/metacall_typescript_call_map_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_jsx_default_test/source/main.cpp b/source/tests/metacall_typescript_jsx_default_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_typescript_jsx_default_test/source/main.cpp +++ b/source/tests/metacall_typescript_jsx_default_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_jsx_default_test/source/metacall_typescript_jsx_default_test.cpp b/source/tests/metacall_typescript_jsx_default_test/source/metacall_typescript_jsx_default_test.cpp index 0930ddff3..609bb760e 100644 --- a/source/tests/metacall_typescript_jsx_default_test/source/metacall_typescript_jsx_default_test.cpp +++ b/source/tests/metacall_typescript_jsx_default_test/source/metacall_typescript_jsx_default_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_node_test/source/main.cpp b/source/tests/metacall_typescript_node_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_typescript_node_test/source/main.cpp +++ b/source/tests/metacall_typescript_node_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_node_test/source/metacall_typescript_node_test.cpp b/source/tests/metacall_typescript_node_test/source/metacall_typescript_node_test.cpp index 95a65c98b..4285ca809 100644 --- a/source/tests/metacall_typescript_node_test/source/metacall_typescript_node_test.cpp +++ b/source/tests/metacall_typescript_node_test/source/metacall_typescript_node_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_require_test/source/main.cpp b/source/tests/metacall_typescript_require_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_typescript_require_test/source/main.cpp +++ b/source/tests/metacall_typescript_require_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_require_test/source/metacall_typescript_require_test.cpp b/source/tests/metacall_typescript_require_test/source/metacall_typescript_require_test.cpp index 13d90c515..b94e43fa3 100644 --- a/source/tests/metacall_typescript_require_test/source/metacall_typescript_require_test.cpp +++ b/source/tests/metacall_typescript_require_test/source/metacall_typescript_require_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_test/source/main.cpp b/source/tests/metacall_typescript_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_typescript_test/source/main.cpp +++ b/source/tests/metacall_typescript_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_test/source/metacall_typescript_test.cpp b/source/tests/metacall_typescript_test/source/metacall_typescript_test.cpp index 8b3488797..9ebd5f9f3 100644 --- a/source/tests/metacall_typescript_test/source/metacall_typescript_test.cpp +++ b/source/tests/metacall_typescript_test/source/metacall_typescript_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_tsx_loop_fail_test/source/main.cpp b/source/tests/metacall_typescript_tsx_loop_fail_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_typescript_tsx_loop_fail_test/source/main.cpp +++ b/source/tests/metacall_typescript_tsx_loop_fail_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_tsx_loop_fail_test/source/metacall_typescript_tsx_loop_fail_test.cpp b/source/tests/metacall_typescript_tsx_loop_fail_test/source/metacall_typescript_tsx_loop_fail_test.cpp index 8256b3481..54a278e39 100644 --- a/source/tests/metacall_typescript_tsx_loop_fail_test/source/metacall_typescript_tsx_loop_fail_test.cpp +++ b/source/tests/metacall_typescript_tsx_loop_fail_test/source/metacall_typescript_tsx_loop_fail_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_tsx_test/source/main.cpp b/source/tests/metacall_typescript_tsx_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_typescript_tsx_test/source/main.cpp +++ b/source/tests/metacall_typescript_tsx_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp b/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp index 0723b6eed..16404c17d 100644 --- a/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp +++ b/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_version_test/source/main.cpp b/source/tests/metacall_version_test/source/main.cpp index 11ddf3f59..582034129 100644 --- a/source/tests/metacall_version_test/source/main.cpp +++ b/source/tests/metacall_version_test/source/main.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_version_test/source/metacall_version_test.cpp b/source/tests/metacall_version_test/source/metacall_version_test.cpp index 531e7bdd5..b7023840b 100644 --- a/source/tests/metacall_version_test/source/metacall_version_test.cpp +++ b/source/tests/metacall_version_test/source/metacall_version_test.cpp @@ -2,7 +2,7 @@ * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_wasm_python_port_test/source/main.cpp b/source/tests/metacall_wasm_python_port_test/source/main.cpp index 31f757ddc..ae1380d35 100644 --- a/source/tests/metacall_wasm_python_port_test/source/main.cpp +++ b/source/tests/metacall_wasm_python_port_test/source/main.cpp @@ -1,7 +1,7 @@ /* * WebAssembly Loader Tests by Parra Studios * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_wasm_python_port_test/source/metacall_wasm_python_port_test.cpp b/source/tests/metacall_wasm_python_port_test/source/metacall_wasm_python_port_test.cpp index 7896135fe..f233b6a52 100644 --- a/source/tests/metacall_wasm_python_port_test/source/metacall_wasm_python_port_test.cpp +++ b/source/tests/metacall_wasm_python_port_test/source/metacall_wasm_python_port_test.cpp @@ -1,7 +1,7 @@ /* * WebAssembly Loader Tests by Parra Studios * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_wasm_test/source/main.cpp b/source/tests/metacall_wasm_test/source/main.cpp index 31f757ddc..ae1380d35 100644 --- a/source/tests/metacall_wasm_test/source/main.cpp +++ b/source/tests/metacall_wasm_test/source/main.cpp @@ -1,7 +1,7 @@ /* * WebAssembly Loader Tests by Parra Studios * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp b/source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp index 2c5515ed8..0042e45b7 100644 --- a/source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp +++ b/source/tests/metacall_wasm_test/source/metacall_wasm_test.cpp @@ -1,7 +1,7 @@ /* * WebAssembly Loader Tests by Parra Studios * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/portability_path_test/source/main.cpp b/source/tests/portability_path_test/source/main.cpp index 1888b3214..24fae6af6 100644 --- a/source/tests/portability_path_test/source/main.cpp +++ b/source/tests/portability_path_test/source/main.cpp @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/portability_path_test/source/portability_path_test.cpp b/source/tests/portability_path_test/source/portability_path_test.cpp index f49756348..c8b4dccc5 100644 --- a/source/tests/portability_path_test/source/portability_path_test.cpp +++ b/source/tests/portability_path_test/source/portability_path_test.cpp @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios -* Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +* Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A library for loading executable code at run-time into a process. * diff --git a/source/tests/preprocessor_test/source/main.cpp b/source/tests/preprocessor_test/source/main.cpp index d678d80ae..ccd0ee35a 100644 --- a/source/tests/preprocessor_test/source/main.cpp +++ b/source/tests/preprocessor_test/source/main.cpp @@ -2,7 +2,7 @@ * Logger Library by Parra Studios * A generic logger library providing application execution reports. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/preprocessor_test/source/preprocessor_test.cpp b/source/tests/preprocessor_test/source/preprocessor_test.cpp index 1c5bf3e61..80d4bad37 100644 --- a/source/tests/preprocessor_test/source/preprocessor_test.cpp +++ b/source/tests/preprocessor_test/source/preprocessor_test.cpp @@ -2,7 +2,7 @@ * Preprocssor Library by Parra Studios * A generic header-only preprocessor metaprogramming library. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/rb_loader_parser_test/source/main.cpp b/source/tests/rb_loader_parser_test/source/main.cpp index 4537c68d3..37d4adc23 100644 --- a/source/tests/rb_loader_parser_test/source/main.cpp +++ b/source/tests/rb_loader_parser_test/source/main.cpp @@ -2,7 +2,7 @@ * Loader Library by Parra Studios * A plugin for loading ruby code at run-time into a process. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/rb_loader_parser_test/source/rb_loader_parser_test.cpp b/source/tests/rb_loader_parser_test/source/rb_loader_parser_test.cpp index 98066bc98..a8984ff47 100644 --- a/source/tests/rb_loader_parser_test/source/rb_loader_parser_test.cpp +++ b/source/tests/rb_loader_parser_test/source/rb_loader_parser_test.cpp @@ -1,6 +1,6 @@ /* * Loader Library by Parra Studios - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * A plugin for loading ruby code at run-time into a process. * diff --git a/source/tests/reflect_function_test/source/main.cpp b/source/tests/reflect_function_test/source/main.cpp index 718fa2707..cba58797c 100644 --- a/source/tests/reflect_function_test/source/main.cpp +++ b/source/tests/reflect_function_test/source/main.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_function_test/source/reflect_function_test.cpp b/source/tests/reflect_function_test/source/reflect_function_test.cpp index eea934927..7567f4505 100644 --- a/source/tests/reflect_function_test/source/reflect_function_test.cpp +++ b/source/tests/reflect_function_test/source/reflect_function_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_metadata_test/source/main.cpp b/source/tests/reflect_metadata_test/source/main.cpp index 718fa2707..cba58797c 100644 --- a/source/tests/reflect_metadata_test/source/main.cpp +++ b/source/tests/reflect_metadata_test/source/main.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_metadata_test/source/reflect_metadata_test.cpp b/source/tests/reflect_metadata_test/source/reflect_metadata_test.cpp index 32747c825..6c1bc10f7 100644 --- a/source/tests/reflect_metadata_test/source/reflect_metadata_test.cpp +++ b/source/tests/reflect_metadata_test/source/reflect_metadata_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_object_class_test/source/main.cpp b/source/tests/reflect_object_class_test/source/main.cpp index 718fa2707..cba58797c 100644 --- a/source/tests/reflect_object_class_test/source/main.cpp +++ b/source/tests/reflect_object_class_test/source/main.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_object_class_test/source/reflect_object_class_test.cpp b/source/tests/reflect_object_class_test/source/reflect_object_class_test.cpp index 275713e5f..a0d7e0cc2 100644 --- a/source/tests/reflect_object_class_test/source/reflect_object_class_test.cpp +++ b/source/tests/reflect_object_class_test/source/reflect_object_class_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_scope_test/source/main.cpp b/source/tests/reflect_scope_test/source/main.cpp index 718fa2707..cba58797c 100644 --- a/source/tests/reflect_scope_test/source/main.cpp +++ b/source/tests/reflect_scope_test/source/main.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_scope_test/source/reflect_scope_test.cpp b/source/tests/reflect_scope_test/source/reflect_scope_test.cpp index 528715925..2e58c50b0 100644 --- a/source/tests/reflect_scope_test/source/reflect_scope_test.cpp +++ b/source/tests/reflect_scope_test/source/reflect_scope_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_value_cast_test/source/main.cpp b/source/tests/reflect_value_cast_test/source/main.cpp index 718fa2707..cba58797c 100644 --- a/source/tests/reflect_value_cast_test/source/main.cpp +++ b/source/tests/reflect_value_cast_test/source/main.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_value_cast_test/source/reflect_value_cast_bool_test.cpp b/source/tests/reflect_value_cast_test/source/reflect_value_cast_bool_test.cpp index 49770adaf..988e7a607 100644 --- a/source/tests/reflect_value_cast_test/source/reflect_value_cast_bool_test.cpp +++ b/source/tests/reflect_value_cast_test/source/reflect_value_cast_bool_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_value_cast_test/source/reflect_value_cast_char_test.cpp b/source/tests/reflect_value_cast_test/source/reflect_value_cast_char_test.cpp index 35d20ad94..0bbe2bbec 100644 --- a/source/tests/reflect_value_cast_test/source/reflect_value_cast_char_test.cpp +++ b/source/tests/reflect_value_cast_test/source/reflect_value_cast_char_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_value_cast_test/source/reflect_value_cast_double_test.cpp b/source/tests/reflect_value_cast_test/source/reflect_value_cast_double_test.cpp index 7d7fad6cb..899135273 100644 --- a/source/tests/reflect_value_cast_test/source/reflect_value_cast_double_test.cpp +++ b/source/tests/reflect_value_cast_test/source/reflect_value_cast_double_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_value_cast_test/source/reflect_value_cast_float_test.cpp b/source/tests/reflect_value_cast_test/source/reflect_value_cast_float_test.cpp index 8c543a381..f1ffedc06 100644 --- a/source/tests/reflect_value_cast_test/source/reflect_value_cast_float_test.cpp +++ b/source/tests/reflect_value_cast_test/source/reflect_value_cast_float_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_value_cast_test/source/reflect_value_cast_int_test.cpp b/source/tests/reflect_value_cast_test/source/reflect_value_cast_int_test.cpp index 9d5a67abb..7e6e2aa35 100644 --- a/source/tests/reflect_value_cast_test/source/reflect_value_cast_int_test.cpp +++ b/source/tests/reflect_value_cast_test/source/reflect_value_cast_int_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_value_cast_test/source/reflect_value_cast_long_test.cpp b/source/tests/reflect_value_cast_test/source/reflect_value_cast_long_test.cpp index fa5ea251a..9258a11e3 100644 --- a/source/tests/reflect_value_cast_test/source/reflect_value_cast_long_test.cpp +++ b/source/tests/reflect_value_cast_test/source/reflect_value_cast_long_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/reflect_value_cast_test/source/reflect_value_cast_short_test.cpp b/source/tests/reflect_value_cast_test/source/reflect_value_cast_short_test.cpp index 48211f3cb..e33d57637 100644 --- a/source/tests/reflect_value_cast_test/source/reflect_value_cast_short_test.cpp +++ b/source/tests/reflect_value_cast_test/source/reflect_value_cast_short_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/serial_test/source/main.cpp b/source/tests/serial_test/source/main.cpp index 718fa2707..cba58797c 100644 --- a/source/tests/serial_test/source/main.cpp +++ b/source/tests/serial_test/source/main.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/tests/serial_test/source/serial_test.cpp b/source/tests/serial_test/source/serial_test.cpp index c2216a5b8..921a417bb 100644 --- a/source/tests/serial_test/source/serial_test.cpp +++ b/source/tests/serial_test/source/serial_test.cpp @@ -2,7 +2,7 @@ * Reflect Library by Parra Studios * A library for provide reflection and metadata representation. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/include/threading/threading.h b/source/threading/include/threading/threading.h index f79566a1b..f0b711481 100644 --- a/source/threading/include/threading/threading.h +++ b/source/threading/include/threading/threading.h @@ -2,7 +2,7 @@ * Thrading Library by Parra Studios * A threading library providing utilities for lock-free data structures and more. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/include/threading/threading_atomic.h b/source/threading/include/threading/threading_atomic.h index a2b870d3a..994ac9757 100644 --- a/source/threading/include/threading/threading_atomic.h +++ b/source/threading/include/threading/threading_atomic.h @@ -2,7 +2,7 @@ * Thrading Library by Parra Studios * A threading library providing utilities for lock-free data structures and more. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/include/threading/threading_atomic_ref_count.h b/source/threading/include/threading/threading_atomic_ref_count.h index 9e152bb0a..165ef565c 100644 --- a/source/threading/include/threading/threading_atomic_ref_count.h +++ b/source/threading/include/threading/threading_atomic_ref_count.h @@ -2,7 +2,7 @@ * Thrading Library by Parra Studios * A threading library providing utilities for lock-free data structures and more. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/include/threading/threading_atomic_win32.h b/source/threading/include/threading/threading_atomic_win32.h index 0686f9a00..00c2055aa 100644 --- a/source/threading/include/threading/threading_atomic_win32.h +++ b/source/threading/include/threading/threading_atomic_win32.h @@ -2,7 +2,7 @@ * Thrading Library by Parra Studios * A threading library providing utilities for lock-free data structures and more. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/include/threading/threading_mutex.h b/source/threading/include/threading/threading_mutex.h index b8762b25c..c9b346c3c 100644 --- a/source/threading/include/threading/threading_mutex.h +++ b/source/threading/include/threading/threading_mutex.h @@ -2,7 +2,7 @@ * Thrading Library by Parra Studios * A threading library providing utilities for lock-free data structures and more. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/include/threading/threading_thread_id.h b/source/threading/include/threading/threading_thread_id.h index 1545e0faa..af111a4fe 100644 --- a/source/threading/include/threading/threading_thread_id.h +++ b/source/threading/include/threading/threading_thread_id.h @@ -2,7 +2,7 @@ * Thrading Library by Parra Studios * A threading library providing utilities for lock-free data structures and more. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/source/threading.c b/source/threading/source/threading.c index 0d82cd305..2d795819f 100644 --- a/source/threading/source/threading.c +++ b/source/threading/source/threading.c @@ -2,7 +2,7 @@ * Thrading Library by Parra Studios * A threading library providing utilities for lock-free data structures and more. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ const char *threading_print_info(void) { static const char threading_info[] = "Threading Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef ADT_STATIC_DEFINE "Compiled as static library type" diff --git a/source/threading/source/threading_mutex_macos.c b/source/threading/source/threading_mutex_macos.c index dbcdd2218..ed4766321 100644 --- a/source/threading/source/threading_mutex_macos.c +++ b/source/threading/source/threading_mutex_macos.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/source/threading_mutex_pthread.c b/source/threading/source/threading_mutex_pthread.c index 3536387eb..4fc161d34 100644 --- a/source/threading/source/threading_mutex_pthread.c +++ b/source/threading/source/threading_mutex_pthread.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/source/threading_mutex_win32.c b/source/threading/source/threading_mutex_win32.c index 19cdef9fe..aefdcfb1e 100644 --- a/source/threading/source/threading_mutex_win32.c +++ b/source/threading/source/threading_mutex_win32.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/threading/source/threading_thread_id.c b/source/threading/source/threading_thread_id.c index e3fa8030b..0edf1db79 100644 --- a/source/threading/source/threading_thread_id.c +++ b/source/threading/source/threading_thread_id.c @@ -2,7 +2,7 @@ * Abstract Data Type Library by Parra Studios * A abstract data type library providing generic containers. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/version/include/version/version.h b/source/version/include/version/version.h index 9c0dbcd3d..eae5523e8 100644 --- a/source/version/include/version/version.h +++ b/source/version/include/version/version.h @@ -2,7 +2,7 @@ * CMake Versioning Utility by Parra Studios * A template for generating versioning utilities. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/version/include/version/version.h.in b/source/version/include/version/version.h.in index 79a37cfd0..69341f7b5 100644 --- a/source/version/include/version/version.h.in +++ b/source/version/include/version/version.h.in @@ -2,7 +2,7 @@ * CMake Versioning Utility by Parra Studios * A template for generating versioning utilities. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/source/version/source/version.c b/source/version/source/version.c index 3dca24831..95cec396c 100644 --- a/source/version/source/version.c +++ b/source/version/source/version.c @@ -2,7 +2,7 @@ * CMake Versioning Utility by Parra Studios * A template for generating versioning utilities. * - * Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ const char *version_print_info(void) { static const char version_info[] = "Version Library " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" #ifdef ADT_STATIC_DEFINE "Compiled as static library type" diff --git a/tools/cli/Dockerfile b/tools/cli/Dockerfile index ee1eaa943..fed409c5e 100644 --- a/tools/cli/Dockerfile +++ b/tools/cli/Dockerfile @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker image infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/deps/Dockerfile b/tools/deps/Dockerfile index aa4ba69fe..342bef8de 100644 --- a/tools/deps/Dockerfile +++ b/tools/deps/Dockerfile @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker image infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/dev/Dockerfile b/tools/dev/Dockerfile index 022c4703a..9f5805944 100644 --- a/tools/dev/Dockerfile +++ b/tools/dev/Dockerfile @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker image infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/metacall-build.ps1 b/tools/metacall-build.ps1 index 483caa2ed..ec95a2dd8 100755 --- a/tools/metacall-build.ps1 +++ b/tools/metacall-build.ps1 @@ -2,7 +2,7 @@ # MetaCall Build PowerShell Script by Parra Studios # Build and install powershell script utility for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/metacall-build.sh b/tools/metacall-build.sh index d2074c1af..74826e22f 100755 --- a/tools/metacall-build.sh +++ b/tools/metacall-build.sh @@ -4,7 +4,7 @@ # MetaCall Build Shell Script by Parra Studios # Build and install shell script utility for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/metacall-configure.ps1 b/tools/metacall-configure.ps1 index bcfaf74cf..ea3928e66 100755 --- a/tools/metacall-configure.ps1 +++ b/tools/metacall-configure.ps1 @@ -2,7 +2,7 @@ # MetaCall Build PowerShell Script by Parra Studios # Build and install powershell script utility for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/metacall-configure.sh b/tools/metacall-configure.sh index 206bc1e47..0360f472f 100755 --- a/tools/metacall-configure.sh +++ b/tools/metacall-configure.sh @@ -4,7 +4,7 @@ # MetaCall Build Shell Script by Parra Studios # Build and install shell script utility for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index dd2191520..8d60574a7 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -2,7 +2,7 @@ # MetaCall Build PowerShell Script by Parra Studios # Build and install powershell script utility for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 28c9a6934..5735bc28a 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -4,7 +4,7 @@ # MetaCall Configuration Environment Shell Script by Parra Studios # Configure and install MetaCall environment script utility. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/metacall-license.sh b/tools/metacall-license.sh index 31c82f7b9..2be232899 100755 --- a/tools/metacall-license.sh +++ b/tools/metacall-license.sh @@ -4,7 +4,7 @@ # MetaCall License Bash Script by Parra Studios # License bash script utility for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ find "$EXEC_PATH" -type f \ -exec sh -c ' \ # Copyright - COPYRIGHT="Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>$" + COPYRIGHT="Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>$" # License LICENSE=$(cat <<-END diff --git a/tools/metacall-runtime.sh b/tools/metacall-runtime.sh index aad251243..aea5bab16 100755 --- a/tools/metacall-runtime.sh +++ b/tools/metacall-runtime.sh @@ -4,7 +4,7 @@ # MetaCall Configuration Environment Shell Script by Parra Studios # Configure and install MetaCall environment script utility. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/metacall-sanitizer.sh b/tools/metacall-sanitizer.sh index 81ca40a4a..49677c734 100755 --- a/tools/metacall-sanitizer.sh +++ b/tools/metacall-sanitizer.sh @@ -4,7 +4,7 @@ # MetaCall Sanitizer Bash Script by Parra Studios # Install, build and sanitizer test bash script utility for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/runtime/Dockerfile b/tools/runtime/Dockerfile index 355e48397..1276b7e11 100644 --- a/tools/runtime/Dockerfile +++ b/tools/runtime/Dockerfile @@ -2,7 +2,7 @@ # MetaCall Library by Parra Studios # Docker image infrastructure for MetaCall. # -# Copyright (C) 2016 - 2024 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 830bb3b637c90fc7f5d8f77336f00cb51d90bdde Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Mar 2025 18:26:59 +0100 Subject: [PATCH 202/487] Extended dynlink for getting symbols of the executable. --- source/dynlink/include/dynlink/dynlink.h | 24 ++++ .../dynlink/include/dynlink/dynlink_flags.h | 2 + source/dynlink/source/dynlink.c | 40 +++++- source/dynlink/source/dynlink_impl_beos.c | 36 +++-- source/dynlink/source/dynlink_impl_macos.c | 135 ++++++++++++------ source/dynlink/source/dynlink_impl_unix.c | 29 ++-- source/dynlink/source/dynlink_impl_win32.c | 26 +++- .../dynlink_test/source/dynlink_test.cpp | 37 ++++- 8 files changed, 260 insertions(+), 69 deletions(-) diff --git a/source/dynlink/include/dynlink/dynlink.h b/source/dynlink/include/dynlink/dynlink.h index 28080638a..57bea7ab5 100644 --- a/source/dynlink/include/dynlink/dynlink.h +++ b/source/dynlink/include/dynlink/dynlink.h @@ -78,6 +78,18 @@ DYNLINK_API dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_f */ DYNLINK_API dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags); +/** +* @brief +* Get the reference of the current process +* +* @param[in] flags +* Dynamic linking flags +* +* @return +* A handle to the current process +*/ +DYNLINK_API dynlink dynlink_load_self(dynlink_flags flags); + /** * @brief * Retreive the name of the dynamically linked shared object @@ -114,6 +126,18 @@ DYNLINK_API dynlink_name dynlink_get_name_impl(dynlink handle); */ DYNLINK_API dynlink_flags dynlink_get_flags(dynlink handle); +/** +* @brief +* Retreive the internal representation of the dynamically linked shared object +* +* @param[in] handle +* Handle of dynamically linked shared object +* +* @return +* The implementation dependant handle representing the dynamically linked shared object +*/ +DYNLINK_API dynlink_impl dynlink_get_impl(dynlink handle); + /** * @brief * Get a symbol address of dynamically linked shared object by name diff --git a/source/dynlink/include/dynlink/dynlink_flags.h b/source/dynlink/include/dynlink/dynlink_flags.h index 2f64619e7..f72708a27 100644 --- a/source/dynlink/include/dynlink/dynlink_flags.h +++ b/source/dynlink/include/dynlink/dynlink_flags.h @@ -36,6 +36,8 @@ extern "C" { #define DYNLINK_FLAGS_BIND_LOCAL (0x01 << 0x02) /**< Private visibility bind flag */ #define DYNLINK_FLAGS_BIND_GLOBAL (0x01 << 0x03) /**< Public visibility bind flag */ +#define DYNLINK_FLAGS_BIND_SELF (0x01 << 0x10) /**< Private flag for when loading the current process */ + /* -- Macros -- */ /** diff --git a/source/dynlink/source/dynlink.c b/source/dynlink/source/dynlink.c index 16266c163..57a70b238 100644 --- a/source/dynlink/source/dynlink.c +++ b/source/dynlink/source/dynlink.c @@ -25,6 +25,7 @@ #include <dynlink/dynlink.h> #include <dynlink/dynlink_impl.h> +#include <portability/portability_executable_path.h> #include <portability/portability_path.h> #include <stdlib.h> @@ -74,7 +75,7 @@ dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_flags flags) strncpy(handle->name_impl, name_impl, strnlen(name_impl, PORTABILITY_PATH_SIZE) + 1); } - handle->flags = flags; + DYNLINK_FLAGS_SET(handle->flags, flags); handle->impl = dynlink_impl_load(handle); @@ -101,7 +102,7 @@ dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags) strncpy(handle->name_impl, path, strnlen(path, PORTABILITY_PATH_SIZE) + 1); - handle->flags = flags; + DYNLINK_FLAGS_SET(handle->flags, flags); handle->impl = dynlink_impl_load(handle); @@ -114,6 +115,31 @@ dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags) return handle; } +dynlink dynlink_load_self(dynlink_flags flags) +{ + portability_executable_path_length path_length; + dynlink handle = malloc(sizeof(struct dynlink_type)); + + if (handle == NULL) + { + return NULL; + } + + portability_executable_path(handle->name_impl, &path_length); + portability_path_get_name(handle->name_impl, path_length + 1, handle->name, PORTABILITY_PATH_SIZE); + DYNLINK_FLAGS_SET(handle->flags, flags); + DYNLINK_FLAGS_ADD(handle->flags, DYNLINK_FLAGS_BIND_SELF); + handle->impl = dynlink_impl_load(handle); + + if (handle->impl == NULL) + { + free(handle); + return NULL; + } + + return handle; +} + dynlink_name dynlink_get_name(dynlink handle) { if (handle != NULL) @@ -144,6 +170,16 @@ dynlink_flags dynlink_get_flags(dynlink handle) return 0; } +dynlink_impl dynlink_get_impl(dynlink handle) +{ + if (handle != NULL) + { + return handle->impl; + } + + return NULL; +} + int dynlink_symbol(dynlink handle, dynlink_symbol_name symbol_name, dynlink_symbol_addr *symbol_address) { if (handle != NULL && handle->impl != NULL && symbol_name != NULL && symbol_address != NULL) diff --git a/source/dynlink/source/dynlink_impl_beos.c b/source/dynlink/source/dynlink_impl_beos.c index 7f9adbbae..6a5e225f1 100644 --- a/source/dynlink/source/dynlink_impl_beos.c +++ b/source/dynlink/source/dynlink_impl_beos.c @@ -52,23 +52,33 @@ void dynlink_impl_interface_get_name_beos(dynlink_name name, dynlink_name_impl n dynlink_impl dynlink_impl_interface_load_beos(dynlink handle) { dynlink_flags flags = dynlink_get_flags(handle); + image_id impl = 0; - int flags_impl; - - image_id impl; + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) + { + image_info info; + int32 cookie = 0; - DYNLINK_FLAGS_SET(flags_impl, 0); + if (get_next_image_info(0, &cookie, &info) != B_OK) + { + log_write("metacall", LOG_LEVEL_ERROR, "DynLink error: failed to load BeOS/Haiku image add-on on current executable"); + return NULL; + } - impl = load_add_on(dynlink_get_name_impl(handle)); + impl = load_add_on(info.name); + } + else + { + impl = load_add_on(dynlink_get_name_impl(handle)); + } if (impl < B_NO_ERROR) { - return (dynlink_impl)impl; + log_write("metacall", LOG_LEVEL_ERROR, "DynLink error: failed to load BeOS/Haiku image add-on with error code %d", (int)impl); + return NULL; } - log_write("metacall", LOG_LEVEL_ERROR, "DynLink error: failed to load BeOS/Haiku image add-on"); - - return NULL; + return (dynlink_impl)impl; } int dynlink_impl_interface_symbol_beos(dynlink handle, dynlink_impl impl, dynlink_symbol_name name, dynlink_symbol_addr *addr) @@ -92,8 +102,16 @@ int dynlink_impl_interface_symbol_beos(dynlink handle, dynlink_impl impl, dynlin int dynlink_impl_interface_unload_beos(dynlink handle, dynlink_impl impl) { + dynlink_flags flags = dynlink_get_flags(handle); + (void)handle; + /* Skip unlink when using global handle for loading symbols of the current process */ + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) + { + return 0; + } + #if defined(__MEMORYCHECK__) || defined(__ADDRESS_SANITIZER__) || defined(__THREAD_SANITIZER__) || defined(__MEMORY_SANITIZER__) /* Disable dlclose when running with address sanitizer in order to maintain stacktraces */ (void)impl; diff --git a/source/dynlink/source/dynlink_impl_macos.c b/source/dynlink/source/dynlink_impl_macos.c index 4cfe04209..b09c8e078 100644 --- a/source/dynlink/source/dynlink_impl_macos.c +++ b/source/dynlink/source/dynlink_impl_macos.c @@ -32,6 +32,10 @@ #include <unistd.h> +/* -- Member Data -- */ + +static void *dynlink_impl_global_handle_macos = NULL; + /* -- Methods -- */ const char *dynlink_impl_interface_extension_macos(void) @@ -53,65 +57,69 @@ void dynlink_impl_interface_get_name_macos(dynlink_name name, dynlink_name_impl dynlink_impl dynlink_impl_interface_load_macos(dynlink handle) { dynlink_flags flags = dynlink_get_flags(handle); - - unsigned long flags_impl; - - NSObjectFileImage image; - NSModule impl; - const char *name = dynlink_get_name_impl(handle); - - NSObjectFileImageReturnCode ret = NSCreateObjectFileImageFromFile(name, &image); - - if (ret != NSObjectFileImageSuccess) + if (!DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) { - char *error; + unsigned long flags_impl; + NSObjectFileImage image; + const char *name = dynlink_get_name_impl(handle); + NSObjectFileImageReturnCode ret = NSCreateObjectFileImageFromFile(name, &image); - switch (ret) + if (ret != NSObjectFileImageSuccess) { - case NSObjectFileImageAccess: - if (access(name, F_OK) == 0) - { - error = "DynLink error: %s permission denied"; - } - else - { - error = "DynLink error: %s no such file or directory"; - } - case NSObjectFileImageArch: - error = "DynLink error: %s is not built for the current architecture"; - break; - case NSObjectFileImageInappropriateFile: - case NSObjectFileImageFormat: - error = "DynLink error: %s is not a loadable module"; - break; - default: - error = "DynLink error: unknown error for %s"; - break; + char *error; + + switch (ret) + { + case NSObjectFileImageAccess: + if (access(name, F_OK) == 0) + { + error = "DynLink error: %s permission denied"; + } + else + { + error = "DynLink error: %s no such file or directory"; + } + case NSObjectFileImageArch: + error = "DynLink error: %s is not built for the current architecture"; + break; + case NSObjectFileImageInappropriateFile: + case NSObjectFileImageFormat: + error = "DynLink error: %s is not a loadable module"; + break; + default: + error = "DynLink error: unknown error for %s"; + break; + } + + log_write("metacall", LOG_LEVEL_ERROR, error, name); + + return NULL; } - log_write("metacall", LOG_LEVEL_ERROR, error, name); + DYNLINK_FLAGS_SET(flags_impl, NSLINKMODULE_OPTION_RETURN_ON_ERROR); - return NULL; - } + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_LOCAL)) + { + DYNLINK_FLAGS_ADD(flags_impl, NSLINKMODULE_OPTION_PRIVATE); + } + + if (!DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_LAZY)) + { + DYNLINK_FLAGS_ADD(flags_impl, NSLINKMODULE_OPTION_BINDNOW); + } - DYNLINK_FLAGS_SET(flags_impl, NSLINKMODULE_OPTION_RETURN_ON_ERROR); + impl = NSLinkModule(image, name, flags_impl); - if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_LOCAL)) - { - DYNLINK_FLAGS_ADD(flags_impl, NSLINKMODULE_OPTION_PRIVATE); + NSDestroyObjectFileImage(image); } - - if (!DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_LAZY)) + else { - DYNLINK_FLAGS_ADD(flags_impl, NSLINKMODULE_OPTION_BINDNOW); + /* We return this for identifying the global handle when loading symbols of the current process */ + impl = (void *)(&dynlink_impl_global_handle_macos); } - impl = NSLinkModule(image, name, flags_impl); - - NSDestroyObjectFileImage(image); - if (impl == NULL) { NSLinkEditErrors link_edit_errors; @@ -132,11 +140,30 @@ dynlink_impl dynlink_impl_interface_load_macos(dynlink handle) int dynlink_impl_interface_symbol_macos(dynlink handle, dynlink_impl impl, dynlink_symbol_name name, dynlink_symbol_addr *addr) { - NSSymbol symbol = NSLookupSymbolInModule(impl, name); - void *symbol_addr = NSAddressOfSymbol(symbol); + dynlink_flags flags = dynlink_get_flags(handle); + NSSymbol symbol; + void *symbol_addr; (void)handle; + /* Skip unlink when using global handle for loading symbols of the current process */ + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) + { + /* Global context, use NSLookupAndBindSymbol */ + if (!NSIsSymbolNameDefined(name)) + { + return 1; + } + + symbol = NSLookupAndBindSymbol(name); + } + else + { + symbol = NSLookupSymbolInModule(impl, name); + } + + symbol_addr = NSAddressOfSymbol(symbol); + dynlink_symbol_cast(void *, symbol_addr, *addr); return (*addr == NULL); @@ -144,9 +171,23 @@ int dynlink_impl_interface_symbol_macos(dynlink handle, dynlink_impl impl, dynli int dynlink_impl_interface_unload_macos(dynlink handle, dynlink_impl impl) { + dynlink_flags flags = dynlink_get_flags(handle); + (void)handle; + /* Skip unlink when using global handle for loading symbols of the current process */ + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) + { + return 0; + } + +#if defined(__MEMORYCHECK__) || defined(__ADDRESS_SANITIZER__) || defined(__THREAD_SANITIZER__) || defined(__MEMORY_SANITIZER__) + /* Disable dlclose when running with address sanitizer in order to maintain stacktraces */ + (void)impl; + return 0; +#else return NSUnLinkModule(impl, 0) == TRUE ? 0 : 1; +#endif } dynlink_impl_interface dynlink_impl_interface_singleton(void) diff --git a/source/dynlink/source/dynlink_impl_unix.c b/source/dynlink/source/dynlink_impl_unix.c index 8892797f9..0354ecce7 100644 --- a/source/dynlink/source/dynlink_impl_unix.c +++ b/source/dynlink/source/dynlink_impl_unix.c @@ -60,9 +60,7 @@ void dynlink_impl_interface_get_name_unix(dynlink_name name, dynlink_name_impl n dynlink_impl dynlink_impl_interface_load_unix(dynlink handle) { dynlink_flags flags = dynlink_get_flags(handle); - int flags_impl; - void *impl; DYNLINK_FLAGS_SET(flags_impl, 0); @@ -87,16 +85,23 @@ dynlink_impl dynlink_impl_interface_load_unix(dynlink handle) DYNLINK_FLAGS_ADD(flags_impl, RTLD_GLOBAL); } - impl = dlopen(dynlink_get_name_impl(handle), flags_impl); - - if (impl != NULL) + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) { - return (dynlink_impl)impl; + impl = dlopen(NULL, flags_impl); + } + else + { + impl = dlopen(dynlink_get_name_impl(handle), flags_impl); } - log_write("metacall", LOG_LEVEL_ERROR, "DynLink error: %s", dlerror()); + if (impl == NULL) + { + log_write("metacall", LOG_LEVEL_ERROR, "DynLink error: %s", dlerror()); - return NULL; + return NULL; + } + + return (dynlink_impl)impl; } int dynlink_impl_interface_symbol_unix(dynlink handle, dynlink_impl impl, dynlink_symbol_name name, dynlink_symbol_addr *addr) @@ -112,8 +117,16 @@ int dynlink_impl_interface_symbol_unix(dynlink handle, dynlink_impl impl, dynlin int dynlink_impl_interface_unload_unix(dynlink handle, dynlink_impl impl) { + dynlink_flags flags = dynlink_get_flags(handle); + (void)handle; + /* Skip unlink when using global handle for loading symbols of the current process */ + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) + { + return 0; + } + #if defined(__MEMORYCHECK__) || defined(__ADDRESS_SANITIZER__) || defined(__THREAD_SANITIZER__) || defined(__MEMORY_SANITIZER__) /* Disable dlclose when running with valgrind or sanitizers in order to maintain stacktraces */ (void)impl; diff --git a/source/dynlink/source/dynlink_impl_win32.c b/source/dynlink/source/dynlink_impl_win32.c index 8009aea54..5d0af2a0e 100644 --- a/source/dynlink/source/dynlink_impl_win32.c +++ b/source/dynlink/source/dynlink_impl_win32.c @@ -56,7 +56,17 @@ void dynlink_impl_interface_get_name_win32(dynlink_name name, dynlink_name_impl dynlink_impl dynlink_impl_interface_load_win32(dynlink handle) { - HANDLE impl = LoadLibrary(dynlink_get_name_impl(handle)); + HMODULE impl; + dynlink_flags flags = dynlink_get_flags(handle); + + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) + { + impl = GetModuleHandle(NULL); + } + else + { + impl = LoadLibrary(dynlink_get_name_impl(handle)); + } if (impl == NULL) { @@ -89,9 +99,23 @@ int dynlink_impl_interface_symbol_win32(dynlink handle, dynlink_impl impl, dynli int dynlink_impl_interface_unload_win32(dynlink handle, dynlink_impl impl) { + dynlink_flags flags = dynlink_get_flags(handle); + (void)handle; + /* Skip unlink when using global handle for loading symbols of the current process */ + if (DYNLINK_FLAGS_CHECK(flags, DYNLINK_FLAGS_BIND_SELF)) + { + return 0; + } + +#if defined(__MEMORYCHECK__) || defined(__ADDRESS_SANITIZER__) || defined(__THREAD_SANITIZER__) || defined(__MEMORY_SANITIZER__) + /* Disable dlclose when running with address sanitizer in order to maintain stacktraces */ + (void)impl; + return 0; +#else return (FreeLibrary(impl) == FALSE); +#endif } dynlink_impl_interface dynlink_impl_interface_singleton(void) diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index ed6aec997..ae8813715 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -35,6 +35,19 @@ class dynlink_test : public testing::Test protected: }; +#ifdef _WIN32 + #define EXPORT_SYMBOL __declspec(dllexport) +#else + #define EXPORT_SYMBOL __attribute__((visibility("default"))) +#endif + +extern "C" EXPORT_SYMBOL int function_from_current_executable(void) +{ + log_write("metacall", LOG_LEVEL_INFO, "function_from_current_executable"); + + return 48; +} + TEST_F(dynlink_test, DefaultConstructor) { EXPECT_EQ((int)0, (int)log_configure("metacall", @@ -47,6 +60,7 @@ TEST_F(dynlink_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object extension: %s", dynlink_extension()); + /* Test library loading */ { #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) const char library_name[] = "mock_loaderd"; @@ -60,13 +74,13 @@ TEST_F(dynlink_test, DefaultConstructor) environment_variable_path_destroy(path); - EXPECT_NE(handle, (dynlink)NULL); + ASSERT_NE(handle, (dynlink)NULL); log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_name_impl(handle)); if (handle != NULL) { - static dynlink_symbol_addr mock_loader_print_info_addr; + dynlink_symbol_addr mock_loader_print_info_addr; EXPECT_EQ((int)0, dynlink_symbol(handle, "mock_loader_print_info", &mock_loader_print_info_addr)); @@ -89,4 +103,23 @@ TEST_F(dynlink_test, DefaultConstructor) dynlink_unload(handle); } } + + /* Test loading symbols from current process */ + { + dynlink proc = dynlink_load_self(DYNLINK_FLAGS_BIND_GLOBAL | DYNLINK_FLAGS_BIND_LAZY); + + ASSERT_NE((dynlink)proc, (dynlink)(NULL)); + + dynlink_symbol_addr addr; + + EXPECT_EQ((int)0, dynlink_symbol(proc, "function_from_current_executable", &addr)); + + ASSERT_NE((dynlink)proc, (dynlink)(NULL)); + + int (*fn_ptr)(void) = (int (*)(void))addr; + + EXPECT_EQ((int)48, fn_ptr()); + + dynlink_unload(proc); /* Should do nothing except by freeing the handle */ + } } From a50b5a98cb84ad679a0dc97d5b941961638cc044 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 25 Mar 2025 21:37:04 +0100 Subject: [PATCH 203/487] Add base of plthook. --- .github/workflows/benchmark.yml | 2 - .github/workflows/macos-test.yml | 4 +- .github/workflows/windows-test.yml | 2 +- NOTICE | 10 +- docker-compose.test.yml | 2 +- docker-compose.yml | 2 +- docs/README.md | 8 +- source/detour/include/detour/detour.h | 90 +++++++++-- .../detour/include/detour/detour_interface.h | 13 +- source/detour/source/detour.c | 113 +++++++++---- source/detours/CMakeLists.txt | 4 +- .../funchook_detour/funchook_detour_impl.h | 92 ----------- .../funchook_detour/source/funchook_detour.c | 45 ------ .../source/funchook_detour_impl.c | 78 --------- .../CMakeLists.txt | 83 +++------- .../include/plthook_detour/plthook_detour.h} | 12 +- .../plthook_detour/plthook_detour_impl.h | 151 ++++++++++++++++++ .../plthook_detour/source/plthook_detour.c | 48 ++++++ .../source/plthook_detour_impl.c | 122 ++++++++++++++ source/dynlink/source/dynlink_impl_unix.c | 3 + source/metacall/source/metacall.c | 2 +- source/tests/detour_test/CMakeLists.txt | 10 +- .../tests/detour_test/source/detour_test.cpp | 31 ++-- .../tests/metacall_fork_test/CMakeLists.txt | 2 +- tools/metacall-environment.ps1 | 4 - tools/metacall-environment.sh | 15 -- tools/metacall-sanitizer.sh | 2 +- 27 files changed, 567 insertions(+), 383 deletions(-) delete mode 100644 source/detours/funchook_detour/include/funchook_detour/funchook_detour_impl.h delete mode 100644 source/detours/funchook_detour/source/funchook_detour.c delete mode 100644 source/detours/funchook_detour/source/funchook_detour_impl.c rename source/detours/{funchook_detour => plthook_detour}/CMakeLists.txt (50%) rename source/detours/{funchook_detour/include/funchook_detour/funchook_detour.h => plthook_detour/include/plthook_detour/plthook_detour.h} (80%) create mode 100644 source/detours/plthook_detour/include/plthook_detour/plthook_detour_impl.h create mode 100644 source/detours/plthook_detour/source/plthook_detour.c create mode 100644 source/detours/plthook_detour/source/plthook_detour_impl.c diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 33349ce4d..928da375a 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -56,12 +56,10 @@ jobs: - name: Build working-directory: ./build - # TODO: Remove the disable option for fork safe once funchook problem is solved run: | if [ "$(uname)" == "Darwin" ]; then . .env fi - cmake -DOPTION_FORK_SAFE=OFF .. bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS env: METACALL_BUILD_OPTIONS: release benchmarks diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 64a768757..c98f66f09 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -77,7 +77,7 @@ jobs: - name: Set up the environment run: sh ./tools/metacall-environment.sh $METACALL_INSTALL_OPTIONS env: - METACALL_INSTALL_OPTIONS: base python nodejs typescript java ruby wasm rpc file cobol go backtrace #netcore5 c rust rapidjson funchook swig pack # clangformat v8rep51 coverage + METACALL_INSTALL_OPTIONS: base python nodejs typescript java ruby wasm rpc file cobol go backtrace #netcore5 c rust rapidjson swig pack # clangformat v8rep51 coverage - name: Configure run: | @@ -89,10 +89,8 @@ jobs: - name: Build working-directory: ./build - # TODO: Remove the disable option for fork safe once funchook problem is solved run: | . .env - cmake -DOPTION_FORK_SAFE=OFF .. bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS env: METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index c7af6e0ee..c1a423616 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -48,7 +48,7 @@ jobs: - name: Set up the environment run: cmd.exe /c "powershell .\tools\metacall-environment.ps1 $Env:METACALL_INSTALL_OPTIONS" env: - METACALL_INSTALL_OPTIONS: python nodejs java ruby typescript wasm rpc file # netcore5 java c cobol rust rapidjson funchook swig pack # clangformat v8rep51 coverage + METACALL_INSTALL_OPTIONS: python nodejs java ruby typescript wasm rpc file # netcore5 java c cobol rust rapidjson swig pack # clangformat v8rep51 coverage - name: Configure run: | diff --git a/NOTICE b/NOTICE index 64d3172e0..e584ab4a7 100644 --- a/NOTICE +++ b/NOTICE @@ -19,7 +19,7 @@ All external code and licenses used by **METACALL** are always wrapped into plug - [2. Serials](#2-serials) - [2.1 RapidJSON](#21-rapidjson) - [3. Detours](#3-detours) - - [3.1 FuncHook](#31-funchook) + - [3.1 PLTHook](#31-fookhook) - [4. Ports](#4-ports) - [4.1 Swig](#41-swig) @@ -80,11 +80,11 @@ All external code and licenses used by **METACALL** are always wrapped into plug ## 3. Detours -### 3.1 FuncHook +### 3.1 PLTHook -| Software | License | -| :----------: | :-------------------------------------------------------------------------------------------------: | -| **FuncHook** | [GPLv2 or later with a GPL linking exception](https://github.com/kubo/funchook/blob/master/LICENSE) | +| Software | License | +| :----------: | :------------------------------------------------------------------------------------------: | +| **PLTHook** | [2-clause BSD-style license](https://github.com/metacall/plthook?tab=readme-ov-file#license) | ## 4. Ports diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 5dadee3cb..0834f67a0 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -25,7 +25,7 @@ services: build: args: METACALL_BUILD_TYPE: ${METACALL_BUILD_TYPE} - METACALL_INSTALL_OPTIONS: base python ruby netcore7 nodejs typescript file rpc wasm java c cobol go rust rapidjson funchook swig pack backtrace sandbox ${METACALL_BUILD_COVERAGE} # clangformat v8rep51 + METACALL_INSTALL_OPTIONS: base python ruby netcore7 nodejs typescript file rpc wasm java c cobol go rust rapidjson swig pack backtrace sandbox ${METACALL_BUILD_COVERAGE} # clangformat v8rep51 dev: image: metacall/core:dev build: diff --git a/docker-compose.yml b/docker-compose.yml index 38e167b44..ff548ba2a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,7 +31,7 @@ services: METACALL_PATH: $METACALL_PATH METACALL_TOOLS_PATH: $METACALL_PATH/tools METACALL_BUILD_TYPE: $METACALL_BUILD_TYPE - METACALL_INSTALL_OPTIONS: base python ruby nodejs typescript file rpc rapidjson funchook swig pack backtrace # clangformat v8rep51 coverage + METACALL_INSTALL_OPTIONS: base python ruby nodejs typescript file rpc rapidjson swig pack backtrace # clangformat v8rep51 coverage environment: DEBIAN_FRONTEND: noninteractive # Work around https://github.com/dotnet/cli/issues/1582 until Docker releases a diff --git a/docs/README.md b/docs/README.md index 446569788..3c348b9f8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -66,7 +66,7 @@ Use the [installer](https://github.com/metacall/install) and try [some examples] - [5.3.2.1 MetaCall](#5321-metacall) - [5.3.2.2 RapidJSON](#5322-rapidjson) - [5.3.3 Detours](#533-detours) - - [5.3.3.1 FuncHook](#5331-funchook) + - [5.3.3.1 PLTHook](#5331-plthook) - [5.4 Ports](#54-ports) - [5.5 Serialization](#55-serialization) - [5.6 Memory Layout](#56-memory-layout) @@ -251,7 +251,7 @@ The environment variables are optional, in case you want to modify default paths - [`detours`](/source/detours) implement the [`detour`](/source/detour) interface by using a plugin architecture. The current list of available detour plugins is the following one. - - [`funchook_detour`](/source/detours/funchook_detour) implemented by means of FuncHook library. + - [`plthook_detour`](/source/detours/plthook_detour) implemented by means of PLTHook library. - [`dynlink`](/source/dynlink) implements a cross-platform method to dynamically load libraries. It is used to dynamically load plugins into **METACALL**. @@ -499,7 +499,7 @@ A loader must implement it to be considered a valid loader. #### 5.3.3 Detours -##### 5.3.3.1 FuncHook +##### 5.3.3.1 PLTHook ### 5.4 Ports @@ -666,7 +666,7 @@ It is possible to enable or disable concrete loaders, script, ports, serials or | **OPTION*BUILD_LOADERS*** | `C` `JS` `CS` `MOCK` `PY` `JSM` `NODE` `RB` `FILE` | | **OPTION*BUILD_SCRIPTS*** | `C` `CS` `JS` `NODE` `PY` `RB` `JAVA` | | **OPTION*BUILD_SERIALS*** | `METACALL` `RAPID_JSON` | -| **OPTION*BUILD_DETOURS*** | `FUNCHOOK` | +| **OPTION*BUILD_DETOURS*** | `PLTHOOK` | | **OPTION*BUILD_PORTS*** | `CS` `CXX` `D` `GO` `JAVA` `JS` `LUA` `NODE` `PHP` `PL` `PY` `R` `RB` | To format the entire C/C++ codebase use: diff --git a/source/detour/include/detour/detour.h b/source/detour/include/detour/detour.h index fca7d3ee1..fd0cc20a1 100644 --- a/source/detour/include/detour/detour.h +++ b/source/detour/include/detour/detour.h @@ -40,7 +40,7 @@ DETOUR_API int detour_initialize(void); * Create detour by @name * * @param[in] name -* Plugin will be used to detourize and detourize +* Plugin will be used for hooking * * @return * Pointer to detour on correct initialization, null otherwise @@ -63,35 +63,77 @@ DETOUR_API const char *detour_name(detour d); /** * @brief -* Get trampoline of the detour +* Initialize the detour of a library from @path * -* @param[in] handle -* Reference to the detour handle +* @param[in] d +* Reference to the detour +* +* @param[in] path +* String to the path or name of the library, in case of NULL, the current process will be used * * @return -* Pointer to the trampoline function +* Pointer to the detour handle * */ -DETOUR_API void (*detour_trampoline(detour_handle handle))(void); +DETOUR_API detour_handle detour_load_file(detour d, const char *path); /** * @brief -* Install detour from @target to @hook +* Initialize the detour of a library from @library dynlink handle * * @param[in] d * Reference to the detour * -* @param[in] target -* Reference to the function to be hooked +* @param[in] library +* Pointer to the library already opened by dynlink +* +* @return +* Pointer to the detour handle +* +*/ +DETOUR_API detour_handle detour_load_handle(detour d, dynlink library); + +/** +* @brief +* Initialize the detour of a library from @address, this function pointer +* must be a pointer to a function of the library that we want to hook +* +* @param[in] d +* Reference to the detour * -* @param[in] hook -* Reference to the function will be called instead of @target +* @param[in] address +* Pointer to a function of the library we want to hook * * @return * Pointer to the detour handle * */ -DETOUR_API detour_handle detour_install(detour d, void (*target)(void), void (*hook)(void)); +DETOUR_API detour_handle detour_load_address(detour d, void (*address)(void)); + +/** +* @brief +* Iterate all symbols of the library already opened +* +* @param[in] d +* Reference to the detour +* +* @param[in] handle +* Pointer to the detour hook implementation +* +* @param[out] position +* Pointer to the current index of the enumeration +* +* @param[out] name +* Pointer to the function name in string form +* +* @param[out] address +* Pointer to the pointer of the function pointer of the function to be hooked +* +* @return +* Return zero on success, different from zero otherwise +* +*/ +DETOUR_API int detour_enumerate(detour d, detour_handle handle, unsigned int *position, const char **name, void (***address)(void)); /** * @brief @@ -103,11 +145,33 @@ DETOUR_API detour_handle detour_install(detour d, void (*target)(void), void (*h * @param[in] handle * Reference to the detour handle * +* @param[in] function_name +* Function name to be hooked, it must belong to the library +* +* @param[in] function_addr +* Function pointer to the function that will replace the original function from the library +* +* @param[out] function_trampoline +* Function pointer to the original function from the library that will be replaced +* * @return * Return zero if success, different from zero otherwise * */ -DETOUR_API int detour_uninstall(detour d, detour_handle handle); +int detour_replace(detour d, detour_handle handle, const char *function_name, void (*function_addr)(void), void (**function_trampoline)(void)); + +/** +* @brief +* Destroy detour handle previously loaded by detour_load_* functions +* +* @param[in] d +* Reference to the detour +* +* @param[in] handle +* Reference to the detour handle +* +*/ +void detour_unload(detour d, detour_handle handle); /** * @brief diff --git a/source/detour/include/detour/detour_interface.h b/source/detour/include/detour/detour_interface.h index 5207622ba..d4ac5b5e8 100644 --- a/source/detour/include/detour/detour_interface.h +++ b/source/detour/include/detour/detour_interface.h @@ -25,6 +25,8 @@ #include <detour/detour_api.h> +#include <dynlink/dynlink.h> + #ifdef __cplusplus extern "C" { #endif @@ -42,10 +44,13 @@ typedef struct detour_interface_type *detour_interface; struct detour_interface_type { - detour_impl_handle (*initialize)(void); - int (*install)(detour_impl_handle, void (**)(void), void (*)(void)); - int (*uninstall)(detour_impl_handle); - int (*destroy)(detour_impl_handle); + int (*initialize_file)(detour_impl_handle *, const char *); + int (*initialize_handle)(detour_impl_handle *, dynlink); + int (*initialize_address)(detour_impl_handle *, void (*)(void)); + int (*enumerate)(detour_impl_handle, unsigned int *, const char **, void ***); + int (*replace)(detour_impl_handle, const char *, void (*)(void), void **); + const char *(*error)(detour_impl_handle); + void (*destroy)(detour_impl_handle); }; #ifdef __cplusplus diff --git a/source/detour/source/detour.c b/source/detour/source/detour.c index 9da330372..58c81e892 100644 --- a/source/detour/source/detour.c +++ b/source/detour/source/detour.c @@ -34,7 +34,11 @@ static plugin_manager_declare(detour_manager); struct detour_handle_type { - void (*target)(void); + /* TODO: Implement hash map for holding the symbol table? */ + /* TODO: Optimize the replace process by exposing the internal replace function + * and store all the symbols in the hash table then iterate and replace at the + * same time, so the functions are accessed in O(1) instead of O(n) + */ detour_impl_handle impl; }; @@ -65,37 +69,59 @@ const char *detour_name(detour d) return plugin_name(d); } -void (*detour_trampoline(detour_handle handle))(void) +detour_handle detour_load_file(detour d, const char *path) { + detour_handle handle; + + if (d == NULL) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour load arguments"); + + return NULL; + } + + handle = malloc(sizeof(struct detour_handle_type)); + if (handle == NULL) { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour load handle allocation"); + + return NULL; + } + + if (detour_iface(d)->initialize_file(&handle->impl, path) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour implementation handle initialization"); + + free(handle); + return NULL; } - return handle->target; + return handle; } -detour_handle detour_install(detour d, void (*target)(void), void (*hook)(void)) +detour_handle detour_load_handle(detour d, dynlink library) { - if (d == NULL || target == NULL || hook == NULL) + detour_handle handle; + + if (d == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour install arguments"); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour load arguments"); return NULL; } - detour_handle handle = malloc(sizeof(struct detour_handle_type)); + handle = malloc(sizeof(struct detour_handle_type)); if (handle == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour install handle allocation"); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour load handle allocation"); return NULL; } - handle->impl = detour_iface(d)->initialize(); - - if (handle->impl == NULL) + if (detour_iface(d)->initialize_handle(&handle->impl, library) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour implementation handle initialization"); @@ -104,55 +130,74 @@ detour_handle detour_install(detour d, void (*target)(void), void (*hook)(void)) return NULL; } - void (**target_ptr)(void) = ⌖ + return handle; +} + +detour_handle detour_load_address(detour d, void (*address)(void)) +{ + detour_handle handle; + + if (d == NULL) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour load arguments"); + + return NULL; + } + + handle = malloc(sizeof(struct detour_handle_type)); - if (detour_iface(d)->install(handle->impl, target_ptr, hook) != 0) + if (handle == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour implementation handle installation"); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour load handle allocation"); + + return NULL; + } - if (detour_iface(d)->destroy(handle->impl) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour implementation handle destruction"); - } + if (detour_iface(d)->initialize_address(&handle->impl, address) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour implementation handle initialization"); free(handle); return NULL; } - handle->target = *target_ptr; - return handle; } -int detour_uninstall(detour d, detour_handle handle) +int detour_enumerate(detour d, detour_handle handle, unsigned int *position, const char **name, void (***address)(void)) { - int result = 0; - - if (d == NULL || handle == NULL) + if (d == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid uninstall arguments"); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour enumerate arguments"); return 1; } - result |= detour_iface(d)->uninstall(handle->impl); + return detour_iface(d)->enumerate(handle, position, name, (void ***)address); +} - if (result != 0) +int detour_replace(detour d, detour_handle handle, const char *function_name, void (*function_addr)(void), void (**function_trampoline)(void)) +{ + if (d == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour implementation handle uninstallation"); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour replace arguments"); + + return 1; } - result |= detour_iface(d)->destroy(handle->impl); + return detour_iface(d)->replace(handle, function_name, function_addr, (void **)function_trampoline); +} - if (result != 0) +void detour_unload(detour d, detour_handle handle) +{ + if (d == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour implementation handle destruction"); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour replace arguments"); + return; } - free(handle); - - return result; + detour_iface(d)->destroy(handle); } int detour_clear(detour d) diff --git a/source/detours/CMakeLists.txt b/source/detours/CMakeLists.txt index c1f851b97..1a3c51030 100644 --- a/source/detours/CMakeLists.txt +++ b/source/detours/CMakeLists.txt @@ -4,7 +4,7 @@ if(NOT OPTION_BUILD_DETOURS) endif() # Detour options -option(OPTION_BUILD_DETOURS_FUNCHOOK "FuncHook library detour." ON) +option(OPTION_BUILD_DETOURS_PLTHOOK "PLTHook library detour." ON) # Detour packages -add_subdirectory(funchook_detour) # FuncHook library +add_subdirectory(plthook_detour) # PLTHook library diff --git a/source/detours/funchook_detour/include/funchook_detour/funchook_detour_impl.h b/source/detours/funchook_detour/include/funchook_detour/funchook_detour_impl.h deleted file mode 100644 index 37cb640cd..000000000 --- a/source/detours/funchook_detour/include/funchook_detour/funchook_detour_impl.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Detour Library by Parra Studios - * A cross-platform library providing detours, function hooks and trampolines. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef FUNCHOOK_DETOUR_IMPL_H -#define FUNCHOOK_DETOUR_IMPL_H 1 - -/* -- Headers -- */ - -#include <funchook_detour/funchook_detour_api.h> - -#include <detour/detour_interface.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* -- Methods -- */ - -/** -* @brief -* Initialize FuncHook detour hook implementation -* -* @return -* Returns pointer to detour hook implementation on success, null pointer otherwise -* -*/ -FUNCHOOK_DETOUR_API detour_impl_handle funchook_detour_impl_initialize(void); - -/** -* @brief -* Install FuncHook detour implementation -* -* @param[in] handle -* Pointer to the detour hook implementation -* -* @param[in] target -* Pointer to the function to be intercepted -* -* @param[in] hook -* Function will be called instead of target -* -* @return -* Return zero on success, different from zero otherwise -* -*/ -FUNCHOOK_DETOUR_API int funchook_detour_impl_install(detour_impl_handle handle, void (**target)(void), void (*hook)(void)); - -/** -* @brief -* Uninstall FuncHook detour implementation -* -* @param[in] handle -* Pointer to the detour hook implementation -* -* @return -* Return zero on success, different from zero otherwise -* -*/ -FUNCHOOK_DETOUR_API int funchook_detour_impl_uninstall(detour_impl_handle handle); - -/** -* @brief -* Destroy FuncHook detour implementation -* -* @return -* Returns zero on correct destruction, distinct from zero otherwise -* -*/ -FUNCHOOK_DETOUR_API int funchook_detour_impl_destroy(detour_impl_handle handle); - -#ifdef __cplusplus -} -#endif - -#endif /* FUNCHOOK_DETOUR_IMPL_H */ diff --git a/source/detours/funchook_detour/source/funchook_detour.c b/source/detours/funchook_detour/source/funchook_detour.c deleted file mode 100644 index 9a15057fa..000000000 --- a/source/detours/funchook_detour/source/funchook_detour.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Detour Library by Parra Studios - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * A cross-platform library providing detours, function hooks and trampolines. - * - */ - -/* -- Headers -- */ - -#include <metacall/metacall_version.h> - -#include <funchook_detour/funchook_detour.h> -#include <funchook_detour/funchook_detour_impl.h> - -/* -- Methods -- */ - -detour_interface funchook_detour_impl_interface_singleton(void) -{ - static struct detour_interface_type interface_instance_funchook = { - &funchook_detour_impl_initialize, - &funchook_detour_impl_install, - &funchook_detour_impl_uninstall, - &funchook_detour_impl_destroy - }; - - return &interface_instance_funchook; -} - -const char *funchook_detour_print_info(void) -{ - static const char funchook_detour_info[] = - "FuncHook Detour Plugin " METACALL_VERSION "\n" - "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" - -#ifdef FUNCHOOK_DETOUR_STATIC_DEFINE - "Compiled as static library type\n" -#else - "Compiled as shared library type\n" -#endif - - "\n"; - - return funchook_detour_info; -} diff --git a/source/detours/funchook_detour/source/funchook_detour_impl.c b/source/detours/funchook_detour/source/funchook_detour_impl.c deleted file mode 100644 index 83c25a1dc..000000000 --- a/source/detours/funchook_detour/source/funchook_detour_impl.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Detour Library by Parra Studios - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * A cross-platform library providing detours, function hooks and trampolines. - * - */ - -/* -- Headers -- */ - -#include <funchook_detour/funchook_detour_impl.h> - -#include <log/log.h> - -#include <funchook.h> - -/* -- Member Data -- */ - -union funchook_detour_impl_cast -{ - void (*hook)(void); - void *ptr; -}; - -/* -- Methods -- */ - -detour_impl_handle funchook_detour_impl_initialize(void) -{ - return (detour_impl_handle)funchook_create(); -} - -int funchook_detour_impl_install(detour_impl_handle handle, void (**target)(void), void (*hook)(void)) -{ - funchook_t *handle_impl = handle; - - if (handle_impl != NULL && target != NULL && hook != NULL) - { - union funchook_detour_impl_cast hook_cast = { hook }; - - if (funchook_prepare(handle_impl, (void **)target, hook_cast.ptr) != FUNCHOOK_ERROR_SUCCESS) - { - return 1; - } - - if (funchook_install(handle_impl, 0) != FUNCHOOK_ERROR_SUCCESS) - { - return 1; - } - - return 0; - } - - return 1; -} - -int funchook_detour_impl_uninstall(detour_impl_handle handle) -{ - funchook_t *handle_impl = handle; - - if (handle_impl != NULL) - { - return !(funchook_uninstall(handle_impl, 0) == FUNCHOOK_ERROR_SUCCESS); - } - - return 1; -} - -int funchook_detour_impl_destroy(detour_impl_handle handle) -{ - funchook_t *handle_impl = handle; - - if (handle_impl == NULL) - { - return 0; - } - - return !(funchook_destroy(handle_impl) == FUNCHOOK_ERROR_SUCCESS); -} diff --git a/source/detours/funchook_detour/CMakeLists.txt b/source/detours/plthook_detour/CMakeLists.txt similarity index 50% rename from source/detours/funchook_detour/CMakeLists.txt rename to source/detours/plthook_detour/CMakeLists.txt index ac782f31d..a5db591c1 100644 --- a/source/detours/funchook_detour/CMakeLists.txt +++ b/source/detours/plthook_detour/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if this detour is enabled -if(NOT OPTION_BUILD_DETOURS OR NOT OPTION_BUILD_DETOURS_FUNCHOOK) +if(NOT OPTION_BUILD_DETOURS OR NOT OPTION_BUILD_DETOURS_PLTHOOK) return() endif() @@ -7,66 +7,35 @@ endif() # External dependencies # -find_package(Git REQUIRED) +# PLTHook +include(FetchContent) -# Target depends name -set(target_depends funchook_detour_depends) +set(PLTHook_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/plthook") -include(ExternalProject) - -set(FUNCHOOK_VERSION 1.1.3) +FetchContent_Declare(PLTHook + GIT_REPOSITORY https://github.com/metacall/plthook.git + GIT_TAG master + SOURCE_DIR ${PLTHook_SOURCE_DIR} +) -if(WIN32) - set(FUNCHOOK_LIBRARY_SUFFIX "lib") - set(FUNCHOOK_LIBRARY_INSTALL_SUFFIX "dll") -elseif(APPLE) - set(FUNCHOOK_LIBRARY_SUFFIX "dylib") -else() - set(FUNCHOOK_LIBRARY_SUFFIX "so") -endif() +FetchContent_MakeAvailable(PLTHook) -set(FUNCHOOK_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/funchook/src/funchook") +set(PLTHook_INCLUDE_DIR "${PLTHook_SOURCE_DIR}") -if(WIN32) - set(FUNCHOOK_BUILD_TARGET "INSTALL") - set(FUNCHOOK_LIBRARY_NAME "funchook_dll.${FUNCHOOK_LIBRARY_SUFFIX}") - set(FUNCHOOK_LIBRARY "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${FUNCHOOK_LIBRARY_NAME}") - set(FUNCHOOK_LIBRARY_INSTALL_NAME "funchook.${FUNCHOOK_LIBRARY_INSTALL_SUFFIX}") - set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_SOURCE_DIR}/${CMAKE_BUILD_TYPE}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") +if(APPLE) + set(PLTHook_SOURCE "${PLTHook_SOURCE_DIR}/plthook_osx.c") +elseif(WIN32 OR MINGW) + set(PLTHook_SOURCE "${PLTHook_SOURCE_DIR}/plthook_win32.c") else() - set(FUNCHOOK_BUILD_TARGET "install") - set(FUNCHOOK_LIBRARY_NAME "libfunchook.${FUNCHOOK_LIBRARY_SUFFIX}") - set(FUNCHOOK_LIBRARY "${FUNCHOOK_SOURCE_DIR}/${FUNCHOOK_LIBRARY_NAME}") - set(FUNCHOOK_LIBRARY_INSTALL_NAME "${FUNCHOOK_LIBRARY_NAME}") - set(FUNCHOOK_LIBRARY_INSTALL_DIR "${FUNCHOOK_LIBRARY}") + set(PLTHook_SOURCE "${PLTHook_SOURCE_DIR}/plthook_elf.c") endif() -set(FUNCHOOK_INSTALL_DIR "${PROJECT_OUTPUT_DIR}") -set(FUNCHOOK_LIBRARY_INSTALL "${PROJECT_OUTPUT_DIR}/${FUNCHOOK_LIBRARY_INSTALL_NAME}") -set(FUNCHOOK_INCLUDE_DIR "${FUNCHOOK_SOURCE_DIR}/include") - -ExternalProject_Add(${target_depends} - PREFIX funchook - SOURCE_DIR ${FUNCHOOK_SOURCE_DIR} - INSTALL_DIR ${FUNCHOOK_INSTALL_DIR} - DOWNLOAD_COMMAND "${GIT_EXECUTABLE}" clone --single-branch --branch v${FUNCHOOK_VERSION} --recursive https://github.com/kubo/funchook.git "${FUNCHOOK_SOURCE_DIR}" - CONFIGURE_COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -DCMAKE_BUILD_PARALLEL_LEVEL=1 -DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON -DCMAKE_INSTALL_PREFIX=${FUNCHOOK_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFUNCHOOK_BUILD_SHARED=ON -DFUNCHOOK_BUILD_TESTS=OFF -DFUNCHOOK_BUILD_STATIC=OFF . - BUILD_COMMAND ${CMAKE_COMMAND} -E env CMAKE_BUILD_PARALLEL_LEVEL=1 ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy "${FUNCHOOK_LIBRARY_INSTALL_DIR}" "${FUNCHOOK_INSTALL_DIR}" - UPDATE_COMMAND "" - BUILD_IN_SOURCE ON - LOG_DOWNLOAD ON - LOG_CONFIGURE ON - LOG_BUILD ON - LOG_INSTALL ON -) - # # Library name and options # # Target name -set(target funchook_detour) +set(target plthook_detour) # Exit here if required dependencies are not met message(STATUS "Detour ${target}") @@ -96,13 +65,14 @@ set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") set(headers - ${include_path}/funchook_detour.h - ${include_path}/funchook_detour_impl.h + ${include_path}/plthook_detour.h + ${include_path}/plthook_detour_impl.h ) set(sources - ${source_path}/funchook_detour.c - ${source_path}/funchook_detour_impl.c + ${source_path}/plthook_detour.c + ${source_path}/plthook_detour_impl.c + ${PLTHook_SOURCE} # PLTHook Source ) # Group source files @@ -123,11 +93,6 @@ add_library(${target} MODULE ${headers} ) -# Add target dependencies -add_dependencies(${target} - ${target_depends} -) - # Create namespaced alias add_library(${META_PROJECT_NAME}::${target} ALIAS ${target}) @@ -162,7 +127,7 @@ target_include_directories(${target} ${CMAKE_CURRENT_BINARY_DIR}/include $<TARGET_PROPERTY:${META_PROJECT_NAME}::metacall,INCLUDE_DIRECTORIES> # MetaCall includes - ${FUNCHOOK_INCLUDE_DIR} # FuncHook includes + ${PLTHook_INCLUDE_DIR} # PLTHook includes PUBLIC ${DEFAULT_INCLUDE_DIRECTORIES} @@ -180,7 +145,6 @@ target_include_directories(${target} target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - ${FUNCHOOK_LIBRARY} # FuncHook libraries PUBLIC ${DEFAULT_LIBRARIES} @@ -234,7 +198,6 @@ target_link_options(${target} # Dependency install(FILES - ${FUNCHOOK_LIBRARY_INSTALL} DESTINATION ${INSTALL_LIB} COMPONENT runtime ) diff --git a/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h b/source/detours/plthook_detour/include/plthook_detour/plthook_detour.h similarity index 80% rename from source/detours/funchook_detour/include/funchook_detour/funchook_detour.h rename to source/detours/plthook_detour/include/plthook_detour/plthook_detour.h index 98a71ea43..068ae11c6 100644 --- a/source/detours/funchook_detour/include/funchook_detour/funchook_detour.h +++ b/source/detours/plthook_detour/include/plthook_detour/plthook_detour.h @@ -18,12 +18,12 @@ * */ -#ifndef FUNCHOOK_DETOUR_H -#define FUNCHOOK_DETOUR_H 1 +#ifndef PLTHOOK_DETOUR_H +#define PLTHOOK_DETOUR_H 1 /* -- Headers -- */ -#include <funchook_detour/funchook_detour_api.h> +#include <plthook_detour/plthook_detour_api.h> #include <detour/detour_interface.h> @@ -41,7 +41,7 @@ extern "C" { * Returns pointer to interface to be used by implementation * */ -FUNCHOOK_DETOUR_API detour_interface funchook_detour_impl_interface_singleton(void); +PLTHOOK_DETOUR_API detour_interface plthook_detour_impl_interface_singleton(void); /** * @brief @@ -51,10 +51,10 @@ FUNCHOOK_DETOUR_API detour_interface funchook_detour_impl_interface_singleton(vo * Static string containing module information * */ -FUNCHOOK_DETOUR_API const char *funchook_detour_print_info(void); +PLTHOOK_DETOUR_API const char *plthook_detour_print_info(void); #ifdef __cplusplus } #endif -#endif /* FUNCHOOK_DETOUR_H */ +#endif /* PLTHOOK_DETOUR_H */ diff --git a/source/detours/plthook_detour/include/plthook_detour/plthook_detour_impl.h b/source/detours/plthook_detour/include/plthook_detour/plthook_detour_impl.h new file mode 100644 index 000000000..680cff01e --- /dev/null +++ b/source/detours/plthook_detour/include/plthook_detour/plthook_detour_impl.h @@ -0,0 +1,151 @@ +/* + * Detour Library by Parra Studios + * A cross-platform library providing detours, function hooks and trampolines. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef PLTHOOK_DETOUR_IMPL_H +#define PLTHOOK_DETOUR_IMPL_H 1 + +/* -- Headers -- */ + +#include <plthook_detour/plthook_detour_api.h> + +#include <detour/detour_interface.h> + +#include <dynlink/dynlink.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* -- Methods -- */ + +/** +* @brief +* Initialize PLTHook detour hook implementation by file name +* +* @param[out] handle +* When success, it returns the pointer to the detour implementation, null otherwise +* +* @param[in] path +* String containing the path or name to the dynamic library to be opened +* +* @return +* Returns zero on success, different from zero otherwise +* +*/ +PLTHOOK_DETOUR_API int plthook_detour_impl_initialize_file(detour_impl_handle *handle, const char *path); + +/** +* @brief +* Initialize PLTHook detour hook implementation by already l +* +* @param[out] handle +* When success, it returns the pointer to the detour implementation, null otherwiseoaded dynamic library handle +* +* @param[in] library +* Pointer to the dynlink handle of the library +* +* @return +* Returns zero on success, different from zero otherwise +* +*/ +PLTHOOK_DETOUR_API int plthook_detour_impl_initialize_handle(detour_impl_handle *handle, dynlink library); + +/** +* @brief +* Initialize PLTHook detour hook implementation by a functio +* +* @param[out] handle +* When success, it returns the pointer to the detour implementation, null otherwisen pointer of a function belonging to a library +* +* @param[in] address +* Function pointer of a function belonging to the library to be hooked +* +* @return +* Returns zero on success, different from zero otherwise +* +*/ +PLTHOOK_DETOUR_API int plthook_detour_impl_initialize_address(detour_impl_handle *handle, void (*address)(void)); + +/** +* @brief +* Iterate all symbols of the library already opened +* +* @param[in] handle +* Pointer to the detour hook implementation +* +* @param[out] position +* Pointer to the current index of the enumeration +* +* @param[out] name +* Pointer to the function name in string form +* +* @param[out] address +* Pointer to the pointer of the function pointer of the function to be hooked +* +* @return +* Return zero on success, different from zero otherwise +* +*/ +PLTHOOK_DETOUR_API int plthook_detour_impl_enumerate(detour_impl_handle handle, unsigned int *position, const char **name, void ***address); + +/** +* @brief +* Replace function from a library already opened by name, returns the old function pointer +* +* @param[in] handle +* Pointer to the detour hook implementation +* +* @param[in] function_name +* String containing the function name to be replaced +* +* @param[in] function_addr +* Function pointer that will be used to replace the original one +* +* @param[out] function_old_addr +* Function pointer to the original function that has been replaced +* +* @return +* Return zero on success, different from zero otherwise +* +*/ +PLTHOOK_DETOUR_API int plthook_detour_impl_replace(detour_impl_handle handle, const char *function_name, void (*function_addr)(void), void **function_old_addr); + +/** +* @brief +* Error handling PLTHook detour implementation +* +* @return +* Returns string containing the information of the error +* +*/ +PLTHOOK_DETOUR_API const char *plthook_detour_impl_error(detour_impl_handle handle); + +/** +* @brief +* Destroy PLTHook detour implementation +* +*/ +PLTHOOK_DETOUR_API void plthook_detour_impl_destroy(detour_impl_handle handle); + +#ifdef __cplusplus +} +#endif + +#endif /* PLTHOOK_DETOUR_IMPL_H */ diff --git a/source/detours/plthook_detour/source/plthook_detour.c b/source/detours/plthook_detour/source/plthook_detour.c new file mode 100644 index 000000000..b291b0b8e --- /dev/null +++ b/source/detours/plthook_detour/source/plthook_detour.c @@ -0,0 +1,48 @@ +/* + * Detour Library by Parra Studios + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * A cross-platform library providing detours, function hooks and trampolines. + * + */ + +/* -- Headers -- */ + +#include <metacall/metacall_version.h> + +#include <plthook_detour/plthook_detour.h> +#include <plthook_detour/plthook_detour_impl.h> + +/* -- Methods -- */ + +detour_interface plthook_detour_impl_interface_singleton(void) +{ + static struct detour_interface_type interface_instance_plthook = { + &plthook_detour_impl_initialize_file, + &plthook_detour_impl_initialize_handle, + &plthook_detour_impl_initialize_address, + &plthook_detour_impl_enumerate, + &plthook_detour_impl_replace, + &plthook_detour_impl_error, + &plthook_detour_impl_destroy + }; + + return &interface_instance_plthook; +} + +const char *plthook_detour_print_info(void) +{ + static const char plthook_detour_info[] = + "PLTHook Detour Plugin " METACALL_VERSION "\n" + "Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com>\n" + +#ifdef PLTHOOK_DETOUR_STATIC_DEFINE + "Compiled as static library type\n" +#else + "Compiled as shared library type\n" +#endif + + "\n"; + + return plthook_detour_info; +} diff --git a/source/detours/plthook_detour/source/plthook_detour_impl.c b/source/detours/plthook_detour/source/plthook_detour_impl.c new file mode 100644 index 000000000..33d23850d --- /dev/null +++ b/source/detours/plthook_detour/source/plthook_detour_impl.c @@ -0,0 +1,122 @@ +/* + * Detour Library by Parra Studios + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * A cross-platform library providing detours, function hooks and trampolines. + * + */ + +/* -- Headers -- */ + +#include <plthook_detour/plthook_detour_impl.h> + +#include <plthook.h> + +/* -- Methods -- */ + +int plthook_detour_impl_initialize_file(detour_impl_handle *handle, const char *path) +{ + plthook_t *plthook; + int result; + + if (handle == NULL) + { + return 1; + } + + result = plthook_open(&plthook, path); + + if (result != PLTHOOK_SUCCESS) + { + *handle = NULL; + return result; + } + + *handle = (void *)plthook; + return 0; +} + +int plthook_detour_impl_initialize_handle(detour_impl_handle *handle, dynlink library) +{ + plthook_t *plthook; + int result; + + if (handle == NULL) + { + return 1; + } + + result = plthook_open_by_handle(&plthook, dynlink_get_impl(library)); + + if (result != PLTHOOK_SUCCESS) + { + *handle = NULL; + return result; + } + + *handle = (void *)plthook; + return 0; +} + +int plthook_detour_impl_initialize_address(detour_impl_handle *handle, void (*address)(void)) + +{ + plthook_t *plthook; + void *ptr; + int result; + + if (handle == NULL) + { + return 1; + } + + dynlink_symbol_uncast(address, ptr); + + result = plthook_open_by_address(&plthook, ptr); + + if (result != PLTHOOK_SUCCESS) + { + *handle = NULL; + return result; + } + + *handle = (void *)plthook; + return 0; +} + +int plthook_detour_impl_enumerate(detour_impl_handle handle, unsigned int *position, const char **name, void ***address) +{ + if (handle == NULL) + { + return 1; + } + + return plthook_enum(handle, position, name, address); +} + +int plthook_detour_impl_replace(detour_impl_handle handle, const char *function_name, void (*function_addr)(void), void **function_old_addr) +{ + void *ptr; + + if (handle == NULL) + { + return 1; + } + + dynlink_symbol_uncast(function_addr, ptr); + + return plthook_replace(handle, function_name, ptr, function_old_addr); +} + +const char *plthook_detour_impl_error(detour_impl_handle handle) +{ + /* TODO: The error should be stored in the handle, this must be modified from plthook library itself */ + (void)handle; + + return plthook_error(); +} + +void plthook_detour_impl_destroy(detour_impl_handle handle) +{ + plthook_close(handle); +} diff --git a/source/dynlink/source/dynlink_impl_unix.c b/source/dynlink/source/dynlink_impl_unix.c index 0354ecce7..df74485c1 100644 --- a/source/dynlink/source/dynlink_impl_unix.c +++ b/source/dynlink/source/dynlink_impl_unix.c @@ -28,12 +28,15 @@ #include <string.h> +/* Enable if needed for extended API */ +/* #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #ifndef __USE_GNU #define __USE_GNU #endif +*/ #include <dlfcn.h> diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index dec8182d2..273120fa0 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -47,7 +47,7 @@ #define METACALL_ARGS_SIZE 0x10 #define METACALL_SERIAL "rapid_json" -#define METACALL_DETOUR "funchook" +#define METACALL_DETOUR "plthook" /* -- Type Definitions -- */ diff --git a/source/tests/detour_test/CMakeLists.txt b/source/tests/detour_test/CMakeLists.txt index 7b722beeb..d73991ebc 100644 --- a/source/tests/detour_test/CMakeLists.txt +++ b/source/tests/detour_test/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if detours are enabled -if(NOT OPTION_BUILD_DETOURS OR NOT OPTION_BUILD_DETOURS_FUNCHOOK) +if(NOT OPTION_BUILD_DETOURS OR NOT OPTION_BUILD_DETOURS_PLTHOOK) return() endif() @@ -134,6 +134,14 @@ add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> ) +# +# Define dependencies +# + +add_dependencies(${target} + plthook_detour +) + # # Define test properties # diff --git a/source/tests/detour_test/source/detour_test.cpp b/source/tests/detour_test/source/detour_test.cpp index 6b84295fd..029f6171c 100644 --- a/source/tests/detour_test/source/detour_test.cpp +++ b/source/tests/detour_test/source/detour_test.cpp @@ -31,7 +31,8 @@ class detour_test : public testing::Test public: }; -static detour_handle handle; +static detour_handle handle = NULL; +static void (*trampoline)(void) = NULL; int hook_function(int x) { @@ -39,16 +40,22 @@ int hook_function(int x) log_write("metacall", LOG_LEVEL_DEBUG, "Hook function %d", x); - int (*target_function_ptr)(int) = (int (*)(int))detour_trampoline(handle); + int (*trampoline_ptr)(int) = (int (*)(int))trampoline; - int result = target_function_ptr(x + 2) + 2; + int result = trampoline_ptr(x + 2) + 2; log_write("metacall", LOG_LEVEL_DEBUG, "Hook function result %d", result); return result; } -int target_function(int x) +#ifdef _WIN32 + #define EXPORT_SYMBOL __declspec(dllexport) +#else + #define EXPORT_SYMBOL __attribute__((visibility("default"))) +#endif + +extern "C" EXPORT_SYMBOL int target_function(int x) { EXPECT_EQ((int)130, (int)x); @@ -59,7 +66,7 @@ int target_function(int x) TEST_F(detour_test, DefaultConstructor) { - static const char name[] = "funchook"; + static const char name[] = "plthook"; /* Initialize log */ EXPECT_EQ((int)0, (int)log_configure("metacall", @@ -71,23 +78,29 @@ TEST_F(detour_test, DefaultConstructor) /* Initialize detour */ EXPECT_EQ((int)0, (int)detour_initialize()); - /* Create detour funchook */ + /* Create detour plthook */ detour d = detour_create(name); - EXPECT_NE((detour)NULL, (detour)d); + ASSERT_NE((detour)NULL, (detour)d); EXPECT_EQ((int)0, (int)strcmp(name, detour_name(d))); + /* Load detour */ + handle = detour_load_file(d, NULL); + /* Install detour */ - handle = detour_install(d, (void (*)(void)) & target_function, (void (*)(void)) & hook_function); + detour_replace(d, handle, "target_function", (void (*)(void))(&hook_function), &trampoline); EXPECT_NE((detour_handle)NULL, (detour_handle)handle); + /* Old funciton must equal to the trampoline returned by replace */ + EXPECT_EQ((int (*)(int))trampoline, (int (*)(int))(&target_function)); + /* Call detour, it should call hooked function */ EXPECT_EQ((int)132, (int)target_function(128)); /* Uninstall detour */ - EXPECT_EQ((int)0, (int)detour_uninstall(d, handle)); + detour_unload(d, handle); /* Clear detour */ EXPECT_EQ((int)0, (int)detour_clear(d)); diff --git a/source/tests/metacall_fork_test/CMakeLists.txt b/source/tests/metacall_fork_test/CMakeLists.txt index 47d389592..122637bdd 100644 --- a/source/tests/metacall_fork_test/CMakeLists.txt +++ b/source/tests/metacall_fork_test/CMakeLists.txt @@ -128,7 +128,7 @@ add_test(NAME ${target} # add_dependencies(${target} - funchook_detour + plthook_detour ) # diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index 8d60574a7..72ce3659b 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -310,9 +310,6 @@ function Configure { if ("$var" -eq 'rapidjson') { Write-Output "rapidjson selected" } - if ("$var" -eq 'funchook') { - Write-Output "funchook selected" - } if (("$var" -eq 'v8') -or ("$var" -eq 'v8rep54')) { Write-Output "v8 selected" } @@ -387,7 +384,6 @@ function Help { Write-Output " netcore2" Write-Output " netcore5" Write-Output " rapidjson" - Write-Output " funchook" Write-Output " v8" Write-Output " v8rep51" Write-Output " v8rep54" diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 5735bc28a..593ac4b93 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -30,7 +30,6 @@ INSTALL_BASE=1 INSTALL_PYTHON=0 INSTALL_RUBY=0 INSTALL_RAPIDJSON=0 -INSTALL_FUNCHOOK=0 INSTALL_NETCORE=0 INSTALL_NETCORE2=0 INSTALL_NETCORE5=0 @@ -262,12 +261,6 @@ sub_rapidjson(){ fi } -# FuncHook -sub_funchook(){ - echo "configure funchook" - -} - # NetCore sub_netcore(){ echo "configure netcore" @@ -917,9 +910,6 @@ sub_install(){ if [ $INSTALL_RAPIDJSON = 1 ]; then sub_rapidjson fi - if [ $INSTALL_FUNCHOOK = 1 ]; then - sub_funchook - fi if [ $INSTALL_NETCORE = 1 ]; then sub_netcore fi @@ -1039,10 +1029,6 @@ sub_options(){ echo "rapidjson selected" INSTALL_RAPIDJSON=1 fi - if [ "$option" = 'funchook' ]; then - echo "funchook selected" - INSTALL_FUNCHOOK=1 - fi if [ "$option" = 'v8' ] || [ "$option" = 'v8rep54' ]; then echo "v8 selected" INSTALL_V8REPO=1 @@ -1149,7 +1135,6 @@ sub_help() { echo " netcore5" echo " netcore7" echo " rapidjson" - echo " funchook" echo " v8" echo " v8rep51" echo " v8rep54" diff --git a/tools/metacall-sanitizer.sh b/tools/metacall-sanitizer.sh index 49677c734..d5f9ac529 100755 --- a/tools/metacall-sanitizer.sh +++ b/tools/metacall-sanitizer.sh @@ -35,7 +35,7 @@ if [ "${BUILD_SANITIZER}" != "address-sanitizer" ] && [ "${BUILD_SANITIZER}" != fi # Install -"${SCRIPT_DIR}/metacall-environment.sh" base ${BUILD_LANGUAGES[@]} rapidjson funchook swig pack backtrace +"${SCRIPT_DIR}/metacall-environment.sh" base ${BUILD_LANGUAGES[@]} rapidjson swig pack backtrace # Configure and Build export NODE_PATH="/usr/lib/node_modules" From e6b92a2d028e2196ec104fe39f7ccd300bfbbe0f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 28 Mar 2025 18:03:18 +0100 Subject: [PATCH 204/487] Detour working properly, enum still failing. --- source/detour/source/detour.c | 14 ++-- .../tests/detour_test/source/detour_test.cpp | 72 ++++++++++++++----- 2 files changed, 60 insertions(+), 26 deletions(-) diff --git a/source/detour/source/detour.c b/source/detour/source/detour.c index 58c81e892..d894a8d5b 100644 --- a/source/detour/source/detour.c +++ b/source/detour/source/detour.c @@ -167,37 +167,37 @@ detour_handle detour_load_address(detour d, void (*address)(void)) int detour_enumerate(detour d, detour_handle handle, unsigned int *position, const char **name, void (***address)(void)) { - if (d == NULL) + if (d == NULL || handle == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour enumerate arguments"); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour replace arguments"); return 1; } - return detour_iface(d)->enumerate(handle, position, name, (void ***)address); + return detour_iface(d)->enumerate(handle->impl, position, name, (void ***)address); } int detour_replace(detour d, detour_handle handle, const char *function_name, void (*function_addr)(void), void (**function_trampoline)(void)) { - if (d == NULL) + if (d == NULL || handle == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour replace arguments"); return 1; } - return detour_iface(d)->replace(handle, function_name, function_addr, (void **)function_trampoline); + return detour_iface(d)->replace(handle->impl, function_name, function_addr, (void **)function_trampoline); } void detour_unload(detour d, detour_handle handle) { - if (d == NULL) + if (d == NULL || handle == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid detour replace arguments"); return; } - detour_iface(d)->destroy(handle); + detour_iface(d)->destroy(handle->impl); } int detour_clear(detour d) diff --git a/source/tests/detour_test/source/detour_test.cpp b/source/tests/detour_test/source/detour_test.cpp index 029f6171c..f4009bf97 100644 --- a/source/tests/detour_test/source/detour_test.cpp +++ b/source/tests/detour_test/source/detour_test.cpp @@ -24,6 +24,8 @@ #include <detour/detour.h> +#include <dynlink/dynlink.h> + #include <string.h> class detour_test : public testing::Test @@ -32,21 +34,31 @@ class detour_test : public testing::Test }; static detour_handle handle = NULL; -static void (*trampoline)(void) = NULL; +static const char *(*trampoline)(void) = NULL; -int hook_function(int x) +int check_detour_hook(const char *(*fp)(void)) { - EXPECT_EQ((int)128, (int)x); + static const char str_without_hook[] = "Detour Library"; + + const char *str = fp(); + + log_write("metacall", LOG_LEVEL_DEBUG, "Check: %s", str); - log_write("metacall", LOG_LEVEL_DEBUG, "Hook function %d", x); + return strncmp(str, str_without_hook, sizeof(str_without_hook) - 1); +} - int (*trampoline_ptr)(int) = (int (*)(int))trampoline; +const char *hook_function(void) +{ + static const char str_with_hook[] = "Yeet"; - int result = trampoline_ptr(x + 2) + 2; + log_write("metacall", LOG_LEVEL_DEBUG, "HOOK WORKING PROPERLY"); + log_write("metacall", LOG_LEVEL_DEBUG, "Original function: %s", trampoline()); - log_write("metacall", LOG_LEVEL_DEBUG, "Hook function result %d", result); + /* Here we check that we got the correct trampoline implementation (aka the original function) + and we can call it from inside of the body of the hook function */ + EXPECT_EQ((int)0, (int)check_detour_hook(trampoline)); - return result; + return str_with_hook; } #ifdef _WIN32 @@ -55,10 +67,8 @@ int hook_function(int x) #define EXPORT_SYMBOL __attribute__((visibility("default"))) #endif -extern "C" EXPORT_SYMBOL int target_function(int x) +extern "C" EXPORT_SYMBOL int test_exported_symbols_from_executable(int x) { - EXPECT_EQ((int)130, (int)x); - log_write("metacall", LOG_LEVEL_DEBUG, "Target function %d", x); return x; @@ -85,19 +95,43 @@ TEST_F(detour_test, DefaultConstructor) EXPECT_EQ((int)0, (int)strcmp(name, detour_name(d))); - /* Load detour */ + /* Load detour of detour library */ handle = detour_load_file(d, NULL); - /* Install detour */ - detour_replace(d, handle, "target_function", (void (*)(void))(&hook_function), &trampoline); + ASSERT_NE((detour_handle)NULL, (detour_handle)handle); + + /* Check if it can list exported symbols from executable */ + test_exported_symbols_from_executable(3); + + unsigned int position = 0; + const char *fn_name = NULL; + void (**addr)(void) = NULL; + bool found = false; + while (detour_enumerate(d, handle, &position, &fn_name, &addr) == 0) + { + log_write("metacall", LOG_LEVEL_DEBUG, "[%d] %p %s", position, *addr, fn_name); - EXPECT_NE((detour_handle)NULL, (detour_handle)handle); + if (strcmp("test_exported_symbols_from_executable", fn_name) == 0) + { + found = true; + EXPECT_EQ((void *)(*addr), (void *)(&test_exported_symbols_from_executable)); + break; + } + } + + EXPECT_EQ((bool)true, (bool)found); + + /* Install detour */ + union + { + const char *(**trampoline)(void); + void (**ptr)(void); + } cast = { &trampoline }; - /* Old funciton must equal to the trampoline returned by replace */ - EXPECT_EQ((int (*)(int))trampoline, (int (*)(int))(&target_function)); + ASSERT_EQ((int)0, detour_replace(d, handle, "detour_print_info", (void (*)(void))(&hook_function), cast.ptr)); - /* Call detour, it should call hooked function */ - EXPECT_EQ((int)132, (int)target_function(128)); + /* This must return "Yeet", so when checking the test it should return distinct from 0, then the funtion is properly hooked */ + EXPECT_NE((int)0, (int)check_detour_hook(&detour_print_info)); /* Uninstall detour */ detour_unload(d, handle); From 46f840b132215c62ee3779be86ba8dd6e2953fb4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Apr 2025 17:55:15 +0200 Subject: [PATCH 205/487] Solved metacall fork in linux. --- .../metacall/include/metacall/metacall_fork.h | 5 +- .../metacall/include/metacall/metacall_link.h | 5 +- source/metacall/source/metacall.c | 10 +-- source/metacall/source/metacall_fork.c | 73 +++++++++---------- source/metacall/source/metacall_link.c | 62 +++++++++------- source/ports/rs_port/src/bindings.rs | 4 +- .../ports/zig_port/src/metacall-bindings.zig | 2 +- .../tests/detour_test/source/detour_test.cpp | 20 +++++ 8 files changed, 97 insertions(+), 84 deletions(-) diff --git a/source/metacall/include/metacall/metacall_fork.h b/source/metacall/include/metacall/metacall_fork.h index fd9915fce..53eb2478e 100644 --- a/source/metacall/include/metacall/metacall_fork.h +++ b/source/metacall/include/metacall/metacall_fork.h @@ -88,11 +88,8 @@ METACALL_API void metacall_fork(metacall_pre_fork_callback_ptr pre_callback, met /** * @brief * Unregister fork detours and destroy shared memory -* -* @return -* Zero if success, different from zero otherwise */ -METACALL_API int metacall_fork_destroy(void); +METACALL_API void metacall_fork_destroy(void); #ifdef __cplusplus } diff --git a/source/metacall/include/metacall/metacall_link.h b/source/metacall/include/metacall/metacall_link.h index fc4f3a2c4..b9de5afff 100644 --- a/source/metacall/include/metacall/metacall_link.h +++ b/source/metacall/include/metacall/metacall_link.h @@ -76,11 +76,8 @@ METACALL_API int metacall_link_unregister(const char *symbol); /** * @brief * Unregister link detours and destroy shared memory -* -* @return -* Zero if success, different from zero otherwise */ -METACALL_API int metacall_link_destroy(void); +METACALL_API void metacall_link_destroy(void); #ifdef __cplusplus } diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 273120fa0..12f2f14dc 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -199,19 +199,13 @@ int metacall_plugin_extension_load(void) void metacall_detour_destructor(void) { /* Destroy link */ - if (metacall_link_destroy() != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall link destruction"); - } + metacall_link_destroy(); /* Destroy fork */ #ifdef METACALL_FORK_SAFE if (metacall_config_flags & METACALL_FLAGS_FORK_SAFE) { - if (metacall_fork_destroy() != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall fork destruction"); - } + metacall_fork_destroy(); } #endif /* METACALL_FORK_SAFE */ diff --git a/source/metacall/source/metacall_fork.c b/source/metacall/source/metacall_fork.c index 422c00a0e..e353879fd 100644 --- a/source/metacall/source/metacall_fork.c +++ b/source/metacall/source/metacall_fork.c @@ -29,6 +29,8 @@ #include <stdlib.h> +/* -- Methods -- */ + #if defined(WIN32) || defined(_WIN32) || \ defined(__CYGWIN__) || defined(__CYGWIN32__) || \ defined(__MINGW32__) || defined(__MINGW64__) @@ -43,10 +45,6 @@ #endif #include <windows.h> -/* -- Definitions -- */ - - #define metacall_fork_pid _getpid - /* -- Type Definitions -- */ typedef long NTSTATUS; @@ -89,8 +87,6 @@ typedef NTSTATUS(NTAPI *RtlCloneUserProcessPtr)(ULONG ProcessFlags, /* -- Methods -- */ -void (*metacall_fork_func(void))(void); - NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, PSECURITY_DESCRIPTOR ProcessSecurityDescriptor, PSECURITY_DESCRIPTOR ThreadSecurityDescriptor, @@ -104,8 +100,6 @@ NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, /* -- Methods -- */ -void (*metacall_fork_func(void))(void); - pid_t metacall_fork_hook(void); #else @@ -125,21 +119,14 @@ static metacall_post_fork_callback_ptr metacall_post_fork_callback = NULL; defined(__CYGWIN__) || defined(__CYGWIN32__) || \ defined(__MINGW32__) || defined(__MINGW64__) -void (*metacall_fork_func(void))(void) -{ - HMODULE module; - RtlCloneUserProcessPtr clone_ptr; +typedef RtlCloneUserProcessPtr metacall_fork_trampoline_type; - module = GetModuleHandle("ntdll.dll"); +static const char metacall_fork_func_name[] = "RtlCloneUserProcess"; +static metacall_fork_trampoline_type metacall_fork_trampoline = NULL; - if (!module) - { - return NULL; - } - - clone_ptr = (RtlCloneUserProcessPtr)GetProcAddress(module, "RtlCloneUserProcess"); - - return (void (*)(void))clone_ptr; +static detour_handle metacall_fork_handle(detour d) +{ + return detour_load_file(d, "ntdll.dll"); } NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, @@ -148,8 +135,6 @@ NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, HANDLE DebugPort, PRTL_USER_PROCESS_INFORMATION ProcessInformation) { - RtlCloneUserProcessPtr metacall_fork_trampoline = (RtlCloneUserProcessPtr)detour_trampoline(detour_fork_handle); - metacall_pre_fork_callback_ptr pre_callback = metacall_pre_fork_callback; metacall_post_fork_callback_ptr post_callback = metacall_post_fork_callback; @@ -213,15 +198,18 @@ NTSTATUS NTAPI metacall_fork_hook(ULONG ProcessFlags, defined(__CYGWIN__) || defined(__CYGWIN32__) || \ (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) -void (*metacall_fork_func(void))(void) +typedef pid_t (*metacall_fork_trampoline_type)(void); + +static const char metacall_fork_func_name[] = "fork"; +static metacall_fork_trampoline_type metacall_fork_trampoline = NULL; + +static detour_handle metacall_fork_handle(detour d) { - return (void (*)(void))(&fork); + return detour_load_file(d, NULL); } pid_t metacall_fork_hook(void) { - pid_t (*metacall_fork_trampoline)(void) = (pid_t(*)(void))detour_trampoline(detour_fork_handle); - metacall_pre_fork_callback_ptr pre_callback = metacall_pre_fork_callback; metacall_post_fork_callback_ptr post_callback = metacall_post_fork_callback; @@ -285,7 +273,14 @@ int metacall_fork_initialize(void) if (detour_fork_handle == NULL) { - detour_fork_handle = detour_install(d, (void (*)(void))metacall_fork_func(), (void (*)(void))(&metacall_fork_hook)); + /* Casting for getting the original function */ + union + { + metacall_fork_trampoline_type *trampoline; + void (**ptr)(void); + } cast = { &metacall_fork_trampoline }; + + detour_fork_handle = metacall_fork_handle(d); if (detour_fork_handle == NULL) { @@ -295,6 +290,15 @@ int metacall_fork_initialize(void) return 1; } + + if (detour_replace(d, detour_fork_handle, metacall_fork_func_name, (void (*)(void))(&metacall_fork_hook), cast.ptr) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour fork replacement"); + + metacall_link_destroy(); + + return 1; + } } return 0; @@ -306,26 +310,17 @@ void metacall_fork(metacall_pre_fork_callback_ptr pre_callback, metacall_post_fo metacall_post_fork_callback = post_callback; } -int metacall_fork_destroy(void) +void metacall_fork_destroy(void) { - int result = 0; - if (detour_fork_handle != NULL) { detour d = detour_create(metacall_detour()); - if (detour_uninstall(d, detour_fork_handle) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour fork uninstall"); - - result = 1; - } + detour_unload(d, detour_fork_handle); detour_fork_handle = NULL; } metacall_pre_fork_callback = NULL; metacall_post_fork_callback = NULL; - - return result; } diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index 3526c6b18..9812211b2 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -47,23 +47,22 @@ static threading_mutex_type link_mutex = THREADING_MUTEX_INITIALIZE; #include <windows.h> -void (*metacall_link_func(void))(void) +typedef FARPROC (*metacall_link_trampoline_type)(HMODULE, LPCSTR); + +static const char metacall_link_func_name[] = "GetProcAddress"; +static metacall_link_trampoline_type metacall_link_trampoline = NULL; + +static detour_handle metacall_link_handle(detour d) { - return (void (*)(void))(&GetProcAddress); + return detour_load_address(d, (void (*)(void))(&GetProcAddress)); } FARPROC metacall_link_hook(HMODULE handle, LPCSTR symbol) { - typedef FARPROC (*metacall_link_func_ptr)(HMODULE, LPCSTR); - - metacall_link_func_ptr metacall_link_trampoline; - void *ptr; threading_mutex_lock(&link_mutex); - metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); - /* Intercept if any */ ptr = set_get(metacall_link_table, (set_key)symbol); @@ -93,18 +92,22 @@ void (*metacall_link_func(void))(void) return (void (*)(void))(&dlsym); } -void *metacall_link_hook(void *handle, const char *symbol) -{ - typedef void *(*metacall_link_func_ptr)(void *, const char *); +typedef void *(*metacall_link_trampoline_type)(void *, const char *); + +static const char metacall_link_func_name[] = "dlsym"; +static metacall_link_trampoline_type metacall_link_trampoline = NULL; - metacall_link_func_ptr metacall_link_trampoline; +static detour_handle metacall_link_handle(detour d) +{ + return detour_load_address(d, (void (*)(void))(&dlsym)); +} +void *metacall_link_hook(void *handle, const char *symbol) +{ void *ptr; threading_mutex_lock(&link_mutex); - metacall_link_trampoline = (metacall_link_func_ptr)detour_trampoline(detour_link_handle); - /* Intercept function if any */ ptr = set_get(metacall_link_table, (set_key)symbol); @@ -140,7 +143,14 @@ int metacall_link_initialize(void) if (detour_link_handle == NULL) { - detour_link_handle = detour_install(d, (void (*)(void))metacall_link_func(), (void (*)(void))(&metacall_link_hook)); + /* Casting for getting the original function */ + union + { + metacall_link_trampoline_type *trampoline; + void (**ptr)(void); + } cast = { &metacall_link_trampoline }; + + detour_link_handle = metacall_link_handle(d); if (detour_link_handle == NULL) { @@ -150,6 +160,15 @@ int metacall_link_initialize(void) return 1; } + + if (detour_replace(d, detour_link_handle, metacall_link_func_name, (void (*)(void))(&metacall_link_hook), cast.ptr) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour link replacement"); + + metacall_link_destroy(); + + return 1; + } } if (metacall_link_table == NULL) @@ -193,22 +212,15 @@ int metacall_link_unregister(const char *symbol) return (set_remove(metacall_link_table, (set_key)symbol) == NULL); } -int metacall_link_destroy(void) +void metacall_link_destroy(void) { - int result = 0; - threading_mutex_lock(&link_mutex); if (detour_link_handle != NULL) { detour d = detour_create(metacall_detour()); - if (detour_uninstall(d, detour_link_handle) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour fork uninstall"); - - result = 1; - } + detour_unload(d, detour_link_handle); detour_link_handle = NULL; } @@ -223,6 +235,4 @@ int metacall_link_destroy(void) threading_mutex_unlock(&link_mutex); threading_mutex_destroy(&link_mutex); - - return result; } diff --git a/source/ports/rs_port/src/bindings.rs b/source/ports/rs_port/src/bindings.rs index c4319b2ac..26a41b7bd 100644 --- a/source/ports/rs_port/src/bindings.rs +++ b/source/ports/rs_port/src/bindings.rs @@ -627,8 +627,8 @@ unsafe extern "C" { ); } unsafe extern "C" { - #[doc = " @brief\n Unregister fork detours and destroy shared memory\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_fork_destroy() -> ::std::os::raw::c_int; + #[doc = " @brief\n Unregister fork detours and destroy shared memory"] + pub fn metacall_fork_destroy(); } #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/source/ports/zig_port/src/metacall-bindings.zig b/source/ports/zig_port/src/metacall-bindings.zig index 0615eb723..9e51c89cd 100644 --- a/source/ports/zig_port/src/metacall-bindings.zig +++ b/source/ports/zig_port/src/metacall-bindings.zig @@ -1235,7 +1235,7 @@ pub const metacall_pre_fork_callback_ptr = ?*const fn (?*anyopaque) callconv(.C) pub const metacall_post_fork_callback_ptr = ?*const fn (metacall_pid, ?*anyopaque) callconv(.C) c_int; pub extern fn metacall_fork_initialize() c_int; pub extern fn metacall_fork(pre_callback: metacall_pre_fork_callback_ptr, post_callback: metacall_post_fork_callback_ptr) void; -pub extern fn metacall_fork_destroy() c_int; +pub extern fn metacall_fork_destroy() void; pub const struct_metacall_initialize_configuration_type = extern struct { tag: [*c]u8 = @import("std").mem.zeroes([*c]u8), options: ?*anyopaque = @import("std").mem.zeroes(?*anyopaque), diff --git a/source/tests/detour_test/source/detour_test.cpp b/source/tests/detour_test/source/detour_test.cpp index f4009bf97..15b56ec58 100644 --- a/source/tests/detour_test/source/detour_test.cpp +++ b/source/tests/detour_test/source/detour_test.cpp @@ -61,6 +61,24 @@ const char *hook_function(void) return str_with_hook; } +/* TODO: +* This test is not going to work because detour_enumeration does not walk in +* the following sections: +* T Global text symbol +* t Local text symbol +* This funtion we are searching for is stored in: +* 0000000000073630 T test_exported_symbols_from_executable +* 00000000000736e0 t _Z13hook_functionv +* 0000000000072e34 t _Z13hook_functionv.cold +* 0000000000073680 t _Z17check_detour_hookPFPKcvE +* We can find all the sections here: https://en.wikipedia.org/wiki/Nm_(Unix) +* For listing properly all the symbols we should replicate something like +* GNU libc does under the hood for dlsym, which is implemented through do_lookup: +* https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=elf/dl-lookup.c;hb=HEAD +* We will leave this for future versions, including support for GNU hashed symbols. +*/ +#define TODO_TEST_EXPORTED_SYMBOLS_FROM_EXECUTABLE 1 + #ifdef _WIN32 #define EXPORT_SYMBOL __declspec(dllexport) #else @@ -101,6 +119,7 @@ TEST_F(detour_test, DefaultConstructor) ASSERT_NE((detour_handle)NULL, (detour_handle)handle); /* Check if it can list exported symbols from executable */ +#ifndef TODO_TEST_EXPORTED_SYMBOLS_FROM_EXECUTABLE test_exported_symbols_from_executable(3); unsigned int position = 0; @@ -120,6 +139,7 @@ TEST_F(detour_test, DefaultConstructor) } EXPECT_EQ((bool)true, (bool)found); +#endif /* Install detour */ union From 0e8dcc497aaa030c34272e315bac655968dc0b8d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Apr 2025 18:35:55 +0200 Subject: [PATCH 206/487] Start to improve node loader. --- source/loaders/node_loader/CMakeLists.txt | 70 +++++++-------- .../node_loader_win32_delay_load.h | 85 ------------------- .../node_loader/source/node_loader_impl.cpp | 49 ++++++++++- 3 files changed, 79 insertions(+), 125 deletions(-) delete mode 100644 source/loaders/node_loader/include/node_loader/node_loader_win32_delay_load.h diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index e557fba41..746b684ad 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -22,6 +22,34 @@ if(NodeJS_LIBRARY_NAME_PATH AND WIN32) file(COPY "${NodeJS_LIBRARY_NAME_PATH}" DESTINATION ${PROJECT_OUTPUT_DIR}) endif() +# Runtime (pack NodeJS DLL in windows) +# TODO: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies +# TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da +set(NodeJS_LIBRARY_DEVELOPMENT "${NodeJS_LIBRARY}") + +if(NodeJS_LIBRARY_NAME_PATH AND WIN32) + install(FILES + "${NodeJS_LIBRARY_NAME_PATH}" + DESTINATION ${INSTALL_LIB} + COMPONENT runtime + ) + + get_filename_component(NodeJS_LIBRARY_NAME "${NodeJS_LIBRARY_NAME_PATH}" NAME) + set(NodeJS_LIBRARY_DEVELOPMENT "${NodeJS_LIBRARY_NAME_PATH}") + set(NodeJS_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${NodeJS_LIBRARY_NAME}") +elseif(NodeJS_BUILD_FROM_SOURCE AND NOT WIN32) + install(FILES + "${NodeJS_LIBRARY}" + DESTINATION ${INSTALL_LIB} + COMPONENT runtime + ) + + get_filename_component(NodeJS_LIBRARY_NAME "${NodeJS_LIBRARY}" NAME) + set(NodeJS_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${NodeJS_LIBRARY_NAME}") +else() + set(NodeJS_LIBRARY_INSTALL "${NodeJS_LIBRARY}") +endif() + # # Plugin name and options # @@ -74,13 +102,6 @@ set(sources ${source_path}/node_loader_trampoline.cpp ) -if(WIN32 AND MSVC_VERSION GREATER_EQUAL 1200) - set(headers - ${headers} - ${include_path}/node_loader_win32_delay_load.h - ) -endif() - # Group source files set(header_group "Header Files (API)") set(source_group "Source Files") @@ -157,8 +178,9 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - # TODO: Replace this by /FORCE:UNRESOLVED on MSVC for later on resolving it ourselves? - $<$<CXX_COMPILER_ID:MSVC>:${NodeJS_LIBRARY}> # NodeJS library + # Delay load for MSVC + $<$<CXX_COMPILER_ID:MSVC>:libnode2> + $<$<CXX_COMPILER_ID:MSVC>:delayimp> PUBLIC ${DEFAULT_LIBRARIES} @@ -172,7 +194,6 @@ target_link_libraries(${target} target_compile_definitions(${target} PRIVATE - $<$<BOOL:${WIN32}>:NODEJS_LIBRARY_NAME="${NodeJS_LIBRARY_NAME}"> $<$<NOT:$<BOOL:${MSVC}>>:_LARGEFILE_SOURCE> $<$<NOT:$<BOOL:${MSVC}>>:_FILE_OFFSET_BITS=64> $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:_DARWIN_USE_64_BIT_INODE=1> @@ -204,6 +225,7 @@ target_compile_options(${target} target_link_options(${target} PRIVATE $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> + $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${NodeJS_LIBRARY_NAME}> PUBLIC ${DEFAULT_LINKER_OPTIONS} @@ -231,34 +253,6 @@ install(TARGETS ${target} ARCHIVE DESTINATION ${INSTALL_LIB} COMPONENT dev ) -set(NodeJS_LIBRARY_DEVELOPMENT "${NodeJS_LIBRARY}") - -# Runtime (pack NodeJS DLL in windows) -# TODO: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies -# TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da -if(NodeJS_LIBRARY_NAME_PATH AND WIN32) - install(FILES - "${NodeJS_LIBRARY_NAME_PATH}" - DESTINATION ${INSTALL_LIB} - COMPONENT runtime - ) - - get_filename_component(NodeJS_LIBRARY_NAME "${NodeJS_LIBRARY_NAME_PATH}" NAME) - set(NodeJS_LIBRARY_DEVELOPMENT "${NodeJS_LIBRARY_NAME_PATH}") - set(NodeJS_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${NodeJS_LIBRARY_NAME}") -elseif(NodeJS_BUILD_FROM_SOURCE AND NOT WIN32) - install(FILES - "${NodeJS_LIBRARY}" - DESTINATION ${INSTALL_LIB} - COMPONENT runtime - ) - - get_filename_component(NodeJS_LIBRARY_NAME "${NodeJS_LIBRARY}" NAME) - set(NodeJS_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${NodeJS_LIBRARY_NAME}") -else() - set(NodeJS_LIBRARY_INSTALL "${NodeJS_LIBRARY}") -endif() - # # Configuration # diff --git a/source/loaders/node_loader/include/node_loader/node_loader_win32_delay_load.h b/source/loaders/node_loader/include/node_loader/node_loader_win32_delay_load.h deleted file mode 100644 index 47d425cee..000000000 --- a/source/loaders/node_loader/include/node_loader/node_loader_win32_delay_load.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Loader Library by Parra Studios - * A plugin for loading nodejs code at run-time into a process. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/* -- Headers -- */ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -#include <stdlib.h> -#include <string.h> - -inline void *node_loader_hook_import_address_table(const char *module_name, const char *function_name, void *hook) -{ - LPVOID image_base = GetModuleHandle(module_name); - PIMAGE_DOS_HEADER dos_headers = (PIMAGE_DOS_HEADER)image_base; - - if (dos_headers->e_magic != IMAGE_DOS_SIGNATURE) - { - return NULL; - } - - PIMAGE_NT_HEADERS nt_headers = (PIMAGE_NT_HEADERS)((DWORD_PTR)image_base + dos_headers->e_lfanew); - - if (nt_headers->Signature != IMAGE_NT_SIGNATURE) - { - return NULL; - } - - IMAGE_DATA_DIRECTORY *imports_directory = &nt_headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT]; - - if (imports_directory->Size == 0 || imports_directory->VirtualAddress == 0) - { - return NULL; - } - - PIMAGE_IMPORT_DESCRIPTOR import_descriptor = (PIMAGE_IMPORT_DESCRIPTOR)(imports_directory->VirtualAddress + (DWORD_PTR)image_base); - - for (; import_descriptor->FirstThunk != NULL; ++import_descriptor) - { - PIMAGE_THUNK_DATA original_first_thunk = (PIMAGE_THUNK_DATA)((DWORD_PTR)image_base + import_descriptor->OriginalFirstThunk); // Image thunk data names - PIMAGE_THUNK_DATA first_thunk = (PIMAGE_THUNK_DATA)((DWORD_PTR)image_base + import_descriptor->FirstThunk); // Image thunk data address - - for (; original_first_thunk->u1.AddressOfData != NULL; ++original_first_thunk, ++first_thunk) - { - if ((original_first_thunk->u1.Ordinal & IMAGE_ORDINAL_FLAG) == 0) - { - PIMAGE_IMPORT_BY_NAME func = (PIMAGE_IMPORT_BY_NAME)((DWORD_PTR)image_base + original_first_thunk->u1.AddressOfData); - - if (strcmp(func->Name, function_name) == 0) - { - LPVOID original_address = (LPVOID)(first_thunk->u1.Function); - LPVOID import_func_load_address = (LPVOID)(&first_thunk->u1.Function); - DWORD old_page_protect, unused_old_page_protect; - - VirtualProtect(import_func_load_address, sizeof(void *), PAGE_EXECUTE_READWRITE, &old_page_protect); - - memcpy(import_func_load_address, &hook, sizeof(hook)); - - VirtualProtect(import_func_load_address, sizeof(void *), old_page_protect, &unused_old_page_protect); - - return (void *)original_address; - } - } - } - } - - return NULL; -} diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index e15575fec..2008cc111 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -899,6 +899,7 @@ static void node_loader_impl_try_destroy(loader_impl_node node_impl); /* Required for the DelayLoad hook interposition, solves bug of NodeJS extensions requiring node.exe instead of node.dll */ static HMODULE node_loader_node_dll_handle = NULL; static HMODULE (*get_module_handle_a_ptr)(_In_opt_ LPCSTR) = NULL; /* TODO: Implement W version too? */ +static detour_handle node_module_handle_a_handle = NULL; #endif /* -- Methods -- */ @@ -3690,8 +3691,38 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi /* On Windows, hook node extension loading mechanism in order to patch extensions linked to node.exe */ #if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1200) - node_loader_node_dll_handle = GetModuleHandle(NODEJS_LIBRARY_NAME); - get_module_handle_a_ptr = (HMODULE(*)(_In_opt_ LPCSTR))node_loader_hook_import_address_table("kernel32.dll", "GetModuleHandleA", &get_module_handle_a_hook); + { + /* As the library handle is correctly resolved here, either to executable, library of the executable, + or the loader dependency we can directly obtain the handle of this dependency from a function pointer */ + if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, &napi_create_reference, &node_loader_node_dll_handle)) + { + napi_throw_type_error(env, nullptr, "Failed to initialize the hooking against node extensions load mechanism"); + } + + detour d = detour_create(metacall_detour()); + + node_module_handle_a_handle = detour_load_file(d, "kernel32.dll"); + + if (node_module_handle_a_handle == NULL) + { + napi_throw_type_error(env, nullptr, "Invalid creation of the detour handle for hooking node extension load mechanism"); + } + else + { + typedef HMODULE (*get_module_handle_a_type)(_In_opt_ LPCSTR); + + union + { + get_module_handle_a_type *trampoline; + void (**ptr)(void); + } cast = { &get_module_handle_a_ptr }; + + if (detour_replace(d, node_module_handle_a_handle, "GetModuleHandleA", (void (*)(void))(&get_module_handle_a_hook), cast.ptr) != 0) + { + napi_throw_type_error(env, nullptr, "Invalid replacement of GetModuleHandle for hooking node extension load mechanism"); + } + } + } #endif /* On host mode, register delayed paths */ @@ -4628,6 +4659,20 @@ int node_loader_impl_destroy(loader_impl impl) uv_thread_join(&node_impl->thread_log_id); #endif + /* On Windows, destroy the node extension hooking mechanism */ +#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1200) + { + if (node_module_handle_a_handle != NULL) + { + detour d = detour_create(metacall_detour()); + + detour_unload(d, node_module_handle_a_handle); + + node_module_handle_a_handle = NULL; + } + } +#endif + /* Print NodeJS execution result */ log_write("metacall", LOG_LEVEL_DEBUG, "NodeJS execution return status %d", node_impl->result); From 73492ee71d57133b2c2382da05f73bceedbbcaa7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 9 Apr 2025 00:59:45 +0200 Subject: [PATCH 207/487] Improve dynlink and prepare it for managing the dependencies of the loaders. --- source/dynlink/include/dynlink/dynlink.h | 9 ++ source/dynlink/include/dynlink/dynlink_impl.h | 9 ++ .../include/dynlink/dynlink_interface.h | 4 +- source/dynlink/source/dynlink.c | 36 ++++++- source/dynlink/source/dynlink_impl.c | 15 ++- source/dynlink/source/dynlink_impl_beos.c | 18 ++-- source/dynlink/source/dynlink_impl_macos.c | 16 ++-- source/dynlink/source/dynlink_impl_unix.c | 18 ++-- source/dynlink/source/dynlink_impl_win32.c | 26 +++-- .../include/portability/portability_path.h | 2 + source/portability/source/portability_path.c | 55 +++++++++++ source/ports/node_port/CMakeLists.txt | 95 ++++++++++--------- .../source/metacall_serial_impl_serialize.c | 2 +- .../dynlink_test/source/dynlink_test.cpp | 78 ++++++++++++--- 14 files changed, 273 insertions(+), 110 deletions(-) diff --git a/source/dynlink/include/dynlink/dynlink.h b/source/dynlink/include/dynlink/dynlink.h index 57bea7ab5..3154e93fd 100644 --- a/source/dynlink/include/dynlink/dynlink.h +++ b/source/dynlink/include/dynlink/dynlink.h @@ -36,6 +36,15 @@ extern "C" { /* -- Methods -- */ +/** +* @brief +* Get the library prefix for specified platform (normally "lib") +* +* @return +* A constant string pointer to the platform prefix +*/ +DYNLINK_API const char *dynlink_prefix(void); + /** * @brief * Get the library extension for specified platform diff --git a/source/dynlink/include/dynlink/dynlink_impl.h b/source/dynlink/include/dynlink/dynlink_impl.h index f6af1d6fb..69696a55d 100644 --- a/source/dynlink/include/dynlink/dynlink_impl.h +++ b/source/dynlink/include/dynlink/dynlink_impl.h @@ -35,6 +35,15 @@ extern "C" { /* -- Methods -- */ +/** +* @brief +* Dynamically linked shared object handle prefix implementation (normally "lib") +* +* @return +* A const string reference to the prefix depending on the OS implementation +*/ +DYNLINK_API const char *dynlink_impl_prefix(void); + /** * @brief * Dynamically linked shared object handle extension implementation diff --git a/source/dynlink/include/dynlink/dynlink_interface.h b/source/dynlink/include/dynlink/dynlink_interface.h index 80b34fc39..f9b55e1d6 100644 --- a/source/dynlink/include/dynlink/dynlink_interface.h +++ b/source/dynlink/include/dynlink/dynlink_interface.h @@ -54,16 +54,16 @@ extern "C" { typedef dynlink_symbol_addr *dynlink_symbol_addr_ptr; +typedef const char *(*dynlink_impl_interface_prefix)(void); typedef const char *(*dynlink_impl_interface_extension)(void); -typedef void (*dynlink_impl_interface_get_name)(dynlink_name, dynlink_name_impl, size_t); typedef dynlink_impl (*dynlink_impl_interface_load)(dynlink); typedef int (*dynlink_impl_interface_symbol)(dynlink, dynlink_impl, dynlink_symbol_name, dynlink_symbol_addr_ptr); typedef int (*dynlink_impl_interface_unload)(dynlink, dynlink_impl); struct dynlink_impl_interface_type { + dynlink_impl_interface_prefix prefix; dynlink_impl_interface_extension extension; - dynlink_impl_interface_get_name get_name; dynlink_impl_interface_load load; dynlink_impl_interface_symbol symbol; dynlink_impl_interface_unload unload; diff --git a/source/dynlink/source/dynlink.c b/source/dynlink/source/dynlink.c index 57a70b238..ced93d585 100644 --- a/source/dynlink/source/dynlink.c +++ b/source/dynlink/source/dynlink.c @@ -43,6 +43,11 @@ struct dynlink_type /* -- Methods -- */ +const char *dynlink_prefix(void) +{ + return dynlink_impl_prefix(); +} + const char *dynlink_extension(void) { return dynlink_impl_extension(); @@ -94,13 +99,33 @@ dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_flags flags) dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags) { dynlink handle = malloc(sizeof(struct dynlink_type)); + size_t path_size, name_size, prefix_length; + const char *prefix = dynlink_prefix(); if (handle == NULL) { return NULL; } - strncpy(handle->name_impl, path, strnlen(path, PORTABILITY_PATH_SIZE) + 1); + path_size = strnlen(path, PORTABILITY_PATH_SIZE) + 1; + + strncpy(handle->name_impl, path, path_size); + + /* Get the library name without any extension */ + name_size = portability_path_get_name_canonical(path, path_size, handle->name, PORTABILITY_PATH_SIZE); + + /* Remove the library prefix */ + prefix_length = strlen(prefix); + + if (strncmp(prefix, handle->name, prefix_length) == 0) + { + size_t current, next = prefix_length, end = name_size - prefix_length; + + for (current = 0; current < end; ++current, ++next) + { + handle->name[current] = handle->name[next]; + } + } DYNLINK_FLAGS_SET(handle->flags, flags); @@ -125,10 +150,19 @@ dynlink dynlink_load_self(dynlink_flags flags) return NULL; } + /* Retrieve the executable path for the full name */ portability_executable_path(handle->name_impl, &path_length); + + /* Get the name without the extension */ portability_path_get_name(handle->name_impl, path_length + 1, handle->name, PORTABILITY_PATH_SIZE); + + /* Set the flags with the additional special flag for itself, + this will help to identify that the handle loaded is the current executable + and behave accordingly depending on the implementation + */ DYNLINK_FLAGS_SET(handle->flags, flags); DYNLINK_FLAGS_ADD(handle->flags, DYNLINK_FLAGS_BIND_SELF); + handle->impl = dynlink_impl_load(handle); if (handle->impl == NULL) diff --git a/source/dynlink/source/dynlink_impl.c b/source/dynlink/source/dynlink_impl.c index 86092ad43..bd0fd942c 100644 --- a/source/dynlink/source/dynlink_impl.c +++ b/source/dynlink/source/dynlink_impl.c @@ -28,6 +28,13 @@ /* -- Methods -- */ +const char *dynlink_impl_prefix(void) +{ + dynlink_impl_interface_singleton_ptr singleton = dynlink_interface(); + + return singleton()->prefix(); +} + const char *dynlink_impl_extension(void) { dynlink_impl_interface_singleton_ptr singleton = dynlink_interface(); @@ -39,9 +46,13 @@ void dynlink_impl_get_name(dynlink_name name, dynlink_name_impl name_impl, size_ { if (name != NULL && name_impl != NULL && size > 1) { - dynlink_impl_interface_singleton_ptr singleton = dynlink_interface(); + strncpy(name_impl, dynlink_impl_prefix(), size); + + strncat(name_impl, name, size - 1); + + strncat(name_impl, ".", size - 1); - singleton()->get_name(name, name_impl, size); + strncat(name_impl, dynlink_impl_extension(), size - 1); } } diff --git a/source/dynlink/source/dynlink_impl_beos.c b/source/dynlink/source/dynlink_impl_beos.c index 6a5e225f1..60688b5b7 100644 --- a/source/dynlink/source/dynlink_impl_beos.c +++ b/source/dynlink/source/dynlink_impl_beos.c @@ -31,22 +31,18 @@ /* -- Methods -- */ -const char *dynlink_impl_interface_extension_beos(void) +const char *dynlink_impl_interface_prefix_beos(void) { - static const char extension_beos[] = "so"; + static const char prefix_beos[] = "lib"; - return extension_beos; + return prefix_beos; } -void dynlink_impl_interface_get_name_beos(dynlink_name name, dynlink_name_impl name_impl, size_t size) +const char *dynlink_impl_interface_extension_beos(void) { - strncpy(name_impl, "lib", size); - - strncat(name_impl, name, size - 1); - - strncat(name_impl, ".", size - 1); + static const char extension_beos[] = "so"; - strncat(name_impl, dynlink_impl_extension(), size - 1); + return extension_beos; } dynlink_impl dynlink_impl_interface_load_beos(dynlink handle) @@ -124,8 +120,8 @@ int dynlink_impl_interface_unload_beos(dynlink handle, dynlink_impl impl) dynlink_impl_interface dynlink_impl_interface_singleton(void) { static struct dynlink_impl_interface_type impl_interface_beos = { + &dynlink_impl_interface_prefix_beos, &dynlink_impl_interface_extension_beos, - &dynlink_impl_interface_get_name_beos, &dynlink_impl_interface_load_beos, &dynlink_impl_interface_symbol_beos, &dynlink_impl_interface_unload_beos, diff --git a/source/dynlink/source/dynlink_impl_macos.c b/source/dynlink/source/dynlink_impl_macos.c index b09c8e078..c210c9bd3 100644 --- a/source/dynlink/source/dynlink_impl_macos.c +++ b/source/dynlink/source/dynlink_impl_macos.c @@ -38,20 +38,18 @@ static void *dynlink_impl_global_handle_macos = NULL; /* -- Methods -- */ -const char *dynlink_impl_interface_extension_macos(void) +const char *dynlink_impl_interface_prefix_macos(void) { - static const char extension_macos[] = "dylib"; + static const char prefix_macos[] = "lib"; - return extension_macos; + return prefix_macos; } -void dynlink_impl_interface_get_name_macos(dynlink_name name, dynlink_name_impl name_impl, size_t size) +const char *dynlink_impl_interface_extension_macos(void) { - strncpy(name_impl, name, size); - - strncat(name_impl, ".", size - 1); + static const char extension_macos[] = "dylib"; - strncat(name_impl, dynlink_impl_extension(), size - 1); + return extension_macos; } dynlink_impl dynlink_impl_interface_load_macos(dynlink handle) @@ -193,8 +191,8 @@ int dynlink_impl_interface_unload_macos(dynlink handle, dynlink_impl impl) dynlink_impl_interface dynlink_impl_interface_singleton(void) { static struct dynlink_impl_interface_type impl_interface_macos = { + &dynlink_impl_interface_prefix_macos, &dynlink_impl_interface_extension_macos, - &dynlink_impl_interface_get_name_macos, &dynlink_impl_interface_load_macos, &dynlink_impl_interface_symbol_macos, &dynlink_impl_interface_unload_macos, diff --git a/source/dynlink/source/dynlink_impl_unix.c b/source/dynlink/source/dynlink_impl_unix.c index df74485c1..b6a234abe 100644 --- a/source/dynlink/source/dynlink_impl_unix.c +++ b/source/dynlink/source/dynlink_impl_unix.c @@ -42,22 +42,18 @@ /* -- Methods -- */ -const char *dynlink_impl_interface_extension_unix(void) +const char *dynlink_impl_interface_prefix_unix(void) { - static const char extension_unix[] = "so"; + static const char prefix_unix[] = "lib"; - return extension_unix; + return prefix_unix; } -void dynlink_impl_interface_get_name_unix(dynlink_name name, dynlink_name_impl name_impl, size_t size) +const char *dynlink_impl_interface_extension_unix(void) { - strncpy(name_impl, "lib", size); - - strncat(name_impl, name, size - 1); - - strncat(name_impl, ".", size - 1); + static const char extension_unix[] = "so"; - strncat(name_impl, dynlink_impl_extension(), size - 1); + return extension_unix; } dynlink_impl dynlink_impl_interface_load_unix(dynlink handle) @@ -142,8 +138,8 @@ int dynlink_impl_interface_unload_unix(dynlink handle, dynlink_impl impl) dynlink_impl_interface dynlink_impl_interface_singleton(void) { static struct dynlink_impl_interface_type impl_interface_unix = { + &dynlink_impl_interface_prefix_unix, &dynlink_impl_interface_extension_unix, - &dynlink_impl_interface_get_name_unix, &dynlink_impl_interface_load_unix, &dynlink_impl_interface_symbol_unix, &dynlink_impl_interface_unload_unix, diff --git a/source/dynlink/source/dynlink_impl_win32.c b/source/dynlink/source/dynlink_impl_win32.c index 5d0af2a0e..9d3ec0425 100644 --- a/source/dynlink/source/dynlink_impl_win32.c +++ b/source/dynlink/source/dynlink_impl_win32.c @@ -32,26 +32,22 @@ /* -- Methods -- */ -const char *dynlink_impl_interface_extension_win32(void) -{ - static const char extension_win32[] = "dll"; - - return extension_win32; -} - -void dynlink_impl_interface_get_name_win32(dynlink_name name, dynlink_name_impl name_impl, size_t size) +const char *dynlink_impl_interface_prefix_win32(void) { #if defined(__MINGW32__) || defined(__MINGW64__) - strncpy(name_impl, "lib", size); - - strncat(name_impl, name, size - 1); + static const char prefix_win32[] = "lib"; #else - strncpy(name_impl, name, size); + static const char prefix_win32[] = ""; #endif - strncat(name_impl, ".", size - 1); + return prefix_win32; +} - strncat(name_impl, dynlink_impl_extension(), size - 1); +const char *dynlink_impl_interface_extension_win32(void) +{ + static const char extension_win32[] = "dll"; + + return extension_win32; } dynlink_impl dynlink_impl_interface_load_win32(dynlink handle) @@ -121,8 +117,8 @@ int dynlink_impl_interface_unload_win32(dynlink handle, dynlink_impl impl) dynlink_impl_interface dynlink_impl_interface_singleton(void) { static struct dynlink_impl_interface_type impl_interface_win32 = { + &dynlink_impl_interface_prefix_win32, &dynlink_impl_interface_extension_win32, - &dynlink_impl_interface_get_name_win32, &dynlink_impl_interface_load_win32, &dynlink_impl_interface_symbol_win32, &dynlink_impl_interface_unload_win32, diff --git a/source/portability/include/portability/portability_path.h b/source/portability/include/portability/portability_path.h index 36885514a..79ff0761b 100644 --- a/source/portability/include/portability/portability_path.h +++ b/source/portability/include/portability/portability_path.h @@ -111,6 +111,8 @@ extern "C" { PORTABILITY_API size_t portability_path_get_name(const char *path, size_t path_size, char *name, size_t name_size); +PORTABILITY_API size_t portability_path_get_name_canonical(const char *path, size_t path_size, char *name, size_t name_size); + PORTABILITY_API size_t portability_path_get_fullname(const char *path, size_t path_size, char *name, size_t name_size); PORTABILITY_API size_t portability_path_get_extension(const char *path, size_t path_size, char *extension, size_t extension_size); diff --git a/source/portability/source/portability_path.c b/source/portability/source/portability_path.c index 9e5232c27..ea96ca764 100644 --- a/source/portability/source/portability_path.c +++ b/source/portability/source/portability_path.c @@ -73,6 +73,61 @@ size_t portability_path_get_name(const char *path, size_t path_size, char *name, return last + 1; } +size_t portability_path_get_name_canonical(const char *path, size_t path_size, char *name, size_t name_size) +{ + if (path == NULL || name == NULL) + { + return 0; + } + + size_t i, count, last; + + for (i = 0, count = 0, last = 0; path[i] != '\0' && i < path_size && count < name_size; ++i) + { + name[count++] = path[i]; + + if (PORTABILITY_PATH_SEPARATOR(path[i])) + { + count = 0; + } + else if (path[i] == '.') + { + if (i > 0 && path[i - 1] == '.') + { + last = 0; + count = 0; + } + else + { + if (count > 0) + { + last = count - 1; + } + else + { + last = 0; + } + + /* This function is the same as portability_path_get_name but + returns the name of the file without any extension, for example: + - portability_path_get_name of libnode.so.72 is libnode.so + - portability_path_get_name_canonical of libnode.so.72 is libnode + */ + break; + } + } + } + + if (last == 0 && count > 1) + { + last = count; + } + + name[last] = '\0'; + + return last + 1; +} + size_t portability_path_get_fullname(const char *path, size_t path_size, char *name, size_t name_size) { if (path == NULL || name == NULL) diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index 5ddccd023..4fb44685c 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -89,7 +89,7 @@ install(FILES # # Check if loaders are enabled -if(NOT OPTION_BUILD_CLI OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_LOADERS_TS OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_RB OR NOT OPTION_BUILD_SCRIPTS_TS) +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_LOADERS_TS OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_RB OR NOT OPTION_BUILD_SCRIPTS_TS) return() endif() @@ -116,30 +116,9 @@ if(OPTION_BUILD_THREAD_SANITIZER AND OPTION_BUILD_LOADERS_CS) endif() # -# Define test +# Define environment variables # -set(node_port_test "${target}_test") - -message(STATUS "Test ${node_port_test}") - -add_test(NAME ${target} - COMMAND ${CMAKE_COMMAND} -D "EXECUTABLE=$<TARGET_FILE:metacallcli>" -D "INPUT=${CMAKE_CURRENT_SOURCE_DIR}/test/commands/node_port.txt" -P "${CMAKE_SOURCE_DIR}/source/cli/metacallcli/test/commands/command_runner.cmake" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - -# -# Define test labels -# - -set_property(TEST ${target} - PROPERTY LABELS ${node_port_test} -) - -set_tests_properties(${target} PROPERTIES - PASS_REGULAR_EXPRESSION "Tests passed without errors" -) - include(TestEnvironmentVariables) # Enable cobol test if it is built @@ -160,19 +139,7 @@ if(OPTION_BUILD_LOADERS_RS) set(TESTS_ENVIRONMENT_VARIABLES_RS "OPTION_BUILD_LOADERS_RS=1") endif() -# Add dependencies and optional dependencies -add_dependencies(${target} - node_loader - mock_loader - py_loader - rb_loader - ts_loader - ${COBOL_DEPENDENCY} - ${C_DEPENDENCY} - ${RS_DEPENDENCY} -) - -# Disable OpenSSL related tests if versions are incompatible +# Disable OpenSSL related tests if versions are incompatible (TODO: Review this bug and remove the workaround if possible) set(NodeJS_EXECUTABLE_ONLY ON) find_package(NodeJS) @@ -207,14 +174,54 @@ if(NodeJS_FOUND AND Python_Interpreter_FOUND) endif() endif() -test_environment_variables(${target} - "" - ${TESTS_ENVIRONMENT_VARIABLES} - ${TESTS_ENVIRONMENT_VARIABLES_COB} - ${TESTS_ENVIRONMENT_VARIABLES_C} - ${TESTS_ENVIRONMENT_VARIABLES_RS} - ${TESTS_ENVIRONMENT_VARIABLES_OPENSSL} -) +# +# Test importing NodeJS Port from CLI +# + +set(node_port_test "${target}_test") + +if(OPTION_BUILD_CLI) + message(STATUS "Test ${node_port_test}") + + add_test(NAME ${target} + COMMAND ${CMAKE_COMMAND} -D "EXECUTABLE=$<TARGET_FILE:metacallcli>" -D "INPUT=${CMAKE_CURRENT_SOURCE_DIR}/test/commands/node_port.txt" -P "${CMAKE_SOURCE_DIR}/source/cli/metacallcli/test/commands/command_runner.cmake" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + + # + # Define test labels + # + + set_property(TEST ${target} + PROPERTY LABELS ${node_port_test} + ) + + set_tests_properties(${target} PROPERTIES + PASS_REGULAR_EXPRESSION "Tests passed without errors" + ) + + # Add dependencies and optional dependencies + add_dependencies(${target} + node_loader + mock_loader + py_loader + rb_loader + ts_loader + ${COBOL_DEPENDENCY} + ${C_DEPENDENCY} + ${RS_DEPENDENCY} + ) + + # Environment variables + test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} + ${TESTS_ENVIRONMENT_VARIABLES_COB} + ${TESTS_ENVIRONMENT_VARIABLES_C} + ${TESTS_ENVIRONMENT_VARIABLES_RS} + ${TESTS_ENVIRONMENT_VARIABLES_OPENSSL} + ) +endif() # # Test importing NodeJS Port from node.exe diff --git a/source/serials/metacall_serial/source/metacall_serial_impl_serialize.c b/source/serials/metacall_serial/source/metacall_serial_impl_serialize.c index e618f935e..16dd1d267 100644 --- a/source/serials/metacall_serial/source/metacall_serial_impl_serialize.c +++ b/source/serials/metacall_serial/source/metacall_serial_impl_serialize.c @@ -221,7 +221,7 @@ void metacall_serial_impl_serialize_array(value v, char *dest, size_t size, cons (void)format; - /* Calculate sum of all array values lenght */ + /* Calculate sum of all array values length */ for (iterator = 0; iterator < array_size; ++iterator) { value current_value = array_value[iterator]; diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index ae8813715..5bf29f76c 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -28,7 +28,7 @@ #define DYNLINK_TEST_LIBRARY_PATH "DYNLINK_TEST_LIBRARY_PATH" -typedef void (*mock_loader_print_func)(void); +typedef void (*dynlink_print_func)(void); class dynlink_test : public testing::Test { @@ -60,39 +60,41 @@ TEST_F(dynlink_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object extension: %s", dynlink_extension()); - /* Test library loading */ - { #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - const char library_name[] = "mock_loaderd"; + const char library_name[] = "dynlinkd"; #else - const char library_name[] = "mock_loader"; + const char library_name[] = "dynlink"; #endif - char *path = environment_variable_path_create(DYNLINK_TEST_LIBRARY_PATH, NULL, 0, NULL); + char *path = environment_variable_path_create(DYNLINK_TEST_LIBRARY_PATH, NULL, 0, NULL); - dynlink handle = dynlink_load(path, library_name, DYNLINK_FLAGS_BIND_NOW | DYNLINK_FLAGS_BIND_GLOBAL); + ASSERT_NE((char *)path, (char *)NULL); - environment_variable_path_destroy(path); + /* Test library loading */ + { + dynlink handle = dynlink_load(path, library_name, DYNLINK_FLAGS_BIND_NOW | DYNLINK_FLAGS_BIND_GLOBAL); ASSERT_NE(handle, (dynlink)NULL); log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_name_impl(handle)); + EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); + if (handle != NULL) { - dynlink_symbol_addr mock_loader_print_info_addr; + dynlink_symbol_addr dynlink_print_info_addr; - EXPECT_EQ((int)0, dynlink_symbol(handle, "mock_loader_print_info", &mock_loader_print_info_addr)); + EXPECT_EQ((int)0, dynlink_symbol(handle, "dynlink_print_info", &dynlink_print_info_addr)); - if (mock_loader_print_info_addr != NULL) + if (dynlink_print_info_addr != NULL) { - mock_loader_print_func print = mock_loader_print_info_addr; + dynlink_print_func print = dynlink_print_info_addr; log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); - log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)mock_loader_print_info_addr); + log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)dynlink_print_info_addr); - if (mock_loader_print_info_addr != NULL) + if (dynlink_print_info_addr != NULL) { log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); } @@ -122,4 +124,52 @@ TEST_F(dynlink_test, DefaultConstructor) dynlink_unload(proc); /* Should do nothing except by freeing the handle */ } + + /* Test loading symbols from absolute path */ + { + char library_name_platform[PORTABILITY_PATH_SIZE]; + char absolute_path[PORTABILITY_PATH_SIZE]; + + dynlink_platform_name(library_name, library_name_platform); + + portability_path_join(path, strlen(path) + 1, library_name_platform, strlen(library_name_platform) + 1, absolute_path, PORTABILITY_PATH_SIZE); + + dynlink handle = dynlink_load_absolute(absolute_path, DYNLINK_FLAGS_BIND_NOW | DYNLINK_FLAGS_BIND_GLOBAL); + + ASSERT_NE(handle, (dynlink)NULL); + + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object absolute path: %s", absolute_path); + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file name: %s", dynlink_get_name_impl(handle)); + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_name(handle)); + + EXPECT_EQ((int)0, (int)strcmp(absolute_path, dynlink_get_name_impl(handle))); + EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); + + if (handle != NULL) + { + dynlink_symbol_addr dynlink_print_info_addr; + + EXPECT_EQ((int)0, dynlink_symbol(handle, "dynlink_print_info", &dynlink_print_info_addr)); + + if (dynlink_print_info_addr != NULL) + { + dynlink_print_func print = dynlink_print_info_addr; + + log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); + + log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)dynlink_print_info_addr); + + if (dynlink_print_info_addr != NULL) + { + log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); + } + + print(); + } + + dynlink_unload(handle); + } + } + + environment_variable_path_destroy(path); } From 70de2c43c63a6a4349a236881b73ba31f624672d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 9 Apr 2025 18:13:45 +0200 Subject: [PATCH 208/487] Add loading of the dependencies. --- source/loader/source/loader.c | 13 +- source/loader/source/loader_impl.c | 203 ++++++++++++++++-- source/portability/CMakeLists.txt | 2 + .../portability/portability_dependency.h | 44 ++++ .../portability/source/portability_atexit.c | 1 + .../source/portability_dependency.c | 135 ++++++++++++ 6 files changed, 373 insertions(+), 25 deletions(-) create mode 100644 source/portability/include/portability/portability_dependency.h create mode 100644 source/portability/source/portability_dependency.c diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 02ec13573..2db2b641b 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -265,9 +265,9 @@ plugin loader_get_impl_plugin(const loader_tag tag) } /* Dynamic link loader dependencies if it is not host */ - if (loader_impl_get_option_host(impl) == 0) + if (loader_impl_dependencies(impl) != 0) { - loader_impl_dependencies(impl); + goto plugin_manager_create_error; } /* Dynamic link the loader */ @@ -278,6 +278,15 @@ plugin loader_get_impl_plugin(const loader_tag tag) goto plugin_manager_create_error; } + /* If it is host, relink the loader symbols to the host (either the executable or a library) */ + if (loader_impl_get_option_host(impl) == 1) + { + // if (loader_impl_relink(impl) != 0) + // { + // goto plugin_manager_create_error; + // } + } + /* Store in the loader implementation the reference to the plugin which belongs to */ loader_impl_attach(impl, p); diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 2ad8034d8..24d6045a7 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -36,6 +36,8 @@ #include <configuration/configuration.h> +#include <portability/portability_dependency.h> + #include <stdlib.h> #include <string.h> @@ -90,6 +92,7 @@ struct loader_impl_type value options; /* Additional initialization options passed in the initialize phase */ set exec_path_map; /* Set of execution paths passed by the end user */ configuration config; /* Reference to the loader configuration, it contains execution_paths, dependencies and additional info */ + set dependencies_map; /* List of handles (dynlink) to the dependencies of the loader */ }; struct loader_handle_impl_type @@ -120,6 +123,14 @@ struct loader_impl_metadata_cb_iterator_type static loader_impl loader_impl_allocate(const loader_tag tag); +static void loader_impl_configuration_execution_paths(loader_impl_interface iface, loader_impl impl); + +static int loader_impl_dependencies_self_list(const char *library, void *data); + +static int loader_impl_dependencies_self_find(loader_impl impl, const char *key_str, vector dependencies_self); + +static int loader_impl_dependencies_load(loader_impl impl, const char *key_str, value *paths_array, size_t paths_size); + static configuration loader_impl_initialize_configuration(const loader_tag tag); static int loader_impl_initialize_registered(plugin_manager manager, plugin p); @@ -208,8 +219,17 @@ loader_impl loader_impl_allocate(const loader_tag tag) goto alloc_exec_path_map_error; } + impl->dependencies_map = set_create(&hash_callback_str, &comparable_callback_str); + + if (impl->dependencies_map == NULL) + { + goto alloc_dependencies_map_error; + } + return impl; +alloc_dependencies_map_error: + set_destroy(impl->exec_path_map); alloc_exec_path_map_error: context_destroy(impl->ctx); alloc_ctx_error: @@ -289,15 +309,113 @@ void loader_impl_configuration_execution_paths(loader_impl_interface iface, load } } +int loader_impl_dependencies_self_list(const char *library, void *data) +{ + vector dependencies_self = (vector)data; + + vector_push_back_empty(dependencies_self); + + strncpy(vector_back(dependencies_self), library, strnlen(library, PORTABILITY_PATH_SIZE)); + + return 0; +} + +int loader_impl_dependencies_self_find(loader_impl impl, const char *key_str, vector dependencies_self) +{ + size_t iterator, size = vector_size(dependencies_self); + char library_self_name[PORTABILITY_PATH_SIZE]; + + for (iterator = 0; iterator < size; ++iterator) + { + const char *library_self = vector_at(dependencies_self, iterator); + + /* Get the name of the library */ + portability_path_get_fullname(library_self, strnlen(library_self, PORTABILITY_PATH_SIZE) + 1, library_self_name, PORTABILITY_PATH_SIZE); + + /* Try to find the dependency name in the library */ + if (strstr(library_self_name, key_str) != NULL) + { + dynlink handle = dynlink_load_absolute(library_self, DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); + + if (handle != NULL && set_insert(impl->dependencies_map, (const set_key)key_str, (set_value)handle) == 0) + { + return 0; + } + + dynlink_unload(handle); + + return 1; + } + } + + return 1; +} + +int loader_impl_dependencies_load(loader_impl impl, const char *key_str, value *paths_array, size_t paths_size) +{ + size_t iterator; + + for (iterator = 0; iterator < paths_size; ++iterator) + { + if (value_type_id(paths_array[iterator]) == TYPE_STRING) + { + const char *library_path = value_to_string(paths_array[iterator]); + + if (library_path != NULL) + { + dynlink handle = dynlink_load_absolute(library_path, DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); + + if (handle != NULL && set_insert(impl->dependencies_map, (const set_key)key_str, (set_value)handle) == 0) + { + return 0; + } + + dynlink_unload(handle); + } + } + } + + return 1; +} + int loader_impl_dependencies(loader_impl impl) { - /* Dependencies have the following format */ - /* + const int host = loader_impl_get_option_host(impl); + + /* Dependencies have the following format: + { "dependencies": { "node": ["/usr/lib/x86_64-linux-gnu/libnode.so.72"] } } + + The algorithm works in the following way: + 1) If current loader is the host: + - Take the dependency name and try to find if it is already + loaded as a library in the current process, for example: + + "dependencies": { + "node": ["/usr/lib/x86_64-linux-gnu/libnode.so.72"] + } + + Will search for all libraries, looking for the library name + with the following substring (lib)node, so if we find: + + "/usr/lib/x86_64-linux-gnu/libnode.so.108" + + It will test against libnode.so.108 the substring (lib)node. + + - If it has not been found, then get the handle of the current process. + + 2) Otherwise, the current loader is not the host: + - Iterate the dependencies and if they are properly loaded, index + them by name in the dependency map, for example: + + [ Key ] => [ Value ] + "node" => "/usr/lib/x86_64-linux-gnu/libnode.so.72" + + The value in this case will be the library loaded, instead of the full path. */ value dependencies_value = configuration_value_type(impl->config, "dependencies", TYPE_MAP); @@ -305,49 +423,67 @@ int loader_impl_dependencies(loader_impl impl) { size_t size = value_type_count(dependencies_value); value *dependencies_map = value_to_map(dependencies_value); + vector dependencies_self = NULL; size_t iterator; + /* In case of host, get all loaded dependencies into an array */ + if (host == 1) + { + dependencies_self = vector_create(sizeof(char) * PORTABILITY_PATH_SIZE); + + if (dependencies_self == NULL) + { + return 1; + } + + if (portability_dependendency_iterate(&loader_impl_dependencies_self_list, (void *)dependencies_self) != 0) + { + vector_destroy(dependencies_self); + return 1; + } + } + + /* Iterate through the dependencies */ for (iterator = 0; iterator < size; ++iterator) { if (value_type_id(dependencies_map[iterator]) == TYPE_ARRAY) { value *library_tuple = value_to_array(dependencies_map[iterator]); - if (value_type_id(library_tuple[1]) == TYPE_ARRAY) + if (value_type_id(library_tuple[0]) == TYPE_STRING) { - value *paths_array = value_to_array(library_tuple[1]); - size_t paths_size = value_type_count(library_tuple[1]); - size_t path; - int found = 0; + const char *key_str = value_to_string(library_tuple[0]); - for (path = 0; path < paths_size; ++path) + if (host == 0) { - if (value_type_id(paths_array[iterator]) == TYPE_STRING) + /* If the loader is not the host, iterate through all dependencies and load them */ + if (value_type_id(library_tuple[1]) == TYPE_ARRAY) { - const char *library_path = value_to_string(paths_array[iterator]); + value *paths_array = value_to_array(library_tuple[1]); + size_t paths_size = value_type_count(library_tuple[1]); - if (library_path != NULL) + if (loader_impl_dependencies_load(impl, key_str, paths_array, paths_size) != 0) { - dynlink handle = dynlink_load_absolute(library_path, DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); - - if (handle != NULL) - { - found = 1; - break; - } + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load dependency '%s' from loader configuration '%s.json'", key_str, plugin_name(impl->p)); + return 1; } } } - - if (!found) + else { - const char *dependency = value_type_id(library_tuple[0]) == TYPE_STRING ? value_to_string(library_tuple[0]) : "unknown_library"; - log_write("metacall", LOG_LEVEL_ERROR, "Failed to load dependency '%s' from loader configuration '%s.json'", dependency, plugin_name(impl->p)); - return 1; + /* Otherwise try to find if the library is already loaded, and if not, load the process */ + if (loader_impl_dependencies_self_find(impl, key_str, dependencies_self) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load dependency '%s' from loader '%s' as a host", key_str, plugin_name(impl->p)); + vector_destroy(dependencies_self); + return 1; + } } } } } + + vector_destroy(dependencies_self); } return 0; @@ -1580,6 +1716,22 @@ int loader_impl_destroy_exec_path_map_cb_iterate(set s, set_key key, set_value v return 0; } +int loader_impl_destroy_dependencies_map_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) +{ + (void)s; + (void)key; + (void)args; + + if (val != NULL) + { + dynlink dependency = val; + + dynlink_unload(dependency); + } + + return 0; +} + void loader_impl_destroy_objects(loader_impl impl) { /* This iterates through all functions, classes objects and types, @@ -1637,6 +1789,11 @@ void loader_impl_destroy_deallocate(loader_impl impl) value_type_destroy(impl->options); } + /* Unload all the dependencies when everything has been destroyed and the loader is unloaded */ + set_iterate(impl->dependencies_map, &loader_impl_destroy_dependencies_map_cb_iterate, NULL); + + set_destroy(impl->dependencies_map); + free(impl); } diff --git a/source/portability/CMakeLists.txt b/source/portability/CMakeLists.txt index 1855258d2..b6baba4a8 100644 --- a/source/portability/CMakeLists.txt +++ b/source/portability/CMakeLists.txt @@ -41,6 +41,7 @@ set(headers ${include_path}/portability_working_path.h ${include_path}/portability_path.h ${include_path}/portability_atexit.h + ${include_path}/portability_dependency.h ) set(sources @@ -50,6 +51,7 @@ set(sources ${source_path}/portability_working_path.c ${source_path}/portability_path.c ${source_path}/portability_atexit.c + ${source_path}/portability_dependency.c ) # Group source files diff --git a/source/portability/include/portability/portability_dependency.h b/source/portability/include/portability/portability_dependency.h new file mode 100644 index 000000000..2fbf4cce2 --- /dev/null +++ b/source/portability/include/portability/portability_dependency.h @@ -0,0 +1,44 @@ +/* + * Portability Library by Parra Studios + * A generic cross-platform portability utility. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef PORTABILITY_DEPENDENCY_H +#define PORTABILITY_DEPENDENCY_H 1 + +/* -- Headers -- */ + +#include <portability/portability_api.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* -- Type Definitions -- */ + +typedef int (*portability_dependendency_iterate_cb)(const char *library, void *data); + +/* -- Methods -- */ + +int portability_dependendency_iterate(portability_dependendency_iterate_cb callback, void *data); + +#ifdef __cplusplus +} +#endif + +#endif /* PORTABILITY_DEPENDENCY_H */ diff --git a/source/portability/source/portability_atexit.c b/source/portability/source/portability_atexit.c index 5dafc48a9..ee18e7795 100644 --- a/source/portability/source/portability_atexit.c +++ b/source/portability/source/portability_atexit.c @@ -54,6 +54,7 @@ static void portability_atexit_destroy(void) } free(prev); + } while (atexit_list != NULL); atexit_list = NULL; diff --git a/source/portability/source/portability_dependency.c b/source/portability/source/portability_dependency.c new file mode 100644 index 000000000..55e633de4 --- /dev/null +++ b/source/portability/source/portability_dependency.c @@ -0,0 +1,135 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* -- Headers -- */ + +#include <portability/portability_dependency.h> + +#include <stddef.h> + +#if defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ + defined(__FreeBSD__) + + #ifndef _GNU_SOURCE + #define _GNU_SOURCE + #endif + #include <link.h> + +#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) + + #include <mach-o/dyld.h> + +#elif defined(WIN32) || defined(_WIN32) + + #include <psapi.h> + #include <windows.h> + +#else + #error "Unsupported platform for portability_dependendency_iterate" +#endif + +#if defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ + defined(__FreeBSD__) + +/* -- Type Definitions -- */ + +typedef struct portability_dependendency_iterate_phdr_type *portability_dependendency_iterate_phdr; + +/* -- Member Data -- */ + +struct portability_dependendency_iterate_phdr_type +{ + portability_dependendency_iterate_cb callback; + void *data; +}; + +/* -- Private Methods -- */ + +static int portability_dependendency_iterate_phdr_callback(struct dl_phdr_info *info, size_t size, void *data) +{ + portability_dependendency_iterate_phdr phdr = (portability_dependendency_iterate_phdr)data; + + (void)size; + + return phdr->callback(info->dlpi_name, phdr->data); +} + +#endif + +int portability_dependendency_iterate(portability_dependendency_iterate_cb callback, void *data) +{ + if (callback == NULL) + { + return 1; + } + +#if defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ + defined(__FreeBSD__) + { + struct portability_dependendency_iterate_phdr_type phdr = { + callback, + data + }; + + return dl_iterate_phdr(&portability_dependendency_iterate_phdr_callback, (void *)&phdr); + } +#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) + { + uint32_t iterator, size = _dyld_image_count(); + + for (iterator = 0; iterator < size; ++iterator) + { + const char *image_name = _dyld_get_image_name(iterator); + + if (callback(image_name, data) != 0) + { + return 1; + } + } + + return 0; + } +#elif defined(WIN32) || defined(_WIN32) + { + HANDLE process = GetCurrentProcess(); + HMODULE modules[1024]; + DWORD modules_size; + + if (EnumProcessModules(process, modules, sizeof(modules), &modules_size)) + { + size_t iterator, size = modules_size / sizeof(HMODULE); + char module_name[MAX_PATH]; + + for (iterator = 0; i < size; ++iterator) + { + if (GetModuleFileNameExA(process, modules[iterator], module_name, sizeof(module_name) / sizeof(char))) + { + if (callback(module_name, data) != 0) + { + return 1; + } + } + } + } + + return 0; + } +#endif +} From 7c43f635e7ee0bf93aa1f80ed1bc7c391c288f88 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 9 Apr 2025 22:29:59 +0200 Subject: [PATCH 209/487] Improve the implementation. --- .../environment/source/environment_variable.c | 2 +- source/loader/include/loader/loader_impl.h | 2 + source/loader/source/loader.c | 11 +- source/loader/source/loader_impl.c | 108 ++++++++++++++---- .../node_loader/source/node_loader_impl.cpp | 9 +- .../node_loader/source/node_loader_port.cpp | 2 +- .../metacall/include/metacall/metacall_link.h | 18 ++- source/metacall/source/metacall_link.c | 15 ++- source/plugin/include/plugin/plugin_impl.h | 2 +- source/plugin/source/plugin_impl.c | 2 +- 10 files changed, 131 insertions(+), 40 deletions(-) diff --git a/source/environment/source/environment_variable.c b/source/environment/source/environment_variable.c index 9323e0163..a9e94eb23 100644 --- a/source/environment/source/environment_variable.c +++ b/source/environment/source/environment_variable.c @@ -77,7 +77,7 @@ const char *environment_variable_get(const char *name, const char *default_value int environment_variable_set(const char *name, const char *value_string) { -#if defined(_WIN32) +#if defined(WIN32) || defined(_WIN32) return _putenv_s(name, value_string); #else return setenv(name, value_string, 1); diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index f7c7d56cb..3a2655e39 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -45,6 +45,8 @@ LOADER_API loader_impl loader_impl_create_host(const loader_tag tag); LOADER_API int loader_impl_dependencies(loader_impl impl); +LOADER_API int loader_impl_link(plugin p, loader_impl impl); + LOADER_API void loader_impl_attach(loader_impl impl, plugin p); LOADER_API plugin loader_impl_plugin(loader_impl impl); diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 2db2b641b..8511f2715 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -278,13 +278,10 @@ plugin loader_get_impl_plugin(const loader_tag tag) goto plugin_manager_create_error; } - /* If it is host, relink the loader symbols to the host (either the executable or a library) */ - if (loader_impl_get_option_host(impl) == 1) + /* If it is host, link the loader symbols to the host (either the executable or a library) */ + if (loader_impl_link(p, impl) != 0) { - // if (loader_impl_relink(impl) != 0) - // { - // goto plugin_manager_create_error; - // } + goto plugin_manager_create_error; } /* Store in the loader implementation the reference to the plugin which belongs to */ @@ -793,7 +790,7 @@ void loader_unload_children(loader_impl impl) * the loader has been unloaded, and the function interface will point to an unloaded * plugin, generating a segmentation fault. All the plugins will be unloaded on plugin_manager_destroy. */ - plugin_destroy_delayed(order->p); + plugin_destructor(order->p); /* Mark loader as destroyed (prevents access to already freed memory and defines what loaders are destroyed) */ loader_manager_impl_set_destroyed(manager_impl, destroyed_impl); diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 24d6045a7..9ccb51d00 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -92,7 +92,7 @@ struct loader_impl_type value options; /* Additional initialization options passed in the initialize phase */ set exec_path_map; /* Set of execution paths passed by the end user */ configuration config; /* Reference to the loader configuration, it contains execution_paths, dependencies and additional info */ - set dependencies_map; /* List of handles (dynlink) to the dependencies of the loader */ + set library_map; /* List of handles (dynlink) to the dependencies of the loader and the loader itself */ }; struct loader_handle_impl_type @@ -219,16 +219,16 @@ loader_impl loader_impl_allocate(const loader_tag tag) goto alloc_exec_path_map_error; } - impl->dependencies_map = set_create(&hash_callback_str, &comparable_callback_str); + impl->library_map = set_create(&hash_callback_str, &comparable_callback_str); - if (impl->dependencies_map == NULL) + if (impl->library_map == NULL) { - goto alloc_dependencies_map_error; + goto alloc_library_map_error; } return impl; -alloc_dependencies_map_error: +alloc_library_map_error: set_destroy(impl->exec_path_map); alloc_exec_path_map_error: context_destroy(impl->ctx); @@ -324,7 +324,9 @@ int loader_impl_dependencies_self_find(loader_impl impl, const char *key_str, ve { size_t iterator, size = vector_size(dependencies_self); char library_self_name[PORTABILITY_PATH_SIZE]; + dynlink handle; + /* Try to load it from the dependencies of the executable */ for (iterator = 0; iterator < size; ++iterator) { const char *library_self = vector_at(dependencies_self, iterator); @@ -335,19 +337,24 @@ int loader_impl_dependencies_self_find(loader_impl impl, const char *key_str, ve /* Try to find the dependency name in the library */ if (strstr(library_self_name, key_str) != NULL) { - dynlink handle = dynlink_load_absolute(library_self, DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); + handle = dynlink_load_absolute(library_self, DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); - if (handle != NULL && set_insert(impl->dependencies_map, (const set_key)key_str, (set_value)handle) == 0) - { - return 0; - } + goto dependencies_map_insert; + } + } - dynlink_unload(handle); + /* If it is not found in the dependencies, it is linked statically to the executable, load it */ + handle = dynlink_load_self(DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); - return 1; - } +dependencies_map_insert: + + if (handle != NULL && set_insert(impl->library_map, (const set_key)key_str, (set_value)handle) == 0) + { + return 0; } + dynlink_unload(handle); + return 1; } @@ -365,7 +372,7 @@ int loader_impl_dependencies_load(loader_impl impl, const char *key_str, value * { dynlink handle = dynlink_load_absolute(library_path, DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); - if (handle != NULL && set_insert(impl->dependencies_map, (const set_key)key_str, (set_value)handle) == 0) + if (handle != NULL && set_insert(impl->library_map, (const set_key)key_str, (set_value)handle) == 0) { return 0; } @@ -380,17 +387,16 @@ int loader_impl_dependencies_load(loader_impl impl, const char *key_str, value * int loader_impl_dependencies(loader_impl impl) { - const int host = loader_impl_get_option_host(impl); - /* Dependencies have the following format: - { "dependencies": { "node": ["/usr/lib/x86_64-linux-gnu/libnode.so.72"] } } + */ + value dependencies_value = configuration_value_type(impl->config, "dependencies", TYPE_MAP); - The algorithm works in the following way: + /* The algorithm works in the following way: 1) If current loader is the host: - Take the dependency name and try to find if it is already loaded as a library in the current process, for example: @@ -417,7 +423,6 @@ int loader_impl_dependencies(loader_impl impl) The value in this case will be the library loaded, instead of the full path. */ - value dependencies_value = configuration_value_type(impl->config, "dependencies", TYPE_MAP); if (dependencies_value != NULL) { @@ -425,6 +430,7 @@ int loader_impl_dependencies(loader_impl impl) value *dependencies_map = value_to_map(dependencies_value); vector dependencies_self = NULL; size_t iterator; + const int host = loader_impl_get_option_host(impl); /* In case of host, get all loaded dependencies into an array */ if (host == 1) @@ -489,6 +495,55 @@ int loader_impl_dependencies(loader_impl impl) return 0; } +int loader_impl_link(plugin p, loader_impl impl) +{ + plugin_descriptor desc = plugin_desc(p); + + /* On Linux and MacOS, if the symbols are exported, + the linker when loading the library automatically resolves the symbols + so there is no need for doing the link manually, in Windows meanwhile + we link the dependency with delay load linking. Before we execute anything, + we should relink all the symbols to the host. + */ +#if defined(WIN32) || defined(_WIN32) + if (loader_impl_get_option_host(impl) == 1) + { + /* TODO: Replace loader symbols by the dependency (aka the already loaded + library if the host is linked dynamically, or the executable if it is + linked statically): + + loader_handle = detour_load_handle(d, desc->handle); + + while (detour_enumerate(d, loader_handle, position, name, addr)) + { + foreach(library_handle in impl->library_map) + { + symbol = dynlink_symbol(library_handle, name); + + if (symbol != NULL) + { + if (detour_replace(d, loader_handle, name, symbol, ...) == 0) + { + break; + } + } + } + } + + detour_unload(d, loader_handle); + */ + } +#endif + + /* Store itself in the library map along with the dependencies */ + if (set_insert(impl->library_map, (set_key)desc->library_name, (set_value)desc->handle) != 0) + { + return 1; + } + + return 0; +} + configuration loader_impl_initialize_configuration(const loader_tag tag) { static const char configuration_key_suffix[] = "_loader"; @@ -1789,10 +1844,16 @@ void loader_impl_destroy_deallocate(loader_impl impl) value_type_destroy(impl->options); } + /* TODO: I am not sure this will work. + This must be done when the plugin handle (aka the loader) gets unloaded, + at this point it is not unloaded yet, because the plugin destructor is called before doing: + dynlink_unload(p->descriptor->handle); + In theory it should work because normally those handles are reference counted but "I don't trust like that". + */ /* Unload all the dependencies when everything has been destroyed and the loader is unloaded */ - set_iterate(impl->dependencies_map, &loader_impl_destroy_dependencies_map_cb_iterate, NULL); + set_iterate(impl->library_map, &loader_impl_destroy_dependencies_map_cb_iterate, NULL); - set_destroy(impl->dependencies_map); + set_destroy(impl->library_map); free(impl); } @@ -1822,6 +1883,11 @@ void loader_impl_destroy(plugin p, loader_impl impl) impl->init = 1; } + + /* Remove the loader library from the library list */ + plugin_descriptor desc = plugin_desc(p); + + set_remove(impl->library_map, (set_key)desc->library_name); } else { diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 2008cc111..d05b2b4a6 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -810,7 +810,9 @@ class loader_impl_napi_constructor public: loader_impl_napi_constructor() { - if (metacall_link_register("napi_register_module_v1", (void (*)(void))(&node_loader_port_initialize)) != 0) + static const loader_tag node_loader_tag = "node"; + + if (metacall_link_register(node_loader_tag, "node", "napi_register_module_v1", (void (*)(void))(&node_loader_port_initialize)) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Node loader failed register the link hook"); } @@ -3693,8 +3695,9 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi #if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1200) { /* As the library handle is correctly resolved here, either to executable, library of the executable, - or the loader dependency we can directly obtain the handle of this dependency from a function pointer */ - if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, &napi_create_reference, &node_loader_node_dll_handle)) + or the loader dependency we can directly obtain the handle of this dependency from a function pointer, + use any function that is contained in node runtime, in this case we are using napi_create_array */ + if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, &napi_create_array, &node_loader_node_dll_handle)) { napi_throw_type_error(env, nullptr, "Failed to initialize the hooking against node extensions load mechanism"); } diff --git a/source/loaders/node_loader/source/node_loader_port.cpp b/source/loaders/node_loader/source/node_loader_port.cpp index f96f1f295..82eaafbff 100644 --- a/source/loaders/node_loader/source/node_loader_port.cpp +++ b/source/loaders/node_loader/source/node_loader_port.cpp @@ -1114,7 +1114,7 @@ napi_value node_loader_port_initialize(napi_env env, napi_value exports) node_loader_port_exports(env, exports); /* Unregister NAPI Hook */ - if (metacall_link_unregister("napi_register_module_v1") != 0) + if (metacall_link_unregister(node_loader_tag, "node", "napi_register_module_v1") != 0) { // TODO: Handle error } diff --git a/source/metacall/include/metacall/metacall_link.h b/source/metacall/include/metacall/metacall_link.h index b9de5afff..598358aa9 100644 --- a/source/metacall/include/metacall/metacall_link.h +++ b/source/metacall/include/metacall/metacall_link.h @@ -50,6 +50,12 @@ METACALL_API int metacall_link_initialize(void); * Function interposition is required in order to hook into runtimes * and dynamically interpose our functions. * +* @param[in] tag +* Name of the loader which the @dependency belongs to +* +* @param[in] library +* Name of the library that is going to be hooked +* * @param[in] symbol * Name of the function to be interposed * @@ -59,19 +65,25 @@ METACALL_API int metacall_link_initialize(void); * @return * Zero if success, different from zero otherwise */ -METACALL_API int metacall_link_register(const char *symbol, void (*fn)(void)); +METACALL_API int metacall_link_register(const char *tag, const char *library, const char *symbol, void (*fn)(void)); /** * @brief * Remove the hook previously registered * +* @param[in] tag +* Name of the loader which the @dependency belongs to +* +* @param[in] library +* Name of the library that is going to be hooked +* * @param[in] symbol -* Name of the function to be removed +* Name of the function to be interposed * * @return * Zero if success, different from zero otherwise */ -METACALL_API int metacall_link_unregister(const char *symbol); +METACALL_API int metacall_link_unregister(const char *tag, const char *library, const char *symbol); /** * @brief diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index 9812211b2..838207de6 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -97,9 +97,20 @@ typedef void *(*metacall_link_trampoline_type)(void *, const char *); static const char metacall_link_func_name[] = "dlsym"; static metacall_link_trampoline_type metacall_link_trampoline = NULL; +/* TODO: We have to implement a lazy loaded map for +detours and load it from the loaders whenever hooking +is required, on destroy we can delete all the hook handles +*/ + static detour_handle metacall_link_handle(detour d) { + /* return detour_load_address(d, (void (*)(void))(&dlsym)); + */ + /* + return detour_load_file(d, NULL); + */ + return detour_load_file(d, "/lib/x86_64-linux-gnu/libnode.so.72"); } void *metacall_link_hook(void *handle, const char *symbol) @@ -188,7 +199,7 @@ int metacall_link_initialize(void) return 0; } -int metacall_link_register(const char *symbol, void (*fn)(void)) +int metacall_link_register(const char *tag, const char *library, const char *symbol, void (*fn)(void)) { void *ptr; @@ -202,7 +213,7 @@ int metacall_link_register(const char *symbol, void (*fn)(void)) return set_insert(metacall_link_table, (set_key)symbol, ptr); } -int metacall_link_unregister(const char *symbol) +int metacall_link_unregister(const char *tag, const char *library, const char *symbol) { if (metacall_link_table == NULL) { diff --git a/source/plugin/include/plugin/plugin_impl.h b/source/plugin/include/plugin/plugin_impl.h index c74706197..bc8b51ecf 100644 --- a/source/plugin/include/plugin/plugin_impl.h +++ b/source/plugin/include/plugin/plugin_impl.h @@ -59,7 +59,7 @@ PLUGIN_API void *plugin_iface(plugin p); PLUGIN_API void *plugin_impl(plugin p); -PLUGIN_API void plugin_destroy_delayed(plugin p); +PLUGIN_API void plugin_destructor(plugin p); PLUGIN_API void plugin_destroy(plugin p); diff --git a/source/plugin/source/plugin_impl.c b/source/plugin/source/plugin_impl.c index 1de83e55f..5cb9e6f2c 100644 --- a/source/plugin/source/plugin_impl.c +++ b/source/plugin/source/plugin_impl.c @@ -101,7 +101,7 @@ void *plugin_impl(plugin p) return p->impl; } -void plugin_destroy_delayed(plugin p) +void plugin_destructor(plugin p) { if (p != NULL) { From 4954d8dfbd46ecc35104504668fbea6686ef3426 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 10 Apr 2025 17:22:13 +0200 Subject: [PATCH 210/487] Typo on notice. --- NOTICE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index e584ab4a7..f51329169 100644 --- a/NOTICE +++ b/NOTICE @@ -19,7 +19,7 @@ All external code and licenses used by **METACALL** are always wrapped into plug - [2. Serials](#2-serials) - [2.1 RapidJSON](#21-rapidjson) - [3. Detours](#3-detours) - - [3.1 PLTHook](#31-fookhook) + - [3.1 PLTHook](#31-plthook) - [4. Ports](#4-ports) - [4.1 Swig](#41-swig) From 9a31798945b707702611d37aa2f59d6738eeed62 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 10 Apr 2025 17:23:40 +0200 Subject: [PATCH 211/487] First version of plthook working, improved dylink and added support for hooking the loaders. --- source/dynlink/include/dynlink/dynlink.h | 18 +-- source/dynlink/include/dynlink/dynlink_impl.h | 12 +- .../include/dynlink/dynlink_interface.h | 2 +- source/dynlink/include/dynlink/dynlink_type.h | 12 +- source/dynlink/source/dynlink.c | 44 ++++---- source/dynlink/source/dynlink_impl.c | 14 +-- source/dynlink/source/dynlink_impl_beos.c | 4 +- source/dynlink/source/dynlink_impl_macos.c | 4 +- source/dynlink/source/dynlink_impl_unix.c | 14 +-- source/dynlink/source/dynlink_impl_win32.c | 6 +- source/loader/include/loader/loader.h | 6 + source/loader/include/loader/loader_impl.h | 6 +- .../include/loader/loader_manager_impl.h | 1 + source/loader/source/loader.c | 24 +++- source/loader/source/loader_impl.c | 83 +++++++++++++- .../loaders/c_loader/source/c_loader_impl.cpp | 2 +- .../ext_loader/source/ext_loader_impl.cpp | 2 +- .../node_loader/source/node_loader_impl.cpp | 24 +--- .../metacall/include/metacall/metacall_link.h | 31 ++++- source/metacall/source/metacall.c | 13 ++- source/metacall/source/metacall_link.c | 106 ++++++++---------- source/plugin/source/plugin_manager.c | 2 +- .../sandbox_plugin/source/sandbox_plugin.cpp | 5 +- .../dynlink_test/source/dynlink_test.cpp | 6 +- .../source/metacall_dynlink_path_test.cpp | 2 +- 25 files changed, 268 insertions(+), 175 deletions(-) diff --git a/source/dynlink/include/dynlink/dynlink.h b/source/dynlink/include/dynlink/dynlink.h index 3154e93fd..1a94636f0 100644 --- a/source/dynlink/include/dynlink/dynlink.h +++ b/source/dynlink/include/dynlink/dynlink.h @@ -70,7 +70,7 @@ DYNLINK_API const char *dynlink_extension(void); * @return * A handle to the dynamically linked shared object */ -DYNLINK_API dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_flags flags); +DYNLINK_API dynlink dynlink_load(const char *path, const char *name, dynlink_flags flags); /** * @brief @@ -85,7 +85,7 @@ DYNLINK_API dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_f * @return * A handle to the dynamically linked shared object */ -DYNLINK_API dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags); +DYNLINK_API dynlink dynlink_load_absolute(const char *path, dynlink_flags flags); /** * @brief @@ -109,19 +109,19 @@ DYNLINK_API dynlink dynlink_load_self(dynlink_flags flags); * @return * Reference to the name of the dynamically linked shared object */ -DYNLINK_API dynlink_name dynlink_get_name(dynlink handle); +DYNLINK_API const char *dynlink_get_name(dynlink handle); /** * @brief -* Retreive the file name of the dynamically linked shared object handle +* Retreive the path of the dynamically linked shared object handle * * @param[in] handle * Handle of dynamically linked shared object * * @return -* Reference to the file name of the dynamically linked shared object +* Reference to the path of the dynamically linked shared object */ -DYNLINK_API dynlink_name dynlink_get_name_impl(dynlink handle); +DYNLINK_API const char *dynlink_get_path(dynlink handle); /** * @brief @@ -163,7 +163,7 @@ DYNLINK_API dynlink_impl dynlink_get_impl(dynlink handle); * @return * Returns zero on correct dynamic linking, distinct from zero otherwise */ -DYNLINK_API int dynlink_symbol(dynlink handle, dynlink_symbol_name symbol_name, dynlink_symbol_addr *symbol_address); +DYNLINK_API int dynlink_symbol(dynlink handle, const char *symbol_name, dynlink_symbol_addr *symbol_address); /** * @brief @@ -190,7 +190,7 @@ DYNLINK_API void dynlink_unload(dynlink handle); * @return * Returns zero if it could find the path, different from zero if not found */ -DYNLINK_API int dynlink_library_path(dynlink_name name, dynlink_library_path_str path, size_t *length); +DYNLINK_API int dynlink_library_path(const char *name, dynlink_path path, size_t *length); /** * @brief @@ -202,7 +202,7 @@ DYNLINK_API int dynlink_library_path(dynlink_name name, dynlink_library_path_str * @param[out] result * The resulting library name that will be generated (i.e libexample.so in Linux, or example.dll in Windows) */ -DYNLINK_API void dynlink_platform_name(dynlink_name name, dynlink_name_impl result); +DYNLINK_API void dynlink_platform_name(const char *name, dynlink_path result); /** * @brief diff --git a/source/dynlink/include/dynlink/dynlink_impl.h b/source/dynlink/include/dynlink/dynlink_impl.h index 69696a55d..d5d8728e6 100644 --- a/source/dynlink/include/dynlink/dynlink_impl.h +++ b/source/dynlink/include/dynlink/dynlink_impl.h @@ -60,19 +60,19 @@ DYNLINK_API const char *dynlink_impl_extension(void); * @param[in] name * Name of dynamically linked shared object * -* @param[out] name_impl -* Pointer to the dynamically linked shared object handle +* @param[out] destination +* Pointer to string where final platform dependant name will be stored * * @param[in] size -* Size of string @name_impl +* Size of string @destination */ -DYNLINK_API void dynlink_impl_get_name(dynlink_name name, dynlink_name_impl name_impl, size_t size); +DYNLINK_API void dynlink_impl_get_name(const char *name, dynlink_path destination, size_t size); /** * @brief * Load a dynamically linked shared object implementation * -* @param[in] name +* @param[in] handle * Pointer to the dynamically linked shared object handle * * @return @@ -99,7 +99,7 @@ DYNLINK_API dynlink_impl dynlink_impl_load(dynlink handle); * @return * Returns zero on correct dynamic linking, distinct from zero otherwise */ -DYNLINK_API int dynlink_impl_symbol(dynlink handle, dynlink_impl impl, dynlink_symbol_name symbol_name, dynlink_symbol_addr *symbol_address); +DYNLINK_API int dynlink_impl_symbol(dynlink handle, dynlink_impl impl, const char *symbol_name, dynlink_symbol_addr *symbol_address); /** * @brief diff --git a/source/dynlink/include/dynlink/dynlink_interface.h b/source/dynlink/include/dynlink/dynlink_interface.h index f9b55e1d6..445a0cd4d 100644 --- a/source/dynlink/include/dynlink/dynlink_interface.h +++ b/source/dynlink/include/dynlink/dynlink_interface.h @@ -57,7 +57,7 @@ typedef dynlink_symbol_addr *dynlink_symbol_addr_ptr; typedef const char *(*dynlink_impl_interface_prefix)(void); typedef const char *(*dynlink_impl_interface_extension)(void); typedef dynlink_impl (*dynlink_impl_interface_load)(dynlink); -typedef int (*dynlink_impl_interface_symbol)(dynlink, dynlink_impl, dynlink_symbol_name, dynlink_symbol_addr_ptr); +typedef int (*dynlink_impl_interface_symbol)(dynlink, dynlink_impl, const char *, dynlink_symbol_addr_ptr); typedef int (*dynlink_impl_interface_unload)(dynlink, dynlink_impl); struct dynlink_impl_interface_type diff --git a/source/dynlink/include/dynlink/dynlink_type.h b/source/dynlink/include/dynlink/dynlink_type.h index cc759e25f..d6b737e57 100644 --- a/source/dynlink/include/dynlink/dynlink_type.h +++ b/source/dynlink/include/dynlink/dynlink_type.h @@ -37,14 +37,10 @@ struct dynlink_type; /* -- Type definitions -- */ -typedef struct dynlink_type *dynlink; /**< Dynamically linked shared object handle */ -typedef const char *dynlink_path; /**< Dynamically linked shared object path */ -typedef const char *dynlink_name; /**< Dynamically linked shared object name */ -typedef const char *dynlink_symbol_name; /**< Dynamically linked shared object symbol name */ -typedef portability_library_path_str dynlink_library_path_str; /**< Dynamically linked shared object symbol name */ -typedef void *dynlink_impl; /**< Dynamically linked shared object implementation */ -typedef char dynlink_name_impl[PORTABILITY_PATH_SIZE]; /**< Allocated copy of dynamically linked shared object name */ -typedef void (*dynlink_symbol_addr)(void); /**< Function pointer referring to a symbol address */ +typedef struct dynlink_type *dynlink; /**< Dynamically linked shared object handle */ +typedef void *dynlink_impl; /**< Dynamically linked shared object implementation */ +typedef char dynlink_path[PORTABILITY_PATH_SIZE]; /**< Allocated copy of dynamically linked shared object name */ +typedef void (*dynlink_symbol_addr)(void); /**< Function pointer referring to a symbol address */ /* -- Macros -- */ diff --git a/source/dynlink/source/dynlink.c b/source/dynlink/source/dynlink.c index ced93d585..580cef521 100644 --- a/source/dynlink/source/dynlink.c +++ b/source/dynlink/source/dynlink.c @@ -35,10 +35,10 @@ struct dynlink_type { - dynlink_name_impl name; /**< Dynamically linked shared object name */ - dynlink_name_impl name_impl; /**< Dynamically linked shared object file name */ - dynlink_flags flags; /**< Dynamically linked shared object flags */ - dynlink_impl impl; /**< Dynamically linked shared object loader implementation */ + dynlink_path name; /**< Dynamically linked shared object name */ + dynlink_path path; /**< Dynamically linked shared object file name */ + dynlink_flags flags; /**< Dynamically linked shared object flags */ + dynlink_impl impl; /**< Dynamically linked shared object loader implementation */ }; /* -- Methods -- */ @@ -53,7 +53,7 @@ const char *dynlink_extension(void) return dynlink_impl_extension(); } -dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_flags flags) +dynlink dynlink_load(const char *path, const char *name, dynlink_flags flags) { if (name != NULL) { @@ -61,23 +61,23 @@ dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_flags flags) if (handle != NULL) { - dynlink_name_impl name_impl; + dynlink_path name_impl; strncpy(handle->name, name, PORTABILITY_PATH_SIZE - 1); - dynlink_impl_get_name(dynlink_get_name(handle), name_impl, PORTABILITY_PATH_SIZE); + dynlink_impl_get_name(handle->name, name_impl, PORTABILITY_PATH_SIZE); if (path != NULL) { - dynlink_name_impl join_path; + dynlink_path join_path; size_t join_path_size = portability_path_join(path, strnlen(path, PORTABILITY_PATH_SIZE) + 1, name_impl, strnlen(name_impl, PORTABILITY_PATH_SIZE) + 1, join_path, PORTABILITY_PATH_SIZE); - (void)portability_path_canonical(join_path, join_path_size, handle->name_impl, PORTABILITY_PATH_SIZE); + (void)portability_path_canonical(join_path, join_path_size, handle->path, PORTABILITY_PATH_SIZE); } else { - strncpy(handle->name_impl, name_impl, strnlen(name_impl, PORTABILITY_PATH_SIZE) + 1); + strncpy(handle->path, name_impl, strnlen(name_impl, PORTABILITY_PATH_SIZE) + 1); } DYNLINK_FLAGS_SET(handle->flags, flags); @@ -96,7 +96,7 @@ dynlink dynlink_load(dynlink_path path, dynlink_name name, dynlink_flags flags) return NULL; } -dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags) +dynlink dynlink_load_absolute(const char *path, dynlink_flags flags) { dynlink handle = malloc(sizeof(struct dynlink_type)); size_t path_size, name_size, prefix_length; @@ -109,7 +109,7 @@ dynlink dynlink_load_absolute(dynlink_path path, dynlink_flags flags) path_size = strnlen(path, PORTABILITY_PATH_SIZE) + 1; - strncpy(handle->name_impl, path, path_size); + strncpy(handle->path, path, path_size); /* Get the library name without any extension */ name_size = portability_path_get_name_canonical(path, path_size, handle->name, PORTABILITY_PATH_SIZE); @@ -151,10 +151,10 @@ dynlink dynlink_load_self(dynlink_flags flags) } /* Retrieve the executable path for the full name */ - portability_executable_path(handle->name_impl, &path_length); + portability_executable_path(handle->path, &path_length); /* Get the name without the extension */ - portability_path_get_name(handle->name_impl, path_length + 1, handle->name, PORTABILITY_PATH_SIZE); + portability_path_get_name(handle->path, path_length + 1, handle->name, PORTABILITY_PATH_SIZE); /* Set the flags with the additional special flag for itself, this will help to identify that the handle loaded is the current executable @@ -174,7 +174,7 @@ dynlink dynlink_load_self(dynlink_flags flags) return handle; } -dynlink_name dynlink_get_name(dynlink handle) +const char *dynlink_get_name(dynlink handle) { if (handle != NULL) { @@ -184,11 +184,11 @@ dynlink_name dynlink_get_name(dynlink handle) return NULL; } -dynlink_name dynlink_get_name_impl(dynlink handle) +const char *dynlink_get_path(dynlink handle) { if (handle != NULL) { - return handle->name_impl; + return handle->path; } return NULL; @@ -214,7 +214,7 @@ dynlink_impl dynlink_get_impl(dynlink handle) return NULL; } -int dynlink_symbol(dynlink handle, dynlink_symbol_name symbol_name, dynlink_symbol_addr *symbol_address) +int dynlink_symbol(dynlink handle, const char *symbol_name, dynlink_symbol_addr *symbol_address) { if (handle != NULL && handle->impl != NULL && symbol_name != NULL && symbol_address != NULL) { @@ -234,9 +234,9 @@ void dynlink_unload(dynlink handle) } } -int dynlink_library_path(dynlink_name name, dynlink_library_path_str path, size_t *length) +int dynlink_library_path(const char *name, dynlink_path path, size_t *length) { - dynlink_name_impl name_impl; + dynlink_path name_impl; dynlink_impl_get_name(name, name_impl, PORTABILITY_PATH_SIZE); @@ -251,13 +251,13 @@ int dynlink_library_path(dynlink_name name, dynlink_library_path_str path, size_ } else { - (void)portability_path_get_directory_inplace(path, strnlen(path, sizeof(dynlink_library_path_str) / sizeof(char)) + 1); + (void)portability_path_get_directory_inplace(path, strnlen(path, PORTABILITY_PATH_SIZE)); } return 0; } -void dynlink_platform_name(dynlink_name name, dynlink_name_impl result) +void dynlink_platform_name(const char *name, dynlink_path result) { dynlink_impl_get_name(name, result, PORTABILITY_PATH_SIZE); } diff --git a/source/dynlink/source/dynlink_impl.c b/source/dynlink/source/dynlink_impl.c index bd0fd942c..f49fece5c 100644 --- a/source/dynlink/source/dynlink_impl.c +++ b/source/dynlink/source/dynlink_impl.c @@ -42,17 +42,17 @@ const char *dynlink_impl_extension(void) return singleton()->extension(); } -void dynlink_impl_get_name(dynlink_name name, dynlink_name_impl name_impl, size_t size) +void dynlink_impl_get_name(const char *name, dynlink_path destination, size_t size) { - if (name != NULL && name_impl != NULL && size > 1) + if (name != NULL && destination != NULL && size > 1) { - strncpy(name_impl, dynlink_impl_prefix(), size); + strncpy(destination, dynlink_impl_prefix(), size); - strncat(name_impl, name, size - 1); + strncat(destination, name, size - 1); - strncat(name_impl, ".", size - 1); + strncat(destination, ".", size - 1); - strncat(name_impl, dynlink_impl_extension(), size - 1); + strncat(destination, dynlink_impl_extension(), size - 1); } } @@ -63,7 +63,7 @@ dynlink_impl dynlink_impl_load(dynlink handle) return singleton()->load(handle); } -int dynlink_impl_symbol(dynlink handle, dynlink_impl impl, dynlink_symbol_name symbol_name, dynlink_symbol_addr *symbol_address) +int dynlink_impl_symbol(dynlink handle, dynlink_impl impl, const char *symbol_name, dynlink_symbol_addr *symbol_address) { if (impl != NULL) { diff --git a/source/dynlink/source/dynlink_impl_beos.c b/source/dynlink/source/dynlink_impl_beos.c index 60688b5b7..98d5a07cc 100644 --- a/source/dynlink/source/dynlink_impl_beos.c +++ b/source/dynlink/source/dynlink_impl_beos.c @@ -65,7 +65,7 @@ dynlink_impl dynlink_impl_interface_load_beos(dynlink handle) } else { - impl = load_add_on(dynlink_get_name_impl(handle)); + impl = load_add_on(dynlink_get_path(handle)); } if (impl < B_NO_ERROR) @@ -77,7 +77,7 @@ dynlink_impl dynlink_impl_interface_load_beos(dynlink handle) return (dynlink_impl)impl; } -int dynlink_impl_interface_symbol_beos(dynlink handle, dynlink_impl impl, dynlink_symbol_name name, dynlink_symbol_addr *addr) +int dynlink_impl_interface_symbol_beos(dynlink handle, dynlink_impl impl, const char *name, dynlink_symbol_addr *addr) { void *symbol = NULL; diff --git a/source/dynlink/source/dynlink_impl_macos.c b/source/dynlink/source/dynlink_impl_macos.c index c210c9bd3..48c7a4daf 100644 --- a/source/dynlink/source/dynlink_impl_macos.c +++ b/source/dynlink/source/dynlink_impl_macos.c @@ -61,7 +61,7 @@ dynlink_impl dynlink_impl_interface_load_macos(dynlink handle) { unsigned long flags_impl; NSObjectFileImage image; - const char *name = dynlink_get_name_impl(handle); + const char *name = dynlink_get_path(handle); NSObjectFileImageReturnCode ret = NSCreateObjectFileImageFromFile(name, &image); if (ret != NSObjectFileImageSuccess) @@ -136,7 +136,7 @@ dynlink_impl dynlink_impl_interface_load_macos(dynlink handle) return (dynlink_impl)impl; } -int dynlink_impl_interface_symbol_macos(dynlink handle, dynlink_impl impl, dynlink_symbol_name name, dynlink_symbol_addr *addr) +int dynlink_impl_interface_symbol_macos(dynlink handle, dynlink_impl impl, const char *name, dynlink_symbol_addr *addr) { dynlink_flags flags = dynlink_get_flags(handle); NSSymbol symbol; diff --git a/source/dynlink/source/dynlink_impl_unix.c b/source/dynlink/source/dynlink_impl_unix.c index b6a234abe..7a6d35711 100644 --- a/source/dynlink/source/dynlink_impl_unix.c +++ b/source/dynlink/source/dynlink_impl_unix.c @@ -28,16 +28,6 @@ #include <string.h> -/* Enable if needed for extended API */ -/* -#ifndef _GNU_SOURCE - #define _GNU_SOURCE -#endif -#ifndef __USE_GNU - #define __USE_GNU -#endif -*/ - #include <dlfcn.h> /* -- Methods -- */ @@ -90,7 +80,7 @@ dynlink_impl dynlink_impl_interface_load_unix(dynlink handle) } else { - impl = dlopen(dynlink_get_name_impl(handle), flags_impl); + impl = dlopen(dynlink_get_path(handle), flags_impl); } if (impl == NULL) @@ -103,7 +93,7 @@ dynlink_impl dynlink_impl_interface_load_unix(dynlink handle) return (dynlink_impl)impl; } -int dynlink_impl_interface_symbol_unix(dynlink handle, dynlink_impl impl, dynlink_symbol_name name, dynlink_symbol_addr *addr) +int dynlink_impl_interface_symbol_unix(dynlink handle, dynlink_impl impl, const char *name, dynlink_symbol_addr *addr) { void *symbol = dlsym(impl, name); diff --git a/source/dynlink/source/dynlink_impl_win32.c b/source/dynlink/source/dynlink_impl_win32.c index 9d3ec0425..d1956a965 100644 --- a/source/dynlink/source/dynlink_impl_win32.c +++ b/source/dynlink/source/dynlink_impl_win32.c @@ -61,7 +61,7 @@ dynlink_impl dynlink_impl_interface_load_win32(dynlink handle) } else { - impl = LoadLibrary(dynlink_get_name_impl(handle)); + impl = LoadLibrary(dynlink_get_path(handle)); } if (impl == NULL) @@ -72,7 +72,7 @@ dynlink_impl dynlink_impl_interface_load_win32(dynlink handle) size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error_id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&message_buffer, 0, NULL); - log_write("metacall", LOG_LEVEL_ERROR, "Failed to load: %s with error code [%d]: %.*s", dynlink_get_name_impl(handle), error_id, size - 1, (const char *)message_buffer); + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load: %s with error code [%d]: %.*s", dynlink_get_path(handle), error_id, size - 1, (const char *)message_buffer); LocalFree(message_buffer); @@ -82,7 +82,7 @@ dynlink_impl dynlink_impl_interface_load_win32(dynlink handle) return (dynlink_impl)impl; } -int dynlink_impl_interface_symbol_win32(dynlink handle, dynlink_impl impl, dynlink_symbol_name name, dynlink_symbol_addr *addr) +int dynlink_impl_interface_symbol_win32(dynlink handle, dynlink_impl impl, const char *name, dynlink_symbol_addr *addr) { FARPROC proc_addr = GetProcAddress(impl, name); diff --git a/source/loader/include/loader/loader.h b/source/loader/include/loader/loader.h index b4b8816a3..8fe36fd1e 100644 --- a/source/loader/include/loader/loader.h +++ b/source/loader/include/loader/loader.h @@ -59,6 +59,12 @@ LOADER_API int loader_register(const char *name, loader_register_invoke invoke, LOADER_API int loader_register_impl(void *impl, void *handle, const char *name, loader_register_invoke invoke, type_id return_type, size_t arg_size, type_id args_type_id[]); +LOADER_API void loader_detour(detour d); + +LOADER_API detour_handle loader_hook(const loader_tag tag, const char *library, int (*load_cb)(detour, detour_handle)); + +LOADER_API detour_handle loader_hook_impl(void *impl, const char *library, int (*load_cb)(detour, detour_handle)); + LOADER_API const char *loader_library_path(void); LOADER_API int loader_execution_path(const loader_tag tag, const loader_path path); diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index 3a2655e39..44b242928 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -29,6 +29,8 @@ #include <plugin/plugin_impl.h> #include <plugin/plugin_manager.h> +#include <detour/detour.h> + #ifdef __cplusplus extern "C" { #endif @@ -43,10 +45,12 @@ LOADER_API loader_impl loader_impl_create(const loader_tag tag); LOADER_API loader_impl loader_impl_create_host(const loader_tag tag); -LOADER_API int loader_impl_dependencies(loader_impl impl); +LOADER_API int loader_impl_dependencies(loader_impl impl, detour d); LOADER_API int loader_impl_link(plugin p, loader_impl impl); +LOADER_API detour_handle loader_impl_detour(loader_impl impl, const char *library, int (*load_cb)(detour, detour_handle)); + LOADER_API void loader_impl_attach(loader_impl impl, plugin p); LOADER_API plugin loader_impl_plugin(loader_impl impl); diff --git a/source/loader/include/loader/loader_manager_impl.h b/source/loader/include/loader/loader_manager_impl.h index 124aaf55c..3e9c4d82c 100644 --- a/source/loader/include/loader/loader_manager_impl.h +++ b/source/loader/include/loader/loader_manager_impl.h @@ -53,6 +53,7 @@ struct loader_manager_impl_type uint64_t init_thread_id; /* Stores the thread id of the thread that initialized metacall */ vector script_paths; /* Vector of search path for the scripts */ set destroy_map; /* Tracks the list of destroyed runtimes during destruction of the manager (loader_impl -> NULL) */ + detour d; /* Stores the detour manager that is being used for hooking */ }; /* -- Type Definitions -- */ diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 8511f2715..b4b13e5df 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -33,8 +33,6 @@ #include <serial/serial.h> -#include <detour/detour.h> - #include <log/log.h> #include <threading/threading_thread_id.h> @@ -134,6 +132,9 @@ int loader_initialize(void) /* Insert into destruction list */ loader_initialization_register_plugin(manager_impl->host); + /* Initialize detours */ + manager_impl->d = NULL; + /* TODO: Disable logs here until log is completely thread safe and async signal safe */ /* log_write("metacall", LOG_LEVEL_DEBUG, "Loader host initialized"); */ @@ -248,6 +249,23 @@ int loader_register_impl(void *impl, void *handle, const char *name, loader_regi return loader_host_register((loader_impl)impl, loader_impl_handle_context(handle), name, invoke, NULL, return_type, arg_size, args_type_id); } +void loader_detour(detour d) +{ + loader_manager_impl manager_impl = plugin_manager_impl_type(&loader_manager, loader_manager_impl); + + manager_impl->d = d; +} + +detour_handle loader_hook(const loader_tag tag, const char *library, int (*load_cb)(detour, detour_handle)) +{ + return loader_impl_detour(loader_get_impl(tag), library, load_cb); +} + +detour_handle loader_hook_impl(void *impl, const char *library, int (*load_cb)(detour, detour_handle)) +{ + return loader_impl_detour((loader_impl)impl, library, load_cb); +} + plugin loader_get_impl_plugin(const loader_tag tag) { plugin p = plugin_manager_get(&loader_manager, tag); @@ -265,7 +283,7 @@ plugin loader_get_impl_plugin(const loader_tag tag) } /* Dynamic link loader dependencies if it is not host */ - if (loader_impl_dependencies(impl) != 0) + if (loader_impl_dependencies(impl, plugin_manager_impl_type(&loader_manager, loader_manager_impl)->d) != 0) { goto plugin_manager_create_error; } diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 9ccb51d00..0221b4a5e 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -93,6 +93,8 @@ struct loader_impl_type set exec_path_map; /* Set of execution paths passed by the end user */ configuration config; /* Reference to the loader configuration, it contains execution_paths, dependencies and additional info */ set library_map; /* List of handles (dynlink) to the dependencies of the loader and the loader itself */ + detour d; /* Reference to the detour which was used for hooking the loader or its dependencies */ + set detour_map; /* List of detour handles (detour_handle) to the dependencies of the loader and the loader itself */ }; struct loader_handle_impl_type @@ -226,8 +228,17 @@ loader_impl loader_impl_allocate(const loader_tag tag) goto alloc_library_map_error; } + impl->detour_map = set_create(&hash_callback_str, &comparable_callback_str); + + if (impl->detour_map == NULL) + { + goto alloc_detour_map_error; + } + return impl; +alloc_detour_map_error: + set_destroy(impl->library_map); alloc_library_map_error: set_destroy(impl->exec_path_map); alloc_exec_path_map_error: @@ -385,7 +396,7 @@ int loader_impl_dependencies_load(loader_impl impl, const char *key_str, value * return 1; } -int loader_impl_dependencies(loader_impl impl) +int loader_impl_dependencies(loader_impl impl, detour d) { /* Dependencies have the following format: { @@ -424,6 +435,10 @@ int loader_impl_dependencies(loader_impl impl) The value in this case will be the library loaded, instead of the full path. */ + /* Initialize the loader detour */ + impl->d = d; + + /* Check if the loader has dependencies and load them */ if (dependencies_value != NULL) { size_t size = value_type_count(dependencies_value); @@ -544,6 +559,42 @@ int loader_impl_link(plugin p, loader_impl impl) return 0; } +detour_handle loader_impl_detour(loader_impl impl, const char *library, int (*load_cb)(detour, detour_handle)) +{ + detour_handle handle = set_get(impl->detour_map, (const set_key)library); + + if (handle == NULL) + { + dynlink library_handle = set_get(impl->library_map, (const set_key)library); + + if (library_handle == NULL) + { + return NULL; + } + + handle = detour_load_handle(impl->d, library_handle); + + if (handle == NULL) + { + return NULL; + } + + if (load_cb(impl->d, handle) != 0) + { + detour_unload(impl->d, handle); + return NULL; + } + + if (set_insert(impl->detour_map, (set_key)library, handle) != 0) + { + detour_unload(impl->d, handle); + return NULL; + } + } + + return handle; +} + configuration loader_impl_initialize_configuration(const loader_tag tag) { static const char configuration_key_suffix[] = "_loader"; @@ -1771,6 +1822,22 @@ int loader_impl_destroy_exec_path_map_cb_iterate(set s, set_key key, set_value v return 0; } +int loader_impl_destroy_detour_map_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) +{ + (void)s; + (void)key; + + if (val != NULL && args != NULL) + { + detour d = args; + detour_handle handle = val; + + detour_unload(d, handle); + } + + return 0; +} + int loader_impl_destroy_dependencies_map_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) { (void)s; @@ -1844,12 +1911,18 @@ void loader_impl_destroy_deallocate(loader_impl impl) value_type_destroy(impl->options); } + /* Destroy detour map */ + set_iterate(impl->detour_map, &loader_impl_destroy_detour_map_cb_iterate, impl->d); + + set_destroy(impl->detour_map); + /* TODO: I am not sure this will work. - This must be done when the plugin handle (aka the loader) gets unloaded, - at this point it is not unloaded yet, because the plugin destructor is called before doing: - dynlink_unload(p->descriptor->handle); - In theory it should work because normally those handles are reference counted but "I don't trust like that". + This must be done when the plugin handle (aka the loader) gets unloaded, + at this point it is not unloaded yet, because the plugin destructor is called before doing: + dynlink_unload(p->descriptor->handle); + In theory it should work because normally those handles are reference counted but "I don't trust like that". */ + /* Unload all the dependencies when everything has been destroyed and the loader is unloaded */ set_iterate(impl->library_map, &loader_impl_destroy_dependencies_map_cb_iterate, NULL); diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index f9530b7ab..a4e57914c 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -315,7 +315,7 @@ typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_typ { /* This function will try to check if the library exists before loading it, so we avoid error messages from dynlink when guessing the file path for relative load from file */ - dynlink_name_impl platform_name; + dynlink_path platform_name; dynlink_platform_name(library_name, platform_name); diff --git a/source/loaders/ext_loader/source/ext_loader_impl.cpp b/source/loaders/ext_loader/source/ext_loader_impl.cpp index c41db8f1b..ab4f182bd 100644 --- a/source/loaders/ext_loader/source/ext_loader_impl.cpp +++ b/source/loaders/ext_loader/source/ext_loader_impl.cpp @@ -142,7 +142,7 @@ dynlink ext_loader_impl_load_from_file_dynlink(const char *path, const char *lib { /* This function will try to check if the library exists before loading it, so we avoid error messages from dynlink when guessing the file path for relative load from file */ - dynlink_name_impl platform_name; + dynlink_path platform_name; dynlink_platform_name(library_name, platform_name); diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index d05b2b4a6..d622cbb0d 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -805,25 +805,6 @@ typedef struct loader_impl_napi_to_value_callback_closure_type } * loader_impl_napi_to_value_callback_closure; -class loader_impl_napi_constructor -{ -public: - loader_impl_napi_constructor() - { - static const loader_tag node_loader_tag = "node"; - - if (metacall_link_register(node_loader_tag, "node", "napi_register_module_v1", (void (*)(void))(&node_loader_port_initialize)) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Node loader failed register the link hook"); - } - } - - ~loader_impl_napi_constructor() {} -}; - -/* Initializer of napi_register_module_v1 */ -static loader_impl_napi_constructor loader_impl_napi_ctor; - /* Type conversion */ static napi_value node_loader_impl_napi_to_value_callback(napi_env env, napi_callback_info info); @@ -4027,6 +4008,11 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con /* Result will never be defined properly */ node_impl->result = 0; + + if (metacall_link_register_impl(impl, "node", "napi_register_module_v1", (void (*)(void))(&node_loader_port_initialize)) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Node Loader failed to hook napi_register_module_v1"); + } } /* Register initialization */ diff --git a/source/metacall/include/metacall/metacall_link.h b/source/metacall/include/metacall/metacall_link.h index 598358aa9..5012810fe 100644 --- a/source/metacall/include/metacall/metacall_link.h +++ b/source/metacall/include/metacall/metacall_link.h @@ -51,7 +51,7 @@ METACALL_API int metacall_link_initialize(void); * and dynamically interpose our functions. * * @param[in] tag -* Name of the loader which the @dependency belongs to +* Name of the loader which the @library belongs to * * @param[in] library * Name of the library that is going to be hooked @@ -67,12 +67,39 @@ METACALL_API int metacall_link_initialize(void); */ METACALL_API int metacall_link_register(const char *tag, const char *library, const char *symbol, void (*fn)(void)); +/** +* @brief +* Register a function pointer in order to allow function +* interposition when loading a library, if you register a +* function @symbol called 'foo', when you try to dlsym (or the equivalent +* on every platform), you will get the pointer to @fn, even if +* the symbol does not exist in the library, it will work. +* Function interposition is required in order to hook into runtimes +* and dynamically interpose our functions. +* +* @param[in] loader +* Pointer to the loader which the @library belongs to +* +* @param[in] library +* Name of the library that is going to be hooked +* +* @param[in] symbol +* Name of the function to be interposed +* +* @param[in] fn +* Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol +* +* @return +* Zero if success, different from zero otherwise +*/ +METACALL_API int metacall_link_register_impl(void *loader, const char *library, const char *symbol, void (*fn)(void)); + /** * @brief * Remove the hook previously registered * * @param[in] tag -* Name of the loader which the @dependency belongs to +* Name of the loader which the @library belongs to * * @param[in] library * Name of the library that is going to be hooked diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index 12f2f14dc..c865e1ccd 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -256,12 +256,6 @@ int metacall_initialize(void) return 1; } - /* Initialize link */ - if (metacall_link_initialize() != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall link initialization"); - } - #ifdef METACALL_FORK_SAFE if (metacall_config_flags & METACALL_FLAGS_FORK_SAFE) { @@ -316,6 +310,7 @@ int metacall_initialize(void) } } + /* Initialize loader subsystem */ if (loader_initialize() != 0) { configuration_destroy(); @@ -323,6 +318,12 @@ int metacall_initialize(void) return 1; } + /* Initialize link */ + if (metacall_link_initialize() != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid MetaCall link initialization"); + } + /* Load core plugins */ if (metacall_plugin_extension_load() != 0) { diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index 838207de6..df4b05cce 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -33,11 +33,12 @@ #include <adt/adt_set.h> +#include <loader/loader.h> + #include <stdlib.h> /* -- Private Variables -- */ -static detour_handle detour_link_handle = NULL; static set metacall_link_table = NULL; static threading_mutex_type link_mutex = THREADING_MUTEX_INITIALIZE; @@ -52,9 +53,9 @@ typedef FARPROC (*metacall_link_trampoline_type)(HMODULE, LPCSTR); static const char metacall_link_func_name[] = "GetProcAddress"; static metacall_link_trampoline_type metacall_link_trampoline = NULL; -static detour_handle metacall_link_handle(detour d) +static metacall_link_trampoline_type metacall_link_func(void) { - return detour_load_address(d, (void (*)(void))(&GetProcAddress)); + return &GetProcAddress; } FARPROC metacall_link_hook(HMODULE handle, LPCSTR symbol) @@ -87,30 +88,14 @@ FARPROC metacall_link_hook(HMODULE handle, LPCSTR symbol) #include <dlfcn.h> -void (*metacall_link_func(void))(void) -{ - return (void (*)(void))(&dlsym); -} - typedef void *(*metacall_link_trampoline_type)(void *, const char *); static const char metacall_link_func_name[] = "dlsym"; static metacall_link_trampoline_type metacall_link_trampoline = NULL; -/* TODO: We have to implement a lazy loaded map for -detours and load it from the loaders whenever hooking -is required, on destroy we can delete all the hook handles -*/ - -static detour_handle metacall_link_handle(detour d) +static metacall_link_trampoline_type metacall_link_func(void) { - /* - return detour_load_address(d, (void (*)(void))(&dlsym)); - */ - /* - return detour_load_file(d, NULL); - */ - return detour_load_file(d, "/lib/x86_64-linux-gnu/libnode.so.72"); + return &dlsym; } void *metacall_link_hook(void *handle, const char *symbol) @@ -143,8 +128,6 @@ void *metacall_link_hook(void *handle, const char *symbol) int metacall_link_initialize(void) { - detour d = detour_create(metacall_detour()); - if (threading_mutex_initialize(&link_mutex) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid link mutex initialization"); @@ -152,34 +135,13 @@ int metacall_link_initialize(void) return 1; } - if (detour_link_handle == NULL) - { - /* Casting for getting the original function */ - union - { - metacall_link_trampoline_type *trampoline; - void (**ptr)(void); - } cast = { &metacall_link_trampoline }; - - detour_link_handle = metacall_link_handle(d); - - if (detour_link_handle == NULL) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour link installation"); + /* Initialize the default detour for the loaders */ + loader_detour(detour_create(metacall_detour())); - metacall_link_destroy(); - - return 1; - } - - if (detour_replace(d, detour_link_handle, metacall_link_func_name, (void (*)(void))(&metacall_link_hook), cast.ptr) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall invalid detour link replacement"); - - metacall_link_destroy(); - - return 1; - } + if (metacall_link_trampoline == NULL) + { + /* Store the original symbol link function */ + metacall_link_trampoline = metacall_link_func(); } if (metacall_link_table == NULL) @@ -199,6 +161,13 @@ int metacall_link_initialize(void) return 0; } +static int metacall_link_register_load_cb(detour d, detour_handle handle) +{ + void (*addr)(void) = NULL; + + return detour_replace(d, handle, metacall_link_func_name, (void (*)(void))(&metacall_link_hook), &addr); +} + int metacall_link_register(const char *tag, const char *library, const char *symbol, void (*fn)(void)) { void *ptr; @@ -208,6 +177,30 @@ int metacall_link_register(const char *tag, const char *library, const char *sym return 1; } + if (loader_hook(tag, library, metacall_link_register_load_cb) == NULL) + { + return 1; + } + + dynlink_symbol_uncast(fn, ptr); + + return set_insert(metacall_link_table, (set_key)symbol, ptr); +} + +int metacall_link_register_impl(void *loader, const char *library, const char *symbol, void (*fn)(void)) +{ + void *ptr; + + if (metacall_link_table == NULL) + { + return 1; + } + + if (loader_hook_impl(loader, library, metacall_link_register_load_cb) == NULL) + { + return 1; + } + dynlink_symbol_uncast(fn, ptr); return set_insert(metacall_link_table, (set_key)symbol, ptr); @@ -220,6 +213,10 @@ int metacall_link_unregister(const char *tag, const char *library, const char *s return 1; } + /* TODO: Restore the hook? We need support for this on the detour API */ + (void)tag; + (void)library; + return (set_remove(metacall_link_table, (set_key)symbol) == NULL); } @@ -227,15 +224,6 @@ void metacall_link_destroy(void) { threading_mutex_lock(&link_mutex); - if (detour_link_handle != NULL) - { - detour d = detour_create(metacall_detour()); - - detour_unload(d, detour_link_handle); - - detour_link_handle = NULL; - } - if (metacall_link_table != NULL) { set_destroy(metacall_link_table); diff --git a/source/plugin/source/plugin_manager.c b/source/plugin/source/plugin_manager.c index 94e6cc5d3..d0f92a36a 100644 --- a/source/plugin/source/plugin_manager.c +++ b/source/plugin/source/plugin_manager.c @@ -111,7 +111,7 @@ int plugin_manager_initialize(plugin_manager manager, const char *name, const ch #endif ; - dynlink_library_path_str path; + dynlink_path path; size_t length = 0; /* The order of precedence is: diff --git a/source/plugins/sandbox_plugin/source/sandbox_plugin.cpp b/source/plugins/sandbox_plugin/source/sandbox_plugin.cpp index 884342633..48bd7a715 100644 --- a/source/plugins/sandbox_plugin/source/sandbox_plugin.cpp +++ b/source/plugins/sandbox_plugin/source/sandbox_plugin.cpp @@ -378,7 +378,10 @@ void *sandbox_signals(size_t argc, void *args[], void *data) SCMP_SYS(sigsuspend), SCMP_SYS(sigreturn), SCMP_SYS(rt_sigaction), - SCMP_SYS(rt_sigprocmask), + /* TODO: For some reason this makes the metacall-sandbox-plugin-test fail, + disabled it for now, we should review it + */ + /* SCMP_SYS(rt_sigprocmask), */ SCMP_SYS(rt_sigpending), SCMP_SYS(rt_sigsuspend), SCMP_SYS(rt_sigreturn), diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index 5bf29f76c..48c037205 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -76,7 +76,7 @@ TEST_F(dynlink_test, DefaultConstructor) ASSERT_NE(handle, (dynlink)NULL); - log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_name_impl(handle)); + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_path(handle)); EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); @@ -139,10 +139,10 @@ TEST_F(dynlink_test, DefaultConstructor) ASSERT_NE(handle, (dynlink)NULL); log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object absolute path: %s", absolute_path); - log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file name: %s", dynlink_get_name_impl(handle)); + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file name: %s", dynlink_get_path(handle)); log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_name(handle)); - EXPECT_EQ((int)0, (int)strcmp(absolute_path, dynlink_get_name_impl(handle))); + EXPECT_EQ((int)0, (int)strcmp(absolute_path, dynlink_get_path(handle))); EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); if (handle != NULL) diff --git a/source/tests/metacall_dynlink_path_test/source/metacall_dynlink_path_test.cpp b/source/tests/metacall_dynlink_path_test/source/metacall_dynlink_path_test.cpp index ac6239501..a989448f4 100644 --- a/source/tests/metacall_dynlink_path_test/source/metacall_dynlink_path_test.cpp +++ b/source/tests/metacall_dynlink_path_test/source/metacall_dynlink_path_test.cpp @@ -33,7 +33,7 @@ TEST_F(metacall_dynlink_path_test, DefaultConstructor) { metacall_print_info(); - dynlink_library_path_str path; + dynlink_path path; const char name[] = "metacall" #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) From 3dd2c54e58a9619cea785a0124d91ffe777d9f3a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 10 Apr 2025 17:46:05 +0200 Subject: [PATCH 212/487] Minor bug in cmake libgit2. --- cmake/FindLibGit2.cmake | 6 +- output | 4601 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 4604 insertions(+), 3 deletions(-) create mode 100644 output diff --git a/cmake/FindLibGit2.cmake b/cmake/FindLibGit2.cmake index f9f4497e3..cb1c0cf0a 100644 --- a/cmake/FindLibGit2.cmake +++ b/cmake/FindLibGit2.cmake @@ -44,13 +44,13 @@ endif() if(NOT LibGit2_VERSION AND LibGit2_INCLUDE_DIR) file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_MAJOR REGEX "^#define LIBGIT2_VER_MAJOR +([0-9]+)") - string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_MAJOR ${LibGit2_VERSION_MAJOR}) + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_MAJOR "${LibGit2_VERSION_MAJOR}") file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_MINOR REGEX "^#define LIBGIT2_VER_MINOR +([0-9]+)") - string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_MINOR ${LibGit2_VERSION_MINOR}) + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_MINOR "${LibGit2_VERSION_MINOR}") file(STRINGS "${LibGit2_INCLUDE_DIR}/git2/version.h" LibGit2_VERSION_REVISION REGEX "^#define LIBGIT2_VER_REVISION +([0-9]+)") - string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_REVISION ${LibGit2_VERSION_REVISION}) + string(REGEX MATCH "([0-9]+)$" LibGit2_VERSION_REVISION "${LibGit2_VERSION_REVISION}") set(LibGit2_VERSION "${LibGit2_VERSION_MAJOR}.${LibGit2_VERSION_MINOR}.${LibGit2_VERSION_REVISION}") endif() diff --git a/output b/output new file mode 100644 index 000000000..de325f6b5 --- /dev/null +++ b/output @@ -0,0 +1,4601 @@ ++ export COMPOSE_DOCKER_CLI_BUILD=1 ++ COMPOSE_DOCKER_CLI_BUILD=1 ++ export DOCKER_BUILDKIT=1 ++ DOCKER_BUILDKIT=1 ++ export BUILDKIT_PROGRESS=plain ++ BUILDKIT_PROGRESS=plain ++ export PROGRESS_NO_TRUNC=1 ++ PROGRESS_NO_TRUNC=1 +++ command -v docker-compose ++ '[' -x /usr/local/bin/docker-compose ']' ++ DOCKER_COMPOSE=docker-compose ++ case "$1" in ++ sub_test ++ export DOCKER_BUILDKIT=0 ++ DOCKER_BUILDKIT=0 ++ export METACALL_BUILD_SANITIZER= ++ METACALL_BUILD_SANITIZER= ++ export METACALL_BUILD_COVERAGE= ++ METACALL_BUILD_COVERAGE= ++ export METACALL_BUILD_TYPE=debug ++ METACALL_BUILD_TYPE=debug ++ ln -sf tools/deps/.dockerignore .dockerignore ++ docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm deps +Building deps +Sending build context to Docker daemon 41.47kB +Step 1/11 : ARG METACALL_BASE_IMAGE +Step 2/11 : FROM ${METACALL_BASE_IMAGE} AS deps + ---> 29f27ec2c121 +Step 3/11 : LABEL copyright.name="Vicente Eduardo Ferrer Garcia" copyright.address="vic798@gmail.com" maintainer.name="Vicente Eduardo Ferrer Garcia" maintainer.address="vic798@gmail.com" vendor="MetaCall Inc." version="0.1" + ---> Using cache + ---> 49a33baef77c +Step 4/11 : ARG METACALL_PATH + ---> Using cache + ---> 13cf6ef6b257 +Step 5/11 : ARG METACALL_TOOLS_PATH + ---> Using cache + ---> 74c0900e4935 +Step 6/11 : ENV DEBIAN_FRONTEND=noninteractive LTTNG_UST_REGISTER_TIMEOUT=0 NUGET_XMLDOC_MODE=skip DOTNET_CLI_TELEMETRY_OPTOUT=true + ---> Using cache + ---> 90e6f87497e7 +Step 7/11 : WORKDIR $METACALL_PATH + ---> Using cache + ---> 889e429fecde +Step 8/11 : COPY tools/metacall-environment.sh tools/nobuildtest.patch $METACALL_TOOLS_PATH/ + ---> Using cache + ---> 6039e0748a38 +Step 9/11 : ARG METACALL_BUILD_TYPE + ---> Using cache + ---> 7ef06f56da55 +Step 10/11 : ARG METACALL_INSTALL_OPTIONS + ---> Using cache + ---> 55bcc6a1ff91 +Step 11/11 : RUN chmod 500 $METACALL_TOOLS_PATH/metacall-environment.sh && $METACALL_TOOLS_PATH/metacall-environment.sh ${METACALL_BUILD_TYPE} ${METACALL_INSTALL_OPTIONS} && rm -rf $METACALL_PATH + ---> Using cache + ---> 663a36c6a1d2 +Successfully built 663a36c6a1d2 +Successfully tagged metacall/core:deps ++ ln -sf tools/dev/.dockerignore .dockerignore ++ docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm dev +Building dev +Sending build context to Docker daemon 145MB +Step 1/11 : FROM metacall/core:deps AS dev + ---> 663a36c6a1d2 +Step 2/11 : LABEL copyright.name="Vicente Eduardo Ferrer Garcia" copyright.address="vic798@gmail.com" maintainer.name="Vicente Eduardo Ferrer Garcia" maintainer.address="vic798@gmail.com" vendor="MetaCall Inc." version="0.1" + ---> Using cache + ---> cad39512370c +Step 3/11 : ARG METACALL_PATH + ---> Using cache + ---> 667cbb0424d2 +Step 4/11 : ENV LOADER_LIBRARY_PATH=$METACALL_PATH/build LOADER_SCRIPT_PATH=$METACALL_PATH/build/scripts CONFIGURATION_PATH=$METACALL_PATH/build/configurations/global.json SERIAL_LIBRARY_PATH=$METACALL_PATH/build DETOUR_LIBRARY_PATH=$METACALL_PATH/build PORT_LIBRARY_PATH=$METACALL_PATH/build DEBIAN_FRONTEND=noninteractive NODE_PATH=/usr/lib/node_modules DOTNET_CLI_TELEMETRY_OPTOUT=true + ---> Using cache + ---> 9880ade75ea2 +Step 5/11 : WORKDIR $METACALL_PATH + ---> Using cache + ---> 60b4d0ff9791 +Step 6/11 : COPY . $METACALL_PATH + ---> 61fa6f901dff +Step 7/11 : RUN chmod 500 $METACALL_PATH/tools/metacall-configure.sh && chmod 500 $METACALL_PATH/tools/metacall-build.sh && mkdir -p $METACALL_PATH/build + ---> Running in 83b240d9adc6 +Removing intermediate container 83b240d9adc6 + ---> 605f80d762f6 +Step 8/11 : ARG METACALL_BUILD_TYPE + ---> Running in f1af673b92af +Removing intermediate container f1af673b92af + ---> 84b68123c202 +Step 9/11 : ARG METACALL_BUILD_OPTIONS + ---> Running in c6ce85603c04 +Removing intermediate container c6ce85603c04 + ---> 2407b0953672 +Step 10/11 : RUN cd $METACALL_PATH/build && $METACALL_PATH/tools/metacall-configure.sh ${METACALL_BUILD_TYPE} ${METACALL_BUILD_OPTIONS} + ---> Running in 84f6a9010292 +Current option settings +errexit on +noglob off +ignoreeof off +interactive off +monitor off +noexec off +stdin off +xtrace on +verbose off +vi off +emacs off +noclobber off +allexport off +notify off +nounset on +privileged off +nolog off +pipefail off +debug off ++ pwd ++ ROOT_DIR=/usr/local/metacall/build ++ BUILD_TYPE=Release ++ BUILD_PYTHON=0 ++ BUILD_RUBY=0 ++ BUILD_NETCORE=0 ++ BUILD_NETCORE2=0 ++ BUILD_NETCORE5=0 ++ BUILD_NETCORE7=0 ++ BUILD_V8=0 ++ BUILD_NODEJS=0 ++ BUILD_TYPESCRIPT=0 ++ BUILD_FILE=0 ++ BUILD_RPC=0 ++ BUILD_WASM=0 ++ BUILD_JAVA=0 ++ BUILD_C=0 ++ BUILD_COBOL=0 ++ BUILD_GO=0 ++ BUILD_RUST=0 ++ BUILD_ZIG=0 ++ BUILD_SCRIPTS=0 ++ BUILD_EXAMPLES=0 ++ BUILD_TESTS=0 ++ BUILD_BENCHMARKS=0 ++ BUILD_PORTS=0 ++ BUILD_SANDBOX=0 ++ BUILD_COVERAGE=0 ++ BUILD_ADDRESS_SANITIZER=0 ++ BUILD_THREAD_SANITIZER=0 ++ BUILD_MEMORY_SANITIZER=0 ++ uname -s ++ OPERATIVE_SYSTEM=Linux ++ [ -f /etc/os-release ] ++ cat /etc/os-release ++ grep ^ID= ++ cut -f2- -d= ++ sed -e s/^[[:space:]]*// -e s/[[:space:]]*$// ++ tr -d " ++ LINUX_DISTRO=debian ++ + cat /etc/os-release +grep ^VERSION_ID= ++ cut -f2- -d= ++ sed -e s/^[[:space:]]*// -e s/[[:space:]]*$// ++ tr -d " ++ LINUX_VERSION_ID= ++ sub_options debug python ruby netcore7 nodejs typescript file rpc wasm java c cobol go rust examples tests scripts ports install pack sandbox benchmarks ++ [ debug = debug ] ++ echo Build all scripts in debug mode ++ BUILD_TYPE=Debug ++ [ debug = release ] ++ [ debug = relwithdebinfo ] ++ [ debug = python ] ++ [ debug = ruby ] ++ [ debug = netcore ] ++ [ debug = netcore2 ] ++ [ debug = netcore5 ] ++ [ debug = netcore7 ] ++ [ debug = v8 ] ++ [ debug = nodejs ] ++ [ debug = typescript ] ++ [ debug = file ] ++ [ debug = rpc ] ++ [ debug = wasm ] ++ [ debug = java ] ++ [ debug = c ]Build all scripts in debug mode + ++ [ debug = cobol ] ++ [ debug = go ] ++ [ debug = rust ] ++ [ debug = zig ] ++ [ debug = scripts ] ++ [ debug = examples ] ++ [ debug = tests ] ++ [ debug = benchmarks ] ++ [ debug = ports ] ++ [ debug = sandbox ] ++ [ debug = coverage ] ++ [ debug = address-sanitizer ] ++ [ debug = thread-sanitizer ] ++ [ debug = memory-sanitizer ] ++ [ python = debug ] ++ [ python = release ] ++ [ python = relwithdebinfo ] ++ [ python = python ] ++ echo Build with python support ++ BUILD_PYTHON=1 ++ [ python = ruby ] ++ [ python = netcore ] ++ [ python = netcore2 ] ++ [ python = netcore5 ] ++ [ python = netcore7 ] ++ [ python = v8 ] ++ [ python = nodejs ] ++ [ python = typescript ] ++ [ python = file ] ++ [ python = rpc ] ++ [ python = wasmBuild with python support + ] ++ [ python = java ] ++ [ python = c ] ++ [ python = cobol ] ++ [ python = go ] ++ [ python = rust ] ++ [ python = zig ] ++ [ python = scripts ] ++ [ python = examples ] ++ [ python = tests ] ++ [ python = benchmarks ] ++ [ python = ports ] ++ [ python = sandbox ] ++ [ python = coverage ] ++ [ python = address-sanitizer ] ++ [ python = thread-sanitizer ] ++ [ python = memory-sanitizer ] ++ Build with ruby support +[ ruby = debug ] ++ [ ruby = release ] ++ [ ruby = relwithdebinfo ] ++ [ ruby = python ] ++ [ ruby = ruby ] ++ echo Build with ruby support ++ BUILD_RUBY=1 ++ [ ruby = netcore ] ++ [ ruby = netcore2 ] ++ [ ruby = netcore5 ] ++ [ ruby = netcore7 ] ++ [ ruby = v8 ] ++ [ ruby = nodejs ] ++ [ ruby = typescript ] ++ [ ruby = file ] ++ [ ruby = rpc ] ++ [ ruby = wasm ] ++ [ ruby = java ] ++ [ ruby = c ] ++ [ ruby = cobol ] ++ [ ruby = go ] ++ [ ruby = rust ] ++ [ ruby = zig ] ++ [ ruby = scripts ] ++ [ ruby = examples ] ++ [ ruby = tests ] ++ [ ruby = benchmarks ] ++ [ ruby = ports ] ++ [ ruby = sandbox ] ++ [ ruby = coverage ] ++ [ ruby = address-sanitizer ] ++ [ ruby = thread-sanitizer ] ++ [ ruby = memory-sanitizer ] ++ [ netcore7 = debug ] ++ [ netcore7 = release ] ++ [ netcore7 = relwithdebinfo ] ++ [ netcore7 = python ] ++ [ netcore7 = ruby ] ++ [ netcore7 = netcore ] ++ [ netcore7 = netcore2 ] ++ [ netcore7 = netcore5 ] ++ [Build with netcore 7 support + netcore7 = netcore7 ] ++ echo Build with netcore 7 support ++ BUILD_NETCORE7=1 ++ [ netcore7 = v8 ] ++ [ netcore7 = nodejs ] ++ [ netcore7 = typescript ] ++ [ netcore7 = file ] ++ [ netcore7 = rpc ] ++ [ netcore7 = wasm ] ++ [ netcore7 = java ] ++ [ netcore7 = c ] ++ [ netcore7 = cobol ] ++ [ netcore7 = go ] ++ [ netcore7 = rust ] ++ [ netcore7 = zig ] ++ [ netcore7 = scripts ] ++ [ netcore7 = examples ] ++ [ netcore7 = tests ] ++ [ netcore7 = benchmarks ] ++ [ netcore7 = ports ] ++ [ netcore7 = sandbox ] ++ [ netcore7 = coverage ] ++ [ netcore7 = address-sanitizer ] ++ [ netcore7 = thread-sanitizer ] ++ [ netcore7 = memory-sanitizer ] ++ [ nodejs = debug ] ++ [ nodejs = release ] ++ [ nodejs = relwithdebinfo ] ++ [ nodejs = python ] ++ [ nodejs = ruby ] ++ [ nodejs = netcore ] ++ [ nodejs = netcore2 ] ++ [ nodejs = netcore5 ] ++ [ nodejs = netcore7 ] ++ [ nodejs = v8 ] ++ [ nodejs = nodejs ] ++ echo Build with nodejs support ++ BUILD_NODEJS=1 ++ [ nodejs = typescript ] ++ [ nodejs = file ] ++ [ nodejs = rpc ] ++ [ nodejs = wasm ] ++ [ nodejs = java ] ++ [ nodejs = c ] ++ [ nodejs = cobol ] ++ [ nodejs = go ] ++ [ nodejs = rust ] ++ [ nodejs = zig ] ++ [ nodejs = scripts ] ++ [ nodejs = examples ] ++ [ nodejs = tests ] ++ [ nodejs = benchmarks ] ++ [ nodejs = ports ] ++ [ nodejs = sandbox ] ++ [ nodejs = coverage ] ++ [ nodejs = address-sanitizer ] ++ [ nodejs = thread-sanitizer ] ++ [ nodejs = memory-sanitizer ] ++ [ typescript = debug ] ++ [ typescript = release ] ++ [ typescript = relwithdebinfo ] ++ [ typescript = python ] ++ [ typescript = ruby ] ++ [ typescript = netcore ] ++ [ typescript = netcore2 ] ++ [ typescript = netcore5 ] ++ [ typescript = netcore7 ] ++ [ typescript = v8 ] ++ [ typescript = nodejs ] ++ [ typescript = typescript ] ++ echo Build with typescript support ++ BUILD_TYPESCRIPT=1 ++ [ typescript = file ] ++ [ typescript = rpc ] ++ [ typescript = wasm ] ++ [ typescript = java ] ++ [ typescript = c ] ++ [ typescript = cobol ] ++ [ typescript = go ] ++ [ typescript = rust ] ++ [ typescript = zig ] ++ [ typescript = scripts ] ++ [ typescript = examples ] ++ [ typescript = tests ] ++ [ typescript = benchmarks ] ++ [ typescript = ports ] ++ [ typescript = sandbox ] ++ [ typescript = coverage ] ++ [ typescript = address-sanitizer ] ++ [ typescript = thread-sanitizer ] ++ [ typescript = memory-sanitizer ] ++ [ file = debug ] ++ [ file = release ] ++ [ file = relwithdebinfo ] ++ [ file = python ] ++ [ file = ruby ] ++ [ file = netcore ] ++ [ file = netcore2 ] ++ [ file = netcore5 ] ++ [ file = netcore7 ] ++ [ file = v8 ] ++ [ file = nodejs ] ++ [ file = typescript ] ++ [ file = file ] ++ echo Build with file support ++ BUILD_FILE=1 ++ [ file = rpc ] ++ [ file = wasm ] +Build with nodejs support +Build with typescript support +Build with file support ++ [ file = java ] ++ [ file = c ] ++ [ file = cobol ] ++ [ file = go ] ++ [ file = rust ] ++ [ file = zig ] ++ [ file = scripts ] ++ [ file = examples ] ++ [ file = tests ] ++ [ file = benchmarks ] ++ [ file = ports ] ++ [ file = sandbox ] ++ [ file = coverage ] ++ [ file = address-sanitizer ] ++ [ file = thread-sanitizer ] ++ [ file = memory-sanitizer ] ++ [ rpc = debug ] ++ [ rpc = release ] ++ [ rpc = relwithdebinfo ] ++ [ rpc = python ] ++ [ rpc = ruby ] ++ [ rpc = netcore ] ++ [ rpc = netcore2 ] ++ [ rpc = netcore5 ] ++ [ rpc = netcore7 ] ++ [ rpc = v8 ] ++ [ rpc = nodejs ] ++ [ rpc = typescript ] ++ [ rpc = file ] ++ [ rpc = rpc ] ++ echo Build with rpc support ++ BUILD_RPC=1 ++ [ rpc = wasm ] ++ [ rpc = java ] ++ [ rpc = c ] ++ [ rpc = cobol ] ++ [ rpc = go ] ++ [ rpc = rust ] ++ [ rpc = zig ] ++ [ rpc = scripts ] ++ [ rpc = examples ] ++ [ rpc = tests ] ++ [ rpc = benchmarks ] ++ [ rpc = ports ] ++ [ rpc = sandbox ] ++ [ rpc = coverage ] ++ [ rpc = address-sanitizer ] ++ [ rpc = thread-sanitizer ] ++ [ rpc = memory-sanitizer ] ++ [ wasm = debug ] ++ [ wasm = release ] ++ [ wasm = relwithdebinfo ] ++ [ wasm = python ] ++ [ wasm = ruby ] ++ [ wasm = netcore ] ++ [ wasm = netcore2 ] ++ [ wasm = netcore5Build with rpc support + ] ++ [ wasm = netcore7 ] ++ [ wasm = v8 ] ++ [ wasm = nodejs ] ++ [ wasm = typescript ] ++ [ wasm = file ] ++ [ wasm = rpc ] ++ [ wasm = wasm ] ++ echo Build with wasm support ++ BUILD_WASM=1 ++ [ wasm = java ] ++ [ wasm = c ] ++ [ wasm = cobol ] ++ [ wasm = go ] ++ [ wasm = rust ] ++ [ wasm = zig ] ++ [ wasm = scripts ] ++ [ wasm = examples ] ++ [ wasmBuild with wasm support + = tests ] ++ [ wasm = benchmarks ] ++ [ wasm = ports ] ++ [ wasm = sandbox ] ++ [ wasm = coverage ] ++ [ wasm = address-sanitizer ] ++ [ wasm = thread-sanitizer ] ++ [ wasm = memory-sanitizer ] ++ [ java = debug ] ++ [ java = release ] ++ [ java = relwithdebinfo ] ++ [ java = python ] ++ [ java = ruby ] ++ [ java = netcore ] ++ [ java = netcore2 ] ++ [ java = netcore5 ] ++ [ java = netcore7 ] ++ [ java = v8 ] ++ [ java = nodejs ] ++ [ java = typescript ] ++ [ java = file ] ++ [ java = rpc ] ++ [ java = wasm ] ++ [ java = java ] ++ echo Build with java support ++ BUILD_JAVA=1 ++ [ java = c ] ++ [ java = cobol ] ++ [ java = go ] ++ [ java = rust ] ++ [ java = zig ] ++ [ java = scripts ] ++ [ java = examples ] +Build with java support ++ [ java = tests ] ++ [ java = benchmarks ] ++ [ java = ports ] ++ [ java = sandbox ] ++ [ java = coverage ] ++ [ java = address-sanitizer ] ++ [ java = thread-sanitizer ] ++ [ java = memory-sanitizer ] ++ [ c = debug ] ++ [ c = release ] ++ [ c = relwithdebinfo ] ++ [ c = python ] ++ [ c = ruby ] ++ [ c = netcore ] ++ [ c = netcore2 ] ++ [ c = netcore5 ] ++ [ c = netcore7 ] ++ [ c = v8 ] ++ [ c = nodejs ] ++ [ c = typescript ] ++ [ c = file ] ++ [ c = rpc ] ++ [ c = wasm ] ++ [ c = java ] ++ [ c = c ] ++ echo Build with c support ++ BUILD_C=1 ++ [ c = cobol ] ++ [ c = go ] ++ [ c = rust ] ++ [ c = zig ] ++ [ c = scripts ] ++ [ c = examples ] ++ [ c = tests ] ++ [ c = benchmarks ] ++ [ c = ports ] ++ [ c = sandbox ] ++ [ c = coverage ] ++ [ c = address-sanitizer ] ++ [ c = thread-sanitizer ] ++ [ c = memory-sanitizer ] ++ [ cobol = debug ] ++ [ cobol = release ] ++ [ cobol = relwithdebinfo ] ++ [ cobol = python ] ++ [ cobol = ruby ] ++ [ cobol = netcore ] ++ [ cobol = netcore2 ] ++ [ cobol = netcore5 ] ++ [ cobol = netcore7 ] ++ [ cobol = v8 ] ++ [ cobol = nodejs ] ++ [ cobol = typescript ] ++ [ cobol = file ] ++ [ cobol = rpc ] ++ [ cobol = wasm ] ++ [ cobol = java ] ++ [ cobol = c ] ++ [ cobol = cobol ] ++ echo Build with cobol support ++ BUILD_COBOL=1 ++ [ cobol = go ] ++ [ cobol = rust ] ++ [ cobol = zig ] ++ [ cobol = scripts ] ++ [ cobol = examples ] ++ [ cobol = tests ] ++ [ cobol = benchmarks ] ++ [ cobol = ports ] ++ [ cobol = sandbox ] ++ [ cobol = coverage ] ++ [ cobol = address-sanitizer ] ++ [ cobol = thread-sanitizer ] ++ [ cobol = memory-sanitizer ] ++ [ go = debug ] ++ [ go = release ] ++ [ go = relwithdebinfo ] ++ [ go = python ] ++ [ go = ruby ] ++ [ go = netcore ] ++ [ go = netcore2 ] ++ [ go = netcore5 ] ++ [ go = netcore7 ] ++ [ go = v8 ] ++ [ go = nodejs ] ++ [ go = typescript ] ++ [ go = file ] ++ [ go = rpc ] ++ [ go = wasm ] ++ [ go = java ] ++ [ go = c ] ++ [ go = cobol ] ++ [ go = go ] ++ echo Build with go support ++ BUILD_GO=1 ++ [ go = rust ] ++ [ go = zig ] ++ [ go = scripts ] ++ [ go = examples ] ++ [ go = tests ] ++ [ go = benchmarks ] ++ [ go = ports ] ++ [ go = sandbox ] ++ [ go = coverage ] ++ [ go = address-sanitizer ] ++ [ go = thread-sanitizer ] ++ [ go = memory-sanitizer ] ++ [ rust = debug ] ++ [ rust = release ] ++ [ rust = relwithdebinfo ] ++ [ rust = python ] ++ [ rust = ruby ] ++ [ rust = netcore ] ++ [ rust = netcore2 ] ++ [ rust = netcore5 ] ++ [ rust = netcore7 ] ++ [ rust = v8 ] ++ [ rust = nodejs ] ++ [ rust = typescript ] ++ [ rust = file ] ++ [ rust = rpc ] ++ [ rust = wasm ] ++ [ rust = java ] ++ [ rust = c ] ++ [ rust = cobol ] ++ [ rust = go ] ++ [ rust = rust ] ++ echo Build with rust support ++ BUILD_RUST=1 ++ [ rust = zig ] ++ [ rust = scripts ] ++ [ rust = examples ] ++ [ rust = tests ] ++ [ rust = benchmarks ] ++ [ rust = ports ] ++ [ rust = sandbox ] ++ [ rust = coverage ] ++ [ rust = address-sanitizer ] ++ [ rust = thread-sanitizer ] ++ [ rust = memory-sanitizer ] ++ [ examples = debug ] ++ [ examples = release ] ++ [ examples = relwithdebinfo ] ++ [ examples = python ] ++ [ examples = ruby ] ++ [ examples = netcore ] ++ [ examples = netcore2 ] ++ [ examples = netcore5 ] ++ [ examples = netcore7 ] ++ [ examples = v8 ] ++ [ examples = nodejs ] ++ [ examples = typescript ] ++ [ examples = file ] ++ [ examples = rpc ] ++ [ examples = wasm ] ++ [ examples = java ] ++ [ examples = c ] ++ [ examples = cobol ] ++ [ examples = go ] ++ [ examples = rust ] ++ [ examples = zig ] ++ [ examples = scripts ] ++ [ examples = examples ] ++ echo Build all examples ++ BUILD_EXAMPLES=1 ++ [ examples = tests ] ++ [ examples = benchmarks ] ++ [ examples = ports ] ++ [ examples = sandbox ] ++ [ examples = coverage ] ++ [ examples = address-sanitizer ] ++ [ examples = thread-sanitizer ] ++ [ examples = memory-sanitizer ] ++ [ tests = debug ] ++ [ tests = release ] ++ [ tests = relwithdebinfo ] ++ [ tests = python ] ++ [ tests = ruby ] ++ [ tests = netcore ] ++ [ tests = netcore2 ] ++ [ tests = netcore5 ] ++ [ tests = netcore7 ] ++ [ tests = v8 ] ++ [ tests = nodejs ] ++ [ tests = typescript ] ++ [ tests = file ] ++ [ tests = rpc ] ++ [ tests = wasm ] ++ [ tests = java ] ++ [ tests = c ] ++ [ tests = cobol ] ++ [ tests = go ] ++ [ tests = rust ] ++ [ tests = zig ] ++ [ tests = scripts ] ++ [ tests = examples ] ++ [ tests = tests ] ++ echo Build all tests ++ BUILD_TESTS=1 ++ [ tests = benchmarks ] ++ [ tests = ports ] ++ [ tests = sandbox ] ++ [ tests = coverage ] ++ [ tests = address-sanitizer ] ++ [ tests = thread-sanitizer ] ++ [ tests = memory-sanitizer ] ++ [ scripts = debug ] ++ [ scripts = release ] ++ [ scripts = relwithdebinfo ] ++ [ scripts = python ]Build with c support +Build with cobol support +Build with go support +Build with rust support +Build all examples +Build all tests + ++ [ scripts = ruby ] ++ [ scripts = netcore ] ++ [ scripts = netcore2 ] ++ [ scripts = netcore5 ] ++ [ scripts = netcore7 ] ++ [ scripts = v8 ] ++ [ scripts = nodejs ] ++ [ scripts = typescript ] ++ [ scripts = file ] ++ [ scripts = rpc ] ++ [ scripts = wasm ] ++ [ scripts = java ] ++ [ scripts = c ] ++ [ scripts = cobol ] ++ [ scripts = go ] ++ [ scripts = rust ] ++ [ scripts = zig ] ++ [ scripts = scripts ] ++ echo Build all scripts ++ BUILD_SCRIPTS=1 ++ [ scripts = examples ] ++ [ scripts = tests ] ++ [ scripts = benchmarks ] ++ [ scripts = ports ] ++ [ scripts = sandbox ] ++ [ scripts = coverage ] ++ [ scripts = address-sanitizer ] ++ [ scripts = thread-sanitizer ] ++ [ scripts = memory-sanitizer ] ++ [ ports = debug ] ++ [ ports = release ] ++ [ ports = relwithdebinfo ] +Build all scripts ++ [ ports = python ] ++ [ ports = ruby ] ++ [ ports = netcore ] ++ [ ports = netcore2 ] ++ [ ports = netcore5 ] ++ [ ports = netcore7 ] ++ [ ports = v8 ] ++ [ ports = nodejs ] ++ [ ports = typescript ] ++ [ ports = file ] ++ [ ports = rpc ] ++ [ ports = wasm ] ++ [ ports = java ] ++ [ ports = c ] ++ [ ports = cobol ] ++ [ ports = go ] ++ [ ports = rust ] ++ [ ports = zig ] ++ [ ports = scripts ] ++ [ ports = examples ] ++ [ ports = tests ] ++ [ ports = benchmarks ] ++ [ ports = ports ] ++ echo Build all ports +Build all ports ++ BUILD_PORTS=1 ++ [ ports = sandbox ] ++ [ ports = coverage ] ++ [ ports = address-sanitizer ] ++ [ ports = thread-sanitizer ] ++ [ ports = memory-sanitizer ] ++ [ install = debug ] ++ [ install = release ] ++ [ install = relwithdebinfo ] ++ [ install = python ] ++ [ install = ruby ] ++ [ install = netcore ] ++ [ install = netcore2 ] ++ [ install = netcore5 ] ++ [ install = netcore7 ] ++ [ install = v8 ] ++ [ install = nodejs ] ++ [ install = typescript ] ++ [ install = file ] ++ [ install = rpc ] ++ [ install = wasm ] ++ [ install = java ] ++ [ install = c ] ++ [ install = cobol ] ++ [ install = go ] ++ [ install = rust ] ++ [ install = zig ] ++ [ install = scripts ] ++ [ install = examples ] ++ [ install = tests ] ++ [ install = benchmarks ] ++ [ install = ports ] ++ [ install = sandbox ] ++ [ install = coverage ] ++ [ install = address-sanitizer ] ++ [ install = thread-sanitizer ] ++ [ install = memory-sanitizer ] ++ [ pack = debug ] ++ [ pack = release ] ++ [ pack = relwithdebinfo ] ++ [ pack = python ] ++ [ pack = ruby ] ++ [ pack = netcore ] ++ [ pack = netcore2 ] ++ [ pack = netcore5 ] ++ [ pack = netcore7 ] ++ [ pack = v8 ] ++ [ pack = nodejs ] ++ [ pack = typescript ] ++ [ pack = file ] ++ [ pack = rpc ] ++ [ pack = wasm ] ++ [ pack = java ] ++ [ pack = c ] ++ [ pack = cobol ] ++ [ pack = go ] ++ [ pack = rust ] ++ [ pack = zig ] ++ [ pack = scripts ] ++ [ pack = examples ] ++ [ pack = tests ] ++ [ pack = benchmarks ] ++ [ pack = ports ] ++ [ pack = sandbox ] ++ [ pack = coverage ] ++ [ pack = address-sanitizer ] ++ [ pack = thread-sanitizer ] ++ [ pack = memory-sanitizer ] ++ [ sandbox = debug ] ++ [ sandbox = release ] ++ [ sandbox = relwithdebinfo ] ++ [ sandbox = python ] ++ [ sandbox = ruby ] ++ [ sandbox = netcore ] ++ [ sandbox = netcore2 ] ++ [ sandbox = netcore5 ] ++ [ sandbox = netcore7 ] ++ [ sandbox = v8 ] ++ [ sandbox = nodejs ] ++ [ sandbox = typescript ] ++ [ sandbox = file ] ++ [ sandbox = rpc ] ++ [ sandbox = wasm ] ++ [ sandbox = java ] ++ [ sandbox = c ] ++ [ sandbox = cobol ] ++ [ sandbox = go ] ++ [ sandbox = rust ] ++ [ sandbox = zig ] ++ [ sandbox = scripts ] ++ [ sandbox = examples ] ++ [ sandbox = tests ] ++ [ sandbox = benchmarks ] ++ [ sandbox = ports ] ++ [ sandbox = sandbox ] ++ echo Build with sandboxing support ++ BUILD_SANDBOX=1 ++ [ sandbox = coverage ] ++ [ sandbox = address-sanitizer ] ++ [ sandbox = thread-sanitizer ] ++ [ sandbox = memory-sanitizer ] ++ [ benchmarks = debug ] ++ [ benchmarks = release ] ++ [ benchmarks = relwithdebinfo ] ++ [ benchmarks = python ] ++ [ benchmarks = ruby ] ++ [ benchmarks = netcore ] ++ [ benchmarks = netcore2 ] ++ [ benchmarks = netcore5 ] ++ [ benchmarks = netcore7 ] ++ [ benchmarks = v8 ] ++ [ benchmarks = nodejs ] ++ [ benchmarks = typescript ] ++ [ benchmarks = file ] ++ [ benchmarks = rpcBuild with sandboxing support +Build all benchmarks + ] ++ [ benchmarks = wasm ] ++ [ benchmarks = java ] ++ [ benchmarks = c ] ++ [ benchmarks = cobol ] ++ [ benchmarks = go ] ++ [ benchmarks = rust ] ++ [ benchmarks = zig ] ++ [ benchmarks = scripts ] ++ [ benchmarks = examples ] ++ [ benchmarks = tests ] ++ [ benchmarks = benchmarks ] ++ echo Build all benchmarks ++ BUILD_BENCHMARKS=1 ++ [ benchmarks = ports ] ++ [ benchmarks = sandbox ] ++ [ benchmarks = coverage ] ++ [ benchmarks = address-sanitizer ] ++ [ benchmarks = thread-sanitizer ] ++ [ benchmarks = memory-sanitizer ] ++ sub_configure ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On ++ [ debian = alpine ] ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On ++ [ Linux = Darwin ] ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On ++ [ 0 = 1 ] ++ [ 0 = 1 ] ++ [ 0 = 1 ] ++ [ 1 = 1 ] ++ sub_find_dotnet_runtime 7 ++ dotnet --list-runtimes ++ grep -m 1 Microsoft.NETCore.App 7 ++ NETCORE_BASE_PATH=Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App] ++ echo Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App] ++ awk { print $3 } ++ tail -c +2 ++ head -c -2 ++ echo Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App] ++ awk { print $2 } ++ echo /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On ++ [ 0 = 1 ] ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On ++ [ debian = alpine ] ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On ++ [ 1 = 1 ] ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On ++ [ 0 = 1 ] ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On ++ [ 1 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On ++ [ 0 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off ++ [ 0 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off ++ [ 0 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off ++ [ 0 = 1 ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off -DOPTION_BUILD_MEMORY_SANITIZER=Off ++ CMAKE_CONFIG_FILE=/usr/local/metacall/build/CMakeConfig.txt ++ [ -f /usr/local/metacall/build/CMakeConfig.txt ] ++ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off -DOPTION_BUILD_MEMORY_SANITIZER=Off -DCMAKE_BUILD_TYPE=Debug ++ cmake -Wno-dev -DOPTION_GIT_HOOKS=Off -DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off -DOPTION_BUILD_MEMORY_SANITIZER=Off -DCMAKE_BUILD_TYPE=Debug .. +-- The C compiler identification is GNU 14.2.0 +-- The CXX compiler identification is GNU 14.2.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Check for working CXX compiler: /usr/bin/c++ - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +-- Target Operative System: Linux +-- Target OS Family: unix +-- Linux x86_64 64bit detected +CMake Warning at CMakeLists.txt:162 (message): + Linting disabled: clang-format executable not found + + +-- Lib version +-- Performing Test PIC_C_FLAG +-- Performing Test PIC_C_FLAG - Success +-- Performing Test STACK_PROTECTOR_STRONG_C_FLAG +-- Performing Test STACK_PROTECTOR_STRONG_C_FLAG - Success +-- Performing Test FORTIFY_SOURCE_C_FLAG +-- Performing Test FORTIFY_SOURCE_C_FLAG - Success +-- Performing Test PIC_CXX_FLAG +-- Performing Test PIC_CXX_FLAG - Success +-- Performing Test STACK_PROTECTOR_STRONG_CXX_FLAG +-- Performing Test STACK_PROTECTOR_STRONG_CXX_FLAG - Success +-- Performing Test FORTIFY_SOURCE_CXX_FLAG +-- Performing Test FORTIFY_SOURCE_CXX_FLAG - Success +-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY +-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success +-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY +-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success +-- Performing Test COMPILER_HAS_DEPRECATED_ATTR +-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success +-- Lib preprocessor +-- Lib environment +-- Lib format +-- Lib log +-- Lib memory +-- Lib portability +-- Lib threading +-- Lib adt +-- Lib filesystem +-- Lib dynlink +-- Lib plugin +-- Lib detour +-- Lib reflect +-- Lib serial +-- Lib configuration +-- Lib loader +-- Lib metacall +-- Found LibFFI: /usr/lib/x86_64-linux-gnu/libffi.so +-- Could NOT find LibTCC (missing: LIBTCC_LIBRARY LIBTCC_INCLUDE_DIR) +-- Installing LibTCC 6ec4a10 +-- Found LibClang: /usr/lib/llvm-14/lib/libclang.so +-- Plugin c_loader +-- Found COBOL: /usr/bin/cobc (found version "3.2.0") +-- Plugin cob_loader +-- Plugin cs_loader_impl implementation +-- Plugin cs_loader +-- Plugin ext_loader +-- Plugin file_loader +-- Found JNI: /usr/lib/jvm/default-java/include found components: AWT JVM +-- Found Java: /usr/bin/java (found version "21.0.7") +-- Plugin java_loader_bootstrap bootstrap +-- Plugin java_loader +-- Plugin mock_loader +-- Searching NodeJS library version 115 +-- NodeJS Library Found +-- Found NodeJS: /usr/bin/node (found version "20.19.0") +-- Found NPM: /usr/bin/npm (found version "9.2.0") +-- Plugin node_loader_bootstrap bootstrap +-- Plugin node_loader +-- Found Python3: /usr/include/python3.13d (found version "3.13.2") found components: Development Development.Module Development.Embed +-- Plugin py_loader +-- Found Ruby: /usr/bin/ruby (found suitable version "3.3.7", minimum required is "1.8.0") +-- Plugin rb_loader +CMake Warning at source/loaders/rs_loader/CMakeLists.txt:8 (message): + Rust loader is out of date, needs to be updated in order to work + + +-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "8.13.0") +-- Plugin rpc_loader +-- Plugin ts_loader_bootstrap bootstrap +-- Plugin ts_loader +-- Wasmtime C API library or headers not found, downloading from archive +-- [download 0% complete] +-- [download 1% complete] +-- [download 2% complete] +-- [download 3% complete] +-- [download 4% complete] +-- [download 5% complete] +-- [download 6% complete] +-- [download 7% complete] +-- [download 8% complete] +-- [download 9% complete] +-- [download 10% complete] +-- [download 11% complete] +-- [download 12% complete] +-- [download 13% complete] +-- [download 14% complete] +-- [download 15% complete] +-- [download 16% complete] +-- [download 17% complete] +-- [download 18% complete] +-- [download 19% complete] +-- [download 20% complete] +-- [download 21% complete] +-- [download 22% complete] +-- [download 23% complete] +-- [download 24% complete] +-- [download 25% complete] +-- [download 26% complete] +-- [download 27% complete] +-- [download 28% complete] +-- [download 29% complete] +-- [download 30% complete] +-- [download 31% complete] +-- [download 32% complete] +-- [download 33% complete] +-- [download 34% complete] +-- [download 35% complete] +-- [download 36% complete] +-- [download 37% complete] +-- [download 38% complete] +-- [download 39% complete] +-- [download 40% complete] +-- [download 41% complete] +-- [download 42% complete] +-- [download 43% complete] +-- [download 44% complete] +-- [download 45% complete] +-- [download 46% complete] +-- [download 47% complete] +-- [download 48% complete] +-- [download 49% complete] +-- [download 50% complete] +-- [download 51% complete] +-- [download 52% complete] +-- [download 53% complete] +-- [download 54% complete] +-- [download 55% complete] +-- [download 56% complete] +-- [download 57% complete] +-- [download 58% complete] +-- [download 59% complete] +-- [download 60% complete] +-- [download 61% complete] +-- [download 62% complete] +-- [download 63% complete] +-- [download 64% complete] +-- [download 65% complete] +-- [download 66% complete] +-- [download 67% complete] +-- [download 68% complete] +-- [download 69% complete] +-- [download 70% complete] +-- [download 71% complete] +-- [download 72% complete] +-- [download 73% complete] +-- [download 74% complete] +-- [download 75% complete] +-- [download 76% complete] +-- [download 77% complete] +-- [download 78% complete] +-- [download 79% complete] +-- [download 80% complete] +-- [download 81% complete] +-- [download 82% complete] +-- [download 83% complete] +-- [download 84% complete] +-- [download 85% complete] +-- [download 86% complete] +-- [download 87% complete] +-- [download 88% complete] +-- [download 89% complete] +-- [download 90% complete] +-- [download 91% complete] +-- [download 92% complete] +-- [download 93% complete] +-- [download 94% complete] +-- [download 95% complete] +-- [download 96% complete] +-- [download 97% complete] +-- [download 98% complete] +-- [download 99% complete] +-- [download 100% complete] +-- Found Wasmtime: /usr/local/metacall/build/wasmtime/wasmtime-v8.0.1-x86_64-linux-c-api/lib/libwasmtime.so (found suitable version "8.0.1", minimum required is "8.0.1") +-- Plugin wasm_loader +-- Serial metacall_serial +-- Found RapidJSON header files in /usr/local/include +-- Serial rapid_json_serial +-- Detour plthook_detour +-- Extension plugin_extension +-- Found libdw: /usr/lib/x86_64-linux-gnu/libdw.so +-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) +-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR) +-- Found Backward: /usr/local/metacall/build/_deps/backwardcpp-src +-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) +-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR) +-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) +-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR) +-- Found Backward: /usr/local/metacall/build/_deps/backwardcpp-src +-- Plugin backtrace_plugin +-- Found LibSecComp: /usr/lib/x86_64-linux-gnu/libseccomp.so (Required is at least version "2") +-- Plugin sandbox_plugin +-- Port node_port +-- Found Python: /usr/bin/python3 (found version "3.13.2") found components: Interpreter +-- Test node_port_test +-- Test node_port_test_executable +-- Port py_port +-- Found Python3: /usr/bin/python3 (found version "3.13.2") found components: Interpreter +-- The Golang compiler identification is go1.24.2 linux/amd64 +-- Check for working Golang compiler: /usr/bin/go +-- Port go_port +-- Found Rust: /root/.cargo/bin/cargo (found version "1.86.0") +-- Port rs_port + Updating crates.io index + Downloading crates ... + Downloaded bindgen-cli v0.71.1 + Installing bindgen-cli v0.71.1 + Updating crates.io index + Locking 59 packages to latest compatible versions + Adding env_logger v0.10.2 (available: v0.11.8) + Downloading crates ... + Downloaded anstyle-parse v0.2.6 + Downloaded bitflags v2.9.0 + Downloaded anstream v0.6.18 + Downloaded cfg-if v1.0.0 + Downloaded is-terminal v0.4.16 + Downloaded anstyle-query v1.1.2 + Downloaded is_terminal_polyfill v1.70.1 + Downloaded anstyle v1.0.10 + Downloaded strsim v0.11.1 + Downloaded clap_lex v0.7.4 + Downloaded utf8parse v0.2.2 + Downloaded termcolor v1.4.1 + Downloaded quote v1.0.40 + Downloaded libloading v0.8.6 + Downloaded unicode-ident v1.0.18 + Downloaded colorchoice v1.0.3 + Downloaded prettyplease v0.2.32 + Downloaded minimal-lexical v0.2.1 + Downloaded memchr v2.7.4 + Downloaded nom v7.1.3 + Downloaded itertools v0.13.0 + Downloaded clap_builder v4.5.35 + Downloaded aho-corasick v1.1.3 + Downloaded clap v4.5.35 + Downloaded bindgen v0.71.1 + Downloaded clang-sys v1.8.1 + Downloaded proc-macro2 v1.0.94 + Downloaded regex v1.11.1 + Downloaded unicode-width v0.2.0 + Downloaded syn v2.0.100 + Downloaded log v0.4.27 + Downloaded clap_complete v4.5.47 + Downloaded regex-syntax v0.8.5 + Downloaded clap_derive v4.5.32 + Downloaded cexpr v0.6.0 + Downloaded heck v0.5.0 + Downloaded glob v0.3.2 + Downloaded env_logger v0.10.2 + Downloaded shlex v1.3.0 + Downloaded rustc-hash v2.1.1 + Downloaded annotate-snippets v0.11.5 + Downloaded humantime v2.2.0 + Downloaded either v1.15.0 + Downloaded regex-automata v0.4.9 + Downloaded libc v0.2.171 + Compiling proc-macro2 v1.0.94 + Compiling memchr v2.7.4 + Compiling unicode-ident v1.0.18 + Compiling anstyle v1.0.10 + Compiling libc v0.2.171 + Compiling utf8parse v0.2.2 + Compiling anstyle-query v1.1.2 + Compiling is_terminal_polyfill v1.70.1 + Compiling colorchoice v1.0.3 + Compiling glob v0.3.2 + Compiling clap_lex v0.7.4 + Compiling strsim v0.11.1 + Compiling prettyplease v0.2.32 + Compiling regex-syntax v0.8.5 + Compiling heck v0.5.0 + Compiling minimal-lexical v0.2.1 + Compiling cfg-if v1.0.0 + Compiling bindgen v0.71.1 + Compiling unicode-width v0.2.0 + Compiling log v0.4.27 + Compiling either v1.15.0 + Compiling humantime v2.2.0 + Compiling libloading v0.8.6 + Compiling anstyle-parse v0.2.6 + Compiling bitflags v2.9.0 + Compiling termcolor v1.4.1 + Compiling shlex v1.3.0 + Compiling rustc-hash v2.1.1 + Compiling anstream v0.6.18 + Compiling itertools v0.13.0 + Compiling annotate-snippets v0.11.5 + Compiling clang-sys v1.8.1 + Compiling clap_builder v4.5.35 + Compiling aho-corasick v1.1.3 + Compiling nom v7.1.3 + Compiling quote v1.0.40 + Compiling syn v2.0.100 + Compiling is-terminal v0.4.16 + Compiling regex-automata v0.4.9 + Compiling cexpr v0.6.0 + Compiling clap_derive v4.5.32 + Compiling regex v1.11.1 + Compiling env_logger v0.10.2 + Compiling clap v4.5.35 + Compiling clap_complete v4.5.47 + Compiling bindgen-cli v0.71.1 + Finished `release` profile [optimized] target(s) in 31.97s + Installing /root/.cargo/bin/bindgen + Installed package `bindgen-cli v0.71.1` (executable `bindgen`) +-- Found SWIG: /usr/bin/swig (found version "4.3.0") +-- Port rb_port +-- Script compiled +-- Script ffi +-- Script cbks +-- Script loadtest +-- Script say +-- Script hello +-- Script static +-- Script function +-- Script sum_extension +-- Script static +-- Script favicon +-- Script glob +-- Script fibonnaci +-- Script jartest +-- Script test +-- Script nod +-- Script inline +-- Script export +-- Script host +-- Script server +-- Script factcallback +-- Script derpyramda +-- Script gram +-- Script duplicated +-- Script ramda +-- Script example +-- Script helloworld +-- Script initfini +-- Script callback +-- Script function +-- Script ducktype +-- Script rsasample +-- Script garbage +-- Script classname +-- Script web +-- Script landing +-- Script model +-- Script pointer +-- Script dicty +-- Script host +-- Script s1 +-- Script s2 +-- Script withoutfunctions +-- Script wasm +-- Script badimport +-- Script watzon +-- Script fnmesh +-- Script hello +-- Script second +-- Script blog +-- Script cache +-- Script ducktype +-- Script invalid +-- Script klass +-- Script failempty +-- Script remote +-- Script typedfunc +-- Script templating +-- Script loopfail +-- Script badrequire +-- Script server +-- Script tests +-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) (Required is at least version "1.11.0") +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success +-- Found Threads: TRUE +-- Install Google Test v1.11.0 +-- Test preprocessor-test +-- Test environment-test +-- Test log-test +-- Test log-custom-test +-- Test adt-set-test +-- Test adt-trie-test +-- Test adt-vector-test +-- Test adt-map-test +-- Test reflect-value-cast-test +-- Test reflect-function-test +-- Test reflect-object-class-test +-- Test reflect-scope-test +-- Test reflect-metadata-test +-- Test dynlink-test +-- Test detour-test +-- Test serial-test +-- Test configuration-test +-- Test rb-loader-parser-test +-- Test portability-path-test +-- Test metacall-logs-test +-- Test metacall-load-memory-test +-- Test metacall-load-memory-empty-test +-- Test metacall-load-configuration-test +-- Test metacall-load-configuration-fail-test +-- Test metacall-load-configuration-relative-test +-- Test metacall-load-configuration-python-node-test +-- Test metacall-load-configuration-node-python-test +-- Test metacall-duplicated-handle-test +-- Test metacall-duplicated-symbols-test +-- Test metacall-handle-export-test +-- Test metacall-handle-get-test +-- Test metacall-test +-- Test metacall-node-test +-- Test metacall-node-event-loop-test +-- Test metacall-node-event-loop-signal-test +-- Test metacall-node-call-test +-- Test metacall-node-inline-test +-- Test metacall-node-async-test +-- Test metacall-node-async-multiple-test +-- Test metacall-node-reentrant-test +-- Test metacall-node-port-test +-- Test metacall-node-port-await-test +-- Found LibGit2: /usr/lib/x86_64-linux-gnu/libgit2.so (found version "1.8.4") +-- Test metacall-node-port-c-lib-test +-- Test metacall-node-python-port-mock-test +-- Test metacall-node-python-port-ruby-test +-- Searching NodeJS library version 115 +-- NodeJS Library Found +-- Test metacall-node-python-ruby-test +-- Test metacall-node-callback-test +-- Test metacall-node-fail-test +-- Test metacall-node-fail-env-var-test +-- Test metacall-node-fail-load-leak-test +-- Test metacall-node-typescript-test +-- Test metacall-node-python-async-after-destroy-test +-- Test metacall-node-python-await-test +-- Test metacall-node-python-exception-test +-- Test metacall-node-clear-mem-test +-- Test metacall-node-async-resources-test +-- Test metacall-node-await-chain-test +-- Test metacall-node-exception-test +-- Test metacall-node-python-deadlock-test +-- Test metacall-node-native-code-test +-- Test metacall-node-extension-test +-- Searching NodeJS library version 115 +-- NodeJS Library Found +-- Script node_extension_test +-- Test metacall-node-multithread-deadlock-test +-- Test metacall-distributable-test +-- Test metacall-cast-test +-- Test metacall-init-fini-test +-- Test metacall-ducktype-test +-- Test metacall-inspect-test +-- Test metacall-integration-test +-- Test metacall-depends-test +-- Test metacall-configuration-exec-path-test +-- Test metacall-configuration-default-test +-- Test metacall-clear-test +-- Test metacall-python-test +-- Test metacall-python-object-class-test +-- Test metacall-python-gc-test +-- Test metacall-python-open-test +-- Test metacall-python-dict-test +-- Test metacall-python-pointer-test +-- Test metacall-python-reentrant-test +-- Test metacall-python-varargs-test +-- Test py-loader-port-test +-- Test metacall-python-port-https-test +-- Test metacall-python-port-callback-test +-- Test metacall-python-port-pointer-test +-- Test metacall-python-port-import-test +-- Test metacall-python-callback-test +-- Test metacall-python-fail-test +-- Test metacall-python-relative-path-test +-- Test metacall-python-without-functions-test +-- Test metacall-python-builtins-test +-- Test metacall-python-async-test +-- Test metacall-python-exception-test +-- Test metacall-python-without-env-vars-test +-- Test metacall-map-test +-- Test metacall-map-await-test +-- Test metacall-initialize-test +-- Test metacall-initialize-ex-test +-- Test metacall-reinitialize-test +-- Test metacall-initialize-destroy-multiple-test +-- Test metacall-initialize-destroy-multiple-node-test +-- Test metacall-reload-functions-test +-- Test metacall-invalid-loader-test +-- Test metacall-fork-test +-- Test metacall-return-monad-test +-- Test metacall-callback-complex-test +-- Test metacall-ruby-fail-test +-- Test metacall-ruby-fail-empty-test +-- Test metacall-ruby-object-class-test +-- Test metacall-ruby-parser-integration-test +-- Test metacall-function-test +-- Test metacall-cobol-test +-- Test metacall-file-test +-- Test metacall-file-fail-test +-- Test metacall-file-glob-test +-- Test metacall-typescript-test +-- Test metacall-typescript-node-test +-- Test metacall-typescript-call-map-test +-- Test metacall-typescript-tsx-test +-- Test metacall-typescript-tsx-loop-fail-test +-- Test metacall-typescript-require-test +-- Test metacall-typescript-jsx-default-test +-- Test metacall-rpc-test +-- Test metacall-csharp-static-class-test +-- Test metacall-ruby-test +-- Test metacall-cs-test +-- Test metacall-java-test +-- Test metacall-wasm-test +-- Test metacall-wasm-python-port-test +-- Test metacall-c-test +-- Test metacall-c-lib-test +-- Test metacall-version-test +-- Test metacall-dynlink-path-test +-- Test metacall-library-path-without-env-vars-test +-- Test metacall-ext-test +-- Test metacall-plugin-extension-test +-- Test metacall-plugin-extension-local-test +-- Test metacall-backtrace-plugin-test +-- Test metacall-sandbox-plugin-test +-- Could NOT find GBench (missing: GBENCH_INCLUDE_DIR GBENCH_LIBRARY) +-- Install Google Benchmark v1.6.1 +-- Benchmark log-bench +-- Found Python3: /usr/include/python3.13d (found version "3.13.2") found components: Development Development.Module Development.Embed +-- Benchmark metacall-py-c-api-bench +-- Benchmark metacall-py-call-bench +-- Benchmark metacall-py-init-bench +-- Benchmark metacall-node-call-bench +-- Benchmark metacall-rb-call-bench +-- Benchmark metacall-cs-call-bench +-- CLI metacallcli +-- Searching NodeJS library version 115 +-- NodeJS Library Found +-- Plugin cli_repl_plugin +-- Searching NodeJS library version 115 +-- NodeJS Library Found +-- Plugin cli_core_plugin +-- Plugin cli_cmd_plugin +-- Plugin cli_sandbox_plugin +-- Example metacalllog +-- Configuring done (84.4s) +-- Generating done (1.1s) +-- Build files have been written to: /usr/local/metacall/build +Removing intermediate container 84f6a9010292 + ---> d5122ec3833c +Step 11/11 : RUN cd $METACALL_PATH/build && $METACALL_PATH/tools/metacall-build.sh ${METACALL_BUILD_TYPE} ${METACALL_BUILD_OPTIONS} + ---> Running in 8fc0ef566964 ++ BUILD_TYPE=Release ++ BUILD_TESTS=0 ++ BUILD_BENCHMARKS=0 ++ BUILD_COVERAGE=0 ++ BUILD_INSTALL=0 +Current option settings +errexit on +noglob off +ignoreeof off +interactive off +monitor off +noexec off +stdin off +xtrace on +verbose off +vi off +emacs off +noclobber off +allexport off +notify off +nounset on +privileged off +nolog off +pipefail off +debug off ++ id -u ++ [ 0 = 0 ] ++ SUDO_CMD= ++ sub_options debug python ruby netcore7 nodejs typescript file rpc wasm java c cobol go rust examples tests scripts ports install pack sandbox benchmarks ++ [ debug = debug ] ++ echo Build all scripts in debug mode ++ BUILD_TYPE=Debug ++ [ debug = release ] ++ [Build all scripts in debug mode + debug = relwithdebinfo ] ++ [ debug = tests ] ++ [ debug = benchmarks ] ++ [ debug = coverage ] ++ [ debug = install ] ++ [ python = debug ] ++ [ python = release ] ++ [ python = relwithdebinfo ] ++ [ python = tests ] ++ [ python = benchmarks ] ++ [ python = coverage ] ++ [ python = install ] ++ [ ruby = debug ] ++ [ ruby = release ] ++ [ ruby = relwithdebinfo ] ++ [ ruby = tests ] ++ [ ruby = benchmarks ] ++ [ ruby = coverage ] ++ [ ruby = install ] ++ [ netcore7 = debug ] ++ [ netcore7 = release ] ++ [ netcore7 = relwithdebinfo ] ++ [ netcore7 = tests ] ++ [ netcore7 = benchmarks ] ++ [ netcore7 = coverage ] ++ [ netcore7 = install ] ++ [ nodejs = debug ] ++ [ nodejs = release ] ++ [ nodejs = relwithdebinfo ] ++ [ nodejs = tests ] ++ [ nodejs = benchmarks ] ++ [ nodejs = coverage ] ++ [ nodejs = install ] ++ [ typescript = debug ] ++ [ typescript = release ] ++ [ typescript = relwithdebinfo ] ++ [ typescript = tests ] ++ [ typescript = benchmarks ] ++ [ typescript = coverage ] ++ [ typescript = install ] ++ [ file = debug ] ++ [ file = release ] ++ [ file = relwithdebinfo ] ++ [ file = tests ] ++ [ file = benchmarks ] ++ [ file = coverage ] ++ [ file = install ] ++ [ rpc = debug ] ++ [ rpc = release ] ++ [ rpc = relwithdebinfo ] ++ [ rpc = tests ] ++ [ rpc = benchmarks ] ++ [ rpc = coverage ] ++ [ rpc = install ] ++ [ wasm = debug ] ++ [ wasm = release ] ++ [ wasm = relwithdebinfo ] ++ [ wasm = tests ] ++ [ wasm = benchmarks ] ++ [ wasm = coverage ] ++ [ wasm = install ] ++ [ java = debug ] ++ [ java = release ] ++ [ java = relwithdebinfo ] ++ [ java = tests ] ++ [ java = benchmarks ] ++ [ java = coverage ] ++ [ java = install ] ++ [ c = debug ] ++ [ c = release ] ++ [ c = relwithdebinfo ] ++ [ c = tests ] ++ [ c = benchmarks ] ++ [ c = coverage ] ++ [ c = install ] ++ [ cobol = debug ] ++ [ cobol = release ] ++ [ cobol = relwithdebinfo ] ++ [ cobol = tests ] ++ [ cobol = benchmarks ] ++ [ cobol = coverage ] ++ [ cobol = install ] ++ [ go = debug ] ++ [ go = release ] ++ [ go = relwithdebinfo ] ++ [ go = tests ] ++ [ go = benchmarks ] ++ [ go = coverage ] ++ [ go = install ] ++ [ rust = debug ] ++ [ rust = release ] ++ [ rust = relwithdebinfo ] ++ [ rust = tests ] ++ [ rust = benchmarks ] ++ [ rust = coverage ] ++ [ rust = install ] ++ [ examples = debug ] ++ [ examples = release ] ++ [ examples = relwithdebinfo ] ++ [ examples = tests ] ++ [ examples = benchmarks ] ++ [ examples = coverage ] ++ [ examples = install ] ++ [ tests = debug ] ++ [ tests = release ] ++ [ tests = relwithdebinfo ] ++ [ tests = tests ] ++ echo Build and run all tests ++ BUILD_TESTS=1 ++ [ tests = benchmarks ] ++ [ tests = coverage ] ++ [ tests = install ] ++ [ scripts = debug ] ++ [ scripts = release ] ++ [ scripts = relwithdebinfo ] ++ [ scripts = tests ] ++ [ scripts = benchmarks ] ++ [ scripts = coverage ] ++ [ scripts = install ] ++ [ ports = debug ] ++ [ ports = release ] ++ [ ports = relwithdebinfo ] ++ [ ports = tests ] ++ [ ports = benchmarks ] ++ [ ports = coverage ] ++ [ ports = install ] ++ [ install = debug ] ++ [ install = release ] ++ [ install = relwithdebinfo ] ++ [ install = tests ] ++ Build and run all tests +[ install = benchmarks ] ++ [ install = coverage ] ++ [ install = install ] ++ echo Install all libraries ++ BUILD_INSTALL=1 ++ [ pack = debug ] ++ [ pack = release ] ++ [ pack = relwithdebinfo ] ++ [ pack = tests ] ++ [ pack = benchmarks ] ++ [ pack = coverage ] ++ [ pack = install ] ++ [ sandbox = debug ] ++ [ sandbox = release ] ++ [ sandbox = relwithdebinfo ] ++ [ sandbox = tests ] ++ [ sandbox = benchmarks ] ++ [ sandbox = coverage ] ++ [ sandbox = install ] ++ [ benchmarks = debug ] ++ [ benchmarks = release ] ++ [ benchmarks = relwithdebinfo ] ++ [ benchmarks = tests ] ++ [ benchmarks = benchmarks ] ++ echo Build and run all benchmarks ++ BUILD_BENCHMARKS=1 ++ [ benchmarks = coverage ] ++ [ benchmarks = install ] ++ sub_build +Install all libraries +Build and run all benchmarks ++ getconf _NPROCESSORS_ONLN ++ make -j24 +[ 0%] Building C object source/version/CMakeFiles/version.dir/source/version.c.o +Installing node_loader_bootstrap dependencies +[ 0%] Creating directories for 'libtcc-depends' +[ 0%] Building CXX object source/scripts/c/loadtest/CMakeFiles/loadtest.dir/source/loadtest.cpp.o +[ 1%] Building CXX object _deps/backwardcpp-build/CMakeFiles/backward.dir/backward.cpp.o +[ 2%] Building C object source/metacall/CMakeFiles/metacall.dir/__/version/source/version.c.o +[ 3%] Swig compile /usr/local/metacall/source/ports/rb_port/interface/rb_port/rb_port.i for ruby +Installing ts_loader_bootstrap dependencies +[ 3%] Built target c-ffi +[ 3%] Building CXX object _deps/backwardcpp-build/CMakeFiles/backward_object.dir/backward.cpp.o +[ 3%] Built target c-cbks +[ 3%] Built target c-compiled +[ 3%] Built target file-glob +[ 3%] Built target csharp-function +[ 3%] Built target file-static +[ 3%] Built target file-favicon +[ 3%] Built target sandbox_plugin_config +[ 3%] Built target c-loadtest +[ 3%] Built target backtrace_plugin_config +[ 3%] Built target csharp-static +[ 3%] Built target csharp-hello +[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/preprocessor/source/preprocessor.c.o +[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/environment/source/environment.c.o +[ 3%] Performing download step (download, verify and extract) for 'libtcc-depends' +-- Downloading... + dst='/usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/tinycc.tar.gz' + timeout='none' + inactivity timeout='none' +-- Using src='https://github.com/metacall/tinycc/archive/6ec4a10.tar.gz' +[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/environment/source/environment_variable.c.o +[ 3%] Built target java-test +[ 3%] Built target java-jartest +[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/environment/source/environment_variable_path.c.o +[ 3%] Built target nodejs-nod +[ 3%] Built target java-fibonnaci +[ 3%] Linking CXX shared library ../../libversiond.so +[ 3%] Built target nodejs-inline +[ 3%] Built target nodejs-server +[ 3%] Built target nodejs-factcallback +[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/format/source/format.c.o +[ 3%] Built target nodejs-host +[ 3%] Built target nodejs-export +[ 3%] Built target nodejs-derpyramda +[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/threading/source/threading.c.o +[ 3%] Built target python-example +[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/threading/source/threading_thread_id.c.o +[ 3%] Built target nodejs-duplicated +[ 3%] Built target python-callback +[ 3%] Built target python-initfini +[ 3%] Built target python-ducktype +[ 4%] Building C object source/metacall/CMakeFiles/metacall.dir/__/threading/source/threading_mutex_pthread.c.o +[ 4%] Built target version +[ 4%] Built target python-function +[ 4%] Built target python-helloworld +[ 4%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log.c.o +[ 4%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_map.c.o +[ 4%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_valid_size.c.o +[ 4%] Built target cobol-say +[ 5%] Linking CXX shared library ../../../../scripts/libloadtest.so +[ 5%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_level.c.o +[ 5%] Built target python-garbage +[ 5%] Built target python-rsasample +[ 5%] Built target python-classname +/usr/local/metacall/source/metacall/include/metacall/metacall.h:61: Warning 801: Wrong class name (corrected to `Metacall_initialize_configuration_type') +/usr/local/metacall/source/metacall/include/metacall/metacall.h:61: Warning 801: Wrong class name (corrected to `Metacall_initialize_configuration_type') +/usr/local/metacall/source/metacall/include/metacall/metacall.h:62: Warning 451: Setting a const char * variable may leak memory. +/usr/local/metacall/source/metacall/include/metacall/metacall.h:69: Warning 801: Wrong class name (corrected to `Metacall_await_callbacks') +/usr/local/metacall/source/metacall/include/metacall/metacall.h:69: Warning 801: Wrong class name (corrected to `Metacall_await_callbacks') +[ 5%] Built target python-web +/usr/local/metacall/source/metacall/include/metacall/metacall.h:76: Warning 801: Wrong class name (corrected to `Metacall_version_type') +/usr/local/metacall/source/metacall/include/metacall/metacall.h:76: Warning 801: Wrong class name (corrected to `Metacall_version_type') +[ 5%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_record.c.o +[ 5%] Built target python-model + +/usr/local/metacall/source/metacall/include/metacall/metacall.h:80: Warning 451: Setting a const char * variable may leak memory. +Welcome to .NET 7.0! +--------------------- +SDK Version: 7.0.410 + +---------------- +Installed an ASP.NET Core HTTPS development certificate. +To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). +Learn about HTTPS: https://aka.ms/dotnet-https +---------------- +Write your first app: https://aka.ms/dotnet-hello-world +Find out what's new: https://aka.ms/dotnet-whats-new +Explore documentation: https://aka.ms/dotnet-docs +Report issues and find source on GitHub: https://github.com/dotnet/core +Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli +-------------------------------------------------------------------------------------- +/usr/local/metacall/source/metacall/include/metacall/metacall.h:81: Warning 451: Setting a const char * variable may leak memory. +/usr/local/metacall/source/metacall/include/metacall/metacall.h:82: Warning 451: Setting a const char * variable may leak memory. +[ 5%] Built target python-landing +[ 5%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_handle.c.o +[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy.c.o +[ 6%] Built target python-dicty +[ 6%] Built target python-pointer +[ 6%] Built target python-s1 +[ 6%] Built target python-host +[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect.c.o +[ 6%] Built target python-s2 +[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_singleton.c.o +[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_impl.c.o +[ 6%] Built target python-withoutfunctions +[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_format.c.o +[ 6%] Built target python-wasm +[ 6%] Built target rb_port_swig_compilation +[ 6%] Built target python-badimport +[ 6%] Built target loadtest +[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_format_binary.c.o +[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_format_custom.c.o +[ 6%] Built target python-fnmesh +[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_schedule.c.o +[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_format_text.c.o +[ 7%] Built target ruby-hello +[ 7%] Built target python-watzon +[ 7%] Built target ruby-second +[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_schedule_async.c.o +[ 7%] Built target ruby-blog +[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_schedule_sync.c.o +[ 7%] Built target ruby-ducktype +[ 7%] Built target ruby-invalid +[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_storage.c.o +[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_storage_batch.c.o +[ 7%] Built target ruby-klass +[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_storage_sequential.c.o +[ 7%] Built target ruby-failempty +[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream.c.o +[ 7%] Built target ruby-cache +[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_file.c.o +[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_custom.c.o +[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_nginx.c.o +[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_socket.c.o +[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_stdio.c.o +[ 8%] Built target rpc-remote +[ 8%] Built target typescript-typedfunc +[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect_format.c.o +[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_syslog.c.o +[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect_schedule.c.o +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect_storage.c.o +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect_stream.c.o +[ 9%] Built target typescript-loopfail +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory.c.o +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator.c.o +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator_std_impl.c.o +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator_nginx.c.o +[ 9%] Built target typescript-badrequire +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator_std.c.o +[ 9%] Built target typescript-server +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator_nginx_impl.c.o +[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability.c.o +-- verifying file... + file='/usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/tinycc.tar.gz' +-- Downloading... done +[ 9%] Creating directories for 'google-test-depends' +[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_executable_path.c.o +[ 10%] Building C object source/tests/metacall_node_extension_test/node_extension_test/CMakeFiles/node_extension_test.dir/source/node_extension_test.c.o +[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_working_path.c.o +[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_atexit.c.o +[ 10%] Built target wasm-tests +[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_library_path.c.o +[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt.c.o +[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_path.c.o +[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_dependency.c.o +[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_comparable.c.o +[ 11%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_hash.c.o +-- extracting... + src='http://github.com/usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/tinycc.tar.gz' + dst='/usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/libtcc-depends' +-- extracting... [tar xfz] +[ 12%] Performing download step (git clone) for 'google-test-depends' +[ 12%] Linking CXX shared module ../../../../node_extension_test.node +[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_set.c.o +[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_map.c.o +[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_bucket.c.o +[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_vector.c.o +Cloning into 'google-test-depends'... +-- extracting... [analysis] +-- extracting... [rename] +-- extracting... [clean up] +-- extracting... done +[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/filesystem/source/filesystem.c.o +[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/filesystem/source/filesystem_file_descriptor.c.o +[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_trie.c.o +[ 13%] Creating directories for 'google-bench-depends' +[ 13%] No update step for 'libtcc-depends' +[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/filesystem/source/filesystem_directory_descriptor.c.o +[ 14%] Built target metacallcli-scripts-tests +[ 14%] Performing download step (download, verify and extract) for 'google-bench-depends' +-- Downloading... + dst='/usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/GBench-1.6.1.tar.gz' + timeout='none' + inactivity timeout='none' +-- Using src='https://github.com/google/benchmark/archive/v1.6.1.tar.gz' +[ 14%] No patch step for 'libtcc-depends' +[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/dynlink/source/dynlink.c.o +[ 14%] Built target cli_core_plugin_config +[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/dynlink/source/dynlink_impl.c.o +[ 14%] Built target cli_sandbox_plugin_config +[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/dynlink/source/dynlink_interface.c.o +[ 14%] Performing configure step for 'libtcc-depends' +[ 14%] Building C object source/preprocessor/CMakeFiles/preprocessor.dir/source/preprocessor.c.o +[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin.c.o +[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/dynlink/source/dynlink_impl_unix.c.o +[ 14%] Building C object source/format/CMakeFiles/format.dir/source/format.c.o + +up to date, audited 5 packages in 658ms + +1 package is looking for funding + run `npm fund` for details + +found 0 vulnerabilities +[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin_descriptor.c.o +[ 14%] Linking CXX shared library ../../libpreprocessord.so +[ 14%] Built target node_loader_bootstrap_depends +[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin_loader.c.o +[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin_impl.c.o +[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin_manager.c.o +[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/detour/source/detour.c.o +Binary directory /usr/local/metacall/build/libtcc/bin +TinyCC directory /usr/local/metacall/build/libtcc/lib/tcc +Library directory /usr/local/metacall/build/libtcc/lib +Include directory /usr/local/metacall/build/libtcc/include +Manual directory /usr/local/metacall/build/libtcc/share/man +Info directory /usr/local/metacall/build/libtcc/share/info +Doc directory /usr/local/metacall/build/libtcc/share/doc +Source path /usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/libtcc-depends + +up to date, audited 3 packages in 530ms +Build OS Linux x86_64 +C compiler gcc (14.2) +Target OS Linux +CPU x86_64 +Triplet x86_64-linux-gnu +Config debug static=no selinux +Creating config.mak and config.h +[ 15%] Linking CXX shared library ../../libformatd.so + +found 0 vulnerabilities +[ 15%] Building C object source/threading/CMakeFiles/threading.dir/source/threading.c.o +[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect.c.o +[ 15%] Built target preprocessor +Copying node_loader_bootstrap dependencies +[ 15%] Built target ts_loader_bootstrap_depends +[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_type.c.o +[ 15%] Performing build step for 'libtcc-depends' +make[3]: warning: -j24 forced in submake: resetting jobserver mode. +[ 15%] Building C object source/threading/CMakeFiles/threading.dir/source/threading_thread_id.c.o +[ 15%] Building C object source/threading/CMakeFiles/threading.dir/source/threading_mutex_pthread.c.o +[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_type_id.c.o +[ 16%] Building C object source/environment/CMakeFiles/environment.dir/source/environment.c.o +[ 16%] Built target node_extension_test +[ 16%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_signature.c.o +[ 16%] Linking CXX shared library ../../libthreadingd.so +[ 16%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_function.c.o +[ 17%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_attribute.c.o +[ 17%] Built target format +node_loader_bootstrap dependencies copied from /usr/local/metacall/source/loaders/node_loader/bootstrap/node_modules to /usr/local/metacall/build/node_modules +[ 17%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_constructor.c.o +[ 17%] Building C object source/environment/CMakeFiles/environment.dir/source/environment_variable.c.o +[ 17%] Built target node_loader_bootstrap_copy_depends +[ 17%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_memory_tracker.c.o +[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability.c.o + +up to date, audited 2 packages in 754ms + +found 0 vulnerabilities +[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_executable_path.c.o +[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_library_path.c.o +-- verifying file... + file='/usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/GBench-1.6.1.tar.gz' +-- Downloading... done +[ 18%] Built target nodejs-ramda-depends +[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_method.c.o +[ 18%] Built target threading +[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_working_path.c.o +[ 18%] Building C object source/environment/CMakeFiles/environment.dir/source/environment_variable_path.c.o +-- extracting... + src='http://github.com/usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/GBench-1.6.1.tar.gz' + dst='/usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/google-bench-depends' +-- extracting... [tar xfz] +[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_class_visibility.c.o +[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_object.c.o +[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_class.c.o +[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_path.c.o +-- extracting... [analysis] +-- extracting... [rename] +-- extracting... [clean up] +-- extracting... done +[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_atexit.c.o +[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_dependency.c.o +[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_future.c.o +[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_exception.c.o +[ 18%] Linking CXX shared library ../../libenvironmentd.so +[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_throwable.c.o +[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_context.c.o +[ 19%] No update step for 'google-bench-depends' +[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_scope.c.o +[ 19%] Built target node_loader_bootstrap +Note: /usr/local/metacall/source/loaders/java_loader/bootstrap/lib/bootstrap.java uses or overrides a deprecated API. +Note: Recompile with -Xlint:deprecation for details. +[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value.c.o +[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type.c.o +[ 19%] Built target nodejs-ramda +[ 19%] Built target java_loader_bootstrap +[ 19%] No patch step for 'google-bench-depends' + +up to date, audited 49 packages in 1s +[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type_id_size.c.o + +1 moderate severity vulnerability + +To address all issues, run: + npm audit fix + +Run `npm audit` for details. +[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type_promotion.c.o +[ 19%] Built target environment +[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type_demotion.c.o +[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type_cast.c.o +[ 20%] Built target nodejs-gram-depends +[ 20%] Performing configure step for 'google-bench-depends' +[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/serial/source/serial.c.o +CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): + Compatibility with CMake < 3.10 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value. Or, use the <min>...<max> syntax + to tell CMake that the project requires at least <min> but has been updated + to work with policies introduced by <max> or earlier. + + +[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/configuration/source/configuration.c.o +[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/configuration/source/configuration_singleton.c.o +[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/configuration/source/configuration_impl.c.o +[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/configuration/source/configuration_object.c.o +[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/__/loader/source/loader.c.o +[ 21%] Linking CXX shared library ../../libportabilityd.so +[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/__/loader/source/loader_host.c.o +[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/__/loader/source/loader_manager_impl.c.o + Determining projects to restore... +[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/__/loader/source/loader_impl.c.o +-- The CXX compiler identification is GNU 14.2.0 +[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall.c.o +-- Detecting CXX compiler ABI info +[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_log.c.o +[ 21%] Built target portability +[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_allocator.c.o +[ 22%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_value.c.o +[ 22%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_error.c.o +[ 22%] Built target backward_object +[ 22%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_link.c.o +[ 22%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_fork.c.o +[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log.c.o +[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_valid_size.c.o +[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_map.c.o + +up to date, audited 7 packages in 1s + +found 0 vulnerabilities +[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_record.c.o +[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_level.c.o +[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_handle.c.o +[ 22%] Linking CXX shared library ../../libbackward.so +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect.c.o +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy.c.o +[ 23%] Built target typescript-templating-depends +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_impl.c.o +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_singleton.c.o +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_format_binary.c.o +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_format.c.o +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_format_custom.c.o +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_format_text.c.o +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_schedule.c.o +[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_schedule_sync.c.o +[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_schedule_async.c.o +-- Detecting CXX compiler ABI info - done +[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_storage_batch.c.o +[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_storage.c.o +[ 24%] Built target nodejs-gram +[ 24%] Built target typescript-templating +-- Check for working CXX compiler: /usr/bin/c++ - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_custom.c.o +[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream.c.o +[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_storage_sequential.c.o +-- Failed to find LLVM FileCheck +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_nginx.c.o +[ 25%] Built target backward +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_file.c.o +-- Found Git: /usr/bin/git (found version "2.47.2") +-- git version: v0.0.0 normalized to 0.0.0 +-- Version: 1.6.1 +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_socket.c.o +-- Looking for shm_open in rt +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_syslog.c.o +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_stdio.c.o +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect_storage.c.o +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect_schedule.c.o +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect_format.c.o +[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect_stream.c.o +[ 26%] Linking CXX shared library ../../liblogd.so + +> ts_loader_bootstrap@1.1.0 build +> tsc + +-- Looking for shm_open in rt - found +-- Performing Test HAVE_CXX_FLAG_STD_CXX11 +[ 26%] Built target log +[ 26%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator_nginx.c.o +[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt.c.o +[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_hash.c.o +[ 26%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator.c.o +[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_bucket.c.o +[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_set.c.o +[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_trie.c.o +[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_map.c.o +[ 27%] Building C object source/dynlink/CMakeFiles/dynlink.dir/source/dynlink.c.o +[ 27%] Building C object source/dynlink/CMakeFiles/dynlink.dir/source/dynlink_impl.c.o +[ 27%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_comparable.c.o +[ 27%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator_std.c.o +[ 27%] Building C object source/memory/CMakeFiles/memory.dir/source/memory.c.o +[ 27%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator_nginx_impl.c.o +[ 28%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_vector.c.o +[ 28%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator_std_impl.c.o +[ 28%] Building C object source/dynlink/CMakeFiles/dynlink.dir/source/dynlink_impl_unix.c.o +[ 28%] Building C object source/dynlink/CMakeFiles/dynlink.dir/source/dynlink_interface.c.o +-- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success +-- Performing Test HAVE_CXX_FLAG_WALL + +added 15 packages in 2s + +1 package is looking for funding + run `npm fund` for details +[ 28%] Linking CXX shared library ../../libmemoryd.so +[ 28%] Linking CXX shared library ../../libdynlinkd.so +[ 28%] Built target metacall-python-open-test-depends +[ 28%] Built target memory +[ 28%] Built target dynlink +-- Performing Test HAVE_CXX_FLAG_WALL - Success +-- Performing Test HAVE_CXX_FLAG_WEXTRA +[ 28%] Linking CXX shared library ../../libmetacalld.so +[ 28%] Linking CXX shared library ../../libadtd.so +[ 28%] Built target adt +[ 28%] Built target metacall +[ 28%] Building C object source/filesystem/CMakeFiles/filesystem.dir/source/filesystem_directory_descriptor.c.o +[ 28%] Building C object source/filesystem/CMakeFiles/filesystem.dir/source/filesystem.c.o +[ 28%] Building C object source/loaders/cob_loader/CMakeFiles/cob_loader.dir/source/cob_loader.c.o +[ 28%] Building CXX object source/loaders/cob_loader/CMakeFiles/cob_loader.dir/source/cob_loader_impl.cpp.o +[ 28%] Building C object source/filesystem/CMakeFiles/filesystem.dir/source/filesystem_file_descriptor.c.o +[ 29%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin.c.o +[ 30%] Building C object source/serials/metacall_serial/CMakeFiles/metacall_serial.dir/source/metacall_serial.c.o +[ 30%] Building C object source/loaders/rpc_loader/CMakeFiles/rpc_loader.dir/source/rpc_loader.c.o +[ 30%] Building C object source/loaders/mock_loader/CMakeFiles/mock_loader.dir/source/mock_loader.c.o +[ 30%] Building C object source/loaders/node_loader/CMakeFiles/node_loader.dir/source/node_loader.c.o +[ 30%] Building C object source/loaders/java_loader/CMakeFiles/java_loader.dir/source/java_loader.c.o +[ 30%] Building C object source/loaders/ext_loader/CMakeFiles/ext_loader.dir/source/ext_loader.c.o +[ 30%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect.c.o +[ 30%] Building C object source/loaders/wasm_loader/CMakeFiles/wasm_loader.dir/source/wasm_loader.c.o +[ 30%] Building C object source/detours/plthook_detour/CMakeFiles/plthook_detour.dir/source/plthook_detour.c.o +-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success +-- Performing Test HAVE_CXX_FLAG_WSHADOW +[ 30%] Building C object source/serials/rapid_json_serial/CMakeFiles/rapid_json_serial.dir/source/rapid_json_serial.c.o +[ 30%] Building C object source/loaders/rb_loader/CMakeFiles/rb_loader.dir/source/rb_loader.c.o +[ 30%] Building C object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader.c.o +[ 30%] Building C object source/loaders/file_loader/CMakeFiles/file_loader.dir/source/file_loader.c.o +[ 31%] Building CXX object source/loaders/node_loader/CMakeFiles/node_loader.dir/source/node_loader_impl.cpp.o +[ 31%] Building CXX object source/loaders/node_loader/CMakeFiles/node_loader.dir/source/node_loader_port.cpp.o +[ 31%] Building CXX object source/loaders/rpc_loader/CMakeFiles/rpc_loader.dir/source/rpc_loader_impl.cpp.o +[ 31%] Building C object source/serials/metacall_serial/CMakeFiles/metacall_serial.dir/source/metacall_serial_impl.c.o +[ 31%] Building CXX object source/loaders/java_loader/CMakeFiles/java_loader.dir/source/java_loader_impl.cpp.o +[ 31%] Building C object source/loaders/rb_loader/CMakeFiles/rb_loader.dir/source/rb_loader_impl.c.o +[ 31%] Building C object source/loaders/file_loader/CMakeFiles/file_loader.dir/source/file_loader_impl.c.o +[ 31%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_type.c.o +[ 31%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_type_id.c.o +[ 32%] Building CXX object source/loaders/ext_loader/CMakeFiles/ext_loader.dir/source/ext_loader_impl.cpp.o +[ 32%] Building CXX object source/serials/rapid_json_serial/CMakeFiles/rapid_json_serial.dir/source/rapid_json_serial_impl.cpp.o +[ 33%] Linking CXX shared library ../../libfilesystemd.so +[ 33%] Building C object source/detours/plthook_detour/CMakeFiles/plthook_detour.dir/source/plthook_detour_impl.c.o +[ 33%] Building C object source/loaders/rb_loader/CMakeFiles/rb_loader.dir/source/rb_loader_impl_parser.c.o +[ 33%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin_descriptor.c.o +[ 33%] Building C object source/loaders/wasm_loader/CMakeFiles/wasm_loader.dir/source/wasm_loader_impl.c.o +[ 33%] Building C object source/loaders/mock_loader/CMakeFiles/mock_loader.dir/source/mock_loader_impl.c.o +-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success +-- Performing Test HAVE_CXX_FLAG_WERROR +[ 33%] Building C object source/serials/metacall_serial/CMakeFiles/metacall_serial.dir/source/metacall_serial_impl_serialize.c.o +[ 33%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_signature.c.o +[ 33%] Built target filesystem +[ 33%] Building C object source/detours/plthook_detour/CMakeFiles/plthook_detour.dir/plthook/plthook_elf.c.o +[ 33%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_function.c.o +[ 33%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin_impl.c.o +[ 33%] Linking CXX shared module ../../../libmock_loaderd.so +[ 33%] Building CXX object source/extensions/plugin_extension/CMakeFiles/plugin_extension.dir/source/plugin_extension.cpp.o +[ 33%] Building C object source/loaders/wasm_loader/CMakeFiles/wasm_loader.dir/source/wasm_loader_function.c.o +[ 33%] Building C object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader_impl.c.o +-- Performing Test HAVE_CXX_FLAG_WERROR - Success +[ 33%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin_loader.c.o +-- Performing Test HAVE_CXX_FLAG_WSUGGEST_OVERRIDE +[ 33%] Building C object source/loaders/wasm_loader/CMakeFiles/wasm_loader.dir/source/wasm_loader_handle.c.o +[ 33%] Built target mock_loader +[ 33%] Linking CXX shared module ../../../libfile_loaderd.so +[ 33%] Building C object source/serials/metacall_serial/CMakeFiles/metacall_serial.dir/source/metacall_serial_impl_deserialize.c.o +[ 33%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_attribute.c.o +[ 33%] Building C object source/ports/rb_port/CMakeFiles/rb_port.dir/__/__/__/rb_portRUBY_wrap.c.o +[ 33%] Building C object source/ports/rb_port/CMakeFiles/rb_port.dir/source/rb_port.c.o +[ 33%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin_manager.c.o +[ 33%] Building CXX object source/loaders/node_loader/CMakeFiles/node_loader.dir/source/node_loader_trampoline.cpp.o +[ 33%] Built target file_loader +HEAD is now at e2239ee6 Googletest export +[ 33%] Linking CXX shared module ../../../libplthook_detourd.so +[ 34%] Building CXX object source/scripts/extension/sum/CMakeFiles/sum_extension.dir/source/sum_extension.cpp.o +-- Performing Test HAVE_CXX_FLAG_WSUGGEST_OVERRIDE - Success +-- Performing Test HAVE_CXX_FLAG_PEDANTIC +[ 34%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_constructor.c.o +[ 35%] Building CXX object source/examples/metacalllog/CMakeFiles/metacalllog.dir/main.cpp.o +[ 35%] Linking CXX shared module ../../../libcob_loaderd.so +[ 35%] Built target plthook_detour +[ 35%] Linking CXX shared module ../../../libmetacall_seriald.so +[ 35%] Building C object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader_port.c.o +[ 35%] Linking CXX shared library ../../libplugind.so +[ 36%] Linking CXX shared module ../../../libwasm_loaderd.so +[ 36%] No update step for 'google-test-depends' +Failed to run rustfmt: No such file or directory (os error 2) (non-fatal, continuing) +[ 36%] Built target rs_port_bindings +-- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success +-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS +[ 36%] Building CXX object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader_threading.cpp.o +[ 36%] Linking CXX executable ../../../metacalllogd +[ 36%] No patch step for 'google-test-depends' +[ 36%] Built target metacall_serial +[ 37%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_memory_tracker.c.o +[ 37%] Built target plugin +[ 37%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_method.c.o +[ 37%] Built target cob_loader +[ 38%] Building C object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader_dict.c.o +[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_class_visibility.c.o +[ 38%] Performing configure step for 'google-test-depends' +CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): + Compatibility with CMake < 3.10 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value. Or, use the <min>...<max> syntax + to tell CMake that the project requires at least <min> but has been updated + to work with policies introduced by <max> or earlier. + + +[ 38%] Built target wasm_loader +[ 38%] Linking CXX shared module ../../../librb_loaderd.so +[ 38%] Building C object source/detour/CMakeFiles/detour.dir/source/detour.c.o +[ 38%] Built target metacalllog +[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_class.c.o +[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_object.c.o +[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_future.c.o +-- The C compiler identification is GNU 14.2.0 +-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success +-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 +[ 38%] Built target rb_loader +[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_exception.c.o + Downloading crates ... +[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_throwable.c.o +/usr/local/metacall/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp: In function 'char* rapidjson::internal::Prettify(char*, int, int, int)': +/usr/local/metacall/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp:561:1: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow] + 561 | } + | ^ +[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_scope.c.o +In file included from /usr/include/python3.13d/internal/pycore_mimalloc.h:45, + from /usr/include/python3.13d/internal/pycore_interp.h:31, + from /usr/include/python3.13d/internal/pycore_runtime.h:17, + from /usr/include/python3.13d/internal/pycore_emscripten_trampoline.h:4, + from /usr/include/python3.13d/internal/pycore_object.h:13, + from /usr/include/python3.13d/internal/pycore_dict.h:13, + from /usr/local/metacall/source/loaders/py_loader/source/py_loader_dict.c:32: +/usr/include/python3.13d/internal/mimalloc/mimalloc/internal.h:90:12: warning: redundant redeclaration of '_mi_os_purge' [-Wredundant-decls] + 90 | bool _mi_os_purge(void* p, size_t size, mi_stats_t* stats); + | ^~~~~~~~~~~~ +/usr/include/python3.13d/internal/mimalloc/mimalloc/internal.h:84:12: note: previous declaration of '_mi_os_purge' with type '_Bool(void *, size_t, mi_stats_t *)' {aka '_Bool(void *, long unsigned int, struct mi_stats_s *)'} + 84 | bool _mi_os_purge(void* p, size_t size, mi_stats_t* stats); + | ^~~~~~~~~~~~ +/usr/include/python3.13d/internal/pycore_object.h: In function '_PyObject_HasDeferredRefcount': +/usr/include/python3.13d/internal/pycore_object.h:204:41: warning: unused parameter 'op' [-Wunused-parameter] + 204 | _PyObject_HasDeferredRefcount(PyObject *op) + | ~~~~~~~~~~^~ +/usr/include/python3.13d/internal/pycore_dict.h: In function '_PyDict_NotifyEvent': +/usr/include/python3.13d/internal/pycore_dict.h:273:5: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] + 273 | int watcher_bits = mp->ma_version_tag & DICT_WATCHER_MASK; + | ^~~ +In file included from /usr/include/python3.13d/dictobject.h:101, + from /usr/include/python3.13d/Python.h:90, + from /usr/local/metacall/source/loaders/py_loader/include/py_loader/py_loader_dict.h:26, + from /usr/local/metacall/source/loaders/py_loader/source/py_loader_dict.c:21: +/usr/include/python3.13d/cpython/dictobject.h:25:34: note: declared here + 25 | Py_DEPRECATED(3.12) uint64_t ma_version_tag; + | ^~~~~~~~~~~~~~ +/usr/include/python3.13d/internal/pycore_dict.h:278:5: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] + 278 | return DICT_NEXT_VERSION(interp) | (mp->ma_version_tag & DICT_WATCHER_AND_MODIFICATION_MASK); + | ^~~~~~ +/usr/include/python3.13d/cpython/dictobject.h:25:34: note: declared here + 25 | Py_DEPRECATED(3.12) uint64_t ma_version_tag; + | ^~~~~~~~~~~~~~ +[ 39%] Linking CXX shared library ../../libdetourd.so + Downloaded proc-macro2 v1.0.92 + Downloaded unicode-ident v1.0.14 + Downloaded quote v1.0.37 +-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed +-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING +[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value.c.o +-- The CXX compiler identification is GNU 14.2.0 +[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_context.c.o +-- Detecting C compiler ABI info +[ 39%] Built target detour +[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type.c.o +[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type_id_size.c.o + Compiling proc-macro2 v1.0.92 +[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type_promotion.c.o +[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type_demotion.c.o +[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type_cast.c.o +[ 39%] Linking CXX shared module ../../../rb_portd.so + Compiling unicode-ident v1.0.14 + Compiling metacall v0.4.2 (/usr/local/metacall/source/ports/rs_port) + Restored /usr/local/metacall/source/loaders/cs_loader/netcore/source/project.csproj (in 3.59 sec). +[ 39%] Built target rb_port +-- Detecting C compiler ABI info - done +-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success +-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +[ 39%] Linking CXX shared module ../../../../libsum_extensiond.so +-- Detecting CXX compiler ABI info +[ 40%] Linking CXX shared module ../../../libjava_loaderd.so +[ 41%] Linking CXX shared library ../../libreflectd.so +[ 41%] Built target sum_extension +-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Success +-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED +-- Detecting CXX compiler ABI info - done +[ 41%] Built target java_loader +[ 41%] Built target reflect +-- Check for working CXX compiler: /usr/bin/c++ - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +[ 41%] Building C object source/serial/CMakeFiles/serial.dir/source/serial.c.o +CMake Deprecation Warning at googlemock/CMakeLists.txt:45 (cmake_minimum_required): + Compatibility with CMake < 3.10 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value. Or, use the <min>...<max> syntax + to tell CMake that the project requires at least <min> but has been updated + to work with policies introduced by <max> or earlier. + + +CMake Deprecation Warning at googletest/CMakeLists.txt:56 (cmake_minimum_required): + Compatibility with CMake < 3.10 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value. Or, use the <min>...<max> syntax + to tell CMake that the project requires at least <min> but has been updated + to work with policies introduced by <max> or earlier. + + +[ 41%] Performing install step for 'libtcc-depends' +-> /usr/local/metacall/build/libtcc/bin : tcc +-> /usr/local/metacall/build/libtcc/lib/tcc : libtcc1.a runmain.o bt-exe.o bt-log.o bcheck.o +-> /usr/local/metacall/build/libtcc/lib/tcc/include : ./include/*.h ./tcclib.h +-> /usr/local/metacall/build/libtcc/lib : libtcc.so +-> /usr/local/metacall/build/libtcc/include : ./libtcc.h +-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED - Success +-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING +-> /usr/local/metacall/build/libtcc/share/man/man1 : tcc.1 +[ 41%] Linking CXX shared library ../../libseriald.so +[ 42%] No test step for 'libtcc-depends' +[ 42%] Built target serial +[ 43%] Building C object source/configuration/CMakeFiles/configuration.dir/source/configuration_impl.c.o +[ 43%] Building C object source/configuration/CMakeFiles/configuration.dir/source/configuration.c.o +[ 43%] Building C object source/configuration/CMakeFiles/configuration.dir/source/configuration_singleton.c.o +[ 43%] Building C object source/configuration/CMakeFiles/configuration.dir/source/configuration_object.c.o +[ 43%] Completed 'libtcc-depends' +-- Found Python: /usr/bin/python3 (found version "3.13.2") found components: Interpreter +[ 43%] Linking CXX shared module ../../../libplugin_extensiond.so +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD +-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success +-- Performing Test HAVE_CXX_FLAG_WD654 +[ 43%] Built target libtcc-depends +-- Performing Test HAVE_CXX_FLAG_WD654 - Failed +-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY +[ 43%] Building CXX object source/loaders/c_loader/CMakeFiles/c_loader.dir/source/c_loader_impl.cpp.o +[ 43%] Building C object source/loaders/c_loader/CMakeFiles/c_loader.dir/source/c_loader.c.o +[ 43%] Built target plugin_extension +[ 43%] Building CXX object source/plugins/sandbox_plugin/CMakeFiles/sandbox_plugin.dir/source/sandbox_plugin.cpp.o +[ 43%] Building CXX object source/plugins/backtrace_plugin/CMakeFiles/backtrace_plugin.dir/source/backtrace_plugin.cpp.o +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success +-- Found Threads: TRUE +[ 43%] Linking CXX shared library ../../libconfigurationd.so +-- Configuring done (2.0s) +[ 43%] Built target ts_loader_bootstrap_build +-- Generating done (0.0s) +-- Build files have been written to: /usr/local/metacall/build/source/tests/src/google-test-depends-build +-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed +-- Performing Test HAVE_CXX_FLAG_COVERAGE +[ 43%] Performing build step for 'google-test-depends' +Copying ts_loader_bootstrap dependencies +In function 'int64_t node_loader_impl_user_async_handles_count(loader_impl_node)', + inlined from 'void node_loader_impl_destroy_cb(loader_impl_node)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4349:94, + inlined from 'void node_loader_impl_destroy_prepare_cb(uv_prepare_t*)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4370:29: +/usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4506:66: warning: assuming signed overflow does not occur when simplifying 'X - Y <= 0' to 'X <= Y' [-Wstrict-overflow] + 4506 | return active_handles - node_impl->base_active_handles - extra_active_handles; + | ^~~~~~~~~~~~~~~~~~~~ +In function 'int64_t node_loader_impl_user_async_handles_count(loader_impl_node)', + inlined from 'void node_loader_impl_destroy_cb(loader_impl_node)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4349:94, + inlined from 'void node_loader_impl_destroy_check_cb(uv_check_t*)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4377:29: +/usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4506:66: warning: assuming signed overflow does not occur when simplifying 'X - Y <= 0' to 'X <= Y' [-Wstrict-overflow] + 4506 | return active_handles - node_impl->base_active_handles - extra_active_handles; + | ^~~~~~~~~~~~~~~~~~~~ + Compiling quote v1.0.37 +[ 43%] Built target configuration +MSBuild version 17.7.6+77d58ec69 for .NET +[ 43%] Building C object source/loader/CMakeFiles/loader.dir/source/loader_impl.c.o +[ 43%] Building C object source/loader/CMakeFiles/loader.dir/source/loader.c.o +[ 12%] Building CXX object googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o +[ 43%] Building C object source/loader/CMakeFiles/loader.dir/source/loader_host.c.o +[ 43%] Building C object source/loader/CMakeFiles/loader.dir/source/loader_manager_impl.c.o +-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success +-- Performing Test HAVE_STD_REGEX +-- Performing Test HAVE_STD_REGEX +In file included from /usr/local/include/rapidjson/writer.h:23, + from /usr/local/metacall/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp:21: +In function 'char* rapidjson::internal::WriteExponent(int, char*)', + inlined from 'char* rapidjson::internal::Prettify(char*, int, int, int)' at /usr/local/include/rapidjson/internal/dtoa.h:216:29, + inlined from 'char* rapidjson::internal::dtoa(double, char*, int)' at /usr/local/include/rapidjson/internal/dtoa.h:238:24, + inlined from 'char* rapidjson::internal::dtoa(double, char*, int)' at /usr/local/include/rapidjson/internal/dtoa.h:220:14, + inlined from 'bool rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags>::WriteDouble(double) [with OutputStream = rapidjson::GenericStringBuffer<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator; unsigned int writeFlags = 0]' at /usr/local/include/rapidjson/writer.h:579:31, + inlined from 'bool rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags>::WriteDouble(double) [with OutputStream = rapidjson::GenericStringBuffer<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator; unsigned int writeFlags = 0]' at /usr/local/include/rapidjson/writer.h:552:13, + inlined from 'bool rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags>::Double(double) [with OutputStream = rapidjson::GenericStringBuffer<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator; unsigned int writeFlags = 0]' at /usr/local/include/rapidjson/writer.h:195:83, + inlined from 'bool rapidjson::GenericValue<Encoding, Allocator>::Accept(Handler&) const [with Handler = rapidjson::Writer<rapidjson::GenericStringBuffer<rapidjson::UTF8<> > >; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>]' at /usr/local/include/rapidjson/document.h:1979:58: +/usr/local/include/rapidjson/internal/dtoa.h:131:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow] + 131 | if (K < 0) { + | ^~ +/usr/local/include/rapidjson/internal/dtoa.h:136:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow] + 136 | if (K >= 100) { + | ^~ +ts_loader_bootstrap dependencies copied from /usr/local/metacall/source/loaders/ts_loader/bootstrap/node_modules to /usr/local/metacall/build/node_modules +[ 43%] Built target ts_loader_bootstrap +[ 43%] Linking CXX shared module ../../../libpy_loaderd.so + Compiling metacall-inline v0.2.0 (/usr/local/metacall/source/ports/rs_port/inline) +[ 43%] Built target py_loader +[ 44%] Linking CXX shared module ../../../librpc_loaderd.so + Determining projects to restore... +[ 44%] Linking CXX shared library ../../libloaderd.so +[ 44%] Built target rpc_loader +[ 44%] Built target loader +[ 44%] Linking CXX shared module ../../../libext_loaderd.so +[ 44%] Built target ext_loader +In file included from /usr/local/include/rapidjson/reader.h:26, + from /usr/local/include/rapidjson/document.h:20, + from /usr/local/metacall/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp:18: +In function 'double rapidjson::internal::FastPath(double, int)', + inlined from 'double rapidjson::internal::StrtodNormalPrecision(double, int)' at /usr/local/include/rapidjson/internal/strtod.h:41:21, + inlined from 'void rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::ParseNumber(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]' at /usr/local/include/rapidjson/reader.h:1717:55, + inlined from 'void rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::ParseValue(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]' at /usr/local/include/rapidjson/reader.h:1761:46: +/usr/local/include/rapidjson/internal/strtod.h:29:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow] + 29 | if (exp < -308) + | ^~ + All projects are up-to-date for restore. +In function 'int64_t node_loader_impl_user_async_handles_count(loader_impl_node)', + inlined from 'void node_loader_impl_destroy_safe(napi_env, loader_impl_async_destroy_safe_type*)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4402:47: +/usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4506:66: warning: assuming signed overflow does not occur when simplifying 'X - Y <= 0' to 'X <= Y' [-Wstrict-overflow] + 4506 | return active_handles - node_impl->base_active_handles - extra_active_handles; + | ^~~~~~~~~~~~~~~~~~~~ + Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.90s +[ 44%] Built target rs_port +[ 44%] Linking CXX shared module ../../../librapid_json_seriald.so +[ 44%] Built target rapid_json_serial +[ 44%] Linking CXX shared module ../../../plugins/sandbox_plugin/libsandbox_plugind.so +[ 44%] Built target sandbox_plugin +[ 44%] Linking CXX shared module ../../../libnode_loaderd.so +[ 44%] Built target node_loader +[ 44%] Building C object source/loaders/ts_loader/CMakeFiles/ts_loader.dir/source/ts_loader.c.o +[ 45%] Building CXX object source/cli/plugins/cli_sandbox_plugin/CMakeFiles/cli_sandbox_plugin.dir/source/cli_sandbox_plugin.cpp.o +[ 45%] Building CXX object source/loaders/ts_loader/CMakeFiles/ts_loader.dir/source/ts_loader_impl.cpp.o +[ 45%] Built target cli_cmd_plugin +[ 45%] Built target cli_repl_plugin +[ 45%] Building CXX object source/cli/plugins/cli_core_plugin/CMakeFiles/cli_core_plugin.dir/source/cli_core_plugin.cpp.o +[ 45%] Linking CXX shared module ../../../libc_loaderd.so +-- Performing Test HAVE_STD_REGEX -- success +-- Performing Test HAVE_GNU_POSIX_REGEX +-- Performing Test HAVE_GNU_POSIX_REGEX +[ 45%] Linking CXX shared module ../../../../plugins/cli/cmd/cli_sandbox_plugin/libcli_sandbox_plugind.so +[ 45%] Linking CXX shared module ../../../plugins/backtrace_plugin/libbacktrace_plugind.so +[ 45%] Built target c_loader +-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile +-- Performing Test HAVE_POSIX_REGEX +-- Performing Test HAVE_POSIX_REGEX +[ 45%] Built target cli_sandbox_plugin +[ 45%] Built target backtrace_plugin +[ 46%] Linking CXX shared module ../../../libts_loaderd.so +[ 46%] Built target ts_loader +-- Performing Test HAVE_POSIX_REGEX -- success +-- Performing Test HAVE_STEADY_CLOCK +-- Performing Test HAVE_STEADY_CLOCK +Installing node_port +-- Performing Test HAVE_STEADY_CLOCK -- success +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD +-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success +-- Found Threads: TRUE +-- Configuring done (11.1s) +-- Generating done (0.0s) +-- Build files have been written to: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/google-bench-depends-build +[ 46%] Performing build step for 'google-bench-depends' +[ 9%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_name.cc.o +[ 9%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark.cc.o +[ 18%] Building CXX object src/CMakeFiles/benchmark.dir/csv_reporter.cc.o +[ 18%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o +[ 22%] Building CXX object src/CMakeFiles/benchmark.dir/commandlineflags.cc.o +[ 27%] Building CXX object src/CMakeFiles/benchmark.dir/json_reporter.cc.o +[ 31%] Building CXX object src/CMakeFiles/benchmark.dir/sleep.cc.o +[ 40%] Building CXX object src/CMakeFiles/benchmark.dir/statistics.cc.o +[ 40%] Building CXX object src/CMakeFiles/benchmark.dir/complexity.cc.o +[ 45%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_register.cc.o +[ 50%] Building CXX object src/CMakeFiles/benchmark.dir/counter.cc.o +[ 54%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o +[ 63%] Building CXX object src/CMakeFiles/benchmark.dir/colorprint.cc.o +[ 68%] Building CXX object src/CMakeFiles/benchmark.dir/console_reporter.cc.o +[ 68%] Building CXX object src/CMakeFiles/benchmark.dir/reporter.cc.o +[ 72%] Building CXX object src/CMakeFiles/benchmark.dir/timers.cc.o +[ 77%] Building CXX object src/CMakeFiles/benchmark.dir/string_util.cc.o +[ 81%] Building CXX object src/CMakeFiles/benchmark.dir/perf_counters.cc.o +[ 86%] Building CXX object src/CMakeFiles/benchmark.dir/sysinfo.cc.o +[ 25%] Linking CXX static library ../lib/libgtest.a + project -> /usr/local/metacall/source/loaders/cs_loader/netcore/source/bin/Debug/net7.0/CSLoader.dll + project -> /usr/local/metacall/build/ +[ 25%] Built target gtest +[ 37%] Building CXX object googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o +[ 50%] Building CXX object googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o +[ 46%] Built target cs_loader_impl + +up to date, audited 81 packages in 1s + +20 packages are looking for funding + run `npm fund` for details + +3 moderate severity vulnerabilities + +To address all issues (including breaking changes), run: + npm audit fix --force + +Run `npm audit` for details. +[ 46%] Building CXX object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/netcore.cpp.o +[ 47%] Building CXX object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/simple_netcore.cpp.o +[ 47%] Building C object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/cs_loader.c.o +[ 47%] Building CXX object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/netcore_linux.cpp.o +[ 47%] Building C object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/cs_loader_impl.c.o +[ 47%] Built target node_port +[ 47%] Linking CXX shared module ../../../../plugins/cli/repl/cli_core_plugin/libcli_core_plugind.so +[ 47%] Built target cli_core_plugin +[ 47%] Building CXX object source/cli/metacallcli/CMakeFiles/metacallcli.dir/source/main.cpp.o +[ 47%] Building CXX object source/cli/metacallcli/CMakeFiles/metacallcli.dir/source/application.cpp.o +[ 62%] Linking CXX static library ../lib/libgtest_main.a +[ 62%] Built target gtest_main +[ 47%] Linking CXX shared module ../../../libcs_loaderd.so +[ 47%] Built target cs_loader +[ 75%] Linking CXX static library ../lib/libgmock.a +[ 75%] Built target gmock +[ 47%] Linking CXX executable ../../../metacallclid +[ 87%] Building CXX object googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o +[ 47%] Built target metacallcli +[100%] Linking CXX static library ../lib/libgmock_main.a +[100%] Built target gmock_main +[ 47%] No install step for 'google-test-depends' +[ 47%] No test step for 'google-test-depends' +[ 47%] Completed 'google-test-depends' +[ 47%] Built target google-test-depends +[ 47%] Building CXX object source/tests/log_test/CMakeFiles/log-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/reflect_scope_test/CMakeFiles/reflect-scope-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/preprocessor_test/CMakeFiles/preprocessor-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/adt_vector_test/CMakeFiles/adt-vector-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/detour_test/CMakeFiles/detour-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/log_custom_test/CMakeFiles/log-custom-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/reflect_object_class_test/CMakeFiles/reflect-object-class-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/reflect_metadata_test/CMakeFiles/reflect-metadata-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/environment_test/CMakeFiles/environment-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/metacall_logs_test/CMakeFiles/metacall-logs-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/configuration_test/CMakeFiles/configuration-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/adt_set_test/CMakeFiles/adt-set-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/metacall_load_memory_empty_test/CMakeFiles/metacall-load-memory-empty-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/adt_map_test/CMakeFiles/adt-map-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/serial_test/CMakeFiles/serial-test.dir/source/main.cpp.o +[ 47%] Building CXX object source/tests/metacall_load_memory_test/CMakeFiles/metacall-load-memory-test.dir/source/main.cpp.o +[ 48%] Building CXX object source/tests/reflect_function_test/CMakeFiles/reflect-function-test.dir/source/main.cpp.o +[ 48%] Building CXX object source/tests/portability_path_test/CMakeFiles/portability-path-test.dir/source/main.cpp.o +[ 48%] Building CXX object source/tests/dynlink_test/CMakeFiles/dynlink-test.dir/source/main.cpp.o +[ 48%] Building CXX object source/tests/rb_loader_parser_test/CMakeFiles/rb-loader-parser-test.dir/source/main.cpp.o +[ 48%] Building CXX object source/tests/metacall_load_configuration_test/CMakeFiles/metacall-load-configuration-test.dir/source/main.cpp.o +[ 49%] Building CXX object source/tests/adt_trie_test/CMakeFiles/adt-trie-test.dir/source/main.cpp.o +[ 49%] Building CXX object source/tests/metacall_load_memory_test/CMakeFiles/metacall-load-memory-test.dir/source/metacall_load_memory_test.cpp.o +[ 49%] Building CXX object source/tests/log_custom_test/CMakeFiles/log-custom-test.dir/source/log_custom_test.cpp.o +[ 49%] Building CXX object source/tests/metacall_load_memory_empty_test/CMakeFiles/metacall-load-memory-empty-test.dir/source/metacall_load_memory_empty_test.cpp.o +[ 49%] Building CXX object source/tests/reflect_metadata_test/CMakeFiles/reflect-metadata-test.dir/source/reflect_metadata_test.cpp.o +[ 49%] Building CXX object source/tests/adt_vector_test/CMakeFiles/adt-vector-test.dir/source/adt_vector_test.cpp.o +[ 49%] Building CXX object source/tests/portability_path_test/CMakeFiles/portability-path-test.dir/source/portability_path_test.cpp.o +[ 90%] Linking CXX static library libbenchmark.a +[ 49%] Building CXX object source/tests/reflect_scope_test/CMakeFiles/reflect-scope-test.dir/source/reflect_scope_test.cpp.o +[ 49%] Building CXX object source/tests/detour_test/CMakeFiles/detour-test.dir/source/detour_test.cpp.o +[ 90%] Built target benchmark +[ 49%] Building CXX object source/tests/metacall_load_configuration_test/CMakeFiles/metacall-load-configuration-test.dir/source/metacall_load_configuration_test.cpp.o +[ 49%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_bool_test.cpp.o +[ 49%] Building CXX object source/tests/log_test/CMakeFiles/log-test.dir/source/log_test.cpp.o +[ 50%] Building CXX object source/tests/reflect_object_class_test/CMakeFiles/reflect-object-class-test.dir/source/reflect_object_class_test.cpp.o +[ 50%] Building CXX object source/tests/adt_map_test/CMakeFiles/adt-map-test.dir/source/adt_map_test.cpp.o +[ 95%] Building CXX object src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o +[ 50%] Building CXX object source/tests/adt_trie_test/CMakeFiles/adt-trie-test.dir/source/adt_trie_test.cpp.o +[ 50%] Building CXX object source/tests/adt_set_test/CMakeFiles/adt-set-test.dir/source/adt_set_test.cpp.o +[ 50%] Building CXX object source/tests/rb_loader_parser_test/CMakeFiles/rb-loader-parser-test.dir/source/rb_loader_parser_test.cpp.o +[ 51%] Building CXX object source/tests/metacall_logs_test/CMakeFiles/metacall-logs-test.dir/source/metacall_logs_test.cpp.o +[ 50%] Building CXX object source/tests/preprocessor_test/CMakeFiles/preprocessor-test.dir/source/preprocessor_test.cpp.o +[ 51%] Building CXX object source/tests/reflect_function_test/CMakeFiles/reflect-function-test.dir/source/reflect_function_test.cpp.o +[ 51%] Building CXX object source/tests/environment_test/CMakeFiles/environment-test.dir/source/environment_test.cpp.o +[ 51%] Building CXX object source/tests/serial_test/CMakeFiles/serial-test.dir/source/serial_test.cpp.o +[ 51%] Building CXX object source/tests/configuration_test/CMakeFiles/configuration-test.dir/source/configuration_test.cpp.o +[ 51%] Building CXX object source/tests/dynlink_test/CMakeFiles/dynlink-test.dir/source/dynlink_test.cpp.o +[100%] Linking CXX static library libbenchmark_main.a +[100%] Built target benchmark_main +[ 51%] Performing install step for 'google-bench-depends' +[ 90%] Built target benchmark +[100%] Built target benchmark_main +Install the project... +-- Install configuration: "Release" +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/libbenchmark.a +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/libbenchmark_main.a +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/include/benchmark +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/include/benchmark/benchmark.h +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/cmake/benchmark/benchmarkConfig.cmake +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/cmake/benchmark/benchmarkConfigVersion.cmake +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/pkgconfig/benchmark.pc +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/cmake/benchmark/benchmarkTargets.cmake +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/cmake/benchmark/benchmarkTargets-release.cmake +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/platform_specific_build_instructions.md +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/random_interleaving.md +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/AssemblyTests.md +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/perf_counters.md +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/index.md +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/dependencies.md +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/releasing.md +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/_config.yml +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/user_guide.md +-- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/tools.md +[ 51%] No test step for 'google-bench-depends' +[ 51%] Completed 'google-bench-depends' +[ 51%] Built target google-bench-depends +[ 51%] Building CXX object source/tests/metacall_load_configuration_fail_test/CMakeFiles/metacall-load-configuration-fail-test.dir/source/main.cpp.o +[ 51%] Linking CXX executable ../../../metacall-load-memory-empty-testd +[ 51%] Linking CXX executable ../../../adt-vector-testd +[ 51%] Linking CXX executable ../../../log-custom-testd +[ 51%] Built target metacall-load-memory-empty-test +[ 51%] Building CXX object source/tests/metacall_load_configuration_relative_test/CMakeFiles/metacall-load-configuration-relative-test.dir/source/main.cpp.o +[ 51%] Linking CXX executable ../../../metacall-logs-testd +[ 51%] Linking CXX executable ../../../adt-trie-testd +[ 51%] Linking CXX executable ../../../metacall-load-memory-testd +[ 51%] Built target log-custom-test +[ 51%] Built target adt-vector-test +[ 51%] Building CXX object source/tests/metacall_load_configuration_node_python_test/CMakeFiles/metacall-load-configuration-node-python-test.dir/source/main.cpp.o +[ 52%] Building CXX object source/tests/metacall_load_configuration_python_node_test/CMakeFiles/metacall-load-configuration-python-node-test.dir/source/main.cpp.o +[ 52%] Built target metacall-logs-test +[ 52%] Building CXX object source/tests/metacall_duplicated_handle_test/CMakeFiles/metacall-duplicated-handle-test.dir/source/main.cpp.o +[ 52%] Built target adt-trie-test +[ 52%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_char_test.cpp.o +[ 52%] Built target metacall-load-memory-test +[ 53%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_short_test.cpp.o +[ 53%] Building CXX object source/tests/metacall_load_configuration_fail_test/CMakeFiles/metacall-load-configuration-fail-test.dir/source/metacall_load_configuration_fail_test.cpp.o +[ 53%] Linking CXX executable ../../../environment-testd +[ 53%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_int_test.cpp.o +[ 53%] Linking CXX executable ../../../adt-set-testd +[ 53%] Linking CXX executable ../../../detour-testd +[ 53%] Linking CXX executable ../../../adt-map-testd +[ 53%] Linking CXX executable ../../../reflect-function-testd +[ 53%] Built target environment-test +[ 53%] Linking CXX executable ../../../dynlink-testd +[ 54%] Linking CXX executable ../../../log-testd +[ 54%] Building CXX object source/tests/metacall_duplicated_symbols_test/CMakeFiles/metacall-duplicated-symbols-test.dir/source/main.cpp.o +[ 54%] Linking CXX executable ../../../preprocessor-testd +[ 54%] Linking CXX executable ../../../reflect-metadata-testd +[ 54%] Built target detour-test +[ 54%] Built target adt-map-test +[ 54%] Built target adt-set-test +[ 54%] Building CXX object source/tests/metacall_test/CMakeFiles/metacall-test.dir/source/main.cpp.o +[ 54%] Building CXX object source/tests/metacall_load_configuration_relative_test/CMakeFiles/metacall-load-configuration-relative-test.dir/source/metacall_load_configuration_relative_test.cpp.o +[ 54%] Built target reflect-function-test +[ 54%] Building CXX object source/tests/metacall_handle_export_test/CMakeFiles/metacall-handle-export-test.dir/source/main.cpp.o +[ 54%] Building CXX object source/tests/metacall_duplicated_symbols_test/CMakeFiles/metacall-duplicated-symbols-test.dir/source/metacall_duplicated_symbols_test.cpp.o +[ 55%] Building CXX object source/tests/metacall_handle_get_test/CMakeFiles/metacall-handle-get-test.dir/source/main.cpp.o +[ 55%] Built target log-test +[ 55%] Built target dynlink-test +[ 55%] Building CXX object source/tests/metacall_node_test/CMakeFiles/metacall-node-test.dir/source/main.cpp.o +[ 55%] Built target preprocessor-test +[ 55%] Building CXX object source/tests/metacall_node_event_loop_test/CMakeFiles/metacall-node-event-loop-test.dir/source/main.cpp.o +[ 55%] Built target reflect-metadata-test +[ 55%] Building CXX object source/tests/metacall_node_event_loop_test/CMakeFiles/metacall-node-event-loop-test.dir/source/metacall_node_event_loop_test.cpp.o +[ 56%] Building CXX object source/tests/metacall_node_test/CMakeFiles/metacall-node-test.dir/source/metacall_node_test.cpp.o +[ 56%] Building C object source/tests/rb_loader_parser_test/CMakeFiles/rb-loader-parser-test.dir/__/__/loaders/rb_loader/source/rb_loader_impl_parser.c.o +[ 56%] Building CXX object source/tests/metacall_duplicated_handle_test/CMakeFiles/metacall-duplicated-handle-test.dir/source/metacall_duplicated_handle_test.cpp.o +[ 56%] Building CXX object source/tests/metacall_load_configuration_node_python_test/CMakeFiles/metacall-load-configuration-node-python-test.dir/source/metacall_load_configuration_node_python_test.cpp.o +[ 56%] Building CXX object source/tests/metacall_load_configuration_python_node_test/CMakeFiles/metacall-load-configuration-python-node-test.dir/source/metacall_load_configuration_python_node_test.cpp.o +[ 57%] Linking CXX executable ../../../rb-loader-parser-testd +[ 57%] Linking CXX executable ../../../configuration-testd +[ 57%] Linking CXX executable ../../../reflect-scope-testd +[ 57%] Built target rb-loader-parser-test +[ 58%] Building CXX object source/tests/metacall_node_event_loop_signal_test/CMakeFiles/metacall-node-event-loop-signal-test.dir/source/main.cpp.o +[ 58%] Built target configuration-test +[ 58%] Building CXX object source/tests/metacall_node_call_test/CMakeFiles/metacall-node-call-test.dir/source/main.cpp.o +[ 58%] Built target reflect-scope-test +[ 58%] Building CXX object source/tests/metacall_node_inline_test/CMakeFiles/metacall-node-inline-test.dir/source/main.cpp.o +[ 58%] Building CXX object source/tests/metacall_node_async_test/CMakeFiles/metacall-node-async-test.dir/source/main.cpp.o +[ 58%] Building CXX object source/tests/metacall_handle_export_test/CMakeFiles/metacall-handle-export-test.dir/source/metacall_handle_export_test.cpp.o +[ 59%] Linking CXX executable ../../../metacall-load-configuration-testd +[ 59%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_long_test.cpp.o +[ 59%] Building CXX object source/tests/metacall_node_inline_test/CMakeFiles/metacall-node-inline-test.dir/source/metacall_node_inline_test.cpp.o +[ 60%] Building CXX object source/tests/metacall_test/CMakeFiles/metacall-test.dir/source/metacall_test.cpp.o +[ 61%] Building CXX object source/tests/metacall_node_async_multiple_test/CMakeFiles/metacall-node-async-multiple-test.dir/source/main.cpp.o +[ 61%] Building CXX object source/tests/metacall_handle_get_test/CMakeFiles/metacall-handle-get-test.dir/source/metacall_handle_get_test.cpp.o +[ 61%] Linking CXX executable ../../../metacall-load-configuration-fail-testd +[ 61%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_float_test.cpp.o +[ 61%] Built target metacall-load-configuration-test +[ 61%] Building CXX object source/tests/metacall_node_reentrant_test/CMakeFiles/metacall-node-reentrant-test.dir/source/main.cpp.o +[ 61%] Linking CXX executable ../../../metacall-node-event-loop-testd +[ 61%] Linking CXX executable ../../../metacall-duplicated-symbols-testd +[ 61%] Built target metacall-load-configuration-fail-test +[ 61%] Building CXX object source/tests/metacall_node_reentrant_test/CMakeFiles/metacall-node-reentrant-test.dir/source/metacall_node_reentrant_test.cpp.o +[ 61%] Built target metacall-duplicated-symbols-test +[ 61%] Linking CXX executable ../../../metacall-load-configuration-relative-testd +[ 61%] Built target metacall-node-event-loop-test +[ 61%] Building CXX object source/tests/metacall_node_port_test/CMakeFiles/metacall-node-port-test.dir/source/main.cpp.o +[ 61%] Building CXX object source/tests/metacall_node_async_test/CMakeFiles/metacall-node-async-test.dir/source/metacall_node_async_test.cpp.o +[ 61%] Building CXX object source/tests/metacall_node_event_loop_signal_test/CMakeFiles/metacall-node-event-loop-signal-test.dir/source/metacall_node_event_loop_signal_test.cpp.o +[ 61%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_double_test.cpp.o +[ 61%] Building CXX object source/tests/metacall_node_async_multiple_test/CMakeFiles/metacall-node-async-multiple-test.dir/source/metacall_node_async_multiple_test.cpp.o +[ 61%] Building CXX object source/tests/metacall_node_call_test/CMakeFiles/metacall-node-call-test.dir/source/metacall_node_call_test.cpp.o +[ 61%] Linking CXX executable ../../../metacall-load-configuration-node-python-testd +[ 61%] Building CXX object source/tests/metacall_node_port_test/CMakeFiles/metacall-node-port-test.dir/source/metacall_node_port_test.cpp.o +[ 61%] Linking CXX executable ../../../metacall-load-configuration-python-node-testd +[ 61%] Built target metacall-load-configuration-relative-test +[ 61%] Building CXX object source/tests/metacall_node_port_await_test/CMakeFiles/metacall-node-port-await-test.dir/source/main.cpp.o +[ 61%] Linking CXX executable ../../../serial-testd +[ 61%] Linking CXX executable ../../../portability-path-testd +[ 61%] Built target metacall-load-configuration-node-python-test +[ 61%] Building CXX object source/tests/metacall_node_port_c_lib_test/CMakeFiles/metacall-node-port-c-lib-test.dir/source/main.cpp.o +[ 61%] Built target metacall-load-configuration-python-node-test +[ 61%] Building CXX object source/tests/metacall_node_python_port_mock_test/CMakeFiles/metacall-node-python-port-mock-test.dir/source/main.cpp.o +[ 61%] Linking CXX executable ../../../reflect-object-class-testd +[ 61%] Building CXX object source/tests/metacall_node_python_port_ruby_test/CMakeFiles/metacall-node-python-port-ruby-test.dir/source/main.cpp.o +[ 61%] Built target serial-test +[ 61%] Linking CXX executable ../../../metacall-duplicated-handle-testd +[ 61%] Building CXX object source/tests/metacall_node_python_port_mock_test/CMakeFiles/metacall-node-python-port-mock-test.dir/source/metacall_node_python_port_mock_test.cpp.o +[ 61%] Building CXX object source/tests/metacall_node_port_c_lib_test/CMakeFiles/metacall-node-port-c-lib-test.dir/source/metacall_node_port_c_lib_test.cpp.o +[ 61%] Built target portability-path-test +[ 61%] Building CXX object source/tests/metacall_node_python_ruby_test/CMakeFiles/metacall-node-python-ruby-test.dir/source/main.cpp.o +[ 61%] Built target reflect-object-class-test +[ 61%] Building CXX object source/tests/metacall_node_callback_test/CMakeFiles/metacall-node-callback-test.dir/source/main.cpp.o +[ 61%] Built target metacall-duplicated-handle-test +[ 61%] Building CXX object source/tests/metacall_node_fail_test/CMakeFiles/metacall-node-fail-test.dir/source/main.cpp.o +[ 61%] Building CXX object source/tests/metacall_node_fail_env_var_test/CMakeFiles/metacall-node-fail-env-var-test.dir/source/main.cpp.o +[ 61%] Linking CXX executable ../../../metacall-node-testd +[ 61%] Built target metacall-node-test +[ 61%] Building CXX object source/tests/metacall_node_fail_load_leak_test/CMakeFiles/metacall-node-fail-load-leak-test.dir/source/main.cpp.o +[ 62%] Building CXX object source/tests/metacall_node_fail_load_leak_test/CMakeFiles/metacall-node-fail-load-leak-test.dir/source/metacall_node_fail_load_leak_test.cpp.o +[ 62%] Building CXX object source/tests/metacall_node_port_await_test/CMakeFiles/metacall-node-port-await-test.dir/source/metacall_node_port_await_test.cpp.o +[ 62%] Building CXX object source/tests/metacall_node_python_port_ruby_test/CMakeFiles/metacall-node-python-port-ruby-test.dir/source/metacall_node_python_port_ruby_test.cpp.o +[ 62%] Building CXX object source/tests/metacall_node_typescript_test/CMakeFiles/metacall-node-typescript-test.dir/source/main.cpp.o +[ 62%] Building CXX object source/tests/metacall_node_python_async_after_destroy_test/CMakeFiles/metacall-node-python-async-after-destroy-test.dir/source/main.cpp.o +[ 62%] Linking CXX executable ../../../metacall-handle-export-testd +[ 62%] Linking CXX executable ../../../metacall-node-event-loop-signal-testd +[ 63%] Building CXX object source/tests/metacall_node_python_async_after_destroy_test/CMakeFiles/metacall-node-python-async-after-destroy-test.dir/source/metacall_node_python_async_after_destroy_test.cpp.o +[ 63%] Linking CXX executable ../../../metacall-node-inline-testd +[ 63%] Building CXX object source/tests/metacall_node_python_ruby_test/CMakeFiles/metacall-node-python-ruby-test.dir/source/metacall_node_python_ruby_test.cpp.o +[ 64%] Linking CXX executable ../../../metacall-node-call-testd +[ 64%] Built target metacall-handle-export-test +[ 64%] Linking CXX executable ../../../metacall-node-python-port-mock-testd +[ 64%] Built target metacall-node-event-loop-signal-test +[ 64%] Building CXX object source/tests/metacall_node_python_await_test/CMakeFiles/metacall-node-python-await-test.dir/source/main.cpp.o +[ 64%] Building CXX object source/tests/metacall_node_callback_test/CMakeFiles/metacall-node-callback-test.dir/source/metacall_node_callback_test.cpp.o +[ 64%] Building CXX object source/tests/metacall_node_python_await_test/CMakeFiles/metacall-node-python-await-test.dir/source/metacall_node_python_await_test.cpp.o +[ 64%] Linking CXX executable ../../../metacall-node-port-c-lib-testd +[ 64%] Built target metacall-node-inline-test +[ 65%] Building CXX object source/tests/metacall_node_python_exception_test/CMakeFiles/metacall-node-python-exception-test.dir/source/main.cpp.o +[ 65%] Linking CXX executable ../../../reflect-value-cast-testd +[ 65%] Building CXX object source/tests/metacall_node_fail_test/CMakeFiles/metacall-node-fail-test.dir/source/metacall_node_fail_test.cpp.o +[ 65%] Linking CXX executable ../../../metacall-node-port-testd +[ 65%] Built target metacall-node-python-port-mock-test +[ 65%] Built target metacall-node-call-test +[ 65%] Building CXX object source/tests/metacall_node_clear_mem_test/CMakeFiles/metacall-node-clear-mem-test.dir/source/main.cpp.o +[ 65%] Building CXX object source/tests/metacall_node_async_resources_test/CMakeFiles/metacall-node-async-resources-test.dir/source/main.cpp.o +[ 65%] Building CXX object source/tests/metacall_node_fail_env_var_test/CMakeFiles/metacall-node-fail-env-var-test.dir/source/metacall_node_fail_env_var_test.cpp.o +[ 65%] Built target metacall-node-port-c-lib-test +[ 65%] Building CXX object source/tests/metacall_node_async_resources_test/CMakeFiles/metacall-node-async-resources-test.dir/source/metacall_node_async_resources_test.cpp.o +[ 65%] Linking CXX executable ../../../metacall-node-reentrant-testd +[ 65%] Built target metacall-node-port-test +[ 65%] Building CXX object source/tests/metacall_node_await_chain_test/CMakeFiles/metacall-node-await-chain-test.dir/source/main.cpp.o +[ 65%] Built target reflect-value-cast-test +[ 65%] Linking CXX executable ../../../metacall-handle-get-testd +[ 65%] Building CXX object source/tests/metacall_node_exception_test/CMakeFiles/metacall-node-exception-test.dir/source/main.cpp.o +[ 65%] Building CXX object source/tests/metacall_node_exception_test/CMakeFiles/metacall-node-exception-test.dir/source/metacall_node_exception_test.cpp.o +[ 65%] Built target metacall-node-reentrant-test +[ 65%] Building CXX object source/tests/metacall_node_python_deadlock_test/CMakeFiles/metacall-node-python-deadlock-test.dir/source/main.cpp.o +[ 66%] Linking CXX executable ../../../metacall-node-async-testd +[ 66%] Linking CXX executable ../../../metacall-node-async-multiple-testd +[ 66%] Building CXX object source/tests/metacall_node_typescript_test/CMakeFiles/metacall-node-typescript-test.dir/source/metacall_node_typescript_test.cpp.o +[ 66%] Building CXX object source/tests/metacall_node_python_deadlock_test/CMakeFiles/metacall-node-python-deadlock-test.dir/source/metacall_node_python_deadlock_test.cpp.o +[ 66%] Built target metacall-node-async-test +[ 66%] Built target metacall-handle-get-test +[ 66%] Building CXX object source/tests/metacall_node_extension_test/CMakeFiles/metacall-node-extension-test.dir/source/main.cpp.o +[ 66%] Building CXX object source/tests/metacall_node_native_code_test/CMakeFiles/metacall-node-native-code-test.dir/source/main.cpp.o +[ 66%] Built target metacall-node-async-multiple-test +[ 67%] Linking CXX executable ../../../metacall-node-port-await-testd +[ 68%] Building CXX object source/tests/metacall_node_multithread_deadlock_test/CMakeFiles/metacall-node-multithread-deadlock-test.dir/source/main.cpp.o +[ 69%] Linking CXX executable ../../../metacall-node-python-port-ruby-testd +[ 69%] Building CXX object source/tests/metacall_distributable_test/CMakeFiles/metacall-distributable-test.dir/source/main.cpp.o +[ 69%] Linking CXX executable ../../../metacall-node-python-async-after-destroy-testd +[ 69%] Built target metacall-node-python-port-ruby-test +[ 69%] Built target metacall-node-port-await-test +[ 69%] Building CXX object source/tests/metacall_distributable_test/CMakeFiles/metacall-distributable-test.dir/source/metacall_distributable_test.cpp.o +[ 70%] Building CXX object source/tests/metacall_cast_test/CMakeFiles/metacall-cast-test.dir/source/main.cpp.o +[ 70%] Building CXX object source/tests/metacall_node_python_exception_test/CMakeFiles/metacall-node-python-exception-test.dir/source/metacall_node_python_exception_test.cpp.o +[ 70%] Building CXX object source/tests/metacall_cast_test/CMakeFiles/metacall-cast-test.dir/source/metacall_cast_test.cpp.o +[ 70%] Linking CXX executable ../../../metacall-node-python-await-testd +[ 70%] Building CXX object source/tests/metacall_node_clear_mem_test/CMakeFiles/metacall-node-clear-mem-test.dir/source/metacall_node_clear_mem_test.cpp.o +[ 70%] Built target metacall-node-python-async-after-destroy-test +[ 70%] Building CXX object source/tests/metacall_init_fini_test/CMakeFiles/metacall-init-fini-test.dir/source/main.cpp.o +[ 70%] Building CXX object source/tests/metacall_node_native_code_test/CMakeFiles/metacall-node-native-code-test.dir/source/metacall_node_native_code_test.cpp.o +[ 70%] Built target metacall-node-python-await-test +[ 70%] Building CXX object source/tests/metacall_ducktype_test/CMakeFiles/metacall-ducktype-test.dir/source/main.cpp.o +[ 70%] Building CXX object source/tests/metacall_node_await_chain_test/CMakeFiles/metacall-node-await-chain-test.dir/source/metacall_node_await_chain_test.cpp.o +[ 70%] Linking CXX executable ../../../metacall-node-fail-load-leak-testd +[ 70%] Building CXX object source/tests/metacall_inspect_test/CMakeFiles/metacall-inspect-test.dir/source/main.cpp.o +[ 70%] Linking CXX executable ../../../metacall-node-async-resources-testd +[ 70%] Built target metacall-node-fail-load-leak-test +[ 70%] Building CXX object source/tests/metacall_integration_test/CMakeFiles/metacall-integration-test.dir/source/main.cpp.o +[ 70%] Building CXX object source/tests/metacall_ducktype_test/CMakeFiles/metacall-ducktype-test.dir/source/metacall_ducktype_test.cpp.o +[ 70%] Building CXX object source/tests/metacall_node_extension_test/CMakeFiles/metacall-node-extension-test.dir/source/metacall_node_extension_test.cpp.o +[ 70%] Linking CXX executable ../../../metacall-node-callback-testd +[ 70%] Built target metacall-node-async-resources-test +[ 70%] Linking CXX executable ../../../metacall-node-python-ruby-testd +[ 71%] Building CXX object source/tests/metacall_depends_test/CMakeFiles/metacall-depends-test.dir/source/main.cpp.o +[ 72%] Linking CXX executable ../../../metacall-node-exception-testd +[ 72%] Linking CXX executable ../../../metacall-node-python-deadlock-testd +[ 72%] Building CXX object source/tests/metacall_node_multithread_deadlock_test/CMakeFiles/metacall-node-multithread-deadlock-test.dir/source/metacall_node_multithread_deadlock_test.cpp.o +[ 72%] Built target metacall-node-callback-test +[ 72%] Linking CXX executable ../../../metacall-node-fail-testd +[ 72%] Building CXX object source/tests/metacall_depends_test/CMakeFiles/metacall-depends-test.dir/source/metacall_depends_test.cpp.o +[ 72%] Linking CXX executable ../../../metacall-node-fail-env-var-testd +[ 72%] Building CXX object source/tests/metacall_init_fini_test/CMakeFiles/metacall-init-fini-test.dir/source/metacall_init_fini_test.cpp.o +[ 72%] Built target metacall-node-python-ruby-test +[ 72%] Built target metacall-node-exception-test +[ 72%] Building CXX object source/tests/metacall_configuration_default_test/CMakeFiles/metacall-configuration-default-test.dir/source/main.cpp.o +[ 72%] Building CXX object source/tests/metacall_configuration_exec_path_test/CMakeFiles/metacall-configuration-exec-path-test.dir/source/main.cpp.o +[ 72%] Building CXX object source/tests/metacall_configuration_default_test/CMakeFiles/metacall-configuration-default-test.dir/source/metacall_configuration_default_test.cpp.o +[ 72%] Built target metacall-node-python-deadlock-test +[ 72%] Building CXX object source/tests/metacall_configuration_exec_path_test/CMakeFiles/metacall-configuration-exec-path-test.dir/source/metacall_configuration_exec_path_test.cpp.o +[ 72%] Built target metacall-node-fail-test +[ 72%] Building CXX object source/tests/metacall_clear_test/CMakeFiles/metacall-clear-test.dir/source/main.cpp.o +[ 72%] Built target metacall-node-fail-env-var-test +[ 72%] Building CXX object source/tests/metacall_python_test/CMakeFiles/metacall-python-test.dir/source/main.cpp.o +[ 72%] Building CXX object source/tests/metacall_python_test/CMakeFiles/metacall-python-test.dir/source/metacall_python_test.cpp.o +[ 72%] Linking CXX executable ../../../metacall-testd +[ 72%] Building CXX object source/tests/metacall_clear_test/CMakeFiles/metacall-clear-test.dir/source/metacall_clear_test.cpp.o +[ 72%] Linking CXX executable ../../../metacall-node-python-exception-testd +[ 72%] Building CXX object source/tests/metacall_inspect_test/CMakeFiles/metacall-inspect-test.dir/source/metacall_inspect_test.cpp.o +[ 72%] Built target metacall-test +[ 72%] Building CXX object source/tests/metacall_python_object_class_test/CMakeFiles/metacall-python-object-class-test.dir/source/main.cpp.o +[ 72%] Built target metacall-node-python-exception-test +[ 72%] Building CXX object source/tests/metacall_python_gc_test/CMakeFiles/metacall-python-gc-test.dir/source/main.cpp.o +[ 72%] Linking CXX executable ../../../metacall-cast-testd +[ 72%] Building CXX object source/tests/metacall_integration_test/CMakeFiles/metacall-integration-test.dir/source/environment.cpp.o +[ 72%] Linking CXX executable ../../../metacall-node-clear-mem-testd +[ 72%] Building CXX object source/tests/metacall_python_gc_test/CMakeFiles/metacall-python-gc-test.dir/source/metacall_python_gc_test.cpp.o +[ 72%] Linking CXX executable ../../../metacall-node-typescript-testd +[ 72%] Built target metacall-cast-test +[ 72%] Building CXX object source/tests/metacall_python_open_test/CMakeFiles/metacall-python-open-test.dir/source/main.cpp.o +[ 72%] Built target metacall-node-clear-mem-test +[ 72%] Linking CXX executable ../../../metacall-node-await-chain-testd +[ 72%] Building CXX object source/tests/metacall_python_dict_test/CMakeFiles/metacall-python-dict-test.dir/source/main.cpp.o +[ 72%] Built target metacall-node-typescript-test +[ 72%] Building CXX object source/tests/metacall_integration_test/CMakeFiles/metacall-integration-test.dir/source/metacall_integration_test.cpp.o +[ 72%] Building CXX object source/tests/metacall_python_pointer_test/CMakeFiles/metacall-python-pointer-test.dir/source/main.cpp.o +[ 72%] Building CXX object source/tests/metacall_python_dict_test/CMakeFiles/metacall-python-dict-test.dir/source/metacall_python_dict_test.cpp.o +[ 72%] Building CXX object source/tests/metacall_python_reentrant_test/CMakeFiles/metacall-python-reentrant-test.dir/source/main.cpp.o +[ 72%] Built target metacall-node-await-chain-test +[ 73%] Building CXX object source/tests/metacall_python_object_class_test/CMakeFiles/metacall-python-object-class-test.dir/source/metacall_python_object_class_test.cpp.o +[ 73%] Building CXX object source/tests/metacall_python_varargs_test/CMakeFiles/metacall-python-varargs-test.dir/source/main.cpp.o +[ 73%] Linking CXX executable ../../../configuration-default-test/metacall-configuration-default-testd +[ 73%] Linking CXX executable ../../../metacall-node-native-code-testd +[ 73%] Linking CXX executable ../../../metacall-init-fini-testd +[ 73%] Built target metacall-configuration-default-test +[ 73%] Building CXX object source/tests/metacall_python_reentrant_test/CMakeFiles/metacall-python-reentrant-test.dir/source/metacall_python_reentrant_test.cpp.o +[ 74%] Building CXX object source/tests/metacall_python_loader_port_test/CMakeFiles/py-loader-port-test.dir/source/main.cpp.o +[ 74%] Linking CXX executable ../../../metacall-configuration-exec-path-testd +[ 74%] Built target metacall-node-native-code-test +[ 74%] Built target metacall-init-fini-test +[ 74%] Building CXX object source/tests/metacall_python_loader_port_test/CMakeFiles/py-loader-port-test.dir/source/metacall_python_loader_port_test.cpp.o +[ 74%] Building CXX object source/tests/metacall_python_port_https_test/CMakeFiles/metacall-python-port-https-test.dir/source/main.cpp.o +[ 75%] Building CXX object source/tests/metacall_python_port_callback_test/CMakeFiles/metacall-python-port-callback-test.dir/source/main.cpp.o +[ 75%] Linking CXX executable ../../../metacall-distributable-testd +[ 75%] Linking CXX executable ../../../metacall-node-extension-testd +[ 75%] Linking CXX executable ../../../metacall-clear-testd +[ 75%] Building CXX object source/tests/metacall_python_port_callback_test/CMakeFiles/metacall-python-port-callback-test.dir/source/metacall_python_port_callback_test.cpp.o +[ 75%] Linking CXX executable ../../../metacall-node-multithread-deadlock-testd +[ 75%] Built target metacall-configuration-exec-path-test +[ 75%] Building CXX object source/tests/metacall_python_port_pointer_test/CMakeFiles/metacall-python-port-pointer-test.dir/source/main.cpp.o +[ 75%] Linking CXX executable ../../../metacall-python-testd +[ 75%] Linking CXX executable ../../../metacall-depends-testd +[ 75%] Building CXX object source/tests/metacall_python_open_test/CMakeFiles/metacall-python-open-test.dir/source/metacall_python_open_test.cpp.o +[ 75%] Built target metacall-node-extension-test +[ 75%] Built target metacall-distributable-test +[ 75%] Building CXX object source/tests/metacall_python_port_pointer_test/CMakeFiles/metacall-python-port-pointer-test.dir/source/metacall_python_port_pointer_test.cpp.o +[ 75%] Built target metacall-clear-test +[ 76%] Building CXX object source/tests/metacall_python_callback_test/CMakeFiles/metacall-python-callback-test.dir/source/main.cpp.o +[ 76%] Building CXX object source/tests/metacall_python_port_import_test/CMakeFiles/metacall-python-port-import-test.dir/source/main.cpp.o +[ 76%] Building CXX object source/tests/metacall_python_fail_test/CMakeFiles/metacall-python-fail-test.dir/source/main.cpp.o +[ 77%] Linking CXX executable ../../../metacall-ducktype-testd +[ 77%] Building CXX object source/tests/metacall_python_fail_test/CMakeFiles/metacall-python-fail-test.dir/source/metacall_python_fail_test.cpp.o +[ 77%] Built target metacall-node-multithread-deadlock-test +[ 77%] Building CXX object source/tests/metacall_python_pointer_test/CMakeFiles/metacall-python-pointer-test.dir/source/metacall_python_pointer_test.cpp.o +[ 77%] Built target metacall-python-test +[ 77%] Built target metacall-depends-test +[ 77%] Building CXX object source/tests/metacall_python_without_functions_test/CMakeFiles/metacall-python-without-functions-test.dir/source/main.cpp.o +[ 77%] Building CXX object source/tests/metacall_python_relative_path_test/CMakeFiles/metacall-python-relative-path-test.dir/source/main.cpp.o +[ 77%] Building CXX object source/tests/metacall_python_builtins_test/CMakeFiles/metacall-python-builtins-test.dir/source/main.cpp.o +[ 77%] Building CXX object source/tests/metacall_python_varargs_test/CMakeFiles/metacall-python-varargs-test.dir/source/metacall_python_varargs_test.cpp.o +[ 77%] Linking CXX executable ../../../metacall-python-gc-testd +[ 77%] Linking CXX executable ../../../metacall-inspect-testd +[ 77%] Built target metacall-ducktype-test +[ 77%] Building CXX object source/tests/metacall_python_port_import_test/CMakeFiles/metacall-python-port-import-test.dir/source/metacall_python_port_import_test.cpp.o +[ 77%] Built target metacall-inspect-test +[ 77%] Built target metacall-python-gc-test +[ 77%] Building CXX object source/tests/metacall_python_callback_test/CMakeFiles/metacall-python-callback-test.dir/source/metacall_python_callback_test.cpp.o +[ 77%] Building CXX object source/tests/metacall_python_async_test/CMakeFiles/metacall-python-async-test.dir/source/main.cpp.o +[ 77%] Building CXX object source/tests/metacall_python_without_functions_test/CMakeFiles/metacall-python-without-functions-test.dir/source/metacall_python_without_functions_test.cpp.o +[ 77%] Building CXX object source/tests/metacall_python_async_test/CMakeFiles/metacall-python-async-test.dir/source/metacall_python_async_test.cpp.o +[ 77%] Building CXX object source/tests/metacall_python_port_https_test/CMakeFiles/metacall-python-port-https-test.dir/source/metacall_python_port_https_test.cpp.o +[ 78%] Linking CXX executable ../../../metacall-integration-testd +[ 78%] Building CXX object source/tests/metacall_python_builtins_test/CMakeFiles/metacall-python-builtins-test.dir/source/metacall_python_builtins_test.cpp.o +[ 79%] Building CXX object source/tests/metacall_python_relative_path_test/CMakeFiles/metacall-python-relative-path-test.dir/source/metacall_python_relative_path_test.cpp.o +[ 79%] Built target metacall-integration-test +[ 79%] Building CXX object source/tests/metacall_python_exception_test/CMakeFiles/metacall-python-exception-test.dir/source/main.cpp.o +[ 79%] Building CXX object source/tests/metacall_python_exception_test/CMakeFiles/metacall-python-exception-test.dir/source/metacall_python_exception_test.cpp.o +[ 79%] Linking CXX executable ../../../metacall-python-port-callback-testd +[ 80%] Building CXX object source/tests/metacall_python_without_env_vars_test/CMakeFiles/metacall-python-without-env-vars-test.dir/source/main.cpp.o +[ 80%] Building CXX object source/tests/metacall_python_without_env_vars_test/CMakeFiles/metacall-python-without-env-vars-test.dir/source/metacall_python_without_env_vars_test.cpp.o +[ 80%] Linking CXX executable ../../../metacall-python-reentrant-testd +[ 80%] Building CXX object source/tests/metacall_map_test/CMakeFiles/metacall-map-test.dir/source/main.cpp.o +[ 80%] Building CXX object source/tests/metacall_map_test/CMakeFiles/metacall-map-test.dir/source/metacall_map_test.cpp.o +[ 80%] Built target metacall-python-port-callback-test +[ 80%] Built target metacall-python-reentrant-test +[ 80%] Building CXX object source/tests/metacall_initialize_test/CMakeFiles/metacall-initialize-test.dir/source/main.cpp.o +[ 80%] Building CXX object source/tests/metacall_map_await_test/CMakeFiles/metacall-map-await-test.dir/source/main.cpp.o +[ 80%] Linking CXX executable ../../../py-loader-port-testd +[ 80%] Building CXX object source/tests/metacall_map_await_test/CMakeFiles/metacall-map-await-test.dir/source/metacall_map_await_test.cpp.o +[ 80%] Linking CXX executable ../../../metacall-python-dict-testd +[ 80%] Linking CXX executable ../../../metacall-python-port-pointer-testd +[ 80%] Built target py-loader-port-test +[ 80%] Built target metacall-python-dict-test +[ 80%] Building CXX object source/tests/metacall_initialize_ex_test/CMakeFiles/metacall-initialize-ex-test.dir/source/main.cpp.o +[ 81%] Building CXX object source/tests/metacall_reinitialize_test/CMakeFiles/metacall-reinitialize-test.dir/source/main.cpp.o +[ 81%] Linking CXX executable ../../../metacall-python-object-class-testd +[ 81%] Linking CXX executable ../../../metacall-python-fail-testd +[ 81%] Linking CXX executable ../../../metacall-python-varargs-testd +[ 81%] Built target metacall-python-port-pointer-test +[ 81%] Building CXX object source/tests/metacall_initialize_destroy_multiple_test/CMakeFiles/metacall-initialize-destroy-multiple-test.dir/source/main.cpp.o +[ 81%] Building CXX object source/tests/metacall_initialize_destroy_multiple_node_test/CMakeFiles/metacall-initialize-destroy-multiple-node-test.dir/source/main.cpp.o +[ 82%] Linking CXX executable ../../../metacall-python-port-import-testd +[ 82%] Built target metacall-python-object-class-test +[ 82%] Linking CXX executable ../../../metacall-python-port-https-testd +[ 82%] Building CXX object source/tests/metacall_reload_functions_test/CMakeFiles/metacall-reload-functions-test.dir/source/main.cpp.o +[ 82%] Linking CXX executable ../../../metacall-python-pointer-testd +[ 82%] Built target metacall-python-fail-test +[ 82%] Building CXX object source/tests/metacall_initialize_destroy_multiple_node_test/CMakeFiles/metacall-initialize-destroy-multiple-node-test.dir/source/metacall_initialize_destroy_multiple_node_test.cpp.o +[ 82%] Building CXX object source/tests/metacall_initialize_destroy_multiple_test/CMakeFiles/metacall-initialize-destroy-multiple-test.dir/source/metacall_initialize_destroy_multiple_test.cpp.o +[ 82%] Linking CXX executable ../../../metacall-python-callback-testd +[ 82%] Built target metacall-python-varargs-test +[ 82%] Building CXX object source/tests/metacall_invalid_loader_test/CMakeFiles/metacall-invalid-loader-test.dir/source/metacall_invalid_loader_test.cpp.o +[ 83%] Building CXX object source/tests/metacall_initialize_test/CMakeFiles/metacall-initialize-test.dir/source/metacall_initialize_test.cpp.o +[ 83%] Building CXX object source/tests/metacall_invalid_loader_test/CMakeFiles/metacall-invalid-loader-test.dir/source/main.cpp.o +[ 83%] Linking CXX executable ../../../metacall-python-open-testd +[ 83%] Built target metacall-python-port-https-test +[ 83%] Built target metacall-python-port-import-test +[ 84%] Linking CXX executable ../../../metacall-python-exception-testd +[ 84%] Linking CXX executable ../../../metacall-python-without-functions-testd +[ 84%] Building CXX object source/tests/metacall_return_monad_test/CMakeFiles/metacall-return-monad-test.dir/source/main.cpp.o +[ 84%] Building CXX object source/tests/metacall_fork_test/CMakeFiles/metacall-fork-test.dir/source/main.cpp.o +[ 84%] Building CXX object source/tests/metacall_fork_test/CMakeFiles/metacall-fork-test.dir/source/metacall_fork_test.cpp.o +[ 84%] Built target metacall-python-callback-test +[ 84%] Built target metacall-python-pointer-test +[ 84%] Building CXX object source/tests/metacall_return_monad_test/CMakeFiles/metacall-return-monad-test.dir/source/metacall_return_monad_test.cpp.o +[ 84%] Linking CXX executable ../../../metacall-python-without-env-vars-testd +[ 84%] Building CXX object source/tests/metacall_callback_complex_test/CMakeFiles/metacall-callback-complex-test.dir/source/main.cpp.o +[ 84%] Built target metacall-python-open-test +[ 84%] Built target metacall-python-without-functions-test +[ 84%] Building CXX object source/tests/metacall_callback_complex_test/CMakeFiles/metacall-callback-complex-test.dir/source/metacall_callback_complex_test.cpp.o +[ 84%] Building CXX object source/tests/metacall_ruby_fail_test/CMakeFiles/metacall-ruby-fail-test.dir/source/main.cpp.o +[ 84%] Built target metacall-python-exception-test +[ 84%] Building CXX object source/tests/metacall_ruby_fail_empty_test/CMakeFiles/metacall-ruby-fail-empty-test.dir/source/main.cpp.o +[ 84%] Linking CXX executable ../../../metacall-python-builtins-testd +[ 84%] Linking CXX executable ../../../metacall-python-async-testd +[ 84%] Built target metacall-python-without-env-vars-test +[ 84%] Building CXX object source/tests/metacall_ruby_object_class_test/CMakeFiles/metacall-ruby-object-class-test.dir/source/main.cpp.o +[ 84%] Building CXX object source/tests/metacall_initialize_ex_test/CMakeFiles/metacall-initialize-ex-test.dir/source/metacall_initialize_ex_test.cpp.o +[ 84%] Building CXX object source/tests/metacall_reinitialize_test/CMakeFiles/metacall-reinitialize-test.dir/source/metacall_reinitialize_test.cpp.o +[ 84%] Linking CXX executable ../../../metacall-python-relative-path-testd +[ 84%] Built target metacall-python-async-test +[ 84%] Building CXX object source/tests/metacall_ruby_parser_integration_test/CMakeFiles/metacall-ruby-parser-integration-test.dir/source/main.cpp.o +[ 84%] Built target metacall-python-builtins-test +[ 84%] Building CXX object source/tests/metacall_ruby_parser_integration_test/CMakeFiles/metacall-ruby-parser-integration-test.dir/source/metacall_ruby_parser_integration_test.cpp.o +[ 84%] Building CXX object source/tests/metacall_ruby_object_class_test/CMakeFiles/metacall-ruby-object-class-test.dir/source/metacall_ruby_object_class_test.cpp.o +[ 84%] Building CXX object source/tests/metacall_function_test/CMakeFiles/metacall-function-test.dir/source/main.cpp.o +[ 84%] Built target metacall-python-relative-path-test +[ 84%] Linking CXX executable ../../../metacall-map-testd +[ 84%] Building CXX object source/tests/metacall_reload_functions_test/CMakeFiles/metacall-reload-functions-test.dir/source/metacall_reload_functions_test.cpp.o +[ 84%] Building CXX object source/tests/metacall_cobol_test/CMakeFiles/metacall-cobol-test.dir/source/main.cpp.o +[ 84%] Building CXX object source/tests/metacall_cobol_test/CMakeFiles/metacall-cobol-test.dir/source/metacall_cobol_test.cpp.o +[ 84%] Built target metacall-map-test +[ 84%] Building CXX object source/tests/metacall_file_test/CMakeFiles/metacall-file-test.dir/source/main.cpp.o +[ 84%] Building CXX object source/tests/metacall_file_fail_test/CMakeFiles/metacall-file-fail-test.dir/source/main.cpp.o +[ 84%] Building CXX object source/tests/metacall_file_test/CMakeFiles/metacall-file-test.dir/source/metacall_file_test.cpp.o +[ 84%] Linking CXX executable ../../../metacall-invalid-loader-testd +[ 85%] Linking CXX executable ../../../metacall-initialize-destroy-multiple-node-testd +[ 85%] Linking CXX executable ../../../metacall-initialize-destroy-multiple-testd +[ 86%] Building CXX object source/tests/metacall_ruby_fail_test/CMakeFiles/metacall-ruby-fail-test.dir/source/metacall_ruby_fail_test.cpp.o +[ 86%] Linking CXX executable ../../../metacall-initialize-testd +[ 87%] Building CXX object source/tests/metacall_file_glob_test/CMakeFiles/metacall-file-glob-test.dir/source/main.cpp.o +[ 87%] Building CXX object source/tests/metacall_ruby_fail_empty_test/CMakeFiles/metacall-ruby-fail-empty-test.dir/source/metacall_ruby_fail_empty_test.cpp.o +[ 87%] Built target metacall-invalid-loader-test +[ 87%] Building CXX object source/tests/metacall_typescript_test/CMakeFiles/metacall-typescript-test.dir/source/main.cpp.o +[ 88%] Linking CXX executable ../../../metacall-fork-testd +[ 88%] Built target metacall-initialize-destroy-multiple-test +[ 88%] Built target metacall-initialize-destroy-multiple-node-test +[ 88%] Building CXX object source/tests/metacall_file_glob_test/CMakeFiles/metacall-file-glob-test.dir/source/metacall_file_glob_test.cpp.o +[ 88%] Building CXX object source/tests/metacall_typescript_test/CMakeFiles/metacall-typescript-test.dir/source/metacall_typescript_test.cpp.o +[ 88%] Built target metacall-initialize-test +[ 89%] Building CXX object source/tests/metacall_typescript_node_test/CMakeFiles/metacall-typescript-node-test.dir/source/main.cpp.o +[ 89%] Building CXX object source/tests/metacall_typescript_call_map_test/CMakeFiles/metacall-typescript-call-map-test.dir/source/main.cpp.o +[ 89%] Building CXX object source/tests/metacall_typescript_call_map_test/CMakeFiles/metacall-typescript-call-map-test.dir/source/metacall_typescript_call_map_test.cpp.o +[ 89%] Built target metacall-fork-test +[ 89%] Linking CXX executable ../../../metacall-map-await-testd +[ 89%] Building CXX object source/tests/metacall_typescript_tsx_test/CMakeFiles/metacall-typescript-tsx-test.dir/source/main.cpp.o +[ 89%] Linking CXX executable ../../../metacall-initialize-ex-testd +[ 89%] Linking CXX executable ../../../metacall-reinitialize-testd +[ 89%] Built target metacall-map-await-test +[ 89%] Building CXX object source/tests/metacall_function_test/CMakeFiles/metacall-function-test.dir/source/metacall_function_test.cpp.o +[ 89%] Building CXX object source/tests/metacall_typescript_tsx_loop_fail_test/CMakeFiles/metacall-typescript-tsx-loop-fail-test.dir/source/main.cpp.o +[ 89%] Built target metacall-initialize-ex-test +[ 89%] Building CXX object source/tests/metacall_typescript_require_test/CMakeFiles/metacall-typescript-require-test.dir/source/main.cpp.o +[ 89%] Building CXX object source/tests/metacall_typescript_jsx_default_test/CMakeFiles/metacall-typescript-jsx-default-test.dir/source/main.cpp.o +[ 89%] Built target metacall-reinitialize-test +[ 89%] Building CXX object source/tests/metacall_typescript_jsx_default_test/CMakeFiles/metacall-typescript-jsx-default-test.dir/source/metacall_typescript_jsx_default_test.cpp.o +[ 89%] Building CXX object source/tests/metacall_file_fail_test/CMakeFiles/metacall-file-fail-test.dir/source/metacall_file_fail_test.cpp.o +[ 89%] Building CXX object source/tests/metacall_typescript_require_test/CMakeFiles/metacall-typescript-require-test.dir/source/metacall_typescript_require_test.cpp.o +[ 89%] Building CXX object source/tests/metacall_typescript_node_test/CMakeFiles/metacall-typescript-node-test.dir/source/metacall_typescript_node_test.cpp.o +[ 89%] Linking CXX executable ../../../metacall-ruby-parser-integration-testd +[ 89%] Linking CXX executable ../../../metacall-ruby-fail-testd +[ 90%] Linking CXX executable ../../../metacall-return-monad-testd +[ 90%] Building CXX object source/tests/metacall_typescript_tsx_test/CMakeFiles/metacall-typescript-tsx-test.dir/source/metacall_typescript_tsx_test.cpp.o +[ 90%] Building CXX object source/tests/metacall_typescript_tsx_loop_fail_test/CMakeFiles/metacall-typescript-tsx-loop-fail-test.dir/source/metacall_typescript_tsx_loop_fail_test.cpp.o +[ 90%] Built target metacall-ruby-parser-integration-test +[ 90%] Building CXX object source/tests/metacall_csharp_static_class_test/CMakeFiles/metacall-csharp-static-class-test.dir/source/main.cpp.o +[ 90%] Building CXX object source/tests/metacall_rpc_test/CMakeFiles/metacall-rpc-test.dir/source/main.cpp.o +[ 90%] Built target metacall-ruby-fail-test +[ 90%] Building CXX object source/tests/metacall_csharp_static_class_test/CMakeFiles/metacall-csharp-static-class-test.dir/source/metacall_csharp_static_class_test.cpp.o +[ 91%] Building CXX object source/tests/metacall_ruby_test/CMakeFiles/metacall-ruby-test.dir/source/main.cpp.o +[ 91%] Built target metacall-return-monad-test +[ 91%] Building CXX object source/tests/metacall_cs_test/CMakeFiles/metacall-cs-test.dir/source/main.cpp.o +[ 91%] Building CXX object source/tests/metacall_cs_test/CMakeFiles/metacall-cs-test.dir/source/environment.cpp.o +[ 91%] Linking CXX executable ../../../metacall-callback-complex-testd +[ 91%] Building CXX object source/tests/metacall_cs_test/CMakeFiles/metacall-cs-test.dir/source/metacall_cs_test.cpp.o +[ 91%] Building CXX object source/tests/metacall_rpc_test/CMakeFiles/metacall-rpc-test.dir/source/metacall_rpc_test.cpp.o +[ 92%] Linking CXX executable ../../../metacall-cobol-testd +[ 92%] Linking CXX executable ../../../metacall-ruby-fail-empty-testd +[ 92%] Linking CXX executable ../../../metacall-reload-functions-testd +[ 92%] Linking CXX executable ../../../metacall-ruby-object-class-testd +[ 92%] Linking CXX executable ../../../metacall-file-testd +[ 92%] Built target metacall-callback-complex-test +[ 92%] Linking CXX executable ../../../metacall-typescript-jsx-default-testd +[ 92%] Building CXX object source/tests/metacall_java_test/CMakeFiles/metacall-java-test.dir/source/main.cpp.o +[ 92%] Built target metacall-cobol-test +[ 92%] Building CXX object source/tests/metacall_wasm_test/CMakeFiles/metacall-wasm-test.dir/source/main.cpp.o +[ 92%] Built target metacall-ruby-object-class-test +[ 92%] Built target metacall-reload-functions-test +[ 92%] Built target metacall-ruby-fail-empty-test +[ 92%] Building CXX object source/tests/metacall_wasm_python_port_test/CMakeFiles/metacall-wasm-python-port-test.dir/source/main.cpp.o +[ 92%] Building CXX object source/tests/metacall_c_lib_test/CMakeFiles/metacall-c-lib-test.dir/source/main.cpp.o +[ 92%] Building CXX object source/tests/metacall_c_test/CMakeFiles/metacall-c-test.dir/source/main.cpp.o +[ 92%] Built target metacall-file-test +[ 92%] Built target metacall-typescript-jsx-default-test +[ 92%] Building CXX object source/tests/metacall_version_test/CMakeFiles/metacall-version-test.dir/source/main.cpp.o +[ 92%] Building CXX object source/tests/metacall_dynlink_path_test/CMakeFiles/metacall-dynlink-path-test.dir/source/main.cpp.o +[ 93%] Linking CXX executable ../../../metacall-typescript-testd +[ 94%] Building CXX object source/tests/metacall_dynlink_path_test/CMakeFiles/metacall-dynlink-path-test.dir/source/metacall_dynlink_path_test.cpp.o +[ 94%] Linking CXX executable ../../../metacall-file-glob-testd +[ 94%] Linking CXX executable ../../../metacall-typescript-call-map-testd +[ 94%] Building CXX object source/tests/metacall_ruby_test/CMakeFiles/metacall-ruby-test.dir/source/metacall_ruby_test.cpp.o +[ 95%] Building CXX object source/tests/metacall_version_test/CMakeFiles/metacall-version-test.dir/source/metacall_version_test.cpp.o +[ 95%] Built target metacall-typescript-test +[ 95%] Building CXX object source/tests/metacall_library_path_without_env_vars_test/CMakeFiles/metacall-library-path-without-env-vars-test.dir/source/main.cpp.o +[ 95%] Built target metacall-file-glob-test +[ 95%] Building CXX object source/tests/metacall_ext_test/CMakeFiles/metacall-ext-test.dir/source/main.cpp.o +[ 95%] Building CXX object source/tests/metacall_ext_test/CMakeFiles/metacall-ext-test.dir/source/metacall_ext_test.cpp.o +[ 95%] Built target metacall-typescript-call-map-test +[ 96%] Building CXX object source/tests/metacall_plugin_extension_test/CMakeFiles/metacall-plugin-extension-test.dir/source/main.cpp.o +[ 96%] Linking CXX executable ../../../metacall-typescript-require-testd +[ 96%] Building CXX object source/tests/metacall_wasm_test/CMakeFiles/metacall-wasm-test.dir/source/metacall_wasm_test.cpp.o +[ 96%] Linking CXX executable ../../../metacall-file-fail-testd +[ 96%] Building CXX object source/tests/metacall_java_test/CMakeFiles/metacall-java-test.dir/source/metacall_java_test.cpp.o +[ 96%] Built target metacall-typescript-require-test +[ 96%] Building CXX object source/tests/metacall_wasm_python_port_test/CMakeFiles/metacall-wasm-python-port-test.dir/source/metacall_wasm_python_port_test.cpp.o +[ 96%] Linking CXX executable ../../../metacall-function-testd +[ 96%] Built target metacall-file-fail-test +[ 96%] Linking CXX executable ../../../metacall-typescript-tsx-loop-fail-testd +[ 97%] Building CXX object source/tests/metacall_library_path_without_env_vars_test/CMakeFiles/metacall-library-path-without-env-vars-test.dir/source/metacall_library_path_without_env_vars_test.cpp.o +[ 98%] Building CXX object source/tests/metacall_c_lib_test/CMakeFiles/metacall-c-lib-test.dir/source/metacall_c_lib_test.cpp.o +[ 98%] Linking CXX executable ../../../metacall-typescript-node-testd +[ 98%] Building CXX object source/tests/metacall_c_test/CMakeFiles/metacall-c-test.dir/source/metacall_c_test.cpp.o +[ 98%] Building CXX object source/tests/metacall_plugin_extension_test/CMakeFiles/metacall-plugin-extension-test.dir/source/metacall_plugin_extension_test.cpp.o +[ 98%] Building CXX object source/tests/metacall_plugin_extension_local_test/CMakeFiles/metacall-plugin-extension-local-test.dir/source/main.cpp.o +[ 98%] Building CXX object source/tests/metacall_plugin_extension_local_test/CMakeFiles/metacall-plugin-extension-local-test.dir/source/metacall_plugin_extension_local_test.cpp.o +[ 98%] Built target metacall-function-test +[ 98%] Building CXX object source/tests/metacall_backtrace_plugin_test/CMakeFiles/metacall-backtrace-plugin-test.dir/source/main.cpp.o +[ 98%] Built target metacall-typescript-tsx-loop-fail-test +[ 98%] Linking CXX executable ../../../metacall-cs-testd +[ 98%] Linking CXX executable ../../../metacall-typescript-tsx-testd +[ 98%] Building CXX object source/tests/metacall_sandbox_plugin_test/CMakeFiles/metacall-sandbox-plugin-test.dir/source/main.cpp.o +[ 98%] Built target metacall-typescript-node-test +[ 98%] Building CXX object source/benchmarks/log_bench/CMakeFiles/log-bench.dir/source/log_bench.cpp.o +[ 98%] Linking CXX executable ../../../metacall-csharp-static-class-testd +[ 98%] Building CXX object source/benchmarks/metacall_py_c_api_bench/CMakeFiles/metacall-py-c-api-bench.dir/source/metacall_py_c_api_bench.cpp.o +[ 98%] Building CXX object source/tests/metacall_sandbox_plugin_test/CMakeFiles/metacall-sandbox-plugin-test.dir/source/metacall_sandbox_plugin_test.cpp.o +[ 98%] Built target metacall-cs-test +[ 98%] Built target metacall-typescript-tsx-test +[ 98%] Building CXX object source/benchmarks/metacall_py_call_bench/CMakeFiles/metacall-py-call-bench.dir/source/metacall_py_call_bench.cpp.o +[ 98%] Building CXX object source/tests/metacall_backtrace_plugin_test/CMakeFiles/metacall-backtrace-plugin-test.dir/source/metacall_backtrace_plugin_test.cpp.o +[ 98%] Building CXX object source/benchmarks/metacall_py_init_bench/CMakeFiles/metacall-py-init-bench.dir/source/metacall_py_init_bench.cpp.o +[ 98%] Linking CXX executable ../../../metacall-dynlink-path-testd +[ 98%] Linking CXX executable ../../../metacall-ruby-testd +[ 98%] Linking CXX executable ../../../metacall-version-testd +[ 98%] Built target metacall-csharp-static-class-test +[ 98%] Building CXX object source/benchmarks/metacall_node_call_bench/CMakeFiles/metacall-node-call-bench.dir/source/metacall_node_call_bench.cpp.o +[ 98%] Building CXX object source/benchmarks/metacall_rb_call_bench/CMakeFiles/metacall-rb-call-bench.dir/source/metacall_rb_call_bench.cpp.o +[ 98%] Built target metacall-dynlink-path-test +[ 98%] Built target metacall-ruby-test +[ 98%] Building CXX object source/benchmarks/metacall_cs_call_bench/CMakeFiles/metacall-cs-call-bench.dir/source/metacall_cs_call_bench.cpp.o +[ 98%] Linking CXX executable ../../../metacall-rpc-testd +[ 98%] Built target metacall-version-test +[ 98%] Built target metacall-rpc-test +[ 98%] Linking CXX executable ../../../metacall-wasm-python-port-testd +[ 98%] Linking CXX executable ../../../log-benchd +[ 99%] Linking CXX executable ../../../metacall-py-init-benchd +[ 99%] Built target metacall-wasm-python-port-test +[ 99%] Linking CXX executable ../../../metacall-py-c-api-benchd +[ 99%] Built target log-bench +[ 99%] Linking CXX executable ../../../metacall-library-path-without-env-vars-testd +[ 99%] Built target metacall-py-init-bench +[ 99%] Built target metacall-py-c-api-bench +[ 99%] Linking CXX executable ../../../metacall-py-call-benchd +[ 99%] Built target metacall-library-path-without-env-vars-test +[ 99%] Linking CXX executable ../../../metacall-rb-call-benchd +[ 99%] Linking CXX executable ../../../metacall-ext-testd +[ 99%] Built target metacall-py-call-bench +[100%] Linking CXX executable ../../../metacall-cs-call-benchd +[100%] Linking CXX executable ../../../metacall-node-call-benchd +[100%] Built target metacall-rb-call-bench +[100%] Built target metacall-cs-call-bench +[100%] Built target metacall-ext-test +[100%] Linking CXX executable ../../../metacall-c-lib-testd +[100%] Built target metacall-node-call-bench +[100%] Built target metacall-c-lib-test +[100%] Linking CXX executable ../../../metacall-backtrace-plugin-testd +[100%] Built target metacall-backtrace-plugin-test +[100%] Linking CXX executable ../../../metacall-c-testd +[100%] Linking CXX executable ../../../metacall-plugin-extension-local-testd +[100%] Linking CXX executable ../../../metacall-plugin-extension-testd +[100%] Built target metacall-plugin-extension-local-test +[100%] Built target metacall-c-test +[100%] Built target metacall-plugin-extension-test +[100%] Linking CXX executable ../../../metacall-wasm-testd +[100%] Linking CXX executable ../../../metacall-java-testd +[100%] Built target metacall-wasm-test +[100%] Built target metacall-java-test +[100%] Linking CXX executable ../../../metacall-sandbox-plugin-testd +[100%] Built target metacall-sandbox-plugin-test ++ [ 1 = 1 ] ++ getconf _NPROCESSORS_ONLN ++ ctest -j24 --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C Debug +Test project /usr/local/metacall/build + Start 1: ts_loader_bootstrap + Start 2: node_port + Start 3: node_port_test_executable + Start 4: py_port + Start 5: go_port + Start 6: rs_port + Start 7: rb_port + Start 8: preprocessor-test + Start 9: environment-test + Start 10: log-test + Start 11: log-custom-test + Start 12: adt-set-test + Start 13: adt-trie-test + Start 14: adt-vector-test + Start 15: adt-map-test + Start 16: reflect-value-cast-test + Start 17: reflect-function-test + Start 18: reflect-object-class-test + Start 19: reflect-scope-test + Start 20: reflect-metadata-test + Start 21: dynlink-test + Start 22: detour-test + Start 23: serial-test + Start 24: configuration-test + 1/175 Test #8: preprocessor-test ................................ Passed 0.04 sec + 2/175 Test #9: environment-test ................................. Passed 0.03 sec + 3/175 Test #10: log-test ......................................... Passed 0.03 sec + 4/175 Test #11: log-custom-test .................................. Passed 0.03 sec + 5/175 Test #12: adt-set-test ..................................... Passed 0.03 sec + 6/175 Test #13: adt-trie-test .................................... Passed 0.03 sec + 7/175 Test #14: adt-vector-test .................................. Passed 0.03 sec + 8/175 Test #15: adt-map-test ..................................... Passed 0.03 sec + 9/175 Test #16: reflect-value-cast-test .......................... Passed 0.02 sec + 10/175 Test #17: reflect-function-test ............................ Passed 0.02 sec + 11/175 Test #18: reflect-object-class-test ........................ Passed 0.02 sec + 12/175 Test #19: reflect-scope-test ............................... Passed 0.02 sec + 13/175 Test #20: reflect-metadata-test ............................ Passed 0.02 sec + 14/175 Test #21: dynlink-test ..................................... Passed 0.02 sec + Start 25: rb-loader-parser-test + Start 26: portability-path-test + Start 27: metacall-logs-test + Start 28: metacall-load-memory-test + Start 29: metacall-load-memory-empty-test + Start 30: metacall-load-configuration-test + Start 31: metacall-load-configuration-fail-test + Start 32: metacall-load-configuration-relative-test + Start 33: metacall-load-configuration-python-node-test + Start 34: metacall-load-configuration-node-python-test + Start 35: metacall-duplicated-handle-test + Start 36: metacall-duplicated-symbols-test + Start 37: metacall-handle-export-test + Start 38: metacall-handle-get-test + 15/175 Test #22: detour-test ...................................... Passed 0.08 sec + 16/175 Test #23: serial-test ...................................... Passed 0.07 sec + 17/175 Test #24: configuration-test ............................... Passed 0.07 sec + 18/175 Test #25: rb-loader-parser-test ............................ Passed 0.06 sec + 19/175 Test #26: portability-path-test ............................ Passed 0.06 sec + Start 39: metacall-test + Start 40: metacall-node-test + Start 41: metacall-node-event-loop-test + Start 42: metacall-node-event-loop-signal-test + Start 43: metacall-node-call-test + 20/175 Test #27: metacall-logs-test ............................... Passed 0.33 sec + Start 44: metacall-node-inline-test + 21/175 Test #32: metacall-load-configuration-relative-test ........ Passed 0.46 sec + Start 45: metacall-node-async-test + 22/175 Test #31: metacall-load-configuration-fail-test ............ Passed 0.66 sec + Start 46: metacall-node-async-multiple-test + 23/175 Test #42: metacall-node-event-loop-signal-test ............. Passed 0.62 sec + Start 47: metacall-node-reentrant-test + 24/175 Test #28: metacall-load-memory-test ........................ Passed 0.72 sec + Start 48: metacall-node-port-test + 25/175 Test #40: metacall-node-test ............................... Passed 0.77 sec + Start 49: metacall-node-port-await-test + 26/175 Test #7: rb_port .......................................... Passed 0.90 sec + Start 50: metacall-node-port-c-lib-test + 27/175 Test #36: metacall-duplicated-symbols-test ................. Passed 1.06 sec + Start 51: metacall-node-python-port-mock-test + 28/175 Test #45: metacall-node-async-test ......................... Passed 0.69 sec + Start 52: metacall-node-python-port-ruby-test + 29/175 Test #44: metacall-node-inline-test ........................ Passed 0.87 sec + Start 53: metacall-node-python-ruby-test + 30/175 Test #47: metacall-node-reentrant-test ..................... Passed 0.66 sec + Start 54: metacall-node-callback-test + 31/175 Test #33: metacall-load-configuration-python-node-test ..... Passed 1.37 sec + Start 55: metacall-node-fail-test + 32/175 Test #43: metacall-node-call-test .......................... Passed 1.36 sec + Start 56: metacall-node-fail-env-var-test + 33/175 Test #37: metacall-handle-export-test ...................... Passed 1.40 sec + Start 57: metacall-node-fail-load-leak-test + 34/175 Test #30: metacall-load-configuration-test ................. Passed 1.51 sec + Start 58: metacall-node-typescript-test + 35/175 Test #34: metacall-load-configuration-node-python-test ..... Passed 1.52 sec + Start 59: metacall-node-python-async-after-destroy-test + 36/175 Test #38: metacall-handle-get-test ......................... Passed 1.52 sec + Start 60: metacall-node-python-await-test + 37/175 Test #35: metacall-duplicated-handle-test .................. Passed 1.56 sec + Start 61: metacall-node-python-exception-test + 38/175 Test #4: py_port .......................................... Passed 1.72 sec + Start 62: metacall-node-clear-mem-test + 39/175 Test #49: metacall-node-port-await-test .................... Passed 0.86 sec + Start 63: metacall-node-async-resources-test + 40/175 Test #50: metacall-node-port-c-lib-test .................... Passed 0.85 sec + Start 64: metacall-node-await-chain-test + 41/175 Test #56: metacall-node-fail-env-var-test .................. Passed 0.35 sec + Start 65: metacall-node-exception-test + 42/175 Test #55: metacall-node-fail-test .......................... Passed 0.60 sec + Start 66: metacall-node-python-deadlock-test + 43/175 Test #57: metacall-node-fail-load-leak-test ................ Passed 0.55 sec + Start 67: metacall-node-native-code-test + 44/175 Test #62: metacall-node-clear-mem-test ..................... Passed 0.42 sec + Start 68: metacall-node-extension-test + 45/175 Test #52: metacall-node-python-port-ruby-test .............. Passed 1.04 sec + Start 69: metacall-node-multithread-deadlock-test + 46/175 Test #64: metacall-node-await-chain-test ................... Passed 0.51 sec + Start 70: metacall-distributable-test + 47/175 Test #51: metacall-node-python-port-mock-test .............. Passed 1.13 sec + Start 71: metacall-cast-test + 48/175 Test #54: metacall-node-callback-test ...................... Passed 0.89 sec + Start 72: metacall-init-fini-test + 49/175 Test #65: metacall-node-exception-test ..................... Passed 0.51 sec + Start 73: metacall-ducktype-test + 50/175 Test #68: metacall-node-extension-test ..................... Passed 0.40 sec + Start 74: metacall-inspect-test + 51/175 Test #60: metacall-node-python-await-test .................. Passed 0.92 sec + Start 75: metacall-integration-test + 52/175 Test #67: metacall-node-native-code-test ................... Passed 0.52 sec + Start 76: metacall-depends-test + 53/175 Test #61: metacall-node-python-exception-test .............. Passed 0.97 sec + Start 77: metacall-configuration-exec-path-test + 54/175 Test #29: metacall-load-memory-empty-test .................. Passed 2.70 sec + Start 78: metacall-configuration-default-test + 55/175 Test #78: metacall-configuration-default-test .............. Passed 0.02 sec + Start 79: metacall-clear-test + 56/175 Test #71: metacall-cast-test ............................... Passed 0.58 sec + Start 80: metacall-python-test + 57/175 Test #73: metacall-ducktype-test ........................... Passed 0.54 sec + Start 81: metacall-python-object-class-test + 58/175 Test #72: metacall-init-fini-test .......................... Passed 0.74 sec + Start 82: metacall-python-gc-test + 59/175 Test #77: metacall-configuration-exec-path-test ............ Passed 0.56 sec + Start 83: metacall-python-open-test + 60/175 Test #76: metacall-depends-test ............................ Passed 0.65 sec + Start 84: metacall-python-dict-test + 61/175 Test #53: metacall-node-python-ruby-test ................... Passed 2.00 sec + Start 85: metacall-python-pointer-test + 62/175 Test #66: metacall-node-python-deadlock-test ............... Passed 1.25 sec + Start 86: metacall-python-reentrant-test + 63/175 Test #81: metacall-python-object-class-test ................ Passed 0.65 sec + Start 87: metacall-python-varargs-test + 64/175 Test #79: metacall-clear-test .............................. Passed 0.98 sec + Start 88: py-loader-port-test + 65/175 Test #82: metacall-python-gc-test .......................... Passed 0.76 sec + Start 89: metacall-python-port-https-test + 66/175 Test #85: metacall-python-pointer-test ..................... Passed 0.57 sec + Start 90: metacall-python-port-callback-test + 67/175 Test #80: metacall-python-test ............................. Passed 1.01 sec + Start 91: metacall-python-port-pointer-test + 68/175 Test #84: metacall-python-dict-test ........................ Passed 0.68 sec + Start 92: metacall-python-port-import-test + 69/175 Test #86: metacall-python-reentrant-test ................... Passed 1.09 sec + Start 93: metacall-python-callback-test + 70/175 Test #87: metacall-python-varargs-test ..................... Passed 0.86 sec + Start 94: metacall-python-fail-test + 71/175 Test #90: metacall-python-port-callback-test ............... Passed 0.80 sec + Start 95: metacall-python-relative-path-test + 72/175 Test #88: py-loader-port-test .............................. Passed 0.91 sec + Start 96: metacall-python-without-functions-test + 73/175 Test #91: metacall-python-port-pointer-test ................ Passed 0.97 sec + Start 97: metacall-python-builtins-test + 74/175 Test #46: metacall-node-async-multiple-test ................ Passed 4.26 sec + Start 98: metacall-python-async-test + 75/175 Test #94: metacall-python-fail-test ........................ Passed 0.67 sec + Start 99: metacall-python-exception-test + 76/175 Test #89: metacall-python-port-https-test .................. Passed 1.28 sec + Start 100: metacall-python-without-env-vars-test + 77/175 Test #95: metacall-python-relative-path-test ............... Passed 0.64 sec + Start 101: metacall-map-test + 78/175 Test #96: metacall-python-without-functions-test ........... Passed 0.65 sec + Start 102: metacall-map-await-test + 79/175 Test #2: node_port ........................................ Passed 5.42 sec + Start 103: metacall-initialize-test + 80/175 Test #103: metacall-initialize-test ......................... Passed 0.05 sec + Start 104: metacall-initialize-ex-test + 81/175 Test #104: metacall-initialize-ex-test ...................... Passed 0.01 sec + Start 105: metacall-reinitialize-test + 82/175 Test #3: node_port_test_executable ........................ Passed 5.50 sec + Start 106: metacall-initialize-destroy-multiple-test + 83/175 Test #106: metacall-initialize-destroy-multiple-test ........ Passed 0.02 sec + Start 107: metacall-initialize-destroy-multiple-node-test + 84/175 Test #97: metacall-python-builtins-test .................... Passed 0.74 sec + Start 108: metacall-reload-functions-test + 85/175 Test #93: metacall-python-callback-test .................... Passed 1.21 sec + Start 109: metacall-invalid-loader-test + 86/175 Test #109: metacall-invalid-loader-test ..................... Passed 0.02 sec + Start 110: metacall-fork-test + 87/175 Test #98: metacall-python-async-test ....................... Passed 0.63 sec + 88/175 Test #105: metacall-reinitialize-test ....................... Passed 0.14 sec + Start 111: metacall-return-monad-test + Start 112: metacall-callback-complex-test + 89/175 Test #58: metacall-node-typescript-test .................... Passed 4.07 sec + Start 113: metacall-ruby-fail-test + 90/175 Test #110: metacall-fork-test ............................... Passed 0.06 sec + Start 114: metacall-ruby-fail-empty-test + 91/175 Test #99: metacall-python-exception-test ................... Passed 0.62 sec + Start 115: metacall-ruby-object-class-test + 92/175 Test #113: metacall-ruby-fail-test .......................... Passed 0.06 sec + Start 116: metacall-ruby-parser-integration-test + 93/175 Test #115: metacall-ruby-object-class-test .................. Passed 0.04 sec + Start 117: metacall-function-test + 94/175 Test #116: metacall-ruby-parser-integration-test ............ Passed 0.04 sec + Start 118: metacall-cobol-test + 95/175 Test #114: metacall-ruby-fail-empty-test .................... Passed 0.08 sec + Start 119: metacall-file-test + 96/175 Test #119: metacall-file-test ............................... Passed 0.02 sec + Start 120: metacall-file-fail-test + 97/175 Test #118: metacall-cobol-test .............................. Passed 0.04 sec + Start 121: metacall-file-glob-test + 98/175 Test #120: metacall-file-fail-test .......................... Passed 0.01 sec + Start 122: metacall-typescript-test + 99/175 Test #100: metacall-python-without-env-vars-test ............ Passed 0.70 sec + Start 123: metacall-typescript-node-test +100/175 Test #121: metacall-file-glob-test .......................... Passed 0.03 sec + Start 124: metacall-typescript-call-map-test +101/175 Test #102: metacall-map-await-test .......................... Passed 0.55 sec + Start 125: metacall-typescript-tsx-test +102/175 Test #107: metacall-initialize-destroy-multiple-node-test ... Passed 0.41 sec + Start 126: metacall-typescript-tsx-loop-fail-test +103/175 Test #41: metacall-node-event-loop-test .................... Passed 5.86 sec + Start 127: metacall-typescript-require-test +104/175 Test #111: metacall-return-monad-test ....................... Passed 0.49 sec + Start 128: metacall-typescript-jsx-default-test +105/175 Test #92: metacall-python-port-import-test ................. Passed 2.49 sec + Start 129: metacall-rpc-test +106/175 Test #101: metacall-map-test ................................ Passed 1.51 sec + Start 130: metacall-csharp-static-class-test +107/175 Test #117: metacall-function-test ........................... Passed 1.21 sec + Start 131: metacall-ruby-test +108/175 Test #131: metacall-ruby-test ............................... Passed 0.12 sec + Start 132: metacall-cs-test +109/175 Test #108: metacall-reload-functions-test ................... Passed 1.82 sec + Start 133: metacall-java-test +110/175 Test #39: metacall-test .................................... Passed 7.34 sec + Start 134: metacall-wasm-test +111/175 Test #129: metacall-rpc-test ................................ Passed 1.13 sec + Start 135: metacall-wasm-python-port-test +112/175 Test #134: metacall-wasm-test ............................... Passed 0.10 sec + Start 136: metacall-c-test +113/175 Test #136: metacall-c-test .................................. Passed 0.15 sec + Start 137: metacall-c-lib-test +114/175 Test #112: metacall-callback-complex-test ................... Passed 2.28 sec + Start 138: metacall-version-test +115/175 Test #137: metacall-c-lib-test .............................. Passed 0.19 sec + Start 139: metacall-dynlink-path-test +116/175 Test #138: metacall-version-test ............................ Passed 0.01 sec + Start 140: metacall-library-path-without-env-vars-test +117/175 Test #139: metacall-dynlink-path-test ....................... Passed 0.01 sec + Start 141: metacall-ext-test +118/175 Test #140: metacall-library-path-without-env-vars-test ...... Passed 0.02 sec + Start 142: metacall-plugin-extension-test +119/175 Test #141: metacall-ext-test ................................ Passed 0.02 sec + Start 143: metacall-plugin-extension-local-test +120/175 Test #70: metacall-distributable-test ...................... Passed 6.31 sec + Start 144: metacall-backtrace-plugin-test +121/175 Test #135: metacall-wasm-python-port-test ................... Passed 1.07 sec + Start 145: metacall-sandbox-plugin-test +122/175 Test #59: metacall-node-python-async-after-destroy-test .... Passed 7.03 sec + Start 146: log-bench +123/175 Test #75: metacall-integration-test ........................ Passed 6.16 sec + Start 147: metacall-py-c-api-bench +124/175 Test #6: rs_port .......................................... Passed 9.00 sec + Start 148: metacall-py-call-bench +125/175 Test #144: metacall-backtrace-plugin-test ................... Passed 0.45 sec + Start 149: metacall-py-init-bench +126/175 Test #74: metacall-inspect-test ............................ Passed 6.67 sec + Start 150: metacall-node-call-bench +127/175 Test #143: metacall-plugin-extension-local-test ............. Passed 1.52 sec + Start 151: metacall-rb-call-bench +128/175 Test #126: metacall-typescript-tsx-loop-fail-test ........... Passed 3.83 sec + Start 152: metacall-cs-call-bench +129/175 Test #149: metacall-py-init-bench ........................... Passed 0.77 sec + Start 153: metacallcli +130/175 Test #83: metacall-python-open-test ........................ Passed 6.71 sec + Start 154: metacallcli-inspect-leak +131/175 Test #142: metacall-plugin-extension-test ................... Passed 1.99 sec + Start 155: metacallcli-node +132/175 Test #123: metacall-typescript-node-test .................... Passed 4.72 sec + Start 156: metacallcli-node-port-py +133/175 Test #145: metacall-sandbox-plugin-test ..................... Passed 2.02 sec + Start 157: metacallcli-node-port-py-rb +134/175 Test #48: metacall-node-port-test .......................... Passed 9.87 sec + Start 158: metacallcli-node-null +135/175 Test #154: metacallcli-inspect-leak ......................... Passed 0.89 sec + Start 159: metacallcli-node-null-empty +136/175 Test #153: metacallcli ...................................... Passed 1.16 sec + Start 160: metacallcli-node-null-undefined +137/175 Test #133: metacall-java-test ............................... Passed 3.56 sec + Start 161: metacallcli-py-port +138/175 Test #155: metacallcli-node ................................. Passed 1.07 sec + Start 162: metacallcli-py-port-rb +139/175 Test #122: metacall-typescript-test ......................... Passed 5.36 sec + Start 163: metacallcli-file +140/175 Test #159: metacallcli-node-null-empty ...................... Passed 0.69 sec + Start 164: metacallcli-file-fail +141/175 Test #124: metacall-typescript-call-map-test ................ Passed 5.78 sec + Start 165: metacallcli-py-naming +142/175 Test #160: metacallcli-node-null-undefined .................. Passed 0.72 sec + Start 166: metacallcli-py-argv +143/175 Test #130: metacall-csharp-static-class-test ................ Passed 5.12 sec + Start 167: metacallcli-py-main +144/175 Test #128: metacall-typescript-jsx-default-test ............. Passed 5.90 sec + Start 168: metacallcli-py-exception +145/175 Test #163: metacallcli-file ................................. Passed 0.92 sec + Start 169: metacallcli-ts +146/175 Test #158: metacallcli-node-null ............................ Passed 1.45 sec + Start 170: metacallcli-tsx-templating +147/175 Test #157: metacallcli-node-port-py-rb ...................... Passed 1.58 sec + Start 171: metacallcli-tsx-loop-fail +148/175 Test #156: metacallcli-node-port-py ......................... Passed 1.70 sec + Start 172: metacallcli-py-tsx +149/175 Test #164: metacallcli-file-fail ............................ Passed 0.84 sec + Start 173: cli_repl_plugin +150/175 Test #162: metacallcli-py-port-rb ........................... Passed 1.43 sec + Start 174: cli_cmd_plugin +151/175 Test #161: metacallcli-py-port .............................. Passed 1.59 sec + Start 175: metacalllog +152/175 Test #175: metacalllog ...................................... Passed 0.03 sec +153/175 Test #173: cli_repl_plugin .................................. Passed 0.69 sec +154/175 Test #174: cli_cmd_plugin ................................... Passed 0.66 sec +155/175 Test #165: metacallcli-py-naming ............................ Passed 1.70 sec +156/175 Test #166: metacallcli-py-argv .............................. Passed 1.79 sec +157/175 Test #132: metacall-cs-test ................................. Passed 6.45 sec +158/175 Test #168: metacallcli-py-exception ......................... Passed 1.97 sec +159/175 Test #167: metacallcli-py-main .............................. Passed 2.32 sec +160/175 Test #127: metacall-typescript-require-test ................. Passed 8.48 sec +161/175 Test #125: metacall-typescript-tsx-test ..................... Passed 8.86 sec +162/175 Test #1: ts_loader_bootstrap .............................. Passed 15.33 sec +163/175 Test #171: metacallcli-tsx-loop-fail ........................ Passed 4.17 sec +164/175 Test #169: metacallcli-ts ................................... Passed 4.44 sec +165/175 Test #146: log-bench ........................................ Passed 8.61 sec +166/175 Test #172: metacallcli-py-tsx ............................... Passed 6.45 sec +167/175 Test #170: metacallcli-tsx-templating ....................... Passed 6.94 sec +168/175 Test #5: go_port .......................................... Passed 20.72 sec +169/175 Test #147: metacall-py-c-api-bench .......................... Passed 14.79 sec +170/175 Test #69: metacall-node-multithread-deadlock-test .......... Passed 22.96 sec +171/175 Test #152: metacall-cs-call-bench ........................... Passed 25.50 sec +172/175 Test #151: metacall-rb-call-bench ........................... Passed 33.41 sec +173/175 Test #148: metacall-py-call-bench ........................... Passed 34.83 sec +174/175 Test #63: metacall-node-async-resources-test ............... Passed 63.56 sec +175/175 Test #150: metacall-node-call-bench ......................... Passed 90.04 sec + +100% tests passed, 0 tests failed out of 175 + +Label Time Summary: +/usr/local/metacall/build/scripts/typedfunc = 28.42 sec*proc (5 tests) +MEMCHECK_IGNORE = 35.41 sec*proc (7 tests) +WORKING_DIRECTORY = 28.42 sec*proc (5 tests) +adt-map-test = 0.03 sec*proc (1 test) +adt-set-test = 0.03 sec*proc (1 test) +adt-trie-test = 0.03 sec*proc (1 test) +adt-vector-test = 0.03 sec*proc (1 test) +configuration-test = 0.07 sec*proc (1 test) +detour-test = 0.08 sec*proc (1 test) +dynlink-test = 0.02 sec*proc (1 test) +environment-test = 0.03 sec*proc (1 test) +go_port = 20.72 sec*proc (1 test) +log-bench = 8.61 sec*proc (1 test) +log-custom-test = 0.03 sec*proc (1 test) +log-test = 0.03 sec*proc (1 test) +metacall-backtrace-plugin-test = 0.45 sec*proc (1 test) +metacall-c-lib-test = 0.19 sec*proc (1 test) +metacall-c-test = 0.15 sec*proc (1 test) +metacall-callback-complex-test = 2.28 sec*proc (1 test) +metacall-cast-test = 0.58 sec*proc (1 test) +metacall-clear-test = 0.98 sec*proc (1 test) +metacall-cobol-test = 0.04 sec*proc (1 test) +metacall-configuration-default-test = 0.02 sec*proc (1 test) +metacall-configuration-exec-path-test = 0.56 sec*proc (1 test) +metacall-cs-call-bench = 25.50 sec*proc (1 test) +metacall-cs-test = 6.45 sec*proc (1 test) +metacall-csharp-static-class-test = 5.12 sec*proc (1 test) +metacall-depends-test = 0.65 sec*proc (1 test) +metacall-distributable-test = 6.31 sec*proc (1 test) +metacall-ducktype-test = 0.54 sec*proc (1 test) +metacall-duplicated-handle-test = 1.56 sec*proc (1 test) +metacall-duplicated-symbols-test = 1.06 sec*proc (1 test) +metacall-dynlink-path-test = 0.01 sec*proc (1 test) +metacall-ext-test = 0.02 sec*proc (1 test) +metacall-file-fail-test = 0.01 sec*proc (1 test) +metacall-file-glob-test = 0.03 sec*proc (1 test) +metacall-file-test = 0.02 sec*proc (1 test) +metacall-fork-test = 0.06 sec*proc (1 test) +metacall-function-test = 1.21 sec*proc (1 test) +metacall-handle-export-test = 1.40 sec*proc (1 test) +metacall-handle-get-test = 1.52 sec*proc (1 test) +metacall-init-fini-test = 0.74 sec*proc (1 test) +metacall-initialize-destroy-multiple-node-test = 0.41 sec*proc (1 test) +metacall-initialize-destroy-multiple-test = 0.02 sec*proc (1 test) +metacall-initialize-ex-test = 0.01 sec*proc (1 test) +metacall-initialize-test = 0.05 sec*proc (1 test) +metacall-inspect-test = 6.67 sec*proc (1 test) +metacall-integration-test = 6.16 sec*proc (1 test) +metacall-invalid-loader-test = 0.02 sec*proc (1 test) +metacall-java-test = 3.56 sec*proc (1 test) +metacall-library-path-without-env-vars-test = 0.02 sec*proc (1 test) +metacall-load-configuration-fail-test = 0.66 sec*proc (1 test) +metacall-load-configuration-node-python-test = 1.52 sec*proc (1 test) +metacall-load-configuration-python-node-test = 1.37 sec*proc (1 test) +metacall-load-configuration-relative-test = 0.46 sec*proc (1 test) +metacall-load-configuration-test = 1.51 sec*proc (1 test) +metacall-load-memory-empty-test = 2.70 sec*proc (1 test) +metacall-load-memory-test = 0.72 sec*proc (1 test) +metacall-logs-test = 0.33 sec*proc (1 test) +metacall-map-await-test = 0.55 sec*proc (1 test) +metacall-map-test = 1.51 sec*proc (1 test) +metacall-node-async-multiple-test = 4.26 sec*proc (1 test) +metacall-node-async-resources-test = 63.56 sec*proc (1 test) +metacall-node-async-test = 0.69 sec*proc (1 test) +metacall-node-await-chain-test = 0.51 sec*proc (1 test) +metacall-node-call-bench = 90.04 sec*proc (1 test) +metacall-node-call-test = 1.36 sec*proc (1 test) +metacall-node-callback-test = 0.89 sec*proc (1 test) +metacall-node-clear-mem-test = 0.42 sec*proc (1 test) +metacall-node-event-loop-signal-test = 0.62 sec*proc (1 test) +metacall-node-event-loop-test = 5.86 sec*proc (1 test) +metacall-node-exception-test = 0.51 sec*proc (1 test) +metacall-node-extension-test = 0.40 sec*proc (1 test) +metacall-node-fail-env-var-test = 0.35 sec*proc (1 test) +metacall-node-fail-load-leak-test = 0.55 sec*proc (1 test) +metacall-node-fail-test = 0.60 sec*proc (1 test) +metacall-node-inline-test = 0.87 sec*proc (1 test) +metacall-node-multithread-deadlock-test = 22.96 sec*proc (1 test) +metacall-node-native-code-test = 0.52 sec*proc (1 test) +metacall-node-port-await-test = 0.86 sec*proc (1 test) +metacall-node-port-c-lib-test = 0.85 sec*proc (1 test) +metacall-node-port-test = 9.87 sec*proc (1 test) +metacall-node-python-async-after-destroy-test = 7.03 sec*proc (1 test) +metacall-node-python-await-test = 0.92 sec*proc (1 test) +metacall-node-python-deadlock-test = 1.25 sec*proc (1 test) +metacall-node-python-exception-test = 0.97 sec*proc (1 test) +metacall-node-python-port-mock-test = 1.13 sec*proc (1 test) +metacall-node-python-port-ruby-test = 1.04 sec*proc (1 test) +metacall-node-python-ruby-test = 2.00 sec*proc (1 test) +metacall-node-reentrant-test = 0.66 sec*proc (1 test) +metacall-node-test = 0.77 sec*proc (1 test) +metacall-node-typescript-test = 4.07 sec*proc (1 test) +metacall-plugin-extension-local-test = 1.52 sec*proc (1 test) +metacall-plugin-extension-test = 1.99 sec*proc (1 test) +metacall-py-c-api-bench = 14.79 sec*proc (1 test) +metacall-py-call-bench = 34.83 sec*proc (1 test) +metacall-py-init-bench = 0.77 sec*proc (1 test) +metacall-python-builtins-test = 0.74 sec*proc (1 test) +metacall-python-callback-test = 1.21 sec*proc (1 test) +metacall-python-dict-test = 0.68 sec*proc (1 test) +metacall-python-exception-test = 0.62 sec*proc (1 test) +metacall-python-fail-test = 0.67 sec*proc (1 test) +metacall-python-gc-test = 0.76 sec*proc (1 test) +metacall-python-object-class-test = 0.65 sec*proc (1 test) +metacall-python-open-test = 6.71 sec*proc (1 test) +metacall-python-pointer-test = 0.57 sec*proc (1 test) +metacall-python-port-callback-test = 0.80 sec*proc (1 test) +metacall-python-port-https-test = 1.28 sec*proc (1 test) +metacall-python-port-import-test = 2.49 sec*proc (1 test) +metacall-python-port-pointer-test = 0.97 sec*proc (1 test) +metacall-python-reentrant-test = 1.09 sec*proc (1 test) +metacall-python-relative-path-test = 0.64 sec*proc (1 test) +metacall-python-test = 1.01 sec*proc (1 test) +metacall-python-varargs-test = 0.86 sec*proc (1 test) +metacall-python-without-env-vars-test = 0.70 sec*proc (1 test) +metacall-python-without-functions-test = 0.65 sec*proc (1 test) +metacall-rb-call-bench = 33.41 sec*proc (1 test) +metacall-reinitialize-test = 0.14 sec*proc (1 test) +metacall-reload-functions-test = 1.82 sec*proc (1 test) +metacall-return-monad-test = 0.49 sec*proc (1 test) +metacall-rpc-test = 1.13 sec*proc (1 test) +metacall-ruby-fail-empty-test = 0.08 sec*proc (1 test) +metacall-ruby-fail-test = 0.06 sec*proc (1 test) +metacall-ruby-object-class-test = 0.04 sec*proc (1 test) +metacall-ruby-parser-integration-test = 0.04 sec*proc (1 test) +metacall-ruby-test = 0.12 sec*proc (1 test) +metacall-sandbox-plugin-test = 2.02 sec*proc (1 test) +metacall-test = 7.34 sec*proc (1 test) +metacall-typescript-call-map-test = 5.78 sec*proc (1 test) +metacall-typescript-jsx-default-test = 5.90 sec*proc (1 test) +metacall-typescript-node-test = 4.72 sec*proc (1 test) +metacall-typescript-require-test = 8.48 sec*proc (1 test) +metacall-typescript-test = 5.36 sec*proc (1 test) +metacall-typescript-tsx-loop-fail-test = 3.83 sec*proc (1 test) +metacall-typescript-tsx-test = 8.86 sec*proc (1 test) +metacall-version-test = 0.01 sec*proc (1 test) +metacall-wasm-python-port-test = 1.07 sec*proc (1 test) +metacall-wasm-test = 0.10 sec*proc (1 test) +metacallcli = 1.16 sec*proc (1 test) +metacallcli-file = 0.92 sec*proc (1 test) +metacallcli-file-fail = 0.84 sec*proc (1 test) +metacallcli-inspect-leak = 0.89 sec*proc (1 test) +metacallcli-node = 1.07 sec*proc (1 test) +metacallcli-node-null = 1.45 sec*proc (1 test) +metacallcli-node-null-empty = 0.69 sec*proc (1 test) +metacallcli-node-null-undefined = 0.72 sec*proc (1 test) +metacallcli-node-port-py = 1.70 sec*proc (1 test) +metacallcli-node-port-py-rb = 1.58 sec*proc (1 test) +metacallcli-py-argv = 1.79 sec*proc (1 test) +metacallcli-py-exception = 1.97 sec*proc (1 test) +metacallcli-py-main = 2.32 sec*proc (1 test) +metacallcli-py-naming = 1.70 sec*proc (1 test) +metacallcli-py-port = 1.59 sec*proc (1 test) +metacallcli-py-port-rb = 1.43 sec*proc (1 test) +metacallcli-py-tsx = 6.45 sec*proc (1 test) +metacallcli-ts = 4.44 sec*proc (1 test) +metacallcli-tsx-loop-fail = 4.17 sec*proc (1 test) +metacallcli-tsx-templating = 6.94 sec*proc (1 test) +metacalllog = 0.03 sec*proc (1 test) +node_port_test = 5.42 sec*proc (1 test) +node_port_test_executable = 5.50 sec*proc (1 test) +portability-path-test = 0.06 sec*proc (1 test) +preprocessor-test = 0.04 sec*proc (1 test) +py-loader-port-test = 0.91 sec*proc (1 test) +py_port_test = 1.72 sec*proc (1 test) +rb-loader-parser-test = 0.06 sec*proc (1 test) +rb_port_test = 0.90 sec*proc (1 test) +reflect-function-test = 0.02 sec*proc (1 test) +reflect-metadata-test = 0.02 sec*proc (1 test) +reflect-object-class-test = 0.02 sec*proc (1 test) +reflect-scope-test = 0.02 sec*proc (1 test) +reflect-value-cast-test = 0.02 sec*proc (1 test) +rs_port = 9.00 sec*proc (1 test) +serial-test = 0.07 sec*proc (1 test) +ts_loader_bootstrap = 15.33 sec*proc (1 test) + +Total Test time (real) = 99.30 sec ++ [ 0 = 1 ] ++ [ 1 = 1 ] ++ [ = ] ++ make install +[ 0%] Built target version +[ 0%] Built target preprocessor +[ 1%] Built target environment +[ 1%] Built target format +[ 1%] Built target threading +[ 2%] Built target portability +[ 6%] Built target log +[ 6%] Built target memory +[ 7%] Built target adt +[ 8%] Built target filesystem +[ 9%] Built target dynlink +[ 10%] Built target plugin +[ 10%] Built target detour +[ 13%] Built target reflect +[ 13%] Built target serial +[ 14%] Built target configuration +[ 14%] Built target loader +[ 29%] Built target metacall +[ 30%] Built target libtcc-depends +[ 30%] Built target c_loader +[ 30%] Built target cob_loader + Determining projects to restore... + All projects are up-to-date for restore. +MSBuild version 17.7.6+77d58ec69 for .NET + Determining projects to restore... + All projects are up-to-date for restore. + project -> /usr/local/metacall/source/loaders/cs_loader/netcore/source/bin/Debug/net7.0/CSLoader.dll + project -> /usr/local/metacall/build/ +[ 30%] Built target cs_loader_impl +[ 31%] Built target cs_loader +[ 32%] Built target ext_loader +[ 32%] Built target file_loader +Note: /usr/local/metacall/source/loaders/java_loader/bootstrap/lib/bootstrap.java uses or overrides a deprecated API. +Note: Recompile with -Xlint:deprecation for details. +[ 32%] Built target java_loader_bootstrap +[ 33%] Built target java_loader +[ 33%] Built target mock_loader +Installing node_loader_bootstrap dependencies + +up to date, audited 5 packages in 437ms + +1 package is looking for funding + run `npm fund` for details + +found 0 vulnerabilities +[ 33%] Built target node_loader_bootstrap_depends +Copying node_loader_bootstrap dependencies +node_loader_bootstrap dependencies copied from /usr/local/metacall/source/loaders/node_loader/bootstrap/node_modules to /usr/local/metacall/build/node_modules +[ 33%] Built target node_loader_bootstrap_copy_depends +[ 33%] Built target node_loader_bootstrap +[ 34%] Built target node_loader +[ 35%] Built target py_loader +[ 35%] Built target rb_loader +[ 36%] Built target rpc_loader +Installing ts_loader_bootstrap dependencies + +up to date, audited 3 packages in 1s + +found 0 vulnerabilities +[ 36%] Built target ts_loader_bootstrap_depends + +> ts_loader_bootstrap@1.1.0 build +> tsc + +[ 36%] Built target ts_loader_bootstrap_build +Copying ts_loader_bootstrap dependencies +ts_loader_bootstrap dependencies copied from /usr/local/metacall/source/loaders/ts_loader/bootstrap/node_modules to /usr/local/metacall/build/node_modules +[ 36%] Built target ts_loader_bootstrap +[ 37%] Built target ts_loader +[ 38%] Built target wasm_loader +[ 39%] Built target metacall_serial +[ 39%] Built target rapid_json_serial +[ 39%] Built target plthook_detour +[ 39%] Built target plugin_extension +[ 39%] Built target backtrace_plugin_config +[ 39%] Built target backtrace_plugin +[ 39%] Built target backward_object +[ 40%] Built target backward +[ 40%] Built target sandbox_plugin_config +[ 40%] Built target sandbox_plugin +Installing node_port + +up to date, audited 81 packages in 722ms + +20 packages are looking for funding + run `npm fund` for details + +3 moderate severity vulnerabilities + +To address all issues (including breaking changes), run: + npm audit fix --force + +Run `npm audit` for details. +[ 40%] Built target node_port +Failed to run rustfmt: No such file or directory (os error 2) (non-fatal, continuing) +[ 40%] Built target rs_port_bindings + Compiling metacall v0.4.2 (/usr/local/metacall/source/ports/rs_port) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s +[ 40%] Built target rs_port +[ 41%] Built target rb_port_swig_compilation +[ 41%] Built target rb_port +[ 41%] Built target c-compiled +[ 41%] Built target c-ffi +[ 41%] Built target c-cbks +[ 41%] Built target c-loadtest +[ 42%] Built target loadtest +[ 42%] Built target cobol-say +[ 42%] Built target csharp-hello +[ 42%] Built target csharp-static +[ 42%] Built target csharp-function +[ 43%] Built target sum_extension +[ 43%] Built target file-static +[ 43%] Built target file-favicon +[ 43%] Built target file-glob +[ 43%] Built target java-fibonnaci +[ 43%] Built target java-jartest +[ 43%] Built target java-test +[ 43%] Built target nodejs-nod +[ 43%] Built target nodejs-inline +[ 43%] Built target nodejs-export +[ 43%] Built target nodejs-host +[ 43%] Built target nodejs-server +[ 43%] Built target nodejs-factcallback +[ 43%] Built target nodejs-derpyramda + +up to date, audited 49 packages in 608ms + +1 moderate severity vulnerability + +To address all issues, run: + npm audit fix + +Run `npm audit` for details. +[ 43%] Built target nodejs-gram-depends +[ 43%] Built target nodejs-gram +[ 43%] Built target nodejs-duplicated + +up to date, audited 2 packages in 434ms + +found 0 vulnerabilities +[ 43%] Built target nodejs-ramda-depends +[ 43%] Built target nodejs-ramda +[ 43%] Built target python-example +[ 43%] Built target python-helloworld +[ 43%] Built target python-initfini +[ 43%] Built target python-callback +[ 43%] Built target python-function +[ 43%] Built target python-ducktype +[ 43%] Built target python-rsasample +[ 43%] Built target python-garbage +[ 43%] Built target python-classname +[ 43%] Built target python-web +[ 43%] Built target python-landing +[ 43%] Built target python-model +[ 43%] Built target python-pointer +[ 43%] Built target python-dicty +[ 43%] Built target python-host +[ 43%] Built target python-s1 +[ 43%] Built target python-s2 +[ 43%] Built target python-withoutfunctions +[ 43%] Built target python-wasm +[ 43%] Built target python-badimport +[ 43%] Built target python-watzon +[ 43%] Built target python-fnmesh +[ 43%] Built target ruby-hello +[ 43%] Built target ruby-second +[ 43%] Built target ruby-blog +[ 43%] Built target ruby-cache +[ 43%] Built target ruby-ducktype +[ 43%] Built target ruby-invalid +[ 43%] Built target ruby-klass +[ 43%] Built target ruby-failempty +[ 43%] Built target rpc-remote +[ 43%] Built target typescript-typedfunc + +up to date, audited 7 packages in 477ms + +found 0 vulnerabilities +[ 43%] Built target typescript-templating-depends +[ 43%] Built target typescript-templating +[ 43%] Built target typescript-loopfail +[ 43%] Built target typescript-badrequire +[ 43%] Built target typescript-server +[ 43%] Built target wasm-tests +[ 44%] Built target google-test-depends +[ 44%] Built target preprocessor-test +[ 44%] Built target environment-test +[ 45%] Built target log-test +[ 45%] Built target log-custom-test +[ 45%] Built target adt-set-test +[ 46%] Built target adt-trie-test +[ 46%] Built target adt-vector-test +[ 46%] Built target adt-map-test +[ 47%] Built target reflect-value-cast-test +[ 47%] Built target reflect-function-test +[ 48%] Built target reflect-object-class-test +[ 48%] Built target reflect-scope-test +[ 48%] Built target reflect-metadata-test +[ 48%] Built target dynlink-test +[ 48%] Built target detour-test +[ 48%] Built target serial-test +[ 48%] Built target configuration-test +[ 49%] Built target rb-loader-parser-test +[ 50%] Built target portability-path-test +[ 51%] Built target metacall-logs-test +[ 51%] Built target metacall-load-memory-test +[ 51%] Built target metacall-load-memory-empty-test +[ 52%] Built target metacall-load-configuration-test +[ 52%] Built target metacall-load-configuration-fail-test +[ 52%] Built target metacall-load-configuration-relative-test +[ 53%] Built target metacall-load-configuration-python-node-test +[ 53%] Built target metacall-load-configuration-node-python-test +[ 53%] Built target metacall-duplicated-handle-test +[ 53%] Built target metacall-duplicated-symbols-test +[ 53%] Built target metacall-handle-export-test +[ 54%] Built target metacall-handle-get-test +[ 55%] Built target metacall-test +[ 56%] Built target metacall-node-test +[ 56%] Built target metacall-node-event-loop-test +[ 57%] Built target metacall-node-event-loop-signal-test +[ 58%] Built target metacall-node-call-test +[ 58%] Built target metacall-node-inline-test +[ 59%] Built target metacall-node-async-test +[ 60%] Built target metacall-node-async-multiple-test +[ 60%] Built target metacall-node-reentrant-test +[ 60%] Built target metacall-node-port-test +[ 61%] Built target metacall-node-port-await-test +[ 61%] Built target metacall-node-port-c-lib-test +[ 61%] Built target metacall-node-python-port-mock-test +[ 62%] Built target metacall-node-python-port-ruby-test +[ 62%] Built target metacall-node-python-ruby-test +[ 62%] Built target metacall-node-callback-test +[ 62%] Built target metacall-node-fail-test +[ 62%] Built target metacall-node-fail-env-var-test +[ 63%] Built target metacall-node-fail-load-leak-test +[ 63%] Built target metacall-node-typescript-test +[ 64%] Built target metacall-node-python-async-after-destroy-test +[ 64%] Built target metacall-node-python-await-test +[ 65%] Built target metacall-node-python-exception-test +[ 65%] Built target metacall-node-clear-mem-test +[ 65%] Built target metacall-node-async-resources-test +[ 65%] Built target metacall-node-await-chain-test +[ 66%] Built target metacall-node-exception-test +[ 66%] Built target metacall-node-python-deadlock-test +[ 66%] Built target metacall-node-native-code-test +[ 66%] Built target node_extension_test +[ 66%] Built target metacall-node-extension-test +[ 67%] Built target metacall-node-multithread-deadlock-test +[ 67%] Built target metacall-distributable-test +[ 68%] Built target metacall-cast-test +[ 68%] Built target metacall-init-fini-test +[ 69%] Built target metacall-ducktype-test +[ 69%] Built target metacall-inspect-test +[ 70%] Built target metacall-integration-test +[ 71%] Built target metacall-depends-test +[ 71%] Built target metacall-configuration-exec-path-test +[ 71%] Built target metacall-configuration-default-test +[ 71%] Built target metacall-clear-test +[ 71%] Built target metacall-python-test +[ 72%] Built target metacall-python-object-class-test +[ 72%] Built target metacall-python-gc-test + +up to date, audited 16 packages in 514ms + +1 package is looking for funding + run `npm fund` for details + +found 0 vulnerabilities +[ 72%] Built target metacall-python-open-test-depends +[ 72%] Built target metacall-python-open-test +[ 72%] Built target metacall-python-dict-test +[ 72%] Built target metacall-python-pointer-test +[ 72%] Built target metacall-python-reentrant-test +[ 72%] Built target metacall-python-varargs-test +[ 73%] Built target py-loader-port-test +[ 73%] Built target metacall-python-port-https-test +[ 74%] Built target metacall-python-port-callback-test +[ 74%] Built target metacall-python-port-pointer-test +[ 75%] Built target metacall-python-port-import-test +[ 76%] Built target metacall-python-callback-test +[ 76%] Built target metacall-python-fail-test +[ 77%] Built target metacall-python-relative-path-test +[ 77%] Built target metacall-python-without-functions-test +[ 77%] Built target metacall-python-builtins-test +[ 77%] Built target metacall-python-async-test +[ 78%] Built target metacall-python-exception-test +[ 79%] Built target metacall-python-without-env-vars-test +[ 79%] Built target metacall-map-test +[ 79%] Built target metacall-map-await-test +[ 80%] Built target metacall-initialize-test +[ 80%] Built target metacall-initialize-ex-test +[ 81%] Built target metacall-reinitialize-test +[ 81%] Built target metacall-initialize-destroy-multiple-test +[ 82%] Built target metacall-initialize-destroy-multiple-node-test +[ 82%] Built target metacall-reload-functions-test +[ 82%] Built target metacall-invalid-loader-test +[ 83%] Built target metacall-fork-test +[ 84%] Built target metacall-return-monad-test +[ 84%] Built target metacall-callback-complex-test +[ 85%] Built target metacall-ruby-fail-test +[ 85%] Built target metacall-ruby-fail-empty-test +[ 85%] Built target metacall-ruby-object-class-test +[ 85%] Built target metacall-ruby-parser-integration-test +[ 85%] Built target metacall-function-test +[ 86%] Built target metacall-cobol-test +[ 86%] Built target metacall-file-test +[ 86%] Built target metacall-file-fail-test +[ 87%] Built target metacall-file-glob-test +[ 88%] Built target metacall-typescript-test +[ 89%] Built target metacall-typescript-node-test +[ 89%] Built target metacall-typescript-call-map-test +[ 89%] Built target metacall-typescript-tsx-test +[ 89%] Built target metacall-typescript-tsx-loop-fail-test +[ 89%] Built target metacall-typescript-require-test +[ 89%] Built target metacall-typescript-jsx-default-test +[ 89%] Built target metacall-rpc-test +[ 89%] Built target metacall-csharp-static-class-test +[ 90%] Built target metacall-ruby-test +[ 90%] Built target metacall-cs-test +[ 90%] Built target metacall-java-test +[ 90%] Built target metacall-wasm-test +[ 90%] Built target metacall-wasm-python-port-test +[ 90%] Built target metacall-c-test +[ 91%] Built target metacall-c-lib-test +[ 92%] Built target metacall-version-test +[ 93%] Built target metacall-dynlink-path-test +[ 94%] Built target metacall-library-path-without-env-vars-test +[ 94%] Built target metacall-ext-test +[ 95%] Built target metacall-plugin-extension-test +[ 95%] Built target metacall-plugin-extension-local-test +[ 95%] Built target metacall-backtrace-plugin-test +[ 95%] Built target metacall-sandbox-plugin-test +[ 96%] Built target google-bench-depends +[ 96%] Built target log-bench +[ 96%] Built target metacall-py-c-api-bench +[ 96%] Built target metacall-py-call-bench +[ 97%] Built target metacall-py-init-bench +[ 97%] Built target metacall-node-call-bench +[ 97%] Built target metacall-rb-call-bench +[ 98%] Built target metacall-cs-call-bench +[ 98%] Built target cli_repl_plugin +[ 98%] Built target cli_core_plugin +[ 98%] Built target metacallcli-scripts-tests +[ 98%] Built target metacallcli +[ 98%] Built target cli_core_plugin_config +[ 98%] Built target cli_cmd_plugin +[ 99%] Built target cli_sandbox_plugin +[ 99%] Built target cli_sandbox_plugin_config +[100%] Built target metacalllog +Install the project... +-- Install configuration: "Debug" +-- Installing: /usr/local/share/metacall/configurations +-- Installing: /usr/local/share/metacall/configurations/cs_loader.json +-- Installing: /usr/local/share/metacall/configurations/node_loader.json +-- Installing: /usr/local/share/metacall/configurations/global.json +-- Installing: /usr/local/include/metacall +-- Installing: /usr/local/include/metacall/metacall_link.h +-- Installing: /usr/local/include/metacall/metacall_allocator.h +-- Installing: /usr/local/include/metacall/metacall.h +-- Installing: /usr/local/include/metacall/metacall_value.h +-- Installing: /usr/local/include/metacall/metacall_fork.h +-- Installing: /usr/local/include/metacall/metacall_log.h +-- Installing: /usr/local/include/metacall/metacall_error.h +-- Up-to-date: /usr/local/include/metacall +-- Installing: /usr/local/include/metacall/metacall_def.h +-- Installing: /usr/local/include/metacall/metacall_api.h +-- Installing: /usr/local/lib/libmetacalld.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libmetacalld.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/libtcc.so +-- Up-to-date: /usr/local/lib +-- Installing: /usr/local/lib/libtcc1.a +-- Installing: /usr/local/lib/runmain.o +-- Installing: /usr/local/lib/bcheck.o +-- Installing: /usr/local/lib/bt-log.o +-- Installing: /usr/local/lib/bt-exe.o +-- Up-to-date: /usr/local/include +-- Installing: /usr/local/include/stdatomic.h +-- Installing: /usr/local/include/tccdefs.h +-- Installing: /usr/local/include/stddef.h +-- Installing: /usr/local/include/varargs.h +-- Installing: /usr/local/include/tcclib.h +-- Installing: /usr/local/include/stdnoreturn.h +-- Installing: /usr/local/include/stdarg.h +-- Installing: /usr/local/include/stdbool.h +-- Installing: /usr/local/include/stdalign.h +-- Installing: /usr/local/include/tgmath.h +-- Installing: /usr/local/include/float.h +-- Installing: /usr/local/lib/libc_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libc_loaderd.so" to "/usr/local/lib:/usr/lib/llvm-14/lib" +-- Installing: /usr/local/lib/libcob_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libcob_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/CSLoader.dll +-- Installing: /usr/local/lib/Microsoft.CodeAnalysis.dll +-- Installing: /usr/local/lib/Microsoft.CodeAnalysis.CSharp.dll +-- Installing: /usr/local/lib/libcs_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libcs_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/libext_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libext_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/libfile_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libfile_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/bootstrap.class +-- Installing: /usr/local/lib/libjava_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libjava_loaderd.so" to "/usr/local/lib:/usr/lib/jvm/default-java/lib:/usr/lib/jvm/default-java/lib/server" +-- Installing: /usr/local/lib/libmock_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libmock_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/node_modules/espree +-- Installing: /usr/local/lib/node_modules/espree/dist +-- Installing: /usr/local/lib/node_modules/espree/dist/espree.cjs +-- Installing: /usr/local/lib/node_modules/espree/espree.js +-- Installing: /usr/local/lib/node_modules/espree/package.json +-- Installing: /usr/local/lib/node_modules/espree/LICENSE +-- Installing: /usr/local/lib/node_modules/espree/lib +-- Installing: /usr/local/lib/node_modules/espree/lib/espree.js +-- Installing: /usr/local/lib/node_modules/espree/lib/options.js +-- Installing: /usr/local/lib/node_modules/espree/lib/version.js +-- Installing: /usr/local/lib/node_modules/espree/lib/token-translator.js +-- Installing: /usr/local/lib/node_modules/espree/lib/features.js +-- Installing: /usr/local/lib/node_modules/espree/README.md +-- Installing: /usr/local/lib/node_modules/acorn +-- Installing: /usr/local/lib/node_modules/acorn/dist +-- Installing: /usr/local/lib/node_modules/acorn/dist/acorn.mjs.d.ts +-- Installing: /usr/local/lib/node_modules/acorn/dist/acorn.d.ts +-- Installing: /usr/local/lib/node_modules/acorn/dist/acorn.mjs +-- Installing: /usr/local/lib/node_modules/acorn/dist/acorn.js +-- Installing: /usr/local/lib/node_modules/acorn/dist/bin.js +-- Installing: /usr/local/lib/node_modules/acorn/bin +-- Installing: /usr/local/lib/node_modules/acorn/bin/acorn +-- Installing: /usr/local/lib/node_modules/acorn/CHANGELOG.md +-- Installing: /usr/local/lib/node_modules/acorn/package.json +-- Installing: /usr/local/lib/node_modules/acorn/LICENSE +-- Installing: /usr/local/lib/node_modules/acorn/README.md +-- Installing: /usr/local/lib/node_modules/acorn-jsx +-- Installing: /usr/local/lib/node_modules/acorn-jsx/xhtml.js +-- Installing: /usr/local/lib/node_modules/acorn-jsx/index.js +-- Installing: /usr/local/lib/node_modules/acorn-jsx/package.json +-- Installing: /usr/local/lib/node_modules/acorn-jsx/index.d.ts +-- Installing: /usr/local/lib/node_modules/acorn-jsx/LICENSE +-- Installing: /usr/local/lib/node_modules/acorn-jsx/README.md +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/dist +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/dist/index.d.ts +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/package.json +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/LICENSE +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/lib +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/lib/visitor-keys.js +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/lib/index.js +-- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/README.md +-- Installing: /usr/local/lib/bootstrap.js +-- Installing: /usr/local/lib/libnode_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libnode_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/libpy_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libpy_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/librb_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/librb_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/librpc_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/librpc_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/node_modules/typescript +-- Installing: /usr/local/lib/node_modules/typescript/CODE_OF_CONDUCT.md +-- Installing: /usr/local/lib/node_modules/typescript/LICENSE.txt +-- Installing: /usr/local/lib/node_modules/typescript/bin +-- Installing: /usr/local/lib/node_modules/typescript/bin/tsserver +-- Installing: /usr/local/lib/node_modules/typescript/bin/tsc +-- Installing: /usr/local/lib/node_modules/typescript/CopyrightNotice.txt +-- Installing: /usr/local/lib/node_modules/typescript/loc +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptLanguageService +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/Targets +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/Targets/TypeScriptCompile.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/Targets/ProjectItemsSchema.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/Targets/TypeScriptProjectProperties.xaml.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptTasks +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptTasks/TypeScript.Tasks.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptDebugEngine +-- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl +-- Installing: /usr/local/lib/node_modules/typescript/AUTHORS.md +-- Installing: /usr/local/lib/node_modules/typescript/ThirdPartyNoticeText.txt +-- Installing: /usr/local/lib/node_modules/typescript/package.json +-- Installing: /usr/local/lib/node_modules/typescript/lib +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.intl.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es5.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.object.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.collection.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/typescriptServices.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/tsserverlibrary.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/cs +-- Installing: /usr/local/lib/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.core.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/typesMap.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.symbol.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/tr +-- Installing: /usr/local/lib/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.promise.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/ko +-- Installing: /usr/local/lib/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/es +-- Installing: /usr/local/lib/node_modules/typescript/lib/es/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.string.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.weakref.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.scripthost.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/typescript.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.full.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.reflect.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/protocol.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.promise.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.full.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.string.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.webworker.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/pl +-- Installing: /usr/local/lib/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/fr +-- Installing: /usr/local/lib/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.generator.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.string.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.full.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/typescript.js +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/cancellationToken.js +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/tsserverlibrary.js +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.webworker.iterable.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/ja +-- Installing: /usr/local/lib/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.regexp.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.full.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.intl.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/pt-br +-- Installing: /usr/local/lib/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.intl.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/zh-tw +-- Installing: /usr/local/lib/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2016.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.object.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/tsserver.js +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2016.array.include.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/de +-- Installing: /usr/local/lib/node_modules/typescript/lib/de/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.intl.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.dom.iterable.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/typescriptServices.js +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.string.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.dom.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/watchGuard.js +-- Installing: /usr/local/lib/node_modules/typescript/lib/zh-cn +-- Installing: /usr/local/lib/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/ru +-- Installing: /usr/local/lib/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.symbol.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/typingsInstaller.js +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.promise.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.promise.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/README.md +-- Installing: /usr/local/lib/node_modules/typescript/lib/it +-- Installing: /usr/local/lib/node_modules/typescript/lib/it/diagnosticMessages.generated.json +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2016.full.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.array.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.bigint.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.full.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/tsc.js +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.proxy.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es6.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.d.ts +-- Installing: /usr/local/lib/node_modules/typescript/README.md +-- Installing: /usr/local/lib/bootstrap.ts +-- Installing: /usr/local/lib/libts_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libts_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/libwasm_loaderd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libwasm_loaderd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/libwasmtime.so +-- Installing: /usr/local/lib/libmetacall_seriald.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libmetacall_seriald.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/librapid_json_seriald.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/librapid_json_seriald.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/libplthook_detourd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libplthook_detourd.so" to "/usr/local/lib" +-- Installing: /usr/local/lib/libplugin_extensiond.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/libplugin_extensiond.so" to "/usr/local/lib" +-- Installing: /usr/local/include/backward.hpp +-- Installing: /usr/local/lib/backward/BackwardConfig.cmake +-- Installing: /usr/local/lib/plugins +-- Installing: /usr/local/lib/plugins/backtrace_plugin +-- Installing: /usr/local/lib/plugins/backtrace_plugin/libbacktrace_plugind.so +-- Installing: /usr/local/lib/plugins/backtrace_plugin/metacall.json +-- Installing: /usr/local/lib/plugins/cli +-- Installing: /usr/local/lib/plugins/cli/cmd +-- Installing: /usr/local/lib/plugins/cli/cmd/cli_sandbox_plugin +-- Installing: /usr/local/lib/plugins/cli/cmd/cli_sandbox_plugin/libcli_sandbox_plugind.so +-- Installing: /usr/local/lib/plugins/cli/cmd/cli_sandbox_plugin/metacall.json +-- Installing: /usr/local/lib/plugins/cli/internal +-- Installing: /usr/local/lib/plugins/cli/internal/cli_repl_plugin +-- Installing: /usr/local/lib/plugins/cli/internal/cli_repl_plugin/cli_repl_plugin.js +-- Installing: /usr/local/lib/plugins/cli/internal/cli_repl_plugin/parser.js +-- Installing: /usr/local/lib/plugins/cli/internal/cli_repl_plugin/metacall.json +-- Installing: /usr/local/lib/plugins/cli/internal/cli_cmd_plugin +-- Installing: /usr/local/lib/plugins/cli/internal/cli_cmd_plugin/cli_cmd_plugin.js +-- Installing: /usr/local/lib/plugins/cli/internal/cli_cmd_plugin/metacall.json +-- Installing: /usr/local/lib/plugins/cli/repl +-- Installing: /usr/local/lib/plugins/cli/repl/cli_core_plugin +-- Installing: /usr/local/lib/plugins/cli/repl/cli_core_plugin/libcli_core_plugind.so +-- Installing: /usr/local/lib/plugins/cli/repl/cli_core_plugin/cli_core_plugin_repl.js +-- Installing: /usr/local/lib/plugins/cli/repl/cli_core_plugin/metacall.json +-- Installing: /usr/local/lib/plugins/sandbox_plugin +-- Installing: /usr/local/lib/plugins/sandbox_plugin/libsandbox_plugind.so +-- Installing: /usr/local/lib/plugins/sandbox_plugin/metacall.json +-- Installing: /usr/local/lib/node_modules/metacall/index.js +-- Installing: /usr/local/lib/node_modules/metacall/index.d.ts +-- Installing: /usr/local/lib/node_modules/metacall/package.json +-- Installing: /usr/local/lib/node_modules/metacall/package-lock.json +-- Installing: /usr/local/lib/node_modules/metacall/LICENSE +Processing /usr/local/metacall/source/ports/py_port + Preparing metadata (setup.py): started + Preparing metadata (setup.py): finished with status 'done' +Building wheels for collected packages: metacall + Building wheel for metacall (setup.py): started + Building wheel for metacall (setup.py): finished with status 'done' + Created wheel for metacall: filename=metacall-0.5.1-py2.py3-none-any.whl size=14061 sha256=015f92f2fa3cc2bc911cd45a282a12c381d25ca1c498f99098a4a30018c24e84 + Stored in directory: /tmp/pip-ephem-wheel-cache-a3n0sbsf/wheels/67/d1/05/9442633228a4c6adb005b8d5d97a193b9876b444ce637c7bbe +Successfully built metacall +Installing collected packages: metacall +Successfully installed metacall-0.5.1 +WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. +-- Installing: /usr/local/lib/rb_portd.so +-- Set non-toolchain portion of runtime path of "/usr/local/lib/rb_portd.so" to "/usr/local/lib" +-- Installing: /usr/local/bin/metacallclid +-- Set non-toolchain portion of runtime path of "/usr/local/bin/metacallclid" to "/usr/local/lib" +-- Up-to-date: /usr/local/include/metacall +-- Installing: /usr/local/include/metacall/metacall_loaders.h +-- Installing: /usr/local/include/metacall/metacall_version.h +MetaCall configuration paths (overwritables) +LOADER_SCRIPT_PATH: + Description: Directory where scripts are located + Install Location: N/A + Default Location: scripts +CONFIGURATION_PATH: + Description: Path to the main global MetaCall configuration + Install Location: /usr/local/share/metacall/configurations/global.json + Default Location: configurations/global.json +LOADER_LIBRARY_PATH: + Description: Directory where MetaCall loader plugins are located + Install Location: /usr/local/lib + Default Location: . +SERIAL_LIBRARY_PATH: + Description: Directory where MetaCall serial plugins are located + Install Location: /usr/local/lib + Default Location: serials +DETOUR_LIBRARY_PATH: + Description: Directory where MetaCall detour plugins are located + Install Location: /usr/local/lib + Default Location: detours +-- Installing: /usr/local/share/metacall/VERSION +-- Installing: /usr/local/share/metacall/metacall-config.cmake +-- Installing: /usr/local/share/metacall/metacall-config-version.cmake +-- Installing: /usr/local/share/metacall/AUTHORS +-- Installing: /usr/local/share/metacall/LICENSE +-- Installing: /usr/local/share/metacall/README.md +Removing intermediate container 8fc0ef566964 + ---> a154882bd14f +Successfully built a154882bd14f +Successfully tagged metacall/core:dev From 73c12f508cadfea7df67e6fb72873b8daffbe100 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 10 Apr 2025 17:48:20 +0200 Subject: [PATCH 213/487] Avoid to optimize function in release. --- source/tests/dynlink_test/source/dynlink_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index 48c037205..f832ec21c 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -122,6 +122,8 @@ TEST_F(dynlink_test, DefaultConstructor) EXPECT_EQ((int)48, fn_ptr()); + EXPECT_EQ((int (*)(void))&function_from_current_executable, (int (*)(void))fn_ptr); + dynlink_unload(proc); /* Should do nothing except by freeing the handle */ } From 369de4afc2ee9f099294189ecb7521a3792ea89e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 10 Apr 2025 18:11:08 +0200 Subject: [PATCH 214/487] Trying to solve dynlink error. --- source/tests/dynlink_test/source/dynlink_test.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index f832ec21c..1ba674206 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -38,7 +38,7 @@ class dynlink_test : public testing::Test #ifdef _WIN32 #define EXPORT_SYMBOL __declspec(dllexport) #else - #define EXPORT_SYMBOL __attribute__((visibility("default"))) + #define EXPORT_SYMBOL __attribute__((used)) __attribute__((visibility("default"))) #endif extern "C" EXPORT_SYMBOL int function_from_current_executable(void) @@ -114,15 +114,17 @@ TEST_F(dynlink_test, DefaultConstructor) dynlink_symbol_addr addr; + EXPECT_EQ((int)48, (int)function_from_current_executable()); + EXPECT_EQ((int)0, dynlink_symbol(proc, "function_from_current_executable", &addr)); - ASSERT_NE((dynlink)proc, (dynlink)(NULL)); + ASSERT_NE((dynlink_symbol_addr)addr, (dynlink_symbol_addr)NULL); int (*fn_ptr)(void) = (int (*)(void))addr; EXPECT_EQ((int)48, fn_ptr()); - EXPECT_EQ((int (*)(void))&function_from_current_executable, (int (*)(void))fn_ptr); + EXPECT_EQ((int (*)(void))(&function_from_current_executable), (int (*)(void))fn_ptr); dynlink_unload(proc); /* Should do nothing except by freeing the handle */ } From dd78067f045fc98d1208bcf26b6d12ce0f1d283c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 10 Apr 2025 18:18:07 +0200 Subject: [PATCH 215/487] Solve more issues. --- output | 4601 ----------------- .../plugins/backtrace_plugin/CMakeLists.txt | 2 + 2 files changed, 2 insertions(+), 4601 deletions(-) delete mode 100644 output diff --git a/output b/output deleted file mode 100644 index de325f6b5..000000000 --- a/output +++ /dev/null @@ -1,4601 +0,0 @@ -+ export COMPOSE_DOCKER_CLI_BUILD=1 -+ COMPOSE_DOCKER_CLI_BUILD=1 -+ export DOCKER_BUILDKIT=1 -+ DOCKER_BUILDKIT=1 -+ export BUILDKIT_PROGRESS=plain -+ BUILDKIT_PROGRESS=plain -+ export PROGRESS_NO_TRUNC=1 -+ PROGRESS_NO_TRUNC=1 -++ command -v docker-compose -+ '[' -x /usr/local/bin/docker-compose ']' -+ DOCKER_COMPOSE=docker-compose -+ case "$1" in -+ sub_test -+ export DOCKER_BUILDKIT=0 -+ DOCKER_BUILDKIT=0 -+ export METACALL_BUILD_SANITIZER= -+ METACALL_BUILD_SANITIZER= -+ export METACALL_BUILD_COVERAGE= -+ METACALL_BUILD_COVERAGE= -+ export METACALL_BUILD_TYPE=debug -+ METACALL_BUILD_TYPE=debug -+ ln -sf tools/deps/.dockerignore .dockerignore -+ docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm deps -Building deps -Sending build context to Docker daemon 41.47kB -Step 1/11 : ARG METACALL_BASE_IMAGE -Step 2/11 : FROM ${METACALL_BASE_IMAGE} AS deps - ---> 29f27ec2c121 -Step 3/11 : LABEL copyright.name="Vicente Eduardo Ferrer Garcia" copyright.address="vic798@gmail.com" maintainer.name="Vicente Eduardo Ferrer Garcia" maintainer.address="vic798@gmail.com" vendor="MetaCall Inc." version="0.1" - ---> Using cache - ---> 49a33baef77c -Step 4/11 : ARG METACALL_PATH - ---> Using cache - ---> 13cf6ef6b257 -Step 5/11 : ARG METACALL_TOOLS_PATH - ---> Using cache - ---> 74c0900e4935 -Step 6/11 : ENV DEBIAN_FRONTEND=noninteractive LTTNG_UST_REGISTER_TIMEOUT=0 NUGET_XMLDOC_MODE=skip DOTNET_CLI_TELEMETRY_OPTOUT=true - ---> Using cache - ---> 90e6f87497e7 -Step 7/11 : WORKDIR $METACALL_PATH - ---> Using cache - ---> 889e429fecde -Step 8/11 : COPY tools/metacall-environment.sh tools/nobuildtest.patch $METACALL_TOOLS_PATH/ - ---> Using cache - ---> 6039e0748a38 -Step 9/11 : ARG METACALL_BUILD_TYPE - ---> Using cache - ---> 7ef06f56da55 -Step 10/11 : ARG METACALL_INSTALL_OPTIONS - ---> Using cache - ---> 55bcc6a1ff91 -Step 11/11 : RUN chmod 500 $METACALL_TOOLS_PATH/metacall-environment.sh && $METACALL_TOOLS_PATH/metacall-environment.sh ${METACALL_BUILD_TYPE} ${METACALL_INSTALL_OPTIONS} && rm -rf $METACALL_PATH - ---> Using cache - ---> 663a36c6a1d2 -Successfully built 663a36c6a1d2 -Successfully tagged metacall/core:deps -+ ln -sf tools/dev/.dockerignore .dockerignore -+ docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm dev -Building dev -Sending build context to Docker daemon 145MB -Step 1/11 : FROM metacall/core:deps AS dev - ---> 663a36c6a1d2 -Step 2/11 : LABEL copyright.name="Vicente Eduardo Ferrer Garcia" copyright.address="vic798@gmail.com" maintainer.name="Vicente Eduardo Ferrer Garcia" maintainer.address="vic798@gmail.com" vendor="MetaCall Inc." version="0.1" - ---> Using cache - ---> cad39512370c -Step 3/11 : ARG METACALL_PATH - ---> Using cache - ---> 667cbb0424d2 -Step 4/11 : ENV LOADER_LIBRARY_PATH=$METACALL_PATH/build LOADER_SCRIPT_PATH=$METACALL_PATH/build/scripts CONFIGURATION_PATH=$METACALL_PATH/build/configurations/global.json SERIAL_LIBRARY_PATH=$METACALL_PATH/build DETOUR_LIBRARY_PATH=$METACALL_PATH/build PORT_LIBRARY_PATH=$METACALL_PATH/build DEBIAN_FRONTEND=noninteractive NODE_PATH=/usr/lib/node_modules DOTNET_CLI_TELEMETRY_OPTOUT=true - ---> Using cache - ---> 9880ade75ea2 -Step 5/11 : WORKDIR $METACALL_PATH - ---> Using cache - ---> 60b4d0ff9791 -Step 6/11 : COPY . $METACALL_PATH - ---> 61fa6f901dff -Step 7/11 : RUN chmod 500 $METACALL_PATH/tools/metacall-configure.sh && chmod 500 $METACALL_PATH/tools/metacall-build.sh && mkdir -p $METACALL_PATH/build - ---> Running in 83b240d9adc6 -Removing intermediate container 83b240d9adc6 - ---> 605f80d762f6 -Step 8/11 : ARG METACALL_BUILD_TYPE - ---> Running in f1af673b92af -Removing intermediate container f1af673b92af - ---> 84b68123c202 -Step 9/11 : ARG METACALL_BUILD_OPTIONS - ---> Running in c6ce85603c04 -Removing intermediate container c6ce85603c04 - ---> 2407b0953672 -Step 10/11 : RUN cd $METACALL_PATH/build && $METACALL_PATH/tools/metacall-configure.sh ${METACALL_BUILD_TYPE} ${METACALL_BUILD_OPTIONS} - ---> Running in 84f6a9010292 -Current option settings -errexit on -noglob off -ignoreeof off -interactive off -monitor off -noexec off -stdin off -xtrace on -verbose off -vi off -emacs off -noclobber off -allexport off -notify off -nounset on -privileged off -nolog off -pipefail off -debug off -+ pwd -+ ROOT_DIR=/usr/local/metacall/build -+ BUILD_TYPE=Release -+ BUILD_PYTHON=0 -+ BUILD_RUBY=0 -+ BUILD_NETCORE=0 -+ BUILD_NETCORE2=0 -+ BUILD_NETCORE5=0 -+ BUILD_NETCORE7=0 -+ BUILD_V8=0 -+ BUILD_NODEJS=0 -+ BUILD_TYPESCRIPT=0 -+ BUILD_FILE=0 -+ BUILD_RPC=0 -+ BUILD_WASM=0 -+ BUILD_JAVA=0 -+ BUILD_C=0 -+ BUILD_COBOL=0 -+ BUILD_GO=0 -+ BUILD_RUST=0 -+ BUILD_ZIG=0 -+ BUILD_SCRIPTS=0 -+ BUILD_EXAMPLES=0 -+ BUILD_TESTS=0 -+ BUILD_BENCHMARKS=0 -+ BUILD_PORTS=0 -+ BUILD_SANDBOX=0 -+ BUILD_COVERAGE=0 -+ BUILD_ADDRESS_SANITIZER=0 -+ BUILD_THREAD_SANITIZER=0 -+ BUILD_MEMORY_SANITIZER=0 -+ uname -s -+ OPERATIVE_SYSTEM=Linux -+ [ -f /etc/os-release ] -+ cat /etc/os-release -+ grep ^ID= -+ cut -f2- -d= -+ sed -e s/^[[:space:]]*// -e s/[[:space:]]*$// -+ tr -d " -+ LINUX_DISTRO=debian -+ + cat /etc/os-release -grep ^VERSION_ID= -+ cut -f2- -d= -+ sed -e s/^[[:space:]]*// -e s/[[:space:]]*$// -+ tr -d " -+ LINUX_VERSION_ID= -+ sub_options debug python ruby netcore7 nodejs typescript file rpc wasm java c cobol go rust examples tests scripts ports install pack sandbox benchmarks -+ [ debug = debug ] -+ echo Build all scripts in debug mode -+ BUILD_TYPE=Debug -+ [ debug = release ] -+ [ debug = relwithdebinfo ] -+ [ debug = python ] -+ [ debug = ruby ] -+ [ debug = netcore ] -+ [ debug = netcore2 ] -+ [ debug = netcore5 ] -+ [ debug = netcore7 ] -+ [ debug = v8 ] -+ [ debug = nodejs ] -+ [ debug = typescript ] -+ [ debug = file ] -+ [ debug = rpc ] -+ [ debug = wasm ] -+ [ debug = java ] -+ [ debug = c ]Build all scripts in debug mode - -+ [ debug = cobol ] -+ [ debug = go ] -+ [ debug = rust ] -+ [ debug = zig ] -+ [ debug = scripts ] -+ [ debug = examples ] -+ [ debug = tests ] -+ [ debug = benchmarks ] -+ [ debug = ports ] -+ [ debug = sandbox ] -+ [ debug = coverage ] -+ [ debug = address-sanitizer ] -+ [ debug = thread-sanitizer ] -+ [ debug = memory-sanitizer ] -+ [ python = debug ] -+ [ python = release ] -+ [ python = relwithdebinfo ] -+ [ python = python ] -+ echo Build with python support -+ BUILD_PYTHON=1 -+ [ python = ruby ] -+ [ python = netcore ] -+ [ python = netcore2 ] -+ [ python = netcore5 ] -+ [ python = netcore7 ] -+ [ python = v8 ] -+ [ python = nodejs ] -+ [ python = typescript ] -+ [ python = file ] -+ [ python = rpc ] -+ [ python = wasmBuild with python support - ] -+ [ python = java ] -+ [ python = c ] -+ [ python = cobol ] -+ [ python = go ] -+ [ python = rust ] -+ [ python = zig ] -+ [ python = scripts ] -+ [ python = examples ] -+ [ python = tests ] -+ [ python = benchmarks ] -+ [ python = ports ] -+ [ python = sandbox ] -+ [ python = coverage ] -+ [ python = address-sanitizer ] -+ [ python = thread-sanitizer ] -+ [ python = memory-sanitizer ] -+ Build with ruby support -[ ruby = debug ] -+ [ ruby = release ] -+ [ ruby = relwithdebinfo ] -+ [ ruby = python ] -+ [ ruby = ruby ] -+ echo Build with ruby support -+ BUILD_RUBY=1 -+ [ ruby = netcore ] -+ [ ruby = netcore2 ] -+ [ ruby = netcore5 ] -+ [ ruby = netcore7 ] -+ [ ruby = v8 ] -+ [ ruby = nodejs ] -+ [ ruby = typescript ] -+ [ ruby = file ] -+ [ ruby = rpc ] -+ [ ruby = wasm ] -+ [ ruby = java ] -+ [ ruby = c ] -+ [ ruby = cobol ] -+ [ ruby = go ] -+ [ ruby = rust ] -+ [ ruby = zig ] -+ [ ruby = scripts ] -+ [ ruby = examples ] -+ [ ruby = tests ] -+ [ ruby = benchmarks ] -+ [ ruby = ports ] -+ [ ruby = sandbox ] -+ [ ruby = coverage ] -+ [ ruby = address-sanitizer ] -+ [ ruby = thread-sanitizer ] -+ [ ruby = memory-sanitizer ] -+ [ netcore7 = debug ] -+ [ netcore7 = release ] -+ [ netcore7 = relwithdebinfo ] -+ [ netcore7 = python ] -+ [ netcore7 = ruby ] -+ [ netcore7 = netcore ] -+ [ netcore7 = netcore2 ] -+ [ netcore7 = netcore5 ] -+ [Build with netcore 7 support - netcore7 = netcore7 ] -+ echo Build with netcore 7 support -+ BUILD_NETCORE7=1 -+ [ netcore7 = v8 ] -+ [ netcore7 = nodejs ] -+ [ netcore7 = typescript ] -+ [ netcore7 = file ] -+ [ netcore7 = rpc ] -+ [ netcore7 = wasm ] -+ [ netcore7 = java ] -+ [ netcore7 = c ] -+ [ netcore7 = cobol ] -+ [ netcore7 = go ] -+ [ netcore7 = rust ] -+ [ netcore7 = zig ] -+ [ netcore7 = scripts ] -+ [ netcore7 = examples ] -+ [ netcore7 = tests ] -+ [ netcore7 = benchmarks ] -+ [ netcore7 = ports ] -+ [ netcore7 = sandbox ] -+ [ netcore7 = coverage ] -+ [ netcore7 = address-sanitizer ] -+ [ netcore7 = thread-sanitizer ] -+ [ netcore7 = memory-sanitizer ] -+ [ nodejs = debug ] -+ [ nodejs = release ] -+ [ nodejs = relwithdebinfo ] -+ [ nodejs = python ] -+ [ nodejs = ruby ] -+ [ nodejs = netcore ] -+ [ nodejs = netcore2 ] -+ [ nodejs = netcore5 ] -+ [ nodejs = netcore7 ] -+ [ nodejs = v8 ] -+ [ nodejs = nodejs ] -+ echo Build with nodejs support -+ BUILD_NODEJS=1 -+ [ nodejs = typescript ] -+ [ nodejs = file ] -+ [ nodejs = rpc ] -+ [ nodejs = wasm ] -+ [ nodejs = java ] -+ [ nodejs = c ] -+ [ nodejs = cobol ] -+ [ nodejs = go ] -+ [ nodejs = rust ] -+ [ nodejs = zig ] -+ [ nodejs = scripts ] -+ [ nodejs = examples ] -+ [ nodejs = tests ] -+ [ nodejs = benchmarks ] -+ [ nodejs = ports ] -+ [ nodejs = sandbox ] -+ [ nodejs = coverage ] -+ [ nodejs = address-sanitizer ] -+ [ nodejs = thread-sanitizer ] -+ [ nodejs = memory-sanitizer ] -+ [ typescript = debug ] -+ [ typescript = release ] -+ [ typescript = relwithdebinfo ] -+ [ typescript = python ] -+ [ typescript = ruby ] -+ [ typescript = netcore ] -+ [ typescript = netcore2 ] -+ [ typescript = netcore5 ] -+ [ typescript = netcore7 ] -+ [ typescript = v8 ] -+ [ typescript = nodejs ] -+ [ typescript = typescript ] -+ echo Build with typescript support -+ BUILD_TYPESCRIPT=1 -+ [ typescript = file ] -+ [ typescript = rpc ] -+ [ typescript = wasm ] -+ [ typescript = java ] -+ [ typescript = c ] -+ [ typescript = cobol ] -+ [ typescript = go ] -+ [ typescript = rust ] -+ [ typescript = zig ] -+ [ typescript = scripts ] -+ [ typescript = examples ] -+ [ typescript = tests ] -+ [ typescript = benchmarks ] -+ [ typescript = ports ] -+ [ typescript = sandbox ] -+ [ typescript = coverage ] -+ [ typescript = address-sanitizer ] -+ [ typescript = thread-sanitizer ] -+ [ typescript = memory-sanitizer ] -+ [ file = debug ] -+ [ file = release ] -+ [ file = relwithdebinfo ] -+ [ file = python ] -+ [ file = ruby ] -+ [ file = netcore ] -+ [ file = netcore2 ] -+ [ file = netcore5 ] -+ [ file = netcore7 ] -+ [ file = v8 ] -+ [ file = nodejs ] -+ [ file = typescript ] -+ [ file = file ] -+ echo Build with file support -+ BUILD_FILE=1 -+ [ file = rpc ] -+ [ file = wasm ] -Build with nodejs support -Build with typescript support -Build with file support -+ [ file = java ] -+ [ file = c ] -+ [ file = cobol ] -+ [ file = go ] -+ [ file = rust ] -+ [ file = zig ] -+ [ file = scripts ] -+ [ file = examples ] -+ [ file = tests ] -+ [ file = benchmarks ] -+ [ file = ports ] -+ [ file = sandbox ] -+ [ file = coverage ] -+ [ file = address-sanitizer ] -+ [ file = thread-sanitizer ] -+ [ file = memory-sanitizer ] -+ [ rpc = debug ] -+ [ rpc = release ] -+ [ rpc = relwithdebinfo ] -+ [ rpc = python ] -+ [ rpc = ruby ] -+ [ rpc = netcore ] -+ [ rpc = netcore2 ] -+ [ rpc = netcore5 ] -+ [ rpc = netcore7 ] -+ [ rpc = v8 ] -+ [ rpc = nodejs ] -+ [ rpc = typescript ] -+ [ rpc = file ] -+ [ rpc = rpc ] -+ echo Build with rpc support -+ BUILD_RPC=1 -+ [ rpc = wasm ] -+ [ rpc = java ] -+ [ rpc = c ] -+ [ rpc = cobol ] -+ [ rpc = go ] -+ [ rpc = rust ] -+ [ rpc = zig ] -+ [ rpc = scripts ] -+ [ rpc = examples ] -+ [ rpc = tests ] -+ [ rpc = benchmarks ] -+ [ rpc = ports ] -+ [ rpc = sandbox ] -+ [ rpc = coverage ] -+ [ rpc = address-sanitizer ] -+ [ rpc = thread-sanitizer ] -+ [ rpc = memory-sanitizer ] -+ [ wasm = debug ] -+ [ wasm = release ] -+ [ wasm = relwithdebinfo ] -+ [ wasm = python ] -+ [ wasm = ruby ] -+ [ wasm = netcore ] -+ [ wasm = netcore2 ] -+ [ wasm = netcore5Build with rpc support - ] -+ [ wasm = netcore7 ] -+ [ wasm = v8 ] -+ [ wasm = nodejs ] -+ [ wasm = typescript ] -+ [ wasm = file ] -+ [ wasm = rpc ] -+ [ wasm = wasm ] -+ echo Build with wasm support -+ BUILD_WASM=1 -+ [ wasm = java ] -+ [ wasm = c ] -+ [ wasm = cobol ] -+ [ wasm = go ] -+ [ wasm = rust ] -+ [ wasm = zig ] -+ [ wasm = scripts ] -+ [ wasm = examples ] -+ [ wasmBuild with wasm support - = tests ] -+ [ wasm = benchmarks ] -+ [ wasm = ports ] -+ [ wasm = sandbox ] -+ [ wasm = coverage ] -+ [ wasm = address-sanitizer ] -+ [ wasm = thread-sanitizer ] -+ [ wasm = memory-sanitizer ] -+ [ java = debug ] -+ [ java = release ] -+ [ java = relwithdebinfo ] -+ [ java = python ] -+ [ java = ruby ] -+ [ java = netcore ] -+ [ java = netcore2 ] -+ [ java = netcore5 ] -+ [ java = netcore7 ] -+ [ java = v8 ] -+ [ java = nodejs ] -+ [ java = typescript ] -+ [ java = file ] -+ [ java = rpc ] -+ [ java = wasm ] -+ [ java = java ] -+ echo Build with java support -+ BUILD_JAVA=1 -+ [ java = c ] -+ [ java = cobol ] -+ [ java = go ] -+ [ java = rust ] -+ [ java = zig ] -+ [ java = scripts ] -+ [ java = examples ] -Build with java support -+ [ java = tests ] -+ [ java = benchmarks ] -+ [ java = ports ] -+ [ java = sandbox ] -+ [ java = coverage ] -+ [ java = address-sanitizer ] -+ [ java = thread-sanitizer ] -+ [ java = memory-sanitizer ] -+ [ c = debug ] -+ [ c = release ] -+ [ c = relwithdebinfo ] -+ [ c = python ] -+ [ c = ruby ] -+ [ c = netcore ] -+ [ c = netcore2 ] -+ [ c = netcore5 ] -+ [ c = netcore7 ] -+ [ c = v8 ] -+ [ c = nodejs ] -+ [ c = typescript ] -+ [ c = file ] -+ [ c = rpc ] -+ [ c = wasm ] -+ [ c = java ] -+ [ c = c ] -+ echo Build with c support -+ BUILD_C=1 -+ [ c = cobol ] -+ [ c = go ] -+ [ c = rust ] -+ [ c = zig ] -+ [ c = scripts ] -+ [ c = examples ] -+ [ c = tests ] -+ [ c = benchmarks ] -+ [ c = ports ] -+ [ c = sandbox ] -+ [ c = coverage ] -+ [ c = address-sanitizer ] -+ [ c = thread-sanitizer ] -+ [ c = memory-sanitizer ] -+ [ cobol = debug ] -+ [ cobol = release ] -+ [ cobol = relwithdebinfo ] -+ [ cobol = python ] -+ [ cobol = ruby ] -+ [ cobol = netcore ] -+ [ cobol = netcore2 ] -+ [ cobol = netcore5 ] -+ [ cobol = netcore7 ] -+ [ cobol = v8 ] -+ [ cobol = nodejs ] -+ [ cobol = typescript ] -+ [ cobol = file ] -+ [ cobol = rpc ] -+ [ cobol = wasm ] -+ [ cobol = java ] -+ [ cobol = c ] -+ [ cobol = cobol ] -+ echo Build with cobol support -+ BUILD_COBOL=1 -+ [ cobol = go ] -+ [ cobol = rust ] -+ [ cobol = zig ] -+ [ cobol = scripts ] -+ [ cobol = examples ] -+ [ cobol = tests ] -+ [ cobol = benchmarks ] -+ [ cobol = ports ] -+ [ cobol = sandbox ] -+ [ cobol = coverage ] -+ [ cobol = address-sanitizer ] -+ [ cobol = thread-sanitizer ] -+ [ cobol = memory-sanitizer ] -+ [ go = debug ] -+ [ go = release ] -+ [ go = relwithdebinfo ] -+ [ go = python ] -+ [ go = ruby ] -+ [ go = netcore ] -+ [ go = netcore2 ] -+ [ go = netcore5 ] -+ [ go = netcore7 ] -+ [ go = v8 ] -+ [ go = nodejs ] -+ [ go = typescript ] -+ [ go = file ] -+ [ go = rpc ] -+ [ go = wasm ] -+ [ go = java ] -+ [ go = c ] -+ [ go = cobol ] -+ [ go = go ] -+ echo Build with go support -+ BUILD_GO=1 -+ [ go = rust ] -+ [ go = zig ] -+ [ go = scripts ] -+ [ go = examples ] -+ [ go = tests ] -+ [ go = benchmarks ] -+ [ go = ports ] -+ [ go = sandbox ] -+ [ go = coverage ] -+ [ go = address-sanitizer ] -+ [ go = thread-sanitizer ] -+ [ go = memory-sanitizer ] -+ [ rust = debug ] -+ [ rust = release ] -+ [ rust = relwithdebinfo ] -+ [ rust = python ] -+ [ rust = ruby ] -+ [ rust = netcore ] -+ [ rust = netcore2 ] -+ [ rust = netcore5 ] -+ [ rust = netcore7 ] -+ [ rust = v8 ] -+ [ rust = nodejs ] -+ [ rust = typescript ] -+ [ rust = file ] -+ [ rust = rpc ] -+ [ rust = wasm ] -+ [ rust = java ] -+ [ rust = c ] -+ [ rust = cobol ] -+ [ rust = go ] -+ [ rust = rust ] -+ echo Build with rust support -+ BUILD_RUST=1 -+ [ rust = zig ] -+ [ rust = scripts ] -+ [ rust = examples ] -+ [ rust = tests ] -+ [ rust = benchmarks ] -+ [ rust = ports ] -+ [ rust = sandbox ] -+ [ rust = coverage ] -+ [ rust = address-sanitizer ] -+ [ rust = thread-sanitizer ] -+ [ rust = memory-sanitizer ] -+ [ examples = debug ] -+ [ examples = release ] -+ [ examples = relwithdebinfo ] -+ [ examples = python ] -+ [ examples = ruby ] -+ [ examples = netcore ] -+ [ examples = netcore2 ] -+ [ examples = netcore5 ] -+ [ examples = netcore7 ] -+ [ examples = v8 ] -+ [ examples = nodejs ] -+ [ examples = typescript ] -+ [ examples = file ] -+ [ examples = rpc ] -+ [ examples = wasm ] -+ [ examples = java ] -+ [ examples = c ] -+ [ examples = cobol ] -+ [ examples = go ] -+ [ examples = rust ] -+ [ examples = zig ] -+ [ examples = scripts ] -+ [ examples = examples ] -+ echo Build all examples -+ BUILD_EXAMPLES=1 -+ [ examples = tests ] -+ [ examples = benchmarks ] -+ [ examples = ports ] -+ [ examples = sandbox ] -+ [ examples = coverage ] -+ [ examples = address-sanitizer ] -+ [ examples = thread-sanitizer ] -+ [ examples = memory-sanitizer ] -+ [ tests = debug ] -+ [ tests = release ] -+ [ tests = relwithdebinfo ] -+ [ tests = python ] -+ [ tests = ruby ] -+ [ tests = netcore ] -+ [ tests = netcore2 ] -+ [ tests = netcore5 ] -+ [ tests = netcore7 ] -+ [ tests = v8 ] -+ [ tests = nodejs ] -+ [ tests = typescript ] -+ [ tests = file ] -+ [ tests = rpc ] -+ [ tests = wasm ] -+ [ tests = java ] -+ [ tests = c ] -+ [ tests = cobol ] -+ [ tests = go ] -+ [ tests = rust ] -+ [ tests = zig ] -+ [ tests = scripts ] -+ [ tests = examples ] -+ [ tests = tests ] -+ echo Build all tests -+ BUILD_TESTS=1 -+ [ tests = benchmarks ] -+ [ tests = ports ] -+ [ tests = sandbox ] -+ [ tests = coverage ] -+ [ tests = address-sanitizer ] -+ [ tests = thread-sanitizer ] -+ [ tests = memory-sanitizer ] -+ [ scripts = debug ] -+ [ scripts = release ] -+ [ scripts = relwithdebinfo ] -+ [ scripts = python ]Build with c support -Build with cobol support -Build with go support -Build with rust support -Build all examples -Build all tests - -+ [ scripts = ruby ] -+ [ scripts = netcore ] -+ [ scripts = netcore2 ] -+ [ scripts = netcore5 ] -+ [ scripts = netcore7 ] -+ [ scripts = v8 ] -+ [ scripts = nodejs ] -+ [ scripts = typescript ] -+ [ scripts = file ] -+ [ scripts = rpc ] -+ [ scripts = wasm ] -+ [ scripts = java ] -+ [ scripts = c ] -+ [ scripts = cobol ] -+ [ scripts = go ] -+ [ scripts = rust ] -+ [ scripts = zig ] -+ [ scripts = scripts ] -+ echo Build all scripts -+ BUILD_SCRIPTS=1 -+ [ scripts = examples ] -+ [ scripts = tests ] -+ [ scripts = benchmarks ] -+ [ scripts = ports ] -+ [ scripts = sandbox ] -+ [ scripts = coverage ] -+ [ scripts = address-sanitizer ] -+ [ scripts = thread-sanitizer ] -+ [ scripts = memory-sanitizer ] -+ [ ports = debug ] -+ [ ports = release ] -+ [ ports = relwithdebinfo ] -Build all scripts -+ [ ports = python ] -+ [ ports = ruby ] -+ [ ports = netcore ] -+ [ ports = netcore2 ] -+ [ ports = netcore5 ] -+ [ ports = netcore7 ] -+ [ ports = v8 ] -+ [ ports = nodejs ] -+ [ ports = typescript ] -+ [ ports = file ] -+ [ ports = rpc ] -+ [ ports = wasm ] -+ [ ports = java ] -+ [ ports = c ] -+ [ ports = cobol ] -+ [ ports = go ] -+ [ ports = rust ] -+ [ ports = zig ] -+ [ ports = scripts ] -+ [ ports = examples ] -+ [ ports = tests ] -+ [ ports = benchmarks ] -+ [ ports = ports ] -+ echo Build all ports -Build all ports -+ BUILD_PORTS=1 -+ [ ports = sandbox ] -+ [ ports = coverage ] -+ [ ports = address-sanitizer ] -+ [ ports = thread-sanitizer ] -+ [ ports = memory-sanitizer ] -+ [ install = debug ] -+ [ install = release ] -+ [ install = relwithdebinfo ] -+ [ install = python ] -+ [ install = ruby ] -+ [ install = netcore ] -+ [ install = netcore2 ] -+ [ install = netcore5 ] -+ [ install = netcore7 ] -+ [ install = v8 ] -+ [ install = nodejs ] -+ [ install = typescript ] -+ [ install = file ] -+ [ install = rpc ] -+ [ install = wasm ] -+ [ install = java ] -+ [ install = c ] -+ [ install = cobol ] -+ [ install = go ] -+ [ install = rust ] -+ [ install = zig ] -+ [ install = scripts ] -+ [ install = examples ] -+ [ install = tests ] -+ [ install = benchmarks ] -+ [ install = ports ] -+ [ install = sandbox ] -+ [ install = coverage ] -+ [ install = address-sanitizer ] -+ [ install = thread-sanitizer ] -+ [ install = memory-sanitizer ] -+ [ pack = debug ] -+ [ pack = release ] -+ [ pack = relwithdebinfo ] -+ [ pack = python ] -+ [ pack = ruby ] -+ [ pack = netcore ] -+ [ pack = netcore2 ] -+ [ pack = netcore5 ] -+ [ pack = netcore7 ] -+ [ pack = v8 ] -+ [ pack = nodejs ] -+ [ pack = typescript ] -+ [ pack = file ] -+ [ pack = rpc ] -+ [ pack = wasm ] -+ [ pack = java ] -+ [ pack = c ] -+ [ pack = cobol ] -+ [ pack = go ] -+ [ pack = rust ] -+ [ pack = zig ] -+ [ pack = scripts ] -+ [ pack = examples ] -+ [ pack = tests ] -+ [ pack = benchmarks ] -+ [ pack = ports ] -+ [ pack = sandbox ] -+ [ pack = coverage ] -+ [ pack = address-sanitizer ] -+ [ pack = thread-sanitizer ] -+ [ pack = memory-sanitizer ] -+ [ sandbox = debug ] -+ [ sandbox = release ] -+ [ sandbox = relwithdebinfo ] -+ [ sandbox = python ] -+ [ sandbox = ruby ] -+ [ sandbox = netcore ] -+ [ sandbox = netcore2 ] -+ [ sandbox = netcore5 ] -+ [ sandbox = netcore7 ] -+ [ sandbox = v8 ] -+ [ sandbox = nodejs ] -+ [ sandbox = typescript ] -+ [ sandbox = file ] -+ [ sandbox = rpc ] -+ [ sandbox = wasm ] -+ [ sandbox = java ] -+ [ sandbox = c ] -+ [ sandbox = cobol ] -+ [ sandbox = go ] -+ [ sandbox = rust ] -+ [ sandbox = zig ] -+ [ sandbox = scripts ] -+ [ sandbox = examples ] -+ [ sandbox = tests ] -+ [ sandbox = benchmarks ] -+ [ sandbox = ports ] -+ [ sandbox = sandbox ] -+ echo Build with sandboxing support -+ BUILD_SANDBOX=1 -+ [ sandbox = coverage ] -+ [ sandbox = address-sanitizer ] -+ [ sandbox = thread-sanitizer ] -+ [ sandbox = memory-sanitizer ] -+ [ benchmarks = debug ] -+ [ benchmarks = release ] -+ [ benchmarks = relwithdebinfo ] -+ [ benchmarks = python ] -+ [ benchmarks = ruby ] -+ [ benchmarks = netcore ] -+ [ benchmarks = netcore2 ] -+ [ benchmarks = netcore5 ] -+ [ benchmarks = netcore7 ] -+ [ benchmarks = v8 ] -+ [ benchmarks = nodejs ] -+ [ benchmarks = typescript ] -+ [ benchmarks = file ] -+ [ benchmarks = rpcBuild with sandboxing support -Build all benchmarks - ] -+ [ benchmarks = wasm ] -+ [ benchmarks = java ] -+ [ benchmarks = c ] -+ [ benchmarks = cobol ] -+ [ benchmarks = go ] -+ [ benchmarks = rust ] -+ [ benchmarks = zig ] -+ [ benchmarks = scripts ] -+ [ benchmarks = examples ] -+ [ benchmarks = tests ] -+ [ benchmarks = benchmarks ] -+ echo Build all benchmarks -+ BUILD_BENCHMARKS=1 -+ [ benchmarks = ports ] -+ [ benchmarks = sandbox ] -+ [ benchmarks = coverage ] -+ [ benchmarks = address-sanitizer ] -+ [ benchmarks = thread-sanitizer ] -+ [ benchmarks = memory-sanitizer ] -+ sub_configure -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -+ [ debian = alpine ] -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -+ [ Linux = Darwin ] -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -+ [ 0 = 1 ] -+ [ 0 = 1 ] -+ [ 0 = 1 ] -+ [ 1 = 1 ] -+ sub_find_dotnet_runtime 7 -+ dotnet --list-runtimes -+ grep -m 1 Microsoft.NETCore.App 7 -+ NETCORE_BASE_PATH=Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App] -+ echo Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App] -+ awk { print $3 } -+ tail -c +2 -+ head -c -2 -+ echo Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App] -+ awk { print $2 } -+ echo /usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -+ [ 0 = 1 ] -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -+ [ debian = alpine ] -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -+ [ 1 = 1 ] -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -+ [ 0 = 1 ] -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -+ [ 1 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -+ [ 0 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -+ [ 0 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -+ [ 0 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off -+ [ 0 = 1 ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off -DOPTION_BUILD_MEMORY_SANITIZER=Off -+ CMAKE_CONFIG_FILE=/usr/local/metacall/build/CMakeConfig.txt -+ [ -f /usr/local/metacall/build/CMakeConfig.txt ] -+ BUILD_STRING=-DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off -DOPTION_BUILD_MEMORY_SANITIZER=Off -DCMAKE_BUILD_TYPE=Debug -+ cmake -Wno-dev -DOPTION_GIT_HOOKS=Off -DOPTION_BUILD_LOG_PRETTY=Off -DOPTION_BUILD_LOADERS=On -DOPTION_BUILD_LOADERS_MOCK=On -DOPTION_BUILD_SCRIPTS=On -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_SCRIPTS_PY=On -DOPTION_BUILD_PORTS_PY=On -DOPTION_BUILD_LOADERS_RB=On -DOPTION_BUILD_SCRIPTS_RB=On -DOPTION_BUILD_PORTS_RB=On -DOPTION_BUILD_LOADERS_CS=On -DDOTNET_CORE_PATH=/usr/share/dotnet/shared/Microsoft.NETCore.App/7.0.20/ -DOPTION_BUILD_SCRIPTS_CS=On -DOPTION_BUILD_PORTS_CS=On -DOPTION_BUILD_LOADERS_NODE=On -DOPTION_BUILD_SCRIPTS_NODE=On -DOPTION_BUILD_PORTS_NODE=On -DOPTION_BUILD_LOADERS_TS=On -DOPTION_BUILD_SCRIPTS_TS=On -DOPTION_BUILD_PORTS_TS=On -DOPTION_BUILD_LOADERS_FILE=On -DOPTION_BUILD_SCRIPTS_FILE=On -DOPTION_BUILD_LOADERS_RPC=On -DOPTION_BUILD_SCRIPTS_RPC=On -DOPTION_BUILD_LOADERS_WASM=On -DOPTION_BUILD_SCRIPTS_WASM=On -DOPTION_BUILD_LOADERS_JAVA=On -DOPTION_BUILD_SCRIPTS_JAVA=On -DOPTION_BUILD_LOADERS_C=On -DOPTION_BUILD_SCRIPTS_C=On -DOPTION_BUILD_LOADERS_COB=On -DOPTION_BUILD_SCRIPTS_COB=On -DOPTION_BUILD_PORTS_GO=On -DOPTION_BUILD_LOADERS_RS=On -DOPTION_BUILD_SCRIPTS_RS=On -DOPTION_BUILD_PORTS_RS=On -DOPTION_BUILD_EXAMPLES=On -DOPTION_BUILD_TESTS=On -DOPTION_BUILD_BENCHMARKS=On -DOPTION_BUILD_PORTS=On -DOPTION_BUILD_PLUGINS_SANDBOX=On -DOPTION_COVERAGE=Off -DOPTION_BUILD_ADDRESS_SANITIZER=Off -DOPTION_BUILD_THREAD_SANITIZER=Off -DOPTION_BUILD_MEMORY_SANITIZER=Off -DCMAKE_BUILD_TYPE=Debug .. --- The C compiler identification is GNU 14.2.0 --- The CXX compiler identification is GNU 14.2.0 --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Check for working C compiler: /usr/bin/cc - skipped --- Detecting C compile features --- Detecting C compile features - done --- Detecting CXX compiler ABI info --- Detecting CXX compiler ABI info - done --- Check for working CXX compiler: /usr/bin/c++ - skipped --- Detecting CXX compile features --- Detecting CXX compile features - done --- Target Operative System: Linux --- Target OS Family: unix --- Linux x86_64 64bit detected -CMake Warning at CMakeLists.txt:162 (message): - Linting disabled: clang-format executable not found - - --- Lib version --- Performing Test PIC_C_FLAG --- Performing Test PIC_C_FLAG - Success --- Performing Test STACK_PROTECTOR_STRONG_C_FLAG --- Performing Test STACK_PROTECTOR_STRONG_C_FLAG - Success --- Performing Test FORTIFY_SOURCE_C_FLAG --- Performing Test FORTIFY_SOURCE_C_FLAG - Success --- Performing Test PIC_CXX_FLAG --- Performing Test PIC_CXX_FLAG - Success --- Performing Test STACK_PROTECTOR_STRONG_CXX_FLAG --- Performing Test STACK_PROTECTOR_STRONG_CXX_FLAG - Success --- Performing Test FORTIFY_SOURCE_CXX_FLAG --- Performing Test FORTIFY_SOURCE_CXX_FLAG - Success --- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY --- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success --- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY --- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success --- Performing Test COMPILER_HAS_DEPRECATED_ATTR --- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success --- Lib preprocessor --- Lib environment --- Lib format --- Lib log --- Lib memory --- Lib portability --- Lib threading --- Lib adt --- Lib filesystem --- Lib dynlink --- Lib plugin --- Lib detour --- Lib reflect --- Lib serial --- Lib configuration --- Lib loader --- Lib metacall --- Found LibFFI: /usr/lib/x86_64-linux-gnu/libffi.so --- Could NOT find LibTCC (missing: LIBTCC_LIBRARY LIBTCC_INCLUDE_DIR) --- Installing LibTCC 6ec4a10 --- Found LibClang: /usr/lib/llvm-14/lib/libclang.so --- Plugin c_loader --- Found COBOL: /usr/bin/cobc (found version "3.2.0") --- Plugin cob_loader --- Plugin cs_loader_impl implementation --- Plugin cs_loader --- Plugin ext_loader --- Plugin file_loader --- Found JNI: /usr/lib/jvm/default-java/include found components: AWT JVM --- Found Java: /usr/bin/java (found version "21.0.7") --- Plugin java_loader_bootstrap bootstrap --- Plugin java_loader --- Plugin mock_loader --- Searching NodeJS library version 115 --- NodeJS Library Found --- Found NodeJS: /usr/bin/node (found version "20.19.0") --- Found NPM: /usr/bin/npm (found version "9.2.0") --- Plugin node_loader_bootstrap bootstrap --- Plugin node_loader --- Found Python3: /usr/include/python3.13d (found version "3.13.2") found components: Development Development.Module Development.Embed --- Plugin py_loader --- Found Ruby: /usr/bin/ruby (found suitable version "3.3.7", minimum required is "1.8.0") --- Plugin rb_loader -CMake Warning at source/loaders/rs_loader/CMakeLists.txt:8 (message): - Rust loader is out of date, needs to be updated in order to work - - --- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "8.13.0") --- Plugin rpc_loader --- Plugin ts_loader_bootstrap bootstrap --- Plugin ts_loader --- Wasmtime C API library or headers not found, downloading from archive --- [download 0% complete] --- [download 1% complete] --- [download 2% complete] --- [download 3% complete] --- [download 4% complete] --- [download 5% complete] --- [download 6% complete] --- [download 7% complete] --- [download 8% complete] --- [download 9% complete] --- [download 10% complete] --- [download 11% complete] --- [download 12% complete] --- [download 13% complete] --- [download 14% complete] --- [download 15% complete] --- [download 16% complete] --- [download 17% complete] --- [download 18% complete] --- [download 19% complete] --- [download 20% complete] --- [download 21% complete] --- [download 22% complete] --- [download 23% complete] --- [download 24% complete] --- [download 25% complete] --- [download 26% complete] --- [download 27% complete] --- [download 28% complete] --- [download 29% complete] --- [download 30% complete] --- [download 31% complete] --- [download 32% complete] --- [download 33% complete] --- [download 34% complete] --- [download 35% complete] --- [download 36% complete] --- [download 37% complete] --- [download 38% complete] --- [download 39% complete] --- [download 40% complete] --- [download 41% complete] --- [download 42% complete] --- [download 43% complete] --- [download 44% complete] --- [download 45% complete] --- [download 46% complete] --- [download 47% complete] --- [download 48% complete] --- [download 49% complete] --- [download 50% complete] --- [download 51% complete] --- [download 52% complete] --- [download 53% complete] --- [download 54% complete] --- [download 55% complete] --- [download 56% complete] --- [download 57% complete] --- [download 58% complete] --- [download 59% complete] --- [download 60% complete] --- [download 61% complete] --- [download 62% complete] --- [download 63% complete] --- [download 64% complete] --- [download 65% complete] --- [download 66% complete] --- [download 67% complete] --- [download 68% complete] --- [download 69% complete] --- [download 70% complete] --- [download 71% complete] --- [download 72% complete] --- [download 73% complete] --- [download 74% complete] --- [download 75% complete] --- [download 76% complete] --- [download 77% complete] --- [download 78% complete] --- [download 79% complete] --- [download 80% complete] --- [download 81% complete] --- [download 82% complete] --- [download 83% complete] --- [download 84% complete] --- [download 85% complete] --- [download 86% complete] --- [download 87% complete] --- [download 88% complete] --- [download 89% complete] --- [download 90% complete] --- [download 91% complete] --- [download 92% complete] --- [download 93% complete] --- [download 94% complete] --- [download 95% complete] --- [download 96% complete] --- [download 97% complete] --- [download 98% complete] --- [download 99% complete] --- [download 100% complete] --- Found Wasmtime: /usr/local/metacall/build/wasmtime/wasmtime-v8.0.1-x86_64-linux-c-api/lib/libwasmtime.so (found suitable version "8.0.1", minimum required is "8.0.1") --- Plugin wasm_loader --- Serial metacall_serial --- Found RapidJSON header files in /usr/local/include --- Serial rapid_json_serial --- Detour plthook_detour --- Extension plugin_extension --- Found libdw: /usr/lib/x86_64-linux-gnu/libdw.so --- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) --- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR) --- Found Backward: /usr/local/metacall/build/_deps/backwardcpp-src --- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) --- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR) --- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) --- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR) --- Found Backward: /usr/local/metacall/build/_deps/backwardcpp-src --- Plugin backtrace_plugin --- Found LibSecComp: /usr/lib/x86_64-linux-gnu/libseccomp.so (Required is at least version "2") --- Plugin sandbox_plugin --- Port node_port --- Found Python: /usr/bin/python3 (found version "3.13.2") found components: Interpreter --- Test node_port_test --- Test node_port_test_executable --- Port py_port --- Found Python3: /usr/bin/python3 (found version "3.13.2") found components: Interpreter --- The Golang compiler identification is go1.24.2 linux/amd64 --- Check for working Golang compiler: /usr/bin/go --- Port go_port --- Found Rust: /root/.cargo/bin/cargo (found version "1.86.0") --- Port rs_port - Updating crates.io index - Downloading crates ... - Downloaded bindgen-cli v0.71.1 - Installing bindgen-cli v0.71.1 - Updating crates.io index - Locking 59 packages to latest compatible versions - Adding env_logger v0.10.2 (available: v0.11.8) - Downloading crates ... - Downloaded anstyle-parse v0.2.6 - Downloaded bitflags v2.9.0 - Downloaded anstream v0.6.18 - Downloaded cfg-if v1.0.0 - Downloaded is-terminal v0.4.16 - Downloaded anstyle-query v1.1.2 - Downloaded is_terminal_polyfill v1.70.1 - Downloaded anstyle v1.0.10 - Downloaded strsim v0.11.1 - Downloaded clap_lex v0.7.4 - Downloaded utf8parse v0.2.2 - Downloaded termcolor v1.4.1 - Downloaded quote v1.0.40 - Downloaded libloading v0.8.6 - Downloaded unicode-ident v1.0.18 - Downloaded colorchoice v1.0.3 - Downloaded prettyplease v0.2.32 - Downloaded minimal-lexical v0.2.1 - Downloaded memchr v2.7.4 - Downloaded nom v7.1.3 - Downloaded itertools v0.13.0 - Downloaded clap_builder v4.5.35 - Downloaded aho-corasick v1.1.3 - Downloaded clap v4.5.35 - Downloaded bindgen v0.71.1 - Downloaded clang-sys v1.8.1 - Downloaded proc-macro2 v1.0.94 - Downloaded regex v1.11.1 - Downloaded unicode-width v0.2.0 - Downloaded syn v2.0.100 - Downloaded log v0.4.27 - Downloaded clap_complete v4.5.47 - Downloaded regex-syntax v0.8.5 - Downloaded clap_derive v4.5.32 - Downloaded cexpr v0.6.0 - Downloaded heck v0.5.0 - Downloaded glob v0.3.2 - Downloaded env_logger v0.10.2 - Downloaded shlex v1.3.0 - Downloaded rustc-hash v2.1.1 - Downloaded annotate-snippets v0.11.5 - Downloaded humantime v2.2.0 - Downloaded either v1.15.0 - Downloaded regex-automata v0.4.9 - Downloaded libc v0.2.171 - Compiling proc-macro2 v1.0.94 - Compiling memchr v2.7.4 - Compiling unicode-ident v1.0.18 - Compiling anstyle v1.0.10 - Compiling libc v0.2.171 - Compiling utf8parse v0.2.2 - Compiling anstyle-query v1.1.2 - Compiling is_terminal_polyfill v1.70.1 - Compiling colorchoice v1.0.3 - Compiling glob v0.3.2 - Compiling clap_lex v0.7.4 - Compiling strsim v0.11.1 - Compiling prettyplease v0.2.32 - Compiling regex-syntax v0.8.5 - Compiling heck v0.5.0 - Compiling minimal-lexical v0.2.1 - Compiling cfg-if v1.0.0 - Compiling bindgen v0.71.1 - Compiling unicode-width v0.2.0 - Compiling log v0.4.27 - Compiling either v1.15.0 - Compiling humantime v2.2.0 - Compiling libloading v0.8.6 - Compiling anstyle-parse v0.2.6 - Compiling bitflags v2.9.0 - Compiling termcolor v1.4.1 - Compiling shlex v1.3.0 - Compiling rustc-hash v2.1.1 - Compiling anstream v0.6.18 - Compiling itertools v0.13.0 - Compiling annotate-snippets v0.11.5 - Compiling clang-sys v1.8.1 - Compiling clap_builder v4.5.35 - Compiling aho-corasick v1.1.3 - Compiling nom v7.1.3 - Compiling quote v1.0.40 - Compiling syn v2.0.100 - Compiling is-terminal v0.4.16 - Compiling regex-automata v0.4.9 - Compiling cexpr v0.6.0 - Compiling clap_derive v4.5.32 - Compiling regex v1.11.1 - Compiling env_logger v0.10.2 - Compiling clap v4.5.35 - Compiling clap_complete v4.5.47 - Compiling bindgen-cli v0.71.1 - Finished `release` profile [optimized] target(s) in 31.97s - Installing /root/.cargo/bin/bindgen - Installed package `bindgen-cli v0.71.1` (executable `bindgen`) --- Found SWIG: /usr/bin/swig (found version "4.3.0") --- Port rb_port --- Script compiled --- Script ffi --- Script cbks --- Script loadtest --- Script say --- Script hello --- Script static --- Script function --- Script sum_extension --- Script static --- Script favicon --- Script glob --- Script fibonnaci --- Script jartest --- Script test --- Script nod --- Script inline --- Script export --- Script host --- Script server --- Script factcallback --- Script derpyramda --- Script gram --- Script duplicated --- Script ramda --- Script example --- Script helloworld --- Script initfini --- Script callback --- Script function --- Script ducktype --- Script rsasample --- Script garbage --- Script classname --- Script web --- Script landing --- Script model --- Script pointer --- Script dicty --- Script host --- Script s1 --- Script s2 --- Script withoutfunctions --- Script wasm --- Script badimport --- Script watzon --- Script fnmesh --- Script hello --- Script second --- Script blog --- Script cache --- Script ducktype --- Script invalid --- Script klass --- Script failempty --- Script remote --- Script typedfunc --- Script templating --- Script loopfail --- Script badrequire --- Script server --- Script tests --- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) (Required is at least version "1.11.0") --- Performing Test CMAKE_HAVE_LIBC_PTHREAD --- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success --- Found Threads: TRUE --- Install Google Test v1.11.0 --- Test preprocessor-test --- Test environment-test --- Test log-test --- Test log-custom-test --- Test adt-set-test --- Test adt-trie-test --- Test adt-vector-test --- Test adt-map-test --- Test reflect-value-cast-test --- Test reflect-function-test --- Test reflect-object-class-test --- Test reflect-scope-test --- Test reflect-metadata-test --- Test dynlink-test --- Test detour-test --- Test serial-test --- Test configuration-test --- Test rb-loader-parser-test --- Test portability-path-test --- Test metacall-logs-test --- Test metacall-load-memory-test --- Test metacall-load-memory-empty-test --- Test metacall-load-configuration-test --- Test metacall-load-configuration-fail-test --- Test metacall-load-configuration-relative-test --- Test metacall-load-configuration-python-node-test --- Test metacall-load-configuration-node-python-test --- Test metacall-duplicated-handle-test --- Test metacall-duplicated-symbols-test --- Test metacall-handle-export-test --- Test metacall-handle-get-test --- Test metacall-test --- Test metacall-node-test --- Test metacall-node-event-loop-test --- Test metacall-node-event-loop-signal-test --- Test metacall-node-call-test --- Test metacall-node-inline-test --- Test metacall-node-async-test --- Test metacall-node-async-multiple-test --- Test metacall-node-reentrant-test --- Test metacall-node-port-test --- Test metacall-node-port-await-test --- Found LibGit2: /usr/lib/x86_64-linux-gnu/libgit2.so (found version "1.8.4") --- Test metacall-node-port-c-lib-test --- Test metacall-node-python-port-mock-test --- Test metacall-node-python-port-ruby-test --- Searching NodeJS library version 115 --- NodeJS Library Found --- Test metacall-node-python-ruby-test --- Test metacall-node-callback-test --- Test metacall-node-fail-test --- Test metacall-node-fail-env-var-test --- Test metacall-node-fail-load-leak-test --- Test metacall-node-typescript-test --- Test metacall-node-python-async-after-destroy-test --- Test metacall-node-python-await-test --- Test metacall-node-python-exception-test --- Test metacall-node-clear-mem-test --- Test metacall-node-async-resources-test --- Test metacall-node-await-chain-test --- Test metacall-node-exception-test --- Test metacall-node-python-deadlock-test --- Test metacall-node-native-code-test --- Test metacall-node-extension-test --- Searching NodeJS library version 115 --- NodeJS Library Found --- Script node_extension_test --- Test metacall-node-multithread-deadlock-test --- Test metacall-distributable-test --- Test metacall-cast-test --- Test metacall-init-fini-test --- Test metacall-ducktype-test --- Test metacall-inspect-test --- Test metacall-integration-test --- Test metacall-depends-test --- Test metacall-configuration-exec-path-test --- Test metacall-configuration-default-test --- Test metacall-clear-test --- Test metacall-python-test --- Test metacall-python-object-class-test --- Test metacall-python-gc-test --- Test metacall-python-open-test --- Test metacall-python-dict-test --- Test metacall-python-pointer-test --- Test metacall-python-reentrant-test --- Test metacall-python-varargs-test --- Test py-loader-port-test --- Test metacall-python-port-https-test --- Test metacall-python-port-callback-test --- Test metacall-python-port-pointer-test --- Test metacall-python-port-import-test --- Test metacall-python-callback-test --- Test metacall-python-fail-test --- Test metacall-python-relative-path-test --- Test metacall-python-without-functions-test --- Test metacall-python-builtins-test --- Test metacall-python-async-test --- Test metacall-python-exception-test --- Test metacall-python-without-env-vars-test --- Test metacall-map-test --- Test metacall-map-await-test --- Test metacall-initialize-test --- Test metacall-initialize-ex-test --- Test metacall-reinitialize-test --- Test metacall-initialize-destroy-multiple-test --- Test metacall-initialize-destroy-multiple-node-test --- Test metacall-reload-functions-test --- Test metacall-invalid-loader-test --- Test metacall-fork-test --- Test metacall-return-monad-test --- Test metacall-callback-complex-test --- Test metacall-ruby-fail-test --- Test metacall-ruby-fail-empty-test --- Test metacall-ruby-object-class-test --- Test metacall-ruby-parser-integration-test --- Test metacall-function-test --- Test metacall-cobol-test --- Test metacall-file-test --- Test metacall-file-fail-test --- Test metacall-file-glob-test --- Test metacall-typescript-test --- Test metacall-typescript-node-test --- Test metacall-typescript-call-map-test --- Test metacall-typescript-tsx-test --- Test metacall-typescript-tsx-loop-fail-test --- Test metacall-typescript-require-test --- Test metacall-typescript-jsx-default-test --- Test metacall-rpc-test --- Test metacall-csharp-static-class-test --- Test metacall-ruby-test --- Test metacall-cs-test --- Test metacall-java-test --- Test metacall-wasm-test --- Test metacall-wasm-python-port-test --- Test metacall-c-test --- Test metacall-c-lib-test --- Test metacall-version-test --- Test metacall-dynlink-path-test --- Test metacall-library-path-without-env-vars-test --- Test metacall-ext-test --- Test metacall-plugin-extension-test --- Test metacall-plugin-extension-local-test --- Test metacall-backtrace-plugin-test --- Test metacall-sandbox-plugin-test --- Could NOT find GBench (missing: GBENCH_INCLUDE_DIR GBENCH_LIBRARY) --- Install Google Benchmark v1.6.1 --- Benchmark log-bench --- Found Python3: /usr/include/python3.13d (found version "3.13.2") found components: Development Development.Module Development.Embed --- Benchmark metacall-py-c-api-bench --- Benchmark metacall-py-call-bench --- Benchmark metacall-py-init-bench --- Benchmark metacall-node-call-bench --- Benchmark metacall-rb-call-bench --- Benchmark metacall-cs-call-bench --- CLI metacallcli --- Searching NodeJS library version 115 --- NodeJS Library Found --- Plugin cli_repl_plugin --- Searching NodeJS library version 115 --- NodeJS Library Found --- Plugin cli_core_plugin --- Plugin cli_cmd_plugin --- Plugin cli_sandbox_plugin --- Example metacalllog --- Configuring done (84.4s) --- Generating done (1.1s) --- Build files have been written to: /usr/local/metacall/build -Removing intermediate container 84f6a9010292 - ---> d5122ec3833c -Step 11/11 : RUN cd $METACALL_PATH/build && $METACALL_PATH/tools/metacall-build.sh ${METACALL_BUILD_TYPE} ${METACALL_BUILD_OPTIONS} - ---> Running in 8fc0ef566964 -+ BUILD_TYPE=Release -+ BUILD_TESTS=0 -+ BUILD_BENCHMARKS=0 -+ BUILD_COVERAGE=0 -+ BUILD_INSTALL=0 -Current option settings -errexit on -noglob off -ignoreeof off -interactive off -monitor off -noexec off -stdin off -xtrace on -verbose off -vi off -emacs off -noclobber off -allexport off -notify off -nounset on -privileged off -nolog off -pipefail off -debug off -+ id -u -+ [ 0 = 0 ] -+ SUDO_CMD= -+ sub_options debug python ruby netcore7 nodejs typescript file rpc wasm java c cobol go rust examples tests scripts ports install pack sandbox benchmarks -+ [ debug = debug ] -+ echo Build all scripts in debug mode -+ BUILD_TYPE=Debug -+ [ debug = release ] -+ [Build all scripts in debug mode - debug = relwithdebinfo ] -+ [ debug = tests ] -+ [ debug = benchmarks ] -+ [ debug = coverage ] -+ [ debug = install ] -+ [ python = debug ] -+ [ python = release ] -+ [ python = relwithdebinfo ] -+ [ python = tests ] -+ [ python = benchmarks ] -+ [ python = coverage ] -+ [ python = install ] -+ [ ruby = debug ] -+ [ ruby = release ] -+ [ ruby = relwithdebinfo ] -+ [ ruby = tests ] -+ [ ruby = benchmarks ] -+ [ ruby = coverage ] -+ [ ruby = install ] -+ [ netcore7 = debug ] -+ [ netcore7 = release ] -+ [ netcore7 = relwithdebinfo ] -+ [ netcore7 = tests ] -+ [ netcore7 = benchmarks ] -+ [ netcore7 = coverage ] -+ [ netcore7 = install ] -+ [ nodejs = debug ] -+ [ nodejs = release ] -+ [ nodejs = relwithdebinfo ] -+ [ nodejs = tests ] -+ [ nodejs = benchmarks ] -+ [ nodejs = coverage ] -+ [ nodejs = install ] -+ [ typescript = debug ] -+ [ typescript = release ] -+ [ typescript = relwithdebinfo ] -+ [ typescript = tests ] -+ [ typescript = benchmarks ] -+ [ typescript = coverage ] -+ [ typescript = install ] -+ [ file = debug ] -+ [ file = release ] -+ [ file = relwithdebinfo ] -+ [ file = tests ] -+ [ file = benchmarks ] -+ [ file = coverage ] -+ [ file = install ] -+ [ rpc = debug ] -+ [ rpc = release ] -+ [ rpc = relwithdebinfo ] -+ [ rpc = tests ] -+ [ rpc = benchmarks ] -+ [ rpc = coverage ] -+ [ rpc = install ] -+ [ wasm = debug ] -+ [ wasm = release ] -+ [ wasm = relwithdebinfo ] -+ [ wasm = tests ] -+ [ wasm = benchmarks ] -+ [ wasm = coverage ] -+ [ wasm = install ] -+ [ java = debug ] -+ [ java = release ] -+ [ java = relwithdebinfo ] -+ [ java = tests ] -+ [ java = benchmarks ] -+ [ java = coverage ] -+ [ java = install ] -+ [ c = debug ] -+ [ c = release ] -+ [ c = relwithdebinfo ] -+ [ c = tests ] -+ [ c = benchmarks ] -+ [ c = coverage ] -+ [ c = install ] -+ [ cobol = debug ] -+ [ cobol = release ] -+ [ cobol = relwithdebinfo ] -+ [ cobol = tests ] -+ [ cobol = benchmarks ] -+ [ cobol = coverage ] -+ [ cobol = install ] -+ [ go = debug ] -+ [ go = release ] -+ [ go = relwithdebinfo ] -+ [ go = tests ] -+ [ go = benchmarks ] -+ [ go = coverage ] -+ [ go = install ] -+ [ rust = debug ] -+ [ rust = release ] -+ [ rust = relwithdebinfo ] -+ [ rust = tests ] -+ [ rust = benchmarks ] -+ [ rust = coverage ] -+ [ rust = install ] -+ [ examples = debug ] -+ [ examples = release ] -+ [ examples = relwithdebinfo ] -+ [ examples = tests ] -+ [ examples = benchmarks ] -+ [ examples = coverage ] -+ [ examples = install ] -+ [ tests = debug ] -+ [ tests = release ] -+ [ tests = relwithdebinfo ] -+ [ tests = tests ] -+ echo Build and run all tests -+ BUILD_TESTS=1 -+ [ tests = benchmarks ] -+ [ tests = coverage ] -+ [ tests = install ] -+ [ scripts = debug ] -+ [ scripts = release ] -+ [ scripts = relwithdebinfo ] -+ [ scripts = tests ] -+ [ scripts = benchmarks ] -+ [ scripts = coverage ] -+ [ scripts = install ] -+ [ ports = debug ] -+ [ ports = release ] -+ [ ports = relwithdebinfo ] -+ [ ports = tests ] -+ [ ports = benchmarks ] -+ [ ports = coverage ] -+ [ ports = install ] -+ [ install = debug ] -+ [ install = release ] -+ [ install = relwithdebinfo ] -+ [ install = tests ] -+ Build and run all tests -[ install = benchmarks ] -+ [ install = coverage ] -+ [ install = install ] -+ echo Install all libraries -+ BUILD_INSTALL=1 -+ [ pack = debug ] -+ [ pack = release ] -+ [ pack = relwithdebinfo ] -+ [ pack = tests ] -+ [ pack = benchmarks ] -+ [ pack = coverage ] -+ [ pack = install ] -+ [ sandbox = debug ] -+ [ sandbox = release ] -+ [ sandbox = relwithdebinfo ] -+ [ sandbox = tests ] -+ [ sandbox = benchmarks ] -+ [ sandbox = coverage ] -+ [ sandbox = install ] -+ [ benchmarks = debug ] -+ [ benchmarks = release ] -+ [ benchmarks = relwithdebinfo ] -+ [ benchmarks = tests ] -+ [ benchmarks = benchmarks ] -+ echo Build and run all benchmarks -+ BUILD_BENCHMARKS=1 -+ [ benchmarks = coverage ] -+ [ benchmarks = install ] -+ sub_build -Install all libraries -Build and run all benchmarks -+ getconf _NPROCESSORS_ONLN -+ make -j24 -[ 0%] Building C object source/version/CMakeFiles/version.dir/source/version.c.o -Installing node_loader_bootstrap dependencies -[ 0%] Creating directories for 'libtcc-depends' -[ 0%] Building CXX object source/scripts/c/loadtest/CMakeFiles/loadtest.dir/source/loadtest.cpp.o -[ 1%] Building CXX object _deps/backwardcpp-build/CMakeFiles/backward.dir/backward.cpp.o -[ 2%] Building C object source/metacall/CMakeFiles/metacall.dir/__/version/source/version.c.o -[ 3%] Swig compile /usr/local/metacall/source/ports/rb_port/interface/rb_port/rb_port.i for ruby -Installing ts_loader_bootstrap dependencies -[ 3%] Built target c-ffi -[ 3%] Building CXX object _deps/backwardcpp-build/CMakeFiles/backward_object.dir/backward.cpp.o -[ 3%] Built target c-cbks -[ 3%] Built target c-compiled -[ 3%] Built target file-glob -[ 3%] Built target csharp-function -[ 3%] Built target file-static -[ 3%] Built target file-favicon -[ 3%] Built target sandbox_plugin_config -[ 3%] Built target c-loadtest -[ 3%] Built target backtrace_plugin_config -[ 3%] Built target csharp-static -[ 3%] Built target csharp-hello -[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/preprocessor/source/preprocessor.c.o -[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/environment/source/environment.c.o -[ 3%] Performing download step (download, verify and extract) for 'libtcc-depends' --- Downloading... - dst='/usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/tinycc.tar.gz' - timeout='none' - inactivity timeout='none' --- Using src='https://github.com/metacall/tinycc/archive/6ec4a10.tar.gz' -[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/environment/source/environment_variable.c.o -[ 3%] Built target java-test -[ 3%] Built target java-jartest -[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/environment/source/environment_variable_path.c.o -[ 3%] Built target nodejs-nod -[ 3%] Built target java-fibonnaci -[ 3%] Linking CXX shared library ../../libversiond.so -[ 3%] Built target nodejs-inline -[ 3%] Built target nodejs-server -[ 3%] Built target nodejs-factcallback -[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/format/source/format.c.o -[ 3%] Built target nodejs-host -[ 3%] Built target nodejs-export -[ 3%] Built target nodejs-derpyramda -[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/threading/source/threading.c.o -[ 3%] Built target python-example -[ 3%] Building C object source/metacall/CMakeFiles/metacall.dir/__/threading/source/threading_thread_id.c.o -[ 3%] Built target nodejs-duplicated -[ 3%] Built target python-callback -[ 3%] Built target python-initfini -[ 3%] Built target python-ducktype -[ 4%] Building C object source/metacall/CMakeFiles/metacall.dir/__/threading/source/threading_mutex_pthread.c.o -[ 4%] Built target version -[ 4%] Built target python-function -[ 4%] Built target python-helloworld -[ 4%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log.c.o -[ 4%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_map.c.o -[ 4%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_valid_size.c.o -[ 4%] Built target cobol-say -[ 5%] Linking CXX shared library ../../../../scripts/libloadtest.so -[ 5%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_level.c.o -[ 5%] Built target python-garbage -[ 5%] Built target python-rsasample -[ 5%] Built target python-classname -/usr/local/metacall/source/metacall/include/metacall/metacall.h:61: Warning 801: Wrong class name (corrected to `Metacall_initialize_configuration_type') -/usr/local/metacall/source/metacall/include/metacall/metacall.h:61: Warning 801: Wrong class name (corrected to `Metacall_initialize_configuration_type') -/usr/local/metacall/source/metacall/include/metacall/metacall.h:62: Warning 451: Setting a const char * variable may leak memory. -/usr/local/metacall/source/metacall/include/metacall/metacall.h:69: Warning 801: Wrong class name (corrected to `Metacall_await_callbacks') -/usr/local/metacall/source/metacall/include/metacall/metacall.h:69: Warning 801: Wrong class name (corrected to `Metacall_await_callbacks') -[ 5%] Built target python-web -/usr/local/metacall/source/metacall/include/metacall/metacall.h:76: Warning 801: Wrong class name (corrected to `Metacall_version_type') -/usr/local/metacall/source/metacall/include/metacall/metacall.h:76: Warning 801: Wrong class name (corrected to `Metacall_version_type') -[ 5%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_record.c.o -[ 5%] Built target python-model - -/usr/local/metacall/source/metacall/include/metacall/metacall.h:80: Warning 451: Setting a const char * variable may leak memory. -Welcome to .NET 7.0! ---------------------- -SDK Version: 7.0.410 - ----------------- -Installed an ASP.NET Core HTTPS development certificate. -To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). -Learn about HTTPS: https://aka.ms/dotnet-https ----------------- -Write your first app: https://aka.ms/dotnet-hello-world -Find out what's new: https://aka.ms/dotnet-whats-new -Explore documentation: https://aka.ms/dotnet-docs -Report issues and find source on GitHub: https://github.com/dotnet/core -Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli --------------------------------------------------------------------------------------- -/usr/local/metacall/source/metacall/include/metacall/metacall.h:81: Warning 451: Setting a const char * variable may leak memory. -/usr/local/metacall/source/metacall/include/metacall/metacall.h:82: Warning 451: Setting a const char * variable may leak memory. -[ 5%] Built target python-landing -[ 5%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_handle.c.o -[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy.c.o -[ 6%] Built target python-dicty -[ 6%] Built target python-pointer -[ 6%] Built target python-s1 -[ 6%] Built target python-host -[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect.c.o -[ 6%] Built target python-s2 -[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_singleton.c.o -[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_impl.c.o -[ 6%] Built target python-withoutfunctions -[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_format.c.o -[ 6%] Built target python-wasm -[ 6%] Built target rb_port_swig_compilation -[ 6%] Built target python-badimport -[ 6%] Built target loadtest -[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_format_binary.c.o -[ 6%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_format_custom.c.o -[ 6%] Built target python-fnmesh -[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_schedule.c.o -[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_format_text.c.o -[ 7%] Built target ruby-hello -[ 7%] Built target python-watzon -[ 7%] Built target ruby-second -[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_schedule_async.c.o -[ 7%] Built target ruby-blog -[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_schedule_sync.c.o -[ 7%] Built target ruby-ducktype -[ 7%] Built target ruby-invalid -[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_storage.c.o -[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_storage_batch.c.o -[ 7%] Built target ruby-klass -[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_storage_sequential.c.o -[ 7%] Built target ruby-failempty -[ 7%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream.c.o -[ 7%] Built target ruby-cache -[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_file.c.o -[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_custom.c.o -[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_nginx.c.o -[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_socket.c.o -[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_stdio.c.o -[ 8%] Built target rpc-remote -[ 8%] Built target typescript-typedfunc -[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect_format.c.o -[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_policy_stream_syslog.c.o -[ 8%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect_schedule.c.o -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect_storage.c.o -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/log/source/log_aspect_stream.c.o -[ 9%] Built target typescript-loopfail -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory.c.o -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator.c.o -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator_std_impl.c.o -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator_nginx.c.o -[ 9%] Built target typescript-badrequire -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator_std.c.o -[ 9%] Built target typescript-server -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/memory/source/memory_allocator_nginx_impl.c.o -[ 9%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability.c.o --- verifying file... - file='/usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/tinycc.tar.gz' --- Downloading... done -[ 9%] Creating directories for 'google-test-depends' -[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_executable_path.c.o -[ 10%] Building C object source/tests/metacall_node_extension_test/node_extension_test/CMakeFiles/node_extension_test.dir/source/node_extension_test.c.o -[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_working_path.c.o -[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_atexit.c.o -[ 10%] Built target wasm-tests -[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_library_path.c.o -[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt.c.o -[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_path.c.o -[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/portability/source/portability_dependency.c.o -[ 10%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_comparable.c.o -[ 11%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_hash.c.o --- extracting... - src='http://github.com/usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/tinycc.tar.gz' - dst='/usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/libtcc-depends' --- extracting... [tar xfz] -[ 12%] Performing download step (git clone) for 'google-test-depends' -[ 12%] Linking CXX shared module ../../../../node_extension_test.node -[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_set.c.o -[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_map.c.o -[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_bucket.c.o -[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_vector.c.o -Cloning into 'google-test-depends'... --- extracting... [analysis] --- extracting... [rename] --- extracting... [clean up] --- extracting... done -[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/filesystem/source/filesystem.c.o -[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/filesystem/source/filesystem_file_descriptor.c.o -[ 12%] Building C object source/metacall/CMakeFiles/metacall.dir/__/adt/source/adt_trie.c.o -[ 13%] Creating directories for 'google-bench-depends' -[ 13%] No update step for 'libtcc-depends' -[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/filesystem/source/filesystem_directory_descriptor.c.o -[ 14%] Built target metacallcli-scripts-tests -[ 14%] Performing download step (download, verify and extract) for 'google-bench-depends' --- Downloading... - dst='/usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/GBench-1.6.1.tar.gz' - timeout='none' - inactivity timeout='none' --- Using src='https://github.com/google/benchmark/archive/v1.6.1.tar.gz' -[ 14%] No patch step for 'libtcc-depends' -[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/dynlink/source/dynlink.c.o -[ 14%] Built target cli_core_plugin_config -[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/dynlink/source/dynlink_impl.c.o -[ 14%] Built target cli_sandbox_plugin_config -[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/dynlink/source/dynlink_interface.c.o -[ 14%] Performing configure step for 'libtcc-depends' -[ 14%] Building C object source/preprocessor/CMakeFiles/preprocessor.dir/source/preprocessor.c.o -[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin.c.o -[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/dynlink/source/dynlink_impl_unix.c.o -[ 14%] Building C object source/format/CMakeFiles/format.dir/source/format.c.o - -up to date, audited 5 packages in 658ms - -1 package is looking for funding - run `npm fund` for details - -found 0 vulnerabilities -[ 14%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin_descriptor.c.o -[ 14%] Linking CXX shared library ../../libpreprocessord.so -[ 14%] Built target node_loader_bootstrap_depends -[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin_loader.c.o -[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin_impl.c.o -[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/plugin/source/plugin_manager.c.o -[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/detour/source/detour.c.o -Binary directory /usr/local/metacall/build/libtcc/bin -TinyCC directory /usr/local/metacall/build/libtcc/lib/tcc -Library directory /usr/local/metacall/build/libtcc/lib -Include directory /usr/local/metacall/build/libtcc/include -Manual directory /usr/local/metacall/build/libtcc/share/man -Info directory /usr/local/metacall/build/libtcc/share/info -Doc directory /usr/local/metacall/build/libtcc/share/doc -Source path /usr/local/metacall/build/source/loaders/c_loader/libtcc-depends-prefix/src/libtcc-depends - -up to date, audited 3 packages in 530ms -Build OS Linux x86_64 -C compiler gcc (14.2) -Target OS Linux -CPU x86_64 -Triplet x86_64-linux-gnu -Config debug static=no selinux -Creating config.mak and config.h -[ 15%] Linking CXX shared library ../../libformatd.so - -found 0 vulnerabilities -[ 15%] Building C object source/threading/CMakeFiles/threading.dir/source/threading.c.o -[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect.c.o -[ 15%] Built target preprocessor -Copying node_loader_bootstrap dependencies -[ 15%] Built target ts_loader_bootstrap_depends -[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_type.c.o -[ 15%] Performing build step for 'libtcc-depends' -make[3]: warning: -j24 forced in submake: resetting jobserver mode. -[ 15%] Building C object source/threading/CMakeFiles/threading.dir/source/threading_thread_id.c.o -[ 15%] Building C object source/threading/CMakeFiles/threading.dir/source/threading_mutex_pthread.c.o -[ 15%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_type_id.c.o -[ 16%] Building C object source/environment/CMakeFiles/environment.dir/source/environment.c.o -[ 16%] Built target node_extension_test -[ 16%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_signature.c.o -[ 16%] Linking CXX shared library ../../libthreadingd.so -[ 16%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_function.c.o -[ 17%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_attribute.c.o -[ 17%] Built target format -node_loader_bootstrap dependencies copied from /usr/local/metacall/source/loaders/node_loader/bootstrap/node_modules to /usr/local/metacall/build/node_modules -[ 17%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_constructor.c.o -[ 17%] Building C object source/environment/CMakeFiles/environment.dir/source/environment_variable.c.o -[ 17%] Built target node_loader_bootstrap_copy_depends -[ 17%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_memory_tracker.c.o -[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability.c.o - -up to date, audited 2 packages in 754ms - -found 0 vulnerabilities -[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_executable_path.c.o -[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_library_path.c.o --- verifying file... - file='/usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/GBench-1.6.1.tar.gz' --- Downloading... done -[ 18%] Built target nodejs-ramda-depends -[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_method.c.o -[ 18%] Built target threading -[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_working_path.c.o -[ 18%] Building C object source/environment/CMakeFiles/environment.dir/source/environment_variable_path.c.o --- extracting... - src='http://github.com/usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/GBench-1.6.1.tar.gz' - dst='/usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/google-bench-depends' --- extracting... [tar xfz] -[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_class_visibility.c.o -[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_object.c.o -[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_class.c.o -[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_path.c.o --- extracting... [analysis] --- extracting... [rename] --- extracting... [clean up] --- extracting... done -[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_atexit.c.o -[ 18%] Building C object source/portability/CMakeFiles/portability.dir/source/portability_dependency.c.o -[ 18%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_future.c.o -[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_exception.c.o -[ 18%] Linking CXX shared library ../../libenvironmentd.so -[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_throwable.c.o -[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_context.c.o -[ 19%] No update step for 'google-bench-depends' -[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_scope.c.o -[ 19%] Built target node_loader_bootstrap -Note: /usr/local/metacall/source/loaders/java_loader/bootstrap/lib/bootstrap.java uses or overrides a deprecated API. -Note: Recompile with -Xlint:deprecation for details. -[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value.c.o -[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type.c.o -[ 19%] Built target nodejs-ramda -[ 19%] Built target java_loader_bootstrap -[ 19%] No patch step for 'google-bench-depends' - -up to date, audited 49 packages in 1s -[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type_id_size.c.o - -1 moderate severity vulnerability - -To address all issues, run: - npm audit fix - -Run `npm audit` for details. -[ 19%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type_promotion.c.o -[ 19%] Built target environment -[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type_demotion.c.o -[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/reflect/source/reflect_value_type_cast.c.o -[ 20%] Built target nodejs-gram-depends -[ 20%] Performing configure step for 'google-bench-depends' -[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/serial/source/serial.c.o -CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): - Compatibility with CMake < 3.10 will be removed from a future version of - CMake. - - Update the VERSION argument <min> value. Or, use the <min>...<max> syntax - to tell CMake that the project requires at least <min> but has been updated - to work with policies introduced by <max> or earlier. - - -[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/configuration/source/configuration.c.o -[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/configuration/source/configuration_singleton.c.o -[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/configuration/source/configuration_impl.c.o -[ 20%] Building C object source/metacall/CMakeFiles/metacall.dir/__/configuration/source/configuration_object.c.o -[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/__/loader/source/loader.c.o -[ 21%] Linking CXX shared library ../../libportabilityd.so -[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/__/loader/source/loader_host.c.o -[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/__/loader/source/loader_manager_impl.c.o - Determining projects to restore... -[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/__/loader/source/loader_impl.c.o --- The CXX compiler identification is GNU 14.2.0 -[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall.c.o --- Detecting CXX compiler ABI info -[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_log.c.o -[ 21%] Built target portability -[ 21%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_allocator.c.o -[ 22%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_value.c.o -[ 22%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_error.c.o -[ 22%] Built target backward_object -[ 22%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_link.c.o -[ 22%] Building C object source/metacall/CMakeFiles/metacall.dir/source/metacall_fork.c.o -[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log.c.o -[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_valid_size.c.o -[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_map.c.o - -up to date, audited 7 packages in 1s - -found 0 vulnerabilities -[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_record.c.o -[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_level.c.o -[ 22%] Building C object source/log/CMakeFiles/log.dir/source/log_handle.c.o -[ 22%] Linking CXX shared library ../../libbackward.so -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect.c.o -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy.c.o -[ 23%] Built target typescript-templating-depends -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_impl.c.o -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_singleton.c.o -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_format_binary.c.o -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_format.c.o -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_format_custom.c.o -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_format_text.c.o -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_schedule.c.o -[ 23%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_schedule_sync.c.o -[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_schedule_async.c.o --- Detecting CXX compiler ABI info - done -[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_storage_batch.c.o -[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_storage.c.o -[ 24%] Built target nodejs-gram -[ 24%] Built target typescript-templating --- Check for working CXX compiler: /usr/bin/c++ - skipped --- Detecting CXX compile features --- Detecting CXX compile features - done -[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_custom.c.o -[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream.c.o -[ 24%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_storage_sequential.c.o --- Failed to find LLVM FileCheck -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_nginx.c.o -[ 25%] Built target backward -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_file.c.o --- Found Git: /usr/bin/git (found version "2.47.2") --- git version: v0.0.0 normalized to 0.0.0 --- Version: 1.6.1 -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_socket.c.o --- Looking for shm_open in rt -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_syslog.c.o -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_policy_stream_stdio.c.o -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect_storage.c.o -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect_schedule.c.o -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect_format.c.o -[ 25%] Building C object source/log/CMakeFiles/log.dir/source/log_aspect_stream.c.o -[ 26%] Linking CXX shared library ../../liblogd.so - -> ts_loader_bootstrap@1.1.0 build -> tsc - --- Looking for shm_open in rt - found --- Performing Test HAVE_CXX_FLAG_STD_CXX11 -[ 26%] Built target log -[ 26%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator_nginx.c.o -[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt.c.o -[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_hash.c.o -[ 26%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator.c.o -[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_bucket.c.o -[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_set.c.o -[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_trie.c.o -[ 26%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_map.c.o -[ 27%] Building C object source/dynlink/CMakeFiles/dynlink.dir/source/dynlink.c.o -[ 27%] Building C object source/dynlink/CMakeFiles/dynlink.dir/source/dynlink_impl.c.o -[ 27%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_comparable.c.o -[ 27%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator_std.c.o -[ 27%] Building C object source/memory/CMakeFiles/memory.dir/source/memory.c.o -[ 27%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator_nginx_impl.c.o -[ 28%] Building C object source/adt/CMakeFiles/adt.dir/source/adt_vector.c.o -[ 28%] Building C object source/memory/CMakeFiles/memory.dir/source/memory_allocator_std_impl.c.o -[ 28%] Building C object source/dynlink/CMakeFiles/dynlink.dir/source/dynlink_impl_unix.c.o -[ 28%] Building C object source/dynlink/CMakeFiles/dynlink.dir/source/dynlink_interface.c.o --- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success --- Performing Test HAVE_CXX_FLAG_WALL - -added 15 packages in 2s - -1 package is looking for funding - run `npm fund` for details -[ 28%] Linking CXX shared library ../../libmemoryd.so -[ 28%] Linking CXX shared library ../../libdynlinkd.so -[ 28%] Built target metacall-python-open-test-depends -[ 28%] Built target memory -[ 28%] Built target dynlink --- Performing Test HAVE_CXX_FLAG_WALL - Success --- Performing Test HAVE_CXX_FLAG_WEXTRA -[ 28%] Linking CXX shared library ../../libmetacalld.so -[ 28%] Linking CXX shared library ../../libadtd.so -[ 28%] Built target adt -[ 28%] Built target metacall -[ 28%] Building C object source/filesystem/CMakeFiles/filesystem.dir/source/filesystem_directory_descriptor.c.o -[ 28%] Building C object source/filesystem/CMakeFiles/filesystem.dir/source/filesystem.c.o -[ 28%] Building C object source/loaders/cob_loader/CMakeFiles/cob_loader.dir/source/cob_loader.c.o -[ 28%] Building CXX object source/loaders/cob_loader/CMakeFiles/cob_loader.dir/source/cob_loader_impl.cpp.o -[ 28%] Building C object source/filesystem/CMakeFiles/filesystem.dir/source/filesystem_file_descriptor.c.o -[ 29%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin.c.o -[ 30%] Building C object source/serials/metacall_serial/CMakeFiles/metacall_serial.dir/source/metacall_serial.c.o -[ 30%] Building C object source/loaders/rpc_loader/CMakeFiles/rpc_loader.dir/source/rpc_loader.c.o -[ 30%] Building C object source/loaders/mock_loader/CMakeFiles/mock_loader.dir/source/mock_loader.c.o -[ 30%] Building C object source/loaders/node_loader/CMakeFiles/node_loader.dir/source/node_loader.c.o -[ 30%] Building C object source/loaders/java_loader/CMakeFiles/java_loader.dir/source/java_loader.c.o -[ 30%] Building C object source/loaders/ext_loader/CMakeFiles/ext_loader.dir/source/ext_loader.c.o -[ 30%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect.c.o -[ 30%] Building C object source/loaders/wasm_loader/CMakeFiles/wasm_loader.dir/source/wasm_loader.c.o -[ 30%] Building C object source/detours/plthook_detour/CMakeFiles/plthook_detour.dir/source/plthook_detour.c.o --- Performing Test HAVE_CXX_FLAG_WEXTRA - Success --- Performing Test HAVE_CXX_FLAG_WSHADOW -[ 30%] Building C object source/serials/rapid_json_serial/CMakeFiles/rapid_json_serial.dir/source/rapid_json_serial.c.o -[ 30%] Building C object source/loaders/rb_loader/CMakeFiles/rb_loader.dir/source/rb_loader.c.o -[ 30%] Building C object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader.c.o -[ 30%] Building C object source/loaders/file_loader/CMakeFiles/file_loader.dir/source/file_loader.c.o -[ 31%] Building CXX object source/loaders/node_loader/CMakeFiles/node_loader.dir/source/node_loader_impl.cpp.o -[ 31%] Building CXX object source/loaders/node_loader/CMakeFiles/node_loader.dir/source/node_loader_port.cpp.o -[ 31%] Building CXX object source/loaders/rpc_loader/CMakeFiles/rpc_loader.dir/source/rpc_loader_impl.cpp.o -[ 31%] Building C object source/serials/metacall_serial/CMakeFiles/metacall_serial.dir/source/metacall_serial_impl.c.o -[ 31%] Building CXX object source/loaders/java_loader/CMakeFiles/java_loader.dir/source/java_loader_impl.cpp.o -[ 31%] Building C object source/loaders/rb_loader/CMakeFiles/rb_loader.dir/source/rb_loader_impl.c.o -[ 31%] Building C object source/loaders/file_loader/CMakeFiles/file_loader.dir/source/file_loader_impl.c.o -[ 31%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_type.c.o -[ 31%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_type_id.c.o -[ 32%] Building CXX object source/loaders/ext_loader/CMakeFiles/ext_loader.dir/source/ext_loader_impl.cpp.o -[ 32%] Building CXX object source/serials/rapid_json_serial/CMakeFiles/rapid_json_serial.dir/source/rapid_json_serial_impl.cpp.o -[ 33%] Linking CXX shared library ../../libfilesystemd.so -[ 33%] Building C object source/detours/plthook_detour/CMakeFiles/plthook_detour.dir/source/plthook_detour_impl.c.o -[ 33%] Building C object source/loaders/rb_loader/CMakeFiles/rb_loader.dir/source/rb_loader_impl_parser.c.o -[ 33%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin_descriptor.c.o -[ 33%] Building C object source/loaders/wasm_loader/CMakeFiles/wasm_loader.dir/source/wasm_loader_impl.c.o -[ 33%] Building C object source/loaders/mock_loader/CMakeFiles/mock_loader.dir/source/mock_loader_impl.c.o --- Performing Test HAVE_CXX_FLAG_WSHADOW - Success --- Performing Test HAVE_CXX_FLAG_WERROR -[ 33%] Building C object source/serials/metacall_serial/CMakeFiles/metacall_serial.dir/source/metacall_serial_impl_serialize.c.o -[ 33%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_signature.c.o -[ 33%] Built target filesystem -[ 33%] Building C object source/detours/plthook_detour/CMakeFiles/plthook_detour.dir/plthook/plthook_elf.c.o -[ 33%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_function.c.o -[ 33%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin_impl.c.o -[ 33%] Linking CXX shared module ../../../libmock_loaderd.so -[ 33%] Building CXX object source/extensions/plugin_extension/CMakeFiles/plugin_extension.dir/source/plugin_extension.cpp.o -[ 33%] Building C object source/loaders/wasm_loader/CMakeFiles/wasm_loader.dir/source/wasm_loader_function.c.o -[ 33%] Building C object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader_impl.c.o --- Performing Test HAVE_CXX_FLAG_WERROR - Success -[ 33%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin_loader.c.o --- Performing Test HAVE_CXX_FLAG_WSUGGEST_OVERRIDE -[ 33%] Building C object source/loaders/wasm_loader/CMakeFiles/wasm_loader.dir/source/wasm_loader_handle.c.o -[ 33%] Built target mock_loader -[ 33%] Linking CXX shared module ../../../libfile_loaderd.so -[ 33%] Building C object source/serials/metacall_serial/CMakeFiles/metacall_serial.dir/source/metacall_serial_impl_deserialize.c.o -[ 33%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_attribute.c.o -[ 33%] Building C object source/ports/rb_port/CMakeFiles/rb_port.dir/__/__/__/rb_portRUBY_wrap.c.o -[ 33%] Building C object source/ports/rb_port/CMakeFiles/rb_port.dir/source/rb_port.c.o -[ 33%] Building C object source/plugin/CMakeFiles/plugin.dir/source/plugin_manager.c.o -[ 33%] Building CXX object source/loaders/node_loader/CMakeFiles/node_loader.dir/source/node_loader_trampoline.cpp.o -[ 33%] Built target file_loader -HEAD is now at e2239ee6 Googletest export -[ 33%] Linking CXX shared module ../../../libplthook_detourd.so -[ 34%] Building CXX object source/scripts/extension/sum/CMakeFiles/sum_extension.dir/source/sum_extension.cpp.o --- Performing Test HAVE_CXX_FLAG_WSUGGEST_OVERRIDE - Success --- Performing Test HAVE_CXX_FLAG_PEDANTIC -[ 34%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_constructor.c.o -[ 35%] Building CXX object source/examples/metacalllog/CMakeFiles/metacalllog.dir/main.cpp.o -[ 35%] Linking CXX shared module ../../../libcob_loaderd.so -[ 35%] Built target plthook_detour -[ 35%] Linking CXX shared module ../../../libmetacall_seriald.so -[ 35%] Building C object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader_port.c.o -[ 35%] Linking CXX shared library ../../libplugind.so -[ 36%] Linking CXX shared module ../../../libwasm_loaderd.so -[ 36%] No update step for 'google-test-depends' -Failed to run rustfmt: No such file or directory (os error 2) (non-fatal, continuing) -[ 36%] Built target rs_port_bindings --- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success --- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS -[ 36%] Building CXX object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader_threading.cpp.o -[ 36%] Linking CXX executable ../../../metacalllogd -[ 36%] No patch step for 'google-test-depends' -[ 36%] Built target metacall_serial -[ 37%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_memory_tracker.c.o -[ 37%] Built target plugin -[ 37%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_method.c.o -[ 37%] Built target cob_loader -[ 38%] Building C object source/loaders/py_loader/CMakeFiles/py_loader.dir/source/py_loader_dict.c.o -[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_class_visibility.c.o -[ 38%] Performing configure step for 'google-test-depends' -CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): - Compatibility with CMake < 3.10 will be removed from a future version of - CMake. - - Update the VERSION argument <min> value. Or, use the <min>...<max> syntax - to tell CMake that the project requires at least <min> but has been updated - to work with policies introduced by <max> or earlier. - - -[ 38%] Built target wasm_loader -[ 38%] Linking CXX shared module ../../../librb_loaderd.so -[ 38%] Building C object source/detour/CMakeFiles/detour.dir/source/detour.c.o -[ 38%] Built target metacalllog -[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_class.c.o -[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_object.c.o -[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_future.c.o --- The C compiler identification is GNU 14.2.0 --- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success --- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 -[ 38%] Built target rb_loader -[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_exception.c.o - Downloading crates ... -[ 38%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_throwable.c.o -/usr/local/metacall/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp: In function 'char* rapidjson::internal::Prettify(char*, int, int, int)': -/usr/local/metacall/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp:561:1: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow] - 561 | } - | ^ -[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_scope.c.o -In file included from /usr/include/python3.13d/internal/pycore_mimalloc.h:45, - from /usr/include/python3.13d/internal/pycore_interp.h:31, - from /usr/include/python3.13d/internal/pycore_runtime.h:17, - from /usr/include/python3.13d/internal/pycore_emscripten_trampoline.h:4, - from /usr/include/python3.13d/internal/pycore_object.h:13, - from /usr/include/python3.13d/internal/pycore_dict.h:13, - from /usr/local/metacall/source/loaders/py_loader/source/py_loader_dict.c:32: -/usr/include/python3.13d/internal/mimalloc/mimalloc/internal.h:90:12: warning: redundant redeclaration of '_mi_os_purge' [-Wredundant-decls] - 90 | bool _mi_os_purge(void* p, size_t size, mi_stats_t* stats); - | ^~~~~~~~~~~~ -/usr/include/python3.13d/internal/mimalloc/mimalloc/internal.h:84:12: note: previous declaration of '_mi_os_purge' with type '_Bool(void *, size_t, mi_stats_t *)' {aka '_Bool(void *, long unsigned int, struct mi_stats_s *)'} - 84 | bool _mi_os_purge(void* p, size_t size, mi_stats_t* stats); - | ^~~~~~~~~~~~ -/usr/include/python3.13d/internal/pycore_object.h: In function '_PyObject_HasDeferredRefcount': -/usr/include/python3.13d/internal/pycore_object.h:204:41: warning: unused parameter 'op' [-Wunused-parameter] - 204 | _PyObject_HasDeferredRefcount(PyObject *op) - | ~~~~~~~~~~^~ -/usr/include/python3.13d/internal/pycore_dict.h: In function '_PyDict_NotifyEvent': -/usr/include/python3.13d/internal/pycore_dict.h:273:5: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] - 273 | int watcher_bits = mp->ma_version_tag & DICT_WATCHER_MASK; - | ^~~ -In file included from /usr/include/python3.13d/dictobject.h:101, - from /usr/include/python3.13d/Python.h:90, - from /usr/local/metacall/source/loaders/py_loader/include/py_loader/py_loader_dict.h:26, - from /usr/local/metacall/source/loaders/py_loader/source/py_loader_dict.c:21: -/usr/include/python3.13d/cpython/dictobject.h:25:34: note: declared here - 25 | Py_DEPRECATED(3.12) uint64_t ma_version_tag; - | ^~~~~~~~~~~~~~ -/usr/include/python3.13d/internal/pycore_dict.h:278:5: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] - 278 | return DICT_NEXT_VERSION(interp) | (mp->ma_version_tag & DICT_WATCHER_AND_MODIFICATION_MASK); - | ^~~~~~ -/usr/include/python3.13d/cpython/dictobject.h:25:34: note: declared here - 25 | Py_DEPRECATED(3.12) uint64_t ma_version_tag; - | ^~~~~~~~~~~~~~ -[ 39%] Linking CXX shared library ../../libdetourd.so - Downloaded proc-macro2 v1.0.92 - Downloaded unicode-ident v1.0.14 - Downloaded quote v1.0.37 --- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed --- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING -[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value.c.o --- The CXX compiler identification is GNU 14.2.0 -[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_context.c.o --- Detecting C compiler ABI info -[ 39%] Built target detour -[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type.c.o -[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type_id_size.c.o - Compiling proc-macro2 v1.0.92 -[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type_promotion.c.o -[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type_demotion.c.o -[ 39%] Building C object source/reflect/CMakeFiles/reflect.dir/source/reflect_value_type_cast.c.o -[ 39%] Linking CXX shared module ../../../rb_portd.so - Compiling unicode-ident v1.0.14 - Compiling metacall v0.4.2 (/usr/local/metacall/source/ports/rs_port) - Restored /usr/local/metacall/source/loaders/cs_loader/netcore/source/project.csproj (in 3.59 sec). -[ 39%] Built target rb_port --- Detecting C compiler ABI info - done --- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success --- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS --- Check for working C compiler: /usr/bin/cc - skipped --- Detecting C compile features --- Detecting C compile features - done -[ 39%] Linking CXX shared module ../../../../libsum_extensiond.so --- Detecting CXX compiler ABI info -[ 40%] Linking CXX shared module ../../../libjava_loaderd.so -[ 41%] Linking CXX shared library ../../libreflectd.so -[ 41%] Built target sum_extension --- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Success --- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED --- Detecting CXX compiler ABI info - done -[ 41%] Built target java_loader -[ 41%] Built target reflect --- Check for working CXX compiler: /usr/bin/c++ - skipped --- Detecting CXX compile features --- Detecting CXX compile features - done -[ 41%] Building C object source/serial/CMakeFiles/serial.dir/source/serial.c.o -CMake Deprecation Warning at googlemock/CMakeLists.txt:45 (cmake_minimum_required): - Compatibility with CMake < 3.10 will be removed from a future version of - CMake. - - Update the VERSION argument <min> value. Or, use the <min>...<max> syntax - to tell CMake that the project requires at least <min> but has been updated - to work with policies introduced by <max> or earlier. - - -CMake Deprecation Warning at googletest/CMakeLists.txt:56 (cmake_minimum_required): - Compatibility with CMake < 3.10 will be removed from a future version of - CMake. - - Update the VERSION argument <min> value. Or, use the <min>...<max> syntax - to tell CMake that the project requires at least <min> but has been updated - to work with policies introduced by <max> or earlier. - - -[ 41%] Performing install step for 'libtcc-depends' --> /usr/local/metacall/build/libtcc/bin : tcc --> /usr/local/metacall/build/libtcc/lib/tcc : libtcc1.a runmain.o bt-exe.o bt-log.o bcheck.o --> /usr/local/metacall/build/libtcc/lib/tcc/include : ./include/*.h ./tcclib.h --> /usr/local/metacall/build/libtcc/lib : libtcc.so --> /usr/local/metacall/build/libtcc/include : ./libtcc.h --- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED - Success --- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING --> /usr/local/metacall/build/libtcc/share/man/man1 : tcc.1 -[ 41%] Linking CXX shared library ../../libseriald.so -[ 42%] No test step for 'libtcc-depends' -[ 42%] Built target serial -[ 43%] Building C object source/configuration/CMakeFiles/configuration.dir/source/configuration_impl.c.o -[ 43%] Building C object source/configuration/CMakeFiles/configuration.dir/source/configuration.c.o -[ 43%] Building C object source/configuration/CMakeFiles/configuration.dir/source/configuration_singleton.c.o -[ 43%] Building C object source/configuration/CMakeFiles/configuration.dir/source/configuration_object.c.o -[ 43%] Completed 'libtcc-depends' --- Found Python: /usr/bin/python3 (found version "3.13.2") found components: Interpreter -[ 43%] Linking CXX shared module ../../../libplugin_extensiond.so --- Performing Test CMAKE_HAVE_LIBC_PTHREAD --- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success --- Performing Test HAVE_CXX_FLAG_WD654 -[ 43%] Built target libtcc-depends --- Performing Test HAVE_CXX_FLAG_WD654 - Failed --- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY -[ 43%] Building CXX object source/loaders/c_loader/CMakeFiles/c_loader.dir/source/c_loader_impl.cpp.o -[ 43%] Building C object source/loaders/c_loader/CMakeFiles/c_loader.dir/source/c_loader.c.o -[ 43%] Built target plugin_extension -[ 43%] Building CXX object source/plugins/sandbox_plugin/CMakeFiles/sandbox_plugin.dir/source/sandbox_plugin.cpp.o -[ 43%] Building CXX object source/plugins/backtrace_plugin/CMakeFiles/backtrace_plugin.dir/source/backtrace_plugin.cpp.o --- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success --- Found Threads: TRUE -[ 43%] Linking CXX shared library ../../libconfigurationd.so --- Configuring done (2.0s) -[ 43%] Built target ts_loader_bootstrap_build --- Generating done (0.0s) --- Build files have been written to: /usr/local/metacall/build/source/tests/src/google-test-depends-build --- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed --- Performing Test HAVE_CXX_FLAG_COVERAGE -[ 43%] Performing build step for 'google-test-depends' -Copying ts_loader_bootstrap dependencies -In function 'int64_t node_loader_impl_user_async_handles_count(loader_impl_node)', - inlined from 'void node_loader_impl_destroy_cb(loader_impl_node)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4349:94, - inlined from 'void node_loader_impl_destroy_prepare_cb(uv_prepare_t*)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4370:29: -/usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4506:66: warning: assuming signed overflow does not occur when simplifying 'X - Y <= 0' to 'X <= Y' [-Wstrict-overflow] - 4506 | return active_handles - node_impl->base_active_handles - extra_active_handles; - | ^~~~~~~~~~~~~~~~~~~~ -In function 'int64_t node_loader_impl_user_async_handles_count(loader_impl_node)', - inlined from 'void node_loader_impl_destroy_cb(loader_impl_node)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4349:94, - inlined from 'void node_loader_impl_destroy_check_cb(uv_check_t*)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4377:29: -/usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4506:66: warning: assuming signed overflow does not occur when simplifying 'X - Y <= 0' to 'X <= Y' [-Wstrict-overflow] - 4506 | return active_handles - node_impl->base_active_handles - extra_active_handles; - | ^~~~~~~~~~~~~~~~~~~~ - Compiling quote v1.0.37 -[ 43%] Built target configuration -MSBuild version 17.7.6+77d58ec69 for .NET -[ 43%] Building C object source/loader/CMakeFiles/loader.dir/source/loader_impl.c.o -[ 43%] Building C object source/loader/CMakeFiles/loader.dir/source/loader.c.o -[ 12%] Building CXX object googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -[ 43%] Building C object source/loader/CMakeFiles/loader.dir/source/loader_host.c.o -[ 43%] Building C object source/loader/CMakeFiles/loader.dir/source/loader_manager_impl.c.o --- Performing Test HAVE_CXX_FLAG_COVERAGE - Success --- Performing Test HAVE_STD_REGEX --- Performing Test HAVE_STD_REGEX -In file included from /usr/local/include/rapidjson/writer.h:23, - from /usr/local/metacall/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp:21: -In function 'char* rapidjson::internal::WriteExponent(int, char*)', - inlined from 'char* rapidjson::internal::Prettify(char*, int, int, int)' at /usr/local/include/rapidjson/internal/dtoa.h:216:29, - inlined from 'char* rapidjson::internal::dtoa(double, char*, int)' at /usr/local/include/rapidjson/internal/dtoa.h:238:24, - inlined from 'char* rapidjson::internal::dtoa(double, char*, int)' at /usr/local/include/rapidjson/internal/dtoa.h:220:14, - inlined from 'bool rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags>::WriteDouble(double) [with OutputStream = rapidjson::GenericStringBuffer<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator; unsigned int writeFlags = 0]' at /usr/local/include/rapidjson/writer.h:579:31, - inlined from 'bool rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags>::WriteDouble(double) [with OutputStream = rapidjson::GenericStringBuffer<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator; unsigned int writeFlags = 0]' at /usr/local/include/rapidjson/writer.h:552:13, - inlined from 'bool rapidjson::Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags>::Double(double) [with OutputStream = rapidjson::GenericStringBuffer<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator; unsigned int writeFlags = 0]' at /usr/local/include/rapidjson/writer.h:195:83, - inlined from 'bool rapidjson::GenericValue<Encoding, Allocator>::Accept(Handler&) const [with Handler = rapidjson::Writer<rapidjson::GenericStringBuffer<rapidjson::UTF8<> > >; Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>]' at /usr/local/include/rapidjson/document.h:1979:58: -/usr/local/include/rapidjson/internal/dtoa.h:131:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow] - 131 | if (K < 0) { - | ^~ -/usr/local/include/rapidjson/internal/dtoa.h:136:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow] - 136 | if (K >= 100) { - | ^~ -ts_loader_bootstrap dependencies copied from /usr/local/metacall/source/loaders/ts_loader/bootstrap/node_modules to /usr/local/metacall/build/node_modules -[ 43%] Built target ts_loader_bootstrap -[ 43%] Linking CXX shared module ../../../libpy_loaderd.so - Compiling metacall-inline v0.2.0 (/usr/local/metacall/source/ports/rs_port/inline) -[ 43%] Built target py_loader -[ 44%] Linking CXX shared module ../../../librpc_loaderd.so - Determining projects to restore... -[ 44%] Linking CXX shared library ../../libloaderd.so -[ 44%] Built target rpc_loader -[ 44%] Built target loader -[ 44%] Linking CXX shared module ../../../libext_loaderd.so -[ 44%] Built target ext_loader -In file included from /usr/local/include/rapidjson/reader.h:26, - from /usr/local/include/rapidjson/document.h:20, - from /usr/local/metacall/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp:18: -In function 'double rapidjson::internal::FastPath(double, int)', - inlined from 'double rapidjson::internal::StrtodNormalPrecision(double, int)' at /usr/local/include/rapidjson/internal/strtod.h:41:21, - inlined from 'void rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::ParseNumber(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]' at /usr/local/include/rapidjson/reader.h:1717:55, - inlined from 'void rapidjson::GenericReader<SourceEncoding, TargetEncoding, StackAllocator>::ParseValue(InputStream&, Handler&) [with unsigned int parseFlags = 0; InputStream = rapidjson::EncodedInputStream<rapidjson::UTF8<>, rapidjson::MemoryStream>; Handler = rapidjson::GenericDocument<rapidjson::UTF8<> >; SourceEncoding = rapidjson::UTF8<>; TargetEncoding = rapidjson::UTF8<>; StackAllocator = rapidjson::CrtAllocator]' at /usr/local/include/rapidjson/reader.h:1761:46: -/usr/local/include/rapidjson/internal/strtod.h:29:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow] - 29 | if (exp < -308) - | ^~ - All projects are up-to-date for restore. -In function 'int64_t node_loader_impl_user_async_handles_count(loader_impl_node)', - inlined from 'void node_loader_impl_destroy_safe(napi_env, loader_impl_async_destroy_safe_type*)' at /usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4402:47: -/usr/local/metacall/source/loaders/node_loader/source/node_loader_impl.cpp:4506:66: warning: assuming signed overflow does not occur when simplifying 'X - Y <= 0' to 'X <= Y' [-Wstrict-overflow] - 4506 | return active_handles - node_impl->base_active_handles - extra_active_handles; - | ^~~~~~~~~~~~~~~~~~~~ - Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.90s -[ 44%] Built target rs_port -[ 44%] Linking CXX shared module ../../../librapid_json_seriald.so -[ 44%] Built target rapid_json_serial -[ 44%] Linking CXX shared module ../../../plugins/sandbox_plugin/libsandbox_plugind.so -[ 44%] Built target sandbox_plugin -[ 44%] Linking CXX shared module ../../../libnode_loaderd.so -[ 44%] Built target node_loader -[ 44%] Building C object source/loaders/ts_loader/CMakeFiles/ts_loader.dir/source/ts_loader.c.o -[ 45%] Building CXX object source/cli/plugins/cli_sandbox_plugin/CMakeFiles/cli_sandbox_plugin.dir/source/cli_sandbox_plugin.cpp.o -[ 45%] Building CXX object source/loaders/ts_loader/CMakeFiles/ts_loader.dir/source/ts_loader_impl.cpp.o -[ 45%] Built target cli_cmd_plugin -[ 45%] Built target cli_repl_plugin -[ 45%] Building CXX object source/cli/plugins/cli_core_plugin/CMakeFiles/cli_core_plugin.dir/source/cli_core_plugin.cpp.o -[ 45%] Linking CXX shared module ../../../libc_loaderd.so --- Performing Test HAVE_STD_REGEX -- success --- Performing Test HAVE_GNU_POSIX_REGEX --- Performing Test HAVE_GNU_POSIX_REGEX -[ 45%] Linking CXX shared module ../../../../plugins/cli/cmd/cli_sandbox_plugin/libcli_sandbox_plugind.so -[ 45%] Linking CXX shared module ../../../plugins/backtrace_plugin/libbacktrace_plugind.so -[ 45%] Built target c_loader --- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile --- Performing Test HAVE_POSIX_REGEX --- Performing Test HAVE_POSIX_REGEX -[ 45%] Built target cli_sandbox_plugin -[ 45%] Built target backtrace_plugin -[ 46%] Linking CXX shared module ../../../libts_loaderd.so -[ 46%] Built target ts_loader --- Performing Test HAVE_POSIX_REGEX -- success --- Performing Test HAVE_STEADY_CLOCK --- Performing Test HAVE_STEADY_CLOCK -Installing node_port --- Performing Test HAVE_STEADY_CLOCK -- success --- Performing Test CMAKE_HAVE_LIBC_PTHREAD --- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success --- Found Threads: TRUE --- Configuring done (11.1s) --- Generating done (0.0s) --- Build files have been written to: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/src/google-bench-depends-build -[ 46%] Performing build step for 'google-bench-depends' -[ 9%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_name.cc.o -[ 9%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark.cc.o -[ 18%] Building CXX object src/CMakeFiles/benchmark.dir/csv_reporter.cc.o -[ 18%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_api_internal.cc.o -[ 22%] Building CXX object src/CMakeFiles/benchmark.dir/commandlineflags.cc.o -[ 27%] Building CXX object src/CMakeFiles/benchmark.dir/json_reporter.cc.o -[ 31%] Building CXX object src/CMakeFiles/benchmark.dir/sleep.cc.o -[ 40%] Building CXX object src/CMakeFiles/benchmark.dir/statistics.cc.o -[ 40%] Building CXX object src/CMakeFiles/benchmark.dir/complexity.cc.o -[ 45%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_register.cc.o -[ 50%] Building CXX object src/CMakeFiles/benchmark.dir/counter.cc.o -[ 54%] Building CXX object src/CMakeFiles/benchmark.dir/benchmark_runner.cc.o -[ 63%] Building CXX object src/CMakeFiles/benchmark.dir/colorprint.cc.o -[ 68%] Building CXX object src/CMakeFiles/benchmark.dir/console_reporter.cc.o -[ 68%] Building CXX object src/CMakeFiles/benchmark.dir/reporter.cc.o -[ 72%] Building CXX object src/CMakeFiles/benchmark.dir/timers.cc.o -[ 77%] Building CXX object src/CMakeFiles/benchmark.dir/string_util.cc.o -[ 81%] Building CXX object src/CMakeFiles/benchmark.dir/perf_counters.cc.o -[ 86%] Building CXX object src/CMakeFiles/benchmark.dir/sysinfo.cc.o -[ 25%] Linking CXX static library ../lib/libgtest.a - project -> /usr/local/metacall/source/loaders/cs_loader/netcore/source/bin/Debug/net7.0/CSLoader.dll - project -> /usr/local/metacall/build/ -[ 25%] Built target gtest -[ 37%] Building CXX object googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o -[ 50%] Building CXX object googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o -[ 46%] Built target cs_loader_impl - -up to date, audited 81 packages in 1s - -20 packages are looking for funding - run `npm fund` for details - -3 moderate severity vulnerabilities - -To address all issues (including breaking changes), run: - npm audit fix --force - -Run `npm audit` for details. -[ 46%] Building CXX object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/netcore.cpp.o -[ 47%] Building CXX object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/simple_netcore.cpp.o -[ 47%] Building C object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/cs_loader.c.o -[ 47%] Building CXX object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/netcore_linux.cpp.o -[ 47%] Building C object source/loaders/cs_loader/CMakeFiles/cs_loader.dir/source/cs_loader_impl.c.o -[ 47%] Built target node_port -[ 47%] Linking CXX shared module ../../../../plugins/cli/repl/cli_core_plugin/libcli_core_plugind.so -[ 47%] Built target cli_core_plugin -[ 47%] Building CXX object source/cli/metacallcli/CMakeFiles/metacallcli.dir/source/main.cpp.o -[ 47%] Building CXX object source/cli/metacallcli/CMakeFiles/metacallcli.dir/source/application.cpp.o -[ 62%] Linking CXX static library ../lib/libgtest_main.a -[ 62%] Built target gtest_main -[ 47%] Linking CXX shared module ../../../libcs_loaderd.so -[ 47%] Built target cs_loader -[ 75%] Linking CXX static library ../lib/libgmock.a -[ 75%] Built target gmock -[ 47%] Linking CXX executable ../../../metacallclid -[ 87%] Building CXX object googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o -[ 47%] Built target metacallcli -[100%] Linking CXX static library ../lib/libgmock_main.a -[100%] Built target gmock_main -[ 47%] No install step for 'google-test-depends' -[ 47%] No test step for 'google-test-depends' -[ 47%] Completed 'google-test-depends' -[ 47%] Built target google-test-depends -[ 47%] Building CXX object source/tests/log_test/CMakeFiles/log-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/reflect_scope_test/CMakeFiles/reflect-scope-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/preprocessor_test/CMakeFiles/preprocessor-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/adt_vector_test/CMakeFiles/adt-vector-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/detour_test/CMakeFiles/detour-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/log_custom_test/CMakeFiles/log-custom-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/reflect_object_class_test/CMakeFiles/reflect-object-class-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/reflect_metadata_test/CMakeFiles/reflect-metadata-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/environment_test/CMakeFiles/environment-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/metacall_logs_test/CMakeFiles/metacall-logs-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/configuration_test/CMakeFiles/configuration-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/adt_set_test/CMakeFiles/adt-set-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/metacall_load_memory_empty_test/CMakeFiles/metacall-load-memory-empty-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/adt_map_test/CMakeFiles/adt-map-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/serial_test/CMakeFiles/serial-test.dir/source/main.cpp.o -[ 47%] Building CXX object source/tests/metacall_load_memory_test/CMakeFiles/metacall-load-memory-test.dir/source/main.cpp.o -[ 48%] Building CXX object source/tests/reflect_function_test/CMakeFiles/reflect-function-test.dir/source/main.cpp.o -[ 48%] Building CXX object source/tests/portability_path_test/CMakeFiles/portability-path-test.dir/source/main.cpp.o -[ 48%] Building CXX object source/tests/dynlink_test/CMakeFiles/dynlink-test.dir/source/main.cpp.o -[ 48%] Building CXX object source/tests/rb_loader_parser_test/CMakeFiles/rb-loader-parser-test.dir/source/main.cpp.o -[ 48%] Building CXX object source/tests/metacall_load_configuration_test/CMakeFiles/metacall-load-configuration-test.dir/source/main.cpp.o -[ 49%] Building CXX object source/tests/adt_trie_test/CMakeFiles/adt-trie-test.dir/source/main.cpp.o -[ 49%] Building CXX object source/tests/metacall_load_memory_test/CMakeFiles/metacall-load-memory-test.dir/source/metacall_load_memory_test.cpp.o -[ 49%] Building CXX object source/tests/log_custom_test/CMakeFiles/log-custom-test.dir/source/log_custom_test.cpp.o -[ 49%] Building CXX object source/tests/metacall_load_memory_empty_test/CMakeFiles/metacall-load-memory-empty-test.dir/source/metacall_load_memory_empty_test.cpp.o -[ 49%] Building CXX object source/tests/reflect_metadata_test/CMakeFiles/reflect-metadata-test.dir/source/reflect_metadata_test.cpp.o -[ 49%] Building CXX object source/tests/adt_vector_test/CMakeFiles/adt-vector-test.dir/source/adt_vector_test.cpp.o -[ 49%] Building CXX object source/tests/portability_path_test/CMakeFiles/portability-path-test.dir/source/portability_path_test.cpp.o -[ 90%] Linking CXX static library libbenchmark.a -[ 49%] Building CXX object source/tests/reflect_scope_test/CMakeFiles/reflect-scope-test.dir/source/reflect_scope_test.cpp.o -[ 49%] Building CXX object source/tests/detour_test/CMakeFiles/detour-test.dir/source/detour_test.cpp.o -[ 90%] Built target benchmark -[ 49%] Building CXX object source/tests/metacall_load_configuration_test/CMakeFiles/metacall-load-configuration-test.dir/source/metacall_load_configuration_test.cpp.o -[ 49%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_bool_test.cpp.o -[ 49%] Building CXX object source/tests/log_test/CMakeFiles/log-test.dir/source/log_test.cpp.o -[ 50%] Building CXX object source/tests/reflect_object_class_test/CMakeFiles/reflect-object-class-test.dir/source/reflect_object_class_test.cpp.o -[ 50%] Building CXX object source/tests/adt_map_test/CMakeFiles/adt-map-test.dir/source/adt_map_test.cpp.o -[ 95%] Building CXX object src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o -[ 50%] Building CXX object source/tests/adt_trie_test/CMakeFiles/adt-trie-test.dir/source/adt_trie_test.cpp.o -[ 50%] Building CXX object source/tests/adt_set_test/CMakeFiles/adt-set-test.dir/source/adt_set_test.cpp.o -[ 50%] Building CXX object source/tests/rb_loader_parser_test/CMakeFiles/rb-loader-parser-test.dir/source/rb_loader_parser_test.cpp.o -[ 51%] Building CXX object source/tests/metacall_logs_test/CMakeFiles/metacall-logs-test.dir/source/metacall_logs_test.cpp.o -[ 50%] Building CXX object source/tests/preprocessor_test/CMakeFiles/preprocessor-test.dir/source/preprocessor_test.cpp.o -[ 51%] Building CXX object source/tests/reflect_function_test/CMakeFiles/reflect-function-test.dir/source/reflect_function_test.cpp.o -[ 51%] Building CXX object source/tests/environment_test/CMakeFiles/environment-test.dir/source/environment_test.cpp.o -[ 51%] Building CXX object source/tests/serial_test/CMakeFiles/serial-test.dir/source/serial_test.cpp.o -[ 51%] Building CXX object source/tests/configuration_test/CMakeFiles/configuration-test.dir/source/configuration_test.cpp.o -[ 51%] Building CXX object source/tests/dynlink_test/CMakeFiles/dynlink-test.dir/source/dynlink_test.cpp.o -[100%] Linking CXX static library libbenchmark_main.a -[100%] Built target benchmark_main -[ 51%] Performing install step for 'google-bench-depends' -[ 90%] Built target benchmark -[100%] Built target benchmark_main -Install the project... --- Install configuration: "Release" --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/libbenchmark.a --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/libbenchmark_main.a --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/include/benchmark --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/include/benchmark/benchmark.h --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/cmake/benchmark/benchmarkConfig.cmake --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/cmake/benchmark/benchmarkConfigVersion.cmake --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/pkgconfig/benchmark.pc --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/cmake/benchmark/benchmarkTargets.cmake --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/lib/cmake/benchmark/benchmarkTargets-release.cmake --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/platform_specific_build_instructions.md --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/random_interleaving.md --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/AssemblyTests.md --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/perf_counters.md --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/index.md --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/dependencies.md --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/releasing.md --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/_config.yml --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/user_guide.md --- Installing: /usr/local/metacall/build/source/benchmarks/google-bench-depends-prefix/share/doc/benchmark/tools.md -[ 51%] No test step for 'google-bench-depends' -[ 51%] Completed 'google-bench-depends' -[ 51%] Built target google-bench-depends -[ 51%] Building CXX object source/tests/metacall_load_configuration_fail_test/CMakeFiles/metacall-load-configuration-fail-test.dir/source/main.cpp.o -[ 51%] Linking CXX executable ../../../metacall-load-memory-empty-testd -[ 51%] Linking CXX executable ../../../adt-vector-testd -[ 51%] Linking CXX executable ../../../log-custom-testd -[ 51%] Built target metacall-load-memory-empty-test -[ 51%] Building CXX object source/tests/metacall_load_configuration_relative_test/CMakeFiles/metacall-load-configuration-relative-test.dir/source/main.cpp.o -[ 51%] Linking CXX executable ../../../metacall-logs-testd -[ 51%] Linking CXX executable ../../../adt-trie-testd -[ 51%] Linking CXX executable ../../../metacall-load-memory-testd -[ 51%] Built target log-custom-test -[ 51%] Built target adt-vector-test -[ 51%] Building CXX object source/tests/metacall_load_configuration_node_python_test/CMakeFiles/metacall-load-configuration-node-python-test.dir/source/main.cpp.o -[ 52%] Building CXX object source/tests/metacall_load_configuration_python_node_test/CMakeFiles/metacall-load-configuration-python-node-test.dir/source/main.cpp.o -[ 52%] Built target metacall-logs-test -[ 52%] Building CXX object source/tests/metacall_duplicated_handle_test/CMakeFiles/metacall-duplicated-handle-test.dir/source/main.cpp.o -[ 52%] Built target adt-trie-test -[ 52%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_char_test.cpp.o -[ 52%] Built target metacall-load-memory-test -[ 53%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_short_test.cpp.o -[ 53%] Building CXX object source/tests/metacall_load_configuration_fail_test/CMakeFiles/metacall-load-configuration-fail-test.dir/source/metacall_load_configuration_fail_test.cpp.o -[ 53%] Linking CXX executable ../../../environment-testd -[ 53%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_int_test.cpp.o -[ 53%] Linking CXX executable ../../../adt-set-testd -[ 53%] Linking CXX executable ../../../detour-testd -[ 53%] Linking CXX executable ../../../adt-map-testd -[ 53%] Linking CXX executable ../../../reflect-function-testd -[ 53%] Built target environment-test -[ 53%] Linking CXX executable ../../../dynlink-testd -[ 54%] Linking CXX executable ../../../log-testd -[ 54%] Building CXX object source/tests/metacall_duplicated_symbols_test/CMakeFiles/metacall-duplicated-symbols-test.dir/source/main.cpp.o -[ 54%] Linking CXX executable ../../../preprocessor-testd -[ 54%] Linking CXX executable ../../../reflect-metadata-testd -[ 54%] Built target detour-test -[ 54%] Built target adt-map-test -[ 54%] Built target adt-set-test -[ 54%] Building CXX object source/tests/metacall_test/CMakeFiles/metacall-test.dir/source/main.cpp.o -[ 54%] Building CXX object source/tests/metacall_load_configuration_relative_test/CMakeFiles/metacall-load-configuration-relative-test.dir/source/metacall_load_configuration_relative_test.cpp.o -[ 54%] Built target reflect-function-test -[ 54%] Building CXX object source/tests/metacall_handle_export_test/CMakeFiles/metacall-handle-export-test.dir/source/main.cpp.o -[ 54%] Building CXX object source/tests/metacall_duplicated_symbols_test/CMakeFiles/metacall-duplicated-symbols-test.dir/source/metacall_duplicated_symbols_test.cpp.o -[ 55%] Building CXX object source/tests/metacall_handle_get_test/CMakeFiles/metacall-handle-get-test.dir/source/main.cpp.o -[ 55%] Built target log-test -[ 55%] Built target dynlink-test -[ 55%] Building CXX object source/tests/metacall_node_test/CMakeFiles/metacall-node-test.dir/source/main.cpp.o -[ 55%] Built target preprocessor-test -[ 55%] Building CXX object source/tests/metacall_node_event_loop_test/CMakeFiles/metacall-node-event-loop-test.dir/source/main.cpp.o -[ 55%] Built target reflect-metadata-test -[ 55%] Building CXX object source/tests/metacall_node_event_loop_test/CMakeFiles/metacall-node-event-loop-test.dir/source/metacall_node_event_loop_test.cpp.o -[ 56%] Building CXX object source/tests/metacall_node_test/CMakeFiles/metacall-node-test.dir/source/metacall_node_test.cpp.o -[ 56%] Building C object source/tests/rb_loader_parser_test/CMakeFiles/rb-loader-parser-test.dir/__/__/loaders/rb_loader/source/rb_loader_impl_parser.c.o -[ 56%] Building CXX object source/tests/metacall_duplicated_handle_test/CMakeFiles/metacall-duplicated-handle-test.dir/source/metacall_duplicated_handle_test.cpp.o -[ 56%] Building CXX object source/tests/metacall_load_configuration_node_python_test/CMakeFiles/metacall-load-configuration-node-python-test.dir/source/metacall_load_configuration_node_python_test.cpp.o -[ 56%] Building CXX object source/tests/metacall_load_configuration_python_node_test/CMakeFiles/metacall-load-configuration-python-node-test.dir/source/metacall_load_configuration_python_node_test.cpp.o -[ 57%] Linking CXX executable ../../../rb-loader-parser-testd -[ 57%] Linking CXX executable ../../../configuration-testd -[ 57%] Linking CXX executable ../../../reflect-scope-testd -[ 57%] Built target rb-loader-parser-test -[ 58%] Building CXX object source/tests/metacall_node_event_loop_signal_test/CMakeFiles/metacall-node-event-loop-signal-test.dir/source/main.cpp.o -[ 58%] Built target configuration-test -[ 58%] Building CXX object source/tests/metacall_node_call_test/CMakeFiles/metacall-node-call-test.dir/source/main.cpp.o -[ 58%] Built target reflect-scope-test -[ 58%] Building CXX object source/tests/metacall_node_inline_test/CMakeFiles/metacall-node-inline-test.dir/source/main.cpp.o -[ 58%] Building CXX object source/tests/metacall_node_async_test/CMakeFiles/metacall-node-async-test.dir/source/main.cpp.o -[ 58%] Building CXX object source/tests/metacall_handle_export_test/CMakeFiles/metacall-handle-export-test.dir/source/metacall_handle_export_test.cpp.o -[ 59%] Linking CXX executable ../../../metacall-load-configuration-testd -[ 59%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_long_test.cpp.o -[ 59%] Building CXX object source/tests/metacall_node_inline_test/CMakeFiles/metacall-node-inline-test.dir/source/metacall_node_inline_test.cpp.o -[ 60%] Building CXX object source/tests/metacall_test/CMakeFiles/metacall-test.dir/source/metacall_test.cpp.o -[ 61%] Building CXX object source/tests/metacall_node_async_multiple_test/CMakeFiles/metacall-node-async-multiple-test.dir/source/main.cpp.o -[ 61%] Building CXX object source/tests/metacall_handle_get_test/CMakeFiles/metacall-handle-get-test.dir/source/metacall_handle_get_test.cpp.o -[ 61%] Linking CXX executable ../../../metacall-load-configuration-fail-testd -[ 61%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_float_test.cpp.o -[ 61%] Built target metacall-load-configuration-test -[ 61%] Building CXX object source/tests/metacall_node_reentrant_test/CMakeFiles/metacall-node-reentrant-test.dir/source/main.cpp.o -[ 61%] Linking CXX executable ../../../metacall-node-event-loop-testd -[ 61%] Linking CXX executable ../../../metacall-duplicated-symbols-testd -[ 61%] Built target metacall-load-configuration-fail-test -[ 61%] Building CXX object source/tests/metacall_node_reentrant_test/CMakeFiles/metacall-node-reentrant-test.dir/source/metacall_node_reentrant_test.cpp.o -[ 61%] Built target metacall-duplicated-symbols-test -[ 61%] Linking CXX executable ../../../metacall-load-configuration-relative-testd -[ 61%] Built target metacall-node-event-loop-test -[ 61%] Building CXX object source/tests/metacall_node_port_test/CMakeFiles/metacall-node-port-test.dir/source/main.cpp.o -[ 61%] Building CXX object source/tests/metacall_node_async_test/CMakeFiles/metacall-node-async-test.dir/source/metacall_node_async_test.cpp.o -[ 61%] Building CXX object source/tests/metacall_node_event_loop_signal_test/CMakeFiles/metacall-node-event-loop-signal-test.dir/source/metacall_node_event_loop_signal_test.cpp.o -[ 61%] Building CXX object source/tests/reflect_value_cast_test/CMakeFiles/reflect-value-cast-test.dir/source/reflect_value_cast_double_test.cpp.o -[ 61%] Building CXX object source/tests/metacall_node_async_multiple_test/CMakeFiles/metacall-node-async-multiple-test.dir/source/metacall_node_async_multiple_test.cpp.o -[ 61%] Building CXX object source/tests/metacall_node_call_test/CMakeFiles/metacall-node-call-test.dir/source/metacall_node_call_test.cpp.o -[ 61%] Linking CXX executable ../../../metacall-load-configuration-node-python-testd -[ 61%] Building CXX object source/tests/metacall_node_port_test/CMakeFiles/metacall-node-port-test.dir/source/metacall_node_port_test.cpp.o -[ 61%] Linking CXX executable ../../../metacall-load-configuration-python-node-testd -[ 61%] Built target metacall-load-configuration-relative-test -[ 61%] Building CXX object source/tests/metacall_node_port_await_test/CMakeFiles/metacall-node-port-await-test.dir/source/main.cpp.o -[ 61%] Linking CXX executable ../../../serial-testd -[ 61%] Linking CXX executable ../../../portability-path-testd -[ 61%] Built target metacall-load-configuration-node-python-test -[ 61%] Building CXX object source/tests/metacall_node_port_c_lib_test/CMakeFiles/metacall-node-port-c-lib-test.dir/source/main.cpp.o -[ 61%] Built target metacall-load-configuration-python-node-test -[ 61%] Building CXX object source/tests/metacall_node_python_port_mock_test/CMakeFiles/metacall-node-python-port-mock-test.dir/source/main.cpp.o -[ 61%] Linking CXX executable ../../../reflect-object-class-testd -[ 61%] Building CXX object source/tests/metacall_node_python_port_ruby_test/CMakeFiles/metacall-node-python-port-ruby-test.dir/source/main.cpp.o -[ 61%] Built target serial-test -[ 61%] Linking CXX executable ../../../metacall-duplicated-handle-testd -[ 61%] Building CXX object source/tests/metacall_node_python_port_mock_test/CMakeFiles/metacall-node-python-port-mock-test.dir/source/metacall_node_python_port_mock_test.cpp.o -[ 61%] Building CXX object source/tests/metacall_node_port_c_lib_test/CMakeFiles/metacall-node-port-c-lib-test.dir/source/metacall_node_port_c_lib_test.cpp.o -[ 61%] Built target portability-path-test -[ 61%] Building CXX object source/tests/metacall_node_python_ruby_test/CMakeFiles/metacall-node-python-ruby-test.dir/source/main.cpp.o -[ 61%] Built target reflect-object-class-test -[ 61%] Building CXX object source/tests/metacall_node_callback_test/CMakeFiles/metacall-node-callback-test.dir/source/main.cpp.o -[ 61%] Built target metacall-duplicated-handle-test -[ 61%] Building CXX object source/tests/metacall_node_fail_test/CMakeFiles/metacall-node-fail-test.dir/source/main.cpp.o -[ 61%] Building CXX object source/tests/metacall_node_fail_env_var_test/CMakeFiles/metacall-node-fail-env-var-test.dir/source/main.cpp.o -[ 61%] Linking CXX executable ../../../metacall-node-testd -[ 61%] Built target metacall-node-test -[ 61%] Building CXX object source/tests/metacall_node_fail_load_leak_test/CMakeFiles/metacall-node-fail-load-leak-test.dir/source/main.cpp.o -[ 62%] Building CXX object source/tests/metacall_node_fail_load_leak_test/CMakeFiles/metacall-node-fail-load-leak-test.dir/source/metacall_node_fail_load_leak_test.cpp.o -[ 62%] Building CXX object source/tests/metacall_node_port_await_test/CMakeFiles/metacall-node-port-await-test.dir/source/metacall_node_port_await_test.cpp.o -[ 62%] Building CXX object source/tests/metacall_node_python_port_ruby_test/CMakeFiles/metacall-node-python-port-ruby-test.dir/source/metacall_node_python_port_ruby_test.cpp.o -[ 62%] Building CXX object source/tests/metacall_node_typescript_test/CMakeFiles/metacall-node-typescript-test.dir/source/main.cpp.o -[ 62%] Building CXX object source/tests/metacall_node_python_async_after_destroy_test/CMakeFiles/metacall-node-python-async-after-destroy-test.dir/source/main.cpp.o -[ 62%] Linking CXX executable ../../../metacall-handle-export-testd -[ 62%] Linking CXX executable ../../../metacall-node-event-loop-signal-testd -[ 63%] Building CXX object source/tests/metacall_node_python_async_after_destroy_test/CMakeFiles/metacall-node-python-async-after-destroy-test.dir/source/metacall_node_python_async_after_destroy_test.cpp.o -[ 63%] Linking CXX executable ../../../metacall-node-inline-testd -[ 63%] Building CXX object source/tests/metacall_node_python_ruby_test/CMakeFiles/metacall-node-python-ruby-test.dir/source/metacall_node_python_ruby_test.cpp.o -[ 64%] Linking CXX executable ../../../metacall-node-call-testd -[ 64%] Built target metacall-handle-export-test -[ 64%] Linking CXX executable ../../../metacall-node-python-port-mock-testd -[ 64%] Built target metacall-node-event-loop-signal-test -[ 64%] Building CXX object source/tests/metacall_node_python_await_test/CMakeFiles/metacall-node-python-await-test.dir/source/main.cpp.o -[ 64%] Building CXX object source/tests/metacall_node_callback_test/CMakeFiles/metacall-node-callback-test.dir/source/metacall_node_callback_test.cpp.o -[ 64%] Building CXX object source/tests/metacall_node_python_await_test/CMakeFiles/metacall-node-python-await-test.dir/source/metacall_node_python_await_test.cpp.o -[ 64%] Linking CXX executable ../../../metacall-node-port-c-lib-testd -[ 64%] Built target metacall-node-inline-test -[ 65%] Building CXX object source/tests/metacall_node_python_exception_test/CMakeFiles/metacall-node-python-exception-test.dir/source/main.cpp.o -[ 65%] Linking CXX executable ../../../reflect-value-cast-testd -[ 65%] Building CXX object source/tests/metacall_node_fail_test/CMakeFiles/metacall-node-fail-test.dir/source/metacall_node_fail_test.cpp.o -[ 65%] Linking CXX executable ../../../metacall-node-port-testd -[ 65%] Built target metacall-node-python-port-mock-test -[ 65%] Built target metacall-node-call-test -[ 65%] Building CXX object source/tests/metacall_node_clear_mem_test/CMakeFiles/metacall-node-clear-mem-test.dir/source/main.cpp.o -[ 65%] Building CXX object source/tests/metacall_node_async_resources_test/CMakeFiles/metacall-node-async-resources-test.dir/source/main.cpp.o -[ 65%] Building CXX object source/tests/metacall_node_fail_env_var_test/CMakeFiles/metacall-node-fail-env-var-test.dir/source/metacall_node_fail_env_var_test.cpp.o -[ 65%] Built target metacall-node-port-c-lib-test -[ 65%] Building CXX object source/tests/metacall_node_async_resources_test/CMakeFiles/metacall-node-async-resources-test.dir/source/metacall_node_async_resources_test.cpp.o -[ 65%] Linking CXX executable ../../../metacall-node-reentrant-testd -[ 65%] Built target metacall-node-port-test -[ 65%] Building CXX object source/tests/metacall_node_await_chain_test/CMakeFiles/metacall-node-await-chain-test.dir/source/main.cpp.o -[ 65%] Built target reflect-value-cast-test -[ 65%] Linking CXX executable ../../../metacall-handle-get-testd -[ 65%] Building CXX object source/tests/metacall_node_exception_test/CMakeFiles/metacall-node-exception-test.dir/source/main.cpp.o -[ 65%] Building CXX object source/tests/metacall_node_exception_test/CMakeFiles/metacall-node-exception-test.dir/source/metacall_node_exception_test.cpp.o -[ 65%] Built target metacall-node-reentrant-test -[ 65%] Building CXX object source/tests/metacall_node_python_deadlock_test/CMakeFiles/metacall-node-python-deadlock-test.dir/source/main.cpp.o -[ 66%] Linking CXX executable ../../../metacall-node-async-testd -[ 66%] Linking CXX executable ../../../metacall-node-async-multiple-testd -[ 66%] Building CXX object source/tests/metacall_node_typescript_test/CMakeFiles/metacall-node-typescript-test.dir/source/metacall_node_typescript_test.cpp.o -[ 66%] Building CXX object source/tests/metacall_node_python_deadlock_test/CMakeFiles/metacall-node-python-deadlock-test.dir/source/metacall_node_python_deadlock_test.cpp.o -[ 66%] Built target metacall-node-async-test -[ 66%] Built target metacall-handle-get-test -[ 66%] Building CXX object source/tests/metacall_node_extension_test/CMakeFiles/metacall-node-extension-test.dir/source/main.cpp.o -[ 66%] Building CXX object source/tests/metacall_node_native_code_test/CMakeFiles/metacall-node-native-code-test.dir/source/main.cpp.o -[ 66%] Built target metacall-node-async-multiple-test -[ 67%] Linking CXX executable ../../../metacall-node-port-await-testd -[ 68%] Building CXX object source/tests/metacall_node_multithread_deadlock_test/CMakeFiles/metacall-node-multithread-deadlock-test.dir/source/main.cpp.o -[ 69%] Linking CXX executable ../../../metacall-node-python-port-ruby-testd -[ 69%] Building CXX object source/tests/metacall_distributable_test/CMakeFiles/metacall-distributable-test.dir/source/main.cpp.o -[ 69%] Linking CXX executable ../../../metacall-node-python-async-after-destroy-testd -[ 69%] Built target metacall-node-python-port-ruby-test -[ 69%] Built target metacall-node-port-await-test -[ 69%] Building CXX object source/tests/metacall_distributable_test/CMakeFiles/metacall-distributable-test.dir/source/metacall_distributable_test.cpp.o -[ 70%] Building CXX object source/tests/metacall_cast_test/CMakeFiles/metacall-cast-test.dir/source/main.cpp.o -[ 70%] Building CXX object source/tests/metacall_node_python_exception_test/CMakeFiles/metacall-node-python-exception-test.dir/source/metacall_node_python_exception_test.cpp.o -[ 70%] Building CXX object source/tests/metacall_cast_test/CMakeFiles/metacall-cast-test.dir/source/metacall_cast_test.cpp.o -[ 70%] Linking CXX executable ../../../metacall-node-python-await-testd -[ 70%] Building CXX object source/tests/metacall_node_clear_mem_test/CMakeFiles/metacall-node-clear-mem-test.dir/source/metacall_node_clear_mem_test.cpp.o -[ 70%] Built target metacall-node-python-async-after-destroy-test -[ 70%] Building CXX object source/tests/metacall_init_fini_test/CMakeFiles/metacall-init-fini-test.dir/source/main.cpp.o -[ 70%] Building CXX object source/tests/metacall_node_native_code_test/CMakeFiles/metacall-node-native-code-test.dir/source/metacall_node_native_code_test.cpp.o -[ 70%] Built target metacall-node-python-await-test -[ 70%] Building CXX object source/tests/metacall_ducktype_test/CMakeFiles/metacall-ducktype-test.dir/source/main.cpp.o -[ 70%] Building CXX object source/tests/metacall_node_await_chain_test/CMakeFiles/metacall-node-await-chain-test.dir/source/metacall_node_await_chain_test.cpp.o -[ 70%] Linking CXX executable ../../../metacall-node-fail-load-leak-testd -[ 70%] Building CXX object source/tests/metacall_inspect_test/CMakeFiles/metacall-inspect-test.dir/source/main.cpp.o -[ 70%] Linking CXX executable ../../../metacall-node-async-resources-testd -[ 70%] Built target metacall-node-fail-load-leak-test -[ 70%] Building CXX object source/tests/metacall_integration_test/CMakeFiles/metacall-integration-test.dir/source/main.cpp.o -[ 70%] Building CXX object source/tests/metacall_ducktype_test/CMakeFiles/metacall-ducktype-test.dir/source/metacall_ducktype_test.cpp.o -[ 70%] Building CXX object source/tests/metacall_node_extension_test/CMakeFiles/metacall-node-extension-test.dir/source/metacall_node_extension_test.cpp.o -[ 70%] Linking CXX executable ../../../metacall-node-callback-testd -[ 70%] Built target metacall-node-async-resources-test -[ 70%] Linking CXX executable ../../../metacall-node-python-ruby-testd -[ 71%] Building CXX object source/tests/metacall_depends_test/CMakeFiles/metacall-depends-test.dir/source/main.cpp.o -[ 72%] Linking CXX executable ../../../metacall-node-exception-testd -[ 72%] Linking CXX executable ../../../metacall-node-python-deadlock-testd -[ 72%] Building CXX object source/tests/metacall_node_multithread_deadlock_test/CMakeFiles/metacall-node-multithread-deadlock-test.dir/source/metacall_node_multithread_deadlock_test.cpp.o -[ 72%] Built target metacall-node-callback-test -[ 72%] Linking CXX executable ../../../metacall-node-fail-testd -[ 72%] Building CXX object source/tests/metacall_depends_test/CMakeFiles/metacall-depends-test.dir/source/metacall_depends_test.cpp.o -[ 72%] Linking CXX executable ../../../metacall-node-fail-env-var-testd -[ 72%] Building CXX object source/tests/metacall_init_fini_test/CMakeFiles/metacall-init-fini-test.dir/source/metacall_init_fini_test.cpp.o -[ 72%] Built target metacall-node-python-ruby-test -[ 72%] Built target metacall-node-exception-test -[ 72%] Building CXX object source/tests/metacall_configuration_default_test/CMakeFiles/metacall-configuration-default-test.dir/source/main.cpp.o -[ 72%] Building CXX object source/tests/metacall_configuration_exec_path_test/CMakeFiles/metacall-configuration-exec-path-test.dir/source/main.cpp.o -[ 72%] Building CXX object source/tests/metacall_configuration_default_test/CMakeFiles/metacall-configuration-default-test.dir/source/metacall_configuration_default_test.cpp.o -[ 72%] Built target metacall-node-python-deadlock-test -[ 72%] Building CXX object source/tests/metacall_configuration_exec_path_test/CMakeFiles/metacall-configuration-exec-path-test.dir/source/metacall_configuration_exec_path_test.cpp.o -[ 72%] Built target metacall-node-fail-test -[ 72%] Building CXX object source/tests/metacall_clear_test/CMakeFiles/metacall-clear-test.dir/source/main.cpp.o -[ 72%] Built target metacall-node-fail-env-var-test -[ 72%] Building CXX object source/tests/metacall_python_test/CMakeFiles/metacall-python-test.dir/source/main.cpp.o -[ 72%] Building CXX object source/tests/metacall_python_test/CMakeFiles/metacall-python-test.dir/source/metacall_python_test.cpp.o -[ 72%] Linking CXX executable ../../../metacall-testd -[ 72%] Building CXX object source/tests/metacall_clear_test/CMakeFiles/metacall-clear-test.dir/source/metacall_clear_test.cpp.o -[ 72%] Linking CXX executable ../../../metacall-node-python-exception-testd -[ 72%] Building CXX object source/tests/metacall_inspect_test/CMakeFiles/metacall-inspect-test.dir/source/metacall_inspect_test.cpp.o -[ 72%] Built target metacall-test -[ 72%] Building CXX object source/tests/metacall_python_object_class_test/CMakeFiles/metacall-python-object-class-test.dir/source/main.cpp.o -[ 72%] Built target metacall-node-python-exception-test -[ 72%] Building CXX object source/tests/metacall_python_gc_test/CMakeFiles/metacall-python-gc-test.dir/source/main.cpp.o -[ 72%] Linking CXX executable ../../../metacall-cast-testd -[ 72%] Building CXX object source/tests/metacall_integration_test/CMakeFiles/metacall-integration-test.dir/source/environment.cpp.o -[ 72%] Linking CXX executable ../../../metacall-node-clear-mem-testd -[ 72%] Building CXX object source/tests/metacall_python_gc_test/CMakeFiles/metacall-python-gc-test.dir/source/metacall_python_gc_test.cpp.o -[ 72%] Linking CXX executable ../../../metacall-node-typescript-testd -[ 72%] Built target metacall-cast-test -[ 72%] Building CXX object source/tests/metacall_python_open_test/CMakeFiles/metacall-python-open-test.dir/source/main.cpp.o -[ 72%] Built target metacall-node-clear-mem-test -[ 72%] Linking CXX executable ../../../metacall-node-await-chain-testd -[ 72%] Building CXX object source/tests/metacall_python_dict_test/CMakeFiles/metacall-python-dict-test.dir/source/main.cpp.o -[ 72%] Built target metacall-node-typescript-test -[ 72%] Building CXX object source/tests/metacall_integration_test/CMakeFiles/metacall-integration-test.dir/source/metacall_integration_test.cpp.o -[ 72%] Building CXX object source/tests/metacall_python_pointer_test/CMakeFiles/metacall-python-pointer-test.dir/source/main.cpp.o -[ 72%] Building CXX object source/tests/metacall_python_dict_test/CMakeFiles/metacall-python-dict-test.dir/source/metacall_python_dict_test.cpp.o -[ 72%] Building CXX object source/tests/metacall_python_reentrant_test/CMakeFiles/metacall-python-reentrant-test.dir/source/main.cpp.o -[ 72%] Built target metacall-node-await-chain-test -[ 73%] Building CXX object source/tests/metacall_python_object_class_test/CMakeFiles/metacall-python-object-class-test.dir/source/metacall_python_object_class_test.cpp.o -[ 73%] Building CXX object source/tests/metacall_python_varargs_test/CMakeFiles/metacall-python-varargs-test.dir/source/main.cpp.o -[ 73%] Linking CXX executable ../../../configuration-default-test/metacall-configuration-default-testd -[ 73%] Linking CXX executable ../../../metacall-node-native-code-testd -[ 73%] Linking CXX executable ../../../metacall-init-fini-testd -[ 73%] Built target metacall-configuration-default-test -[ 73%] Building CXX object source/tests/metacall_python_reentrant_test/CMakeFiles/metacall-python-reentrant-test.dir/source/metacall_python_reentrant_test.cpp.o -[ 74%] Building CXX object source/tests/metacall_python_loader_port_test/CMakeFiles/py-loader-port-test.dir/source/main.cpp.o -[ 74%] Linking CXX executable ../../../metacall-configuration-exec-path-testd -[ 74%] Built target metacall-node-native-code-test -[ 74%] Built target metacall-init-fini-test -[ 74%] Building CXX object source/tests/metacall_python_loader_port_test/CMakeFiles/py-loader-port-test.dir/source/metacall_python_loader_port_test.cpp.o -[ 74%] Building CXX object source/tests/metacall_python_port_https_test/CMakeFiles/metacall-python-port-https-test.dir/source/main.cpp.o -[ 75%] Building CXX object source/tests/metacall_python_port_callback_test/CMakeFiles/metacall-python-port-callback-test.dir/source/main.cpp.o -[ 75%] Linking CXX executable ../../../metacall-distributable-testd -[ 75%] Linking CXX executable ../../../metacall-node-extension-testd -[ 75%] Linking CXX executable ../../../metacall-clear-testd -[ 75%] Building CXX object source/tests/metacall_python_port_callback_test/CMakeFiles/metacall-python-port-callback-test.dir/source/metacall_python_port_callback_test.cpp.o -[ 75%] Linking CXX executable ../../../metacall-node-multithread-deadlock-testd -[ 75%] Built target metacall-configuration-exec-path-test -[ 75%] Building CXX object source/tests/metacall_python_port_pointer_test/CMakeFiles/metacall-python-port-pointer-test.dir/source/main.cpp.o -[ 75%] Linking CXX executable ../../../metacall-python-testd -[ 75%] Linking CXX executable ../../../metacall-depends-testd -[ 75%] Building CXX object source/tests/metacall_python_open_test/CMakeFiles/metacall-python-open-test.dir/source/metacall_python_open_test.cpp.o -[ 75%] Built target metacall-node-extension-test -[ 75%] Built target metacall-distributable-test -[ 75%] Building CXX object source/tests/metacall_python_port_pointer_test/CMakeFiles/metacall-python-port-pointer-test.dir/source/metacall_python_port_pointer_test.cpp.o -[ 75%] Built target metacall-clear-test -[ 76%] Building CXX object source/tests/metacall_python_callback_test/CMakeFiles/metacall-python-callback-test.dir/source/main.cpp.o -[ 76%] Building CXX object source/tests/metacall_python_port_import_test/CMakeFiles/metacall-python-port-import-test.dir/source/main.cpp.o -[ 76%] Building CXX object source/tests/metacall_python_fail_test/CMakeFiles/metacall-python-fail-test.dir/source/main.cpp.o -[ 77%] Linking CXX executable ../../../metacall-ducktype-testd -[ 77%] Building CXX object source/tests/metacall_python_fail_test/CMakeFiles/metacall-python-fail-test.dir/source/metacall_python_fail_test.cpp.o -[ 77%] Built target metacall-node-multithread-deadlock-test -[ 77%] Building CXX object source/tests/metacall_python_pointer_test/CMakeFiles/metacall-python-pointer-test.dir/source/metacall_python_pointer_test.cpp.o -[ 77%] Built target metacall-python-test -[ 77%] Built target metacall-depends-test -[ 77%] Building CXX object source/tests/metacall_python_without_functions_test/CMakeFiles/metacall-python-without-functions-test.dir/source/main.cpp.o -[ 77%] Building CXX object source/tests/metacall_python_relative_path_test/CMakeFiles/metacall-python-relative-path-test.dir/source/main.cpp.o -[ 77%] Building CXX object source/tests/metacall_python_builtins_test/CMakeFiles/metacall-python-builtins-test.dir/source/main.cpp.o -[ 77%] Building CXX object source/tests/metacall_python_varargs_test/CMakeFiles/metacall-python-varargs-test.dir/source/metacall_python_varargs_test.cpp.o -[ 77%] Linking CXX executable ../../../metacall-python-gc-testd -[ 77%] Linking CXX executable ../../../metacall-inspect-testd -[ 77%] Built target metacall-ducktype-test -[ 77%] Building CXX object source/tests/metacall_python_port_import_test/CMakeFiles/metacall-python-port-import-test.dir/source/metacall_python_port_import_test.cpp.o -[ 77%] Built target metacall-inspect-test -[ 77%] Built target metacall-python-gc-test -[ 77%] Building CXX object source/tests/metacall_python_callback_test/CMakeFiles/metacall-python-callback-test.dir/source/metacall_python_callback_test.cpp.o -[ 77%] Building CXX object source/tests/metacall_python_async_test/CMakeFiles/metacall-python-async-test.dir/source/main.cpp.o -[ 77%] Building CXX object source/tests/metacall_python_without_functions_test/CMakeFiles/metacall-python-without-functions-test.dir/source/metacall_python_without_functions_test.cpp.o -[ 77%] Building CXX object source/tests/metacall_python_async_test/CMakeFiles/metacall-python-async-test.dir/source/metacall_python_async_test.cpp.o -[ 77%] Building CXX object source/tests/metacall_python_port_https_test/CMakeFiles/metacall-python-port-https-test.dir/source/metacall_python_port_https_test.cpp.o -[ 78%] Linking CXX executable ../../../metacall-integration-testd -[ 78%] Building CXX object source/tests/metacall_python_builtins_test/CMakeFiles/metacall-python-builtins-test.dir/source/metacall_python_builtins_test.cpp.o -[ 79%] Building CXX object source/tests/metacall_python_relative_path_test/CMakeFiles/metacall-python-relative-path-test.dir/source/metacall_python_relative_path_test.cpp.o -[ 79%] Built target metacall-integration-test -[ 79%] Building CXX object source/tests/metacall_python_exception_test/CMakeFiles/metacall-python-exception-test.dir/source/main.cpp.o -[ 79%] Building CXX object source/tests/metacall_python_exception_test/CMakeFiles/metacall-python-exception-test.dir/source/metacall_python_exception_test.cpp.o -[ 79%] Linking CXX executable ../../../metacall-python-port-callback-testd -[ 80%] Building CXX object source/tests/metacall_python_without_env_vars_test/CMakeFiles/metacall-python-without-env-vars-test.dir/source/main.cpp.o -[ 80%] Building CXX object source/tests/metacall_python_without_env_vars_test/CMakeFiles/metacall-python-without-env-vars-test.dir/source/metacall_python_without_env_vars_test.cpp.o -[ 80%] Linking CXX executable ../../../metacall-python-reentrant-testd -[ 80%] Building CXX object source/tests/metacall_map_test/CMakeFiles/metacall-map-test.dir/source/main.cpp.o -[ 80%] Building CXX object source/tests/metacall_map_test/CMakeFiles/metacall-map-test.dir/source/metacall_map_test.cpp.o -[ 80%] Built target metacall-python-port-callback-test -[ 80%] Built target metacall-python-reentrant-test -[ 80%] Building CXX object source/tests/metacall_initialize_test/CMakeFiles/metacall-initialize-test.dir/source/main.cpp.o -[ 80%] Building CXX object source/tests/metacall_map_await_test/CMakeFiles/metacall-map-await-test.dir/source/main.cpp.o -[ 80%] Linking CXX executable ../../../py-loader-port-testd -[ 80%] Building CXX object source/tests/metacall_map_await_test/CMakeFiles/metacall-map-await-test.dir/source/metacall_map_await_test.cpp.o -[ 80%] Linking CXX executable ../../../metacall-python-dict-testd -[ 80%] Linking CXX executable ../../../metacall-python-port-pointer-testd -[ 80%] Built target py-loader-port-test -[ 80%] Built target metacall-python-dict-test -[ 80%] Building CXX object source/tests/metacall_initialize_ex_test/CMakeFiles/metacall-initialize-ex-test.dir/source/main.cpp.o -[ 81%] Building CXX object source/tests/metacall_reinitialize_test/CMakeFiles/metacall-reinitialize-test.dir/source/main.cpp.o -[ 81%] Linking CXX executable ../../../metacall-python-object-class-testd -[ 81%] Linking CXX executable ../../../metacall-python-fail-testd -[ 81%] Linking CXX executable ../../../metacall-python-varargs-testd -[ 81%] Built target metacall-python-port-pointer-test -[ 81%] Building CXX object source/tests/metacall_initialize_destroy_multiple_test/CMakeFiles/metacall-initialize-destroy-multiple-test.dir/source/main.cpp.o -[ 81%] Building CXX object source/tests/metacall_initialize_destroy_multiple_node_test/CMakeFiles/metacall-initialize-destroy-multiple-node-test.dir/source/main.cpp.o -[ 82%] Linking CXX executable ../../../metacall-python-port-import-testd -[ 82%] Built target metacall-python-object-class-test -[ 82%] Linking CXX executable ../../../metacall-python-port-https-testd -[ 82%] Building CXX object source/tests/metacall_reload_functions_test/CMakeFiles/metacall-reload-functions-test.dir/source/main.cpp.o -[ 82%] Linking CXX executable ../../../metacall-python-pointer-testd -[ 82%] Built target metacall-python-fail-test -[ 82%] Building CXX object source/tests/metacall_initialize_destroy_multiple_node_test/CMakeFiles/metacall-initialize-destroy-multiple-node-test.dir/source/metacall_initialize_destroy_multiple_node_test.cpp.o -[ 82%] Building CXX object source/tests/metacall_initialize_destroy_multiple_test/CMakeFiles/metacall-initialize-destroy-multiple-test.dir/source/metacall_initialize_destroy_multiple_test.cpp.o -[ 82%] Linking CXX executable ../../../metacall-python-callback-testd -[ 82%] Built target metacall-python-varargs-test -[ 82%] Building CXX object source/tests/metacall_invalid_loader_test/CMakeFiles/metacall-invalid-loader-test.dir/source/metacall_invalid_loader_test.cpp.o -[ 83%] Building CXX object source/tests/metacall_initialize_test/CMakeFiles/metacall-initialize-test.dir/source/metacall_initialize_test.cpp.o -[ 83%] Building CXX object source/tests/metacall_invalid_loader_test/CMakeFiles/metacall-invalid-loader-test.dir/source/main.cpp.o -[ 83%] Linking CXX executable ../../../metacall-python-open-testd -[ 83%] Built target metacall-python-port-https-test -[ 83%] Built target metacall-python-port-import-test -[ 84%] Linking CXX executable ../../../metacall-python-exception-testd -[ 84%] Linking CXX executable ../../../metacall-python-without-functions-testd -[ 84%] Building CXX object source/tests/metacall_return_monad_test/CMakeFiles/metacall-return-monad-test.dir/source/main.cpp.o -[ 84%] Building CXX object source/tests/metacall_fork_test/CMakeFiles/metacall-fork-test.dir/source/main.cpp.o -[ 84%] Building CXX object source/tests/metacall_fork_test/CMakeFiles/metacall-fork-test.dir/source/metacall_fork_test.cpp.o -[ 84%] Built target metacall-python-callback-test -[ 84%] Built target metacall-python-pointer-test -[ 84%] Building CXX object source/tests/metacall_return_monad_test/CMakeFiles/metacall-return-monad-test.dir/source/metacall_return_monad_test.cpp.o -[ 84%] Linking CXX executable ../../../metacall-python-without-env-vars-testd -[ 84%] Building CXX object source/tests/metacall_callback_complex_test/CMakeFiles/metacall-callback-complex-test.dir/source/main.cpp.o -[ 84%] Built target metacall-python-open-test -[ 84%] Built target metacall-python-without-functions-test -[ 84%] Building CXX object source/tests/metacall_callback_complex_test/CMakeFiles/metacall-callback-complex-test.dir/source/metacall_callback_complex_test.cpp.o -[ 84%] Building CXX object source/tests/metacall_ruby_fail_test/CMakeFiles/metacall-ruby-fail-test.dir/source/main.cpp.o -[ 84%] Built target metacall-python-exception-test -[ 84%] Building CXX object source/tests/metacall_ruby_fail_empty_test/CMakeFiles/metacall-ruby-fail-empty-test.dir/source/main.cpp.o -[ 84%] Linking CXX executable ../../../metacall-python-builtins-testd -[ 84%] Linking CXX executable ../../../metacall-python-async-testd -[ 84%] Built target metacall-python-without-env-vars-test -[ 84%] Building CXX object source/tests/metacall_ruby_object_class_test/CMakeFiles/metacall-ruby-object-class-test.dir/source/main.cpp.o -[ 84%] Building CXX object source/tests/metacall_initialize_ex_test/CMakeFiles/metacall-initialize-ex-test.dir/source/metacall_initialize_ex_test.cpp.o -[ 84%] Building CXX object source/tests/metacall_reinitialize_test/CMakeFiles/metacall-reinitialize-test.dir/source/metacall_reinitialize_test.cpp.o -[ 84%] Linking CXX executable ../../../metacall-python-relative-path-testd -[ 84%] Built target metacall-python-async-test -[ 84%] Building CXX object source/tests/metacall_ruby_parser_integration_test/CMakeFiles/metacall-ruby-parser-integration-test.dir/source/main.cpp.o -[ 84%] Built target metacall-python-builtins-test -[ 84%] Building CXX object source/tests/metacall_ruby_parser_integration_test/CMakeFiles/metacall-ruby-parser-integration-test.dir/source/metacall_ruby_parser_integration_test.cpp.o -[ 84%] Building CXX object source/tests/metacall_ruby_object_class_test/CMakeFiles/metacall-ruby-object-class-test.dir/source/metacall_ruby_object_class_test.cpp.o -[ 84%] Building CXX object source/tests/metacall_function_test/CMakeFiles/metacall-function-test.dir/source/main.cpp.o -[ 84%] Built target metacall-python-relative-path-test -[ 84%] Linking CXX executable ../../../metacall-map-testd -[ 84%] Building CXX object source/tests/metacall_reload_functions_test/CMakeFiles/metacall-reload-functions-test.dir/source/metacall_reload_functions_test.cpp.o -[ 84%] Building CXX object source/tests/metacall_cobol_test/CMakeFiles/metacall-cobol-test.dir/source/main.cpp.o -[ 84%] Building CXX object source/tests/metacall_cobol_test/CMakeFiles/metacall-cobol-test.dir/source/metacall_cobol_test.cpp.o -[ 84%] Built target metacall-map-test -[ 84%] Building CXX object source/tests/metacall_file_test/CMakeFiles/metacall-file-test.dir/source/main.cpp.o -[ 84%] Building CXX object source/tests/metacall_file_fail_test/CMakeFiles/metacall-file-fail-test.dir/source/main.cpp.o -[ 84%] Building CXX object source/tests/metacall_file_test/CMakeFiles/metacall-file-test.dir/source/metacall_file_test.cpp.o -[ 84%] Linking CXX executable ../../../metacall-invalid-loader-testd -[ 85%] Linking CXX executable ../../../metacall-initialize-destroy-multiple-node-testd -[ 85%] Linking CXX executable ../../../metacall-initialize-destroy-multiple-testd -[ 86%] Building CXX object source/tests/metacall_ruby_fail_test/CMakeFiles/metacall-ruby-fail-test.dir/source/metacall_ruby_fail_test.cpp.o -[ 86%] Linking CXX executable ../../../metacall-initialize-testd -[ 87%] Building CXX object source/tests/metacall_file_glob_test/CMakeFiles/metacall-file-glob-test.dir/source/main.cpp.o -[ 87%] Building CXX object source/tests/metacall_ruby_fail_empty_test/CMakeFiles/metacall-ruby-fail-empty-test.dir/source/metacall_ruby_fail_empty_test.cpp.o -[ 87%] Built target metacall-invalid-loader-test -[ 87%] Building CXX object source/tests/metacall_typescript_test/CMakeFiles/metacall-typescript-test.dir/source/main.cpp.o -[ 88%] Linking CXX executable ../../../metacall-fork-testd -[ 88%] Built target metacall-initialize-destroy-multiple-test -[ 88%] Built target metacall-initialize-destroy-multiple-node-test -[ 88%] Building CXX object source/tests/metacall_file_glob_test/CMakeFiles/metacall-file-glob-test.dir/source/metacall_file_glob_test.cpp.o -[ 88%] Building CXX object source/tests/metacall_typescript_test/CMakeFiles/metacall-typescript-test.dir/source/metacall_typescript_test.cpp.o -[ 88%] Built target metacall-initialize-test -[ 89%] Building CXX object source/tests/metacall_typescript_node_test/CMakeFiles/metacall-typescript-node-test.dir/source/main.cpp.o -[ 89%] Building CXX object source/tests/metacall_typescript_call_map_test/CMakeFiles/metacall-typescript-call-map-test.dir/source/main.cpp.o -[ 89%] Building CXX object source/tests/metacall_typescript_call_map_test/CMakeFiles/metacall-typescript-call-map-test.dir/source/metacall_typescript_call_map_test.cpp.o -[ 89%] Built target metacall-fork-test -[ 89%] Linking CXX executable ../../../metacall-map-await-testd -[ 89%] Building CXX object source/tests/metacall_typescript_tsx_test/CMakeFiles/metacall-typescript-tsx-test.dir/source/main.cpp.o -[ 89%] Linking CXX executable ../../../metacall-initialize-ex-testd -[ 89%] Linking CXX executable ../../../metacall-reinitialize-testd -[ 89%] Built target metacall-map-await-test -[ 89%] Building CXX object source/tests/metacall_function_test/CMakeFiles/metacall-function-test.dir/source/metacall_function_test.cpp.o -[ 89%] Building CXX object source/tests/metacall_typescript_tsx_loop_fail_test/CMakeFiles/metacall-typescript-tsx-loop-fail-test.dir/source/main.cpp.o -[ 89%] Built target metacall-initialize-ex-test -[ 89%] Building CXX object source/tests/metacall_typescript_require_test/CMakeFiles/metacall-typescript-require-test.dir/source/main.cpp.o -[ 89%] Building CXX object source/tests/metacall_typescript_jsx_default_test/CMakeFiles/metacall-typescript-jsx-default-test.dir/source/main.cpp.o -[ 89%] Built target metacall-reinitialize-test -[ 89%] Building CXX object source/tests/metacall_typescript_jsx_default_test/CMakeFiles/metacall-typescript-jsx-default-test.dir/source/metacall_typescript_jsx_default_test.cpp.o -[ 89%] Building CXX object source/tests/metacall_file_fail_test/CMakeFiles/metacall-file-fail-test.dir/source/metacall_file_fail_test.cpp.o -[ 89%] Building CXX object source/tests/metacall_typescript_require_test/CMakeFiles/metacall-typescript-require-test.dir/source/metacall_typescript_require_test.cpp.o -[ 89%] Building CXX object source/tests/metacall_typescript_node_test/CMakeFiles/metacall-typescript-node-test.dir/source/metacall_typescript_node_test.cpp.o -[ 89%] Linking CXX executable ../../../metacall-ruby-parser-integration-testd -[ 89%] Linking CXX executable ../../../metacall-ruby-fail-testd -[ 90%] Linking CXX executable ../../../metacall-return-monad-testd -[ 90%] Building CXX object source/tests/metacall_typescript_tsx_test/CMakeFiles/metacall-typescript-tsx-test.dir/source/metacall_typescript_tsx_test.cpp.o -[ 90%] Building CXX object source/tests/metacall_typescript_tsx_loop_fail_test/CMakeFiles/metacall-typescript-tsx-loop-fail-test.dir/source/metacall_typescript_tsx_loop_fail_test.cpp.o -[ 90%] Built target metacall-ruby-parser-integration-test -[ 90%] Building CXX object source/tests/metacall_csharp_static_class_test/CMakeFiles/metacall-csharp-static-class-test.dir/source/main.cpp.o -[ 90%] Building CXX object source/tests/metacall_rpc_test/CMakeFiles/metacall-rpc-test.dir/source/main.cpp.o -[ 90%] Built target metacall-ruby-fail-test -[ 90%] Building CXX object source/tests/metacall_csharp_static_class_test/CMakeFiles/metacall-csharp-static-class-test.dir/source/metacall_csharp_static_class_test.cpp.o -[ 91%] Building CXX object source/tests/metacall_ruby_test/CMakeFiles/metacall-ruby-test.dir/source/main.cpp.o -[ 91%] Built target metacall-return-monad-test -[ 91%] Building CXX object source/tests/metacall_cs_test/CMakeFiles/metacall-cs-test.dir/source/main.cpp.o -[ 91%] Building CXX object source/tests/metacall_cs_test/CMakeFiles/metacall-cs-test.dir/source/environment.cpp.o -[ 91%] Linking CXX executable ../../../metacall-callback-complex-testd -[ 91%] Building CXX object source/tests/metacall_cs_test/CMakeFiles/metacall-cs-test.dir/source/metacall_cs_test.cpp.o -[ 91%] Building CXX object source/tests/metacall_rpc_test/CMakeFiles/metacall-rpc-test.dir/source/metacall_rpc_test.cpp.o -[ 92%] Linking CXX executable ../../../metacall-cobol-testd -[ 92%] Linking CXX executable ../../../metacall-ruby-fail-empty-testd -[ 92%] Linking CXX executable ../../../metacall-reload-functions-testd -[ 92%] Linking CXX executable ../../../metacall-ruby-object-class-testd -[ 92%] Linking CXX executable ../../../metacall-file-testd -[ 92%] Built target metacall-callback-complex-test -[ 92%] Linking CXX executable ../../../metacall-typescript-jsx-default-testd -[ 92%] Building CXX object source/tests/metacall_java_test/CMakeFiles/metacall-java-test.dir/source/main.cpp.o -[ 92%] Built target metacall-cobol-test -[ 92%] Building CXX object source/tests/metacall_wasm_test/CMakeFiles/metacall-wasm-test.dir/source/main.cpp.o -[ 92%] Built target metacall-ruby-object-class-test -[ 92%] Built target metacall-reload-functions-test -[ 92%] Built target metacall-ruby-fail-empty-test -[ 92%] Building CXX object source/tests/metacall_wasm_python_port_test/CMakeFiles/metacall-wasm-python-port-test.dir/source/main.cpp.o -[ 92%] Building CXX object source/tests/metacall_c_lib_test/CMakeFiles/metacall-c-lib-test.dir/source/main.cpp.o -[ 92%] Building CXX object source/tests/metacall_c_test/CMakeFiles/metacall-c-test.dir/source/main.cpp.o -[ 92%] Built target metacall-file-test -[ 92%] Built target metacall-typescript-jsx-default-test -[ 92%] Building CXX object source/tests/metacall_version_test/CMakeFiles/metacall-version-test.dir/source/main.cpp.o -[ 92%] Building CXX object source/tests/metacall_dynlink_path_test/CMakeFiles/metacall-dynlink-path-test.dir/source/main.cpp.o -[ 93%] Linking CXX executable ../../../metacall-typescript-testd -[ 94%] Building CXX object source/tests/metacall_dynlink_path_test/CMakeFiles/metacall-dynlink-path-test.dir/source/metacall_dynlink_path_test.cpp.o -[ 94%] Linking CXX executable ../../../metacall-file-glob-testd -[ 94%] Linking CXX executable ../../../metacall-typescript-call-map-testd -[ 94%] Building CXX object source/tests/metacall_ruby_test/CMakeFiles/metacall-ruby-test.dir/source/metacall_ruby_test.cpp.o -[ 95%] Building CXX object source/tests/metacall_version_test/CMakeFiles/metacall-version-test.dir/source/metacall_version_test.cpp.o -[ 95%] Built target metacall-typescript-test -[ 95%] Building CXX object source/tests/metacall_library_path_without_env_vars_test/CMakeFiles/metacall-library-path-without-env-vars-test.dir/source/main.cpp.o -[ 95%] Built target metacall-file-glob-test -[ 95%] Building CXX object source/tests/metacall_ext_test/CMakeFiles/metacall-ext-test.dir/source/main.cpp.o -[ 95%] Building CXX object source/tests/metacall_ext_test/CMakeFiles/metacall-ext-test.dir/source/metacall_ext_test.cpp.o -[ 95%] Built target metacall-typescript-call-map-test -[ 96%] Building CXX object source/tests/metacall_plugin_extension_test/CMakeFiles/metacall-plugin-extension-test.dir/source/main.cpp.o -[ 96%] Linking CXX executable ../../../metacall-typescript-require-testd -[ 96%] Building CXX object source/tests/metacall_wasm_test/CMakeFiles/metacall-wasm-test.dir/source/metacall_wasm_test.cpp.o -[ 96%] Linking CXX executable ../../../metacall-file-fail-testd -[ 96%] Building CXX object source/tests/metacall_java_test/CMakeFiles/metacall-java-test.dir/source/metacall_java_test.cpp.o -[ 96%] Built target metacall-typescript-require-test -[ 96%] Building CXX object source/tests/metacall_wasm_python_port_test/CMakeFiles/metacall-wasm-python-port-test.dir/source/metacall_wasm_python_port_test.cpp.o -[ 96%] Linking CXX executable ../../../metacall-function-testd -[ 96%] Built target metacall-file-fail-test -[ 96%] Linking CXX executable ../../../metacall-typescript-tsx-loop-fail-testd -[ 97%] Building CXX object source/tests/metacall_library_path_without_env_vars_test/CMakeFiles/metacall-library-path-without-env-vars-test.dir/source/metacall_library_path_without_env_vars_test.cpp.o -[ 98%] Building CXX object source/tests/metacall_c_lib_test/CMakeFiles/metacall-c-lib-test.dir/source/metacall_c_lib_test.cpp.o -[ 98%] Linking CXX executable ../../../metacall-typescript-node-testd -[ 98%] Building CXX object source/tests/metacall_c_test/CMakeFiles/metacall-c-test.dir/source/metacall_c_test.cpp.o -[ 98%] Building CXX object source/tests/metacall_plugin_extension_test/CMakeFiles/metacall-plugin-extension-test.dir/source/metacall_plugin_extension_test.cpp.o -[ 98%] Building CXX object source/tests/metacall_plugin_extension_local_test/CMakeFiles/metacall-plugin-extension-local-test.dir/source/main.cpp.o -[ 98%] Building CXX object source/tests/metacall_plugin_extension_local_test/CMakeFiles/metacall-plugin-extension-local-test.dir/source/metacall_plugin_extension_local_test.cpp.o -[ 98%] Built target metacall-function-test -[ 98%] Building CXX object source/tests/metacall_backtrace_plugin_test/CMakeFiles/metacall-backtrace-plugin-test.dir/source/main.cpp.o -[ 98%] Built target metacall-typescript-tsx-loop-fail-test -[ 98%] Linking CXX executable ../../../metacall-cs-testd -[ 98%] Linking CXX executable ../../../metacall-typescript-tsx-testd -[ 98%] Building CXX object source/tests/metacall_sandbox_plugin_test/CMakeFiles/metacall-sandbox-plugin-test.dir/source/main.cpp.o -[ 98%] Built target metacall-typescript-node-test -[ 98%] Building CXX object source/benchmarks/log_bench/CMakeFiles/log-bench.dir/source/log_bench.cpp.o -[ 98%] Linking CXX executable ../../../metacall-csharp-static-class-testd -[ 98%] Building CXX object source/benchmarks/metacall_py_c_api_bench/CMakeFiles/metacall-py-c-api-bench.dir/source/metacall_py_c_api_bench.cpp.o -[ 98%] Building CXX object source/tests/metacall_sandbox_plugin_test/CMakeFiles/metacall-sandbox-plugin-test.dir/source/metacall_sandbox_plugin_test.cpp.o -[ 98%] Built target metacall-cs-test -[ 98%] Built target metacall-typescript-tsx-test -[ 98%] Building CXX object source/benchmarks/metacall_py_call_bench/CMakeFiles/metacall-py-call-bench.dir/source/metacall_py_call_bench.cpp.o -[ 98%] Building CXX object source/tests/metacall_backtrace_plugin_test/CMakeFiles/metacall-backtrace-plugin-test.dir/source/metacall_backtrace_plugin_test.cpp.o -[ 98%] Building CXX object source/benchmarks/metacall_py_init_bench/CMakeFiles/metacall-py-init-bench.dir/source/metacall_py_init_bench.cpp.o -[ 98%] Linking CXX executable ../../../metacall-dynlink-path-testd -[ 98%] Linking CXX executable ../../../metacall-ruby-testd -[ 98%] Linking CXX executable ../../../metacall-version-testd -[ 98%] Built target metacall-csharp-static-class-test -[ 98%] Building CXX object source/benchmarks/metacall_node_call_bench/CMakeFiles/metacall-node-call-bench.dir/source/metacall_node_call_bench.cpp.o -[ 98%] Building CXX object source/benchmarks/metacall_rb_call_bench/CMakeFiles/metacall-rb-call-bench.dir/source/metacall_rb_call_bench.cpp.o -[ 98%] Built target metacall-dynlink-path-test -[ 98%] Built target metacall-ruby-test -[ 98%] Building CXX object source/benchmarks/metacall_cs_call_bench/CMakeFiles/metacall-cs-call-bench.dir/source/metacall_cs_call_bench.cpp.o -[ 98%] Linking CXX executable ../../../metacall-rpc-testd -[ 98%] Built target metacall-version-test -[ 98%] Built target metacall-rpc-test -[ 98%] Linking CXX executable ../../../metacall-wasm-python-port-testd -[ 98%] Linking CXX executable ../../../log-benchd -[ 99%] Linking CXX executable ../../../metacall-py-init-benchd -[ 99%] Built target metacall-wasm-python-port-test -[ 99%] Linking CXX executable ../../../metacall-py-c-api-benchd -[ 99%] Built target log-bench -[ 99%] Linking CXX executable ../../../metacall-library-path-without-env-vars-testd -[ 99%] Built target metacall-py-init-bench -[ 99%] Built target metacall-py-c-api-bench -[ 99%] Linking CXX executable ../../../metacall-py-call-benchd -[ 99%] Built target metacall-library-path-without-env-vars-test -[ 99%] Linking CXX executable ../../../metacall-rb-call-benchd -[ 99%] Linking CXX executable ../../../metacall-ext-testd -[ 99%] Built target metacall-py-call-bench -[100%] Linking CXX executable ../../../metacall-cs-call-benchd -[100%] Linking CXX executable ../../../metacall-node-call-benchd -[100%] Built target metacall-rb-call-bench -[100%] Built target metacall-cs-call-bench -[100%] Built target metacall-ext-test -[100%] Linking CXX executable ../../../metacall-c-lib-testd -[100%] Built target metacall-node-call-bench -[100%] Built target metacall-c-lib-test -[100%] Linking CXX executable ../../../metacall-backtrace-plugin-testd -[100%] Built target metacall-backtrace-plugin-test -[100%] Linking CXX executable ../../../metacall-c-testd -[100%] Linking CXX executable ../../../metacall-plugin-extension-local-testd -[100%] Linking CXX executable ../../../metacall-plugin-extension-testd -[100%] Built target metacall-plugin-extension-local-test -[100%] Built target metacall-c-test -[100%] Built target metacall-plugin-extension-test -[100%] Linking CXX executable ../../../metacall-wasm-testd -[100%] Linking CXX executable ../../../metacall-java-testd -[100%] Built target metacall-wasm-test -[100%] Built target metacall-java-test -[100%] Linking CXX executable ../../../metacall-sandbox-plugin-testd -[100%] Built target metacall-sandbox-plugin-test -+ [ 1 = 1 ] -+ getconf _NPROCESSORS_ONLN -+ ctest -j24 --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C Debug -Test project /usr/local/metacall/build - Start 1: ts_loader_bootstrap - Start 2: node_port - Start 3: node_port_test_executable - Start 4: py_port - Start 5: go_port - Start 6: rs_port - Start 7: rb_port - Start 8: preprocessor-test - Start 9: environment-test - Start 10: log-test - Start 11: log-custom-test - Start 12: adt-set-test - Start 13: adt-trie-test - Start 14: adt-vector-test - Start 15: adt-map-test - Start 16: reflect-value-cast-test - Start 17: reflect-function-test - Start 18: reflect-object-class-test - Start 19: reflect-scope-test - Start 20: reflect-metadata-test - Start 21: dynlink-test - Start 22: detour-test - Start 23: serial-test - Start 24: configuration-test - 1/175 Test #8: preprocessor-test ................................ Passed 0.04 sec - 2/175 Test #9: environment-test ................................. Passed 0.03 sec - 3/175 Test #10: log-test ......................................... Passed 0.03 sec - 4/175 Test #11: log-custom-test .................................. Passed 0.03 sec - 5/175 Test #12: adt-set-test ..................................... Passed 0.03 sec - 6/175 Test #13: adt-trie-test .................................... Passed 0.03 sec - 7/175 Test #14: adt-vector-test .................................. Passed 0.03 sec - 8/175 Test #15: adt-map-test ..................................... Passed 0.03 sec - 9/175 Test #16: reflect-value-cast-test .......................... Passed 0.02 sec - 10/175 Test #17: reflect-function-test ............................ Passed 0.02 sec - 11/175 Test #18: reflect-object-class-test ........................ Passed 0.02 sec - 12/175 Test #19: reflect-scope-test ............................... Passed 0.02 sec - 13/175 Test #20: reflect-metadata-test ............................ Passed 0.02 sec - 14/175 Test #21: dynlink-test ..................................... Passed 0.02 sec - Start 25: rb-loader-parser-test - Start 26: portability-path-test - Start 27: metacall-logs-test - Start 28: metacall-load-memory-test - Start 29: metacall-load-memory-empty-test - Start 30: metacall-load-configuration-test - Start 31: metacall-load-configuration-fail-test - Start 32: metacall-load-configuration-relative-test - Start 33: metacall-load-configuration-python-node-test - Start 34: metacall-load-configuration-node-python-test - Start 35: metacall-duplicated-handle-test - Start 36: metacall-duplicated-symbols-test - Start 37: metacall-handle-export-test - Start 38: metacall-handle-get-test - 15/175 Test #22: detour-test ...................................... Passed 0.08 sec - 16/175 Test #23: serial-test ...................................... Passed 0.07 sec - 17/175 Test #24: configuration-test ............................... Passed 0.07 sec - 18/175 Test #25: rb-loader-parser-test ............................ Passed 0.06 sec - 19/175 Test #26: portability-path-test ............................ Passed 0.06 sec - Start 39: metacall-test - Start 40: metacall-node-test - Start 41: metacall-node-event-loop-test - Start 42: metacall-node-event-loop-signal-test - Start 43: metacall-node-call-test - 20/175 Test #27: metacall-logs-test ............................... Passed 0.33 sec - Start 44: metacall-node-inline-test - 21/175 Test #32: metacall-load-configuration-relative-test ........ Passed 0.46 sec - Start 45: metacall-node-async-test - 22/175 Test #31: metacall-load-configuration-fail-test ............ Passed 0.66 sec - Start 46: metacall-node-async-multiple-test - 23/175 Test #42: metacall-node-event-loop-signal-test ............. Passed 0.62 sec - Start 47: metacall-node-reentrant-test - 24/175 Test #28: metacall-load-memory-test ........................ Passed 0.72 sec - Start 48: metacall-node-port-test - 25/175 Test #40: metacall-node-test ............................... Passed 0.77 sec - Start 49: metacall-node-port-await-test - 26/175 Test #7: rb_port .......................................... Passed 0.90 sec - Start 50: metacall-node-port-c-lib-test - 27/175 Test #36: metacall-duplicated-symbols-test ................. Passed 1.06 sec - Start 51: metacall-node-python-port-mock-test - 28/175 Test #45: metacall-node-async-test ......................... Passed 0.69 sec - Start 52: metacall-node-python-port-ruby-test - 29/175 Test #44: metacall-node-inline-test ........................ Passed 0.87 sec - Start 53: metacall-node-python-ruby-test - 30/175 Test #47: metacall-node-reentrant-test ..................... Passed 0.66 sec - Start 54: metacall-node-callback-test - 31/175 Test #33: metacall-load-configuration-python-node-test ..... Passed 1.37 sec - Start 55: metacall-node-fail-test - 32/175 Test #43: metacall-node-call-test .......................... Passed 1.36 sec - Start 56: metacall-node-fail-env-var-test - 33/175 Test #37: metacall-handle-export-test ...................... Passed 1.40 sec - Start 57: metacall-node-fail-load-leak-test - 34/175 Test #30: metacall-load-configuration-test ................. Passed 1.51 sec - Start 58: metacall-node-typescript-test - 35/175 Test #34: metacall-load-configuration-node-python-test ..... Passed 1.52 sec - Start 59: metacall-node-python-async-after-destroy-test - 36/175 Test #38: metacall-handle-get-test ......................... Passed 1.52 sec - Start 60: metacall-node-python-await-test - 37/175 Test #35: metacall-duplicated-handle-test .................. Passed 1.56 sec - Start 61: metacall-node-python-exception-test - 38/175 Test #4: py_port .......................................... Passed 1.72 sec - Start 62: metacall-node-clear-mem-test - 39/175 Test #49: metacall-node-port-await-test .................... Passed 0.86 sec - Start 63: metacall-node-async-resources-test - 40/175 Test #50: metacall-node-port-c-lib-test .................... Passed 0.85 sec - Start 64: metacall-node-await-chain-test - 41/175 Test #56: metacall-node-fail-env-var-test .................. Passed 0.35 sec - Start 65: metacall-node-exception-test - 42/175 Test #55: metacall-node-fail-test .......................... Passed 0.60 sec - Start 66: metacall-node-python-deadlock-test - 43/175 Test #57: metacall-node-fail-load-leak-test ................ Passed 0.55 sec - Start 67: metacall-node-native-code-test - 44/175 Test #62: metacall-node-clear-mem-test ..................... Passed 0.42 sec - Start 68: metacall-node-extension-test - 45/175 Test #52: metacall-node-python-port-ruby-test .............. Passed 1.04 sec - Start 69: metacall-node-multithread-deadlock-test - 46/175 Test #64: metacall-node-await-chain-test ................... Passed 0.51 sec - Start 70: metacall-distributable-test - 47/175 Test #51: metacall-node-python-port-mock-test .............. Passed 1.13 sec - Start 71: metacall-cast-test - 48/175 Test #54: metacall-node-callback-test ...................... Passed 0.89 sec - Start 72: metacall-init-fini-test - 49/175 Test #65: metacall-node-exception-test ..................... Passed 0.51 sec - Start 73: metacall-ducktype-test - 50/175 Test #68: metacall-node-extension-test ..................... Passed 0.40 sec - Start 74: metacall-inspect-test - 51/175 Test #60: metacall-node-python-await-test .................. Passed 0.92 sec - Start 75: metacall-integration-test - 52/175 Test #67: metacall-node-native-code-test ................... Passed 0.52 sec - Start 76: metacall-depends-test - 53/175 Test #61: metacall-node-python-exception-test .............. Passed 0.97 sec - Start 77: metacall-configuration-exec-path-test - 54/175 Test #29: metacall-load-memory-empty-test .................. Passed 2.70 sec - Start 78: metacall-configuration-default-test - 55/175 Test #78: metacall-configuration-default-test .............. Passed 0.02 sec - Start 79: metacall-clear-test - 56/175 Test #71: metacall-cast-test ............................... Passed 0.58 sec - Start 80: metacall-python-test - 57/175 Test #73: metacall-ducktype-test ........................... Passed 0.54 sec - Start 81: metacall-python-object-class-test - 58/175 Test #72: metacall-init-fini-test .......................... Passed 0.74 sec - Start 82: metacall-python-gc-test - 59/175 Test #77: metacall-configuration-exec-path-test ............ Passed 0.56 sec - Start 83: metacall-python-open-test - 60/175 Test #76: metacall-depends-test ............................ Passed 0.65 sec - Start 84: metacall-python-dict-test - 61/175 Test #53: metacall-node-python-ruby-test ................... Passed 2.00 sec - Start 85: metacall-python-pointer-test - 62/175 Test #66: metacall-node-python-deadlock-test ............... Passed 1.25 sec - Start 86: metacall-python-reentrant-test - 63/175 Test #81: metacall-python-object-class-test ................ Passed 0.65 sec - Start 87: metacall-python-varargs-test - 64/175 Test #79: metacall-clear-test .............................. Passed 0.98 sec - Start 88: py-loader-port-test - 65/175 Test #82: metacall-python-gc-test .......................... Passed 0.76 sec - Start 89: metacall-python-port-https-test - 66/175 Test #85: metacall-python-pointer-test ..................... Passed 0.57 sec - Start 90: metacall-python-port-callback-test - 67/175 Test #80: metacall-python-test ............................. Passed 1.01 sec - Start 91: metacall-python-port-pointer-test - 68/175 Test #84: metacall-python-dict-test ........................ Passed 0.68 sec - Start 92: metacall-python-port-import-test - 69/175 Test #86: metacall-python-reentrant-test ................... Passed 1.09 sec - Start 93: metacall-python-callback-test - 70/175 Test #87: metacall-python-varargs-test ..................... Passed 0.86 sec - Start 94: metacall-python-fail-test - 71/175 Test #90: metacall-python-port-callback-test ............... Passed 0.80 sec - Start 95: metacall-python-relative-path-test - 72/175 Test #88: py-loader-port-test .............................. Passed 0.91 sec - Start 96: metacall-python-without-functions-test - 73/175 Test #91: metacall-python-port-pointer-test ................ Passed 0.97 sec - Start 97: metacall-python-builtins-test - 74/175 Test #46: metacall-node-async-multiple-test ................ Passed 4.26 sec - Start 98: metacall-python-async-test - 75/175 Test #94: metacall-python-fail-test ........................ Passed 0.67 sec - Start 99: metacall-python-exception-test - 76/175 Test #89: metacall-python-port-https-test .................. Passed 1.28 sec - Start 100: metacall-python-without-env-vars-test - 77/175 Test #95: metacall-python-relative-path-test ............... Passed 0.64 sec - Start 101: metacall-map-test - 78/175 Test #96: metacall-python-without-functions-test ........... Passed 0.65 sec - Start 102: metacall-map-await-test - 79/175 Test #2: node_port ........................................ Passed 5.42 sec - Start 103: metacall-initialize-test - 80/175 Test #103: metacall-initialize-test ......................... Passed 0.05 sec - Start 104: metacall-initialize-ex-test - 81/175 Test #104: metacall-initialize-ex-test ...................... Passed 0.01 sec - Start 105: metacall-reinitialize-test - 82/175 Test #3: node_port_test_executable ........................ Passed 5.50 sec - Start 106: metacall-initialize-destroy-multiple-test - 83/175 Test #106: metacall-initialize-destroy-multiple-test ........ Passed 0.02 sec - Start 107: metacall-initialize-destroy-multiple-node-test - 84/175 Test #97: metacall-python-builtins-test .................... Passed 0.74 sec - Start 108: metacall-reload-functions-test - 85/175 Test #93: metacall-python-callback-test .................... Passed 1.21 sec - Start 109: metacall-invalid-loader-test - 86/175 Test #109: metacall-invalid-loader-test ..................... Passed 0.02 sec - Start 110: metacall-fork-test - 87/175 Test #98: metacall-python-async-test ....................... Passed 0.63 sec - 88/175 Test #105: metacall-reinitialize-test ....................... Passed 0.14 sec - Start 111: metacall-return-monad-test - Start 112: metacall-callback-complex-test - 89/175 Test #58: metacall-node-typescript-test .................... Passed 4.07 sec - Start 113: metacall-ruby-fail-test - 90/175 Test #110: metacall-fork-test ............................... Passed 0.06 sec - Start 114: metacall-ruby-fail-empty-test - 91/175 Test #99: metacall-python-exception-test ................... Passed 0.62 sec - Start 115: metacall-ruby-object-class-test - 92/175 Test #113: metacall-ruby-fail-test .......................... Passed 0.06 sec - Start 116: metacall-ruby-parser-integration-test - 93/175 Test #115: metacall-ruby-object-class-test .................. Passed 0.04 sec - Start 117: metacall-function-test - 94/175 Test #116: metacall-ruby-parser-integration-test ............ Passed 0.04 sec - Start 118: metacall-cobol-test - 95/175 Test #114: metacall-ruby-fail-empty-test .................... Passed 0.08 sec - Start 119: metacall-file-test - 96/175 Test #119: metacall-file-test ............................... Passed 0.02 sec - Start 120: metacall-file-fail-test - 97/175 Test #118: metacall-cobol-test .............................. Passed 0.04 sec - Start 121: metacall-file-glob-test - 98/175 Test #120: metacall-file-fail-test .......................... Passed 0.01 sec - Start 122: metacall-typescript-test - 99/175 Test #100: metacall-python-without-env-vars-test ............ Passed 0.70 sec - Start 123: metacall-typescript-node-test -100/175 Test #121: metacall-file-glob-test .......................... Passed 0.03 sec - Start 124: metacall-typescript-call-map-test -101/175 Test #102: metacall-map-await-test .......................... Passed 0.55 sec - Start 125: metacall-typescript-tsx-test -102/175 Test #107: metacall-initialize-destroy-multiple-node-test ... Passed 0.41 sec - Start 126: metacall-typescript-tsx-loop-fail-test -103/175 Test #41: metacall-node-event-loop-test .................... Passed 5.86 sec - Start 127: metacall-typescript-require-test -104/175 Test #111: metacall-return-monad-test ....................... Passed 0.49 sec - Start 128: metacall-typescript-jsx-default-test -105/175 Test #92: metacall-python-port-import-test ................. Passed 2.49 sec - Start 129: metacall-rpc-test -106/175 Test #101: metacall-map-test ................................ Passed 1.51 sec - Start 130: metacall-csharp-static-class-test -107/175 Test #117: metacall-function-test ........................... Passed 1.21 sec - Start 131: metacall-ruby-test -108/175 Test #131: metacall-ruby-test ............................... Passed 0.12 sec - Start 132: metacall-cs-test -109/175 Test #108: metacall-reload-functions-test ................... Passed 1.82 sec - Start 133: metacall-java-test -110/175 Test #39: metacall-test .................................... Passed 7.34 sec - Start 134: metacall-wasm-test -111/175 Test #129: metacall-rpc-test ................................ Passed 1.13 sec - Start 135: metacall-wasm-python-port-test -112/175 Test #134: metacall-wasm-test ............................... Passed 0.10 sec - Start 136: metacall-c-test -113/175 Test #136: metacall-c-test .................................. Passed 0.15 sec - Start 137: metacall-c-lib-test -114/175 Test #112: metacall-callback-complex-test ................... Passed 2.28 sec - Start 138: metacall-version-test -115/175 Test #137: metacall-c-lib-test .............................. Passed 0.19 sec - Start 139: metacall-dynlink-path-test -116/175 Test #138: metacall-version-test ............................ Passed 0.01 sec - Start 140: metacall-library-path-without-env-vars-test -117/175 Test #139: metacall-dynlink-path-test ....................... Passed 0.01 sec - Start 141: metacall-ext-test -118/175 Test #140: metacall-library-path-without-env-vars-test ...... Passed 0.02 sec - Start 142: metacall-plugin-extension-test -119/175 Test #141: metacall-ext-test ................................ Passed 0.02 sec - Start 143: metacall-plugin-extension-local-test -120/175 Test #70: metacall-distributable-test ...................... Passed 6.31 sec - Start 144: metacall-backtrace-plugin-test -121/175 Test #135: metacall-wasm-python-port-test ................... Passed 1.07 sec - Start 145: metacall-sandbox-plugin-test -122/175 Test #59: metacall-node-python-async-after-destroy-test .... Passed 7.03 sec - Start 146: log-bench -123/175 Test #75: metacall-integration-test ........................ Passed 6.16 sec - Start 147: metacall-py-c-api-bench -124/175 Test #6: rs_port .......................................... Passed 9.00 sec - Start 148: metacall-py-call-bench -125/175 Test #144: metacall-backtrace-plugin-test ................... Passed 0.45 sec - Start 149: metacall-py-init-bench -126/175 Test #74: metacall-inspect-test ............................ Passed 6.67 sec - Start 150: metacall-node-call-bench -127/175 Test #143: metacall-plugin-extension-local-test ............. Passed 1.52 sec - Start 151: metacall-rb-call-bench -128/175 Test #126: metacall-typescript-tsx-loop-fail-test ........... Passed 3.83 sec - Start 152: metacall-cs-call-bench -129/175 Test #149: metacall-py-init-bench ........................... Passed 0.77 sec - Start 153: metacallcli -130/175 Test #83: metacall-python-open-test ........................ Passed 6.71 sec - Start 154: metacallcli-inspect-leak -131/175 Test #142: metacall-plugin-extension-test ................... Passed 1.99 sec - Start 155: metacallcli-node -132/175 Test #123: metacall-typescript-node-test .................... Passed 4.72 sec - Start 156: metacallcli-node-port-py -133/175 Test #145: metacall-sandbox-plugin-test ..................... Passed 2.02 sec - Start 157: metacallcli-node-port-py-rb -134/175 Test #48: metacall-node-port-test .......................... Passed 9.87 sec - Start 158: metacallcli-node-null -135/175 Test #154: metacallcli-inspect-leak ......................... Passed 0.89 sec - Start 159: metacallcli-node-null-empty -136/175 Test #153: metacallcli ...................................... Passed 1.16 sec - Start 160: metacallcli-node-null-undefined -137/175 Test #133: metacall-java-test ............................... Passed 3.56 sec - Start 161: metacallcli-py-port -138/175 Test #155: metacallcli-node ................................. Passed 1.07 sec - Start 162: metacallcli-py-port-rb -139/175 Test #122: metacall-typescript-test ......................... Passed 5.36 sec - Start 163: metacallcli-file -140/175 Test #159: metacallcli-node-null-empty ...................... Passed 0.69 sec - Start 164: metacallcli-file-fail -141/175 Test #124: metacall-typescript-call-map-test ................ Passed 5.78 sec - Start 165: metacallcli-py-naming -142/175 Test #160: metacallcli-node-null-undefined .................. Passed 0.72 sec - Start 166: metacallcli-py-argv -143/175 Test #130: metacall-csharp-static-class-test ................ Passed 5.12 sec - Start 167: metacallcli-py-main -144/175 Test #128: metacall-typescript-jsx-default-test ............. Passed 5.90 sec - Start 168: metacallcli-py-exception -145/175 Test #163: metacallcli-file ................................. Passed 0.92 sec - Start 169: metacallcli-ts -146/175 Test #158: metacallcli-node-null ............................ Passed 1.45 sec - Start 170: metacallcli-tsx-templating -147/175 Test #157: metacallcli-node-port-py-rb ...................... Passed 1.58 sec - Start 171: metacallcli-tsx-loop-fail -148/175 Test #156: metacallcli-node-port-py ......................... Passed 1.70 sec - Start 172: metacallcli-py-tsx -149/175 Test #164: metacallcli-file-fail ............................ Passed 0.84 sec - Start 173: cli_repl_plugin -150/175 Test #162: metacallcli-py-port-rb ........................... Passed 1.43 sec - Start 174: cli_cmd_plugin -151/175 Test #161: metacallcli-py-port .............................. Passed 1.59 sec - Start 175: metacalllog -152/175 Test #175: metacalllog ...................................... Passed 0.03 sec -153/175 Test #173: cli_repl_plugin .................................. Passed 0.69 sec -154/175 Test #174: cli_cmd_plugin ................................... Passed 0.66 sec -155/175 Test #165: metacallcli-py-naming ............................ Passed 1.70 sec -156/175 Test #166: metacallcli-py-argv .............................. Passed 1.79 sec -157/175 Test #132: metacall-cs-test ................................. Passed 6.45 sec -158/175 Test #168: metacallcli-py-exception ......................... Passed 1.97 sec -159/175 Test #167: metacallcli-py-main .............................. Passed 2.32 sec -160/175 Test #127: metacall-typescript-require-test ................. Passed 8.48 sec -161/175 Test #125: metacall-typescript-tsx-test ..................... Passed 8.86 sec -162/175 Test #1: ts_loader_bootstrap .............................. Passed 15.33 sec -163/175 Test #171: metacallcli-tsx-loop-fail ........................ Passed 4.17 sec -164/175 Test #169: metacallcli-ts ................................... Passed 4.44 sec -165/175 Test #146: log-bench ........................................ Passed 8.61 sec -166/175 Test #172: metacallcli-py-tsx ............................... Passed 6.45 sec -167/175 Test #170: metacallcli-tsx-templating ....................... Passed 6.94 sec -168/175 Test #5: go_port .......................................... Passed 20.72 sec -169/175 Test #147: metacall-py-c-api-bench .......................... Passed 14.79 sec -170/175 Test #69: metacall-node-multithread-deadlock-test .......... Passed 22.96 sec -171/175 Test #152: metacall-cs-call-bench ........................... Passed 25.50 sec -172/175 Test #151: metacall-rb-call-bench ........................... Passed 33.41 sec -173/175 Test #148: metacall-py-call-bench ........................... Passed 34.83 sec -174/175 Test #63: metacall-node-async-resources-test ............... Passed 63.56 sec -175/175 Test #150: metacall-node-call-bench ......................... Passed 90.04 sec - -100% tests passed, 0 tests failed out of 175 - -Label Time Summary: -/usr/local/metacall/build/scripts/typedfunc = 28.42 sec*proc (5 tests) -MEMCHECK_IGNORE = 35.41 sec*proc (7 tests) -WORKING_DIRECTORY = 28.42 sec*proc (5 tests) -adt-map-test = 0.03 sec*proc (1 test) -adt-set-test = 0.03 sec*proc (1 test) -adt-trie-test = 0.03 sec*proc (1 test) -adt-vector-test = 0.03 sec*proc (1 test) -configuration-test = 0.07 sec*proc (1 test) -detour-test = 0.08 sec*proc (1 test) -dynlink-test = 0.02 sec*proc (1 test) -environment-test = 0.03 sec*proc (1 test) -go_port = 20.72 sec*proc (1 test) -log-bench = 8.61 sec*proc (1 test) -log-custom-test = 0.03 sec*proc (1 test) -log-test = 0.03 sec*proc (1 test) -metacall-backtrace-plugin-test = 0.45 sec*proc (1 test) -metacall-c-lib-test = 0.19 sec*proc (1 test) -metacall-c-test = 0.15 sec*proc (1 test) -metacall-callback-complex-test = 2.28 sec*proc (1 test) -metacall-cast-test = 0.58 sec*proc (1 test) -metacall-clear-test = 0.98 sec*proc (1 test) -metacall-cobol-test = 0.04 sec*proc (1 test) -metacall-configuration-default-test = 0.02 sec*proc (1 test) -metacall-configuration-exec-path-test = 0.56 sec*proc (1 test) -metacall-cs-call-bench = 25.50 sec*proc (1 test) -metacall-cs-test = 6.45 sec*proc (1 test) -metacall-csharp-static-class-test = 5.12 sec*proc (1 test) -metacall-depends-test = 0.65 sec*proc (1 test) -metacall-distributable-test = 6.31 sec*proc (1 test) -metacall-ducktype-test = 0.54 sec*proc (1 test) -metacall-duplicated-handle-test = 1.56 sec*proc (1 test) -metacall-duplicated-symbols-test = 1.06 sec*proc (1 test) -metacall-dynlink-path-test = 0.01 sec*proc (1 test) -metacall-ext-test = 0.02 sec*proc (1 test) -metacall-file-fail-test = 0.01 sec*proc (1 test) -metacall-file-glob-test = 0.03 sec*proc (1 test) -metacall-file-test = 0.02 sec*proc (1 test) -metacall-fork-test = 0.06 sec*proc (1 test) -metacall-function-test = 1.21 sec*proc (1 test) -metacall-handle-export-test = 1.40 sec*proc (1 test) -metacall-handle-get-test = 1.52 sec*proc (1 test) -metacall-init-fini-test = 0.74 sec*proc (1 test) -metacall-initialize-destroy-multiple-node-test = 0.41 sec*proc (1 test) -metacall-initialize-destroy-multiple-test = 0.02 sec*proc (1 test) -metacall-initialize-ex-test = 0.01 sec*proc (1 test) -metacall-initialize-test = 0.05 sec*proc (1 test) -metacall-inspect-test = 6.67 sec*proc (1 test) -metacall-integration-test = 6.16 sec*proc (1 test) -metacall-invalid-loader-test = 0.02 sec*proc (1 test) -metacall-java-test = 3.56 sec*proc (1 test) -metacall-library-path-without-env-vars-test = 0.02 sec*proc (1 test) -metacall-load-configuration-fail-test = 0.66 sec*proc (1 test) -metacall-load-configuration-node-python-test = 1.52 sec*proc (1 test) -metacall-load-configuration-python-node-test = 1.37 sec*proc (1 test) -metacall-load-configuration-relative-test = 0.46 sec*proc (1 test) -metacall-load-configuration-test = 1.51 sec*proc (1 test) -metacall-load-memory-empty-test = 2.70 sec*proc (1 test) -metacall-load-memory-test = 0.72 sec*proc (1 test) -metacall-logs-test = 0.33 sec*proc (1 test) -metacall-map-await-test = 0.55 sec*proc (1 test) -metacall-map-test = 1.51 sec*proc (1 test) -metacall-node-async-multiple-test = 4.26 sec*proc (1 test) -metacall-node-async-resources-test = 63.56 sec*proc (1 test) -metacall-node-async-test = 0.69 sec*proc (1 test) -metacall-node-await-chain-test = 0.51 sec*proc (1 test) -metacall-node-call-bench = 90.04 sec*proc (1 test) -metacall-node-call-test = 1.36 sec*proc (1 test) -metacall-node-callback-test = 0.89 sec*proc (1 test) -metacall-node-clear-mem-test = 0.42 sec*proc (1 test) -metacall-node-event-loop-signal-test = 0.62 sec*proc (1 test) -metacall-node-event-loop-test = 5.86 sec*proc (1 test) -metacall-node-exception-test = 0.51 sec*proc (1 test) -metacall-node-extension-test = 0.40 sec*proc (1 test) -metacall-node-fail-env-var-test = 0.35 sec*proc (1 test) -metacall-node-fail-load-leak-test = 0.55 sec*proc (1 test) -metacall-node-fail-test = 0.60 sec*proc (1 test) -metacall-node-inline-test = 0.87 sec*proc (1 test) -metacall-node-multithread-deadlock-test = 22.96 sec*proc (1 test) -metacall-node-native-code-test = 0.52 sec*proc (1 test) -metacall-node-port-await-test = 0.86 sec*proc (1 test) -metacall-node-port-c-lib-test = 0.85 sec*proc (1 test) -metacall-node-port-test = 9.87 sec*proc (1 test) -metacall-node-python-async-after-destroy-test = 7.03 sec*proc (1 test) -metacall-node-python-await-test = 0.92 sec*proc (1 test) -metacall-node-python-deadlock-test = 1.25 sec*proc (1 test) -metacall-node-python-exception-test = 0.97 sec*proc (1 test) -metacall-node-python-port-mock-test = 1.13 sec*proc (1 test) -metacall-node-python-port-ruby-test = 1.04 sec*proc (1 test) -metacall-node-python-ruby-test = 2.00 sec*proc (1 test) -metacall-node-reentrant-test = 0.66 sec*proc (1 test) -metacall-node-test = 0.77 sec*proc (1 test) -metacall-node-typescript-test = 4.07 sec*proc (1 test) -metacall-plugin-extension-local-test = 1.52 sec*proc (1 test) -metacall-plugin-extension-test = 1.99 sec*proc (1 test) -metacall-py-c-api-bench = 14.79 sec*proc (1 test) -metacall-py-call-bench = 34.83 sec*proc (1 test) -metacall-py-init-bench = 0.77 sec*proc (1 test) -metacall-python-builtins-test = 0.74 sec*proc (1 test) -metacall-python-callback-test = 1.21 sec*proc (1 test) -metacall-python-dict-test = 0.68 sec*proc (1 test) -metacall-python-exception-test = 0.62 sec*proc (1 test) -metacall-python-fail-test = 0.67 sec*proc (1 test) -metacall-python-gc-test = 0.76 sec*proc (1 test) -metacall-python-object-class-test = 0.65 sec*proc (1 test) -metacall-python-open-test = 6.71 sec*proc (1 test) -metacall-python-pointer-test = 0.57 sec*proc (1 test) -metacall-python-port-callback-test = 0.80 sec*proc (1 test) -metacall-python-port-https-test = 1.28 sec*proc (1 test) -metacall-python-port-import-test = 2.49 sec*proc (1 test) -metacall-python-port-pointer-test = 0.97 sec*proc (1 test) -metacall-python-reentrant-test = 1.09 sec*proc (1 test) -metacall-python-relative-path-test = 0.64 sec*proc (1 test) -metacall-python-test = 1.01 sec*proc (1 test) -metacall-python-varargs-test = 0.86 sec*proc (1 test) -metacall-python-without-env-vars-test = 0.70 sec*proc (1 test) -metacall-python-without-functions-test = 0.65 sec*proc (1 test) -metacall-rb-call-bench = 33.41 sec*proc (1 test) -metacall-reinitialize-test = 0.14 sec*proc (1 test) -metacall-reload-functions-test = 1.82 sec*proc (1 test) -metacall-return-monad-test = 0.49 sec*proc (1 test) -metacall-rpc-test = 1.13 sec*proc (1 test) -metacall-ruby-fail-empty-test = 0.08 sec*proc (1 test) -metacall-ruby-fail-test = 0.06 sec*proc (1 test) -metacall-ruby-object-class-test = 0.04 sec*proc (1 test) -metacall-ruby-parser-integration-test = 0.04 sec*proc (1 test) -metacall-ruby-test = 0.12 sec*proc (1 test) -metacall-sandbox-plugin-test = 2.02 sec*proc (1 test) -metacall-test = 7.34 sec*proc (1 test) -metacall-typescript-call-map-test = 5.78 sec*proc (1 test) -metacall-typescript-jsx-default-test = 5.90 sec*proc (1 test) -metacall-typescript-node-test = 4.72 sec*proc (1 test) -metacall-typescript-require-test = 8.48 sec*proc (1 test) -metacall-typescript-test = 5.36 sec*proc (1 test) -metacall-typescript-tsx-loop-fail-test = 3.83 sec*proc (1 test) -metacall-typescript-tsx-test = 8.86 sec*proc (1 test) -metacall-version-test = 0.01 sec*proc (1 test) -metacall-wasm-python-port-test = 1.07 sec*proc (1 test) -metacall-wasm-test = 0.10 sec*proc (1 test) -metacallcli = 1.16 sec*proc (1 test) -metacallcli-file = 0.92 sec*proc (1 test) -metacallcli-file-fail = 0.84 sec*proc (1 test) -metacallcli-inspect-leak = 0.89 sec*proc (1 test) -metacallcli-node = 1.07 sec*proc (1 test) -metacallcli-node-null = 1.45 sec*proc (1 test) -metacallcli-node-null-empty = 0.69 sec*proc (1 test) -metacallcli-node-null-undefined = 0.72 sec*proc (1 test) -metacallcli-node-port-py = 1.70 sec*proc (1 test) -metacallcli-node-port-py-rb = 1.58 sec*proc (1 test) -metacallcli-py-argv = 1.79 sec*proc (1 test) -metacallcli-py-exception = 1.97 sec*proc (1 test) -metacallcli-py-main = 2.32 sec*proc (1 test) -metacallcli-py-naming = 1.70 sec*proc (1 test) -metacallcli-py-port = 1.59 sec*proc (1 test) -metacallcli-py-port-rb = 1.43 sec*proc (1 test) -metacallcli-py-tsx = 6.45 sec*proc (1 test) -metacallcli-ts = 4.44 sec*proc (1 test) -metacallcli-tsx-loop-fail = 4.17 sec*proc (1 test) -metacallcli-tsx-templating = 6.94 sec*proc (1 test) -metacalllog = 0.03 sec*proc (1 test) -node_port_test = 5.42 sec*proc (1 test) -node_port_test_executable = 5.50 sec*proc (1 test) -portability-path-test = 0.06 sec*proc (1 test) -preprocessor-test = 0.04 sec*proc (1 test) -py-loader-port-test = 0.91 sec*proc (1 test) -py_port_test = 1.72 sec*proc (1 test) -rb-loader-parser-test = 0.06 sec*proc (1 test) -rb_port_test = 0.90 sec*proc (1 test) -reflect-function-test = 0.02 sec*proc (1 test) -reflect-metadata-test = 0.02 sec*proc (1 test) -reflect-object-class-test = 0.02 sec*proc (1 test) -reflect-scope-test = 0.02 sec*proc (1 test) -reflect-value-cast-test = 0.02 sec*proc (1 test) -rs_port = 9.00 sec*proc (1 test) -serial-test = 0.07 sec*proc (1 test) -ts_loader_bootstrap = 15.33 sec*proc (1 test) - -Total Test time (real) = 99.30 sec -+ [ 0 = 1 ] -+ [ 1 = 1 ] -+ [ = ] -+ make install -[ 0%] Built target version -[ 0%] Built target preprocessor -[ 1%] Built target environment -[ 1%] Built target format -[ 1%] Built target threading -[ 2%] Built target portability -[ 6%] Built target log -[ 6%] Built target memory -[ 7%] Built target adt -[ 8%] Built target filesystem -[ 9%] Built target dynlink -[ 10%] Built target plugin -[ 10%] Built target detour -[ 13%] Built target reflect -[ 13%] Built target serial -[ 14%] Built target configuration -[ 14%] Built target loader -[ 29%] Built target metacall -[ 30%] Built target libtcc-depends -[ 30%] Built target c_loader -[ 30%] Built target cob_loader - Determining projects to restore... - All projects are up-to-date for restore. -MSBuild version 17.7.6+77d58ec69 for .NET - Determining projects to restore... - All projects are up-to-date for restore. - project -> /usr/local/metacall/source/loaders/cs_loader/netcore/source/bin/Debug/net7.0/CSLoader.dll - project -> /usr/local/metacall/build/ -[ 30%] Built target cs_loader_impl -[ 31%] Built target cs_loader -[ 32%] Built target ext_loader -[ 32%] Built target file_loader -Note: /usr/local/metacall/source/loaders/java_loader/bootstrap/lib/bootstrap.java uses or overrides a deprecated API. -Note: Recompile with -Xlint:deprecation for details. -[ 32%] Built target java_loader_bootstrap -[ 33%] Built target java_loader -[ 33%] Built target mock_loader -Installing node_loader_bootstrap dependencies - -up to date, audited 5 packages in 437ms - -1 package is looking for funding - run `npm fund` for details - -found 0 vulnerabilities -[ 33%] Built target node_loader_bootstrap_depends -Copying node_loader_bootstrap dependencies -node_loader_bootstrap dependencies copied from /usr/local/metacall/source/loaders/node_loader/bootstrap/node_modules to /usr/local/metacall/build/node_modules -[ 33%] Built target node_loader_bootstrap_copy_depends -[ 33%] Built target node_loader_bootstrap -[ 34%] Built target node_loader -[ 35%] Built target py_loader -[ 35%] Built target rb_loader -[ 36%] Built target rpc_loader -Installing ts_loader_bootstrap dependencies - -up to date, audited 3 packages in 1s - -found 0 vulnerabilities -[ 36%] Built target ts_loader_bootstrap_depends - -> ts_loader_bootstrap@1.1.0 build -> tsc - -[ 36%] Built target ts_loader_bootstrap_build -Copying ts_loader_bootstrap dependencies -ts_loader_bootstrap dependencies copied from /usr/local/metacall/source/loaders/ts_loader/bootstrap/node_modules to /usr/local/metacall/build/node_modules -[ 36%] Built target ts_loader_bootstrap -[ 37%] Built target ts_loader -[ 38%] Built target wasm_loader -[ 39%] Built target metacall_serial -[ 39%] Built target rapid_json_serial -[ 39%] Built target plthook_detour -[ 39%] Built target plugin_extension -[ 39%] Built target backtrace_plugin_config -[ 39%] Built target backtrace_plugin -[ 39%] Built target backward_object -[ 40%] Built target backward -[ 40%] Built target sandbox_plugin_config -[ 40%] Built target sandbox_plugin -Installing node_port - -up to date, audited 81 packages in 722ms - -20 packages are looking for funding - run `npm fund` for details - -3 moderate severity vulnerabilities - -To address all issues (including breaking changes), run: - npm audit fix --force - -Run `npm audit` for details. -[ 40%] Built target node_port -Failed to run rustfmt: No such file or directory (os error 2) (non-fatal, continuing) -[ 40%] Built target rs_port_bindings - Compiling metacall v0.4.2 (/usr/local/metacall/source/ports/rs_port) - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s -[ 40%] Built target rs_port -[ 41%] Built target rb_port_swig_compilation -[ 41%] Built target rb_port -[ 41%] Built target c-compiled -[ 41%] Built target c-ffi -[ 41%] Built target c-cbks -[ 41%] Built target c-loadtest -[ 42%] Built target loadtest -[ 42%] Built target cobol-say -[ 42%] Built target csharp-hello -[ 42%] Built target csharp-static -[ 42%] Built target csharp-function -[ 43%] Built target sum_extension -[ 43%] Built target file-static -[ 43%] Built target file-favicon -[ 43%] Built target file-glob -[ 43%] Built target java-fibonnaci -[ 43%] Built target java-jartest -[ 43%] Built target java-test -[ 43%] Built target nodejs-nod -[ 43%] Built target nodejs-inline -[ 43%] Built target nodejs-export -[ 43%] Built target nodejs-host -[ 43%] Built target nodejs-server -[ 43%] Built target nodejs-factcallback -[ 43%] Built target nodejs-derpyramda - -up to date, audited 49 packages in 608ms - -1 moderate severity vulnerability - -To address all issues, run: - npm audit fix - -Run `npm audit` for details. -[ 43%] Built target nodejs-gram-depends -[ 43%] Built target nodejs-gram -[ 43%] Built target nodejs-duplicated - -up to date, audited 2 packages in 434ms - -found 0 vulnerabilities -[ 43%] Built target nodejs-ramda-depends -[ 43%] Built target nodejs-ramda -[ 43%] Built target python-example -[ 43%] Built target python-helloworld -[ 43%] Built target python-initfini -[ 43%] Built target python-callback -[ 43%] Built target python-function -[ 43%] Built target python-ducktype -[ 43%] Built target python-rsasample -[ 43%] Built target python-garbage -[ 43%] Built target python-classname -[ 43%] Built target python-web -[ 43%] Built target python-landing -[ 43%] Built target python-model -[ 43%] Built target python-pointer -[ 43%] Built target python-dicty -[ 43%] Built target python-host -[ 43%] Built target python-s1 -[ 43%] Built target python-s2 -[ 43%] Built target python-withoutfunctions -[ 43%] Built target python-wasm -[ 43%] Built target python-badimport -[ 43%] Built target python-watzon -[ 43%] Built target python-fnmesh -[ 43%] Built target ruby-hello -[ 43%] Built target ruby-second -[ 43%] Built target ruby-blog -[ 43%] Built target ruby-cache -[ 43%] Built target ruby-ducktype -[ 43%] Built target ruby-invalid -[ 43%] Built target ruby-klass -[ 43%] Built target ruby-failempty -[ 43%] Built target rpc-remote -[ 43%] Built target typescript-typedfunc - -up to date, audited 7 packages in 477ms - -found 0 vulnerabilities -[ 43%] Built target typescript-templating-depends -[ 43%] Built target typescript-templating -[ 43%] Built target typescript-loopfail -[ 43%] Built target typescript-badrequire -[ 43%] Built target typescript-server -[ 43%] Built target wasm-tests -[ 44%] Built target google-test-depends -[ 44%] Built target preprocessor-test -[ 44%] Built target environment-test -[ 45%] Built target log-test -[ 45%] Built target log-custom-test -[ 45%] Built target adt-set-test -[ 46%] Built target adt-trie-test -[ 46%] Built target adt-vector-test -[ 46%] Built target adt-map-test -[ 47%] Built target reflect-value-cast-test -[ 47%] Built target reflect-function-test -[ 48%] Built target reflect-object-class-test -[ 48%] Built target reflect-scope-test -[ 48%] Built target reflect-metadata-test -[ 48%] Built target dynlink-test -[ 48%] Built target detour-test -[ 48%] Built target serial-test -[ 48%] Built target configuration-test -[ 49%] Built target rb-loader-parser-test -[ 50%] Built target portability-path-test -[ 51%] Built target metacall-logs-test -[ 51%] Built target metacall-load-memory-test -[ 51%] Built target metacall-load-memory-empty-test -[ 52%] Built target metacall-load-configuration-test -[ 52%] Built target metacall-load-configuration-fail-test -[ 52%] Built target metacall-load-configuration-relative-test -[ 53%] Built target metacall-load-configuration-python-node-test -[ 53%] Built target metacall-load-configuration-node-python-test -[ 53%] Built target metacall-duplicated-handle-test -[ 53%] Built target metacall-duplicated-symbols-test -[ 53%] Built target metacall-handle-export-test -[ 54%] Built target metacall-handle-get-test -[ 55%] Built target metacall-test -[ 56%] Built target metacall-node-test -[ 56%] Built target metacall-node-event-loop-test -[ 57%] Built target metacall-node-event-loop-signal-test -[ 58%] Built target metacall-node-call-test -[ 58%] Built target metacall-node-inline-test -[ 59%] Built target metacall-node-async-test -[ 60%] Built target metacall-node-async-multiple-test -[ 60%] Built target metacall-node-reentrant-test -[ 60%] Built target metacall-node-port-test -[ 61%] Built target metacall-node-port-await-test -[ 61%] Built target metacall-node-port-c-lib-test -[ 61%] Built target metacall-node-python-port-mock-test -[ 62%] Built target metacall-node-python-port-ruby-test -[ 62%] Built target metacall-node-python-ruby-test -[ 62%] Built target metacall-node-callback-test -[ 62%] Built target metacall-node-fail-test -[ 62%] Built target metacall-node-fail-env-var-test -[ 63%] Built target metacall-node-fail-load-leak-test -[ 63%] Built target metacall-node-typescript-test -[ 64%] Built target metacall-node-python-async-after-destroy-test -[ 64%] Built target metacall-node-python-await-test -[ 65%] Built target metacall-node-python-exception-test -[ 65%] Built target metacall-node-clear-mem-test -[ 65%] Built target metacall-node-async-resources-test -[ 65%] Built target metacall-node-await-chain-test -[ 66%] Built target metacall-node-exception-test -[ 66%] Built target metacall-node-python-deadlock-test -[ 66%] Built target metacall-node-native-code-test -[ 66%] Built target node_extension_test -[ 66%] Built target metacall-node-extension-test -[ 67%] Built target metacall-node-multithread-deadlock-test -[ 67%] Built target metacall-distributable-test -[ 68%] Built target metacall-cast-test -[ 68%] Built target metacall-init-fini-test -[ 69%] Built target metacall-ducktype-test -[ 69%] Built target metacall-inspect-test -[ 70%] Built target metacall-integration-test -[ 71%] Built target metacall-depends-test -[ 71%] Built target metacall-configuration-exec-path-test -[ 71%] Built target metacall-configuration-default-test -[ 71%] Built target metacall-clear-test -[ 71%] Built target metacall-python-test -[ 72%] Built target metacall-python-object-class-test -[ 72%] Built target metacall-python-gc-test - -up to date, audited 16 packages in 514ms - -1 package is looking for funding - run `npm fund` for details - -found 0 vulnerabilities -[ 72%] Built target metacall-python-open-test-depends -[ 72%] Built target metacall-python-open-test -[ 72%] Built target metacall-python-dict-test -[ 72%] Built target metacall-python-pointer-test -[ 72%] Built target metacall-python-reentrant-test -[ 72%] Built target metacall-python-varargs-test -[ 73%] Built target py-loader-port-test -[ 73%] Built target metacall-python-port-https-test -[ 74%] Built target metacall-python-port-callback-test -[ 74%] Built target metacall-python-port-pointer-test -[ 75%] Built target metacall-python-port-import-test -[ 76%] Built target metacall-python-callback-test -[ 76%] Built target metacall-python-fail-test -[ 77%] Built target metacall-python-relative-path-test -[ 77%] Built target metacall-python-without-functions-test -[ 77%] Built target metacall-python-builtins-test -[ 77%] Built target metacall-python-async-test -[ 78%] Built target metacall-python-exception-test -[ 79%] Built target metacall-python-without-env-vars-test -[ 79%] Built target metacall-map-test -[ 79%] Built target metacall-map-await-test -[ 80%] Built target metacall-initialize-test -[ 80%] Built target metacall-initialize-ex-test -[ 81%] Built target metacall-reinitialize-test -[ 81%] Built target metacall-initialize-destroy-multiple-test -[ 82%] Built target metacall-initialize-destroy-multiple-node-test -[ 82%] Built target metacall-reload-functions-test -[ 82%] Built target metacall-invalid-loader-test -[ 83%] Built target metacall-fork-test -[ 84%] Built target metacall-return-monad-test -[ 84%] Built target metacall-callback-complex-test -[ 85%] Built target metacall-ruby-fail-test -[ 85%] Built target metacall-ruby-fail-empty-test -[ 85%] Built target metacall-ruby-object-class-test -[ 85%] Built target metacall-ruby-parser-integration-test -[ 85%] Built target metacall-function-test -[ 86%] Built target metacall-cobol-test -[ 86%] Built target metacall-file-test -[ 86%] Built target metacall-file-fail-test -[ 87%] Built target metacall-file-glob-test -[ 88%] Built target metacall-typescript-test -[ 89%] Built target metacall-typescript-node-test -[ 89%] Built target metacall-typescript-call-map-test -[ 89%] Built target metacall-typescript-tsx-test -[ 89%] Built target metacall-typescript-tsx-loop-fail-test -[ 89%] Built target metacall-typescript-require-test -[ 89%] Built target metacall-typescript-jsx-default-test -[ 89%] Built target metacall-rpc-test -[ 89%] Built target metacall-csharp-static-class-test -[ 90%] Built target metacall-ruby-test -[ 90%] Built target metacall-cs-test -[ 90%] Built target metacall-java-test -[ 90%] Built target metacall-wasm-test -[ 90%] Built target metacall-wasm-python-port-test -[ 90%] Built target metacall-c-test -[ 91%] Built target metacall-c-lib-test -[ 92%] Built target metacall-version-test -[ 93%] Built target metacall-dynlink-path-test -[ 94%] Built target metacall-library-path-without-env-vars-test -[ 94%] Built target metacall-ext-test -[ 95%] Built target metacall-plugin-extension-test -[ 95%] Built target metacall-plugin-extension-local-test -[ 95%] Built target metacall-backtrace-plugin-test -[ 95%] Built target metacall-sandbox-plugin-test -[ 96%] Built target google-bench-depends -[ 96%] Built target log-bench -[ 96%] Built target metacall-py-c-api-bench -[ 96%] Built target metacall-py-call-bench -[ 97%] Built target metacall-py-init-bench -[ 97%] Built target metacall-node-call-bench -[ 97%] Built target metacall-rb-call-bench -[ 98%] Built target metacall-cs-call-bench -[ 98%] Built target cli_repl_plugin -[ 98%] Built target cli_core_plugin -[ 98%] Built target metacallcli-scripts-tests -[ 98%] Built target metacallcli -[ 98%] Built target cli_core_plugin_config -[ 98%] Built target cli_cmd_plugin -[ 99%] Built target cli_sandbox_plugin -[ 99%] Built target cli_sandbox_plugin_config -[100%] Built target metacalllog -Install the project... --- Install configuration: "Debug" --- Installing: /usr/local/share/metacall/configurations --- Installing: /usr/local/share/metacall/configurations/cs_loader.json --- Installing: /usr/local/share/metacall/configurations/node_loader.json --- Installing: /usr/local/share/metacall/configurations/global.json --- Installing: /usr/local/include/metacall --- Installing: /usr/local/include/metacall/metacall_link.h --- Installing: /usr/local/include/metacall/metacall_allocator.h --- Installing: /usr/local/include/metacall/metacall.h --- Installing: /usr/local/include/metacall/metacall_value.h --- Installing: /usr/local/include/metacall/metacall_fork.h --- Installing: /usr/local/include/metacall/metacall_log.h --- Installing: /usr/local/include/metacall/metacall_error.h --- Up-to-date: /usr/local/include/metacall --- Installing: /usr/local/include/metacall/metacall_def.h --- Installing: /usr/local/include/metacall/metacall_api.h --- Installing: /usr/local/lib/libmetacalld.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libmetacalld.so" to "/usr/local/lib" --- Installing: /usr/local/lib/libtcc.so --- Up-to-date: /usr/local/lib --- Installing: /usr/local/lib/libtcc1.a --- Installing: /usr/local/lib/runmain.o --- Installing: /usr/local/lib/bcheck.o --- Installing: /usr/local/lib/bt-log.o --- Installing: /usr/local/lib/bt-exe.o --- Up-to-date: /usr/local/include --- Installing: /usr/local/include/stdatomic.h --- Installing: /usr/local/include/tccdefs.h --- Installing: /usr/local/include/stddef.h --- Installing: /usr/local/include/varargs.h --- Installing: /usr/local/include/tcclib.h --- Installing: /usr/local/include/stdnoreturn.h --- Installing: /usr/local/include/stdarg.h --- Installing: /usr/local/include/stdbool.h --- Installing: /usr/local/include/stdalign.h --- Installing: /usr/local/include/tgmath.h --- Installing: /usr/local/include/float.h --- Installing: /usr/local/lib/libc_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libc_loaderd.so" to "/usr/local/lib:/usr/lib/llvm-14/lib" --- Installing: /usr/local/lib/libcob_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libcob_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/CSLoader.dll --- Installing: /usr/local/lib/Microsoft.CodeAnalysis.dll --- Installing: /usr/local/lib/Microsoft.CodeAnalysis.CSharp.dll --- Installing: /usr/local/lib/libcs_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libcs_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/libext_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libext_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/libfile_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libfile_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/bootstrap.class --- Installing: /usr/local/lib/libjava_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libjava_loaderd.so" to "/usr/local/lib:/usr/lib/jvm/default-java/lib:/usr/lib/jvm/default-java/lib/server" --- Installing: /usr/local/lib/libmock_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libmock_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/node_modules/espree --- Installing: /usr/local/lib/node_modules/espree/dist --- Installing: /usr/local/lib/node_modules/espree/dist/espree.cjs --- Installing: /usr/local/lib/node_modules/espree/espree.js --- Installing: /usr/local/lib/node_modules/espree/package.json --- Installing: /usr/local/lib/node_modules/espree/LICENSE --- Installing: /usr/local/lib/node_modules/espree/lib --- Installing: /usr/local/lib/node_modules/espree/lib/espree.js --- Installing: /usr/local/lib/node_modules/espree/lib/options.js --- Installing: /usr/local/lib/node_modules/espree/lib/version.js --- Installing: /usr/local/lib/node_modules/espree/lib/token-translator.js --- Installing: /usr/local/lib/node_modules/espree/lib/features.js --- Installing: /usr/local/lib/node_modules/espree/README.md --- Installing: /usr/local/lib/node_modules/acorn --- Installing: /usr/local/lib/node_modules/acorn/dist --- Installing: /usr/local/lib/node_modules/acorn/dist/acorn.mjs.d.ts --- Installing: /usr/local/lib/node_modules/acorn/dist/acorn.d.ts --- Installing: /usr/local/lib/node_modules/acorn/dist/acorn.mjs --- Installing: /usr/local/lib/node_modules/acorn/dist/acorn.js --- Installing: /usr/local/lib/node_modules/acorn/dist/bin.js --- Installing: /usr/local/lib/node_modules/acorn/bin --- Installing: /usr/local/lib/node_modules/acorn/bin/acorn --- Installing: /usr/local/lib/node_modules/acorn/CHANGELOG.md --- Installing: /usr/local/lib/node_modules/acorn/package.json --- Installing: /usr/local/lib/node_modules/acorn/LICENSE --- Installing: /usr/local/lib/node_modules/acorn/README.md --- Installing: /usr/local/lib/node_modules/acorn-jsx --- Installing: /usr/local/lib/node_modules/acorn-jsx/xhtml.js --- Installing: /usr/local/lib/node_modules/acorn-jsx/index.js --- Installing: /usr/local/lib/node_modules/acorn-jsx/package.json --- Installing: /usr/local/lib/node_modules/acorn-jsx/index.d.ts --- Installing: /usr/local/lib/node_modules/acorn-jsx/LICENSE --- Installing: /usr/local/lib/node_modules/acorn-jsx/README.md --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/dist --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/dist/index.d.ts --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/package.json --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/LICENSE --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/lib --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/lib/visitor-keys.js --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/lib/index.js --- Installing: /usr/local/lib/node_modules/eslint-visitor-keys/README.md --- Installing: /usr/local/lib/bootstrap.js --- Installing: /usr/local/lib/libnode_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libnode_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/libpy_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libpy_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/librb_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/librb_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/librpc_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/librpc_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/node_modules/typescript --- Installing: /usr/local/lib/node_modules/typescript/CODE_OF_CONDUCT.md --- Installing: /usr/local/lib/node_modules/typescript/LICENSE.txt --- Installing: /usr/local/lib/node_modules/typescript/bin --- Installing: /usr/local/lib/node_modules/typescript/bin/tsserver --- Installing: /usr/local/lib/node_modules/typescript/bin/tsc --- Installing: /usr/local/lib/node_modules/typescript/CopyrightNotice.txt --- Installing: /usr/local/lib/node_modules/typescript/loc --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/DEU/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PTB/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/RUS/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ESN/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHS/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/PLK/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/TRK/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CHT/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/KOR/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/ITA/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/JPN/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/CSY/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptLanguageService --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptLanguageService/Microsoft.CodeAnalysis.TypeScript.EditorFeatures.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/Targets --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/Targets/TypeScriptCompile.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/Targets/ProjectItemsSchema.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/Targets/TypeScriptProjectProperties.xaml.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptTasks --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptTasks/TypeScript.Tasks.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptDebugEngine --- Installing: /usr/local/lib/node_modules/typescript/loc/lcl/FRA/TypeScriptDebugEngine/TypeScriptDebugEngine.dll.lcl --- Installing: /usr/local/lib/node_modules/typescript/AUTHORS.md --- Installing: /usr/local/lib/node_modules/typescript/ThirdPartyNoticeText.txt --- Installing: /usr/local/lib/node_modules/typescript/package.json --- Installing: /usr/local/lib/node_modules/typescript/lib --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.intl.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es5.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.object.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.collection.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/typescriptServices.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/tsserverlibrary.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/cs --- Installing: /usr/local/lib/node_modules/typescript/lib/cs/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.core.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/typesMap.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.symbol.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/tr --- Installing: /usr/local/lib/node_modules/typescript/lib/tr/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.promise.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/ko --- Installing: /usr/local/lib/node_modules/typescript/lib/ko/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/es --- Installing: /usr/local/lib/node_modules/typescript/lib/es/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.string.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.weakref.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.scripthost.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/typescript.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.full.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.reflect.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/protocol.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.promise.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.full.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.string.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.webworker.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/pl --- Installing: /usr/local/lib/node_modules/typescript/lib/pl/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/fr --- Installing: /usr/local/lib/node_modules/typescript/lib/fr/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.generator.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.string.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.full.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/typescript.js --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/cancellationToken.js --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/tsserverlibrary.js --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.webworker.iterable.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/ja --- Installing: /usr/local/lib/node_modules/typescript/lib/ja/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.regexp.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.full.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.intl.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/pt-br --- Installing: /usr/local/lib/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.intl.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/zh-tw --- Installing: /usr/local/lib/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2016.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.object.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/tsserver.js --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2016.array.include.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/de --- Installing: /usr/local/lib/node_modules/typescript/lib/de/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.intl.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.dom.iterable.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/typescriptServices.js --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.string.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.dom.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/watchGuard.js --- Installing: /usr/local/lib/node_modules/typescript/lib/zh-cn --- Installing: /usr/local/lib/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/ru --- Installing: /usr/local/lib/node_modules/typescript/lib/ru/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.symbol.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/typingsInstaller.js --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.esnext.promise.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.promise.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/README.md --- Installing: /usr/local/lib/node_modules/typescript/lib/it --- Installing: /usr/local/lib/node_modules/typescript/lib/it/diagnosticMessages.generated.json --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2016.full.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.array.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2020.bigint.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.full.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/tsc.js --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2015.proxy.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es6.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.webworker.importscripts.d.ts --- Installing: /usr/local/lib/node_modules/typescript/lib/lib.es2019.d.ts --- Installing: /usr/local/lib/node_modules/typescript/README.md --- Installing: /usr/local/lib/bootstrap.ts --- Installing: /usr/local/lib/libts_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libts_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/libwasm_loaderd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libwasm_loaderd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/libwasmtime.so --- Installing: /usr/local/lib/libmetacall_seriald.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libmetacall_seriald.so" to "/usr/local/lib" --- Installing: /usr/local/lib/librapid_json_seriald.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/librapid_json_seriald.so" to "/usr/local/lib" --- Installing: /usr/local/lib/libplthook_detourd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libplthook_detourd.so" to "/usr/local/lib" --- Installing: /usr/local/lib/libplugin_extensiond.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/libplugin_extensiond.so" to "/usr/local/lib" --- Installing: /usr/local/include/backward.hpp --- Installing: /usr/local/lib/backward/BackwardConfig.cmake --- Installing: /usr/local/lib/plugins --- Installing: /usr/local/lib/plugins/backtrace_plugin --- Installing: /usr/local/lib/plugins/backtrace_plugin/libbacktrace_plugind.so --- Installing: /usr/local/lib/plugins/backtrace_plugin/metacall.json --- Installing: /usr/local/lib/plugins/cli --- Installing: /usr/local/lib/plugins/cli/cmd --- Installing: /usr/local/lib/plugins/cli/cmd/cli_sandbox_plugin --- Installing: /usr/local/lib/plugins/cli/cmd/cli_sandbox_plugin/libcli_sandbox_plugind.so --- Installing: /usr/local/lib/plugins/cli/cmd/cli_sandbox_plugin/metacall.json --- Installing: /usr/local/lib/plugins/cli/internal --- Installing: /usr/local/lib/plugins/cli/internal/cli_repl_plugin --- Installing: /usr/local/lib/plugins/cli/internal/cli_repl_plugin/cli_repl_plugin.js --- Installing: /usr/local/lib/plugins/cli/internal/cli_repl_plugin/parser.js --- Installing: /usr/local/lib/plugins/cli/internal/cli_repl_plugin/metacall.json --- Installing: /usr/local/lib/plugins/cli/internal/cli_cmd_plugin --- Installing: /usr/local/lib/plugins/cli/internal/cli_cmd_plugin/cli_cmd_plugin.js --- Installing: /usr/local/lib/plugins/cli/internal/cli_cmd_plugin/metacall.json --- Installing: /usr/local/lib/plugins/cli/repl --- Installing: /usr/local/lib/plugins/cli/repl/cli_core_plugin --- Installing: /usr/local/lib/plugins/cli/repl/cli_core_plugin/libcli_core_plugind.so --- Installing: /usr/local/lib/plugins/cli/repl/cli_core_plugin/cli_core_plugin_repl.js --- Installing: /usr/local/lib/plugins/cli/repl/cli_core_plugin/metacall.json --- Installing: /usr/local/lib/plugins/sandbox_plugin --- Installing: /usr/local/lib/plugins/sandbox_plugin/libsandbox_plugind.so --- Installing: /usr/local/lib/plugins/sandbox_plugin/metacall.json --- Installing: /usr/local/lib/node_modules/metacall/index.js --- Installing: /usr/local/lib/node_modules/metacall/index.d.ts --- Installing: /usr/local/lib/node_modules/metacall/package.json --- Installing: /usr/local/lib/node_modules/metacall/package-lock.json --- Installing: /usr/local/lib/node_modules/metacall/LICENSE -Processing /usr/local/metacall/source/ports/py_port - Preparing metadata (setup.py): started - Preparing metadata (setup.py): finished with status 'done' -Building wheels for collected packages: metacall - Building wheel for metacall (setup.py): started - Building wheel for metacall (setup.py): finished with status 'done' - Created wheel for metacall: filename=metacall-0.5.1-py2.py3-none-any.whl size=14061 sha256=015f92f2fa3cc2bc911cd45a282a12c381d25ca1c498f99098a4a30018c24e84 - Stored in directory: /tmp/pip-ephem-wheel-cache-a3n0sbsf/wheels/67/d1/05/9442633228a4c6adb005b8d5d97a193b9876b444ce637c7bbe -Successfully built metacall -Installing collected packages: metacall -Successfully installed metacall-0.5.1 -WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. --- Installing: /usr/local/lib/rb_portd.so --- Set non-toolchain portion of runtime path of "/usr/local/lib/rb_portd.so" to "/usr/local/lib" --- Installing: /usr/local/bin/metacallclid --- Set non-toolchain portion of runtime path of "/usr/local/bin/metacallclid" to "/usr/local/lib" --- Up-to-date: /usr/local/include/metacall --- Installing: /usr/local/include/metacall/metacall_loaders.h --- Installing: /usr/local/include/metacall/metacall_version.h -MetaCall configuration paths (overwritables) -LOADER_SCRIPT_PATH: - Description: Directory where scripts are located - Install Location: N/A - Default Location: scripts -CONFIGURATION_PATH: - Description: Path to the main global MetaCall configuration - Install Location: /usr/local/share/metacall/configurations/global.json - Default Location: configurations/global.json -LOADER_LIBRARY_PATH: - Description: Directory where MetaCall loader plugins are located - Install Location: /usr/local/lib - Default Location: . -SERIAL_LIBRARY_PATH: - Description: Directory where MetaCall serial plugins are located - Install Location: /usr/local/lib - Default Location: serials -DETOUR_LIBRARY_PATH: - Description: Directory where MetaCall detour plugins are located - Install Location: /usr/local/lib - Default Location: detours --- Installing: /usr/local/share/metacall/VERSION --- Installing: /usr/local/share/metacall/metacall-config.cmake --- Installing: /usr/local/share/metacall/metacall-config-version.cmake --- Installing: /usr/local/share/metacall/AUTHORS --- Installing: /usr/local/share/metacall/LICENSE --- Installing: /usr/local/share/metacall/README.md -Removing intermediate container 8fc0ef566964 - ---> a154882bd14f -Successfully built a154882bd14f -Successfully tagged metacall/core:dev diff --git a/source/plugins/backtrace_plugin/CMakeLists.txt b/source/plugins/backtrace_plugin/CMakeLists.txt index ba955b7d8..d114092a9 100644 --- a/source/plugins/backtrace_plugin/CMakeLists.txt +++ b/source/plugins/backtrace_plugin/CMakeLists.txt @@ -13,6 +13,8 @@ if(NOT OPTION_BUILD_GUIX) FetchContent_Declare(BackwardCpp GIT_REPOSITORY https://github.com/bombela/backward-cpp GIT_TAG f30744bcf726ea3735df7ecf9e9de9ddac540283 + CMAKE_ARGS + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ) FetchContent_MakeAvailable(BackwardCpp) From 1bcab450d20bd708e6ba725bbc02f5e1c9f9d74b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 10 Apr 2025 19:16:16 +0200 Subject: [PATCH 216/487] Solve issues in release. --- source/tests/dynlink_test/CMakeLists.txt | 3 +++ source/tests/dynlink_test/source/dynlink_test.cpp | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/tests/dynlink_test/CMakeLists.txt b/source/tests/dynlink_test/CMakeLists.txt index d0e0d844d..2ba18f0d3 100644 --- a/source/tests/dynlink_test/CMakeLists.txt +++ b/source/tests/dynlink_test/CMakeLists.txt @@ -115,6 +115,9 @@ target_compile_options(${target} target_link_options(${target} PRIVATE ${DEFAULT_LINKER_OPTIONS} + + $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-export_dynamic> + $<$<CXX_COMPILER_ID:GNU>:-rdynamic> ) # diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index 1ba674206..dea1c0c8e 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -38,7 +38,7 @@ class dynlink_test : public testing::Test #ifdef _WIN32 #define EXPORT_SYMBOL __declspec(dllexport) #else - #define EXPORT_SYMBOL __attribute__((used)) __attribute__((visibility("default"))) + #define EXPORT_SYMBOL __attribute__((visibility("default"))) #endif extern "C" EXPORT_SYMBOL int function_from_current_executable(void) @@ -114,8 +114,6 @@ TEST_F(dynlink_test, DefaultConstructor) dynlink_symbol_addr addr; - EXPECT_EQ((int)48, (int)function_from_current_executable()); - EXPECT_EQ((int)0, dynlink_symbol(proc, "function_from_current_executable", &addr)); ASSERT_NE((dynlink_symbol_addr)addr, (dynlink_symbol_addr)NULL); From 9171ce67af3905c16eec00865c43778cd35f809f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 10 Apr 2025 19:34:52 +0200 Subject: [PATCH 217/487] Solve issues with atomic. --- source/metacall/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/metacall/CMakeLists.txt b/source/metacall/CMakeLists.txt index 7aefaabd1..25f45878e 100644 --- a/source/metacall/CMakeLists.txt +++ b/source/metacall/CMakeLists.txt @@ -202,6 +202,9 @@ target_link_libraries(${target} $<$<BOOL:${BUILD_SHARED_LIBS}>:${CMAKE_DL_LIBS}> # Native dynamic load library + # Fix issues with atomics in armv6 and armv7 + $<$<STREQUAL:${CMAKE_SYSTEM_PROCESSOR},armv7l>:-latomic> + INTERFACE ) From 06014cfb535a924373074973a6438e3358c78452 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 11 Apr 2025 00:25:43 +0200 Subject: [PATCH 218/487] Solve issues with logs on 32 b32 bits. --- source/log/source/log_policy_format_text.c | 4 ++-- source/tests/log_custom_test/source/log_custom_test.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/log/source/log_policy_format_text.c b/source/log/source/log_policy_format_text.c index 1deea2c22..7f30cae36 100644 --- a/source/log/source/log_policy_format_text.c +++ b/source/log/source/log_policy_format_text.c @@ -20,8 +20,8 @@ /* -- Definitions -- */ -#define LOG_POLICY_FORMAT_TEXT_STR_DEBUG "[%.19s] #%" PRIuS " [ %" PRIuS " | %s | %s ] @%s : " -#define LOG_POLICY_FORMAT_TEXT_STR_RELEASE "[%.19s] #%" PRIuS " @%s : " +#define LOG_POLICY_FORMAT_TEXT_STR_DEBUG "[%.19s] #%" PRIu64 " [ %" PRIuS " | %s | %s ] @%s : " +#define LOG_POLICY_FORMAT_TEXT_STR_RELEASE "[%.19s] #%" PRIu64 " @%s : " #define LOG_POLICY_FORMAT_TEXT_STR_PRETTY "\x1b[32m%s\x1b[0m: " /* -- Macros -- */ diff --git a/source/tests/log_custom_test/source/log_custom_test.cpp b/source/tests/log_custom_test/source/log_custom_test.cpp index 51754be99..f97ebcc6b 100644 --- a/source/tests/log_custom_test/source/log_custom_test.cpp +++ b/source/tests/log_custom_test/source/log_custom_test.cpp @@ -25,7 +25,7 @@ #include <log/log_handle.h> #include <log/log_level.h> -static const char format[] = "%.19s #%" PRIuS " %s:%" PRIuS " %s @%s "; +static const char format[] = "%.19s #%" PRIu64 " %s:%" PRIuS " %s @%s "; class log_custom_test : public testing::Test { From 1e241818a7f746001d4f1a80102fadb35c5f722b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 11 Apr 2025 17:12:34 +0200 Subject: [PATCH 219/487] Update backtrace. --- .../plugins/backtrace_plugin/CMakeLists.txt | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/source/plugins/backtrace_plugin/CMakeLists.txt b/source/plugins/backtrace_plugin/CMakeLists.txt index d114092a9..441fe1b40 100644 --- a/source/plugins/backtrace_plugin/CMakeLists.txt +++ b/source/plugins/backtrace_plugin/CMakeLists.txt @@ -12,9 +12,7 @@ if(NOT OPTION_BUILD_GUIX) FetchContent_Declare(BackwardCpp GIT_REPOSITORY https://github.com/bombela/backward-cpp - GIT_TAG f30744bcf726ea3735df7ecf9e9de9ddac540283 - CMAKE_ARGS - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + GIT_TAG 94718085efa256fb25a311a46b5948ee0d95890a ) FetchContent_MakeAvailable(BackwardCpp) @@ -25,7 +23,7 @@ if(NOT OPTION_BUILD_GUIX) ) if(NOT BackwardCpp_POPULATED) - FetchContent_Populate(backward-cpp) + FetchContent_Populate(BackwardCpp) endif() endif() @@ -33,18 +31,6 @@ if(NOT BackwardCpp_POPULATED OR NOT BackwardCpp_SOURCE) message(STATUS "BackwardCpp could not be installed, trying to find it on the system") endif() -find_package(Backward - CONFIG - PATHS ${BackwardCpp_SOURCE} -) - -if(NOT BACKWARD_FOUND) - message(WARNING "BackwardCpp could not be found, skipping backtrace plugin compilation") - return() -endif() - -include(${BackwardCpp_SOURCE}/BackwardConfig.cmake) - # # Plugin name and options # @@ -161,8 +147,6 @@ target_include_directories(${target} $<TARGET_PROPERTY:${META_PROJECT_NAME}::metacall,INCLUDE_DIRECTORIES> # MetaCall includes - ${BACKWARD_INCLUDE_DIR} # Backward-cpp includes - PUBLIC ${DEFAULT_INCLUDE_DIRECTORIES} @@ -180,11 +164,11 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library + Backward::Interface # Backward-cpp library + PUBLIC ${DEFAULT_LIBRARIES} - Backward::Backward # Backward-cpp library - INTERFACE ) From 69dc5d40bfaef482533f03a4ac4827dc64135d74 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 11 Apr 2025 17:13:12 +0200 Subject: [PATCH 220/487] Solve issues in node loader for 32 bits. --- source/loaders/node_loader/source/node_loader_impl.cpp | 8 ++++---- .../node_loader/source/node_loader_trampoline.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index d622cbb0d..9a318719d 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -619,7 +619,7 @@ typedef struct node_loader_impl_startup_args_type } /* Get node impl pointer */ - ssize_t node_impl_ptr_length = snprintf(NULL, 0, "%p", (void *)node_impl); + ssize_t node_impl_ptr_length = snprintf(NULL, 0, "%" PRIxPTR, (uintptr_t)(node_impl)); if (node_impl_ptr_length <= 0) { @@ -636,10 +636,10 @@ typedef struct node_loader_impl_startup_args_type return 1; } - snprintf(node_impl_ptr_str, node_impl_ptr_str_size, "%p", (void *)node_impl); + snprintf(node_impl_ptr_str, node_impl_ptr_str_size, "%" PRIxPTR, (uintptr_t)(node_impl)); /* Get register pointer */ - ssize_t register_ptr_length = snprintf(NULL, 0, "%p", (void *)&node_loader_impl_register); + ssize_t register_ptr_length = snprintf(NULL, 0, "%" PRIxPTR, (uintptr_t)(&node_loader_impl_register)); if (register_ptr_length <= 0) { @@ -656,7 +656,7 @@ typedef struct node_loader_impl_startup_args_type return 1; } - snprintf(register_ptr_str, register_ptr_str_size, "%p", (void *)&node_loader_impl_register); + snprintf(register_ptr_str, register_ptr_str_size, "%" PRIxPTR, (uintptr_t)(&node_loader_impl_register)); return 0; } diff --git a/source/loaders/node_loader/source/node_loader_trampoline.cpp b/source/loaders/node_loader/source/node_loader_trampoline.cpp index 9083223a1..3dbb35293 100644 --- a/source/loaders/node_loader/source/node_loader_trampoline.cpp +++ b/source/loaders/node_loader/source/node_loader_trampoline.cpp @@ -9,7 +9,8 @@ #include <node_loader/node_loader_impl.h> #include <node_loader/node_loader_trampoline.h> -#include <stdio.h> /* TODO: Improve this trick */ +#include <cinttypes> +#include <cstdio> /* TODO: Improve this trick */ #define NODE_LOADER_TRAMPOLINE_DECLARE_NAPI_METHOD(name, func) \ { \ @@ -45,7 +46,7 @@ union loader_impl_trampoline_cast */ static void node_loader_trampoline_parse_pointer(napi_env env, napi_value v, void **ptr) { - const size_t ptr_str_size = (sizeof(void *) * 2) + 1; + const size_t ptr_str_size = (sizeof(uintptr_t) * 2) + 1; size_t ptr_str_size_copied = 0; char ptr_str[ptr_str_size]; napi_status status = napi_get_value_string_utf8(env, v, ptr_str, ptr_str_size, &ptr_str_size_copied); @@ -53,7 +54,9 @@ static void node_loader_trampoline_parse_pointer(napi_env env, napi_value v, voi node_loader_impl_exception(env, status); /* Convert the string to pointer type */ - sscanf(ptr_str, "%p", ptr); + uintptr_t uint_ptr; + sscanf(ptr_str, "%" SCNxPTR, &uint_ptr); + *ptr = (void *)uint_ptr; } napi_value node_loader_trampoline_register(napi_env env, napi_callback_info info) From 633e9f38b5ad552e642f7c3e359b4768e61805f1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 15 Apr 2025 17:09:42 +0200 Subject: [PATCH 221/487] Updated gtest, add comments on fork. --- cmake/InstallGTest.cmake | 2 +- source/metacall/source/metacall_fork.c | 2 ++ source/tests/metacall_fork_test/source/metacall_fork_test.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/InstallGTest.cmake b/cmake/InstallGTest.cmake index 7977751f0..24cb39665 100644 --- a/cmake/InstallGTest.cmake +++ b/cmake/InstallGTest.cmake @@ -24,7 +24,7 @@ if(NOT GTEST_FOUND OR USE_BUNDLED_GTEST) if(NOT GTEST_VERSION OR USE_BUNDLED_GTEST) - set(GTEST_VERSION 1.11.0) + set(GTEST_VERSION 1.16.0) endif() find_package(Threads REQUIRED) diff --git a/source/metacall/source/metacall_fork.c b/source/metacall/source/metacall_fork.c index e353879fd..0c626a96d 100644 --- a/source/metacall/source/metacall_fork.c +++ b/source/metacall/source/metacall_fork.c @@ -316,6 +316,8 @@ void metacall_fork_destroy(void) { detour d = detour_create(metacall_detour()); + /* TODO: Restore the hook? We need support for this on the detour API */ + detour_unload(d, detour_fork_handle); detour_fork_handle = NULL; diff --git a/source/tests/metacall_fork_test/source/metacall_fork_test.cpp b/source/tests/metacall_fork_test/source/metacall_fork_test.cpp index 2b288b12f..0f34b6bd7 100644 --- a/source/tests/metacall_fork_test/source/metacall_fork_test.cpp +++ b/source/tests/metacall_fork_test/source/metacall_fork_test.cpp @@ -115,7 +115,7 @@ pid_t fork() } else if (result == RTL_CLONE_CHILD) { - /* fix stdio */ + /* Fix stdio */ AllocConsole(); return 0; } From 8d8a6fc1beffb9ae5e6d11031793595609035f33 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 15 Apr 2025 20:23:21 +0200 Subject: [PATCH 222/487] Update google test version. --- source/tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index aca1cfdaa..bf31bbbf9 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -12,7 +12,7 @@ if("${CMAKE_VERSION}" VERSION_LESS "3.11" AND POLICY CMP0037) set_policy(CMP0037 OLD) endif() -set(GTEST_VERSION 1.11.0) +set(GTEST_VERSION 1.16.0) find_package(GTest ${GTEST_VERSION}) From 8b20384e3ad253f62aa603c445f280e3fbeb3c49 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 15 Apr 2025 20:33:09 +0200 Subject: [PATCH 223/487] Solve issues with gtest. --- cmake/InstallGTest.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/InstallGTest.cmake b/cmake/InstallGTest.cmake index 24cb39665..6f03ef2fc 100644 --- a/cmake/InstallGTest.cmake +++ b/cmake/InstallGTest.cmake @@ -38,7 +38,7 @@ if(NOT GTEST_FOUND OR USE_BUNDLED_GTEST) # Import Google Test Framework ExternalProject_Add(google-test-depends GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-${GTEST_VERSION} + GIT_TAG v${GTEST_VERSION} CMAKE_ARGS -Dgtest_build_samples=OFF -Dgtest_build_tests=OFF From 00600e7db5e9530c840117498bc74857eb64f713 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 15 Apr 2025 21:21:42 +0200 Subject: [PATCH 224/487] Update gtest properly to c++17. --- cmake/Portability.cmake | 12 ++++++------ source/tests/adt_map_test/CMakeLists.txt | 9 +++++++++ source/tests/adt_set_test/CMakeLists.txt | 9 +++++++++ source/tests/adt_trie_test/CMakeLists.txt | 9 +++++++++ source/tests/adt_vector_test/CMakeLists.txt | 9 +++++++++ source/tests/configuration_test/CMakeLists.txt | 9 +++++++++ source/tests/detour_test/CMakeLists.txt | 9 +++++++++ source/tests/dynlink_test/CMakeLists.txt | 9 +++++++++ source/tests/environment_test/CMakeLists.txt | 9 +++++++++ source/tests/log_custom_test/CMakeLists.txt | 9 +++++++++ source/tests/log_test/CMakeLists.txt | 9 +++++++++ .../metacall_backtrace_plugin_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_c_lib_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_c_test/CMakeLists.txt | 9 +++++++++ .../metacall_callback_complex_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_cast_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_clear_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_cli_core_plugin_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_cobol_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ source/tests/metacall_cs_test/CMakeLists.txt | 9 +++++++++ .../metacall_csharp_function_test/CMakeLists.txt | 9 +++++++++ .../metacall_csharp_static_class_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_depends_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_distributable_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_ducktype_test/CMakeLists.txt | 9 +++++++++ .../metacall_duplicated_handle_test/CMakeLists.txt | 9 +++++++++ .../metacall_duplicated_symbols_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_dynlink_path_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_ext_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_file_fail_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_file_glob_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_file_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_fork_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_function_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_handle_export_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_handle_get_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_init_fini_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../tests/metacall_initialize_ex_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_initialize_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_inspect_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_integration_test/CMakeLists.txt | 9 +++++++++ .../metacall_invalid_loader_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_java_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_julia_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ source/tests/metacall_llvm_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_load_configuration_test/CMakeLists.txt | 9 +++++++++ .../metacall_load_memory_empty_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_load_memory_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_logs_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_lua_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_map_await_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_map_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_async_multiple_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ source/tests/metacall_node_async_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_await_chain_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_node_call_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_node_callback_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_clear_mem_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_default_export_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_node_event_loop_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_exception_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_extension_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_fail_env_var_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_fail_load_leak_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_node_fail_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_node_inline_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_node_native_code_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_port_await_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_port_c_lib_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_node_port_rs_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_node_port_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_node_python_await_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_node_python_ruby_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_reentrant_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_signal_handler_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_node_test/CMakeLists.txt | 9 +++++++++ .../metacall_node_typescript_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_plugin_extension_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_python_async_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_python_await_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_builtins_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_callback_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_python_dict_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_exception_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_python_fail_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_python_gc_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_loader_port_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_python_model_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_node_await_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_object_class_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_python_open_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_pointer_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_python_port_https_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_port_import_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_port_pointer_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_python_port_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_reentrant_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ source/tests/metacall_python_test/CMakeLists.txt | 9 +++++++++ .../metacall_python_varargs_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../tests/metacall_reinitialize_test/CMakeLists.txt | 9 +++++++++ .../metacall_reload_functions_test/CMakeLists.txt | 9 +++++++++ .../tests/metacall_return_monad_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_rpc_test/CMakeLists.txt | 9 +++++++++ .../metacall_ruby_fail_empty_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_ruby_fail_test/CMakeLists.txt | 9 +++++++++ .../metacall_ruby_object_class_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ source/tests/metacall_ruby_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_rust_class_test/CMakeLists.txt | 9 +++++++++ .../metacall_rust_load_from_mem_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ source/tests/metacall_rust_test/CMakeLists.txt | 9 +++++++++ .../metacall_sandbox_plugin_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_test/CMakeLists.txt | 9 +++++++++ .../metacall_typescript_call_map_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_typescript_node_test/CMakeLists.txt | 9 +++++++++ .../metacall_typescript_require_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_typescript_test/CMakeLists.txt | 9 +++++++++ .../CMakeLists.txt | 9 +++++++++ .../metacall_typescript_tsx_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_version_test/CMakeLists.txt | 9 +++++++++ .../metacall_wasm_python_port_test/CMakeLists.txt | 9 +++++++++ source/tests/metacall_wasm_test/CMakeLists.txt | 9 +++++++++ source/tests/portability_path_test/CMakeLists.txt | 9 +++++++++ source/tests/preprocessor_test/CMakeLists.txt | 9 +++++++++ source/tests/rb_loader_parser_test/CMakeLists.txt | 9 +++++++++ source/tests/reflect_function_test/CMakeLists.txt | 9 +++++++++ source/tests/reflect_metadata_test/CMakeLists.txt | 9 +++++++++ .../tests/reflect_object_class_test/CMakeLists.txt | 9 +++++++++ source/tests/reflect_scope_test/CMakeLists.txt | 9 +++++++++ source/tests/reflect_value_cast_test/CMakeLists.txt | 9 +++++++++ source/tests/serial_test/CMakeLists.txt | 9 +++++++++ 162 files changed, 1455 insertions(+), 6 deletions(-) diff --git a/cmake/Portability.cmake b/cmake/Portability.cmake index 86193291c..556427b18 100644 --- a/cmake/Portability.cmake +++ b/cmake/Portability.cmake @@ -146,11 +146,10 @@ set(PROJECT_ARCH_NAME ${CMAKE_SYSTEM_PROCESSOR}) # 32 or 64 bit Linux if(PROJECT_OS_LINUX) - if(${PROJECT_ARCH_NAME} STREQUAL "x86") + if (${PROJECT_ARCH_NAME} MATCHES "^(x86|i[3-6]86|x86_64)$" AND "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") set(PROJECT_ARCH_32BIT TRUE BOOL INTERNAL) - endif() - - if(${PROJECT_ARCH_NAME} MATCHES "(x86_64)|(amd64)|(AMD64)") + set(PROJECT_ARCH_X86 TRUE BOOL INTERNAL) + elseif(${PROJECT_ARCH_NAME} MATCHES "(x86_64)|(amd64)|(AMD64)") set(PROJECT_ARCH_64BIT TRUE BOOL INTERNAL) set(PROJECT_ARCH_AMD64 TRUE BOOL INTERNAL) elseif(${PROJECT_ARCH_NAME} STREQUAL "aarch64") @@ -162,6 +161,7 @@ if(PROJECT_OS_LINUX) set(PROJECT_ARCH_64BIT TRUE BOOL INTERNAL) endif() + # Verify the architecture is correct if(PROJECT_ARCH_32BIT) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") message(STATUS "Linux ${PROJECT_ARCH_NAME} 32bit detected") @@ -183,7 +183,7 @@ endif() if(NOT PROJECT_ARCH_32BIT AND NOT PROJECT_ARCH_64BIT) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4") message(STATUS "32bit architecture ${PROJECT_ARCH_NAME} detected") - set(PROJECT_ARCH_32BIT TRUE BOOL INTERNAL) + set(PROJECT_ARCH_32BIT TRUE BOOL INTERNAL) if(PROJECT_OS_WIN) set(WINXBITS Win32) @@ -191,7 +191,7 @@ if(NOT PROJECT_ARCH_32BIT AND NOT PROJECT_ARCH_64BIT) elseif("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") message(STATUS "64bit architecture ${PROJECT_ARCH_NAME} detected") - set(PROJECT_ARCH_64BIT TRUE BOOL INTERNAL) + set(PROJECT_ARCH_64BIT TRUE BOOL INTERNAL) if(PROJECT_OS_WIN) set(WINXBITS Win64) diff --git a/source/tests/adt_map_test/CMakeLists.txt b/source/tests/adt_map_test/CMakeLists.txt index 29ae7e7e9..0767bcbb2 100644 --- a/source/tests/adt_map_test/CMakeLists.txt +++ b/source/tests/adt_map_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/adt_set_test/CMakeLists.txt b/source/tests/adt_set_test/CMakeLists.txt index d46b7064f..a3d3b1c3f 100644 --- a/source/tests/adt_set_test/CMakeLists.txt +++ b/source/tests/adt_set_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/adt_trie_test/CMakeLists.txt b/source/tests/adt_trie_test/CMakeLists.txt index 1bac7e403..19babf556 100644 --- a/source/tests/adt_trie_test/CMakeLists.txt +++ b/source/tests/adt_trie_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/adt_vector_test/CMakeLists.txt b/source/tests/adt_vector_test/CMakeLists.txt index dab9ae9a6..e454f0266 100644 --- a/source/tests/adt_vector_test/CMakeLists.txt +++ b/source/tests/adt_vector_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/configuration_test/CMakeLists.txt b/source/tests/configuration_test/CMakeLists.txt index c9f804954..0700e2bf7 100644 --- a/source/tests/configuration_test/CMakeLists.txt +++ b/source/tests/configuration_test/CMakeLists.txt @@ -115,6 +115,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/detour_test/CMakeLists.txt b/source/tests/detour_test/CMakeLists.txt index d73991ebc..06e3ef979 100644 --- a/source/tests/detour_test/CMakeLists.txt +++ b/source/tests/detour_test/CMakeLists.txt @@ -117,6 +117,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/dynlink_test/CMakeLists.txt b/source/tests/dynlink_test/CMakeLists.txt index 2ba18f0d3..1010f0fb9 100644 --- a/source/tests/dynlink_test/CMakeLists.txt +++ b/source/tests/dynlink_test/CMakeLists.txt @@ -108,6 +108,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/environment_test/CMakeLists.txt b/source/tests/environment_test/CMakeLists.txt index ec3e14449..3472e06a8 100644 --- a/source/tests/environment_test/CMakeLists.txt +++ b/source/tests/environment_test/CMakeLists.txt @@ -103,6 +103,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/log_custom_test/CMakeLists.txt b/source/tests/log_custom_test/CMakeLists.txt index 73ef1f64a..f46ff859e 100644 --- a/source/tests/log_custom_test/CMakeLists.txt +++ b/source/tests/log_custom_test/CMakeLists.txt @@ -105,6 +105,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/log_test/CMakeLists.txt b/source/tests/log_test/CMakeLists.txt index d3f70ddc3..d091de149 100644 --- a/source/tests/log_test/CMakeLists.txt +++ b/source/tests/log_test/CMakeLists.txt @@ -105,6 +105,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt b/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt index 013b1d742..900355faa 100644 --- a/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_backtrace_plugin_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_c_lib_test/CMakeLists.txt b/source/tests/metacall_c_lib_test/CMakeLists.txt index eace7e1da..d3a375064 100644 --- a/source/tests/metacall_c_lib_test/CMakeLists.txt +++ b/source/tests/metacall_c_lib_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_c_test/CMakeLists.txt b/source/tests/metacall_c_test/CMakeLists.txt index 7599f98cb..a5c3e0edd 100644 --- a/source/tests/metacall_c_test/CMakeLists.txt +++ b/source/tests/metacall_c_test/CMakeLists.txt @@ -120,6 +120,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_callback_complex_test/CMakeLists.txt b/source/tests/metacall_callback_complex_test/CMakeLists.txt index 00183a9c2..ddf680698 100644 --- a/source/tests/metacall_callback_complex_test/CMakeLists.txt +++ b/source/tests/metacall_callback_complex_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_cast_test/CMakeLists.txt b/source/tests/metacall_cast_test/CMakeLists.txt index ec7b1876b..674a14516 100644 --- a/source/tests/metacall_cast_test/CMakeLists.txt +++ b/source/tests/metacall_cast_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_clear_test/CMakeLists.txt b/source/tests/metacall_clear_test/CMakeLists.txt index bb461a5e9..859807d95 100644 --- a/source/tests/metacall_clear_test/CMakeLists.txt +++ b/source/tests/metacall_clear_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt b/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt index 9c444e084..13284fb39 100644 --- a/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt +++ b/source/tests/metacall_cli_core_plugin_await_test/CMakeLists.txt @@ -119,6 +119,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt b/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt index 8de5b40ef..f0ecb936b 100644 --- a/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_cli_core_plugin_test/CMakeLists.txt @@ -108,6 +108,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_cobol_test/CMakeLists.txt b/source/tests/metacall_cobol_test/CMakeLists.txt index c524b462c..3667141bc 100644 --- a/source/tests/metacall_cobol_test/CMakeLists.txt +++ b/source/tests/metacall_cobol_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_configuration_default_test/CMakeLists.txt b/source/tests/metacall_configuration_default_test/CMakeLists.txt index 571fc6786..8cf0d4007 100644 --- a/source/tests/metacall_configuration_default_test/CMakeLists.txt +++ b/source/tests/metacall_configuration_default_test/CMakeLists.txt @@ -125,6 +125,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt index e63ff23b9..ff845b77b 100644 --- a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt +++ b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_cs_test/CMakeLists.txt b/source/tests/metacall_cs_test/CMakeLists.txt index 084e5f819..6eb981ca3 100644 --- a/source/tests/metacall_cs_test/CMakeLists.txt +++ b/source/tests/metacall_cs_test/CMakeLists.txt @@ -113,6 +113,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_csharp_function_test/CMakeLists.txt b/source/tests/metacall_csharp_function_test/CMakeLists.txt index 53e8df1ac..0a70cedb5 100644 --- a/source/tests/metacall_csharp_function_test/CMakeLists.txt +++ b/source/tests/metacall_csharp_function_test/CMakeLists.txt @@ -121,6 +121,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_csharp_static_class_test/CMakeLists.txt b/source/tests/metacall_csharp_static_class_test/CMakeLists.txt index 9b04dac50..7c2289c3d 100644 --- a/source/tests/metacall_csharp_static_class_test/CMakeLists.txt +++ b/source/tests/metacall_csharp_static_class_test/CMakeLists.txt @@ -121,6 +121,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_depends_test/CMakeLists.txt b/source/tests/metacall_depends_test/CMakeLists.txt index ddc10ae8d..46fe418c7 100644 --- a/source/tests/metacall_depends_test/CMakeLists.txt +++ b/source/tests/metacall_depends_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_distributable_test/CMakeLists.txt b/source/tests/metacall_distributable_test/CMakeLists.txt index 87354950d..07d558161 100644 --- a/source/tests/metacall_distributable_test/CMakeLists.txt +++ b/source/tests/metacall_distributable_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_ducktype_test/CMakeLists.txt b/source/tests/metacall_ducktype_test/CMakeLists.txt index d092bc229..c8d507e6f 100644 --- a/source/tests/metacall_ducktype_test/CMakeLists.txt +++ b/source/tests/metacall_ducktype_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_duplicated_handle_test/CMakeLists.txt b/source/tests/metacall_duplicated_handle_test/CMakeLists.txt index 977c38726..35032c7c5 100644 --- a/source/tests/metacall_duplicated_handle_test/CMakeLists.txt +++ b/source/tests/metacall_duplicated_handle_test/CMakeLists.txt @@ -110,6 +110,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt b/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt index 8ad6ff0c3..c5612d965 100644 --- a/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt +++ b/source/tests/metacall_duplicated_symbols_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_dynlink_path_test/CMakeLists.txt b/source/tests/metacall_dynlink_path_test/CMakeLists.txt index 70537e13e..c1c9a76c4 100644 --- a/source/tests/metacall_dynlink_path_test/CMakeLists.txt +++ b/source/tests/metacall_dynlink_path_test/CMakeLists.txt @@ -111,6 +111,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_ext_test/CMakeLists.txt b/source/tests/metacall_ext_test/CMakeLists.txt index c7df0805a..3c6b98698 100644 --- a/source/tests/metacall_ext_test/CMakeLists.txt +++ b/source/tests/metacall_ext_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_file_fail_test/CMakeLists.txt b/source/tests/metacall_file_fail_test/CMakeLists.txt index fb4c65e7b..ab6236fe1 100644 --- a/source/tests/metacall_file_fail_test/CMakeLists.txt +++ b/source/tests/metacall_file_fail_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_file_glob_test/CMakeLists.txt b/source/tests/metacall_file_glob_test/CMakeLists.txt index b5479a0f3..ffc5a1c27 100644 --- a/source/tests/metacall_file_glob_test/CMakeLists.txt +++ b/source/tests/metacall_file_glob_test/CMakeLists.txt @@ -119,6 +119,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_file_test/CMakeLists.txt b/source/tests/metacall_file_test/CMakeLists.txt index 7be85a2a6..9dd2a4fb0 100644 --- a/source/tests/metacall_file_test/CMakeLists.txt +++ b/source/tests/metacall_file_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_fork_test/CMakeLists.txt b/source/tests/metacall_fork_test/CMakeLists.txt index 122637bdd..90c96bdef 100644 --- a/source/tests/metacall_fork_test/CMakeLists.txt +++ b/source/tests/metacall_fork_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_function_test/CMakeLists.txt b/source/tests/metacall_function_test/CMakeLists.txt index 2584da52b..9ac6fe47d 100644 --- a/source/tests/metacall_function_test/CMakeLists.txt +++ b/source/tests/metacall_function_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_handle_export_test/CMakeLists.txt b/source/tests/metacall_handle_export_test/CMakeLists.txt index 762cb174b..fb1a70856 100644 --- a/source/tests/metacall_handle_export_test/CMakeLists.txt +++ b/source/tests/metacall_handle_export_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_handle_get_test/CMakeLists.txt b/source/tests/metacall_handle_get_test/CMakeLists.txt index 73178da78..c99af8c34 100644 --- a/source/tests/metacall_handle_get_test/CMakeLists.txt +++ b/source/tests/metacall_handle_get_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_init_fini_test/CMakeLists.txt b/source/tests/metacall_init_fini_test/CMakeLists.txt index bb1783bf3..c757cffb7 100644 --- a/source/tests/metacall_init_fini_test/CMakeLists.txt +++ b/source/tests/metacall_init_fini_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt b/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt index 3d0c2ffde..9b06663fd 100644 --- a/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_destroy_multiple_node_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt b/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt index 2de694d0a..3424ea881 100644 --- a/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_destroy_multiple_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_initialize_ex_test/CMakeLists.txt b/source/tests/metacall_initialize_ex_test/CMakeLists.txt index 94332f3b4..714d7ce5b 100644 --- a/source/tests/metacall_initialize_ex_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_ex_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_initialize_test/CMakeLists.txt b/source/tests/metacall_initialize_test/CMakeLists.txt index f8b5b901a..e66bf472e 100644 --- a/source/tests/metacall_initialize_test/CMakeLists.txt +++ b/source/tests/metacall_initialize_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_inspect_test/CMakeLists.txt b/source/tests/metacall_inspect_test/CMakeLists.txt index ff5eaf740..8a97a0c8b 100644 --- a/source/tests/metacall_inspect_test/CMakeLists.txt +++ b/source/tests/metacall_inspect_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_integration_test/CMakeLists.txt b/source/tests/metacall_integration_test/CMakeLists.txt index 55b69ede2..bf2cc13b9 100644 --- a/source/tests/metacall_integration_test/CMakeLists.txt +++ b/source/tests/metacall_integration_test/CMakeLists.txt @@ -113,6 +113,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_invalid_loader_test/CMakeLists.txt b/source/tests/metacall_invalid_loader_test/CMakeLists.txt index 8186d9362..cef1167c5 100644 --- a/source/tests/metacall_invalid_loader_test/CMakeLists.txt +++ b/source/tests/metacall_invalid_loader_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_java_test/CMakeLists.txt b/source/tests/metacall_java_test/CMakeLists.txt index d9000eeb6..fb814afc1 100644 --- a/source/tests/metacall_java_test/CMakeLists.txt +++ b/source/tests/metacall_java_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_julia_test/CMakeLists.txt b/source/tests/metacall_julia_test/CMakeLists.txt index 32dc65a6d..0bfe22f23 100644 --- a/source/tests/metacall_julia_test/CMakeLists.txt +++ b/source/tests/metacall_julia_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt b/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt index e38ecba46..33428a51b 100644 --- a/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt +++ b/source/tests/metacall_library_path_without_env_vars_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_llvm_test/CMakeLists.txt b/source/tests/metacall_llvm_test/CMakeLists.txt index 76f79b68c..cbe63c93f 100644 --- a/source/tests/metacall_llvm_test/CMakeLists.txt +++ b/source/tests/metacall_llvm_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt b/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt index 3a6293c6d..c49bf0e10 100644 --- a/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_fail_test/CMakeLists.txt @@ -110,6 +110,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt b/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt index f38f63ffb..6653f9010 100644 --- a/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_node_python_test/CMakeLists.txt @@ -115,6 +115,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt b/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt index 5d1c09042..f8dd16c32 100644 --- a/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_python_node_test/CMakeLists.txt @@ -112,6 +112,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt b/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt index 4cb9cfb73..a16c0c46f 100644 --- a/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_relative_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_load_configuration_test/CMakeLists.txt b/source/tests/metacall_load_configuration_test/CMakeLists.txt index 52f0a339f..3c42adeb5 100644 --- a/source/tests/metacall_load_configuration_test/CMakeLists.txt +++ b/source/tests/metacall_load_configuration_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_load_memory_empty_test/CMakeLists.txt b/source/tests/metacall_load_memory_empty_test/CMakeLists.txt index 18371653f..b98f18bca 100644 --- a/source/tests/metacall_load_memory_empty_test/CMakeLists.txt +++ b/source/tests/metacall_load_memory_empty_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_load_memory_test/CMakeLists.txt b/source/tests/metacall_load_memory_test/CMakeLists.txt index 7e45abf25..9203a34ca 100644 --- a/source/tests/metacall_load_memory_test/CMakeLists.txt +++ b/source/tests/metacall_load_memory_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_logs_test/CMakeLists.txt b/source/tests/metacall_logs_test/CMakeLists.txt index 35386f0f7..2a56bf637 100644 --- a/source/tests/metacall_logs_test/CMakeLists.txt +++ b/source/tests/metacall_logs_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_lua_test/CMakeLists.txt b/source/tests/metacall_lua_test/CMakeLists.txt index b9b6a62c2..d356553b5 100644 --- a/source/tests/metacall_lua_test/CMakeLists.txt +++ b/source/tests/metacall_lua_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_map_await_test/CMakeLists.txt b/source/tests/metacall_map_await_test/CMakeLists.txt index b36cdee47..6b1df3e95 100644 --- a/source/tests/metacall_map_await_test/CMakeLists.txt +++ b/source/tests/metacall_map_await_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_map_test/CMakeLists.txt b/source/tests/metacall_map_test/CMakeLists.txt index 6022a8abd..b9d40bf14 100644 --- a/source/tests/metacall_map_test/CMakeLists.txt +++ b/source/tests/metacall_map_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_async_multiple_test/CMakeLists.txt b/source/tests/metacall_node_async_multiple_test/CMakeLists.txt index fe9cea8ae..77c1e4b31 100644 --- a/source/tests/metacall_node_async_multiple_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_multiple_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_async_resources_test/CMakeLists.txt b/source/tests/metacall_node_async_resources_test/CMakeLists.txt index a3edb0a50..17e130e41 100644 --- a/source/tests/metacall_node_async_resources_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_resources_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_async_test/CMakeLists.txt b/source/tests/metacall_node_async_test/CMakeLists.txt index 3a29a55a4..d58db6623 100644 --- a/source/tests/metacall_node_async_test/CMakeLists.txt +++ b/source/tests/metacall_node_async_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_await_chain_test/CMakeLists.txt b/source/tests/metacall_node_await_chain_test/CMakeLists.txt index 2b34facf9..52e4ab39e 100644 --- a/source/tests/metacall_node_await_chain_test/CMakeLists.txt +++ b/source/tests/metacall_node_await_chain_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_call_test/CMakeLists.txt b/source/tests/metacall_node_call_test/CMakeLists.txt index 361544791..c0a877d4d 100644 --- a/source/tests/metacall_node_call_test/CMakeLists.txt +++ b/source/tests/metacall_node_call_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_callback_test/CMakeLists.txt b/source/tests/metacall_node_callback_test/CMakeLists.txt index 2fa56024b..1ba50b637 100644 --- a/source/tests/metacall_node_callback_test/CMakeLists.txt +++ b/source/tests/metacall_node_callback_test/CMakeLists.txt @@ -108,6 +108,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_clear_mem_test/CMakeLists.txt b/source/tests/metacall_node_clear_mem_test/CMakeLists.txt index 249b9066b..d7f9e9124 100644 --- a/source/tests/metacall_node_clear_mem_test/CMakeLists.txt +++ b/source/tests/metacall_node_clear_mem_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_default_export_test/CMakeLists.txt b/source/tests/metacall_node_default_export_test/CMakeLists.txt index 56d39f320..c00958933 100644 --- a/source/tests/metacall_node_default_export_test/CMakeLists.txt +++ b/source/tests/metacall_node_default_export_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt b/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt index dbb6410c1..cb3e4701c 100644 --- a/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt +++ b/source/tests/metacall_node_event_loop_signal_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_event_loop_test/CMakeLists.txt b/source/tests/metacall_node_event_loop_test/CMakeLists.txt index 805dd2a9b..d1d83d441 100644 --- a/source/tests/metacall_node_event_loop_test/CMakeLists.txt +++ b/source/tests/metacall_node_event_loop_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_exception_test/CMakeLists.txt b/source/tests/metacall_node_exception_test/CMakeLists.txt index 707e52942..1129b3145 100644 --- a/source/tests/metacall_node_exception_test/CMakeLists.txt +++ b/source/tests/metacall_node_exception_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_extension_test/CMakeLists.txt b/source/tests/metacall_node_extension_test/CMakeLists.txt index 1aac1018e..f56da937a 100644 --- a/source/tests/metacall_node_extension_test/CMakeLists.txt +++ b/source/tests/metacall_node_extension_test/CMakeLists.txt @@ -110,6 +110,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt b/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt index e8310a78c..ecd42051e 100644 --- a/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_env_var_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt b/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt index aaed9e522..3b1cc5bc5 100644 --- a/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_load_leak_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_fail_test/CMakeLists.txt b/source/tests/metacall_node_fail_test/CMakeLists.txt index 62fb239d4..2f46c9261 100644 --- a/source/tests/metacall_node_fail_test/CMakeLists.txt +++ b/source/tests/metacall_node_fail_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_inline_test/CMakeLists.txt b/source/tests/metacall_node_inline_test/CMakeLists.txt index af8f0c8b5..8f7c771f2 100644 --- a/source/tests/metacall_node_inline_test/CMakeLists.txt +++ b/source/tests/metacall_node_inline_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt b/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt index 6f3f91f47..e09b97826 100644 --- a/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt +++ b/source/tests/metacall_node_multithread_deadlock_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_native_code_test/CMakeLists.txt b/source/tests/metacall_node_native_code_test/CMakeLists.txt index 31b61509e..2f485938e 100644 --- a/source/tests/metacall_node_native_code_test/CMakeLists.txt +++ b/source/tests/metacall_node_native_code_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_port_await_test/CMakeLists.txt b/source/tests/metacall_node_port_await_test/CMakeLists.txt index c72587ba4..819a878a0 100644 --- a/source/tests/metacall_node_port_await_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_await_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt index 3c13cf6be..ab55d51e7 100644 --- a/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_c_lib_test/CMakeLists.txt @@ -124,6 +124,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_port_rs_test/CMakeLists.txt b/source/tests/metacall_node_port_rs_test/CMakeLists.txt index 1f4f82043..57422785b 100644 --- a/source/tests/metacall_node_port_rs_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_rs_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_port_test/CMakeLists.txt b/source/tests/metacall_node_port_test/CMakeLists.txt index 86dadd93d..97aa855b3 100644 --- a/source/tests/metacall_node_port_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt b/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt index 6388179f7..6c88f28d6 100644 --- a/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_async_after_destroy_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt b/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt index e7576cb18..a82165e89 100644 --- a/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_await_extended_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_python_await_test/CMakeLists.txt b/source/tests/metacall_node_python_await_test/CMakeLists.txt index 2edadbea7..3553dbc2c 100644 --- a/source/tests/metacall_node_python_await_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_await_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt b/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt index 4e1fb4b71..55bcbfed3 100644 --- a/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_deadlock_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_python_exception_test/CMakeLists.txt b/source/tests/metacall_node_python_exception_test/CMakeLists.txt index f759a0b30..0d4b36869 100644 --- a/source/tests/metacall_node_python_exception_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_exception_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt b/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt index 105e401fc..cbe593374 100644 --- a/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_port_mock_test/CMakeLists.txt @@ -112,6 +112,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt b/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt index 06e1e46bb..6dfbd6c33 100644 --- a/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_port_ruby_test/CMakeLists.txt @@ -112,6 +112,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_python_ruby_test/CMakeLists.txt b/source/tests/metacall_node_python_ruby_test/CMakeLists.txt index a9756c091..b5e291433 100644 --- a/source/tests/metacall_node_python_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_node_python_ruby_test/CMakeLists.txt @@ -118,6 +118,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_reentrant_test/CMakeLists.txt b/source/tests/metacall_node_reentrant_test/CMakeLists.txt index a4ec68f52..6dfff474f 100644 --- a/source/tests/metacall_node_reentrant_test/CMakeLists.txt +++ b/source/tests/metacall_node_reentrant_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_signal_handler_test/CMakeLists.txt b/source/tests/metacall_node_signal_handler_test/CMakeLists.txt index 16e7cbd5e..473ad45e5 100644 --- a/source/tests/metacall_node_signal_handler_test/CMakeLists.txt +++ b/source/tests/metacall_node_signal_handler_test/CMakeLists.txt @@ -115,6 +115,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_test/CMakeLists.txt b/source/tests/metacall_node_test/CMakeLists.txt index 238ccbd4c..7c08d7c10 100644 --- a/source/tests/metacall_node_test/CMakeLists.txt +++ b/source/tests/metacall_node_test/CMakeLists.txt @@ -108,6 +108,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_node_typescript_test/CMakeLists.txt b/source/tests/metacall_node_typescript_test/CMakeLists.txt index f0858d246..a7959a04b 100644 --- a/source/tests/metacall_node_typescript_test/CMakeLists.txt +++ b/source/tests/metacall_node_typescript_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt index f11064599..0bf7f3989 100644 --- a/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_destroy_order_test/CMakeLists.txt @@ -118,6 +118,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt index fc0d79660..6e5da526f 100644 --- a/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_invalid_path_test/CMakeLists.txt @@ -111,6 +111,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt index 20f25e9fd..174628c0e 100644 --- a/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_local_test/CMakeLists.txt @@ -108,6 +108,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_plugin_extension_test/CMakeLists.txt b/source/tests/metacall_plugin_extension_test/CMakeLists.txt index a6eead001..ed506009f 100644 --- a/source/tests/metacall_plugin_extension_test/CMakeLists.txt +++ b/source/tests/metacall_plugin_extension_test/CMakeLists.txt @@ -108,6 +108,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_async_test/CMakeLists.txt b/source/tests/metacall_python_async_test/CMakeLists.txt index 3acc0f211..c329c7a31 100644 --- a/source/tests/metacall_python_async_test/CMakeLists.txt +++ b/source/tests/metacall_python_async_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_await_test/CMakeLists.txt b/source/tests/metacall_python_await_test/CMakeLists.txt index 767eda765..9c3403391 100644 --- a/source/tests/metacall_python_await_test/CMakeLists.txt +++ b/source/tests/metacall_python_await_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_builtins_test/CMakeLists.txt b/source/tests/metacall_python_builtins_test/CMakeLists.txt index d9ca104c3..698df7f4b 100644 --- a/source/tests/metacall_python_builtins_test/CMakeLists.txt +++ b/source/tests/metacall_python_builtins_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_callback_test/CMakeLists.txt b/source/tests/metacall_python_callback_test/CMakeLists.txt index 4f7a4e1b3..e576930fb 100644 --- a/source/tests/metacall_python_callback_test/CMakeLists.txt +++ b/source/tests/metacall_python_callback_test/CMakeLists.txt @@ -108,6 +108,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_dict_test/CMakeLists.txt b/source/tests/metacall_python_dict_test/CMakeLists.txt index 8cc1916d7..835a24fed 100644 --- a/source/tests/metacall_python_dict_test/CMakeLists.txt +++ b/source/tests/metacall_python_dict_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_exception_test/CMakeLists.txt b/source/tests/metacall_python_exception_test/CMakeLists.txt index 31109d355..e06790523 100644 --- a/source/tests/metacall_python_exception_test/CMakeLists.txt +++ b/source/tests/metacall_python_exception_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_fail_test/CMakeLists.txt b/source/tests/metacall_python_fail_test/CMakeLists.txt index fdf0097ed..d16a571d2 100644 --- a/source/tests/metacall_python_fail_test/CMakeLists.txt +++ b/source/tests/metacall_python_fail_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_gc_test/CMakeLists.txt b/source/tests/metacall_python_gc_test/CMakeLists.txt index dea0f4ae2..b72602434 100644 --- a/source/tests/metacall_python_gc_test/CMakeLists.txt +++ b/source/tests/metacall_python_gc_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_loader_port_test/CMakeLists.txt b/source/tests/metacall_python_loader_port_test/CMakeLists.txt index 82bfb7529..eed75ba06 100644 --- a/source/tests/metacall_python_loader_port_test/CMakeLists.txt +++ b/source/tests/metacall_python_loader_port_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_model_test/CMakeLists.txt b/source/tests/metacall_python_model_test/CMakeLists.txt index 59494beac..01475c8c8 100644 --- a/source/tests/metacall_python_model_test/CMakeLists.txt +++ b/source/tests/metacall_python_model_test/CMakeLists.txt @@ -118,6 +118,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_node_await_test/CMakeLists.txt b/source/tests/metacall_python_node_await_test/CMakeLists.txt index 9995c37e0..e2d89c8ff 100644 --- a/source/tests/metacall_python_node_await_test/CMakeLists.txt +++ b/source/tests/metacall_python_node_await_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_object_class_test/CMakeLists.txt b/source/tests/metacall_python_object_class_test/CMakeLists.txt index 475a515ca..f81c535ee 100644 --- a/source/tests/metacall_python_object_class_test/CMakeLists.txt +++ b/source/tests/metacall_python_object_class_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_open_test/CMakeLists.txt b/source/tests/metacall_python_open_test/CMakeLists.txt index ce067050d..32959b363 100644 --- a/source/tests/metacall_python_open_test/CMakeLists.txt +++ b/source/tests/metacall_python_open_test/CMakeLists.txt @@ -127,6 +127,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_pointer_test/CMakeLists.txt b/source/tests/metacall_python_pointer_test/CMakeLists.txt index 4beab7b92..fe6f4ee61 100644 --- a/source/tests/metacall_python_pointer_test/CMakeLists.txt +++ b/source/tests/metacall_python_pointer_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_port_callback_test/CMakeLists.txt b/source/tests/metacall_python_port_callback_test/CMakeLists.txt index 95ddf1ad7..bbf27070a 100644 --- a/source/tests/metacall_python_port_callback_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_callback_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_port_https_test/CMakeLists.txt b/source/tests/metacall_python_port_https_test/CMakeLists.txt index fa4127119..1f1335666 100644 --- a/source/tests/metacall_python_port_https_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_https_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_port_import_test/CMakeLists.txt b/source/tests/metacall_python_port_import_test/CMakeLists.txt index 8d1d94f1c..051f05953 100644 --- a/source/tests/metacall_python_port_import_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_import_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_port_pointer_test/CMakeLists.txt b/source/tests/metacall_python_port_pointer_test/CMakeLists.txt index 463a4e5b6..2c4133672 100644 --- a/source/tests/metacall_python_port_pointer_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_pointer_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_port_test/CMakeLists.txt b/source/tests/metacall_python_port_test/CMakeLists.txt index 431379d4a..a4179b7f2 100644 --- a/source/tests/metacall_python_port_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_test/CMakeLists.txt @@ -109,6 +109,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_reentrant_test/CMakeLists.txt b/source/tests/metacall_python_reentrant_test/CMakeLists.txt index 8f6a82e07..ab29592ef 100644 --- a/source/tests/metacall_python_reentrant_test/CMakeLists.txt +++ b/source/tests/metacall_python_reentrant_test/CMakeLists.txt @@ -110,6 +110,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_relative_path_test/CMakeLists.txt b/source/tests/metacall_python_relative_path_test/CMakeLists.txt index 2a5ad0ff8..22cae4f28 100644 --- a/source/tests/metacall_python_relative_path_test/CMakeLists.txt +++ b/source/tests/metacall_python_relative_path_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_test/CMakeLists.txt b/source/tests/metacall_python_test/CMakeLists.txt index 5fb1bec57..6f89617e3 100644 --- a/source/tests/metacall_python_test/CMakeLists.txt +++ b/source/tests/metacall_python_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_varargs_test/CMakeLists.txt b/source/tests/metacall_python_varargs_test/CMakeLists.txt index bae80e62d..f8636d21e 100644 --- a/source/tests/metacall_python_varargs_test/CMakeLists.txt +++ b/source/tests/metacall_python_varargs_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt b/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt index 9e871cf89..3aca8756e 100644 --- a/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt +++ b/source/tests/metacall_python_without_env_vars_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_python_without_functions_test/CMakeLists.txt b/source/tests/metacall_python_without_functions_test/CMakeLists.txt index a4f92966a..e2092380e 100644 --- a/source/tests/metacall_python_without_functions_test/CMakeLists.txt +++ b/source/tests/metacall_python_without_functions_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_reinitialize_test/CMakeLists.txt b/source/tests/metacall_reinitialize_test/CMakeLists.txt index 73beda512..c1adf593e 100644 --- a/source/tests/metacall_reinitialize_test/CMakeLists.txt +++ b/source/tests/metacall_reinitialize_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_reload_functions_test/CMakeLists.txt b/source/tests/metacall_reload_functions_test/CMakeLists.txt index 4398e0a2d..8d7682d2c 100644 --- a/source/tests/metacall_reload_functions_test/CMakeLists.txt +++ b/source/tests/metacall_reload_functions_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_return_monad_test/CMakeLists.txt b/source/tests/metacall_return_monad_test/CMakeLists.txt index 54f90028d..bcf5ad5c5 100644 --- a/source/tests/metacall_return_monad_test/CMakeLists.txt +++ b/source/tests/metacall_return_monad_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_rpc_test/CMakeLists.txt b/source/tests/metacall_rpc_test/CMakeLists.txt index 091cd4196..04925f1f1 100644 --- a/source/tests/metacall_rpc_test/CMakeLists.txt +++ b/source/tests/metacall_rpc_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt b/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt index 4503b7df1..a480292e1 100644 --- a/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_fail_empty_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_ruby_fail_test/CMakeLists.txt b/source/tests/metacall_ruby_fail_test/CMakeLists.txt index 7211d396e..a34d4318c 100644 --- a/source/tests/metacall_ruby_fail_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_fail_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_ruby_object_class_test/CMakeLists.txt b/source/tests/metacall_ruby_object_class_test/CMakeLists.txt index 50908e439..c4d2ad9b3 100644 --- a/source/tests/metacall_ruby_object_class_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_object_class_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt b/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt index 49a899ecf..ecd892ffb 100644 --- a/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_parser_integration_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt b/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt index a2afac751..6559f627a 100644 --- a/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_rails_integration_test/CMakeLists.txt @@ -114,6 +114,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_ruby_test/CMakeLists.txt b/source/tests/metacall_ruby_test/CMakeLists.txt index 41d084aad..163c170a6 100644 --- a/source/tests/metacall_ruby_test/CMakeLists.txt +++ b/source/tests/metacall_ruby_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_rust_class_test/CMakeLists.txt b/source/tests/metacall_rust_class_test/CMakeLists.txt index dd529756f..28a7f1dac 100644 --- a/source/tests/metacall_rust_class_test/CMakeLists.txt +++ b/source/tests/metacall_rust_class_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt index efcfafdcb..026115ba3 100644 --- a/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_mem_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt index 33b0b2909..0f98b613a 100644 --- a/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_class_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt index 3f9d02f86..7ac9429cf 100644 --- a/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_dep_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt b/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt index e46e552dd..a5aaabbe6 100644 --- a/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt +++ b/source/tests/metacall_rust_load_from_package_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_rust_test/CMakeLists.txt b/source/tests/metacall_rust_test/CMakeLists.txt index 9b0cfc8b3..31434b1be 100644 --- a/source/tests/metacall_rust_test/CMakeLists.txt +++ b/source/tests/metacall_rust_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt b/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt index 67732e310..3a98235b1 100644 --- a/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt +++ b/source/tests/metacall_sandbox_plugin_test/CMakeLists.txt @@ -123,6 +123,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_test/CMakeLists.txt b/source/tests/metacall_test/CMakeLists.txt index 4d75fe9b7..8751e1fe0 100644 --- a/source/tests/metacall_test/CMakeLists.txt +++ b/source/tests/metacall_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_typescript_call_map_test/CMakeLists.txt b/source/tests/metacall_typescript_call_map_test/CMakeLists.txt index 46f491804..9badf8752 100644 --- a/source/tests/metacall_typescript_call_map_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_call_map_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt b/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt index a41409a5b..32674e550 100644 --- a/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_jsx_default_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_typescript_node_test/CMakeLists.txt b/source/tests/metacall_typescript_node_test/CMakeLists.txt index 95954f202..e91cc1717 100644 --- a/source/tests/metacall_typescript_node_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_node_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_typescript_require_test/CMakeLists.txt b/source/tests/metacall_typescript_require_test/CMakeLists.txt index 2e1e327bd..7ab3292c5 100644 --- a/source/tests/metacall_typescript_require_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_require_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_typescript_test/CMakeLists.txt b/source/tests/metacall_typescript_test/CMakeLists.txt index 1ad8d87d3..6827e0804 100644 --- a/source/tests/metacall_typescript_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt b/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt index 59789903b..ca6465387 100644 --- a/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_tsx_loop_fail_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_typescript_tsx_test/CMakeLists.txt b/source/tests/metacall_typescript_tsx_test/CMakeLists.txt index b6732071c..53682fa43 100644 --- a/source/tests/metacall_typescript_tsx_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_tsx_test/CMakeLists.txt @@ -107,6 +107,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_version_test/CMakeLists.txt b/source/tests/metacall_version_test/CMakeLists.txt index 8b3465541..4d93e4fec 100644 --- a/source/tests/metacall_version_test/CMakeLists.txt +++ b/source/tests/metacall_version_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_wasm_python_port_test/CMakeLists.txt b/source/tests/metacall_wasm_python_port_test/CMakeLists.txt index 09c1efe10..7233aa579 100644 --- a/source/tests/metacall_wasm_python_port_test/CMakeLists.txt +++ b/source/tests/metacall_wasm_python_port_test/CMakeLists.txt @@ -108,6 +108,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/metacall_wasm_test/CMakeLists.txt b/source/tests/metacall_wasm_test/CMakeLists.txt index 5aeb8ca0a..6ceca6692 100644 --- a/source/tests/metacall_wasm_test/CMakeLists.txt +++ b/source/tests/metacall_wasm_test/CMakeLists.txt @@ -106,6 +106,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/portability_path_test/CMakeLists.txt b/source/tests/portability_path_test/CMakeLists.txt index 37274fd9e..b95e32718 100644 --- a/source/tests/portability_path_test/CMakeLists.txt +++ b/source/tests/portability_path_test/CMakeLists.txt @@ -101,6 +101,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/preprocessor_test/CMakeLists.txt b/source/tests/preprocessor_test/CMakeLists.txt index 68470eab2..b96a63903 100644 --- a/source/tests/preprocessor_test/CMakeLists.txt +++ b/source/tests/preprocessor_test/CMakeLists.txt @@ -102,6 +102,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/rb_loader_parser_test/CMakeLists.txt b/source/tests/rb_loader_parser_test/CMakeLists.txt index 4e6162aa5..dac449a56 100644 --- a/source/tests/rb_loader_parser_test/CMakeLists.txt +++ b/source/tests/rb_loader_parser_test/CMakeLists.txt @@ -121,6 +121,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/reflect_function_test/CMakeLists.txt b/source/tests/reflect_function_test/CMakeLists.txt index 9beb3781a..fd1875cd3 100644 --- a/source/tests/reflect_function_test/CMakeLists.txt +++ b/source/tests/reflect_function_test/CMakeLists.txt @@ -115,6 +115,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/reflect_metadata_test/CMakeLists.txt b/source/tests/reflect_metadata_test/CMakeLists.txt index 37e635bc6..33497b513 100644 --- a/source/tests/reflect_metadata_test/CMakeLists.txt +++ b/source/tests/reflect_metadata_test/CMakeLists.txt @@ -115,6 +115,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/reflect_object_class_test/CMakeLists.txt b/source/tests/reflect_object_class_test/CMakeLists.txt index 77f837183..3a74590dc 100644 --- a/source/tests/reflect_object_class_test/CMakeLists.txt +++ b/source/tests/reflect_object_class_test/CMakeLists.txt @@ -115,6 +115,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/reflect_scope_test/CMakeLists.txt b/source/tests/reflect_scope_test/CMakeLists.txt index 0a4bd718c..83990f235 100644 --- a/source/tests/reflect_scope_test/CMakeLists.txt +++ b/source/tests/reflect_scope_test/CMakeLists.txt @@ -115,6 +115,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/reflect_value_cast_test/CMakeLists.txt b/source/tests/reflect_value_cast_test/CMakeLists.txt index 46e51f3ae..4b28d3a1a 100644 --- a/source/tests/reflect_value_cast_test/CMakeLists.txt +++ b/source/tests/reflect_value_cast_test/CMakeLists.txt @@ -121,6 +121,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # diff --git a/source/tests/serial_test/CMakeLists.txt b/source/tests/serial_test/CMakeLists.txt index 8b32df06a..12356bc11 100644 --- a/source/tests/serial_test/CMakeLists.txt +++ b/source/tests/serial_test/CMakeLists.txt @@ -120,6 +120,15 @@ target_compile_options(${target} ${DEFAULT_COMPILE_OPTIONS} ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # From 75816ff528634ea039c43ac411cf7ad49bd7a1b7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 15 Apr 2025 23:50:09 +0200 Subject: [PATCH 225/487] Trying to solve issues with docker hub ci. --- .github/workflows/docker-hub.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 123c572b4..9b97c8c22 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -70,20 +70,12 @@ jobs: ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} done - - name: Push Platform Images - run: | - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - for tag in "deps" "dev" "runtime" "cli"; do - echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" - docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} - done - - name: Run Tests run: | set -exuo pipefail platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') cat <<EOF > Dockerfile.test - FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli-${platform_tag} + FROM metacall/${IMAGE_NAME}:cli RUN echo "console.log('abcde')" > script.js RUN metacallcli script.js EOF @@ -91,6 +83,16 @@ jobs: docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . docker run --rm --platform=${{ matrix.platform }} test-image + - name: Push Platform Images + # Only run when master or when tagging a version + if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' + run: | + platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + for tag in "deps" "dev" "runtime" "cli"; do + echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" + docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + done + manifest: name: Create and Push Manifest Lists needs: build @@ -153,7 +155,8 @@ jobs: name: Cleanup Platform Specific Tags needs: [build, manifest] runs-on: ubuntu-latest - if: always() + # Only run when master or when tagging a version + if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' steps: - name: Remove Platform-Specific Tags run: | From a75415a0fa23f10c053bf35db29b68f896c2d826 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 16 Apr 2025 00:08:08 +0200 Subject: [PATCH 226/487] Trying to improve docker hub. --- .github/workflows/docker-hub.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 9b97c8c22..007080e8b 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -35,6 +35,12 @@ jobs: - linux/s390x - linux/arm/v7 - linux/arm/v6 + # TODO: + # - linux/amd64/v2 + # - linux/amd64/v3 + # - linux/mips64le + # - linux/mips64 + # - linux/loong64 steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -63,9 +69,12 @@ jobs: - name: Tag Platform Images run: | + set -exuo pipefail platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') echo "Platform Tag: ${platform_tag}" for tag in "deps" "dev" "runtime" "cli"; do + docker tag metacall/${IMAGE_NAME}:${tag} \ + metacall/${IMAGE_NAME}:${tag}-${platform_tag} docker tag metacall/${IMAGE_NAME}:${tag} \ ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} done @@ -75,13 +84,14 @@ jobs: set -exuo pipefail platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') cat <<EOF > Dockerfile.test - FROM metacall/${IMAGE_NAME}:cli - RUN echo "console.log('abcde')" > script.js + FROM metacall/${IMAGE_NAME}:${tag}-${platform_tag} + RUN echo "console.log('0123456789abcdef')" > script.js RUN metacallcli script.js EOF - docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . - docker run --rm --platform=${{ matrix.platform }} test-image + docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . &> output.txt + cat output.txt + grep "0123456789abcdef" output.txt - name: Push Platform Images # Only run when master or when tagging a version @@ -155,8 +165,7 @@ jobs: name: Cleanup Platform Specific Tags needs: [build, manifest] runs-on: ubuntu-latest - # Only run when master or when tagging a version - if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' + if: always() steps: - name: Remove Platform-Specific Tags run: | From 5db8d09c5e992e4fc6f784f74501c7d68dedd40c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 16 Apr 2025 00:37:16 +0200 Subject: [PATCH 227/487] Sovle issues from dynlink. --- source/tests/dynlink_test/CMakeLists.txt | 10 ++++- .../dynlink_test/source/dynlink_test.cpp | 38 +++++++++---------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/source/tests/dynlink_test/CMakeLists.txt b/source/tests/dynlink_test/CMakeLists.txt index 1010f0fb9..7e39df193 100644 --- a/source/tests/dynlink_test/CMakeLists.txt +++ b/source/tests/dynlink_test/CMakeLists.txt @@ -137,6 +137,14 @@ add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> ) +# +# Define dependencies +# + +add_dependencies(${target} + ${META_PROJECT_NAME}::metacall +) + # # Define test labels # @@ -149,5 +157,5 @@ include(TestEnvironmentVariables) test_environment_variables(${target} "" - "DYNLINK_TEST_LIBRARY_PATH=@OUTPUT_DIRECTORY_DIR@" + "METACALL_TEST_LIBRARY_PATH=@OUTPUT_DIRECTORY_DIR@" ) diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index dea1c0c8e..a419c406c 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -26,9 +26,9 @@ #include <log/log.h> -#define DYNLINK_TEST_LIBRARY_PATH "DYNLINK_TEST_LIBRARY_PATH" +#define METACALL_TEST_LIBRARY_PATH "METACALL_TEST_LIBRARY_PATH" -typedef void (*dynlink_print_func)(void); +typedef const char *(*metacall_print_func)(void); class dynlink_test : public testing::Test { @@ -61,12 +61,12 @@ TEST_F(dynlink_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object extension: %s", dynlink_extension()); #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - const char library_name[] = "dynlinkd"; + const char library_name[] = "metacalld"; #else - const char library_name[] = "dynlink"; + const char library_name[] = "metacall"; #endif - char *path = environment_variable_path_create(DYNLINK_TEST_LIBRARY_PATH, NULL, 0, NULL); + char *path = environment_variable_path_create(METACALL_TEST_LIBRARY_PATH, NULL, 0, NULL); ASSERT_NE((char *)path, (char *)NULL); @@ -82,24 +82,24 @@ TEST_F(dynlink_test, DefaultConstructor) if (handle != NULL) { - dynlink_symbol_addr dynlink_print_info_addr; + dynlink_symbol_addr metacall_print_info_addr; - EXPECT_EQ((int)0, dynlink_symbol(handle, "dynlink_print_info", &dynlink_print_info_addr)); + EXPECT_EQ((int)0, dynlink_symbol(handle, "metacall_print_info", &metacall_print_info_addr)); - if (dynlink_print_info_addr != NULL) + if (metacall_print_info_addr != NULL) { - dynlink_print_func print = dynlink_print_info_addr; + metacall_print_func print = (metacall_print_func)metacall_print_info_addr; log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); - log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)dynlink_print_info_addr); + log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)metacall_print_info_addr); - if (dynlink_print_info_addr != NULL) + if (metacall_print_info_addr != NULL) { log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); } - print(); + log_write("metacall", LOG_LEVEL_DEBUG, "Print: %s", print()); } dynlink_unload(handle); @@ -149,24 +149,24 @@ TEST_F(dynlink_test, DefaultConstructor) if (handle != NULL) { - dynlink_symbol_addr dynlink_print_info_addr; + dynlink_symbol_addr metacall_print_info_addr; - EXPECT_EQ((int)0, dynlink_symbol(handle, "dynlink_print_info", &dynlink_print_info_addr)); + EXPECT_EQ((int)0, dynlink_symbol(handle, "metacall_print_info", &metacall_print_info_addr)); - if (dynlink_print_info_addr != NULL) + if (metacall_print_info_addr != NULL) { - dynlink_print_func print = dynlink_print_info_addr; + metacall_print_func print = (metacall_print_func)metacall_print_info_addr; log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); - log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)dynlink_print_info_addr); + log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)metacall_print_info_addr); - if (dynlink_print_info_addr != NULL) + if (metacall_print_info_addr != NULL) { log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); } - print(); + log_write("metacall", LOG_LEVEL_DEBUG, "Print: %s", print()); } dynlink_unload(handle); From dd45fb384246be4ecda8c7bba5e3a3a5df9f480c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 16 Apr 2025 00:37:28 +0200 Subject: [PATCH 228/487] Solve issues from docker hub. --- .github/workflows/docker-hub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 007080e8b..94b732adb 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -84,7 +84,7 @@ jobs: set -exuo pipefail platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') cat <<EOF > Dockerfile.test - FROM metacall/${IMAGE_NAME}:${tag}-${platform_tag} + FROM metacall/${IMAGE_NAME}:cli-${platform_tag} RUN echo "console.log('0123456789abcdef')" > script.js RUN metacallcli script.js EOF From e032b9c1b16a6745264906506f24e966cba1ca3f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 16 Apr 2025 17:03:59 +0200 Subject: [PATCH 229/487] Solve issues in tests. --- source/tests/dynlink_test/CMakeLists.txt | 10 +----- .../dynlink_test/source/dynlink_test.cpp | 34 +++++++++---------- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../metacall_typescript_test/CMakeLists.txt | 2 +- 7 files changed, 23 insertions(+), 31 deletions(-) diff --git a/source/tests/dynlink_test/CMakeLists.txt b/source/tests/dynlink_test/CMakeLists.txt index 7e39df193..1010f0fb9 100644 --- a/source/tests/dynlink_test/CMakeLists.txt +++ b/source/tests/dynlink_test/CMakeLists.txt @@ -137,14 +137,6 @@ add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> ) -# -# Define dependencies -# - -add_dependencies(${target} - ${META_PROJECT_NAME}::metacall -) - # # Define test labels # @@ -157,5 +149,5 @@ include(TestEnvironmentVariables) test_environment_variables(${target} "" - "METACALL_TEST_LIBRARY_PATH=@OUTPUT_DIRECTORY_DIR@" + "DYNLINK_TEST_LIBRARY_PATH=@OUTPUT_DIRECTORY_DIR@" ) diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index a419c406c..e506c69fa 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -26,9 +26,9 @@ #include <log/log.h> -#define METACALL_TEST_LIBRARY_PATH "METACALL_TEST_LIBRARY_PATH" +#define DYNLINK_TEST_LIBRARY_PATH "DYNLINK_TEST_LIBRARY_PATH" -typedef const char *(*metacall_print_func)(void); +typedef const char *(*dynlink_print_func)(void); class dynlink_test : public testing::Test { @@ -61,12 +61,12 @@ TEST_F(dynlink_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object extension: %s", dynlink_extension()); #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - const char library_name[] = "metacalld"; + const char library_name[] = "dynlinkd"; #else - const char library_name[] = "metacall"; + const char library_name[] = "dynlink"; #endif - char *path = environment_variable_path_create(METACALL_TEST_LIBRARY_PATH, NULL, 0, NULL); + char *path = environment_variable_path_create(DYNLINK_TEST_LIBRARY_PATH, NULL, 0, NULL); ASSERT_NE((char *)path, (char *)NULL); @@ -82,19 +82,19 @@ TEST_F(dynlink_test, DefaultConstructor) if (handle != NULL) { - dynlink_symbol_addr metacall_print_info_addr; + dynlink_symbol_addr dynlink_print_info_addr; - EXPECT_EQ((int)0, dynlink_symbol(handle, "metacall_print_info", &metacall_print_info_addr)); + EXPECT_EQ((int)0, dynlink_symbol(handle, "dynlink_print_info", &dynlink_print_info_addr)); - if (metacall_print_info_addr != NULL) + if (dynlink_print_info_addr != NULL) { - metacall_print_func print = (metacall_print_func)metacall_print_info_addr; + dynlink_print_func print = (dynlink_print_func)dynlink_print_info_addr; log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); - log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)metacall_print_info_addr); + log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)dynlink_print_info_addr); - if (metacall_print_info_addr != NULL) + if (dynlink_print_info_addr != NULL) { log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); } @@ -149,19 +149,19 @@ TEST_F(dynlink_test, DefaultConstructor) if (handle != NULL) { - dynlink_symbol_addr metacall_print_info_addr; + dynlink_symbol_addr dynlink_print_info_addr; - EXPECT_EQ((int)0, dynlink_symbol(handle, "metacall_print_info", &metacall_print_info_addr)); + EXPECT_EQ((int)0, dynlink_symbol(handle, "dynlink_print_info", &dynlink_print_info_addr)); - if (metacall_print_info_addr != NULL) + if (dynlink_print_info_addr != NULL) { - metacall_print_func print = (metacall_print_func)metacall_print_info_addr; + dynlink_print_func print = (dynlink_print_func)dynlink_print_info_addr; log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); - log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)metacall_print_info_addr); + log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)dynlink_print_info_addr); - if (metacall_print_info_addr != NULL) + if (dynlink_print_info_addr != NULL) { log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); } diff --git a/source/tests/metacall_node_typescript_test/CMakeLists.txt b/source/tests/metacall_node_typescript_test/CMakeLists.txt index a7959a04b..499baca66 100644 --- a/source/tests/metacall_node_typescript_test/CMakeLists.txt +++ b/source/tests/metacall_node_typescript_test/CMakeLists.txt @@ -131,6 +131,7 @@ target_link_options(${target} add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> + WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) # @@ -148,7 +149,6 @@ add_dependencies(${target} set_property(TEST ${target} PROPERTY LABELS ${target} - WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) include(TestEnvironmentVariables) diff --git a/source/tests/metacall_typescript_call_map_test/CMakeLists.txt b/source/tests/metacall_typescript_call_map_test/CMakeLists.txt index 9badf8752..4005debcf 100644 --- a/source/tests/metacall_typescript_call_map_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_call_map_test/CMakeLists.txt @@ -131,6 +131,7 @@ target_link_options(${target} add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> + WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) # @@ -148,7 +149,6 @@ add_dependencies(${target} set_property(TEST ${target} PROPERTY LABELS ${target} - WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) include(TestEnvironmentVariables) diff --git a/source/tests/metacall_typescript_node_test/CMakeLists.txt b/source/tests/metacall_typescript_node_test/CMakeLists.txt index e91cc1717..9dbd14de9 100644 --- a/source/tests/metacall_typescript_node_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_node_test/CMakeLists.txt @@ -131,6 +131,7 @@ target_link_options(${target} add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> + WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) # @@ -148,7 +149,6 @@ add_dependencies(${target} set_property(TEST ${target} PROPERTY LABELS ${target} - WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) include(TestEnvironmentVariables) diff --git a/source/tests/metacall_typescript_require_test/CMakeLists.txt b/source/tests/metacall_typescript_require_test/CMakeLists.txt index 7ab3292c5..d4d51e466 100644 --- a/source/tests/metacall_typescript_require_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_require_test/CMakeLists.txt @@ -131,6 +131,7 @@ target_link_options(${target} add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> + WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) # @@ -148,7 +149,6 @@ add_dependencies(${target} set_property(TEST ${target} PROPERTY LABELS ${target} - WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) include(TestEnvironmentVariables) diff --git a/source/tests/metacall_typescript_test/CMakeLists.txt b/source/tests/metacall_typescript_test/CMakeLists.txt index 6827e0804..9af3378eb 100644 --- a/source/tests/metacall_typescript_test/CMakeLists.txt +++ b/source/tests/metacall_typescript_test/CMakeLists.txt @@ -131,6 +131,7 @@ target_link_options(${target} add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> + WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) # @@ -148,7 +149,6 @@ add_dependencies(${target} set_property(TEST ${target} PROPERTY LABELS ${target} - WORKING_DIRECTORY ${LOADER_SCRIPT_PATH}/typedfunc ) include(TestEnvironmentVariables) From 4ec09506aa874a848f8f45e18e4dbe7649164c6e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 16 Apr 2025 17:04:24 +0200 Subject: [PATCH 230/487] Add base for detour improvements. --- source/detour/source/detour.c | 49 ++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/source/detour/source/detour.c b/source/detour/source/detour.c index d894a8d5b..c1e4646e0 100644 --- a/source/detour/source/detour.c +++ b/source/detour/source/detour.c @@ -39,6 +39,8 @@ struct detour_handle_type * and store all the symbols in the hash table then iterate and replace at the * same time, so the functions are accessed in O(1) instead of O(n) */ + set symbol_map; + set replaced_symbols; detour_impl_handle impl; }; @@ -69,6 +71,41 @@ const char *detour_name(detour d) return plugin_name(d); } +static detour_handle detour_handle_allocate(void) +{ + detour_handle handle = malloc(sizeof(struct detour_handle_type)); + + if (handle == NULL) + { + goto alloc_handle_error; + } + + handle->symbol_map = set_create(&hash_callback_ptr, &comparable_callback_ptr); + + if (handle->symbol_map == NULL) + { + goto alloc_symbol_map_error; + } + + handle->replaced_symbols = set_create(&hash_callback_ptr, &comparable_callback_ptr); + + if (handle->replaced_symbols == NULL) + { + goto alloc_replaced_symbols_error; + } + + handle->impl = NULL; + + return handle; + +alloc_replaced_symbols_error: + set_destroy(handle->symbol_map); +alloc_symbol_map_error: + free(handle); +alloc_handle_error: + return NULL; +} + detour_handle detour_load_file(detour d, const char *path) { detour_handle handle; @@ -80,7 +117,7 @@ detour_handle detour_load_file(detour d, const char *path) return NULL; } - handle = malloc(sizeof(struct detour_handle_type)); + handle = detour_handle_allocate(); if (handle == NULL) { @@ -112,7 +149,7 @@ detour_handle detour_load_handle(detour d, dynlink library) return NULL; } - handle = malloc(sizeof(struct detour_handle_type)); + handle = detour_handle_allocate(); if (handle == NULL) { @@ -144,7 +181,7 @@ detour_handle detour_load_address(detour d, void (*address)(void)) return NULL; } - handle = malloc(sizeof(struct detour_handle_type)); + handle = detour_handle_allocate(); if (handle == NULL) { @@ -197,7 +234,13 @@ void detour_unload(detour d, detour_handle handle) return; } + /* TODO: Should we restore all the replaced symbols? */ + detour_iface(d)->destroy(handle->impl); + + set_destroy(handle->symbol_map); + + set_destroy(handle->replaced_symbols); } int detour_clear(detour d) From e1690300fc212bbfa7e0f71e435a9795445d0fd4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 16 Apr 2025 17:04:40 +0200 Subject: [PATCH 231/487] Minor bug in metacall link. --- source/metacall/source/metacall_link.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index df4b05cce..f9be11696 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -213,6 +213,11 @@ int metacall_link_unregister(const char *tag, const char *library, const char *s return 1; } + if (set_get(metacall_link_table, (set_key)symbol) == NULL) + { + return 0; + } + /* TODO: Restore the hook? We need support for this on the detour API */ (void)tag; (void)library; From 97cfe6ff98603e42aa63b646f33714e0f7d50b13 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 16 Apr 2025 17:04:56 +0200 Subject: [PATCH 232/487] Trying to solve issues with dockerhub. --- .github/workflows/docker-hub.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 94b732adb..93a95125b 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -89,8 +89,8 @@ jobs: RUN metacallcli script.js EOF - docker build --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . &> output.txt - cat output.txt + export DOCKER_BUILDKIT=1 + docker build --progress=plain --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . | tee output.txt grep "0123456789abcdef" output.txt - name: Push Platform Images From 25caa343d4ee3d1b4a0f26e282e09c8792d0afd3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 23 Apr 2025 22:43:10 +0200 Subject: [PATCH 233/487] Trying path in docker. --- tools/cli/Dockerfile | 3 ++- tools/dev/Dockerfile | 3 ++- tools/metacall-build.sh | 6 +++--- tools/metacall-configure.sh | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/cli/Dockerfile b/tools/cli/Dockerfile index fed409c5e..5b387470d 100644 --- a/tools/cli/Dockerfile +++ b/tools/cli/Dockerfile @@ -40,7 +40,8 @@ ENV LOADER_LIBRARY_PATH=/usr/local/lib \ PORT_LIBRARY_PATH=/usr/local/lib \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/local/lib/node_modules \ - DOTNET_CLI_TELEMETRY_OPTOUT=true + DOTNET_CLI_TELEMETRY_OPTOUT=true \ + PATH="/usr/local/bin:$PATH" # Define working directory WORKDIR $LOADER_SCRIPT_PATH diff --git a/tools/dev/Dockerfile b/tools/dev/Dockerfile index 9f5805944..8d239a0b8 100644 --- a/tools/dev/Dockerfile +++ b/tools/dev/Dockerfile @@ -40,7 +40,8 @@ ENV LOADER_LIBRARY_PATH=$METACALL_PATH/build \ PORT_LIBRARY_PATH=$METACALL_PATH/build \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/lib/node_modules \ - DOTNET_CLI_TELEMETRY_OPTOUT=true + DOTNET_CLI_TELEMETRY_OPTOUT=true \ + PATH="/usr/local/bin:$PATH" # Define working directory WORKDIR $METACALL_PATH diff --git a/tools/metacall-build.sh b/tools/metacall-build.sh index 74826e22f..1cfcc7f69 100755 --- a/tools/metacall-build.sh +++ b/tools/metacall-build.sh @@ -74,9 +74,9 @@ sub_build() { make -j$(getconf _NPROCESSORS_ONLN) # Tests (coverage needs to run the tests) - if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then - ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE - fi + # if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then + # ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE + # fi # Coverage if [ $BUILD_COVERAGE = 1 ]; then diff --git a/tools/metacall-configure.sh b/tools/metacall-configure.sh index 0360f472f..61a802757 100755 --- a/tools/metacall-configure.sh +++ b/tools/metacall-configure.sh @@ -529,7 +529,7 @@ sub_configure() { fi # Build type - BUILD_STRING="$BUILD_STRING -DCMAKE_BUILD_TYPE=$BUILD_TYPE" + BUILD_STRING="$BUILD_STRING -DOPTION_BUILD_ADDRESS_SANITIZER=On -DCMAKE_BUILD_TYPE=Debug" #$BUILD_TYPE" # Execute CMake cmake -Wno-dev -DOPTION_GIT_HOOKS=Off $BUILD_STRING .. From e316bbfe28b43d153565641927518922120eca15 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 23 Apr 2025 22:46:44 +0200 Subject: [PATCH 234/487] Revert "Trying path in docker." This reverts commit 25caa343d4ee3d1b4a0f26e282e09c8792d0afd3. --- tools/cli/Dockerfile | 3 +-- tools/dev/Dockerfile | 3 +-- tools/metacall-build.sh | 6 +++--- tools/metacall-configure.sh | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/cli/Dockerfile b/tools/cli/Dockerfile index 5b387470d..fed409c5e 100644 --- a/tools/cli/Dockerfile +++ b/tools/cli/Dockerfile @@ -40,8 +40,7 @@ ENV LOADER_LIBRARY_PATH=/usr/local/lib \ PORT_LIBRARY_PATH=/usr/local/lib \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/local/lib/node_modules \ - DOTNET_CLI_TELEMETRY_OPTOUT=true \ - PATH="/usr/local/bin:$PATH" + DOTNET_CLI_TELEMETRY_OPTOUT=true # Define working directory WORKDIR $LOADER_SCRIPT_PATH diff --git a/tools/dev/Dockerfile b/tools/dev/Dockerfile index 8d239a0b8..9f5805944 100644 --- a/tools/dev/Dockerfile +++ b/tools/dev/Dockerfile @@ -40,8 +40,7 @@ ENV LOADER_LIBRARY_PATH=$METACALL_PATH/build \ PORT_LIBRARY_PATH=$METACALL_PATH/build \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/lib/node_modules \ - DOTNET_CLI_TELEMETRY_OPTOUT=true \ - PATH="/usr/local/bin:$PATH" + DOTNET_CLI_TELEMETRY_OPTOUT=true # Define working directory WORKDIR $METACALL_PATH diff --git a/tools/metacall-build.sh b/tools/metacall-build.sh index 1cfcc7f69..74826e22f 100755 --- a/tools/metacall-build.sh +++ b/tools/metacall-build.sh @@ -74,9 +74,9 @@ sub_build() { make -j$(getconf _NPROCESSORS_ONLN) # Tests (coverage needs to run the tests) - # if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then - # ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE - # fi + if [ $BUILD_TESTS = 1 ] || [ $BUILD_BENCHMARKS=1 ] || [ $BUILD_COVERAGE = 1 ]; then + ctest -j$(getconf _NPROCESSORS_ONLN) --timeout 5400 --output-on-failure --test-output-size-failed 3221000000 -C $BUILD_TYPE + fi # Coverage if [ $BUILD_COVERAGE = 1 ]; then diff --git a/tools/metacall-configure.sh b/tools/metacall-configure.sh index 61a802757..0360f472f 100755 --- a/tools/metacall-configure.sh +++ b/tools/metacall-configure.sh @@ -529,7 +529,7 @@ sub_configure() { fi # Build type - BUILD_STRING="$BUILD_STRING -DOPTION_BUILD_ADDRESS_SANITIZER=On -DCMAKE_BUILD_TYPE=Debug" #$BUILD_TYPE" + BUILD_STRING="$BUILD_STRING -DCMAKE_BUILD_TYPE=$BUILD_TYPE" # Execute CMake cmake -Wno-dev -DOPTION_GIT_HOOKS=Off $BUILD_STRING .. From 7ba08234fed06956e430087b09e1c83fdbe35735 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 23 Apr 2025 22:49:00 +0200 Subject: [PATCH 235/487] Docker path. --- tools/cli/Dockerfile | 3 ++- tools/dev/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/cli/Dockerfile b/tools/cli/Dockerfile index fed409c5e..5b387470d 100644 --- a/tools/cli/Dockerfile +++ b/tools/cli/Dockerfile @@ -40,7 +40,8 @@ ENV LOADER_LIBRARY_PATH=/usr/local/lib \ PORT_LIBRARY_PATH=/usr/local/lib \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/local/lib/node_modules \ - DOTNET_CLI_TELEMETRY_OPTOUT=true + DOTNET_CLI_TELEMETRY_OPTOUT=true \ + PATH="/usr/local/bin:$PATH" # Define working directory WORKDIR $LOADER_SCRIPT_PATH diff --git a/tools/dev/Dockerfile b/tools/dev/Dockerfile index 9f5805944..8d239a0b8 100644 --- a/tools/dev/Dockerfile +++ b/tools/dev/Dockerfile @@ -40,7 +40,8 @@ ENV LOADER_LIBRARY_PATH=$METACALL_PATH/build \ PORT_LIBRARY_PATH=$METACALL_PATH/build \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/lib/node_modules \ - DOTNET_CLI_TELEMETRY_OPTOUT=true + DOTNET_CLI_TELEMETRY_OPTOUT=true \ + PATH="/usr/local/bin:$PATH" # Define working directory WORKDIR $METACALL_PATH From 9c2b3e3fade1d06339217240ebade0e77fc035f5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 23 Apr 2025 23:22:27 +0200 Subject: [PATCH 236/487] Trying to solve issues with docker hub. --- .github/workflows/docker-hub.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 93a95125b..55c7b68b3 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -86,12 +86,12 @@ jobs: cat <<EOF > Dockerfile.test FROM metacall/${IMAGE_NAME}:cli-${platform_tag} RUN echo "console.log('0123456789abcdef')" > script.js - RUN metacallcli script.js + RUN metacallcli script.js | tee output.txt + RUN grep 0123456789abcdef output.txt EOF export DOCKER_BUILDKIT=1 - docker build --progress=plain --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . | tee output.txt - grep "0123456789abcdef" output.txt + docker build --progress=plain --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . - name: Push Platform Images # Only run when master or when tagging a version From b9d0940400caab8e0137ff2ac4491ea5c980cf3d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 00:04:53 +0200 Subject: [PATCH 237/487] Add deubg. --- .github/workflows/docker-hub.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 55c7b68b3..151fcf788 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -86,6 +86,7 @@ jobs: cat <<EOF > Dockerfile.test FROM metacall/${IMAGE_NAME}:cli-${platform_tag} RUN echo "console.log('0123456789abcdef')" > script.js + RUN ls -la /usr/local/bin RUN metacallcli script.js | tee output.txt RUN grep 0123456789abcdef output.txt EOF From 0faf2e825ab75763efcf1f735fec6e4d8dc1d921 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 00:30:50 +0200 Subject: [PATCH 238/487] Use the binary on docker hub. --- .github/workflows/docker-hub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 151fcf788..3c1842dbe 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -87,7 +87,7 @@ jobs: FROM metacall/${IMAGE_NAME}:cli-${platform_tag} RUN echo "console.log('0123456789abcdef')" > script.js RUN ls -la /usr/local/bin - RUN metacallcli script.js | tee output.txt + RUN /usr/local/bin/metacallcli script.js | tee output.txt RUN grep 0123456789abcdef output.txt EOF From 9a35d0f5f1c7941c362d02fdb83322855a5126ed Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 01:03:49 +0200 Subject: [PATCH 239/487] Testing things with dockerhub. --- .github/workflows/docker-hub.yml | 7 ++++++- tools/cli/Dockerfile | 3 +-- tools/dev/Dockerfile | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 3c1842dbe..eab4e4d0d 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -86,13 +86,18 @@ jobs: cat <<EOF > Dockerfile.test FROM metacall/${IMAGE_NAME}:cli-${platform_tag} RUN echo "console.log('0123456789abcdef')" > script.js + RUN pwd + RUN ls -la RUN ls -la /usr/local/bin + RUN whoami + RUN /usr/local/bin/metacallcli `pwd`/script.js + RUN /usr/local/bin/metacallcli script.js RUN /usr/local/bin/metacallcli script.js | tee output.txt RUN grep 0123456789abcdef output.txt EOF export DOCKER_BUILDKIT=1 - docker build --progress=plain --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . + docker build --progress=plain --platform=${{ matrix.platform }} -f Dockerfile.test -t test-image . - name: Push Platform Images # Only run when master or when tagging a version diff --git a/tools/cli/Dockerfile b/tools/cli/Dockerfile index 5b387470d..fed409c5e 100644 --- a/tools/cli/Dockerfile +++ b/tools/cli/Dockerfile @@ -40,8 +40,7 @@ ENV LOADER_LIBRARY_PATH=/usr/local/lib \ PORT_LIBRARY_PATH=/usr/local/lib \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/local/lib/node_modules \ - DOTNET_CLI_TELEMETRY_OPTOUT=true \ - PATH="/usr/local/bin:$PATH" + DOTNET_CLI_TELEMETRY_OPTOUT=true # Define working directory WORKDIR $LOADER_SCRIPT_PATH diff --git a/tools/dev/Dockerfile b/tools/dev/Dockerfile index 8d239a0b8..9f5805944 100644 --- a/tools/dev/Dockerfile +++ b/tools/dev/Dockerfile @@ -40,8 +40,7 @@ ENV LOADER_LIBRARY_PATH=$METACALL_PATH/build \ PORT_LIBRARY_PATH=$METACALL_PATH/build \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/lib/node_modules \ - DOTNET_CLI_TELEMETRY_OPTOUT=true \ - PATH="/usr/local/bin:$PATH" + DOTNET_CLI_TELEMETRY_OPTOUT=true # Define working directory WORKDIR $METACALL_PATH From 0785ea1ea84fcd593002f549d48fc076156400f5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 01:31:54 +0200 Subject: [PATCH 240/487] More debug of dockerhub. --- .github/workflows/docker-hub.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index eab4e4d0d..c2d7451a8 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -83,15 +83,12 @@ jobs: run: | set -exuo pipefail platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') + docker image inspect metacall/${IMAGE_NAME}:cli-${platform_tag} --format='{{.Os}}/{{.Architecture}}' cat <<EOF > Dockerfile.test FROM metacall/${IMAGE_NAME}:cli-${platform_tag} RUN echo "console.log('0123456789abcdef')" > script.js - RUN pwd - RUN ls -la - RUN ls -la /usr/local/bin - RUN whoami - RUN /usr/local/bin/metacallcli `pwd`/script.js - RUN /usr/local/bin/metacallcli script.js + RUN file /usr/local/bin/metacallcli + RUN /usr/local/bin/metacallcli /usr/local/scripts/script.js RUN /usr/local/bin/metacallcli script.js | tee output.txt RUN grep 0123456789abcdef output.txt EOF From 64bd9080071ebd14ebf676291400fbf49ac3037c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 01:52:24 +0200 Subject: [PATCH 241/487] Add file dependency for debug dockerhub. --- .github/workflows/docker-hub.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index c2d7451a8..cf4a81848 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -87,6 +87,7 @@ jobs: cat <<EOF > Dockerfile.test FROM metacall/${IMAGE_NAME}:cli-${platform_tag} RUN echo "console.log('0123456789abcdef')" > script.js + RUN apt-get update && apt-get install file RUN file /usr/local/bin/metacallcli RUN /usr/local/bin/metacallcli /usr/local/scripts/script.js RUN /usr/local/bin/metacallcli script.js | tee output.txt From 44379ca690c5a1c67b2a8ca3c74f2e94e6874ed8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 02:29:08 +0200 Subject: [PATCH 242/487] Trying to solve issues with atomic abi. --- source/reflect/source/reflect_class.c | 2 +- source/reflect/source/reflect_exception.c | 2 +- source/reflect/source/reflect_function.c | 2 +- source/reflect/source/reflect_object.c | 2 +- .../threading/threading_atomic_ref_count.h | 22 +++++++++---------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/reflect/source/reflect_class.c b/source/reflect/source/reflect_class.c index 77ea42baa..4a8c54058 100644 --- a/source/reflect/source/reflect_class.c +++ b/source/reflect/source/reflect_class.c @@ -42,7 +42,7 @@ struct class_type enum accessor_type_id accessor; class_impl impl; class_interface interface; - struct threading_atomic_ref_count_type ref; + threading_atomic_ref_count_type ref; vector constructors; map methods; map static_methods; diff --git a/source/reflect/source/reflect_exception.c b/source/reflect/source/reflect_exception.c index 179aa237a..25752bdd9 100644 --- a/source/reflect/source/reflect_exception.c +++ b/source/reflect/source/reflect_exception.c @@ -37,7 +37,7 @@ struct exception_type int64_t code; /* Numeric code of error */ char *stacktrace; /* Stack trace of the error */ uint64_t id; /* Thread id where the error was raised */ - struct threading_atomic_ref_count_type ref; + threading_atomic_ref_count_type ref; /* TODO: value attributes; // This should implement a map for representing the extra attributes of an exception */ }; diff --git a/source/reflect/source/reflect_function.c b/source/reflect/source/reflect_function.c index d64ab1c90..27da107fd 100644 --- a/source/reflect/source/reflect_function.c +++ b/source/reflect/source/reflect_function.c @@ -36,7 +36,7 @@ struct function_type signature s; function_impl impl; function_interface interface; - struct threading_atomic_ref_count_type ref; + threading_atomic_ref_count_type ref; enum async_id async; void *data; }; diff --git a/source/reflect/source/reflect_object.c b/source/reflect/source/reflect_object.c index 1938d55ec..c4b068f67 100644 --- a/source/reflect/source/reflect_object.c +++ b/source/reflect/source/reflect_object.c @@ -40,7 +40,7 @@ struct object_type enum accessor_type_id accessor; object_impl impl; object_interface interface; - struct threading_atomic_ref_count_type ref; + threading_atomic_ref_count_type ref; klass cls; }; diff --git a/source/threading/include/threading/threading_atomic_ref_count.h b/source/threading/include/threading/threading_atomic_ref_count.h index 165ef565c..8dd8531fc 100644 --- a/source/threading/include/threading/threading_atomic_ref_count.h +++ b/source/threading/include/threading/threading_atomic_ref_count.h @@ -46,19 +46,19 @@ extern "C" { /* -- Member Data -- */ -struct threading_atomic_ref_count_type -{ #if defined(__THREAD_SANITIZER__) +typedef struct +{ uintmax_t count; threading_mutex_type m; +} threading_atomic_ref_count_type; #else - atomic_uintmax_t count; +typedef atomic_uintmax_t threading_atomic_ref_count_type; #endif -}; /* -- Type Definitions -- */ -typedef struct threading_atomic_ref_count_type *threading_atomic_ref_count; +typedef threading_atomic_ref_count_type *threading_atomic_ref_count; /* -- Methods -- */ @@ -67,7 +67,7 @@ static inline void threading_atomic_ref_count_store(threading_atomic_ref_count r #if defined(__THREAD_SANITIZER__) threading_mutex_store(&ref->m, &ref->count, &v, sizeof(uintmax_t)); #else - atomic_store(&ref->count, v); + atomic_store(ref, v); #endif } @@ -93,7 +93,7 @@ static inline uintmax_t threading_atomic_ref_count_load(threading_atomic_ref_cou return result; #else - return atomic_load_explicit(&ref->count, memory_order_relaxed); + return atomic_load_explicit(ref, memory_order_relaxed); #endif } @@ -106,12 +106,12 @@ static inline int threading_atomic_ref_count_increment(threading_atomic_ref_coun } threading_mutex_unlock(&ref->m); #else - if (atomic_load_explicit(&ref->count, memory_order_relaxed) == THREADING_ATOMIC_REF_COUNT_MAX) + if (atomic_load_explicit(ref, memory_order_relaxed) == THREADING_ATOMIC_REF_COUNT_MAX) { return 1; } - atomic_fetch_add_explicit(&ref->count, 1, memory_order_relaxed); + atomic_fetch_add_explicit(ref, 1, memory_order_relaxed); #endif return 0; @@ -126,12 +126,12 @@ static inline int threading_atomic_ref_count_decrement(threading_atomic_ref_coun } threading_mutex_unlock(&ref->m); #else - if (atomic_load_explicit(&ref->count, memory_order_relaxed) == THREADING_ATOMIC_REF_COUNT_MIN) + if (atomic_load_explicit(ref, memory_order_relaxed) == THREADING_ATOMIC_REF_COUNT_MIN) { return 1; } - uintmax_t old_ref_count = atomic_fetch_sub_explicit(&ref->count, 1, memory_order_release); + uintmax_t old_ref_count = atomic_fetch_sub_explicit(ref, 1, memory_order_release); if (old_ref_count == THREADING_ATOMIC_REF_COUNT_MIN + 1) { From bcf26cb2b0b94c6dae60c95a66b077f9974f4378 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 17:07:03 +0200 Subject: [PATCH 243/487] Solve issues on docker, improbe build warnings. --- .github/workflows/docker-hub.yml | 30 +++----- docker-compose.test.yml | 4 +- .../include/node_loader/node_loader_impl.h | 2 +- .../node_loader/source/node_loader_impl.cpp | 73 ++++++++++++------- .../source/node_loader_trampoline.cpp | 9 ++- .../loaders/py_loader/source/py_loader_dict.c | 22 ++++++ .../loaders/py_loader/source/py_loader_impl.c | 2 - .../py_loader/source/py_loader_threading.cpp | 2 - .../loaders/rb_loader/source/rb_loader_impl.c | 1 + source/ports/py_port/helper.py | 2 +- source/reflect/source/reflect_class.c | 1 + source/reflect/source/reflect_exception.c | 10 ++- source/reflect/source/reflect_function.c | 18 +++-- source/reflect/source/reflect_object.c | 24 +++--- .../threading/threading_atomic_ref_count.h | 18 ++--- tools/metacall-configure.sh | 21 ++++++ tools/metacall-environment.sh | 23 ++++++ tools/metacall-runtime.sh | 9 +++ tools/metacall-sanitizer.sh | 2 +- 19 files changed, 186 insertions(+), 87 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index cf4a81848..718bae74c 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -67,42 +67,32 @@ jobs: run: | ./docker-compose.sh platform - - name: Tag Platform Images - run: | - set -exuo pipefail - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - echo "Platform Tag: ${platform_tag}" - for tag in "deps" "dev" "runtime" "cli"; do - docker tag metacall/${IMAGE_NAME}:${tag} \ - metacall/${IMAGE_NAME}:${tag}-${platform_tag} - docker tag metacall/${IMAGE_NAME}:${tag} \ - ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} - done - - name: Run Tests run: | set -exuo pipefail - platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') - docker image inspect metacall/${IMAGE_NAME}:cli-${platform_tag} --format='{{.Os}}/{{.Architecture}}' + docker image inspect ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli --format='{{.Os}}/{{.Architecture}}' cat <<EOF > Dockerfile.test - FROM metacall/${IMAGE_NAME}:cli-${platform_tag} - RUN echo "console.log('0123456789abcdef')" > script.js - RUN apt-get update && apt-get install file + FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli + RUN apt-get update && apt-get install -y file RUN file /usr/local/bin/metacallcli - RUN /usr/local/bin/metacallcli /usr/local/scripts/script.js - RUN /usr/local/bin/metacallcli script.js | tee output.txt + RUN echo "console.log('0123456789abcdef')" > script.js + RUN metacallcli script.js | tee output.txt RUN grep 0123456789abcdef output.txt EOF export DOCKER_BUILDKIT=1 docker build --progress=plain --platform=${{ matrix.platform }} -f Dockerfile.test -t test-image . - - name: Push Platform Images + - name: Tag & Push Platform Images # Only run when master or when tagging a version if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' run: | platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') for tag in "deps" "dev" "runtime" "cli"; do + docker tag \ + ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} \ + ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} + echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" docker push ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} done diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 0834f67a0..a6946f3a5 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -25,10 +25,10 @@ services: build: args: METACALL_BUILD_TYPE: ${METACALL_BUILD_TYPE} - METACALL_INSTALL_OPTIONS: base python ruby netcore7 nodejs typescript file rpc wasm java c cobol go rust rapidjson swig pack backtrace sandbox ${METACALL_BUILD_COVERAGE} # clangformat v8rep51 + METACALL_INSTALL_OPTIONS: base python ruby netcore8 nodejs typescript file rpc wasm java c cobol go rust rapidjson swig pack backtrace sandbox ${METACALL_BUILD_COVERAGE} # clangformat v8rep51 dev: image: metacall/core:dev build: args: METACALL_BUILD_TYPE: ${METACALL_BUILD_TYPE} - METACALL_BUILD_OPTIONS: ${METACALL_BUILD_SANITIZER} python ruby netcore7 nodejs typescript file rpc wasm java c cobol go rust examples tests scripts ports install pack sandbox benchmarks ${METACALL_BUILD_COVERAGE} # v8 + METACALL_BUILD_OPTIONS: ${METACALL_BUILD_SANITIZER} python ruby netcore8 nodejs typescript file rpc wasm java c cobol go rust examples tests scripts ports install pack sandbox benchmarks ${METACALL_BUILD_COVERAGE} # v8 diff --git a/source/loaders/node_loader/include/node_loader/node_loader_impl.h b/source/loaders/node_loader/include/node_loader/node_loader_impl.h index 094f3b24e..ee424c9b3 100644 --- a/source/loaders/node_loader/include/node_loader/node_loader_impl.h +++ b/source/loaders/node_loader/include/node_loader/node_loader_impl.h @@ -67,7 +67,7 @@ NODE_LOADER_NO_EXPORT void node_loader_impl_destroy_safe_impl(loader_impl_node n NODE_LOADER_NO_EXPORT void node_loader_impl_print_handles(loader_impl_node node_impl); -NODE_LOADER_NO_EXPORT int64_t node_loader_impl_user_async_handles_count(loader_impl_node node_impl); +NODE_LOADER_NO_EXPORT uint64_t node_loader_impl_user_async_handles_count(loader_impl_node node_impl); NODE_LOADER_NO_EXPORT napi_value node_loader_impl_register_bootstrap_startup(loader_impl_node node_impl, napi_env env); diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 9a318719d..adda1440f 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -704,8 +704,8 @@ struct loader_impl_node_type /* TODO: This implementation won't work for multi-isolate environments. We should test it. */ std::thread::id js_thread_id; - int64_t base_active_handles; - std::atomic_int64_t extra_active_handles; + uint64_t base_active_handles; + std::atomic_uint64_t extra_active_handles; uv_prepare_t destroy_prepare; uv_check_t destroy_check; std::atomic_bool event_loop_empty; @@ -874,7 +874,7 @@ static void node_loader_impl_thread_log(void *data); static void node_loader_impl_walk_async_handles_count(uv_handle_t *handle, void *arg); #endif -static int64_t node_loader_impl_async_handles_count(loader_impl_node node_impl); +static uint64_t node_loader_impl_async_handles_count(loader_impl_node node_impl); static void node_loader_impl_try_destroy(loader_impl_node node_impl); @@ -4346,7 +4346,7 @@ static void node_loader_impl_destroy_cb(loader_impl_node node_impl) node_loader_impl_print_handles(node_impl); #endif - if (node_impl->event_loop_empty.load() == false && node_loader_impl_user_async_handles_count(node_impl) <= 0) + if (node_impl->event_loop_empty.load() == false && node_loader_impl_user_async_handles_count(node_impl) == 0) { loader_impl_handle_safe_cast<uv_prepare_t> destroy_prepare_cast = { NULL }; loader_impl_handle_safe_cast<uv_check_t> destroy_check_cast = { NULL }; @@ -4399,7 +4399,7 @@ void node_loader_impl_destroy_safe(napi_env env, loader_impl_async_destroy_safe_ node_loader_impl_exception(env, status); /* Check if there are async handles, destroy if the queue is empty, otherwise request the destroy */ - if (node_loader_impl_user_async_handles_count(node_impl) <= 0 || node_impl->event_loop_empty.load() == true) + if (node_loader_impl_user_async_handles_count(node_impl) == 0 || node_impl->event_loop_empty.load() == true) { node_loader_impl_destroy_safe_impl(node_impl, env); destroy_safe->has_finished = true; @@ -4431,7 +4431,7 @@ static inline int uv__queue_empty(const struct node_loader_impl_uv__queue *q) #if (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) void node_loader_impl_walk_async_handles_count(uv_handle_t *handle, void *arg) { - int64_t *async_count = static_cast<int64_t *>(arg); + uint64_t *async_count = static_cast<uint64_t *>(arg); if (uv_is_active(handle) && !uv_is_closing(handle)) { @@ -4447,11 +4447,11 @@ void node_loader_impl_walk_async_handles_count(uv_handle_t *handle, void *arg) } #endif -int64_t node_loader_impl_async_closing_handles_count(loader_impl_node node_impl) +uint64_t node_loader_impl_async_closing_handles_count(loader_impl_node node_impl) { #if defined(WIN32) || defined(_WIN32) - return (int64_t)(node_impl->thread_loop->pending_reqs_tail != NULL) + - (int64_t)(node_impl->thread_loop->endgame_handles != NULL); + return (uint64_t)(node_impl->thread_loop->pending_reqs_tail != NULL) + + (uint64_t)(node_impl->thread_loop->endgame_handles != NULL); #else union { @@ -4461,49 +4461,66 @@ int64_t node_loader_impl_async_closing_handles_count(loader_impl_node node_impl) uv__queue_cast.data = (void *)&node_impl->thread_loop->pending_queue; - return (int64_t)(!uv__queue_empty(uv__queue_cast.ptr)) + - (int64_t)(node_impl->thread_loop->closing_handles != NULL); + return (uint64_t)(!uv__queue_empty(uv__queue_cast.ptr)) + + (uint64_t)(node_impl->thread_loop->closing_handles != NULL); #endif } -int64_t node_loader_impl_async_handles_count(loader_impl_node node_impl) +uint64_t node_loader_impl_async_handles_count(loader_impl_node node_impl) { #if (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) - int64_t active_handles = 0; + uint64_t active_handles = 0; uv_walk(node_impl->thread_loop, node_loader_impl_walk_async_handles_count, (void *)&active_handles); return active_handles + - (int64_t)(node_impl->thread_loop->active_reqs.count > 0) + + (uint64_t)(node_impl->thread_loop->active_reqs.count > 0) + node_loader_impl_async_closing_handles_count(node_impl); #else - int64_t active_handles = (int64_t)node_impl->thread_loop->active_handles + - (int64_t)(node_impl->thread_loop->active_reqs.count > 0) + - node_loader_impl_async_closing_handles_count(node_impl); + uint64_t active_handles = (uint64_t)node_impl->thread_loop->active_handles + + (uint64_t)(node_impl->thread_loop->active_reqs.count > 0) + + node_loader_impl_async_closing_handles_count(node_impl); return active_handles; #endif } -int64_t node_loader_impl_user_async_handles_count(loader_impl_node node_impl) +uint64_t node_loader_impl_user_async_handles_count(loader_impl_node node_impl) { - int64_t active_handles = node_loader_impl_async_handles_count(node_impl); - int64_t extra_active_handles = node_impl->extra_active_handles.load(); + uint64_t active_handles = node_loader_impl_async_handles_count(node_impl); + uint64_t extra_active_handles = node_impl->extra_active_handles.load(); + uint64_t base_active_handles = node_impl->base_active_handles; /* TODO: Uncomment for debugging handles */ /* #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - int64_t closing = node_loader_impl_async_closing_handles_count(node_impl); + uint64_t closing = node_loader_impl_async_closing_handles_count(node_impl); printf("[active_handles] - [base_active_handles] - [extra_active_handles] + [active_reqs] + [closing]\n"); - printf(" %" PRId64 " - %" PRId64 " - %" PRId64 " + %" PRId64 " [> 0] + %" PRId64 "\n", - (int64_t)node_impl->thread_loop->active_handles, - node_impl->base_active_handles, + printf(" %" PRIu64 " - %" PRIu64 " - %" PRIu64 " + %" PRIu64 " [> 0] + %" PRIu64 "\n", + (uint64_t)node_impl->thread_loop->active_handles, + base_active_handles, extra_active_handles, - (int64_t)node_impl->thread_loop->active_reqs.count, + (uint64_t)node_impl->thread_loop->active_reqs.count, closing); #endif */ - return active_handles - node_impl->base_active_handles - extra_active_handles; + /* Check for overflow */ + uint64_t total_base_handles = base_active_handles + extra_active_handles; + + if (total_base_handles < base_active_handles) + { + /* Overflow occurred */ + return UINT64_MAX; + } + + /* Check for underflow */ + if (active_handles < total_base_handles) + { + /* Underflow occurred */ + return 0; + } + + return active_handles - total_base_handles; } void node_loader_impl_print_handles(loader_impl_node node_impl) @@ -4512,8 +4529,8 @@ void node_loader_impl_print_handles(loader_impl_node node_impl) /* TODO: Uncomment for debugging handles */ /* - printf("Number of active handles: %" PRId64 "\n", node_loader_impl_async_handles_count(node_impl)); - printf("Number of user active handles: %" PRId64 "\n", node_loader_impl_user_async_handles_count(node_impl)); + printf("Number of active handles: %" PRIu64 "\n", node_loader_impl_async_handles_count(node_impl)); + printf("Number of user active handles: %" PRIu64 "\n", node_loader_impl_user_async_handles_count(node_impl)); uv_print_active_handles(node_impl->thread_loop, stdout); fflush(stdout); */ diff --git a/source/loaders/node_loader/source/node_loader_trampoline.cpp b/source/loaders/node_loader/source/node_loader_trampoline.cpp index 3dbb35293..5d5aebbc8 100644 --- a/source/loaders/node_loader/source/node_loader_trampoline.cpp +++ b/source/loaders/node_loader/source/node_loader_trampoline.cpp @@ -397,12 +397,17 @@ napi_value node_loader_trampoline_active_handles(napi_env env, napi_callback_inf return nullptr; } - int64_t active_handles = node_loader_impl_user_async_handles_count(node_impl_cast.data); + uint64_t active_handles = node_loader_impl_user_async_handles_count(node_impl_cast.data); /* Create the integer return value */ napi_value result; - status = napi_create_int64(env, active_handles, &result); + if (active_handles > (uint64_t)INT64_MAX) + { + active_handles = (uint64_t)INT64_MAX; + } + + status = napi_create_int64(env, (int64_t)active_handles, &result); node_loader_impl_exception(env, status); diff --git a/source/loaders/py_loader/source/py_loader_dict.c b/source/loaders/py_loader/source/py_loader_dict.c index 2982a4367..48c1bdee6 100644 --- a/source/loaders/py_loader/source/py_loader_dict.c +++ b/source/loaders/py_loader/source/py_loader_dict.c @@ -26,10 +26,32 @@ #include <Python.h> #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 + /* Disable warnings from Python */ + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wredundant-decls" + #pragma clang diagnostic ignored "-Wstrict-aliasing" + #pragma clang diagnostic ignored "-Wunused-parameter" + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #elif defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wredundant-decls" + #pragma GCC diagnostic ignored "-Wstrict-aliasing" + #pragma GCC diagnostic ignored "-Wunused-parameter" + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif + #ifndef Py_BUILD_CORE #define Py_BUILD_CORE #endif #include <internal/pycore_dict.h> + + /* Disable warnings from Python */ + #if defined(__clang__) + #pragma clang diagnostic pop + #elif defined(__GNUC__) + #pragma GCC diagnostic pop + #endif #endif struct py_loader_impl_dict_obj diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 79d655d01..32fedc692 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -44,8 +44,6 @@ #include <stdbool.h> #include <stdlib.h> -#include <Python.h> - #define PY_LOADER_IMPL_FUNCTION_TYPE_INVOKE_FUNC "__py_loader_impl_function_type_invoke__" #define PY_LOADER_IMPL_FINALIZER_FUNC "__py_loader_impl_finalizer__" diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index c49add1c3..5aa5173a9 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -24,8 +24,6 @@ #include <Python.h> -#include <thread> - struct py_thread_state { uint64_t ref_count; diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index ea3f817ae..3451dec8f 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -42,6 +42,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #pragma GCC diagnostic ignored "-Wpedantic" + #pragma GCC diagnostic ignored "-Wunused-parameter" #endif #include <ruby.h> diff --git a/source/ports/py_port/helper.py b/source/ports/py_port/helper.py index 86f851381..1a0a77df8 100644 --- a/source/ports/py_port/helper.py +++ b/source/ports/py_port/helper.py @@ -112,7 +112,7 @@ def pre_install(components): def pre_install_prompt(): answers = {'yes': True, 'y': True, 'no': False, 'n': False} - components = ['python', 'ruby', 'netcore7', 'v8', 'nodejs', 'ports'] + components = ['python', 'ruby', 'netcore8', 'v8', 'nodejs', 'ports'] args = [] try: diff --git a/source/reflect/source/reflect_class.c b/source/reflect/source/reflect_class.c index 4a8c54058..63643a24f 100644 --- a/source/reflect/source/reflect_class.c +++ b/source/reflect/source/reflect_class.c @@ -123,6 +123,7 @@ klass class_create(const char *name, enum accessor_type_id accessor, class_impl log_write("metacall", LOG_LEVEL_ERROR, "Invalid class (%s) create callback <%p>", cls->name, cls->interface->create); free(cls->name); + threading_atomic_ref_count_destroy(&cls->ref); vector_destroy(cls->constructors); map_destroy(cls->methods); map_destroy(cls->static_methods); diff --git a/source/reflect/source/reflect_exception.c b/source/reflect/source/reflect_exception.c index 25752bdd9..34b3dc2d3 100644 --- a/source/reflect/source/reflect_exception.c +++ b/source/reflect/source/reflect_exception.c @@ -138,9 +138,15 @@ exception exception_create_const(const char *message, const char *label, int64_t return ex; stacktrace_bad_alloc: - free(ex->label); + if (ex->label != NULL) + { + free(ex->label); + } label_bad_alloc: - free(ex->message); + if (ex->message != NULL) + { + free(ex->message); + } message_bad_alloc: free(ex); exception_bad_alloc: diff --git a/source/reflect/source/reflect_function.c b/source/reflect/source/reflect_function.c index 27da107fd..b9a03512f 100644 --- a/source/reflect/source/reflect_function.c +++ b/source/reflect/source/reflect_function.c @@ -66,9 +66,7 @@ function function_create(const char *name, size_t args_count, function_impl impl { log_write("metacall", LOG_LEVEL_ERROR, "Invalid function name allocation <%s>", name); - free(func); - - return NULL; + goto name_error; } memcpy(func->name, name, func_name_size); @@ -88,7 +86,7 @@ function function_create(const char *name, size_t args_count, function_impl impl { log_write("metacall", LOG_LEVEL_ERROR, "Invalid function signature allocation"); - goto function_create_error; + goto signature_error; } threading_atomic_ref_count_initialize(&func->ref); @@ -101,7 +99,7 @@ function function_create(const char *name, size_t args_count, function_impl impl { log_write("metacall", LOG_LEVEL_ERROR, "Invalid function (%s) create callback <%p>", func->name, func->interface->create); - goto function_create_error; + goto interface_create_error; } } @@ -109,8 +107,14 @@ function function_create(const char *name, size_t args_count, function_impl impl return func; -function_create_error: - free(func->name); +interface_create_error: + signature_destroy(func->s); +signature_error: + if (func->name != NULL) + { + free(func->name); + } +name_error: free(func); return NULL; diff --git a/source/reflect/source/reflect_object.c b/source/reflect/source/reflect_object.c index c4b068f67..a568b24d7 100644 --- a/source/reflect/source/reflect_object.c +++ b/source/reflect/source/reflect_object.c @@ -67,9 +67,7 @@ object object_create(const char *name, enum accessor_type_id accessor, object_im { log_write("metacall", LOG_LEVEL_ERROR, "Invalid object name allocation <%s>", name); - free(obj); - - return NULL; + goto name_error; } memcpy(obj->name, name, obj_name_size); @@ -79,12 +77,11 @@ object object_create(const char *name, enum accessor_type_id accessor, object_im obj->name = NULL; } - obj->impl = impl; - obj->accessor = accessor; threading_atomic_ref_count_initialize(&obj->ref); + obj->impl = impl; + obj->accessor = accessor; obj->interface = singleton ? singleton() : NULL; - obj->cls = cls; if (obj->interface != NULL && obj->interface->create != NULL) @@ -93,16 +90,23 @@ object object_create(const char *name, enum accessor_type_id accessor, object_im { log_write("metacall", LOG_LEVEL_ERROR, "Invalid object (%s) create callback <%p>", obj->name, obj->interface->create); - free(obj->name); - free(obj); - - return NULL; + goto interface_create_error; } } reflect_memory_tracker_allocation(object_stats); return obj; + +interface_create_error: + if (obj->name != NULL) + { + free(obj->name); + } +name_error: + free(obj); + + return NULL; } int object_increment_reference(object obj) diff --git a/source/threading/include/threading/threading_atomic_ref_count.h b/source/threading/include/threading/threading_atomic_ref_count.h index 8dd8531fc..8a1dc1cc4 100644 --- a/source/threading/include/threading/threading_atomic_ref_count.h +++ b/source/threading/include/threading/threading_atomic_ref_count.h @@ -46,15 +46,15 @@ extern "C" { /* -- Member Data -- */ -#if defined(__THREAD_SANITIZER__) typedef struct { +#if defined(__THREAD_SANITIZER__) uintmax_t count; threading_mutex_type m; -} threading_atomic_ref_count_type; #else -typedef atomic_uintmax_t threading_atomic_ref_count_type; + atomic_uintmax_t count; #endif +} threading_atomic_ref_count_type; /* -- Type Definitions -- */ @@ -67,7 +67,7 @@ static inline void threading_atomic_ref_count_store(threading_atomic_ref_count r #if defined(__THREAD_SANITIZER__) threading_mutex_store(&ref->m, &ref->count, &v, sizeof(uintmax_t)); #else - atomic_store(ref, v); + atomic_store(&ref->count, v); #endif } @@ -93,7 +93,7 @@ static inline uintmax_t threading_atomic_ref_count_load(threading_atomic_ref_cou return result; #else - return atomic_load_explicit(ref, memory_order_relaxed); + return atomic_load_explicit(&ref->count, memory_order_relaxed); #endif } @@ -106,12 +106,12 @@ static inline int threading_atomic_ref_count_increment(threading_atomic_ref_coun } threading_mutex_unlock(&ref->m); #else - if (atomic_load_explicit(ref, memory_order_relaxed) == THREADING_ATOMIC_REF_COUNT_MAX) + if (atomic_load_explicit(&ref->count, memory_order_relaxed) == THREADING_ATOMIC_REF_COUNT_MAX) { return 1; } - atomic_fetch_add_explicit(ref, 1, memory_order_relaxed); + atomic_fetch_add_explicit(&ref->count, 1, memory_order_relaxed); #endif return 0; @@ -126,12 +126,12 @@ static inline int threading_atomic_ref_count_decrement(threading_atomic_ref_coun } threading_mutex_unlock(&ref->m); #else - if (atomic_load_explicit(ref, memory_order_relaxed) == THREADING_ATOMIC_REF_COUNT_MIN) + if (atomic_load_explicit(&ref->count, memory_order_relaxed) == THREADING_ATOMIC_REF_COUNT_MIN) { return 1; } - uintmax_t old_ref_count = atomic_fetch_sub_explicit(ref, 1, memory_order_release); + uintmax_t old_ref_count = atomic_fetch_sub_explicit(&ref->count, 1, memory_order_release); if (old_ref_count == THREADING_ATOMIC_REF_COUNT_MIN + 1) { diff --git a/tools/metacall-configure.sh b/tools/metacall-configure.sh index 0360f472f..7847a0d34 100755 --- a/tools/metacall-configure.sh +++ b/tools/metacall-configure.sh @@ -29,6 +29,7 @@ BUILD_NETCORE=0 BUILD_NETCORE2=0 BUILD_NETCORE5=0 BUILD_NETCORE7=0 +BUILD_NETCORE8=0 BUILD_V8=0 BUILD_NODEJS=0 BUILD_TYPESCRIPT=0 @@ -112,6 +113,10 @@ sub_options() { echo "Build with netcore 7 support" BUILD_NETCORE7=1 fi + if [ "$option" = 'netcore8' ]; then + echo "Build with netcore 8 support" + BUILD_NETCORE8=1 + fi if [ "$option" = 'v8' ]; then echo "Build with v8 support" BUILD_V8=1 @@ -318,6 +323,21 @@ sub_configure() { fi fi + # NetCore 8 + if [ $BUILD_NETCORE8 = 1 ]; then + BUILD_STRING="$BUILD_STRING \ + -DOPTION_BUILD_LOADERS_CS=On \ + -DDOTNET_CORE_PATH=`sub_find_dotnet_runtime 8`" + + if [ $BUILD_SCRIPTS = 1 ]; then + BUILD_STRING="$BUILD_STRING -DOPTION_BUILD_SCRIPTS_CS=On" + fi + + if [ $BUILD_PORTS = 1 ]; then + BUILD_STRING="$BUILD_STRING -DOPTION_BUILD_PORTS_CS=On" + fi + fi + # V8 if [ $BUILD_V8 = 1 ]; then BUILD_STRING="$BUILD_STRING -DOPTION_BUILD_LOADERS_JS=On" @@ -545,6 +565,7 @@ sub_help() { echo " netcore2: build with netcore 2 support" echo " netcore5: build with netcore 5 support" echo " netcore7: build with netcore 7 support" + echo " netcore8: build with netcore 8 support" echo " v8: build with v8 support" echo " nodejs: build with nodejs support" echo " typescript: build with typescript support" diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 593ac4b93..fb5ca4761 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -34,6 +34,7 @@ INSTALL_NETCORE=0 INSTALL_NETCORE2=0 INSTALL_NETCORE5=0 INSTALL_NETCORE7=0 +INSTALL_NETCORE8=0 INSTALL_V8=0 INSTALL_V8REPO=0 INSTALL_V8REPO58=0 @@ -387,6 +388,20 @@ sub_netcore7(){ fi } +# NetCore 8 +sub_netcore8(){ + echo "configure netcore 8" + cd $ROOT_DIR + + if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then + if [ "${LINUX_DISTRO}" = "debian" ] || [ "${LINUX_DISTRO}" = "ubuntu" ]; then + wget -O - https://dot.net/v1/dotnet-install.sh | $SUDO_CMD bash -s -- --version 8.0.408 --install-dir /usr/local/bin + elif [ "${LINUX_DISTRO}" = "alpine" ]; then + $SUDO_CMD apk add --no-cache dotnet8-sdk + fi + fi +} + # V8 Repository sub_v8repo(){ echo "configure v8 from repository" @@ -922,6 +937,9 @@ sub_install(){ if [ $INSTALL_NETCORE7 = 1 ]; then sub_netcore7 fi + if [ $INSTALL_NETCORE8 = 1 ]; then + sub_netcore8 + fi if [ $INSTALL_V8 = 1 ]; then sub_v8 fi @@ -1025,6 +1043,10 @@ sub_options(){ echo "netcore 7 selected" INSTALL_NETCORE7=1 fi + if [ "$option" = 'netcore8' ]; then + echo "netcore 8 selected" + INSTALL_NETCORE8=1 + fi if [ "$option" = 'rapidjson' ]; then echo "rapidjson selected" INSTALL_RAPIDJSON=1 @@ -1134,6 +1156,7 @@ sub_help() { echo " netcore2" echo " netcore5" echo " netcore7" + echo " netcore8" echo " rapidjson" echo " v8" echo " v8rep51" diff --git a/tools/metacall-runtime.sh b/tools/metacall-runtime.sh index aea5bab16..9ef4afba2 100755 --- a/tools/metacall-runtime.sh +++ b/tools/metacall-runtime.sh @@ -170,6 +170,15 @@ sub_netcore7(){ sub_apt_install_hold dotnet-runtime-7.0=7.0.5-1 } +# NetCore 8 +sub_netcore8(){ + echo "configure netcore 8" + cd $ROOT_DIR + + # Install NET Core Runtime 8.x + wget -O - https://dot.net/v1/dotnet-install.sh | $SUDO_CMD bash -s -- --version 8.0.408 --install-dir /usr/local/bin --runtime dotnet +} + # V8 sub_v8(){ echo "configure v8" diff --git a/tools/metacall-sanitizer.sh b/tools/metacall-sanitizer.sh index d5f9ac529..9e0856a50 100755 --- a/tools/metacall-sanitizer.sh +++ b/tools/metacall-sanitizer.sh @@ -23,7 +23,7 @@ set -euxo pipefail BUILD_SANITIZER=${1:-address-sanitizer} BUILD_LANGUAGES=( - python ruby netcore7 nodejs typescript file rpc wasm java c cobol rust + python ruby netcore8 nodejs typescript file rpc wasm java c cobol rust ) SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) ROOT_DIR=$(dirname "$SCRIPT_DIR") From 8a1e352601b7153fd5ee9e2b7d1bdce1907a18f2 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 18:20:41 +0200 Subject: [PATCH 244/487] Trying to solve dockerhub. --- .github/workflows/docker-hub.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 718bae74c..91caf530c 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -64,23 +64,24 @@ jobs: - name: Build MetaCall Docker Images env: METACALL_PLATFORM: ${{ matrix.platform }} + DOCKER_BUILDKIT: 1 run: | ./docker-compose.sh platform - - name: Run Tests - run: | + echo + echo "-------------------- Run Tests --------------------" + echo set -exuo pipefail docker image inspect ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli --format='{{.Os}}/{{.Architecture}}' cat <<EOF > Dockerfile.test FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli RUN apt-get update && apt-get install -y file - RUN file /usr/local/bin/metacallcli + RUN file /usr/local/bin/metacallcli && ldd /usr/local/bin/metacallcli RUN echo "console.log('0123456789abcdef')" > script.js RUN metacallcli script.js | tee output.txt RUN grep 0123456789abcdef output.txt EOF - export DOCKER_BUILDKIT=1 docker build --progress=plain --platform=${{ matrix.platform }} -f Dockerfile.test -t test-image . - name: Tag & Push Platform Images From 309414fdaf3687b4a0ff40bb97397042a10ffff5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 18:45:29 +0200 Subject: [PATCH 245/487] Trying buildx in dockerhub. --- .github/workflows/docker-hub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 91caf530c..5e3aeb71b 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -82,7 +82,7 @@ jobs: RUN grep 0123456789abcdef output.txt EOF - docker build --progress=plain --platform=${{ matrix.platform }} -f Dockerfile.test -t test-image . + docker buildx build --progress=plain --platform ${{ matrix.platform }} -f Dockerfile.test -t test-image . - name: Tag & Push Platform Images # Only run when master or when tagging a version From ef5efab583a3c2f0afe7c3087448569f68ee840f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 20:32:31 +0200 Subject: [PATCH 246/487] Improve minor issues rapidjson. --- cmake/InstallRapidJSON.cmake | 2 +- .../source/rapid_json_serial_impl.cpp | 35 ++++++++++++++----- tools/metacall-environment.sh | 4 +-- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/cmake/InstallRapidJSON.cmake b/cmake/InstallRapidJSON.cmake index 41c302027..f90dfc4a4 100644 --- a/cmake/InstallRapidJSON.cmake +++ b/cmake/InstallRapidJSON.cmake @@ -24,7 +24,7 @@ if(NOT RAPIDJSON_FOUND OR USE_BUNDLED_RAPIDJSON) if(NOT RAPIDJSON_VERSION OR USE_BUNDLED_RAPIDJSON) - set(RAPIDJSON_VERSION ab1842a2dae061284c0a62dca1cc6d5e7e37e346) + set(RAPIDJSON_VERSION 24b5e7a8b27f42fa16b96fc70aade9106cf7102f) endif() ExternalProject_Add(rapid-json-depends diff --git a/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp b/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp index 973c06da3..e2e981d7f 100644 --- a/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp +++ b/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp @@ -12,14 +12,27 @@ #include <log/log.h> -// TODO: RapidJSON seems to be outdated, but we use it meanwhile there's a better solution. -// Here's a patch for some of the bugs in the library: https://github.com/Tencent/rapidjson/issues/1928 +/* Disable warnings from RapidJSON */ +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wstrict-overflow" +#elif defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-overflow" +#endif #include <rapidjson/document.h> #include <rapidjson/error/en.h> #include <rapidjson/stringbuffer.h> #include <rapidjson/writer.h> +/* Disable warnings from RapidJSON */ +#if defined(__clang__) + #pragma clang diagnostic pop +#elif defined(__GNUC__) + #pragma GCC diagnostic pop +#endif + #include <sstream> /* -- Type Definitions -- */ @@ -41,7 +54,6 @@ static value rapid_json_serial_impl_deserialize_value(const rapidjson::Value *v) /* -- Classes -- */ -// https://techoverflow.net/2020/01/13/how-to-fix-rapidjson-segmentation-faults-when-building-nested-documents/ rapidjson::MemoryPoolAllocator<> rapid_json_allocator; /* -- Methods -- */ @@ -91,9 +103,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) { short s = value_to_short(v); - int i = (int)s; - - json_v->SetInt(i); + json_v->SetInt((int)s); } else if (id == TYPE_INT) { @@ -105,9 +115,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) { long l = value_to_long(v); - log_write("metacall", LOG_LEVEL_WARNING, "Casting long to int64_t (posible incompatible types) in RapidJSON implementation"); - - json_v->SetInt64(l); + json_v->SetInt64((int64_t)l); } else if (id == TYPE_FLOAT) { @@ -394,6 +402,7 @@ value rapid_json_serial_impl_deserialize_value(const rapidjson::Value *v) { unsigned int ui = v->GetUint(); + /* TODO: Review this, in case of underflow/overflow store it in a bigger type? */ log_write("metacall", LOG_LEVEL_WARNING, "Casting unsigned integer to integer (posible overflow) in RapidJSON implementation"); return value_create_int((int)ui); @@ -402,13 +411,21 @@ value rapid_json_serial_impl_deserialize_value(const rapidjson::Value *v) { int64_t i = v->GetInt64(); + /* TODO: Review this, in case of underflow/overflow store it in a bigger type? */ +#if LONG_MAX < INT64_MAX + log_write("metacall", LOG_LEVEL_WARNING, "Casting long to int (posible overflow) in RapidJSON implementation"); +#endif + return value_create_long((long)i); } else if (v->IsUint64() == true) { uint64_t ui = v->GetUint64(); + /* TODO: Review this, in case of underflow/overflow store it in a bigger type? */ +#if LONG_MAX < UINT64_MAX log_write("metacall", LOG_LEVEL_WARNING, "Casting unsigned long to int (posible overflow) in RapidJSON implementation"); +#endif return value_create_long((long)ui); } diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index fb5ca4761..b24476443 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -250,9 +250,9 @@ sub_rapidjson(){ cd $ROOT_DIR if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then - git clone https://github.com/miloyip/rapidjson.git + git clone https://github.com/Tencent/rapidjson.git cd rapidjson - git checkout ab1842a2dae061284c0a62dca1cc6d5e7e37e346 + git checkout 24b5e7a8b27f42fa16b96fc70aade9106cf7102f mkdir build cd build cmake -DRAPIDJSON_BUILD_DOC=Off -DRAPIDJSON_BUILD_EXAMPLES=Off -DRAPIDJSON_BUILD_TESTS=Off .. From 8b42427b42fdd8bfc551b1a574b17bfb0255ef71 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 20:58:13 +0200 Subject: [PATCH 247/487] Improved the architecture build. --- .github/workflows/docker-hub.yml | 40 ++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 5e3aeb71b..c50d9d3a4 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -19,6 +19,25 @@ env: IMAGE_NAME: core BUILDKIT_VERSION: 0.13.0 + # TODO: Tests failing + # - linux/s390x + # TODO: Not tested or no hooking support + # - linux/mips64le + # - linux/mips64 + # - linux/loong64 + PLATFORM_LIST: > + [ + "linux/amd64", + "linux/amd64/v2" + "linux/amd64/v3" + "linux/386", + "linux/arm64", + "linux/riscv64", + "linux/ppc64le", + "linux/arm/v7", + "linux/arm/v6" + ] + jobs: build: name: Build @@ -26,21 +45,8 @@ jobs: strategy: fail-fast: false matrix: - platform: - - linux/amd64 - - linux/386 - - linux/arm64 - - linux/riscv64 - - linux/ppc64le - - linux/s390x - - linux/arm/v7 - - linux/arm/v6 - # TODO: - # - linux/amd64/v2 - # - linux/amd64/v3 - # - linux/mips64le - # - linux/mips64 - # - linux/loong64 + platform: ${{ fromJSON(env.PLATFORM_LIST) }} + steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -114,7 +120,7 @@ jobs: - name: Create and Push Manifest Lists run: | tags=("deps" "dev" "runtime" "cli") - platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + platforms=("${{ join(fromJSON(env.PLATFORM_LIST), '" "') }}") echo "Create all the tags by platform" @@ -165,7 +171,7 @@ jobs: - name: Remove Platform-Specific Tags run: | tags=("deps" "dev" "runtime" "cli") - platforms=("linux/amd64" "linux/386" "linux/arm64" "linux/riscv64" "linux/ppc64le" "linux/s390x" "linux/arm/v7" "linux/arm/v6") + platforms=("${{ join(fromJSON(env.PLATFORM_LIST), '" "') }}") for tag in "${tags[@]}"; do for platform in "${platforms[@]}"; do From 787220cf122656a9cd72643b217c90d40ca93668 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 21:03:43 +0200 Subject: [PATCH 248/487] Extend timeout of rpc test. --- source/tests/metacall_rpc_test/source/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/tests/metacall_rpc_test/source/test.js b/source/tests/metacall_rpc_test/source/test.js index 42c12bd33..15d5a9dac 100644 --- a/source/tests/metacall_rpc_test/source/test.js +++ b/source/tests/metacall_rpc_test/source/test.js @@ -62,7 +62,7 @@ process.on('uncaughtException', killTest); if (ready === false) { killTest('Timeout reached, server is not ready'); } - }, 10000); + }, 60000); while (ready !== true) { try { From 27b8fdeca5233bcda567f3d840f2e33e41b3dfec Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 21:14:05 +0200 Subject: [PATCH 249/487] Keep trying solving issues with dockerhub. --- .github/workflows/docker-hub.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index c50d9d3a4..7770d93d1 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -39,13 +39,26 @@ env: ] jobs: + generate_matrix: + name: Generate Platform List + runs-on: ubuntu-latest + outputs: + platform_list: ${{ steps.generate_platform_list.outputs.platform_list }} + steps: + - name: Generate platform list + id: generate_platform_list + run: | + echo "PLATFORM_LIST=${{ env.PLATFORM_LIST }}" >> $GITHUB_ENV + echo "::set-output name=platform_list::$PLATFORM_LIST" + build: name: Build runs-on: ubuntu-latest + needs: generate_matrix strategy: fail-fast: false matrix: - platform: ${{ fromJSON(env.PLATFORM_LIST) }} + platform: ${{ fromJSON(needs.generate_matrix.outputs.platform_list) }} steps: - name: Checkout Repository @@ -120,7 +133,7 @@ jobs: - name: Create and Push Manifest Lists run: | tags=("deps" "dev" "runtime" "cli") - platforms=("${{ join(fromJSON(env.PLATFORM_LIST), '" "') }}") + platforms=("${{ join(fromJSON(needs.generate_matrix.outputs.platform_list), '" "') }}") echo "Create all the tags by platform" @@ -171,7 +184,7 @@ jobs: - name: Remove Platform-Specific Tags run: | tags=("deps" "dev" "runtime" "cli") - platforms=("${{ join(fromJSON(env.PLATFORM_LIST), '" "') }}") + platforms=("${{ join(fromJSON(needs.generate_matrix.outputs.platform_list), '" "') }}") for tag in "${tags[@]}"; do for platform in "${platforms[@]}"; do From 549c965b7fc36d86c9f4c2dbdae59c4d7478c914 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 21:18:50 +0200 Subject: [PATCH 250/487] Solve issues dockerhub. --- .github/workflows/docker-hub.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 7770d93d1..ea3b72317 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -48,7 +48,8 @@ jobs: - name: Generate platform list id: generate_platform_list run: | - echo "PLATFORM_LIST=${{ env.PLATFORM_LIST }}" >> $GITHUB_ENV + PLATFORM_LIST=("${{ join(fromJSON(needs.generate_matrix.outputs.platform_list), '" "') }}") + echo "PLATFORM_LIST=$PLATFORM_LIST" >> $GITHUB_ENV echo "::set-output name=platform_list::$PLATFORM_LIST" build: From 71da141aa51a5d70501d0cd3d45abb30c9bb4cfc Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 21:29:41 +0200 Subject: [PATCH 251/487] Try to improve dockerhub. --- .github/workflows/docker-hub.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index ea3b72317..75ba2e654 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -48,7 +48,10 @@ jobs: - name: Generate platform list id: generate_platform_list run: | - PLATFORM_LIST=("${{ join(fromJSON(needs.generate_matrix.outputs.platform_list), '" "') }}") + PLATFORM_STRING=$(cat <<EOF + ${{ env.PLATFORM_LIST }} + ) + PLATFORM_LIST=$(echo "$PLATFORM_STRING" | jq .) echo "PLATFORM_LIST=$PLATFORM_LIST" >> $GITHUB_ENV echo "::set-output name=platform_list::$PLATFORM_LIST" From 4952f19bfd64859d4d8ec37a4c925d10282362a5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 21:32:55 +0200 Subject: [PATCH 252/487] Solve issues dockerhub. --- .github/workflows/docker-hub.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 75ba2e654..c9aa15861 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -48,8 +48,10 @@ jobs: - name: Generate platform list id: generate_platform_list run: | + set -exuo pipefail PLATFORM_STRING=$(cat <<EOF ${{ env.PLATFORM_LIST }} + EOF ) PLATFORM_LIST=$(echo "$PLATFORM_STRING" | jq .) echo "PLATFORM_LIST=$PLATFORM_LIST" >> $GITHUB_ENV From 895a214f359c5a6f5ba6e8febfc9f5bb98018d80 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 21:34:08 +0200 Subject: [PATCH 253/487] Solve more issues dockerhub. --- .github/workflows/docker-hub.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index c9aa15861..68efe6710 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -28,8 +28,8 @@ env: PLATFORM_LIST: > [ "linux/amd64", - "linux/amd64/v2" - "linux/amd64/v3" + "linux/amd64/v2", + "linux/amd64/v3", "linux/386", "linux/arm64", "linux/riscv64", From 95c73c1e058470794ad483dcb34ce5ec073ab8b0 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 21:37:57 +0200 Subject: [PATCH 254/487] Solve issues dockerhub. --- .github/workflows/docker-hub.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 68efe6710..a23d7792e 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -53,7 +53,8 @@ jobs: ${{ env.PLATFORM_LIST }} EOF ) - PLATFORM_LIST=$(echo "$PLATFORM_STRING" | jq .) + # Convert array to comma-separated string with each element quoted + PLATFORM_LIST=$(echo $PLATFORM_STRING | jq -r '[.[] | "\""+tostring+"\""] | join(",")') echo "PLATFORM_LIST=$PLATFORM_LIST" >> $GITHUB_ENV echo "::set-output name=platform_list::$PLATFORM_LIST" From 75af00500e9a7a5ffdc7abfaded874b00106b3cc Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 24 Apr 2025 21:41:35 +0200 Subject: [PATCH 255/487] Dockerhub. --- .github/workflows/docker-hub.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index a23d7792e..dc7f68d9d 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -53,8 +53,7 @@ jobs: ${{ env.PLATFORM_LIST }} EOF ) - # Convert array to comma-separated string with each element quoted - PLATFORM_LIST=$(echo $PLATFORM_STRING | jq -r '[.[] | "\""+tostring+"\""] | join(",")') + PLATFORM_LIST=$(echo $PLATFORM_STRING | jq -c .) echo "PLATFORM_LIST=$PLATFORM_LIST" >> $GITHUB_ENV echo "::set-output name=platform_list::$PLATFORM_LIST" From 4bee75e2570ca116a9888447833cf340c89a25bd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 25 Apr 2025 00:08:15 +0200 Subject: [PATCH 256/487] Test platform. --- .github/workflows/docker-hub.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index dc7f68d9d..885cbe062 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -57,10 +57,23 @@ jobs: echo "PLATFORM_LIST=$PLATFORM_LIST" >> $GITHUB_ENV echo "::set-output name=platform_list::$PLATFORM_LIST" + test_matrix: + name: Test Platform List + runs-on: ubuntu-latest + needs: generate_matrix + steps: + - name: Test platform list + run: | + set -exuo pipefail + platforms=($(echo "${{ needs.generate_matrix.outputs.platform_list }}" | jq -r '.[]')) + for platform in "${platforms[@]}"; do + echo "$platform" + done + build: name: Build runs-on: ubuntu-latest - needs: generate_matrix + needs: test_matrix strategy: fail-fast: false matrix: From 4cc921c5873367a4fba144493ce625ca171557fd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 25 Apr 2025 00:15:21 +0200 Subject: [PATCH 257/487] Test platform. --- .github/workflows/docker-hub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 885cbe062..8fa86e969 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -65,7 +65,7 @@ jobs: - name: Test platform list run: | set -exuo pipefail - platforms=($(echo "${{ needs.generate_matrix.outputs.platform_list }}" | jq -r '.[]')) + platforms=($(echo '${{ needs.generate_matrix.outputs.platform_list }}' | jq -r '.[]')) for platform in "${platforms[@]}"; do echo "$platform" done From 277e5e464bf1cdfe97ac85e25b484f0446514bc9 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 25 Apr 2025 00:20:06 +0200 Subject: [PATCH 258/487] Final version of dockerhub. --- .github/workflows/docker-hub.yml | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 8fa86e969..f5ed9218b 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -57,23 +57,10 @@ jobs: echo "PLATFORM_LIST=$PLATFORM_LIST" >> $GITHUB_ENV echo "::set-output name=platform_list::$PLATFORM_LIST" - test_matrix: - name: Test Platform List - runs-on: ubuntu-latest - needs: generate_matrix - steps: - - name: Test platform list - run: | - set -exuo pipefail - platforms=($(echo '${{ needs.generate_matrix.outputs.platform_list }}' | jq -r '.[]')) - for platform in "${platforms[@]}"; do - echo "$platform" - done - build: name: Build runs-on: ubuntu-latest - needs: test_matrix + needs: generate_matrix strategy: fail-fast: false matrix: @@ -106,9 +93,10 @@ jobs: run: | ./docker-compose.sh platform - echo - echo "-------------------- Run Tests --------------------" - echo + - name: Run Tests + env: + DOCKER_BUILDKIT: 1 + run: | set -exuo pipefail docker image inspect ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli --format='{{.Os}}/{{.Architecture}}' cat <<EOF > Dockerfile.test @@ -152,7 +140,7 @@ jobs: - name: Create and Push Manifest Lists run: | tags=("deps" "dev" "runtime" "cli") - platforms=("${{ join(fromJSON(needs.generate_matrix.outputs.platform_list), '" "') }}") + platforms=($(echo '${{ needs.generate_matrix.outputs.platform_list }}' | jq -r '.[]')) echo "Create all the tags by platform" @@ -203,7 +191,7 @@ jobs: - name: Remove Platform-Specific Tags run: | tags=("deps" "dev" "runtime" "cli") - platforms=("${{ join(fromJSON(needs.generate_matrix.outputs.platform_list), '" "') }}") + platforms=($(echo '${{ needs.generate_matrix.outputs.platform_list }}' | jq -r '.[]')) for tag in "${tags[@]}"; do for platform in "${platforms[@]}"; do From 469c4e481c1ee30e7148fee505a8d4e11802e76f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 25 Apr 2025 00:20:42 +0200 Subject: [PATCH 259/487] Simplify list. --- .github/workflows/docker-hub.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index f5ed9218b..aa40e7ab8 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -27,17 +27,22 @@ env: # - linux/loong64 PLATFORM_LIST: > [ - "linux/amd64", - "linux/amd64/v2", - "linux/amd64/v3", - "linux/386", - "linux/arm64", - "linux/riscv64", - "linux/ppc64le", - "linux/arm/v7", - "linux/arm/v6" + "linux/amd64" ] + + # [ + # "linux/amd64", + # "linux/amd64/v2", + # "linux/amd64/v3", + # "linux/386", + # "linux/arm64", + # "linux/riscv64", + # "linux/ppc64le", + # "linux/arm/v7", + # "linux/arm/v6" + # ] + jobs: generate_matrix: name: Generate Platform List From 5c01e5b2289e9b3f4ac5e4f661d696c312ceebf8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 25 Apr 2025 00:36:57 +0200 Subject: [PATCH 260/487] Testing dockerhub. --- .github/workflows/docker-hub.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index aa40e7ab8..c52e9053b 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -44,7 +44,7 @@ env: # ] jobs: - generate_matrix: + matrix: name: Generate Platform List runs-on: ubuntu-latest outputs: @@ -65,11 +65,11 @@ jobs: build: name: Build runs-on: ubuntu-latest - needs: generate_matrix + needs: matrix strategy: fail-fast: false matrix: - platform: ${{ fromJSON(needs.generate_matrix.outputs.platform_list) }} + platform: ${{ fromJSON(needs.matrix.outputs.platform_list) }} steps: - name: Checkout Repository @@ -131,7 +131,7 @@ jobs: manifest: name: Create and Push Manifest Lists - needs: build + needs: [matrix, build] # Only run when master or when tagging a version if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' runs-on: ubuntu-latest @@ -144,8 +144,10 @@ jobs: - name: Create and Push Manifest Lists run: | + set -exuo pipefail + tags=("deps" "dev" "runtime" "cli") - platforms=($(echo '${{ needs.generate_matrix.outputs.platform_list }}' | jq -r '.[]')) + platforms=($(echo '${{ needs.matrix.outputs.platform_list }}' | jq -r '.[]')) echo "Create all the tags by platform" @@ -189,14 +191,16 @@ jobs: cleanup: name: Cleanup Platform Specific Tags - needs: [build, manifest] + needs: [matrix, build, manifest] runs-on: ubuntu-latest if: always() steps: - name: Remove Platform-Specific Tags run: | + set -exuo pipefail + tags=("deps" "dev" "runtime" "cli") - platforms=($(echo '${{ needs.generate_matrix.outputs.platform_list }}' | jq -r '.[]')) + platforms=($(echo '${{ needs.matrix.outputs.platform_list }}' | jq -r '.[]')) for tag in "${tags[@]}"; do for platform in "${platforms[@]}"; do From 3b370c6ffb42a2be20f41b2ab6f738028d69c623 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 25 Apr 2025 00:58:15 +0200 Subject: [PATCH 261/487] Finished docker hub CI, remove warning from node loader. --- .github/workflows/docker-hub.yml | 23 ++++++++----------- .../node_loader/source/node_loader_impl.cpp | 23 +++++++++++++++++++ 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index c52e9053b..2cbe1634d 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -27,22 +27,17 @@ env: # - linux/loong64 PLATFORM_LIST: > [ - "linux/amd64" + "linux/amd64", + "linux/amd64/v2", + "linux/amd64/v3", + "linux/386", + "linux/arm64", + "linux/riscv64", + "linux/ppc64le", + "linux/arm/v7", + "linux/arm/v6" ] - - # [ - # "linux/amd64", - # "linux/amd64/v2", - # "linux/amd64/v3", - # "linux/386", - # "linux/arm64", - # "linux/riscv64", - # "linux/ppc64le", - # "linux/arm/v7", - # "linux/arm/v6" - # ] - jobs: matrix: name: Generate Platform List diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index adda1440f..8b3b45ad1 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -919,11 +919,34 @@ static detour_handle node_module_handle_a_handle = NULL; void node_loader_impl_register_linked_bindings() { + /* + * For now napi_module_register won't be deprecated: https://github.com/nodejs/node/issues/56153 + * If this changes, we can investigate the alternative approach. + */ +#if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable : 4996) +#elif defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#elif defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + /* Initialize Node Loader Trampoline */ node_loader_impl_register_module("node_loader_trampoline_module", node_loader_trampoline_initialize); /* Initialize Node Loader Port */ node_loader_impl_register_module("node_loader_port_module", node_loader_port_initialize); + +#if defined(_MSC_VER) + #pragma warning(pop) +#elif defined(__clang__) + #pragma clang diagnostic pop +#elif defined(__GNUC__) + #pragma GCC diagnostic pop +#endif } void node_loader_impl_exception(napi_env env, napi_status status) From e804bef14c6f9398e3d2b4fb7fc04888514211f5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 25 Apr 2025 01:15:42 +0200 Subject: [PATCH 262/487] Solve issues with macos. --- source/tests/dynlink_test/CMakeLists.txt | 12 ++ .../dynlink_test/source/dynlink_test.cpp | 152 +++++++++--------- 2 files changed, 90 insertions(+), 74 deletions(-) diff --git a/source/tests/dynlink_test/CMakeLists.txt b/source/tests/dynlink_test/CMakeLists.txt index 1010f0fb9..ae0eabeee 100644 --- a/source/tests/dynlink_test/CMakeLists.txt +++ b/source/tests/dynlink_test/CMakeLists.txt @@ -97,6 +97,8 @@ target_link_libraries(${target} target_compile_definitions(${target} PRIVATE ${DEFAULT_COMPILE_DEFINITIONS} + + $<$<AND:$<BOOL:${OPTION_BUILD_LOADERS}>,$<BOOL:${OPTION_BUILD_LOADERS_MOCK}>>:DYNLINK_TEST_MOCK_LOADER> ) # @@ -137,6 +139,16 @@ add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> ) +# +# Define dependencies +# + +if(OPTION_BUILD_LOADERS AND OPTION_BUILD_LOADERS_MOCK) + add_dependencies(${target} + mock_loader + ) +endif() + # # Define test labels # diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index e506c69fa..1ebd63613 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -28,7 +28,7 @@ #define DYNLINK_TEST_LIBRARY_PATH "DYNLINK_TEST_LIBRARY_PATH" -typedef const char *(*dynlink_print_func)(void); +typedef const char *(*mock_loader_print_func)(void); class dynlink_test : public testing::Test { @@ -60,52 +60,6 @@ TEST_F(dynlink_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object extension: %s", dynlink_extension()); -#if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - const char library_name[] = "dynlinkd"; -#else - const char library_name[] = "dynlink"; -#endif - - char *path = environment_variable_path_create(DYNLINK_TEST_LIBRARY_PATH, NULL, 0, NULL); - - ASSERT_NE((char *)path, (char *)NULL); - - /* Test library loading */ - { - dynlink handle = dynlink_load(path, library_name, DYNLINK_FLAGS_BIND_NOW | DYNLINK_FLAGS_BIND_GLOBAL); - - ASSERT_NE(handle, (dynlink)NULL); - - log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_path(handle)); - - EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); - - if (handle != NULL) - { - dynlink_symbol_addr dynlink_print_info_addr; - - EXPECT_EQ((int)0, dynlink_symbol(handle, "dynlink_print_info", &dynlink_print_info_addr)); - - if (dynlink_print_info_addr != NULL) - { - dynlink_print_func print = (dynlink_print_func)dynlink_print_info_addr; - - log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); - - log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)dynlink_print_info_addr); - - if (dynlink_print_info_addr != NULL) - { - log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); - } - - log_write("metacall", LOG_LEVEL_DEBUG, "Print: %s", print()); - } - - dynlink_unload(handle); - } - } - /* Test loading symbols from current process */ { dynlink proc = dynlink_load_self(DYNLINK_FLAGS_BIND_GLOBAL | DYNLINK_FLAGS_BIND_LAZY); @@ -127,51 +81,101 @@ TEST_F(dynlink_test, DefaultConstructor) dynlink_unload(proc); /* Should do nothing except by freeing the handle */ } - /* Test loading symbols from absolute path */ +#ifdef DYNLINK_TEST_MOCK_LOADER { - char library_name_platform[PORTABILITY_PATH_SIZE]; - char absolute_path[PORTABILITY_PATH_SIZE]; + #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) + const char library_name[] = "mock_loaderd"; + #else + const char library_name[] = "mock_loader"; + #endif - dynlink_platform_name(library_name, library_name_platform); + char *path = environment_variable_path_create(DYNLINK_TEST_LIBRARY_PATH, NULL, 0, NULL); - portability_path_join(path, strlen(path) + 1, library_name_platform, strlen(library_name_platform) + 1, absolute_path, PORTABILITY_PATH_SIZE); + ASSERT_NE((char *)path, (char *)NULL); - dynlink handle = dynlink_load_absolute(absolute_path, DYNLINK_FLAGS_BIND_NOW | DYNLINK_FLAGS_BIND_GLOBAL); + /* Test library loading */ + { + dynlink handle = dynlink_load(path, library_name, DYNLINK_FLAGS_BIND_NOW | DYNLINK_FLAGS_BIND_GLOBAL); - ASSERT_NE(handle, (dynlink)NULL); + ASSERT_NE(handle, (dynlink)NULL); - log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object absolute path: %s", absolute_path); - log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file name: %s", dynlink_get_path(handle)); - log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_name(handle)); + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_path(handle)); - EXPECT_EQ((int)0, (int)strcmp(absolute_path, dynlink_get_path(handle))); - EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); + EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); - if (handle != NULL) + if (handle != NULL) + { + dynlink_symbol_addr mock_loader_print_info_addr; + + EXPECT_EQ((int)0, dynlink_symbol(handle, "mock_loader_print_info", &mock_loader_print_info_addr)); + + if (mock_loader_print_info_addr != NULL) + { + mock_loader_print_func print = (mock_loader_print_func)mock_loader_print_info_addr; + + log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); + + log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)mock_loader_print_info_addr); + + if (mock_loader_print_info_addr != NULL) + { + log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); + } + + log_write("metacall", LOG_LEVEL_DEBUG, "Print: %s", print()); + } + + dynlink_unload(handle); + } + } + + /* Test loading symbols from absolute path */ { - dynlink_symbol_addr dynlink_print_info_addr; + char library_name_platform[PORTABILITY_PATH_SIZE]; + char absolute_path[PORTABILITY_PATH_SIZE]; - EXPECT_EQ((int)0, dynlink_symbol(handle, "dynlink_print_info", &dynlink_print_info_addr)); + dynlink_platform_name(library_name, library_name_platform); - if (dynlink_print_info_addr != NULL) - { - dynlink_print_func print = (dynlink_print_func)dynlink_print_info_addr; + portability_path_join(path, strlen(path) + 1, library_name_platform, strlen(library_name_platform) + 1, absolute_path, PORTABILITY_PATH_SIZE); - log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); + dynlink handle = dynlink_load_absolute(absolute_path, DYNLINK_FLAGS_BIND_NOW | DYNLINK_FLAGS_BIND_GLOBAL); - log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)dynlink_print_info_addr); + ASSERT_NE(handle, (dynlink)NULL); - if (dynlink_print_info_addr != NULL) + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object absolute path: %s", absolute_path); + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file name: %s", dynlink_get_path(handle)); + log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_name(handle)); + + EXPECT_EQ((int)0, (int)strcmp(absolute_path, dynlink_get_path(handle))); + EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); + + if (handle != NULL) + { + dynlink_symbol_addr mock_loader_print_info_addr; + + EXPECT_EQ((int)0, dynlink_symbol(handle, "mock_loader_print_info", &mock_loader_print_info_addr)); + + if (mock_loader_print_info_addr != NULL) { - log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); + mock_loader_print_func print = (mock_loader_print_func)mock_loader_print_info_addr; + + log_write("metacall", LOG_LEVEL_DEBUG, "Print function: %p", (void *)print); + + log_write("metacall", LOG_LEVEL_DEBUG, "Symbol pointer: %p", (void *)mock_loader_print_info_addr); + + if (mock_loader_print_info_addr != NULL) + { + log_write("metacall", LOG_LEVEL_DEBUG, "Pointer is valid"); + } + + log_write("metacall", LOG_LEVEL_DEBUG, "Print: %s", print()); } - log_write("metacall", LOG_LEVEL_DEBUG, "Print: %s", print()); + dynlink_unload(handle); } - - dynlink_unload(handle); } - } - environment_variable_path_destroy(path); + environment_variable_path_destroy(path); + } +#endif } From cb8429fc559e4a028441f7865bee0ed5e7e899ab Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 25 Apr 2025 17:21:31 +0200 Subject: [PATCH 263/487] Solved warnings, trying to mto make windows work. --- cmake/Warnings.cmake | 5 +- source/adt/source/adt_map.c | 8 +- source/adt/source/adt_set.c | 8 +- source/dynlink/source/dynlink.c | 2 +- source/loader/source/loader_host.c | 6 +- source/loader/source/loader_impl.c | 4 +- source/loaders/node_loader/CMakeLists.txt | 6 +- .../node_loader/source/node_loader_impl.cpp | 4 +- source/plugin/source/plugin_manager.c | 6 +- source/portability/CMakeLists.txt | 2 - .../portability/portability_dependency.h | 44 ---- .../portability/portability_library_path.h | 25 ++- .../source/portability_dependency.c | 135 ------------ .../source/portability_library_path.c | 194 +++++++++++++----- source/reflect/source/reflect_scope.c | 8 +- 15 files changed, 192 insertions(+), 265 deletions(-) delete mode 100644 source/portability/include/portability/portability_dependency.h delete mode 100644 source/portability/source/portability_dependency.c diff --git a/cmake/Warnings.cmake b/cmake/Warnings.cmake index 685d3b6a8..23f057afd 100644 --- a/cmake/Warnings.cmake +++ b/cmake/Warnings.cmake @@ -46,6 +46,7 @@ if(WARNINGS_ENABLED) # Define C compiler warning flags if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") + # TODO: Uncomment the rest of the warnings, enable Weverything for clang add_compile_options(-Wall) add_compile_options(-Wextra) add_compile_options(-Wunused) @@ -85,7 +86,7 @@ if(WARNINGS_ENABLED) string(REPLACE "/W1" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REPLACE "/W2" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REPLACE "/W3" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /Wall") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") # /Wall set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CTR_NONSTDC_NO_WARNINGS=1") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CTR_SECURE_NO_WARNINGS=1") set(WARNINGS_C_AVAILABLE 1) @@ -105,7 +106,7 @@ if(WARNINGS_ENABLED) string(REPLACE "/W1" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "/W2" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") # /Wall set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _CTR_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _CTR_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _CTR_NONSTDC_NO_WARNINGS=1") diff --git a/source/adt/source/adt_map.c b/source/adt/source/adt_map.c index 9f54b623f..4f28a10cb 100644 --- a/source/adt/source/adt_map.c +++ b/source/adt/source/adt_map.c @@ -239,9 +239,9 @@ vector map_get(map m, map_key key) { if (m != NULL && key != NULL) { - map_hash hash = m->hash_cb(key); + map_hash h = m->hash_cb(key); - size_t index = hash % m->capacity; + size_t index = h % m->capacity; bucket b = &m->buckets[index]; @@ -255,9 +255,9 @@ int map_contains(map m, map_key key) { if (m != NULL && key != NULL) { - map_hash hash = m->hash_cb(key); + map_hash h = m->hash_cb(key); - size_t index = hash % m->capacity; + size_t index = h % m->capacity; bucket b = &m->buckets[index]; diff --git a/source/adt/source/adt_set.c b/source/adt/source/adt_set.c index d7f38ea95..e54b8faee 100644 --- a/source/adt/source/adt_set.c +++ b/source/adt/source/adt_set.c @@ -256,9 +256,9 @@ set_value set_get(set s, set_key key) { if (s != NULL && key != NULL) { - set_hash hash = s->hash_cb(key); + set_hash h = s->hash_cb(key); - size_t index = hash % s->capacity; + size_t index = h % s->capacity; bucket b = &s->buckets[index]; @@ -277,9 +277,9 @@ int set_contains(set s, set_key key) { if (s != NULL && key != NULL) { - set_hash hash = s->hash_cb(key); + set_hash h = s->hash_cb(key); - size_t index = hash % s->capacity; + size_t index = h % s->capacity; bucket b = &s->buckets[index]; diff --git a/source/dynlink/source/dynlink.c b/source/dynlink/source/dynlink.c index 580cef521..216c18d37 100644 --- a/source/dynlink/source/dynlink.c +++ b/source/dynlink/source/dynlink.c @@ -240,7 +240,7 @@ int dynlink_library_path(const char *name, dynlink_path path, size_t *length) dynlink_impl_get_name(name, name_impl, PORTABILITY_PATH_SIZE); - if (portability_library_path(name_impl, path, length) != 0) + if (portability_library_path_find(name_impl, path, length) != 0) { return 1; } diff --git a/source/loader/source/loader_host.c b/source/loader/source/loader_host.c index 440e3d36a..7ddfb65a4 100644 --- a/source/loader/source/loader_host.c +++ b/source/loader/source/loader_host.c @@ -44,7 +44,7 @@ union loader_host_invoke_cast static value function_host_interface_invoke(function func, function_impl func_impl, function_args args, size_t size); -static function_return function_host_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context); +static function_return function_host_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *ctx); static function_interface function_host_singleton(void); @@ -64,7 +64,7 @@ function_return function_host_interface_invoke(function func, function_impl func return invoke_cast.fn(size, args, data); } -function_return function_host_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *context) +function_return function_host_interface_await(function func, function_impl impl, function_args args, size_t size, function_resolve_callback resolve_callback, function_reject_callback reject_callback, void *ctx) { /* TODO */ @@ -74,7 +74,7 @@ function_return function_host_interface_await(function func, function_impl impl, (void)size; (void)resolve_callback; (void)reject_callback; - (void)context; + (void)ctx; return NULL; } diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 0221b4a5e..b08444d2c 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -36,7 +36,7 @@ #include <configuration/configuration.h> -#include <portability/portability_dependency.h> +#include <portability/portability_library_path.h> #include <stdlib.h> #include <string.h> @@ -457,7 +457,7 @@ int loader_impl_dependencies(loader_impl impl, detour d) return 1; } - if (portability_dependendency_iterate(&loader_impl_dependencies_self_list, (void *)dependencies_self) != 0) + if (portability_library_path_list(&loader_impl_dependencies_self_list, (void *)dependencies_self) != 0) { vector_destroy(dependencies_self); return 1; diff --git a/source/loaders/node_loader/CMakeLists.txt b/source/loaders/node_loader/CMakeLists.txt index 746b684ad..e76ed66f5 100644 --- a/source/loaders/node_loader/CMakeLists.txt +++ b/source/loaders/node_loader/CMakeLists.txt @@ -178,9 +178,9 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - # Delay load for MSVC - $<$<CXX_COMPILER_ID:MSVC>:libnode2> - $<$<CXX_COMPILER_ID:MSVC>:delayimp> + # Delay load for MSVC + $<$<CXX_COMPILER_ID:MSVC>:${NodeJS_LIBRARY}> # NodeJS library + $<$<CXX_COMPILER_ID:MSVC>:delayimp> PUBLIC ${DEFAULT_LIBRARIES} diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 8b3b45ad1..3cdae12ad 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -49,7 +49,7 @@ extern char **environ; #include <node_loader/node_loader_trampoline.h> #if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1200) - #include <node_loader/node_loader_win32_delay_load.h> + #include <detour/detour.h> /* Required for the DelayLoad hook interposition, solves bug of NodeJS extensions requiring node.exe instead of node.dll*/ #include <intrin.h> @@ -3701,7 +3701,7 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi /* As the library handle is correctly resolved here, either to executable, library of the executable, or the loader dependency we can directly obtain the handle of this dependency from a function pointer, use any function that is contained in node runtime, in this case we are using napi_create_array */ - if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, &napi_create_array, &node_loader_node_dll_handle)) + if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)&napi_create_array, &node_loader_node_dll_handle)) { napi_throw_type_error(env, nullptr, "Failed to initialize the hooking against node extensions load mechanism"); } diff --git a/source/plugin/source/plugin_manager.c b/source/plugin/source/plugin_manager.c index d0f92a36a..8f7f615a0 100644 --- a/source/plugin/source/plugin_manager.c +++ b/source/plugin/source/plugin_manager.c @@ -105,9 +105,9 @@ int plugin_manager_initialize(plugin_manager manager, const char *name, const ch /* Initialize the library path */ if (manager->library_path == NULL) { - const char name[] = "metacall" + const char library_name[] = "metacall" #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - "d" + "d" #endif ; @@ -119,7 +119,7 @@ int plugin_manager_initialize(plugin_manager manager, const char *name, const ch * 2) Dynamic link library path of the host library * 3) Default compile time path */ - if (dynlink_library_path(name, path, &length) == 0) + if (dynlink_library_path(library_name, path, &length) == 0) { default_library_path = path; } diff --git a/source/portability/CMakeLists.txt b/source/portability/CMakeLists.txt index b6baba4a8..1855258d2 100644 --- a/source/portability/CMakeLists.txt +++ b/source/portability/CMakeLists.txt @@ -41,7 +41,6 @@ set(headers ${include_path}/portability_working_path.h ${include_path}/portability_path.h ${include_path}/portability_atexit.h - ${include_path}/portability_dependency.h ) set(sources @@ -51,7 +50,6 @@ set(sources ${source_path}/portability_working_path.c ${source_path}/portability_path.c ${source_path}/portability_atexit.c - ${source_path}/portability_dependency.c ) # Group source files diff --git a/source/portability/include/portability/portability_dependency.h b/source/portability/include/portability/portability_dependency.h deleted file mode 100644 index 2fbf4cce2..000000000 --- a/source/portability/include/portability/portability_dependency.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Portability Library by Parra Studios - * A generic cross-platform portability utility. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef PORTABILITY_DEPENDENCY_H -#define PORTABILITY_DEPENDENCY_H 1 - -/* -- Headers -- */ - -#include <portability/portability_api.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* -- Type Definitions -- */ - -typedef int (*portability_dependendency_iterate_cb)(const char *library, void *data); - -/* -- Methods -- */ - -int portability_dependendency_iterate(portability_dependendency_iterate_cb callback, void *data); - -#ifdef __cplusplus -} -#endif - -#endif /* PORTABILITY_DEPENDENCY_H */ diff --git a/source/portability/include/portability/portability_library_path.h b/source/portability/include/portability/portability_library_path.h index 5e266a5a3..5daee5b8d 100644 --- a/source/portability/include/portability/portability_library_path.h +++ b/source/portability/include/portability/portability_library_path.h @@ -27,13 +27,15 @@ #include <portability/portability_path.h> +#ifdef __cplusplus +extern "C" { +#endif + /* -- Type Definitions -- */ typedef char portability_library_path_str[PORTABILITY_PATH_SIZE]; -#ifdef __cplusplus -extern "C" { -#endif +typedef int (*portability_library_path_list_cb)(const char *library, void *data); /* -- Methods -- */ @@ -53,7 +55,22 @@ extern "C" { * @return * Returns zero if it could find the path, different from zero if not found */ -PORTABILITY_API int portability_library_path(const char name[], portability_library_path_str path, size_t *length); +PORTABILITY_API int portability_library_path_find(const char name[], portability_library_path_str path, size_t *length); + +/** +* @brief +* List all the libraries loaded in the current process +* +* @param[in] callback +* Function pointer that will be called for each library loaded in the process +* +* @param[inout] data +* User defined data to pass to the callback +* +* @return +* Returns zero if it there is no error, different from zero on error +*/ +PORTABILITY_API int portability_library_path_list(portability_library_path_list_cb callback, void *data); #ifdef __cplusplus } diff --git a/source/portability/source/portability_dependency.c b/source/portability/source/portability_dependency.c deleted file mode 100644 index 55e633de4..000000000 --- a/source/portability/source/portability_dependency.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * MetaCall Library by Parra Studios - * A library for providing a foreign function interface calls. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/* -- Headers -- */ - -#include <portability/portability_dependency.h> - -#include <stddef.h> - -#if defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ - defined(__FreeBSD__) - - #ifndef _GNU_SOURCE - #define _GNU_SOURCE - #endif - #include <link.h> - -#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) - - #include <mach-o/dyld.h> - -#elif defined(WIN32) || defined(_WIN32) - - #include <psapi.h> - #include <windows.h> - -#else - #error "Unsupported platform for portability_dependendency_iterate" -#endif - -#if defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ - defined(__FreeBSD__) - -/* -- Type Definitions -- */ - -typedef struct portability_dependendency_iterate_phdr_type *portability_dependendency_iterate_phdr; - -/* -- Member Data -- */ - -struct portability_dependendency_iterate_phdr_type -{ - portability_dependendency_iterate_cb callback; - void *data; -}; - -/* -- Private Methods -- */ - -static int portability_dependendency_iterate_phdr_callback(struct dl_phdr_info *info, size_t size, void *data) -{ - portability_dependendency_iterate_phdr phdr = (portability_dependendency_iterate_phdr)data; - - (void)size; - - return phdr->callback(info->dlpi_name, phdr->data); -} - -#endif - -int portability_dependendency_iterate(portability_dependendency_iterate_cb callback, void *data) -{ - if (callback == NULL) - { - return 1; - } - -#if defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ - defined(__FreeBSD__) - { - struct portability_dependendency_iterate_phdr_type phdr = { - callback, - data - }; - - return dl_iterate_phdr(&portability_dependendency_iterate_phdr_callback, (void *)&phdr); - } -#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) - { - uint32_t iterator, size = _dyld_image_count(); - - for (iterator = 0; iterator < size; ++iterator) - { - const char *image_name = _dyld_get_image_name(iterator); - - if (callback(image_name, data) != 0) - { - return 1; - } - } - - return 0; - } -#elif defined(WIN32) || defined(_WIN32) - { - HANDLE process = GetCurrentProcess(); - HMODULE modules[1024]; - DWORD modules_size; - - if (EnumProcessModules(process, modules, sizeof(modules), &modules_size)) - { - size_t iterator, size = modules_size / sizeof(HMODULE); - char module_name[MAX_PATH]; - - for (iterator = 0; i < size; ++iterator) - { - if (GetModuleFileNameExA(process, modules[iterator], module_name, sizeof(module_name) / sizeof(char))) - { - if (callback(module_name, data) != 0) - { - return 1; - } - } - } - } - - return 0; - } -#endif -} diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index 8bf167036..10e3ad64b 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -20,14 +20,14 @@ #include <portability/portability_library_path.h> +#include <stddef.h> #include <string.h> -#define PORTABILITY_LIBRARY_PATH_SIZE (sizeof(portability_library_path_str) / sizeof(char)) - static int portability_library_path_ends_with(const char path[], const char name[]); #if defined(unix) || defined(__unix__) || defined(__unix) || \ - defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) + defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ + defined(__FreeBSD__) #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -38,48 +38,20 @@ static int portability_library_path_ends_with(const char path[], const char name #include <link.h> -struct phdr_callback_type -{ - const char *name; - char *path; - size_t length; -}; - -static int portability_library_path_phdr_callback(struct dl_phdr_info *info, size_t size, void *data) -{ - struct phdr_callback_type *cb = (struct phdr_callback_type *)data; - - (void)size; - - if (portability_library_path_ends_with(info->dlpi_name, cb->name) == 0) - { - cb->length = strnlen(info->dlpi_name, PORTABILITY_LIBRARY_PATH_SIZE); - - if (cb->length >= PORTABILITY_LIBRARY_PATH_SIZE) - { - return 2; - } - - memcpy(cb->path, info->dlpi_name, sizeof(char) * (cb->length + 1)); - - return 1; - } +#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) - return 0; -} + #include <mach-o/dyld.h> #elif defined(WIN32) || defined(_WIN32) || \ defined(__CYGWIN__) || defined(__CYGWIN32__) || \ defined(__MINGW32__) || defined(__MINGW64__) #define WIN32_LEAN_AND_MEAN - #include <psapi.h> #include <windows.h> + #include <psapi.h> -#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) - - #include <mach-o/dyld.h> - +#else + #error "Unsupported platform for portability_library_path" #endif int portability_library_path_ends_with(const char path[], const char name[]) @@ -95,18 +67,74 @@ int portability_library_path_ends_with(const char path[], const char name[]) return !(name_length <= path_length && strncmp(path + path_length - name_length, name, name_length) == 0); } -int portability_library_path(const char name[], portability_library_path_str path, size_t *length) +#if defined(unix) || defined(__unix__) || defined(__unix) || \ + defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ + defined(__FreeBSD__) + +/* -- Type Definitions -- */ + +typedef struct portability_library_path_find_phdr_type *portability_library_path_find_phdr; +typedef struct portability_library_path_list_phdr_type *portability_library_path_list_phdr; + +/* -- Member Data -- */ + +struct portability_library_path_find_phdr_type +{ + const char *name; + char *path; + size_t length; +}; + +struct portability_library_path_list_phdr_type +{ + portability_library_path_list_cb callback; + void *data; +}; + +/* -- Private Methods -- */ + +static int portability_library_path_find_phdr_callback(struct dl_phdr_info *info, size_t size, void *data) +{ + portability_library_path_find_phdr find_phdr = (portability_library_path_find_phdr)data; + + (void)size; + + if (portability_library_path_ends_with(info->dlpi_name, find_phdr->name) == 0) + { + find_phdr->length = strnlen(info->dlpi_name, PORTABILITY_PATH_SIZE); + + memcpy(find_phdr->path, info->dlpi_name, sizeof(char) * (find_phdr->length + 1)); + + return 1; + } + + return 0; +} + +static int portability_library_path_list_phdr_callback(struct dl_phdr_info *info, size_t size, void *data) +{ + portability_library_path_list_phdr list_phdr = (portability_library_path_list_phdr)data; + + (void)size; + + return list_phdr->callback(info->dlpi_name, list_phdr->data); +} + +#endif + +int portability_library_path_find(const char name[], portability_library_path_str path, size_t *length) { #if defined(unix) || defined(__unix__) || defined(__unix) || \ - defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) + defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ + defined(__FreeBSD__) - struct phdr_callback_type data = { + struct portability_library_path_find_phdr_type data = { name, path, 0 }; - if (dl_iterate_phdr(&portability_library_path_phdr_callback, (void *)&data) != 1) + if (dl_iterate_phdr(&portability_library_path_find_phdr_callback, (void *)&data) != 1) { return 1; } @@ -124,21 +152,21 @@ int portability_library_path(const char name[], portability_library_path_str pat HMODULE handle_modules[1024]; HANDLE handle_process = GetCurrentProcess(); - DWORD cb_needed; + DWORD modules_size; - if (EnumProcessModules(handle_process, handle_modules, sizeof(handle_modules), &cb_needed)) + if (EnumProcessModules(handle_process, handle_modules, sizeof(handle_modules), &modules_size)) { - size_t iterator; + size_t iterator, size = modules_size / sizeof(HMODULE); - for (iterator = 0; iterator < (cb_needed / sizeof(HMODULE)); ++iterator) + for (iterator = 0; iterator < size; ++iterator) { - if (GetModuleFileNameEx(handle_process, handle_modules[iterator], path, PORTABILITY_LIBRARY_PATH_SIZE)) + if (GetModuleFileNameEx(handle_process, handle_modules[iterator], path, PORTABILITY_PATH_SIZE)) { if (portability_library_path_ends_with(path, name) == 0) { if (length != NULL) { - *length = strnlen(path, PORTABILITY_LIBRARY_PATH_SIZE); + *length = strnlen(path, PORTABILITY_PATH_SIZE); } return 0; @@ -153,10 +181,10 @@ int portability_library_path(const char name[], portability_library_path_str pat static const char dylib_suffix[] = "dylib"; uint32_t image_index, size = _dyld_image_count(); - size_t name_length = strnlen(name, PORTABILITY_LIBRARY_PATH_SIZE); + size_t name_length = strnlen(name, PORTABILITY_PATH_SIZE); size_t name_dylib_length = name_length + 3; - if (portability_library_path_ends_with(name, "so") == 0 && name_dylib_length < PORTABILITY_LIBRARY_PATH_SIZE) + if (portability_library_path_ends_with(name, "so") == 0 && name_dylib_length < PORTABILITY_PATH_SIZE) { memcpy(path, name, sizeof(char) * (name_length - 2)); memcpy(path, dylib_suffix, sizeof(dylib_suffix)); @@ -168,9 +196,9 @@ int portability_library_path(const char name[], portability_library_path_str pat if (portability_library_path_ends_with(image_name, path) == 0) { - size_t image_length = strnlen(image_name, PORTABILITY_LIBRARY_PATH_SIZE); + size_t image_length = strnlen(image_name, PORTABILITY_PATH_SIZE); - if (image_length >= PORTABILITY_LIBRARY_PATH_SIZE) + if (image_length >= PORTABILITY_PATH_SIZE) { return 1; } @@ -189,7 +217,69 @@ int portability_library_path(const char name[], portability_library_path_str pat return 1; #else - /* Not supported */ - return 1; + #error "Unsupported platform for portability_library_path" +#endif +} + +int portability_library_path_list(portability_library_path_list_cb callback, void *data) +{ + if (callback == NULL) + { + return 1; + } + +#if defined(linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux) || \ + defined(__FreeBSD__) + { + struct portability_library_path_list_phdr_type list_phdr = { + callback, + data + }; + + return dl_iterate_phdr(&portability_library_path_list_phdr_callback, (void *)&list_phdr); + } +#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__MACOSX__) + { + uint32_t iterator, size = _dyld_image_count(); + + for (iterator = 0; iterator < size; ++iterator) + { + const char *image_name = _dyld_get_image_name(iterator); + + if (callback(image_name, data) != 0) + { + return 1; + } + } + + return 0; + } +#elif defined(WIN32) || defined(_WIN32) + { + HANDLE process = GetCurrentProcess(); + HMODULE modules[1024]; + DWORD modules_size; + + if (EnumProcessModules(process, modules, sizeof(modules), &modules_size)) + { + size_t iterator, size = modules_size / sizeof(HMODULE); + char module_name[MAX_PATH]; + + for (iterator = 0; iterator < size; ++iterator) + { + if (GetModuleFileNameExA(process, modules[iterator], module_name, sizeof(module_name) / sizeof(char))) + { + if (callback(module_name, data) != 0) + { + return 1; + } + } + } + } + + return 0; + } +#else + #error "Unsupported platform for portability_library_path" #endif } diff --git a/source/reflect/source/reflect_scope.c b/source/reflect/source/reflect_scope.c index a8fbe4944..3942bb8ee 100644 --- a/source/reflect/source/reflect_scope.c +++ b/source/reflect/source/reflect_scope.c @@ -200,17 +200,17 @@ int scope_metadata_array_cb_iterate(set s, set_key key, set_value val, set_cb_it (void)s; (void)key; - int type_id = value_type_id(val); + type_id id = value_type_id(val); - if (type_id == TYPE_FUNCTION) + if (id == TYPE_FUNCTION) { metadata_iterator->functions[metadata_iterator->functions_size++] = function_metadata(value_to_function(val)); } - else if (type_id == TYPE_CLASS) + else if (id == TYPE_CLASS) { metadata_iterator->classes[metadata_iterator->classes_size++] = class_metadata(value_to_class(val)); } - else if (type_id == TYPE_OBJECT) + else if (id == TYPE_OBJECT) { metadata_iterator->objects[metadata_iterator->objects_size++] = object_metadata(value_to_object(val)); } From 94d33827a623f699191466a942873e1174bf0c80 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 5 May 2025 22:35:24 +0200 Subject: [PATCH 264/487] Solve issues in detours and node loader for windows. --- source/detour/include/detour/detour.h | 4 ++-- source/loaders/node_loader/source/node_loader_impl.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/detour/include/detour/detour.h b/source/detour/include/detour/detour.h index fd0cc20a1..9eb8d50fc 100644 --- a/source/detour/include/detour/detour.h +++ b/source/detour/include/detour/detour.h @@ -158,7 +158,7 @@ DETOUR_API int detour_enumerate(detour d, detour_handle handle, unsigned int *po * Return zero if success, different from zero otherwise * */ -int detour_replace(detour d, detour_handle handle, const char *function_name, void (*function_addr)(void), void (**function_trampoline)(void)); +DETOUR_API int detour_replace(detour d, detour_handle handle, const char *function_name, void (*function_addr)(void), void (**function_trampoline)(void)); /** * @brief @@ -171,7 +171,7 @@ int detour_replace(detour d, detour_handle handle, const char *function_name, vo * Reference to the detour handle * */ -void detour_unload(detour d, detour_handle handle); +DETOUR_API void detour_unload(detour d, detour_handle handle); /** * @brief diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 3cdae12ad..1192a4b65 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -4069,7 +4069,7 @@ napi_value node_loader_impl_register_bootstrap_startup(loader_impl_node node_imp argv[3] = node_loader_trampoline_initialize_object(env); /* Set the values */ - for (size_t iterator = 0; iterator < 4; ++iterator) + for (uint32_t iterator = 0; iterator < 4; ++iterator) { status = napi_set_element(env, v, iterator, argv[iterator]); node_loader_impl_exception(env, status); From 1a6066586454b090f07bd41cb282cc5c0265fe6c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 5 May 2025 23:16:50 +0200 Subject: [PATCH 265/487] Solve issues of gtest in windows. --- cmake/InstallGTest.cmake | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cmake/InstallGTest.cmake b/cmake/InstallGTest.cmake index 6f03ef2fc..fa555b16b 100644 --- a/cmake/InstallGTest.cmake +++ b/cmake/InstallGTest.cmake @@ -65,17 +65,11 @@ if(NOT GTEST_FOUND OR USE_BUNDLED_GTEST) set(GTEST_LIB_SUFFIX "lib") set(GTEST_LIBS_DIR "${binary_dir}/lib/${CMAKE_BUILD_TYPE}") set(GMOCK_LIBS_DIR "${binary_dir}/lib/${CMAKE_BUILD_TYPE}") - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(GTEST_LIB_DEBUG "d") - else() - set(GTEST_LIB_DEBUG "") - endif() else() set(GTEST_LIB_PREFIX "lib") set(GTEST_LIB_SUFFIX "a") set(GTEST_LIBS_DIR "${binary_dir}/lib") set(GMOCK_LIBS_DIR "${binary_dir}/lib") - set(GTEST_LIB_DEBUG "") endif() # Define Paths @@ -85,11 +79,11 @@ if(NOT GTEST_FOUND OR USE_BUNDLED_GTEST) ) set(GTEST_LIBRARY - "${GTEST_LIBS_DIR}/${GTEST_LIB_PREFIX}gtest${GTEST_LIB_DEBUG}.${GTEST_LIB_SUFFIX}" + "${GTEST_LIBS_DIR}/${GTEST_LIB_PREFIX}gtest.${GTEST_LIB_SUFFIX}" ) set(GMOCK_LIBRARY - "${GMOCK_LIBS_DIR}/${GTEST_LIB_PREFIX}gmock${GTEST_LIB_DEBUG}.${GTEST_LIB_SUFFIX}" + "${GMOCK_LIBS_DIR}/${GTEST_LIB_PREFIX}gmock.${GTEST_LIB_SUFFIX}" ) set(GTEST_LIBRARIES From 9c894ecbb9f6750b00e0c3c9c81b6b9776000c23 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 6 May 2025 00:23:55 +0200 Subject: [PATCH 266/487] Trying to solve issue of windows dlls. --- source/loader/include/loader/loader_impl.h | 2 ++ source/loader/source/loader_impl.c | 7 +++++++ .../node_loader/source/node_loader_impl.cpp | 14 +++++++++----- source/metacall/include/metacall/metacall_link.h | 2 +- source/metacall/source/metacall_link.c | 2 +- .../node_extension_test_win32_delay_load.cpp | 4 +++- 6 files changed, 23 insertions(+), 8 deletions(-) diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index 44b242928..e116a001e 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -49,6 +49,8 @@ LOADER_API int loader_impl_dependencies(loader_impl impl, detour d); LOADER_API int loader_impl_link(plugin p, loader_impl impl); +LOADER_API dynlink loader_impl_dependency(loader_impl impl, const char *library); + LOADER_API detour_handle loader_impl_detour(loader_impl impl, const char *library, int (*load_cb)(detour, detour_handle)); LOADER_API void loader_impl_attach(loader_impl impl, plugin p); diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index b08444d2c..dc1cabe9b 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -559,6 +559,13 @@ int loader_impl_link(plugin p, loader_impl impl) return 0; } +dynlink loader_impl_dependency(loader_impl impl, const char *library) +{ + dynlink library_handle = set_get(impl->library_map, (const set_key)library); + + return library_handle; +} + detour_handle loader_impl_detour(loader_impl impl, const char *library, int (*load_cb)(detour, detour_handle)) { detour_handle handle = set_get(impl->detour_map, (const set_key)library); diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 1192a4b65..42593db02 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -3699,11 +3699,15 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi #if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER >= 1200) { /* As the library handle is correctly resolved here, either to executable, library of the executable, - or the loader dependency we can directly obtain the handle of this dependency from a function pointer, - use any function that is contained in node runtime, in this case we are using napi_create_array */ - if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)&napi_create_array, &node_loader_node_dll_handle)) + or the loader dependency we can directly get the handle of this dependency */ + dynlink node_library = loader_impl_dependency(node_impl->impl, "node"); + + node_loader_node_dll_handle = dynlink_get_impl(node_library); + + if (node_loader_node_dll_handle == NULL) { - napi_throw_type_error(env, nullptr, "Failed to initialize the hooking against node extensions load mechanism"); + napi_throw_error(env, nullptr, "Failed to initialize the hooking against node extensions load mechanism"); + return NULL; } detour d = detour_create(metacall_detour()); @@ -4032,7 +4036,7 @@ loader_impl_data node_loader_impl_initialize(loader_impl impl, configuration con /* Result will never be defined properly */ node_impl->result = 0; - if (metacall_link_register_impl(impl, "node", "napi_register_module_v1", (void (*)(void))(&node_loader_port_initialize)) != 0) + if (metacall_link_register_loader(impl, "node", "napi_register_module_v1", (void (*)(void))(&node_loader_port_initialize)) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Node Loader failed to hook napi_register_module_v1"); } diff --git a/source/metacall/include/metacall/metacall_link.h b/source/metacall/include/metacall/metacall_link.h index 5012810fe..4e023d090 100644 --- a/source/metacall/include/metacall/metacall_link.h +++ b/source/metacall/include/metacall/metacall_link.h @@ -92,7 +92,7 @@ METACALL_API int metacall_link_register(const char *tag, const char *library, co * @return * Zero if success, different from zero otherwise */ -METACALL_API int metacall_link_register_impl(void *loader, const char *library, const char *symbol, void (*fn)(void)); +METACALL_API int metacall_link_register_loader(void *loader, const char *library, const char *symbol, void (*fn)(void)); /** * @brief diff --git a/source/metacall/source/metacall_link.c b/source/metacall/source/metacall_link.c index f9be11696..cc261644e 100644 --- a/source/metacall/source/metacall_link.c +++ b/source/metacall/source/metacall_link.c @@ -187,7 +187,7 @@ int metacall_link_register(const char *tag, const char *library, const char *sym return set_insert(metacall_link_table, (set_key)symbol, ptr); } -int metacall_link_register_impl(void *loader, const char *library, const char *symbol, void (*fn)(void)) +int metacall_link_register_loader(void *loader, const char *library, const char *symbol, void (*fn)(void)) { void *ptr; diff --git a/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test_win32_delay_load.cpp b/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test_win32_delay_load.cpp index a19afc563..fc968f846 100644 --- a/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test_win32_delay_load.cpp +++ b/source/tests/metacall_node_extension_test/node_extension_test/source/node_extension_test_win32_delay_load.cpp @@ -29,6 +29,8 @@ #include <delayimp.h> #include <string.h> +static const char node_library_name[] = NODEJS_LIBRARY_NAME; + static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo *info) { HMODULE m; @@ -38,7 +40,7 @@ static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo *info) return NULL; } - if (_stricmp(info->szDll, NODEJS_LIBRARY_NAME) != 0) + if (_stricmp(info->szDll, node_library_name) != 0) { return NULL; } From aed631e9cedd676b1c410a1d0764a515fbaf11ee Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 6 May 2025 00:46:31 +0200 Subject: [PATCH 267/487] Solve issue in windows. --- source/loaders/node_loader/source/node_loader_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 42593db02..77e66b08a 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -3702,7 +3702,7 @@ void *node_loader_impl_register(void *node_impl_ptr, void *env_ptr, void *functi or the loader dependency we can directly get the handle of this dependency */ dynlink node_library = loader_impl_dependency(node_impl->impl, "node"); - node_loader_node_dll_handle = dynlink_get_impl(node_library); + node_loader_node_dll_handle = static_cast<HMODULE>(dynlink_get_impl(node_library)); if (node_loader_node_dll_handle == NULL) { From 28bae5b8d4a2ce21252057cae445f0b03b505bfe Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 7 May 2025 17:35:18 +0200 Subject: [PATCH 268/487] Solved bugs. --- source/loader/include/loader/loader.h | 6 +- source/loader/include/loader/loader_impl.h | 2 +- source/loader/source/loader.c | 65 +++++----- source/loader/source/loader_impl.c | 19 +-- source/metacall/source/metacall.c | 18 +-- source/portability/source/portability_path.c | 6 +- .../source/portability_path_test.cpp | 114 +++++++++++------- 7 files changed, 119 insertions(+), 111 deletions(-) diff --git a/source/loader/include/loader/loader.h b/source/loader/include/loader/loader.h index 8fe36fd1e..441cc938e 100644 --- a/source/loader/include/loader/loader.h +++ b/source/loader/include/loader/loader.h @@ -51,8 +51,6 @@ LOADER_API void loader_initialization_register(loader_impl impl); LOADER_API int loader_initialize(void); -LOADER_NO_EXPORT int loader_initialize_host(const loader_tag tag); - LOADER_API int loader_is_initialized(const loader_tag tag); LOADER_API int loader_register(const char *name, loader_register_invoke invoke, function *func, type_id return_type, size_t arg_size, type_id args_type_id[]); @@ -83,14 +81,12 @@ LOADER_API loader_data loader_get(const char *name); LOADER_API void *loader_get_handle(const loader_tag tag, const char *name); -LOADER_API void loader_set_options(const loader_tag tag, void *options); +LOADER_API int loader_set_options(const loader_tag tag, value options); LOADER_API value loader_get_options(const loader_tag tag); LOADER_API value loader_get_option(const loader_tag tag, const char *field); -LOADER_API int loader_get_option_host(const loader_tag tag); - LOADER_API int loader_handle_initialize(loader_impl impl, const loader_path name, void **handle_ptr); LOADER_API const char *loader_handle_id(void *handle); diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index e116a001e..6f3691d8f 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -77,7 +77,7 @@ LOADER_API int loader_impl_load_from_package(plugin_manager manager, plugin p, l LOADER_API void *loader_impl_get_handle(loader_impl impl, const char *name); -LOADER_API void loader_impl_set_options(loader_impl impl, void *options); +LOADER_API void loader_impl_set_options(loader_impl impl, value options); LOADER_API value loader_impl_get_options(loader_impl impl); diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index b4b13e5df..0c055b01c 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -74,6 +74,8 @@ static void loader_initialization_register_plugin(plugin p); static plugin loader_get_impl_plugin(const loader_tag tag); +static plugin loader_get_impl_plugin_options(const loader_tag tag, value options); + static int loader_get_cb_iterate(plugin_manager manager, plugin p, void *data); static int loader_metadata_cb_iterate(plugin_manager manager, plugin p, void *data); @@ -202,29 +204,6 @@ void loader_initialization_register_plugin(plugin p) } } -int loader_initialize_host(const loader_tag tag) -{ - plugin p = plugin_manager_get(&loader_manager, tag); - - if (p == NULL) - { - return 1; - } - - if (loader_impl_initialize(&loader_manager, p, plugin_impl_type(p, loader_impl)) != 0) - { - return 1; - } - else - { - loader_manager_impl manager_impl = plugin_manager_impl_type(&loader_manager, loader_manager_impl); - - manager_impl->host = p; - - return 0; - } -} - int loader_is_initialized(const loader_tag tag) { plugin p = plugin_manager_get(&loader_manager, tag); @@ -267,21 +246,31 @@ detour_handle loader_hook_impl(void *impl, const char *library, int (*load_cb)(d } plugin loader_get_impl_plugin(const loader_tag tag) +{ + return loader_get_impl_plugin_options(tag, NULL); +} + +plugin loader_get_impl_plugin_options(const loader_tag tag, value options) { plugin p = plugin_manager_get(&loader_manager, tag); + loader_impl impl; + if (p != NULL) { return p; } - loader_impl impl = loader_impl_create(tag); + impl = loader_impl_create(tag); if (impl == NULL) { goto loader_create_error; } + /* Define the options */ + loader_impl_set_options(impl, options); + /* Dynamic link loader dependencies if it is not host */ if (loader_impl_dependencies(impl, plugin_manager_impl_type(&loader_manager, loader_manager_impl)->d) != 0) { @@ -305,6 +294,21 @@ plugin loader_get_impl_plugin(const loader_tag tag) /* Store in the loader implementation the reference to the plugin which belongs to */ loader_impl_attach(impl, p); + /* Check if it is host, initialize it and set it as host */ + if (options != NULL && loader_impl_get_option_host(impl) == 1) + { + loader_manager_impl manager_impl; + + if (loader_impl_initialize(&loader_manager, p, plugin_impl_type(p, loader_impl)) != 0) + { + goto plugin_manager_create_error; + } + + manager_impl = plugin_manager_impl_type(&loader_manager, loader_manager_impl); + + manager_impl->host = p; + } + /* TODO: Disable logs here until log is completely thread safe and async signal safe */ /* log_write("metacall", LOG_LEVEL_DEBUG, "Created loader (%s) implementation <%p>", tag, (void *)impl); */ @@ -594,11 +598,11 @@ void *loader_get_handle(const loader_tag tag, const char *name) return loader_impl_get_handle(plugin_impl_type(p, loader_impl), name); } -void loader_set_options(const loader_tag tag, void *options) +int loader_set_options(const loader_tag tag, value options) { - plugin p = loader_get_impl_plugin(tag); + plugin p = loader_get_impl_plugin_options(tag, options); - loader_impl_set_options(plugin_impl_type(p, loader_impl), options); + return (p == NULL); } value loader_get_options(const loader_tag tag) @@ -615,13 +619,6 @@ value loader_get_option(const loader_tag tag, const char *field) return loader_impl_get_option(plugin_impl_type(p, loader_impl), field); } -int loader_get_option_host(const loader_tag tag) -{ - plugin p = loader_get_impl_plugin(tag); - - return loader_impl_get_option_host(plugin_impl_type(p, loader_impl)); -} - int loader_handle_initialize(loader_impl impl, const loader_path name, void **handle_ptr) { if (loader_initialize() == 1) diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index dc1cabe9b..5eef78140 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -326,7 +326,7 @@ int loader_impl_dependencies_self_list(const char *library, void *data) vector_push_back_empty(dependencies_self); - strncpy(vector_back(dependencies_self), library, strnlen(library, PORTABILITY_PATH_SIZE)); + strncpy(vector_back(dependencies_self), library, strnlen(library, PORTABILITY_PATH_SIZE) + 1); return 0; } @@ -1457,7 +1457,7 @@ void *loader_impl_get_handle(loader_impl impl, const char *name) return NULL; } -void loader_impl_set_options(loader_impl impl, void *options) +void loader_impl_set_options(loader_impl impl, value options) { if (impl != NULL && options != NULL) { @@ -1923,14 +1923,15 @@ void loader_impl_destroy_deallocate(loader_impl impl) set_destroy(impl->detour_map); - /* TODO: I am not sure this will work. - This must be done when the plugin handle (aka the loader) gets unloaded, - at this point it is not unloaded yet, because the plugin destructor is called before doing: - dynlink_unload(p->descriptor->handle); - In theory it should work because normally those handles are reference counted but "I don't trust like that". + /* Unload all the dependencies. + This must be done when the plugin dynlink handle (aka the loader) gets unloaded, + at this point it is not unloaded yet, because the plugin destructor is called before doing: + dynlink_unload(p->descriptor->handle); + As the destroy mechanism requires the loaders to be unloaded at the end after all the destroy methods of all + loaders have been called, this generates an ourobros that cannot be solved easily. In any case, + this method still should work because normally those handles are reference counted and we increment + the reference counter at the beginning, so they will be properly unloaded when the dynlink handle gets unloaded. */ - - /* Unload all the dependencies when everything has been destroyed and the loader is unloaded */ set_iterate(impl->library_map, &loader_impl_destroy_dependencies_map_cb_iterate, NULL); set_destroy(impl->library_map); diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index c865e1ccd..fcba2931a 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -346,26 +346,12 @@ int metacall_initialize_ex(struct metacall_initialize_configuration_type initial while (!(initialize_config[index].tag == NULL && initialize_config[index].options == NULL)) { - loader_impl impl = loader_get_impl(initialize_config[index].tag); - - if (impl == NULL) + if (loader_set_options(initialize_config[index].tag, initialize_config[index].options) != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall failed to find '%s_loader'", initialize_config[index].tag); + log_write("metacall", LOG_LEVEL_ERROR, "MetaCall failed to set options of '%s_loader'", initialize_config[index].tag); return 1; } - loader_set_options(initialize_config[index].tag, initialize_config[index].options); - - /* If we are initializing a loader as a host, we must initialize it */ - if (loader_get_option_host(initialize_config[index].tag)) - { - if (loader_initialize_host(initialize_config[index].tag) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "MetaCall failed to initialize '%s_loader' as host", initialize_config[index].tag); - return 1; - } - } - ++index; } diff --git a/source/portability/source/portability_path.c b/source/portability/source/portability_path.c index ea96ca764..9606a7d69 100644 --- a/source/portability/source/portability_path.c +++ b/source/portability/source/portability_path.c @@ -27,13 +27,13 @@ size_t portability_path_get_name(const char *path, size_t path_size, char *name, size_t name_size) { + size_t i, count, last; + if (path == NULL || name == NULL) { return 0; } - size_t i, count, last; - for (i = 0, count = 0, last = 0; path[i] != '\0' && i < path_size && count < name_size; ++i) { name[count++] = path[i]; @@ -63,7 +63,7 @@ size_t portability_path_get_name(const char *path, size_t path_size, char *name, } } - if (last == 0 && count > 1) + if ((last == 0 && count > 1) || last > count) { last = count; } diff --git a/source/tests/portability_path_test/source/portability_path_test.cpp b/source/tests/portability_path_test/source/portability_path_test.cpp index c8b4dccc5..15534b235 100644 --- a/source/tests/portability_path_test/source/portability_path_test.cpp +++ b/source/tests/portability_path_test/source/portability_path_test.cpp @@ -33,7 +33,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_module_name) size_t size = portability_path_get_module_name(base, sizeof(base), extension, sizeof(extension), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -48,7 +48,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_module_name_without size_t size = portability_path_get_module_name(base, sizeof(base), extension, sizeof(extension), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -63,7 +63,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_module_name_with_ra size_t size = portability_path_get_module_name(base, sizeof(base), extension, sizeof(extension), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -77,7 +77,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_name) size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -91,7 +91,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_end_dot) size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -105,7 +105,21 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_without_dot) size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); + EXPECT_EQ((size_t)size, (size_t)sizeof(result)); + EXPECT_EQ((char)'\0', (char)result[size - 1]); +} + +TEST_F(portability_path_test, portability_path_test_path_get_name_only_separator_dot) +{ + static const char base[] = "/."; + static const char result[] = ""; + + string_name name; + + size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); + + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -119,7 +133,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_only_dot) size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -133,7 +147,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_two_dots) size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -147,7 +161,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_three_dots) size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -161,7 +175,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_only_extension size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -175,7 +189,7 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_double_extensi size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -189,7 +203,21 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_triple_extensi size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); - EXPECT_EQ((int)0, (int)strcmp(name, result)); + EXPECT_STREQ(name, result); + EXPECT_EQ((size_t)size, (size_t)sizeof(result)); + EXPECT_EQ((char)'\0', (char)result[size - 1]); +} + +TEST_F(portability_path_test, portability_path_test_path_get_name_nullchar) +{ + static const char base[] = "/home/yeet/.nvm/versions/node/v18.20.3/bin/node"; + static const char result[] = "node"; + + string_name name; + + size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); + + EXPECT_STREQ(name, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -203,7 +231,7 @@ TEST_F(portability_path_test, portability_path_test_get_path_of_path) size_t size = portability_path_get_directory(base, sizeof(base), path, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(path, result)); + EXPECT_STREQ(path, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -217,7 +245,7 @@ TEST_F(portability_path_test, portability_path_test_get_path_of_filepath) size_t size = portability_path_get_directory(base, sizeof(base), path, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(path, result)); + EXPECT_STREQ(path, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -232,7 +260,7 @@ TEST_F(portability_path_test, portability_path_test_get_relative) size_t size = portability_path_get_relative(base, sizeof(base), path, sizeof(path), relative, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(relative, result)); + EXPECT_STREQ(relative, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -247,7 +275,7 @@ TEST_F(portability_path_test, portability_path_test_get_relative_fail) size_t size = portability_path_get_relative(base, sizeof(base), path, sizeof(path), relative, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(relative, result)); + EXPECT_STREQ(relative, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -262,7 +290,7 @@ TEST_F(portability_path_test, portability_path_test_join_none_slash) size_t size = portability_path_join(left, sizeof(left), right, sizeof(right), join, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(join, result)); + EXPECT_STREQ(join, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -277,7 +305,7 @@ TEST_F(portability_path_test, portability_path_test_join_left_slash) size_t size = portability_path_join(left, sizeof(left), right, sizeof(right), join, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(join, result)); + EXPECT_STREQ(join, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -292,7 +320,7 @@ TEST_F(portability_path_test, portability_path_test_join_right_slash) size_t size = portability_path_join(left, sizeof(left), right, sizeof(right), join, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(join, result)); + EXPECT_STREQ(join, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -307,7 +335,7 @@ TEST_F(portability_path_test, portability_path_test_join_both_slash) size_t size = portability_path_join(left, sizeof(left), right, sizeof(right), join, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(join, result)); + EXPECT_STREQ(join, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -322,7 +350,7 @@ TEST_F(portability_path_test, portability_path_test_join_left_empty) size_t size = portability_path_join(left, sizeof(left), right, sizeof(right), join, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(join, result)); + EXPECT_STREQ(join, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -337,7 +365,7 @@ TEST_F(portability_path_test, portability_path_test_join_right_empty) size_t size = portability_path_join(left, sizeof(left), right, sizeof(right), join, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(join, result)); + EXPECT_STREQ(join, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -352,7 +380,7 @@ TEST_F(portability_path_test, portability_path_test_join_right_empty_non_slash) size_t size = portability_path_join(left, sizeof(left), right, sizeof(right), join, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(join, result)); + EXPECT_STREQ(join, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -367,7 +395,7 @@ TEST_F(portability_path_test, portability_path_test_join_both_empty) size_t size = portability_path_join(left, sizeof(left), right, sizeof(right), join, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(join, result)); + EXPECT_STREQ(join, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -381,7 +409,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_begin_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -395,7 +423,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_begin_double_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -409,7 +437,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_begin_many_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -423,7 +451,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_begin_many_double_ size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -437,7 +465,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_begin_dot_non_slas size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -451,7 +479,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_begin_many_dot_non size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -465,7 +493,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_begin_invalid) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -479,7 +507,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_middle_double_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -493,7 +521,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_middle_double_dot_ size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -507,7 +535,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_middle_double_dot_ size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -521,7 +549,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_middle_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -535,7 +563,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_middle_mixed_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -549,7 +577,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_end_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -563,7 +591,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_end_double_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -577,7 +605,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_end_mixed_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -591,7 +619,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_absolute_end_mixed size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -605,7 +633,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_absolute_end_dot) size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -619,7 +647,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_relative_begin_end size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } @@ -633,7 +661,7 @@ TEST_F(portability_path_test, portability_path_test_canonical_absolute_end_many_ size_t size = portability_path_canonical(path, sizeof(path), canonical, PATH_SIZE); - EXPECT_EQ((int)0, (int)strcmp(canonical, result)); + EXPECT_STREQ(canonical, result); EXPECT_EQ((size_t)size, (size_t)sizeof(result)); EXPECT_EQ((char)'\0', (char)result[size - 1]); } From db92d1e9e0af5f9ad2b6e5f83cf728edca9acb69 Mon Sep 17 00:00:00 2001 From: Jose Antonio Dominguez <chamot11@gmail.com> Date: Wed, 7 May 2025 20:08:11 -0300 Subject: [PATCH 269/487] Refactor Windows loader implementation to improve symbol replacement logic and ensure proper unloading of handles. --- source/loader/source/loader_impl.c | 53 +++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 5eef78140..33c232af6 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -523,30 +523,53 @@ int loader_impl_link(plugin p, loader_impl impl) #if defined(WIN32) || defined(_WIN32) if (loader_impl_get_option_host(impl) == 1) { - /* TODO: Replace loader symbols by the dependency (aka the already loaded + /* Replace loader symbols by the dependency (aka the already loaded library if the host is linked dynamically, or the executable if it is - linked statically): - - loader_handle = detour_load_handle(d, desc->handle); - - while (detour_enumerate(d, loader_handle, position, name, addr)) + linked statically) */ + detour_handle loader_handle; + void *position = NULL; + char name[DETOUR_SYMBOL_SIZE]; + void *addr = NULL; + + loader_handle = detour_load_handle(impl->d, desc->handle); + + if (loader_handle != NULL) + { + set_iterator it; + size_t iterator; + + while (detour_enumerate(impl->d, loader_handle, &position, name, &addr)) { - foreach(library_handle in impl->library_map) + /* Iterate through all library handles in the library map */ + it = set_iterator_begin(impl->library_map); + + for (iterator = 0; iterator < set_size(impl->library_map); ++iterator) { - symbol = dynlink_symbol(library_handle, name); - - if (symbol != NULL) + dynlink library_handle = set_iterator_value(it); + void *symbol = NULL; + + if (library_handle != NULL) { - if (detour_replace(d, loader_handle, name, symbol, ...) == 0) + if (dynlink_symbol(library_handle, name, &symbol) == 0) { - break; + if (symbol != NULL) + { + if (detour_replace(impl->d, loader_handle, name, symbol, NULL) == 0) + { + /* Symbol successfully replaced */ + + break; + } + } } } + + it = set_iterator_next(it); } } - - detour_unload(d, loader_handle); - */ + + detour_unload(impl->d, loader_handle); + } } #endif From 5c0b9dbfda06ccaa922c399f6d30a206b68bb09b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 8 May 2025 17:23:08 +0200 Subject: [PATCH 270/487] Improve hash map and add set benchmarks. --- source/adt/source/adt_map.c | 114 ++++++++------ source/adt/source/adt_set.c | 2 + source/benchmarks/CMakeLists.txt | 1 + .../benchmarks/log_bench/source/log_bench.cpp | 1 - source/benchmarks/set_bench/CMakeLists.txt | 147 ++++++++++++++++++ .../benchmarks/set_bench/source/set_bench.cpp | 147 ++++++++++++++++++ source/loader/source/loader_impl.c | 4 +- source/reflect/source/reflect_class.c | 50 +++--- .../adt_map_test/source/adt_map_test.cpp | 25 +++ .../adt_set_test/source/adt_set_test.cpp | 23 +++ 10 files changed, 429 insertions(+), 85 deletions(-) create mode 100644 source/benchmarks/set_bench/CMakeLists.txt create mode 100644 source/benchmarks/set_bench/source/set_bench.cpp diff --git a/source/adt/source/adt_map.c b/source/adt/source/adt_map.c index 4f28a10cb..53febfa78 100644 --- a/source/adt/source/adt_map.c +++ b/source/adt/source/adt_map.c @@ -49,14 +49,6 @@ struct map_iterator_type size_t current_pair; }; -struct map_contains_any_cb_iterator_type -{ - map m; - int result; -}; - -typedef struct map_contains_any_cb_iterator_type *map_contains_any_cb_iterator; - /* -- Methods -- */ map map_create(map_cb_hash hash_cb, map_cb_compare compare_cb) @@ -104,30 +96,38 @@ size_t map_size(map m) return 0; } -static int map_bucket_realloc_iterator(map m, map_key key, map_value value, map_cb_iterate_args args) +static int map_bucket_rehash(map m, map new_map) { - map new_map = (map)args; + size_t bucket_iterator, pair_iterator; - if (new_map != m && key != NULL && args != NULL) + for (bucket_iterator = 0; bucket_iterator < m->capacity; ++bucket_iterator) { - map_hash h = new_map->hash_cb(key); + bucket b = &m->buckets[bucket_iterator]; - size_t index = h % new_map->capacity; + if (b->pairs != NULL && b->count > 0) + { + for (pair_iterator = 0; pair_iterator < b->count; ++pair_iterator) + { + pair p = &b->pairs[pair_iterator]; - bucket b = &new_map->buckets[index]; + map_hash h = new_map->hash_cb(p->key); - if (bucket_insert(b, key, value) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid map bucket realloc insertion"); - return 1; - } + size_t index = h % new_map->capacity; - ++new_map->count; + bucket b = &new_map->buckets[index]; - return 0; + if (bucket_insert(b, p->key, p->value) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid map bucket realloc insertion"); + return 1; + } + + ++new_map->count; + } + } } - return 1; + return 0; } static int map_bucket_realloc(map m) @@ -160,8 +160,10 @@ static int map_bucket_realloc(map m) { size_t iterator; - map_iterate(m, &map_bucket_realloc_iterator, &new_map); + /* Rehash all the elements into the new map */ + map_bucket_rehash(m, &new_map); + /* Destroy all pairs from old map */ for (iterator = 0; iterator < m->capacity; ++iterator) { bucket b = &m->buckets[iterator]; @@ -172,6 +174,7 @@ static int map_bucket_realloc(map m) } } + /* Destroy all buckets from old map */ free(m->buckets); m->capacity = new_map.capacity; @@ -272,29 +275,29 @@ int map_contains(map m, map_key key) return 1; } -static int map_contains_any_cb_iterate(map m, map_key key, map_value value, map_cb_iterate_args args) -{ - map_contains_any_cb_iterator iterator = (map_contains_any_cb_iterator)args; - - (void)m; - (void)value; - - iterator->result = map_contains(iterator->m, key); - - /* Stop iteration if we found an element */ - return !iterator->result; -} - int map_contains_any(map dest, map src) { - struct map_contains_any_cb_iterator_type args; + size_t bucket_iterator, pair_iterator; - args.m = dest; - args.result = 1; + for (bucket_iterator = 0; bucket_iterator < src->capacity; ++bucket_iterator) + { + bucket b = &src->buckets[bucket_iterator]; - map_iterate(src, &map_contains_any_cb_iterate, (map_cb_iterate_args)&args); + if (b->pairs != NULL && b->count > 0) + { + for (pair_iterator = 0; pair_iterator < b->count; ++pair_iterator) + { + pair p = &b->pairs[pair_iterator]; + + if (map_contains(dest, p->key) == 0) + { + return 0; + } + } + } + } - return args.result; + return 1; } map_value map_remove(map m, map_key key) @@ -413,20 +416,27 @@ void map_iterate(map m, map_cb_iterate iterate_cb, map_cb_iterate_args args) } } -static int map_append_cb_iterate(map m, map_key key, map_value value, map_cb_iterate_args args) +int map_append(map dest, map src) { - map dest = (map)args; - - (void)m; + size_t bucket_iterator, pair_iterator; - return map_insert(dest, key, value); -} + for (bucket_iterator = 0; bucket_iterator < src->capacity; ++bucket_iterator) + { + bucket b = &src->buckets[bucket_iterator]; -int map_append(map dest, map src) -{ - map_cb_iterate_args args = (map_cb_iterate_args)dest; + if (b->pairs != NULL && b->count > 0) + { + for (pair_iterator = 0; pair_iterator < b->count; ++pair_iterator) + { + pair p = &b->pairs[pair_iterator]; - map_iterate(src, &map_append_cb_iterate, args); + if (map_insert(dest, p->key, p->value) != 0) + { + return 1; + } + } + } + } return 0; } @@ -559,6 +569,8 @@ void map_iterator_next(map_iterator it) } } } + + it->current_pair = 0; } } } diff --git a/source/adt/source/adt_set.c b/source/adt/source/adt_set.c index e54b8faee..4ea3dd86d 100644 --- a/source/adt/source/adt_set.c +++ b/source/adt/source/adt_set.c @@ -582,6 +582,8 @@ void set_iterator_next(set_iterator it) return; } } + + it->current_pair = 0; } } } diff --git a/source/benchmarks/CMakeLists.txt b/source/benchmarks/CMakeLists.txt index 8bf6ce15e..107a348e8 100644 --- a/source/benchmarks/CMakeLists.txt +++ b/source/benchmarks/CMakeLists.txt @@ -58,6 +58,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/b include(CTest) +add_subdirectory(set_bench) add_subdirectory(log_bench) add_subdirectory(metacall_py_c_api_bench) add_subdirectory(metacall_py_call_bench) diff --git a/source/benchmarks/log_bench/source/log_bench.cpp b/source/benchmarks/log_bench/source/log_bench.cpp index 73bb489fe..75bdb547b 100644 --- a/source/benchmarks/log_bench/source/log_bench.cpp +++ b/source/benchmarks/log_bench/source/log_bench.cpp @@ -21,7 +21,6 @@ #include <benchmark/benchmark.h> #include <log/log.h> -#include <metacall/metacall_loaders.h> static int stream_write(void *, const char *, const size_t) { diff --git a/source/benchmarks/set_bench/CMakeLists.txt b/source/benchmarks/set_bench/CMakeLists.txt new file mode 100644 index 000000000..69630fada --- /dev/null +++ b/source/benchmarks/set_bench/CMakeLists.txt @@ -0,0 +1,147 @@ +# +# Executable name and options +# + +# Target name +set(target set-bench) +message(STATUS "Benchmark ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/set_bench.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GBench + + ${META_PROJECT_NAME}::version + ${META_PROJECT_NAME}::preprocessor + ${META_PROJECT_NAME}::format + ${META_PROJECT_NAME}::threading + ${META_PROJECT_NAME}::log + ${META_PROJECT_NAME}::adt +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Linker options +# + +target_link_options(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $<TARGET_FILE:${target}> + --benchmark_out=${CMAKE_BINARY_DIR}/benchmarks/${target}.json +) + +# +# Define dependencies +# + +add_dependencies(${target} + adt +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} +) diff --git a/source/benchmarks/set_bench/source/set_bench.cpp b/source/benchmarks/set_bench/source/set_bench.cpp new file mode 100644 index 000000000..3b233cfd0 --- /dev/null +++ b/source/benchmarks/set_bench/source/set_bench.cpp @@ -0,0 +1,147 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <benchmark/benchmark.h> + +#include <adt/adt_set.h> + +#include <string> +#include <vector> + +#define SET_SIZE 1000 +#define ITERATIONS 1000 + +class set_bench : public benchmark::Fixture +{ +public: + void SetUp(benchmark::State &) + { + s = set_create(&hash_callback_ptr, &comparable_callback_ptr); + + keys.reserve(SET_SIZE); + values.reserve(SET_SIZE); + + for (int i = 0; i < SET_SIZE; ++i) + { + keys.push_back(std::to_string(i)); + values.push_back(i); + set_insert(s, (set_key)keys[i].c_str(), &values[i]); + } + } + + void TearDown(benchmark::State &) + { + set_destroy(s); + } + + set s; + std::vector<std::string> keys; + std::vector<int> values; +}; + +int set_cb_iterate_sum(set s, set_key key, set_value value, set_cb_iterate_args args) +{ + int *i = (int *)value; + uint64_t *sum = (uint64_t *)args; + + (void)s; + (void)key; + + *sum = ((*sum) + (uint64_t)(*i)); + + return 0; +} + +BENCHMARK_DEFINE_F(set_bench, set_iterate) +(benchmark::State &state) +{ + uint64_t sum = 0; + + for (auto _ : state) + { + set_iterate(s, &set_cb_iterate_sum, &sum); + } + + state.SetLabel("Set Benchmark - Iterate Callback"); + state.SetItemsProcessed(SET_SIZE); +} + +BENCHMARK_REGISTER_F(set_bench, set_iterate) + ->Unit(benchmark::kMillisecond) + ->Iterations(ITERATIONS) + ->Repetitions(3); + +BENCHMARK_DEFINE_F(set_bench, set_iterators) +(benchmark::State &state) +{ + uint64_t sum = 0; + + for (auto _ : state) + { + for (set_iterator it = set_iterator_begin(s); set_iterator_end(&it) > 0; set_iterator_next(it)) + { + int *i = (int *)set_iterator_get_value(it); + + sum += ((uint64_t)(*i)); + } + } + + (void)sum; + + state.SetLabel("Set Benchmark - Iterators"); + state.SetItemsProcessed(SET_SIZE); +} + +BENCHMARK_REGISTER_F(set_bench, set_iterators) + ->Unit(benchmark::kMillisecond) + ->Iterations(ITERATIONS) + ->Repetitions(3); + +/* +BENCHMARK_DEFINE_F(set_bench, set_iterators_2) +(benchmark::State &state) +{ + uint64_t sum = 0; + + for (auto _ : state) + { + set_iterator_type it; + + for (set_iterator_begin_2(s, &it); set_iterator_end_2(&it) > 0; set_iterator_next(&it)) + { + int *i = (int *)set_iterator_get_value(&it); + + sum += ((uint64_t)(*i)); + } + } + + (void)sum; + + state.SetLabel("Set Benchmark - Iterators 2"); + state.SetItemsProcessed(SET_SIZE); +} + +BENCHMARK_REGISTER_F(set_bench, set_iterators_2) + ->Unit(benchmark::kMillisecond) + ->Iterations(ITERATIONS) + ->Repetitions(3); +*/ + +BENCHMARK_MAIN(); diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 33c232af6..fc87cb099 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -520,7 +520,8 @@ int loader_impl_link(plugin p, loader_impl impl) we link the dependency with delay load linking. Before we execute anything, we should relink all the symbols to the host. */ -#if defined(WIN32) || defined(_WIN32) +#if 0 // TODO + #if defined(WIN32) || defined(_WIN32) if (loader_impl_get_option_host(impl) == 1) { /* Replace loader symbols by the dependency (aka the already loaded @@ -571,6 +572,7 @@ int loader_impl_link(plugin p, loader_impl impl) detour_unload(impl->d, loader_handle); } } + #endif #endif /* Store itself in the library map along with the dependencies */ diff --git a/source/reflect/source/reflect_class.c b/source/reflect/source/reflect_class.c index 63643a24f..c0f35f6e0 100644 --- a/source/reflect/source/reflect_class.c +++ b/source/reflect/source/reflect_class.c @@ -72,7 +72,6 @@ static value class_metadata_attributes(klass cls); static value class_metadata_static_attributes(klass cls); static method class_get_method_type_safe(vector v, type_id ret, type_id args[], size_t size); static int class_attributes_destroy_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); -static int class_methods_destroy_cb_iterate(map m, map_key key, map_value val, map_cb_iterate_args args); static void class_constructors_destroy(klass cls); klass class_create(const char *name, enum accessor_type_id accessor, class_impl impl, class_impl_interface_singleton singleton) @@ -262,23 +261,12 @@ value class_metadata_constructors(klass cls) return v; } -int class_metadata_methods_impl_cb_iterate(map m, map_key key, map_value val, map_cb_iterate_args args) -{ - class_metadata_iterator_args iterator = (class_metadata_iterator_args)args; - value *v_array = value_to_array(iterator->v); - - (void)m; - (void)key; - - v_array[iterator->count++] = method_metadata((method)val); - - return 0; -} - value class_metadata_methods_impl(const char name[], size_t size, map methods) { value v = value_create_array(NULL, 2); value *v_array; + map_iterator it; + size_t count = 0; if (v == NULL) { @@ -300,12 +288,12 @@ value class_metadata_methods_impl(const char name[], size_t size, map methods) goto error_value; } - struct class_metadata_iterator_args_type iterator; - - iterator.v = v_array[1]; - iterator.count = 0; + for (it = map_iterator_begin(methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + { + value *method_array = value_to_array(v_array[1]); - map_iterate(methods, &class_metadata_methods_impl_cb_iterate, &iterator); + method_array[count++] = method_metadata((method)map_iterator_get_value(it)); + } return v; error_value: @@ -807,17 +795,6 @@ int class_attributes_destroy_cb_iterate(set s, set_key key, set_value val, set_c return 0; } -int class_methods_destroy_cb_iterate(map m, map_key key, map_value val, map_cb_iterate_args args) -{ - (void)m; - (void)key; - (void)args; - - method_destroy((method)val); - - return 0; -} - void class_constructors_destroy(klass cls) { size_t iterator, size = vector_size(cls->constructors); @@ -846,6 +823,8 @@ void class_destroy(klass cls) if (threading_atomic_ref_count_load(&cls->ref) == 0) { + map_iterator it; + /* TODO: Disable logs here until log is completely thread safe and async signal safe */ /* @@ -864,8 +843,15 @@ void class_destroy(klass cls) set_iterate(cls->attributes, &class_attributes_destroy_cb_iterate, NULL); set_iterate(cls->static_attributes, &class_attributes_destroy_cb_iterate, NULL); - map_iterate(cls->methods, &class_methods_destroy_cb_iterate, NULL); - map_iterate(cls->static_methods, &class_methods_destroy_cb_iterate, NULL); + for (it = map_iterator_begin(cls->methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + { + method_destroy((method)map_iterator_get_value(it)); + } + + for (it = map_iterator_begin(cls->static_methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + { + method_destroy((method)map_iterator_get_value(it)); + } if (cls->interface != NULL && cls->interface->destroy != NULL) { diff --git a/source/tests/adt_map_test/source/adt_map_test.cpp b/source/tests/adt_map_test/source/adt_map_test.cpp index 9fb876427..5e6e76fc7 100644 --- a/source/tests/adt_map_test/source/adt_map_test.cpp +++ b/source/tests/adt_map_test/source/adt_map_test.cpp @@ -24,9 +24,13 @@ #include <log/log.h> +#include <vector> + typedef char key_str[7]; static size_t iterator_counter = 0; +static std::vector<int> order_iterate; +static std::vector<int> order_iterator; int map_cb_iterate_str_to_int(map m, map_key key, map_value value, map_cb_iterate_args args) { @@ -34,6 +38,8 @@ int map_cb_iterate_str_to_int(map m, map_key key, map_value value, map_cb_iterat { log_write("metacall", LOG_LEVEL_DEBUG, "%s -> %d", (char *)key, *((int *)(value))); + order_iterate.push_back(*((int *)(value))); + ++iterator_counter; return 0; @@ -108,6 +114,25 @@ TEST_F(adt_map_test, map_int) EXPECT_EQ((size_t)iterator_counter, (size_t)value_array_size * 2); + /* Iterators */ + iterator_counter = 0; + + for (map_iterator it = map_iterator_begin(m); map_iterator_end(&it) != 0; map_iterator_next(it)) + { + char *key = (char *)map_iterator_get_key(it); + int *value = (int *)map_iterator_get_value(it); + + log_write("metacall", LOG_LEVEL_DEBUG, "[%s -> %d]", (char *)key, *((int *)(value))); + + order_iterator.push_back(*((int *)(value))); + + iterator_counter++; + } + + EXPECT_EQ((size_t)iterator_counter, (size_t)value_array_size * 2); + + EXPECT_EQ((bool)true, (bool)(order_iterator == order_iterate)); + /* Get value */ for (size_t i = 0; i < key_array_size; ++i) { diff --git a/source/tests/adt_set_test/source/adt_set_test.cpp b/source/tests/adt_set_test/source/adt_set_test.cpp index b148b7a2e..429073999 100644 --- a/source/tests/adt_set_test/source/adt_set_test.cpp +++ b/source/tests/adt_set_test/source/adt_set_test.cpp @@ -27,6 +27,8 @@ typedef char key_str[7]; static size_t iterator_counter = 0; +static std::vector<int> order_iterate; +static std::vector<int> order_iterator; int set_cb_iterate_str_to_int(set s, set_key key, set_value value, set_cb_iterate_args args) { @@ -34,6 +36,8 @@ int set_cb_iterate_str_to_int(set s, set_key key, set_value value, set_cb_iterat { log_write("metacall", LOG_LEVEL_DEBUG, "%s -> %d", (char *)key, *((int *)(value))); + order_iterate.push_back(*((int *)(value))); + ++iterator_counter; return 0; @@ -120,6 +124,25 @@ TEST_F(adt_set_test, DefaultConstructor) EXPECT_EQ((size_t)iterator_counter, (size_t)value_array_size); + /* Iterators */ + iterator_counter = 0; + + for (set_iterator it = set_iterator_begin(s); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + char *key = (char *)set_iterator_get_key(it); + int *value = (int *)set_iterator_get_value(it); + + log_write("metacall", LOG_LEVEL_DEBUG, "[%s -> %d]", (char *)key, *((int *)(value))); + + order_iterator.push_back(*((int *)(value))); + + iterator_counter++; + } + + EXPECT_EQ((size_t)iterator_counter, (size_t)value_array_size); + + EXPECT_EQ((bool)true, (bool)(order_iterator == order_iterate)); + /* Get value */ for (size_t i = 0; i < key_array_size; ++i) { From d82578a94d789b9f913be7375a55751163109aad Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 9 May 2025 08:34:33 +0200 Subject: [PATCH 271/487] Refactor set_iterate into iterator inside adt_set.c --- source/adt/source/adt_set.c | 189 ++++++++++++++++++------------------ 1 file changed, 95 insertions(+), 94 deletions(-) diff --git a/source/adt/source/adt_set.c b/source/adt/source/adt_set.c index 4ea3dd86d..c559ae22a 100644 --- a/source/adt/source/adt_set.c +++ b/source/adt/source/adt_set.c @@ -49,22 +49,6 @@ struct set_iterator_type size_t current_pair; }; -struct set_contains_any_cb_iterator_type -{ - set s; - int result; -}; - -struct set_contains_which_cb_iterator_type -{ - set s; - int result; - set_key *key; -}; - -typedef struct set_contains_any_cb_iterator_type *set_contains_any_cb_iterator; -typedef struct set_contains_which_cb_iterator_type *set_contains_which_cb_iterator; - /* -- Methods -- */ set set_create(set_cb_hash hash_cb, set_cb_compare compare_cb) @@ -112,30 +96,38 @@ size_t set_size(set s) return 0; } -static int set_bucket_realloc_iterator(set s, set_key key, set_value value, set_cb_iterate_args args) +static int set_bucket_rehash(set s, set new_set) { - set new_set = (set)args; + size_t bucket_iterator, pair_iterator; - if (new_set != s && key != NULL && args != NULL) + for (bucket_iterator = 0; bucket_iterator < s->capacity; ++bucket_iterator) { - set_hash h = new_set->hash_cb(key); + bucket b = &s->buckets[bucket_iterator]; + + if (b->pairs != NULL && b->count > 0) + { + for (pair_iterator = 0; pair_iterator < b->count; ++pair_iterator) + { + pair p = &b->pairs[pair_iterator]; - size_t index = h % new_set->capacity; + set_hash h = new_set->hash_cb(p->key); - bucket b = &new_set->buckets[index]; + size_t index = h % new_set->capacity; - if (bucket_insert(b, key, value) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid set bucket realloc insertion"); - return 1; - } + bucket b = &new_set->buckets[index]; - ++new_set->count; + if (bucket_insert(b, p->key, p->value) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid set bucket realloc insertion"); + return 1; + } - return 0; + ++new_set->count; + } + } } - return 1; + return 0; } static int set_bucket_realloc(set s) @@ -168,8 +160,10 @@ static int set_bucket_realloc(set s) { size_t iterator; - set_iterate(s, &set_bucket_realloc_iterator, &new_set); + /* Rehash all the elements into the new set */ + set_bucket_rehash(s, &new_set); + /* Destroy all pairs from old set */ for (iterator = 0; iterator < s->capacity; ++iterator) { bucket b = &s->buckets[iterator]; @@ -180,6 +174,7 @@ static int set_bucket_realloc(set s) } } + /* Destroy all buckets from old set */ free(s->buckets); s->capacity = new_set.capacity; @@ -294,63 +289,55 @@ int set_contains(set s, set_key key) return 1; } -static int set_contains_any_cb_iterate(set s, set_key key, set_value value, set_cb_iterate_args args) -{ - set_contains_any_cb_iterator iterator = (set_contains_any_cb_iterator)args; - - (void)s; - (void)value; - - iterator->result = set_contains(iterator->s, key); - - /* Stop iteration if we found an element */ - return !iterator->result; -} - int set_contains_any(set dest, set src) { - struct set_contains_any_cb_iterator_type args; - - args.s = dest; - args.result = 1; - - set_iterate(src, &set_contains_any_cb_iterate, (set_cb_iterate_args)&args); + size_t bucket_iterator, pair_iterator; - return args.result; -} - -static int set_contains_which_cb_iterate(set s, set_key key, set_value value, set_cb_iterate_args args) -{ - set_contains_which_cb_iterator iterator = (set_contains_which_cb_iterator)args; - - (void)s; - (void)value; + for (bucket_iterator = 0; bucket_iterator < src->capacity; ++bucket_iterator) + { + bucket b = &src->buckets[bucket_iterator]; - iterator->result = set_contains(iterator->s, key); + if (b->pairs != NULL && b->count > 0) + { + for (pair_iterator = 0; pair_iterator < b->count; ++pair_iterator) + { + pair p = &b->pairs[pair_iterator]; - if (iterator->result == 0) - { - iterator->key = key; + if (set_contains(dest, p->key) == 0) + { + return 0; + } + } + } } - /* Stop iteration if we found an element */ - return !iterator->result; + return 1; } int set_contains_which(set dest, set src, set_key *key) { - struct set_contains_which_cb_iterator_type args; + size_t bucket_iterator, pair_iterator; - args.s = dest; - args.result = 1; - args.key = NULL; + for (bucket_iterator = 0; bucket_iterator < src->capacity; ++bucket_iterator) + { + bucket b = &src->buckets[bucket_iterator]; - set_iterate(src, &set_contains_which_cb_iterate, (set_cb_iterate_args)&args); + if (b->pairs != NULL && b->count > 0) + { + for (pair_iterator = 0; pair_iterator < b->count; ++pair_iterator) + { + pair p = &b->pairs[pair_iterator]; - /* Return which is the duplicated key if any */ - *key = args.key; + if (set_contains(dest, p->key) == 0) + { + *key = p->key; + return 0; + } + } + } + } - return args.result; + return 1; } set_value set_remove(set s, set_key key) @@ -417,40 +404,54 @@ void set_iterate(set s, set_cb_iterate iterate_cb, set_cb_iterate_args args) } } -static int set_append_cb_iterate(set s, set_key key, set_value value, set_cb_iterate_args args) +int set_append(set dest, set src) { - set dest = (set)args; - - (void)s; + size_t bucket_iterator, pair_iterator; - return set_insert(dest, key, value); -} + for (bucket_iterator = 0; bucket_iterator < src->capacity; ++bucket_iterator) + { + bucket b = &src->buckets[bucket_iterator]; -int set_append(set dest, set src) -{ - set_cb_iterate_args args = (set_cb_iterate_args)dest; + if (b->pairs != NULL && b->count > 0) + { + for (pair_iterator = 0; pair_iterator < b->count; ++pair_iterator) + { + pair p = &b->pairs[pair_iterator]; - set_iterate(src, &set_append_cb_iterate, args); + if (set_insert(dest, p->key, p->value) != 0) + { + return 1; + } + } + } + } return 0; } -static int set_disjoint_cb_iterate(set s, set_key key, set_value value, set_cb_iterate_args args) +int set_disjoint(set dest, set src) { - set dest = (set)args; - - set_value deleted = set_remove(dest, key); + size_t bucket_iterator, pair_iterator; - (void)s; + for (bucket_iterator = 0; bucket_iterator < src->capacity; ++bucket_iterator) + { + bucket b = &src->buckets[bucket_iterator]; - return !(deleted == value); -} + if (b->pairs != NULL && b->count > 0) + { + for (pair_iterator = 0; pair_iterator < b->count; ++pair_iterator) + { + pair p = &b->pairs[pair_iterator]; -int set_disjoint(set dest, set src) -{ - set_cb_iterate_args args = (set_cb_iterate_args)dest; + set_value deleted = set_remove(dest, p->key); - set_iterate(src, &set_disjoint_cb_iterate, args); + if (deleted != p->value) + { + return 1; + } + } + } + } return 0; } From 3ec329a9ce5626e864b789c2aa9d77bbd70fc794 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 9 May 2025 17:16:39 +0200 Subject: [PATCH 272/487] Convert set_iterate to set_iterator, implemented loader link. --- source/adt/include/adt/adt_map.h | 4 +- source/adt/include/adt/adt_set.h | 4 +- source/adt/source/adt_map.c | 4 +- source/adt/source/adt_set.c | 4 +- source/adt/source/adt_trie.c | 7 +- .../benchmarks/set_bench/source/set_bench.cpp | 4 +- .../source/configuration_object.c | 87 ++---- .../source/configuration_singleton.c | 29 +- source/loader/include/loader/loader.h | 6 +- source/loader/source/loader.c | 99 ++----- source/loader/source/loader_impl.c | 257 ++++++------------ .../rb_loader/source/rb_loader_impl_parser.c | 59 ++-- source/plugin/include/plugin/plugin_manager.h | 4 +- source/plugin/source/plugin_manager.c | 86 +----- source/reflect/source/reflect_class.c | 91 +++---- source/reflect/source/reflect_scope.c | 236 +++++++--------- .../adt_map_test/source/adt_map_test.cpp | 4 +- .../adt_set_test/source/adt_set_test.cpp | 4 +- 18 files changed, 326 insertions(+), 663 deletions(-) diff --git a/source/adt/include/adt/adt_map.h b/source/adt/include/adt/adt_map.h index 8fe9e1c5e..e0236c8b6 100644 --- a/source/adt/include/adt/adt_map.h +++ b/source/adt/include/adt/adt_map.h @@ -81,9 +81,9 @@ ADT_API void map_destroy(map m); ADT_API map_iterator map_iterator_begin(map m); -ADT_API map_key map_iterator_get_key(map_iterator it); +ADT_API map_key map_iterator_key(map_iterator it); -ADT_API map_value map_iterator_get_value(map_iterator it); +ADT_API map_value map_iterator_value(map_iterator it); ADT_API void map_iterator_next(map_iterator it); diff --git a/source/adt/include/adt/adt_set.h b/source/adt/include/adt/adt_set.h index 64af95176..2515d052f 100644 --- a/source/adt/include/adt/adt_set.h +++ b/source/adt/include/adt/adt_set.h @@ -82,9 +82,9 @@ ADT_API void set_destroy(set s); ADT_API set_iterator set_iterator_begin(set s); -ADT_API set_key set_iterator_get_key(set_iterator it); +ADT_API set_key set_iterator_key(set_iterator it); -ADT_API set_value set_iterator_get_value(set_iterator it); +ADT_API set_value set_iterator_value(set_iterator it); ADT_API void set_iterator_next(set_iterator it); diff --git a/source/adt/source/adt_map.c b/source/adt/source/adt_map.c index 53febfa78..949a211b6 100644 --- a/source/adt/source/adt_map.c +++ b/source/adt/source/adt_map.c @@ -527,7 +527,7 @@ map_iterator map_iterator_begin(map m) return NULL; } -map_key map_iterator_get_key(map_iterator it) +map_key map_iterator_key(map_iterator it) { if (it != NULL && it->current_bucket < it->m->capacity && it->current_pair > 0) { @@ -537,7 +537,7 @@ map_key map_iterator_get_key(map_iterator it) return NULL; } -map_value map_iterator_get_value(map_iterator it) +map_value map_iterator_value(map_iterator it) { if (it != NULL && it->current_bucket < it->m->capacity && it->current_pair > 0) { diff --git a/source/adt/source/adt_set.c b/source/adt/source/adt_set.c index c559ae22a..e6d79c36a 100644 --- a/source/adt/source/adt_set.c +++ b/source/adt/source/adt_set.c @@ -542,7 +542,7 @@ set_iterator set_iterator_begin(set s) return NULL; } -set_key set_iterator_get_key(set_iterator it) +set_key set_iterator_key(set_iterator it) { if (it != NULL && it->current_bucket < it->s->capacity && it->current_pair > 0) { @@ -552,7 +552,7 @@ set_key set_iterator_get_key(set_iterator it) return NULL; } -set_value set_iterator_get_value(set_iterator it) +set_value set_iterator_value(set_iterator it) { if (it != NULL && it->current_bucket < it->s->capacity && it->current_pair > 0) { diff --git a/source/adt/source/adt_trie.c b/source/adt/source/adt_trie.c index 12b934243..68e3d5d28 100644 --- a/source/adt/source/adt_trie.c +++ b/source/adt/source/adt_trie.c @@ -525,9 +525,10 @@ void trie_node_iterate(trie t, trie_node n, trie_cb_iterate iterate_cb, trie_cb_ if (back->childs != NULL) { set_iterator it; + for (it = set_iterator_begin(back->childs); set_iterator_end(&it) > 0; set_iterator_next(it)) { - trie_node_ref ref_node = set_iterator_get_value(it); + trie_node_ref ref_node = set_iterator_value(it); trie_node current_node = &t->node_list[ref_node->index]; @@ -613,7 +614,7 @@ int trie_node_clear(trie t, trie_node n) for (it = set_iterator_begin(back->childs); set_iterator_end(&it) > 0; set_iterator_next(it)) { - trie_node_ref ref_node = set_iterator_get_value(it); + trie_node_ref ref_node = set_iterator_value(it); trie_node current_node = &t->node_list[ref_node->index]; @@ -688,7 +689,7 @@ trie_node trie_node_find(trie t, trie_key key) { for (it = set_iterator_begin(back->childs); set_iterator_end(&it) > 0; set_iterator_next(it)) { - trie_node_ref ref_node = set_iterator_get_value(it); + trie_node_ref ref_node = set_iterator_value(it); trie_node current_node = &t->node_list[ref_node->index]; diff --git a/source/benchmarks/set_bench/source/set_bench.cpp b/source/benchmarks/set_bench/source/set_bench.cpp index 3b233cfd0..2e998b0d7 100644 --- a/source/benchmarks/set_bench/source/set_bench.cpp +++ b/source/benchmarks/set_bench/source/set_bench.cpp @@ -97,7 +97,7 @@ BENCHMARK_DEFINE_F(set_bench, set_iterators) { for (set_iterator it = set_iterator_begin(s); set_iterator_end(&it) > 0; set_iterator_next(it)) { - int *i = (int *)set_iterator_get_value(it); + int *i = (int *)set_iterator_value(it); sum += ((uint64_t)(*i)); } @@ -126,7 +126,7 @@ BENCHMARK_DEFINE_F(set_bench, set_iterators_2) for (set_iterator_begin_2(s, &it); set_iterator_end_2(&it) > 0; set_iterator_next(&it)) { - int *i = (int *)set_iterator_get_value(&it); + int *i = (int *)set_iterator_value(&it); sum += ((uint64_t)(*i)); } diff --git a/source/configuration/source/configuration_object.c b/source/configuration/source/configuration_object.c index 2509992bf..cf3aaa85f 100644 --- a/source/configuration/source/configuration_object.c +++ b/source/configuration/source/configuration_object.c @@ -15,24 +15,8 @@ #include <string.h> -/* -- Forward Declarations -- */ - -struct configuration_childs_cb_iterator_type; - -/* -- Type Definitions -- */ - -typedef struct configuration_childs_cb_iterator_type *configuration_childs_cb_iterator; - /* -- Member Data -- */ -struct configuration_childs_cb_iterator_type -{ - int result; - configuration parent; - vector childs; - set storage; -}; - struct configuration_type { char *name; @@ -45,28 +29,10 @@ struct configuration_type /* -- Private Methods -- */ -static int configuration_object_initialize_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); - static char *configuration_object_read(const char *path); -static int configuration_object_childs_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); - /* -- Methods -- */ -int configuration_object_initialize_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - set map = args; - - (void)s; - - if (key != NULL && val != NULL) - { - return set_insert(map, key, val); - } - - return 0; -} - char *configuration_object_read(const char *path) { FILE *file = fopen(path, "rb"); @@ -190,7 +156,12 @@ configuration configuration_object_initialize(const char *name, const char *path if (config->parent != NULL) { - set_iterate(config->parent->map, &configuration_object_initialize_cb_iterate, config->map); + set_iterator it; + + for (it = set_iterator_begin(config->parent->map); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + set_insert(config->map, set_iterator_key(it), set_iterator_value(it)); + } } config->v = NULL; @@ -198,7 +169,7 @@ configuration configuration_object_initialize(const char *name, const char *path return config; } -int configuration_object_childs_cb_iterate_valid(set_key key, set_value val) +int configuration_object_childs_valid(set_key key, set_value val) { value v = val; @@ -243,50 +214,38 @@ int configuration_object_childs_cb_iterate_valid(set_key key, set_value val) return 1; } -int configuration_object_childs_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) +int configuration_object_childs(configuration config, vector childs, set storage) { - (void)s; + set_iterator it; - if (configuration_object_childs_cb_iterate_valid(key, val) == 0) + for (it = set_iterator_begin(config->map); set_iterator_end(&it) != 0; set_iterator_next(it)) { - configuration_childs_cb_iterator iterator = args; + set_key key = set_iterator_key(it); + set_value val = set_iterator_value(it); - if (set_get(iterator->storage, key) == NULL) + if (configuration_object_childs_valid(key, val) == 0) { - value v = val; + if (set_get(storage, key) == NULL) + { + value v = val; - const char *path = value_to_string(v); + const char *path = value_to_string(v); - configuration child = configuration_object_initialize(key, path, iterator->parent); + configuration child = configuration_object_initialize(key, path, config); - if (child == NULL) - { - iterator->result = 1; + if (child == NULL) + { + return 1; + } - return 1; + vector_push_back(childs, &child); } - - vector_push_back(iterator->childs, &child); } } return 0; } -int configuration_object_childs(configuration config, vector childs, set storage) -{ - struct configuration_childs_cb_iterator_type iterator; - - iterator.result = 0; - iterator.parent = config; - iterator.childs = childs; - iterator.storage = storage; - - set_iterate(config->map, &configuration_object_childs_cb_iterate, &iterator); - - return iterator.result; -} - void configuration_object_instantiate(configuration config, value v) { size_t index, size = value_type_count(v); diff --git a/source/configuration/source/configuration_singleton.c b/source/configuration/source/configuration_singleton.c index ea440cc7c..8fdd0aeea 100644 --- a/source/configuration/source/configuration_singleton.c +++ b/source/configuration/source/configuration_singleton.c @@ -25,10 +25,6 @@ struct configuration_singleton_type configuration global; }; -/* -- Private Methods -- */ - -static int configuration_singleton_destroy_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); - /* -- Member Data -- */ static struct configuration_singleton_type configuration_singleton_default = { @@ -115,22 +111,6 @@ int configuration_singleton_clear(configuration config) return 0; } -int configuration_singleton_destroy_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - (void)s; - (void)key; - (void)args; - - if (val != NULL) - { - configuration config = val; - - configuration_object_destroy(config); - } - - return 0; -} - void configuration_singleton_destroy(void) { configuration_singleton singleton = configuration_singleton_instance(); @@ -139,7 +119,14 @@ void configuration_singleton_destroy(void) if (singleton->scopes != NULL) { - set_iterate(singleton->scopes, &configuration_singleton_destroy_cb_iterate, NULL); + set_iterator it; + + for (it = set_iterator_begin(singleton->scopes); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + configuration config = set_iterator_value(it); + + configuration_object_destroy(config); + } set_destroy(singleton->scopes); diff --git a/source/loader/include/loader/loader.h b/source/loader/include/loader/loader.h index 441cc938e..d20931539 100644 --- a/source/loader/include/loader/loader.h +++ b/source/loader/include/loader/loader.h @@ -41,8 +41,6 @@ struct loader_type; typedef value (*loader_register_invoke)(size_t, void *[], void *); -typedef void *loader_data; - typedef struct loader_type *loader; /* -- Methods -- */ @@ -77,7 +75,7 @@ LOADER_API int loader_load_from_configuration(const loader_path path, void **han LOADER_API loader_impl loader_get_impl(const loader_tag tag); -LOADER_API loader_data loader_get(const char *name); +LOADER_API value loader_get(const char *name); LOADER_API void *loader_get_handle(const loader_tag tag, const char *name); @@ -93,7 +91,7 @@ LOADER_API const char *loader_handle_id(void *handle); LOADER_API void *loader_handle_export(void *handle); -LOADER_API loader_data loader_handle_get(void *handle, const char *name); +LOADER_API value loader_handle_get(void *handle, const char *name); LOADER_API int loader_handle_populate(void *handle_dest, void *handle_src); diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 0c055b01c..156017d24 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -46,26 +46,6 @@ #define LOADER_LIBRARY_PATH "LOADER_LIBRARY_PATH" #define LOADER_LIBRARY_DEFAULT_PATH "loaders" -/* -- Member Data -- */ - -struct loader_metadata_cb_iterator_type -{ - size_t iterator; - value *values; -}; - -struct loader_get_cb_iterator_type -{ - const char *name; - value obj; /* scope_object */ -}; - -/* -- Type Definitions -- */ - -typedef struct loader_get_cb_iterator_type *loader_get_cb_iterator; - -typedef struct loader_metadata_cb_iterator_type *loader_metadata_cb_iterator; - /* -- Private Methods -- */ static void loader_initialization_debug(void); @@ -76,10 +56,6 @@ static plugin loader_get_impl_plugin(const loader_tag tag); static plugin loader_get_impl_plugin_options(const loader_tag tag, value options); -static int loader_get_cb_iterate(plugin_manager manager, plugin p, void *data); - -static int loader_metadata_cb_iterate(plugin_manager manager, plugin p, void *data); - /* -- Member Data -- */ static plugin_manager_declare(loader_manager); @@ -560,35 +536,25 @@ int loader_load_from_configuration(const loader_path path, void **handle, void * return 0; } -int loader_get_cb_iterate(plugin_manager manager, plugin p, void *data) +value loader_get(const char *name) { - loader_impl impl = plugin_impl_type(p, loader_impl); - loader_get_cb_iterator get_iterator = data; + set_iterator it; - (void)manager; - - get_iterator->obj = loader_impl_get_value(impl, get_iterator->name); - - if (get_iterator->obj != NULL) + for (it = set_iterator_begin(loader_manager.plugins); set_iterator_end(&it) != 0; set_iterator_next(it)) { - /* TODO: Disable logs here until log is completely thread safe and async signal safe */ - /* log_write("metacall", LOG_LEVEL_DEBUG, "Loader (%s) get value: %s <%p>", plugin_name(p), get_iterator->name, (void *)get_iterator->obj); */ - return 1; - } + plugin p = set_iterator_value(it); - return 0; -} + loader_impl impl = plugin_impl_type(p, loader_impl); -loader_data loader_get(const char *name) -{ - struct loader_get_cb_iterator_type get_iterator; + value scope_object = loader_impl_get_value(impl, name); - get_iterator.name = name; - get_iterator.obj = NULL; - - plugin_manager_iterate(&loader_manager, &loader_get_cb_iterate, (void *)&get_iterator); + if (scope_object != NULL) + { + return scope_object; + } + } - return (loader_data)get_iterator.obj; + return NULL; } void *loader_get_handle(const loader_tag tag, const char *name) @@ -662,7 +628,7 @@ value loader_handle_export(void *handle) return loader_impl_handle_export(handle); } -loader_data loader_handle_get(void *handle, const char *name) +value loader_handle_get(void *handle, const char *name) { if (handle != NULL) { @@ -710,37 +676,32 @@ value loader_metadata_impl(plugin p, loader_impl impl) return v; } -int loader_metadata_cb_iterate(plugin_manager manager, plugin p, void *data) -{ - loader_impl impl = plugin_impl_type(p, loader_impl); - loader_metadata_cb_iterator metadata_iterator = data; - - (void)manager; - - metadata_iterator->values[metadata_iterator->iterator] = loader_metadata_impl(p, impl); - - if (metadata_iterator->values[metadata_iterator->iterator] != NULL) - { - ++metadata_iterator->iterator; - } - - return 0; -} - value loader_metadata(void) { - struct loader_metadata_cb_iterator_type metadata_iterator; - value v = value_create_map(NULL, plugin_manager_size(&loader_manager)); + value *values, v = value_create_map(NULL, plugin_manager_size(&loader_manager)); + set_iterator it; + size_t values_it; if (v == NULL) { return NULL; } - metadata_iterator.iterator = 0; - metadata_iterator.values = value_to_map(v); + values = value_to_map(v); + + for (it = set_iterator_begin(loader_manager.plugins), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(it)) + { + plugin p = set_iterator_value(it); + + loader_impl impl = plugin_impl_type(p, loader_impl); + + values[values_it] = loader_metadata_impl(p, impl); - plugin_manager_iterate(&loader_manager, &loader_metadata_cb_iterate, (void *)&metadata_iterator); + if (values[values_it] != NULL) + { + ++values_it; + } + } return v; } diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index fc87cb099..f069f3a58 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -65,18 +65,10 @@ struct loader_handle_impl_type; -struct loader_impl_metadata_cb_iterator_type; - -struct loader_impl_handle_register_cb_iterator_type; - /* -- Type Definitions -- */ typedef struct loader_handle_impl_type *loader_handle_impl; -typedef struct loader_impl_metadata_cb_iterator_type *loader_impl_metadata_cb_iterator; - -typedef struct loader_impl_handle_register_cb_iterator_type *loader_impl_handle_register_cb_iterator; - /* -- Member Data -- */ struct loader_impl_type @@ -109,18 +101,6 @@ struct loader_handle_impl_type vector populated_handles; /* Vector containing all the references to which this handle has been populated into, it is necessary for detach the symbols when destroying (used in load_from_* when passing an input parameter) */ }; -struct loader_impl_handle_register_cb_iterator_type -{ - context handle_ctx; - char *duplicated_key; -}; - -struct loader_impl_metadata_cb_iterator_type -{ - size_t iterator; - value *values; -}; - /* -- Private Methods -- */ static loader_impl loader_impl_allocate(const loader_tag tag); @@ -141,8 +121,6 @@ static loader_handle_impl loader_impl_load_handle(loader_impl impl, loader_impl_ static int loader_impl_handle_init(loader_impl impl, const char *path, loader_handle_impl handle_impl, void **handle_ptr, int populated); -static int loader_impl_handle_register_cb_iterate(plugin_manager manager, plugin p, void *data); - static int loader_impl_handle_register(plugin_manager manager, loader_impl impl, const char *path, loader_handle_impl handle_impl, void **handle_ptr); static size_t loader_impl_handle_name(plugin_manager manager, const loader_path path, loader_path result); @@ -155,12 +133,8 @@ static value loader_impl_metadata_handle_context(loader_handle_impl handle_impl) static value loader_impl_metadata_handle(loader_handle_impl handle_impl); -static int loader_impl_metadata_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); - static void loader_impl_destroy_handle(loader_handle_impl handle_impl); -static int loader_impl_destroy_type_map_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); - /* -- Private Member Data -- */ static const char loader_handle_impl_magic_alloc[] = "loader_handle_impl_magic_alloc"; @@ -520,59 +494,50 @@ int loader_impl_link(plugin p, loader_impl impl) we link the dependency with delay load linking. Before we execute anything, we should relink all the symbols to the host. */ -#if 0 // TODO - #if defined(WIN32) || defined(_WIN32) +#if defined(WIN32) || defined(_WIN32) || 1 // TODO: Remove this if (loader_impl_get_option_host(impl) == 1) { /* Replace loader symbols by the dependency (aka the already loaded library if the host is linked dynamically, or the executable if it is linked statically) */ - detour_handle loader_handle; - void *position = NULL; - char name[DETOUR_SYMBOL_SIZE]; - void *addr = NULL; - - loader_handle = detour_load_handle(impl->d, desc->handle); - + detour_handle loader_handle = detour_load_handle(impl->d, desc->handle); + if (loader_handle != NULL) { - set_iterator it; - size_t iterator; - - while (detour_enumerate(impl->d, loader_handle, &position, name, &addr)) + unsigned int position = 0; + const char *name = NULL; + void (**addr)(void) = NULL; + + while (detour_enumerate(impl->d, loader_handle, &position, &name, &addr) == 0) { /* Iterate through all library handles in the library map */ - it = set_iterator_begin(impl->library_map); - - for (iterator = 0; iterator < set_size(impl->library_map); ++iterator) + set_iterator it; + + for (it = set_iterator_begin(impl->library_map); set_iterator_end(&it) != 0; set_iterator_next(it)) { dynlink library_handle = set_iterator_value(it); - void *symbol = NULL; - - if (library_handle != NULL) + + /* Try to find the symbols in the dependencies, do not use the + loader dynlink handle for this, it is included in the library map */ + if (library_handle != NULL && library_handle != desc->handle) { - if (dynlink_symbol(library_handle, name, &symbol) == 0) + dynlink_symbol_addr symbol = NULL; + + if (dynlink_symbol(library_handle, name, &symbol) == 0 && symbol != NULL) { - if (symbol != NULL) + if (detour_replace(impl->d, loader_handle, name, symbol, NULL) == 0) { - if (detour_replace(impl->d, loader_handle, name, symbol, NULL) == 0) - { - /* Symbol successfully replaced */ - - break; - } + /* Symbol successfully replaced */ + break; } } } - - it = set_iterator_next(it); } } - + detour_unload(impl->d, loader_handle); } } - #endif #endif /* Store itself in the library map along with the dependencies */ @@ -1040,36 +1005,29 @@ int loader_impl_handle_init(loader_impl impl, const char *path, loader_handle_im return result; } -int loader_impl_handle_register_cb_iterate(plugin_manager manager, plugin p, void *data) -{ - loader_impl impl = plugin_impl_type(p, loader_impl); - loader_impl_handle_register_cb_iterator iterator = (loader_impl_handle_register_cb_iterator)data; - - (void)manager; - - return (context_contains(impl->ctx, iterator->handle_ctx, &iterator->duplicated_key) == 0); -} - int loader_impl_handle_register(plugin_manager manager, loader_impl impl, const char *path, loader_handle_impl handle_impl, void **handle_ptr) { /* If there's no handle input/output pointer passed as input parameter, then propagate the handle symbols to the loader context */ if (handle_ptr == NULL) { - /* This case handles the global scope (shared scope between all loaders, there is no out reference to a handle) */ - struct loader_impl_handle_register_cb_iterator_type iterator; + set_iterator it; - iterator.handle_ctx = handle_impl->ctx; - iterator.duplicated_key = NULL; - - /* This checks if there are duplicated keys between all loaders and the current handle context */ - plugin_manager_iterate(manager, &loader_impl_handle_register_cb_iterate, &iterator); - - if (iterator.duplicated_key != NULL) + /* This case handles the global scope (shared scope between all loaders, there is no out reference to a handle) */ + for (it = set_iterator_begin(manager->plugins); set_iterator_end(&it) != 0; set_iterator_next(it)) { - log_write("metacall", LOG_LEVEL_ERROR, "Duplicated symbol found named '%s' already defined in the global scope by handle: %s", iterator.duplicated_key, path); - return 1; + plugin p = set_iterator_value(it); + loader_impl other_impl = plugin_impl_type(p, loader_impl); + char *duplicated_key = NULL; + + /* This checks if there are duplicated keys between all loaders and the current handle context */ + if (context_contains(other_impl->ctx, handle_impl->ctx, &duplicated_key) == 0 && duplicated_key != NULL) + { + log_write("metacall", LOG_LEVEL_ERROR, "Duplicated symbol found named '%s' already defined in the global scope by handle: %s", duplicated_key, path); + return 1; + } } - else if (context_append(impl->ctx, handle_impl->ctx) == 0) + + if (context_append(impl->ctx, handle_impl->ctx) == 0) { return loader_impl_handle_init(impl, path, handle_impl, handle_ptr, 0); } @@ -1748,38 +1706,30 @@ value loader_impl_metadata_handle(loader_handle_impl handle_impl) return v; } -int loader_impl_metadata_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - loader_impl_metadata_cb_iterator metadata_iterator = (loader_impl_metadata_cb_iterator)args; - - (void)s; - (void)key; - - metadata_iterator->values[metadata_iterator->iterator] = loader_impl_metadata_handle((loader_handle_impl)val); - - if (metadata_iterator->values[metadata_iterator->iterator] != NULL) - { - ++metadata_iterator->iterator; - } - - return 0; -} - value loader_impl_metadata(loader_impl impl) { - struct loader_impl_metadata_cb_iterator_type metadata_iterator; - - value v = value_create_array(NULL, set_size(impl->handle_impl_path_map)); + value *values, v = value_create_array(NULL, set_size(impl->handle_impl_path_map)); + set_iterator it; + size_t values_it; if (v == NULL) { return NULL; } - metadata_iterator.iterator = 0; - metadata_iterator.values = value_to_array(v); + values = value_to_map(v); + + for (it = set_iterator_begin(impl->handle_impl_path_map), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(it)) + { + loader_handle_impl handle_impl = set_iterator_value(it); + + values[values_it] = loader_impl_metadata_handle(handle_impl); - set_iterate(impl->handle_impl_path_map, &loader_impl_metadata_cb_iterate, (set_cb_iterate_args)&metadata_iterator); + if (values[values_it] != NULL) + { + ++values_it; + } + } return v; } @@ -1820,72 +1770,6 @@ int loader_impl_clear(void *handle) return 1; } -int loader_impl_destroy_type_map_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - (void)s; - (void)key; - (void)args; - - if (val != NULL) - { - type t = val; - - type_destroy(t); - - return 0; - } - - return 1; -} - -int loader_impl_destroy_exec_path_map_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - (void)s; - (void)key; - (void)args; - - if (val != NULL) - { - vector paths = val; - - vector_destroy(paths); - } - - return 0; -} - -int loader_impl_destroy_detour_map_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - (void)s; - (void)key; - - if (val != NULL && args != NULL) - { - detour d = args; - detour_handle handle = val; - - detour_unload(d, handle); - } - - return 0; -} - -int loader_impl_destroy_dependencies_map_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - (void)s; - (void)key; - (void)args; - - if (val != NULL) - { - dynlink dependency = val; - - dynlink_unload(dependency); - } - - return 0; -} - void loader_impl_destroy_objects(loader_impl impl) { /* This iterates through all functions, classes objects and types, @@ -1924,7 +1808,16 @@ void loader_impl_destroy_objects(loader_impl impl) set_destroy(impl->handle_impl_map); /* Destroy all the types */ - set_iterate(impl->type_info_map, &loader_impl_destroy_type_map_cb_iterate, NULL); + { + set_iterator it; + + for (it = set_iterator_begin(impl->type_info_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + type t = set_iterator_value(it); + + type_destroy(t); + } + } set_destroy(impl->type_info_map); } @@ -1932,19 +1825,34 @@ void loader_impl_destroy_objects(loader_impl impl) void loader_impl_destroy_deallocate(loader_impl impl) { - set_iterate(impl->exec_path_map, &loader_impl_destroy_exec_path_map_cb_iterate, NULL); + set_iterator it; + + /* Destroy execution path map */ + for (it = set_iterator_begin(impl->exec_path_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + vector paths = set_iterator_value(it); + + vector_destroy(paths); + } set_destroy(impl->exec_path_map); + /* Destroy context */ context_destroy(impl->ctx); + /* Destroy options */ if (impl->options != NULL) { value_type_destroy(impl->options); } /* Destroy detour map */ - set_iterate(impl->detour_map, &loader_impl_destroy_detour_map_cb_iterate, impl->d); + for (it = set_iterator_begin(impl->detour_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + detour_handle handle = set_iterator_value(it); + + detour_unload(impl->d, handle); + } set_destroy(impl->detour_map); @@ -1957,7 +1865,12 @@ void loader_impl_destroy_deallocate(loader_impl impl) this method still should work because normally those handles are reference counted and we increment the reference counter at the beginning, so they will be properly unloaded when the dynlink handle gets unloaded. */ - set_iterate(impl->library_map, &loader_impl_destroy_dependencies_map_cb_iterate, NULL); + for (it = set_iterator_begin(impl->library_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + dynlink dependency = set_iterator_value(it); + + dynlink_unload(dependency); + } set_destroy(impl->library_map); diff --git a/source/loaders/rb_loader/source/rb_loader_impl_parser.c b/source/loaders/rb_loader/source/rb_loader_impl_parser.c index 3f3759d01..c8d9a3835 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl_parser.c +++ b/source/loaders/rb_loader/source/rb_loader_impl_parser.c @@ -42,12 +42,6 @@ enum rb_loader_impl_comment_state rb_loader_impl_comment_state_multi_line_end }; -/* -- Private Methods -- */ - -static int rb_loader_impl_key_print_cb_iterate(set s, set_key key, set_value v, set_cb_iterate_args args); - -static int rb_loader_impl_key_clear_cb_iterate(set s, set_key key, set_value v, set_cb_iterate_args args); - /* -- Methods -- */ int rb_loader_impl_key_parse(const char *source, set function_map) @@ -396,53 +390,38 @@ int rb_loader_impl_key_parse(const char *source, set function_map) return 0; } -int rb_loader_impl_key_print_cb_iterate(set s, set_key key, set_value v, set_cb_iterate_args args) +void rb_loader_impl_key_print(set function_map) { - size_t parameter; + set_iterator it; - rb_function_parser function = v; + for (it = set_iterator_begin(function_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + size_t parameter; - (void)s; - (void)key; - (void)args; + rb_function_parser function = set_iterator_value(it); - log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader key parse function (%s)", function->name); + log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader key parse function (%s)", function->name); - for (parameter = 0; parameter < function->params_size; ++parameter) - { - log_write("metacall", LOG_LEVEL_DEBUG, " Ruby loader key parse parameter [%d] (%s : %s)", - function->params[parameter].index, - function->params[parameter].name, - function->params[parameter].type); + for (parameter = 0; parameter < function->params_size; ++parameter) + { + log_write("metacall", LOG_LEVEL_DEBUG, " Ruby loader key parse parameter [%d] (%s : %s)", + function->params[parameter].index, + function->params[parameter].name, + function->params[parameter].type); + } } - - return 0; } -void rb_loader_impl_key_print(set function_map) -{ - set_iterate(function_map, &rb_loader_impl_key_print_cb_iterate, NULL); -} - -int rb_loader_impl_key_clear_cb_iterate(set s, set_key key, set_value v, set_cb_iterate_args args) +void rb_loader_impl_key_clear(set function_map) { - rb_function_parser function = v; + set_iterator it; - (void)s; - (void)key; - (void)args; - - if (function != NULL) + for (it = set_iterator_begin(function_map); set_iterator_end(&it) != 0; set_iterator_next(it)) { + rb_function_parser function = set_iterator_value(it); + free(function); } - return 0; -} - -void rb_loader_impl_key_clear(set function_map) -{ - set_iterate(function_map, &rb_loader_impl_key_clear_cb_iterate, NULL); - set_destroy(function_map); } diff --git a/source/plugin/include/plugin/plugin_manager.h b/source/plugin/include/plugin/plugin_manager.h index 724db1c30..a4340bb59 100644 --- a/source/plugin/include/plugin/plugin_manager.h +++ b/source/plugin/include/plugin/plugin_manager.h @@ -64,7 +64,7 @@ struct plugin_manager_type struct plugin_manager_interface_type { - int (*clear)(plugin_manager, plugin); /* Hook for clearing the plugin implementation */ + void (*clear)(plugin_manager, plugin); /* Hook for clearing the plugin implementation */ void (*destroy)(plugin_manager, void *); /* Hook for destroying the plugin manager implementation */ }; @@ -86,8 +86,6 @@ PLUGIN_API plugin plugin_manager_create(plugin_manager manager, const char *name PLUGIN_API plugin plugin_manager_get(plugin_manager manager, const char *name); -PLUGIN_API void plugin_manager_iterate(plugin_manager manager, int (*iterator)(plugin_manager, plugin, void *), void *data); - PLUGIN_API int plugin_manager_clear(plugin_manager manager, plugin p); PLUGIN_API void plugin_manager_destroy(plugin_manager manager); diff --git a/source/plugin/source/plugin_manager.c b/source/plugin/source/plugin_manager.c index 8f7f615a0..c22237543 100644 --- a/source/plugin/source/plugin_manager.c +++ b/source/plugin/source/plugin_manager.c @@ -34,20 +34,9 @@ #include <winbase.h> /* SetDllDirectoryA */ #endif -/* -- Declarations -- */ - -struct plugin_manager_iterate_cb_type -{ - plugin_manager manager; - int (*iterator)(plugin_manager, plugin, void *); - void *data; -}; - /* -- Private Methods -- */ static int plugin_manager_unregister(plugin_manager manager, plugin p); -static int plugin_manager_iterate_cb(set s, set_key key, set_value val, set_cb_iterate_args args); -static int plugin_manager_destroy_cb(set s, set_key key, set_value val, set_cb_iterate_args args); /* -- Methods -- */ @@ -234,36 +223,6 @@ plugin plugin_manager_get(plugin_manager manager, const char *name) return set_get(manager->plugins, (set_key)name); } -int plugin_manager_iterate_cb(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - (void)s; - (void)key; - - if (val != NULL && args != NULL) - { - struct plugin_manager_iterate_cb_type *args_ptr = (struct plugin_manager_iterate_cb_type *)args; - return args_ptr->iterator(args_ptr->manager, (plugin)val, args_ptr->data); - } - - return 0; -} - -void plugin_manager_iterate(plugin_manager manager, int (*iterator)(plugin_manager, plugin, void *), void *data) -{ - if (iterator == NULL) - { - return; - } - - struct plugin_manager_iterate_cb_type args = { - manager, - iterator, - data - }; - - set_iterate(manager->plugins, &plugin_manager_iterate_cb, (void *)&args); -} - int plugin_manager_unregister(plugin_manager manager, plugin p) { const char *name = plugin_name(p); @@ -299,35 +258,6 @@ int plugin_manager_clear(plugin_manager manager, plugin p) return result; } -int plugin_manager_destroy_cb(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - int result = 0; - - (void)s; - (void)key; - - if (val != NULL) - { - plugin p = (plugin)val; - - if (args != NULL) - { - plugin_manager manager = (plugin_manager)args; - - if (manager->iface != NULL && manager->iface->clear != NULL) - { - /* Call to the clear method of the manager */ - result = manager->iface->clear(manager, p); - } - } - - /* Unload the dynamic link library and destroy the plugin */ - plugin_destroy(p); - } - - return result; -} - void plugin_manager_destroy(plugin_manager manager) { /* If there's a destroy callback, probably the plugin manager needs a complex destroy algorithm */ @@ -340,7 +270,21 @@ void plugin_manager_destroy(plugin_manager manager) * plugin set and this will do nothing if the set has been emptied before with plugin_manager_clear */ if (manager->plugins != NULL) { - set_iterate(manager->plugins, &plugin_manager_destroy_cb, NULL); + set_iterator it; + + for (it = set_iterator_begin(manager->plugins); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + plugin p = set_iterator_value(it); + + if (manager->iface != NULL && manager->iface->clear != NULL) + { + /* Call to the clear method of the manager */ + manager->iface->clear(manager, p); + } + + /* Unload the dynamic link library and destroy the plugin */ + plugin_destroy(p); + } } /* Clear the name */ diff --git a/source/reflect/source/reflect_class.c b/source/reflect/source/reflect_class.c index c0f35f6e0..e54239a02 100644 --- a/source/reflect/source/reflect_class.c +++ b/source/reflect/source/reflect_class.c @@ -50,28 +50,17 @@ struct class_type set static_attributes; }; -struct class_metadata_iterator_args_type -{ - value v; - size_t count; -}; - -typedef struct class_metadata_iterator_args_type *class_metadata_iterator_args; - reflect_memory_tracker(class_stats); static value class_metadata_name(klass cls); static value class_metadata_constructors(klass cls); -static int class_metadata_methods_impl_cb_iterate(map m, map_key key, map_value val, map_cb_iterate_args args); static value class_metadata_methods_impl(const char name[], size_t size, map methods); static value class_metadata_methods(klass cls); static value class_metadata_static_methods(klass cls); -static int class_metadata_attributes_impl_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); static value class_metadata_attributes_impl(const char name[], size_t size, set attributes); static value class_metadata_attributes(klass cls); static value class_metadata_static_attributes(klass cls); static method class_get_method_type_safe(vector v, type_id ret, type_id args[], size_t size); -static int class_attributes_destroy_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); static void class_constructors_destroy(klass cls); klass class_create(const char *name, enum accessor_type_id accessor, class_impl impl, class_impl_interface_singleton singleton) @@ -266,7 +255,7 @@ value class_metadata_methods_impl(const char name[], size_t size, map methods) value v = value_create_array(NULL, 2); value *v_array; map_iterator it; - size_t count = 0; + size_t count; if (v == NULL) { @@ -288,11 +277,11 @@ value class_metadata_methods_impl(const char name[], size_t size, map methods) goto error_value; } - for (it = map_iterator_begin(methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + for (it = map_iterator_begin(methods), count = 0; map_iterator_end(&it) != 0; map_iterator_next(it)) { value *method_array = value_to_array(v_array[1]); - method_array[count++] = method_metadata((method)map_iterator_get_value(it)); + method_array[count++] = method_metadata((method)map_iterator_value(it)); } return v; @@ -313,23 +302,12 @@ value class_metadata_static_methods(klass cls) return class_metadata_methods_impl(name, sizeof(name), cls->static_methods); } -int class_metadata_attributes_impl_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - class_metadata_iterator_args iterator = (class_metadata_iterator_args)args; - value *v_array = value_to_array(iterator->v); - - (void)s; - (void)key; - - v_array[iterator->count++] = attribute_metadata((attribute)val); - - return 0; -} - value class_metadata_attributes_impl(const char name[], size_t size, set attributes) { value v = value_create_array(NULL, 2); value *v_array; + set_iterator it; + size_t count; if (v == NULL) { @@ -351,12 +329,12 @@ value class_metadata_attributes_impl(const char name[], size_t size, set attribu goto error_value; } - struct class_metadata_iterator_args_type iterator; - - iterator.v = v_array[1]; - iterator.count = 0; + for (it = set_iterator_begin(attributes), count = 0; set_iterator_end(&it) != 0; set_iterator_next(it)) + { + value *attribute_array = value_to_array(v_array[1]); - set_iterate(attributes, &class_metadata_attributes_impl_cb_iterate, &iterator); + attribute_array[count++] = attribute_metadata(set_iterator_value(it)); + } return v; error_value: @@ -779,22 +757,6 @@ value class_static_await(klass cls, method m, class_args args, size_t size, clas return NULL; } -int class_attributes_destroy_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - (void)s; - (void)key; - (void)args; - - if (val != NULL) - { - attribute attr = val; - - attribute_destroy(attr); - } - - return 0; -} - void class_constructors_destroy(klass cls) { size_t iterator, size = vector_size(cls->constructors); @@ -823,8 +785,6 @@ void class_destroy(klass cls) if (threading_atomic_ref_count_load(&cls->ref) == 0) { - map_iterator it; - /* TODO: Disable logs here until log is completely thread safe and async signal safe */ /* @@ -840,17 +800,34 @@ void class_destroy(klass cls) class_constructors_destroy(cls); - set_iterate(cls->attributes, &class_attributes_destroy_cb_iterate, NULL); - set_iterate(cls->static_attributes, &class_attributes_destroy_cb_iterate, NULL); - - for (it = map_iterator_begin(cls->methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + /* Destroy attributes */ { - method_destroy((method)map_iterator_get_value(it)); + set_iterator it; + + for (it = set_iterator_begin(cls->attributes); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + attribute_destroy(set_iterator_value(it)); + } + + for (it = set_iterator_begin(cls->static_attributes); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + attribute_destroy(set_iterator_value(it)); + } } - for (it = map_iterator_begin(cls->static_methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + /* Destroy methods */ { - method_destroy((method)map_iterator_get_value(it)); + map_iterator it; + + for (it = map_iterator_begin(cls->methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + { + method_destroy(map_iterator_value(it)); + } + + for (it = map_iterator_begin(cls->static_methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + { + method_destroy(map_iterator_value(it)); + } } if (cls->interface != NULL && cls->interface->destroy != NULL) diff --git a/source/reflect/source/reflect_scope.c b/source/reflect/source/reflect_scope.c index 3942bb8ee..c030c3e37 100644 --- a/source/reflect/source/reflect_scope.c +++ b/source/reflect/source/reflect_scope.c @@ -30,14 +30,6 @@ #include <stdlib.h> #include <string.h> -struct scope_metadata_array_cb_iterator_type; - -struct scope_export_cb_iterator_type; - -typedef struct scope_metadata_array_cb_iterator_type *scope_metadata_array_cb_iterator; - -typedef struct scope_export_cb_iterator_type *scope_export_cb_iterator; - struct scope_type { char *name; /**< Scope name */ @@ -45,32 +37,11 @@ struct scope_type vector call_stack; /**< Scope call stack */ }; -struct scope_metadata_array_cb_iterator_type -{ - value *functions; - value *classes; - value *objects; - - size_t functions_size; - size_t classes_size; - size_t objects_size; -}; - -struct scope_export_cb_iterator_type -{ - size_t iterator; - value *values; -}; - -static int scope_metadata_array_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); - -static int scope_export_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); - static int scope_metadata_array(scope sp, value v_array[3]); static value scope_metadata_name(scope sp); -static int scope_destroy_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args); +static value scope_export_value(const char *key, value val); scope scope_create(const char *name) { @@ -193,106 +164,94 @@ int scope_define(scope sp, const char *key, value val) return 1; } -int scope_metadata_array_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) +int scope_metadata_array(scope sp, value v_array[3]) { - scope_metadata_array_cb_iterator metadata_iterator = (scope_metadata_array_cb_iterator)args; + size_t functions_size = 0, classes_size = 0, objects_size = 0; + value functions_value, classes_value, objects_value; + value *functions, *classes, *objects; + set_iterator it; - (void)s; - (void)key; - - type_id id = value_type_id(val); - - if (id == TYPE_FUNCTION) + for (it = set_iterator_begin(sp->objects); set_iterator_end(&it) != 0; set_iterator_next(it)) { - metadata_iterator->functions[metadata_iterator->functions_size++] = function_metadata(value_to_function(val)); - } - else if (id == TYPE_CLASS) - { - metadata_iterator->classes[metadata_iterator->classes_size++] = class_metadata(value_to_class(val)); - } - else if (id == TYPE_OBJECT) - { - metadata_iterator->objects[metadata_iterator->objects_size++] = object_metadata(value_to_object(val)); - } - - return 0; -} - -int scope_metadata_array_cb_iterate_counter(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - scope_metadata_array_cb_iterator metadata_iterator = (scope_metadata_array_cb_iterator)args; - - (void)s; - (void)key; - - type_id id = value_type_id(val); + type_id id = value_type_id(set_iterator_value(it)); - if (id == TYPE_FUNCTION) - { - metadata_iterator->functions_size++; - } - else if (id == TYPE_CLASS) - { - metadata_iterator->classes_size++; - } - else if (id == TYPE_OBJECT) - { - metadata_iterator->objects_size++; + if (id == TYPE_FUNCTION) + { + functions_size++; + } + else if (id == TYPE_CLASS) + { + classes_size++; + } + else if (id == TYPE_OBJECT) + { + objects_size++; + } } - return 0; -} - -int scope_metadata_array(scope sp, value v_array[3]) -{ - struct scope_metadata_array_cb_iterator_type metadata_iterator = { - NULL, NULL, NULL, 0, 0, 0 - }; + functions_value = value_create_array(NULL, functions_size); - set_iterate(sp->objects, &scope_metadata_array_cb_iterate_counter, (set_cb_iterate_args)&metadata_iterator); - - value functions_val = value_create_array(NULL, metadata_iterator.functions_size); - - if (functions_val == NULL) + if (functions_value == NULL) { - return 1; + goto functions_error; } - metadata_iterator.functions = value_to_array(functions_val); + functions = value_to_array(functions_value); - value classes_val = value_create_array(NULL, metadata_iterator.classes_size); + classes_value = value_create_array(NULL, classes_size); - if (classes_val == NULL) + if (classes_value == NULL) { - value_destroy(functions_val); - return 1; + goto classes_error; } - metadata_iterator.classes = value_to_array(classes_val); + classes = value_to_array(classes_value); - value objects_val = value_create_array(NULL, metadata_iterator.objects_size); + objects_value = value_create_array(NULL, objects_size); - if (objects_val == NULL) + if (objects_value == NULL) { - value_destroy(functions_val); - value_destroy(classes_val); - return 1; + goto objects_error; } - metadata_iterator.objects = value_to_array(objects_val); + objects = value_to_array(objects_value); /* Reuse counters to fill the arrays */ - metadata_iterator.classes_size = 0; - metadata_iterator.functions_size = 0; - metadata_iterator.objects_size = 0; + classes_size = 0; + functions_size = 0; + objects_size = 0; + + for (it = set_iterator_begin(sp->objects); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + value v = set_iterator_value(it); + type_id id = value_type_id(v); - set_iterate(sp->objects, &scope_metadata_array_cb_iterate, (set_cb_iterate_args)&metadata_iterator); + if (id == TYPE_FUNCTION) + { + functions[functions_size++] = function_metadata(value_to_function(v)); + } + else if (id == TYPE_CLASS) + { + classes[classes_size++] = class_metadata(value_to_class(v)); + } + else if (id == TYPE_OBJECT) + { + objects[objects_size++] = object_metadata(value_to_object(v)); + } + } - v_array[0] = functions_val; - v_array[1] = classes_val; - v_array[2] = objects_val; + v_array[0] = functions_value; + v_array[1] = classes_value; + v_array[2] = objects_value; return 0; + +objects_error: + value_destroy(classes_value); +classes_error: + value_destroy(functions_value); +functions_error: + return 1; } value scope_metadata_name(scope sp) @@ -379,62 +338,60 @@ value scope_metadata(scope sp) return v; } -int scope_export_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) +value scope_export_value(const char *key, value val) { - scope_export_cb_iterator export_iterator = (scope_export_cb_iterator)args; - - const char *key_str = (const char *)key; - value *v_array, v = value_create_array(NULL, 2); - (void)s; - if (v == NULL) { - return 0; + goto array_create_error; } v_array = value_to_array(v); - v_array[0] = value_create_string(key_str, strlen(key_str)); + v_array[0] = value_create_string(key, strlen(key)); if (v_array[0] == NULL) { - value_type_destroy(v); - - return 0; + goto string_create_error; } v_array[1] = value_type_copy(val); if (v_array[1] == NULL) { - value_type_destroy(v); - - return 0; + goto value_copy_error; } - export_iterator->values[export_iterator->iterator] = v; - ++export_iterator->iterator; + return v; - return 0; +value_copy_error: + value_type_destroy(v_array[0]); +string_create_error: + value_type_destroy(v); +array_create_error: + return NULL; } value scope_export(scope sp) { - struct scope_export_cb_iterator_type export_iterator; - - value export = value_create_map(NULL, scope_size(sp)); + value *values, export = value_create_map(NULL, scope_size(sp)); + size_t values_it; + set_iterator it; if (export == NULL) { return NULL; } - export_iterator.iterator = 0; - export_iterator.values = value_to_map(export); + values = value_to_map(export); - set_iterate(sp->objects, &scope_export_cb_iterate, (set_cb_iterate_args)&export_iterator); + for (it = set_iterator_begin(sp->objects), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(it)) + { + value v = scope_export_value(set_iterator_key(it), set_iterator_value(it)); + + values[values_it++] = v; + } return export; } @@ -592,27 +549,16 @@ int scope_stack_pop(scope sp) return 1; } -int scope_destroy_cb_iterate(set s, set_key key, set_value val, set_cb_iterate_args args) -{ - (void)s; - (void)key; - (void)args; - - if (val != NULL) - { - value_type_destroy(val); - - return 0; - } - - return 1; -} - void scope_destroy(scope sp) { if (sp != NULL) { - set_iterate(sp->objects, &scope_destroy_cb_iterate, NULL); + set_iterator it; + + for (it = set_iterator_begin(sp->objects); set_iterator_end(&it) != 0; set_iterator_next(it)) + { + value_type_destroy(set_iterator_value(it)); + } set_destroy(sp->objects); diff --git a/source/tests/adt_map_test/source/adt_map_test.cpp b/source/tests/adt_map_test/source/adt_map_test.cpp index 5e6e76fc7..74498fe4c 100644 --- a/source/tests/adt_map_test/source/adt_map_test.cpp +++ b/source/tests/adt_map_test/source/adt_map_test.cpp @@ -119,8 +119,8 @@ TEST_F(adt_map_test, map_int) for (map_iterator it = map_iterator_begin(m); map_iterator_end(&it) != 0; map_iterator_next(it)) { - char *key = (char *)map_iterator_get_key(it); - int *value = (int *)map_iterator_get_value(it); + char *key = (char *)map_iterator_key(it); + int *value = (int *)map_iterator_value(it); log_write("metacall", LOG_LEVEL_DEBUG, "[%s -> %d]", (char *)key, *((int *)(value))); diff --git a/source/tests/adt_set_test/source/adt_set_test.cpp b/source/tests/adt_set_test/source/adt_set_test.cpp index 429073999..3747f5165 100644 --- a/source/tests/adt_set_test/source/adt_set_test.cpp +++ b/source/tests/adt_set_test/source/adt_set_test.cpp @@ -129,8 +129,8 @@ TEST_F(adt_set_test, DefaultConstructor) for (set_iterator it = set_iterator_begin(s); set_iterator_end(&it) != 0; set_iterator_next(it)) { - char *key = (char *)set_iterator_get_key(it); - int *value = (int *)set_iterator_get_value(it); + char *key = (char *)set_iterator_key(it); + int *value = (int *)set_iterator_value(it); log_write("metacall", LOG_LEVEL_DEBUG, "[%s -> %d]", (char *)key, *((int *)(value))); From 35aea2b47ea1193ce6fb0a99c0d58749197c4645 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 9 May 2025 17:51:37 +0200 Subject: [PATCH 273/487] Added loongarch64, windows working well, add doc for architectures. --- .github/workflows/docker-hub.yml | 4 ++-- docs/README.md | 24 ++++++++++++------------ source/loader/source/loader_impl.c | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 2cbe1634d..fbb879014 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -24,7 +24,6 @@ env: # TODO: Not tested or no hooking support # - linux/mips64le # - linux/mips64 - # - linux/loong64 PLATFORM_LIST: > [ "linux/amd64", @@ -35,7 +34,8 @@ env: "linux/riscv64", "linux/ppc64le", "linux/arm/v7", - "linux/arm/v6" + "linux/arm/v6", + "linux/loong64" ] jobs: diff --git a/docs/README.md b/docs/README.md index 3c348b9f8..c93a23188 100644 --- a/docs/README.md +++ b/docs/README.md @@ -116,7 +116,7 @@ This section describes all programming languages that **METACALL** allows to loa | [Java](https://www.java.com) | [JVM](https://en.wikipedia.org/wiki/Java_virtual_machine) | **>=11** | java | | [WebAssembly](https://webassembly.org/) | [Wasmtime](https://github.com/bytecodealliance/wasmtime) | **>= 0.27 <= 8.0.1** | wasm | | [C](<https://en.wikipedia.org/wiki/C_(programming_language)>) | [libclang](https://clang.llvm.org/doxygen/group__CINDEX.html) - [Tiny C Compiler](https://bellard.org/tcc/) - [libffi](http://sourceware.org/libffi/) | **>=12** - **>=2021-10-30** - **>=3.2** | c | -| [Rust](https://www.rust-lang.org/) | [rustc](https://doc.rust-lang.org/rustc/what-is-rustc.html) - [libffi](http://sourceware.org/libffi/) | **nightly-2021-12-04** | rs | +| [Rust](https://www.rust-lang.org/) | [rustc](https://doc.rust-lang.org/rustc/what-is-rustc.html) - [libffi](http://sourceware.org/libffi/) | **nightly-2021-12-04** | rs | - Languages and run-times under construction: @@ -663,11 +663,11 @@ It is possible to enable or disable concrete loaders, script, ports, serials or | Build Option Prefix | Build Option Suffix | | :-----------------------: | --------------------------------------------------------------------- | -| **OPTION*BUILD_LOADERS*** | `C` `JS` `CS` `MOCK` `PY` `JSM` `NODE` `RB` `FILE` | -| **OPTION*BUILD_SCRIPTS*** | `C` `CS` `JS` `NODE` `PY` `RB` `JAVA` | -| **OPTION*BUILD_SERIALS*** | `METACALL` `RAPID_JSON` | -| **OPTION*BUILD_DETOURS*** | `PLTHOOK` | -| **OPTION*BUILD_PORTS*** | `CS` `CXX` `D` `GO` `JAVA` `JS` `LUA` `NODE` `PHP` `PL` `PY` `R` `RB` | +| **OPTION_BUILD_LOADERS_*** | `C` `JS` `CS` `MOCK` `PY` `JSM` `NODE` `RB` `FILE` | +| **OPTION_BUILD_SCRIPTS_*** | `C` `CS` `JS` `NODE` `PY` `RB` `JAVA` | +| **OPTION_BUILD_SERIALS_*** | `METACALL` `RAPID_JSON` | +| **OPTION_BUILD_DETOURS_*** | `PLTHOOK` | +| **OPTION_BUILD_PORTS_*** | `CS` `CXX` `D` `GO` `JAVA` `JS` `LUA` `NODE` `PHP` `PL` `PY` `R` `RB` | To format the entire C/C++ codebase use: @@ -740,12 +740,12 @@ Click the button below. A workspace with all required environments will be creat The following platforms and architectures have been tested and are known to work correctly with all plugins of **METACALL**. -| Operative System | Architecture | Compiler | -| :--------------: | :-----------------: | :---------: | -| **`ubuntu`** | **`amd64`** | **`gcc`** | -| **`debian`** | **`amd64`** | **`gcc`** | -| **`debian`** | **`amd64`** | **`clang`** | -| **`windows`** | **`x86`** **`x64`** | **`msvc`** | +| Operative System | Architecture | Compiler | +| :--------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :---------: | +| **`ubuntu`** | **`amd64`** | **`gcc`** | +| **`debian`** | **`amd64`** **`amd64/v2`** **`amd64/v3`** **`386`** **`arm64`** **`riscv64`** **`ppc64le`** **`arm/v7`** **`arm/v6`** **`loong64`** | **`gcc`** | +| **`macos`** | **`amd64`** **`arm64`** | **`clang`** | +| **`windows`** | **`x86`** **`x64`** | **`msvc`** | ### 7.1 Docker Support diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index f069f3a58..c47db9e27 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -494,7 +494,7 @@ int loader_impl_link(plugin p, loader_impl impl) we link the dependency with delay load linking. Before we execute anything, we should relink all the symbols to the host. */ -#if defined(WIN32) || defined(_WIN32) || 1 // TODO: Remove this +#if defined(WIN32) || defined(_WIN32) if (loader_impl_get_option_host(impl) == 1) { /* Replace loader symbols by the dependency (aka the already loaded From 93aa42db905995fb4549dcd122302d5efbefac51 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 14 May 2025 17:56:24 +0200 Subject: [PATCH 274/487] Trying to solve issues with loongarch64. --- .github/workflows/docker-hub.yml | 2 +- docker-compose.sh | 6 ++++++ .../source/metacall_node_python_ruby_test.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index fbb879014..c4952c9c4 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -21,7 +21,7 @@ env: # TODO: Tests failing # - linux/s390x - # TODO: Not tested or no hooking support + # TODO: Not tested or detour not supported # - linux/mips64le # - linux/mips64 PLATFORM_LIST: > diff --git a/docker-compose.sh b/docker-compose.sh index f2f134230..b10ebaa4c 100755 --- a/docker-compose.sh +++ b/docker-compose.sh @@ -206,6 +206,12 @@ sub_platform() { exit 1 fi + # Debian in Docker Hub does not support LoongArch64 yet, let's use official LoongArch repository instead + if [ "$METACALL_PLATFORM" = "linux/loong64" ]; then + source .env + export METACALL_BASE_IMAGE="ghcr.io/loong64/${METACALL_BASE_IMAGE}" + fi + ln -sf tools/deps/.dockerignore .dockerignore $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build deps diff --git a/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp b/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp index 0ba5f3ba3..0cf822240 100644 --- a/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp +++ b/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp @@ -86,7 +86,7 @@ TEST_F(metacall_node_python_ruby_test, DefaultConstructor) "module.exports = {\n" " test: async function () {\n" " try {\n" - " const result = fetch('http://github.com/service/https://www.google.com/');\n" + " const result = fetch('http://github.com/service/https://www.google.com/', { signal: AbortSignal.timeout(30000) });\n" " console.log(result);\n" " return true;\n" " } catch (e) {\n" From 2b3651136f64d914ef5525ff19f19d5700ec9c6a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 15 May 2025 19:32:58 +0200 Subject: [PATCH 275/487] Solve issues in macos node port executable. --- source/portability/source/portability_library_path.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index 10e3ad64b..25cad4a32 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -190,7 +190,8 @@ int portability_library_path_find(const char name[], portability_library_path_st memcpy(path, dylib_suffix, sizeof(dylib_suffix)); } - for (image_index = 0; image_index < size; ++image_index) + /* Start from 1 so we avoid the executable itself */ + for (image_index = 1; image_index < size; ++image_index) { const char *image_name = _dyld_get_image_name(image_index); @@ -242,7 +243,8 @@ int portability_library_path_list(portability_library_path_list_cb callback, voi { uint32_t iterator, size = _dyld_image_count(); - for (iterator = 0; iterator < size; ++iterator) + /* Start from 1 so we avoid the executable itself */ + for (iterator = 1; iterator < size; ++iterator) { const char *image_name = _dyld_get_image_name(iterator); From 5a4adc530134343ab00ad13c1c876b580d51bd55 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 16 May 2025 17:16:43 +0200 Subject: [PATCH 276/487] Trying to solve issues of dockerhub multi arch builds. --- .github/workflows/docker-hub.yml | 8 ++++---- docker-compose.sh | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index c4952c9c4..907dc9ba3 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -21,7 +21,7 @@ env: # TODO: Tests failing # - linux/s390x - # TODO: Not tested or detour not supported + # TODO: Detour not supported, needs to patch GOT instead of PLT # - linux/mips64le # - linux/mips64 PLATFORM_LIST: > @@ -98,9 +98,9 @@ jobs: DOCKER_BUILDKIT: 1 run: | set -exuo pipefail - docker image inspect ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli --format='{{.Os}}/{{.Architecture}}' + docker image inspect ${DOCKER_USERNAME}/${IMAGE_NAME}:cli --format='{{.Os}}/{{.Architecture}}' cat <<EOF > Dockerfile.test - FROM ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:cli + FROM ${DOCKER_USERNAME}/${IMAGE_NAME}:cli RUN apt-get update && apt-get install -y file RUN file /usr/local/bin/metacallcli && ldd /usr/local/bin/metacallcli RUN echo "console.log('0123456789abcdef')" > script.js @@ -117,7 +117,7 @@ jobs: platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-') for tag in "deps" "dev" "runtime" "cli"; do docker tag \ - ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} \ + ${DOCKER_USERNAME}/${IMAGE_NAME}:${tag} \ ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/${IMAGE_NAME}:${tag}-${platform_tag} echo "Pushing image for tag: ${tag} with platform: ${platform_tag}" diff --git a/docker-compose.sh b/docker-compose.sh index b10ebaa4c..4759e59c1 100755 --- a/docker-compose.sh +++ b/docker-compose.sh @@ -206,23 +206,33 @@ sub_platform() { exit 1 fi + # Initialize QEMU for Buildkit + docker run --rm --privileged tonistiigi/binfmt --install all + # Debian in Docker Hub does not support LoongArch64 yet, let's use official LoongArch repository instead if [ "$METACALL_PLATFORM" = "linux/loong64" ]; then source .env export METACALL_BASE_IMAGE="ghcr.io/loong64/${METACALL_BASE_IMAGE}" fi + # Generate the docker compose file with all .env variables substituted (bake seems not to support this) + $DOCKER_COMPOSE config &> docker-compose.bake.yml + + # Build with Bake, so the image can be loaded into local docker context ln -sf tools/deps/.dockerignore .dockerignore - $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build deps + docker buildx bake -f docker-compose.bake.yml -f docker-compose.platform.yml --load deps ln -sf tools/dev/.dockerignore .dockerignore - $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build dev + docker buildx bake -f docker-compose.bake.yml -f docker-compose.platform.yml --load dev ln -sf tools/runtime/.dockerignore .dockerignore - $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build runtime + docker buildx bake -f docker-compose.bake.yml -f docker-compose.platform.yml --load runtime ln -sf tools/cli/.dockerignore .dockerignore - $DOCKER_COMPOSE -f docker-compose.yml -f docker-compose.platform.yml build cli + docker buildx bake -f docker-compose.bake.yml -f docker-compose.platform.yml --load cli + + # Delete temporal docker compose file + rm -rf docker-compose.bake.yml } # Push MetaCall Docker Compose From 4d67638ddfc1c60cccbc1f8f85d0df21d41a7f81 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 16 May 2025 18:00:16 +0200 Subject: [PATCH 277/487] Add base for python.exe support in python loader and port. --- source/configuration/CMakeLists.txt | 4 + source/loaders/py_loader/CMakeLists.txt | 44 +++- .../include/py_loader/py_loader_port.h | 6 +- .../loaders/py_loader/source/py_loader_impl.c | 38 +-- .../loaders/py_loader/source/py_loader_port.c | 43 +-- source/ports/py_port/helper.py | 240 ----------------- source/ports/py_port/helper/__init__.py | 245 ------------------ source/ports/py_port/metacall/api.py | 103 ++++++-- source/ports/py_port/metacall/module_linux.py | 54 ---- source/ports/py_port/metacall/module_win32.py | 82 ------ source/ports/py_port/setup.py | 79 ------ .../CMakeLists.txt | 43 +++ .../data/configurations/py_loader.json.in | 5 +- .../metacall_python_port_test/CMakeLists.txt | 10 +- 14 files changed, 220 insertions(+), 776 deletions(-) delete mode 100644 source/ports/py_port/helper.py delete mode 100644 source/ports/py_port/helper/__init__.py delete mode 100644 source/ports/py_port/metacall/module_linux.py delete mode 100644 source/ports/py_port/metacall/module_win32.py diff --git a/source/configuration/CMakeLists.txt b/source/configuration/CMakeLists.txt index 4097b1d54..4e3405db3 100644 --- a/source/configuration/CMakeLists.txt +++ b/source/configuration/CMakeLists.txt @@ -191,6 +191,10 @@ function(configurations_write config_dir config_path) set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"node_loader\":\"${config_dir}/node_loader.json\",") endif() + if(OPTION_BUILD_LOADERS_PY) + set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"py_loader\":\"${config_dir}/py_loader.json\",") + endif() + #if(OPTION_BUILD_LOADERS_JS) # set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"js_loader\":\"${config_dir}/js_loader.json\",") #endif() diff --git a/source/loaders/py_loader/CMakeLists.txt b/source/loaders/py_loader/CMakeLists.txt index b2957ff0f..90c650490 100644 --- a/source/loaders/py_loader/CMakeLists.txt +++ b/source/loaders/py_loader/CMakeLists.txt @@ -33,20 +33,22 @@ if(PROJECT_OS_FAMILY STREQUAL win32 AND Python3_LIBRARIES AND Python3_ROOT_DIR A # Get the library name get_filename_component(LIB_NAME "${LIB_PATH}" NAME) # Find the library in the Python3 root path - find_file(Python3_LIBRARY_NAME ${LIB_NAME} + find_file(Python3_LIBRARY_NAME_PATH ${LIB_NAME} PATHS ${Python3_ROOT_DIR} NO_DEFAULT_PATH ) - if(Python3_LIBRARY_NAME) + if(Python3_LIBRARY_NAME_PATH) break() endif() endif() endforeach() endif() -if(Python3_LIBRARY_NAME) +if(Python3_LIBRARY_NAME_PATH) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_OUTPUT_DIR}) - file(COPY "${Python3_LIBRARY_NAME}" DESTINATION ${PROJECT_OUTPUT_DIR}) + file(COPY "${Python3_LIBRARY_NAME_PATH}" DESTINATION ${PROJECT_OUTPUT_DIR}) +else() + set(Python3_LIBRARY_NAME_PATH "${Python3_LIBRARIES}") endif() # @@ -169,7 +171,10 @@ target_include_directories(${target} target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - ${Python3_LIBRARIES} # Python libraries + + # Delay load for MSVC + $<$<CXX_COMPILER_ID:MSVC>:${Python3_LIBRARIES}> # Python library + $<$<CXX_COMPILER_ID:MSVC>:delayimp> PUBLIC ${DEFAULT_LIBRARIES} @@ -183,7 +188,6 @@ target_link_libraries(${target} target_compile_definitions(${target} PRIVATE - PY_LOADER_PORT_NAME=$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:lib>py_loader$<$<CONFIG:DEBUG>:d> PUBLIC $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${target_upper}_STATIC_DEFINE> @@ -209,8 +213,12 @@ target_compile_options(${target} # Linker options # +get_filename_component(Python3_LIBRARY_NAME "${Python3_LIBRARY_NAME_PATH}" NAME) + target_link_options(${target} PRIVATE + $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> + $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${Python3_LIBRARY_NAME}> PUBLIC ${DEFAULT_LINKER_OPTIONS} @@ -233,10 +241,30 @@ install(TARGETS ${target} # Runtime (pack Python DLL in windows) # TODO: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies # TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da -if(Python3_LIBRARY_NAME) +set(Python3_LIBRARY_DEVELOPMENT "${Python3_LIBRARY_NAME_PATH}") + +if(Python3_LIBRARY_NAME_PATH AND PROJECT_OS_FAMILY STREQUAL win32) install(FILES - "${Python3_LIBRARY_NAME}" + "${Python3_LIBRARY_NAME_PATH}" DESTINATION ${INSTALL_LIB} COMPONENT runtime ) + + set(Python3_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${Python3_LIBRARY_NAME}") +else() + set(Python3_LIBRARY_INSTALL "${Python3_LIBRARY_NAME_PATH}") endif() + +# +# Configuration +# + +# Development +loader_configuration_begin(py_loader) +loader_configuration_deps(python "${Python3_LIBRARY_DEVELOPMENT}") +loader_configuartion_end_development() + +# Install +loader_configuration_begin(py_loader) +loader_configuration_deps(python "${Python3_LIBRARY_INSTALL}") +loader_configuartion_end_install() diff --git a/source/loaders/py_loader/include/py_loader/py_loader_port.h b/source/loaders/py_loader/include/py_loader/py_loader_port.h index 07dd6589f..9cc66ed42 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_port.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_port.h @@ -27,11 +27,7 @@ extern "C" { #endif -#define PY_LOADER_PORT_NAME_FUNC_IMPL_EXPAND(x) PyInit_##x -#define PY_LOADER_PORT_NAME_FUNC_IMPL(x) PY_LOADER_PORT_NAME_FUNC_IMPL_EXPAND(x) -#define PY_LOADER_PORT_NAME_FUNC PY_LOADER_PORT_NAME_FUNC_IMPL(PY_LOADER_PORT_NAME) - -PyMODINIT_FUNC PY_LOADER_PORT_NAME_FUNC(void); +int py_port_initialize(void); #ifdef __cplusplus } diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 32fedc692..f73dbe9c3 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -192,7 +192,7 @@ static void py_loader_impl_value_invoke_state_finalize(value v, void *data); static void py_loader_impl_value_ptr_finalize(value v, void *data); -static int py_loader_impl_finalize(loader_impl_py py_impl); +static int py_loader_impl_finalize(loader_impl impl, loader_impl_py py_impl); static PyObject *py_loader_impl_load_from_memory_compile(loader_impl_py py_impl, const loader_name name, const char *buffer); @@ -2620,19 +2620,22 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi goto error_alloc_py_impl; } - Py_InitializeEx(0); - - if (Py_IsInitialized() == 0) + if (loader_impl_get_option_host(impl) == 0) { - goto error_init_py; - } + Py_InitializeEx(0); + + if (Py_IsInitialized() == 0) + { + goto error_init_py; + } #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 6 - if (PyEval_ThreadsInitialized() == 0) - { - PyEval_InitThreads(); - } + if (PyEval_ThreadsInitialized() == 0) + { + PyEval_InitThreads(); + } #endif + } /* Hook the deallocation of PyCFunction */ py_loader_impl_pycfunction_dealloc = PyCFunction_Type.tp_dealloc; @@ -2695,7 +2698,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi goto error_after_inspect; } - if (PY_LOADER_PORT_NAME_FUNC() == NULL) + if (py_port_initialize() != 0) { goto error_after_import; } @@ -2759,7 +2762,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi #endif error_after_argv: error_after_sys_executable: - (void)py_loader_impl_finalize(py_impl); + (void)py_loader_impl_finalize(impl, py_impl); error_init_py: free(py_impl); error_alloc_py_impl: @@ -4140,7 +4143,7 @@ void py_loader_impl_sys_path_print(PyObject *sys_path_list) } #endif -int py_loader_impl_finalize(loader_impl_py py_impl) +int py_loader_impl_finalize(loader_impl impl, loader_impl_py py_impl) { if (Py_IsInitialized() != 0) { @@ -4149,19 +4152,18 @@ int py_loader_impl_finalize(loader_impl_py py_impl) py_loader_impl_error_print(py_impl); } -#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 6 + if (loader_impl_get_option_host(impl) == 0) { +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 6 if (Py_FinalizeEx() != 0) { log_write("metacall", LOG_LEVEL_DEBUG, "Error when executing Py_FinalizeEx"); return 1; } - } #else - { Py_Finalize(); - } #endif + } } return 0; @@ -4225,7 +4227,7 @@ int py_loader_impl_destroy(loader_impl impl) } #endif - int result = py_loader_impl_finalize(py_impl); + int result = py_loader_impl_finalize(impl, py_impl); /* Unhook the deallocation of PyCFunction */ PyCFunction_Type.tp_dealloc = py_loader_impl_pycfunction_dealloc; diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index 3bece75cd..fbf3b457c 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -27,10 +27,6 @@ #include <loader/loader.h> -#ifndef PY_LOADER_PORT_NAME - #error "The Python Loader Port must be defined" -#endif - static const loader_tag py_loader_tag = "py"; static PyObject *py_loader_port_none(void) @@ -955,26 +951,33 @@ static PyMethodDef metacall_methods[] = { { NULL, NULL, 0, NULL } }; -static struct PyModuleDef metacall_definition = { - PyModuleDef_HEAD_INIT, - "metacall", - "A library for providing inter-language foreign function interface calls.", - -1, - metacall_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PY_LOADER_PORT_NAME_FUNC(void) +int py_port_initialize(void) { - static PyObject *module = NULL; + static struct PyModuleDef metacall_definition = { + PyModuleDef_HEAD_INIT, + "py_port_impl_module", + "A library for providing inter-language foreign function interface calls.", + -1, + metacall_methods, + NULL, + NULL, + NULL, + NULL + }; + + PyObject *module = PyModule_Create(&metacall_definition); if (module == NULL) { - module = PyModule_Create(&metacall_definition); + return 1; + } + + PyObject *sys_modules = PyImport_GetModuleDict(); + + if (PyDict_SetItemString(sys_modules, metacall_definition.m_name, module) < 0) + { + return 1; } - return module; + return 0; } diff --git a/source/ports/py_port/helper.py b/source/ports/py_port/helper.py deleted file mode 100644 index 1a0a77df8..000000000 --- a/source/ports/py_port/helper.py +++ /dev/null @@ -1,240 +0,0 @@ -import sys -import os -import re -import shutil -import tarfile -import subprocess - -import requests - - -def file_size(num, suffix='B'): - for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']: - if abs(num) < 1024.0: - return "%3.1f%s%s" % (num, unit, suffix) - num /= 1024.0 - return "%.1f%s%s" % (num, 'Yi', suffix) - - -def find_assets(patterns): - api_url = 'https://api.github.com/repos/metacall/core/releases/latest' - urls = [] - res = requests.get(api_url) - data = res.json() - data = [li['browser_download_url'] for li in data['assets']] - for p in patterns: - regex = re.compile(p) - urls.append(list(filter(regex.search, data))[0]) - return urls - - -def download(urls): - for url in urls: - filename = '/tmp/{}'.format(url.split("/")[-1]) - - if os.path.isfile(filename + '.tmp'): - os.remove(filename + '.tmp') - - with open(filename + '.tmp', 'wb') as file: - res = requests.get(url, stream=True) - total_length = res.headers.get('content-length') - - if total_length is None or int(total_length) < 4096: - print('Downloading {} from {}\n'.format(url.split("/")[-1], url)) - file.write(res.content) - else: - dl = 0 - total_length = int(total_length) - print('Downloading {} (total: {}) from {}\n'.format(url.split("/")[-1], total_length, url)) - for data in res.iter_content(chunk_size=4096): - dl += len(data) - file.write(data) - done = int(50 * dl / total_length) - sys.stdout.write("\r[%s%s]" % ('=' * done, ' ' * (50 - done))) - sys.stdout.write( - '\r[{}{}] - {}/{}'.format('=' * done, ' ' * (50 - done), - file_size(dl), file_size(total_length)) - ) - sys.stdout.flush() - print('\n') - - os.rename(filename + '.tmp', filename) - - -def unpack(files): - for filename in files: - filename = filename.split("/")[-1] - print('Extracting {} ...'.format(filename)) - with tarfile.open(filename) as file: - file.extractall() - - -def write_install_log(content): - with open('/tmp/mc-install.tmp', 'w') as logger: - logger.write('\n'.join(content)) - - shutil.move('/tmp/mc-install.tmp', '/usr/local/share/metacall/install') - - -def read_install_log(): - with open('/usr/local/share/metacall/install', 'r') as logger: - lines = logger.read().splitlines() - return lines - - -def overwrite(src, dest): - if os.path.isdir(src): - if not os.path.isdir(dest): - os.makedirs(dest) - files = os.listdir(src) - for file in files: - yield from overwrite(os.path.join(src, file), os.path.join(dest, file)) - else: - print('copying {} to {}'.format(src, dest)) - shutil.copyfile(src, dest) - yield str(dest) - - -def spawn(args): - process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output, error = process.communicate() - - return output, error, process.returncode - - -def pre_install(components): - download(['https://raw.githubusercontent.com/metacall/core/develop/tools/metacall-runtime.sh']) - args = ['bash', '/tmp/metacall-runtime.sh'] - args = args + components - subprocess.call(args) - - -def pre_install_prompt(): - - answers = {'yes': True, 'y': True, 'no': False, 'n': False} - components = ['python', 'ruby', 'netcore8', 'v8', 'nodejs', 'ports'] - args = [] - - try: - while True: - for component in components: - message = '''do you want to install {} (y/n)? '''.format(component) - sys.stdout.write(message) - choice = input().lower() - if choice in answers and answers[choice]: - args.append(component) - elif choice not in answers: - sys.stdout.write("Please respond with 'yes' or 'no' (or 'y' or 'n').\n") - exit(0) - if len(args) == 0: - exit(0) - pre_install(args) - break - - except KeyboardInterrupt: - exit(1) - - -def install(ignore=False): - if ignore is False: - if os.path.isfile('/usr/local/bin/metacallcli'): - print('MetaCall CLI is already installed') - exit(0) - pre_install_prompt() - - if os.getuid() != 0: - print('You need to have root privileges to run this script.') - exit(-1) - - os.chdir('/tmp/') - - docs = '' # link to documentation if this script failed to download the cli - - try: - - print('Searching for files ...') - - assets = find_assets([r'metacall-[0-9].[0-9].[0.9]-runtime.tar.gz', - r'metacall-[0-9].[0-9].[0.9]-examples.tar.gz']) - - missing_files = [file for file in assets if not os.path.isfile(file.split('/')[-1])] - - if len(missing_files) != 0: - download(missing_files) - - unpack(assets) - - write_install_log(list(overwrite('/tmp/usr/local/', '/usr/local/'))) - - print('\n') - - output, error, code = spawn(['ldconfig', '-n', '-v', '/usr/local/lib/']) - if code != 0: - print('Failed to install MetaCall\n{}\n' - 'please proceed with the manual installation. {}'.format(error.decode('utf-8'), docs)) - exit(1) - else: - print(output.decode('utf-8')) - - spawn(['chmod', '+x', '/usr/local/bin/metacallcli']) - - print('\nCleaning things up ...') - - shutil.rmtree('/tmp/usr') - for file in assets: - path = '/tmp/' + file.split('/')[-1] - if os.path.isfile(path): - os.remove(path) - - print('MetaCall CLI is successfully installed.') - - except ConnectionError: - print('Downloading process failed, please proceed with the manual installation. {}'.format(docs)) - except tarfile.ExtractError: - print('Extraction process failed, please proceed with the manual installation. {}'.format(docs)) - except KeyboardInterrupt: - print('\nCanceled by user.') - - -def update(): - install(ignore=True) - - -def uninstall(paths): - - for fp in paths: - if os.path.isfile(fp): - os.remove(fp) - - if os.path.isdir('/usr/local/share/metacall'): - shutil.rmtree('/usr/local/share/metacall') - - spawn(['ldconfig']) - - exit(0) - - -def uninstall_prompt(): - paths = read_install_log() - message = '''This action would remove:\n {} -* this action DOES NOT uninstall the python package, only MetaCall CLI and MetaCall libs -* for a complete uninstall you have to run metacall-uninstall && pip uninstall metacall -* (the order of execution is important) - -Proceed (y/n)? '''.format(''.join('''{}\n '''.format(l) for l in paths)) - - answers = {'yes': True, 'y': True, 'no': False, 'n': False} - - try: - while True: - sys.stdout.write(message) - choice = input().lower() - if choice in answers: - if answers[choice]: - uninstall(paths) - else: - exit(0) - else: - sys.stdout.write("Please respond with 'yes' or 'no' (or 'y' or 'n').\n") - except KeyboardInterrupt: - exit(1) \ No newline at end of file diff --git a/source/ports/py_port/helper/__init__.py b/source/ports/py_port/helper/__init__.py deleted file mode 100644 index 3534e2a45..000000000 --- a/source/ports/py_port/helper/__init__.py +++ /dev/null @@ -1,245 +0,0 @@ -#!/usr/bin/env python3 - -# MetaCall Python Port by Parra Studios -# A frontend for Python language bindings in MetaCall. -# -# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# TODO: Update to the new install / distributable tarballs - -import sys -import os -import re -import shutil -import tarfile -import subprocess -import requests - -def file_size(num, suffix='B'): - for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']: - if abs(num) < 1024.0: - return "%3.1f%s%s" % (num, unit, suffix) - num /= 1024.0 - return "%.1f%s%s" % (num, 'Yi', suffix) - -def find_assets(patterns): - api_url = 'https://api.github.com/repos/metacall/core/releases/latest' - urls = [] - res = requests.get(api_url) - data = res.json() - data = [li['browser_download_url'] for li in data['assets']] - for p in patterns: - regex = re.compile(p) - urls.append(list(filter(regex.search, data))[0]) - return urls - -def download(urls): - for url in urls: - filename = '/tmp/{}'.format(url.split("/")[-1]) - - if os.path.isfile(filename + '.tmp'): - os.remove(filename + '.tmp') - - with open(filename + '.tmp', 'wb') as file: - res = requests.get(url, stream=True) - total_length = res.headers.get('content-length') - - if total_length is None or int(total_length) < 4096: - print('Downloading {} from {}\n'.format(url.split("/")[-1], url)) - file.write(res.content) - else: - dl = 0 - total_length = int(total_length) - print('Downloading {} (total: {}) from {}\n'.format(url.split("/")[-1], total_length, url)) - for data in res.iter_content(chunk_size=4096): - dl += len(data) - file.write(data) - done = int(50 * dl / total_length) - sys.stdout.write("\r[%s%s]" % ('=' * done, ' ' * (50 - done))) - sys.stdout.write( - '\r[{}{}] - {}/{}'.format('=' * done, ' ' * (50 - done), - file_size(dl), file_size(total_length)) - ) - sys.stdout.flush() - print('\n') - - os.rename(filename + '.tmp', filename) - -def unpack(files): - for filename in files: - filename = filename.split("/")[-1] - print('Extracting {} ...'.format(filename)) - with tarfile.open(filename) as file: - file.extractall() - -def write_install_log(content): - with open('/tmp/mc-install.tmp', 'w') as logger: - logger.write('\n'.join(content)) - - shutil.move('/tmp/mc-install.tmp', '/usr/local/share/metacall/install') - -def read_install_log(): - with open('/usr/local/share/metacall/install', 'r') as logger: - lines = logger.read().splitlines() - return lines - -def overwrite(src, dest): - if os.path.isdir(src): - if not os.path.isdir(dest): - os.makedirs(dest) - files = os.listdir(src) - for file in files: - yield from overwrite(os.path.join(src, file), os.path.join(dest, file)) - else: - print('copying {} to {}'.format(src, dest)) - shutil.copyfile(src, dest) - yield str(dest) - -def spawn(args): - process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output, error = process.communicate() - - return output, error, process.returncode - -def pre_install(components): - download(['https://raw.githubusercontent.com/metacall/core/develop/tools/metacall-runtime.sh']) - args = ['bash', '/tmp/metacall-runtime.sh'] - args = args + components - subprocess.call(args) - -def pre_install_prompt(): - answers = {'yes': True, 'y': True, 'no': False, 'n': False} - components = ['python', 'ruby', 'netcore', 'v8', 'nodejs', 'ports'] - args = [] - - try: - while True: - for component in components: - message = '''do you want to install {} (y/n)? '''.format(component) - sys.stdout.write(message) - choice = input().lower() - if choice in answers and answers[choice]: - args.append(component) - elif choice not in answers: - sys.stdout.write("Please respond with 'yes' or 'no' (or 'y' or 'n').\n") - exit(0) - if len(args) == 0: - exit(0) - pre_install(args) - break - - except KeyboardInterrupt: - exit(1) - -def install(ignore=False): - if ignore is False: - if os.path.isfile('/usr/local/bin/metacallcli'): - print('MetaCall CLI is already installed') - exit(0) - pre_install_prompt() - - if os.getuid() != 0: - print('You need to have root privileges to run this script.') - exit(-1) - - os.chdir('/tmp/') - - docs = '' # link to documentation if this script failed to download the cli - - try: - - print('Searching for files ...') - - assets = find_assets([r'metacall-[0-9].[0-9].[0.9]-runtime.tar.gz', - r'metacall-[0-9].[0-9].[0.9]-examples.tar.gz']) - - missing_files = [file for file in assets if not os.path.isfile(file.split('/')[-1])] - - if len(missing_files) != 0: - download(missing_files) - - unpack(assets) - - write_install_log(list(overwrite('/tmp/usr/local/', '/usr/local/'))) - - print('\n') - - output, error, code = spawn(['ldconfig', '-n', '-v', '/usr/local/lib/']) - if code != 0: - print('Failed to install MetaCall\n{}\n' - 'please proceed with the manual installation. {}'.format(error.decode('utf-8'), docs)) - exit(1) - else: - print(output.decode('utf-8')) - - spawn(['chmod', '+x', '/usr/local/bin/metacallcli']) - - print('\nCleaning things up ...') - - shutil.rmtree('/tmp/usr') - for file in assets: - path = '/tmp/' + file.split('/')[-1] - if os.path.isfile(path): - os.remove(path) - - print('MetaCall CLI is successfully installed.') - - except ConnectionError: - print('Downloading process failed, please proceed with the manual installation. {}'.format(docs)) - except tarfile.ExtractError: - print('Extraction process failed, please proceed with the manual installation. {}'.format(docs)) - except KeyboardInterrupt: - print('\nCanceled by user.') - -def update(): - install(ignore=True) - -def uninstall(paths): - - for fp in paths: - if os.path.isfile(fp): - os.remove(fp) - - if os.path.isdir('/usr/local/share/metacall'): - shutil.rmtree('/usr/local/share/metacall') - - spawn(['ldconfig']) - - exit(0) - -def uninstall_prompt(): - paths = read_install_log() - message = '''This action would remove:\n {} -* this action DOES NOT uninstall the python package, only MetaCall CLI and MetaCall libs -* for a complete uninstall you have to run metacall-uninstall && pip uninstall metacall -* (the order of execution is important) - -Proceed (y/n)? '''.format(''.join('''{}\n '''.format(l) for l in paths)) - - answers = {'yes': True, 'y': True, 'no': False, 'n': False} - - try: - while True: - sys.stdout.write(message) - choice = input().lower() - if choice in answers: - if answers[choice]: - uninstall(paths) - else: - exit(0) - else: - sys.stdout.write("Please respond with 'yes' or 'no' (or 'y' or 'n').\n") - except KeyboardInterrupt: - exit(1) diff --git a/source/ports/py_port/metacall/api.py b/source/ports/py_port/metacall/api.py index 1c1d328b8..80586c86e 100644 --- a/source/ports/py_port/metacall/api.py +++ b/source/ports/py_port/metacall/api.py @@ -18,35 +18,92 @@ # limitations under the License. import os +import re import sys import json -import inspect # TODO: Remove this, check the monkey patching - -if sys.platform == 'win32': - from metacall.module_win32 import metacall_module_load -elif sys.platform == 'linux': - from metacall.module_linux import metacall_module_load -elif sys.platform == 'darwin' or sys.platform == 'cygwin': - print('\x1b[31m\x1b[1m', 'The platform', sys.platform, 'has not been not tested, but we are using linux module as a fallback.', '\x1b[0m') - # TODO: Probably it won't work, but we use it as a fallback, implement other platforms - from metacall.module_linux import metacall_module_load -else: - raise ImportError('MetaCall Python Port is not implemented under this platform.') +import ctypes + +def find_files_recursively(root_dir, pattern): + regex = re.compile(pattern) + matches = [] + for dirpath, dirnames, filenames in os.walk(root_dir): + for filename in filenames: + if regex.search(filename): + matches.append(os.path.join(dirpath, filename)) + return matches + +def platform_install_paths(): + if sys.platform == 'win32': + return { + 'paths': [ os.path.join(os.environ.get('LOCALAPPDATA', ''), 'MetaCall', 'metacall') ], + 'name': r'metacall\.dll' + } + elif sys.platform == 'darwin': + return { + 'paths': [ '/opt/homebrew/lib/', '/usr/local/lib/' ], + 'name': r'libmetacall\.dylib' + } + elif sys.platform == 'linux': + return { + 'paths': [ '/usr/local/lib/', '/gnu/lib/' ], + 'name': r'libmetacall\.so' + } + else: + raise RuntimeError(f"Platform {sys.platform} not supported") + +def search_paths(): + custom_path = os.environ.get('METACALL_INSTALL_PATH') + if custom_path: + return { + 'paths': [ custom_path ], + 'name': r'^(lib)?metacall(d)?\.(so|dylib|dll)$' + } + + return platform_install_paths() + +def find_library(): + search_data = search_paths() + + for path in search_data['paths']: + files = find_files_recursively(path, search_data['name']) + if files: + return files[0] + + raise ImportError(""" + MetaCall library not found, if you have it in a special folder, define it through METACALL_INSTALL_PATH'. + """ + + "Looking for it in the following paths: " + ', '.join(search_data['paths']) + """ + If you do not have it installed, you have three options: + 1) Go to https://github.com/metacall/install and install it. + 2) Contribute to https://github.com/metacall/distributable by providing support for your platform and architecture. + 3) Be a x10 programmer and compile it by yourself, then define the install folder if it is different from the default in os.environ['METACALL_INSTALL_PATH']. + """) + +def metacall_module_load(): + # Check if it is loaded from MetaCall or from Python + if 'py_port_impl_module' in sys.modules: + return sys.modules['py_port_impl_module'] + + # Define the Python host + os.environ['METACALL_HOST'] = 'py' + + # Find the shared library + library_path = find_library() + + # Load MetaCall + lib = ctypes.CDLL(library_path, mode=ctypes.RTLD_GLOBAL) + + # Python Port must have been loaded at this point + if 'py_port_impl_module' in sys.modules: + return sys.modules['py_port_impl_module'] + else: + raise ImportError( + 'MetaCall was found but failed to load' + ) # Load metacall extension depending on the platform module = metacall_module_load() -# Check if library was found and print error message otherwhise -if module == None: - print('\x1b[31m\x1b[1m', 'You do not have MetaCall installed or we cannot find it.', '\x1b[0m') - print('\x1b[1m', 'Looking for it in the following paths:', sys.path, '\x1b[0m') - print('\x1b[33m\x1b[1m', 'If you do not have it installed, you have three options:', '\x1b[0m') - print('\x1b[1m', ' 1) Go to https://github.com/metacall/install and install it.', '\x1b[0m') - print('\x1b[1m', ' 2) Contribute to https://github.com/metacall/distributable by providing support for your platform and architecture.', '\033[0m') - print('\x1b[1m', ' 3) Be a x10 programmer and compile it by yourself, then define the install folder (if it is different from the default /usr/local/lib) in os.environ[\'LOADER_LIBRARY_PATH\'].', '\x1b[0m') - print('\x1b[33m\x1b[1m', 'If you have it installed in an non-standard folder, please define os.environ[\'LOADER_LIBRARY_PATH\'].', '\x1b[0m') - raise ImportError('MetaCall Python Port was not found') - # Load from file def metacall_load_from_file(tag, paths): return module.metacall_load_from_file(tag, paths) diff --git a/source/ports/py_port/metacall/module_linux.py b/source/ports/py_port/metacall/module_linux.py deleted file mode 100644 index cf9fdd634..000000000 --- a/source/ports/py_port/metacall/module_linux.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 - -# MetaCall Python Port by Parra Studios -# A frontend for Python language bindings in MetaCall. -# -# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import sys -import re - -def metacall_module_load(): - # Append environment variable or default install path when building manually - sys.path.append(os.environ.get('LOADER_LIBRARY_PATH', os.path.join(os.path.sep, 'usr', 'local', 'lib'))) - - # Find is MetaCall is installed as a distributable tarball - rootdir = os.path.join(os.path.sep, 'gnu', 'store') - regex = re.compile('.*-metacall-.*') - - for root, dirs, _ in os.walk(rootdir): - for folder in dirs: - if regex.match(folder) and not folder.endswith('R'): - sys.path.append(os.path.join(rootdir, folder, 'lib')) - - # Try to load the extension - library_names = ['libpy_loaderd', 'libpy_loader'] - library_found = '' - module = None - - # Find the library - for name in library_names: - try: - module = __import__(name, globals(), locals()) - library_found = name - break - except ImportError as e: - pass - except: - print("Unexpected error while loading the MetaCall Python Port", name, ":", sys.exc_info()[0]) - raise - - return module diff --git a/source/ports/py_port/metacall/module_win32.py b/source/ports/py_port/metacall/module_win32.py deleted file mode 100644 index 4c5c8e4e8..000000000 --- a/source/ports/py_port/metacall/module_win32.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python3 - -# MetaCall Python Port by Parra Studios -# A frontend for Python language bindings in MetaCall. -# -# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import ctypes -from ctypes import wintypes, windll - -def metacall_module_load(): - def enum_process_modules(): - # Get handle of current process - kernel32 = windll.kernel32 - kernel32.GetCurrentProcess.restype = ctypes.c_void_p - hProcess = kernel32.GetCurrentProcess() - - # Load EnumProcessModules either from kernel32.dll or psapi.dll - try: - EnumProcessModulesProc = windll.psapi.EnumProcessModules - except AttributeError: - EnumProcessModulesProc = windll.kernel32.EnumProcessModules - EnumProcessModulesProc.restype = ctypes.c_bool - EnumProcessModulesProc.argtypes = [ctypes.c_void_p, ctypes.POINTER(ctypes.c_void_p), ctypes.c_ulong, ctypes.POINTER(ctypes.c_ulong)] - - hProcess = kernel32.GetCurrentProcess() - hMods = (ctypes.c_void_p * 1024)() - cbNeeded = ctypes.c_ulong() - if EnumProcessModulesProc(hProcess, hMods, ctypes.sizeof(hMods), ctypes.byref(cbNeeded)): - return hMods - return None - - def get_loaded_module(modules, module_name): - kernel32 = windll.kernel32 - kernel32.GetModuleFileNameA.restype = ctypes.c_ulong - kernel32.GetModuleFileNameA.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_ulong] - - if modules is None: - return None - for module in modules: - cPath = ctypes.c_char_p(b'\0' * 1024) - kernel32.GetModuleFileNameA(module, cPath, ctypes.c_ulong(1024)) - path = cPath.value - if os.path.normpath(path.decode('utf-8')) == os.path.normpath(module_name): - return module - return None - - # Retrieve all loaded modules in the process - modules = enum_process_modules() - - # Get environment variable or default install path when building manually - base_path = os.environ.get('LOADER_LIBRARY_PATH', os.path.join(os.path.sep, 'C:', 'Program Files', 'MetaCall')) - library_names = ['py_loaderd', 'py_loader'] - - for name in library_names: - runtime_module_handle = get_loaded_module(modules, os.path.join(os.path.sep, base_path, name + '.dll')) - if runtime_module_handle is None: - continue - runtime_module = ctypes.CDLL('', handle = runtime_module_handle) # cdecl calling convention - - if runtime_module != None: - func_name = 'PyInit_' + name - if runtime_module[func_name]: - init = runtime_module[func_name] - init.restype = ctypes.py_object - init.argtypes = None - return init() - - return None diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index d34742d73..4841636e9 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -124,85 +124,6 @@ # Exclude base packages exclude_packages = ['contrib', 'docs', 'test', 'test.py' 'CMakeLists.txt', '.gitignore', 'upload.sh'] -# TODO: Review helper -# # Detect if metacall port is already installed -# port_installed = False - -# # Append environment variable or default install path when building manually (TODO: Cross-platform paths) -# sys.path.append(os.environ.get('PORT_LIBRARY_PATH', os.path.join(os.path.sep, 'usr', 'local', 'lib'))); - -# # Find is MetaCall is installed as a distributable tarball (TODO: Cross-platform paths) -# rootdir = os.path.join(os.path.sep, 'gnu', 'store') -# regex = re.compile('.*-metacall-.*') - -# for root, dirs, _ in os.walk(rootdir): -# for folder in dirs: -# if regex.match(folder) and not folder.endswith('R'): -# sys.path.append(os.path.join(rootdir, folder, 'lib')) - -# TODO: Review helper -# # Find if module is installed -# if sys.version_info[0] < 3: -# # Python 2.7 -# import imp -# try: -# imp.find_module('_py_port') -# port_installed = True -# except ImportError: -# try: -# imp.find_module('_py_portd') -# port_installed = True -# except ImportError: -# pass -# elif sys.version_info[0] >= 3 and sys.version_info[1] <= 3: -# # Python <= 3.3 -# import importlib -# py_port = importlib.find_loader('_py_port') -# port_installed = py_port is not None -# if port_installed == False: -# py_port = importlib.find_loader('_py_portd') -# port_installed = py_port is not None -# elif sys.version_info[0] >= 3 and sys.version_info[1] > 3: -# # Python >= 3.4 -# import importlib -# py_port = importlib.util.find_spec("_py_port") -# port_installed = py_port is not None -# if port_installed == False: -# py_port = importlib.util.find_spec("_py_portd") -# port_installed = py_port is not None - -# TODO: This code is very interesting for providing commands to the end user. -# pip cannot execute arbitrary code as pre/post install hook when the package is being installed. -# So it is impossible to install the binaries unless we add extra commands after install. -# At this moment there is a common solution for installing binaries depending on Bash/PowerShell -# that is OS dependant and not language dependant. By the moment we will use the new way of install -# instead of the old one, but we keep the ./helper folder in order to provide future support for -# extra commands, although the main idea is to keep the OS dependant install, this can be useful -# for updating or doing Python related things. Meanwhile, it will be avoided. -exclude_packages.extend(['helper', 'helper.py']) - -# TODO: Review helper -# if port_installed == True: -# # Exclude helper package if port is already installed -# exclude_packages.append('helper') -# else: -# # List run-time dependencies here. These will be installed by pip when -# # your project is installed. For an analysis of "install_requires" vs pip's -# # requirements files see: -# # https://packaging.python.org/en/latest/requirements.html -# options['install_requires'] = ['peppercorn', 'requests'] - -# # To provide executable scripts, use entry points in preference to the -# # "scripts" keyword. Entry points provide cross-platform support and allow -# # pip to create the appropriate form of executable for the target platform. -# options['entry_points'] = { -# 'console_scripts': [ -# 'metacall-install=helper:install', -# 'metacall-uninstall=helper:uninstall_prompt', -# 'metacall-update=helper:update' -# ], -# } - # Define required packages options['packages'] = find_packages(exclude=exclude_packages) diff --git a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt index ff845b77b..04c9d805e 100644 --- a/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt +++ b/source/tests/metacall_configuration_exec_path_test/CMakeLists.txt @@ -204,6 +204,49 @@ test_environment_variables(${target} "${TESTS_SANITIZER_ENVIRONMENT_VARIABLES}" ) +# +# External dependencies +# + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(Python3_FIND_ABI "ON" "ANY" "ANY") + find_package(Python3 COMPONENTS Development) + + # Fallback to release if not found + if(NOT Python3_Development_FOUND) + set(Python3_FIND_ABI) + find_package(Python3 COMPONENTS Development REQUIRED) + endif() +else() + find_package(Python3 COMPONENTS Development REQUIRED) +endif() + +# Find Python DLL +include(Portability) + +if(PROJECT_OS_FAMILY STREQUAL win32 AND Python3_LIBRARIES AND Python3_ROOT_DIR AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + foreach(library ${Python3_LIBRARIES}) + if(${library} MATCHES "[^_d][.]lib$") + # Get the library path with dll suffix + string(REGEX REPLACE "[.]lib$" ".dll" LIB_PATH ${library}) + # Get the library name + get_filename_component(LIB_NAME "${LIB_PATH}" NAME) + # Find the library in the Python3 root path + find_file(Python3_LIBRARY_NAME_PATH ${LIB_NAME} + PATHS ${Python3_ROOT_DIR} + NO_DEFAULT_PATH + ) + if(Python3_LIBRARY_NAME_PATH) + break() + endif() + endif() + endforeach() +endif() + +if(NOT Python3_LIBRARY_NAME_PATH) + set(Python3_LIBRARY_NAME_PATH "${Python3_LIBRARIES}") +endif() + # # Configure test data # diff --git a/source/tests/metacall_configuration_exec_path_test/data/configurations/py_loader.json.in b/source/tests/metacall_configuration_exec_path_test/data/configurations/py_loader.json.in index 4978ee0b2..02a8e81f9 100644 --- a/source/tests/metacall_configuration_exec_path_test/data/configurations/py_loader.json.in +++ b/source/tests/metacall_configuration_exec_path_test/data/configurations/py_loader.json.in @@ -1,5 +1,8 @@ { "execution_paths": [ "@PY_EXECUTION_PATH@" - ] + ], + "dependencies": { + "python": ["@Python3_LIBRARY_NAME_PATH@"] + } } diff --git a/source/tests/metacall_python_port_test/CMakeLists.txt b/source/tests/metacall_python_port_test/CMakeLists.txt index a4179b7f2..124502f07 100644 --- a/source/tests/metacall_python_port_test/CMakeLists.txt +++ b/source/tests/metacall_python_port_test/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if loaders are enabled -if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_LOADERS_RS OR NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_RB OR NOT OPTION_BUILD_SCRIPTS_RS OR NOT OPTION_BUILD_SCRIPTS_NODE) +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_RB OR NOT OPTION_BUILD_SCRIPTS_NODE) return() endif() @@ -135,6 +135,12 @@ add_test(NAME ${target} COMMAND $<TARGET_FILE:${target}> ) +# Enable rust test if it is built +if(OPTION_BUILD_LOADERS_RS) + set(RS_DEPENDENCY rs_loader) + set(TESTS_ENVIRONMENT_VARIABLES_RS "OPTION_BUILD_LOADERS_RS=1") +endif() + # # Define dependencies # @@ -144,6 +150,7 @@ add_dependencies(${target} py_loader rb_loader node_loader + ${RS_DEPENDENCY} ) # @@ -159,4 +166,5 @@ include(TestEnvironmentVariables) test_environment_variables(${target} "" ${TESTS_ENVIRONMENT_VARIABLES} + ${TESTS_ENVIRONMENT_VARIABLES_RS} ) From dcbdd4fad80ad3ffe5842182d161be98b14b65fe Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 17 May 2025 07:08:58 +0200 Subject: [PATCH 278/487] Trying compose with bake. --- docker-compose.platform.yml | 37 ------------------------------------- docker-compose.sh | 9 +++++---- 2 files changed, 5 insertions(+), 41 deletions(-) delete mode 100644 docker-compose.platform.yml diff --git a/docker-compose.platform.yml b/docker-compose.platform.yml deleted file mode 100644 index b22964bf5..000000000 --- a/docker-compose.platform.yml +++ /dev/null @@ -1,37 +0,0 @@ -# -# MetaCall Library by Parra Studios -# Docker compose infrastructure for MetaCall. -# -# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -version: "3.7" - -services: - deps: - image: metacall/core:deps - platform: ${METACALL_PLATFORM} - - dev: - image: metacall/core:dev - platform: ${METACALL_PLATFORM} - - runtime: - image: metacall/core:runtime - platform: ${METACALL_PLATFORM} - - cli: - image: metacall/core:cli - platform: ${METACALL_PLATFORM} diff --git a/docker-compose.sh b/docker-compose.sh index 4759e59c1..12186b391 100755 --- a/docker-compose.sh +++ b/docker-compose.sh @@ -217,19 +217,20 @@ sub_platform() { # Generate the docker compose file with all .env variables substituted (bake seems not to support this) $DOCKER_COMPOSE config &> docker-compose.bake.yml + cat docker-compose.bake.yml # Build with Bake, so the image can be loaded into local docker context ln -sf tools/deps/.dockerignore .dockerignore - docker buildx bake -f docker-compose.bake.yml -f docker-compose.platform.yml --load deps + docker buildx bake -f docker-compose.bake.yml --set *.platform="${METACALL_PLATFORM}" --load deps ln -sf tools/dev/.dockerignore .dockerignore - docker buildx bake -f docker-compose.bake.yml -f docker-compose.platform.yml --load dev + docker buildx bake -f docker-compose.bake.yml --set *.platform="${METACALL_PLATFORM}" --load dev ln -sf tools/runtime/.dockerignore .dockerignore - docker buildx bake -f docker-compose.bake.yml -f docker-compose.platform.yml --load runtime + docker buildx bake -f docker-compose.bake.yml --set *.platform="${METACALL_PLATFORM}" --load runtime ln -sf tools/cli/.dockerignore .dockerignore - docker buildx bake -f docker-compose.bake.yml -f docker-compose.platform.yml --load cli + docker buildx bake -f docker-compose.bake.yml --set *.platform="${METACALL_PLATFORM}" --load cli # Delete temporal docker compose file rm -rf docker-compose.bake.yml From ee87dd145ce491155f88a4163a31410f4210d895 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 17 May 2025 07:17:10 +0200 Subject: [PATCH 279/487] Trying to solve issues. --- docker-compose.sh | 2 +- docker-compose.yml | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/docker-compose.sh b/docker-compose.sh index 12186b391..669e6fc84 100755 --- a/docker-compose.sh +++ b/docker-compose.sh @@ -216,7 +216,7 @@ sub_platform() { fi # Generate the docker compose file with all .env variables substituted (bake seems not to support this) - $DOCKER_COMPOSE config &> docker-compose.bake.yml + $DOCKER_COMPOSE -f docker-compose.yml config &> docker-compose.bake.yml cat docker-compose.bake.yml # Build with Bake, so the image can be loaded into local docker context diff --git a/docker-compose.yml b/docker-compose.yml index ff548ba2a..bba15a4c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,8 +17,6 @@ # limitations under the License. # -version: "3.7" - services: deps: image: metacall/core:deps @@ -66,8 +64,6 @@ services: DETOUR_LIBRARY_PATH: $METACALL_PATH/build PORT_LIBRARY_PATH: $METACALL_PATH/build NODE_PATH: /usr/lib/node_modules - depends_on: - - deps runtime: image: metacall/core:runtime @@ -91,8 +87,6 @@ services: DETOUR_LIBRARY_PATH: /usr/local/lib PORT_LIBRARY_PATH: /usr/local/lib NODE_PATH: /usr/local/lib/node_modules - depends_on: - - dev cli: image: metacall/core:cli @@ -112,6 +106,3 @@ services: DETOUR_LIBRARY_PATH: /usr/local/lib PORT_LIBRARY_PATH: /usr/local/lib NODE_PATH: /usr/local/lib/node_modules - depends_on: - - dev - - runtime From 12e190ae1702d32976026459130eb688317ec282 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 17 May 2025 11:50:58 +0200 Subject: [PATCH 280/487] Update rust port. --- source/ports/rs_port/CMakeLists.txt | 2 +- source/ports/rs_port/config.toml | 3 -- source/ports/rs_port/src/bindings.rs | 42 ++++++++++++++++++++++++++-- 3 files changed, 41 insertions(+), 6 deletions(-) delete mode 100644 source/ports/rs_port/config.toml diff --git a/source/ports/rs_port/CMakeLists.txt b/source/ports/rs_port/CMakeLists.txt index 54fbcbca1..548d583b9 100644 --- a/source/ports/rs_port/CMakeLists.txt +++ b/source/ports/rs_port/CMakeLists.txt @@ -233,7 +233,7 @@ set(RS_PORT_BUILD_ENVIRONMENT_VARIABLES "PROJECT_OUTPUT_DIR = { value = \"${PROJECT_OUTPUT_DIR}\", force = true }" ) -set(RS_PORT_CONFIG_ENV_FILE "${CMAKE_CURRENT_SOURCE_DIR}/config.toml") +set(RS_PORT_CONFIG_ENV_FILE "${CMAKE_CURRENT_SOURCE_DIR}/.cargo/config.toml") file(WRITE ${RS_PORT_CONFIG_ENV_FILE} "[env]\n") diff --git a/source/ports/rs_port/config.toml b/source/ports/rs_port/config.toml deleted file mode 100644 index f0d75af73..000000000 --- a/source/ports/rs_port/config.toml +++ /dev/null @@ -1,3 +0,0 @@ -[env] -CMAKE_BUILD_TYPE = { value = "Debug", force = true } -PROJECT_OUTPUT_DIR = { value = "/media/sf_koyanisqaatsi/metacall-core-rs-port-improved/build", force = true } diff --git a/source/ports/rs_port/src/bindings.rs b/source/ports/rs_port/src/bindings.rs index 26a41b7bd..8f6385d5b 100644 --- a/source/ports/rs_port/src/bindings.rs +++ b/source/ports/rs_port/src/bindings.rs @@ -80,6 +80,40 @@ unsafe extern "C" { #[doc = " @brief\n Clear last error that has happened after a call to any API from MetaCall"] pub fn metacall_error_clear(); } +unsafe extern "C" { + #[doc = " @brief\n Initialize link detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_link_initialize() -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_link_register( + tag: *const ::std::os::raw::c_char, + library: *const ::std::os::raw::c_char, + symbol: *const ::std::os::raw::c_char, + fn_: ::std::option::Option<unsafe extern "C" fn()>, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] loader\n Pointer to the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_link_register_loader( + loader: *mut ::std::os::raw::c_void, + library: *const ::std::os::raw::c_char, + symbol: *const ::std::os::raw::c_char, + fn_: ::std::option::Option<unsafe extern "C" fn()>, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Remove the hook previously registered\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_link_unregister( + tag: *const ::std::os::raw::c_char, + library: *const ::std::os::raw::c_char, + symbol: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Unregister link detours and destroy shared memory"] + pub fn metacall_link_destroy(); +} #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum metacall_log_id { @@ -633,7 +667,7 @@ unsafe extern "C" { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct metacall_initialize_configuration_type { - pub tag: *mut ::std::os::raw::c_char, + pub tag: *const ::std::os::raw::c_char, pub options: *mut ::std::os::raw::c_void, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] @@ -703,6 +737,10 @@ unsafe extern "C" { #[doc = " @brief\n Returns default serializer used by MetaCall\n\n @return\n Name of the serializer to be used with serialization methods"] pub fn metacall_serial() -> *const ::std::os::raw::c_char; } +unsafe extern "C" { + #[doc = " @brief\n Returns default detour used by MetaCall\n\n @return\n Name of the detour to be used with detouring methods"] + pub fn metacall_detour() -> *const ::std::os::raw::c_char; +} unsafe extern "C" { #[doc = " @brief\n Disables MetaCall logs, must be called before @metacall_initialize.\n\n When initializing MetaCall, it initializes a default logs to stdout\n if none was defined. If you want to benchmark or simply disable this\n default logs, you can call to this function before @metacall_initialize."] pub fn metacall_log_null(); @@ -1355,7 +1393,7 @@ unsafe extern "C" { pub fn metacall_plugin_path() -> *const ::std::os::raw::c_char; } unsafe extern "C" { - #[doc = " @brief\n Destroy MetaCall library\n"] + #[doc = " @brief\n Destroy MetaCall library"] pub fn metacall_destroy(); } unsafe extern "C" { From 7890c7847f6c1956f2725ffd4970511617966900 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 17 May 2025 12:10:39 +0200 Subject: [PATCH 281/487] Remove debug info. --- docker-compose.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.sh b/docker-compose.sh index 669e6fc84..e254cb103 100755 --- a/docker-compose.sh +++ b/docker-compose.sh @@ -217,7 +217,6 @@ sub_platform() { # Generate the docker compose file with all .env variables substituted (bake seems not to support this) $DOCKER_COMPOSE -f docker-compose.yml config &> docker-compose.bake.yml - cat docker-compose.bake.yml # Build with Bake, so the image can be loaded into local docker context ln -sf tools/deps/.dockerignore .dockerignore From 43833f8311c13694856a2060648e0a41a8f884c8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 21 May 2025 19:36:14 +0200 Subject: [PATCH 282/487] Almost working version for py_port with python.exe. --- source/loader/source/loader.c | 2 + source/loaders/py_loader/CMakeLists.txt | 1 + .../include/py_loader/py_loader_port.h | 4 +- .../include/py_loader/py_loader_threading.h | 2 +- .../loaders/py_loader/source/py_loader_impl.c | 139 +++++++++++++----- .../loaders/py_loader/source/py_loader_port.c | 42 +++--- .../source/py_loader_symbol_fallback.c | 28 ++++ .../py_loader/source/py_loader_threading.cpp | 8 +- source/metacall/source/metacall.c | 1 - source/ports/node_port/CMakeLists.txt | 10 +- source/ports/node_port/test.js | 22 ++- .../node_port/test/commands/node_port.txt | 3 - source/ports/py_port/CMakeLists.txt | 70 +++++---- source/ports/py_port/test.py | 5 +- .../py_port/test/commands/py_port.txt.in | 3 - 15 files changed, 225 insertions(+), 115 deletions(-) create mode 100644 source/loaders/py_loader/source/py_loader_symbol_fallback.c delete mode 100644 source/ports/node_port/test/commands/node_port.txt delete mode 100644 source/ports/py_port/test/commands/py_port.txt.in diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 156017d24..1fe457cad 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -241,6 +241,8 @@ plugin loader_get_impl_plugin_options(const loader_tag tag, value options) if (impl == NULL) { + /* Destroy options on error */ + value_type_destroy(options); goto loader_create_error; } diff --git a/source/loaders/py_loader/CMakeLists.txt b/source/loaders/py_loader/CMakeLists.txt index 90c650490..c764d17b1 100644 --- a/source/loaders/py_loader/CMakeLists.txt +++ b/source/loaders/py_loader/CMakeLists.txt @@ -99,6 +99,7 @@ set(sources ${source_path}/py_loader_port.c ${source_path}/py_loader_threading.cpp ${source_path}/py_loader_dict.c + ${source_path}/py_loader_symbol_fallback.c ) # Group source files diff --git a/source/loaders/py_loader/include/py_loader/py_loader_port.h b/source/loaders/py_loader/include/py_loader/py_loader_port.h index 9cc66ed42..eea4cd784 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_port.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_port.h @@ -21,13 +21,15 @@ #ifndef PY_LOADER_PORT_H #define PY_LOADER_PORT_H 1 +#include <py_loader/py_loader_api.h> + #include <Python.h> #ifdef __cplusplus extern "C" { #endif -int py_port_initialize(void); +PY_LOADER_NO_EXPORT int py_port_initialize(void); #ifdef __cplusplus } diff --git a/source/loaders/py_loader/include/py_loader/py_loader_threading.h b/source/loaders/py_loader/include/py_loader/py_loader_threading.h index b4f0fb499..82b7ece7c 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_threading.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_threading.h @@ -27,7 +27,7 @@ extern "C" { #endif -PY_LOADER_NO_EXPORT void py_loader_thread_initialize(void); +PY_LOADER_NO_EXPORT void py_loader_thread_initialize(const int host); PY_LOADER_NO_EXPORT int py_loader_thread_is_main(void); diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index f73dbe9c3..7c5f55823 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -120,6 +120,7 @@ struct loader_impl_py_type PyObject *thread_background_start; PyObject *thread_background_send; PyObject *thread_background_stop; + PyObject *thread_background_register_atexit; PyObject *py_task_callback_handler; /* End asyncio required modules */ @@ -192,7 +193,7 @@ static void py_loader_impl_value_invoke_state_finalize(value v, void *data); static void py_loader_impl_value_ptr_finalize(value v, void *data); -static int py_loader_impl_finalize(loader_impl impl, loader_impl_py py_impl); +static int py_loader_impl_finalize(loader_impl_py py_impl, const int host); static PyObject *py_loader_impl_load_from_memory_compile(loader_impl_py py_impl, const loader_name name, const char *buffer); @@ -2001,14 +2002,21 @@ int py_loader_impl_get_builtin_type(loader_impl impl, loader_impl_py py_impl, ty return 1; } -int py_loader_impl_import_module(loader_impl_py py_impl, PyObject **loc, const char *name) +int py_loader_impl_import_module(loader_impl_py py_impl, PyObject **module, const char *name) { - PyObject *module_name = PyUnicode_DecodeFSDefault(name); - *loc = PyImport_Import(module_name); + PyObject *module_name, *sys_modules = PyImport_GetModuleDict(); + *module = PyDict_GetItemString(sys_modules, name); + if (*module != NULL) + { + return 0; + } + + module_name = PyUnicode_DecodeFSDefault(name); + *module = PyImport_Import(module_name); Py_DECREF(module_name); - if (*loc == NULL) + if (*module == NULL) { py_loader_impl_error_print(py_impl); return 1; @@ -2134,7 +2142,7 @@ int py_loader_impl_initialize_inspect(loader_impl impl, loader_impl_py py_impl) return 1; } -int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl) +int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl, const int host) { PyObject *module_name = PyUnicode_DecodeFSDefault("asyncio"); py_impl->asyncio_module = PyImport_Import(module_name); @@ -2188,6 +2196,17 @@ int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl) goto error_after_py_task_callback_handler; } + /* When running in host, we must register a thread atexit for finalizing the background threads + before Python_AtExit, just before when all threads are join (except by daemon threads) */ + if (host == 1) + { + PyObject *args_tuple = PyTuple_New(1); + Py_INCREF(py_impl->asyncio_loop); + PyTuple_SetItem(args_tuple, 0, py_impl->asyncio_loop); + PyObject_Call(py_impl->thread_background_register_atexit, args_tuple, NULL); + Py_XDECREF(args_tuple); + } + return 0; error_after_py_task_callback_handler: @@ -2377,8 +2396,8 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) { static const char thread_background_module_str[] = "import asyncio\n" - "from threading import Thread\n" - "from threading import Event\n" + "import threading\n" + "import sys\n" "class ThreadLoop:\n" " def __init__(self, loop, t):\n" " self.loop = loop\n" @@ -2399,7 +2418,7 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) " loop.close()\n" "def start_background_loop():\n" " loop = asyncio.new_event_loop()\n" - " t = Thread(target=background_loop, name='MetaCall asyncio event loop', args=(loop,), daemon=False)\n" + " t = threading.Thread(target=background_loop, name='MetaCall asyncio event loop', args=(loop,), daemon=False)\n" " t.start()\n" " return ThreadLoop(loop, t)\n" "def send_background_loop(tl, coro, callback, capsule):\n" @@ -2407,9 +2426,18 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) " task.__metacall_capsule = capsule\n" " task.add_done_callback(callback)\n" " return asyncio.wrap_future(task, loop=tl.loop)\n" - "def stop_background_loop(tl):\n" + /* Stop background loop enqueues at the end of the event loop + the task to be finished, so effectively it waits until the event loop finishes */ + "def stop_background_loop(tl, join):\n" " tl.loop.call_soon_threadsafe(tl.loop.stop)\n" - " tl.t.join()\n"; + " if join:\n" + " tl.t.join()\n" + "def atexit_background_loop(tl):\n" + /* This checks if py_port_impl_module contains py_loader_port_atexit */ + " py_loader_port_atexit = getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None)\n" + " tl.loop.call_soon_threadsafe(py_loader_port_atexit)\n" + "def register_atexit_background_loop(tl):\n" + " threading._register_atexit(atexit_background_loop, tl)\n"; /* How to use the module: */ /* @@ -2478,8 +2506,18 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) goto error_thread_background_stop; } + py_impl->thread_background_register_atexit = PyObject_GetAttrString(py_impl->thread_background_module, "register_atexit_background_loop"); + + if (py_impl->thread_background_register_atexit == NULL || !PyCallable_Check(py_impl->thread_background_register_atexit)) + { + log_write("metacall", LOG_LEVEL_ERROR, "Error getting register_atexit_background_loop function"); + goto error_thread_background_register_atexit; + } + return 0; +error_thread_background_register_atexit: + Py_XDECREF(py_impl->thread_background_register_atexit); error_thread_background_stop: Py_XDECREF(py_impl->thread_background_stop); error_thread_background_send: @@ -2606,6 +2644,8 @@ static void PyCFunction_dealloc(PyObject *obj) loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration config) { + const int host = loader_impl_get_option_host(impl); + (void)impl; (void)config; @@ -2620,7 +2660,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi goto error_alloc_py_impl; } - if (loader_impl_get_option_host(impl) == 0) + if (host == 0) { Py_InitializeEx(0); @@ -2637,20 +2677,16 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi #endif } - /* Hook the deallocation of PyCFunction */ - py_loader_impl_pycfunction_dealloc = PyCFunction_Type.tp_dealloc; - PyCFunction_Type.tp_dealloc = PyCFunction_dealloc; - - /* TODO: This does not work after 3.13, is it really needed for this hook? */ -#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 13 - PyType_Modified(&PyCFunction_Type); -#endif + /* Initialize threading */ + py_loader_thread_initialize(host); + /* Initialize executable */ if (py_loader_impl_initialize_sys_executable(py_impl) != 0) { goto error_after_sys_executable; } + /* Initialize main arguments */ char **argv = metacall_argv(); int argc = metacall_argc(); @@ -2665,6 +2701,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi py_loader_impl_run_main = 0; } + /* Initialize stack trace module */ if (py_loader_impl_initialize_traceback(impl, py_impl) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid traceback module creation"); @@ -2675,6 +2712,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi } #if DEBUG_ENABLED + /* Initialize GC module */ { if (py_loader_impl_initialize_gc(py_impl) != 0) { @@ -2688,37 +2726,50 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi } #endif + /* Initialize inspect module */ if (py_loader_impl_initialize_inspect(impl, py_impl) != 0) { goto error_after_traceback_and_gc; } + /* Initialize import module */ if (py_loader_impl_initialize_import(py_impl) != 0) { goto error_after_inspect; } + /* Initialize port module */ if (py_port_initialize() != 0) { goto error_after_import; } + /* Initialize thread module for supporting threaded async */ if (py_loader_impl_initialize_thread_background_module(py_impl) != 0) { goto error_after_import; } - if (py_loader_impl_initialize_asyncio_module(py_impl) != 0) + /* Initialize asyncio module for supporting async */ + if (py_loader_impl_initialize_asyncio_module(py_impl, host) != 0) { goto error_after_thread_background_module; } + /* Initialize custom dict type */ if (py_loader_impl_dict_type_init() < 0) { goto error_after_asyncio_module; } - py_loader_thread_initialize(); + /* Hook the deallocation of PyCFunction */ + py_loader_impl_pycfunction_dealloc = PyCFunction_Type.tp_dealloc; + PyCFunction_Type.tp_dealloc = PyCFunction_dealloc; + + /* TODO: This does not work after 3.13, is it really needed for this hook? */ +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 13 + PyType_Modified(&PyCFunction_Type); +#endif /* Register initialization */ loader_initialization_register(impl); @@ -2737,6 +2788,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi Py_DECREF(py_impl->thread_background_start); Py_DECREF(py_impl->thread_background_send); Py_DECREF(py_impl->thread_background_stop); + Py_DECREF(py_impl->thread_background_register_atexit); Py_DECREF(py_impl->thread_background_future_check); error_after_import: Py_DECREF(py_impl->import_module); @@ -2762,7 +2814,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi #endif error_after_argv: error_after_sys_executable: - (void)py_loader_impl_finalize(impl, py_impl); + (void)py_loader_impl_finalize(py_impl, host); error_init_py: free(py_impl); error_alloc_py_impl: @@ -4143,7 +4195,7 @@ void py_loader_impl_sys_path_print(PyObject *sys_path_list) } #endif -int py_loader_impl_finalize(loader_impl impl, loader_impl_py py_impl) +int py_loader_impl_finalize(loader_impl_py py_impl, const int host) { if (Py_IsInitialized() != 0) { @@ -4152,7 +4204,7 @@ int py_loader_impl_finalize(loader_impl impl, loader_impl_py py_impl) py_loader_impl_error_print(py_impl); } - if (loader_impl_get_option_host(impl) == 0) + if (host == 0) { #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 6 if (Py_FinalizeEx() != 0) @@ -4171,7 +4223,9 @@ int py_loader_impl_finalize(loader_impl impl, loader_impl_py py_impl) int py_loader_impl_destroy(loader_impl impl) { + const int host = loader_impl_get_option_host(impl); loader_impl_py py_impl = loader_impl_get(impl); + int result = 0; if (py_impl == NULL) { @@ -4184,15 +4238,19 @@ int py_loader_impl_destroy(loader_impl impl) py_loader_thread_acquire(); /* Stop event loop for async calls */ - PyObject *args_tuple = PyTuple_New(1); - Py_INCREF(py_impl->asyncio_loop); - PyTuple_SetItem(args_tuple, 0, py_impl->asyncio_loop); - PyObject_Call(py_impl->thread_background_stop, args_tuple, NULL); - Py_XDECREF(args_tuple); - - if (PyErr_Occurred() != NULL) { - py_loader_impl_error_print(py_impl); + PyObject *args_tuple = PyTuple_New(2); + Py_INCREF(py_impl->asyncio_loop); + PyTuple_SetItem(args_tuple, 0, py_impl->asyncio_loop); + /* If it is host, do not join the thread */ + PyTuple_SetItem(args_tuple, 1, PyBool_FromLong(!host)); + PyObject_Call(py_impl->thread_background_stop, args_tuple, NULL); + Py_XDECREF(args_tuple); + + if (PyErr_Occurred() != NULL) + { + py_loader_impl_error_print(py_impl); + } } Py_DECREF(py_impl->inspect_signature); @@ -4216,6 +4274,7 @@ int py_loader_impl_destroy(loader_impl impl) Py_XDECREF(py_impl->thread_background_start); Py_XDECREF(py_impl->thread_background_send); Py_XDECREF(py_impl->thread_background_stop); + Py_XDECREF(py_impl->thread_background_register_atexit); #if DEBUG_ENABLED { @@ -4227,10 +4286,18 @@ int py_loader_impl_destroy(loader_impl impl) } #endif - int result = py_loader_impl_finalize(impl, py_impl); + result = py_loader_impl_finalize(py_impl, host); - /* Unhook the deallocation of PyCFunction */ - PyCFunction_Type.tp_dealloc = py_loader_impl_pycfunction_dealloc; + if (host == 0) + { + /* Unhook the deallocation of PyCFunction */ + PyCFunction_Type.tp_dealloc = py_loader_impl_pycfunction_dealloc; + } + else + { + /* On host, release the GIL and let Python continue until it calls Py_Finalize by itself */ + py_loader_thread_release(); + } free(py_impl); diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index fbf3b457c..9edb8277e 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -489,13 +489,6 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) /* Obtain Python loader implementation */ impl = loader_get_impl(py_loader_tag); - /* TODO: Remove this check when we implement this: https://github.com/metacall/core/issues/231 */ - if (impl == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid Python loader instance, MetaCall Port must be used from MetaCall CLI"); - return py_loader_port_none(); - } - var_args_size = PyTuple_Size(var_args); if (var_args_size == 0) @@ -619,13 +612,6 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) /* Obtain Python loader implementation */ impl = loader_get_impl(py_loader_tag); - /* TODO: Remove this check when we implement this: https://github.com/metacall/core/issues/231 */ - if (impl == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid Python loader instance, MetaCall Port must be used from MetaCall CLI"); - return py_loader_port_none(); - } - var_args_size = PyTuple_Size(var_args); if (var_args_size == 0) @@ -840,10 +826,6 @@ static PyObject *py_loader_port_value_reference(PyObject *self, PyObject *args) /* Obtain Python loader implementation */ impl = loader_get_impl(py_loader_tag); - /* TODO: When using the port outside MetaCall this is going to segfault for functions and similar - * structures that require py loader internal structure to be initialized. For those cases, we - * must implement this: https://github.com/metacall/core/issues/231 - */ v = py_loader_impl_capi_to_value(impl, obj, py_loader_impl_capi_to_value_type(impl, obj)); if (v == NULL) @@ -912,10 +894,6 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args /* Obtain Python loader implementation */ impl = loader_get_impl(py_loader_tag); - /* TODO: When using the port outside MetaCall this is going to segfault for functions and similar - * structures that require py loader internal structure to be initialized. For those cases, we - * must implement this: https://github.com/metacall/core/issues/231 - */ result = py_loader_impl_value_to_capi(impl, value_type_id(v), v); if (result == NULL) @@ -927,6 +905,24 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args return result; } +static PyObject *py_loader_port_atexit(PyObject *self, PyObject *args) +{ + loader_impl impl = loader_get_impl(py_loader_tag); + + (void)self; + (void)args; + + if (impl != NULL) + { + if (py_loader_impl_destroy(impl) != 0) + { + PyErr_SetString(PyExc_RuntimeError, "Failed to destroy Python Loader on MetaCall."); + } + } + + return py_loader_port_none(); +} + static PyMethodDef metacall_methods[] = { { "metacall_load_from_file", py_loader_port_load_from_file, METH_VARARGS, "Loads a script from file." }, @@ -948,6 +944,8 @@ static PyMethodDef metacall_methods[] = { "Create a new value of type Pointer." }, { "metacall_value_dereference", py_loader_port_value_dereference, METH_VARARGS, "Get the data which a value of type Pointer is pointing to." }, + { "py_loader_port_atexit", py_loader_port_atexit, METH_NOARGS, + "At exit function that will be executed when Python is host, for internal cleanup purposes." }, { NULL, NULL, 0, NULL } }; diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c new file mode 100644 index 000000000..6ecfd3582 --- /dev/null +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -0,0 +1,28 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading python code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <Python.h> + +/* Required for when linking to Python in debug mode and loading with Python.exe in release mode */ +#if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) + #if defined(__clang__) || defined(__GNUC__) +__attribute__((weak)) void _Py_DECREF_DecRefTotal(void) {} + #endif +#endif diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index 5aa5173a9..3a669d013 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -62,9 +62,15 @@ static uint64_t main_thread_ref_count = 0; thread_local py_thread_state current_thread_state; thread_local uint64_t current_thread_id = thread_id_get_current(); -void py_loader_thread_initialize() +void py_loader_thread_initialize(const int host) { main_thread_id = thread_id_get_current(); + + if (host == 1) + { + main_thread_state = PyThreadState_Get(); + main_thread_ref_count++; + } } int py_loader_thread_is_main() diff --git a/source/metacall/source/metacall.c b/source/metacall/source/metacall.c index fcba2931a..cd7366184 100644 --- a/source/metacall/source/metacall.c +++ b/source/metacall/source/metacall.c @@ -112,7 +112,6 @@ portability_constructor(metacall_constructor) if (metacall_initialize_ex(config) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "MetaCall host constructor failed to initialize"); - metacall_value_destroy(config[0].options); exit(1); } diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index 4fb44685c..abb6d38f1 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -184,8 +184,7 @@ if(OPTION_BUILD_CLI) message(STATUS "Test ${node_port_test}") add_test(NAME ${target} - COMMAND ${CMAKE_COMMAND} -D "EXECUTABLE=$<TARGET_FILE:metacallcli>" -D "INPUT=${CMAKE_CURRENT_SOURCE_DIR}/test/commands/node_port.txt" -P "${CMAKE_SOURCE_DIR}/source/cli/metacallcli/test/commands/command_runner.cmake" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND $<TARGET_FILE:metacallcli> ${CMAKE_CURRENT_SOURCE_DIR}/test.js ) # @@ -196,10 +195,6 @@ if(OPTION_BUILD_CLI) PROPERTY LABELS ${node_port_test} ) - set_tests_properties(${target} PROPERTIES - PASS_REGULAR_EXPRESSION "Tests passed without errors" - ) - # Add dependencies and optional dependencies add_dependencies(${target} node_loader @@ -232,8 +227,7 @@ set(node_port_test_exec "${node_port_test}_executable") message(STATUS "Test ${node_port_test_exec}") add_test(NAME ${node_port_test_exec} - COMMAND ${NodeJS_EXECUTABLE} -e "require('./test.js').main()" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${NodeJS_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.js ) # Define test labels diff --git a/source/ports/node_port/test.js b/source/ports/node_port/test.js index 6dd49fbc3..36cb0f849 100644 --- a/source/ports/node_port/test.js +++ b/source/ports/node_port/test.js @@ -41,17 +41,15 @@ const waitForMocha = async () => { return new Promise((resolve, reject) => mocha.run(failures => failures ? reject(failures) : resolve())); }; -module.exports = { - main: async () => { - try { - // Run the tests - await waitForMocha(); - } catch (failures) { - if (failures !== 0) { - process.exit(1); - } +void (async () => { + try { + // Run the tests + await waitForMocha(); + } catch (failures) { + if (failures !== 0) { + process.exit(1); } + } - return 'Tests passed without errors'; - }, -}; + console.log('Tests passed without errors'); +})(); diff --git a/source/ports/node_port/test/commands/node_port.txt b/source/ports/node_port/test/commands/node_port.txt deleted file mode 100644 index 7a231f9e1..000000000 --- a/source/ports/node_port/test/commands/node_port.txt +++ /dev/null @@ -1,3 +0,0 @@ -load node test.js -await main() -exit diff --git a/source/ports/py_port/CMakeLists.txt b/source/ports/py_port/CMakeLists.txt index c6bd6f330..5f673e83d 100644 --- a/source/ports/py_port/CMakeLists.txt +++ b/source/ports/py_port/CMakeLists.txt @@ -7,6 +7,8 @@ endif() # External dependencies # +find_package(Python3 COMPONENTS Interpreter REQUIRED) + # # Port name and options # @@ -18,8 +20,6 @@ set(target py_port) message(STATUS "Port ${target}") if(NOT OPTION_BUILD_GUIX) - find_package(Python3 COMPONENTS Interpreter REQUIRED) - if(Python3_VERSION_MAJOR EQUAL 3 AND Python3_VERSION_MINOR GREATER_EQUAL 11) set(PIP_BREAK_SYSTEM_PACKAGES "--break-system-packages") else() @@ -29,52 +29,70 @@ if(NOT OPTION_BUILD_GUIX) install(CODE "execute_process(COMMAND ${PIP_BACKWARD_COMPATIBILITY} pip3 install ${PIP_BREAK_SYSTEM_PACKAGES} ${CMAKE_CURRENT_SOURCE_DIR})") endif() -# -# Configure test -# - # Check if loaders are enabled if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_RB OR NOT OPTION_BUILD_SCRIPTS_NODE) return() endif() +# Enable Rust test if the rs_loader is built +if(OPTION_BUILD_LOADERS_RS) + set(TESTS_ENVIRONMENT_VARIABLES_RS "OPTION_BUILD_LOADERS_RS=1") +endif() + +# +# Define test (CLI) +# + set(py_port_test "${target}_test") +if(NOT OPTION_BUILD_CLI) + # Add test (CLI) + add_test(NAME ${target} + COMMAND $<TARGET_FILE:metacallcli> ${CMAKE_CURRENT_SOURCE_DIR}/test.py + ) + + # + # Define test labels + # + + set_property(TEST ${target} + PROPERTY LABELS ${py_port_test} + ) + + include(TestEnvironmentVariables) + + test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} + ${TESTS_ENVIRONMENT_VARIABLES_RS} + ) +endif() + # -# Define test +# Define test (Python) # -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/test/commands/py_port.txt.in - ${CMAKE_CURRENT_BINARY_DIR}/py_port.txt -) +set(py_port_test_exec "${py_port_test}_executable") -# Add test (must be run with MetaCall CLI) -add_test(NAME ${target} - COMMAND ${CMAKE_COMMAND} -D "EXECUTABLE=$<TARGET_FILE:metacallcli>" -D "INPUT=${CMAKE_CURRENT_BINARY_DIR}/py_port.txt" -P "${CMAKE_SOURCE_DIR}/source/cli/metacallcli/test/commands/command_runner.cmake" +# Add test (Python) +add_test(NAME ${py_port_test_exec} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py ) # # Define test labels # -set_property(TEST ${target} - PROPERTY LABELS ${py_port_test} -) - -set_tests_properties(${target} PROPERTIES - PASS_REGULAR_EXPRESSION "Tests passed without errors" +set_property(TEST ${py_port_test_exec} + PROPERTY LABELS ${py_port_test_exec} ) include(TestEnvironmentVariables) -# Enable rust test if it is built -if(OPTION_BUILD_LOADERS_RS) - set(TESTS_ENVIRONMENT_VARIABLES_RS "OPTION_BUILD_LOADERS_RS=1") -endif() - -test_environment_variables(${target} +test_environment_variables(${py_port_test_exec} "" ${TESTS_ENVIRONMENT_VARIABLES} ${TESTS_ENVIRONMENT_VARIABLES_RS} + "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) diff --git a/source/ports/py_port/test.py b/source/ports/py_port/test.py index 034a4ac69..7405b9c3c 100644 --- a/source/ports/py_port/test.py +++ b/source/ports/py_port/test.py @@ -16,4 +16,7 @@ def main(): if len(result.errors) + len(result.failures) == 0: return 'Tests passed without errors' else: - return '' + exit(1) + +if __name__ == "__main__": + main() diff --git a/source/ports/py_port/test/commands/py_port.txt.in b/source/ports/py_port/test/commands/py_port.txt.in deleted file mode 100644 index 2a9019bbc..000000000 --- a/source/ports/py_port/test/commands/py_port.txt.in +++ /dev/null @@ -1,3 +0,0 @@ -load py ${CMAKE_CURRENT_SOURCE_DIR}/test.py -call main() -exit From b880e6180de766a675aa417cfe086fb8b7c747db Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 23 May 2025 18:22:56 +0200 Subject: [PATCH 283/487] Improve python.exe support. --- source/loader/include/loader/loader_host.h | 2 + source/loader/source/loader.c | 10 +- source/loader/source/loader_host.c | 11 ++ .../include/py_loader/py_loader_threading.h | 6 + .../loaders/py_loader/source/py_loader_impl.c | 147 +++++++++--------- .../source/py_loader_symbol_fallback.c | 64 ++++++++ .../py_loader/source/py_loader_threading.cpp | 29 +++- source/plugin/include/plugin/plugin_impl.h | 28 ++++ source/plugin/source/plugin_impl.c | 8 + .../dynlink_test/source/dynlink_test.cpp | 2 +- 10 files changed, 226 insertions(+), 81 deletions(-) diff --git a/source/loader/include/loader/loader_host.h b/source/loader/include/loader/loader_host.h index e5844e125..cc740a299 100644 --- a/source/loader/include/loader/loader_host.h +++ b/source/loader/include/loader/loader_host.h @@ -42,6 +42,8 @@ extern "C" { LOADER_API plugin loader_host_initialize(void); +LOADER_API plugin loader_host_get(void); + LOADER_API int loader_host_register(loader_impl host, context ctx, const char *name, loader_register_invoke invoke, function *func, type_id return_type, size_t arg_size, type_id args_type_id[]); #ifdef __cplusplus diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 1fe457cad..c6786c959 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -818,15 +818,19 @@ void loader_destroy(void) loader_unload_children(NULL); /* The host is the first loader, it must be destroyed at the end */ - if (manager_impl->host != NULL) + if (manager_impl->host == loader_host_get()) { if (plugin_manager_clear(&loader_manager, manager_impl->host) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Failed to clear host loader"); } - - manager_impl->host = NULL; } + else + { + plugin_destroyed(manager_impl->host); + } + + manager_impl->host = NULL; } plugin_manager_destroy(&loader_manager); diff --git a/source/loader/source/loader_host.c b/source/loader/source/loader_host.c index 7ddfb65a4..0ac16440f 100644 --- a/source/loader/source/loader_host.c +++ b/source/loader/source/loader_host.c @@ -52,6 +52,10 @@ static void loader_host_destroy_dtor(plugin p); static void loader_host_destroy(loader_impl host); +/* -- Private Member Data -- */ + +static plugin loader_host_plugin = NULL; + /* -- Methods -- */ function_return function_host_interface_invoke(function func, function_impl func_impl, function_args args, size_t size) @@ -139,12 +143,19 @@ plugin loader_host_initialize(void) goto error; } + loader_host_plugin = p; + return p; error: loader_host_destroy(host); return NULL; } +plugin loader_host_get(void) +{ + return loader_host_plugin; +} + int loader_host_register(loader_impl host, context ctx, const char *name, loader_register_invoke invoke, function *func, type_id return_type, size_t arg_size, type_id args_type_id[]) { void **invoke_ptr = (void *)&invoke; diff --git a/source/loaders/py_loader/include/py_loader/py_loader_threading.h b/source/loaders/py_loader/include/py_loader/py_loader_threading.h index 82b7ece7c..592dcaa02 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_threading.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_threading.h @@ -23,6 +23,8 @@ #include <py_loader/py_loader_api.h> +#include <Python.h> + #ifdef __cplusplus extern "C" { #endif @@ -35,6 +37,10 @@ PY_LOADER_NO_EXPORT void py_loader_thread_acquire(void); PY_LOADER_NO_EXPORT void py_loader_thread_release(void); +PY_LOADER_NO_EXPORT void py_loader_thread_delayed_destroy(PyObject *obj); + +PY_LOADER_NO_EXPORT void py_loader_thread_destroy(void); + #ifdef __cplusplus } #endif diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 7c5f55823..15acd6ae7 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -292,9 +292,7 @@ void py_loader_impl_value_invoke_state_finalize(value v, void *data) if (loader_is_destroyed(invoke_state->impl) != 0 && capsule != NULL) { - py_loader_thread_acquire(); - Py_DECREF(capsule); - py_loader_thread_release(); + py_loader_thread_delayed_destroy(capsule); } free(invoke_state); @@ -312,10 +310,9 @@ void py_loader_impl_value_ptr_finalize(value v, void *data) if (loader_is_destroyed(impl) != 0) { - py_loader_thread_acquire(); PyObject *obj = (PyObject *)value_to_ptr(v); - Py_XDECREF(obj); - py_loader_thread_release(); + + py_loader_thread_delayed_destroy(obj); } } } @@ -401,9 +398,7 @@ void future_py_interface_destroy(future f, future_impl impl) { if (loader_is_destroyed(py_future->impl) != 0) { - py_loader_thread_acquire(); - Py_DECREF(py_future->future); - py_loader_thread_release(); + py_loader_thread_delayed_destroy(py_future->future); } free(py_future); @@ -555,18 +550,17 @@ void py_object_interface_destroy(object obj, object_impl impl) { if (loader_is_destroyed(py_object->impl) != 0) { - py_loader_thread_acquire(); - - Py_XDECREF(py_object->obj); - - py_loader_thread_release(); - - if (py_object->obj_class != NULL) + if (py_object->obj != NULL) { - value_type_destroy(py_object->obj_class); + py_loader_thread_delayed_destroy(py_object->obj); } } + if (py_object->obj_class != NULL) + { + value_type_destroy(py_object->obj_class); + } + free(py_object); } } @@ -781,9 +775,7 @@ void py_class_interface_destroy(klass cls, class_impl impl) { if (loader_is_destroyed(py_class->impl) != 0) { - py_loader_thread_acquire(); - Py_XDECREF(py_class->cls); - py_loader_thread_release(); + py_loader_thread_delayed_destroy(py_class->cls); } free(py_class); @@ -1862,9 +1854,7 @@ void function_py_interface_destroy(function func, function_impl impl) if (loader_is_destroyed(py_func->impl) != 0) { - py_loader_thread_acquire(); - Py_DECREF(py_func->func); - py_loader_thread_release(); + py_loader_thread_delayed_destroy(py_func->func); } free(py_func); @@ -1958,25 +1948,9 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) Py_RETURN_NONE; } -PyObject *py_loader_impl_get_builtin(loader_impl_py py_impl, const char *builtin_name) -{ - PyObject *builtin = PyObject_GetAttrString(py_impl->builtins_module, builtin_name); - - Py_XINCREF(builtin); - - if (builtin != NULL && PyType_Check(builtin)) - { - return builtin; - } - - Py_XDECREF(builtin); - - return NULL; -} - int py_loader_impl_get_builtin_type(loader_impl impl, loader_impl_py py_impl, type_id id, const char *name) { - PyObject *builtin = py_loader_impl_get_builtin(py_impl, name); + PyObject *builtin = PyObject_GetAttrString(py_impl->builtins_module, name); if (builtin == NULL) { @@ -1990,11 +1964,14 @@ int py_loader_impl_get_builtin_type(loader_impl impl, loader_impl_py py_impl, ty goto error_create_type; } - if (loader_impl_type_define(impl, type_name(builtin_type), builtin_type) == 0) + if (loader_impl_type_define(impl, type_name(builtin_type), builtin_type) != 0) { - return 0; + goto error_define_type; } + return 0; + +error_define_type: type_destroy(builtin_type); error_create_type: Py_DECREF(builtin); @@ -2004,17 +1981,7 @@ int py_loader_impl_get_builtin_type(loader_impl impl, loader_impl_py py_impl, ty int py_loader_impl_import_module(loader_impl_py py_impl, PyObject **module, const char *name) { - PyObject *module_name, *sys_modules = PyImport_GetModuleDict(); - *module = PyDict_GetItemString(sys_modules, name); - - if (*module != NULL) - { - return 0; - } - - module_name = PyUnicode_DecodeFSDefault(name); - *module = PyImport_Import(module_name); - Py_DECREF(module_name); + *module = PyImport_ImportModule(name); if (*module == NULL) { @@ -2247,9 +2214,11 @@ int py_loader_impl_initialize_traceback(loader_impl impl, loader_impl_py py_impl return 1; } +#if DEBUG_ENABLED int py_loader_impl_initialize_gc(loader_impl_py py_impl) { -#if DEBUG_ENABLED + PyObject *flags; + if (py_loader_impl_import_module(py_impl, &py_impl->gc_module, "gc") != 0) { goto error_import_module; @@ -2268,33 +2237,55 @@ int py_loader_impl_initialize_gc(loader_impl_py py_impl) } py_impl->gc_debug_leak = PyDict_GetItemString(PyModule_GetDict(py_impl->gc_module), "DEBUG_LEAK"); + + if (py_impl->gc_debug_leak == NULL) + { + goto error_callable_check; + } + + Py_INCREF(py_impl->gc_debug_leak); + py_impl->gc_debug_stats = PyDict_GetItemString(PyModule_GetDict(py_impl->gc_module), "DEBUG_STATS"); - if (py_impl->gc_debug_leak != NULL && py_impl->gc_debug_stats != NULL) + if (py_impl->gc_debug_stats == NULL) { - Py_INCREF(py_impl->gc_debug_leak); - Py_INCREF(py_impl->gc_debug_stats); + goto error_debug_leak; + } - return 0; + Py_INCREF(py_impl->gc_debug_stats); + + flags = PyNumber_Or(py_impl->gc_debug_leak, py_impl->gc_debug_stats); + + if (flags == NULL) + { + goto error_debug_stats; } - Py_XDECREF(py_impl->gc_debug_leak); - Py_XDECREF(py_impl->gc_debug_stats); + PyObject_CallFunctionObjArgs(py_impl->gc_set_debug, flags, NULL); + + Py_DECREF(flags); + + if (PyErr_Occurred() != NULL) + { + goto error_call_set_debug; + } + return 0; + +error_call_set_debug: + py_loader_impl_error_print(py_impl); +error_debug_stats: + Py_XDECREF(py_impl->gc_debug_stats); +error_debug_leak: + Py_XDECREF(py_impl->gc_debug_leak); error_callable_check: Py_XDECREF(py_impl->gc_set_debug); error_set_debug: Py_DECREF(py_impl->gc_module); error_import_module: return 1; -#else - { - (void)py_impl; - - return 1; - } -#endif } +#endif int py_loader_impl_initialize_import(loader_impl_py py_impl) { @@ -2398,6 +2389,7 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) "import asyncio\n" "import threading\n" "import sys\n" + // "import atexit; atexit.register(getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None))\n" "class ThreadLoop:\n" " def __init__(self, loop, t):\n" " self.loop = loop\n" @@ -2433,9 +2425,10 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) " if join:\n" " tl.t.join()\n" "def atexit_background_loop(tl):\n" - /* This checks if py_port_impl_module contains py_loader_port_atexit */ - " py_loader_port_atexit = getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None)\n" - " tl.loop.call_soon_threadsafe(py_loader_port_atexit)\n" + /* Checks if py_port_impl_module contains py_loader_port_atexit and executes it */ + // " py_loader_port_atexit = getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None)\n" + " getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None)()\n" + // " tl.loop.call_soon_threadsafe(stop_background_loop, tl, False)\n" "def register_atexit_background_loop(tl):\n" " threading._register_atexit(atexit_background_loop, tl)\n"; @@ -2714,12 +2707,9 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi #if DEBUG_ENABLED /* Initialize GC module */ { - if (py_loader_impl_initialize_gc(py_impl) != 0) - { - PyObject_CallMethodObjArgs(py_impl->gc_module, py_impl->gc_set_debug, py_impl->gc_debug_leak /* py_impl->gc_debug_stats */); - gc_initialized = 0; - } - else + gc_initialized = py_loader_impl_initialize_gc(py_impl); + + if (gc_initialized != 0) { log_write("metacall", LOG_LEVEL_WARNING, "Invalid garbage collector module creation"); } @@ -4253,6 +4243,10 @@ int py_loader_impl_destroy(loader_impl impl) } } + /* Delete all the objects from the destructors of the other threads */ + py_loader_thread_destroy(); + + /* Destroy all Python loader objects */ Py_DECREF(py_impl->inspect_signature); Py_DECREF(py_impl->inspect_getattr_static); Py_DECREF(py_impl->inspect_getfullargspec); @@ -4286,6 +4280,7 @@ int py_loader_impl_destroy(loader_impl impl) } #endif + /* Destroy Python runtime itself (only when it is not the host) */ result = py_loader_impl_finalize(py_impl, host); if (host == 0) diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 6ecfd3582..62ca99513 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -23,6 +23,70 @@ /* Required for when linking to Python in debug mode and loading with Python.exe in release mode */ #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) #if defined(__clang__) || defined(__GNUC__) + + #include <dynlink/dynlink.h> + __attribute__((weak)) void _Py_DECREF_DecRefTotal(void) {} +__attribute__((weak)) void _Py_INCREF_IncRefTotal(void) {} + + /* When Python has been compiled with tracing reference counting, +provide fallback symbols for allowing it to compile properly */ + #ifdef Py_TRACE_REFS + + #undef PyModule_Create2 + #undef PyModule_FromDefAndSpec2 + +static dynlink_symbol_addr py_loader_symbol(const char *name) +{ + dynlink proc = dynlink_load_self(DYNLINK_FLAGS_BIND_NOW | DYNLINK_FLAGS_BIND_GLOBAL); + dynlink_symbol_addr addr = NULL; + + if (proc == NULL) + { + return NULL; + } + + dynlink_symbol(proc, name, &addr); + + dynlink_unload(proc); + + return addr; +} + +__attribute__((weak)) PyObject *PyModule_Create2(struct PyModuleDef *module, int module_api_version) +{ + static PyObject *(*py_module_create2)(struct PyModuleDef *, int) = NULL; + + if (py_module_create2 == NULL) + { + py_module_create2 = (PyObject * (*)(struct PyModuleDef *, int)) py_loader_symbol("PyModule_Create2TraceRefs"); + } + + if (py_module_create2 == NULL) + { + return NULL; + } + + return py_module_create2(module, module_api_version); +} +__attribute__((weak)) PyObject *PyModule_FromDefAndSpec2(PyModuleDef *def, PyObject *spec, int module_api_version) +{ + static PyObject *(*py_module_from_def_and_spec2)(struct PyModuleDef *, PyObject *, int) = NULL; + + if (py_module_from_def_and_spec2 == NULL) + { + py_module_from_def_and_spec2 = (PyObject * (*)(struct PyModuleDef *, PyObject *, int)) py_loader_symbol("PyModule_FromDefAndSpec2TraceRefs"); + } + + if (py_module_from_def_and_spec2 == NULL) + { + return NULL; + } + + return py_module_from_def_and_spec2(def, spec, module_api_version); +} + + #endif + #endif #endif diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index 3a669d013..32b2e1c93 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -22,7 +22,7 @@ #include <threading/threading_thread_id.h> -#include <Python.h> +#include <vector> struct py_thread_state { @@ -61,6 +61,7 @@ static uint64_t main_thread_id = 0; static uint64_t main_thread_ref_count = 0; thread_local py_thread_state current_thread_state; thread_local uint64_t current_thread_id = thread_id_get_current(); +static std::vector<PyObject *> delayed_destructor; void py_loader_thread_initialize(const int host) { @@ -119,3 +120,29 @@ void py_loader_thread_release() current_thread_state.release(); } } + +void py_loader_thread_delayed_destroy(PyObject *obj) +{ + if (main_thread_id == current_thread_id) + { + py_loader_thread_acquire(); + Py_DECREF(obj); + py_loader_thread_release(); + } + else + { + delayed_destructor.push_back(obj); + } +} + +void py_loader_thread_destroy(void) +{ + py_loader_thread_acquire(); + + for (auto obj : delayed_destructor) + { + Py_DECREF(obj); + } + + py_loader_thread_release(); +} diff --git a/source/plugin/include/plugin/plugin_impl.h b/source/plugin/include/plugin/plugin_impl.h index bc8b51ecf..1489ca97d 100644 --- a/source/plugin/include/plugin/plugin_impl.h +++ b/source/plugin/include/plugin/plugin_impl.h @@ -59,8 +59,36 @@ PLUGIN_API void *plugin_iface(plugin p); PLUGIN_API void *plugin_impl(plugin p); +/** +* @brief +* Executes the destructor once and nullifies it, it does not free +* the memory of the plugin but the destructor is removed +* +* @param[in] p +* The plugin that will be used to execute the destructor +*/ PLUGIN_API void plugin_destructor(plugin p); +/** +* @brief +* Marks the plugin as destroyed, nullifies the destructor +* but does not free the memory of the plugin, this is useful +* for when we execute loader plugin manager in host mode, +* because the destructor is called without the control of metacall, +* and it prevents to call it again after it has been called by host +* +* @param[in] p +* The plugin that will be used to clear the destructor +*/ +PLUGIN_API void plugin_destroyed(plugin p); + +/** +* @brief +* Executes the destructor if any and frees all the memory +* +* @param[in] p +* The plugin to be destroyed +*/ PLUGIN_API void plugin_destroy(plugin p); #ifdef __cplusplus diff --git a/source/plugin/source/plugin_impl.c b/source/plugin/source/plugin_impl.c index 5cb9e6f2c..511897bde 100644 --- a/source/plugin/source/plugin_impl.c +++ b/source/plugin/source/plugin_impl.c @@ -113,6 +113,14 @@ void plugin_destructor(plugin p) } } +void plugin_destroyed(plugin p) +{ + if (p != NULL) + { + p->dtor = NULL; + } +} + void plugin_destroy(plugin p) { if (p != NULL) diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index 1ebd63613..8bebf4526 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -62,7 +62,7 @@ TEST_F(dynlink_test, DefaultConstructor) /* Test loading symbols from current process */ { - dynlink proc = dynlink_load_self(DYNLINK_FLAGS_BIND_GLOBAL | DYNLINK_FLAGS_BIND_LAZY); + dynlink proc = dynlink_load_self(DYNLINK_FLAGS_BIND_LAZY | DYNLINK_FLAGS_BIND_GLOBAL); ASSERT_NE((dynlink)proc, (dynlink)(NULL)); From 27c005dcf56012f40751ecbbda48ea66f18df64a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 23 May 2025 18:43:51 +0200 Subject: [PATCH 284/487] Change print of gc. --- .../loaders/py_loader/source/py_loader_impl.c | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 15acd6ae7..f5de0f6c6 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -4130,29 +4130,39 @@ value py_loader_impl_error_value_from_exception(loader_impl_py py_impl, PyObject void py_loader_impl_gc_print(loader_impl_py py_impl) { static const char garbage_format_str[] = "Python Garbage Collector:\n%s"; - static const char separator_str[] = "\n"; + PyObject *garbage_repr, *garbage_list = PyObject_GetAttrString(py_impl->gc_module, "garbage"); + const char *garbage_str; - PyObject *garbage_list, *separator, *garbage_str_obj; + if (garbage_list == NULL) + { + goto error_garbage_list; + } - garbage_list = PyObject_GetAttrString(py_impl->gc_module, "garbage"); + garbage_repr = PyObject_Repr(garbage_list); - #if PY_MAJOR_VERSION == 2 - separator = PyString_FromString(separator_str); - - garbage_str_obj = PyString_Join(separator, garbage_list); + if (garbage_repr == NULL) + { + goto error_garbage_repr; + } - log_write("metacall", LOG_LEVEL_DEBUG, garbage_format_str, PyString_AsString(garbage_str_obj)); - #elif PY_MAJOR_VERSION == 3 - separator = PyUnicode_FromString(separator_str); + garbage_str = PyUnicode_AsUTF8(garbage_repr); - garbage_str_obj = PyUnicode_Join(separator, garbage_list); + if (garbage_str == NULL) + { + goto error_garbage_str; + } - log_write("metacall", LOG_LEVEL_DEBUG, garbage_format_str, PyUnicode_AsUTF8(garbage_str_obj)); - #endif + log_write("metacall", LOG_LEVEL_DEBUG, garbage_format_str, garbage_str); +error_garbage_str: + Py_DECREF(garbage_repr); +error_garbage_repr: Py_DECREF(garbage_list); - Py_DECREF(separator); - Py_DECREF(garbage_str_obj); +error_garbage_list: + if (PyErr_Occurred() != NULL) + { + py_loader_impl_error_print(py_impl); + } } void py_loader_impl_sys_path_print(PyObject *sys_path_list) From 99fdb5f9b1db118e14f2eeb2a9cd106662729e38 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 28 May 2025 17:18:35 +0200 Subject: [PATCH 285/487] Try to solve issues with python and iterators. --- cmake/CompileOptions.cmake | 49 ++++ source/adt/include/adt/adt_map.h | 13 +- source/adt/include/adt/adt_set.h | 13 +- source/adt/source/adt_map.c | 42 +-- source/adt/source/adt_set.c | 42 +-- source/adt/source/adt_trie.c | 22 +- .../benchmarks/set_bench/source/set_bench.cpp | 6 +- .../source/configuration_object.c | 14 +- .../source/configuration_singleton.c | 6 +- source/loader/source/loader.c | 12 +- source/loader/source/loader_impl.c | 38 +-- .../node_loader/source/node_loader_impl.cpp | 8 +- .../include/py_loader/py_loader_port.h | 2 - .../loaders/py_loader/source/py_loader_dict.c | 2 - .../source/py_loader_symbol_fallback.c | 6 +- .../include/rb_loader/rb_loader_impl_parser.h | 8 +- .../include/rb_loader/rb_loader_port.h | 36 +++ .../rb_loader/source/rb_loader_impl_parser.c | 12 +- .../loaders/rb_loader/source/rb_loader_port.c | 148 ++++++++++ source/plugin/source/plugin_manager.c | 6 +- source/ports/java_port/CMakeLists.txt | 262 ------------------ source/ports/java_port/pom.xml | 84 ------ .../java/metacall/{util.java => Utils.java} | 2 +- .../java_port/test/{run.java.in => main.java} | 0 source/ports/js_port/CMakeLists.txt | 16 ++ source/ports/py_port/CMakeLists.txt | 9 + source/reflect/source/reflect_class.c | 32 +-- source/reflect/source/reflect_scope.c | 22 +- .../scripts/python/garbage/source/garbage.py | 2 +- .../adt_map_test/source/adt_map_test.cpp | 7 +- .../adt_set_test/source/adt_set_test.cpp | 7 +- .../source/metacall_node_python_ruby_test.cpp | 2 +- .../source/metacall_python_gc_test.cpp | 6 +- 33 files changed, 423 insertions(+), 513 deletions(-) create mode 100644 source/loaders/rb_loader/include/rb_loader/rb_loader_port.h create mode 100644 source/loaders/rb_loader/source/rb_loader_port.c delete mode 100644 source/ports/java_port/pom.xml rename source/ports/java_port/src/main/java/metacall/{util.java => Utils.java} (98%) rename source/ports/java_port/test/{run.java.in => main.java} (100%) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index e72d648a1..1718b84d7 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -427,6 +427,55 @@ if (PROJECT_OS_FAMILY MATCHES "unix" OR PROJECT_OS_FAMILY MATCHES "macos") endif() endif() +macro(check_symbol_executable symbol binary_path result_var) + if(WIN32) + find_program(DUMPBIN_EXECUTABLE dumpbin) + if(NOT DUMPBIN_EXECUTABLE) + message(FATAL_ERROR "Trying to find symbol ${symbol} in ${binary_path} but dumpbin was not found") + endif() + execute_process( + COMMAND ${DUMPBIN_EXECUTABLE} /symbols ${binary_path} + OUTPUT_VARIABLE dumpbin_output + RESULT_VARIABLE dumpbin_result + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(FIND "${dumpbin_output}" symbol SYMBOL_FOUND) + if(NOT SYMBOL_FOUND EQUAL -1) + set(${result_var} TRUE PARENT_SCOPE) + else() + set(${result_var} FALSE PARENT_SCOPE) + endif() + else() + find_program(NM_EXECUTABLE nm) + if(NM_EXECUTABLE) + execute_process( + COMMAND ${NM_EXECUTABLE} -D ${binary_path} + OUTPUT_VARIABLE nm_output + RESULT_VARIABLE nm_result + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(FIND "${nm_output}" symbol SYMBOL_FOUND) + if(NOT SYMBOL_FOUND EQUAL -1) + set(${result_var} TRUE PARENT_SCOPE) + else() + set(${result_var} FALSE PARENT_SCOPE) + endif() + else() + message(FATAL_ERROR "Trying to find symbol ${symbol} in ${binary_path} but nm was not found") + endif() + endif() +endmacro() + +function(check_asan_executable binary_path result_var) + check_symbol_executable("__asan_init" "${binary_path}" ${result_var}) +endfunction() + +function(check_tsan_executable binary_path result_var) + check_symbol_executable("__tsan_init" "${binary_path}" ${result_var}) +endfunction() + # # Linker options # diff --git a/source/adt/include/adt/adt_map.h b/source/adt/include/adt/adt_map.h index e0236c8b6..2a256463e 100644 --- a/source/adt/include/adt/adt_map.h +++ b/source/adt/include/adt/adt_map.h @@ -51,6 +51,15 @@ typedef int (*map_cb_iterate)(map, map_key, map_value, map_cb_iterate_args); typedef struct map_iterator_type *map_iterator; +/* -- Member Data -- */ + +struct map_iterator_type +{ + map m; + size_t current_bucket; + size_t current_pair; +}; + /* -- Methods -- */ ADT_API map map_create(map_cb_hash hash_cb, map_cb_compare compare_cb); @@ -79,7 +88,7 @@ ADT_API int map_clear(map m); ADT_API void map_destroy(map m); -ADT_API map_iterator map_iterator_begin(map m); +ADT_API void map_iterator_begin(map_iterator it, map m); ADT_API map_key map_iterator_key(map_iterator it); @@ -87,7 +96,7 @@ ADT_API map_value map_iterator_value(map_iterator it); ADT_API void map_iterator_next(map_iterator it); -ADT_API int map_iterator_end(map_iterator *it); +ADT_API int map_iterator_end(map_iterator it); #ifdef __cplusplus } diff --git a/source/adt/include/adt/adt_set.h b/source/adt/include/adt/adt_set.h index 2515d052f..a662a90b8 100644 --- a/source/adt/include/adt/adt_set.h +++ b/source/adt/include/adt/adt_set.h @@ -50,6 +50,15 @@ typedef int (*set_cb_iterate)(set, set_key, set_value, set_cb_iterate_args); typedef struct set_iterator_type *set_iterator; +/* -- Member Data -- */ + +struct set_iterator_type +{ + set s; + size_t current_bucket; + size_t current_pair; +}; + /* -- Methods -- */ ADT_API set set_create(set_cb_hash hash_cb, set_cb_compare compare_cb); @@ -80,7 +89,7 @@ ADT_API int set_clear(set s); ADT_API void set_destroy(set s); -ADT_API set_iterator set_iterator_begin(set s); +ADT_API void set_iterator_begin(set_iterator it, set s); ADT_API set_key set_iterator_key(set_iterator it); @@ -88,7 +97,7 @@ ADT_API set_value set_iterator_value(set_iterator it); ADT_API void set_iterator_next(set_iterator it); -ADT_API int set_iterator_end(set_iterator *it); +ADT_API int set_iterator_end(set_iterator it); #ifdef __cplusplus } diff --git a/source/adt/source/adt_map.c b/source/adt/source/adt_map.c index 949a211b6..2f1faaf5c 100644 --- a/source/adt/source/adt_map.c +++ b/source/adt/source/adt_map.c @@ -42,13 +42,6 @@ struct map_type map_cb_compare compare_cb; }; -struct map_iterator_type -{ - map m; - size_t current_bucket; - size_t current_pair; -}; - /* -- Methods -- */ map map_create(map_cb_hash hash_cb, map_cb_compare compare_cb) @@ -506,30 +499,29 @@ void map_destroy(map m) free(m); } -map_iterator map_iterator_begin(map m) +void map_iterator_begin(map_iterator it, map m) { - if (m != NULL && m->buckets != NULL && map_size(m) > 0) + if (it != NULL) { - map_iterator it = malloc(sizeof(struct map_iterator_type)); + it->current_bucket = 0; + it->current_pair = 0; - if (it != NULL) + if (m != NULL && m->buckets != NULL && map_size(m) > 0) { it->m = m; - it->current_bucket = 0; - it->current_pair = 0; map_iterator_next(it); - - return it; + } + else + { + it->m = NULL; } } - - return NULL; } map_key map_iterator_key(map_iterator it) { - if (it != NULL && it->current_bucket < it->m->capacity && it->current_pair > 0) + if (it != NULL && it->m != NULL && it->current_bucket < it->m->capacity && it->current_pair > 0) { return it->m->buckets[it->current_bucket].pairs[it->current_pair - 1].key; } @@ -539,7 +531,7 @@ map_key map_iterator_key(map_iterator it) map_value map_iterator_value(map_iterator it) { - if (it != NULL && it->current_bucket < it->m->capacity && it->current_pair > 0) + if (it != NULL && it->m != NULL && it->current_bucket < it->m->capacity && it->current_pair > 0) { return it->m->buckets[it->current_bucket].pairs[it->current_pair - 1].value; } @@ -549,7 +541,7 @@ map_value map_iterator_value(map_iterator it) void map_iterator_next(map_iterator it) { - if (it != NULL) + if (it != NULL && it->m != NULL) { for (; it->current_bucket < it->m->capacity; ++it->current_bucket) { @@ -575,16 +567,12 @@ void map_iterator_next(map_iterator it) } } -int map_iterator_end(map_iterator *it) +int map_iterator_end(map_iterator it) { - if (it != NULL && *it != NULL) + if (it != NULL && it->m != NULL) { - if ((*it)->current_bucket >= (*it)->m->capacity) + if (it->current_bucket >= it->m->capacity) { - free(*it); - - *it = NULL; - return 0; } diff --git a/source/adt/source/adt_set.c b/source/adt/source/adt_set.c index e6d79c36a..94816c032 100644 --- a/source/adt/source/adt_set.c +++ b/source/adt/source/adt_set.c @@ -42,13 +42,6 @@ struct set_type set_cb_compare compare_cb; }; -struct set_iterator_type -{ - set s; - size_t current_bucket; - size_t current_pair; -}; - /* -- Methods -- */ set set_create(set_cb_hash hash_cb, set_cb_compare compare_cb) @@ -521,30 +514,29 @@ void set_destroy(set s) free(s); } -set_iterator set_iterator_begin(set s) +void set_iterator_begin(set_iterator it, set s) { - if (s != NULL && s->buckets != NULL && set_size(s) > 0) + if (it != NULL) { - set_iterator it = malloc(sizeof(struct set_iterator_type)); + it->current_bucket = 0; + it->current_pair = 0; - if (it != NULL) + if (s != NULL && s->buckets != NULL && set_size(s) > 0) { it->s = s; - it->current_bucket = 0; - it->current_pair = 0; set_iterator_next(it); - - return it; + } + else + { + it->s = NULL; } } - - return NULL; } set_key set_iterator_key(set_iterator it) { - if (it != NULL && it->current_bucket < it->s->capacity && it->current_pair > 0) + if (it != NULL && it->s != NULL && it->current_bucket < it->s->capacity && it->current_pair > 0) { return it->s->buckets[it->current_bucket].pairs[it->current_pair - 1].key; } @@ -554,7 +546,7 @@ set_key set_iterator_key(set_iterator it) set_value set_iterator_value(set_iterator it) { - if (it != NULL && it->current_bucket < it->s->capacity && it->current_pair > 0) + if (it != NULL && it->s != NULL && it->current_bucket < it->s->capacity && it->current_pair > 0) { return it->s->buckets[it->current_bucket].pairs[it->current_pair - 1].value; } @@ -564,7 +556,7 @@ set_value set_iterator_value(set_iterator it) void set_iterator_next(set_iterator it) { - if (it != NULL) + if (it != NULL && it->s != NULL) { for (; it->current_bucket < it->s->capacity; ++it->current_bucket) { @@ -590,16 +582,12 @@ void set_iterator_next(set_iterator it) } } -int set_iterator_end(set_iterator *it) +int set_iterator_end(set_iterator it) { - if (it != NULL && *it != NULL) + if (it != NULL && it->s != NULL) { - if ((*it)->current_bucket >= (*it)->s->capacity) + if (it->current_bucket >= it->s->capacity) { - free(*it); - - *it = NULL; - return 0; } diff --git a/source/adt/source/adt_trie.c b/source/adt/source/adt_trie.c index 68e3d5d28..047c20a69 100644 --- a/source/adt/source/adt_trie.c +++ b/source/adt/source/adt_trie.c @@ -524,11 +524,11 @@ void trie_node_iterate(trie t, trie_node n, trie_cb_iterate iterate_cb, trie_cb_ if (back->childs != NULL) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(back->childs); set_iterator_end(&it) > 0; set_iterator_next(it)) + for (set_iterator_begin(&it, back->childs); set_iterator_end(&it) > 0; set_iterator_next(&it)) { - trie_node_ref ref_node = set_iterator_value(it); + trie_node_ref ref_node = set_iterator_value(&it); trie_node current_node = &t->node_list[ref_node->index]; @@ -610,11 +610,11 @@ int trie_node_clear(trie t, trie_node n) if (back->childs != NULL) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(back->childs); set_iterator_end(&it) > 0; set_iterator_next(it)) + for (set_iterator_begin(&it, back->childs); set_iterator_end(&it) > 0; set_iterator_next(&it)) { - trie_node_ref ref_node = set_iterator_value(it); + trie_node_ref ref_node = set_iterator_value(&it); trie_node current_node = &t->node_list[ref_node->index]; @@ -682,14 +682,13 @@ trie_node trie_node_find(trie t, trie_key key) if (back_ptr != NULL && *back_ptr != NULL) { trie_node back = *back_ptr; - - set_iterator it = NULL; + struct set_iterator_type it; if (back->childs != NULL) { - for (it = set_iterator_begin(back->childs); set_iterator_end(&it) > 0; set_iterator_next(it)) + for (set_iterator_begin(&it, back->childs); set_iterator_end(&it) > 0; set_iterator_next(&it)) { - trie_node_ref ref_node = set_iterator_value(it); + trie_node_ref ref_node = set_iterator_value(&it); trie_node current_node = &t->node_list[ref_node->index]; @@ -699,9 +698,10 @@ trie_node trie_node_find(trie t, trie_key key) if (back->key != NULL && t->compare_cb(back->key, key) == 0) { + /* TODO: it may be un-initialized here */ while (set_iterator_end(&it) > 0) { - set_iterator_next(it); + set_iterator_next(&it); } vector_destroy(node_stack); diff --git a/source/benchmarks/set_bench/source/set_bench.cpp b/source/benchmarks/set_bench/source/set_bench.cpp index 2e998b0d7..2129c98b5 100644 --- a/source/benchmarks/set_bench/source/set_bench.cpp +++ b/source/benchmarks/set_bench/source/set_bench.cpp @@ -88,6 +88,7 @@ BENCHMARK_REGISTER_F(set_bench, set_iterate) ->Iterations(ITERATIONS) ->Repetitions(3); +/* BENCHMARK_DEFINE_F(set_bench, set_iterators) (benchmark::State &state) { @@ -113,8 +114,8 @@ BENCHMARK_REGISTER_F(set_bench, set_iterators) ->Unit(benchmark::kMillisecond) ->Iterations(ITERATIONS) ->Repetitions(3); +*/ -/* BENCHMARK_DEFINE_F(set_bench, set_iterators_2) (benchmark::State &state) { @@ -124,7 +125,7 @@ BENCHMARK_DEFINE_F(set_bench, set_iterators_2) { set_iterator_type it; - for (set_iterator_begin_2(s, &it); set_iterator_end_2(&it) > 0; set_iterator_next(&it)) + for (set_iterator_begin(&it, s); set_iterator_end(&it) > 0; set_iterator_next(&it)) { int *i = (int *)set_iterator_value(&it); @@ -142,6 +143,5 @@ BENCHMARK_REGISTER_F(set_bench, set_iterators_2) ->Unit(benchmark::kMillisecond) ->Iterations(ITERATIONS) ->Repetitions(3); -*/ BENCHMARK_MAIN(); diff --git a/source/configuration/source/configuration_object.c b/source/configuration/source/configuration_object.c index cf3aaa85f..f38298023 100644 --- a/source/configuration/source/configuration_object.c +++ b/source/configuration/source/configuration_object.c @@ -156,11 +156,11 @@ configuration configuration_object_initialize(const char *name, const char *path if (config->parent != NULL) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(config->parent->map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, config->parent->map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - set_insert(config->map, set_iterator_key(it), set_iterator_value(it)); + set_insert(config->map, set_iterator_key(&it), set_iterator_value(&it)); } } @@ -216,12 +216,12 @@ int configuration_object_childs_valid(set_key key, set_value val) int configuration_object_childs(configuration config, vector childs, set storage) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(config->map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, config->map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - set_key key = set_iterator_key(it); - set_value val = set_iterator_value(it); + set_key key = set_iterator_key(&it); + set_value val = set_iterator_value(&it); if (configuration_object_childs_valid(key, val) == 0) { diff --git a/source/configuration/source/configuration_singleton.c b/source/configuration/source/configuration_singleton.c index 8fdd0aeea..7d8d094b4 100644 --- a/source/configuration/source/configuration_singleton.c +++ b/source/configuration/source/configuration_singleton.c @@ -119,11 +119,11 @@ void configuration_singleton_destroy(void) if (singleton->scopes != NULL) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(singleton->scopes); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, singleton->scopes); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - configuration config = set_iterator_value(it); + configuration config = set_iterator_value(&it); configuration_object_destroy(config); } diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index c6786c959..5a440a1e1 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -540,11 +540,11 @@ int loader_load_from_configuration(const loader_path path, void **handle, void * value loader_get(const char *name) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(loader_manager.plugins); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, loader_manager.plugins); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - plugin p = set_iterator_value(it); + plugin p = set_iterator_value(&it); loader_impl impl = plugin_impl_type(p, loader_impl); @@ -681,7 +681,7 @@ value loader_metadata_impl(plugin p, loader_impl impl) value loader_metadata(void) { value *values, v = value_create_map(NULL, plugin_manager_size(&loader_manager)); - set_iterator it; + struct set_iterator_type it; size_t values_it; if (v == NULL) @@ -691,9 +691,9 @@ value loader_metadata(void) values = value_to_map(v); - for (it = set_iterator_begin(loader_manager.plugins), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, loader_manager.plugins), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(&it)) { - plugin p = set_iterator_value(it); + plugin p = set_iterator_value(&it); loader_impl impl = plugin_impl_type(p, loader_impl); diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index c47db9e27..531199fd1 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -511,11 +511,11 @@ int loader_impl_link(plugin p, loader_impl impl) while (detour_enumerate(impl->d, loader_handle, &position, &name, &addr) == 0) { /* Iterate through all library handles in the library map */ - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(impl->library_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, impl->library_map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - dynlink library_handle = set_iterator_value(it); + dynlink library_handle = set_iterator_value(&it); /* Try to find the symbols in the dependencies, do not use the loader dynlink handle for this, it is included in the library map */ @@ -1010,12 +1010,12 @@ int loader_impl_handle_register(plugin_manager manager, loader_impl impl, const /* If there's no handle input/output pointer passed as input parameter, then propagate the handle symbols to the loader context */ if (handle_ptr == NULL) { - set_iterator it; + struct set_iterator_type it; /* This case handles the global scope (shared scope between all loaders, there is no out reference to a handle) */ - for (it = set_iterator_begin(manager->plugins); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, manager->plugins); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - plugin p = set_iterator_value(it); + plugin p = set_iterator_value(&it); loader_impl other_impl = plugin_impl_type(p, loader_impl); char *duplicated_key = NULL; @@ -1709,7 +1709,7 @@ value loader_impl_metadata_handle(loader_handle_impl handle_impl) value loader_impl_metadata(loader_impl impl) { value *values, v = value_create_array(NULL, set_size(impl->handle_impl_path_map)); - set_iterator it; + struct set_iterator_type it; size_t values_it; if (v == NULL) @@ -1719,9 +1719,9 @@ value loader_impl_metadata(loader_impl impl) values = value_to_map(v); - for (it = set_iterator_begin(impl->handle_impl_path_map), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, impl->handle_impl_path_map), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(&it)) { - loader_handle_impl handle_impl = set_iterator_value(it); + loader_handle_impl handle_impl = set_iterator_value(&it); values[values_it] = loader_impl_metadata_handle(handle_impl); @@ -1809,11 +1809,11 @@ void loader_impl_destroy_objects(loader_impl impl) /* Destroy all the types */ { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(impl->type_info_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, impl->type_info_map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - type t = set_iterator_value(it); + type t = set_iterator_value(&it); type_destroy(t); } @@ -1825,12 +1825,12 @@ void loader_impl_destroy_objects(loader_impl impl) void loader_impl_destroy_deallocate(loader_impl impl) { - set_iterator it; + struct set_iterator_type it; /* Destroy execution path map */ - for (it = set_iterator_begin(impl->exec_path_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, impl->exec_path_map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - vector paths = set_iterator_value(it); + vector paths = set_iterator_value(&it); vector_destroy(paths); } @@ -1847,9 +1847,9 @@ void loader_impl_destroy_deallocate(loader_impl impl) } /* Destroy detour map */ - for (it = set_iterator_begin(impl->detour_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, impl->detour_map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - detour_handle handle = set_iterator_value(it); + detour_handle handle = set_iterator_value(&it); detour_unload(impl->d, handle); } @@ -1865,9 +1865,9 @@ void loader_impl_destroy_deallocate(loader_impl impl) this method still should work because normally those handles are reference counted and we increment the reference counter at the beginning, so they will be properly unloaded when the dynlink handle gets unloaded. */ - for (it = set_iterator_begin(impl->library_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, impl->library_map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - dynlink dependency = set_iterator_value(it); + dynlink dependency = set_iterator_value(&it); dynlink_unload(dependency); } diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index 77e66b08a..e12594884 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -178,8 +178,8 @@ union loader_impl_handle_safe_cast typedef struct loader_impl_node_function_type { - loader_impl_node node_impl; loader_impl impl; + loader_impl_node node_impl; napi_ref func_ref; napi_value *argv; @@ -187,6 +187,7 @@ typedef struct loader_impl_node_function_type typedef struct loader_impl_node_future_type { + loader_impl impl; loader_impl_node node_impl; napi_ref promise_ref; @@ -1357,6 +1358,7 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n /* Create reference to promise */ node_future->node_impl = node_impl; + node_future->impl = node_impl->impl; status = napi_create_reference(env, v, 1, &node_future->promise_ref); @@ -1843,7 +1845,7 @@ void function_node_interface_destroy(function func, function_impl impl) return; } - if (loader_is_destroyed(node_func->node_impl->impl) != 0) + if (loader_is_destroyed(node_func->impl) != 0) { loader_impl_node node_impl = node_func->node_impl; loader_impl_async_func_destroy_safe_type func_destroy_safe(node_impl, node_func); @@ -1924,7 +1926,7 @@ void future_node_interface_destroy(future f, future_impl impl) return; } - if (loader_is_destroyed(node_future->node_impl->impl) != 0) + if (loader_is_destroyed(node_future->impl) != 0) { loader_impl_node node_impl = node_future->node_impl; loader_impl_async_future_delete_safe_type future_delete_safe(node_impl, f, node_future); diff --git a/source/loaders/py_loader/include/py_loader/py_loader_port.h b/source/loaders/py_loader/include/py_loader/py_loader_port.h index eea4cd784..617ba0d5d 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_port.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_port.h @@ -23,8 +23,6 @@ #include <py_loader/py_loader_api.h> -#include <Python.h> - #ifdef __cplusplus extern "C" { #endif diff --git a/source/loaders/py_loader/source/py_loader_dict.c b/source/loaders/py_loader/source/py_loader_dict.c index 48c1bdee6..2fc9bd1c7 100644 --- a/source/loaders/py_loader/source/py_loader_dict.c +++ b/source/loaders/py_loader/source/py_loader_dict.c @@ -23,8 +23,6 @@ #include <metacall/metacall_value.h> -#include <Python.h> - #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 /* Disable warnings from Python */ #if defined(__clang__) diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 62ca99513..837b88338 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -24,15 +24,15 @@ #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) #if defined(__clang__) || defined(__GNUC__) - #include <dynlink/dynlink.h> - __attribute__((weak)) void _Py_DECREF_DecRefTotal(void) {} __attribute__((weak)) void _Py_INCREF_IncRefTotal(void) {} /* When Python has been compiled with tracing reference counting, -provide fallback symbols for allowing it to compile properly */ + * provide fallback symbols for allowing it to compile properly */ #ifdef Py_TRACE_REFS + #include <dynlink/dynlink.h> + #undef PyModule_Create2 #undef PyModule_FromDefAndSpec2 diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader_impl_parser.h b/source/loaders/rb_loader/include/rb_loader/rb_loader_impl_parser.h index 6a854d079..8c739f706 100644 --- a/source/loaders/rb_loader/include/rb_loader/rb_loader_impl_parser.h +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader_impl_parser.h @@ -21,6 +21,8 @@ #ifndef RB_LOADER_IMPL_PARSER_H #define RB_LOADER_IMPL_PARSER_H 1 +#include <rb_loader/rb_loader_api.h> + #include <adt/adt_set.h> #ifdef __cplusplus @@ -48,11 +50,11 @@ typedef struct rb_function_parser_type } * rb_function_parser; -int rb_loader_impl_key_parse(const char *source, set function_map); +RB_LOADER_NO_EXPORT int rb_loader_impl_key_parse(const char *source, set function_map); -void rb_loader_impl_key_print(set function_map); +RB_LOADER_NO_EXPORT void rb_loader_impl_key_print(set function_map); -void rb_loader_impl_key_clear(set function_map); +RB_LOADER_NO_EXPORT void rb_loader_impl_key_clear(set function_map); #ifdef __cplusplus } diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader_port.h b/source/loaders/rb_loader/include/rb_loader/rb_loader_port.h new file mode 100644 index 000000000..20598f280 --- /dev/null +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader_port.h @@ -0,0 +1,36 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading ruby code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef RB_LOADER_PORT_H +#define RB_LOADER_PORT_H 1 + +#include <rb_loader/rb_loader_api.h> + +#ifdef __cplusplus +extern "C" { +#endif + +RB_LOADER_NO_EXPORT int rb_loader_port_initialize(void); + +#ifdef __cplusplus +} +#endif + +#endif /* RB_LOADER_PORT_H */ diff --git a/source/loaders/rb_loader/source/rb_loader_impl_parser.c b/source/loaders/rb_loader/source/rb_loader_impl_parser.c index c8d9a3835..c2780bc20 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl_parser.c +++ b/source/loaders/rb_loader/source/rb_loader_impl_parser.c @@ -392,13 +392,13 @@ int rb_loader_impl_key_parse(const char *source, set function_map) void rb_loader_impl_key_print(set function_map) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(function_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, function_map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { size_t parameter; - rb_function_parser function = set_iterator_value(it); + rb_function_parser function = set_iterator_value(&it); log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader key parse function (%s)", function->name); @@ -414,11 +414,11 @@ void rb_loader_impl_key_print(set function_map) void rb_loader_impl_key_clear(set function_map) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(function_map); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, function_map); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - rb_function_parser function = set_iterator_value(it); + rb_function_parser function = set_iterator_value(&it); free(function); } diff --git a/source/loaders/rb_loader/source/rb_loader_port.c b/source/loaders/rb_loader/source/rb_loader_port.c new file mode 100644 index 000000000..f3f52d807 --- /dev/null +++ b/source/loaders/rb_loader/source/rb_loader_port.c @@ -0,0 +1,148 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading ruby code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <rb_loader/rb_loader_port.h> + +#include <ruby.h> + +#include <metacall/metacall.h> + +#include <format/format.h> + +VALUE rb_loader_port_load_from_file(int argc, VALUE *argv, VALUE self) +{ + const char *tag; + const char **paths; + size_t size; + int result; + + (void)self; + + if (argc != 2) + { + rb_raise(rb_eArgError, "Wrong # of arguments (expected 2, received %d)", argc); + return Qnil; + } + + if (TYPE(argv[0]) != T_STRING) + { + rb_raise(rb_eArgError, "First parameter expected to be a string indicating the tag of the loader (py, node, c, ...)"); + return Qnil; + } + + tag = StringValuePtr(argv[0]); + + if (TYPE(argv[1]) != T_ARRAY) + { + rb_raise(rb_eArgError, "Second parameter expected to be an array of strings with the desired files to be loaded"); + return Qnil; + } + + /* Get array size */ + size = RARRAY_LEN(argv[1]); + + if (size == 0) + { + rb_raise(rb_eArgError, "Second parameter cannot be an empty file path list"); + return Qnil; + } + + /* Parse the array */ + { + size_t iterator; + VALUE *array_ptr = RARRAY_PTR(argv[1]); + + paths = (const char **)malloc(sizeof(const char *) * size); + + if (paths == NULL) + { + rb_raise(rb_eArgError, "Invalid file argument allocation"); + return Qnil; + } + + for (iterator = 0; iterator < size; ++iterator) + { + if (TYPE(array_ptr[iterator]) != T_STRING) + { + rb_raise(rb_eArgError, "Second parameter expected to be an array of strings, but the element %" PRIuS " of the array is not a string", iterator); + free(paths); + return Qnil; + } + + paths[iterator] = StringValuePtr(array_ptr[iterator]); + } + } + + /* Execute load from file */ + result = metacall_load_from_file(tag, (const char **)paths, size, NULL); + + free(paths); + + return LONG2NUM(result); +} + +VALUE rb_loader_port_load_from_memory(int argc, VALUE *argv, VALUE self) +{ + const char *tag; + const char *buffer; + size_t size; + int result; + + (void)self; + + if (argc != 2) + { + rb_raise(rb_eArgError, "Wrong # of arguments (expected 2, received %d)", argc); + return Qnil; + } + + if (TYPE(argv[0]) != T_STRING) + { + rb_raise(rb_eArgError, "First parameter expected to be a string indicating the tag of the loader (py, node, c, ...)"); + return Qnil; + } + + tag = StringValuePtr(argv[0]); + + if (TYPE(argv[1]) != T_STRING) + { + rb_raise(rb_eArgError, "Second parameter expected to be an string with the code to be loaded"); + return Qnil; + } + + /* Get buffer size */ + size = RSTRING_LEN(argv[1]) + 1; + + if (size == 1) + { + rb_raise(rb_eArgError, "Second parameter cannot be an empty string"); + return Qnil; + } + + /* Execute load from memory */ + result = metacall_load_from_memory(tag, buffer, size, NULL); + + return LONG2NUM(result); +} + +int rb_loader_port_initialize(void) +{ + return 0; +} diff --git a/source/plugin/source/plugin_manager.c b/source/plugin/source/plugin_manager.c index c22237543..cf6f2dc83 100644 --- a/source/plugin/source/plugin_manager.c +++ b/source/plugin/source/plugin_manager.c @@ -270,11 +270,11 @@ void plugin_manager_destroy(plugin_manager manager) * plugin set and this will do nothing if the set has been emptied before with plugin_manager_clear */ if (manager->plugins != NULL) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(manager->plugins); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, manager->plugins); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - plugin p = set_iterator_value(it); + plugin p = set_iterator_value(&it); if (manager->iface != NULL && manager->iface->clear != NULL) { diff --git a/source/ports/java_port/CMakeLists.txt b/source/ports/java_port/CMakeLists.txt index 86a5862ae..6f14b448b 100644 --- a/source/ports/java_port/CMakeLists.txt +++ b/source/ports/java_port/CMakeLists.txt @@ -44,265 +44,3 @@ message(STATUS "Port ${target}") # https://cmake.org/cmake/help/latest/module/UseJava.html # https://searchcode.com/codesearch/view/7927641/ # https://github.com/Kurento/kms-core/blob/master/CMake/FindMaven.cmake - -# # Set API export file and macro -# string(TOUPPER ${target} target_upper) -# set(export_file "include/${target}/${target}_api.h") -# set(export_macro "${target_upper}_API") - -# # -# # Sources -# # - -# set(interface_path "${CMAKE_CURRENT_SOURCE_DIR}/interface/${target}") -# set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") -# set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") - -# set(interfaces -# ${interface_path}/java_port.i -# ) - -# set(headers -# ${include_path}/java_port.h -# ) - -# set(sources -# ${source_path}/java_port.c -# ) - -# # Group source files -# set(interface_group "Interface Files (SWIG)") -# set(header_group "Header Files (API)") -# set(source_group "Source Files") -# source_group_by_path(${interface_path} "\\\\.i$" -# ${interface_group} ${interfaces}) -# source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" -# ${header_group} ${headers}) -# source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" -# ${source_group} ${sources}) - -# # -# # SWIG Configuration -# # - -# # Set SWIG flags -# if(CMAKE_BUILD_TYPE STREQUAL "Debug") -# list(APPEND CMAKE_SWIG_FLAGS "-DDEBUG") -# else() -# list(APPEND CMAKE_SWIG_FLAGS "-DNDEBUG") -# endif() - -# # Set SWIG include path -# include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") -# include_directories("${CMAKE_CURRENT_SOURCE_DIR}/interface") - -# # -# # Create library -# # - -# foreach(file ${interfaces} ${headers} ${sources}) -# set_source_files_properties( -# ${file} -# PROPERTY SWIG_FLAGS "-java" "-includeall" -# ) - -# set_source_files_properties( -# ${file} -# PROPERTIES CPLUSPLUS OFF -# ) -# endforeach() - -# if(${CMAKE_VERSION} VERSION_LESS "3.8.0") -# swig_add_module(${target} -# java -# ${interfaces} -# ${headers} -# ${sources} -# ) -# else() -# swig_add_library(${target} -# LANGUAGE java -# SOURCES ${interfaces} ${headers} ${sources} -# ) -# endif() - -# # -# # Dependecies -# # - -# add_dependencies(${SWIG_MODULE_${target}_REAL_NAME} -# ${META_PROJECT_NAME}::metacall -# ) - -# # Create namespaced alias -# add_library(${META_PROJECT_NAME}::${target} ALIAS ${SWIG_MODULE_${target}_REAL_NAME}) - -# # Export library for downstream projects -# export(TARGETS ${SWIG_MODULE_${target}_REAL_NAME} NAMESPACE ${META_PROJECT_NAME}:: FILE ${PROJECT_BINARY_DIR}/cmake/${target}/${target}-export.cmake) - -# # Create API export header -# generate_export_header(${SWIG_MODULE_${target}_REAL_NAME} -# EXPORT_FILE_NAME ${export_file} -# EXPORT_MACRO_NAME ${export_macro} -# ) - -# # -# # Project options -# # - -# set_target_properties(${SWIG_MODULE_${target}_REAL_NAME} -# PROPERTIES -# ${DEFAULT_PROJECT_OPTIONS} -# FOLDER "${IDE_FOLDER}" -# ) - -# # -# # Include directories -# # -# target_include_directories(${SWIG_MODULE_${target}_REAL_NAME} -# PRIVATE -# ${PROJECT_BINARY_DIR}/source/include -# ${CMAKE_CURRENT_SOURCE_DIR}/include -# ${CMAKE_CURRENT_BINARY_DIR}/include - -# $<TARGET_PROPERTY:${META_PROJECT_NAME}::metacall,INCLUDE_DIRECTORIES> # MetaCall includes -# ${JAVA_INCLUDE_DIRS} # Java includes -# ${JNI_INCLUDE_DIRS} # JNI includes - -# PUBLIC -# ${DEFAULT_INCLUDE_DIRECTORIES} - -# INTERFACE -# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> -# $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> -# $<INSTALL_INTERFACE:include> -# ) - -# # -# # Libraries -# # - -# swig_link_libraries(${target} -# PRIVATE -# ${JAVA_LIBRARY} # Java libraries -# ${JNI_LIBRARIES} # JNI libraries - -# ${META_PROJECT_NAME}::metacall - -# PUBLIC -# ${DEFAULT_LIBRARIES} - -# INTERFACE -# ) - -# # -# # Compile definitions -# # - -# target_compile_definitions(${SWIG_MODULE_${target}_REAL_NAME} -# PRIVATE - -# PUBLIC -# $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${target_upper}_STATIC_DEFINE> -# ${DEFAULT_COMPILE_DEFINITIONS} - -# INTERFACE -# ) - -# # -# # Compile options -# # - -# target_compile_options(${SWIG_MODULE_${target}_REAL_NAME} -# PRIVATE - -# PUBLIC -# ${DEFAULT_COMPILE_OPTIONS} - -# INTERFACE -# ) - -# # -# # Linker options -# # - -# target_link_libraries(${SWIG_MODULE_${target}_REAL_NAME} -# PRIVATE -# ${META_PROJECT_NAME}::metacall - -# PUBLIC -# ${DEFAULT_LINKER_OPTIONS} - -# INTERFACE -# ) - -# # -# # Deployment -# # - -# # Library -# install(TARGETS ${SWIG_MODULE_${target}_REAL_NAME} -# EXPORT "${target}-export" COMPONENT dev -# RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT runtime -# LIBRARY DESTINATION ${INSTALL_SHARED} COMPONENT runtime -# ARCHIVE DESTINATION ${INSTALL_LIB} COMPONENT dev -# ) - -# # Header files -# install(DIRECTORY -# ${CMAKE_CURRENT_SOURCE_DIR}/include/${target} DESTINATION ${INSTALL_INCLUDE} -# COMPONENT dev -# ) - -# # Generated header files -# install(DIRECTORY -# ${CMAKE_CURRENT_BINARY_DIR}/include/${target} DESTINATION ${INSTALL_INCLUDE} -# COMPONENT dev -# ) - -# # CMake config -# install(EXPORT ${target}-export -# NAMESPACE ${META_PROJECT_NAME}:: -# DESTINATION ${INSTALL_CMAKE}/${target} -# COMPONENT dev -# ) - -# # -# # Configure test -# # - -# set(java_port_test "${target}_test") -# set(java_port_test_path "${PROJECT_OUTPUT_DIR}/${java_port_test}.java") - -# # Require module name -# if(CMAKE_BUILD_TYPE STREQUAL "Debug") -# get_target_property(DEBUG_POSTFIX ${SWIG_MODULE_${target}_REAL_NAME} "DEBUG_POSTFIX") -# set(JAVA_PORT_NAME "${SWIG_MODULE_${target}_REAL_NAME}${DEBUG_POSTFIX}") -# else() -# set(JAVA_PORT_NAME "${SWIG_MODULE_${target}_REAL_NAME}") -# endif() - -# configure_file(test/run.java.in ${java_port_test_path}) - -# # -# # Define test -# # - -# add_test(NAME ${target} -# COMMAND ${JAVA_EXECUTABLE} ${java_port_test_path} -# ) - -# # -# # Define test labels -# # - -# set_property(TEST ${target} -# PROPERTY LABELS ${java_port_test} -# ) - -# include(TestEnvironmentVariables) - -# test_environment_variables(${target} -# "" -# ${TESTS_ENVIRONMENT_VARIABLES} -# ) diff --git a/source/ports/java_port/pom.xml b/source/ports/java_port/pom.xml deleted file mode 100644 index 71519cfdf..000000000 --- a/source/ports/java_port/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0%20http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>metacall</groupId> - <artifactId>metacall-jna-java-port</artifactId> - <version>1.0-SNAPSHOT</version> - - <name>jnajavaport</name> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.source>1.7</maven.compiler.source> - <maven.compiler.target>1.7</maven.compiler.target> - </properties> -<developers> -<developer> -<name>Onkar Dahale</name> -<email>dahaleonkar@gmail.com</email> -</developer> - -</developers> - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.13.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna</artifactId> - <version>5.9.0</version> - </dependency> - </dependencies> - - <build> - <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> - <plugins> - <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> - <plugin> - <artifactId>maven-clean-plugin</artifactId> - <version>3.1.0</version> - </plugin> - <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <version>3.0.2</version> - </plugin> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.8.0</version> - </plugin> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.22.1</version> - </plugin> - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <version>3.0.2</version> - </plugin> - <plugin> - <artifactId>maven-install-plugin</artifactId> - <version>2.5.2</version> - </plugin> - <plugin> - <artifactId>maven-deploy-plugin</artifactId> - <version>2.8.2</version> - </plugin> - <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> - <plugin> - <artifactId>maven-site-plugin</artifactId> - <version>3.7.1</version> - </plugin> - <plugin> - <artifactId>maven-project-info-reports-plugin</artifactId> - <version>3.0.0</version> - </plugin> - </plugins> - </pluginManagement> - </build> -</project> diff --git a/source/ports/java_port/src/main/java/metacall/util.java b/source/ports/java_port/src/main/java/metacall/Utils.java similarity index 98% rename from source/ports/java_port/src/main/java/metacall/util.java rename to source/ports/java_port/src/main/java/metacall/Utils.java index 93a8cf55f..70c1f2cad 100644 --- a/source/ports/java_port/src/main/java/metacall/util.java +++ b/source/ports/java_port/src/main/java/metacall/Utils.java @@ -2,7 +2,7 @@ import com.sun.jna.*; -class util +class Utils { public static class SizeT extends IntegerType diff --git a/source/ports/java_port/test/run.java.in b/source/ports/java_port/test/main.java similarity index 100% rename from source/ports/java_port/test/run.java.in rename to source/ports/java_port/test/main.java diff --git a/source/ports/js_port/CMakeLists.txt b/source/ports/js_port/CMakeLists.txt index 8613fc33b..7b2146e47 100644 --- a/source/ports/js_port/CMakeLists.txt +++ b/source/ports/js_port/CMakeLists.txt @@ -7,6 +7,7 @@ endif() # External dependencies # +# V8 find_package(V8 5.1) if(NOT V8_FOUND) @@ -14,6 +15,21 @@ if(NOT V8_FOUND) return() endif() +# SWIG +find_package(SWIG) + +if(NOT SWIG_FOUND) + message(WARNING "Swig not found: disabling ports depending on swig") + return() +endif() + +include(${SWIG_USE_FILE}) + +list(APPEND CMAKE_SWIG_FLAGS + "-I${CMAKE_SOURCE_DIR}/source/metacall/include" + "-I${CMAKE_BINARY_DIR}/source/metacall/include" +) + # # Port name and options # diff --git a/source/ports/py_port/CMakeLists.txt b/source/ports/py_port/CMakeLists.txt index 5f673e83d..201511dd3 100644 --- a/source/ports/py_port/CMakeLists.txt +++ b/source/ports/py_port/CMakeLists.txt @@ -74,6 +74,15 @@ endif() set(py_port_test_exec "${py_port_test}_executable") +# Check if Python is compiled with Address Sanitizer +if(OPTION_BUILD_ADDRESS_SANITIZER) + check_asan_executable("${Python3_EXECUTABLE}" Python3_ASAN) + if(NOT Python3_ASAN) + # Skip this test because it gives false positives if Python is not compiled with ASan + return() + endif() +endif() + # Add test (Python) add_test(NAME ${py_port_test_exec} COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py diff --git a/source/reflect/source/reflect_class.c b/source/reflect/source/reflect_class.c index e54239a02..8830cf55b 100644 --- a/source/reflect/source/reflect_class.c +++ b/source/reflect/source/reflect_class.c @@ -254,7 +254,7 @@ value class_metadata_methods_impl(const char name[], size_t size, map methods) { value v = value_create_array(NULL, 2); value *v_array; - map_iterator it; + struct map_iterator_type it; size_t count; if (v == NULL) @@ -277,11 +277,11 @@ value class_metadata_methods_impl(const char name[], size_t size, map methods) goto error_value; } - for (it = map_iterator_begin(methods), count = 0; map_iterator_end(&it) != 0; map_iterator_next(it)) + for (map_iterator_begin(&it, methods), count = 0; map_iterator_end(&it) != 0; map_iterator_next(&it)) { value *method_array = value_to_array(v_array[1]); - method_array[count++] = method_metadata((method)map_iterator_value(it)); + method_array[count++] = method_metadata((method)map_iterator_value(&it)); } return v; @@ -306,7 +306,7 @@ value class_metadata_attributes_impl(const char name[], size_t size, set attribu { value v = value_create_array(NULL, 2); value *v_array; - set_iterator it; + struct set_iterator_type it; size_t count; if (v == NULL) @@ -329,11 +329,11 @@ value class_metadata_attributes_impl(const char name[], size_t size, set attribu goto error_value; } - for (it = set_iterator_begin(attributes), count = 0; set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, attributes), count = 0; set_iterator_end(&it) != 0; set_iterator_next(&it)) { value *attribute_array = value_to_array(v_array[1]); - attribute_array[count++] = attribute_metadata(set_iterator_value(it)); + attribute_array[count++] = attribute_metadata(set_iterator_value(&it)); } return v; @@ -802,31 +802,31 @@ void class_destroy(klass cls) /* Destroy attributes */ { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(cls->attributes); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, cls->attributes); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - attribute_destroy(set_iterator_value(it)); + attribute_destroy(set_iterator_value(&it)); } - for (it = set_iterator_begin(cls->static_attributes); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, cls->static_attributes); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - attribute_destroy(set_iterator_value(it)); + attribute_destroy(set_iterator_value(&it)); } } /* Destroy methods */ { - map_iterator it; + struct map_iterator_type it; - for (it = map_iterator_begin(cls->methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + for (map_iterator_begin(&it, cls->methods); map_iterator_end(&it) != 0; map_iterator_next(&it)) { - method_destroy(map_iterator_value(it)); + method_destroy(map_iterator_value(&it)); } - for (it = map_iterator_begin(cls->static_methods); map_iterator_end(&it) != 0; map_iterator_next(it)) + for (map_iterator_begin(&it, cls->static_methods); map_iterator_end(&it) != 0; map_iterator_next(&it)) { - method_destroy(map_iterator_value(it)); + method_destroy(map_iterator_value(&it)); } } diff --git a/source/reflect/source/reflect_scope.c b/source/reflect/source/reflect_scope.c index c030c3e37..1da2285bf 100644 --- a/source/reflect/source/reflect_scope.c +++ b/source/reflect/source/reflect_scope.c @@ -169,11 +169,11 @@ int scope_metadata_array(scope sp, value v_array[3]) size_t functions_size = 0, classes_size = 0, objects_size = 0; value functions_value, classes_value, objects_value; value *functions, *classes, *objects; - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(sp->objects); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, sp->objects); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - type_id id = value_type_id(set_iterator_value(it)); + type_id id = value_type_id(set_iterator_value(&it)); if (id == TYPE_FUNCTION) { @@ -221,9 +221,9 @@ int scope_metadata_array(scope sp, value v_array[3]) functions_size = 0; objects_size = 0; - for (it = set_iterator_begin(sp->objects); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, sp->objects); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - value v = set_iterator_value(it); + value v = set_iterator_value(&it); type_id id = value_type_id(v); if (id == TYPE_FUNCTION) @@ -377,7 +377,7 @@ value scope_export(scope sp) { value *values, export = value_create_map(NULL, scope_size(sp)); size_t values_it; - set_iterator it; + struct set_iterator_type it; if (export == NULL) { @@ -386,9 +386,9 @@ value scope_export(scope sp) values = value_to_map(export); - for (it = set_iterator_begin(sp->objects), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, sp->objects), values_it = 0; set_iterator_end(&it) != 0; set_iterator_next(&it)) { - value v = scope_export_value(set_iterator_key(it), set_iterator_value(it)); + value v = scope_export_value(set_iterator_key(&it), set_iterator_value(&it)); values[values_it++] = v; } @@ -553,11 +553,11 @@ void scope_destroy(scope sp) { if (sp != NULL) { - set_iterator it; + struct set_iterator_type it; - for (it = set_iterator_begin(sp->objects); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, sp->objects); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - value_type_destroy(set_iterator_value(it)); + value_type_destroy(set_iterator_value(&it)); } set_destroy(sp->objects); diff --git a/source/scripts/python/garbage/source/garbage.py b/source/scripts/python/garbage/source/garbage.py index 93c5e97c6..82dfcd113 100644 --- a/source/scripts/python/garbage/source/garbage.py +++ b/source/scripts/python/garbage/source/garbage.py @@ -6,4 +6,4 @@ def set_debug(): gc.set_debug(gc.DEBUG_LEAK | gc.DEBUG_STATS) def garbage(): - return ''.join(gc.garbage) + return repr(gc.garbage) diff --git a/source/tests/adt_map_test/source/adt_map_test.cpp b/source/tests/adt_map_test/source/adt_map_test.cpp index 74498fe4c..24217e383 100644 --- a/source/tests/adt_map_test/source/adt_map_test.cpp +++ b/source/tests/adt_map_test/source/adt_map_test.cpp @@ -116,11 +116,12 @@ TEST_F(adt_map_test, map_int) /* Iterators */ iterator_counter = 0; + struct map_iterator_type it; - for (map_iterator it = map_iterator_begin(m); map_iterator_end(&it) != 0; map_iterator_next(it)) + for (map_iterator_begin(&it, m); map_iterator_end(&it) != 0; map_iterator_next(&it)) { - char *key = (char *)map_iterator_key(it); - int *value = (int *)map_iterator_value(it); + char *key = (char *)map_iterator_key(&it); + int *value = (int *)map_iterator_value(&it); log_write("metacall", LOG_LEVEL_DEBUG, "[%s -> %d]", (char *)key, *((int *)(value))); diff --git a/source/tests/adt_set_test/source/adt_set_test.cpp b/source/tests/adt_set_test/source/adt_set_test.cpp index 3747f5165..85c087b9c 100644 --- a/source/tests/adt_set_test/source/adt_set_test.cpp +++ b/source/tests/adt_set_test/source/adt_set_test.cpp @@ -126,11 +126,12 @@ TEST_F(adt_set_test, DefaultConstructor) /* Iterators */ iterator_counter = 0; + struct set_iterator_type it; - for (set_iterator it = set_iterator_begin(s); set_iterator_end(&it) != 0; set_iterator_next(it)) + for (set_iterator_begin(&it, s); set_iterator_end(&it) != 0; set_iterator_next(&it)) { - char *key = (char *)set_iterator_key(it); - int *value = (int *)set_iterator_value(it); + char *key = (char *)set_iterator_key(&it); + int *value = (int *)set_iterator_value(&it); log_write("metacall", LOG_LEVEL_DEBUG, "[%s -> %d]", (char *)key, *((int *)(value))); diff --git a/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp b/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp index 0cf822240..6253dffc4 100644 --- a/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp +++ b/source/tests/metacall_node_python_ruby_test/source/metacall_node_python_ruby_test.cpp @@ -86,7 +86,7 @@ TEST_F(metacall_node_python_ruby_test, DefaultConstructor) "module.exports = {\n" " test: async function () {\n" " try {\n" - " const result = fetch('http://github.com/service/https://www.google.com/', { signal: AbortSignal.timeout(30000) });\n" + " const result = fetch('http://github.com/service/https://www.google.com/', { signal: AbortSignal.timeout(60000) });\n" " console.log(result);\n" " return true;\n" " } catch (e) {\n" diff --git a/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp b/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp index 3e21db1ab..8bdea252f 100644 --- a/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp +++ b/source/tests/metacall_python_gc_test/source/metacall_python_gc_test.cpp @@ -45,9 +45,9 @@ TEST_F(metacall_python_gc_test, DefaultConstructor) void *ret = metacall("set_debug"); - EXPECT_NE((void *)NULL, (void *)ret); + ASSERT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((enum metacall_value_id)METACALL_NULL, (enum metacall_value_id)metacall_value_id(ret)); + ASSERT_EQ((enum metacall_value_id)METACALL_NULL, (enum metacall_value_id)metacall_value_id(ret)); EXPECT_EQ((void *)NULL, (void *)metacall_value_to_null(ret)); @@ -57,6 +57,8 @@ TEST_F(metacall_python_gc_test, DefaultConstructor) ASSERT_NE((void *)NULL, (void *)ret); + ASSERT_EQ((enum metacall_value_id)METACALL_STRING, (enum metacall_value_id)metacall_value_id(ret)); + std::cout << metacall_value_to_string(ret) << std::endl; metacall_value_destroy(ret); From 707430544a9717fd8fa6519da2ab9269fed3c96b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 28 May 2025 17:34:30 +0200 Subject: [PATCH 286/487] Remove Swig, start to reimplement ruby port. --- .github/workflows/macos-test.yml | 2 +- .github/workflows/windows-test.yml | 2 +- NOTICE | 15 - docker-compose.test.yml | 2 +- docker-compose.yml | 2 +- source/loaders/rb_loader/CMakeLists.txt | 2 + .../loaders/rb_loader/source/rb_loader_port.c | 5 + source/ports/CMakeLists.txt | 50 +-- source/ports/rb_port/.gitignore | 2 + source/ports/rb_port/CMakeLists.txt | 267 +----------- .../ports/rb_port/include/rb_port/rb_port.h | 29 -- .../ports/rb_port/interface/rb_port/rb_port.i | 67 --- .../rb_port/interface/rb_port/rb_port_impl.i | 408 ------------------ .../ports/rb_port/package/metacall-0.0.1.gem | Bin 4096 -> 0 bytes source/ports/rb_port/source/rb_port.c | 23 - .../ports/rb_port/test/{run.rb.in => run.rb} | 0 tools/metacall-environment.ps1 | 4 - tools/metacall-environment.sh | 31 -- tools/metacall-sanitizer.sh | 2 +- 19 files changed, 26 insertions(+), 887 deletions(-) create mode 100644 source/ports/rb_port/.gitignore delete mode 100644 source/ports/rb_port/include/rb_port/rb_port.h delete mode 100644 source/ports/rb_port/interface/rb_port/rb_port.i delete mode 100644 source/ports/rb_port/interface/rb_port/rb_port_impl.i delete mode 100644 source/ports/rb_port/package/metacall-0.0.1.gem delete mode 100644 source/ports/rb_port/source/rb_port.c rename source/ports/rb_port/test/{run.rb.in => run.rb} (100%) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index c98f66f09..504486f54 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -77,7 +77,7 @@ jobs: - name: Set up the environment run: sh ./tools/metacall-environment.sh $METACALL_INSTALL_OPTIONS env: - METACALL_INSTALL_OPTIONS: base python nodejs typescript java ruby wasm rpc file cobol go backtrace #netcore5 c rust rapidjson swig pack # clangformat v8rep51 coverage + METACALL_INSTALL_OPTIONS: base python nodejs typescript java ruby wasm rpc file cobol go backtrace #netcore5 c rust rapidjson pack # clangformat v8rep51 coverage - name: Configure run: | diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index c1a423616..69a4ecc5b 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -48,7 +48,7 @@ jobs: - name: Set up the environment run: cmd.exe /c "powershell .\tools\metacall-environment.ps1 $Env:METACALL_INSTALL_OPTIONS" env: - METACALL_INSTALL_OPTIONS: python nodejs java ruby typescript wasm rpc file # netcore5 java c cobol rust rapidjson swig pack # clangformat v8rep51 coverage + METACALL_INSTALL_OPTIONS: python nodejs java ruby typescript wasm rpc file # netcore5 java c cobol rust rapidjson pack # clangformat v8rep51 coverage - name: Configure run: | diff --git a/NOTICE b/NOTICE index f51329169..687413ccf 100644 --- a/NOTICE +++ b/NOTICE @@ -21,7 +21,6 @@ All external code and licenses used by **METACALL** are always wrapped into plug - [3. Detours](#3-detours) - [3.1 PLTHook](#31-plthook) - [4. Ports](#4-ports) - - [4.1 Swig](#41-swig) <!-- /TOC --> @@ -87,17 +86,3 @@ All external code and licenses used by **METACALL** are always wrapped into plug | **PLTHook** | [2-clause BSD-style license](https://github.com/metacall/plthook?tab=readme-ov-file#license) | ## 4. Ports - -### 4.1 Swig - -| Software | License | -| :------: | :-----: | -| **SWIG** | **∅** | - ->When SWIG is used as it is distributed by the SWIG developers, its output is not governed by SWIG's license (including the GPL). SWIG's output contains code from three sources: -> -> - code generated by SWIG, which is not governed by copyright; -> - code copied from the SWIG library which is permissively licensed to be redistributed without restriction; -> - code derived from the user's input, which may be governed by the license of the code supplied by the user. -> ->So, while the input supplied to SWIG may affect the license of SWIG's output (e.g. if the input code is licensed under a copyleft or proprietary license), SWIG's license does not affect the license of the output. This is consistent with the FSF's FAQ entries on this subject ([GPLOutput](http://www.gnu.org/licenses/gpl-faq.html#GPLOutput) and [WhatCaseIsOutputGPL](http://www.gnu.org/licenses/gpl-faq.html#WhatCaseIsOutputGPL)), because the SWIG code copied into the output by SWIG is not GPL-licensed. diff --git a/docker-compose.test.yml b/docker-compose.test.yml index a6946f3a5..5802aeef5 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -25,7 +25,7 @@ services: build: args: METACALL_BUILD_TYPE: ${METACALL_BUILD_TYPE} - METACALL_INSTALL_OPTIONS: base python ruby netcore8 nodejs typescript file rpc wasm java c cobol go rust rapidjson swig pack backtrace sandbox ${METACALL_BUILD_COVERAGE} # clangformat v8rep51 + METACALL_INSTALL_OPTIONS: base python ruby netcore8 nodejs typescript file rpc wasm java c cobol go rust rapidjson pack backtrace sandbox ${METACALL_BUILD_COVERAGE} # clangformat v8rep51 dev: image: metacall/core:dev build: diff --git a/docker-compose.yml b/docker-compose.yml index bba15a4c4..6ba78b1cc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: METACALL_PATH: $METACALL_PATH METACALL_TOOLS_PATH: $METACALL_PATH/tools METACALL_BUILD_TYPE: $METACALL_BUILD_TYPE - METACALL_INSTALL_OPTIONS: base python ruby nodejs typescript file rpc rapidjson swig pack backtrace # clangformat v8rep51 coverage + METACALL_INSTALL_OPTIONS: base python ruby nodejs typescript file rpc rapidjson pack backtrace # clangformat v8rep51 coverage environment: DEBIAN_FRONTEND: noninteractive # Work around https://github.com/dotnet/cli/issues/1582 until Docker releases a diff --git a/source/loaders/rb_loader/CMakeLists.txt b/source/loaders/rb_loader/CMakeLists.txt index e74b89540..bd756385d 100644 --- a/source/loaders/rb_loader/CMakeLists.txt +++ b/source/loaders/rb_loader/CMakeLists.txt @@ -60,12 +60,14 @@ set(headers ${include_path}/rb_loader.h ${include_path}/rb_loader_impl.h ${include_path}/rb_loader_impl_parser.h + # ${include_path}/rb_loader_port.h ) set(sources ${source_path}/rb_loader.c ${source_path}/rb_loader_impl.c ${source_path}/rb_loader_impl_parser.c + # ${source_path}/rb_loader_port.c ) # Group source files diff --git a/source/loaders/rb_loader/source/rb_loader_port.c b/source/loaders/rb_loader/source/rb_loader_port.c index f3f52d807..92e928e54 100644 --- a/source/loaders/rb_loader/source/rb_loader_port.c +++ b/source/loaders/rb_loader/source/rb_loader_port.c @@ -142,7 +142,12 @@ VALUE rb_loader_port_load_from_memory(int argc, VALUE *argv, VALUE self) return LONG2NUM(result); } +// TODO: Implement metacall function + int rb_loader_port_initialize(void) { + VALUE rb_loader_port = rb_define_module("metacall_rb_loader_port"); + rb_define_module_function(mRb_portd, "metacall_detour", _wrap_metacall_detour, -1); + return 0; } diff --git a/source/ports/CMakeLists.txt b/source/ports/CMakeLists.txt index 056f9e97a..cc73de928 100644 --- a/source/ports/CMakeLists.txt +++ b/source/ports/CMakeLists.txt @@ -45,57 +45,21 @@ option(OPTION_BUILD_PORTS_TS "Build TypeScript port." OFF) option(OPTION_BUILD_PORTS_ZIG "Build Zig port." OFF) # -# Port languages (Standalone) +# Port languages # -add_subdirectory(cxx_port) -add_subdirectory(node_port) -add_subdirectory(py_port) -add_subdirectory(go_port) -add_subdirectory(rs_port) -add_subdirectory(zig_port) - -# -# External dependencies -# - -# SWIG (TODO: Remove SWIG) -find_package(SWIG) - -if(NOT SWIG_FOUND) - message(WARNING "Swig not found: disabling ports depending on swig") - return() -endif() - -include(${SWIG_USE_FILE}) - -# -# Set MetaCall inlcude directories for SWIG -# - -get_filename_component(CMAKE_PARENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) -get_filename_component(CMAKE_PARENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} DIRECTORY) - -list(APPEND CMAKE_SWIG_FLAGS - "-I${CMAKE_PARENT_SOURCE_DIR}/metacall/include" - "-I${CMAKE_PARENT_BINARY_DIR}/metacall/include" -) - -# -# Port languages (Swig) -# - -# TODO: Swig must be completely removed eventually, -# new architecture needs ports and loaders unified so -# Swig is not needed anymore - add_subdirectory(cs_port) +add_subdirectory(cxx_port) add_subdirectory(d_port) -# add_subdirectory(go_port) # TODO: Integrate it with CMake properly and with Docker +add_subdirectory(go_port) add_subdirectory(java_port) add_subdirectory(js_port) add_subdirectory(lua_port) +add_subdirectory(node_port) add_subdirectory(php_port) add_subdirectory(pl_port) +add_subdirectory(py_port) add_subdirectory(r_port) add_subdirectory(rb_port) +add_subdirectory(rs_port) +add_subdirectory(zig_port) diff --git a/source/ports/rb_port/.gitignore b/source/ports/rb_port/.gitignore new file mode 100644 index 000000000..16e37a407 --- /dev/null +++ b/source/ports/rb_port/.gitignore @@ -0,0 +1,2 @@ +*.gem +*.rbc diff --git a/source/ports/rb_port/CMakeLists.txt b/source/ports/rb_port/CMakeLists.txt index d22778818..4459bbdd8 100644 --- a/source/ports/rb_port/CMakeLists.txt +++ b/source/ports/rb_port/CMakeLists.txt @@ -3,16 +3,6 @@ if(NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_RB OR NOT OPTION_BUILD_LOADE return() endif() -# TODO: This port is not passing tests properly in MacOS and Windows. -# In any case this implementation will be deleted eventually (once SWIG gets removed), -# so there is no need to make it work anyway. In any case this project should be reviewed. -include(Portability) - -if(PROJECT_OS_FAMILY STREQUAL win32 OR PROJECT_OS_FAMILY STREQUAL macos) - message(WARNING "Port rb_port does not work on Windows neither MacOS") - return() -endif() - # # External dependencies # @@ -34,257 +24,7 @@ set(target rb_port) # Exit here if required dependencies are not met message(STATUS "Port ${target}") -# Set API export file and macro -string(TOUPPER ${target} target_upper) -set(export_file "include/${target}/${target}_api.h") -set(export_macro "${target_upper}_API") - -# -# Sources -# - -set(interface_path "${CMAKE_CURRENT_SOURCE_DIR}/interface/${target}") -set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") -set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") - -set(interfaces - ${interface_path}/rb_port.i -) - -set(headers - ${include_path}/rb_port.h -) - -set(sources - ${source_path}/rb_port.c -) - -# Group source files -set(interface_group "Interface Files (SWIG)") -set(header_group "Header Files (API)") -set(source_group "Source Files") -source_group_by_path(${interface_path} "\\\\.i$" - ${interface_group} ${interfaces}) -source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" - ${header_group} ${headers}) -source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" - ${source_group} ${sources}) - -# -# SWIG Configuration -# - -# Set SWIG flags -if(CMAKE_BUILD_TYPE STREQUAL "Debug") - list(APPEND CMAKE_SWIG_FLAGS "-DDEBUG") -else() - list(APPEND CMAKE_SWIG_FLAGS "-DNDEBUG") -endif() - -# Set SWIG include path -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/interface") - -# -# Create library -# - -foreach(file ${interfaces} ${headers} ${sources}) - set_source_files_properties( - ${file} - PROPERTY SWIG_FLAGS "-ruby" "-includeall" - ) - - set_source_files_properties( - ${file} - PROPERTIES CPLUSPLUS OFF - ) -endforeach() - -if(${CMAKE_VERSION} VERSION_LESS "3.8.0") - swig_add_module(${target} - ruby - ${interfaces} - ${headers} - ${sources} - ) -else() - swig_add_library(${target} - LANGUAGE ruby - SOURCES ${interfaces} ${headers} ${sources} - OUTPUT_DIR "${PROJECT_OUTPUT_DIR}" - ) -endif() - -# -# Dependecies -# - -add_dependencies(${SWIG_MODULE_${target}_REAL_NAME} - ${META_PROJECT_NAME}::metacall -) - -# Create namespaced alias -add_library(${META_PROJECT_NAME}::${target} ALIAS ${SWIG_MODULE_${target}_REAL_NAME}) - -# Export library for downstream projects -export(TARGETS ${SWIG_MODULE_${target}_REAL_NAME} NAMESPACE ${META_PROJECT_NAME}:: FILE ${PROJECT_BINARY_DIR}/cmake/${target}/${target}-export.cmake) - -# Create API export header -generate_export_header(${SWIG_MODULE_${target}_REAL_NAME} - EXPORT_FILE_NAME ${export_file} - EXPORT_MACRO_NAME ${export_macro} -) - -# -# Project options -# - -set_target_properties(${SWIG_MODULE_${target}_REAL_NAME} - PROPERTIES - ${DEFAULT_PROJECT_OPTIONS} - FOLDER "${IDE_FOLDER}" - - # Set Ruby extension properies - SUFFIX ".so" -) - -# -# Include directories -# -target_include_directories(${SWIG_MODULE_${target}_REAL_NAME} - PRIVATE - ${PROJECT_BINARY_DIR}/source/include - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR}/include - - $<TARGET_PROPERTY:${META_PROJECT_NAME}::metacall,INCLUDE_DIRECTORIES> # MetaCall includes - ${Ruby_INCLUDE_DIRS} # Ruby includes - - PUBLIC - ${DEFAULT_INCLUDE_DIRECTORIES} - - INTERFACE - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> - $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> - $<INSTALL_INTERFACE:include> -) - -# -# Libraries -# - -swig_link_libraries(${target} - PRIVATE - ${Ruby_LIBRARY} # Ruby libraries - - ${META_PROJECT_NAME}::metacall - - PUBLIC - ${DEFAULT_LIBRARIES} - - INTERFACE -) - -# -# Compile definitions -# - -target_compile_definitions(${SWIG_MODULE_${target}_REAL_NAME} - PRIVATE - - PUBLIC - $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${target_upper}_STATIC_DEFINE> - ${DEFAULT_COMPILE_DEFINITIONS} - $<$<BOOL:${MSVC}>:RB_PORT_USINGSWIG_EXPORTS> - - INTERFACE -) - -# -# Compile options -# - -target_compile_options(${SWIG_MODULE_${target}_REAL_NAME} - PRIVATE - - PUBLIC - ${DEFAULT_COMPILE_OPTIONS} - - INTERFACE -) - -include(Portability) - -target_compile_options(${target} - PRIVATE - - # Fix Ruby MacOSX LLVM bug - # '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes - $<$<AND:$<STREQUAL:${PROJECT_OS_FAMILY},macos>,$<OR:$<STREQUAL:${CMAKE_CXX_COMPILER_ID},Clang>,$<STREQUAL:${CMAKE_CXX_COMPILER_ID},AppleClang>>>:-fdeclspec> - - # Disable warnings (Clang, GCC) for unused parameters and variables generated by Swig - $<$<OR:$<STREQUAL:${CMAKE_CXX_COMPILER_ID},Clang>,$<STREQUAL:${CMAKE_CXX_COMPILER_ID},AppleClang>,$<STREQUAL:${CMAKE_CXX_COMPILER_ID},GNU>>:-Wno-unused-parameter> - $<$<OR:$<STREQUAL:${CMAKE_CXX_COMPILER_ID},Clang>,$<STREQUAL:${CMAKE_CXX_COMPILER_ID},AppleClang>,$<STREQUAL:${CMAKE_CXX_COMPILER_ID},GNU>>:-Wno-unused-variable> - - PUBLIC - ${DEFAULT_COMPILE_OPTIONS} - - INTERFACE -) - -# -# Linker options -# - -target_link_options(${SWIG_MODULE_${target}_REAL_NAME} - PRIVATE - - PUBLIC - ${DEFAULT_LINKER_OPTIONS} - - INTERFACE -) - -# -# Deployment -# - -# Library -install(TARGETS ${SWIG_MODULE_${target}_REAL_NAME} - EXPORT "${target}-export" COMPONENT dev - RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT runtime - LIBRARY DESTINATION ${INSTALL_SHARED} COMPONENT runtime - ARCHIVE DESTINATION ${INSTALL_LIB} COMPONENT dev -) - -# -# Configure test -# - -# Check if port is enabled -if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_RB) - return() -endif() - -set(rb_port_test "${target}_test") -set(rb_port_test_path "${PROJECT_OUTPUT_DIR}/${rb_port_test}.rb") - -# Require module name -if(CMAKE_BUILD_TYPE STREQUAL "Debug") - get_target_property(DEBUG_POSTFIX ${SWIG_MODULE_${target}_REAL_NAME} "DEBUG_POSTFIX") - set(RB_PORT_NAME "${SWIG_MODULE_${target}_REAL_NAME}${DEBUG_POSTFIX}") -else() - set(RB_PORT_NAME "${SWIG_MODULE_${target}_REAL_NAME}") -endif() - -# Module object instance (capitalized) -string(SUBSTRING "${RB_PORT_NAME}" 0 1 RB_PORT_FIRST) -string(TOUPPER "${RB_PORT_FIRST}" RB_PORT_FIRST_UPPER) -string(SUBSTRING "${RB_PORT_NAME}" 1 -1 RB_PORT_LAST) -set(RB_PORT_OBJ "${RB_PORT_FIRST_UPPER}${RB_PORT_LAST}") - -configure_file(test/run.rb.in ${rb_port_test_path}) +# TODO # # Define test @@ -303,8 +43,11 @@ if(OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER) return() endif() +set(rb_port_test "rb_port_test") +set(rb_port_test_path "${CMAKE_CURRENT_SOURCE_DIR}/test/run.rb") + add_test(NAME ${target} - COMMAND ${Ruby_EXECUTABLE} ${rb_port_test_path} + COMMAND ${Ruby_EXECUTABLE} "${rb_port_test_path}" ) # diff --git a/source/ports/rb_port/include/rb_port/rb_port.h b/source/ports/rb_port/include/rb_port/rb_port.h deleted file mode 100644 index 8e88024dd..000000000 --- a/source/ports/rb_port/include/rb_port/rb_port.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * MetaCall SWIG Wrapper by Parra Studios - * A complete infrastructure for supporting multiple language bindings in MetaCall. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef METACALL_SWIG_WRAPPER_RB_PORT_H -#define METACALL_SWIG_WRAPPER_RB_PORT_H 1 - -/* TODO: Review https://github.com/SketchUp/testup-2/blob/e32a68c5c02e2cbc3a924f40d4987faa05dbcc89/ruby-c-extension/sketchup-taskbarlist/TaskbarProgress/src/RubyUtils/RubyLib.h */ -/* TODO: Unify rb_port with rb_loader */ - -/* ... */ - -#endif /* METACALL_SWIG_WRAPPER_RB_PORT_H */ diff --git a/source/ports/rb_port/interface/rb_port/rb_port.i b/source/ports/rb_port/interface/rb_port/rb_port.i deleted file mode 100644 index 6968ab129..000000000 --- a/source/ports/rb_port/interface/rb_port/rb_port.i +++ /dev/null @@ -1,67 +0,0 @@ -/* - * MetaCall SWIG Wrapper by Parra Studios - * A complete infrastructure for supporting multiple language bindings in MetaCall. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef METACALL_SWIG_WRAPPER_RB_PORT_I -#define METACALL_SWIG_WRAPPER_RB_PORT_I 1 - -/* -- Headers -- */ - -#if defined(SWIG) && defined(SWIGRUBY) - - #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - %module rb_portd - #else - %module rb_port - #endif - - %{ - #include <rb_port/rb_port.h> - - #include <metacall/metacall_api.h> - #include <metacall/metacall.h> - #include <metacall/metacall_value.h> - - #include <ruby.h> - %} - - %include <rb_port/rb_port.h> - - /* Note: This should not be necessary because we do not allow to use ports outside MetaCall */ - /* - %init - %{ - metacall_initialize(); - %} - */ - - %import <rb_port/rb_port_impl.i> - - %include <metacall/metacall_api.h> - - #ifdef METACALL_API - # undef METACALL_API - # define METACALL_API - #endif - - %include <metacall/metacall.h> - -#endif /* SWIG && SWIGRUBY */ - -#endif /* METACALL_SWIG_WRAPPER_RB_PORT_I */ diff --git a/source/ports/rb_port/interface/rb_port/rb_port_impl.i b/source/ports/rb_port/interface/rb_port/rb_port_impl.i deleted file mode 100644 index ddbd3e705..000000000 --- a/source/ports/rb_port/interface/rb_port/rb_port_impl.i +++ /dev/null @@ -1,408 +0,0 @@ -/* - * MetaCall SWIG Wrapper by Parra Studios - * A complete infrastructure for supporting multiple language bindings in MetaCall. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef METACALL_SWIG_WRAPPER_RB_PORT_IMPL_I -#define METACALL_SWIG_WRAPPER_RB_PORT_IMPL_I 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* -- Ignores -- */ - -%ignore metacall_null_args; - -%ignore metacallv; - -%ignore metacallvf; - -%ignore metacall_serial; /* TODO */ - -%ignore metacall_register; /* TODO */ - -%ignore metacall_load_from_package; /* TODO */ - -/* -- Type Maps -- */ - -/** -* @brief -* Transform load mechanism from Ruby string into -* a valid load from memory format (buffer and size) -*/ -%typemap(in) (const char * buffer, size_t size, void ** handle) -{ - char * buffer_str = StringValuePtr($input); - - size_t length = RSTRING_LEN($input); - - $1 = buffer_str; - - $2 = (length + 1); -} - -/** -* @brief -* Transform load mechanism from Ruby array into -* a valid load from file format (array of strings) -*/ -%typemap(in) (const char * paths[], size_t size, void ** handle) -{ - size_t iterator, size = RARRAY_LEN($input); - - VALUE * array_ptr = RARRAY_PTR($input); - - if (size == 0) - { - rb_raise(rb_eArgError, "Empty script path list"); - - return Qnil; - } - - $1 = (char **)malloc(sizeof(char *) * size); - - if ($1 == NULL) - { - rb_raise(rb_eArgError, "Invalid argument allocation"); - - SWIG_fail; - } - - $2 = size; - - for (iterator = 0; iterator < size; ++iterator, ++array_ptr) - { - size_t length = RSTRING_LEN(*array_ptr); - - $1[iterator] = malloc(sizeof(char) * (length + 1)); - - if ($1[iterator] == NULL) - { - size_t alloc_iterator; - - for (alloc_iterator = 0; alloc_iterator < iterator; ++alloc_iterator) - { - free($1[alloc_iterator]); - } - - free($1); - - rb_raise(rb_eArgError, "Invalid string path allocation"); - - SWIG_fail; - } - - memcpy($1[iterator], StringValuePtr(*array_ptr), length); - - $1[iterator][length] = '\0'; - } -} - -/** -* @brief -* Transform variadic arguments from Ruby into -* a valid metacallv format with values -*/ -%typemap(in) (const char * name, ...) -{ - void ** args; - size_t args_size, args_count; - - /* Format string */ - $1 = RSTRING_PTR($input); - - /* Variable length arguments */ - if (argc >= 1) - { - args_size = argc - 1; - } - else - { - rb_raise(rb_eArgError, "Invalid number of arguments"); - - return Qnil; - } - - if (args_size > 0) - { - /* TODO: Remove this by a local array? */ - args = (void **) malloc(args_size * sizeof(void *)); - - if (args == NULL) - { - rb_raise(rb_eArgError, "Invalid argument allocation"); - - SWIG_fail; - } - - for (args_count = 0; args_count < args_size; ++args_count) - { - VALUE rb_arg = argv[args_count + 1]; - - int rb_arg_type = TYPE(rb_arg); - - if (rb_arg_type == T_TRUE) - { - boolean b = 1L; - - args[args_count] = metacall_value_create_bool(b); - } - else if (rb_arg_type == T_FALSE) - { - boolean b = 0L; - - args[args_count] = metacall_value_create_bool(b); - } - else if (rb_arg_type == T_FIXNUM) - { - int i = FIX2INT(rb_arg); - - args[args_count] = metacall_value_create_int(i); - } - else if (rb_arg_type == T_BIGNUM) - { - long l = NUM2LONG(rb_arg); - - args[args_count] = metacall_value_create_long(l); - } - else if (rb_arg_type == T_FLOAT) - { - double d = NUM2DBL(rb_arg); - - args[args_count] = metacall_value_create_double(d); - } - else if (rb_arg_type == T_STRING) - { - long length = RSTRING_LEN(rb_arg); - - char * str = StringValuePtr(rb_arg); - - if (length > 0 && str != NULL) - { - args[args_count] = metacall_value_create_string(str, (size_t)length); - } - } - else if (rb_arg_type == T_NIL) - { - args[args_count] = metacall_value_create_null(); - } - else - { - size_t alloc_iterator; - - for (alloc_iterator = 0; alloc_iterator < args_count; ++alloc_iterator) - { - metacall_value_destroy(args[alloc_iterator]); - } - - /* TODO: Remove this by a local array? */ - free(args); - - rb_raise(rb_eArgError, "Invalid argument allocation"); - - SWIG_fail; - - return Qnil; - } - } - } - else - { - args = NULL; - } - - $2 = (void *) args; -} - -/* -- Features -- */ - -/** -* @brief -* Execute the load from memory -* -* @return -* Zero if success, different from zero otherwise -*/ -%feature("action") metacall_load_from_memory -{ - const char * tag = (const char *)arg1; - - char * buffer = (char *)arg2; - - size_t size = (size_t)arg3; - - result = metacall_load_from_memory(tag, (const char *)buffer, size, NULL); -} - -/** -* @brief -* Execute the load from file -* -* @return -* Zero if success, different from zero otherwise -*/ -%feature("action") metacall_load_from_file -{ - const char * tag = (const char *)arg1; - - char ** paths = (char **)arg2; - - size_t iterator, size = arg3; - - result = metacall_load_from_file(tag, (const char **)paths, size, NULL); - - for (iterator = 0; iterator < size; ++iterator) - { - free(paths[iterator]); - } - - free(paths); -} - -/** -* @brief -* Execute the call and transform return -* value into a valid Ruby format -* -* @return -* A value converted into Ruby format -*/ -%feature("action") metacall -{ - size_t args_count, args_size; - void ** args; - void * ret; - - args_size = argc - 1; - args = (void **) arg2; - - if (args != NULL) - { - /* Execute call */ - ret = metacallv(arg1, args); - - /* Clear args */ - for (args_count = 0; args_count < args_size; ++args_count) - { - metacall_value_destroy(args[args_count]); - } - - /* TODO: Remove this by a local array? */ - free(args); - } - else - { - /* Execute call */ - ret = metacallv(arg1, metacall_null_args); - } - - /* Return value */ - if (ret != NULL) - { - switch (metacall_value_id(ret)) - { - - case METACALL_BOOL : - { - boolean b = metacall_value_to_bool(ret); - - /*$result*/ vresult = (b == 0L) ? Qfalse : Qtrue; - - break; - } - - case METACALL_CHAR : - { - /*$result*/ vresult = INT2FIX((char)metacall_value_to_char(ret)); - - break; - } - - case METACALL_SHORT : - { - /*$result*/ vresult = INT2FIX((int)metacall_value_to_short(ret)); - - break; - } - - case METACALL_INT : - { - /*$result*/ vresult = INT2FIX(metacall_value_to_int(ret)); - - break; - } - - case METACALL_LONG : - { - /*$result*/ vresult = LONG2NUM(metacall_value_to_long(ret)); - - break; - } - - case METACALL_FLOAT : - { - /*$result*/ vresult = DBL2NUM((double)metacall_value_to_float(ret)); - - break; - } - - case METACALL_DOUBLE : - { - /*$result*/ vresult = DBL2NUM(metacall_value_to_double(ret)); - - break; - } - - case METACALL_STRING : - { - /*$result*/ vresult = rb_str_new_cstr(metacall_value_to_string(ret)); - - break; - } - - case METACALL_NULL : - { - /*$result*/ vresult = Qnil; - - break; - } - - default : - { - rb_raise(rb_eArgError, "Unsupported return type"); - - /*$result*/ vresult = Qnil; - } - } - - metacall_value_destroy(ret); - } - else - { - /*$result*/ vresult = Qnil; - } - - return /*$result*/ vresult; -} - -#ifdef __cplusplus -} -#endif - -#endif /* METACALL_SWIG_WRAPPER_RB_PORT_IMPL_I */ diff --git a/source/ports/rb_port/package/metacall-0.0.1.gem b/source/ports/rb_port/package/metacall-0.0.1.gem deleted file mode 100644 index 851e7ef987c30aa6f0a165b07065f53abd8e2d70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmc~zElEsCEJ@T$uVSDTFaQD*6B7my4Fu@4fti^ZgQ2m3p^2%fiHU(JgMp#3iHSLb zf&r}@glukUaY<qk&`ISPsi`^05@>8f@({lvJcp)zuyW<QIT%=P8bvTM9}V`+zhWS; z_xyT^s+XEKQ(7CMvRYei&8yN3;#Ux{JeQNy@wVhmNUY*N>&Ypbxfi_>wGOhGXD*+g zHYZhb-@}df@}2(9^$FVkWXdm_2^+1mOEw*BzTPKd<#p@DzIOFT8rNU3?rwKw?Qjp6 zC|=3wy#BJ@hG2`E4RXQa7Fs7h9F+Rh`C*r&sX1eQ$4rTQQ|Z;}2?<p)y54L7(f1?5 zH0lkGtTdXtP3ZA!^NbRqBil6Yr>4%#_157st*_ju_lJp>_lfkUV?i-zG^DmU&kEiv z+%~^O@t${|1&iN}Nz6sJzH!Z8Q(6D<VY0R7PR^qLK50I?-tq5yVL5TWhrH{xsR2e; z&#jyBRAozbbpExjXEDy=GQ7J)`C`4AZ_Sxv=3swSLoUXLD{-~xzdx+b9V<84sX2!A zCC!OFAY*!Fi`Zgk-qnuF^LqEknO(gy`PI~I_w*gqdnaA{<S7*1G4svl)u)Xu{SIXZ z8?H^B^ZC)A_aaMfeB8fm<BwUdRgW31UmMbM_zly;`y$(S=5%cPdTskv{#)Ey|9+PE zUDz(*{@mn!yp*wrO0JFX$$ZC`a%xkVshO6*c^{Yq1~UH}85*GHe`6D~(fm)%c*bQG zBLAN{>2vA4udb($-<gvawY`!SumVeM0|RsO1cL^Kl3NE3oM<_C;l_arN3L8sa^!%> zihD;c+?n8bu%VG}!Im8=8#!J~`P6geij2)Gj+2Y4^Ew)y%sKKXi8VfftAK48gWkF; zdqniw0u8v_4r)lS9+m^S=l_3Z2KV!`PBC!ca^0vntwSI=BQ-g@xHPv|uQD+=hc=}E zsA|Ml|C<<^qvd}SGlS9kpVm<iHXo7yQzuvlF&pr>{GOvE&XMeS?fA<VFDx7DmMuyQ zDy)+6$}ru1tG0UgUA_1D>kIbBte^k)!>9KBH8uCwpY5<+CVf!j`NrE9B5$wuxN>me z!m>{v|5nNU`}(?hl46GUoivvTOLQb&H61Y0$WGS3@zW>uK>bd>HibV|*4_xS^fH%N zKJ$vg`?aE02cyK<f3BL-%n|Fd%!hxLb#(s>vF%5vWqnsGoYS_`!!Ygkt!~d77ah(C zf8Tj^rr&ydn>|Lk#-_WMTDLrjJnX4_F0t>KOvI!$`$XAU!&fajWb;CpGyHg5^R2eI zX+0ua%bu9@wzQaD$eQam(=Mq)F6!Haz24`iRs3X}yJ24PB1XD|_^2hLAut*OqaiRj GLI41w-Prp8 diff --git a/source/ports/rb_port/source/rb_port.c b/source/ports/rb_port/source/rb_port.c deleted file mode 100644 index b9a5fc4d3..000000000 --- a/source/ports/rb_port/source/rb_port.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * MetaCall SWIG Wrapper by Parra Studios - * A complete infrastructure for supporting multiple language bindings in MetaCall. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <rb_port/rb_port.h> - -/* ... */ diff --git a/source/ports/rb_port/test/run.rb.in b/source/ports/rb_port/test/run.rb similarity index 100% rename from source/ports/rb_port/test/run.rb.in rename to source/ports/rb_port/test/run.rb diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index 72ce3659b..35bd79467 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -359,9 +359,6 @@ function Configure { if ("$var" -eq 'rust') { Write-Output "rust selected" } - if ("$var" -eq 'swig') { - Write-Output "swig selected" - } if ("$var" -eq 'metacall') { Write-Output "metacall selected" } @@ -398,7 +395,6 @@ function Help { Write-Output " c" Write-Output " cobol" Write-Output " go" - Write-Output " swig" Write-Output " metacall" Write-Output " pack" Write-Output " clangformat" diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index b24476443..7c2c03a9e 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -52,7 +52,6 @@ INSTALL_C=0 INSTALL_COBOL=0 INSTALL_GO=0 INSTALL_RUST=0 -INSTALL_SWIG=0 INSTALL_PACK=0 INSTALL_COVERAGE=0 INSTALL_CLANGFORMAT=0 @@ -114,28 +113,6 @@ sub_base(){ fi } -# Swig -sub_swig(){ - echo "configure swig" - cd $ROOT_DIR - - if [ "${OPERATIVE_SYSTEM}" = "Linux" ]; then - if [ "${LINUX_DISTRO}" = "debian" ] || [ "${LINUX_DISTRO}" = "ubuntu" ]; then - $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends swig - - # Install Python Port Dependencies (TODO: This must be transformed into pip3 install metacall) - $SUDO_CMD apt-get $APT_CACHE_CMD install -y --no-install-recommends python3-setuptools - elif [ "${LINUX_DISTRO}" = "alpine" ]; then - $SUDO_CMD apk add --no-cache swig - - # Install Python Port Dependencies (TODO: This must be transformed into pip3 install metacall) - $SUDO_CMD apk add --no-cache py3-setuptools - fi - elif [ "${OPERATIVE_SYSTEM}" = "Darwin" ]; then - brew install swig - fi -} - # Python sub_python(){ echo "configure python" @@ -976,9 +953,6 @@ sub_install(){ if [ $INSTALL_RUST = 1 ]; then sub_rust fi - if [ $INSTALL_SWIG = 1 ]; then - sub_swig - fi if [ $INSTALL_PACK = 1 ]; then sub_pack fi @@ -1116,10 +1090,6 @@ sub_options(){ echo "rust selected" INSTALL_RUST=1 fi - if [ "$option" = 'swig' ]; then - echo "swig selected" - INSTALL_SWIG=1 - fi if [ "$option" = 'pack' ]; then echo "pack selected" INSTALL_PACK=1 @@ -1172,7 +1142,6 @@ sub_help() { echo " c" echo " cobol" echo " go" - echo " swig" echo " pack" echo " coverage" echo " clangformat" diff --git a/tools/metacall-sanitizer.sh b/tools/metacall-sanitizer.sh index 9e0856a50..6605ac112 100755 --- a/tools/metacall-sanitizer.sh +++ b/tools/metacall-sanitizer.sh @@ -35,7 +35,7 @@ if [ "${BUILD_SANITIZER}" != "address-sanitizer" ] && [ "${BUILD_SANITIZER}" != fi # Install -"${SCRIPT_DIR}/metacall-environment.sh" base ${BUILD_LANGUAGES[@]} rapidjson swig pack backtrace +"${SCRIPT_DIR}/metacall-environment.sh" base ${BUILD_LANGUAGES[@]} rapidjson pack backtrace # Configure and Build export NODE_PATH="/usr/lib/node_modules" From 1828b05e7e3516197ee71082d9517a7098f1ed28 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 30 May 2025 17:28:03 +0200 Subject: [PATCH 287/487] Ruby port and ruby.exe support in progress. --- .../loaders/py_loader/source/py_loader_impl.c | 10 +- source/loaders/rb_loader/CMakeLists.txt | 5 +- .../include/rb_loader/rb_loader_impl.h | 8 + .../include/rb_loader/rb_loader_include.h | 82 +++++ .../include/rb_loader/rb_loader_port.h | 4 +- .../loaders/rb_loader/source/rb_loader_impl.c | 341 ++++++++---------- .../loaders/rb_loader/source/rb_loader_port.c | 131 +++++-- source/ports/py_port/CMakeLists.txt | 5 +- source/ports/rb_port/CMakeLists.txt | 92 +++-- source/ports/rb_port/package/lib/metacall.rb | 115 +++++- source/ports/rb_port/test/run.rb | 62 ++-- .../rb_loader_parser_test/CMakeLists.txt | 1 + 12 files changed, 575 insertions(+), 281 deletions(-) create mode 100644 source/loaders/rb_loader/include/rb_loader/rb_loader_include.h diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index f5de0f6c6..590e997e5 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2691,7 +2691,15 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi } py_loader_impl_main_module = argv[1]; - py_loader_impl_run_main = 0; + + /* If we are running on host, this means the main is already executed by the host, so we can skip it, + * otherwise if we are not in host and we run it for the first time, we can prepare the loader + * for running the main the first time + */ + if (host == 0) + { + py_loader_impl_run_main = 0; + } } /* Initialize stack trace module */ diff --git a/source/loaders/rb_loader/CMakeLists.txt b/source/loaders/rb_loader/CMakeLists.txt index bd756385d..a142dce09 100644 --- a/source/loaders/rb_loader/CMakeLists.txt +++ b/source/loaders/rb_loader/CMakeLists.txt @@ -58,16 +58,17 @@ set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") set(headers ${include_path}/rb_loader.h + ${include_path}/rb_loader_include.h ${include_path}/rb_loader_impl.h ${include_path}/rb_loader_impl_parser.h - # ${include_path}/rb_loader_port.h + ${include_path}/rb_loader_port.h ) set(sources ${source_path}/rb_loader.c ${source_path}/rb_loader_impl.c ${source_path}/rb_loader_impl_parser.c - # ${source_path}/rb_loader_port.c + ${source_path}/rb_loader_port.c ) # Group source files diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h b/source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h index 3a86aaaa9..f5a6e3b85 100644 --- a/source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader_impl.h @@ -27,6 +27,10 @@ #include <configuration/configuration.h> +#include <metacall/metacall.h> + +#include <rb_loader/rb_loader_include.h> + #ifdef __cplusplus extern "C" { #endif @@ -47,6 +51,10 @@ RB_LOADER_API int rb_loader_impl_discover(loader_impl impl, loader_handle handle RB_LOADER_API int rb_loader_impl_destroy(loader_impl impl); +RB_LOADER_NO_EXPORT const char *rb_type_deserialize(loader_impl impl, VALUE v, value *result); + +RB_LOADER_NO_EXPORT VALUE rb_type_serialize(value v); + #ifdef __cplusplus } #endif diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader_include.h b/source/loaders/rb_loader/include/rb_loader/rb_loader_include.h new file mode 100644 index 000000000..a8874b1b2 --- /dev/null +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader_include.h @@ -0,0 +1,82 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading ruby code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef RB_LOADER_INCLUDE_H +#define RB_LOADER_INCLUDE_H 1 + +#if (defined(_WIN32) || defined(_WIN64)) && !defined(_MSC_VER) && defined(boolean) + #undef boolean +#endif + +/* Disable warnings from Ruby */ +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wunused-parameter" +#elif defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wredundant-decls" + #pragma GCC diagnostic ignored "-Wpedantic" + #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +#include <ruby.h> + +/* Disable warnings from Ruby */ +#if defined(__clang__) + #pragma clang diagnostic pop +#elif defined(__GNUC__) + #pragma GCC diagnostic pop +#endif + +/* Backward compatible macros for Ruby < 2.7 */ +#ifndef RB_PASS_KEYWORDS + #define rb_funcallv_kw(o, m, c, v, kw) rb_funcallv(o, m, c, v) + #define rb_funcallv_public_kw(o, m, c, v, kw) rb_funcallv_public(o, m, c, v) + #define rb_funcall_passing_block_kw(o, m, c, v, kw) rb_funcall_passing_block(o, m, c, v) + #define rb_funcall_with_block_kw(o, m, c, v, b, kw) rb_funcall_with_block(o, m, c, v, b) + #define rb_scan_args_kw(kw, c, v, s, ...) rb_scan_args(c, v, s, __VA_ARGS__) + #define rb_call_super_kw(c, v, kw) rb_call_super(c, v) + #define rb_yield_values_kw(c, v, kw) rb_yield_values2(c, v) + #define rb_yield_splat_kw(a, kw) rb_yield_splat(a) + #define rb_block_call_kw(o, m, c, v, f, p, kw) rb_block_call(o, m, c, v, f, p) + #define rb_fiber_resume_kw(o, c, v, kw) rb_fiber_resume(o, c, v) + #define rb_fiber_yield_kw(c, v, kw) rb_fiber_yield(c, v) + #define rb_enumeratorize_with_size_kw(o, m, c, v, f, kw) rb_enumeratorize_with_size(o, m, c, v, f) + #define SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat) \ + rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()), \ + (argc), (argv), (size_fn)) + #define RETURN_SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat) \ + do \ + { \ + if (!rb_block_given_p()) \ + return SIZED_ENUMERATOR(obj, argc, argv, size_fn); \ + } while (0) + #define RETURN_ENUMERATOR_KW(obj, argc, argv, kw_splat) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0) + #define rb_check_funcall_kw(o, m, c, v, kw) rb_check_funcall(o, m, c, v) + #define rb_obj_call_init_kw(o, c, v, kw) rb_obj_call_init(o, c, v) + #define rb_class_new_instance_kw(c, v, k, kw) rb_class_new_instance(c, v, k) + #define rb_proc_call_kw(p, a, kw) rb_proc_call(p, a) + #define rb_proc_call_with_block_kw(p, c, v, b, kw) rb_proc_call_with_block(p, c, v, b) + #define rb_method_call_kw(c, v, m, kw) rb_method_call(c, v, m) + #define rb_method_call_with_block_kw(c, v, m, b, kw) rb_method_call_with_block(c, v, m, b) + #define rb_eval_cmd_kwd(c, a, kw) rb_eval_cmd(c, a, 0) +#endif + +#endif /* RB_LOADER_INCLUDE_H */ diff --git a/source/loaders/rb_loader/include/rb_loader/rb_loader_port.h b/source/loaders/rb_loader/include/rb_loader/rb_loader_port.h index 20598f280..0ccc7a497 100644 --- a/source/loaders/rb_loader/include/rb_loader/rb_loader_port.h +++ b/source/loaders/rb_loader/include/rb_loader/rb_loader_port.h @@ -23,11 +23,13 @@ #include <rb_loader/rb_loader_api.h> +#include <loader/loader_impl_interface.h> + #ifdef __cplusplus extern "C" { #endif -RB_LOADER_NO_EXPORT int rb_loader_port_initialize(void); +RB_LOADER_NO_EXPORT int rb_loader_port_initialize(loader_impl impl); #ifdef __cplusplus } diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 3451dec8f..2eb931f7b 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -8,6 +8,7 @@ #include <rb_loader/rb_loader_impl.h> #include <rb_loader/rb_loader_impl_parser.h> +#include <rb_loader/rb_loader_port.h> #include <loader/loader.h> #include <loader/loader_impl.h> @@ -25,69 +26,9 @@ #include <log/log.h> -#include <metacall/metacall.h> - #include <stdio.h> #include <stdlib.h> -#if (defined(_WIN32) || defined(_WIN64)) && !defined(_MSC_VER) && defined(boolean) - #undef boolean -#endif - -/* Disable warnings from Ruby */ -#if defined(__clang__) - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wunused-parameter" -#elif defined(__GNUC__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wredundant-decls" - #pragma GCC diagnostic ignored "-Wpedantic" - #pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -#include <ruby.h> - -/* Disable warnings from Ruby */ -#if defined(__clang__) - #pragma clang diagnostic pop -#elif defined(__GNUC__) - #pragma GCC diagnostic pop -#endif - -/* Backward compatible macros for Ruby < 2.7 */ -#ifndef RB_PASS_KEYWORDS - #define rb_funcallv_kw(o, m, c, v, kw) rb_funcallv(o, m, c, v) - #define rb_funcallv_public_kw(o, m, c, v, kw) rb_funcallv_public(o, m, c, v) - #define rb_funcall_passing_block_kw(o, m, c, v, kw) rb_funcall_passing_block(o, m, c, v) - #define rb_funcall_with_block_kw(o, m, c, v, b, kw) rb_funcall_with_block(o, m, c, v, b) - #define rb_scan_args_kw(kw, c, v, s, ...) rb_scan_args(c, v, s, __VA_ARGS__) - #define rb_call_super_kw(c, v, kw) rb_call_super(c, v) - #define rb_yield_values_kw(c, v, kw) rb_yield_values2(c, v) - #define rb_yield_splat_kw(a, kw) rb_yield_splat(a) - #define rb_block_call_kw(o, m, c, v, f, p, kw) rb_block_call(o, m, c, v, f, p) - #define rb_fiber_resume_kw(o, c, v, kw) rb_fiber_resume(o, c, v) - #define rb_fiber_yield_kw(c, v, kw) rb_fiber_yield(c, v) - #define rb_enumeratorize_with_size_kw(o, m, c, v, f, kw) rb_enumeratorize_with_size(o, m, c, v, f) - #define SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat) \ - rb_enumeratorize_with_size((obj), ID2SYM(rb_frame_this_func()), \ - (argc), (argv), (size_fn)) - #define RETURN_SIZED_ENUMERATOR_KW(obj, argc, argv, size_fn, kw_splat) \ - do \ - { \ - if (!rb_block_given_p()) \ - return SIZED_ENUMERATOR(obj, argc, argv, size_fn); \ - } while (0) - #define RETURN_ENUMERATOR_KW(obj, argc, argv, kw_splat) RETURN_SIZED_ENUMERATOR(obj, argc, argv, 0) - #define rb_check_funcall_kw(o, m, c, v, kw) rb_check_funcall(o, m, c, v) - #define rb_obj_call_init_kw(o, c, v, kw) rb_obj_call_init(o, c, v) - #define rb_class_new_instance_kw(c, v, k, kw) rb_class_new_instance(c, v, k) - #define rb_proc_call_kw(p, a, kw) rb_proc_call(p, a) - #define rb_proc_call_with_block_kw(p, c, v, b, kw) rb_proc_call_with_block(p, c, v, b) - #define rb_method_call_kw(c, v, m, kw) rb_method_call(c, v, m) - #define rb_method_call_with_block_kw(c, v, m, b, kw) rb_method_call_with_block(c, v, m, b) - #define rb_eval_cmd_kwd(c, a, kw) rb_eval_cmd(c, a, 0) -#endif - #define LOADER_IMPL_RB_FUNCTION_ARGS_SIZE 0x10 #define LOADER_IMPL_RB_PROTECT_ARGS_SIZE 0x10 @@ -152,6 +93,10 @@ static class_interface rb_class_interface_singleton(void); static object_interface rb_object_interface_singleton(void); static void rb_loader_impl_discover_methods(klass c, VALUE cls, const char *class_name_str, enum class_visibility_id visibility, const char *method_type_str, VALUE methods, int (*register_method)(klass, method)); +/* Implements executing the file as main instead of a module */ +static int rb_loader_impl_run_main = 1; +static char *rb_loader_impl_main_module = NULL; + int function_rb_interface_create(function func, function_impl impl) { signature s = function_signature(func); @@ -985,6 +930,8 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi NULL }; + const int host = loader_impl_get_option_host(impl); + /* Initialize Ruby */ char **argv = metacall_argv(); int argc = metacall_argc(); @@ -993,6 +940,21 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi (void)config; ruby_sysinit(&argc, &argv); + + if (argv != NULL && argc > 1) + { + rb_loader_impl_main_module = argv[1]; + + /* If we are running on host, this means the main is already executed by the host, so we can skip it, + * otherwise if we are not in host and we run it for the first time, we can prepare the loader + * for running the file as script instead of like a module + */ + if (host == 0) + { + rb_loader_impl_run_main = 0; + } + } + { RUBY_INIT_STACK; @@ -1002,17 +964,15 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi if (rb_loader_impl_initialize_types(impl) != 0) { - ruby_cleanup(0); - - return NULL; + log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the types"); + goto error_initialize; } #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) if (rb_gv_set("$VERBOSE", Qtrue) != Qtrue) { - ruby_cleanup(0); - - return NULL; + log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the $VERBOSE variable"); + goto error_initialize; } #endif @@ -1031,6 +991,12 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi } */ + if (rb_loader_port_initialize(impl) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the port"); + goto error_initialize; + } + log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader initialized correctly"); } @@ -1038,6 +1004,10 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi loader_initialization_register(impl); return (loader_impl_data)&rb_loader_impl_unused; + +error_initialize: + ruby_cleanup(0); + return NULL; } int rb_loader_impl_execution_path(loader_impl impl, const loader_path path) @@ -1117,47 +1087,93 @@ VALUE rb_loader_impl_module_eval_protect(VALUE args) return rb_mod_module_eval(protect->argc, protect->argv, protect->module); } +void rb_loader_impl_print_exception(void) +{ + VALUE exception = rb_gv_get("$!"); + + if (RTEST(exception)) + { + VALUE inspect, backtrace; + + inspect = rb_inspect(exception); + + rb_io_puts(1, &inspect, rb_stderr); + + backtrace = rb_funcallv(exception, rb_intern("backtrace"), 0, NULL); + + rb_io_puts(1, &backtrace, rb_stderr); + } + else + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby module backtrace not available"); + } +} + int rb_loader_impl_module_eval(VALUE module, VALUE module_data, VALUE *result) { - VALUE argv[1]; struct loader_impl_rb_module_eval_protect_type protect; int state; - argv[0] = module_data; - protect.argc = 1; - protect.argv = argv; + protect.argv = &module_data; protect.module = module; *result = rb_protect(rb_loader_impl_module_eval_protect, (VALUE)&protect, &state); if (state != 0) { - VALUE exception; - log_write("metacall", LOG_LEVEL_ERROR, "Ruby module evaluation failed"); + rb_loader_impl_print_exception(); + } - exception = rb_gv_get("$!"); + return state; +} - if (RTEST(exception)) - { - VALUE inspect, backtrace; +loader_impl_rb_module rb_loader_impl_create_module(VALUE name_capitalized, VALUE module, VALUE module_data, VALUE result) +{ + loader_impl_rb_module rb_module = malloc(sizeof(struct loader_impl_rb_module_type)); - inspect = rb_inspect(exception); + if (rb_module == NULL) + { + return NULL; + } - rb_io_puts(1, &inspect, rb_stderr); + if (result != Qnil) + { + rb_module->empty = 1; + rb_module->id = rb_to_id(name_capitalized); + rb_module->module = module; + rb_module->instance = rb_funcall(rb_cClass, rb_intern("new"), 1, rb_cObject); - backtrace = rb_funcallv(exception, rb_intern("backtrace"), 0, NULL); + rb_extend_object(rb_module->instance, rb_module->module); - rb_io_puts(1, &backtrace, rb_stderr); - } - else + rb_include_module(rb_module->instance, rb_module->module); + + rb_module->function_map = set_create(&hash_callback_str, &comparable_callback_str); + + if (!(rb_module->function_map != NULL && rb_loader_impl_key_parse(RSTRING_PTR(module_data), rb_module->function_map) == 0)) { - log_write("metacall", LOG_LEVEL_ERROR, "Ruby module backtrace not available"); + rb_loader_impl_key_clear(rb_module->function_map); + + free(rb_module); + + return NULL; } + + log_write("metacall", LOG_LEVEL_DEBUG, "Ruby module %s loaded", StringValuePtr(name_capitalized)); + + rb_loader_impl_key_print(rb_module->function_map); + } + else + { + rb_module->empty = 0; + rb_module->id = (ID)NULL; + rb_module->module = Qnil; + rb_module->instance = Qnil; + rb_module->function_map = NULL; } - return state; + return rb_module; } loader_impl_rb_module rb_loader_impl_load_from_file_module(loader_impl impl, const loader_path path, const loader_name name) @@ -1178,47 +1194,7 @@ loader_impl_rb_module rb_loader_impl_load_from_file_module(loader_impl impl, con if (rb_loader_impl_module_eval(module, module_data, &result) == 0) { - loader_impl_rb_module rb_module = malloc(sizeof(struct loader_impl_rb_module_type)); - - if (rb_module != NULL) - { - if (result != Qnil) - { - rb_module->empty = 1; - rb_module->id = rb_to_id(name_capitalized); - rb_module->module = module; - rb_module->instance = rb_funcall(rb_cClass, rb_intern("new"), 1, rb_cObject); - - rb_extend_object(rb_module->instance, rb_module->module); - - rb_include_module(rb_module->instance, rb_module->module); - - rb_module->function_map = set_create(&hash_callback_str, &comparable_callback_str); - - if (!(rb_module->function_map != NULL && rb_loader_impl_key_parse(RSTRING_PTR(module_data), rb_module->function_map) == 0)) - { - rb_loader_impl_key_clear(rb_module->function_map); - - free(rb_module); - - return NULL; - } - - log_write("metacall", LOG_LEVEL_DEBUG, "Ruby module %s loaded", path); - - rb_loader_impl_key_print(rb_module->function_map); - } - else - { - rb_module->empty = 0; - rb_module->id = (ID)NULL; - rb_module->module = Qnil; - rb_module->instance = Qnil; - rb_module->function_map = NULL; - } - - return rb_module; - } + return rb_loader_impl_create_module(name_capitalized, module, module_data, result); } } } @@ -1230,12 +1206,9 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path { loader_impl_rb_handle handle = malloc(sizeof(struct loader_impl_rb_handle_type)); - size_t iterator; - if (handle == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid ruby handle allocation"); - return NULL; } @@ -1244,45 +1217,83 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path if (handle->modules == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid ruby modules vector allocation"); - - free(handle); - - return NULL; + goto vector_error; } - for (iterator = 0; iterator < size; ++iterator) + /* If we loaded one script and this script is the same as the one we passed to argv, + then we should set up this as a main script, only if only we set up the argv in MetaCall. + This should run only once, the first time after the initialization */ + if (rb_loader_impl_run_main == 0 && size == 1 && strcmp(paths[0], rb_loader_impl_main_module) == 0) { - static const char extension[] = "rb"; + VALUE module_data, result, module_name; + int state; loader_impl_rb_module rb_module; - loader_name module_name; - (void)portability_path_get_module_name(paths[iterator], strnlen(paths[iterator], LOADER_PATH_SIZE) + 1, extension, sizeof(extension), module_name, LOADER_NAME_SIZE); + rb_loader_impl_run_main = 1; - rb_module = rb_loader_impl_load_from_file_module(impl, paths[iterator], module_name); + module_data = rb_loader_impl_load_data(impl, paths[0]); + + result = rb_eval_string_protect(StringValuePtr(module_data), &state); + + if (state != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby evaluation failed"); + rb_loader_impl_print_exception(); + goto load_error; + } + + module_name = rb_funcall(result, rb_intern("name"), 0); + + rb_module = rb_loader_impl_create_module(module_name, result, module_data, result); if (rb_module == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid ruby module loading %s", paths[iterator]); + log_write("metacall", LOG_LEVEL_ERROR, "Invalid ruby module loading %s", paths[0]); } else { vector_push_back(handle->modules, &rb_module); } } + else + { + size_t iterator; + + for (iterator = 0; iterator < size; ++iterator) + { + static const char extension[] = "rb"; + loader_impl_rb_module rb_module; + loader_name module_name; + + (void)portability_path_get_module_name(paths[iterator], strnlen(paths[iterator], LOADER_PATH_SIZE) + 1, extension, sizeof(extension), module_name, LOADER_NAME_SIZE); + + rb_module = rb_loader_impl_load_from_file_module(impl, paths[iterator], module_name); + + if (rb_module == NULL) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid ruby module loading %s", paths[iterator]); + } + else + { + vector_push_back(handle->modules, &rb_module); + } + } + } // Do not load the handle in case there isn't modules if (vector_size(handle->modules) == 0) { log_write("metacall", LOG_LEVEL_ERROR, "No module could be loaded"); - - vector_destroy(handle->modules); - - free(handle); - - return NULL; + goto load_error; } return (loader_handle)handle; + +load_error: + vector_destroy(handle->modules); +vector_error: + free(handle); + return NULL; } loader_impl_rb_module rb_loader_impl_load_from_memory_module(loader_impl impl, const loader_name name, const char *buffer, size_t size) @@ -1306,47 +1317,7 @@ loader_impl_rb_module rb_loader_impl_load_from_memory_module(loader_impl impl, c if (rb_loader_impl_module_eval(module, module_data, &result) == 0) { - loader_impl_rb_module rb_module = malloc(sizeof(struct loader_impl_rb_module_type)); - - if (rb_module != NULL) - { - if (result != Qnil) - { - rb_module->empty = 1; - rb_module->id = rb_to_id(name_capitalized); - rb_module->module = module; - rb_module->instance = rb_funcall(rb_cClass, rb_intern("new"), 1, rb_cObject); - - rb_extend_object(rb_module->instance, rb_module->module); - - rb_include_module(rb_module->instance, rb_module->module); - - rb_module->function_map = set_create(&hash_callback_str, &comparable_callback_str); - - if (!(rb_module->function_map != NULL && rb_loader_impl_key_parse(RSTRING_PTR(module_data), rb_module->function_map) == 0)) - { - set_destroy(rb_module->function_map); - - free(rb_module); - - return NULL; - } - - log_write("metacall", LOG_LEVEL_DEBUG, "Ruby module %s loaded", name); - - rb_loader_impl_key_print(rb_module->function_map); - } - else - { - rb_module->empty = 0; - rb_module->id = (ID)NULL; - rb_module->module = Qnil; - rb_module->instance = Qnil; - rb_module->function_map = NULL; - } - - return rb_module; - } + return rb_loader_impl_create_module(name_capitalized, module, module_data, result); } } } diff --git a/source/loaders/rb_loader/source/rb_loader_port.c b/source/loaders/rb_loader/source/rb_loader_port.c index 92e928e54..eef87b563 100644 --- a/source/loaders/rb_loader/source/rb_loader_port.c +++ b/source/loaders/rb_loader/source/rb_loader_port.c @@ -18,15 +18,18 @@ * */ +#include <rb_loader/rb_loader_impl.h> #include <rb_loader/rb_loader_port.h> -#include <ruby.h> +#include <format/format.h> #include <metacall/metacall.h> -#include <format/format.h> +#include <rb_loader/rb_loader_include.h> -VALUE rb_loader_port_load_from_file(int argc, VALUE *argv, VALUE self) +static loader_impl rb_loader_impl = NULL; + +VALUE rb_loader_port_load_from_file(VALUE self, VALUE tag_value, VALUE paths_value) { const char *tag; const char **paths; @@ -35,28 +38,23 @@ VALUE rb_loader_port_load_from_file(int argc, VALUE *argv, VALUE self) (void)self; - if (argc != 2) - { - rb_raise(rb_eArgError, "Wrong # of arguments (expected 2, received %d)", argc); - return Qnil; - } - - if (TYPE(argv[0]) != T_STRING) + /* Get tag */ + if (TYPE(tag_value) != T_STRING) { rb_raise(rb_eArgError, "First parameter expected to be a string indicating the tag of the loader (py, node, c, ...)"); return Qnil; } - tag = StringValuePtr(argv[0]); + tag = StringValuePtr(tag_value); - if (TYPE(argv[1]) != T_ARRAY) + /* Get array size */ + if (TYPE(paths_value) != T_ARRAY) { rb_raise(rb_eArgError, "Second parameter expected to be an array of strings with the desired files to be loaded"); return Qnil; } - /* Get array size */ - size = RARRAY_LEN(argv[1]); + size = RARRAY_LEN(paths_value); if (size == 0) { @@ -67,13 +65,13 @@ VALUE rb_loader_port_load_from_file(int argc, VALUE *argv, VALUE self) /* Parse the array */ { size_t iterator; - VALUE *array_ptr = RARRAY_PTR(argv[1]); + VALUE *array_ptr = RARRAY_PTR(paths_value); paths = (const char **)malloc(sizeof(const char *) * size); if (paths == NULL) { - rb_raise(rb_eArgError, "Invalid file argument allocation"); + rb_raise(rb_eArgError, "Invalid paths argument allocation"); return Qnil; } @@ -98,7 +96,7 @@ VALUE rb_loader_port_load_from_file(int argc, VALUE *argv, VALUE self) return LONG2NUM(result); } -VALUE rb_loader_port_load_from_memory(int argc, VALUE *argv, VALUE self) +VALUE rb_loader_port_load_from_memory(VALUE self, VALUE tag_value, VALUE buffer_value) { const char *tag; const char *buffer; @@ -107,28 +105,23 @@ VALUE rb_loader_port_load_from_memory(int argc, VALUE *argv, VALUE self) (void)self; - if (argc != 2) - { - rb_raise(rb_eArgError, "Wrong # of arguments (expected 2, received %d)", argc); - return Qnil; - } - - if (TYPE(argv[0]) != T_STRING) + /* Get tag */ + if (TYPE(tag_value) != T_STRING) { rb_raise(rb_eArgError, "First parameter expected to be a string indicating the tag of the loader (py, node, c, ...)"); return Qnil; } - tag = StringValuePtr(argv[0]); + tag = StringValuePtr(tag_value); - if (TYPE(argv[1]) != T_STRING) + /* Get buffer size */ + if (TYPE(buffer_value) != T_STRING) { rb_raise(rb_eArgError, "Second parameter expected to be an string with the code to be loaded"); return Qnil; } - /* Get buffer size */ - size = RSTRING_LEN(argv[1]) + 1; + size = RSTRING_LEN(buffer_value) + 1; if (size == 1) { @@ -136,18 +129,92 @@ VALUE rb_loader_port_load_from_memory(int argc, VALUE *argv, VALUE self) return Qnil; } + /* Get buffer */ + buffer = StringValuePtr(buffer_value); + /* Execute load from memory */ result = metacall_load_from_memory(tag, buffer, size, NULL); return LONG2NUM(result); } -// TODO: Implement metacall function +VALUE rb_loader_port_metacall(int argc, VALUE *argv, VALUE self) +{ + const char *function_name; + size_t args_size, iterator; + value *args, result; + + (void)self; + + if (argc <= 0) + { + rb_raise(rb_eArgError, "Wrong # of arguments (expected at least 1 argument, received 0)"); + return Qnil; + } -int rb_loader_port_initialize(void) + /* Get function name */ + if (TYPE(argv[0]) != T_STRING) + { + rb_raise(rb_eArgError, "First parameter expected to be a string indicating the function name to be called"); + return Qnil; + } + + function_name = StringValuePtr(argv[0]); + + /* Allocate arguments */ + args_size = argc - 1; + + args = args_size > 0 ? (value *)malloc(sizeof(value) * args_size) : metacall_null_args; + + if (args_size > 0 && args == NULL) + { + rb_raise(rb_eArgError, "Invalid arguments allocation"); + return Qnil; + } + + /* Convert the arguments into MetaCall values */ + for (iterator = 0; iterator < args_size; ++iterator) + { + (void)rb_type_deserialize(rb_loader_impl, argv[iterator], &args[iterator]); + } + + /* Execute the call */ + result = metacallv_s(function_name, args, args_size); + + /* Clear the arguments */ + if (args_size > 0) + { + for (iterator = 0; iterator < args_size; ++iterator) + { + value_type_destroy(args[iterator]); + } + + free(args); + } + + return rb_type_serialize(result); +} + +int rb_loader_port_initialize(loader_impl impl) { - VALUE rb_loader_port = rb_define_module("metacall_rb_loader_port"); - rb_define_module_function(mRb_portd, "metacall_detour", _wrap_metacall_detour, -1); + VALUE rb_loader_port; + + if (impl == NULL) + { + return 1; + } + + if (rb_loader_impl != NULL) + { + return 0; + } + + rb_loader_port = rb_define_module("MetaCallRbLoaderPort"); + rb_define_module_function(rb_loader_port, "metacall_load_from_file", rb_loader_port_load_from_file, 2); + rb_define_module_function(rb_loader_port, "metacall_load_from_memory", rb_loader_port_load_from_memory, 2); + rb_define_module_function(rb_loader_port, "metacall", rb_loader_port_metacall, -1); + + rb_loader_impl = impl; return 0; } diff --git a/source/ports/py_port/CMakeLists.txt b/source/ports/py_port/CMakeLists.txt index 201511dd3..c41504c73 100644 --- a/source/ports/py_port/CMakeLists.txt +++ b/source/ports/py_port/CMakeLists.txt @@ -45,8 +45,9 @@ endif() set(py_port_test "${target}_test") -if(NOT OPTION_BUILD_CLI) - # Add test (CLI) +if(OPTION_BUILD_CLI) + message(STATUS "Test ${py_port_test}") + add_test(NAME ${target} COMMAND $<TARGET_FILE:metacallcli> ${CMAKE_CURRENT_SOURCE_DIR}/test.py ) diff --git a/source/ports/rb_port/CMakeLists.txt b/source/ports/rb_port/CMakeLists.txt index 4459bbdd8..200bde489 100644 --- a/source/ports/rb_port/CMakeLists.txt +++ b/source/ports/rb_port/CMakeLists.txt @@ -24,43 +24,81 @@ set(target rb_port) # Exit here if required dependencies are not met message(STATUS "Port ${target}") -# TODO + + + # -# Define test +# Define test (CLI) # -if(OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER) - # TODO: This test fails when run with sanitizers: +set(rb_port_test "${target}_test") +set(rb_port_test_path "${CMAKE_CURRENT_SOURCE_DIR}/test/run.rb") + +if(OPTION_BUILD_CLI) + message(STATUS "Test ${rb_port_test}") + + add_test(NAME ${rb_port_test} + COMMAND $<TARGET_FILE:metacallcli> "${rb_port_test_path}" + ) + # - # Sanitizer: - # ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. - # For solving the issue compile the test with sanitizers when enabled or preload asan + # Define test labels # - # Thread Sanitizer: - # /usr/local/metacall/build/rb_port_test.rb:4:in `require_relative': /usr/lib/x86_64-linux-gnu/libtsan.so.2: cannot allocate memory in static TLS block - /usr/local/metacall/build/rb_portd.so (LoadError) - # from /usr/local/metacall/build/rb_port_test.rb:4:in `<main>' - return() + + set_property(TEST ${rb_port_test} + PROPERTY LABELS ${rb_port_test} + ) + + include(TestEnvironmentVariables) + + test_environment_variables(${rb_port_test} + "" + ${TESTS_ENVIRONMENT_VARIABLES} + ) endif() -set(rb_port_test "rb_port_test") -set(rb_port_test_path "${CMAKE_CURRENT_SOURCE_DIR}/test/run.rb") -add_test(NAME ${target} - COMMAND ${Ruby_EXECUTABLE} "${rb_port_test_path}" -) -# -# Define test labels -# -set_property(TEST ${target} - PROPERTY LABELS ${rb_port_test} -) -include(TestEnvironmentVariables) +# TODO + +# # +# # Define test +# # + +# if(OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER) +# # TODO: This test fails when run with sanitizers: +# # +# # Sanitizer: +# # ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. +# # For solving the issue compile the test with sanitizers when enabled or preload asan +# # +# # Thread Sanitizer: +# # /usr/local/metacall/build/rb_port_test.rb:4:in `require_relative': /usr/lib/x86_64-linux-gnu/libtsan.so.2: cannot allocate memory in static TLS block - /usr/local/metacall/build/rb_portd.so (LoadError) +# # from /usr/local/metacall/build/rb_port_test.rb:4:in `<main>' +# return() +# endif() + +# set(rb_port_test "rb_port_test") +# set(rb_port_test_path "${CMAKE_CURRENT_SOURCE_DIR}/test/run.rb") + +# add_test(NAME ${target} +# COMMAND ${Ruby_EXECUTABLE} "${rb_port_test_path}" +# ) + +# # +# # Define test labels +# # + +# set_property(TEST ${target} +# PROPERTY LABELS ${rb_port_test} +# ) + +# include(TestEnvironmentVariables) -test_environment_variables(${target} - "" - ${TESTS_ENVIRONMENT_VARIABLES} -) +# test_environment_variables(${target} +# "" +# ${TESTS_ENVIRONMENT_VARIABLES} +# ) diff --git a/source/ports/rb_port/package/lib/metacall.rb b/source/ports/rb_port/package/lib/metacall.rb index 29d1ce90d..0e7fe7a6c 100644 --- a/source/ports/rb_port/package/lib/metacall.rb +++ b/source/ports/rb_port/package/lib/metacall.rb @@ -1,3 +1,116 @@ -class MetaCall +#!/usr/bin/ruby + +require 'find' +require 'rbconfig' +require 'fiddle' + +module MetaCall + private + + def find_files_recursively(root_dir, pattern) + regex = Regexp.new(pattern) + matches = [] + + if Dir.exist?(root_dir) + Find.find(root_dir) do |path| + matches << path if File.file?(path) && regex.match?(File.basename(path)) + end + end + + matches + end + + def platform_install_paths + host_os = RbConfig::CONFIG['host_os'] + + case host_os + when /mswin|mingw|cygwin/ + { + paths: [ File.join(ENV['LOCALAPPDATA'].to_s, 'MetaCall', 'metacall') ], + name: 'metacall\.dll' + } + when /darwin/ + { + paths: [ '/opt/homebrew/lib/', '/usr/local/lib/' ], + name: 'libmetacall\.dylib' + } + when /linux/ + { + paths: [ '/usr/local/lib/', '/gnu/lib/' ], + name: 'libmetacall\.so' + } + else + raise "Platform #{host_os} not supported" + end + end + + def search_paths + custom_path = ENV['METACALL_INSTALL_PATH'] + + if custom_path + { + paths: [ custom_path ], + name: '^(lib)?metacall(d)?\.(so|dylib|dll)$' + } + else + platform_install_paths + end + end + + def find_library + search_data = search_paths + + search_data[:paths].each do |path| + files = find_files_recursively(path, search_data[:name]) + return files.first unless files.empty? + end + + raise LoadError, <<~ERROR + MetaCall library not found. If you have it in a special folder, define it using the METACALL_INSTALL_PATH environment variable. + Searched in: #{search_data[:paths].join(', ')} + + If you do not have it installed, you have three options: + 1) Go to https://github.com/metacall/install and install it. + 2) Contribute to https://github.com/metacall/distributable by providing support for your platform and architecture. + 3) Be a x10 programmer and compile it yourself, then define the install folder using METACALL_INSTALL_PATH. + ERROR + end + + def metacall_module_load + # Check if already loaded + if defined?(MetaCallRbLoaderPort) + return MetaCallRbLoaderPort + end + + # Set environment variable for the host + ENV['METACALL_HOST'] = 'rb' + + # Find and load the MetaCall shared library + library_path = find_library + + begin + # Load the shared library globally + Fiddle::Handle.new(library_path, Fiddle::RTLD_GLOBAL | Fiddle::RTLD_NOW) + rescue Fiddle::DLError => e + raise LoadError, "Failed to load MetaCall library at #{library_path}: #{e.message}" + end + + # Check again if the port was loaded + if defined?(MetaCallRbLoaderPort) + return MetaCallRbLoaderPort + else + raise LoadError, 'MetaCall was found but failed to load MetaCallRbLoaderPort' + end + end + + # TODO: Load the port at startup + # port = metacall_module_load() + + public + + # TODO: API + # def method_a + # port.method_a + # end end diff --git a/source/ports/rb_port/test/run.rb b/source/ports/rb_port/test/run.rb index fe0180210..a6c407775 100644 --- a/source/ports/rb_port/test/run.rb +++ b/source/ports/rb_port/test/run.rb @@ -1,46 +1,48 @@ #!/usr/bin/ruby -require 'test/unit' -require_relative '@RB_PORT_NAME@' +require File.expand_path("../package/lib/metacall.rb") -class RbPortTest < Test::Unit::TestCase +# require 'test/unit' +# require_relative '@RB_PORT_NAME@' - @@meta = @RB_PORT_OBJ@.method(:metacall) +# class RbPortTest < Test::Unit::TestCase - # MetaCall (Python from memory) - def test_python_memory - script = '#!/usr/bin/env python3\n' \ - 'def inline_multiply_mem(left: int, right: int) -> int:\n' \ - ' return left * right;\n' - 'def inline_hello(left: int, right: int) -> int:\n' \ - ' print(\'Helloo\', left, \' \', right);\n' - ' return;\n' +# @@meta = @RB_PORT_OBJ@.method(:metacall) - assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_memory('py', script)) +# # MetaCall (Python from memory) +# def test_python_memory +# script = '#!/usr/bin/env python3\n' \ +# 'def inline_multiply_mem(left: int, right: int) -> int:\n' \ +# ' return left * right;\n' +# 'def inline_hello(left: int, right: int) -> int:\n' \ +# ' print(\'Helloo\', left, \' \', right);\n' +# ' return;\n' - #assert_equal(4, @@meta.call('inline_multiply_mem', 2, 2)) +# assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_memory('py', script)) - assert_equal(nil, @@meta.call('inline_hello', 10, 20)) - end +# #assert_equal(4, @@meta.call('inline_multiply_mem', 2, 2)) - # MetaCall (Python) - def test_python - assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_file('py', ['example.py'])) +# assert_equal(nil, @@meta.call('inline_hello', 10, 20)) +# end - assert_equal(nil, @@meta.call('hello')) +# # MetaCall (Python) +# def test_python +# assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_file('py', ['example.py'])) - assert_equal(35, @@meta.call('multiply', 5, 7)) - end +# assert_equal(nil, @@meta.call('hello')) - # MetaCall (Ruby) - def test_ruby - assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_file('rb', ['hello.rb'])) +# assert_equal(35, @@meta.call('multiply', 5, 7)) +# end - assert_equal(nil, @@meta.call('say_null')) +# # MetaCall (Ruby) +# def test_ruby +# assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_file('rb', ['hello.rb'])) - assert_equal(12, @@meta.call('say_multiply', 3, 4)) +# assert_equal(nil, @@meta.call('say_null')) - assert_equal('Hello world!', @@meta.call('say_hello', 'world')) - end +# assert_equal(12, @@meta.call('say_multiply', 3, 4)) -end +# assert_equal('Hello world!', @@meta.call('say_hello', 'world')) +# end + +# end diff --git a/source/tests/rb_loader_parser_test/CMakeLists.txt b/source/tests/rb_loader_parser_test/CMakeLists.txt index dac449a56..af3df47fe 100644 --- a/source/tests/rb_loader_parser_test/CMakeLists.txt +++ b/source/tests/rb_loader_parser_test/CMakeLists.txt @@ -79,6 +79,7 @@ target_include_directories(${target} ${PROJECT_BINARY_DIR}/source/include # Ruby Loader headers + ${CMAKE_BINARY_DIR}/source/loaders/rb_loader/include ${CMAKE_SOURCE_DIR}/source/loaders/rb_loader/include ) From c2fc27389aa57a55fa1c141f5a76f04eed6ac7cc Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 30 May 2025 19:05:09 +0200 Subject: [PATCH 288/487] Support for ruby.exe, metacall is not working now. --- .../loaders/rb_loader/source/rb_loader_impl.c | 73 +++++++++++-------- source/ports/rb_port/CMakeLists.txt | 53 +++++++------- source/ports/rb_port/package/lib/metacall.rb | 26 +++++-- source/ports/rb_port/test/run.rb | 64 ++++++++-------- 4 files changed, 120 insertions(+), 96 deletions(-) diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 2eb931f7b..4ac6f9fc1 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -955,58 +955,62 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi } } + if (host == 0) { RUBY_INIT_STACK; ruby_init(); ruby_init_loadpath(); + } - if (rb_loader_impl_initialize_types(impl) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the types"); - goto error_initialize; - } + if (rb_loader_impl_initialize_types(impl) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the types"); + goto error_initialize; + } #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - if (rb_gv_set("$VERBOSE", Qtrue) != Qtrue) - { - log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the $VERBOSE variable"); - goto error_initialize; - } + if (rb_gv_set("$VERBOSE", Qtrue) != Qtrue) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the $VERBOSE variable"); + goto error_initialize; + } #endif - /* Gem add home folder if any */ - /* - { - const char * gem_home_env = getenv("GEM_HOME"); + /* Gem add home folder if any */ + /* + { + const char * gem_home_env = getenv("GEM_HOME"); - if (gem_home_env != NULL) + if (gem_home_env != NULL) + { + if (rb_loader_impl_execution_path(impl, gem_home_env) != 0) { - if (rb_loader_impl_execution_path(impl, gem_home_env) != 0) - { - log_write("metacall", LOG_LEVEL_WARNING, "Ruby GEM_HOME could not be added to execution path list"); - } + log_write("metacall", LOG_LEVEL_WARNING, "Ruby GEM_HOME could not be added to execution path list"); } } - */ - - if (rb_loader_port_initialize(impl) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the port"); - goto error_initialize; - } + } + */ - log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader initialized correctly"); + if (rb_loader_port_initialize(impl) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby loader failed to initialize the port"); + goto error_initialize; } - /* Register initialization */ - loader_initialization_register(impl); + log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader initialized correctly"); - return (loader_impl_data)&rb_loader_impl_unused; +/* Register initialization */ +loader_initialization_register(impl); + +return (loader_impl_data)&rb_loader_impl_unused; error_initialize: - ruby_cleanup(0); + if (host == 0) + { + ruby_cleanup(0); + } return NULL; } @@ -1722,10 +1726,15 @@ int rb_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx) int rb_loader_impl_destroy(loader_impl impl) { - (void)impl; + const int host = loader_impl_get_option_host(impl); /* Destroy children loaders */ loader_unload_children(impl); + if (host == 1) + { + return 0; + } + return ruby_cleanup(0); } diff --git a/source/ports/rb_port/CMakeLists.txt b/source/ports/rb_port/CMakeLists.txt index 200bde489..ae034bee7 100644 --- a/source/ports/rb_port/CMakeLists.txt +++ b/source/ports/rb_port/CMakeLists.txt @@ -25,8 +25,11 @@ set(target rb_port) message(STATUS "Port ${target}") - - +# Check for test dependencies +if(NOT OPTION_BUILD_LOADERS_PY) + message(WARNING "Enable Python Loader [-DOPTION_BUILD_LOADERS_PY=ON] for enabling tests for Ruby Port") + return() +endif() # # Define test (CLI) @@ -40,6 +43,7 @@ if(OPTION_BUILD_CLI) add_test(NAME ${rb_port_test} COMMAND $<TARGET_FILE:metacallcli> "${rb_port_test_path}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test" ) # @@ -58,16 +62,13 @@ if(OPTION_BUILD_CLI) ) endif() +# +# Define test (Ruby) +# - - +set(rb_port_test_executable "${rb_port_test}_executable") # TODO - -# # -# # Define test -# # - # if(OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER) # # TODO: This test fails when run with sanitizers: # # @@ -81,24 +82,26 @@ endif() # return() # endif() -# set(rb_port_test "rb_port_test") -# set(rb_port_test_path "${CMAKE_CURRENT_SOURCE_DIR}/test/run.rb") +message(STATUS "Test ${rb_port_test_executable}") -# add_test(NAME ${target} -# COMMAND ${Ruby_EXECUTABLE} "${rb_port_test_path}" -# ) +add_test(NAME ${rb_port_test_executable} + COMMAND ${Ruby_EXECUTABLE} "${rb_port_test_path}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test" +) -# # -# # Define test labels -# # +# +# Define test labels +# -# set_property(TEST ${target} -# PROPERTY LABELS ${rb_port_test} -# ) +set_property(TEST ${rb_port_test_executable} + PROPERTY LABELS ${rb_port_test_executable} +) -# include(TestEnvironmentVariables) +include(TestEnvironmentVariables) -# test_environment_variables(${target} -# "" -# ${TESTS_ENVIRONMENT_VARIABLES} -# ) +test_environment_variables(${rb_port_test_executable} + "" + ${TESTS_ENVIRONMENT_VARIABLES} + "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} +) diff --git a/source/ports/rb_port/package/lib/metacall.rb b/source/ports/rb_port/package/lib/metacall.rb index 0e7fe7a6c..bb21cd623 100644 --- a/source/ports/rb_port/package/lib/metacall.rb +++ b/source/ports/rb_port/package/lib/metacall.rb @@ -5,6 +5,8 @@ require 'fiddle' module MetaCall + extend self + private def find_files_recursively(root_dir, pattern) @@ -103,14 +105,24 @@ def metacall_module_load end end - # TODO: Load the port at startup - # port = metacall_module_load() - public - # TODO: API - # def method_a - # port.method_a - # end + def metacall_load_from_file(tag, paths) + metacall_module_load + + MetaCallRbLoaderPort.metacall_load_from_file(tag, paths) + end + + def metacall_load_from_memory(tag, script) + metacall_module_load + + MetaCallRbLoaderPort.metacall_load_from_memory(tag, script) + end + + def metacall(function_name, *args) + metacall_module_load + + MetaCallRbLoaderPort.metacall(function_name, *args) + end end diff --git a/source/ports/rb_port/test/run.rb b/source/ports/rb_port/test/run.rb index a6c407775..69ead17bd 100644 --- a/source/ports/rb_port/test/run.rb +++ b/source/ports/rb_port/test/run.rb @@ -1,48 +1,48 @@ #!/usr/bin/ruby +require 'test/unit' require File.expand_path("../package/lib/metacall.rb") -# require 'test/unit' -# require_relative '@RB_PORT_NAME@' +class RbPortTest < Test::Unit::TestCase -# class RbPortTest < Test::Unit::TestCase + # MetaCall (Python from memory) + def test_python_memory + script = '#!/usr/bin/env python3\n' \ + 'def inline_multiply_mem(left: int, right: int) -> int:\n' \ + ' return left * right;\n' + 'def inline_hello(left: int, right: int) -> int:\n' \ + ' print(\'Helloo\', left, \' \', right);\n' + ' return;\n' -# @@meta = @RB_PORT_OBJ@.method(:metacall) + assert_equal(0, MetaCall.metacall_load_from_memory('py', script)) -# # MetaCall (Python from memory) -# def test_python_memory -# script = '#!/usr/bin/env python3\n' \ -# 'def inline_multiply_mem(left: int, right: int) -> int:\n' \ -# ' return left * right;\n' -# 'def inline_hello(left: int, right: int) -> int:\n' \ -# ' print(\'Helloo\', left, \' \', right);\n' -# ' return;\n' + # TODO + # assert_equal(4, MetaCall::metacall('inline_multiply_mem', 2, 2)) -# assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_memory('py', script)) + assert_equal(nil, MetaCall::metacall('inline_hello', 10, 20)) + end -# #assert_equal(4, @@meta.call('inline_multiply_mem', 2, 2)) + # MetaCall (Python) + def test_python + assert_equal(0, MetaCall::metacall_load_from_file('py', ['example.py'])) -# assert_equal(nil, @@meta.call('inline_hello', 10, 20)) -# end + assert_equal(nil, MetaCall::metacall('hello')) -# # MetaCall (Python) -# def test_python -# assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_file('py', ['example.py'])) + # TODO + # assert_equal(35, MetaCall::metacall('multiply', 5, 7)) + end -# assert_equal(nil, @@meta.call('hello')) + # MetaCall (Ruby) + def test_ruby + assert_equal(0, MetaCall::metacall_load_from_file('rb', ['hello.rb'])) -# assert_equal(35, @@meta.call('multiply', 5, 7)) -# end + assert_equal(nil, MetaCall::metacall('say_null')) -# # MetaCall (Ruby) -# def test_ruby -# assert_equal(0, @RB_PORT_OBJ@.metacall_load_from_file('rb', ['hello.rb'])) + # TODO + # assert_equal(12, MetaCall::metacall('say_multiply', 3, 4)) -# assert_equal(nil, @@meta.call('say_null')) + # TODO + # assert_equal('Hello world!', MetaCall::metacall('say_hello', 'world')) + end -# assert_equal(12, @@meta.call('say_multiply', 3, 4)) - -# assert_equal('Hello world!', @@meta.call('say_hello', 'world')) -# end - -# end +end From 8032b37d1510b7cb3a2bf55c3ada9e44f230849d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 30 May 2025 19:14:41 +0200 Subject: [PATCH 289/487] Solve issue with python. --- source/loaders/py_loader/source/py_loader_symbol_fallback.c | 1 + source/loaders/rb_loader/source/rb_loader_impl.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 837b88338..2d969ecc3 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -26,6 +26,7 @@ __attribute__((weak)) void _Py_DECREF_DecRefTotal(void) {} __attribute__((weak)) void _Py_INCREF_IncRefTotal(void) {} +__attribute__((weak)) Py_ssize_t _Py_RefTotal; /* When Python has been compiled with tracing reference counting, * provide fallback symbols for allowing it to compile properly */ diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 4ac6f9fc1..c5139dea9 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -1001,10 +1001,10 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader initialized correctly"); -/* Register initialization */ -loader_initialization_register(impl); + /* Register initialization */ + loader_initialization_register(impl); -return (loader_impl_data)&rb_loader_impl_unused; + return (loader_impl_data)&rb_loader_impl_unused; error_initialize: if (host == 0) From 0ff9225c3d90513d46ba1fa8ce74ce2a3f90d49b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 30 May 2025 22:15:31 +0200 Subject: [PATCH 290/487] Solve deadlock in metacall node port test. --- source/ports/node_port/test.js | 19 ++++++++++++++++--- .../metacall_node_port_test/CMakeLists.txt | 1 + .../source/metacall_node_port_test.cpp | 6 +++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/source/ports/node_port/test.js b/source/ports/node_port/test.js index 36cb0f849..424b8c60c 100644 --- a/source/ports/node_port/test.js +++ b/source/ports/node_port/test.js @@ -41,7 +41,7 @@ const waitForMocha = async () => { return new Promise((resolve, reject) => mocha.run(failures => failures ? reject(failures) : resolve())); }; -void (async () => { +const main = async () => { try { // Run the tests await waitForMocha(); @@ -51,5 +51,18 @@ void (async () => { } } - console.log('Tests passed without errors'); -})(); + return 'Tests passed without errors'; +}; + +/* Allow to execute the test on demand */ +if (process.env['NODE_PORT_TEST_EXPORTS']) { + /* Export the test as a function */ + module.exports = { + main, + }; +} else { + /* Execute the test and print the result */ + void (async () => { + console.log(await main()); + })(); +} diff --git a/source/tests/metacall_node_port_test/CMakeLists.txt b/source/tests/metacall_node_port_test/CMakeLists.txt index 97aa855b3..556805951 100644 --- a/source/tests/metacall_node_port_test/CMakeLists.txt +++ b/source/tests/metacall_node_port_test/CMakeLists.txt @@ -240,4 +240,5 @@ test_environment_variables(${target} ${TESTS_ENVIRONMENT_VARIABLES_C} ${TESTS_ENVIRONMENT_VARIABLES_RS} ${TESTS_ENVIRONMENT_VARIABLES_OPENSSL} + "NODE_PORT_TEST_EXPORTS=1" ) diff --git a/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp b/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp index cfe35e8b5..081bf8337 100644 --- a/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp +++ b/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp @@ -75,11 +75,11 @@ TEST_F(metacall_node_port_test, DefaultConstructor) void *future = metacall_await("main", metacall_null_args, accept, reject, static_cast<void *>(&await_data)); - await_data.c.wait(lock); + ASSERT_NE((void *)NULL, (void *)future); - EXPECT_NE((void *)NULL, (void *)future); + ASSERT_EQ((enum metacall_value_id)metacall_value_id(future), (enum metacall_value_id)METACALL_FUTURE); - EXPECT_EQ((enum metacall_value_id)metacall_value_id(future), (enum metacall_value_id)METACALL_FUTURE); + await_data.c.wait(lock); metacall_value_destroy(future); } From 7f1f80001bfeddf7a86cd95e65656bccdee51f11 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 08:02:11 +0200 Subject: [PATCH 291/487] Enable more msvc versions. --- .github/workflows/macos-test.yml | 2 +- .github/workflows/windows-test.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 504486f54..26247e35b 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-13, macos-14] # TODO: macos-15: https://github.com/metacall/core/issues/530 + os: [macos-13, macos-14, macos-15] options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 69a4ecc5b..3b0d5dabc 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -17,11 +17,12 @@ concurrency: jobs: windows-test: name: Windows MSVC Test - runs-on: windows-2019 # TODO: Implement matrix with windows 2019 and 2022 + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: + os: [windows-2019, windows-2022, windows-2025] options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, From d773471e51ebc5593e350081cf93357284639a16 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 13:14:39 +0200 Subject: [PATCH 292/487] Solve delay load import issues on windows. --- source/dynlink/include/dynlink/dynlink_type.h | 14 ++ source/loaders/py_loader/CMakeLists.txt | 80 ++++--- .../py_loader/py_loader_symbol_fallback.h | 60 ++++++ .../loaders/py_loader/source/py_loader_impl.c | 15 +- .../loaders/py_loader/source/py_loader_port.c | 129 +++++------ .../source/py_loader_symbol_fallback.c | 203 +++++++++++++++++- 6 files changed, 387 insertions(+), 114 deletions(-) create mode 100644 source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h diff --git a/source/dynlink/include/dynlink/dynlink_type.h b/source/dynlink/include/dynlink/dynlink_type.h index d6b737e57..57413cae2 100644 --- a/source/dynlink/include/dynlink/dynlink_type.h +++ b/source/dynlink/include/dynlink/dynlink_type.h @@ -72,6 +72,20 @@ typedef void (*dynlink_symbol_addr)(void); /**< Function pointer referring to \ } while (0) +#define dynlink_symbol_uncast_type(fn, type, result) \ + do \ + { \ + union \ + { \ + type ptr; \ + dynlink_symbol_addr fn; \ + } cast; \ +\ + cast.fn = (fn); \ + (result) = (type)cast.ptr; \ +\ + } while (0) + #ifdef __cplusplus } #endif diff --git a/source/loaders/py_loader/CMakeLists.txt b/source/loaders/py_loader/CMakeLists.txt index c764d17b1..06d73b112 100644 --- a/source/loaders/py_loader/CMakeLists.txt +++ b/source/loaders/py_loader/CMakeLists.txt @@ -9,15 +9,45 @@ endif() if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(Python3_FIND_ABI "ON" "ANY" "ANY") - find_package(Python3 COMPONENTS Development) + find_package(Python3 COMPONENTS Interpreter Development) # Fallback to release if not found if(NOT Python3_Development_FOUND) set(Python3_FIND_ABI) - find_package(Python3 COMPONENTS Development REQUIRED) + find_package(Python3 COMPONENTS Interpreter Development REQUIRED) endif() else() - find_package(Python3 COMPONENTS Development REQUIRED) + find_package(Python3 COMPONENTS Interpreter Development REQUIRED) +endif() + +# Select the proper library +if(NOT Python3_LIBRARY AND Python3_LIBRARIES) + # Go through the list and handle keyword-separated structure + set(index 0) + list(LENGTH Python3_LIBRARIES lib_len) + while(index LESS lib_len) + list(GET Python3_LIBRARIES ${index} item) + + # Check if it's a keyword (debug/optimized) + if(item STREQUAL "debug" OR item STREQUAL "optimized" OR item STREQUAL "general") + set(keyword ${item}) + math(EXPR next "${index} + 1") + list(GET Python3_LIBRARIES ${next} lib_path) + + # Match the right keyword + if((CMAKE_BUILD_TYPE STREQUAL "Debug" AND keyword STREQUAL "debug") OR + (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND keyword STREQUAL "optimized") OR + (keyword STREQUAL "general")) # general applies to all configs + set(Python3_LIBRARY ${lib_path}) + endif() + + math(EXPR index "${index} + 2") # Skip keyword and path + else() + # Plain list without keywords (single-config or fallback) + set(Python3_LIBRARY ${item}) + math(EXPR index "${index} + 1") + endif() + endwhile() endif() # Copy Python DLL into project output directory @@ -25,30 +55,27 @@ endif() # TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da include(Portability) -if(PROJECT_OS_FAMILY STREQUAL win32 AND Python3_LIBRARIES AND Python3_ROOT_DIR AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - foreach(library ${Python3_LIBRARIES}) - if(${library} MATCHES "[^_d][.]lib$") - # Get the library path with dll suffix - string(REGEX REPLACE "[.]lib$" ".dll" LIB_PATH ${library}) - # Get the library name - get_filename_component(LIB_NAME "${LIB_PATH}" NAME) - # Find the library in the Python3 root path - find_file(Python3_LIBRARY_NAME_PATH ${LIB_NAME} - PATHS ${Python3_ROOT_DIR} - NO_DEFAULT_PATH - ) - if(Python3_LIBRARY_NAME_PATH) - break() - endif() - endif() - endforeach() +if(PROJECT_OS_FAMILY STREQUAL win32 AND Python3_LIBRARY) + # Get the library path with dll suffix + string(REGEX REPLACE "[.]lib$" ".dll" LIB_PATH "${Python3_LIBRARY}") + # Get the library name + get_filename_component(LIB_NAME "${LIB_PATH}" NAME) + # Get the python root folder + if(NOT Python3_ROOT_DIR) + get_filename_component(Python3_ROOT_DIR "${Python3_EXECUTABLE}" DIRECTORY) + endif() + # Find the library in the Python3 root path + find_file(Python3_LIBRARY_NAME_PATH "${LIB_NAME}" + PATHS "${Python3_ROOT_DIR}" + NO_DEFAULT_PATH + ) + # Copy the DLL to the output directory + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${PROJECT_OUTPUT_DIR}") + file(COPY "${Python3_LIBRARY_NAME_PATH}" DESTINATION "${PROJECT_OUTPUT_DIR}") endif() -if(Python3_LIBRARY_NAME_PATH) - execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_OUTPUT_DIR}) - file(COPY "${Python3_LIBRARY_NAME_PATH}" DESTINATION ${PROJECT_OUTPUT_DIR}) -else() - set(Python3_LIBRARY_NAME_PATH "${Python3_LIBRARIES}") +if(NOT Python3_LIBRARY_NAME_PATH) + set(Python3_LIBRARY_NAME_PATH "${Python3_LIBRARY}") endif() # @@ -91,6 +118,7 @@ set(headers ${include_path}/py_loader_port.h ${include_path}/py_loader_threading.h ${include_path}/py_loader_dict.h + ${include_path}/py_loader_symbol_fallback.h ) set(sources @@ -174,7 +202,7 @@ target_link_libraries(${target} ${META_PROJECT_NAME}::metacall # MetaCall library # Delay load for MSVC - $<$<CXX_COMPILER_ID:MSVC>:${Python3_LIBRARIES}> # Python library + $<$<CXX_COMPILER_ID:MSVC>:${Python3_LIBRARY}> # Python library $<$<CXX_COMPILER_ID:MSVC>:delayimp> PUBLIC diff --git a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h new file mode 100644 index 000000000..4805dabc6 --- /dev/null +++ b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h @@ -0,0 +1,60 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading python code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef PY_LOADER_SYMBOL_FALLBACK_H +#define PY_LOADER_SYMBOL_FALLBACK_H 1 + +#include <py_loader/py_loader_api.h> + +#include <dynlink/dynlink.h> + +#include <Python.h> + +#ifdef __cplusplus +extern "C" { +#endif + +PY_LOADER_NO_EXPORT int py_loader_symbol_fallback_initialize(dynlink py_library); + +#if defined(_WIN32) && defined(_MSC_VER) + #undef PyBool_Check +PY_LOADER_NO_EXPORT int PyBool_Check(const PyObject *ob); + #undef PyFloat_Check +PY_LOADER_NO_EXPORT int PyFloat_Check(const PyObject *ob); + #undef PyCapsule_CheckExact +PY_LOADER_NO_EXPORT int PyCapsule_CheckExact(const PyObject *ob); + #undef PyFunction_Check +PY_LOADER_NO_EXPORT int PyFunction_Check(const PyObject *ob); + #undef PyCFunction_Check +PY_LOADER_NO_EXPORT int PyCFunction_Check(const PyObject *ob); + #undef PyModule_Check +PY_LOADER_NO_EXPORT int PyModule_Check(const PyObject *ob); +#endif + +PY_LOADER_NO_EXPORT PyObject *Py_NonePtr(void); +PY_LOADER_NO_EXPORT PyObject *Py_ReturnNone(void); +PY_LOADER_NO_EXPORT PyObject *Py_ReturnFalse(void); +PY_LOADER_NO_EXPORT PyObject *Py_ReturnTrue(void); + +#ifdef __cplusplus +} +#endif + +#endif /* PY_LOADER_SYMBOL_FALLBACK_H */ diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 590e997e5..eaeada6ce 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -21,6 +21,7 @@ #include <py_loader/py_loader_dict.h> #include <py_loader/py_loader_impl.h> #include <py_loader/py_loader_port.h> +#include <py_loader/py_loader_symbol_fallback.h> #include <py_loader/py_loader_threading.h> #include <loader/loader.h> @@ -280,7 +281,7 @@ PyObject *py_loader_impl_capsule_new_null(void) /* We want to create a new capsule with contents set to NULL, but PyCapsule * does not allow that, instead we are going to identify our NULL capsule with * this configuration (setting the capsule to Py_None) */ - return PyCapsule_New(Py_None, py_loader_capsule_null_id, NULL); + return PyCapsule_New((void *)Py_NonePtr(), py_loader_capsule_null_id, NULL); } void py_loader_impl_value_invoke_state_finalize(value v, void *data) @@ -918,7 +919,7 @@ type_id py_loader_impl_capi_to_value_type(loader_impl impl, PyObject *obj) { return TYPE_FUNCTION; } - else if (obj == Py_None) + else if (obj == Py_NonePtr()) { return TYPE_NULL; } @@ -1146,7 +1147,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) const char *name = PyCapsule_GetName(obj); void *ptr = PyCapsule_GetPointer(obj, name); - if (ptr == Py_None && name == py_loader_capsule_null_id) + if (ptr == Py_NonePtr() && name == py_loader_capsule_null_id) { v = value_create_ptr(NULL); } @@ -1293,7 +1294,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) { PyObject *tb = PyException_GetTraceback(obj); - v = py_loader_impl_error_value_from_exception(loader_impl_get(impl), (PyObject *)Py_TYPE(obj), obj, tb ? tb : Py_None); + v = py_loader_impl_error_value_from_exception(loader_impl_get(impl), (PyObject *)Py_TYPE(obj), obj, tb ? tb : Py_NonePtr()); Py_XDECREF(tb); } @@ -2670,6 +2671,12 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi #endif } + /* Initialize symbol fallback */ + if (py_loader_symbol_fallback_initialize(loader_impl_dependency(impl, "python")) != 0) + { + goto error_init_py; + } + /* Initialize threading */ py_loader_thread_initialize(host); diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index 9edb8277e..0eb98e756 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -23,46 +23,13 @@ #include <py_loader/py_loader_dict.h> #include <py_loader/py_loader_impl.h> #include <py_loader/py_loader_port.h> +#include <py_loader/py_loader_symbol_fallback.h> #include <py_loader/py_loader_threading.h> #include <loader/loader.h> static const loader_tag py_loader_tag = "py"; -static PyObject *py_loader_port_none(void) -{ - Py_RETURN_NONE; -} - -#if defined(__clang__) - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wstrict-aliasing" -#elif defined(__GNUC__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#elif defined(_MSC_VER) - #pragma warning(push) -// TODO -#endif - -static PyObject *py_loader_port_false(void) -{ - Py_RETURN_FALSE; -} - -static PyObject *py_loader_port_true(void) -{ - Py_RETURN_TRUE; -} - -#if defined(__clang__) - #pragma clang diagnostic pop -#elif defined(__GNUC__) - #pragma GCC diagnostic pop -#elif defined(_MSC_VER) - #pragma warning(pop) -#endif - static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *args, void **handle) { static const char format[] = "OO:metacall_load_from_file"; @@ -77,7 +44,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (!PyArg_ParseTuple(args, (char *)format, &tag, &paths)) { PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_load_from_file('node', ['script.js']);"); - return py_loader_port_false(); + return Py_ReturnFalse(); } #if PY_MAJOR_VERSION == 2 @@ -87,13 +54,13 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar #endif { PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); - return py_loader_port_false(); + return Py_ReturnFalse(); } if (!PyList_Check(paths)) { PyErr_SetString(PyExc_TypeError, "Invalid parameter type in second argument (a list of strings indicating the paths must be used)"); - return py_loader_port_false(); + return Py_ReturnFalse(); } paths_size = PyList_Size(paths); @@ -101,7 +68,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (paths_size == 0) { PyErr_SetString(PyExc_TypeError, "At least one path must be included in the paths list"); - return py_loader_port_false(); + return Py_ReturnFalse(); } /* Convert tag from unicode into a string */ @@ -121,7 +88,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (tag_str == NULL) { PyErr_SetString(PyExc_TypeError, "Invalid tag string conversion"); - return py_loader_port_false(); + return Py_ReturnFalse(); } /* Convert paths list into an array of strings */ @@ -130,7 +97,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (paths_str == NULL) { PyErr_SetString(PyExc_ValueError, "Invalid argument allocation"); - return py_loader_port_false(); + return Py_ReturnFalse(); } for (iterator = 0; iterator < paths_size; ++iterator) @@ -165,7 +132,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (str == NULL) { PyErr_SetString(PyExc_TypeError, "Invalid path string conversion"); - result = py_loader_port_false(); + result = Py_ReturnFalse(); goto clear; } @@ -174,7 +141,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (paths_str[iterator] == NULL) { PyErr_SetString(PyExc_ValueError, "Invalid string path allocation"); - result = py_loader_port_false(); + result = Py_ReturnFalse(); goto clear; } @@ -193,7 +160,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (ret != 0) { - result = handle == NULL ? py_loader_port_false() : py_loader_port_none(); + result = handle == NULL ? Py_ReturnFalse() : Py_ReturnNone(); goto clear; } else @@ -211,7 +178,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (wrapper == NULL) { Py_XDECREF(result); - result = py_loader_port_none(); + result = Py_ReturnNone(); } else { @@ -220,7 +187,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar } else { - result = py_loader_port_true(); + result = Py_ReturnTrue(); } } @@ -259,7 +226,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (!PyArg_ParseTuple(args, (char *)format, &tag, &path)) { PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_load_from_package('cs', ['file.dll']);"); - return py_loader_port_false(); + return Py_ReturnFalse(); } #if PY_MAJOR_VERSION == 2 @@ -269,7 +236,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject #endif { PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); - return py_loader_port_false(); + return Py_ReturnFalse(); } #if PY_MAJOR_VERSION == 2 @@ -279,7 +246,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject #endif { PyErr_SetString(PyExc_TypeError, "Invalid parameter type in second argument (a string indicating the path must be used)"); - return py_loader_port_false(); + return Py_ReturnFalse(); } /* Convert tag from unicode into a string */ @@ -299,7 +266,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (tag_str == NULL) { PyErr_SetString(PyExc_TypeError, "Invalid tag string conversion"); - return py_loader_port_false(); + return Py_ReturnFalse(); } #if PY_MAJOR_VERSION == 2 @@ -325,7 +292,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (path_str == NULL) { PyErr_SetString(PyExc_TypeError, "Invalid path string conversion"); - return py_loader_port_false(); + return Py_ReturnFalse(); } py_loader_thread_release(); @@ -337,7 +304,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (ret != 0) { - result = handle == NULL ? py_loader_port_false() : py_loader_port_none(); + result = handle == NULL ? Py_ReturnFalse() : Py_ReturnNone(); } else { @@ -354,7 +321,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (wrapper == NULL) { Py_XDECREF(result); - result = py_loader_port_none(); + result = Py_ReturnNone(); } else { @@ -363,7 +330,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject } else { - result = py_loader_port_true(); + result = Py_ReturnTrue(); } } @@ -394,7 +361,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, (char *)format, &tag, &buffer)) { PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_load_from_memory('node', 'console.log(\"hello\")');"); - return py_loader_port_false(); + return Py_ReturnFalse(); } #if PY_MAJOR_VERSION == 2 @@ -404,7 +371,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) #endif { PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); - return py_loader_port_false(); + return Py_ReturnFalse(); } #if PY_MAJOR_VERSION == 2 @@ -414,7 +381,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) #endif { PyErr_SetString(PyExc_TypeError, "Invalid parameter type in second argument (a string indicating the tag of the loader must be used: 'console.log(\"hello\")')"); - return py_loader_port_false(); + return Py_ReturnFalse(); } /* Convert tag from unicode into a string */ @@ -434,7 +401,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) if (tag_str == NULL) { PyErr_SetString(PyExc_TypeError, "Invalid tag string conversion"); - return py_loader_port_false(); + return Py_ReturnFalse(); } /* Convert buffer from unicode into a string */ @@ -454,7 +421,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) if (buffer_str == NULL) { PyErr_SetString(PyExc_TypeError, "Invalid buffer string conversion"); - return py_loader_port_false(); + return Py_ReturnFalse(); } /* Execute the load from memory call */ @@ -467,11 +434,11 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) if (ret != 0) { - return py_loader_port_false(); + return Py_ReturnFalse(); } } - return py_loader_port_true(); + return Py_ReturnTrue(); } static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) @@ -494,7 +461,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) if (var_args_size == 0) { PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall('function_name', 'asd', 123, [7, 4]);"); - return py_loader_port_none(); + return Py_ReturnNone(); } name = PyTuple_GetItem(var_args, 0); @@ -515,7 +482,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) if (name_str == NULL) { PyErr_SetString(PyExc_TypeError, "Invalid function name string conversion, first parameter must be a string"); - return py_loader_port_none(); + return Py_ReturnNone(); } /* Get variable arguments length */ @@ -529,7 +496,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) if (value_args == NULL) { PyErr_SetString(PyExc_ValueError, "Invalid argument allocation"); - return py_loader_port_none(); + return Py_ReturnNone(); } /* Parse variable arguments */ @@ -560,7 +527,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) if (ret == NULL) { - result = py_loader_port_none(); + result = Py_ReturnNone(); goto clear; } @@ -572,7 +539,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) if (result == NULL) { - result = py_loader_port_none(); + result = Py_ReturnNone(); goto clear; } } @@ -617,7 +584,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) if (var_args_size == 0) { PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall('function_name', 'asd', 123, [7, 4]);"); - return py_loader_port_none(); + return Py_ReturnNone(); } name = PyTuple_GetItem(var_args, 0); @@ -638,7 +605,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) if (name_str == NULL) { PyErr_SetString(PyExc_TypeError, "Invalid function name string conversion, first parameter must be a string"); - return py_loader_port_none(); + return Py_ReturnNone(); } /* Get variable arguments length */ @@ -652,7 +619,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) if (value_args == NULL) { PyErr_SetString(PyExc_ValueError, "Invalid argument allocation"); - return py_loader_port_none(); + return Py_ReturnNone(); } /* Parse variable arguments */ @@ -686,7 +653,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) if (ret == NULL) { - result = py_loader_port_none(); + result = Py_ReturnNone(); goto clear; } @@ -696,7 +663,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) if (result == NULL) { - result = py_loader_port_none(); + result = Py_ReturnNone(); goto clear; } } @@ -773,16 +740,16 @@ static PyObject *py_loader_port_value_create_ptr(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, (char *)format, &pointer)) { PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_value_create_ptr(None); or metacall_value_create_ptr(previous_allocated_ptr);"); - return py_loader_port_none(); + return Py_ReturnNone(); } - if (!PyCapsule_CheckExact(pointer) && pointer != Py_None) + if (!PyCapsule_CheckExact(pointer) && pointer != Py_NonePtr()) { PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument must be None or a PyCapsule (i.e a previously allocated pointer)"); - return py_loader_port_none(); + return Py_ReturnNone(); } - if (pointer == Py_None) + if (pointer == Py_NonePtr()) { return py_loader_impl_capsule_new_null(); } @@ -846,7 +813,7 @@ static PyObject *py_loader_port_value_reference(PyObject *self, PyObject *args) error_value: metacall_value_destroy(v); error_none: - return py_loader_port_none(); + return Py_ReturnNone(); } static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args) @@ -864,14 +831,14 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args if (!PyArg_ParseTuple(args, (char *)format, &capsule)) { PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_value_dereference(ptr);"); - return py_loader_port_none(); + return Py_ReturnNone(); } /* Check if it is a valid reference */ if (!PyCapsule_CheckExact(capsule)) { PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument must be a PyCapsule (i.e a previously allocated pointer)"); - return py_loader_port_none(); + return Py_ReturnNone(); } /* Check if it is a valid MetaCall reference */ @@ -880,7 +847,7 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args if (name != py_loader_capsule_reference_id) { PyErr_SetString(PyExc_TypeError, "Invalid reference, argument must be a PyCapsule from MetaCall"); - return py_loader_port_none(); + return Py_ReturnNone(); } /* Get the value */ @@ -888,7 +855,7 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args if (v == NULL) { - return py_loader_port_none(); + return Py_ReturnNone(); } /* Obtain Python loader implementation */ @@ -899,7 +866,7 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args if (result == NULL) { PyErr_SetString(PyExc_ValueError, "Failed to convert the MetaCall value to Python object."); - return py_loader_port_none(); + return Py_ReturnNone(); } return result; @@ -920,7 +887,7 @@ static PyObject *py_loader_port_atexit(PyObject *self, PyObject *args) } } - return py_loader_port_none(); + return Py_ReturnNone(); } static PyMethodDef metacall_methods[] = { diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 2d969ecc3..0041f504e 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -18,13 +18,210 @@ * */ -#include <Python.h> +#include <py_loader/py_loader_symbol_fallback.h> -/* Required for when linking to Python in debug mode and loading with Python.exe in release mode */ +#include <dynlink/dynlink_type.h> + +/* Required for Windows due to DELAYLOAD not supporting delayed import of data symbols */ + +#if defined(_WIN32) && defined(_MSC_VER) +static PyTypeObject *PyBool_TypePtr = NULL; +static PyTypeObject *PyFloat_TypePtr = NULL; +static PyTypeObject *PyCapsule_TypePtr = NULL; +static PyTypeObject *PyFunction_TypePtr = NULL; +static PyTypeObject *PyCFunction_TypePtr = NULL; +static PyTypeObject *PyModule_TypePtr = NULL; +static PyObject *Py_NoneStructPtr = NULL; +static PyObject *Py_FalseStructPtr = NULL; +static PyObject *Py_TrueStructPtr = NULL; +#endif + +int py_loader_symbol_fallback_initialize(dynlink py_library) +{ +#if defined(_WIN32) && defined(_MSC_VER) + dynlink_symbol_addr address; + + if (py_library == NULL) + { + return 1; + } + + /* PyBool_Type */ + if (dynlink_symbol(py_library, "PyBool_Type", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyBool_TypePtr); + + /* PyFloat_Type */ + if (dynlink_symbol(py_library, "PyFloat_Type", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyFloat_TypePtr); + + /* PyCapsule_Type */ + if (dynlink_symbol(py_library, "PyCapsule_Type", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyCapsule_TypePtr); + + /* PyFunction_Type */ + if (dynlink_symbol(py_library, "PyFunction_Type", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyFunction_TypePtr); + + /* PyCFunction_Type */ + if (dynlink_symbol(py_library, "PyCFunction_Type", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyCFunction_TypePtr); + + /* PyModule_Type */ + if (dynlink_symbol(py_library, "PyModule_Type", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyModule_TypePtr); + + /* Py_None */ + if (dynlink_symbol(py_library, "_Py_NoneStruct", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyObject *, Py_NoneStructPtr); + + /* Py_False */ + if (dynlink_symbol(py_library, "_Py_FalseStruct", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyObject *, Py_FalseStructPtr); + + /* Py_True */ + if (dynlink_symbol(py_library, "_Py_TrueStruct", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyObject *, Py_TrueStructPtr); + + return 0; +#else + (void)py_library; + return 0; +#endif +} + +#if defined(_WIN32) && defined(_MSC_VER) +int PyBool_Check(const PyObject *ob) +{ + return Py_IS_TYPE(ob, PyBool_TypePtr); +} + +int PyFloat_Check(const PyObject *ob) +{ + return Py_IS_TYPE(ob, PyFloat_TypePtr); +} + +int PyCapsule_CheckExact(const PyObject *ob) +{ + return Py_IS_TYPE(ob, PyCapsule_TypePtr); +} + +int PyFunction_Check(const PyObject *ob) +{ + return Py_IS_TYPE(ob, PyFunction_TypePtr); +} + +int PyCFunction_Check(const PyObject *ob) +{ + return Py_IS_TYPE(ob, PyCFunction_TypePtr); +} + +int PyModule_Check(const PyObject *ob) +{ + return Py_IS_TYPE(ob, PyModule_TypePtr); +} +#endif + +PyObject *Py_NonePtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return Py_NoneStructPtr; +#else + return Py_None; +#endif +} + +PyObject *Py_ReturnNone(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + Py_INCREF(Py_NoneStructPtr); + return Py_NoneStructPtr; +#else + Py_RETURN_NONE; +#endif +} + +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wstrict-aliasing" +#elif defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#elif defined(_MSC_VER) + #pragma warning(push) +// TODO +#endif + +PyObject *Py_ReturnFalse(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + Py_INCREF(Py_FalseStructPtr); + return Py_FalseStructPtr; +#else + Py_RETURN_FALSE; +#endif +} + +PyObject *Py_ReturnTrue(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + Py_INCREF(Py_TrueStructPtr); + return Py_TrueStructPtr; +#else + Py_RETURN_TRUE; +#endif +} + +#if defined(__clang__) + #pragma clang diagnostic pop +#elif defined(__GNUC__) + #pragma GCC diagnostic pop +#elif defined(_MSC_VER) + #pragma warning(pop) +#endif + +/* Required on GNU for when linking to Python in debug mode and loading with Python.elf in release mode */ #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) #if defined(__clang__) || defined(__GNUC__) -__attribute__((weak)) void _Py_DECREF_DecRefTotal(void) {} +__attribute__((weak)) void _Py_DECREF_DecRefTotal(void) +{ +} __attribute__((weak)) void _Py_INCREF_IncRefTotal(void) {} __attribute__((weak)) Py_ssize_t _Py_RefTotal; From 27e6342ffb58627c7c8827b9cd2ac2ae9bcf56cd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 13:29:44 +0200 Subject: [PATCH 293/487] Solve more issues on python. --- .../py_loader/py_loader_symbol_fallback.h | 1 + .../loaders/py_loader/source/py_loader_impl.c | 4 ++-- .../source/py_loader_symbol_fallback.c | 20 ++++++++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h index 4805dabc6..b4394726c 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h @@ -48,6 +48,7 @@ PY_LOADER_NO_EXPORT int PyCFunction_Check(const PyObject *ob); PY_LOADER_NO_EXPORT int PyModule_Check(const PyObject *ob); #endif +PY_LOADER_NO_EXPORT PyTypeObject *PyTypeTypePtr(void); PY_LOADER_NO_EXPORT PyObject *Py_NonePtr(void); PY_LOADER_NO_EXPORT PyObject *Py_ReturnNone(void); PY_LOADER_NO_EXPORT PyObject *Py_ReturnFalse(void); diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index eaeada6ce..4fabcffbc 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -3941,8 +3941,8 @@ int py_loader_impl_discover_module(loader_impl impl, PyObject *module, context c while (PyDict_Next(module_dict, &position, &module_dict_key, &module_dict_val)) { // Class is also PyCallable, so test for class first - if (PyObject_TypeCheck(module_dict_val, &PyType_Type)) - // PyObject_IsSubclass(module_dict_val, (PyObject *)&PyType_Type) == 0 + if (PyObject_TypeCheck(module_dict_val, PyTypeTypePtr())) + // PyObject_IsSubclass(module_dict_val, (PyObject *)PyTypeTypePtr()) == 0 { const char *cls_name = PyUnicode_AsUTF8(module_dict_key); diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 0041f504e..b0ba0c5f7 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -31,6 +31,7 @@ static PyTypeObject *PyCapsule_TypePtr = NULL; static PyTypeObject *PyFunction_TypePtr = NULL; static PyTypeObject *PyCFunction_TypePtr = NULL; static PyTypeObject *PyModule_TypePtr = NULL; +static PyTypeObject *PyType_TypePtr = NULL; static PyObject *Py_NoneStructPtr = NULL; static PyObject *Py_FalseStructPtr = NULL; static PyObject *Py_TrueStructPtr = NULL; @@ -92,7 +93,15 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyTypeObject *, PyModule_TypePtr); + dynlink_symbol_uncast_type(address, PyTypeObject *, PyCFunction_TypePtr); + + /* PyType_Type */ + if (dynlink_symbol(py_library, "PyType_Type", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyType_TypePtr); /* Py_None */ if (dynlink_symbol(py_library, "_Py_NoneStruct", &address) != 0) @@ -157,6 +166,15 @@ int PyModule_Check(const PyObject *ob) } #endif +PyTypeObject *PyTypeTypePtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyType_TypePtr; +#else + return &PyType_Type; +#endif +} + PyObject *Py_NonePtr(void) { #if defined(_WIN32) && defined(_MSC_VER) From 60838dfeac89cebaa19fc2b67a1c2a88cbfaa32e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 15:00:07 +0200 Subject: [PATCH 294/487] Solve more issues in windows python. --- .../py_loader/py_loader_symbol_fallback.h | 19 +++ .../loaders/py_loader/source/py_loader_dict.c | 8 +- .../loaders/py_loader/source/py_loader_impl.c | 34 ++-- .../loaders/py_loader/source/py_loader_port.c | 68 ++++---- .../source/py_loader_symbol_fallback.c | 154 +++++++++++++++++- 5 files changed, 228 insertions(+), 55 deletions(-) diff --git a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h index b4394726c..cc6d00575 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h @@ -34,6 +34,16 @@ extern "C" { PY_LOADER_NO_EXPORT int py_loader_symbol_fallback_initialize(dynlink py_library); #if defined(_WIN32) && defined(_MSC_VER) + #undef PyCFunction_GET_FUNCTION + #define PyCFunction_GET_FUNCTION(func) \ + (((PyCFunctionObject *)func)->m_ml->ml_meth) + + #undef PyCFunction_GET_SELF + #define PyCFunction_GET_SELF(func) \ + (((PyCFunctionObject *)func)->m_ml->ml_flags & METH_STATIC ? \ + NULL : \ + ((PyCFunctionObject *)func)->m_self) + #undef PyBool_Check PY_LOADER_NO_EXPORT int PyBool_Check(const PyObject *ob); #undef PyFloat_Check @@ -48,8 +58,17 @@ PY_LOADER_NO_EXPORT int PyCFunction_Check(const PyObject *ob); PY_LOADER_NO_EXPORT int PyModule_Check(const PyObject *ob); #endif +PY_LOADER_NO_EXPORT PyTypeObject *PyCFunctionTypePtr(void); +PY_LOADER_NO_EXPORT PyTypeObject *PyStaticMethodTypePtr(void); +PY_LOADER_NO_EXPORT PyTypeObject *PyDictProxyTypePtr(void); +PY_LOADER_NO_EXPORT PyTypeObject *PyDictTypePtr(void); PY_LOADER_NO_EXPORT PyTypeObject *PyTypeTypePtr(void); PY_LOADER_NO_EXPORT PyObject *Py_NonePtr(void); +PY_LOADER_NO_EXPORT PyObject *PyExc_ExceptionPtr(void); +PY_LOADER_NO_EXPORT PyObject *PyExc_FileNotFoundErrorPtr(void); +PY_LOADER_NO_EXPORT PyObject *PyExc_TypeErrorPtr(void); +PY_LOADER_NO_EXPORT PyObject *PyExc_ValueErrorPtr(void); +PY_LOADER_NO_EXPORT PyObject *PyExc_RuntimeErrorPtr(void); PY_LOADER_NO_EXPORT PyObject *Py_ReturnNone(void); PY_LOADER_NO_EXPORT PyObject *Py_ReturnFalse(void); PY_LOADER_NO_EXPORT PyObject *Py_ReturnTrue(void); diff --git a/source/loaders/py_loader/source/py_loader_dict.c b/source/loaders/py_loader/source/py_loader_dict.c index 2fc9bd1c7..c68d378aa 100644 --- a/source/loaders/py_loader/source/py_loader_dict.c +++ b/source/loaders/py_loader/source/py_loader_dict.c @@ -52,6 +52,8 @@ #endif #endif +#include <py_loader/py_loader_symbol_fallback.h> + struct py_loader_impl_dict_obj { PyDictObject dict; @@ -144,7 +146,7 @@ PyObject *py_loader_impl_dict_sizeof(struct py_loader_impl_dict_obj *self, void int py_loader_impl_dict_init(struct py_loader_impl_dict_obj *self, PyObject *args, PyObject *kwds) { - if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0) + if (PyDictTypePtr()->tp_init((PyObject *)self, args, kwds) < 0) return -1; self->v = NULL; return 0; @@ -155,13 +157,13 @@ void py_loader_impl_dict_dealloc(struct py_loader_impl_dict_obj *self) metacall_value_destroy(self->v); Py_DECREF(self->parent); /* TODO: Review if this is correct or this line is unnecessary */ - PyDict_Type.tp_dealloc((PyObject *)self); + PyDictTypePtr()->tp_dealloc((PyObject *)self); } int py_loader_impl_dict_type_init(void) { /* py_loader_impl_dict_type is derived from PyDict_Type */ - py_loader_impl_dict_type.tp_base = &PyDict_Type; + py_loader_impl_dict_type.tp_base = PyDictTypePtr(); return PyType_Ready(&py_loader_impl_dict_type); } diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 4fabcffbc..c3012c2a7 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -231,12 +231,12 @@ PyObject *py_loader_impl_finalizer_object_impl(PyObject *self, PyObject *Py_UNUS if (v == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Fatal error destroying a value, the metacall value attached to the python value is null"); - Py_RETURN_NONE; + return Py_ReturnNone(); } value_type_destroy(v); - Py_RETURN_NONE; + return Py_ReturnNone(); } int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v) @@ -1453,7 +1453,7 @@ PyObject *py_loader_impl_value_to_capi(loader_impl impl, type_id id, value v) { /* TODO */ log_write("metacall", LOG_LEVEL_ERROR, "TODO: Python future not implemented yet for arguments"); - Py_RETURN_NONE; + return Py_ReturnNone(); } else if (id == TYPE_FUNCTION) { @@ -1481,7 +1481,7 @@ PyObject *py_loader_impl_value_to_capi(loader_impl impl, type_id id, value v) } else if (id == TYPE_NULL) { - Py_RETURN_NONE; + return Py_ReturnNone(); } else if (id == TYPE_CLASS) { @@ -1539,7 +1539,7 @@ PyObject *py_task_callback_handler_impl(PyObject *self, PyObject *pyfuture) { py_loader_thread_release(); log_write("metacall", LOG_LEVEL_ERROR, "Invalid python capsule in task_callback_handler"); - Py_RETURN_NONE; + return Py_ReturnNone(); } loader_impl_py_await_invoke_callback_state callback_state = PyCapsule_GetPointer(capsule, NULL); @@ -1610,7 +1610,7 @@ PyObject *py_task_callback_handler_impl(PyObject *self, PyObject *pyfuture) if (ret == NULL) { - Py_RETURN_NONE; + return Py_ReturnNone(); } else { @@ -1886,7 +1886,7 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) { log_write("metacall", LOG_LEVEL_ERROR, "Fatal error when invoking a function, state cannot be recovered, avoiding the function call"); py_loader_thread_release(); - Py_RETURN_NONE; + return Py_ReturnNone(); } Py_ssize_t callee_args_size = PyTuple_Size(args); @@ -1897,7 +1897,7 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid allocation of arguments for callback"); py_loader_thread_release(); - Py_RETURN_NONE; + return Py_ReturnNone(); } /* Generate metacall values from python values */ @@ -1946,7 +1946,7 @@ PyObject *py_loader_impl_function_type_invoke(PyObject *self, PyObject *args) return py_ret; } - Py_RETURN_NONE; + return Py_ReturnNone(); } int py_loader_impl_get_builtin_type(loader_impl impl, loader_impl_py py_impl, type_id id, const char *name) @@ -2768,12 +2768,12 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi } /* Hook the deallocation of PyCFunction */ - py_loader_impl_pycfunction_dealloc = PyCFunction_Type.tp_dealloc; - PyCFunction_Type.tp_dealloc = PyCFunction_dealloc; + py_loader_impl_pycfunction_dealloc = PyCFunctionTypePtr()->tp_dealloc; + PyCFunctionTypePtr()->tp_dealloc = PyCFunction_dealloc; /* TODO: This does not work after 3.13, is it really needed for this hook? */ #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 13 - PyType_Modified(&PyCFunction_Type); + PyType_Modified(PyCFunctionTypePtr()); #endif /* Register initialization */ @@ -2997,7 +2997,7 @@ int py_loader_impl_load_from_file_path(loader_impl_py py_impl, loader_impl_py_ha if (!(module->instance != NULL && PyModule_Check(module->instance))) { - if (module->instance != NULL && PyErr_GivenExceptionMatches(module->instance, PyExc_Exception)) + if (module->instance != NULL && PyErr_GivenExceptionMatches(module->instance, PyExc_ExceptionPtr())) { *exception = module->instance; module->instance = NULL; @@ -3054,7 +3054,7 @@ int py_loader_impl_load_from_module(loader_impl_py py_impl, loader_impl_py_handl if (!(module->instance != NULL && PyModule_Check(module->instance))) { - if (module->instance != NULL && PyErr_GivenExceptionMatches(module->instance, PyExc_Exception)) + if (module->instance != NULL && PyErr_GivenExceptionMatches(module->instance, PyExc_ExceptionPtr())) { *exception = module->instance; module->instance = NULL; @@ -3079,7 +3079,7 @@ int py_loader_impl_load_from_module(loader_impl_py py_impl, loader_impl_py_handl int py_loader_impl_import_exception(PyObject *exception) { - return /*PyErr_GivenExceptionMatches(exception, PyExc_ImportError) ||*/ PyErr_GivenExceptionMatches(exception, PyExc_FileNotFoundError); + return /*PyErr_GivenExceptionMatches(exception, PyExc_ImportErrorPtr()) ||*/ PyErr_GivenExceptionMatches(exception, PyExc_FileNotFoundErrorPtr()); } int py_loader_impl_load_from_file_relative(loader_impl_py py_impl, loader_impl_py_handle_module module, const loader_path path, PyObject **exception, int run_main) @@ -3815,7 +3815,7 @@ int py_loader_impl_discover_class(loader_impl impl, PyObject *py_class, klass c) Py_INCREF(tuple_key); PyObject *method_static = PyObject_CallObject(py_impl->inspect_getattr_static, args); Py_DECREF(args); - bool is_static_method = PyObject_TypeCheck(method_static, &PyStaticMethod_Type); + bool is_static_method = PyObject_TypeCheck(method_static, PyStaticMethodTypePtr()); log_write("metacall", LOG_LEVEL_DEBUG, "Introspection: class member %s, type %s, static method: %d", PyUnicode_AsUTF8(tuple_key), @@ -4311,7 +4311,7 @@ int py_loader_impl_destroy(loader_impl impl) if (host == 0) { /* Unhook the deallocation of PyCFunction */ - PyCFunction_Type.tp_dealloc = py_loader_impl_pycfunction_dealloc; + PyCFunctionTypePtr()->tp_dealloc = py_loader_impl_pycfunction_dealloc; } else { diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index 0eb98e756..7f1ad9233 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -43,7 +43,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar /* Parse arguments */ if (!PyArg_ParseTuple(args, (char *)format, &tag, &paths)) { - PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_load_from_file('node', ['script.js']);"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid number of arguments, use it like: metacall_load_from_file('node', ['script.js']);"); return Py_ReturnFalse(); } @@ -53,13 +53,13 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (!PyUnicode_Check(tag)) #endif { - PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); return Py_ReturnFalse(); } if (!PyList_Check(paths)) { - PyErr_SetString(PyExc_TypeError, "Invalid parameter type in second argument (a list of strings indicating the paths must be used)"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid parameter type in second argument (a list of strings indicating the paths must be used)"); return Py_ReturnFalse(); } @@ -67,7 +67,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (paths_size == 0) { - PyErr_SetString(PyExc_TypeError, "At least one path must be included in the paths list"); + PyErr_SetString(PyExc_TypeErrorPtr(), "At least one path must be included in the paths list"); return Py_ReturnFalse(); } @@ -87,7 +87,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (tag_str == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid tag string conversion"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid tag string conversion"); return Py_ReturnFalse(); } @@ -96,7 +96,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (paths_str == NULL) { - PyErr_SetString(PyExc_ValueError, "Invalid argument allocation"); + PyErr_SetString(PyExc_ValueErrorPtr(), "Invalid argument allocation"); return Py_ReturnFalse(); } @@ -131,7 +131,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (str == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid path string conversion"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid path string conversion"); result = Py_ReturnFalse(); goto clear; } @@ -140,7 +140,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (paths_str[iterator] == NULL) { - PyErr_SetString(PyExc_ValueError, "Invalid string path allocation"); + PyErr_SetString(PyExc_ValueErrorPtr(), "Invalid string path allocation"); result = Py_ReturnFalse(); goto clear; } @@ -225,7 +225,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject /* Parse arguments */ if (!PyArg_ParseTuple(args, (char *)format, &tag, &path)) { - PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_load_from_package('cs', ['file.dll']);"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid number of arguments, use it like: metacall_load_from_package('cs', ['file.dll']);"); return Py_ReturnFalse(); } @@ -235,7 +235,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (!PyUnicode_Check(tag)) #endif { - PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); return Py_ReturnFalse(); } @@ -245,7 +245,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (!PyUnicode_Check(path)) #endif { - PyErr_SetString(PyExc_TypeError, "Invalid parameter type in second argument (a string indicating the path must be used)"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid parameter type in second argument (a string indicating the path must be used)"); return Py_ReturnFalse(); } @@ -265,7 +265,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (tag_str == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid tag string conversion"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid tag string conversion"); return Py_ReturnFalse(); } @@ -291,7 +291,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (path_str == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid path string conversion"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid path string conversion"); return Py_ReturnFalse(); } @@ -360,7 +360,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) /* Parse arguments */ if (!PyArg_ParseTuple(args, (char *)format, &tag, &buffer)) { - PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_load_from_memory('node', 'console.log(\"hello\")');"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid number of arguments, use it like: metacall_load_from_memory('node', 'console.log(\"hello\")');"); return Py_ReturnFalse(); } @@ -370,7 +370,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) if (!PyUnicode_Check(tag)) #endif { - PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid parameter type in first argument (a string indicating the tag of the loader must be used: 'node', 'rb', 'ts', 'cs', 'js', 'cob'...)"); return Py_ReturnFalse(); } @@ -380,7 +380,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) if (!PyUnicode_Check(buffer)) #endif { - PyErr_SetString(PyExc_TypeError, "Invalid parameter type in second argument (a string indicating the tag of the loader must be used: 'console.log(\"hello\")')"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid parameter type in second argument (a string indicating the tag of the loader must be used: 'console.log(\"hello\")')"); return Py_ReturnFalse(); } @@ -400,7 +400,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) if (tag_str == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid tag string conversion"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid tag string conversion"); return Py_ReturnFalse(); } @@ -420,7 +420,7 @@ static PyObject *py_loader_port_load_from_memory(PyObject *self, PyObject *args) if (buffer_str == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid buffer string conversion"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid buffer string conversion"); return Py_ReturnFalse(); } @@ -460,7 +460,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) if (var_args_size == 0) { - PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall('function_name', 'asd', 123, [7, 4]);"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid number of arguments, use it like: metacall('function_name', 'asd', 123, [7, 4]);"); return Py_ReturnNone(); } @@ -481,7 +481,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) if (name_str == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid function name string conversion, first parameter must be a string"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid function name string conversion, first parameter must be a string"); return Py_ReturnNone(); } @@ -495,7 +495,7 @@ static PyObject *py_loader_port_invoke(PyObject *self, PyObject *var_args) if (value_args == NULL) { - PyErr_SetString(PyExc_ValueError, "Invalid argument allocation"); + PyErr_SetString(PyExc_ValueErrorPtr(), "Invalid argument allocation"); return Py_ReturnNone(); } @@ -583,7 +583,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) if (var_args_size == 0) { - PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall('function_name', 'asd', 123, [7, 4]);"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid number of arguments, use it like: metacall('function_name', 'asd', 123, [7, 4]);"); return Py_ReturnNone(); } @@ -604,7 +604,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) if (name_str == NULL) { - PyErr_SetString(PyExc_TypeError, "Invalid function name string conversion, first parameter must be a string"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid function name string conversion, first parameter must be a string"); return Py_ReturnNone(); } @@ -618,7 +618,7 @@ static PyObject *py_loader_port_await(PyObject *self, PyObject *var_args) if (value_args == NULL) { - PyErr_SetString(PyExc_ValueError, "Invalid argument allocation"); + PyErr_SetString(PyExc_ValueErrorPtr(), "Invalid argument allocation"); return Py_ReturnNone(); } @@ -710,7 +710,7 @@ static PyObject *py_loader_port_inspect(PyObject *self, PyObject *args) result_str = (char *)empty; size = sizeof(empty); - PyErr_SetString(PyExc_ValueError, "Inspect returned an invalid size or string"); + PyErr_SetString(PyExc_ValueErrorPtr(), "Inspect returned an invalid size or string"); } #if PY_MAJOR_VERSION == 2 @@ -739,13 +739,13 @@ static PyObject *py_loader_port_value_create_ptr(PyObject *self, PyObject *args) /* Parse arguments */ if (!PyArg_ParseTuple(args, (char *)format, &pointer)) { - PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_value_create_ptr(None); or metacall_value_create_ptr(previous_allocated_ptr);"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid number of arguments, use it like: metacall_value_create_ptr(None); or metacall_value_create_ptr(previous_allocated_ptr);"); return Py_ReturnNone(); } if (!PyCapsule_CheckExact(pointer) && pointer != Py_NonePtr()) { - PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument must be None or a PyCapsule (i.e a previously allocated pointer)"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid parameter type in first argument must be None or a PyCapsule (i.e a previously allocated pointer)"); return Py_ReturnNone(); } @@ -786,7 +786,7 @@ static PyObject *py_loader_port_value_reference(PyObject *self, PyObject *args) /* Parse arguments */ if (!PyArg_ParseTuple(args, (char *)format, &obj)) { - PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_value_reference(obj);"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid number of arguments, use it like: metacall_value_reference(obj);"); goto error_none; } @@ -797,7 +797,7 @@ static PyObject *py_loader_port_value_reference(PyObject *self, PyObject *args) if (v == NULL) { - PyErr_SetString(PyExc_ValueError, "Failed to convert the Python object to MetaCall value."); + PyErr_SetString(PyExc_ValueErrorPtr(), "Failed to convert the Python object to MetaCall value."); goto error_none; } @@ -830,14 +830,14 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args /* Parse arguments */ if (!PyArg_ParseTuple(args, (char *)format, &capsule)) { - PyErr_SetString(PyExc_TypeError, "Invalid number of arguments, use it like: metacall_value_dereference(ptr);"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid number of arguments, use it like: metacall_value_dereference(ptr);"); return Py_ReturnNone(); } /* Check if it is a valid reference */ if (!PyCapsule_CheckExact(capsule)) { - PyErr_SetString(PyExc_TypeError, "Invalid parameter type in first argument must be a PyCapsule (i.e a previously allocated pointer)"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid parameter type in first argument must be a PyCapsule (i.e a previously allocated pointer)"); return Py_ReturnNone(); } @@ -846,7 +846,7 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args if (name != py_loader_capsule_reference_id) { - PyErr_SetString(PyExc_TypeError, "Invalid reference, argument must be a PyCapsule from MetaCall"); + PyErr_SetString(PyExc_TypeErrorPtr(), "Invalid reference, argument must be a PyCapsule from MetaCall"); return Py_ReturnNone(); } @@ -865,7 +865,7 @@ static PyObject *py_loader_port_value_dereference(PyObject *self, PyObject *args if (result == NULL) { - PyErr_SetString(PyExc_ValueError, "Failed to convert the MetaCall value to Python object."); + PyErr_SetString(PyExc_ValueErrorPtr(), "Failed to convert the MetaCall value to Python object."); return Py_ReturnNone(); } @@ -883,7 +883,7 @@ static PyObject *py_loader_port_atexit(PyObject *self, PyObject *args) { if (py_loader_impl_destroy(impl) != 0) { - PyErr_SetString(PyExc_RuntimeError, "Failed to destroy Python Loader on MetaCall."); + PyErr_SetString(PyExc_RuntimeErrorPtr(), "Failed to destroy Python Loader on MetaCall."); } } diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index b0ba0c5f7..3c37a442a 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -30,9 +30,17 @@ static PyTypeObject *PyFloat_TypePtr = NULL; static PyTypeObject *PyCapsule_TypePtr = NULL; static PyTypeObject *PyFunction_TypePtr = NULL; static PyTypeObject *PyCFunction_TypePtr = NULL; +static PyTypeObject *PyStaticMethod_TypePtr = NULL; +static PyTypeObject *PyDictProxy_TypePtr = NULL; +static PyTypeObject *PyDict_TypePtr = NULL; static PyTypeObject *PyModule_TypePtr = NULL; static PyTypeObject *PyType_TypePtr = NULL; static PyObject *Py_NoneStructPtr = NULL; +static PyObject *PyExc_ExceptionStructPtr = NULL; +static PyObject *PyExc_FileNotFoundErrorPtr = NULL; +static PyObject *PyExc_TypeErrorStructPtr = NULL; +static PyObject *PyExc_ValueErrorStructPtr = NULL; +static PyObject *PyExc_RuntimeErrorStructPtr = NULL; static PyObject *Py_FalseStructPtr = NULL; static PyObject *Py_TrueStructPtr = NULL; #endif @@ -87,6 +95,30 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) dynlink_symbol_uncast_type(address, PyTypeObject *, PyCFunction_TypePtr); + /* PyStaticMethod_Type */ + if (dynlink_symbol(py_library, "PyStaticMethod_Type", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyStaticMethod_TypePtr); + + /* PyDict_TypePtr */ + if (dynlink_symbol(py_library, "PyDict_TypePtr", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyDict_TypePtrPtr); + + /* PyDictProxy_TypePtr */ + if (dynlink_symbol(py_library, "PyDictProxy_TypePtr", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyTypeObject *, PyDictProxy_TypePtrPtr); + /* PyModule_Type */ if (dynlink_symbol(py_library, "PyModule_Type", &address) != 0) { @@ -111,6 +143,46 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) dynlink_symbol_uncast_type(address, PyObject *, Py_NoneStructPtr); + /* PyExc_Exception */ + if (dynlink_symbol(py_library, "PyExc_Exception", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyObject *, PyExc_ExceptionStructPtr); + + /* PyExc_FileNotFoundError */ + if (dynlink_symbol(py_library, "PyExc_FileNotFoundError", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyObject *, PyExc_FileNotFoundErrorStructPtr); + + /* PyExc_TypeError */ + if (dynlink_symbol(py_library, "PyExc_TypeError", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyObject *, PyExc_TypeErrorStructPtr); + + /* PyExc_ValueError */ + if (dynlink_symbol(py_library, "PyExc_ValueError", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyObject *, PyExc_ValueErrorStructPtr); + + /* PyExc_RuntimeError */ + if (dynlink_symbol(py_library, "PyExc_RuntimeError", &address) != 0) + { + return 1; + } + + dynlink_symbol_uncast_type(address, PyObject *, PyExc_RuntimeErrorStructPtr); + /* Py_False */ if (dynlink_symbol(py_library, "_Py_FalseStruct", &address) != 0) { @@ -166,6 +238,42 @@ int PyModule_Check(const PyObject *ob) } #endif +PyTypeObject *PyCFunctionTypePtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyCFunction_TypePtr; +#else + return &PyCFunction_Type; +#endif +} + +PyTypeObject *PyStaticMethodTypePtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyStaticMethod_TypePtr; +#else + return &PyStaticMethod_Type; +#endif +} + +PyTypeObject *PyDictTypePtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyDict_TypePtr; +#else + return &PyDict_Type; +#endif +} + +PyTypeObject *PyDictProxyTypePtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyDictProxy_TypePtr; +#else + return &PyDictProxy_Type; +#endif +} + PyTypeObject *PyTypeTypePtr(void) { #if defined(_WIN32) && defined(_MSC_VER) @@ -184,6 +292,51 @@ PyObject *Py_NonePtr(void) #endif } +PyObject *PyExc_ExceptionPtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyExc_ExceptionStructPtr; +#else + return PyExc_Exception; +#endif +} + +PyObject *PyExc_FileNotFoundErrorPtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyExc_FileNotFoundErrorStructPtr; +#else + return PyExc_FileNotFoundError; +#endif +} + +PyObject *PyExc_TypeErrorPtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyExc_TypeErrorStructPtr; +#else + return PyExc_TypeError; +#endif +} + +PyObject *PyExc_ValueErrorPtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyExc_ValueErrorStructPtr; +#else + return PyExc_ValueError; +#endif +} + +PyObject *PyExc_RuntimeErrorPtr(void) +{ +#if defined(_WIN32) && defined(_MSC_VER) + return PyExc_RuntimeErrorStructPtr; +#else + return PyExc_RuntimeError; +#endif +} + PyObject *Py_ReturnNone(void) { #if defined(_WIN32) && defined(_MSC_VER) @@ -303,6 +456,5 @@ __attribute__((weak)) PyObject *PyModule_FromDefAndSpec2(PyModuleDef *def, PyObj } #endif - #endif #endif From 4073b9e730c75696de56058eca3e5b112c8e1488 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 15:11:31 +0200 Subject: [PATCH 295/487] Solve more issues in python loader. --- source/loaders/py_loader/source/py_loader_symbol_fallback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 3c37a442a..0d2f41b6a 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -37,7 +37,7 @@ static PyTypeObject *PyModule_TypePtr = NULL; static PyTypeObject *PyType_TypePtr = NULL; static PyObject *Py_NoneStructPtr = NULL; static PyObject *PyExc_ExceptionStructPtr = NULL; -static PyObject *PyExc_FileNotFoundErrorPtr = NULL; +static PyObject *PyExc_FileNotFoundErrorStructPtr = NULL; static PyObject *PyExc_TypeErrorStructPtr = NULL; static PyObject *PyExc_ValueErrorStructPtr = NULL; static PyObject *PyExc_RuntimeErrorStructPtr = NULL; @@ -109,7 +109,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyTypeObject *, PyDict_TypePtrPtr); + dynlink_symbol_uncast_type(address, PyTypeObject *, PyDict_TypePtr); /* PyDictProxy_TypePtr */ if (dynlink_symbol(py_library, "PyDictProxy_TypePtr", &address) != 0) @@ -117,7 +117,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyTypeObject *, PyDictProxy_TypePtrPtr); + dynlink_symbol_uncast_type(address, PyTypeObject *, PyDictProxy_TypePtr); /* PyModule_Type */ if (dynlink_symbol(py_library, "PyModule_Type", &address) != 0) From ee9e64c078073974377a702cca97ab56b6a8539d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 15:20:24 +0200 Subject: [PATCH 296/487] Solve more issues in python loader. --- .../py_loader/include/py_loader/py_loader_symbol_fallback.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h index cc6d00575..43436b723 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h @@ -34,6 +34,10 @@ extern "C" { PY_LOADER_NO_EXPORT int py_loader_symbol_fallback_initialize(dynlink py_library); #if defined(_WIN32) && defined(_MSC_VER) + #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) +extern __declspec(selectany) Py_ssize_t _Py_RefTotal = 0; + #endif + #undef PyCFunction_GET_FUNCTION #define PyCFunction_GET_FUNCTION(func) \ (((PyCFunctionObject *)func)->m_ml->ml_meth) From 8301fef61c38d2bf828b90080a9619d1c82f8926 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 15:27:17 +0200 Subject: [PATCH 297/487] Solve more issues in python loader. --- source/loaders/py_loader/source/py_loader_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index c3012c2a7..e1ba62e93 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -3773,7 +3773,7 @@ int py_loader_impl_discover_class(loader_impl impl, PyObject *py_class, klass c) Py_DECREF(nameobj); /* Turns out __dict__ is not a PyDict but PyMapping */ - if (!PyObject_TypeCheck(read_only_dict, &PyDictProxy_Type)) + if (!PyObject_TypeCheck(read_only_dict, PyDictProxyTypePtr())) { Py_XDECREF(read_only_dict); return 1; From 48f717f0af43708a1f30bf8a760bb1f8946e2edd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 15:36:56 +0200 Subject: [PATCH 298/487] Solve more issues in python loader. --- .../py_loader/py_loader_symbol_fallback.h | 4 - .../loaders/py_loader/source/py_loader_dict.c | 6 +- .../loaders/py_loader/source/py_loader_impl.c | 272 +++++++++--------- .../source/py_loader_symbol_fallback.c | 6 +- .../py_loader/source/py_loader_threading.cpp | 4 +- 5 files changed, 144 insertions(+), 148 deletions(-) diff --git a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h index 43436b723..cc6d00575 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_symbol_fallback.h @@ -34,10 +34,6 @@ extern "C" { PY_LOADER_NO_EXPORT int py_loader_symbol_fallback_initialize(dynlink py_library); #if defined(_WIN32) && defined(_MSC_VER) - #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) -extern __declspec(selectany) Py_ssize_t _Py_RefTotal = 0; - #endif - #undef PyCFunction_GET_FUNCTION #define PyCFunction_GET_FUNCTION(func) \ (((PyCFunctionObject *)func)->m_ml->ml_meth) diff --git a/source/loaders/py_loader/source/py_loader_dict.c b/source/loaders/py_loader/source/py_loader_dict.c index c68d378aa..f78508141 100644 --- a/source/loaders/py_loader/source/py_loader_dict.c +++ b/source/loaders/py_loader/source/py_loader_dict.c @@ -155,7 +155,7 @@ int py_loader_impl_dict_init(struct py_loader_impl_dict_obj *self, PyObject *arg void py_loader_impl_dict_dealloc(struct py_loader_impl_dict_obj *self) { metacall_value_destroy(self->v); - Py_DECREF(self->parent); /* TODO: Review if this is correct or this line is unnecessary */ + Py_DecRef(self->parent); /* TODO: Review if this is correct or this line is unnecessary */ PyDictTypePtr()->tp_dealloc((PyObject *)self); } @@ -176,9 +176,9 @@ PyObject *py_loader_impl_finalizer_wrap_map(PyObject *obj, void *v) union py_loader_impl_dict_cast dict_cast = { &py_loader_impl_dict_type }; PyTuple_SetItem(args, 0, obj); - Py_INCREF(obj); + Py_IncRef(obj); PyObject *wrapper = PyObject_CallObject(dict_cast.object, args); - Py_DECREF(args); + Py_DecRef(args); py_loader_thread_release(); diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index e1ba62e93..e476d1585 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -259,7 +259,7 @@ int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v) if (destructor != NULL) { /* This will destroy the capsule too */ - Py_DECREF(destructor); + Py_DecRef(destructor); } else { @@ -336,7 +336,7 @@ void type_py_interface_destroy(type t, type_impl impl) if (Py_IsInitialized() != 0) { py_loader_thread_acquire(); - Py_DECREF(builtin); + Py_DecRef(builtin); py_loader_thread_release(); } } @@ -463,7 +463,7 @@ int py_object_interface_set(object obj, object_impl impl, struct accessor_type * PyObject *pyvalue = py_loader_impl_value_to_capi(py_object->impl, value_type_id(v), v); int retval = PyObject_GenericSetAttr(pyobject_object, key_py_str, pyvalue); - Py_DECREF(key_py_str); + Py_DecRef(key_py_str); py_loader_thread_release(); @@ -499,7 +499,7 @@ value py_object_interface_method_invoke(object obj, object_impl impl, method m, PyObject *python_object = PyObject_CallMethod(obj_impl->obj, method_name(m), "O", args_tuple, NULL); - Py_DECREF(args_tuple); + Py_DecRef(args_tuple); if (python_object == NULL) { @@ -631,7 +631,7 @@ object py_class_interface_constructor(klass cls, class_impl impl, const char *na /* Calling the class will create an instance (object) */ PyObject *python_object = PyObject_CallObject(py_cls->cls, args_tuple); - Py_DECREF(args_tuple); + Py_DecRef(args_tuple); if (python_object == NULL) { @@ -640,7 +640,7 @@ object py_class_interface_constructor(klass cls, class_impl impl, const char *na return NULL; } - Py_INCREF(py_cls->cls); + Py_IncRef(py_cls->cls); py_loader_thread_release(); py_obj->obj = python_object; @@ -692,7 +692,7 @@ int py_class_interface_static_set(klass cls, class_impl impl, struct accessor_ty PyObject *key_py_str = PyUnicode_FromString(attr_name); int result = PyObject_SetAttr(py_class->cls, key_py_str, py_value); - Py_DECREF(key_py_str); + Py_DecRef(key_py_str); py_loader_thread_release(); @@ -736,8 +736,8 @@ value py_class_interface_static_invoke(klass cls, class_impl impl, method m, cla PyObject *python_object = PyObject_Call(method, args_tuple, NULL); - Py_DECREF(args_tuple); - Py_DECREF(method); + Py_DecRef(args_tuple); + Py_DecRef(method); if (python_object == NULL) { @@ -802,7 +802,7 @@ int py_loader_impl_check_future(loader_impl_py py_impl, PyObject *obj) { PyObject *args_tuple = PyTuple_New(1); - Py_INCREF(obj); + Py_IncRef(obj); PyTuple_SetItem(args_tuple, 0, obj); @@ -822,7 +822,7 @@ int py_loader_impl_check_future(loader_impl_py py_impl, PyObject *obj) int ret = PyObject_IsTrue(result); - Py_DECREF(result); + Py_DecRef(result); return ret; } @@ -843,7 +843,7 @@ int py_loader_impl_check_async(loader_impl_py py_impl, PyObject *func) int ret = PyObject_IsTrue(result); - Py_DECREF(result); + Py_DecRef(result); return ret; } @@ -860,7 +860,7 @@ int py_loader_impl_check_class(loader_impl_py py_impl, PyObject *obj) int result = !(PyObject_IsTrue(is_class) == 1); - Py_DECREF(is_class); + Py_DecRef(is_class); return result; } @@ -1171,7 +1171,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) /* Move finalizers */ value_move(callback, invoke_state->callback); - Py_DECREF(invoke_state_capsule); + Py_DecRef(invoke_state_capsule); return callback; } @@ -1187,7 +1187,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) return NULL; } - Py_INCREF(obj); + Py_IncRef(obj); py_func->func = obj; py_func->impl = impl; @@ -1232,7 +1232,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) py_future->py_impl = py_impl; py_future->future = obj; - Py_INCREF(obj); + Py_IncRef(obj); v = value_create_future(f); } @@ -1240,7 +1240,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) { loader_impl_py_class py_cls = malloc(sizeof(struct loader_impl_py_class_type)); - Py_INCREF(obj); + Py_IncRef(obj); PyObject *qualname = PyObject_GetAttrString(obj, "__qualname__"); klass c = class_create(PyUnicode_AsUTF8(qualname), ACCESSOR_TYPE_STATIC, py_cls, &py_class_interface_singleton); @@ -1264,7 +1264,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) { loader_impl_py_object py_obj = malloc(sizeof(struct loader_impl_py_object_type)); - Py_INCREF(obj); + Py_IncRef(obj); PyObject *object_class = PyObject_Type(obj); /* Increments the class reference count */ @@ -1304,7 +1304,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) v = value_create_ptr(obj); /* Create reference to the value so it does not get garbage collected */ - Py_INCREF(obj); + Py_IncRef(obj); /* Set up finalizer in order to free the value */ value_finalizer(v, &py_loader_impl_value_ptr_finalize, impl); @@ -1508,7 +1508,7 @@ PyObject *py_loader_impl_value_to_capi(loader_impl impl, type_id id, value v) /* TODO: The return value of object_impl_get may not be a loader_impl_py_object, it can be a loader_impl_node_node too */ /* TODO: We must detect if it comes from python and use this method, otherwise we must create the object dynamically */ loader_impl_py_object obj_impl = object_impl_get(obj); - Py_INCREF(obj_impl->obj); + Py_IncRef(obj_impl->obj); if (obj_impl == NULL) { @@ -1543,14 +1543,14 @@ PyObject *py_task_callback_handler_impl(PyObject *self, PyObject *pyfuture) } loader_impl_py_await_invoke_callback_state callback_state = PyCapsule_GetPointer(capsule, NULL); - Py_DECREF(capsule); + Py_DecRef(capsule); /* pyfuture should never raise InvalidStateError exception here */ /* because this is a callback set in Future.add_done_callback */ PyObject *result_str = PyUnicode_FromString("result"); PyObject *result = PyObject_CallMethodObjArgs(pyfuture, result_str, NULL); - Py_DECREF(result_str); + Py_DecRef(result_str); value v = NULL, ret = NULL; @@ -1559,7 +1559,7 @@ PyObject *py_task_callback_handler_impl(PyObject *self, PyObject *pyfuture) type_id id = py_loader_impl_capi_to_value_type(callback_state->impl, result); v = py_loader_impl_capi_to_value(callback_state->impl, result, id); - Py_DECREF(result); + Py_DecRef(result); py_loader_thread_release(); ret = callback_state->resolve_callback(v, callback_state->context); @@ -1600,7 +1600,7 @@ PyObject *py_task_callback_handler_impl(PyObject *self, PyObject *pyfuture) loader_impl impl = callback_state->impl; - Py_DECREF(callback_state->coroutine); + Py_DecRef(callback_state->coroutine); py_loader_thread_release(); @@ -1689,7 +1689,7 @@ function_return function_py_interface_invoke(function func, function_impl impl, type_id id = ret_type == NULL ? py_loader_impl_capi_to_value_type(py_func->impl, result) : type_index(ret_type); v = py_loader_impl_capi_to_value(py_func->impl, result, id); - Py_DECREF(result); + Py_DecRef(result); finalize: py_loader_thread_release(); return v; @@ -1750,7 +1750,7 @@ function_return function_py_interface_await(function func, function_impl impl, f if (args_tuple == NULL) { - Py_DECREF(coroutine); + Py_DecRef(coroutine); goto error; } @@ -1759,8 +1759,8 @@ function_return function_py_interface_await(function func, function_impl impl, f if (callback_state == NULL) { - Py_DECREF(coroutine); - Py_DECREF(args_tuple); + Py_DecRef(coroutine); + Py_DecRef(args_tuple); goto error; } @@ -1774,8 +1774,8 @@ function_return function_py_interface_await(function func, function_impl impl, f if (callback_status == NULL) { - Py_DECREF(coroutine); - Py_DECREF(args_tuple); + Py_DecRef(coroutine); + Py_DecRef(args_tuple); free(callback_state); goto error; } @@ -1783,10 +1783,10 @@ function_return function_py_interface_await(function func, function_impl impl, f /* Create a reference to the function so we avoid to delete it when destroying the event loop */ callback_state->func_val = value_create_function(func); - Py_INCREF(py_impl->asyncio_loop); - Py_INCREF(coroutine); - Py_INCREF(py_impl->py_task_callback_handler); - Py_INCREF(callback_status); + Py_IncRef(py_impl->asyncio_loop); + Py_IncRef(coroutine); + Py_IncRef(py_impl->py_task_callback_handler); + Py_IncRef(callback_status); PyTuple_SetItem(args_tuple, 0, py_impl->asyncio_loop); PyTuple_SetItem(args_tuple, 1, coroutine); @@ -1794,7 +1794,7 @@ function_return function_py_interface_await(function func, function_impl impl, f PyTuple_SetItem(args_tuple, 3, callback_status); pyfuture = PyObject_Call(py_impl->thread_background_send, args_tuple, NULL); - Py_DECREF(args_tuple); + Py_DecRef(args_tuple); /* Variable arguments */ if (args_size > signature_args_size) @@ -1819,8 +1819,8 @@ function_return function_py_interface_await(function func, function_impl impl, f v = py_loader_impl_capi_to_value(py_func->impl, pyfuture, id); - Py_DECREF(pyfuture); - Py_DECREF(tuple_args); + Py_DecRef(pyfuture); + Py_DecRef(tuple_args); py_loader_thread_release(); @@ -1834,7 +1834,7 @@ function_return function_py_interface_await(function func, function_impl impl, f } Py_XDECREF(pyfuture); - Py_DECREF(tuple_args); + Py_DecRef(tuple_args); py_loader_thread_release(); @@ -1975,7 +1975,7 @@ int py_loader_impl_get_builtin_type(loader_impl impl, loader_impl_py py_impl, ty error_define_type: type_destroy(builtin_type); error_create_type: - Py_DECREF(builtin); + Py_DecRef(builtin); error_get_builtin: return 1; } @@ -2043,7 +2043,7 @@ int py_loader_impl_initialize_inspect_types(loader_impl impl, loader_impl_py py_ return 0; error_get_builtin_type: - Py_DECREF(py_impl->builtins_module); + Py_DecRef(py_impl->builtins_module); error_import_module: return 1; } @@ -2095,17 +2095,17 @@ int py_loader_impl_initialize_inspect(loader_impl impl, loader_impl_py py_impl) return 0; } - Py_DECREF(py_impl->inspect_isclass); + Py_DecRef(py_impl->inspect_isclass); error_inspect_isclass: - Py_DECREF(py_impl->inspect_ismethod); + Py_DecRef(py_impl->inspect_ismethod); error_inspect_ismethod: - Py_DECREF(py_impl->inspect_getfullargspec); + Py_DecRef(py_impl->inspect_getfullargspec); error_inspect_getfullargspec: - Py_DECREF(py_impl->inspect_getattr_static); + Py_DecRef(py_impl->inspect_getattr_static); error_inspect_getattr_static: - Py_DECREF(py_impl->inspect_signature); + Py_DecRef(py_impl->inspect_signature); error_inspect_signature: - Py_DECREF(py_impl->inspect_module); + Py_DecRef(py_impl->inspect_module); error_import_module: return 1; } @@ -2115,7 +2115,7 @@ int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl, const int h PyObject *module_name = PyUnicode_DecodeFSDefault("asyncio"); py_impl->asyncio_module = PyImport_Import(module_name); - Py_DECREF(module_name); + Py_DecRef(module_name); if (PyErr_Occurred() != NULL) { @@ -2169,7 +2169,7 @@ int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl, const int h if (host == 1) { PyObject *args_tuple = PyTuple_New(1); - Py_INCREF(py_impl->asyncio_loop); + Py_IncRef(py_impl->asyncio_loop); PyTuple_SetItem(args_tuple, 0, py_impl->asyncio_loop); PyObject_Call(py_impl->thread_background_register_atexit, args_tuple, NULL); Py_XDECREF(args_tuple); @@ -2178,11 +2178,11 @@ int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl, const int h return 0; error_after_py_task_callback_handler: - Py_DECREF(py_impl->py_task_callback_handler); + Py_DecRef(py_impl->py_task_callback_handler); error_after_asyncio_iscoroutinefunction: - Py_DECREF(py_impl->asyncio_iscoroutinefunction); + Py_DecRef(py_impl->asyncio_iscoroutinefunction); error_after_asyncio_module: - Py_DECREF(py_impl->asyncio_module); + Py_DecRef(py_impl->asyncio_module); return 1; } @@ -2210,7 +2210,7 @@ int py_loader_impl_initialize_traceback(loader_impl impl, loader_impl_py py_impl Py_XDECREF(py_impl->traceback_format_exception); error_format_exception: - Py_DECREF(py_impl->traceback_module); + Py_DecRef(py_impl->traceback_module); error_import_module: return 1; } @@ -2244,7 +2244,7 @@ int py_loader_impl_initialize_gc(loader_impl_py py_impl) goto error_callable_check; } - Py_INCREF(py_impl->gc_debug_leak); + Py_IncRef(py_impl->gc_debug_leak); py_impl->gc_debug_stats = PyDict_GetItemString(PyModule_GetDict(py_impl->gc_module), "DEBUG_STATS"); @@ -2253,7 +2253,7 @@ int py_loader_impl_initialize_gc(loader_impl_py py_impl) goto error_debug_leak; } - Py_INCREF(py_impl->gc_debug_stats); + Py_IncRef(py_impl->gc_debug_stats); flags = PyNumber_Or(py_impl->gc_debug_leak, py_impl->gc_debug_stats); @@ -2264,7 +2264,7 @@ int py_loader_impl_initialize_gc(loader_impl_py py_impl) PyObject_CallFunctionObjArgs(py_impl->gc_set_debug, flags, NULL); - Py_DECREF(flags); + Py_DecRef(flags); if (PyErr_Occurred() != NULL) { @@ -2282,7 +2282,7 @@ int py_loader_impl_initialize_gc(loader_impl_py py_impl) error_callable_check: Py_XDECREF(py_impl->gc_set_debug); error_set_debug: - Py_DECREF(py_impl->gc_module); + Py_DecRef(py_impl->gc_module); error_import_module: return 1; } @@ -2378,7 +2378,7 @@ int py_loader_impl_initialize_import(loader_impl_py py_impl) return 0; error_import_function: - Py_DECREF(py_impl->import_module); + Py_DecRef(py_impl->import_module); error_import_compile: py_loader_impl_error_print(py_impl); return 1; @@ -2551,7 +2551,7 @@ int py_loader_impl_initialize_sys_executable(loader_impl_py py_impl) int result = PySys_SetObject("executable", exe_path_obj); - Py_DECREF(exe_path_obj); + Py_DecRef(exe_path_obj); if (result == -1) { @@ -2585,7 +2585,7 @@ int py_loader_impl_initialize_argv(loader_impl_py py_impl, int argc, char **argv int result = PySys_SetObject("argv", list); - Py_DECREF(list); + Py_DecRef(list); if (result == -1) { @@ -2601,7 +2601,7 @@ int py_loader_impl_initialize_argv(loader_impl_py py_impl, int argc, char **argv return 0; error_set_item: - Py_DECREF(list); + Py_DecRef(list); return 1; } @@ -2625,7 +2625,7 @@ static void PyCFunction_dealloc(PyObject *obj) value_type_destroy(invoke_state->callback); py_loader_thread_acquire(); - Py_DECREF(invoke_state_capsule); + Py_DecRef(invoke_state_capsule); PyErr_Restore(error_type, error_value, error_traceback); } @@ -2784,37 +2784,37 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi return py_impl; error_after_asyncio_module: - Py_DECREF(py_impl->asyncio_iscoroutinefunction); - Py_DECREF(py_impl->asyncio_loop); - Py_DECREF(py_impl->asyncio_module); + Py_DecRef(py_impl->asyncio_iscoroutinefunction); + Py_DecRef(py_impl->asyncio_loop); + Py_DecRef(py_impl->asyncio_module); Py_XDECREF(py_impl->py_task_callback_handler); error_after_thread_background_module: - Py_DECREF(py_impl->thread_background_module); - Py_DECREF(py_impl->thread_background_start); - Py_DECREF(py_impl->thread_background_send); - Py_DECREF(py_impl->thread_background_stop); - Py_DECREF(py_impl->thread_background_register_atexit); - Py_DECREF(py_impl->thread_background_future_check); + Py_DecRef(py_impl->thread_background_module); + Py_DecRef(py_impl->thread_background_start); + Py_DecRef(py_impl->thread_background_send); + Py_DecRef(py_impl->thread_background_stop); + Py_DecRef(py_impl->thread_background_register_atexit); + Py_DecRef(py_impl->thread_background_future_check); error_after_import: - Py_DECREF(py_impl->import_module); - Py_DECREF(py_impl->import_function); + Py_DecRef(py_impl->import_module); + Py_DecRef(py_impl->import_function); error_after_inspect: - Py_DECREF(py_impl->inspect_signature); - Py_DECREF(py_impl->inspect_module); - Py_DECREF(py_impl->builtins_module); + Py_DecRef(py_impl->inspect_signature); + Py_DecRef(py_impl->inspect_module); + Py_DecRef(py_impl->builtins_module); error_after_traceback_and_gc: if (traceback_initialized == 0) { - Py_DECREF(py_impl->traceback_format_exception); - Py_DECREF(py_impl->traceback_module); + Py_DecRef(py_impl->traceback_format_exception); + Py_DecRef(py_impl->traceback_module); } #if DEBUG_ENABLED if (gc_initialized == 0) { - Py_DECREF(py_impl->gc_set_debug); - Py_DECREF(py_impl->gc_debug_leak); - Py_DECREF(py_impl->gc_debug_stats); - Py_DECREF(py_impl->gc_module); + Py_DecRef(py_impl->gc_set_debug); + Py_DecRef(py_impl->gc_debug_leak); + Py_DecRef(py_impl->gc_debug_stats); + Py_DecRef(py_impl->gc_module); } #endif error_after_argv: @@ -2864,7 +2864,7 @@ int py_loader_impl_execution_path(loader_impl impl, const loader_path path) #endif clear_current_path: - Py_DECREF(current_path); + Py_DecRef(current_path); py_loader_thread_release(); return result; } @@ -2916,18 +2916,18 @@ void py_loader_impl_module_destroy(loader_impl_py_handle_module module) if (item != NULL) { - Py_DECREF(item); + Py_DecRef(item); PyObject_DelItem(system_modules, module->name); } } - Py_DECREF(module->name); + Py_DecRef(module->name); module->name = NULL; } if (module->instance != NULL) { - Py_DECREF(module->instance); + Py_DecRef(module->instance); module->instance = NULL; } } @@ -2990,8 +2990,8 @@ int py_loader_impl_load_from_file_path(loader_impl_py py_impl, loader_impl_py_ha PyTuple_SetItem(args_tuple, 0, module->name); PyTuple_SetItem(args_tuple, 1, py_path); - Py_INCREF(module->name); - Py_INCREF(py_path); + Py_IncRef(module->name); + Py_IncRef(py_path); module->instance = PyObject_Call(py_impl->import_function, args_tuple, NULL); @@ -3006,15 +3006,15 @@ int py_loader_impl_load_from_file_path(loader_impl_py py_impl, loader_impl_py_ha goto error_module_instance; } - Py_DECREF(args_tuple); - Py_DECREF(py_path); + Py_DecRef(args_tuple); + Py_DecRef(py_path); return 0; error_module_instance: - Py_DECREF(args_tuple); + Py_DecRef(args_tuple); error_tuple_create: - Py_DECREF(py_path); + Py_DecRef(py_path); error_path_create: Py_XDECREF(module->name); module->name = NULL; @@ -3048,7 +3048,7 @@ int py_loader_impl_load_from_module(loader_impl_py py_impl, loader_impl_py_handl } PyTuple_SetItem(args_tuple, 0, module->name); - Py_INCREF(module->name); + Py_IncRef(module->name); module->instance = PyObject_Call(py_impl->import_function, args_tuple, NULL); @@ -3063,13 +3063,13 @@ int py_loader_impl_load_from_module(loader_impl_py py_impl, loader_impl_py_handl goto error_module_instance; } - Py_INCREF(module->instance); - Py_DECREF(args_tuple); + Py_IncRef(module->instance); + Py_DecRef(args_tuple); return 0; error_module_instance: - Py_DECREF(args_tuple); + Py_DecRef(args_tuple); error_tuple_create: Py_XDECREF(module->name); module->name = NULL; @@ -3132,7 +3132,7 @@ static void py_loader_impl_load_from_file_exception(loader_impl_py py_impl, cons PyErr_SetObject(exception_type, exception); - Py_DECREF(exception_type); + Py_DecRef(exception_type); py_loader_impl_error_print(py_impl); @@ -3266,7 +3266,7 @@ PyObject *py_loader_impl_load_from_memory_compile(loader_impl_py py_impl, const PyObject *instance = PyImport_ExecCodeModule(name, compiled); - Py_DECREF(compiled); + Py_DecRef(compiled); return instance; } @@ -3385,7 +3385,7 @@ type py_loader_impl_discover_type(loader_impl impl, PyObject *annotation, const log_write("metacall", LOG_LEVEL_DEBUG, "Discover type (%p) (%p): %s", (void *)annotation, (void *)type_derived(t), annotation_name); } - Py_DECREF(annotation_qualname); + Py_DecRef(annotation_qualname); } return t; @@ -3429,9 +3429,9 @@ size_t py_loader_impl_discover_callable_args_count(loader_impl_py py_impl, PyObj args_count--; } - Py_DECREF(is_method); + Py_DecRef(is_method); clear_spec: - Py_DECREF(spec); /* The elements from the tuple (args) are cleaned here */ + Py_DecRef(spec); /* The elements from the tuple (args) are cleaned here */ unsupported_callable: return args_count; } @@ -3448,9 +3448,9 @@ int py_loader_impl_discover_func(loader_impl impl, PyObject *func, function f) } PyTuple_SetItem(args, 0, func); - Py_INCREF(func); + Py_IncRef(func); PyObject *result = PyObject_CallObject(py_impl->inspect_signature, args); - Py_DECREF(args); + Py_DecRef(args); if (result != NULL) { @@ -3505,7 +3505,7 @@ int py_loader_impl_discover_func(loader_impl impl, PyObject *func, function f) signature_set_return(s, py_loader_impl_discover_type(impl, return_annotation, func_name, NULL)); - Py_DECREF(return_annotation); + Py_DecRef(return_annotation); return 0; } @@ -3546,10 +3546,10 @@ int py_loader_impl_discover_method(loader_impl impl, PyObject *callable, method else { PyTuple_SetItem(args, 0, callable); - Py_INCREF(callable); + Py_IncRef(callable); } PyObject *result = PyObject_CallObject(py_impl->inspect_signature, args); - Py_DECREF(args); + Py_DecRef(args); if (result != NULL) { @@ -3602,7 +3602,7 @@ int py_loader_impl_discover_method(loader_impl impl, PyObject *callable, method signature_set_return(s, py_loader_impl_discover_type(impl, return_annotation, m_name, NULL)); - Py_DECREF(return_annotation); + Py_DecRef(return_annotation); return 0; } @@ -3659,7 +3659,7 @@ type py_loader_impl_get_type(loader_impl impl, PyObject *obj) t = NULL; } - Py_DECREF(t_name); + Py_DecRef(t_name); return t; } @@ -3691,12 +3691,12 @@ int py_loader_impl_discover_constructor(loader_impl impl, PyObject *py_class, kl PyObject *name_init = PyUnicode_FromString("__init__"); PyObject *init_method = PyObject_GenericGetAttr(py_class, name_init); - Py_DECREF(name_init); + Py_DecRef(name_init); PyTuple_SetItem(args, 0, init_method); PyObject *result = PyObject_CallObject(py_impl->inspect_signature, args); - Py_DECREF(args); /* Clears init_method reference */ + Py_DecRef(args); /* Clears init_method reference */ if (result == NULL) { @@ -3770,7 +3770,7 @@ int py_loader_impl_discover_class(loader_impl impl, PyObject *py_class, klass c) { PyObject *nameobj = PyUnicode_FromString("__dict__"); PyObject *read_only_dict = PyObject_GenericGetAttr((PyObject *)py_class, nameobj); - Py_DECREF(nameobj); + Py_DecRef(nameobj); /* Turns out __dict__ is not a PyDict but PyMapping */ if (!PyObject_TypeCheck(read_only_dict, PyDictProxyTypePtr())) @@ -3810,11 +3810,11 @@ int py_loader_impl_discover_class(loader_impl impl, PyObject *py_class, klass c) } PyTuple_SetItem(args, 0, py_class); // class - Py_INCREF(py_class); + Py_IncRef(py_class); PyTuple_SetItem(args, 1, tuple_key); // method - Py_INCREF(tuple_key); + Py_IncRef(tuple_key); PyObject *method_static = PyObject_CallObject(py_impl->inspect_getattr_static, args); - Py_DECREF(args); + Py_DecRef(args); bool is_static_method = PyObject_TypeCheck(method_static, PyStaticMethodTypePtr()); log_write("metacall", LOG_LEVEL_DEBUG, "Introspection: class member %s, type %s, static method: %d", @@ -3831,7 +3831,7 @@ int py_loader_impl_discover_class(loader_impl impl, PyObject *py_class, klass c) { PyObject *func = PyObject_GetAttrString(tuple_val, "__func__"); args_count = py_loader_impl_discover_callable_args_count(py_impl, func); - Py_DECREF(func); + Py_DecRef(func); } else { @@ -3950,7 +3950,7 @@ int py_loader_impl_discover_module(loader_impl impl, PyObject *module, context c loader_impl_py_class py_cls = malloc(sizeof(struct loader_impl_py_class_type)); - Py_INCREF(module_dict_val); + Py_IncRef(module_dict_val); klass c = class_create(cls_name, ACCESSOR_TYPE_STATIC, py_cls, &py_class_interface_singleton); @@ -3987,7 +3987,7 @@ int py_loader_impl_discover_module(loader_impl impl, PyObject *module, context c return 1; } - Py_INCREF(module_dict_val); + Py_IncRef(module_dict_val); py_func->func = module_dict_val; py_func->impl = impl; @@ -4079,7 +4079,7 @@ void py_loader_impl_error_print(loader_impl_py py_impl) log_write("metacall", LOG_LEVEL_ERROR, error_format_str, type_str, value_str, traceback_str ? traceback_str : traceback_not_found); Py_XDECREF(traceback_list); - Py_DECREF(separator); + Py_DecRef(separator); Py_XDECREF(traceback_str_obj); PyErr_Restore(type, value, traceback); @@ -4135,7 +4135,7 @@ value py_loader_impl_error_value_from_exception(loader_impl_py py_impl, PyObject ret = value_create_throwable(th); Py_XDECREF(traceback_list); - Py_DECREF(separator); + Py_DecRef(separator); Py_XDECREF(traceback_str_obj); return ret; @@ -4170,9 +4170,9 @@ void py_loader_impl_gc_print(loader_impl_py py_impl) log_write("metacall", LOG_LEVEL_DEBUG, garbage_format_str, garbage_str); error_garbage_str: - Py_DECREF(garbage_repr); + Py_DecRef(garbage_repr); error_garbage_repr: - Py_DECREF(garbage_list); + Py_DecRef(garbage_list); error_garbage_list: if (PyErr_Occurred() != NULL) { @@ -4255,7 +4255,7 @@ int py_loader_impl_destroy(loader_impl impl) /* Stop event loop for async calls */ { PyObject *args_tuple = PyTuple_New(2); - Py_INCREF(py_impl->asyncio_loop); + Py_IncRef(py_impl->asyncio_loop); PyTuple_SetItem(args_tuple, 0, py_impl->asyncio_loop); /* If it is host, do not join the thread */ PyTuple_SetItem(args_tuple, 1, PyBool_FromLong(!host)); @@ -4272,17 +4272,17 @@ int py_loader_impl_destroy(loader_impl impl) py_loader_thread_destroy(); /* Destroy all Python loader objects */ - Py_DECREF(py_impl->inspect_signature); - Py_DECREF(py_impl->inspect_getattr_static); - Py_DECREF(py_impl->inspect_getfullargspec); - Py_DECREF(py_impl->inspect_ismethod); - Py_DECREF(py_impl->inspect_isclass); - Py_DECREF(py_impl->inspect_module); - Py_DECREF(py_impl->builtins_module); - Py_DECREF(py_impl->traceback_format_exception); - Py_DECREF(py_impl->traceback_module); - Py_DECREF(py_impl->import_function); - Py_DECREF(py_impl->import_module); + Py_DecRef(py_impl->inspect_signature); + Py_DecRef(py_impl->inspect_getattr_static); + Py_DecRef(py_impl->inspect_getfullargspec); + Py_DecRef(py_impl->inspect_ismethod); + Py_DecRef(py_impl->inspect_isclass); + Py_DecRef(py_impl->inspect_module); + Py_DecRef(py_impl->builtins_module); + Py_DecRef(py_impl->traceback_format_exception); + Py_DecRef(py_impl->traceback_module); + Py_DecRef(py_impl->import_function); + Py_DecRef(py_impl->import_module); Py_XDECREF(py_impl->asyncio_iscoroutinefunction); Py_XDECREF(py_impl->asyncio_loop); @@ -4298,10 +4298,10 @@ int py_loader_impl_destroy(loader_impl impl) #if DEBUG_ENABLED { py_loader_impl_gc_print(py_impl); - Py_DECREF(py_impl->gc_set_debug); - Py_DECREF(py_impl->gc_debug_leak); - Py_DECREF(py_impl->gc_debug_stats); - Py_DECREF(py_impl->gc_module); + Py_DecRef(py_impl->gc_set_debug); + Py_DecRef(py_impl->gc_debug_leak); + Py_DecRef(py_impl->gc_debug_stats); + Py_DecRef(py_impl->gc_module); } #endif diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 0d2f41b6a..877145592 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -340,7 +340,7 @@ PyObject *PyExc_RuntimeErrorPtr(void) PyObject *Py_ReturnNone(void) { #if defined(_WIN32) && defined(_MSC_VER) - Py_INCREF(Py_NoneStructPtr); + Py_IncRef(Py_NoneStructPtr); return Py_NoneStructPtr; #else Py_RETURN_NONE; @@ -361,7 +361,7 @@ PyObject *Py_ReturnNone(void) PyObject *Py_ReturnFalse(void) { #if defined(_WIN32) && defined(_MSC_VER) - Py_INCREF(Py_FalseStructPtr); + Py_IncRef(Py_FalseStructPtr); return Py_FalseStructPtr; #else Py_RETURN_FALSE; @@ -371,7 +371,7 @@ PyObject *Py_ReturnFalse(void) PyObject *Py_ReturnTrue(void) { #if defined(_WIN32) && defined(_MSC_VER) - Py_INCREF(Py_TrueStructPtr); + Py_IncRef(Py_TrueStructPtr); return Py_TrueStructPtr; #else Py_RETURN_TRUE; diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index 32b2e1c93..63e5feea0 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -126,7 +126,7 @@ void py_loader_thread_delayed_destroy(PyObject *obj) if (main_thread_id == current_thread_id) { py_loader_thread_acquire(); - Py_DECREF(obj); + Py_DecRef(obj); py_loader_thread_release(); } else @@ -141,7 +141,7 @@ void py_loader_thread_destroy(void) for (auto obj : delayed_destructor) { - Py_DECREF(obj); + Py_DecRef(obj); } py_loader_thread_release(); From 2d87595fb45baeaeefd539383a3a295dd1254e6e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 15:38:12 +0200 Subject: [PATCH 299/487] Remove windows matrix temporally. --- .github/workflows/windows-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 3b0d5dabc..32bab3ef1 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019, windows-2022, windows-2025] + os: [windows-2019] # TODO: windows-2022, windows-2025 options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, From 953165e0ae0c21660c7a79c4f06782cd468e512e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 15:48:25 +0200 Subject: [PATCH 300/487] Remove windows matrix temporally. --- .../loaders/py_loader/source/py_loader_impl.c | 132 +++++++++--------- .../loaders/py_loader/source/py_loader_port.c | 4 +- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index e476d1585..420159b37 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -263,7 +263,7 @@ int py_loader_impl_finalizer_object(loader_impl impl, PyObject *obj, value v) } else { - Py_XDECREF(v_capsule); + Py_DecRef(v_capsule); } py_loader_thread_release(); @@ -441,10 +441,10 @@ value py_object_interface_get(object obj, object_impl impl, struct accessor_type PyObject *pyobject_object = py_object->obj; PyObject *key_py_str = PyUnicode_FromString(attribute_name(accessor->data.attr)); PyObject *generic_attr = PyObject_GenericGetAttr(pyobject_object, key_py_str); - Py_XDECREF(key_py_str); + Py_DecRef(key_py_str); value v = py_loader_impl_capi_to_value(impl, generic_attr, py_loader_impl_capi_to_value_type(py_object->impl, generic_attr)); - Py_XDECREF(generic_attr); + Py_DecRef(generic_attr); py_loader_thread_release(); @@ -508,7 +508,7 @@ value py_object_interface_method_invoke(object obj, object_impl impl, method m, ret = py_loader_impl_capi_to_value(impl, python_object, py_loader_impl_capi_to_value_type(obj_impl->impl, python_object)); - Py_XDECREF(python_object); + Py_DecRef(python_object); release: py_loader_thread_release(); @@ -664,10 +664,10 @@ value py_class_interface_static_get(klass cls, class_impl impl, struct accessor_ PyObject *key_py_str = PyUnicode_FromString(attr_name); PyObject *generic_attr = PyObject_GenericGetAttr(pyobject_class, key_py_str); - Py_XDECREF(key_py_str); + Py_DecRef(key_py_str); value v = py_loader_impl_capi_to_value(impl, generic_attr, py_loader_impl_capi_to_value_type(py_class->impl, generic_attr)); - Py_XDECREF(generic_attr); + Py_DecRef(generic_attr); py_loader_thread_release(); @@ -808,7 +808,7 @@ int py_loader_impl_check_future(loader_impl_py py_impl, PyObject *obj) PyObject *result = PyObject_Call(py_impl->thread_background_future_check, args_tuple, NULL); - Py_XDECREF(args_tuple); + Py_DecRef(args_tuple); if (result == NULL) { @@ -1244,7 +1244,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) PyObject *qualname = PyObject_GetAttrString(obj, "__qualname__"); klass c = class_create(PyUnicode_AsUTF8(qualname), ACCESSOR_TYPE_STATIC, py_cls, &py_class_interface_singleton); - Py_XDECREF(qualname); + Py_DecRef(qualname); py_cls->impl = impl; py_cls->cls = obj; @@ -1274,7 +1274,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) /* So we must avoid calling it's constructor again */ PyObject *repr = PyObject_Repr(obj); object o = object_create(PyUnicode_AsUTF8(repr), ACCESSOR_TYPE_STATIC, py_obj, &py_object_interface_singleton, value_to_class(obj_cls)); - Py_XDECREF(repr); + Py_DecRef(repr); py_obj->impl = impl; py_obj->obj = obj; @@ -1296,7 +1296,7 @@ value py_loader_impl_capi_to_value(loader_impl impl, PyObject *obj, type_id id) v = py_loader_impl_error_value_from_exception(loader_impl_get(impl), (PyObject *)Py_TYPE(obj), obj, tb ? tb : Py_NonePtr()); - Py_XDECREF(tb); + Py_DecRef(tb); } else { @@ -1472,7 +1472,7 @@ PyObject *py_loader_impl_value_to_capi(loader_impl impl, type_id id, value v) invoke_state_capsule = PyCapsule_New(invoke_state, NULL, NULL); - Py_XINCREF(invoke_state_capsule); + Py_IncRef(invoke_state_capsule); /* Set up finalizer in order to free the invoke state */ value_finalizer(invoke_state->callback, &py_loader_impl_value_invoke_state_finalize, invoke_state_capsule); @@ -1583,7 +1583,7 @@ PyObject *py_task_callback_handler_impl(PyObject *self, PyObject *pyfuture) v = py_loader_impl_capi_to_value(callback_state->impl, val, id); } - Py_XDECREF(args); + Py_DecRef(args); PyErr_Clear(); } @@ -1674,7 +1674,7 @@ function_return function_py_interface_invoke(function func, function_impl impl, } } - Py_XDECREF(tuple_args); + Py_DecRef(tuple_args); if (is_var_args) { @@ -1741,7 +1741,7 @@ function_return function_py_interface_await(function func, function_impl impl, f if (coroutine == NULL || PyErr_Occurred() != NULL) { - Py_XDECREF(coroutine); + Py_DecRef(coroutine); goto error; } @@ -1833,7 +1833,7 @@ function_return function_py_interface_await(function func, function_impl impl, f py_loader_impl_error_print(py_impl); } - Py_XDECREF(pyfuture); + Py_DecRef(pyfuture); Py_DecRef(tuple_args); py_loader_thread_release(); @@ -2156,7 +2156,7 @@ int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl, const int h /* Start the asyncio thread */ PyObject *args_tuple = PyTuple_New(0); py_impl->asyncio_loop = PyObject_Call(py_impl->thread_background_start, args_tuple, NULL); - Py_XDECREF(args_tuple); + Py_DecRef(args_tuple); if (py_impl->asyncio_loop == NULL) { @@ -2172,7 +2172,7 @@ int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl, const int h Py_IncRef(py_impl->asyncio_loop); PyTuple_SetItem(args_tuple, 0, py_impl->asyncio_loop); PyObject_Call(py_impl->thread_background_register_atexit, args_tuple, NULL); - Py_XDECREF(args_tuple); + Py_DecRef(args_tuple); } return 0; @@ -2208,7 +2208,7 @@ int py_loader_impl_initialize_traceback(loader_impl impl, loader_impl_py py_impl return 0; } - Py_XDECREF(py_impl->traceback_format_exception); + Py_DecRef(py_impl->traceback_format_exception); error_format_exception: Py_DecRef(py_impl->traceback_module); error_import_module: @@ -2276,11 +2276,11 @@ int py_loader_impl_initialize_gc(loader_impl_py py_impl) error_call_set_debug: py_loader_impl_error_print(py_impl); error_debug_stats: - Py_XDECREF(py_impl->gc_debug_stats); + Py_DecRef(py_impl->gc_debug_stats); error_debug_leak: - Py_XDECREF(py_impl->gc_debug_leak); + Py_DecRef(py_impl->gc_debug_leak); error_callable_check: - Py_XDECREF(py_impl->gc_set_debug); + Py_DecRef(py_impl->gc_set_debug); error_set_debug: Py_DecRef(py_impl->gc_module); error_import_module: @@ -2511,17 +2511,17 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) return 0; error_thread_background_register_atexit: - Py_XDECREF(py_impl->thread_background_register_atexit); + Py_DecRef(py_impl->thread_background_register_atexit); error_thread_background_stop: - Py_XDECREF(py_impl->thread_background_stop); + Py_DecRef(py_impl->thread_background_stop); error_thread_background_send: - Py_XDECREF(py_impl->thread_background_send); + Py_DecRef(py_impl->thread_background_send); error_thread_background_start: - Py_XDECREF(py_impl->thread_background_start); + Py_DecRef(py_impl->thread_background_start); error_thread_background_future_check: - Py_XDECREF(py_impl->thread_background_future_check); + Py_DecRef(py_impl->thread_background_future_check); error_thread_background_compile: - Py_XDECREF(py_impl->thread_background_module); + Py_DecRef(py_impl->thread_background_module); if (PyErr_Occurred() != NULL) { @@ -2787,7 +2787,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi Py_DecRef(py_impl->asyncio_iscoroutinefunction); Py_DecRef(py_impl->asyncio_loop); Py_DecRef(py_impl->asyncio_module); - Py_XDECREF(py_impl->py_task_callback_handler); + Py_DecRef(py_impl->py_task_callback_handler); error_after_thread_background_module: Py_DecRef(py_impl->thread_background_module); Py_DecRef(py_impl->thread_background_start); @@ -3016,7 +3016,7 @@ int py_loader_impl_load_from_file_path(loader_impl_py py_impl, loader_impl_py_ha error_tuple_create: Py_DecRef(py_path); error_path_create: - Py_XDECREF(module->name); + Py_DecRef(module->name); module->name = NULL; error_name_create: return 1; @@ -3071,7 +3071,7 @@ int py_loader_impl_load_from_module(loader_impl_py py_impl, loader_impl_py_handl error_module_instance: Py_DecRef(args_tuple); error_tuple_create: - Py_XDECREF(module->name); + Py_DecRef(module->name); module->name = NULL; error_name_create: return 1; @@ -3246,7 +3246,7 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path py_loader_impl_error_print(py_impl); PyErr_Clear(); } - Py_XDECREF(exception); + Py_DecRef(exception); error_recursive_call: py_loader_thread_release(); py_loader_impl_handle_destroy(py_handle); @@ -3491,15 +3491,15 @@ int py_loader_impl_discover_func(loader_impl impl, PyObject *func, function f) PyObject *annotation = PyObject_GetAttrString(parameter, "annotation"); type t = py_loader_impl_discover_type(impl, annotation, func_name, parameter_name); signature_set(s, iterator, parameter_name, t); - Py_XDECREF(name); - Py_XDECREF(annotation); + Py_DecRef(name); + Py_DecRef(annotation); } } - Py_XDECREF(parameter_list); + Py_DecRef(parameter_list); } - Py_XDECREF(parameters); + Py_DecRef(parameters); function_async(f, py_loader_impl_check_async(py_impl, func) == 1 ? ASYNCHRONOUS : SYNCHRONOUS); @@ -3590,15 +3590,15 @@ int py_loader_impl_discover_method(loader_impl impl, PyObject *callable, method PyObject *annotation = PyObject_GetAttrString(parameter, "annotation"); type t = py_loader_impl_discover_type(impl, annotation, m_name, parameter_name); signature_set(s, iterator, parameter_name, t); - Py_XDECREF(name); - Py_XDECREF(annotation); + Py_DecRef(name); + Py_DecRef(annotation); } } - Py_XDECREF(parameter_list); + Py_DecRef(parameter_list); } - Py_XDECREF(parameters); + Py_DecRef(parameters); signature_set_return(s, py_loader_impl_discover_type(impl, return_annotation, m_name, NULL)); @@ -3664,9 +3664,9 @@ type py_loader_impl_get_type(loader_impl impl, PyObject *obj) } type_name_error: - Py_XDECREF(t_name); + Py_DecRef(t_name); builtin_error: - Py_XDECREF(builtin); + Py_DecRef(builtin); return t; } @@ -3731,8 +3731,8 @@ int py_loader_impl_discover_constructor(loader_impl impl, PyObject *py_class, kl PyObject *annotation = PyObject_GetAttrString(parameter, "annotation"); type t = py_loader_impl_discover_type(impl, annotation, "__init__", parameter_name); constructor_set(ctor, parameter_count++, parameter_name, t); - Py_XDECREF(name); - Py_XDECREF(annotation); + Py_DecRef(name); + Py_DecRef(annotation); } ret = class_register_constructor(c, ctor); @@ -3743,10 +3743,10 @@ int py_loader_impl_discover_constructor(loader_impl impl, PyObject *py_class, kl } } - Py_XDECREF(parameter_list); + Py_DecRef(parameter_list); } - Py_XDECREF(parameters); + Py_DecRef(parameters); return ret; } @@ -3775,7 +3775,7 @@ int py_loader_impl_discover_class(loader_impl impl, PyObject *py_class, klass c) /* Turns out __dict__ is not a PyDict but PyMapping */ if (!PyObject_TypeCheck(read_only_dict, PyDictProxyTypePtr())) { - Py_XDECREF(read_only_dict); + Py_DecRef(read_only_dict); return 1; } @@ -3869,7 +3869,7 @@ int py_loader_impl_discover_class(loader_impl impl, PyObject *py_class, klass c) } /* Delete the reference of the method here instead of in py_method_interface_destroy */ - Py_XDECREF(tuple_val); + Py_DecRef(tuple_val); } else { @@ -3891,8 +3891,8 @@ int py_loader_impl_discover_class(loader_impl impl, PyObject *py_class, klass c) } } - Py_XDECREF(dict_items); - Py_XDECREF(read_only_dict); + Py_DecRef(dict_items); + Py_DecRef(read_only_dict); } return 0; @@ -4078,9 +4078,9 @@ void py_loader_impl_error_print(loader_impl_py py_impl) log_write("metacall", LOG_LEVEL_ERROR, error_format_str, type_str, value_str, traceback_str ? traceback_str : traceback_not_found); - Py_XDECREF(traceback_list); + Py_DecRef(traceback_list); Py_DecRef(separator); - Py_XDECREF(traceback_str_obj); + Py_DecRef(traceback_str_obj); PyErr_Restore(type, value, traceback); } @@ -4134,9 +4134,9 @@ value py_loader_impl_error_value_from_exception(loader_impl_py py_impl, PyObject ret = value_create_throwable(th); - Py_XDECREF(traceback_list); + Py_DecRef(traceback_list); Py_DecRef(separator); - Py_XDECREF(traceback_str_obj); + Py_DecRef(traceback_str_obj); return ret; } @@ -4205,8 +4205,8 @@ void py_loader_impl_sys_path_print(PyObject *sys_path_list) log_write("metacall", LOG_LEVEL_DEBUG, sys_path_format_str, sys_path_str); - Py_XDECREF(sys_path_str_obj); - Py_XDECREF(separator); + Py_DecRef(sys_path_str_obj); + Py_DecRef(separator); } #endif @@ -4260,7 +4260,7 @@ int py_loader_impl_destroy(loader_impl impl) /* If it is host, do not join the thread */ PyTuple_SetItem(args_tuple, 1, PyBool_FromLong(!host)); PyObject_Call(py_impl->thread_background_stop, args_tuple, NULL); - Py_XDECREF(args_tuple); + Py_DecRef(args_tuple); if (PyErr_Occurred() != NULL) { @@ -4284,16 +4284,16 @@ int py_loader_impl_destroy(loader_impl impl) Py_DecRef(py_impl->import_function); Py_DecRef(py_impl->import_module); - Py_XDECREF(py_impl->asyncio_iscoroutinefunction); - Py_XDECREF(py_impl->asyncio_loop); - Py_XDECREF(py_impl->asyncio_module); - Py_XDECREF(py_impl->py_task_callback_handler); - Py_XDECREF(py_impl->thread_background_future_check); - Py_XDECREF(py_impl->thread_background_module); - Py_XDECREF(py_impl->thread_background_start); - Py_XDECREF(py_impl->thread_background_send); - Py_XDECREF(py_impl->thread_background_stop); - Py_XDECREF(py_impl->thread_background_register_atexit); + Py_DecRef(py_impl->asyncio_iscoroutinefunction); + Py_DecRef(py_impl->asyncio_loop); + Py_DecRef(py_impl->asyncio_module); + Py_DecRef(py_impl->py_task_callback_handler); + Py_DecRef(py_impl->thread_background_future_check); + Py_DecRef(py_impl->thread_background_module); + Py_DecRef(py_impl->thread_background_start); + Py_DecRef(py_impl->thread_background_send); + Py_DecRef(py_impl->thread_background_stop); + Py_DecRef(py_impl->thread_background_register_atexit); #if DEBUG_ENABLED { diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index 7f1ad9233..a5bf798ff 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -177,7 +177,7 @@ static PyObject *py_loader_port_load_from_file_impl(PyObject *self, PyObject *ar if (wrapper == NULL) { - Py_XDECREF(result); + Py_DecRef(result); result = Py_ReturnNone(); } else @@ -320,7 +320,7 @@ static PyObject *py_loader_port_load_from_package_impl(PyObject *self, PyObject if (wrapper == NULL) { - Py_XDECREF(result); + Py_DecRef(result); result = Py_ReturnNone(); } else From 6921b218fdb7e98d612f30a41f392f66bc07482a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 16:46:10 +0200 Subject: [PATCH 301/487] Solve more issues from py_loader on windows. --- source/adt/source/adt_map.c | 4 +-- source/adt/source/adt_set.c | 33 +++++++++++++++++-- .../loaders/py_loader/source/py_loader_impl.c | 12 ++++--- .../source/py_loader_symbol_fallback.c | 6 ++-- 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/source/adt/source/adt_map.c b/source/adt/source/adt_map.c index 2f1faaf5c..eb1768d0d 100644 --- a/source/adt/source/adt_map.c +++ b/source/adt/source/adt_map.c @@ -107,9 +107,9 @@ static int map_bucket_rehash(map m, map new_map) size_t index = h % new_map->capacity; - bucket b = &new_map->buckets[index]; + bucket new_bucket = &new_map->buckets[index]; - if (bucket_insert(b, p->key, p->value) != 0) + if (bucket_insert(new_bucket, p->key, p->value) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid map bucket realloc insertion"); return 1; diff --git a/source/adt/source/adt_set.c b/source/adt/source/adt_set.c index 94816c032..2ffd45717 100644 --- a/source/adt/source/adt_set.c +++ b/source/adt/source/adt_set.c @@ -89,6 +89,35 @@ size_t set_size(set s) return 0; } +/* + +static int set_bucket_realloc_iterator(set s, set_key key, set_value value, set_cb_iterate_args args) +{ + set new_set = (set)args; + + if (new_set != s && key != NULL && args != NULL) + { + set_hash h = new_set->hash_cb(key); + + size_t index = h % new_set->capacity; + + bucket b = &new_set->buckets[index]; + + if (bucket_insert(b, key, value) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Invalid set bucket realloc insertion"); + return 1; + } + + ++new_set->count; + + return 0; + } + + return 1; +} +*/ + static int set_bucket_rehash(set s, set new_set) { size_t bucket_iterator, pair_iterator; @@ -107,9 +136,9 @@ static int set_bucket_rehash(set s, set new_set) size_t index = h % new_set->capacity; - bucket b = &new_set->buckets[index]; + bucket new_bucket = &new_set->buckets[index]; - if (bucket_insert(b, p->key, p->value) != 0) + if (bucket_insert(new_bucket, p->key, p->value) != 0) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid set bucket realloc insertion"); return 1; diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 420159b37..2f158da18 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -224,10 +224,12 @@ static void (*py_loader_impl_pycfunction_dealloc)(PyObject *) = NULL; /* Implements PyCapsules with null value internally */ static const char py_loader_capsule_null_id[] = "__metacall_capsule_null__"; -PyObject *py_loader_impl_finalizer_object_impl(PyObject *self, PyObject *Py_UNUSED(args)) +PyObject *py_loader_impl_finalizer_object_impl(PyObject *self, PyObject *args) { value v = PyCapsule_GetPointer(self, NULL); + (void)args; + if (v == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Fatal error destroying a value, the metacall value attached to the python value is null"); @@ -2154,9 +2156,11 @@ int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl, const int h } /* Start the asyncio thread */ - PyObject *args_tuple = PyTuple_New(0); - py_impl->asyncio_loop = PyObject_Call(py_impl->thread_background_start, args_tuple, NULL); - Py_DecRef(args_tuple); + { + PyObject *args_tuple = PyTuple_New(0); + py_impl->asyncio_loop = PyObject_Call(py_impl->thread_background_start, args_tuple, NULL); + Py_DecRef(args_tuple); + } if (py_impl->asyncio_loop == NULL) { diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 877145592..4d915f08d 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -104,7 +104,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) dynlink_symbol_uncast_type(address, PyTypeObject *, PyStaticMethod_TypePtr); /* PyDict_TypePtr */ - if (dynlink_symbol(py_library, "PyDict_TypePtr", &address) != 0) + if (dynlink_symbol(py_library, "PyDict_Type", &address) != 0) { return 1; } @@ -112,7 +112,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) dynlink_symbol_uncast_type(address, PyTypeObject *, PyDict_TypePtr); /* PyDictProxy_TypePtr */ - if (dynlink_symbol(py_library, "PyDictProxy_TypePtr", &address) != 0) + if (dynlink_symbol(py_library, "PyDictProxy_Type", &address) != 0) { return 1; } @@ -125,7 +125,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyTypeObject *, PyCFunction_TypePtr); + dynlink_symbol_uncast_type(address, PyTypeObject *, PyModule_TypePtr); /* PyType_Type */ if (dynlink_symbol(py_library, "PyType_Type", &address) != 0) From 1c6af4b8eda9cc9d7026210d0c248a28ba1e2188 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 18:04:04 +0200 Subject: [PATCH 302/487] Solve python exception issues. --- source/loaders/py_loader/source/py_loader_impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 2f158da18..ca452fd73 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -3001,7 +3001,7 @@ int py_loader_impl_load_from_file_path(loader_impl_py py_impl, loader_impl_py_ha if (!(module->instance != NULL && PyModule_Check(module->instance))) { - if (module->instance != NULL && PyErr_GivenExceptionMatches(module->instance, PyExc_ExceptionPtr())) + if (module->instance != NULL && PyExceptionInstance_Check(module->instance)) { *exception = module->instance; module->instance = NULL; @@ -3058,7 +3058,7 @@ int py_loader_impl_load_from_module(loader_impl_py py_impl, loader_impl_py_handl if (!(module->instance != NULL && PyModule_Check(module->instance))) { - if (module->instance != NULL && PyErr_GivenExceptionMatches(module->instance, PyExc_ExceptionPtr())) + if (module->instance != NULL && PyExceptionInstance_Check(module->instance)) { *exception = module->instance; module->instance = NULL; From 3f1cb6d263370c02480fcb680a3f1a7a05591980 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 31 May 2025 18:53:14 +0200 Subject: [PATCH 303/487] Solve issues with exceptions. --- .../source/py_loader_symbol_fallback.c | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_symbol_fallback.c b/source/loaders/py_loader/source/py_loader_symbol_fallback.c index 4d915f08d..1f5e55ff9 100644 --- a/source/loaders/py_loader/source/py_loader_symbol_fallback.c +++ b/source/loaders/py_loader/source/py_loader_symbol_fallback.c @@ -36,11 +36,11 @@ static PyTypeObject *PyDict_TypePtr = NULL; static PyTypeObject *PyModule_TypePtr = NULL; static PyTypeObject *PyType_TypePtr = NULL; static PyObject *Py_NoneStructPtr = NULL; -static PyObject *PyExc_ExceptionStructPtr = NULL; -static PyObject *PyExc_FileNotFoundErrorStructPtr = NULL; -static PyObject *PyExc_TypeErrorStructPtr = NULL; -static PyObject *PyExc_ValueErrorStructPtr = NULL; -static PyObject *PyExc_RuntimeErrorStructPtr = NULL; +static PyObject **PyExc_ExceptionStructPtr = NULL; +static PyObject **PyExc_FileNotFoundErrorStructPtr = NULL; +static PyObject **PyExc_TypeErrorStructPtr = NULL; +static PyObject **PyExc_ValueErrorStructPtr = NULL; +static PyObject **PyExc_RuntimeErrorStructPtr = NULL; static PyObject *Py_FalseStructPtr = NULL; static PyObject *Py_TrueStructPtr = NULL; #endif @@ -149,7 +149,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyObject *, PyExc_ExceptionStructPtr); + dynlink_symbol_uncast_type(address, PyObject **, PyExc_ExceptionStructPtr); /* PyExc_FileNotFoundError */ if (dynlink_symbol(py_library, "PyExc_FileNotFoundError", &address) != 0) @@ -157,7 +157,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyObject *, PyExc_FileNotFoundErrorStructPtr); + dynlink_symbol_uncast_type(address, PyObject **, PyExc_FileNotFoundErrorStructPtr); /* PyExc_TypeError */ if (dynlink_symbol(py_library, "PyExc_TypeError", &address) != 0) @@ -165,7 +165,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyObject *, PyExc_TypeErrorStructPtr); + dynlink_symbol_uncast_type(address, PyObject **, PyExc_TypeErrorStructPtr); /* PyExc_ValueError */ if (dynlink_symbol(py_library, "PyExc_ValueError", &address) != 0) @@ -173,7 +173,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyObject *, PyExc_ValueErrorStructPtr); + dynlink_symbol_uncast_type(address, PyObject **, PyExc_ValueErrorStructPtr); /* PyExc_RuntimeError */ if (dynlink_symbol(py_library, "PyExc_RuntimeError", &address) != 0) @@ -181,7 +181,7 @@ int py_loader_symbol_fallback_initialize(dynlink py_library) return 1; } - dynlink_symbol_uncast_type(address, PyObject *, PyExc_RuntimeErrorStructPtr); + dynlink_symbol_uncast_type(address, PyObject **, PyExc_RuntimeErrorStructPtr); /* Py_False */ if (dynlink_symbol(py_library, "_Py_FalseStruct", &address) != 0) @@ -295,7 +295,7 @@ PyObject *Py_NonePtr(void) PyObject *PyExc_ExceptionPtr(void) { #if defined(_WIN32) && defined(_MSC_VER) - return PyExc_ExceptionStructPtr; + return *PyExc_ExceptionStructPtr; #else return PyExc_Exception; #endif @@ -304,7 +304,7 @@ PyObject *PyExc_ExceptionPtr(void) PyObject *PyExc_FileNotFoundErrorPtr(void) { #if defined(_WIN32) && defined(_MSC_VER) - return PyExc_FileNotFoundErrorStructPtr; + return *PyExc_FileNotFoundErrorStructPtr; #else return PyExc_FileNotFoundError; #endif @@ -313,7 +313,7 @@ PyObject *PyExc_FileNotFoundErrorPtr(void) PyObject *PyExc_TypeErrorPtr(void) { #if defined(_WIN32) && defined(_MSC_VER) - return PyExc_TypeErrorStructPtr; + return *PyExc_TypeErrorStructPtr; #else return PyExc_TypeError; #endif @@ -322,7 +322,7 @@ PyObject *PyExc_TypeErrorPtr(void) PyObject *PyExc_ValueErrorPtr(void) { #if defined(_WIN32) && defined(_MSC_VER) - return PyExc_ValueErrorStructPtr; + return *PyExc_ValueErrorStructPtr; #else return PyExc_ValueError; #endif @@ -331,7 +331,7 @@ PyObject *PyExc_ValueErrorPtr(void) PyObject *PyExc_RuntimeErrorPtr(void) { #if defined(_WIN32) && defined(_MSC_VER) - return PyExc_RuntimeErrorStructPtr; + return *PyExc_RuntimeErrorStructPtr; #else return PyExc_RuntimeError; #endif From 851d08dcf61749f90b045eac721ca5d39ca286c0 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 01:59:55 +0200 Subject: [PATCH 304/487] Solve issues in py loader windows. --- source/loaders/py_loader/source/py_loader_impl.c | 1 + source/loaders/py_loader/source/py_loader_threading.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index ca452fd73..c31797b88 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2678,6 +2678,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi /* Initialize symbol fallback */ if (py_loader_symbol_fallback_initialize(loader_impl_dependency(impl, "python")) != 0) { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to initialize the Python Loader Symbol Fallback mechanism"); goto error_init_py; } diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index 63e5feea0..ed4e3ea60 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -69,8 +69,10 @@ void py_loader_thread_initialize(const int host) if (host == 1) { + PyGILState_STATE gstate = PyGILState_Ensure(); main_thread_state = PyThreadState_Get(); main_thread_ref_count++; + PyGILState_Release(gstate); } } From 88f2e1cae0e8da5b6ad4d09cd829b68c232fb85f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 02:01:04 +0200 Subject: [PATCH 305/487] Solve issues in windows library path listing. --- source/portability/source/portability_library_path.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index 25cad4a32..221d7a1cc 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -158,7 +158,8 @@ int portability_library_path_find(const char name[], portability_library_path_st { size_t iterator, size = modules_size / sizeof(HMODULE); - for (iterator = 0; iterator < size; ++iterator) + /* Start from 1 so we avoid the executable itself */ + for (iterator = 1; iterator < size; ++iterator) { if (GetModuleFileNameEx(handle_process, handle_modules[iterator], path, PORTABILITY_PATH_SIZE)) { @@ -267,7 +268,8 @@ int portability_library_path_list(portability_library_path_list_cb callback, voi size_t iterator, size = modules_size / sizeof(HMODULE); char module_name[MAX_PATH]; - for (iterator = 0; iterator < size; ++iterator) + /* Start from 1 so we avoid the executable itself */ + for (iterator = 1; iterator < size; ++iterator) { if (GetModuleFileNameExA(process, modules[iterator], module_name, sizeof(module_name) / sizeof(char))) { From e955b5494b97ca288cf2536bc25f38e24e3073a5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 02:12:43 +0200 Subject: [PATCH 306/487] Make rb_loader weakly linked to libruby. --- source/loaders/rb_loader/CMakeLists.txt | 37 +++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/source/loaders/rb_loader/CMakeLists.txt b/source/loaders/rb_loader/CMakeLists.txt index a142dce09..5db103bfb 100644 --- a/source/loaders/rb_loader/CMakeLists.txt +++ b/source/loaders/rb_loader/CMakeLists.txt @@ -14,12 +14,16 @@ if(NOT Ruby_FOUND) return() endif() +# TODO: Search Ruby_LIBRARY_NAME_PATH like in Python? +set(Ruby_LIBRARY_NAME_PATH "${Ruby_LIBRARY_NAME}") +get_filename_component(Ruby_LIBRARY_NAME "${Ruby_LIBRARY_NAME_PATH}" NAME) + # Copy Ruby DLL into project output directory # TODO: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies # TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da -if(WIN32 AND Ruby_LIBRARY_NAME) +if(Ruby_LIBRARY_NAME_PATH AND WIN32) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_OUTPUT_DIR}) - file(COPY "${Ruby_LIBRARY_NAME}" DESTINATION ${PROJECT_OUTPUT_DIR}) + file(COPY "${Ruby_LIBRARY_NAME_PATH}" DESTINATION ${PROJECT_OUTPUT_DIR}) endif() # @@ -142,7 +146,9 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - ${Ruby_LIBRARY} # Ruby library + # Delay load for MSVC + $<$<CXX_COMPILER_ID:MSVC>:${Ruby_LIBRARY}> # Ruby library + $<$<CXX_COMPILER_ID:MSVC>:delayimp> PUBLIC ${DEFAULT_LIBRARIES} @@ -191,6 +197,8 @@ endif() target_link_options(${target} PRIVATE + $<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup> + $<$<CXX_COMPILER_ID:MSVC>:/DELAYLOAD:${Ruby_LIBRARY_NAME_PATH}> PUBLIC ${DEFAULT_LINKER_OPTIONS} @@ -213,10 +221,29 @@ install(TARGETS ${target} # Runtime (pack Ruby DLL in windows) # TODO: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies # TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da -if(WIN32 AND Ruby_LIBRARY_NAME) +set(Ruby_LIBRARY_DEVELOPMENT "${Ruby_LIBRARY_NAME_PATH}") + +if(Ruby_LIBRARY_NAME_PATH AND WIN32) install(FILES - "${Ruby_LIBRARY_NAME}" + "${Ruby_LIBRARY_NAME_PATH}" DESTINATION ${INSTALL_LIB} COMPONENT runtime ) + set(Ruby_LIBRARY_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${Ruby_LIBRARY_NAME}") +else() + set(Ruby_LIBRARY_INSTALL "${Ruby_LIBRARY_NAME_PATH}") endif() + +# +# Configuration +# + +# Development +loader_configuration_begin(rb_loader) +loader_configuration_deps(ruby "${Ruby_LIBRARY_DEVELOPMENT}") +loader_configuartion_end_development() + +# Install +loader_configuration_begin(rb_loader) +loader_configuration_deps(ruby "${Ruby_LIBRARY_INSTALL}") +loader_configuartion_end_install() From 88c20b42230c9591d25d950b748451ae264ec667 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 02:27:52 +0200 Subject: [PATCH 307/487] Solve issue on linux. --- source/loaders/rb_loader/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/loaders/rb_loader/CMakeLists.txt b/source/loaders/rb_loader/CMakeLists.txt index 5db103bfb..d3dd5545f 100644 --- a/source/loaders/rb_loader/CMakeLists.txt +++ b/source/loaders/rb_loader/CMakeLists.txt @@ -15,7 +15,11 @@ if(NOT Ruby_FOUND) endif() # TODO: Search Ruby_LIBRARY_NAME_PATH like in Python? -set(Ruby_LIBRARY_NAME_PATH "${Ruby_LIBRARY_NAME}") +if(Ruby_LIBRARY_NAME) + set(Ruby_LIBRARY_NAME_PATH "${Ruby_LIBRARY_NAME}") +else() + set(Ruby_LIBRARY_NAME_PATH "${Ruby_LIBRARY}") +endif() get_filename_component(Ruby_LIBRARY_NAME "${Ruby_LIBRARY_NAME_PATH}" NAME) # Copy Ruby DLL into project output directory From 153b301bdd41ddb0b4d8e5ae6ee7d5a7bec52601 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 02:42:10 +0200 Subject: [PATCH 308/487] Solve another issue from rb_loader. --- source/configuration/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/configuration/CMakeLists.txt b/source/configuration/CMakeLists.txt index 4e3405db3..18b30a7eb 100644 --- a/source/configuration/CMakeLists.txt +++ b/source/configuration/CMakeLists.txt @@ -195,6 +195,11 @@ function(configurations_write config_dir config_path) set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"py_loader\":\"${config_dir}/py_loader.json\",") endif() + + if(OPTION_BUILD_LOADERS_RB) + set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"rb_loader\":\"${config_dir}/rb_loader.json\",") + endif() + #if(OPTION_BUILD_LOADERS_JS) # set(CONFIGURATION_GLOBAL "${CONFIGURATION_GLOBAL}\n\t\"js_loader\":\"${config_dir}/js_loader.json\",") #endif() From f81f80dd56818a129ea0b89f825a0ecfc8dcd815 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 02:52:43 +0200 Subject: [PATCH 309/487] Remove GC print unless we use sanitizers on python. --- source/loaders/py_loader/source/py_loader_impl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index c31797b88..47ef9b9d5 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -4302,7 +4302,9 @@ int py_loader_impl_destroy(loader_impl impl) #if DEBUG_ENABLED { + #if (defined(__ADDRESS_SANITIZER__) || defined(__MEMORY_SANITIZER__)) py_loader_impl_gc_print(py_impl); + #endif Py_DecRef(py_impl->gc_set_debug); Py_DecRef(py_impl->gc_debug_leak); Py_DecRef(py_impl->gc_debug_stats); From 0cad186d7813e15767a0807099ab69eab3b535cc Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 13:03:56 +0200 Subject: [PATCH 310/487] Update version to v0.9.0. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5c5cbb3b8..899f24fc7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.8 \ No newline at end of file +0.9.0 \ No newline at end of file From ec59057139f684d8e5c185b4c196692d2c88d143 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 21:47:02 +0200 Subject: [PATCH 311/487] Allow PLTHook to be defined by variables. --- source/detours/plthook_detour/CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/detours/plthook_detour/CMakeLists.txt b/source/detours/plthook_detour/CMakeLists.txt index a5db591c1..0907b84fa 100644 --- a/source/detours/plthook_detour/CMakeLists.txt +++ b/source/detours/plthook_detour/CMakeLists.txt @@ -8,17 +8,19 @@ endif() # # PLTHook -include(FetchContent) +if(NOT PLTHook_SOURCE_DIR) + include(FetchContent) -set(PLTHook_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/plthook") + set(PLTHook_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/plthook") -FetchContent_Declare(PLTHook - GIT_REPOSITORY https://github.com/metacall/plthook.git - GIT_TAG master - SOURCE_DIR ${PLTHook_SOURCE_DIR} -) + FetchContent_Declare(PLTHook + GIT_REPOSITORY https://github.com/metacall/plthook.git + GIT_TAG master + SOURCE_DIR ${PLTHook_SOURCE_DIR} + ) -FetchContent_MakeAvailable(PLTHook) + FetchContent_MakeAvailable(PLTHook) +endif() set(PLTHook_INCLUDE_DIR "${PLTHook_SOURCE_DIR}") From f468fc9181e748a2abcf43070585435f89d871bb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sun, 1 Jun 2025 21:47:55 +0200 Subject: [PATCH 312/487] Update version to v0.9.1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 899f24fc7..f514a2f0b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.0 \ No newline at end of file +0.9.1 \ No newline at end of file From 15f6beeffbf93931d282daf083ad094d5ae7caf2 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 00:15:46 +0200 Subject: [PATCH 313/487] Solve issues with ruby loader. --- source/cli/metacallcli/CMakeLists.txt | 15 +++++++++++++++ .../loaders/rb_loader/source/rb_loader_impl.c | 18 +++++++++++++++++- source/scripts/ruby/CMakeLists.txt | 1 + source/scripts/ruby/simplest/CMakeLists.txt | 5 +++++ .../scripts/ruby/simplest/source/simplest.rb | 3 +++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 source/scripts/ruby/simplest/CMakeLists.txt create mode 100644 source/scripts/ruby/simplest/source/simplest.rb diff --git a/source/cli/metacallcli/CMakeLists.txt b/source/cli/metacallcli/CMakeLists.txt index 7d2183283..8067b8e62 100644 --- a/source/cli/metacallcli/CMakeLists.txt +++ b/source/cli/metacallcli/CMakeLists.txt @@ -416,6 +416,21 @@ if(OPTION_BUILD_LOADERS AND OPTION_BUILD_LOADERS_PY) ) endif() +if(OPTION_BUILD_LOADERS AND OPTION_BUILD_LOADERS_RB) + add_test(NAME ${target}-rb-simplest + COMMAND $<TARGET_FILE:${target}> simplest.rb + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + set_tests_properties(${target}-rb-simplest PROPERTIES + LABELS ${target}-rb-simplest + PASS_REGULAR_EXPRESSION "Hello from Ruby" + ) + test_environment_variables(${target}-rb-simplest + "" + ${TESTS_ENVIRONMENT_VARIABLES} + ) +endif() + if(OPTION_BUILD_LOADERS AND OPTION_BUILD_LOADERS_TS AND OPTION_BUILD_SCRIPTS AND OPTION_BUILD_SCRIPTS_TS) add_test(NAME ${target}-ts COMMAND ${CMAKE_COMMAND} -D "EXECUTABLE=$<TARGET_FILE:${target}>" -D "INPUT=${TEST_COMMAND_INPUT}-ts.txt" -P ${TEST_COMMAND_RUNNER} diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index c5139dea9..3c360b256 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -1237,6 +1237,12 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path module_data = rb_loader_impl_load_data(impl, paths[0]); + if (module_data == Qnil) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby module not found: %s", paths[0]); + goto load_error; + } + result = rb_eval_string_protect(StringValuePtr(module_data), &state); if (state != 0) @@ -1246,7 +1252,17 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path goto load_error; } - module_name = rb_funcall(result, rb_intern("name"), 0); + if (result == Qnil) + { + loader_path name; + size_t size = portability_path_get_name(paths[0], strnlen(paths[0], LOADER_PATH_SIZE), name, LOADER_PATH_SIZE); + + module_name = rb_str_new(name, size); + } + else + { + module_name = rb_funcall(result, rb_intern("name"), 0); + } rb_module = rb_loader_impl_create_module(module_name, result, module_data, result); diff --git a/source/scripts/ruby/CMakeLists.txt b/source/scripts/ruby/CMakeLists.txt index 07ca3c848..46dc789cd 100644 --- a/source/scripts/ruby/CMakeLists.txt +++ b/source/scripts/ruby/CMakeLists.txt @@ -21,3 +21,4 @@ add_subdirectory(ducktype) add_subdirectory(invalid) add_subdirectory(klass) add_subdirectory(failempty) +add_subdirectory(simplest) diff --git a/source/scripts/ruby/simplest/CMakeLists.txt b/source/scripts/ruby/simplest/CMakeLists.txt new file mode 100644 index 000000000..ab31b4b0b --- /dev/null +++ b/source/scripts/ruby/simplest/CMakeLists.txt @@ -0,0 +1,5 @@ +# +# Configure ruby project +# + +rb_project(simplest 0.1.0) diff --git a/source/scripts/ruby/simplest/source/simplest.rb b/source/scripts/ruby/simplest/source/simplest.rb new file mode 100644 index 000000000..5adade713 --- /dev/null +++ b/source/scripts/ruby/simplest/source/simplest.rb @@ -0,0 +1,3 @@ +#!/usr/bin/ruby + +print("Hello from Ruby") From be0731ac8abd23a8502cbea3d9e4e0c40f035f79 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 00:18:29 +0200 Subject: [PATCH 314/487] Update version to v0.9.2. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f514a2f0b..f76f91317 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.1 \ No newline at end of file +0.9.2 \ No newline at end of file From 9662d2caa79c58520efef185912a27d92d787d6b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 00:20:42 +0200 Subject: [PATCH 315/487] Update mirror of ruby-mswin. --- tools/metacall-environment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index 35bd79467..741a2810f 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -182,7 +182,7 @@ function Set-Ruby { if (!(Test-Path -Path "$DepsDir\ruby-mswin.7z")) { # Download installer Write-Output "Ruby not found downloading now..." - (New-Object Net.WebClient).DownloadFile("https://github.com/MSP-Greg/ruby-mswin/releases/download/ruby-mswin-builds/Ruby-$RUBY_VERSION-ms.7z", "$DepsDir\ruby-mswin.7z") + (New-Object Net.WebClient).DownloadFile("https://github.com/metacall/ruby-mswin/releases/download/ruby-mswin-builds/Ruby-$RUBY_VERSION-ms.7z", "$DepsDir\ruby-mswin.7z") } mkdir "$DepsDir\Ruby31-ms" From fb5c9ffd7c80c462b485ee1d778b824a5ed818f0 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 01:04:38 +0200 Subject: [PATCH 316/487] Solve more issues. --- source/loaders/py_loader/source/py_loader_impl.c | 4 ++++ source/plugins/backtrace_plugin/CMakeLists.txt | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 47ef9b9d5..4cc86e8a4 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -161,7 +161,9 @@ static value py_loader_impl_error_value(loader_impl_py py_impl); static value py_loader_impl_error_value_from_exception(loader_impl_py py_impl, PyObject *type_obj, PyObject *value_obj, PyObject *traceback_obj); #if DEBUG_ENABLED + #if (defined(__ADDRESS_SANITIZER__) || defined(__MEMORY_SANITIZER__)) static void py_loader_impl_gc_print(loader_impl_py py_impl); + #endif static void py_loader_impl_sys_path_print(PyObject *sys_path_list); #endif @@ -4147,6 +4149,7 @@ value py_loader_impl_error_value_from_exception(loader_impl_py py_impl, PyObject } #if DEBUG_ENABLED + #if (defined(__ADDRESS_SANITIZER__) || defined(__MEMORY_SANITIZER__)) void py_loader_impl_gc_print(loader_impl_py py_impl) { static const char garbage_format_str[] = "Python Garbage Collector:\n%s"; @@ -4184,6 +4187,7 @@ void py_loader_impl_gc_print(loader_impl_py py_impl) py_loader_impl_error_print(py_impl); } } + #endif void py_loader_impl_sys_path_print(PyObject *sys_path_list) { diff --git a/source/plugins/backtrace_plugin/CMakeLists.txt b/source/plugins/backtrace_plugin/CMakeLists.txt index 441fe1b40..acaf00022 100644 --- a/source/plugins/backtrace_plugin/CMakeLists.txt +++ b/source/plugins/backtrace_plugin/CMakeLists.txt @@ -31,6 +31,18 @@ if(NOT BackwardCpp_POPULATED OR NOT BackwardCpp_SOURCE) message(STATUS "BackwardCpp could not be installed, trying to find it on the system") endif() +find_package(Backward + CONFIG + PATHS ${BackwardCpp_SOURCE} +) + +if(NOT BACKWARD_FOUND) + message(WARNING "BackwardCpp could not be found, skipping backtrace plugin compilation") + return() +endif() + +include(${BackwardCpp_SOURCE}/BackwardConfig.cmake) + # # Plugin name and options # @@ -164,7 +176,7 @@ target_link_libraries(${target} PRIVATE ${META_PROJECT_NAME}::metacall # MetaCall library - Backward::Interface # Backward-cpp library + Backward::Backward # Backward-cpp library PUBLIC ${DEFAULT_LIBRARIES} From 19ee89f65af2d89ca4a331545759573507483912 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 01:05:20 +0200 Subject: [PATCH 317/487] Update version to v0.9.3. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f76f91317..b3ec1638f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.2 \ No newline at end of file +0.9.3 \ No newline at end of file From ecf52d5aef255b7337b8e72a4fdc6e5aa5678711 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 18:02:29 +0200 Subject: [PATCH 318/487] Solve issues on ruby port and loader. --- .../loaders/rb_loader/source/rb_loader_impl.c | 6 +-- .../loaders/rb_loader/source/rb_loader_port.c | 40 ++++++++++++++++++- source/ports/rb_port/package/lib/metacall.rb | 13 +++--- source/ports/rb_port/test/run.rb | 29 ++++++-------- 4 files changed, 60 insertions(+), 28 deletions(-) diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 3c360b256..5b4373602 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -1252,17 +1252,13 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path goto load_error; } - if (result == Qnil) + /* Define module name */ { loader_path name; size_t size = portability_path_get_name(paths[0], strnlen(paths[0], LOADER_PATH_SIZE), name, LOADER_PATH_SIZE); module_name = rb_str_new(name, size); } - else - { - module_name = rb_funcall(result, rb_intern("name"), 0); - } rb_module = rb_loader_impl_create_module(module_name, result, module_data, result); diff --git a/source/loaders/rb_loader/source/rb_loader_port.c b/source/loaders/rb_loader/source/rb_loader_port.c index eef87b563..0b3b97c7a 100644 --- a/source/loaders/rb_loader/source/rb_loader_port.c +++ b/source/loaders/rb_loader/source/rb_loader_port.c @@ -175,7 +175,7 @@ VALUE rb_loader_port_metacall(int argc, VALUE *argv, VALUE self) /* Convert the arguments into MetaCall values */ for (iterator = 0; iterator < args_size; ++iterator) { - (void)rb_type_deserialize(rb_loader_impl, argv[iterator], &args[iterator]); + (void)rb_type_deserialize(rb_loader_impl, argv[iterator + 1], &args[iterator]); } /* Execute the call */ @@ -195,6 +195,43 @@ VALUE rb_loader_port_metacall(int argc, VALUE *argv, VALUE self) return rb_type_serialize(result); } +VALUE rb_loader_port_inspect(VALUE self) +{ + VALUE result; + size_t size = 0; + char *result_str = NULL, *inspect_str = NULL; + struct metacall_allocator_std_type std_ctx = { &malloc, &realloc, &free }; + + /* Create the allocator */ + void *allocator = metacall_allocator_create(METACALL_ALLOCATOR_STD, (void *)&std_ctx); + + (void)self; + + /* Retrieve inspect data */ + result_str = inspect_str = metacall_inspect(&size, allocator); + + if (inspect_str == NULL || size == 0) + { + static const char empty[] = "{}"; + + result_str = (char *)empty; + size = sizeof(empty); + + rb_raise(rb_eArgError, "Inspect returned an invalid size or string"); + } + + result = rb_str_new(result_str, size - 1); + + if (inspect_str != NULL && size > 0) + { + metacall_allocator_free(allocator, inspect_str); + } + + metacall_allocator_destroy(allocator); + + return result; +} + int rb_loader_port_initialize(loader_impl impl) { VALUE rb_loader_port; @@ -213,6 +250,7 @@ int rb_loader_port_initialize(loader_impl impl) rb_define_module_function(rb_loader_port, "metacall_load_from_file", rb_loader_port_load_from_file, 2); rb_define_module_function(rb_loader_port, "metacall_load_from_memory", rb_loader_port_load_from_memory, 2); rb_define_module_function(rb_loader_port, "metacall", rb_loader_port_metacall, -1); + rb_define_module_function(rb_loader_port, "metacall_inspect", rb_loader_port_inspect, 0); rb_loader_impl = impl; diff --git a/source/ports/rb_port/package/lib/metacall.rb b/source/ports/rb_port/package/lib/metacall.rb index bb21cd623..ba36cea95 100644 --- a/source/ports/rb_port/package/lib/metacall.rb +++ b/source/ports/rb_port/package/lib/metacall.rb @@ -105,24 +105,25 @@ def metacall_module_load end end + # Initialize the MetaCall Ruby Port + metacall_module_load + public def metacall_load_from_file(tag, paths) - metacall_module_load - MetaCallRbLoaderPort.metacall_load_from_file(tag, paths) end def metacall_load_from_memory(tag, script) - metacall_module_load - MetaCallRbLoaderPort.metacall_load_from_memory(tag, script) end def metacall(function_name, *args) - metacall_module_load - MetaCallRbLoaderPort.metacall(function_name, *args) end + def metacall_inspect() + MetaCallRbLoaderPort.metacall_inspect() + end + end diff --git a/source/ports/rb_port/test/run.rb b/source/ports/rb_port/test/run.rb index 69ead17bd..cba7d6842 100644 --- a/source/ports/rb_port/test/run.rb +++ b/source/ports/rb_port/test/run.rb @@ -7,19 +7,19 @@ class RbPortTest < Test::Unit::TestCase # MetaCall (Python from memory) def test_python_memory - script = '#!/usr/bin/env python3\n' \ - 'def inline_multiply_mem(left: int, right: int) -> int:\n' \ - ' return left * right;\n' - 'def inline_hello(left: int, right: int) -> int:\n' \ - ' print(\'Helloo\', left, \' \', right);\n' - ' return;\n' + script = <<~SCRIPT +def inline_multiply_mem(left: int, right: int) -> int: + return left * right +def inline_hello(left: int, right: int) -> int: + print('Helloo', left, ' ', right) + return left * right +SCRIPT - assert_equal(0, MetaCall.metacall_load_from_memory('py', script)) + assert_equal(0, MetaCall::metacall_load_from_memory('py', script)) - # TODO - # assert_equal(4, MetaCall::metacall('inline_multiply_mem', 2, 2)) + assert_equal(4, MetaCall::metacall('inline_multiply_mem', 2, 2)) - assert_equal(nil, MetaCall::metacall('inline_hello', 10, 20)) + assert_equal(200, MetaCall::metacall('inline_hello', 10, 20)) end # MetaCall (Python) @@ -28,8 +28,7 @@ def test_python assert_equal(nil, MetaCall::metacall('hello')) - # TODO - # assert_equal(35, MetaCall::metacall('multiply', 5, 7)) + assert_equal(35, MetaCall::metacall('multiply', 5, 7)) end # MetaCall (Ruby) @@ -38,11 +37,9 @@ def test_ruby assert_equal(nil, MetaCall::metacall('say_null')) - # TODO - # assert_equal(12, MetaCall::metacall('say_multiply', 3, 4)) + assert_equal(12, MetaCall::metacall('say_multiply', 3, 4)) - # TODO - # assert_equal('Hello world!', MetaCall::metacall('say_hello', 'world')) + assert_equal('Hello world!', MetaCall::metacall('say_hello', 'world')) end end From c6964b631cd986cec5bcd846e0c609b86eaa98e0 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 18:03:33 +0200 Subject: [PATCH 319/487] Update version to v0.9.4. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b3ec1638f..2bd77c74f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.3 \ No newline at end of file +0.9.4 \ No newline at end of file From fbe8bdc84d6108a2001e9264e37d5fe4e041d538 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 18:59:45 +0200 Subject: [PATCH 320/487] Solve issues with ruby loader. --- .../loaders/rb_loader/source/rb_loader_impl.c | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 5b4373602..388e3b2e9 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -1229,7 +1229,7 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path This should run only once, the first time after the initialization */ if (rb_loader_impl_run_main == 0 && size == 1 && strcmp(paths[0], rb_loader_impl_main_module) == 0) { - VALUE module_data, result, module_name; + VALUE module_data, result, module_name, module; int state; loader_impl_rb_module rb_module; @@ -1243,24 +1243,47 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path goto load_error; } + /* Define module name */ + { + loader_path name; + size_t size = portability_path_get_name(paths[0], strnlen(paths[0], LOADER_PATH_SIZE), name, LOADER_PATH_SIZE); + module_name = rb_str_new(name, size - 1); + module_name = rb_funcallv(module_name, rb_intern("capitalize"), 0, NULL); + } + + /* Define module that wraps the code */ + { +#define rb_str_new_static_size(str) rb_str_new_static(str, sizeof(str) - 1) + + VALUE wrapped_code = rb_str_plus(rb_str_new_static_size("module "), module_name); + wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("\n")); + wrapped_code = rb_str_plus(wrapped_code, module_data); + wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("\nend")); + +#undef rb_str_new_static_size + + module_data = wrapped_code; + } + result = rb_eval_string_protect(StringValuePtr(module_data), &state); if (state != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "Ruby evaluation failed"); + log_write("metacall", LOG_LEVEL_ERROR, "Ruby evaluation failed %s", paths[0]); rb_loader_impl_print_exception(); goto load_error; } - /* Define module name */ - { - loader_path name; - size_t size = portability_path_get_name(paths[0], strnlen(paths[0], LOADER_PATH_SIZE), name, LOADER_PATH_SIZE); + /* Get the module reference */ + module = rb_const_get(rb_cObject, rb_intern_str(module_name)); - module_name = rb_str_new(name, size); + if (module == Qnil) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby invalid module generation: %s", paths[0]); + goto load_error; } - rb_module = rb_loader_impl_create_module(module_name, result, module_data, result); + rb_module = rb_loader_impl_create_module(module_name, module, module_data, result); if (rb_module == NULL) { @@ -1296,7 +1319,7 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path } } - // Do not load the handle in case there isn't modules + /* Do not load the handle in case there isn't modules */ if (vector_size(handle->modules) == 0) { log_write("metacall", LOG_LEVEL_ERROR, "No module could be loaded"); From 8f9843479797f5c63f5873d087ea8fe92a52a45a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 2 Jun 2025 19:00:52 +0200 Subject: [PATCH 321/487] Update version to v0.9.5. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2bd77c74f..03834411d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.4 \ No newline at end of file +0.9.5 \ No newline at end of file From c3fc2bcc0e11f84365bc878793c2422884ba9c04 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 3 Jun 2025 22:48:58 +0200 Subject: [PATCH 322/487] Solve issues with sanitizers. --- source/ports/node_port/CMakeLists.txt | 14 +++++++++++++- source/ports/py_port/CMakeLists.txt | 4 +++- source/ports/rb_port/CMakeLists.txt | 14 -------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index abb6d38f1..02f0ef8a8 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -224,10 +224,22 @@ endif() set(node_port_test_exec "${node_port_test}_executable") +# MacOS 14 does not support well NodeJS executable with preloaded sanitizers +if(APPLE) + # Check if NodeJS is compiled with Address Sanitizer + if(OPTION_BUILD_ADDRESS_SANITIZER) + check_asan_executable("${NodeJS_EXECUTABLE}" NodeJS_ASAN) + if(NOT NodeJS_ASAN) + # Skip this test because it gives false positives if NodeJS is not compiled with ASan + return() + endif() + endif() +endif() + message(STATUS "Test ${node_port_test_exec}") add_test(NAME ${node_port_test_exec} - COMMAND ${NodeJS_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.js + COMMAND ${NodeJS_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test.js" ) # Define test labels diff --git a/source/ports/py_port/CMakeLists.txt b/source/ports/py_port/CMakeLists.txt index c41504c73..5bf1d7d38 100644 --- a/source/ports/py_port/CMakeLists.txt +++ b/source/ports/py_port/CMakeLists.txt @@ -84,9 +84,11 @@ if(OPTION_BUILD_ADDRESS_SANITIZER) endif() endif() +message(STATUS "Test ${py_port_test_exec}") + # Add test (Python) add_test(NAME ${py_port_test_exec} - COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py + COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test.py" ) # diff --git a/source/ports/rb_port/CMakeLists.txt b/source/ports/rb_port/CMakeLists.txt index ae034bee7..7a2ad6a76 100644 --- a/source/ports/rb_port/CMakeLists.txt +++ b/source/ports/rb_port/CMakeLists.txt @@ -68,20 +68,6 @@ endif() set(rb_port_test_executable "${rb_port_test}_executable") -# TODO -# if(OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER) -# # TODO: This test fails when run with sanitizers: -# # -# # Sanitizer: -# # ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. -# # For solving the issue compile the test with sanitizers when enabled or preload asan -# # -# # Thread Sanitizer: -# # /usr/local/metacall/build/rb_port_test.rb:4:in `require_relative': /usr/lib/x86_64-linux-gnu/libtsan.so.2: cannot allocate memory in static TLS block - /usr/local/metacall/build/rb_portd.so (LoadError) -# # from /usr/local/metacall/build/rb_port_test.rb:4:in `<main>' -# return() -# endif() - message(STATUS "Test ${rb_port_test_executable}") add_test(NAME ${rb_port_test_executable} From 84bcd1c850ded5b21f6cca4d16bf3a09744b3092 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 3 Jun 2025 22:56:14 +0200 Subject: [PATCH 323/487] Make NPM work in macos. --- tools/metacall-environment.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/metacall-environment.sh b/tools/metacall-environment.sh index 7c2c03a9e..577889af9 100755 --- a/tools/metacall-environment.sh +++ b/tools/metacall-environment.sh @@ -528,6 +528,9 @@ sub_nodejs(){ # Configure NPM path echo "-DNPM_ROOT=$NODE_PREFIX/bin" >> $CMAKE_CONFIG_PATH + # Make npm available for subsequent calls + export PATH="$NODE_PREFIX/bin:$PATH" + # Build either using pre-compiled binaries or building node from source if [ -z "${NodeJS_BUILD_FROM_SOURCE:-}" ]; then # Define node location From ee52a251494590474484311a7367afb6e7f61615 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 3 Jun 2025 23:32:33 +0200 Subject: [PATCH 324/487] Solve more issues on macos. --- source/ports/node_port/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index 02f0ef8a8..cec5ba4f9 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -224,7 +224,8 @@ endif() set(node_port_test_exec "${node_port_test}_executable") -# MacOS 14 does not support well NodeJS executable with preloaded sanitizers +# TODO: Since MacOS 14 with ARM64, it does not support well NodeJS executable with preloaded sanitizers +# The NodeJS initalization fails with: Node Loader failed to hook napi_register_module_v1 if(APPLE) # Check if NodeJS is compiled with Address Sanitizer if(OPTION_BUILD_ADDRESS_SANITIZER) @@ -234,6 +235,15 @@ if(APPLE) return() endif() endif() + + # Check if NodeJS is compiled with Thread Sanitizer + if(OPTION_BUILD_THREAD_SANITIZER) + check_tsan_executable("${NodeJS_EXECUTABLE}" NodeJS_TSAN) + if(NOT NodeJS_TSAN) + # Skip this test because it gives false positives if NodeJS is not compiled with TSan + return() + endif() + endif() endif() message(STATUS "Test ${node_port_test_exec}") From f496108c8c13bffd1b44a98099e5e2ca58c20327 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 3 Jun 2025 23:53:55 +0200 Subject: [PATCH 325/487] Trying to solve issues with linux ubuntu builds. --- docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 6ba78b1cc..f74866582 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,7 @@ services: image: metacall/core:deps container_name: metacall_core_deps build: + network: "host" context: . dockerfile: tools/deps/Dockerfile args: @@ -46,6 +47,7 @@ services: image: metacall/core:dev container_name: metacall_core_dev build: + network: "host" context: . dockerfile: tools/dev/Dockerfile args: @@ -69,6 +71,7 @@ services: image: metacall/core:runtime container_name: metacall_core_runtime build: + network: "host" context: . dockerfile: tools/runtime/Dockerfile args: @@ -92,6 +95,7 @@ services: image: metacall/core:cli container_name: metacall_core_cli build: + network: "host" context: . dockerfile: tools/cli/Dockerfile environment: From 95b0cf76768310d73c3f62f2d92585380255a1bd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 4 Jun 2025 00:32:27 +0200 Subject: [PATCH 326/487] Enable all windows versions again. --- .github/workflows/windows-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 32bab3ef1..3b0d5dabc 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019] # TODO: windows-2022, windows-2025 + os: [windows-2019, windows-2022, windows-2025] options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, From a336cb4d4b451822b395b73cda11dd6e9ceeef53 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 4 Jun 2025 00:47:53 +0200 Subject: [PATCH 327/487] Add release in order to test win. --- .github/workflows/windows-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 3b0d5dabc..984624131 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -32,7 +32,7 @@ jobs: # {build: debug, sanitizer: memory-sanitizer}, # TODO: https://github.com/metacall/core/issues/461 - # {build: release, sanitizer: without-sanitizer} + {build: release, sanitizer: without-sanitizer} ] steps: From 9a0b71d8f5fd2381f52f6e942be07c7133aae60d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 4 Jun 2025 01:21:45 +0200 Subject: [PATCH 328/487] Solve issues with preprocessor on MSVC 2022. --- source/preprocessor/cmake/preprocessor_arguments_body.h.in | 2 +- source/preprocessor/cmake/preprocessor_for_body.h.in | 4 ++-- .../include/preprocessor/preprocessor_arguments.h | 2 +- source/preprocessor/include/preprocessor/preprocessor_for.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/preprocessor/cmake/preprocessor_arguments_body.h.in b/source/preprocessor/cmake/preprocessor_arguments_body.h.in index 86d6d511f..ddb312ed6 100644 --- a/source/preprocessor/cmake/preprocessor_arguments_body.h.in +++ b/source/preprocessor/cmake/preprocessor_arguments_body.h.in @@ -47,7 +47,7 @@ PREPROCESSOR_ARGS_COMMA(PREPROCESSOR_COMMA_VARIADIC __VA_ARGS__ ()) \ ) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) # define PREPROCESSOR_ARGS_COUNT_IMPL(...) \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__) # define PREPROCESSOR_ARGS_COUNT(...) \ diff --git a/source/preprocessor/cmake/preprocessor_for_body.h.in b/source/preprocessor/cmake/preprocessor_for_body.h.in index 57e9977b5..01212df13 100644 --- a/source/preprocessor/cmake/preprocessor_for_body.h.in +++ b/source/preprocessor/cmake/preprocessor_for_body.h.in @@ -18,7 +18,7 @@ expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_1(expr, __VA_ARGS__)) #endif @PREPROCESSOR_FOR_EACH_IMPL_BODY@ -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) # define PREPROCESSOR_FOR_EACH(expr, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ @@ -57,7 +57,7 @@ expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_1(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) #endif @PREPROCESSOR_FOR_IMPL_BODY@ -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) # define PREPROCESSOR_FOR(expr, context, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ diff --git a/source/preprocessor/include/preprocessor/preprocessor_arguments.h b/source/preprocessor/include/preprocessor/preprocessor_arguments.h index c78bc4e06..961c3e2a8 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_arguments.h +++ b/source/preprocessor/include/preprocessor/preprocessor_arguments.h @@ -104,7 +104,7 @@ extern "C" { PREPROCESSOR_ARGS_COMMA(PREPROCESSOR_COMMA_VARIADIC __VA_ARGS__ ()) \ ) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) # define PREPROCESSOR_ARGS_COUNT_IMPL(...) \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__) # define PREPROCESSOR_ARGS_COUNT(...) \ diff --git a/source/preprocessor/include/preprocessor/preprocessor_for.h b/source/preprocessor/include/preprocessor/preprocessor_for.h index 89821d92d..218305eb4 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_for.h +++ b/source/preprocessor/include/preprocessor/preprocessor_for.h @@ -115,7 +115,7 @@ extern "C" { #define PREPROCESSOR_FOR_EACH_IMPL_63(expr, element, ...) expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_62(expr, __VA_ARGS__)) #define PREPROCESSOR_FOR_EACH_IMPL_64(expr, element, ...) expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_63(expr, __VA_ARGS__)) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) # define PREPROCESSOR_FOR_EACH(expr, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ @@ -222,7 +222,7 @@ extern "C" { #define PREPROCESSOR_FOR_IMPL_63(expr, context, iterator, element, ...) expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_62(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) #define PREPROCESSOR_FOR_IMPL_64(expr, context, iterator, element, ...) expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_63(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) # define PREPROCESSOR_FOR(expr, context, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ From 7bab32c2c53290bd46e282882e8ac49dd68d7550 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 4 Jun 2025 01:30:37 +0200 Subject: [PATCH 329/487] Remove release for now in windows. --- .github/workflows/windows-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 984624131..3b0d5dabc 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -32,7 +32,7 @@ jobs: # {build: debug, sanitizer: memory-sanitizer}, # TODO: https://github.com/metacall/core/issues/461 - {build: release, sanitizer: without-sanitizer} + # {build: release, sanitizer: without-sanitizer} ] steps: From 149b968fba856b3b4782c7f924be5a49d68123ae Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 4 Jun 2025 01:30:57 +0200 Subject: [PATCH 330/487] Add error info. --- source/threading/include/threading/threading_atomic.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/threading/include/threading/threading_atomic.h b/source/threading/include/threading/threading_atomic.h index 994ac9757..f5beb243c 100644 --- a/source/threading/include/threading/threading_atomic.h +++ b/source/threading/include/threading/threading_atomic.h @@ -35,8 +35,9 @@ extern "C" { #if __STDC_VERSION__ - 0L >= 201112L /* C11 support */ #if defined(__STDC_NO_ATOMICS__) - /* TODO: C11 atomics not supported, check the platform and implement support if needed */ + /* TODO: Using C11 but atomics not supported, check the platform and implement support if needed */ #define THREADING_ATOMIC 0 + #error "Using C11 but atomics not supported, check the platform and implement support" #elif defined __has_include #if __has_include(<stdatomic.h>) #include <stdatomic.h> @@ -49,6 +50,7 @@ extern "C" { #else /* TODO: C11 is not supported, check the platform and implement support if needed */ #define THREADING_ATOMIC 0 + #error "C11 is not supported, check the platform and implement support" #endif #elif defined(_WIN32) && defined(_MSC_VER) #if (_MSC_VER < 1930) From 1afb052cc1e004c371edfd3a17d6df98d0e6b01e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 4 Jun 2025 01:44:31 +0200 Subject: [PATCH 331/487] Solve issues with threading on windows. --- .../include/threading/threading_atomic.h | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/source/threading/include/threading/threading_atomic.h b/source/threading/include/threading/threading_atomic.h index f5beb243c..26ba7c45b 100644 --- a/source/threading/include/threading/threading_atomic.h +++ b/source/threading/include/threading/threading_atomic.h @@ -31,11 +31,19 @@ extern "C" { /* -- Definitions -- */ -#if defined(__STDC_VERSION__) - #if __STDC_VERSION__ - 0L >= 201112L +#if defined(_WIN32) && defined(_MSC_VER) + #if (_MSC_VER < 1930 || defined(__STDC_NO_ATOMICS__)) + /* Before Visual Studio 2022 atomics are not supported, use fallback solution */ + #include <threading/threading_atomic_win32.h> + #define THREADING_ATOMIC 1 + #else + #include <stdatomic.h> + #define THREADING_ATOMIC 1 + #endif +#elif defined(__STDC_VERSION__) + #if (__STDC_VERSION__ - 0L) >= 201112L /* C11 support */ #if defined(__STDC_NO_ATOMICS__) - /* TODO: Using C11 but atomics not supported, check the platform and implement support if needed */ #define THREADING_ATOMIC 0 #error "Using C11 but atomics not supported, check the platform and implement support" #elif defined __has_include @@ -48,19 +56,9 @@ extern "C" { #define THREADING_ATOMIC 1 #endif #else - /* TODO: C11 is not supported, check the platform and implement support if needed */ #define THREADING_ATOMIC 0 #error "C11 is not supported, check the platform and implement support" #endif -#elif defined(_WIN32) && defined(_MSC_VER) - #if (_MSC_VER < 1930) - /* Before Visual Studio 2022 atomics are not supported, use fallback solution */ - #include <threading/threading_atomic_win32.h> - #define THREADING_ATOMIC 1 - #else - #include <stdatomic.h> - #define THREADING_ATOMIC 1 - #endif #else /* TODO: Unknown compiler and platform, check the platform and compiler, then implement support if needed */ #define THREADING_ATOMIC 0 From b61de760926ebf051dab31e6790d965b3ec43fe1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 9 Jun 2025 14:48:57 +0200 Subject: [PATCH 332/487] Trying to solve issues with preprocessor. --- .../preprocessor/cmake/preprocessor_for_body.h.in | 4 ++-- .../include/preprocessor/preprocessor_for.h | 4 ++-- .../preprocessor_test/source/preprocessor_test.cpp | 13 +++++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/source/preprocessor/cmake/preprocessor_for_body.h.in b/source/preprocessor/cmake/preprocessor_for_body.h.in index 01212df13..2573bb7e7 100644 --- a/source/preprocessor/cmake/preprocessor_for_body.h.in +++ b/source/preprocessor/cmake/preprocessor_for_body.h.in @@ -24,7 +24,7 @@ PREPROCESSOR_EMPTY_SYMBOL(), \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__, \ @PREPROCESSOR_FOR_EACH_IMPL_GNUC_BODY@\ - PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__)) + PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__, ~)) #elif defined(_MSC_VER) && !defined(__clang__) # define PREPROCESSOR_FOR_EACH_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_EACH_IMPL_, count) @@ -63,7 +63,7 @@ PREPROCESSOR_EMPTY_SYMBOL(), \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__, \ @PREPROCESSOR_FOR_IMPL_GNUC_BODY@\ - PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__)) + PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__, ~)) #elif defined(_MSC_VER) && !defined(__clang__) # define PREPROCESSOR_FOR_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_IMPL_, count) diff --git a/source/preprocessor/include/preprocessor/preprocessor_for.h b/source/preprocessor/include/preprocessor/preprocessor_for.h index 218305eb4..d41947fc9 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_for.h +++ b/source/preprocessor/include/preprocessor/preprocessor_for.h @@ -127,7 +127,7 @@ extern "C" { PREPROCESSOR_FOR_EACH_IMPL_29, PREPROCESSOR_FOR_EACH_IMPL_28, PREPROCESSOR_FOR_EACH_IMPL_27, PREPROCESSOR_FOR_EACH_IMPL_26, PREPROCESSOR_FOR_EACH_IMPL_25, PREPROCESSOR_FOR_EACH_IMPL_24, PREPROCESSOR_FOR_EACH_IMPL_23, PREPROCESSOR_FOR_EACH_IMPL_22, PREPROCESSOR_FOR_EACH_IMPL_21, PREPROCESSOR_FOR_EACH_IMPL_20, \ PREPROCESSOR_FOR_EACH_IMPL_19, PREPROCESSOR_FOR_EACH_IMPL_18, PREPROCESSOR_FOR_EACH_IMPL_17, PREPROCESSOR_FOR_EACH_IMPL_16, PREPROCESSOR_FOR_EACH_IMPL_15, PREPROCESSOR_FOR_EACH_IMPL_14, PREPROCESSOR_FOR_EACH_IMPL_13, PREPROCESSOR_FOR_EACH_IMPL_12, PREPROCESSOR_FOR_EACH_IMPL_11, PREPROCESSOR_FOR_EACH_IMPL_10, \ PREPROCESSOR_FOR_EACH_IMPL_9, PREPROCESSOR_FOR_EACH_IMPL_8, PREPROCESSOR_FOR_EACH_IMPL_7, PREPROCESSOR_FOR_EACH_IMPL_6, PREPROCESSOR_FOR_EACH_IMPL_5, PREPROCESSOR_FOR_EACH_IMPL_4, PREPROCESSOR_FOR_EACH_IMPL_3, PREPROCESSOR_FOR_EACH_IMPL_2, PREPROCESSOR_FOR_EACH_IMPL_1, \ - PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__)) + PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__, ~)) #elif defined(_MSC_VER) && !defined(__clang__) # define PREPROCESSOR_FOR_EACH_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_EACH_IMPL_, count) @@ -234,7 +234,7 @@ extern "C" { PREPROCESSOR_FOR_IMPL_29, PREPROCESSOR_FOR_IMPL_28, PREPROCESSOR_FOR_IMPL_27, PREPROCESSOR_FOR_IMPL_26, PREPROCESSOR_FOR_IMPL_25, PREPROCESSOR_FOR_IMPL_24, PREPROCESSOR_FOR_IMPL_23, PREPROCESSOR_FOR_IMPL_22, PREPROCESSOR_FOR_IMPL_21, PREPROCESSOR_FOR_IMPL_20, \ PREPROCESSOR_FOR_IMPL_19, PREPROCESSOR_FOR_IMPL_18, PREPROCESSOR_FOR_IMPL_17, PREPROCESSOR_FOR_IMPL_16, PREPROCESSOR_FOR_IMPL_15, PREPROCESSOR_FOR_IMPL_14, PREPROCESSOR_FOR_IMPL_13, PREPROCESSOR_FOR_IMPL_12, PREPROCESSOR_FOR_IMPL_11, PREPROCESSOR_FOR_IMPL_10, \ PREPROCESSOR_FOR_IMPL_9, PREPROCESSOR_FOR_IMPL_8, PREPROCESSOR_FOR_IMPL_7, PREPROCESSOR_FOR_IMPL_6, PREPROCESSOR_FOR_IMPL_5, PREPROCESSOR_FOR_IMPL_4, PREPROCESSOR_FOR_IMPL_3, PREPROCESSOR_FOR_IMPL_2, PREPROCESSOR_FOR_IMPL_1, \ - PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__)) + PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__, ~)) #elif defined(_MSC_VER) && !defined(__clang__) # define PREPROCESSOR_FOR_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_IMPL_, count) diff --git a/source/tests/preprocessor_test/source/preprocessor_test.cpp b/source/tests/preprocessor_test/source/preprocessor_test.cpp index 80d4bad37..75b6529b8 100644 --- a/source/tests/preprocessor_test/source/preprocessor_test.cpp +++ b/source/tests/preprocessor_test/source/preprocessor_test.cpp @@ -179,6 +179,19 @@ TEST_F(preprocessor_test, if) EXPECT_NE((int)0, PREPROCESSOR_IF(0, (int)0, (int)1)); } +TEST_F(preprocessor_test, if_va_args) +{ +#define PREPROCESSOR_TEST_IF_VA_ARGS(A, B, C, ...) \ + PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), 1, 0) + + EXPECT_EQ((int)1, (int)PREPROCESSOR_TEST_IF_VA_ARGS(A, B, C)); + EXPECT_EQ((int)0, (int)PREPROCESSOR_TEST_IF_VA_ARGS(A, B, C, D)); + EXPECT_EQ((int)0, (int)PREPROCESSOR_TEST_IF_VA_ARGS(A, B, C, D, E)); + EXPECT_EQ((int)0, (int)PREPROCESSOR_TEST_IF_VA_ARGS(A, B, C, D, E, F)); + +#undef PREPROCESSOR_TEST_IF_VA_ARGS +} + TEST_F(preprocessor_test, serial) { #define PREPROCSSOR_TEST_SERIAL_TAG abc From 0b27ee2ad6ab6c4d1a7f54204fd12a91b44399c8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 9 Jun 2025 15:56:13 +0300 Subject: [PATCH 333/487] Revert "Trying to solve issues with preprocessor." This reverts commit b61de760926ebf051dab31e6790d965b3ec43fe1. --- source/preprocessor/cmake/preprocessor_for_body.h.in | 4 ++-- source/preprocessor/include/preprocessor/preprocessor_for.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/preprocessor/cmake/preprocessor_for_body.h.in b/source/preprocessor/cmake/preprocessor_for_body.h.in index 2573bb7e7..01212df13 100644 --- a/source/preprocessor/cmake/preprocessor_for_body.h.in +++ b/source/preprocessor/cmake/preprocessor_for_body.h.in @@ -24,7 +24,7 @@ PREPROCESSOR_EMPTY_SYMBOL(), \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__, \ @PREPROCESSOR_FOR_EACH_IMPL_GNUC_BODY@\ - PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__, ~)) + PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__)) #elif defined(_MSC_VER) && !defined(__clang__) # define PREPROCESSOR_FOR_EACH_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_EACH_IMPL_, count) @@ -63,7 +63,7 @@ PREPROCESSOR_EMPTY_SYMBOL(), \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__, \ @PREPROCESSOR_FOR_IMPL_GNUC_BODY@\ - PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__, ~)) + PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__)) #elif defined(_MSC_VER) && !defined(__clang__) # define PREPROCESSOR_FOR_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_IMPL_, count) diff --git a/source/preprocessor/include/preprocessor/preprocessor_for.h b/source/preprocessor/include/preprocessor/preprocessor_for.h index d41947fc9..218305eb4 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_for.h +++ b/source/preprocessor/include/preprocessor/preprocessor_for.h @@ -127,7 +127,7 @@ extern "C" { PREPROCESSOR_FOR_EACH_IMPL_29, PREPROCESSOR_FOR_EACH_IMPL_28, PREPROCESSOR_FOR_EACH_IMPL_27, PREPROCESSOR_FOR_EACH_IMPL_26, PREPROCESSOR_FOR_EACH_IMPL_25, PREPROCESSOR_FOR_EACH_IMPL_24, PREPROCESSOR_FOR_EACH_IMPL_23, PREPROCESSOR_FOR_EACH_IMPL_22, PREPROCESSOR_FOR_EACH_IMPL_21, PREPROCESSOR_FOR_EACH_IMPL_20, \ PREPROCESSOR_FOR_EACH_IMPL_19, PREPROCESSOR_FOR_EACH_IMPL_18, PREPROCESSOR_FOR_EACH_IMPL_17, PREPROCESSOR_FOR_EACH_IMPL_16, PREPROCESSOR_FOR_EACH_IMPL_15, PREPROCESSOR_FOR_EACH_IMPL_14, PREPROCESSOR_FOR_EACH_IMPL_13, PREPROCESSOR_FOR_EACH_IMPL_12, PREPROCESSOR_FOR_EACH_IMPL_11, PREPROCESSOR_FOR_EACH_IMPL_10, \ PREPROCESSOR_FOR_EACH_IMPL_9, PREPROCESSOR_FOR_EACH_IMPL_8, PREPROCESSOR_FOR_EACH_IMPL_7, PREPROCESSOR_FOR_EACH_IMPL_6, PREPROCESSOR_FOR_EACH_IMPL_5, PREPROCESSOR_FOR_EACH_IMPL_4, PREPROCESSOR_FOR_EACH_IMPL_3, PREPROCESSOR_FOR_EACH_IMPL_2, PREPROCESSOR_FOR_EACH_IMPL_1, \ - PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__, ~)) + PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__)) #elif defined(_MSC_VER) && !defined(__clang__) # define PREPROCESSOR_FOR_EACH_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_EACH_IMPL_, count) @@ -234,7 +234,7 @@ extern "C" { PREPROCESSOR_FOR_IMPL_29, PREPROCESSOR_FOR_IMPL_28, PREPROCESSOR_FOR_IMPL_27, PREPROCESSOR_FOR_IMPL_26, PREPROCESSOR_FOR_IMPL_25, PREPROCESSOR_FOR_IMPL_24, PREPROCESSOR_FOR_IMPL_23, PREPROCESSOR_FOR_IMPL_22, PREPROCESSOR_FOR_IMPL_21, PREPROCESSOR_FOR_IMPL_20, \ PREPROCESSOR_FOR_IMPL_19, PREPROCESSOR_FOR_IMPL_18, PREPROCESSOR_FOR_IMPL_17, PREPROCESSOR_FOR_IMPL_16, PREPROCESSOR_FOR_IMPL_15, PREPROCESSOR_FOR_IMPL_14, PREPROCESSOR_FOR_IMPL_13, PREPROCESSOR_FOR_IMPL_12, PREPROCESSOR_FOR_IMPL_11, PREPROCESSOR_FOR_IMPL_10, \ PREPROCESSOR_FOR_IMPL_9, PREPROCESSOR_FOR_IMPL_8, PREPROCESSOR_FOR_IMPL_7, PREPROCESSOR_FOR_IMPL_6, PREPROCESSOR_FOR_IMPL_5, PREPROCESSOR_FOR_IMPL_4, PREPROCESSOR_FOR_IMPL_3, PREPROCESSOR_FOR_IMPL_2, PREPROCESSOR_FOR_IMPL_1, \ - PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__, ~)) + PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__)) #elif defined(_MSC_VER) && !defined(__clang__) # define PREPROCESSOR_FOR_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_IMPL_, count) From c4ba42eb7de8a039ab71a9754f99e9933522fdcd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 9 Jun 2025 20:06:45 +0200 Subject: [PATCH 334/487] Trying to solve preprocessor issues. --- cmake/CompileOptions.cmake | 9 +++++++++ .../preprocessor/cmake/preprocessor_arguments_body.h.in | 2 +- source/preprocessor/cmake/preprocessor_for_body.h.in | 4 ++-- .../include/preprocessor/preprocessor_arguments.h | 2 +- .../preprocessor/include/preprocessor/preprocessor_for.h | 4 ++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index 1718b84d7..57e66a0ac 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -300,6 +300,15 @@ if(WIN32 AND MSVC) #add_compile_options(/wd4251 /wd4592) #add_compile_options(/ZH:SHA_256) # use SHA256 for generating hashes of compiler processed source files. + # TODO: Preprocessor library not working after MSVC 2019 because they have replaced the implementation + # It seems they wanted to make it work as C99 standard but still seems to be problematic. + # The bug comes from multiple macros from preprocessor library, for more information here is the whole information: + # https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview?view=msvc-170#rescanning-replacement-list-for-macros + # As a workaround, we disable the new preprocessor. + if(MSVC_VERSION GREATER_EQUAL 1930) + add_compile_options(/Zc:preprocessor-) + endif() + if(CMAKE_BUILD_TYPE STREQUAL "Debug") # Disable optimizations add_compile_options(/Od) diff --git a/source/preprocessor/cmake/preprocessor_arguments_body.h.in b/source/preprocessor/cmake/preprocessor_arguments_body.h.in index ddb312ed6..86d6d511f 100644 --- a/source/preprocessor/cmake/preprocessor_arguments_body.h.in +++ b/source/preprocessor/cmake/preprocessor_arguments_body.h.in @@ -47,7 +47,7 @@ PREPROCESSOR_ARGS_COMMA(PREPROCESSOR_COMMA_VARIADIC __VA_ARGS__ ()) \ ) -#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) +#if defined(__GNUC__) || defined(__clang__) # define PREPROCESSOR_ARGS_COUNT_IMPL(...) \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__) # define PREPROCESSOR_ARGS_COUNT(...) \ diff --git a/source/preprocessor/cmake/preprocessor_for_body.h.in b/source/preprocessor/cmake/preprocessor_for_body.h.in index 01212df13..57e9977b5 100644 --- a/source/preprocessor/cmake/preprocessor_for_body.h.in +++ b/source/preprocessor/cmake/preprocessor_for_body.h.in @@ -18,7 +18,7 @@ expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_1(expr, __VA_ARGS__)) #endif @PREPROCESSOR_FOR_EACH_IMPL_BODY@ -#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) +#if defined(__GNUC__) || defined(__clang__) # define PREPROCESSOR_FOR_EACH(expr, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ @@ -57,7 +57,7 @@ expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_1(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) #endif @PREPROCESSOR_FOR_IMPL_BODY@ -#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) +#if defined(__GNUC__) || defined(__clang__) # define PREPROCESSOR_FOR(expr, context, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ diff --git a/source/preprocessor/include/preprocessor/preprocessor_arguments.h b/source/preprocessor/include/preprocessor/preprocessor_arguments.h index 961c3e2a8..c78bc4e06 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_arguments.h +++ b/source/preprocessor/include/preprocessor/preprocessor_arguments.h @@ -104,7 +104,7 @@ extern "C" { PREPROCESSOR_ARGS_COMMA(PREPROCESSOR_COMMA_VARIADIC __VA_ARGS__ ()) \ ) -#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) +#if defined(__GNUC__) || defined(__clang__) # define PREPROCESSOR_ARGS_COUNT_IMPL(...) \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__) # define PREPROCESSOR_ARGS_COUNT(...) \ diff --git a/source/preprocessor/include/preprocessor/preprocessor_for.h b/source/preprocessor/include/preprocessor/preprocessor_for.h index 218305eb4..89821d92d 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_for.h +++ b/source/preprocessor/include/preprocessor/preprocessor_for.h @@ -115,7 +115,7 @@ extern "C" { #define PREPROCESSOR_FOR_EACH_IMPL_63(expr, element, ...) expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_62(expr, __VA_ARGS__)) #define PREPROCESSOR_FOR_EACH_IMPL_64(expr, element, ...) expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_63(expr, __VA_ARGS__)) -#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) +#if defined(__GNUC__) || defined(__clang__) # define PREPROCESSOR_FOR_EACH(expr, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ @@ -222,7 +222,7 @@ extern "C" { #define PREPROCESSOR_FOR_IMPL_63(expr, context, iterator, element, ...) expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_62(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) #define PREPROCESSOR_FOR_IMPL_64(expr, context, iterator, element, ...) expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_63(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) -#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && _MSC_VER >= 1930) +#if defined(__GNUC__) || defined(__clang__) # define PREPROCESSOR_FOR(expr, context, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ From e4e9ac2e191adf1560dac677c53fc64f7dae0fb7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 9 Jun 2025 20:40:58 +0200 Subject: [PATCH 335/487] Trying to solve ruby issues. --- tools/metacall-environment.ps1 | 55 ++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index 741a2810f..055143a6f 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -173,7 +173,50 @@ function Set-Java { function Set-Ruby { Write-Output "Install Ruby" - $RUBY_VERSION = "3.1.2" + + # Find vswhere in order to detect MSVC version + $vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + + if (Test-Path $vswherePath) { + $vsInfo = & $vswherePath -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json | ConvertFrom-Json + + if ($vsInfo) { + $installationPath = $vsInfo[0].installationPath + $installationVersion = $vsInfo[0].installationVersion + + # Determine major version + $majorVersion = [int]$installationVersion.Split('.')[0] + } + } + + switch ($majorVersion) { + 16 { + # MSVC 2019 + $RUBY_VERSION = "3.1.2" + $RUBY_MAJOR_VERSION = "3.1.0" + $RUBY_FOLDER = "Ruby31-ms" + $RUBY_LIBRARY_NAME = "x64-vcruntime140-ruby310" + } + 17 { + # MSVC 2022 + $RUBY_VERSION = "3.2.1" + $RUBY_MAJOR_VERSION = "3.2.0" + $RUBY_FOLDER = "Ruby32-ms" + $RUBY_LIBRARY_NAME = "x64-vcruntime140-ruby320" + } + 18 { + # TODO: For 2025 ruby-loco? + # MSVC 2025 + $RUBY_VERSION = "3.2.1" + $RUBY_MAJOR_VERSION = "3.2.0" + $RUBY_FOLDER = "Ruby32-ms" + $RUBY_LIBRARY_NAME = "x64-vcruntime140-ruby320" + } + default { + Write-Error "Unknown or unsupported Visual Studio version for Ruby: $majorVersion" + exit 1 + } + } Set-Location $ROOT_DIR $RuntimeDir = "$env:ProgramFiles\ruby" @@ -185,10 +228,10 @@ function Set-Ruby { (New-Object Net.WebClient).DownloadFile("https://github.com/metacall/ruby-mswin/releases/download/ruby-mswin-builds/Ruby-$RUBY_VERSION-ms.7z", "$DepsDir\ruby-mswin.7z") } - mkdir "$DepsDir\Ruby31-ms" + mkdir "$DepsDir\$RUBY_FOLDER" 7z x "$DepsDir\ruby-mswin.7z" -o"$DepsDir" - robocopy /move /e "$DepsDir\Ruby31-ms\" $RuntimeDir + robocopy /move /e "$DepsDir\$RUBY_FOLDER\" $RuntimeDir Add-to-Path "$RuntimeDir\bin" @@ -196,10 +239,10 @@ function Set-Ruby { $RubyDir = $RuntimeDir.Replace('\', '/') Write-Output "-DRuby_VERSION_STRING=""$RUBY_VERSION""" >> $EnvOpts - Write-Output "-DRuby_INCLUDE_DIR=""$RubyDir/include/ruby-3.1.0""" >> $EnvOpts + Write-Output "-DRuby_INCLUDE_DIR=""$RubyDir/include/ruby-$RUBY_MAJOR_VERSION""" >> $EnvOpts Write-Output "-DRuby_EXECUTABLE=""$RubyDir/bin/ruby.exe""" >> $EnvOpts - Write-Output "-DRuby_LIBRARY=""$RubyDir/lib/x64-vcruntime140-ruby310.lib""" >> $EnvOpts - Write-Output "-DRuby_LIBRARY_NAME=""$RubyDir/bin/x64-vcruntime140-ruby310.dll""" >> $EnvOpts + Write-Output "-DRuby_LIBRARY=""$RubyDir/lib/$RUBY_LIBRARY_NAME.lib""" >> $EnvOpts + Write-Output "-DRuby_LIBRARY_NAME=""$RubyDir/bin/$RUBY_LIBRARY_NAME.dll""" >> $EnvOpts } function Set-TypeScript { From b73fa21e5c01502e91d6316cbf542db50562bcfe Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 9 Jun 2025 21:20:11 +0200 Subject: [PATCH 336/487] Add visual studio version. --- .github/workflows/windows-test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 3b0d5dabc..2b1e160b6 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -17,12 +17,16 @@ concurrency: jobs: windows-test: name: Windows MSVC Test - runs-on: ${{ matrix.os }} + runs-on: windows-${{ matrix.os.year }} strategy: fail-fast: false matrix: - os: [windows-2019, windows-2022, windows-2025] + os: [ + {year: 2019, version: "16.11"}, + {year: 2022, version: "17.9"}, + {year: 2025, version: "18.1"}, + ] options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, @@ -45,6 +49,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: amd64 + vsversion: ${{ matrix.os.version }} - name: Set up the environment run: cmd.exe /c "powershell .\tools\metacall-environment.ps1 $Env:METACALL_INSTALL_OPTIONS" From 447caef610e1308b98a778ceacea0a52f3ba7b01 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 9 Jun 2025 21:23:50 +0200 Subject: [PATCH 337/487] Improve version. --- .github/workflows/windows-test.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 2b1e160b6..a4cf56f5f 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -17,16 +17,12 @@ concurrency: jobs: windows-test: name: Windows MSVC Test - runs-on: windows-${{ matrix.os.year }} + runs-on: windows-${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ - {year: 2019, version: "16.11"}, - {year: 2022, version: "17.9"}, - {year: 2025, version: "18.1"}, - ] + os: [2019, 2022, 2025] options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, @@ -49,7 +45,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: amd64 - vsversion: ${{ matrix.os.version }} + vsversion: "${{ matrix.os }}" - name: Set up the environment run: cmd.exe /c "powershell .\tools\metacall-environment.ps1 $Env:METACALL_INSTALL_OPTIONS" From 9e589a2e791ec4a06bf47a0a6bffd4f108dbe2bb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 9 Jun 2025 21:58:47 +0200 Subject: [PATCH 338/487] Use ruby-loco. --- .github/workflows/windows-test.yml | 2 +- tools/metacall-environment.ps1 | 58 ++++-------------------------- 2 files changed, 8 insertions(+), 52 deletions(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index a4cf56f5f..818ffbe82 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -45,7 +45,7 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: amd64 - vsversion: "${{ matrix.os }}" + # vsversion: "${{ matrix.os }}" - name: Set up the environment run: cmd.exe /c "powershell .\tools\metacall-environment.ps1 $Env:METACALL_INSTALL_OPTIONS" diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index 055143a6f..d66aab7cf 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -174,50 +174,6 @@ function Set-Java { function Set-Ruby { Write-Output "Install Ruby" - # Find vswhere in order to detect MSVC version - $vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" - - if (Test-Path $vswherePath) { - $vsInfo = & $vswherePath -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -format json | ConvertFrom-Json - - if ($vsInfo) { - $installationPath = $vsInfo[0].installationPath - $installationVersion = $vsInfo[0].installationVersion - - # Determine major version - $majorVersion = [int]$installationVersion.Split('.')[0] - } - } - - switch ($majorVersion) { - 16 { - # MSVC 2019 - $RUBY_VERSION = "3.1.2" - $RUBY_MAJOR_VERSION = "3.1.0" - $RUBY_FOLDER = "Ruby31-ms" - $RUBY_LIBRARY_NAME = "x64-vcruntime140-ruby310" - } - 17 { - # MSVC 2022 - $RUBY_VERSION = "3.2.1" - $RUBY_MAJOR_VERSION = "3.2.0" - $RUBY_FOLDER = "Ruby32-ms" - $RUBY_LIBRARY_NAME = "x64-vcruntime140-ruby320" - } - 18 { - # TODO: For 2025 ruby-loco? - # MSVC 2025 - $RUBY_VERSION = "3.2.1" - $RUBY_MAJOR_VERSION = "3.2.0" - $RUBY_FOLDER = "Ruby32-ms" - $RUBY_LIBRARY_NAME = "x64-vcruntime140-ruby320" - } - default { - Write-Error "Unknown or unsupported Visual Studio version for Ruby: $majorVersion" - exit 1 - } - } - Set-Location $ROOT_DIR $RuntimeDir = "$env:ProgramFiles\ruby" $DepsDir = "$ROOT_DIR\dependencies" @@ -225,24 +181,24 @@ function Set-Ruby { if (!(Test-Path -Path "$DepsDir\ruby-mswin.7z")) { # Download installer Write-Output "Ruby not found downloading now..." - (New-Object Net.WebClient).DownloadFile("https://github.com/metacall/ruby-mswin/releases/download/ruby-mswin-builds/Ruby-$RUBY_VERSION-ms.7z", "$DepsDir\ruby-mswin.7z") + (New-Object Net.WebClient).DownloadFile("https://github.com/metacall/ruby-loco/releases/download/ruby-master/ruby-mswin.7z", "$DepsDir\ruby-mswin.7z") } - mkdir "$DepsDir\$RUBY_FOLDER" + mkdir "$DepsDir\ruby-mswin" 7z x "$DepsDir\ruby-mswin.7z" -o"$DepsDir" - robocopy /move /e "$DepsDir\$RUBY_FOLDER\" $RuntimeDir + robocopy /move /e "$DepsDir\ruby-mswin\" $RuntimeDir Add-to-Path "$RuntimeDir\bin" $EnvOpts = "$ROOT_DIR\build\CMakeConfig.txt" $RubyDir = $RuntimeDir.Replace('\', '/') - Write-Output "-DRuby_VERSION_STRING=""$RUBY_VERSION""" >> $EnvOpts - Write-Output "-DRuby_INCLUDE_DIR=""$RubyDir/include/ruby-$RUBY_MAJOR_VERSION""" >> $EnvOpts + Write-Output "-DRuby_VERSION_STRING=""3.5.0""" >> $EnvOpts + Write-Output "-DRuby_INCLUDE_DIR=""$RubyDir/include/ruby-3.5.0+0""" >> $EnvOpts Write-Output "-DRuby_EXECUTABLE=""$RubyDir/bin/ruby.exe""" >> $EnvOpts - Write-Output "-DRuby_LIBRARY=""$RubyDir/lib/$RUBY_LIBRARY_NAME.lib""" >> $EnvOpts - Write-Output "-DRuby_LIBRARY_NAME=""$RubyDir/bin/$RUBY_LIBRARY_NAME.dll""" >> $EnvOpts + Write-Output "-DRuby_LIBRARY=""$RubyDir/lib/x64-vcruntime140-ruby350.lib""" >> $EnvOpts + Write-Output "-DRuby_LIBRARY_NAME=""$RubyDir/bin/x64-vcruntime140-ruby350.dll""" >> $EnvOpts } function Set-TypeScript { From d30e82e8c4f1a4c59e106d62c5d8596010a4512d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 17:25:58 +0200 Subject: [PATCH 339/487] Add support for preprocessor in msvc 2022+. --- cmake/CompileOptions.cmake | 16 +++-------- .../cmake/preprocessor_arguments_body.h.in | 4 +-- .../cmake/preprocessor_for_body.h.in | 8 +++--- .../preprocessor/preprocessor_arguments.h | 4 +-- .../preprocessor/preprocessor_complement.h | 2 +- .../preprocessor/preprocessor_concatenation.h | 2 +- .../include/preprocessor/preprocessor_for.h | 8 +++--- .../include/preprocessor/preprocessor_if.h | 2 +- .../preprocessor/preprocessor_stringify.h | 6 ++--- .../source/preprocessor_test.cpp | 27 +++++++++++++++++++ 10 files changed, 49 insertions(+), 30 deletions(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index 57e66a0ac..f7126a3ba 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -300,15 +300,6 @@ if(WIN32 AND MSVC) #add_compile_options(/wd4251 /wd4592) #add_compile_options(/ZH:SHA_256) # use SHA256 for generating hashes of compiler processed source files. - # TODO: Preprocessor library not working after MSVC 2019 because they have replaced the implementation - # It seems they wanted to make it work as C99 standard but still seems to be problematic. - # The bug comes from multiple macros from preprocessor library, for more information here is the whole information: - # https://learn.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview?view=msvc-170#rescanning-replacement-list-for-macros - # As a workaround, we disable the new preprocessor. - if(MSVC_VERSION GREATER_EQUAL 1930) - add_compile_options(/Zc:preprocessor-) - endif() - if(CMAKE_BUILD_TYPE STREQUAL "Debug") # Disable optimizations add_compile_options(/Od) @@ -328,14 +319,14 @@ if(WIN32 AND MSVC) add_compile_options(/Oy) # TODO: Disable runtime checks (not compatible with O2) - # foreach(FLAG_VAR + # foreach(COMPILER_FLAGS # CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE # CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO # CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE # CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO # ) - # string(REGEX REPLACE "/RTC[^ ]*" "" ${FLAG_VAR} "${${FLAG_VAR}}") - # endforeach(FLAG_VAR) + # string(REGEX REPLACE "/RTC[^ ]*" "" ${COMPILER_FLAGS} "${${COMPILER_FLAGS}}") + # endforeach(COMPILER_FLAGS) if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") # Enable debug symbols @@ -357,6 +348,7 @@ if(WIN32 AND MSVC) add_compile_options(/fsanitize=leak) add_link_options(/INCREMENTAL:NO) endif() + endif() if (PROJECT_OS_FAMILY MATCHES "unix" OR PROJECT_OS_FAMILY MATCHES "macos") diff --git a/source/preprocessor/cmake/preprocessor_arguments_body.h.in b/source/preprocessor/cmake/preprocessor_arguments_body.h.in index 86d6d511f..bad23f879 100644 --- a/source/preprocessor/cmake/preprocessor_arguments_body.h.in +++ b/source/preprocessor/cmake/preprocessor_arguments_body.h.in @@ -47,7 +47,7 @@ PREPROCESSOR_ARGS_COMMA(PREPROCESSOR_COMMA_VARIADIC __VA_ARGS__ ()) \ ) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && !(!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) # define PREPROCESSOR_ARGS_COUNT_IMPL(...) \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__) # define PREPROCESSOR_ARGS_COUNT(...) \ @@ -70,7 +70,7 @@ # define PREPROCESSOR_ARGS_COMMA(...) \ PREPROCESSOR_ARGS_COUNT_IMPL(__VA_ARGS__, PREPROCESSOR_ARGS_COMMA_SEQ_IMPL()) # endif -#elif defined(_MSC_VER) && !defined(__clang__) +#elif (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) # define PREPROCESSOR_ARGS_COUNT_PREFIX__PREPROCESSOR_ARGS_COUNT_POSTFIX @PREPROCESSOR_ARGS_COUNT_PREFIX_POSTFIX_BODY@0 # define PREPROCESSOR_ARGS_COUNT_IMPL(expr) PREPROCESSOR_ARGS_N_IMPL expr # define PREPROCESSOR_ARGS_COUNT(...) \ diff --git a/source/preprocessor/cmake/preprocessor_for_body.h.in b/source/preprocessor/cmake/preprocessor_for_body.h.in index 57e9977b5..a175100f3 100644 --- a/source/preprocessor/cmake/preprocessor_for_body.h.in +++ b/source/preprocessor/cmake/preprocessor_for_body.h.in @@ -18,14 +18,14 @@ expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_1(expr, __VA_ARGS__)) #endif @PREPROCESSOR_FOR_EACH_IMPL_BODY@ -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && !(!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) # define PREPROCESSOR_FOR_EACH(expr, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__, \ @PREPROCESSOR_FOR_EACH_IMPL_GNUC_BODY@\ PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__)) -#elif defined(_MSC_VER) && !defined(__clang__) +#elif (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) # define PREPROCESSOR_FOR_EACH_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_EACH_IMPL_, count) # define PREPROCESSOR_FOR_EACH_IMPL_EXPR(...) \ @@ -57,14 +57,14 @@ expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_1(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) #endif @PREPROCESSOR_FOR_IMPL_BODY@ -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && !(!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) # define PREPROCESSOR_FOR(expr, context, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__, \ @PREPROCESSOR_FOR_IMPL_GNUC_BODY@\ PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__)) -#elif defined(_MSC_VER) && !defined(__clang__) +#elif (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) # define PREPROCESSOR_FOR_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_IMPL_, count) # define PREPROCESSOR_FOR_IMPL_EXPR(...) \ diff --git a/source/preprocessor/include/preprocessor/preprocessor_arguments.h b/source/preprocessor/include/preprocessor/preprocessor_arguments.h index c78bc4e06..b02fc1dbd 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_arguments.h +++ b/source/preprocessor/include/preprocessor/preprocessor_arguments.h @@ -104,7 +104,7 @@ extern "C" { PREPROCESSOR_ARGS_COMMA(PREPROCESSOR_COMMA_VARIADIC __VA_ARGS__ ()) \ ) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && !(!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) # define PREPROCESSOR_ARGS_COUNT_IMPL(...) \ PREPROCESSOR_ARGS_N_IMPL(__VA_ARGS__) # define PREPROCESSOR_ARGS_COUNT(...) \ @@ -190,7 +190,7 @@ extern "C" { # define PREPROCESSOR_ARGS_COMMA(...) \ PREPROCESSOR_ARGS_COUNT_IMPL(__VA_ARGS__, PREPROCESSOR_ARGS_COMMA_SEQ_IMPL()) # endif -#elif defined(_MSC_VER) && !defined(__clang__) +#elif (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) # define PREPROCESSOR_ARGS_COUNT_PREFIX__PREPROCESSOR_ARGS_COUNT_POSTFIX ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0 # define PREPROCESSOR_ARGS_COUNT_IMPL(expr) PREPROCESSOR_ARGS_N_IMPL expr # define PREPROCESSOR_ARGS_COUNT(...) \ diff --git a/source/preprocessor/include/preprocessor/preprocessor_complement.h b/source/preprocessor/include/preprocessor/preprocessor_complement.h index 78b6688bf..0cd0b5f02 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_complement.h +++ b/source/preprocessor/include/preprocessor/preprocessor_complement.h @@ -24,7 +24,7 @@ extern "C" { /* -- Macros -- */ -#if defined(_MSC_VER) && !defined(__clang__) +#if (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) #define PREPROCESSOR_COMPL_IMPL_EXPAND(expr) expr #define PREPROCESSOR_COMPL_IMPL(expr) PREPROCESSOR_COMPL_IMPL_EXPAND(PREPROCESSOR_COMPL_IMPL_##expr) #else diff --git a/source/preprocessor/include/preprocessor/preprocessor_concatenation.h b/source/preprocessor/include/preprocessor/preprocessor_concatenation.h index 4f63401fa..e5d3c7958 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_concatenation.h +++ b/source/preprocessor/include/preprocessor/preprocessor_concatenation.h @@ -19,7 +19,7 @@ extern "C" { /* -- Macros -- */ -#if defined(_MSC_VER) && !defined(__clang__) +#if (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) #define PREPROCESSOR_CONCAT_IMPL_II(token, expr) expr #define PREPROCESSOR_CONCAT_IMPL_I(left, right) PREPROCESSOR_CONCAT_IMPL_II(~, left##right) #define PREPROCESSOR_CONCAT_IMPL(left, right) PREPROCESSOR_CONCAT_IMPL_I(left, right) diff --git a/source/preprocessor/include/preprocessor/preprocessor_for.h b/source/preprocessor/include/preprocessor/preprocessor_for.h index 89821d92d..530dc8ee1 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_for.h +++ b/source/preprocessor/include/preprocessor/preprocessor_for.h @@ -115,7 +115,7 @@ extern "C" { #define PREPROCESSOR_FOR_EACH_IMPL_63(expr, element, ...) expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_62(expr, __VA_ARGS__)) #define PREPROCESSOR_FOR_EACH_IMPL_64(expr, element, ...) expr(element) PREPROCESSOR_FOR_EACH_EVAL(PREPROCESSOR_FOR_EACH_IMPL_63(expr, __VA_ARGS__)) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && !(!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) # define PREPROCESSOR_FOR_EACH(expr, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ @@ -128,7 +128,7 @@ extern "C" { PREPROCESSOR_FOR_EACH_IMPL_19, PREPROCESSOR_FOR_EACH_IMPL_18, PREPROCESSOR_FOR_EACH_IMPL_17, PREPROCESSOR_FOR_EACH_IMPL_16, PREPROCESSOR_FOR_EACH_IMPL_15, PREPROCESSOR_FOR_EACH_IMPL_14, PREPROCESSOR_FOR_EACH_IMPL_13, PREPROCESSOR_FOR_EACH_IMPL_12, PREPROCESSOR_FOR_EACH_IMPL_11, PREPROCESSOR_FOR_EACH_IMPL_10, \ PREPROCESSOR_FOR_EACH_IMPL_9, PREPROCESSOR_FOR_EACH_IMPL_8, PREPROCESSOR_FOR_EACH_IMPL_7, PREPROCESSOR_FOR_EACH_IMPL_6, PREPROCESSOR_FOR_EACH_IMPL_5, PREPROCESSOR_FOR_EACH_IMPL_4, PREPROCESSOR_FOR_EACH_IMPL_3, PREPROCESSOR_FOR_EACH_IMPL_2, PREPROCESSOR_FOR_EACH_IMPL_1, \ PREPROCESSOR_FOR_EACH_IMPL_0)(expr, __VA_ARGS__)) -#elif defined(_MSC_VER) && !defined(__clang__) +#elif (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) # define PREPROCESSOR_FOR_EACH_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_EACH_IMPL_, count) # define PREPROCESSOR_FOR_EACH_IMPL_EXPR(...) \ @@ -222,7 +222,7 @@ extern "C" { #define PREPROCESSOR_FOR_IMPL_63(expr, context, iterator, element, ...) expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_62(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) #define PREPROCESSOR_FOR_IMPL_64(expr, context, iterator, element, ...) expr(context, iterator, element) PREPROCESSOR_FOR_EVAL(PREPROCESSOR_FOR_IMPL_63(expr, context, PREPROCESSOR_INCREMENT(iterator), __VA_ARGS__)) -#if defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) || (defined(_MSC_VER) && !(!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) # define PREPROCESSOR_FOR(expr, context, ...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ PREPROCESSOR_EMPTY_SYMBOL(), \ @@ -235,7 +235,7 @@ extern "C" { PREPROCESSOR_FOR_IMPL_19, PREPROCESSOR_FOR_IMPL_18, PREPROCESSOR_FOR_IMPL_17, PREPROCESSOR_FOR_IMPL_16, PREPROCESSOR_FOR_IMPL_15, PREPROCESSOR_FOR_IMPL_14, PREPROCESSOR_FOR_IMPL_13, PREPROCESSOR_FOR_IMPL_12, PREPROCESSOR_FOR_IMPL_11, PREPROCESSOR_FOR_IMPL_10, \ PREPROCESSOR_FOR_IMPL_9, PREPROCESSOR_FOR_IMPL_8, PREPROCESSOR_FOR_IMPL_7, PREPROCESSOR_FOR_IMPL_6, PREPROCESSOR_FOR_IMPL_5, PREPROCESSOR_FOR_IMPL_4, PREPROCESSOR_FOR_IMPL_3, PREPROCESSOR_FOR_IMPL_2, PREPROCESSOR_FOR_IMPL_1, \ PREPROCESSOR_FOR_IMPL_0)(expr, context, 0, __VA_ARGS__)) -#elif defined(_MSC_VER) && !defined(__clang__) +#elif (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) # define PREPROCESSOR_FOR_IMPL_COUNT(count) \ PREPROCESSOR_CONCAT(PREPROCESSOR_FOR_IMPL_, count) # define PREPROCESSOR_FOR_IMPL_EXPR(...) \ diff --git a/source/preprocessor/include/preprocessor/preprocessor_if.h b/source/preprocessor/include/preprocessor/preprocessor_if.h index 9a491f60d..513df26cf 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_if.h +++ b/source/preprocessor/include/preprocessor/preprocessor_if.h @@ -33,7 +33,7 @@ extern "C" { #define PREPROCESSOR_IIF_IMPL_1(true_expr, false_expr) true_expr #endif -#if defined(_MSC_VER) && !defined(__clang__) +#if (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) #define PREPROCESSOR_IIF_IMPL_I(expr) expr #define PREPROCESSOR_IIF_IMPL(value, true_expr, false_expr) PREPROCESSOR_IIF_IMPL_I(PREPROCESSOR_IIF_IMPL_##value(true_expr, false_expr)) #else diff --git a/source/preprocessor/include/preprocessor/preprocessor_stringify.h b/source/preprocessor/include/preprocessor/preprocessor_stringify.h index 4cb637c33..fb84478d9 100644 --- a/source/preprocessor/include/preprocessor/preprocessor_stringify.h +++ b/source/preprocessor/include/preprocessor/preprocessor_stringify.h @@ -27,7 +27,7 @@ extern "C" { #if defined(__MWERKS__) #define PREPROCESSOR_STRINGIFY_IMPL_I(tuple) PREPROCESSOR_STRINGIFY_IMPL##tuple #define PREPROCESSOR_STRINGIFY(expr) PREPROCESSOR_STRINGIFY_IMPL_I((expr)) -#elif defined(_MSC_VER) && !defined(__clang__) +#elif (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) #define PREPROCESSOR_STRINGIFY_IMPL_I(tuple) PREPROCESSOR_STRINGIFY_IMPL tuple #define PREPROCESSOR_STRINGIFY(expr) PREPROCESSOR_STRINGIFY_IMPL_I((expr)) #else @@ -35,7 +35,7 @@ extern "C" { #endif /* Stringify a symbol or return empty string if the expression expands to nothing */ -#if defined(_MSC_VER) && !defined(__clang__) +#if (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) #define PREPROCESSOR_STRINGIFY_OR_EMPTY_IMPL_II(...) #__VA_ARGS__ #define PREPROCESSOR_STRINGIFY_OR_EMPTY_IMPL(...) \ PREPROCESSOR_IF(PREPROCESSOR_ARGS_NOT_EMPTY(__VA_ARGS__), \ @@ -48,7 +48,7 @@ extern "C" { #if defined(__MWERKS__) #define PREPROCESSOR_STRINGIFY_OR_EMPTY_IMPL_I(tuple) PREPROCESSOR_STRINGIFY_OR_EMPTY_IMPL##tuple #define PREPROCESSOR_STRINGIFY_OR_EMPTY(expr) PREPROCESSOR_STRINGIFY_OR_EMPTY_IMPL_I((expr)) -#elif defined(_MSC_VER) && !defined(__clang__) +#elif (defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)) && !defined(__clang__) #define PREPROCESSOR_STRINGIFY_OR_EMPTY_IMPL_I(tuple) PREPROCESSOR_STRINGIFY_OR_EMPTY_IMPL tuple #define PREPROCESSOR_STRINGIFY_OR_EMPTY(expr) PREPROCESSOR_STRINGIFY_OR_EMPTY_IMPL_I((expr)) #else diff --git a/source/tests/preprocessor_test/source/preprocessor_test.cpp b/source/tests/preprocessor_test/source/preprocessor_test.cpp index 75b6529b8..4e406c384 100644 --- a/source/tests/preprocessor_test/source/preprocessor_test.cpp +++ b/source/tests/preprocessor_test/source/preprocessor_test.cpp @@ -192,6 +192,33 @@ TEST_F(preprocessor_test, if_va_args) #undef PREPROCESSOR_TEST_IF_VA_ARGS } +TEST_F(preprocessor_test, if_va_args_ext) +{ +#define PREPROCESSOR_TEST_IF_VA_ARGS_PRINT(A, B, C) \ + do \ + { \ + printf("%d %d %d\n", A, B, C); \ + } while (0) + +#define PREPROCESSOR_TEST_IF_VA_ARGS_PRINT_VA(A, B, C, ...) \ + do \ + { \ + printf(A, B, C, __VA_ARGS__); \ + } while (0) + +#define PREPROCESSOR_TEST_IF_VA_ARGS(A, B, C, ...) \ + PREPROCESSOR_IF(PREPROCESSOR_ARGS_EMPTY(__VA_ARGS__), \ + PREPROCESSOR_TEST_IF_VA_ARGS_PRINT(A, B, C), \ + PREPROCESSOR_TEST_IF_VA_ARGS_PRINT_VA(A, B, C, __VA_ARGS__)) + + PREPROCESSOR_TEST_IF_VA_ARGS(1, 2, 3); + PREPROCESSOR_TEST_IF_VA_ARGS("%s %s %s\n", "B", "C", "D"); + PREPROCESSOR_TEST_IF_VA_ARGS("%s %s %s %s\n", "B", "C", "D", "E"); + PREPROCESSOR_TEST_IF_VA_ARGS("%s %s %s %s %s\n", "B", "C", "D", "E", "F"); + +#undef PREPROCESSOR_TEST_IF_VA_ARGS +} + TEST_F(preprocessor_test, serial) { #define PREPROCSSOR_TEST_SERIAL_TAG abc From 2f86d8da72f89e57110dd0b47ae6e2a6a226fda5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 17:26:41 +0200 Subject: [PATCH 340/487] Solve issues in msvc. --- source/cli/metacallcli/source/application.cpp | 13 +++++++--- .../source/plugin_extension.cpp | 2 +- source/loader/include/loader/loader_impl.h | 2 +- source/loader/source/loader.c | 2 +- source/loader/source/loader_impl.c | 6 ++--- .../source/rapid_json_serial_impl.cpp | 26 +++++++++---------- .../source/metacall_fork_test.cpp | 5 +--- 7 files changed, 29 insertions(+), 27 deletions(-) diff --git a/source/cli/metacallcli/source/application.cpp b/source/cli/metacallcli/source/application.cpp index 0f439da61..a8389d003 100644 --- a/source/cli/metacallcli/source/application.cpp +++ b/source/cli/metacallcli/source/application.cpp @@ -134,14 +134,19 @@ bool application::cmd(std::vector<std::string> &arguments) /* Initialize CMD descriptors */ std::string plugin_path(metacall_plugin_path()); - void *args[] = { + void *command_initialize_args[] = { metacall_value_create_string(plugin_path.c_str(), plugin_path.length()) }; - void *command_initialize_ret = metacallhv_s(plugin_cli_handle, "command_initialize", args, sizeof(args) / sizeof(args[0])); + void *command_initialize_ret = metacallhv_s(plugin_cli_handle, "command_initialize", command_initialize_args, sizeof(command_initialize_args) / sizeof(command_initialize_args[0])); check_for_exception(command_initialize_ret); + for (void *arg : command_initialize_args) + { + metacall_value_destroy(arg); + } + /* Convert all arguments into metacall value strings */ std::vector<void *> arguments_values; arguments_values.reserve(arguments.size()); @@ -179,11 +184,11 @@ bool application::cmd(std::vector<std::string> &arguments) { void **command_pair = metacall_value_to_array(command_map[iterator]); - void *args[] = { + void *command_args[] = { command_pair[0] }; - void *command_func = metacallfv_s(command_function_func, args, sizeof(args) / sizeof(args[0])); + void *command_func = metacallfv_s(command_function_func, command_args, sizeof(command_args) / sizeof(command_args[0])); if (metacall_value_id(command_func) == METACALL_FUNCTION) { diff --git a/source/extensions/plugin_extension/source/plugin_extension.cpp b/source/extensions/plugin_extension/source/plugin_extension.cpp index f787bdfe3..eac0a32c5 100644 --- a/source/extensions/plugin_extension/source/plugin_extension.cpp +++ b/source/extensions/plugin_extension/source/plugin_extension.cpp @@ -40,7 +40,7 @@ namespace fs = std::experimental::filesystem; static void *extension_loader = NULL; -void *plugin_load_from_path(size_t argc, void *args[], void *data) +static void *plugin_load_from_path(size_t argc, void *args[], void *data) { /* TODO: Improve return values with throwable in the future */ (void)data; diff --git a/source/loader/include/loader/loader_impl.h b/source/loader/include/loader/loader_impl.h index 6f3691d8f..0fb27961a 100644 --- a/source/loader/include/loader/loader_impl.h +++ b/source/loader/include/loader/loader_impl.h @@ -45,7 +45,7 @@ LOADER_API loader_impl loader_impl_create(const loader_tag tag); LOADER_API loader_impl loader_impl_create_host(const loader_tag tag); -LOADER_API int loader_impl_dependencies(loader_impl impl, detour d); +LOADER_API int loader_impl_dependencies(loader_impl impl, detour d, const loader_tag tag); LOADER_API int loader_impl_link(plugin p, loader_impl impl); diff --git a/source/loader/source/loader.c b/source/loader/source/loader.c index 5a440a1e1..c01c2c192 100644 --- a/source/loader/source/loader.c +++ b/source/loader/source/loader.c @@ -250,7 +250,7 @@ plugin loader_get_impl_plugin_options(const loader_tag tag, value options) loader_impl_set_options(impl, options); /* Dynamic link loader dependencies if it is not host */ - if (loader_impl_dependencies(impl, plugin_manager_impl_type(&loader_manager, loader_manager_impl)->d) != 0) + if (loader_impl_dependencies(impl, plugin_manager_impl_type(&loader_manager, loader_manager_impl)->d, tag) != 0) { goto plugin_manager_create_error; } diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 531199fd1..58470eccf 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -370,7 +370,7 @@ int loader_impl_dependencies_load(loader_impl impl, const char *key_str, value * return 1; } -int loader_impl_dependencies(loader_impl impl, detour d) +int loader_impl_dependencies(loader_impl impl, detour d, const loader_tag tag) { /* Dependencies have the following format: { @@ -459,7 +459,7 @@ int loader_impl_dependencies(loader_impl impl, detour d) if (loader_impl_dependencies_load(impl, key_str, paths_array, paths_size) != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "Failed to load dependency '%s' from loader configuration '%s.json'", key_str, plugin_name(impl->p)); + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load dependency '%s' from loader '%s' configuration", key_str, tag); return 1; } } @@ -469,7 +469,7 @@ int loader_impl_dependencies(loader_impl impl, detour d) /* Otherwise try to find if the library is already loaded, and if not, load the process */ if (loader_impl_dependencies_self_find(impl, key_str, dependencies_self) != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "Failed to load dependency '%s' from loader '%s' as a host", key_str, plugin_name(impl->p)); + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load dependency '%s' from loader '%s' as a host", key_str, tag); vector_destroy(dependencies_self); return 1; } diff --git a/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp b/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp index e2e981d7f..cd9341e0c 100644 --- a/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp +++ b/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp @@ -135,7 +135,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) size_t size = value_type_size(v); - rapidjson::SizeType length = size > 0 ? (rapidjson::SizeType)(size - 1) : 0; + rapidjson::SizeType length = size > 0 ? static_cast<rapidjson::SizeType>(size - 1) : 0; json_v->SetString(str, length); } @@ -229,7 +229,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) size_t size = sizeof(str); - rapidjson::SizeType length = size > 0 ? (rapidjson::SizeType)(size - 1) : 0; + rapidjson::SizeType length = size > 0 ? static_cast<rapidjson::SizeType>(size - 1) : 0; json_v->SetString(str, length); } @@ -240,7 +240,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) size_t size = sizeof(str); - rapidjson::SizeType length = size > 0 ? (rapidjson::SizeType)(size - 1) : 0; + rapidjson::SizeType length = size > 0 ? static_cast<rapidjson::SizeType>(size - 1) : 0; json_v->SetString(str, length); } @@ -251,7 +251,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) size_t size = sizeof(str); - rapidjson::SizeType length = size > 0 ? (rapidjson::SizeType)(size - 1) : 0; + rapidjson::SizeType length = size > 0 ? static_cast<rapidjson::SizeType>(size - 1) : 0; json_v->SetString(str, length); } @@ -262,7 +262,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) size_t size = sizeof(str); - rapidjson::SizeType length = size > 0 ? (rapidjson::SizeType)(size - 1) : 0; + rapidjson::SizeType length = size > 0 ? static_cast<rapidjson::SizeType>(size - 1) : 0; json_v->SetString(str, length); } @@ -275,28 +275,28 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) rapidjson::Value message_member, message_value; static const char message_str[] = "message"; - message_member.SetString(message_str, (rapidjson::SizeType)(sizeof(message_str) - 1)); - message_value.SetString(exception_message(ex), strlen(exception_message(ex))); + message_member.SetString(message_str, static_cast<rapidjson::SizeType>(sizeof(message_str) - 1)); + message_value.SetString(exception_message(ex), static_cast<rapidjson::SizeType>(strlen(exception_message(ex)))); json_map.AddMember(message_member, message_value, rapid_json_allocator); rapidjson::Value label_member, label_value; static const char label_str[] = "label"; - label_member.SetString(label_str, (rapidjson::SizeType)(sizeof(label_str) - 1)); - label_value.SetString(exception_label(ex), strlen(exception_label(ex))); + label_member.SetString(label_str, static_cast<rapidjson::SizeType>(sizeof(label_str) - 1)); + label_value.SetString(exception_label(ex), static_cast<rapidjson::SizeType>(strlen(exception_label(ex)))); json_map.AddMember(label_member, label_value, rapid_json_allocator); rapidjson::Value code_member, code_value; static const char code_str[] = "code"; - code_member.SetString(code_str, (rapidjson::SizeType)(sizeof(code_str) - 1)); + code_member.SetString(code_str, static_cast<rapidjson::SizeType>(sizeof(code_str) - 1)); code_value.SetInt64(exception_error_code(ex)); json_map.AddMember(code_member, code_value, rapid_json_allocator); rapidjson::Value stacktrace_member, stacktrace_value; static const char stacktrace_str[] = "stacktrace"; - stacktrace_member.SetString(stacktrace_str, (rapidjson::SizeType)(sizeof(stacktrace_str) - 1)); + stacktrace_member.SetString(stacktrace_str, static_cast<rapidjson::SizeType>(sizeof(stacktrace_str) - 1)); stacktrace_value.SetString(exception_stacktrace(ex), strlen(exception_stacktrace(ex))); json_map.AddMember(stacktrace_member, stacktrace_value, rapid_json_allocator); } @@ -310,7 +310,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) size_t size = sizeof(str); - rapidjson::SizeType length = (rapidjson::SizeType)(size - 1); + rapidjson::SizeType length = static_cast<rapidjson::SizeType>(size - 1); rapidjson::Value json_member, json_inner_value; @@ -328,7 +328,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) std::string s = ostream.str(); - json_v->SetString(s.c_str(), (rapidjson::SizeType)s.length()); + json_v->SetString(s.c_str(), static_cast<rapidjson::SizeType>(s.length())); } else if (id == TYPE_NULL) { diff --git a/source/tests/metacall_fork_test/source/metacall_fork_test.cpp b/source/tests/metacall_fork_test/source/metacall_fork_test.cpp index 0f34b6bd7..ab784ff94 100644 --- a/source/tests/metacall_fork_test/source/metacall_fork_test.cpp +++ b/source/tests/metacall_fork_test/source/metacall_fork_test.cpp @@ -102,10 +102,7 @@ pid_t fork() if (result == RTL_CLONE_PARENT) { - HANDLE me = GetCurrentProcess(); - pid_t child_pid; - - child_pid = GetProcessId(process_info.Process); + pid_t child_pid = GetProcessId(process_info.Process); ResumeThread(process_info.Thread); CloseHandle(process_info.Process); From 3bc6c1b30acaa6df0fdbeebfa397fe297ca0af84 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 17:27:07 +0200 Subject: [PATCH 341/487] Solve issues on workflows, enable windows versions on benchmarks. --- .github/workflows/benchmark.yml | 2 +- .github/workflows/windows-test.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 928da375a..1b75d77f3 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -99,7 +99,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019] + os: [windows-2019, windows-2022, windows-2025] env: LTTNG_UST_REGISTER_TIMEOUT: 0 diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 818ffbe82..962bd34e2 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -45,7 +45,6 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: amd64 - # vsversion: "${{ matrix.os }}" - name: Set up the environment run: cmd.exe /c "powershell .\tools\metacall-environment.ps1 $Env:METACALL_INSTALL_OPTIONS" From 0a6122cb0218b2feac9eff8b48631c53eec0b197 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 17:57:23 +0200 Subject: [PATCH 342/487] Solve issue on cast. --- .../serials/rapid_json_serial/source/rapid_json_serial_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp b/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp index cd9341e0c..f46cb09b1 100644 --- a/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp +++ b/source/serials/rapid_json_serial/source/rapid_json_serial_impl.cpp @@ -297,7 +297,7 @@ void rapid_json_serial_impl_serialize_value(value v, rapidjson::Value *json_v) static const char stacktrace_str[] = "stacktrace"; stacktrace_member.SetString(stacktrace_str, static_cast<rapidjson::SizeType>(sizeof(stacktrace_str) - 1)); - stacktrace_value.SetString(exception_stacktrace(ex), strlen(exception_stacktrace(ex))); + stacktrace_value.SetString(exception_stacktrace(ex), static_cast<rapidjson::SizeType>(strlen(exception_stacktrace(ex)))); json_map.AddMember(stacktrace_member, stacktrace_value, rapid_json_allocator); } else if (id == TYPE_THROWABLE) From 6fb8de0c4544bae0a7bc5ff03bd6b78fbe9c33b2 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 17:57:42 +0200 Subject: [PATCH 343/487] Solve issues with gtest on sanitizers. --- cmake/InstallGTest.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmake/InstallGTest.cmake b/cmake/InstallGTest.cmake index fa555b16b..45fdf569c 100644 --- a/cmake/InstallGTest.cmake +++ b/cmake/InstallGTest.cmake @@ -35,6 +35,18 @@ if(NOT GTEST_FOUND OR USE_BUNDLED_GTEST) set(GTEST_DISABLE_PTHREADS OFF) endif() + if(MSVC AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) + if(OPTION_BUILD_THREAD_SANITIZER) + set(SANITIZER_FLAGS -DCMAKE_CXX_FLAGS=/fsanitize=thread -DCMAKE_C_FLAGS=/fsanitize=thread) + endif() + if(OPTION_BUILD_ADDRESS_SANITIZER) + set(SANITIZER_FLAGS -DCMAKE_CXX_FLAGS=/fsanitize=address -DCMAKE_C_FLAGS=/fsanitize=address) + endif() + if(OPTION_BUILD_MEMORY_SANITIZER) + set(SANITIZER_FLAGS -DCMAKE_CXX_FLAGS="/fsanitize=memory /fsanitize=leak" -DCMAKE_C_FLAGS="/fsanitize=memory /fsanitize=leak") + endif() + endif() + # Import Google Test Framework ExternalProject_Add(google-test-depends GIT_REPOSITORY https://github.com/google/googletest.git @@ -48,6 +60,7 @@ if(NOT GTEST_FOUND OR USE_BUNDLED_GTEST) -DINSTALL_GTEST=OFF -DBUILD_GMOCK=ON -Dgmock_build_tests=OFF + ${SANITIZER_FLAGS} PREFIX "${CMAKE_CURRENT_BINARY_DIR}" UPDATE_COMMAND "" INSTALL_COMMAND "" From 79e590495e95087a6c634a675e98d71aa6fc7325 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 18:06:22 +0200 Subject: [PATCH 344/487] Add support for newer windows versions. --- .github/workflows/benchmark.yml | 2 +- .github/workflows/windows-test.yml | 2 +- cmake/FindNodeJS.cmake | 4 +++- docs/README.md | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 1b75d77f3..06b428b84 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -99,7 +99,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019, windows-2022, windows-2025] + os: [windows-2022, windows-2025] env: LTTNG_UST_REGISTER_TIMEOUT: 0 diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 962bd34e2..1e2a0a8ca 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [2019, 2022, 2025] + os: [2022, 2025] options: [ {build: debug, sanitizer: without-sanitizer}, {build: debug, sanitizer: address-sanitizer}, diff --git a/cmake/FindNodeJS.cmake b/cmake/FindNodeJS.cmake index 1bec27069..d9e5e6651 100644 --- a/cmake/FindNodeJS.cmake +++ b/cmake/FindNodeJS.cmake @@ -453,7 +453,9 @@ if(NOT NodeJS_LIBRARY) endif() # Check for Visual Studio Version and configure the build command - if(MSVC_VERSION GREATER 1916) + if(MSVC_VERSION GREATER_EQUAL 1930) + set(NodeJS_MSVC_VER vs2022) + if(MSVC_VERSION GREATER_EQUAL 1920) set(NodeJS_MSVC_VER vs2019) elseif(MSVC_VERSION GREATER 1900) set(NodeJS_MSVC_VER vs2017) diff --git a/docs/README.md b/docs/README.md index c93a23188..55c101c5c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -862,7 +862,8 @@ Where `script.js` is a script contained in host folder `$HOME/metacall` that wil | :-----------------: | :--------------------------------------------------: | | **`ubuntu-latest`** | https://metacall.github.io/core/bench/ubuntu-latest/ | | **`macos-latest`** | https://metacall.github.io/core/bench/macos-latest/ | -| **`windows-2019`** | https://metacall.github.io/core/bench/windows-2019/ | +| **`windows-2022`** | https://metacall.github.io/core/bench/windows-2022/ | +| **`windows-2025`** | https://metacall.github.io/core/bench/windows-2025/ | ## 9. License From e11c4450b6dab056c29b7a02a444fcb523c05c92 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 18:29:17 +0200 Subject: [PATCH 345/487] Solve issue with nodejs. --- cmake/FindNodeJS.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindNodeJS.cmake b/cmake/FindNodeJS.cmake index d9e5e6651..6cea42bf4 100644 --- a/cmake/FindNodeJS.cmake +++ b/cmake/FindNodeJS.cmake @@ -455,7 +455,7 @@ if(NOT NodeJS_LIBRARY) # Check for Visual Studio Version and configure the build command if(MSVC_VERSION GREATER_EQUAL 1930) set(NodeJS_MSVC_VER vs2022) - if(MSVC_VERSION GREATER_EQUAL 1920) + elseif(MSVC_VERSION GREATER_EQUAL 1920) set(NodeJS_MSVC_VER vs2019) elseif(MSVC_VERSION GREATER 1900) set(NodeJS_MSVC_VER vs2017) From 4432914b4816eb10118c1c9b09726b9fad1c80a6 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 22:04:57 +0200 Subject: [PATCH 346/487] Add search paths for dependencies. --- source/loader/source/loader_impl.c | 41 +++++++++++++++++++++++++ source/loaders/CMakeLists.txt | 16 ++++++++++ source/loaders/loader.json.in | 1 + source/loaders/rb_loader/CMakeLists.txt | 21 +++++++++++++ tools/metacall-environment.ps1 | 1 + 5 files changed, 80 insertions(+) diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 58470eccf..c66b2bfd4 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -113,6 +113,10 @@ static int loader_impl_dependencies_self_find(loader_impl impl, const char *key_ static int loader_impl_dependencies_load(loader_impl impl, const char *key_str, value *paths_array, size_t paths_size); +#if defined(WIN32) || defined(_WIN32) +static void loader_impl_dependencies_search_paths(loader_impl impl, const loader_tag tag); +#endif + static configuration loader_impl_initialize_configuration(const loader_tag tag); static int loader_impl_initialize_registered(plugin_manager manager, plugin p); @@ -370,6 +374,39 @@ int loader_impl_dependencies_load(loader_impl impl, const char *key_str, value * return 1; } +#if defined(WIN32) || defined(_WIN32) +void loader_impl_dependencies_search_paths(loader_impl impl, const loader_tag tag) +{ + /* Search paths have the following format and are only implemented for Windows: + { + "search_paths": ["C:\Program Files\ruby\bin\ruby_builtin_dlls"] + } + */ + value search_paths_value = configuration_value_type(impl->config, "search_paths", TYPE_ARRAY); + + /* Check if the loader has search paths and initialize them */ + if (search_paths_value != NULL) + { + size_t size = value_type_count(search_paths_value); + value *search_paths_array = value_to_array(search_paths_value); + size_t iterator; + + for (iterator = 0; iterator < size; ++iterator) + { + if (value_type_id(search_paths_array[iterator]) == TYPE_STRING) + { + const char *key_str = value_to_string(search_paths_array[iterator]); + + if (SetDllDirectoryA(key_str) == FALSE) + { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to register the DLL directory %s in loader '%s'; dependencies with other dependant DLLs may fail to load", key_str, tag); + } + } + } + } +} +#endif + int loader_impl_dependencies(loader_impl impl, detour d, const loader_tag tag) { /* Dependencies have the following format: @@ -412,6 +449,10 @@ int loader_impl_dependencies(loader_impl impl, detour d, const loader_tag tag) /* Initialize the loader detour */ impl->d = d; +#if defined(WIN32) || defined(_WIN32) + loader_impl_dependencies_search_paths(impl, tag); +#endif + /* Check if the loader has dependencies and load them */ if (dependencies_value != NULL) { diff --git a/source/loaders/CMakeLists.txt b/source/loaders/CMakeLists.txt index edcb03e08..374d6e4a5 100644 --- a/source/loaders/CMakeLists.txt +++ b/source/loaders/CMakeLists.txt @@ -87,6 +87,22 @@ macro(loader_configuration_begin TARGET) set(LOADER_CONFIGURATION_TARGET "${TARGET}") endmacro() +# Generate configuration with search paths for a loader +# +# "search_paths": [ "C:/Program Files/ruby/bin/ruby_builtin_dlls" ], +# +macro(loader_configuration_paths LIBRARY_PATHS_LIST) + if(NOT "${LIBRARY_PATHS_LIST}" STREQUAL "") + # Normalize the paths + string(REPLACE "\\" "/" LIBRARY_PATHS "${LIBRARY_PATHS_LIST}") + + # Convert to JSON + string(REPLACE ";" "\", \"" LOADER_SEARCH_PATHS "\"${LIBRARY_PATHS}\"") + else() + set(LOADER_SEARCH_PATHS) + endif() +endmacro() + # Generate configuration with dependencies for a loader # # node_loader: diff --git a/source/loaders/loader.json.in b/source/loaders/loader.json.in index dfb183afd..713a30bbd 100644 --- a/source/loaders/loader.json.in +++ b/source/loaders/loader.json.in @@ -1,4 +1,5 @@ { + "search_paths": [ @LOADER_SEARCH_PATHS@ ], "dependencies": { @LOADER_DEPENDENCIES@ } diff --git a/source/loaders/rb_loader/CMakeLists.txt b/source/loaders/rb_loader/CMakeLists.txt index d3dd5545f..bf3a336fa 100644 --- a/source/loaders/rb_loader/CMakeLists.txt +++ b/source/loaders/rb_loader/CMakeLists.txt @@ -238,16 +238,37 @@ else() set(Ruby_LIBRARY_INSTALL "${Ruby_LIBRARY_NAME_PATH}") endif() +# Define search paths +set(Ruby_LIBRARY_SEARCH_PATHS_DEVELOPMENT "${Ruby_LIBRARY_SEARCH_PATHS}") + +if(Ruby_LIBRARY_SEARCH_PATHS AND WIN32) + set(Ruby_LIBRARY_SEARCH_PATHS_INSTALL "") + + foreach(SEARCH_PATH IN LISTS Ruby_LIBRARY_SEARCH_PATHS) + install(DIRECTORY + "${SEARCH_PATH}" + DESTINATION ${INSTALL_LIB} + COMPONENT runtime + ) + + get_filename_component(SEARCH_PATH_FOLDER_NAME "${SEARCH_PATH}" NAME) + + list(APPEND Ruby_LIBRARY_SEARCH_PATHS_INSTALL "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB}/${SEARCH_PATH_FOLDER_NAME}") + endforeach() +endif() + # # Configuration # # Development loader_configuration_begin(rb_loader) +loader_configuration_paths("${Ruby_LIBRARY_SEARCH_PATHS_DEVELOPMENT}") loader_configuration_deps(ruby "${Ruby_LIBRARY_DEVELOPMENT}") loader_configuartion_end_development() # Install loader_configuration_begin(rb_loader) +loader_configuration_paths("${Ruby_LIBRARY_SEARCH_PATHS_INSTALL}") loader_configuration_deps(ruby "${Ruby_LIBRARY_INSTALL}") loader_configuartion_end_install() diff --git a/tools/metacall-environment.ps1 b/tools/metacall-environment.ps1 index d66aab7cf..486edf771 100755 --- a/tools/metacall-environment.ps1 +++ b/tools/metacall-environment.ps1 @@ -199,6 +199,7 @@ function Set-Ruby { Write-Output "-DRuby_EXECUTABLE=""$RubyDir/bin/ruby.exe""" >> $EnvOpts Write-Output "-DRuby_LIBRARY=""$RubyDir/lib/x64-vcruntime140-ruby350.lib""" >> $EnvOpts Write-Output "-DRuby_LIBRARY_NAME=""$RubyDir/bin/x64-vcruntime140-ruby350.dll""" >> $EnvOpts + Write-Output "-DRuby_LIBRARY_SEARCH_PATHS=""$RubyDir/bin/ruby_builtin_dlls""" >> $EnvOpts } function Set-TypeScript { From b4af2abb0b258fc08957196b3326da7e766ece45 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 10 Jun 2025 22:38:31 +0200 Subject: [PATCH 347/487] Solve issues with ruby. --- source/loaders/rb_loader/CMakeLists.txt | 9 +-------- source/loaders/rb_loader/source/rb_loader_impl.c | 13 +++++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/source/loaders/rb_loader/CMakeLists.txt b/source/loaders/rb_loader/CMakeLists.txt index bf3a336fa..3e6d2cbdb 100644 --- a/source/loaders/rb_loader/CMakeLists.txt +++ b/source/loaders/rb_loader/CMakeLists.txt @@ -20,15 +20,8 @@ if(Ruby_LIBRARY_NAME) else() set(Ruby_LIBRARY_NAME_PATH "${Ruby_LIBRARY}") endif() -get_filename_component(Ruby_LIBRARY_NAME "${Ruby_LIBRARY_NAME_PATH}" NAME) -# Copy Ruby DLL into project output directory -# TODO: https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies -# TODO: https://gist.github.com/micahsnyder/5d98ac8548b429309ec5a35bca9366da -if(Ruby_LIBRARY_NAME_PATH AND WIN32) - execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_OUTPUT_DIR}) - file(COPY "${Ruby_LIBRARY_NAME_PATH}" DESTINATION ${PROJECT_OUTPUT_DIR}) -endif() +get_filename_component(Ruby_LIBRARY_NAME "${Ruby_LIBRARY_NAME_PATH}" NAME) # # Plugin name and options diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 388e3b2e9..d35208391 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -1506,7 +1506,7 @@ void rb_loader_impl_discover_methods(klass c, VALUE cls, const char *class_name_ for (method_index = 0; method_index < methods_size; ++method_index) { VALUE rb_method = rb_ary_entry(methods, method_index); - VALUE name = rb_funcallv(rb_method, rb_intern("id2name"), 0, NULL); + VALUE name = rb_sym2str(rb_method); const char *method_name_str = RSTRING_PTR(name); VALUE instance_method = rb_funcall(cls, rb_intern(method_type_str), 1, rb_method); @@ -1551,7 +1551,7 @@ void rb_loader_impl_discover_methods(klass c, VALUE cls, const char *class_name_ if (RARRAY_LEN(parameter_pair) == 2) { VALUE parameter_name_id = rb_ary_entry(parameter_pair, 1); - VALUE parameter_name = rb_funcallv(parameter_name_id, rb_intern("id2name"), 0, NULL); + VALUE parameter_name = rb_sym2str(parameter_name_id); const char *parameter_name_str = RSTRING_PTR(parameter_name); signature_set(s, args_it, parameter_name_str, NULL); @@ -1572,7 +1572,7 @@ void rb_loader_impl_discover_attributes(klass c, const char *class_name_str, VAL for (attributes_index = 0; attributes_index < attributes_size; ++attributes_index) { VALUE rb_attr = rb_ary_entry(attributes, attributes_index); - VALUE name = rb_funcallv(rb_attr, rb_intern("id2name"), 0, NULL); + VALUE name = rb_sym2str(rb_attr); const char *attr_name_str = RSTRING_PTR(name); log_write("metacall", LOG_LEVEL_DEBUG, "Attribute '%s' inside '%s'", attr_name_str, class_name_str); @@ -1606,12 +1606,9 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo if (method != Qnil) { - VALUE method_name = rb_funcallv(method, rb_intern("id2name"), 0, NULL); - + VALUE method_name = rb_sym2str(method); const char *method_name_str = RSTRING_PTR(method_name); - rb_function_parser function_parser = set_get(rb_module->function_map, (set_key)method_name_str); - loader_impl_rb_function rb_function = NULL; if (function_parser == NULL) @@ -1666,7 +1663,7 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo { if (RB_TYPE_P(constant, T_SYMBOL)) { - VALUE class_name = rb_funcallv(constant, rb_intern("id2name"), 0, NULL); + VALUE class_name = rb_sym2str(constant); const char *class_name_str = RSTRING_PTR(class_name); VALUE cls = rb_const_get_from(rb_module->module, rb_intern(class_name_str)); loader_impl_rb_class rb_cls = malloc(sizeof(struct loader_impl_rb_class_type)); From 96df3a30bc7be5568aa7788060ed11d8030a94c7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 11 Jun 2025 18:13:37 +0200 Subject: [PATCH 348/487] Remove dead code and enable release on windows. --- .github/workflows/windows-test.yml | 2 +- source/loaders/py_loader/source/py_loader_dict.c | 1 + source/loaders/py_loader/source/py_loader_impl.c | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 1e2a0a8ca..7f4867123 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -32,7 +32,7 @@ jobs: # {build: debug, sanitizer: memory-sanitizer}, # TODO: https://github.com/metacall/core/issues/461 - # {build: release, sanitizer: without-sanitizer} + {build: release, sanitizer: without-sanitizer} ] steps: diff --git a/source/loaders/py_loader/source/py_loader_dict.c b/source/loaders/py_loader/source/py_loader_dict.c index f78508141..abfed7a0a 100644 --- a/source/loaders/py_loader/source/py_loader_dict.c +++ b/source/loaders/py_loader/source/py_loader_dict.c @@ -43,6 +43,7 @@ #define Py_BUILD_CORE #endif #include <internal/pycore_dict.h> + #undef Py_BUILD_CORE /* Disable warnings from Python */ #if defined(__clang__) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 4cc86e8a4..5fb872dda 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2396,7 +2396,6 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) "import asyncio\n" "import threading\n" "import sys\n" - // "import atexit; atexit.register(getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None))\n" "class ThreadLoop:\n" " def __init__(self, loop, t):\n" " self.loop = loop\n" @@ -2433,9 +2432,7 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) " tl.t.join()\n" "def atexit_background_loop(tl):\n" /* Checks if py_port_impl_module contains py_loader_port_atexit and executes it */ - // " py_loader_port_atexit = getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None)\n" " getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None)()\n" - // " tl.loop.call_soon_threadsafe(stop_background_loop, tl, False)\n" "def register_atexit_background_loop(tl):\n" " threading._register_atexit(atexit_background_loop, tl)\n"; From 2bed0f916a566557fb7f8c05ddddd7c737845ff5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 11 Jun 2025 19:57:02 +0200 Subject: [PATCH 349/487] Improve install method of py port. --- source/ports/py_port/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/CMakeLists.txt b/source/ports/py_port/CMakeLists.txt index 5bf1d7d38..91279d3e7 100644 --- a/source/ports/py_port/CMakeLists.txt +++ b/source/ports/py_port/CMakeLists.txt @@ -26,7 +26,7 @@ if(NOT OPTION_BUILD_GUIX) set(PIP_BACKWARD_COMPATIBILITY "${CMAKE_COMMAND} -E env SETUPTOOLS_USE_DISTUTILS=stdlib") endif() - install(CODE "execute_process(COMMAND ${PIP_BACKWARD_COMPATIBILITY} pip3 install ${PIP_BREAK_SYSTEM_PACKAGES} ${CMAKE_CURRENT_SOURCE_DIR})") + install(CODE "execute_process(COMMAND ${PIP_BACKWARD_COMPATIBILITY} ${Python3_EXECUTABLE} -m pip install ${PIP_BREAK_SYSTEM_PACKAGES} ${CMAKE_CURRENT_SOURCE_DIR})") endif() # Check if loaders are enabled From a639f918a09ebba5163b8b7192e480fb1130a65b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 11 Jun 2025 20:22:56 +0200 Subject: [PATCH 350/487] Add install step to ci. --- .github/workflows/macos-test.yml | 2 +- .github/workflows/windows-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 26247e35b..d6ba0dc3b 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -93,7 +93,7 @@ jobs: . .env bash ../tools/metacall-build.sh $METACALL_BUILD_OPTIONS env: - METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests + METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests install macos-distributable: name: MacOS Distributable Dispatch diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 7f4867123..93508418b 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -64,7 +64,7 @@ jobs: working-directory: ./build run: cmd.exe /c "powershell ..\tools\metacall-build.ps1 $Env:METACALL_BUILD_OPTIONS" env: - METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests + METACALL_BUILD_OPTIONS: ${{ matrix.options.build }} tests install windows-distributable: name: Windows Distributable Dispatch From 4dcf6e6c8b1b54c010b59e4235e6f52a3078cccb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 11 Jun 2025 20:58:20 +0200 Subject: [PATCH 351/487] Remove release in windows, python still failing. --- .github/workflows/windows-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 93508418b..3518e6d4d 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -32,7 +32,7 @@ jobs: # {build: debug, sanitizer: memory-sanitizer}, # TODO: https://github.com/metacall/core/issues/461 - {build: release, sanitizer: without-sanitizer} + # {build: release, sanitizer: without-sanitizer} ] steps: From 74345507a07f7547526607d603c60244456d3ba4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 11 Jun 2025 20:59:01 +0200 Subject: [PATCH 352/487] Update version to v0.9.6. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 03834411d..9cf038687 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.5 \ No newline at end of file +0.9.6 \ No newline at end of file From 20891089161e09ad659c4f0c1667e496e2726b98 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Jun 2025 01:02:47 +0200 Subject: [PATCH 353/487] Solve issue in node port. --- source/ports/node_port/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/ports/node_port/index.js b/source/ports/node_port/index.js index 0df0a7590..23ff5d683 100644 --- a/source/ports/node_port/index.js +++ b/source/ports/node_port/index.js @@ -38,7 +38,13 @@ const findFilesRecursively = (directory, filePattern, depthLimit = Infinity) => continue; } - const items = fs.readdirSync(dir); + const items = (() => { + try { + return fs.readdirSync(dir); + } catch (e) { + return []; + } + })(); for (const item of items) { const fullPath = path.join(dir, item); From 517bd24f6cd58640f3eac7623fae5df213c1bb97 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Jun 2025 01:03:46 +0200 Subject: [PATCH 354/487] Update version to v0.9.7. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9cf038687..bae256fd5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.6 \ No newline at end of file +0.9.7 \ No newline at end of file From 83011ae50aea469d5bd2169ff8c05e50ef25e382 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Jun 2025 01:55:49 +0200 Subject: [PATCH 355/487] Update backwardcpp. --- source/plugins/backtrace_plugin/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/plugins/backtrace_plugin/CMakeLists.txt b/source/plugins/backtrace_plugin/CMakeLists.txt index acaf00022..089fa8539 100644 --- a/source/plugins/backtrace_plugin/CMakeLists.txt +++ b/source/plugins/backtrace_plugin/CMakeLists.txt @@ -7,12 +7,12 @@ endif() # External dependencies # -if(NOT OPTION_BUILD_GUIX) +if(NOT (OPTION_BUILD_GUIX OR BackwardCpp_SOURCE)) include(FetchContent) FetchContent_Declare(BackwardCpp - GIT_REPOSITORY https://github.com/bombela/backward-cpp - GIT_TAG 94718085efa256fb25a311a46b5948ee0d95890a + GIT_REPOSITORY https://github.com/metacall/backward-cpp + GIT_TAG 0bfd0a07a61551413ccd2ab9a9099af3bad40681 ) FetchContent_MakeAvailable(BackwardCpp) From 673b3f458aeebc2222486bd3cdaf853e12b4e660 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Jun 2025 01:56:40 +0200 Subject: [PATCH 356/487] Update version to v0.9.8. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index bae256fd5..b5d0ec558 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.7 \ No newline at end of file +0.9.8 \ No newline at end of file From f6b7fba8e092388c1cfc46bee5c4b536ba534512 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Jun 2025 17:30:41 +0200 Subject: [PATCH 357/487] Remove incompatible ubsan option. --- cmake/CompileOptions.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/CompileOptions.cmake b/cmake/CompileOptions.cmake index f7126a3ba..b3cd23a46 100644 --- a/cmake/CompileOptions.cmake +++ b/cmake/CompileOptions.cmake @@ -337,7 +337,6 @@ if(WIN32 AND MSVC) # Sanitizers if(OPTION_BUILD_THREAD_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) add_compile_options(/fsanitize=thread) - # add_compile_options(/fsanitize=undefined) add_link_options(/INCREMENTAL:NO) elseif(OPTION_BUILD_ADDRESS_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) add_compile_options(/fsanitize=address) From b2c2779eb54fc54f9bc30d95e22d08c575c36de9 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 12 Jun 2025 17:30:55 +0200 Subject: [PATCH 358/487] Trying to solve issues with threads python. --- .../include/py_loader/py_loader_threading.h | 2 +- .../loaders/py_loader/source/py_loader_impl.c | 12 +++++++++++- .../py_loader/source/py_loader_threading.cpp | 19 ++++++++++++++++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/source/loaders/py_loader/include/py_loader/py_loader_threading.h b/source/loaders/py_loader/include/py_loader/py_loader_threading.h index 592dcaa02..d55a804b7 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_threading.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_threading.h @@ -29,7 +29,7 @@ extern "C" { #endif -PY_LOADER_NO_EXPORT void py_loader_thread_initialize(const int host); +PY_LOADER_NO_EXPORT int py_loader_thread_initialize(const int host); PY_LOADER_NO_EXPORT int py_loader_thread_is_main(void); diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 5fb872dda..477b7a4b0 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2651,6 +2651,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi #if DEBUG_ENABLED int gc_initialized = 1; #endif + int gil_release; if (py_impl == NULL) { @@ -2682,7 +2683,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi } /* Initialize threading */ - py_loader_thread_initialize(host); + gil_release = py_loader_thread_initialize(host); /* Initialize executable */ if (py_loader_impl_initialize_sys_executable(py_impl) != 0) @@ -2780,6 +2781,11 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi PyType_Modified(PyCFunctionTypePtr()); #endif + if (gil_release) + { + py_loader_thread_release(); + } + /* Register initialization */ loader_initialization_register(impl); @@ -2823,6 +2829,10 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi #endif error_after_argv: error_after_sys_executable: + if (gil_release) + { + py_loader_thread_release(); + } (void)py_loader_impl_finalize(py_impl, host); error_init_py: free(py_impl); diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index ed4e3ea60..1b4041fbe 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -30,7 +30,7 @@ struct py_thread_state PyGILState_STATE gstate; py_thread_state() : - ref_count(0) {} + ref_count(0), gstate(PyGILState_UNLOCKED) {} void ensure() { @@ -63,17 +63,30 @@ thread_local py_thread_state current_thread_state; thread_local uint64_t current_thread_id = thread_id_get_current(); static std::vector<PyObject *> delayed_destructor; -void py_loader_thread_initialize(const int host) +int py_loader_thread_initialize(const int host) { main_thread_id = thread_id_get_current(); if (host == 1) { + int gil_status = PyGILState_Check(); + PyGILState_STATE gstate = PyGILState_Ensure(); main_thread_state = PyThreadState_Get(); - main_thread_ref_count++; PyGILState_Release(gstate); + + if (gil_status == 0) + { + py_loader_thread_acquire(); + return 1; + } + else + { + main_thread_ref_count++; + } } + + return 0; } int py_loader_thread_is_main() From c40449176c67e6fadb7d3f2286c6efe48464490c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 14 Jun 2025 10:24:27 +0200 Subject: [PATCH 359/487] Trying to improve env var requirements. --- source/CMakeLists.txt | 13 ++++++------ source/ports/node_port/CMakeLists.txt | 1 - source/ports/py_port/CMakeLists.txt | 30 ++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 13cb953f5..883be65c3 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -79,12 +79,13 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # Default definitions # -add_definitions( - -DCONFIGURATION_INSTALL_PATH=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_DATA}/configurations/global.json\" - -DSERIAL_LIBRARY_INSTALL_PATH=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARED}\" - -DLOADER_LIBRARY_INSTALL_PATH=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARED}\" - -DDETOUR_LIBRARY_INSTALL_PATH=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARED}\" - -DPORT_LIBRARY_INSTALL_PATH=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARED}\" +set(DEFAULT_COMPILE_DEFINITIONS + ${DEFAULT_COMPILE_DEFINITIONS} + CONFIGURATION_INSTALL_PATH="${CMAKE_INSTALL_PREFIX}/${INSTALL_DATA}/configurations/global.json" + SERIAL_LIBRARY_INSTALL_PATH="${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARED}" + LOADER_LIBRARY_INSTALL_PATH="${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARED}" + DETOUR_LIBRARY_INSTALL_PATH="${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARED}" + PORT_LIBRARY_INSTALL_PATH="${CMAKE_INSTALL_PREFIX}/${INSTALL_SHARED}" ) # diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index cec5ba4f9..9a30aeeb8 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -266,5 +266,4 @@ test_environment_variables(${node_port_test_exec} ${TESTS_ENVIRONMENT_VARIABLES_RS} ${TESTS_ENVIRONMENT_VARIABLES_OPENSSL} "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" - ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) diff --git a/source/ports/py_port/CMakeLists.txt b/source/ports/py_port/CMakeLists.txt index 91279d3e7..91477ab15 100644 --- a/source/ports/py_port/CMakeLists.txt +++ b/source/ports/py_port/CMakeLists.txt @@ -106,5 +106,33 @@ test_environment_variables(${py_port_test_exec} ${TESTS_ENVIRONMENT_VARIABLES} ${TESTS_ENVIRONMENT_VARIABLES_RS} "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" - ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} +) + +# +# Define test (Python standalone) +# + +set(py_port_test_exec_alone "${py_port_test}_executable_standalone") + +message(STATUS "Test ${py_port_test_exec_alone}") + +# Add test (Python standalone) +add_test(NAME ${py_port_test_exec_alone} + COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test.py" +) + +# +# Define test labels +# + +set_property(TEST ${py_port_test_exec_alone} + PROPERTY LABELS ${py_port_test_exec_alone} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${py_port_test_exec_alone} + "" + "LOADER_SCRIPT_PATH=${LOADER_SCRIPT_PATH}" + "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" ) From 1ca8a736121a193c6f0d670b61720613b3a98174 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 14 Jun 2025 12:13:50 +0200 Subject: [PATCH 360/487] Improve configuration path detection. --- source/configuration/source/configuration.c | 56 ++++++++++++++++++++- source/plugin/source/plugin_manager.c | 4 +- source/ports/py_port/CMakeLists.txt | 2 + 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/source/configuration/source/configuration.c b/source/configuration/source/configuration.c index 365fdaf0c..8994e4bb0 100644 --- a/source/configuration/source/configuration.c +++ b/source/configuration/source/configuration.c @@ -28,6 +28,35 @@ /* -- Methods -- */ +static int configuration_path_from_library_path(dynlink_path library_relative_path, const char relative_path[], size_t relative_path_size) +{ + static const char library_name[] = "metacall" +#if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) + "d" +#endif + ; + + dynlink_path library_path, join_path; + + size_t size, length = 0; + + if (dynlink_library_path(library_name, library_path, &length) != 0) + { + return 1; + } + + /* Get the current folder without the library */ + size = portability_path_get_directory_inplace(library_path, length + 1); + + /* Append the relative path */ + size = portability_path_join(library_path, size, relative_path, relative_path_size, join_path, PORTABILITY_PATH_SIZE); + + /* Make it cannonical */ + size = portability_path_canonical(join_path, size, library_relative_path, PORTABILITY_PATH_SIZE); + + return size == 0; +} + int configuration_initialize(const char *reader, const char *path, void *allocator) { configuration global = NULL; @@ -39,12 +68,20 @@ int configuration_initialize(const char *reader, const char *path, void *allocat return 1; } + /* The order of precedence is: + * 1) Environment variable + * 2) Default relative path to metacall library + * 3) Locate it relative to metacall library install path + * 4) Default installation path (if any) + */ if (path == NULL) { static const char configuration_path[] = CONFIGURATION_PATH; const char *env_path = environment_variable_get(configuration_path, NULL); + dynlink_path library_relative_path; + if (env_path != NULL) { global = configuration_object_initialize(CONFIGURATION_GLOBAL_SCOPE, env_path, NULL); @@ -56,9 +93,24 @@ int configuration_initialize(const char *reader, const char *path, void *allocat { static const char configuration_default_path[] = CONFIGURATION_DEFAULT_PATH; - global = configuration_object_initialize(CONFIGURATION_GLOBAL_SCOPE, configuration_default_path, NULL); + if (configuration_path_from_library_path(library_relative_path, configuration_default_path, sizeof(configuration_default_path)) == 0) + { + global = configuration_object_initialize(CONFIGURATION_GLOBAL_SCOPE, library_relative_path, NULL); + + path = library_relative_path; + } + } + + if (global == NULL) + { + static const char relative_path[] = ".." ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR "share" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR "metacall" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR CONFIGURATION_DEFAULT_PATH; + + if (configuration_path_from_library_path(library_relative_path, relative_path, sizeof(relative_path)) == 0) + { + global = configuration_object_initialize(CONFIGURATION_GLOBAL_SCOPE, library_relative_path, NULL); - path = configuration_default_path; + path = library_relative_path; + } } #if defined(CONFIGURATION_INSTALL_PATH) diff --git a/source/plugin/source/plugin_manager.c b/source/plugin/source/plugin_manager.c index cf6f2dc83..c2c78980a 100644 --- a/source/plugin/source/plugin_manager.c +++ b/source/plugin/source/plugin_manager.c @@ -94,9 +94,9 @@ int plugin_manager_initialize(plugin_manager manager, const char *name, const ch /* Initialize the library path */ if (manager->library_path == NULL) { - const char library_name[] = "metacall" + static const char library_name[] = "metacall" #if (!defined(NDEBUG) || defined(DEBUG) || defined(_DEBUG) || defined(__DEBUG) || defined(__DEBUG__)) - "d" + "d" #endif ; diff --git a/source/ports/py_port/CMakeLists.txt b/source/ports/py_port/CMakeLists.txt index 91477ab15..f09f85d84 100644 --- a/source/ports/py_port/CMakeLists.txt +++ b/source/ports/py_port/CMakeLists.txt @@ -106,6 +106,7 @@ test_environment_variables(${py_port_test_exec} ${TESTS_ENVIRONMENT_VARIABLES} ${TESTS_ENVIRONMENT_VARIABLES_RS} "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) # @@ -135,4 +136,5 @@ test_environment_variables(${py_port_test_exec_alone} "" "LOADER_SCRIPT_PATH=${LOADER_SCRIPT_PATH}" "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) From 4444b5ffc50152e7b4230f57395340a07e117dac Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 14 Jun 2025 12:33:33 +0200 Subject: [PATCH 361/487] Add environment variables for sanitizer. --- source/ports/py_port/CMakeLists.txt | 2 ++ source/ports/rb_port/CMakeLists.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/source/ports/py_port/CMakeLists.txt b/source/ports/py_port/CMakeLists.txt index f09f85d84..83bec99f4 100644 --- a/source/ports/py_port/CMakeLists.txt +++ b/source/ports/py_port/CMakeLists.txt @@ -106,6 +106,7 @@ test_environment_variables(${py_port_test_exec} ${TESTS_ENVIRONMENT_VARIABLES} ${TESTS_ENVIRONMENT_VARIABLES_RS} "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_ENVIRONMENT_VARIABLES} ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) @@ -136,5 +137,6 @@ test_environment_variables(${py_port_test_exec_alone} "" "LOADER_SCRIPT_PATH=${LOADER_SCRIPT_PATH}" "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_ENVIRONMENT_VARIABLES} ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) diff --git a/source/ports/rb_port/CMakeLists.txt b/source/ports/rb_port/CMakeLists.txt index 7a2ad6a76..0827203ac 100644 --- a/source/ports/rb_port/CMakeLists.txt +++ b/source/ports/rb_port/CMakeLists.txt @@ -89,5 +89,6 @@ test_environment_variables(${rb_port_test_executable} "" ${TESTS_ENVIRONMENT_VARIABLES} "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_ENVIRONMENT_VARIABLES} ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) From 1447a08581cd30f5a2d43345463a3224382b91cc Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 14 Jun 2025 13:04:32 +0200 Subject: [PATCH 362/487] Add sanitizer env vars for node port. --- source/ports/node_port/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/ports/node_port/CMakeLists.txt b/source/ports/node_port/CMakeLists.txt index 9a30aeeb8..1a04fc77e 100644 --- a/source/ports/node_port/CMakeLists.txt +++ b/source/ports/node_port/CMakeLists.txt @@ -266,4 +266,6 @@ test_environment_variables(${node_port_test_exec} ${TESTS_ENVIRONMENT_VARIABLES_RS} ${TESTS_ENVIRONMENT_VARIABLES_OPENSSL} "METACALL_INSTALL_PATH=${PROJECT_OUTPUT_DIR}" + ${TESTS_SANITIZER_ENVIRONMENT_VARIABLES} + ${TESTS_SANITIZER_PRELOAD_ENVIRONMENT_VARIABLES} ) From 734fe91b90a1fc6b057132b8a2c46c87105ffc4c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 17 Jun 2025 18:23:31 +0200 Subject: [PATCH 363/487] Solved deadlock in python windows. --- .../include/py_loader/py_loader_impl.h | 2 ++ .../loaders/py_loader/source/py_loader_impl.c | 25 +++++++++++++++---- .../loaders/py_loader/source/py_loader_port.c | 22 ++++++++++++++++ .../py_loader/source/py_loader_threading.cpp | 2 +- source/ports/py_port/metacall/api.py | 9 ++++++- 5 files changed, 53 insertions(+), 7 deletions(-) diff --git a/source/loaders/py_loader/include/py_loader/py_loader_impl.h b/source/loaders/py_loader/include/py_loader/py_loader_impl.h index f06b3d603..bc1a081ed 100644 --- a/source/loaders/py_loader/include/py_loader/py_loader_impl.h +++ b/source/loaders/py_loader/include/py_loader/py_loader_impl.h @@ -62,6 +62,8 @@ PY_LOADER_NO_EXPORT int py_loader_impl_finalizer_object(loader_impl impl, PyObje PY_LOADER_NO_EXPORT PyObject *py_loader_impl_capsule_new_null(void); +PY_LOADER_NO_EXPORT int py_loader_impl_initialize_asyncio_module(loader_impl_py py_impl, const int host); + #ifdef __cplusplus } #endif diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 477b7a4b0..1f9fc5e3d 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2610,7 +2610,12 @@ int py_loader_impl_initialize_argv(loader_impl_py py_impl, int argc, char **argv static void PyCFunction_dealloc(PyObject *obj) { - py_loader_thread_acquire(); + const int gil_status = PyGILState_Check(); + + if (gil_status == 0) + { + py_loader_thread_acquire(); + } /* Check if we are passing our own hook to the callback */ if (PyCFunction_Check(obj) && PyCFunction_GET_FUNCTION(obj) == py_loader_impl_function_type_invoke) @@ -2624,6 +2629,7 @@ static void PyCFunction_dealloc(PyObject *obj) loader_impl_py_function_type_invoke_state invoke_state = PyCapsule_GetPointer(invoke_state_capsule, NULL); + /* Release the GIL and let the destroy be executed outside of Python (if it belongs to another language) */ py_loader_thread_release(); value_type_destroy(invoke_state->callback); py_loader_thread_acquire(); @@ -2636,7 +2642,10 @@ static void PyCFunction_dealloc(PyObject *obj) /* Call to the original meth_dealloc function */ py_loader_impl_pycfunction_dealloc(obj); - py_loader_thread_release(); + if (gil_status == 0) + { + py_loader_thread_release(); + } } loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration config) @@ -2760,10 +2769,16 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi goto error_after_import; } - /* Initialize asyncio module for supporting async */ - if (py_loader_impl_initialize_asyncio_module(py_impl, host) != 0) +#if defined(WIN32) || defined(_WIN32) + /* On Windows, the initialization of this module deadlocks, we delay it to the port on this case */ + if (host == 0) +#endif { - goto error_after_thread_background_module; + /* Initialize asyncio module for supporting async */ + if (py_loader_impl_initialize_asyncio_module(py_impl, host) != 0) + { + goto error_after_thread_background_module; + } } /* Initialize custom dict type */ diff --git a/source/loaders/py_loader/source/py_loader_port.c b/source/loaders/py_loader/source/py_loader_port.c index a5bf798ff..8f60578e3 100644 --- a/source/loaders/py_loader/source/py_loader_port.c +++ b/source/loaders/py_loader/source/py_loader_port.c @@ -890,6 +890,26 @@ static PyObject *py_loader_port_atexit(PyObject *self, PyObject *args) return Py_ReturnNone(); } +static PyObject *py_loader_port_asyncio_initialize(PyObject *self, PyObject *args) +{ + loader_impl impl = loader_get_impl(py_loader_tag); + const int host = loader_impl_get_option_host(impl); + loader_impl_py py_impl = loader_impl_get(impl); + + (void)self; + (void)args; + + if (impl != NULL) + { + if (py_loader_impl_initialize_asyncio_module(py_impl, host) != 0) + { + PyErr_SetString(PyExc_RuntimeErrorPtr(), "Failed to initialize asyncio module of Python Loader on MetaCall."); + } + } + + return Py_ReturnNone(); +} + static PyMethodDef metacall_methods[] = { { "metacall_load_from_file", py_loader_port_load_from_file, METH_VARARGS, "Loads a script from file." }, @@ -913,6 +933,8 @@ static PyMethodDef metacall_methods[] = { "Get the data which a value of type Pointer is pointing to." }, { "py_loader_port_atexit", py_loader_port_atexit, METH_NOARGS, "At exit function that will be executed when Python is host, for internal cleanup purposes." }, + { "py_loader_port_asyncio_initialize", py_loader_port_asyncio_initialize, METH_NOARGS, + "Initialization function that will be executed when Python is host, for internal initialization purposes." }, { NULL, NULL, 0, NULL } }; diff --git a/source/loaders/py_loader/source/py_loader_threading.cpp b/source/loaders/py_loader/source/py_loader_threading.cpp index 1b4041fbe..64a0ab7fb 100644 --- a/source/loaders/py_loader/source/py_loader_threading.cpp +++ b/source/loaders/py_loader/source/py_loader_threading.cpp @@ -69,7 +69,7 @@ int py_loader_thread_initialize(const int host) if (host == 1) { - int gil_status = PyGILState_Check(); + const int gil_status = PyGILState_Check(); PyGILState_STATE gstate = PyGILState_Ensure(); main_thread_state = PyThreadState_Get(); diff --git a/source/ports/py_port/metacall/api.py b/source/ports/py_port/metacall/api.py index 80586c86e..83f28da45 100644 --- a/source/ports/py_port/metacall/api.py +++ b/source/ports/py_port/metacall/api.py @@ -95,7 +95,14 @@ def metacall_module_load(): # Python Port must have been loaded at this point if 'py_port_impl_module' in sys.modules: - return sys.modules['py_port_impl_module'] + port = sys.modules['py_port_impl_module'] + + # For some reason, Windows deadlocks on initializing asyncio + # but if it is delayed, it works, so we initialize it after here + if sys.platform == 'win32': + port.py_loader_port_asyncio_initialize() + + return port else: raise ImportError( 'MetaCall was found but failed to load' From c1e74c827dd940d5b2c605bcf71883ea80217f27 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 17 Jun 2025 22:37:58 +0200 Subject: [PATCH 364/487] Trying to solve configuration issues. --- source/configuration/source/configuration.c | 15 +++++++++++++++ .../configuration/source/configuration_object.c | 2 ++ 2 files changed, 17 insertions(+) diff --git a/source/configuration/source/configuration.c b/source/configuration/source/configuration.c index 8994e4bb0..f1f6e41f8 100644 --- a/source/configuration/source/configuration.c +++ b/source/configuration/source/configuration.c @@ -101,6 +101,21 @@ int configuration_initialize(const char *reader, const char *path, void *allocat } } +#if (defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER) + /* Windows MSVC stores the build folder in Debug/Release folders, so we must also check in the parent folder */ + if (global == NULL) + { + static const char configuration_default_path_win32[] = ".." ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR CONFIGURATION_DEFAULT_PATH; + + if (configuration_path_from_library_path(library_relative_path, configuration_default_path_win32, sizeof(configuration_default_path_win32)) == 0) + { + global = configuration_object_initialize(CONFIGURATION_GLOBAL_SCOPE, library_relative_path, NULL); + + path = library_relative_path; + } + } +#endif + if (global == NULL) { static const char relative_path[] = ".." ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR "share" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR "metacall" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR CONFIGURATION_DEFAULT_PATH; diff --git a/source/configuration/source/configuration_object.c b/source/configuration/source/configuration_object.c index f38298023..57c7ab9cd 100644 --- a/source/configuration/source/configuration_object.c +++ b/source/configuration/source/configuration_object.c @@ -96,6 +96,8 @@ configuration configuration_object_initialize(const char *name, const char *path if (path != NULL) { + log_write("metacall", LOG_LEVEL_DEBUG, "Trying to load configuration from %s", path); + config->source = configuration_object_read(path); if (config->source == NULL) From 4eda28a1f87c2778826a4ea28c36301211e771b2 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 17 Jun 2025 23:07:30 +0200 Subject: [PATCH 365/487] Add more debug info to configuration. --- source/configuration/source/configuration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/configuration/source/configuration.c b/source/configuration/source/configuration.c index f1f6e41f8..e72793a19 100644 --- a/source/configuration/source/configuration.c +++ b/source/configuration/source/configuration.c @@ -45,6 +45,8 @@ static int configuration_path_from_library_path(dynlink_path library_relative_pa return 1; } + log_write("metacall", LOG_LEVEL_DEBUG, "Finding configuration relative path %s to %s", relative_path, library_path); + /* Get the current folder without the library */ size = portability_path_get_directory_inplace(library_path, length + 1); @@ -102,7 +104,7 @@ int configuration_initialize(const char *reader, const char *path, void *allocat } #if (defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER) - /* Windows MSVC stores the build folder in Debug/Release folders, so we must also check in the parent folder */ + /* Windows MSVC when running the tests, it has the binaries in Debug / Release folders, so we must also check in the parent folder */ if (global == NULL) { static const char configuration_default_path_win32[] = ".." ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR CONFIGURATION_DEFAULT_PATH; From e5f58ed87f622935a9fe2910d2adb55ff5d04e88 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 17 Jun 2025 23:26:20 +0200 Subject: [PATCH 366/487] Add more debug info. --- source/portability/source/portability_library_path.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index 221d7a1cc..314e1fec2 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -196,6 +196,10 @@ int portability_library_path_find(const char name[], portability_library_path_st { const char *image_name = _dyld_get_image_name(image_index); + // TODO: Delete this + printf("Debug: %s\n", image_name); + fflush(stdout); + if (portability_library_path_ends_with(image_name, path) == 0) { size_t image_length = strnlen(image_name, PORTABILITY_PATH_SIZE); From 353e5b0cc447055fe53ecb01d5c8d339acae07b3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 17 Jun 2025 23:41:28 +0200 Subject: [PATCH 367/487] Debug macos. --- source/portability/source/portability_library_path.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index 314e1fec2..eb873d6c2 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -122,6 +122,8 @@ static int portability_library_path_list_phdr_callback(struct dl_phdr_info *info #endif +#include <stdio.h> + int portability_library_path_find(const char name[], portability_library_path_str path, size_t *length) { #if defined(unix) || defined(__unix__) || defined(__unix) || \ From 611fb049ea45cc09d832ec443a9c39c265b1f13c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 17 Jun 2025 23:54:48 +0200 Subject: [PATCH 368/487] Test with index 0. --- source/portability/source/portability_library_path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index eb873d6c2..a1dba149b 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -194,7 +194,7 @@ int portability_library_path_find(const char name[], portability_library_path_st } /* Start from 1 so we avoid the executable itself */ - for (image_index = 1; image_index < size; ++image_index) + for (image_index = 0; image_index < size; ++image_index) { const char *image_name = _dyld_get_image_name(image_index); From 8160473677bf3f7972e34bac7cc267dd2cf8c3af Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Jun 2025 00:12:05 +0200 Subject: [PATCH 369/487] Add more debug info in macos. --- source/portability/source/portability_library_path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index a1dba149b..5f457cbc0 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -199,7 +199,7 @@ int portability_library_path_find(const char name[], portability_library_path_st const char *image_name = _dyld_get_image_name(image_index); // TODO: Delete this - printf("Debug: %s\n", image_name); + printf("Debug: #%d / %d => %s\n", image_index, size, image_name); fflush(stdout); if (portability_library_path_ends_with(image_name, path) == 0) From c7a8ad3f0313ecb9b32707ac65471d36935469af Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Jun 2025 00:33:38 +0200 Subject: [PATCH 370/487] Add more debug info macos. --- source/portability/source/portability_library_path.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index 5f457cbc0..c94275d39 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -194,7 +194,7 @@ int portability_library_path_find(const char name[], portability_library_path_st } /* Start from 1 so we avoid the executable itself */ - for (image_index = 0; image_index < size; ++image_index) + for (image_index = 1; image_index < size; ++image_index) { const char *image_name = _dyld_get_image_name(image_index); @@ -202,7 +202,11 @@ int portability_library_path_find(const char name[], portability_library_path_st printf("Debug: #%d / %d => %s\n", image_index, size, image_name); fflush(stdout); - if (portability_library_path_ends_with(image_name, path) == 0) + printf("Debug ends with: %s | %s\n", image_name, path); + printf("Debug ends with: %s | %s\n", image_name, name); + fflush(stdout); + + if (portability_library_path_ends_with(image_name, name) == 0) { size_t image_length = strnlen(image_name, PORTABILITY_PATH_SIZE); @@ -218,6 +222,9 @@ int portability_library_path_find(const char name[], portability_library_path_st *length = image_length; } + printf("Debug ended with: %s | %s => %s\n", image_name, path, name); + fflush(stdout); + return 0; } } From 0e37d08553578bc879a026067263178a430475f3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Jun 2025 00:45:52 +0200 Subject: [PATCH 371/487] Solve issue with macos. --- source/portability/source/portability_library_path.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index c94275d39..0558c515d 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -189,8 +189,9 @@ int portability_library_path_find(const char name[], portability_library_path_st if (portability_library_path_ends_with(name, "so") == 0 && name_dylib_length < PORTABILITY_PATH_SIZE) { - memcpy(path, name, sizeof(char) * (name_length - 2)); - memcpy(path, dylib_suffix, sizeof(dylib_suffix)); + const size_t base_length = sizeof(char) * (name_length - 2); + memcpy(path, name, base_length); + memcpy(&path[base_length], dylib_suffix, sizeof(dylib_suffix)); } /* Start from 1 so we avoid the executable itself */ @@ -206,7 +207,7 @@ int portability_library_path_find(const char name[], portability_library_path_st printf("Debug ends with: %s | %s\n", image_name, name); fflush(stdout); - if (portability_library_path_ends_with(image_name, name) == 0) + if (portability_library_path_ends_with(image_name, path) == 0) { size_t image_length = strnlen(image_name, PORTABILITY_PATH_SIZE); @@ -222,7 +223,7 @@ int portability_library_path_find(const char name[], portability_library_path_st *length = image_length; } - printf("Debug ended with: %s | %s => %s\n", image_name, path, name); + printf("------------------------------- Debug ended with: %s | %s => %s\n", image_name, path, name); fflush(stdout); return 0; From a6851fa1526b720f4b3f3f6d785c2a2ad63d5568 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Jun 2025 00:59:03 +0200 Subject: [PATCH 372/487] Solved issues on macos. --- .../portability/source/portability_library_path.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/source/portability/source/portability_library_path.c b/source/portability/source/portability_library_path.c index 0558c515d..cda5f9cb3 100644 --- a/source/portability/source/portability_library_path.c +++ b/source/portability/source/portability_library_path.c @@ -122,8 +122,6 @@ static int portability_library_path_list_phdr_callback(struct dl_phdr_info *info #endif -#include <stdio.h> - int portability_library_path_find(const char name[], portability_library_path_str path, size_t *length) { #if defined(unix) || defined(__unix__) || defined(__unix) || \ @@ -199,14 +197,6 @@ int portability_library_path_find(const char name[], portability_library_path_st { const char *image_name = _dyld_get_image_name(image_index); - // TODO: Delete this - printf("Debug: #%d / %d => %s\n", image_index, size, image_name); - fflush(stdout); - - printf("Debug ends with: %s | %s\n", image_name, path); - printf("Debug ends with: %s | %s\n", image_name, name); - fflush(stdout); - if (portability_library_path_ends_with(image_name, path) == 0) { size_t image_length = strnlen(image_name, PORTABILITY_PATH_SIZE); @@ -223,9 +213,6 @@ int portability_library_path_find(const char name[], portability_library_path_st *length = image_length; } - printf("------------------------------- Debug ended with: %s | %s => %s\n", image_name, path, name); - fflush(stdout); - return 0; } } From 46b74adeab2ecb915306f16536e0ce9a18b1a3dd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Jun 2025 01:01:50 +0200 Subject: [PATCH 373/487] Update version to v0.9.9. Long live to Argentum Online. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b5d0ec558..6f060dcbc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.8 \ No newline at end of file +0.9.9 \ No newline at end of file From a090ae5b810ce40394bd574bdd8e704cbb347a88 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Jun 2025 19:42:10 +0200 Subject: [PATCH 374/487] Improve debugging tools for threading in python loader. --- .../loaders/py_loader/source/py_loader_impl.c | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 1f9fc5e3d..a5fa1d9ff 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -2396,6 +2396,13 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) "import asyncio\n" "import threading\n" "import sys\n" +#if DEBUG_ENABLED + "def trace_calls(frame, event, arg):\n" + " t = threading.current_thread()\n" + " print(f\"[{t.native_id}] {t.name}: {event} {frame.f_code.co_name}\")\n" + "threading.settrace(trace_calls)\n" + "sys.settrace(trace_calls)\n" +#endif "class ThreadLoop:\n" " def __init__(self, loop, t):\n" " self.loop = loop\n" @@ -2410,13 +2417,26 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) " tl.loop.call_soon_threadsafe(f.set_exception, exception)\n" "def background_loop(loop):\n" " asyncio.set_event_loop(loop)\n" - " loop.run_forever()\n" - " loop.run_until_complete(loop.shutdown_asyncgens())\n" - " loop.stop()\n" - " loop.close()\n" + " try:\n" + " loop.run_forever()\n" + " finally:\n" +#if DEBUG_ENABLED + " print('Loop stopping, cleaning up...', flush=True)\n" +#endif + " try:\n" + " loop.run_until_complete(loop.shutdown_asyncgens())\n" + " except Exception as e:\n" + " print(f\"Error during shutdown_asyncgens: {e}\", flush=True)\n" + " loop.close()\n" +#if DEBUG_ENABLED + " print('Event loop closed', flush=True)\n" +#endif "def start_background_loop():\n" " loop = asyncio.new_event_loop()\n" - " t = threading.Thread(target=background_loop, name='MetaCall asyncio event loop', args=(loop,), daemon=False)\n" +#if DEBUG_ENABLED + " loop.set_debug(True)\n" +#endif + " t = threading.Thread(target=background_loop, name='MetaCallEventLoop', args=(loop,), daemon=False)\n" " t.start()\n" " return ThreadLoop(loop, t)\n" "def send_background_loop(tl, coro, callback, capsule):\n" @@ -2427,9 +2447,18 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) /* Stop background loop enqueues at the end of the event loop the task to be finished, so effectively it waits until the event loop finishes */ "def stop_background_loop(tl, join):\n" +#if DEBUG_ENABLED + " print('Requesting loop to stop', flush=True)\n" +#endif " tl.loop.call_soon_threadsafe(tl.loop.stop)\n" " if join:\n" +#if DEBUG_ENABLED + " print('Waiting for thread to join', flush=True)\n" +#endif " tl.t.join()\n" +#if DEBUG_ENABLED + " print('Background loop stopped', flush=True)\n" +#endif "def atexit_background_loop(tl):\n" /* Checks if py_port_impl_module contains py_loader_port_atexit and executes it */ " getattr(sys.modules.get('py_port_impl_module'), 'py_loader_port_atexit', lambda: None)()\n" From e214b903397891e04d909be61f16f9c0e6c46c67 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 18 Jun 2025 19:42:44 +0200 Subject: [PATCH 375/487] Exit properly on CLI error. --- source/cli/metacallcli/source/application.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/cli/metacallcli/source/application.cpp b/source/cli/metacallcli/source/application.cpp index a8389d003..098f63900 100644 --- a/source/cli/metacallcli/source/application.cpp +++ b/source/cli/metacallcli/source/application.cpp @@ -49,7 +49,7 @@ void application::repl() } /* Register exit function */ - auto exit = [](size_t argc, void *args[], void *data) -> void * { + auto exit_command = [](size_t argc, void *args[], void *data) -> void * { (void)args; (void)data; @@ -67,11 +67,12 @@ void application::repl() return NULL; }; - int result = metacall_register_loaderv(metacall_loader("ext"), plugin_repl_handle, "exit", exit, METACALL_INVALID, 0, NULL); + int result = metacall_register_loaderv(metacall_loader("ext"), plugin_repl_handle, "exit", exit_command, METACALL_INVALID, 0, NULL); if (result != 0) { std::cout << "Exit function was not registered properly, return code: " << result << std::endl; + exit(1); } else { @@ -268,7 +269,7 @@ application::application(int argc, char *argv[]) : if (metacall_initialize() != 0) { /* Exit from application */ - return; + exit(1); } /* Initialize MetaCall arguments */ @@ -372,7 +373,7 @@ void application::arguments_parse(std::vector<std::string> &arguments) { /* Stop loading more scripts */ std::cout << "Error: Failed to load script '" << script << "' with loader '" << safe_tag << "'" << std::endl; - return; + exit(1); } } } From 578dcfdc250962665581bb31b88c8283cb052b03 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 20 Jun 2025 00:37:47 +0200 Subject: [PATCH 376/487] Improve issues with ruby port. --- .../loaders/rb_loader/source/rb_loader_impl.c | 265 ++++++++++-------- .../loaders/rb_loader/source/rb_loader_port.c | 25 +- source/ports/rb_port/package/lib/metacall.rb | 24 ++ 3 files changed, 195 insertions(+), 119 deletions(-) diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index d35208391..325844066 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -89,6 +89,13 @@ typedef struct loader_impl_rb_funcall_protect_type ID id; } * loader_impl_rb_funcall_protect; +typedef struct loader_impl_rb_discover_module_protect_type +{ + loader_impl impl; + loader_impl_rb_module rb_module; + context ctx; +} * loader_impl_rb_discover_module_protect; + static class_interface rb_class_interface_singleton(void); static object_interface rb_object_interface_singleton(void); static void rb_loader_impl_discover_methods(klass c, VALUE cls, const char *class_name_str, enum class_visibility_id visibility, const char *method_type_str, VALUE methods, int (*register_method)(klass, method)); @@ -1255,7 +1262,9 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path { #define rb_str_new_static_size(str) rb_str_new_static(str, sizeof(str) - 1) - VALUE wrapped_code = rb_str_plus(rb_str_new_static_size("module "), module_name); + VALUE wrapped_code = rb_str_new_static_size("require 'rubygems'\n"); + wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("module ")); + wrapped_code = rb_str_plus(wrapped_code, module_name); wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("\n")); wrapped_code = rb_str_plus(wrapped_code, module_data); wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("\nend")); @@ -1509,58 +1518,61 @@ void rb_loader_impl_discover_methods(klass c, VALUE cls, const char *class_name_ VALUE name = rb_sym2str(rb_method); const char *method_name_str = RSTRING_PTR(name); - VALUE instance_method = rb_funcall(cls, rb_intern(method_type_str), 1, rb_method); - VALUE parameters = rb_funcallv(instance_method, rb_intern("parameters"), 0, NULL); - size_t args_it, args_count = RARRAY_LEN(parameters); - - log_write("metacall", LOG_LEVEL_DEBUG, "Method '%s' inside '%s' of type %s with %" PRIuS " parameters", method_name_str, class_name_str, method_type_str, args_count); - - /* - * TODO: - * Another alternative (for supporting types), which is not used in the current implementation, - * but it can simplify the parser, it's the following: - * - * - For classes: origin_file, definition_line = MyClass.instance_method(:foo).source_location - * - For plain functions: origin_file, definition_line = method(:foo).source_location - * - * Then: - * method_signature = IO.readlines(origin_file)[definition_line.pred] - * - * Now we have only the method signature, this is going to be less problematic than parsing - * the whole file as we are doing now (although for multi-line signatures it's going to be - * a little bit more complicated...) - * - * We can switch to completely duck typed approach (refactoring the tests) or we can use this - * simplified parsing approach and maintain types - */ - - method m = method_create(c, - method_name_str, - args_count, - (method_impl)instance_method, - visibility, - SYNCHRONOUS, /* There is not async functions in Ruby */ - NULL); - - signature s = method_signature(m); - - for (args_it = 0; args_it < args_count; ++args_it) + if (rb_respond_to(cls, RB_SYM2ID(rb_method))) { - VALUE parameter_pair = rb_ary_entry(parameters, args_it); - - if (RARRAY_LEN(parameter_pair) == 2) + VALUE instance_method = rb_funcall(cls, rb_intern(method_type_str), 1, rb_method); + VALUE parameters = rb_funcallv(instance_method, rb_intern("parameters"), 0, NULL); + size_t args_it, args_count = RARRAY_LEN(parameters); + + log_write("metacall", LOG_LEVEL_DEBUG, "Method '%s' inside '%s' of type %s with %" PRIuS " parameters", method_name_str, class_name_str, method_type_str, args_count); + + /* + * TODO: + * Another alternative (for supporting types), which is not used in the current implementation, + * but it can simplify the parser, it's the following: + * + * - For classes: origin_file, definition_line = MyClass.instance_method(:foo).source_location + * - For plain functions: origin_file, definition_line = method(:foo).source_location + * + * Then: + * method_signature = IO.readlines(origin_file)[definition_line.pred] + * + * Now we have only the method signature, this is going to be less problematic than parsing + * the whole file as we are doing now (although for multi-line signatures it's going to be + * a little bit more complicated...) + * + * We can switch to completely duck typed approach (refactoring the tests) or we can use this + * simplified parsing approach and maintain types + */ + + method m = method_create(c, + method_name_str, + args_count, + (method_impl)instance_method, + visibility, + SYNCHRONOUS, /* There is not async functions in Ruby */ + NULL); + + signature s = method_signature(m); + + for (args_it = 0; args_it < args_count; ++args_it) { - VALUE parameter_name_id = rb_ary_entry(parameter_pair, 1); - VALUE parameter_name = rb_sym2str(parameter_name_id); - const char *parameter_name_str = RSTRING_PTR(parameter_name); + VALUE parameter_pair = rb_ary_entry(parameters, args_it); - signature_set(s, args_it, parameter_name_str, NULL); + if (RARRAY_LEN(parameter_pair) == 2) + { + VALUE parameter_name_id = rb_ary_entry(parameter_pair, 1); + VALUE parameter_name = rb_sym2str(parameter_name_id); + const char *parameter_name_str = RSTRING_PTR(parameter_name); + + signature_set(s, args_it, parameter_name_str, NULL); + } } - } - if (register_method(c, m) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Ruby failed to register method '%s' in class '%s'", method_name_str, class_name_str); + if (register_method(c, m) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby failed to register method '%s' in class '%s'", method_name_str, class_name_str); + } } } } @@ -1587,15 +1599,12 @@ void rb_loader_impl_discover_attributes(klass c, const char *class_name_str, VAL } } -int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_module, context ctx) +static VALUE rb_loader_impl_discover_module_protect(VALUE args) { - log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader discovering:"); - - if (rb_module->empty == 0) - { - return 0; - } - + loader_impl_rb_discover_module_protect protect = (loader_impl_rb_discover_module_protect)args; + loader_impl impl = protect->impl; + loader_impl_rb_module rb_module = protect->rb_module; + context ctx = protect->ctx; VALUE instance_methods = rb_funcallv(rb_module->module, rb_intern("instance_methods"), 0, NULL); VALUE methods_size = rb_funcallv(instance_methods, rb_intern("size"), 0, NULL); int index, size = FIX2INT(methods_size); @@ -1630,7 +1639,7 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo if (scope_define(sp, function_name(f), v) != 0) { value_type_destroy(v); - return 1; + return INT2NUM(1); } else { @@ -1640,12 +1649,12 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo } else { - return 1; + return INT2NUM(1); } } else { - return 1; + return INT2NUM(1); } } } @@ -1659,80 +1668,106 @@ int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_mo { VALUE constant = rb_ary_entry(constants, index); - if (constant != Qnil) + if (constant != Qnil && RB_TYPE_P(constant, T_SYMBOL)) { - if (RB_TYPE_P(constant, T_SYMBOL)) - { - VALUE class_name = rb_sym2str(constant); - const char *class_name_str = RSTRING_PTR(class_name); - VALUE cls = rb_const_get_from(rb_module->module, rb_intern(class_name_str)); - loader_impl_rb_class rb_cls = malloc(sizeof(struct loader_impl_rb_class_type)); - klass c = class_create(class_name_str, ACCESSOR_TYPE_DYNAMIC, rb_cls, &rb_class_interface_singleton); + VALUE class_name = rb_sym2str(constant); + const char *class_name_str = RSTRING_PTR(class_name); + VALUE cls = rb_const_get_from(rb_module->module, rb_intern(class_name_str)); + loader_impl_rb_class rb_cls = malloc(sizeof(struct loader_impl_rb_class_type)); + klass c = class_create(class_name_str, ACCESSOR_TYPE_DYNAMIC, rb_cls, &rb_class_interface_singleton); - rb_cls->class = cls; - rb_cls->impl = impl; + rb_cls->class = cls; + rb_cls->impl = impl; - /* Discover methods */ - VALUE argv[1] = { Qtrue }; /* include_superclasses ? Qtrue : Qfalse; */ - VALUE methods = rb_class_public_instance_methods(1, argv, cls); /* argc, argv, cls */ - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "instance_method", methods, &class_register_method); + /* Discover methods */ + VALUE argv[1] = { Qtrue }; /* include_superclasses ? Qtrue : Qfalse; */ + VALUE methods = rb_class_public_instance_methods(1, argv, cls); /* argc, argv, cls */ + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "instance_method", methods, &class_register_method); - methods = rb_class_protected_instance_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PROTECTED, "instance_method", methods, &class_register_method); + methods = rb_class_protected_instance_methods(1, argv, cls); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PROTECTED, "instance_method", methods, &class_register_method); - methods = rb_class_private_instance_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PRIVATE, "instance_method", methods, &class_register_method); + methods = rb_class_private_instance_methods(1, argv, cls); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PRIVATE, "instance_method", methods, &class_register_method); #if RUBY_VERSION_MAJOR == 3 && RUBY_VERSION_MINOR >= 0 - methods = rb_obj_public_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "singleton_method", methods, &class_register_static_method); + methods = rb_obj_public_methods(1, argv, cls); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "singleton_method", methods, &class_register_static_method); - methods = rb_obj_protected_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PROTECTED, "singleton_method", methods, &class_register_static_method); + methods = rb_obj_protected_methods(1, argv, cls); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PROTECTED, "singleton_method", methods, &class_register_static_method); - methods = rb_obj_private_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PRIVATE, "singleton_method", methods, &class_register_static_method); + methods = rb_obj_private_methods(1, argv, cls); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PRIVATE, "singleton_method", methods, &class_register_static_method); #else - methods = rb_obj_singleton_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "singleton_method", methods, &class_register_static_method); + methods = rb_obj_singleton_methods(1, argv, cls); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "method", methods, &class_register_static_method); #endif - /* Discover attributes */ - VALUE static_attributes = rb_mod_class_variables(1, argv, cls); - rb_loader_impl_discover_attributes(c, class_name_str, static_attributes, &class_register_static_attribute); - - VALUE instance_attributes = rb_obj_instance_variables(cls); - rb_loader_impl_discover_attributes(c, class_name_str, instance_attributes, &class_register_attribute); - - /* Define default constructor. Ruby only supports one constructor, a - * method called 'initialize'. It can have arguments but when inspected via - * reflection, the signature is variadic arguments and cannot be inspected: - * - * MyClass.methods(:initialize).parameters = [[:rest]] # variadic args notation in Ruby - * - * Due to this, we will always register only one default constructor without arguments - * which will take all the arguments when invoking 'new' and apply them as variadic. - */ - constructor ctor = constructor_create(0, VISIBILITY_PUBLIC); - - if (class_register_constructor(c, ctor) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Failed to register default constructor in class %s", class_name_str); - } + /* Discover attributes */ + VALUE static_attributes = rb_mod_class_variables(1, argv, cls); + rb_loader_impl_discover_attributes(c, class_name_str, static_attributes, &class_register_static_attribute); + + VALUE instance_attributes = rb_obj_instance_variables(cls); + rb_loader_impl_discover_attributes(c, class_name_str, instance_attributes, &class_register_attribute); + + /* Define default constructor. Ruby only supports one constructor, a + * method called 'initialize'. It can have arguments but when inspected via + * reflection, the signature is variadic arguments and cannot be inspected: + * + * MyClass.methods(:initialize).parameters = [[:rest]] # variadic args notation in Ruby + * + * Due to this, we will always register only one default constructor without arguments + * which will take all the arguments when invoking 'new' and apply them as variadic. + */ + constructor ctor = constructor_create(0, VISIBILITY_PUBLIC); + + if (class_register_constructor(c, ctor) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to register default constructor in class %s", class_name_str); + } - scope sp = context_scope(ctx); - value v = value_create_class(c); + scope sp = context_scope(ctx); + value v = value_create_class(c); - if (scope_define(sp, class_name_str, v) != 0) - { - value_type_destroy(v); - return 1; - } + if (scope_define(sp, class_name_str, v) != 0) + { + value_type_destroy(v); + return INT2NUM(1); } } } - return 0; + return INT2NUM(0); +} + +int rb_loader_impl_discover_module(loader_impl impl, loader_impl_rb_module rb_module, context ctx) +{ + struct loader_impl_rb_discover_module_protect_type protect; + int state; + VALUE result; + + log_write("metacall", LOG_LEVEL_DEBUG, "Ruby loader discovering:"); + + if (rb_module->empty == 0) + { + return 0; + } + + protect.impl = impl; + protect.rb_module = rb_module; + protect.ctx = ctx; + + result = rb_protect(rb_loader_impl_discover_module_protect, (VALUE)&protect, &state); + + if (state != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby module discover failed"); + rb_loader_impl_print_exception(); + return 1; + } + + return NUM2INT(result); } int rb_loader_impl_discover(loader_impl impl, loader_handle handle, context ctx) diff --git a/source/loaders/rb_loader/source/rb_loader_port.c b/source/loaders/rb_loader/source/rb_loader_port.c index 0b3b97c7a..18f957f0d 100644 --- a/source/loaders/rb_loader/source/rb_loader_port.c +++ b/source/loaders/rb_loader/source/rb_loader_port.c @@ -29,7 +29,7 @@ static loader_impl rb_loader_impl = NULL; -VALUE rb_loader_port_load_from_file(VALUE self, VALUE tag_value, VALUE paths_value) +static VALUE rb_loader_port_load_from_file(VALUE self, VALUE tag_value, VALUE paths_value) { const char *tag; const char **paths; @@ -96,7 +96,7 @@ VALUE rb_loader_port_load_from_file(VALUE self, VALUE tag_value, VALUE paths_val return LONG2NUM(result); } -VALUE rb_loader_port_load_from_memory(VALUE self, VALUE tag_value, VALUE buffer_value) +static VALUE rb_loader_port_load_from_memory(VALUE self, VALUE tag_value, VALUE buffer_value) { const char *tag; const char *buffer; @@ -138,7 +138,7 @@ VALUE rb_loader_port_load_from_memory(VALUE self, VALUE tag_value, VALUE buffer_ return LONG2NUM(result); } -VALUE rb_loader_port_metacall(int argc, VALUE *argv, VALUE self) +static VALUE rb_loader_port_metacall(int argc, VALUE *argv, VALUE self) { const char *function_name; size_t args_size, iterator; @@ -195,7 +195,7 @@ VALUE rb_loader_port_metacall(int argc, VALUE *argv, VALUE self) return rb_type_serialize(result); } -VALUE rb_loader_port_inspect(VALUE self) +static VALUE rb_loader_port_inspect(VALUE self) { VALUE result; size_t size = 0; @@ -232,6 +232,22 @@ VALUE rb_loader_port_inspect(VALUE self) return result; } +static VALUE rb_loader_port_atexit(VALUE self) +{ + static int atexit_executed = 0; + + (void)self; + + if (atexit_executed == 0 && rb_loader_impl_destroy(rb_loader_impl) != 0) + { + rb_raise(rb_eSystemExit, "Failed to destroy Ruby Loader from MetaCall"); + } + + atexit_executed = 1; + + return Qnil; +} + int rb_loader_port_initialize(loader_impl impl) { VALUE rb_loader_port; @@ -251,6 +267,7 @@ int rb_loader_port_initialize(loader_impl impl) rb_define_module_function(rb_loader_port, "metacall_load_from_memory", rb_loader_port_load_from_memory, 2); rb_define_module_function(rb_loader_port, "metacall", rb_loader_port_metacall, -1); rb_define_module_function(rb_loader_port, "metacall_inspect", rb_loader_port_inspect, 0); + rb_define_module_function(rb_loader_port, "rb_loader_port_atexit", rb_loader_port_atexit, 0); rb_loader_impl = impl; diff --git a/source/ports/rb_port/package/lib/metacall.rb b/source/ports/rb_port/package/lib/metacall.rb index ba36cea95..f54e37ca5 100644 --- a/source/ports/rb_port/package/lib/metacall.rb +++ b/source/ports/rb_port/package/lib/metacall.rb @@ -99,6 +99,8 @@ def metacall_module_load # Check again if the port was loaded if defined?(MetaCallRbLoaderPort) + + return MetaCallRbLoaderPort else raise LoadError, 'MetaCall was found but failed to load MetaCallRbLoaderPort' @@ -108,6 +110,28 @@ def metacall_module_load # Initialize the MetaCall Ruby Port metacall_module_load + # When we are running MetaCall with Ruby, we should hook the at exit method + if ENV.key?('METACALL_HOST') + module Kernel + alias_method :original_exit, :exit + alias_method :original_exit_bang, :exit! + + def exit(status = true) + if defined?(MetaCallRbLoaderPort) && MetaCall.respond_to?(:rb_loader_port_atexit) + MetaCallRbLoaderPort.rb_loader_port_atexit + end + original_exit(status) + end + + def exit!(status = true) + if defined?(MetaCallRbLoaderPort) && MetaCall.respond_to?(:rb_loader_port_atexit) + MetaCallRbLoaderPort.rb_loader_port_atexit + end + original_exit_bang(status) + end + end + end + public def metacall_load_from_file(tag, paths) From 4eea25b2dc58b6013db3061e0d0339d13e375ab9 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 20 Jun 2025 17:21:58 +0200 Subject: [PATCH 377/487] Solve issues with ruby. --- .../loaders/rb_loader/source/rb_loader_impl.c | 166 ++++++++++++------ source/ports/rb_port/package/lib/metacall.rb | 2 - source/scripts/ruby/klass/source/klass.rb | 2 - 3 files changed, 109 insertions(+), 61 deletions(-) diff --git a/source/loaders/rb_loader/source/rb_loader_impl.c b/source/loaders/rb_loader/source/rb_loader_impl.c index 325844066..9d0e43afb 100644 --- a/source/loaders/rb_loader/source/rb_loader_impl.c +++ b/source/loaders/rb_loader/source/rb_loader_impl.c @@ -968,7 +968,12 @@ loader_impl_data rb_loader_impl_initialize(loader_impl impl, configuration confi ruby_init(); - ruby_init_loadpath(); + /* Apparently ruby_init_loadpath is not enough to initialize the builtins and gems, + * so we use ruby_options instead + */ + /* ruby_init_loadpath(); */ + + ruby_options(argc, argv); } if (rb_loader_impl_initialize_types(impl) != 0) @@ -1098,7 +1103,7 @@ VALUE rb_loader_impl_module_eval_protect(VALUE args) return rb_mod_module_eval(protect->argc, protect->argv, protect->module); } -void rb_loader_impl_print_exception(void) +static void rb_loader_impl_print_exception(void) { VALUE exception = rb_gv_get("$!"); @@ -1262,12 +1267,43 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path { #define rb_str_new_static_size(str) rb_str_new_static(str, sizeof(str) - 1) - VALUE wrapped_code = rb_str_new_static_size("require 'rubygems'\n"); + static const char header[] = + /* AtExitInterceptor is needed due to Ruby's nature, it calls + * at_exit during ruby_cleanup and due to this, scripts depending on + * this feature like unit tests will run after MetaCall has started + * to destroy the objects of reflect associated to the loader. + * In order to avoid this, we hook into at_exit and we execute at + * the end of the main script execution. + */ + "module AtExitInterceptor\n" + " @captured_exit_procs = []\n" + " def self.captured_exit_procs\n" + " @captured_exit_procs\n" + " end\n" + /* Replace Kernel.at_exit */ + " module ::Kernel\n" + " alias_method :__original_at_exit, :at_exit\n" + " def at_exit(&block)\n" + " AtExitInterceptor.captured_exit_procs << block\n" + " nil\n" + " end\n" + " end\n" + /* Manual runner */ + " def self.run_all\n" + /* Run in reverse order to match Ruby's actual behavior */ + " @captured_exit_procs.reverse_each do |proc|\n" + " proc.call\n" + " end\n" + " end\n" + "end\n"; + + VALUE wrapped_code = rb_str_new_static_size(header); wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("module ")); wrapped_code = rb_str_plus(wrapped_code, module_name); wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("\n")); wrapped_code = rb_str_plus(wrapped_code, module_data); - wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("\nend")); + wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("\nend\n")); + wrapped_code = rb_str_plus(wrapped_code, rb_str_new_static_size("AtExitInterceptor.run_all\n")); #undef rb_str_new_static_size @@ -1278,9 +1314,28 @@ loader_handle rb_loader_impl_load_from_file(loader_impl impl, const loader_path if (state != 0) { - log_write("metacall", LOG_LEVEL_ERROR, "Ruby evaluation failed %s", paths[0]); - rb_loader_impl_print_exception(); - goto load_error; + VALUE err = rb_errinfo(); + VALUE system_exit_class = rb_const_get(rb_cObject, rb_intern("SystemExit")); + + /* Check if the script exited */ + if (rb_obj_is_kind_of(err, system_exit_class)) + { + VALUE status = rb_funcall(err, rb_intern("status"), 0); + int exit_status = NUM2INT(status); + + if (exit_status != 0) + { + exit(exit_status); + } + + rb_set_errinfo(Qnil); + } + else + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby evaluation failed %s", paths[0]); + rb_loader_impl_print_exception(); + goto load_error; + } } /* Get the module reference */ @@ -1518,61 +1573,58 @@ void rb_loader_impl_discover_methods(klass c, VALUE cls, const char *class_name_ VALUE name = rb_sym2str(rb_method); const char *method_name_str = RSTRING_PTR(name); - if (rb_respond_to(cls, RB_SYM2ID(rb_method))) - { - VALUE instance_method = rb_funcall(cls, rb_intern(method_type_str), 1, rb_method); - VALUE parameters = rb_funcallv(instance_method, rb_intern("parameters"), 0, NULL); - size_t args_it, args_count = RARRAY_LEN(parameters); + VALUE instance_method = rb_funcall(cls, rb_intern(method_type_str), 1, rb_method); + VALUE parameters = rb_funcallv(instance_method, rb_intern("parameters"), 0, NULL); + size_t args_it, args_count = RARRAY_LEN(parameters); - log_write("metacall", LOG_LEVEL_DEBUG, "Method '%s' inside '%s' of type %s with %" PRIuS " parameters", method_name_str, class_name_str, method_type_str, args_count); + log_write("metacall", LOG_LEVEL_DEBUG, "Method '%s' inside '%s' of type %s with %" PRIuS " parameters", method_name_str, class_name_str, method_type_str, args_count); - /* - * TODO: - * Another alternative (for supporting types), which is not used in the current implementation, - * but it can simplify the parser, it's the following: - * - * - For classes: origin_file, definition_line = MyClass.instance_method(:foo).source_location - * - For plain functions: origin_file, definition_line = method(:foo).source_location - * - * Then: - * method_signature = IO.readlines(origin_file)[definition_line.pred] - * - * Now we have only the method signature, this is going to be less problematic than parsing - * the whole file as we are doing now (although for multi-line signatures it's going to be - * a little bit more complicated...) - * - * We can switch to completely duck typed approach (refactoring the tests) or we can use this - * simplified parsing approach and maintain types - */ + /* + * TODO: + * Another alternative (for supporting types), which is not used in the current implementation, + * but it can simplify the parser, it's the following: + * + * - For classes: origin_file, definition_line = MyClass.instance_method(:foo).source_location + * - For plain functions: origin_file, definition_line = method(:foo).source_location + * + * Then: + * method_signature = IO.readlines(origin_file)[definition_line.pred] + * + * Now we have only the method signature, this is going to be less problematic than parsing + * the whole file as we are doing now (although for multi-line signatures it's going to be + * a little bit more complicated...) + * + * We can switch to completely duck typed approach (refactoring the tests) or we can use this + * simplified parsing approach and maintain types + */ - method m = method_create(c, - method_name_str, - args_count, - (method_impl)instance_method, - visibility, - SYNCHRONOUS, /* There is not async functions in Ruby */ - NULL); + method m = method_create(c, + method_name_str, + args_count, + (method_impl)instance_method, + visibility, + SYNCHRONOUS, /* There is not async functions in Ruby */ + NULL); - signature s = method_signature(m); + signature s = method_signature(m); - for (args_it = 0; args_it < args_count; ++args_it) - { - VALUE parameter_pair = rb_ary_entry(parameters, args_it); + for (args_it = 0; args_it < args_count; ++args_it) + { + VALUE parameter_pair = rb_ary_entry(parameters, args_it); - if (RARRAY_LEN(parameter_pair) == 2) - { - VALUE parameter_name_id = rb_ary_entry(parameter_pair, 1); - VALUE parameter_name = rb_sym2str(parameter_name_id); - const char *parameter_name_str = RSTRING_PTR(parameter_name); + if (RARRAY_LEN(parameter_pair) == 2) + { + VALUE parameter_name_id = rb_ary_entry(parameter_pair, 1); + VALUE parameter_name = rb_sym2str(parameter_name_id); + const char *parameter_name_str = RSTRING_PTR(parameter_name); - signature_set(s, args_it, parameter_name_str, NULL); - } + signature_set(s, args_it, parameter_name_str, NULL); } + } - if (register_method(c, m) != 0) - { - log_write("metacall", LOG_LEVEL_ERROR, "Ruby failed to register method '%s' in class '%s'", method_name_str, class_name_str); - } + if (register_method(c, m) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Ruby failed to register method '%s' in class '%s'", method_name_str, class_name_str); } } } @@ -1680,7 +1732,7 @@ static VALUE rb_loader_impl_discover_module_protect(VALUE args) rb_cls->impl = impl; /* Discover methods */ - VALUE argv[1] = { Qtrue }; /* include_superclasses ? Qtrue : Qfalse; */ + VALUE argv[1] = { Qfalse /* include_superclasses ? Qtrue : Qfalse; */ }; VALUE methods = rb_class_public_instance_methods(1, argv, cls); /* argc, argv, cls */ rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "instance_method", methods, &class_register_method); @@ -1692,13 +1744,13 @@ static VALUE rb_loader_impl_discover_module_protect(VALUE args) #if RUBY_VERSION_MAJOR == 3 && RUBY_VERSION_MINOR >= 0 methods = rb_obj_public_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "singleton_method", methods, &class_register_static_method); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "method", methods, &class_register_static_method); methods = rb_obj_protected_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PROTECTED, "singleton_method", methods, &class_register_static_method); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PROTECTED, "method", methods, &class_register_static_method); methods = rb_obj_private_methods(1, argv, cls); - rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PRIVATE, "singleton_method", methods, &class_register_static_method); + rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PRIVATE, "method", methods, &class_register_static_method); #else methods = rb_obj_singleton_methods(1, argv, cls); rb_loader_impl_discover_methods(c, cls, class_name_str, VISIBILITY_PUBLIC, "method", methods, &class_register_static_method); diff --git a/source/ports/rb_port/package/lib/metacall.rb b/source/ports/rb_port/package/lib/metacall.rb index f54e37ca5..e889f03ea 100644 --- a/source/ports/rb_port/package/lib/metacall.rb +++ b/source/ports/rb_port/package/lib/metacall.rb @@ -99,8 +99,6 @@ def metacall_module_load # Check again if the port was loaded if defined?(MetaCallRbLoaderPort) - - return MetaCallRbLoaderPort else raise LoadError, 'MetaCall was found but failed to load MetaCallRbLoaderPort' diff --git a/source/scripts/ruby/klass/source/klass.rb b/source/scripts/ruby/klass/source/klass.rb index ad37a4573..86e392930 100644 --- a/source/scripts/ruby/klass/source/klass.rb +++ b/source/scripts/ruby/klass/source/klass.rb @@ -39,6 +39,4 @@ def return_class_function() return MyClass end - #p return_class_function()::CLASS_CONSTANT - From a58272041baba227dc2ee44344d9e12038f0efee Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 20 Jun 2025 17:22:17 +0200 Subject: [PATCH 378/487] Solve issues with debug prints on python. --- .../loaders/py_loader/source/py_loader_impl.c | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index a5fa1d9ff..dcf5ab92a 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -54,6 +54,12 @@ #define DEBUG_ENABLED 0 #endif +/* Set this variable to 1 in order to debug garbage collection data +* and threading flow for improving the debug of memory leaks and async bugs. +* Set it to 0 in order to remove all the noise. +*/ +#define DEBUG_PRINT_ENABLED 1 + typedef struct loader_impl_py_function_type { PyObject *func; @@ -160,7 +166,7 @@ static value py_loader_impl_error_value(loader_impl_py py_impl); static value py_loader_impl_error_value_from_exception(loader_impl_py py_impl, PyObject *type_obj, PyObject *value_obj, PyObject *traceback_obj); -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED #if (defined(__ADDRESS_SANITIZER__) || defined(__MEMORY_SANITIZER__)) static void py_loader_impl_gc_print(loader_impl_py py_impl); #endif @@ -2221,7 +2227,7 @@ int py_loader_impl_initialize_traceback(loader_impl impl, loader_impl_py py_impl return 1; } -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED int py_loader_impl_initialize_gc(loader_impl_py py_impl) { PyObject *flags; @@ -2396,10 +2402,10 @@ int py_loader_impl_initialize_thread_background_module(loader_impl_py py_impl) "import asyncio\n" "import threading\n" "import sys\n" -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED "def trace_calls(frame, event, arg):\n" " t = threading.current_thread()\n" - " print(f\"[{t.native_id}] {t.name}: {event} {frame.f_code.co_name}\")\n" + " print(f\"[{t.native_id}] {t.name}: {event} {frame.f_code.co_name}\", flush=True)\n" "threading.settrace(trace_calls)\n" "sys.settrace(trace_calls)\n" #endif @@ -2686,7 +2692,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi loader_impl_py py_impl = malloc(sizeof(struct loader_impl_py_type)); int traceback_initialized = 1; -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED int gc_initialized = 1; #endif int gil_release; @@ -2762,7 +2768,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi traceback_initialized = 0; } -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED /* Initialize GC module */ { gc_initialized = py_loader_impl_initialize_gc(py_impl); @@ -2862,7 +2868,7 @@ loader_impl_data py_loader_impl_initialize(loader_impl impl, configuration confi Py_DecRef(py_impl->traceback_format_exception); Py_DecRef(py_impl->traceback_module); } -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED if (gc_initialized == 0) { Py_DecRef(py_impl->gc_set_debug); @@ -2917,7 +2923,7 @@ int py_loader_impl_execution_path(loader_impl impl, const loader_path path) goto clear_current_path; } -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED py_loader_impl_sys_path_print(system_paths); #endif @@ -4199,7 +4205,7 @@ value py_loader_impl_error_value_from_exception(loader_impl_py py_impl, PyObject return ret; } -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED #if (defined(__ADDRESS_SANITIZER__) || defined(__MEMORY_SANITIZER__)) void py_loader_impl_gc_print(loader_impl_py py_impl) { @@ -4355,7 +4361,7 @@ int py_loader_impl_destroy(loader_impl impl) Py_DecRef(py_impl->thread_background_stop); Py_DecRef(py_impl->thread_background_register_atexit); -#if DEBUG_ENABLED +#if DEBUG_ENABLED && DEBUG_PRINT_ENABLED { #if (defined(__ADDRESS_SANITIZER__) || defined(__MEMORY_SANITIZER__)) py_loader_impl_gc_print(py_impl); From d8e061b17c2a4eebe8a4e9fbebbc876ec58a7e75 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 1 Jul 2025 08:05:21 +0200 Subject: [PATCH 379/487] Solve issues with deadlocks on windows. --- .../loaders/py_loader/source/py_loader_impl.c | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index dcf5ab92a..d5a11d618 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -4302,6 +4302,80 @@ int py_loader_impl_finalize(loader_impl_py py_impl, const int host) return 0; } +#if defined(WIN32) || defined(_WIN32) +/* On Windows, threads are destroyed when atexit is executed, we should control this in order to avoid deadlocks */ +static long py_loader_impl_asyncio_thread_native_id(loader_impl_py py_impl) +{ + PyObject *thread_obj = PyObject_GetAttrString(py_impl->asyncio_loop, "t"); + + if (thread_obj == NULL) + { + return -1; + } + + PyObject *native_id_obj = PyObject_GetAttrString(thread_obj, "native_id"); + Py_DecRef(thread_obj); + + if (thread_obj == NULL) + { + return -1; + } + + long native_id = PyLong_AsLong(native_id_obj); + Py_DecRef(native_id_obj); + + if (PyErr_Occurred()) + { + py_loader_impl_error_print(py_impl); + return -1; + } + + return native_id; +} + +static int py_loader_impl_check_thread(loader_impl_py py_impl) +{ + long thread_id = py_loader_impl_asyncio_thread_native_id(py_impl); + + if (thread_id == -1) + { + return -1; + } + + HANDLE thread_handle = OpenThread(THREAD_QUERY_INFORMATION | SYNCHRONIZE, FALSE, thread_id); + + if (thread_handle == NULL) + { + return 1; + } + + DWORD result = WaitForSingleObject(thread_handle, 0); + + CloseHandle(thread_handle); + + if (result == WAIT_TIMEOUT) + { + return 0; + } + else if (result == WAIT_OBJECT_0) + { + /* This workaround forces to skip thread waiting, so it avoids deadlocks */ + PyObject *sys_modules = PyImport_GetModuleDict(); + + if (PyDict_DelItemString(sys_modules, "threading") < 0) + { + PyErr_Print(); + } + + return 1; + } + else + { + return -1; + } +} +#endif + int py_loader_impl_destroy(loader_impl impl) { const int host = loader_impl_get_option_host(impl); @@ -4319,6 +4393,9 @@ int py_loader_impl_destroy(loader_impl impl) py_loader_thread_acquire(); /* Stop event loop for async calls */ +#if defined(WIN32) || defined(_WIN32) + if (py_loader_impl_check_thread(py_impl) == 0) +#endif { PyObject *args_tuple = PyTuple_New(2); Py_IncRef(py_impl->asyncio_loop); From 1cc1a3cb086ab9e3815b874816687f6d7dc16fda Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 1 Jul 2025 08:33:13 +0200 Subject: [PATCH 380/487] Solve issues with wasmtime. --- .../loaders/wasm_loader/source/wasm_loader_impl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/loaders/wasm_loader/source/wasm_loader_impl.c b/source/loaders/wasm_loader/source/wasm_loader_impl.c index 558ea0215..d359ef872 100644 --- a/source/loaders/wasm_loader/source/wasm_loader_impl.c +++ b/source/loaders/wasm_loader/source/wasm_loader_impl.c @@ -18,6 +18,13 @@ * */ +#ifdef WASMTIME + #if defined(_WIN32) && defined(_MSC_VER) + #define WASM_API_EXTERN + #endif + #include <wasmtime.h> +#endif + #include <wasm_loader/wasm_loader_function.h> #include <wasm_loader/wasm_loader_handle.h> #include <wasm_loader/wasm_loader_impl.h> @@ -35,13 +42,6 @@ #include <stdlib.h> -#ifdef WASMTIME - #if defined(_WIN32) && defined(_MSC_VER) - #define WASM_API_EXTERN - #endif - #include <wasmtime.h> -#endif - #define COUNT_OF(array) (sizeof(array) / sizeof(array[0])) typedef struct loader_impl_wasm_type From 33220069d4cefeb098f35b258506d7717e252a37 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 1 Jul 2025 08:39:39 +0200 Subject: [PATCH 381/487] Update version to v0.9.10. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6f060dcbc..ea8f4fd66 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.9 \ No newline at end of file +0.9.10 \ No newline at end of file From cd0348f8f22209ff51ac375ab47bded5895292a1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 1 Jul 2025 22:24:38 +0200 Subject: [PATCH 382/487] Solve issues with macos ci. --- .github/workflows/macos-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index d6ba0dc3b..2a5725996 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -110,7 +110,7 @@ jobs: workflow_file_name: test.yml wait_workflow: true client_payload: '{"ref": "${{ github.head_ref || github.ref_name }}"}' - ref: ${{ github.head_ref || github.ref_name }} + ref: main - name: MacOS Workflow Dispatch uses: convictional/trigger-workflow-and-wait@v1.6.1 with: From 73c020e0188434705d5308ac2e7e83f94c0138fd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 00:41:46 +0200 Subject: [PATCH 383/487] Improve python package publish and add nodejs package publish. --- .github/workflows/release-nodejs.yml | 26 ++++++++++++++++++++++++++ source/ports/node_port/upload.sh | 22 +++++++++++++++++++--- source/ports/py_port/VERSION | 2 +- source/ports/py_port/upload.sh | 3 +-- 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/release-nodejs.yml diff --git a/.github/workflows/release-nodejs.yml b/.github/workflows/release-nodejs.yml new file mode 100644 index 000000000..1f82be6da --- /dev/null +++ b/.github/workflows/release-nodejs.yml @@ -0,0 +1,26 @@ +name: Release NodeJS Package + +on: + push: + branches: [ master, develop ] + paths: + - 'source/ports/node_port/package.json' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + release: + name: Release NodeJS Port + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Release the port + working-directory: source/ports/node_port + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: ./upload.sh diff --git a/source/ports/node_port/upload.sh b/source/ports/node_port/upload.sh index a38301bd8..664e4b83c 100755 --- a/source/ports/node_port/upload.sh +++ b/source/ports/node_port/upload.sh @@ -19,8 +19,24 @@ # limitations under the License. # -# TODO: Update version in package.json -# TODO: Automate for CD/CI +set -euxo pipefail + +NPM_VERSION=$(npm view metacall version) +PORT_VERSION=$(node -p "require('./package.json').version") + +if [[ "$NPM_VERSION" == "$PORT_VERSION" ]]; then + echo "Current package version is the same as NPM version, skipping upload." + exit 0 +fi + +if [[ -z "${NPM_TOKEN:-}" ]]; then + echo "NPM_TOKEN environment variable is not set or empty, skipping upload" + exit 1 +fi + +# Register the token +echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc # Publish -npm login && npm publish +npm login +npm publish diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION index 5d4294b91..2411653a5 100644 --- a/source/ports/py_port/VERSION +++ b/source/ports/py_port/VERSION @@ -1 +1 @@ -0.5.1 \ No newline at end of file +0.5.2 \ No newline at end of file diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index 5e8635432..c1505e7c3 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -30,8 +30,7 @@ if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then fi # Install dependencies and upload MetaCall package -python3 -m pip install --user --upgrade twine setuptools wheel # build -# python3 -m build +python3 -m pip install --user --upgrade twine setuptools wheel python3 setup.py sdist bdist_wheel python3 -m twine check dist/* python3 -m twine upload dist/* From 695a79985bf71f4972c20725717cdf070a109166 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 00:48:08 +0200 Subject: [PATCH 384/487] Trying to solve more issues in node and python packages. --- .github/workflows/release-nodejs.yml | 2 +- .github/workflows/release-python.yml | 2 +- source/ports/py_port/setup.cfg | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-nodejs.yml b/.github/workflows/release-nodejs.yml index 1f82be6da..da626217c 100644 --- a/.github/workflows/release-nodejs.yml +++ b/.github/workflows/release-nodejs.yml @@ -4,7 +4,7 @@ on: push: branches: [ master, develop ] paths: - - 'source/ports/node_port/package.json' + - 'source/ports/node_port/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 52f6f4c88..d2d96cabd 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -4,7 +4,7 @@ on: push: branches: [ master, develop ] paths: - - 'source/ports/py_port/VERSION' + - 'source/ports/py_port/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/source/ports/py_port/setup.cfg b/source/ports/py_port/setup.cfg index 79bc67848..6a92005e2 100644 --- a/source/ports/py_port/setup.cfg +++ b/source/ports/py_port/setup.cfg @@ -3,3 +3,6 @@ # 3. If at all possible, it is good practice to do this. If you cannot, you # will need to generate wheels for each Python version that you support. universal=1 + +[metadata] +license_files=LICENSE.txt From 44395aec234bb8d73cae2813027f09fe07fc57cb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 00:55:04 +0200 Subject: [PATCH 385/487] Solve issues with python. --- source/ports/py_port/setup.cfg | 1 + source/ports/py_port/setup.py | 3 --- source/ports/py_port/upload.sh | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/ports/py_port/setup.cfg b/source/ports/py_port/setup.cfg index 6a92005e2..cc49de877 100644 --- a/source/ports/py_port/setup.cfg +++ b/source/ports/py_port/setup.cfg @@ -5,4 +5,5 @@ universal=1 [metadata] +license=Apache-2.0 license_files=LICENSE.txt diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index 4841636e9..bda3e96c8 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -71,9 +71,6 @@ 'Intended Audience :: Developers', 'Topic :: Software Development :: Interpreters', - # License - 'License :: OSI Approved :: Apache Software License', - # Python versions support #'Programming Language :: Python :: 2', #'Programming Language :: Python :: 2.6', diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index c1505e7c3..d3ff9f3e2 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -30,7 +30,8 @@ if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then fi # Install dependencies and upload MetaCall package -python3 -m pip install --user --upgrade twine setuptools wheel +python3 -m pip install --user --upgrade twine setuptools wheel build +python3 -m build python3 setup.py sdist bdist_wheel python3 -m twine check dist/* python3 -m twine upload dist/* From 3a47ed3f3e006bbc80a0e8f7a323e4ae24f4a036 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 00:57:22 +0200 Subject: [PATCH 386/487] Remove python build. --- source/ports/py_port/upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index d3ff9f3e2..01e368666 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -31,7 +31,7 @@ fi # Install dependencies and upload MetaCall package python3 -m pip install --user --upgrade twine setuptools wheel build -python3 -m build +# python3 -m build python3 setup.py sdist bdist_wheel python3 -m twine check dist/* python3 -m twine upload dist/* From 2f6a01045ef5fc81c1bbc90524481d168f2a4ed1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 06:48:37 +0200 Subject: [PATCH 387/487] Update python port. --- source/ports/py_port/README.rst | 4 ++-- source/ports/py_port/metacall/__init__.py | 2 +- source/ports/py_port/metacall/{api.py => metacall.py} | 0 source/ports/py_port/setup.cfg | 6 ------ 4 files changed, 3 insertions(+), 9 deletions(-) rename source/ports/py_port/metacall/{api.py => metacall.py} (100%) diff --git a/source/ports/py_port/README.rst b/source/ports/py_port/README.rst index c90d8c46b..27c27ab53 100644 --- a/source/ports/py_port/README.rst +++ b/source/ports/py_port/README.rst @@ -25,7 +25,7 @@ Then install MetaCall Python package through MetaCall: .. code:: console - metacall pip3 install metacall + pip3 install metacall Example ======= @@ -55,7 +55,7 @@ Running the example: .. code:: console - metacall main.py + python3 main.py Using pointers (calling to a C library) --------------------------------------- diff --git a/source/ports/py_port/metacall/__init__.py b/source/ports/py_port/metacall/__init__.py index 412cd2dd1..e34d69bc5 100644 --- a/source/ports/py_port/metacall/__init__.py +++ b/source/ports/py_port/metacall/__init__.py @@ -17,4 +17,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -from metacall.api import metacall, metacall_load_from_file, metacall_load_from_memory, metacall_load_from_package, metacall_inspect, metacall_value_create_ptr, metacall_value_reference, metacall_value_dereference +from metacall.metacall import metacall, metacall_load_from_file, metacall_load_from_memory, metacall_load_from_package, metacall_inspect, metacall_value_create_ptr, metacall_value_reference, metacall_value_dereference diff --git a/source/ports/py_port/metacall/api.py b/source/ports/py_port/metacall/metacall.py similarity index 100% rename from source/ports/py_port/metacall/api.py rename to source/ports/py_port/metacall/metacall.py diff --git a/source/ports/py_port/setup.cfg b/source/ports/py_port/setup.cfg index cc49de877..51402097a 100644 --- a/source/ports/py_port/setup.cfg +++ b/source/ports/py_port/setup.cfg @@ -1,9 +1,3 @@ -[bdist_wheel] -# This flag says that the code is written to work on both Python 2 and Python -# 3. If at all possible, it is good practice to do this. If you cannot, you -# will need to generate wheels for each Python version that you support. -universal=1 - [metadata] license=Apache-2.0 license_files=LICENSE.txt From 4eb5d8cb4c9f1a2f2404ebf83e41723c5553b208 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 06:49:39 +0200 Subject: [PATCH 388/487] Testing node port. --- .github/workflows/release-nodejs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-nodejs.yml b/.github/workflows/release-nodejs.yml index da626217c..bc733d613 100644 --- a/.github/workflows/release-nodejs.yml +++ b/.github/workflows/release-nodejs.yml @@ -3,8 +3,8 @@ name: Release NodeJS Package on: push: branches: [ master, develop ] - paths: - - 'source/ports/node_port/**' + # paths: + # - 'source/ports/node_port/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} From 7059976e5dcfa3ec2f4b577a414d865f6a6fc538 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 06:53:02 +0200 Subject: [PATCH 389/487] Trying to build python package. --- source/ports/py_port/metacall/__init__.py | 2 +- source/ports/py_port/metacall/{metacall.py => api.py} | 0 source/ports/py_port/upload.sh | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename source/ports/py_port/metacall/{metacall.py => api.py} (100%) diff --git a/source/ports/py_port/metacall/__init__.py b/source/ports/py_port/metacall/__init__.py index e34d69bc5..412cd2dd1 100644 --- a/source/ports/py_port/metacall/__init__.py +++ b/source/ports/py_port/metacall/__init__.py @@ -17,4 +17,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -from metacall.metacall import metacall, metacall_load_from_file, metacall_load_from_memory, metacall_load_from_package, metacall_inspect, metacall_value_create_ptr, metacall_value_reference, metacall_value_dereference +from metacall.api import metacall, metacall_load_from_file, metacall_load_from_memory, metacall_load_from_package, metacall_inspect, metacall_value_create_ptr, metacall_value_reference, metacall_value_dereference diff --git a/source/ports/py_port/metacall/metacall.py b/source/ports/py_port/metacall/api.py similarity index 100% rename from source/ports/py_port/metacall/metacall.py rename to source/ports/py_port/metacall/api.py diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index 01e368666..d3ff9f3e2 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -31,7 +31,7 @@ fi # Install dependencies and upload MetaCall package python3 -m pip install --user --upgrade twine setuptools wheel build -# python3 -m build +python3 -m build python3 setup.py sdist bdist_wheel python3 -m twine check dist/* python3 -m twine upload dist/* From 5b8ddaa46e8b820295707af423607d8076c52db5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 06:54:41 +0200 Subject: [PATCH 390/487] Corrected bash script. --- source/ports/node_port/upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/node_port/upload.sh b/source/ports/node_port/upload.sh index 664e4b83c..f37d4c53a 100755 --- a/source/ports/node_port/upload.sh +++ b/source/ports/node_port/upload.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash # # MetaCall NodeJS Port Deploy Script by Parra Studios From 050a199baaaf9b952f1d6e7c54e56557a1277e84 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 06:57:45 +0200 Subject: [PATCH 391/487] Update version of node package. --- .github/workflows/release-nodejs.yml | 4 ++-- source/ports/node_port/package-lock.json | 2 +- source/ports/node_port/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-nodejs.yml b/.github/workflows/release-nodejs.yml index bc733d613..da626217c 100644 --- a/.github/workflows/release-nodejs.yml +++ b/.github/workflows/release-nodejs.yml @@ -3,8 +3,8 @@ name: Release NodeJS Package on: push: branches: [ master, develop ] - # paths: - # - 'source/ports/node_port/**' + paths: + - 'source/ports/node_port/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/source/ports/node_port/package-lock.json b/source/ports/node_port/package-lock.json index bfb3b0d1b..33e7e61c0 100644 --- a/source/ports/node_port/package-lock.json +++ b/source/ports/node_port/package-lock.json @@ -1,6 +1,6 @@ { "name": "metacall", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/source/ports/node_port/package.json b/source/ports/node_port/package.json index f9508ef75..5c15efc0b 100644 --- a/source/ports/node_port/package.json +++ b/source/ports/node_port/package.json @@ -1,6 +1,6 @@ { "name": "metacall", - "version": "0.5.0", + "version": "0.5.1", "description": "Call Python, C#, Ruby... functions from NodeJS (a NodeJS Port for MetaCall)", "repository": "github:metacall/core", "bugs": "https://github.com/metacall/core/issues", From ac753a400bf5415e629ed22e2df80fd9d955e3fa Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:01:11 +0200 Subject: [PATCH 392/487] Update python package, remove version. --- source/ports/py_port/VERSION | 1 - source/ports/py_port/setup.py | 6 +----- source/ports/py_port/upload.sh | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 source/ports/py_port/VERSION diff --git a/source/ports/py_port/VERSION b/source/ports/py_port/VERSION deleted file mode 100644 index 2411653a5..000000000 --- a/source/ports/py_port/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.5.2 \ No newline at end of file diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index bda3e96c8..c1e17fe04 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -32,10 +32,6 @@ with open(os.path.join(current_path, 'README.rst'), encoding='utf-8') as f: long_description = f.read() -# Get the version -with open(os.path.join(current_path, 'VERSION')) as f: - version = f.read() - # Define set up options options = { 'name': 'metacall', @@ -43,7 +39,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - 'version': version, + 'version': '0.5.2', 'description': 'A library for providing inter-language foreign function interface calls', 'long_description': long_description, diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index d3ff9f3e2..6aa047bb8 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -22,7 +22,7 @@ set -exuo pipefail PYPI_VERSION=$(curl -s https://pypi.org/rss/project/metacall/releases.xml | sed -n 's/\s*<title>\([0-9.]*\).*/\1/p' | sed -n '2 p') -PORT_VERSION=$(cat VERSION) +PORT_VERSION=$(python3 setup.py --version) if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then echo "Current package version is the same as PyPI version, skipping upload." From 9499dddf3399919e8684b7172f2820d885c83409 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:04:14 +0200 Subject: [PATCH 393/487] Remove setup.py run on python package. --- source/ports/py_port/upload.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index 6aa047bb8..73a9db3ad 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -32,7 +32,6 @@ fi # Install dependencies and upload MetaCall package python3 -m pip install --user --upgrade twine setuptools wheel build python3 -m build -python3 setup.py sdist bdist_wheel python3 -m twine check dist/* python3 -m twine upload dist/* From f2b132747c0d62aaf83e658d378bcc3e6b490534 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:09:02 +0200 Subject: [PATCH 394/487] Remove setup.cfg. --- source/ports/py_port/MANIFEST.in | 4 ---- source/ports/py_port/setup.cfg | 3 --- 2 files changed, 7 deletions(-) delete mode 100644 source/ports/py_port/setup.cfg diff --git a/source/ports/py_port/MANIFEST.in b/source/ports/py_port/MANIFEST.in index 7557376f5..a4fa0c0da 100644 --- a/source/ports/py_port/MANIFEST.in +++ b/source/ports/py_port/MANIFEST.in @@ -3,7 +3,3 @@ include LICENSE.txt # Include the data files recursive-include data * - -# If using Python 2.6 or less, then have to include package data, even though -# it's already declared in setup.py -# include sample/*.dat diff --git a/source/ports/py_port/setup.cfg b/source/ports/py_port/setup.cfg deleted file mode 100644 index 51402097a..000000000 --- a/source/ports/py_port/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[metadata] -license=Apache-2.0 -license_files=LICENSE.txt From bc6deb47a64c7bf8c9075cb745b191be4afc81f9 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:11:26 +0200 Subject: [PATCH 395/487] Update license_files. --- source/ports/py_port/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index c1e17fe04..535850a82 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -54,6 +54,7 @@ # License 'license': 'Apache License 2.0', + 'license_files': 'LICENSE.txt', # See https://pypi.python.org/pypi?%3Aaction=list_classifiers 'classifiers': [ From 9ebb3f33f3f4cfb2e4ac5cf1a4ded6ed18f76911 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:12:42 +0200 Subject: [PATCH 396/487] Update license properly. --- source/ports/py_port/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index 535850a82..ea1e15e57 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -54,7 +54,7 @@ # License 'license': 'Apache License 2.0', - 'license_files': 'LICENSE.txt', + 'license_files': ['LICENSE.txt'], # See https://pypi.python.org/pypi?%3Aaction=list_classifiers 'classifiers': [ From f0075922a38884e8a9c653e2f1f6fa3f2c58bfda Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:16:48 +0200 Subject: [PATCH 397/487] Test python package. --- source/ports/py_port/upload.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index 73a9db3ad..a3aba92f0 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -29,6 +29,9 @@ if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then exit 0 fi +# Delete previous build +rm -rf dist build *.egg-info + # Install dependencies and upload MetaCall package python3 -m pip install --user --upgrade twine setuptools wheel build python3 -m build @@ -36,4 +39,4 @@ python3 -m twine check dist/* python3 -m twine upload dist/* # Delete output -rm -rf dist/* build/* +rm -rf dist build *.egg-info From 60242c043e86a45cd801d26642b7956728487831 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:18:00 +0200 Subject: [PATCH 398/487] Remove license files. --- source/ports/py_port/setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py index ea1e15e57..c1e17fe04 100644 --- a/source/ports/py_port/setup.py +++ b/source/ports/py_port/setup.py @@ -54,7 +54,6 @@ # License 'license': 'Apache License 2.0', - 'license_files': ['LICENSE.txt'], # See https://pypi.python.org/pypi?%3Aaction=list_classifiers 'classifiers': [ From da32696f7fbefa70800b10253a27f0f8fd02793f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Wed, 2 Jul 2025 01:41:53 -0400 Subject: [PATCH 399/487] Create pyproject.toml --- source/ports/py_port/pyproject.toml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 source/ports/py_port/pyproject.toml diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml new file mode 100644 index 000000000..6df32310d --- /dev/null +++ b/source/ports/py_port/pyproject.toml @@ -0,0 +1,36 @@ +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "metacall" +version = "0.5.2" +description = "A library for providing inter-language foreign function interface calls" +readme = "README.rst" +requires-python = ">=3.7" +license = { text = "Apache-2.0" } +authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Topic :: Software Development :: Interpreters", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13" +] +dependencies = [] + +[tool.setuptools] +packages = ["metacall"] + +[tool.setuptools.package-data] +"metacall" = ["*"] From e857ef0f3e8f7d7a4cbfa7b754f7ec3485751cce Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:48:59 +0200 Subject: [PATCH 400/487] Improving pyproject.toml. --- source/ports/py_port/pyproject.toml | 9 +- source/ports/py_port/setup.py | 124 ---------------------------- 2 files changed, 8 insertions(+), 125 deletions(-) delete mode 100644 source/ports/py_port/setup.py diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index 6df32310d..9bf127f9b 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -6,8 +6,9 @@ build-backend = "setuptools.build_meta" name = "metacall" version = "0.5.2" description = "A library for providing inter-language foreign function interface calls" +keywords = ["metacall", "python", "port", "ffi", "polyglot", "faas", "serverless"] readme = "README.rst" -requires-python = ">=3.7" +requires-python = ">=3.3" license = { text = "Apache-2.0" } authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] classifiers = [ @@ -29,6 +30,12 @@ classifiers = [ ] dependencies = [] +[project.urls] +Homepage = "https://metacall.io/" +Repository = "https://github.com/metacall/core" +Documentation = "https://core.metacall.io/" +Issues = "https://github.com/metacall/core/issues" + [tool.setuptools] packages = ["metacall"] diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py deleted file mode 100644 index c1e17fe04..000000000 --- a/source/ports/py_port/setup.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python3 - -# MetaCall Python Port by Parra Studios -# A frontend for Python language bindings in MetaCall. -# -# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# To use a consistent encoding -from codecs import open -import os -import sys -import re - -# Always prefer setuptools over distutils -from setuptools import setup, find_packages - -current_path = os.path.abspath(os.path.dirname(__file__)) - -# Get the long description from the README file -with open(os.path.join(current_path, 'README.rst'), encoding='utf-8') as f: - long_description = f.read() - -# Define set up options -options = { - 'name': 'metacall', - - # Versions should comply with PEP440. For a discussion on single-sourcing - # the version across setup.py and the project code, see - # https://packaging.python.org/en/latest/single_source_version.html - 'version': '0.5.2', - - 'description': 'A library for providing inter-language foreign function interface calls', - 'long_description': long_description, - 'long_description_content_type': 'text/x-rst', - - # The project's main homepage - 'url': 'https://github.com/metacall/core', - - # Author details - 'author': 'Vicente Eduardo Ferrer Garcia', - 'author_email': 'vic798@gmail.com', - - # License - 'license': 'Apache License 2.0', - - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - 'classifiers': [ - # Project Status - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - 'Development Status :: 4 - Beta', - - # Audience - 'Intended Audience :: Developers', - 'Topic :: Software Development :: Interpreters', - - # Python versions support - #'Programming Language :: Python :: 2', - #'Programming Language :: Python :: 2.6', - #'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - ], - - # Keywords - 'keywords': 'metacall python port ffi polyglot faas serverless', - - # Modules - 'py_modules': ['metacall'], - - # List additional groups of dependencies here (e.g. development - # dependencies). You can install these using the following syntax, - # for example: - # $ pip install -e .[dev,test] - 'extras_require': { - 'dev': ['check-manifest'], - 'test': ['coverage'], - }, - - # If there are data files included in your packages that need to be - # installed, specify them here. If using Python 2.6 or less, then these - # have to be included in MANIFEST.in as well. - #package_data: { - # 'sample': ['package_data.dat'], - #}, - - # Although 'package_data' is the preferred approach, in some case you may - # need to place data files outside of your packages. See: - # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa - # In this case, 'data_file' will be installed into '<sys.prefix>/my_data' - #data_files: [('my_data', ['data/data_file'])], -} - -# Exclude base packages -exclude_packages = ['contrib', 'docs', 'test', 'test.py' 'CMakeLists.txt', '.gitignore', 'upload.sh'] - -# Define required packages -options['packages'] = find_packages(exclude=exclude_packages) - -# Execute the setup -setup(**options) From 8404af32724d66c700802989611507e105e69b5e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:51:41 +0200 Subject: [PATCH 401/487] Update port version. --- source/ports/py_port/upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index a3aba92f0..e2b992fb3 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -22,7 +22,7 @@ set -exuo pipefail PYPI_VERSION=$(curl -s https://pypi.org/rss/project/metacall/releases.xml | sed -n 's/\s*<title>\([0-9.]*\).*/\1/p' | sed -n '2 p') -PORT_VERSION=$(python3 setup.py --version) +PORT_VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml) if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then echo "Current package version is the same as PyPI version, skipping upload." From 20150d60272a457dddf25df3f14914eb05122c3e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:54:47 +0200 Subject: [PATCH 402/487] Update license version. --- source/ports/py_port/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index 9bf127f9b..aaca782f1 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -9,7 +9,8 @@ description = "A library for providing inter-language foreign function interface keywords = ["metacall", "python", "port", "ffi", "polyglot", "faas", "serverless"] readme = "README.rst" requires-python = ">=3.3" -license = { text = "Apache-2.0" } +license = "Apache-2.0" +license-files = ["LICENSE.txt"] authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] classifiers = [ "Development Status :: 4 - Beta", From 5d23bb53608a2f8e45d2493dacbc2d91535572dd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 07:59:20 +0200 Subject: [PATCH 403/487] Remove unused files python package. --- source/ports/py_port/MANIFEST.in | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 source/ports/py_port/MANIFEST.in diff --git a/source/ports/py_port/MANIFEST.in b/source/ports/py_port/MANIFEST.in deleted file mode 100644 index a4fa0c0da..000000000 --- a/source/ports/py_port/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -# Include the license file -include LICENSE.txt - -# Include the data files -recursive-include data * From 51517a8d301230cbc5ada6b3ca1789519b0db74b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 08:02:35 +0200 Subject: [PATCH 404/487] Update setuptools. --- source/ports/py_port/pyproject.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index aaca782f1..0e69dda30 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61", "wheel"] +requires = ["setuptools>=65", "wheel"] build-backend = "setuptools.build_meta" [project] @@ -39,6 +39,3 @@ Issues = "https://github.com/metacall/core/issues" [tool.setuptools] packages = ["metacall"] - -[tool.setuptools.package-data] -"metacall" = ["*"] From 3ac6927f75374f4c8390c90550cd463c1515f381 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 08:04:51 +0200 Subject: [PATCH 405/487] Remove license. --- source/ports/py_port/LICENSE.txt | 201 ---------------------------- source/ports/py_port/pyproject.toml | 1 - 2 files changed, 202 deletions(-) delete mode 100644 source/ports/py_port/LICENSE.txt diff --git a/source/ports/py_port/LICENSE.txt b/source/ports/py_port/LICENSE.txt deleted file mode 100644 index d56ad81fa..000000000 --- a/source/ports/py_port/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index 0e69dda30..04ac72134 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -10,7 +10,6 @@ keywords = ["metacall", "python", "port", "ffi", "polyglot", "faas", "serverless readme = "README.rst" requires-python = ">=3.3" license = "Apache-2.0" -license-files = ["LICENSE.txt"] authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] classifiers = [ "Development Status :: 4 - Beta", From f36c6b1842b42ad2e7723b24e3191ae8e7aa8041 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Wed, 2 Jul 2025 02:07:50 -0400 Subject: [PATCH 406/487] Update pyproject.toml --- source/ports/py_port/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index 04ac72134..77562f8c0 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -12,6 +12,7 @@ requires-python = ">=3.3" license = "Apache-2.0" authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] classifiers = [ + "License :: OSI Approved :: Apache Software License", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Topic :: Software Development :: Interpreters", From d4c26f62f9520b46996c9c9a42f9e701a03d9879 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 08:11:34 +0200 Subject: [PATCH 407/487] Modify license. --- source/ports/py_port/LICENSE.txt | 201 ++++++++++++++++++++++++++++ source/ports/py_port/pyproject.toml | 3 +- 2 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 source/ports/py_port/LICENSE.txt diff --git a/source/ports/py_port/LICENSE.txt b/source/ports/py_port/LICENSE.txt new file mode 100644 index 000000000..d56ad81fa --- /dev/null +++ b/source/ports/py_port/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index 77562f8c0..b55234f78 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -9,10 +9,9 @@ description = "A library for providing inter-language foreign function interface keywords = ["metacall", "python", "port", "ffi", "polyglot", "faas", "serverless"] readme = "README.rst" requires-python = ">=3.3" -license = "Apache-2.0" +license = { file = "LICENSE.txt" } authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] classifiers = [ - "License :: OSI Approved :: Apache Software License", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Topic :: Software Development :: Interpreters", From 22750ba0bb7aff2a4126e51408a20f1bff5e0184 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 08:13:02 +0200 Subject: [PATCH 408/487] License files python package. --- source/ports/py_port/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index b55234f78..55c6bf84b 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -9,7 +9,7 @@ description = "A library for providing inter-language foreign function interface keywords = ["metacall", "python", "port", "ffi", "polyglot", "faas", "serverless"] readme = "README.rst" requires-python = ">=3.3" -license = { file = "LICENSE.txt" } +license-files = ["LICENSE.txt"] authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] classifiers = [ "Development Status :: 4 - Beta", From 02ddf49476d9b3f36bc2d0c239c3056e2b63d0f4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 08:14:14 +0200 Subject: [PATCH 409/487] Remove license completely. --- source/ports/py_port/LICENSE.txt | 201 ---------------------------- source/ports/py_port/pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 202 deletions(-) delete mode 100644 source/ports/py_port/LICENSE.txt diff --git a/source/ports/py_port/LICENSE.txt b/source/ports/py_port/LICENSE.txt deleted file mode 100644 index d56ad81fa..000000000 --- a/source/ports/py_port/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index 55c6bf84b..a1f796411 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -9,7 +9,7 @@ description = "A library for providing inter-language foreign function interface keywords = ["metacall", "python", "port", "ffi", "polyglot", "faas", "serverless"] readme = "README.rst" requires-python = ">=3.3" -license-files = ["LICENSE.txt"] +# license-files = ["LICENSE.txt"] authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] classifiers = [ "Development Status :: 4 - Beta", From 113ba8c36a95d03546ac4c264dabae44881b72f4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 08:16:39 +0200 Subject: [PATCH 410/487] Add license to python package again. --- source/ports/py_port/LICENSE.txt | 201 +++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 source/ports/py_port/LICENSE.txt diff --git a/source/ports/py_port/LICENSE.txt b/source/ports/py_port/LICENSE.txt new file mode 100644 index 000000000..d56ad81fa --- /dev/null +++ b/source/ports/py_port/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 5de40d6e1ba6610dca8e141d8f580b0328c8482d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 08:19:09 +0200 Subject: [PATCH 411/487] Add token permissions to python package. --- .github/workflows/release-python.yml | 4 + source/ports/py_port/LICENSE.txt | 201 --------------------------- 2 files changed, 4 insertions(+), 201 deletions(-) delete mode 100644 source/ports/py_port/LICENSE.txt diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index d2d96cabd..a5f0c7de4 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -6,6 +6,10 @@ on: paths: - 'source/ports/py_port/**' +permissions: + id-token: write + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true diff --git a/source/ports/py_port/LICENSE.txt b/source/ports/py_port/LICENSE.txt deleted file mode 100644 index d56ad81fa..000000000 --- a/source/ports/py_port/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. From 9fe130b0f69e3c6b38fc19f1531f1fe500024bdf Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 08:21:48 +0200 Subject: [PATCH 412/487] Remove license from python package completely. --- source/ports/py_port/pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml index a1f796411..a693b8d58 100644 --- a/source/ports/py_port/pyproject.toml +++ b/source/ports/py_port/pyproject.toml @@ -9,7 +9,6 @@ description = "A library for providing inter-language foreign function interface keywords = ["metacall", "python", "port", "ffi", "polyglot", "faas", "serverless"] readme = "README.rst" requires-python = ">=3.3" -# license-files = ["LICENSE.txt"] authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] classifiers = [ "Development Status :: 4 - Beta", From 12668e1d07b34407a30ac470823de4b9ab9dccdd Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 17:02:02 +0200 Subject: [PATCH 413/487] Update version to v0.9.11. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ea8f4fd66..6889a3112 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.10 \ No newline at end of file +0.9.11 \ No newline at end of file From c8339e8a91a80e41c242bab635c952787ceca426 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 17:32:47 +0200 Subject: [PATCH 414/487] Move to setup.py again, it conflicts with distributables. --- source/ports/py_port/LICENSE.txt | 201 ++++++++++++++++++++++++++++ source/ports/py_port/MANIFEST.in | 2 + source/ports/py_port/README.rst | 20 +++ source/ports/py_port/pyproject.toml | 39 ------ source/ports/py_port/setup.py | 134 +++++++++++++++++++ source/ports/py_port/upload.sh | 2 +- 6 files changed, 358 insertions(+), 40 deletions(-) create mode 100644 source/ports/py_port/LICENSE.txt create mode 100644 source/ports/py_port/MANIFEST.in delete mode 100644 source/ports/py_port/pyproject.toml create mode 100644 source/ports/py_port/setup.py diff --git a/source/ports/py_port/LICENSE.txt b/source/ports/py_port/LICENSE.txt new file mode 100644 index 000000000..d56ad81fa --- /dev/null +++ b/source/ports/py_port/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/source/ports/py_port/MANIFEST.in b/source/ports/py_port/MANIFEST.in new file mode 100644 index 000000000..e02cfac5f --- /dev/null +++ b/source/ports/py_port/MANIFEST.in @@ -0,0 +1,2 @@ +# Include the license file +include LICENSE.txt diff --git a/source/ports/py_port/README.rst b/source/ports/py_port/README.rst index 27c27ab53..6947e5c09 100644 --- a/source/ports/py_port/README.rst +++ b/source/ports/py_port/README.rst @@ -51,6 +51,26 @@ Calling Ruby from Python metacall('multiply', 3, 4); # 12 +Calling NodeJS from Python (MonkeyPatch API) +------------------------ + +``sum.js`` + +.. code:: js + + module.exports = { + sum: (x, y) => x + y, + }; + +``main.py`` + +.. code:: python + + import metacall + from sum.js import sum + + sum(3, 4); # 7 + Running the example: .. code:: console diff --git a/source/ports/py_port/pyproject.toml b/source/ports/py_port/pyproject.toml deleted file mode 100644 index a693b8d58..000000000 --- a/source/ports/py_port/pyproject.toml +++ /dev/null @@ -1,39 +0,0 @@ -[build-system] -requires = ["setuptools>=65", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "metacall" -version = "0.5.2" -description = "A library for providing inter-language foreign function interface calls" -keywords = ["metacall", "python", "port", "ffi", "polyglot", "faas", "serverless"] -readme = "README.rst" -requires-python = ">=3.3" -authors = [{ name = "Vicente Eduardo Ferrer Garcia", email = "vic798@gmail.com" }] -classifiers = [ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Topic :: Software Development :: Interpreters", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13" -] -dependencies = [] - -[project.urls] -Homepage = "https://metacall.io/" -Repository = "https://github.com/metacall/core" -Documentation = "https://core.metacall.io/" -Issues = "https://github.com/metacall/core/issues" - -[tool.setuptools] -packages = ["metacall"] diff --git a/source/ports/py_port/setup.py b/source/ports/py_port/setup.py new file mode 100644 index 000000000..f5094e04c --- /dev/null +++ b/source/ports/py_port/setup.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python3 + +# MetaCall Python Port by Parra Studios +# A frontend for Python language bindings in MetaCall. +# +# Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# To use a consistent encoding +from codecs import open +import os +import sys +import re + +# Always prefer setuptools over distutils +from setuptools import setup, find_packages + +current_path = os.path.abspath(os.path.dirname(__file__)) + +# Get the long description from the README file +with open(os.path.join(current_path, 'README.rst'), encoding='utf-8') as f: + long_description = f.read() + +# Define set up options +options = { + 'name': 'metacall', + + # Versions should comply with PEP440. For a discussion on single-sourcing + # the version across setup.py and the project code, see + # https://packaging.python.org/en/latest/single_source_version.html + 'version': '0.5.3', + + 'description': 'A library for providing inter-language foreign function interface calls', + 'long_description': long_description, + 'long_description_content_type': 'text/x-rst', + + # The project's main homepage + 'url': 'https://github.com/metacall/core', + + 'project_urls': { + 'Homepage': 'https://metacall.io/', + 'Repository': 'https://github.com/metacall/core', + 'Documentation': 'https://core.metacall.io/', + 'Issues': 'https://github.com/metacall/core/issues', + }, + + # Author details + 'author': 'Vicente Eduardo Ferrer Garcia', + 'author_email': 'vic798@gmail.com', + + # License + 'license': 'Apache License 2.0', + + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers + 'classifiers': [ + # Project Status + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + 'Development Status :: 4 - Beta', + + # Audience + 'Intended Audience :: Developers', + 'Topic :: Software Development :: Interpreters', + + # Python versions support + #'Programming Language :: Python :: 2', + #'Programming Language :: Python :: 2.6', + #'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + ], + + # Keywords + 'keywords': 'metacall python port ffi polyglot faas serverless', + + # Required Python version + 'python_requires': '>=3.3', + + # Dependencies + 'install_requires': [], + + # List additional groups of dependencies here (e.g. development + # dependencies). You can install these using the following syntax, + # for example: + # $ pip install -e .[dev,test] + 'extras_require': { + 'dev': ['check-manifest'], + 'test': ['coverage'], + }, + + # If there are data files included in your packages that need to be + # installed, specify them here. If using Python 2.6 or less, then these + # have to be included in MANIFEST.in as well. + #package_data: { + # 'sample': ['package_data.dat'], + #}, + + # Although 'package_data' is the preferred approach, in some case you may + # need to place data files outside of your packages. See: + # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa + # In this case, 'data_file' will be installed into '<sys.prefix>/my_data' + #data_files: [('my_data', ['data/data_file'])], +} + +# Exclude base packages +exclude_packages = ['contrib', 'docs', 'test', 'test.py', 'CMakeLists.txt', '.gitignore', 'upload.sh'] + +# Define required packages +options['packages'] = find_packages(exclude=exclude_packages) + +# Execute the setup +setup(**options) diff --git a/source/ports/py_port/upload.sh b/source/ports/py_port/upload.sh index e2b992fb3..a3aba92f0 100755 --- a/source/ports/py_port/upload.sh +++ b/source/ports/py_port/upload.sh @@ -22,7 +22,7 @@ set -exuo pipefail PYPI_VERSION=$(curl -s https://pypi.org/rss/project/metacall/releases.xml | sed -n 's/\s*<title>\([0-9.]*\).*/\1/p' | sed -n '2 p') -PORT_VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml) +PORT_VERSION=$(python3 setup.py --version) if [[ "$PYPI_VERSION" == "$PORT_VERSION" ]]; then echo "Current package version is the same as PyPI version, skipping upload." From 913ae9dc5c4411953d95c5c26fe7e933491c1968 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 17:34:22 +0200 Subject: [PATCH 415/487] Remove license from python package,. --- source/ports/py_port/LICENSE.txt | 201 ------------------------------- source/ports/py_port/MANIFEST.in | 2 - 2 files changed, 203 deletions(-) delete mode 100644 source/ports/py_port/LICENSE.txt delete mode 100644 source/ports/py_port/MANIFEST.in diff --git a/source/ports/py_port/LICENSE.txt b/source/ports/py_port/LICENSE.txt deleted file mode 100644 index d56ad81fa..000000000 --- a/source/ports/py_port/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016-2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/source/ports/py_port/MANIFEST.in b/source/ports/py_port/MANIFEST.in deleted file mode 100644 index e02cfac5f..000000000 --- a/source/ports/py_port/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -# Include the license file -include LICENSE.txt From 69f2aa51087b490059ef65624103dae72c006f5f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 17:35:47 +0200 Subject: [PATCH 416/487] Solve issues. --- source/ports/py_port/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/py_port/README.rst b/source/ports/py_port/README.rst index 6947e5c09..469dad730 100644 --- a/source/ports/py_port/README.rst +++ b/source/ports/py_port/README.rst @@ -52,7 +52,7 @@ Calling Ruby from Python metacall('multiply', 3, 4); # 12 Calling NodeJS from Python (MonkeyPatch API) ------------------------- +-------------------------------------------- ``sum.js`` From b5c5fa940ddcfe51a59f9c6c5dbbb35f8fa17c32 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 2 Jul 2025 18:01:19 +0200 Subject: [PATCH 417/487] Update to version v0.9.12. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6889a3112..bf1ba0c17 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.11 \ No newline at end of file +0.9.12 \ No newline at end of file From 54b6b15e6288fabf61a143e631c439854546955a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Tue, 8 Jul 2025 19:18:14 -0400 Subject: [PATCH 418/487] Update docker-hub.yml --- .github/workflows/docker-hub.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 907dc9ba3..34267338a 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -81,6 +81,8 @@ jobs: version: v${{ env.BUILDKIT_VERSION }} - name: Login to Docker Hub + # Only run when master or when tagging a version + if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.event_name != 'pull_request' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} From ae05b71b9a088720f331a99596372f40327cd7f0 Mon Sep 17 00:00:00 2001 From: Mahdi Sharifi <devraymondsh@gmail.com> Date: Wed, 9 Jul 2025 02:49:46 +0330 Subject: [PATCH 419/487] Implement metacall_box for passing function arguments with different types (#538) * Implement metacall_box for passing function arguments with different types * Update metacall_test.rs --------- Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- source/ports/rs_port/src/cast.rs | 2 +- source/ports/rs_port/src/lib.rs | 1 + .../rs_port/src/types/metacall_exception.rs | 2 +- .../ports/rs_port/src/types/metacall_value.rs | 33 +++++++++++++++++ source/ports/rs_port/tests/metacall_test.rs | 36 ++++++++----------- 5 files changed, 51 insertions(+), 23 deletions(-) diff --git a/source/ports/rs_port/src/cast.rs b/source/ports/rs_port/src/cast.rs index 51574fdf1..61e4c3e8c 100644 --- a/source/ports/rs_port/src/cast.rs +++ b/source/ports/rs_port/src/cast.rs @@ -235,6 +235,6 @@ pub fn metacallobj_untyped_to_raw(ret: Box<dyn MetaCallValue>) -> Option<*mut c_ None } -pub fn metacall_implementer_to_traitobj(v: impl MetaCallValue) -> Box<dyn MetaCallValue> { +pub fn metacall_box(v: impl MetaCallValue) -> Box<dyn MetaCallValue> { Box::new(v) as Box<dyn MetaCallValue> } diff --git a/source/ports/rs_port/src/lib.rs b/source/ports/rs_port/src/lib.rs index ac93df572..328236d57 100644 --- a/source/ports/rs_port/src/lib.rs +++ b/source/ports/rs_port/src/lib.rs @@ -88,6 +88,7 @@ pub use types::*; #[doc(hidden)] mod init; +pub use cast::metacall_box; pub use init::initialize; pub use init::is_initialized; diff --git a/source/ports/rs_port/src/types/metacall_exception.rs b/source/ports/rs_port/src/types/metacall_exception.rs index c3bf662cc..f753fce6c 100644 --- a/source/ports/rs_port/src/types/metacall_exception.rs +++ b/source/ports/rs_port/src/types/metacall_exception.rs @@ -180,7 +180,7 @@ impl MetaCallThrowable { Ok(mut value) => { value.leak = true; - cast::metacall_implementer_to_traitobj(value) + cast::metacall_box(value) } Err(original) => original, } diff --git a/source/ports/rs_port/src/types/metacall_value.rs b/source/ports/rs_port/src/types/metacall_value.rs index 97a669567..bbc5870ff 100644 --- a/source/ports/rs_port/src/types/metacall_value.rs +++ b/source/ports/rs_port/src/types/metacall_value.rs @@ -429,3 +429,36 @@ impl MetaCallValue for MetaCallThrowable { self.into_raw() } } +/// Just a Rust barrier made for easier polymorphism. +impl MetaCallValue for Box<dyn MetaCallValue> { + fn get_metacall_id() -> metacall_value_id { + metacall_value_id::METACALL_INVALID + } + fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { + Ok(cast::raw_to_metacallobj_untyped_leak(v)) + } + fn into_metacall_raw(self) -> *mut c_void { + match_metacall_value!(self, { + bool: bool => bool.into_metacall_raw(), + char: char => char.into_metacall_raw(), + num: i16 => num.into_metacall_raw(), + num: i32 => num.into_metacall_raw(), + num: i64 => num.into_metacall_raw(), + num: f32 => num.into_metacall_raw(), + num: f64 => num.into_metacall_raw(), + str: String => str.into_metacall_raw(), + buf: Vec<i8> => buf.into_metacall_raw(), + arr: Vec<Box<dyn MetaCallValue>> => arr.into_metacall_raw(), + map: HashMap<String, Box<dyn MetaCallValue>> => map.into_metacall_raw(), + ptr: MetaCallPointer => ptr.into_metacall_raw(), + fut: MetaCallFuture => fut.into_metacall_raw(), + fun: MetaCallFunction => fun.into_metacall_raw(), + null: MetaCallNull => null.into_metacall_raw(), + cls: MetaCallClass => cls.into_metacall_raw(), + obj: MetaCallObject => obj.into_metacall_raw(), + exc: MetaCallException => exc.into_metacall_raw(), + thr: MetaCallThrowable => thr.into_metacall_raw(), + _ => MetaCallNull().into_metacall_raw() + }) + } +} diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index ad6389262..d23e2e2ae 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -81,27 +81,22 @@ fn test_float() { fn test_double() { generate_test::<f64>("test_double", 1.2345_f64); } -// TODO -// fn test_mixed_numbers() { -// let result = ::metacall::metacall::<i64>( -// "test_mixed_numbers", -// [ -// Box::new(1 as i16) as Box<dyn MetaCallValue>, -// Box::new(2 as i32) as Box<dyn MetaCallValue>, -// Box::new(3 as i64) as Box<dyn MetaCallValue>, -// ], -// ); - -// // TODO -// // ::metacall::metacall::<i64>("test_mixed_numbers", [1_i16, 2_i32, 3_i64]); -// // ::metacall::metacall::<i64>("test_mixed_numbers", (1_i16, 2_i32, 3_i64)); +fn test_mixed_numbers() { + let result = ::metacall::metacall::<i64>( + "test_mixed_numbers", + [ + ::metacall::metacall_box(1 as i16), + ::metacall::metacall_box(2 as i32), + ::metacall::metacall_box(3 as i64), + ], + ); -// assert!(result.is_ok()); + assert!(result.is_ok()); -// if let Ok(ret) = result { -// assert_eq!(ret, 6_i64) -// } -// } + if let Ok(ret) = result { + assert_eq!(ret, 6_i64) + } +} fn test_string() { generate_test::<String>( "return_the_argument_py", @@ -393,8 +388,7 @@ fn metacall() { test_int(); test_long(); test_short(); - // TODO - // test_mixed_numbers(); + test_mixed_numbers(); } if load::from_single_file("node", js_test_file).is_ok() { test_exception(); From 81faf03ff665a2014a247a1c7c4fb08f25164e6b Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 9 Jul 2025 17:04:08 +0200 Subject: [PATCH 420/487] Remove PORT_LIBRARY_PATH. --- docker-compose.yml | 3 --- source/CMakeLists.txt | 8 -------- source/ports/rs_port/CMakeLists.txt | 1 - tools/cli/Dockerfile | 1 - tools/dev/Dockerfile | 1 - tools/metacall-sanitizer.sh | 1 - tools/runtime/Dockerfile | 1 - 7 files changed, 16 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f74866582..1c1997b13 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,7 +64,6 @@ services: CONFIGURATION_PATH: $METACALL_PATH/build/configurations/global.json SERIAL_LIBRARY_PATH: $METACALL_PATH/build DETOUR_LIBRARY_PATH: $METACALL_PATH/build - PORT_LIBRARY_PATH: $METACALL_PATH/build NODE_PATH: /usr/lib/node_modules runtime: @@ -88,7 +87,6 @@ services: CONFIGURATION_PATH: /usr/local/share/metacall/configurations/global.json SERIAL_LIBRARY_PATH: /usr/local/lib DETOUR_LIBRARY_PATH: /usr/local/lib - PORT_LIBRARY_PATH: /usr/local/lib NODE_PATH: /usr/local/lib/node_modules cli: @@ -108,5 +106,4 @@ services: CONFIGURATION_PATH: /usr/local/share/metacall/configurations/global.json SERIAL_LIBRARY_PATH: /usr/local/lib DETOUR_LIBRARY_PATH: /usr/local/lib - PORT_LIBRARY_PATH: /usr/local/lib NODE_PATH: /usr/local/lib/node_modules diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 883be65c3..b7c1e402b 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -18,9 +18,6 @@ set(SERIAL_LIBRARY_PATH "@OUTPUT_DIRECTORY_DIR@" CACHE PATH "MetaCall serial lib # Export output detour plugin directory set(DETOUR_LIBRARY_PATH "@OUTPUT_DIRECTORY_DIR@" CACHE PATH "MetaCall detour library path") -# Export output port directory -set(PORT_LIBRARY_PATH "@OUTPUT_DIRECTORY_DIR@" CACHE PATH "MetaCall port library path") - # Add extra environment varible set(EXTRA_ENVIRONMENT_VARIABLES "" CACHE PATH "MetaCall extra environment variable") @@ -54,16 +51,11 @@ set(TESTS_DETOUR_ENVIRONMENT_VARIABLES "DETOUR_LIBRARY_PATH=${DETOUR_LIBRARY_PATH}" ) -set(TESTS_PORT_ENVIRONMENT_VARIABLES - "PORT_LIBRARY_PATH=${PORT_LIBRARY_PATH}" -) - set(TESTS_ENVIRONMENT_VARIABLES ${TESTS_LOADER_ENVIRONMENT_VARIABLES} ${TESTS_CONFIGURATION_ENVIRONMENT_VARIABLES} ${TESTS_SERIAL_ENVIRONMENT_VARIABLES} ${TESTS_DETOUR_ENVIRONMENT_VARIABLES} - ${TESTS_PORT_ENVIRONMENT_VARIABLES} ${TESTS_SANITIZER_ENVIRONMENT_VARIABLES} ${TESTS_MEMCHECK_ENVIRONMENT_VARIABLES} ${EXTRA_ENVIRONMENT_VARIABLES} diff --git a/source/ports/rs_port/CMakeLists.txt b/source/ports/rs_port/CMakeLists.txt index 548d583b9..972c34922 100644 --- a/source/ports/rs_port/CMakeLists.txt +++ b/source/ports/rs_port/CMakeLists.txt @@ -215,7 +215,6 @@ set(RS_PORT_DEBUG_ENVIRONMENT_VARIABLES "CONFIGURATION_PATH=${PROJECT_OUTPUT_DIR}/configurations/global.json" "SERIAL_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" "DETOUR_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" - "PORT_LIBRARY_PATH=${PROJECT_OUTPUT_DIR}" "${PROJECT_LIBRARY_PATH_NAME}=${TEST_LIB_PATH}" ) diff --git a/tools/cli/Dockerfile b/tools/cli/Dockerfile index fed409c5e..0da28539b 100644 --- a/tools/cli/Dockerfile +++ b/tools/cli/Dockerfile @@ -37,7 +37,6 @@ ENV LOADER_LIBRARY_PATH=/usr/local/lib \ CONFIGURATION_PATH=/usr/local/share/metacall/configurations/global.json \ SERIAL_LIBRARY_PATH=/usr/local/lib \ DETOUR_LIBRARY_PATH=/usr/local/lib \ - PORT_LIBRARY_PATH=/usr/local/lib \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/local/lib/node_modules \ DOTNET_CLI_TELEMETRY_OPTOUT=true diff --git a/tools/dev/Dockerfile b/tools/dev/Dockerfile index 9f5805944..ec35dfde4 100644 --- a/tools/dev/Dockerfile +++ b/tools/dev/Dockerfile @@ -37,7 +37,6 @@ ENV LOADER_LIBRARY_PATH=$METACALL_PATH/build \ CONFIGURATION_PATH=$METACALL_PATH/build/configurations/global.json \ SERIAL_LIBRARY_PATH=$METACALL_PATH/build \ DETOUR_LIBRARY_PATH=$METACALL_PATH/build \ - PORT_LIBRARY_PATH=$METACALL_PATH/build \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/lib/node_modules \ DOTNET_CLI_TELEMETRY_OPTOUT=true diff --git a/tools/metacall-sanitizer.sh b/tools/metacall-sanitizer.sh index 6605ac112..cd3f08b40 100755 --- a/tools/metacall-sanitizer.sh +++ b/tools/metacall-sanitizer.sh @@ -44,7 +44,6 @@ export LOADER_SCRIPT_PATH="${BUILD_DIR}/scripts" export CONFIGURATION_PATH="${BUILD_DIR}/configurations/global.json" export SERIAL_LIBRARY_PATH="${BUILD_DIR}" export DETOUR_LIBRARY_PATH="${BUILD_DIR}" -export PORT_LIBRARY_PATH="${BUILD_DIR}" BUILD_OPTIONS=( ${BUILD_SANITIZER} debug ${BUILD_LANGUAGES[@]} examples tests scripts ports install pack benchmarks diff --git a/tools/runtime/Dockerfile b/tools/runtime/Dockerfile index 1276b7e11..4ac47f518 100644 --- a/tools/runtime/Dockerfile +++ b/tools/runtime/Dockerfile @@ -61,7 +61,6 @@ ENV LOADER_LIBRARY_PATH=/usr/local/lib \ CONFIGURATION_PATH=/usr/local/share/metacall/configurations/global.json \ SERIAL_LIBRARY_PATH=/usr/local/lib \ DETOUR_LIBRARY_PATH=/usr/local/lib \ - PORT_LIBRARY_PATH=/usr/local/lib \ DEBIAN_FRONTEND=noninteractive \ NODE_PATH=/usr/local/lib/node_modules \ DOTNET_CLI_TELEMETRY_OPTOUT=true From a0f4a115b31ed95e3612ccb187118f7ed53368b1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 9 Jul 2025 17:04:52 +0200 Subject: [PATCH 421/487] Update version of node port in lockfile. --- source/ports/node_port/package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/node_port/package-lock.json b/source/ports/node_port/package-lock.json index 33e7e61c0..8fc04f897 100644 --- a/source/ports/node_port/package-lock.json +++ b/source/ports/node_port/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "metacall", - "version": "0.5.0", + "version": "0.5.1", "license": "Apache-2.0", "devDependencies": { "mocha": "^9.2.1" From d6103ee5cfb7bed1454fe99f1871d9598ee309e1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 9 Jul 2025 17:05:19 +0200 Subject: [PATCH 422/487] Add support to relative paths in configurations. --- .../configuration/configuration_object.h | 21 ++ .../configuration/source/configuration_impl.c | 63 ++--- .../source/configuration_object.c | 37 ++- source/loader/source/loader_impl.c | 14 +- source/tests/CMakeLists.txt | 1 + .../CMakeLists.txt | 265 ++++++++++++++++++ .../data/configurations/global.json.in | 3 + .../data/configurations/py_loader.json.in | 8 + .../data/scripts/main.py | 6 + ...l_configuration_exec_relative_path_test.py | 4 + .../source/main.cpp | 28 ++ ..._configuration_exec_relative_path_test.cpp | 59 ++++ 12 files changed, 457 insertions(+), 52 deletions(-) create mode 100644 source/tests/metacall_configuration_exec_relative_path_test/CMakeLists.txt create mode 100644 source/tests/metacall_configuration_exec_relative_path_test/data/configurations/global.json.in create mode 100644 source/tests/metacall_configuration_exec_relative_path_test/data/configurations/py_loader.json.in create mode 100644 source/tests/metacall_configuration_exec_relative_path_test/data/scripts/main.py create mode 100644 source/tests/metacall_configuration_exec_relative_path_test/data/scripts/metacall_configuration_exec_relative_path_test.py create mode 100644 source/tests/metacall_configuration_exec_relative_path_test/source/main.cpp create mode 100644 source/tests/metacall_configuration_exec_relative_path_test/source/metacall_configuration_exec_relative_path_test.cpp diff --git a/source/configuration/include/configuration/configuration_object.h b/source/configuration/include/configuration/configuration_object.h index 2c22e6eb2..7a5f88679 100644 --- a/source/configuration/include/configuration/configuration_object.h +++ b/source/configuration/include/configuration/configuration_object.h @@ -76,6 +76,27 @@ CONFIGURATION_API configuration configuration_object_initialize(const char *name */ CONFIGURATION_API int configuration_object_childs(configuration config, vector childs, set storage); +/** +* @brief +* Get an absolute path from the value @v which is a string representing a path, +* if the path is absolute, store it in @path as it is, otherwise, join the @config +* path to the value string @v and make it canonical +* +* @param[in] config +* Pointer to configuration object +* +* @param[in] v +* The value representing the path +* +* @param[out] path +* The string where it is going to be store the path +* +* @return +* Returns the size of the path +* +*/ +CONFIGURATION_API size_t configuration_object_child_path(configuration config, value v, char *path); + /** * @brief * Set value of configuration object @config diff --git a/source/configuration/source/configuration_impl.c b/source/configuration/source/configuration_impl.c index ca61ed14b..5482f7375 100644 --- a/source/configuration/source/configuration_impl.c +++ b/source/configuration/source/configuration_impl.c @@ -69,18 +69,15 @@ int configuration_impl_initialize(const char *name) int configuration_impl_load(configuration config, void *allocator) { configuration_impl_singleton singleton = configuration_impl_singleton_instance(); - - set storage; - vector queue, childs; - - storage = set_create(&hash_callback_str, &comparable_callback_str); + set storage = set_create(&hash_callback_str, &comparable_callback_str); + int result = 1; if (storage == NULL) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration implementation load set allocation"); - return 1; + goto alloc_storage_error; } queue = vector_create(sizeof(configuration)); @@ -89,9 +86,7 @@ int configuration_impl_load(configuration config, void *allocator) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration implementation load queue allocation"); - set_destroy(storage); - - return 1; + goto alloc_queue_error; } childs = vector_create(sizeof(configuration)); @@ -100,11 +95,7 @@ int configuration_impl_load(configuration config, void *allocator) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration implementation load childs allocation"); - set_destroy(storage); - - vector_destroy(queue); - - return 1; + goto alloc_childs_error; } vector_push_back(queue, &config); @@ -131,13 +122,7 @@ int configuration_impl_load(configuration config, void *allocator) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration implementation load (childs) <%p>", current); - set_destroy(storage); - - vector_destroy(queue); - - vector_destroy(childs); - - return 1; + goto load_error; } } @@ -145,7 +130,12 @@ int configuration_impl_load(configuration config, void *allocator) vector_clear(childs); - if (configuration_object_childs(current, childs, storage) == 0 && vector_size(childs) > 0) + if (configuration_object_childs(current, childs, storage) != 0) + { + goto load_error; + } + + if (vector_size(childs) > 0) { size_t iterator; @@ -160,13 +150,7 @@ int configuration_impl_load(configuration config, void *allocator) log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration implementation child singleton insertion (%s, %s)", configuration_object_name(child), configuration_object_path(child)); - set_destroy(storage); - - vector_destroy(queue); - - vector_destroy(childs); - - return 1; + goto load_error; } vector_push_back(queue, &child); @@ -176,25 +160,22 @@ int configuration_impl_load(configuration config, void *allocator) { log_write("metacall", LOG_LEVEL_ERROR, "Invalid configuration implementation child set insertion"); - set_destroy(storage); - - vector_destroy(queue); - - vector_destroy(childs); - - return 1; + goto load_error; } } } } - set_destroy(storage); - - vector_destroy(queue); + result = 0; +load_error: vector_destroy(childs); - - return 0; +alloc_childs_error: + vector_destroy(queue); +alloc_queue_error: + set_destroy(storage); +alloc_storage_error: + return result; } int configuration_impl_destroy(void) diff --git a/source/configuration/source/configuration_object.c b/source/configuration/source/configuration_object.c index 57c7ab9cd..e49e8a733 100644 --- a/source/configuration/source/configuration_object.c +++ b/source/configuration/source/configuration_object.c @@ -13,6 +13,8 @@ #include <log/log.h> +#include <portability/portability_path.h> + #include <string.h> /* -- Member Data -- */ @@ -102,6 +104,8 @@ configuration configuration_object_initialize(const char *name, const char *path if (config->source == NULL) { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load configuration %s from %s", name, path); + free(config); return NULL; @@ -216,6 +220,31 @@ int configuration_object_childs_valid(set_key key, set_value val) return 1; } +size_t configuration_object_child_path(configuration config, value v, char *path) +{ + const char *value_path = value_to_string(v); + size_t size = value_type_size(v); + + if (portability_path_is_absolute(value_path, size) == 0) + { + memcpy(path, value_path, size); + } + else + { + char absolute_path[PORTABILITY_PATH_SIZE]; + + size_t absolute_path_size = portability_path_get_directory(config->path, strnlen(config->path, PORTABILITY_PATH_SIZE), absolute_path, PORTABILITY_PATH_SIZE); + + char join_path[PORTABILITY_PATH_SIZE]; + + size_t join_path_size = portability_path_join(absolute_path, absolute_path_size, value_path, size, join_path, PORTABILITY_PATH_SIZE); + + size = portability_path_canonical(join_path, join_path_size, path, PORTABILITY_PATH_SIZE); + } + + return size; +} + int configuration_object_childs(configuration config, vector childs, set storage) { struct set_iterator_type it; @@ -229,11 +258,13 @@ int configuration_object_childs(configuration config, vector childs, set storage { if (set_get(storage, key) == NULL) { - value v = val; + char path[PORTABILITY_PATH_SIZE]; + + configuration child; - const char *path = value_to_string(v); + configuration_object_child_path(config, val, path); - configuration child = configuration_object_initialize(key, path, config); + child = configuration_object_initialize(key, path, config); if (child == NULL) { diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index c66b2bfd4..260a787af 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -35,6 +35,7 @@ #include <log/log.h> #include <configuration/configuration.h> +#include <configuration/configuration_object.h> #include <portability/portability_library_path.h> @@ -282,16 +283,13 @@ void loader_impl_configuration_execution_paths(loader_impl_interface iface, load { if (value_type_id(execution_paths_array[iterator]) == TYPE_STRING) { - const char *str = value_to_string(execution_paths_array[iterator]); - size_t str_size = value_type_size(execution_paths_array[iterator]); + loader_path execution_path; - if (str != NULL) - { - loader_path execution_path; - - strncpy(execution_path, str, str_size > LOADER_PATH_SIZE ? LOADER_PATH_SIZE : str_size); + configuration_object_child_path(impl->config, execution_paths_array[iterator], execution_path); - iface->execution_path(impl, execution_path); + if (iface->execution_path(impl, execution_path) != 0) + { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load execution path %s in configuration %s", execution_path, configuration_object_name(impl->config)); } } } diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index bf31bbbf9..6e6ad2ffc 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -158,6 +158,7 @@ add_subdirectory(metacall_inspect_test) add_subdirectory(metacall_integration_test) add_subdirectory(metacall_depends_test) add_subdirectory(metacall_configuration_exec_path_test) +add_subdirectory(metacall_configuration_exec_relative_path_test) add_subdirectory(metacall_configuration_default_test) add_subdirectory(metacall_clear_test) add_subdirectory(metacall_python_test) diff --git a/source/tests/metacall_configuration_exec_relative_path_test/CMakeLists.txt b/source/tests/metacall_configuration_exec_relative_path_test/CMakeLists.txt new file mode 100644 index 000000000..93ad2822f --- /dev/null +++ b/source/tests/metacall_configuration_exec_relative_path_test/CMakeLists.txt @@ -0,0 +1,265 @@ +# Check if python loader is enabled +if(NOT OPTION_BUILD_LOADERS_PY) + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-configuration-exec-relative-path-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_configuration_exec_relative_path_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Dependecies +# + +add_dependencies(${target} + ${META_PROJECT_NAME}::metacall +) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::metacall +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + +# +# Linker options +# + +target_link_options(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $<TARGET_FILE:${target}> +) + +# +# Define dependencies +# + +add_dependencies(${target} + py_loader +) + +# +# Set test variables +# + +set(PY_LOADER_SCRIPT_PATH "${CMAKE_CURRENT_BINARY_DIR}/scripts") +set(PY_CONFIGURATION_PATH "${CMAKE_CURRENT_BINARY_DIR}/configurations") +set(PY_EXECUTION_PATH "${PY_LOADER_SCRIPT_PATH}/a/b/c/d/e") + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +if(OPTION_BUILD_ADDRESS_SANITIZER) + # TODO: This test fails when run with sanitizers: + # ERROR: LeakSanitizer: detected memory leaks + # + # Direct leak of 551991 byte(s) in 221 object(s) allocated from: + # #0 0x7f3819e399cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 + # #1 0x7f38161499c7 (/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0+0x1169c7) + # + # Direct leak of 1344 byte(s) in 2 object(s) allocated from: + # #0 0x7f3819e388d5 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:85 + # #1 0x7f38162370d4 in _PyObject_GC_Resize (/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0+0x2040d4) + # + # Direct leak of 64 byte(s) in 2 object(s) allocated from: + # #0 0x7f3819e399cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 + # #1 0x7f381622e105 in PyThread_allocate_lock (/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0+0x1fb105) + # + # Indirect leak of 238277 byte(s) in 249 object(s) allocated from: + # #0 0x7f3819e399cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 + # #1 0x7f38161499c7 (/usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0+0x1169c7) + # + # SUMMARY: AddressSanitizer: 791676 byte(s) leaked in 474 allocation(s). + # + # For solving this, we should enable Python support for sanitizers and debug it properly + set_tests_properties(${target} PROPERTIES + PASS_REGULAR_EXPRESSION "[ PASSED ]" + ) +endif() + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + "LOADER_LIBRARY_PATH=${LOADER_LIBRARY_PATH}" + "LOADER_SCRIPT_PATH=${PY_LOADER_SCRIPT_PATH}" + "CONFIGURATION_PATH=${PY_CONFIGURATION_PATH}/global.json" + "SERIAL_LIBRARY_PATH=${SERIAL_LIBRARY_PATH}" + "DETOUR_LIBRARY_PATH=${DETOUR_LIBRARY_PATH}" + "${TESTS_SANITIZER_ENVIRONMENT_VARIABLES}" +) + +# +# External dependencies +# + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(Python3_FIND_ABI "ON" "ANY" "ANY") + find_package(Python3 COMPONENTS Development) + + # Fallback to release if not found + if(NOT Python3_Development_FOUND) + set(Python3_FIND_ABI) + find_package(Python3 COMPONENTS Development REQUIRED) + endif() +else() + find_package(Python3 COMPONENTS Development REQUIRED) +endif() + +# Find Python DLL +include(Portability) + +if(PROJECT_OS_FAMILY STREQUAL win32 AND Python3_LIBRARIES AND Python3_ROOT_DIR AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + foreach(library ${Python3_LIBRARIES}) + if(${library} MATCHES "[^_d][.]lib$") + # Get the library path with dll suffix + string(REGEX REPLACE "[.]lib$" ".dll" LIB_PATH ${library}) + # Get the library name + get_filename_component(LIB_NAME "${LIB_PATH}" NAME) + # Find the library in the Python3 root path + find_file(Python3_LIBRARY_NAME_PATH ${LIB_NAME} + PATHS ${Python3_ROOT_DIR} + NO_DEFAULT_PATH + ) + if(Python3_LIBRARY_NAME_PATH) + break() + endif() + endif() + endforeach() +endif() + +if(NOT Python3_LIBRARY_NAME_PATH) + set(Python3_LIBRARY_NAME_PATH "${Python3_LIBRARIES}") +endif() + +# +# Configure test data +# + +file(COPY data/scripts/main.py DESTINATION ${PY_LOADER_SCRIPT_PATH}) + +file(COPY data/scripts/metacall_configuration_exec_relative_path_test.py DESTINATION ${PY_EXECUTION_PATH}) + +# Set relative paths +set(PY_CONFIGURATION_OUTPUT_PATH "${PY_CONFIGURATION_PATH}") +set(PY_CONFIGURATION_PATH ".") +set(PY_EXECUTION_PATH "../scripts/a/b/c/d/e") + +configure_file(data/configurations/global.json.in ${PY_CONFIGURATION_OUTPUT_PATH}/global.json @ONLY) + +configure_file(data/configurations/py_loader.json.in ${PY_CONFIGURATION_OUTPUT_PATH}/py_loader.json @ONLY) diff --git a/source/tests/metacall_configuration_exec_relative_path_test/data/configurations/global.json.in b/source/tests/metacall_configuration_exec_relative_path_test/data/configurations/global.json.in new file mode 100644 index 000000000..ca417e6a7 --- /dev/null +++ b/source/tests/metacall_configuration_exec_relative_path_test/data/configurations/global.json.in @@ -0,0 +1,3 @@ +{ + "py_loader":"@PY_CONFIGURATION_PATH@/py_loader.json" +} diff --git a/source/tests/metacall_configuration_exec_relative_path_test/data/configurations/py_loader.json.in b/source/tests/metacall_configuration_exec_relative_path_test/data/configurations/py_loader.json.in new file mode 100644 index 000000000..02a8e81f9 --- /dev/null +++ b/source/tests/metacall_configuration_exec_relative_path_test/data/configurations/py_loader.json.in @@ -0,0 +1,8 @@ +{ + "execution_paths": [ + "@PY_EXECUTION_PATH@" + ], + "dependencies": { + "python": ["@Python3_LIBRARY_NAME_PATH@"] + } +} diff --git a/source/tests/metacall_configuration_exec_relative_path_test/data/scripts/main.py b/source/tests/metacall_configuration_exec_relative_path_test/data/scripts/main.py new file mode 100644 index 000000000..a34daba89 --- /dev/null +++ b/source/tests/metacall_configuration_exec_relative_path_test/data/scripts/main.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +import metacall_configuration_exec_relative_path_test + +def main(): + return metacall_configuration_exec_relative_path_test.hello_world('test') diff --git a/source/tests/metacall_configuration_exec_relative_path_test/data/scripts/metacall_configuration_exec_relative_path_test.py b/source/tests/metacall_configuration_exec_relative_path_test/data/scripts/metacall_configuration_exec_relative_path_test.py new file mode 100644 index 000000000..5a8d8d156 --- /dev/null +++ b/source/tests/metacall_configuration_exec_relative_path_test/data/scripts/metacall_configuration_exec_relative_path_test.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 + +def hello_world(text): + return 'Python hello_world: ' + text diff --git a/source/tests/metacall_configuration_exec_relative_path_test/source/main.cpp b/source/tests/metacall_configuration_exec_relative_path_test/source/main.cpp new file mode 100644 index 000000000..582034129 --- /dev/null +++ b/source/tests/metacall_configuration_exec_relative_path_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_configuration_exec_relative_path_test/source/metacall_configuration_exec_relative_path_test.cpp b/source/tests/metacall_configuration_exec_relative_path_test/source/metacall_configuration_exec_relative_path_test.cpp new file mode 100644 index 000000000..9257ec918 --- /dev/null +++ b/source/tests/metacall_configuration_exec_relative_path_test/source/metacall_configuration_exec_relative_path_test.cpp @@ -0,0 +1,59 @@ +/* + * MetaCall Library by Parra Studios + * A library for providing a foreign function interface calls. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +#include <metacall/metacall.h> +#include <metacall/metacall_loaders.h> + +class metacall_configuration_exec_relative_path_test : public testing::Test +{ +public: +}; + +TEST_F(metacall_configuration_exec_relative_path_test, DefaultConstructor) +{ + metacall_print_info(); + + ASSERT_EQ((int)0, (int)metacall_initialize()); + +/* Python */ +#if defined(OPTION_BUILD_LOADERS_PY) + { + const char *py_scripts[] = { + "main.py" + }; + + void *ret = NULL; + + ASSERT_EQ((int)0, (int)metacall_load_from_file("py", py_scripts, sizeof(py_scripts) / sizeof(py_scripts[0]), NULL)); + + ret = metacall("main"); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Python hello_world: test")); + + metacall_value_destroy(ret); + } +#endif /* OPTION_BUILD_LOADERS_PY */ + + metacall_destroy(); +} From 46e4fddd0eee0f538d31c7ccdc5e69478873ca9d Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 9 Jul 2025 17:05:34 +0200 Subject: [PATCH 423/487] Update rs_port version. --- source/ports/rs_port/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index 25789507b..d1030b99d 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.4.2" +version = "0.4.3" [lib] crate-type = ["lib"] From 1001fcd8bb1445d96d1f69c71cf5a788bcf35bfa Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 9 Jul 2025 17:09:32 +0200 Subject: [PATCH 424/487] Update version to v0.9.13. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index bf1ba0c17..6af8ded76 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.12 \ No newline at end of file +0.9.13 \ No newline at end of file From cd8a068ca7a2af4bd288f5fe5456a603b85237e4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 28 Aug 2025 15:13:45 +0200 Subject: [PATCH 425/487] Solve wrong error message location. --- source/configuration/source/configuration_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/configuration/source/configuration_object.c b/source/configuration/source/configuration_object.c index e49e8a733..8d5ec4584 100644 --- a/source/configuration/source/configuration_object.c +++ b/source/configuration/source/configuration_object.c @@ -104,8 +104,6 @@ configuration configuration_object_initialize(const char *name, const char *path if (config->source == NULL) { - log_write("metacall", LOG_LEVEL_ERROR, "Failed to load configuration %s from %s", name, path); - free(config); return NULL; @@ -268,6 +266,8 @@ int configuration_object_childs(configuration config, vector childs, set storage if (child == NULL) { + log_write("metacall", LOG_LEVEL_ERROR, "Failed to load configuration %s from %s", (char *)key, path); + return 1; } From 51701a47cc51b86b78f1b9ed27b568f674952891 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 28 Aug 2025 19:38:43 +0200 Subject: [PATCH 426/487] Add error generation (throwable). --- .../include/metacall/metacall_error.h | 24 +++++++++++++ source/metacall/source/metacall_error.c | 35 +++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/source/metacall/include/metacall/metacall_error.h b/source/metacall/include/metacall/metacall_error.h index ae030b965..e17815fbc 100644 --- a/source/metacall/include/metacall/metacall_error.h +++ b/source/metacall/include/metacall/metacall_error.h @@ -49,6 +49,30 @@ typedef struct metacall_exception_type *metacall_exception; /* -- Methods -- */ +/** +* @brief +* Create an throwable value from an exception with a simple API in a single instruction +* +* @param[in] label +* Label of the exception +* +* @param[in] code +* Error code of the exception +* +* @param[in] stacktrace +* Stack trace of the exception +* +* @param[in] message +* Message of the exception to be formatted with the variable arguments +* +* @param[in] va_args +* Arguments for formatting the message +* +* @return +* The value of type throwable containing the exception created +*/ +METACALL_API void *metacall_error_throw(const char *label, int64_t code, const char *stacktrace, const char *message, ...); + /** * @brief * Retrieve the exception from a value, it can be either a throwable value with an exception inside or an exception itself diff --git a/source/metacall/source/metacall_error.c b/source/metacall/source/metacall_error.c index 4bceddc72..68829a5ab 100644 --- a/source/metacall/source/metacall_error.c +++ b/source/metacall/source/metacall_error.c @@ -28,6 +28,41 @@ /* -- Methods -- */ +void *metacall_error_throw(const char *label, int64_t code, const char *stacktrace, const char *message, ...) +{ + va_list args, args_copy; + int length; + char *buffer; + exception ex; + throwable th; + + va_start(args, message); + va_copy(args_copy, args); + length = vsnprintf(NULL, 0, message, args_copy); + va_end(args_copy); + + if (length < 0) + { + va_end(args); + return NULL; /* TODO: Return a generic static error here */ + } + + buffer = malloc(length + 1); + + if (!buffer) + { + va_end(args); + return NULL; /* TODO: Return a generic static error here */ + } + + vsnprintf(buffer, length + 1, message, args); + va_end(args); + + ex = exception_create_message_const(buffer, label, code, stacktrace); + th = throwable_create(value_create_exception(ex)); + return value_create_throwable(th); +} + int metacall_error_from_value(void *v, metacall_exception ex) { if (v == NULL || ex == NULL) From c722edd16aeca5cbcc0bc12bc4ba69d1ef035336 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 28 Aug 2025 19:40:38 +0200 Subject: [PATCH 427/487] Add exception facility for errors. --- .../include/reflect/reflect_exception.h | 2 + source/reflect/source/reflect_exception.c | 67 +++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/source/reflect/include/reflect/reflect_exception.h b/source/reflect/include/reflect/reflect_exception.h index 81ff9a3a8..476bb417b 100644 --- a/source/reflect/include/reflect/reflect_exception.h +++ b/source/reflect/include/reflect/reflect_exception.h @@ -37,6 +37,8 @@ REFLECT_API exception exception_create(char *message, char *label, int64_t code, REFLECT_API exception exception_create_const(const char *message, const char *label, int64_t code, const char *stacktrace); +REFLECT_API exception exception_create_message_const(char *message, const char *label, int64_t code, const char *stacktrace); + REFLECT_API int exception_increment_reference(exception ex); REFLECT_API int exception_decrement_reference(exception ex); diff --git a/source/reflect/source/reflect_exception.c b/source/reflect/source/reflect_exception.c index 34b3dc2d3..7a85d46b0 100644 --- a/source/reflect/source/reflect_exception.c +++ b/source/reflect/source/reflect_exception.c @@ -153,6 +153,73 @@ exception exception_create_const(const char *message, const char *label, int64_t return NULL; } +exception exception_create_message_const(char *message, const char *label, int64_t code, const char *stacktrace) +{ + exception ex = malloc(sizeof(struct exception_type)); + + if (ex == NULL) + { + goto exception_bad_alloc; + } + + ex->message = message; + + if (label != NULL) + { + size_t label_size = strlen(label) + 1; + + ex->label = malloc(sizeof(char) * label_size); + + if (ex->label == NULL) + { + goto label_bad_alloc; + } + + memcpy(ex->label, label, label_size); + } + else + { + ex->label = NULL; + } + + if (stacktrace != NULL) + { + size_t stacktrace_size = strlen(stacktrace) + 1; + + ex->stacktrace = malloc(sizeof(char) * stacktrace_size); + + if (ex->stacktrace == NULL) + { + goto stacktrace_bad_alloc; + } + + memcpy(ex->stacktrace, stacktrace, stacktrace_size); + } + else + { + ex->stacktrace = NULL; + } + + ex->code = code; + ex->id = thread_id_get_current(); + + threading_atomic_ref_count_initialize(&ex->ref); + + reflect_memory_tracker_allocation(exception_stats); + + return ex; + +stacktrace_bad_alloc: + if (ex->label != NULL) + { + free(ex->label); + } +label_bad_alloc: + free(ex); +exception_bad_alloc: + return NULL; +} + int exception_increment_reference(exception ex) { if (ex == NULL) From abf23518c4506dea81030d0294dabe3f7b62c09f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 28 Aug 2025 19:40:55 +0200 Subject: [PATCH 428/487] Solve issues with metacall values. --- source/reflect/source/reflect_value_type.c | 30 ++++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/source/reflect/source/reflect_value_type.c b/source/reflect/source/reflect_value_type.c index 6775aac44..cc5692161 100644 --- a/source/reflect/source/reflect_value_type.c +++ b/source/reflect/source/reflect_value_type.c @@ -525,15 +525,29 @@ value value_from_double(value v, double d) value value_from_string(value v, const char *str, size_t length) { - if (v != NULL && str != NULL && length > 0) + if (v != NULL) { - size_t current_size = value_size(v); + if (str == NULL || length == 0) + { + return value_from(v, NULL, 1); + } + else + { + size_t current_size = value_type_size(v); - size_t bytes = length + 1; + size_t bytes = length + 1; - size_t size = (bytes <= current_size) ? bytes : current_size; + size_t size = (bytes <= current_size) ? bytes : current_size; - return value_from(v, str, size); + value_from(v, str, size); + + if (bytes > current_size) + { + char *str = value_to_string(v); + + str[size - 1] = '\0'; + } + } } return v; @@ -543,7 +557,7 @@ value value_from_buffer(value v, const void *buffer, size_t size) { if (v != NULL && buffer != NULL && size > 0) { - size_t current_size = value_size(v); + size_t current_size = value_type_size(v); size_t bytes = sizeof(char) * size; @@ -557,7 +571,7 @@ value value_from_array(value v, const value *values, size_t size) { if (v != NULL && values != NULL && size > 0) { - size_t current_size = value_size(v); + size_t current_size = value_type_size(v); size_t bytes = sizeof(const value) * size; @@ -571,7 +585,7 @@ value value_from_map(value v, const value *tuples, size_t size) { if (v != NULL && tuples != NULL && size > 0) { - size_t current_size = value_size(v); + size_t current_size = value_type_size(v); size_t bytes = sizeof(const value) * size; From b6054cee5d044e7ad29509357995bd40749a806e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 28 Aug 2025 19:41:48 +0200 Subject: [PATCH 429/487] Improve C loader with more types and issues. --- .../loaders/c_loader/source/c_loader_impl.cpp | 107 ++++++++++++++++-- source/scripts/c/compiled/source/compiled.c | 101 +++++++++++++++++ source/scripts/c/loadtest/source/loadtest.cpp | 4 + source/scripts/c/loadtest/source/loadtest.h | 2 +- 4 files changed, 203 insertions(+), 11 deletions(-) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index a4e57914c..d1ef1cb78 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -55,6 +55,7 @@ namespace fs = std::experimental::filesystem; #include <string> #include <vector> +#include <cassert> #include <cstring> /* LibFFI */ @@ -633,10 +634,18 @@ ffi_type *c_loader_impl_ffi_type(type_id id) return &ffi_type_float; case TYPE_DOUBLE: return &ffi_type_double; + case TYPE_STRING: + return &ffi_type_pointer; + case TYPE_BUFFER: + return &ffi_type_pointer; + case TYPE_ARRAY: + return &ffi_type_pointer; case TYPE_PTR: return &ffi_type_pointer; case TYPE_FUNCTION: return &ffi_type_pointer; + case TYPE_NULL: + return &ffi_type_void; } return &ffi_type_void; @@ -648,8 +657,7 @@ function_return function_c_interface_invoke(function func, function_impl impl, f if (args_size != signature_count(s)) { - log_write("metacall", LOG_LEVEL_ERROR, "Invalid number of arguments when calling %s (canceling call in order to avoid a segfault)", function_name(func)); - return NULL; + return metacall_error_throw("C Loader Error", 0, "", "Invalid number of arguments when calling %s (canceling call in order to avoid a segfault)", function_name(func)); } loader_impl_c_function c_function = static_cast<loader_impl_c_function>(impl); @@ -663,7 +671,7 @@ function_return function_c_interface_invoke(function func, function_impl impl, f if (id != value_id) { - log_write("metacall", LOG_LEVEL_ERROR, + return metacall_error_throw("C Loader Error", 0, "", "Type mismatch in when calling %s in argument number %" PRIuS " (expected %s of type %s and received %s)." " Canceling call in order to avoid a segfault.", @@ -672,7 +680,6 @@ function_return function_c_interface_invoke(function func, function_impl impl, f type_name(t), type_id_name(id), type_id_name(value_id)); - return NULL; } if (id == TYPE_FUNCTION) @@ -683,19 +690,39 @@ function_return function_c_interface_invoke(function func, function_impl impl, f closures.push_back(closure); } - else + else if (id == TYPE_STRING || id == TYPE_BUFFER || id == TYPE_ARRAY || id == TYPE_PTR) { + /* + String, buffer requires to be pointer to a string + Array requires to be pointer to a array + Pointer requires to be pointer to pointer + */ + + /* In order to work, this must be true */ + assert(args[args_count] == value_data(args[args_count])); + + c_function->values[args_count] = (void *)&args[args_count]; + } + else if (type_id_integer(id) == 0 || type_id_decimal(id) == 0) + { + /* Primitive types already have the pointer indirection */ c_function->values[args_count] = value_data((value)args[args_count]); } + else + { + return metacall_error_throw("C Loader Error", 0, "", + "Type %s in argument number %" PRIuS " of function %s is not supported.", + type_id_name(id), + args_count, + function_name(func)); + } } type_id ret_id = type_index(signature_get_return(s)); size_t ret_size = value_type_id_size(ret_id); void *ret = NULL; - /* TODO: This if is not correct because the sizes of strings, objects, etc are - relative to the pointer, not the value contents, we should review this */ - if (ret_size <= sizeof(ffi_arg)) + if (ret_size <= sizeof(ffi_arg) && (type_id_integer(ret_id) == 0 || type_id_decimal(ret_id) == 0)) { ffi_arg result; @@ -705,9 +732,50 @@ function_return function_c_interface_invoke(function func, function_impl impl, f } else { - ret = value_type_create(NULL, ret_size, ret_id); + void *result = NULL; + void *result_ptr = &result; + + if (ret_id == TYPE_NULL) + { + ret = value_create_null(); + result_ptr = NULL; + } + else if (ret_id != TYPE_STRING && ret_id != TYPE_BUFFER && ret_id != TYPE_ARRAY && ret_id != TYPE_PTR) + { + /* TODO: This is not tested and we do not know how to handle it */ + /* TODO: result = ret = value_type_create(NULL, ret_size, ret_id); */ + + return metacall_error_throw("C Loader Error", 0, "", + "Return type %s in of function %s is not supported.", + type_id_name(ret_id), + function_name(func)); + } - ffi_call(&c_function->cif, FFI_FN(c_function->address), value_data(ret), c_function->values); + ffi_call(&c_function->cif, FFI_FN(c_function->address), result_ptr, c_function->values); + + if (ret_id == TYPE_STRING) + { + char *str = (char *)result; + ret = value_create_string(str, strlen(str)); + } + else if (ret_id == TYPE_BUFFER) + { + return metacall_error_throw("C Loader Error", 0, "", + "Return type %s in of function %s is not supported, buffer is unsafe to be returned because there is no way to reconstruct it without overflowing as there is no null character nor size information.", + type_id_name(ret_id), + function_name(func)); + } + else if (ret_id == TYPE_ARRAY) + { + return metacall_error_throw("C Loader Error", 0, "", + "Return type %s in of function %s is not supported, array is unsafe to be returned because there is no way to reconstruct it without overflowing as there is no null character nor size information.", + type_id_name(ret_id), + function_name(func)); + } + else if (ret_id == TYPE_PTR) + { + ret = value_create_ptr(result); + } } /* Clear allocated closures if any */ @@ -800,6 +868,7 @@ int c_loader_impl_initialize_types(loader_impl impl) { TYPE_BOOL, "bool" }, { TYPE_CHAR, "char" }, + { TYPE_CHAR, "unsigned char" }, { TYPE_CHAR, "int8_t" }, { TYPE_CHAR, "uint8_t" }, { TYPE_CHAR, "int_least8_t" }, @@ -808,6 +877,7 @@ int c_loader_impl_initialize_types(loader_impl impl) { TYPE_CHAR, "uint_fast8_t" }, { TYPE_SHORT, "short" }, + { TYPE_SHORT, "unsigned short" }, { TYPE_SHORT, "int16_t" }, { TYPE_SHORT, "uint16_t" }, { TYPE_SHORT, "int_least16_t" }, @@ -816,6 +886,7 @@ int c_loader_impl_initialize_types(loader_impl impl) { TYPE_SHORT, "uint_fast16_t" }, { TYPE_INT, "int" }, + { TYPE_INT, "unsigned int" }, { TYPE_INT, "uint32_t" }, { TYPE_INT, "int32_t" }, { TYPE_INT, "int_least32_t" }, @@ -824,7 +895,9 @@ int c_loader_impl_initialize_types(loader_impl impl) { TYPE_INT, "uint_fast32_t" }, { TYPE_LONG, "long" }, + { TYPE_LONG, "unsigned long" }, { TYPE_LONG, "long long" }, + { TYPE_LONG, "unsigned long long" }, { TYPE_LONG, "uint64_t" }, { TYPE_LONG, "int64_t" }, { TYPE_LONG, "int_least64_t" }, @@ -838,6 +911,11 @@ int c_loader_impl_initialize_types(loader_impl impl) { TYPE_FLOAT, "float" }, { TYPE_DOUBLE, "double" }, + { TYPE_STRING, "unsigned char *" }, + { TYPE_STRING, "char *" }, + { TYPE_STRING, "const unsigned char *" }, + { TYPE_STRING, "const char *" }, + { TYPE_NULL, "void" } /* TODO: Do more types */ @@ -932,6 +1010,10 @@ static type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXTyp return TYPE_PTR; } + case CXType_ConstantArray: + case CXType_IncompleteArray: + return TYPE_ARRAY; + case CXType_FunctionProto: case CXType_FunctionNoProto: { c_loader_closure_type *closure_type = new c_loader_closure_type(impl); @@ -964,7 +1046,12 @@ static type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXTyp case CXType_Bool: return TYPE_BOOL; + case CXType_Short: + case CXType_UShort: + return TYPE_SHORT; + case CXType_Int: + case CXType_UInt: return TYPE_INT; case CXType_Void: diff --git a/source/scripts/c/compiled/source/compiled.c b/source/scripts/c/compiled/source/compiled.c index b7468cde7..e41807a41 100644 --- a/source/scripts/c/compiled/source/compiled.c +++ b/source/scripts/c/compiled/source/compiled.c @@ -1,4 +1,7 @@ +#include <assert.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> void compiled_print(int a, double b) { @@ -9,3 +12,101 @@ long compiled_sum(long a, long b) { return a + b; } + +char *return_text(void) +{ + static char input[] = "hello"; + return input; +} + +void process_text(char *input) +{ + printf("inside of compiled script '%s'\n", input); + assert(strcmp(input, "test_test") == 0); +} + +typedef struct data_t +{ + int value; +} * data_ptr_t; + +data_ptr_t alloc_data(void) +{ + data_ptr_t ptr = malloc(sizeof(struct data_t)); + + ptr->value = 0; + + printf("alloc_data %p\n", ptr); + + return ptr; +} + +void alloc_data_args(data_ptr_t *ptr) +{ + *ptr = malloc(sizeof(struct data_t)); + + (*ptr)->value = 0; + + printf("alloc_data_args %p\n", *ptr); + printf("alloc_data_args ref %p\n", ptr); +} + +int compare_data_value(data_ptr_t left, data_ptr_t right) +{ + printf("left %p\n", left); + printf("right %p\n", right); + assert(left == right); + return left == right; +} + +void set_data_value(data_ptr_t ptr, int value) +{ + printf("set_data_value %p\n", ptr); + ptr->value = value; +} + +int get_data_value(data_ptr_t ptr) +{ + printf("get_data_value %p\n", ptr); + return ptr->value; +} + +void free_data(data_ptr_t ptr) +{ + printf("free_data %p\n", ptr); + free(ptr); +} + +// TODO: When calling from NodeJS it does not work, +// NodeJS emmits double as a call, and this expects long, it needs a casting +void modify_int_ptr(long *l) +{ + printf("l %p\n", l); + printf("value %d\n", *l); + assert(*l == 324444L); + *l = 111L; +} + +void modify_double_ptr(double *d) +{ + printf("d %p\n", d); + printf("value %f\n", *d); + assert(*d == 324444.0); + *d = 111.0; +} + +void modify_str_ptr(char **str_ptr) +{ + static char new_str[] = "yeet"; + printf("(C) pointer %p\n", str_ptr); + printf("(C) string %p\n", (*str_ptr)); + printf("(C) string value %s\n", *str_ptr); + fflush(stdout); + assert(strcmp("asd", *str_ptr) == 0); + *str_ptr = new_str; + printf("(C) pointer %p\n", str_ptr); + printf("(C) string %p\n", (*str_ptr)); + printf("(C) string value %s\n", *str_ptr); + fflush(stdout); + assert(strcmp("yeet", *str_ptr) == 0); +} diff --git a/source/scripts/c/loadtest/source/loadtest.cpp b/source/scripts/c/loadtest/source/loadtest.cpp index 8dcb43ded..5ddaf4b11 100644 --- a/source/scripts/c/loadtest/source/loadtest.cpp +++ b/source/scripts/c/loadtest/source/loadtest.cpp @@ -1,4 +1,5 @@ #include "loadtest.h" +#include <iostream> #include <vector> long call_cpp_func(void) @@ -23,6 +24,9 @@ int pair_list_init(pair_list **t) (*t)->pairs[i].d = (double)(((double)i) * 1.0); } + std::cout << "pair_list_init: " << t << std::endl; + std::cout << "pair_list_init: *(" << *t << ")" << std::endl; + return 0; } diff --git a/source/scripts/c/loadtest/source/loadtest.h b/source/scripts/c/loadtest/source/loadtest.h index 3e4f07274..4a9335695 100644 --- a/source/scripts/c/loadtest/source/loadtest.h +++ b/source/scripts/c/loadtest/source/loadtest.h @@ -11,7 +11,7 @@ extern "C" { #endif -#include <cstdint> +#include <stdint.h> typedef struct { From 10df5e1e50b6fb9d7a29ca249cbddce71b7a3c97 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 28 Aug 2025 19:42:07 +0200 Subject: [PATCH 430/487] Solve issues with pointers in node loader. --- source/loaders/node_loader/source/node_loader_impl.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source/loaders/node_loader/source/node_loader_impl.cpp b/source/loaders/node_loader/source/node_loader_impl.cpp index e12594884..b493d1964 100644 --- a/source/loaders/node_loader/source/node_loader_impl.cpp +++ b/source/loaders/node_loader/source/node_loader_impl.cpp @@ -1442,14 +1442,13 @@ value node_loader_impl_napi_to_value(loader_impl_node node_impl, napi_env env, n } else if (valuetype == napi_external) { - /* Returns the previously allocated copy */ void *c = nullptr; status = napi_get_value_external(env, v, &c); node_loader_impl_exception(env, status); - return c; + return value_create_ptr(c); } return ret; @@ -1635,10 +1634,7 @@ napi_value node_loader_impl_value_to_napi(loader_impl_node node_impl, napi_env e } else if (id == TYPE_PTR) { - /* Copy value and set the ownership, the old value will be deleted after the call */ - void *c = value_copy(arg_value); - - value_move(arg_value, c); + void *c = value_to_ptr(arg_value); status = napi_create_external(env, c, nullptr, nullptr, &v); From 703d33648e84f08400166aa6d9537809053b9ca8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 29 Aug 2025 18:10:41 +0200 Subject: [PATCH 431/487] Add support for array by value. --- .../loaders/c_loader/source/c_loader_impl.cpp | 132 +++++++++++++++++- source/scripts/c/compiled/source/compiled.c | 31 ++++ .../source/metacall_c_test.cpp | 64 +++++++++ 3 files changed, 222 insertions(+), 5 deletions(-) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index d1ef1cb78..d2cfefed1 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -517,6 +517,95 @@ class c_loader_closure_value } }; +static type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXType cx_type, c_loader_type_impl **impl_type); + +class c_loader_array_type : public c_loader_type_impl +{ +public: + std::optional<long long> size; + type_id id; + + c_loader_array_type(loader_impl impl, CXCursor cursor, CXType cx_type, c_loader_type_impl **impl_type) + { + CXType element_cx_type = clang_getArrayElementType(cx_type); + + id = c_loader_impl_clang_type(impl, cursor, element_cx_type, impl_type); + + if (cx_type.kind == CXType_ConstantArray) + { + size = clang_getArraySize(cx_type); + + if (size < 0) + { + size = 0; + } + } + } + + ~c_loader_array_type() {} + + void *generate_c_array(void *array, size_t args_count, function func, void **error) + { + size_t count = metacall_value_count(array); + + /* Check if array size is correct */ + if (size.has_value()) + { + if (count != static_cast<size_t>(*size)) + { + *error = metacall_error_throw("C Loader Error", 0, "", "Argument %" PRIuS " of type array with different size when calling %s (expecting an array of size %d, received an array of size %" PRIuS ")", args_count, function_name(func), *size, count); + return NULL; + } + } + + /* Check if array type is correct */ + void **array_ptr = metacall_value_to_array(array); + + for (size_t it = 0; it < count; ++it) + { + if (metacall_value_id(array_ptr[it]) != id) + { + *error = metacall_error_throw("C Loader Error", 0, "", "Argument %" PRIuS " of type array with different type when calling %s (expecting an array of type %s, received an array of type %s in the element %" PRIuS ")", args_count, function_name(func), type_id_name(id), metacall_value_type_name(array_ptr[it]), it); + return NULL; + } + } + + /* Allocate temporal memory */ + size_t type_size = value_type_id_size(id); + void **memory_ptr = static_cast<void **>(malloc(sizeof(void **))); + + if (memory_ptr == NULL) + { + *error = metacall_error_throw("C Loader Error", 0, "", "Argument %" PRIuS " failed to allocate memory pointer for the array when calling %s", args_count, function_name(func)); + return NULL; + } + + void *memory = malloc(count * type_size); + + if (memory == NULL) + { + *error = metacall_error_throw("C Loader Error", 0, "", "Argument %" PRIuS " failed to allocate memory for the array when calling %s", args_count, function_name(func)); + free(memory_ptr); + return NULL; + } + + for (size_t it = 0; it < count; ++it) + { + std::memcpy(&((unsigned char *)memory)[it * type_size], array_ptr[it], type_size); + } + + *memory_ptr = memory; + + return memory_ptr; + } + + static void free_c_array(void **memory_ptr) + { + free(*memory_ptr); + free(memory_ptr); + } +}; + std::string c_loader_impl_cxstring_to_str(const CXString &s) { std::string result = clang_getCString(s); @@ -690,11 +779,10 @@ function_return function_c_interface_invoke(function func, function_impl impl, f closures.push_back(closure); } - else if (id == TYPE_STRING || id == TYPE_BUFFER || id == TYPE_ARRAY || id == TYPE_PTR) + else if (id == TYPE_STRING || id == TYPE_BUFFER || id == TYPE_PTR) { /* String, buffer requires to be pointer to a string - Array requires to be pointer to a array Pointer requires to be pointer to pointer */ @@ -703,6 +791,19 @@ function_return function_c_interface_invoke(function func, function_impl impl, f c_function->values[args_count] = (void *)&args[args_count]; } + else if (id == TYPE_ARRAY) + { + c_loader_array_type *array = static_cast<c_loader_array_type *>(type_derived(t)); + void *error = NULL; + void *array_ptr = array->generate_c_array(args[args_count], args_count, func, &error); + + if (error != NULL) + { + return error; + } + + c_function->values[args_count] = array_ptr; + } else if (type_id_integer(id) == 0 || type_id_decimal(id) == 0) { /* Primitive types already have the pointer indirection */ @@ -778,6 +879,17 @@ function_return function_c_interface_invoke(function func, function_impl impl, f } } + for (size_t args_count = 0; args_count < args_size; ++args_count) + { + type t = signature_get_type(s, args_count); + type_id id = type_index(t); + + if (id == TYPE_ARRAY) + { + c_loader_array_type::free_c_array(static_cast<void **>(c_function->values[args_count])); + } + } + /* Clear allocated closures if any */ for (c_loader_closure_value *closure : closures) { @@ -984,7 +1096,7 @@ int c_loader_impl_execution_path(loader_impl impl, const loader_path path) return 0; } -static type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXType cx_type, c_loader_type_impl **impl_type) +type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXType cx_type, c_loader_type_impl **impl_type) { switch (cx_type.kind) { @@ -1011,8 +1123,18 @@ static type_id c_loader_impl_clang_type(loader_impl impl, CXCursor cursor, CXTyp } case CXType_ConstantArray: - case CXType_IncompleteArray: - return TYPE_ARRAY; + case CXType_IncompleteArray: { + c_loader_array_type *array_type = new c_loader_array_type(impl, cursor, cx_type, impl_type); + + if (array_type != nullptr) + { + *impl_type = static_cast<c_loader_array_type *>(array_type); + + return TYPE_ARRAY; + } + + return TYPE_INVALID; + } case CXType_FunctionProto: case CXType_FunctionNoProto: { diff --git a/source/scripts/c/compiled/source/compiled.c b/source/scripts/c/compiled/source/compiled.c index e41807a41..c8e33e9d9 100644 --- a/source/scripts/c/compiled/source/compiled.c +++ b/source/scripts/c/compiled/source/compiled.c @@ -77,6 +77,37 @@ void free_data(data_ptr_t ptr) free(ptr); } +/* https://github.com/metacall/core/issues/570 */ +void apply_blur_filter(int pixels[], int width, int height) +{ + int size = width * height; + + printf("pixels == %p\n", pixels); + fflush(stdout); + + for (int i = 0; i < size; i++) + { + printf("pixels[%d] == %d\n", pixels[i], i); + fflush(stdout); + assert(pixels[i] == i); + pixels[i] = pixels[i] / 2; + } + printf("C: Blur filter applied on %d pixels\n", size); +} + +double calculate_brightness(int pixels[], int size) +{ + long sum = 0; + for (int i = 0; i < size; i++) + { + assert(pixels[i] == i); + sum += pixels[i]; + } + double avg = (double)sum / (double)size; + printf("C: Average brightness = %f\n", avg); + return avg; +} + // TODO: When calling from NodeJS it does not work, // NodeJS emmits double as a call, and this expects long, it needs a casting void modify_int_ptr(long *l) diff --git a/source/tests/metacall_c_test/source/metacall_c_test.cpp b/source/tests/metacall_c_test/source/metacall_c_test.cpp index 46cce764e..2721c469c 100644 --- a/source/tests/metacall_c_test/source/metacall_c_test.cpp +++ b/source/tests/metacall_c_test/source/metacall_c_test.cpp @@ -60,6 +60,70 @@ TEST_F(metacall_c_test, DefaultConstructor) metacall_value_destroy(ret); + /* https://github.com/metacall/core/issues/570 */ + { + /* Call by array */ + { + void *args[] = { + metacall_value_create_array(NULL, 100), + metacall_value_create_int(10), + metacall_value_create_int(10) + }; + + void **array_ptr = metacall_value_to_array(args[0]); + + for (int i = 0; i < 100; ++i) + { + array_ptr[i] = metacall_value_create_int(i); + } + + std::cout << "value: " << args[0] << std::endl; + std::cout << "array: " << array_ptr << std::endl; + + ret = metacallv("apply_blur_filter", args); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + + metacall_value_destroy(args[0]); + metacall_value_destroy(args[1]); + metacall_value_destroy(args[2]); + } + + /* Call by pointer */ + { + int array[100]; + + void *args[] = { + metacall_value_create_ptr(array), + metacall_value_create_int(10), + metacall_value_create_int(10) + }; + + for (int i = 0; i < 100; ++i) + { + array[i] = i; + } + + ret = metacallv("apply_blur_filter", args); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + + metacall_value_destroy(args[0]); + metacall_value_destroy(args[1]); + metacall_value_destroy(args[2]); + } + + // TODO: double calculate_brightness(int pixels[], int size) + } + /* File with dependencies */ const char *c_dep_scripts[] = { "ffi.c", From 0a313d25ebca4d8e795117228637e0d1e6cb7557 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 2 Sep 2025 17:24:20 +0200 Subject: [PATCH 432/487] Improve C loader ptr and tests. --- .../loaders/c_loader/source/c_loader_impl.cpp | 12 +- source/scripts/c/loadtest/source/loadtest.cpp | 4 + .../source/metacall_c_lib_test.cpp | 17 ++- .../source/metacall_c_test.cpp | 104 ++++++++++++++++++ 4 files changed, 126 insertions(+), 11 deletions(-) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index d2cfefed1..bb712d5ad 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -52,6 +52,7 @@ namespace fs = std::experimental::filesystem; #endif #include <map> +#include <optional> #include <string> #include <vector> @@ -779,18 +780,19 @@ function_return function_c_interface_invoke(function func, function_impl impl, f closures.push_back(closure); } - else if (id == TYPE_STRING || id == TYPE_BUFFER || id == TYPE_PTR) + else if (id == TYPE_STRING || id == TYPE_BUFFER) { - /* - String, buffer requires to be pointer to a string - Pointer requires to be pointer to pointer - */ + /* String, buffer requires to be pointer to a string */ /* In order to work, this must be true */ assert(args[args_count] == value_data(args[args_count])); c_function->values[args_count] = (void *)&args[args_count]; } + else if (id == TYPE_PTR) + { + c_function->values[args_count] = args[args_count]; + } else if (id == TYPE_ARRAY) { c_loader_array_type *array = static_cast<c_loader_array_type *>(type_derived(t)); diff --git a/source/scripts/c/loadtest/source/loadtest.cpp b/source/scripts/c/loadtest/source/loadtest.cpp index 5ddaf4b11..3bc2b6328 100644 --- a/source/scripts/c/loadtest/source/loadtest.cpp +++ b/source/scripts/c/loadtest/source/loadtest.cpp @@ -13,6 +13,9 @@ int pair_list_init(pair_list **t) { static const uint32_t size = 3; + std::cout << "pair_list_init: " << t << std::endl; + std::cout << "pair_list_init: *(" << *t << ")" << std::endl; + *t = new pair_list(); (*t)->size = size; @@ -37,6 +40,7 @@ double pair_list_value(pair_list *t, uint32_t id) void pair_list_destroy(pair_list *t) { + std::cout << "pair_list_destroy: *(" << t << ")" << std::endl; delete[] t->pairs; delete t; } diff --git a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp index cabe0100b..1f61c2b17 100644 --- a/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp +++ b/source/tests/metacall_c_lib_test/source/metacall_c_lib_test.cpp @@ -43,14 +43,20 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) metacall_value_destroy(ret); - void *pair_list = NULL; + void *pair_list_ptr = metacall_value_create_ptr(NULL); void *args_init[] = { - metacall_value_create_ptr(&pair_list), + metacall_value_create_ptr(pair_list_ptr), }; + std::cout << "pair_list_ptr: " << pair_list_ptr << std::endl; + std::cout << "pair_list_ptr: *(" << metacall_value_to_ptr(pair_list_ptr) << ")" << std::endl; + ret = metacallv("pair_list_init", args_init); + std::cout << "pair_list_ptr: " << pair_list_ptr << std::endl; + std::cout << "pair_list_ptr: *(" << metacall_value_to_ptr(pair_list_ptr) << ")" << std::endl; + EXPECT_NE((void *)NULL, (void *)ret); EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_INT); @@ -62,7 +68,7 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) metacall_value_destroy(args_init[0]); void *args_value[] = { - metacall_value_create_ptr(pair_list), + pair_list_ptr, metacall_value_create_int(2) }; @@ -76,11 +82,10 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) metacall_value_destroy(ret); - metacall_value_destroy(args_value[0]); metacall_value_destroy(args_value[1]); void *args_destroy[] = { - metacall_value_create_ptr(pair_list), + pair_list_ptr, }; ret = metacallv("pair_list_destroy", args_destroy); @@ -91,7 +96,7 @@ TEST_F(metacall_c_lib_test, DefaultConstructor) metacall_value_destroy(ret); - metacall_value_destroy(args_destroy[0]); + metacall_value_destroy(pair_list_ptr); metacall_destroy(); } diff --git a/source/tests/metacall_c_test/source/metacall_c_test.cpp b/source/tests/metacall_c_test/source/metacall_c_test.cpp index 2721c469c..490428e15 100644 --- a/source/tests/metacall_c_test/source/metacall_c_test.cpp +++ b/source/tests/metacall_c_test/source/metacall_c_test.cpp @@ -41,6 +41,37 @@ void *sum_callback(size_t argc, void *args[], void *data) return metacall_value_create_int(result); } +void *test_string_reference(size_t argc, void *args[], void *data) +{ + printf("ptr %p\n", args[0]); + fflush(stdout); + + void *string_value = metacall_value_to_ptr(args[0]); + + printf("string ptr %p\n", string_value); + printf("type id %s\n", metacall_value_type_name(string_value)); + fflush(stdout); + + char *str = metacall_value_to_string(string_value); + + (void)argc; + (void)data; + + printf("native string %s\n", str); + + EXPECT_STREQ("asd", str); + + static const char yeet[] = "yeet"; + + metacall_value_from_string(string_value, yeet, sizeof(yeet) - 1); + + printf("type id %s\n", metacall_value_type_name(string_value)); + printf("native string %s\n", str); + fflush(stdout); + + return metacall_value_create_null(); +} + TEST_F(metacall_c_test, DefaultConstructor) { ASSERT_EQ((int)0, (int)metacall_initialize()); @@ -196,6 +227,79 @@ TEST_F(metacall_c_test, DefaultConstructor) // metacall_value_destroy(ret); + /* References (Native) */ + { + static const char str[] = "asd"; + void *str_value = metacall_value_create_string(str, sizeof(str) - 1); + void *str_value_ref = metacall_value_reference(str_value); + + printf("ptr %p\n", str_value_ref); + printf("string %p\n", str_value); + printf("string str %s\n", metacall_value_to_string(str_value)); + fflush(stdout); + + { + void *new_str_value = metacall_value_to_ptr(str_value_ref); + char *new_str = metacall_value_to_string(new_str_value); + + EXPECT_STREQ("asd", new_str); + } + + void *args[] = { + str_value_ref + }; + + metacall_register("test_string_reference", test_string_reference, NULL, METACALL_NULL, 1, METACALL_PTR); + + ret = metacallv_s("test_string_reference", args, 1); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + + printf("type id %s\n", metacall_value_type_name(str_value)); + fflush(stdout); + + // It chops the string because it has a fixed size from 'asd' + EXPECT_STREQ(metacall_value_to_string(str_value), "yee"); + + metacall_value_destroy(str_value); + metacall_value_destroy(str_value_ref); + } + + /* References (C) */ + { + static const char str[] = "asd"; + void *str_value = metacall_value_create_string(str, sizeof(str) - 1); + void *str_value_ref = metacall_value_reference(str_value); + + printf("(R) ptr %p\n", str_value_ref); + printf("(R) string ptr %p\n", str_value); + printf("(R) string str %s\n", metacall_value_to_string(str_value)); + fflush(stdout); + + void *args[] = { + str_value_ref + }; + + ret = metacallv_s("modify_str_ptr", args, 1); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + + char *str_value_deref = static_cast<char *>(metacall_value_dereference(str_value_ref)); + + EXPECT_STREQ(str_value_deref, "yeet"); + + metacall_value_destroy(str_value); + metacall_value_destroy(str_value_ref); + } + /* Print inspect information */ { size_t size = 0; From 55dbfb4402b49c5bd8c85b9ff8d1684e8bc555cf Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 2 Sep 2025 22:55:47 +0200 Subject: [PATCH 433/487] Improve pointer, array in C loader. --- .../loaders/c_loader/source/c_loader_impl.cpp | 80 ++++++++++++++++--- .../reflect/source/reflect_value_type_cast.c | 6 ++ .../source/metacall_c_test.cpp | 65 ++++++++++++++- 3 files changed, 141 insertions(+), 10 deletions(-) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index bb712d5ad..c041ffc5c 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -759,7 +759,8 @@ function_return function_c_interface_invoke(function func, function_impl impl, f type_id id = type_index(t); type_id value_id = value_type_id((value)args[args_count]); - if (id != value_id) + /* We can accept pointers if we pass to an array, it is unsafe but it improves efficiency */ + if (id != value_id && !(value_id == TYPE_PTR && id == TYPE_ARRAY)) { return metacall_error_throw("C Loader Error", 0, "", "Type mismatch in when calling %s in argument number %" PRIuS @@ -772,7 +773,7 @@ function_return function_c_interface_invoke(function func, function_impl impl, f type_id_name(value_id)); } - if (id == TYPE_FUNCTION) + if (value_id == TYPE_FUNCTION) { c_loader_closure_value *closure = new c_loader_closure_value(static_cast<c_loader_closure_type *>(type_derived(t))); @@ -780,7 +781,7 @@ function_return function_c_interface_invoke(function func, function_impl impl, f closures.push_back(closure); } - else if (id == TYPE_STRING || id == TYPE_BUFFER) + else if (value_id == TYPE_STRING || value_id == TYPE_BUFFER) { /* String, buffer requires to be pointer to a string */ @@ -789,11 +790,11 @@ function_return function_c_interface_invoke(function func, function_impl impl, f c_function->values[args_count] = (void *)&args[args_count]; } - else if (id == TYPE_PTR) + else if (value_id == TYPE_PTR) { c_function->values[args_count] = args[args_count]; } - else if (id == TYPE_ARRAY) + else if (value_id == TYPE_ARRAY) { c_loader_array_type *array = static_cast<c_loader_array_type *>(type_derived(t)); void *error = NULL; @@ -806,7 +807,7 @@ function_return function_c_interface_invoke(function func, function_impl impl, f c_function->values[args_count] = array_ptr; } - else if (type_id_integer(id) == 0 || type_id_decimal(id) == 0) + else if (type_id_integer(value_id) == 0 || type_id_decimal(value_id) == 0) { /* Primitive types already have the pointer indirection */ c_function->values[args_count] = value_data((value)args[args_count]); @@ -883,10 +884,9 @@ function_return function_c_interface_invoke(function func, function_impl impl, f for (size_t args_count = 0; args_count < args_size; ++args_count) { - type t = signature_get_type(s, args_count); - type_id id = type_index(t); + type_id value_id = value_type_id((value)args[args_count]); - if (id == TYPE_ARRAY) + if (value_id == TYPE_ARRAY) { c_loader_array_type::free_c_array(static_cast<void **>(c_function->values[args_count])); } @@ -1353,6 +1353,68 @@ static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_bas command_line_args.push_back(includes.back().c_str()); } + /* TODO: Load from memory (discover from memory) */ + /* + #include <clang-c/Index.h> + #include <stdio.h> + #include <stdlib.h> + + int main() { + const char *source_code = + "int add(int a, int b) {\n" + " return a + b;\n" + "}"; + + // Simulate an in-memory file + CXUnsavedFile unsaved_file; + unsaved_file.Filename = "example.c"; + unsaved_file.Contents = source_code; + unsaved_file.Length = (unsigned long)strlen(source_code); + + // Create index + CXIndex index = clang_createIndex(0, 0); + + // Parse translation unit from buffer (unsaved file) + CXTranslationUnit tu; + CXErrorCode err = clang_parseTranslationUnit2( + index, + "example.c", // filename for context (matches unsaved file) + NULL, 0, // command line args + &unsaved_file, 1, // unsaved files + CXTranslationUnit_None, // options + &tu + ); + + if (err != CXError_Success) { + fprintf(stderr, "Failed to parse translation unit.\n"); + return 1; + } + + // Get the cursor to the root of the translation unit + CXCursor cursor = clang_getTranslationUnitCursor(tu); + + // Visit each AST node + clang_visitChildren( + cursor, + [](CXCursor c, CXCursor parent, CXClientData client_data) { + CXString spelling = clang_getCursorSpelling(c); + CXString kind = clang_getCursorKindSpelling(clang_getCursorKind(c)); + printf("Cursor: %s (%s)\n", clang_getCString(spelling), clang_getCString(kind)); + clang_disposeString(spelling); + clang_disposeString(kind); + return CXChildVisit_Recurse; + }, + NULL + ); + + // Clean up + clang_disposeTranslationUnit(tu); + clang_disposeIndex(index); + + return 0; + } + */ + for (std::string file : c_handle->files) { /* Define the command line arguments (simulating compiler flags) */ diff --git a/source/reflect/source/reflect_value_type_cast.c b/source/reflect/source/reflect_value_type_cast.c index 7b7410da3..e7b667026 100644 --- a/source/reflect/source/reflect_value_type_cast.c +++ b/source/reflect/source/reflect_value_type_cast.c @@ -36,6 +36,12 @@ value value_type_cast(value v, type_id id) return v; } + /* Exception raised, avoid casting */ + if (type_id_throwable(src_id) == 0) + { + return v; + } + /* Cast from string to any type */ if (type_id_string(src_id) == 0) { diff --git a/source/tests/metacall_c_test/source/metacall_c_test.cpp b/source/tests/metacall_c_test/source/metacall_c_test.cpp index 490428e15..7aa43a950 100644 --- a/source/tests/metacall_c_test/source/metacall_c_test.cpp +++ b/source/tests/metacall_c_test/source/metacall_c_test.cpp @@ -93,6 +93,8 @@ TEST_F(metacall_c_test, DefaultConstructor) /* https://github.com/metacall/core/issues/570 */ { + /* void apply_blur_filter(int pixels[], int width, int height) */ + /* Call by array */ { void *args[] = { @@ -152,7 +154,68 @@ TEST_F(metacall_c_test, DefaultConstructor) metacall_value_destroy(args[2]); } - // TODO: double calculate_brightness(int pixels[], int size) + /* double calculate_brightness(int pixels[], int size) */ + + /* Call by array */ + { + void *args[] = { + metacall_value_create_array(NULL, 100), + metacall_value_create_int(100) + }; + + void **array_ptr = metacall_value_to_array(args[0]); + + for (int i = 0; i < 100; ++i) + { + array_ptr[i] = metacall_value_create_int(i); + } + + std::cout << "value: " << args[0] << std::endl; + std::cout << "array: " << array_ptr << std::endl; + + ret = metacallv("calculate_brightness", args); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_DOUBLE); + + std::cout << "result: " << metacall_value_to_double(ret) << std::endl; + + EXPECT_EQ((double)metacall_value_to_double(ret), (double)49.5); + + metacall_value_destroy(ret); + + metacall_value_destroy(args[0]); + metacall_value_destroy(args[1]); + } + + /* Call by pointer */ + { + int array[100]; + + void *args[] = { + metacall_value_create_ptr(array), + metacall_value_create_int(100) + }; + + for (int i = 0; i < 100; ++i) + { + array[i] = i; + } + + ret = metacallv("calculate_brightness", args); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_DOUBLE); + + std::cout << "result: " << metacall_value_to_double(ret) << std::endl; + + metacall_value_destroy(ret); + + metacall_value_destroy(args[0]); + metacall_value_destroy(args[1]); + } } /* File with dependencies */ From 9c9581bb288f24f8bc3b14cf4095d693020806a0 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 3 Sep 2025 17:13:00 +0200 Subject: [PATCH 434/487] Solve issues with tests. --- source/scripts/c/compiled/source/compiled.c | 4 ++ .../source/metacall_c_test.cpp | 59 +++++++++++++++++-- 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/source/scripts/c/compiled/source/compiled.c b/source/scripts/c/compiled/source/compiled.c index c8e33e9d9..8493e28d9 100644 --- a/source/scripts/c/compiled/source/compiled.c +++ b/source/scripts/c/compiled/source/compiled.c @@ -114,6 +114,7 @@ void modify_int_ptr(long *l) { printf("l %p\n", l); printf("value %d\n", *l); + fflush(stdout); assert(*l == 324444L); *l = 111L; } @@ -122,6 +123,7 @@ void modify_double_ptr(double *d) { printf("d %p\n", d); printf("value %f\n", *d); + fflush(stdout); assert(*d == 324444.0); *d = 111.0; } @@ -130,7 +132,9 @@ void modify_str_ptr(char **str_ptr) { static char new_str[] = "yeet"; printf("(C) pointer %p\n", str_ptr); + fflush(stdout); printf("(C) string %p\n", (*str_ptr)); + fflush(stdout); printf("(C) string value %s\n", *str_ptr); fflush(stdout); assert(strcmp("asd", *str_ptr) == 0); diff --git a/source/tests/metacall_c_test/source/metacall_c_test.cpp b/source/tests/metacall_c_test/source/metacall_c_test.cpp index 7aa43a950..b661e8b39 100644 --- a/source/tests/metacall_c_test/source/metacall_c_test.cpp +++ b/source/tests/metacall_c_test/source/metacall_c_test.cpp @@ -43,6 +43,10 @@ void *sum_callback(size_t argc, void *args[], void *data) void *test_string_reference(size_t argc, void *args[], void *data) { + (void)argc; + (void)data; + + /* Get string from pointer */ printf("ptr %p\n", args[0]); fflush(stdout); @@ -54,13 +58,12 @@ void *test_string_reference(size_t argc, void *args[], void *data) char *str = metacall_value_to_string(string_value); - (void)argc; - (void)data; - printf("native string %s\n", str); + /* Check it is a valid string */ EXPECT_STREQ("asd", str); + /* Replace the string, it will be choped by the previous length */ static const char yeet[] = "yeet"; metacall_value_from_string(string_value, yeet, sizeof(yeet) - 1); @@ -69,6 +72,13 @@ void *test_string_reference(size_t argc, void *args[], void *data) printf("native string %s\n", str); fflush(stdout); + EXPECT_STREQ("yee", str); + + /* Define a new string in the pointer value */ + static const char hello[] = "hello world"; + + metacall_value_from_ptr(args[0], metacall_value_create_string(hello, sizeof(hello) - 1)); + return metacall_value_create_null(); } @@ -325,18 +335,26 @@ TEST_F(metacall_c_test, DefaultConstructor) printf("type id %s\n", metacall_value_type_name(str_value)); fflush(stdout); - // It chops the string because it has a fixed size from 'asd' + /* It chops the string because it has a fixed size from 'asd' */ EXPECT_STREQ(metacall_value_to_string(str_value), "yee"); metacall_value_destroy(str_value); + + /* It should contain the new string */ + void *new_str = metacall_value_dereference(str_value_ref); + + EXPECT_STREQ(metacall_value_to_string(new_str), "hello world"); + + metacall_value_destroy(new_str); metacall_value_destroy(str_value_ref); } - /* References (C) */ + /* References (C: string) */ { static const char str[] = "asd"; void *str_value = metacall_value_create_string(str, sizeof(str) - 1); void *str_value_ref = metacall_value_reference(str_value); + void *str_value_ref_ref = metacall_value_reference(str_value_ref); printf("(R) ptr %p\n", str_value_ref); printf("(R) string ptr %p\n", str_value); @@ -344,7 +362,7 @@ TEST_F(metacall_c_test, DefaultConstructor) fflush(stdout); void *args[] = { - str_value_ref + str_value_ref_ref }; ret = metacallv_s("modify_str_ptr", args, 1); @@ -361,6 +379,35 @@ TEST_F(metacall_c_test, DefaultConstructor) metacall_value_destroy(str_value); metacall_value_destroy(str_value_ref); + metacall_value_destroy(str_value_ref_ref); + } + + /* References (C: int) */ + { + void *int_value = metacall_value_create_long(324444L); + void *int_value_ref = metacall_value_reference(int_value); + + printf("(R) ptr %p\n", int_value_ref); + printf("(R) int ptr %p\n", int_value); + printf("(R) int value %ld\n", metacall_value_to_long(int_value)); + fflush(stdout); + + void *args[] = { + int_value_ref + }; + + ret = metacallv_s("modify_int_ptr", args, 1); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + + EXPECT_EQ((long)metacall_value_to_long(int_value), (long)111L); + + metacall_value_destroy(int_value); + metacall_value_destroy(int_value_ref); } /* Print inspect information */ From 6b59246e6e9e5c1aaec4677d8bad0b2498b883e8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 3 Sep 2025 17:13:58 +0200 Subject: [PATCH 435/487] Update bindings. --- source/ports/rs_port/src/bindings.rs | 1429 +------------------------- 1 file changed, 1 insertion(+), 1428 deletions(-) diff --git a/source/ports/rs_port/src/bindings.rs b/source/ports/rs_port/src/bindings.rs index 8f6385d5b..7222ae744 100644 --- a/source/ports/rs_port/src/bindings.rs +++ b/source/ports/rs_port/src/bindings.rs @@ -1,1430 +1,3 @@ /* automatically generated by rust-bindgen 0.71.1 */ -pub type __pid_t = ::std::os::raw::c_int; -pub type pid_t = __pid_t; -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum metacall_allocator_id { - METACALL_ALLOCATOR_STD = 0, - METACALL_ALLOCATOR_NGINX = 1, -} -unsafe extern "C" { - #[doc = " @brief\n Create an allocator instance\n\n @param[in] allocator_id\n Type of allocator to be created\n\n @param[in] ctx\n Context of the allocator\n\n @return\n Pointer to allocator if success, null otherwise"] - pub fn metacall_allocator_create( - allocator_id: metacall_allocator_id, - ctx: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Reserve memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] size\n Size in bytes to be allocated\n\n @return\n Pointer to allocated data on success, null otherwise"] - pub fn metacall_allocator_alloc( - allocator: *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Reallocate memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Original pointer to data\n\n @param[in] size\n Original size in bytes\n\n @param[in] new_size\n New size in bytes to be reallocated\n\n @return\n Pointer to new reallocated data on success, null otherwise"] - pub fn metacall_allocator_realloc( - allocator: *mut ::std::os::raw::c_void, - data: *mut ::std::os::raw::c_void, - size: usize, - new_size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Free memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Pointer to data to be freed"] - pub fn metacall_allocator_free( - allocator: *mut ::std::os::raw::c_void, - data: *mut ::std::os::raw::c_void, - ); -} -unsafe extern "C" { - #[doc = " @brief\n Destroy an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance"] - pub fn metacall_allocator_destroy(allocator: *mut ::std::os::raw::c_void); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_exception_type { - pub message: *const ::std::os::raw::c_char, - pub label: *const ::std::os::raw::c_char, - pub code: i64, - pub stacktrace: *const ::std::os::raw::c_char, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of metacall_exception_type"][::std::mem::size_of::<metacall_exception_type>() - 32usize]; - ["Alignment of metacall_exception_type"] - [::std::mem::align_of::<metacall_exception_type>() - 8usize]; - ["Offset of field: metacall_exception_type::message"] - [::std::mem::offset_of!(metacall_exception_type, message) - 0usize]; - ["Offset of field: metacall_exception_type::label"] - [::std::mem::offset_of!(metacall_exception_type, label) - 8usize]; - ["Offset of field: metacall_exception_type::code"] - [::std::mem::offset_of!(metacall_exception_type, code) - 16usize]; - ["Offset of field: metacall_exception_type::stacktrace"] - [::std::mem::offset_of!(metacall_exception_type, stacktrace) - 24usize]; -}; -pub type metacall_exception = *mut metacall_exception_type; -unsafe extern "C" { - #[doc = " @brief\n Retrieve the exception from a value, it can be either a throwable value with an exception inside or an exception itself\n\n @param[in] v\n Value that represents the exception to be retrieved\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to @v\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_error_from_value( - v: *mut ::std::os::raw::c_void, - ex: metacall_exception, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Retrieve last error that has happened after a call to any API from MetaCall\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to the internal MetaCall exception\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_error_last(ex: metacall_exception) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Clear last error that has happened after a call to any API from MetaCall"] - pub fn metacall_error_clear(); -} -unsafe extern "C" { - #[doc = " @brief\n Initialize link detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_link_initialize() -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_link_register( - tag: *const ::std::os::raw::c_char, - library: *const ::std::os::raw::c_char, - symbol: *const ::std::os::raw::c_char, - fn_: ::std::option::Option<unsafe extern "C" fn()>, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] loader\n Pointer to the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_link_register_loader( - loader: *mut ::std::os::raw::c_void, - library: *const ::std::os::raw::c_char, - symbol: *const ::std::os::raw::c_char, - fn_: ::std::option::Option<unsafe extern "C" fn()>, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Remove the hook previously registered\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_link_unregister( - tag: *const ::std::os::raw::c_char, - library: *const ::std::os::raw::c_char, - symbol: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Unregister link detours and destroy shared memory"] - pub fn metacall_link_destroy(); -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum metacall_log_id { - METACALL_LOG_STDIO = 0, - METACALL_LOG_FILE = 1, - METACALL_LOG_SOCKET = 2, - METACALL_LOG_SYSLOG = 3, - METACALL_LOG_NGINX = 4, - METACALL_LOG_CUSTOM = 5, -} -unsafe extern "C" { - #[doc = " @brief\n Create a log instance\n\n @param[in] log_id\n Type of log to be created\n\n @param[in] ctx\n Context of the log (a pointer to metacall_log_{stdio, file, socket, syslog, nginx, custom}_type)\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_log( - log_id: metacall_log_id, - ctx: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum metacall_value_id { - METACALL_BOOL = 0, - METACALL_CHAR = 1, - METACALL_SHORT = 2, - METACALL_INT = 3, - METACALL_LONG = 4, - METACALL_FLOAT = 5, - METACALL_DOUBLE = 6, - METACALL_STRING = 7, - METACALL_BUFFER = 8, - METACALL_ARRAY = 9, - METACALL_MAP = 10, - METACALL_PTR = 11, - METACALL_FUTURE = 12, - METACALL_FUNCTION = 13, - METACALL_NULL = 14, - METACALL_CLASS = 15, - METACALL_OBJECT = 16, - METACALL_EXCEPTION = 17, - METACALL_THROWABLE = 18, - METACALL_SIZE = 19, - METACALL_INVALID = 20, -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from boolean @b\n\n @param[in] b\n Boolean will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_bool(b: ::std::os::raw::c_uchar) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from char @c\n\n @param[in] c\n Character will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_char(c: ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from short @s\n\n @param[in] s\n Short will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_short(s: ::std::os::raw::c_short) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from integer @i\n\n @param[in] i\n Integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_int(i: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from long @l\n\n @param[in] l\n Long integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_long(l: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from single precision floating point number @f\n\n @param[in] f\n Float will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_float(f: f32) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from double precision floating point number @d\n\n @param[in] d\n Double will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_double(d: f64) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from a C string @str\n\n @param[in] str\n Constant string will be copied into value (needs to be null terminated)\n\n @param[in] length\n Length of the constant string\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_string( - str_: *const ::std::os::raw::c_char, - length: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value buffer from array @buffer\n\n @param[in] buffer\n Constant memory block will be copied into value array\n\n @param[in] size\n Size in bytes of data contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_buffer( - buffer: *const ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value array from array of values @values\n\n @param[in] values\n Constant array of values will be copied into value list\n\n @param[in] size\n Number of elements contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_array( - values: *mut *const ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value map from array of tuples @map\n\n @param[in] tuples\n Constant array of tuples will be copied into value map\n\n @param[in] size\n Number of elements contained in the map\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_map( - tuples: *mut *const ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from pointer @ptr\n\n @param[in] ptr\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_ptr( - ptr: *const ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from future @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_future( - f: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from function @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_function( - f: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from function @f binding a closure @c to it\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @param[in] c\n Pointer to closure that will be binded into function @f\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_function_closure( - f: *mut ::std::os::raw::c_void, - c: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value of type null\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_null() -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from class @c\n\n @param[in] c\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_class( - c: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from object @o\n\n @param[in] o\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_object( - o: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from exception @ex\n\n @param[in] ex\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_exception( - ex: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a value from throwable @th\n\n @param[in] th\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] - pub fn metacall_value_create_throwable( - th: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Returns the size of the value\n\n @param[in] v\n Reference to the value\n\n @return\n Size in bytes of the value"] - pub fn metacall_value_size(v: *mut ::std::os::raw::c_void) -> usize; -} -unsafe extern "C" { - #[doc = " @brief\n Returns the amount of values this value contains\n\n @param[in] v\n Reference to the value\n\n @return\n Number of values @v represents"] - pub fn metacall_value_count(v: *mut ::std::os::raw::c_void) -> usize; -} -unsafe extern "C" { - #[doc = " @brief\n Provide type id of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return type id assigned to value"] - pub fn metacall_value_id(v: *mut ::std::os::raw::c_void) -> metacall_value_id; -} -unsafe extern "C" { - #[doc = " @brief\n Provide type id in a readable form (as string) of a type id\n\n @param[in] id\n Value type identifier\n\n @return\n Return string related to the type id"] - pub fn metacall_value_id_name(id: metacall_value_id) -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Provide type id in a readable form (as string) of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return string related to the type id assigned to value"] - pub fn metacall_value_type_name( - v: *mut ::std::os::raw::c_void, - ) -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Deep copies the value @v, the result copy resets\n the reference counter and ownership, including the finalizer\n\n @param[in] v\n Reference to the value to be copied\n\n @return\n Copy of the value @v on success, null otherwhise"] - pub fn metacall_value_copy(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Creates a new pointer value, with a reference to the\n data contained inside the value @v. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n\n In this case, void *ptr is a value equivalent to int*,\n and it points directly to the integer contained in void *v.\n Note that if we destroy the value @v, the reference will\n point to already freed memory, causing use-after-free when used.\n\n @param[in] v\n Reference to the value to be referenced\n\n @return\n A new value of type pointer, pointing to the @v data"] - pub fn metacall_value_reference(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n If you pass a reference previously created (i.e a value of\n type pointer, pointing to another value), it returns the\n original value. It does not modify the memory of the values\n neither allocates anything. If the value @v is pointing to\n has been deleted, it will cause an use-after-free. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n void *w = metacall_value_dereference(ptr);\n assert(v == w); // Both are the same value\n\n @param[in] v\n Reference to the value to be dereferenced\n\n @return\n The value containing the data which ptr is pointing to"] - pub fn metacall_value_dereference( - v: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Copies the ownership from @src to @dst, including the finalizer,\n and resets the owner and finalizer of @src\n\n @param[in] src\n Source value which will lose the ownership\n\n @param[in] dst\n Destination value which will recieve the ownership"] - pub fn metacall_value_move(src: *mut ::std::os::raw::c_void, dest: *mut ::std::os::raw::c_void); -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to boolean\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to boolean"] - pub fn metacall_value_to_bool(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_uchar; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to char\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to char"] - pub fn metacall_value_to_char(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to short\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to short"] - pub fn metacall_value_to_short(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_short; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to integer"] - pub fn metacall_value_to_int(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to long integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to long integer"] - pub fn metacall_value_to_long(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_long; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to single precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to float"] - pub fn metacall_value_to_float(v: *mut ::std::os::raw::c_void) -> f32; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to double precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to dobule"] - pub fn metacall_value_to_double(v: *mut ::std::os::raw::c_void) -> f64; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to string\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to C string (null terminated)"] - pub fn metacall_value_to_string(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to buffer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to memory block"] - pub fn metacall_value_to_buffer(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to array of values\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to array of values"] - pub fn metacall_value_to_array( - v: *mut ::std::os::raw::c_void, - ) -> *mut *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to map\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to map (array of tuples (array of values))"] - pub fn metacall_value_to_map( - v: *mut ::std::os::raw::c_void, - ) -> *mut *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to pointer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to pointer"] - pub fn metacall_value_to_ptr(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to future\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to future"] - pub fn metacall_value_to_future(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to function\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to function"] - pub fn metacall_value_to_function( - v: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to null\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to null"] - pub fn metacall_value_to_null(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to class\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to class"] - pub fn metacall_value_to_class(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to object\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to object"] - pub fn metacall_value_to_object(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to exception\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to exception"] - pub fn metacall_value_to_exception( - v: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v to throwable\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to throwable"] - pub fn metacall_value_to_throwable( - v: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign boolean @b to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] b\n Boolean to be assigned to value @v\n\n @return\n Value with boolean @b assigned to it"] - pub fn metacall_value_from_bool( - v: *mut ::std::os::raw::c_void, - b: ::std::os::raw::c_uchar, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign character @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Character to be assigned to value @v\n\n @return\n Value with char @c assigned to it"] - pub fn metacall_value_from_char( - v: *mut ::std::os::raw::c_void, - c: ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign short @s to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] s\n Short to be assigned to value @v\n\n @return\n Value with short @s assigned to it"] - pub fn metacall_value_from_short( - v: *mut ::std::os::raw::c_void, - s: ::std::os::raw::c_short, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign integer @i to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] i\n Integer to be assigned to value @v\n\n @return\n Value with integer @i assigned to it"] - pub fn metacall_value_from_int( - v: *mut ::std::os::raw::c_void, - i: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign long integer @l to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] l\n Long integer to be assigned to value @v\n\n @return\n Value with long @l assigned to it"] - pub fn metacall_value_from_long( - v: *mut ::std::os::raw::c_void, - l: ::std::os::raw::c_long, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign single precision floating point @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Float to be assigned to value @v\n\n @return\n Value with float @f assigned to it"] - pub fn metacall_value_from_float( - v: *mut ::std::os::raw::c_void, - f: f32, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign double precision floating point @d to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] d\n Double to be assigned to value @v\n\n @return\n Value with double @d assigned to it"] - pub fn metacall_value_from_double( - v: *mut ::std::os::raw::c_void, - d: f64, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign string @str to value @v, truncates to @v size if it is smaller\n than @length + 1. It does not add null terminator if truncated.\n\n @param[in] v\n Reference to the value\n\n @param[in] str\n Constant string to be assigned to value @v (it needs to be null terminated)\n\n @param[in] length\n Length of the constant string @str\n\n @return\n Value with string @str assigned to it"] - pub fn metacall_value_from_string( - v: *mut ::std::os::raw::c_void, - str_: *const ::std::os::raw::c_char, - length: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign array @buffer to value buffer @v\n\n @param[in] v\n Reference to the value\n\n @param[in] buffer\n Constant array to be assigned to value @v\n\n @param[in] size\n Number of elements contained in @buffer\n\n @return\n Value with array @buffer assigned to it"] - pub fn metacall_value_from_buffer( - v: *mut ::std::os::raw::c_void, - buffer: *const ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign array of values @values to value array @v\n\n @param[in] v\n Reference to the value\n\n @param[in] values\n Constant array of values to be assigned to value array @v\n\n @param[in] size\n Number of values contained in constant array @values\n\n @return\n Value with array of values @values assigned to it"] - pub fn metacall_value_from_array( - v: *mut ::std::os::raw::c_void, - values: *mut *const ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign array of values @values to value map @v\n\n @param[in] v\n Reference to the value\n\n @param[in] tuples\n Constant array of tuples to be assigned to value map @v\n\n @param[in] size\n Number of values contained in constant array @tuples\n\n @return\n Value with array of tuples @tuples assigned to it"] - pub fn metacall_value_from_map( - v: *mut ::std::os::raw::c_void, - tuples: *mut *const ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign pointer reference @ptr to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ptr\n Pointer to be assigned to value @v\n\n @return\n Value with pointer @ptr assigned to it"] - pub fn metacall_value_from_ptr( - v: *mut ::std::os::raw::c_void, - ptr: *const ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign future @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Future to be assigned to value @v\n\n @return\n Value with future @f assigned to it"] - pub fn metacall_value_from_future( - v: *mut ::std::os::raw::c_void, - f: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign function @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Function to be assigned to value @v\n\n @return\n Value with function @f assigned to it"] - pub fn metacall_value_from_function( - v: *mut ::std::os::raw::c_void, - f: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign null to value @v\n\n @param[in] v\n Reference to the value\n\n @return\n Value with null assigned to it"] - pub fn metacall_value_from_null(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign class @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Class to be assigned to value @v\n\n @return\n Value with class @c assigned to it"] - pub fn metacall_value_from_class( - v: *mut ::std::os::raw::c_void, - c: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign object @o to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] o\n Object to be assigned to value @v\n\n @return\n Value with object @o assigned to it"] - pub fn metacall_value_from_object( - v: *mut ::std::os::raw::c_void, - o: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign exception @ex to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ex\n Exception to be assigned to value @v\n\n @return\n Value with exception @ex assigned to it"] - pub fn metacall_value_from_exception( - v: *mut ::std::os::raw::c_void, - ex: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Assign throwable @th to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] th\n Throwable to be assigned to value @v\n\n @return\n Value with throwable @th assigned to it"] - pub fn metacall_value_from_throwable( - v: *mut ::std::os::raw::c_void, - th: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Casts a value to a new type @id\n\n @param[in] v\n Reference to the value\n\n @param[in] id\n New type id of value to be casted\n\n @return\n Casted value or reference to @v if casting is between equivalent types"] - pub fn metacall_value_cast( - v: *mut ::std::os::raw::c_void, - id: metacall_value_id, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to boolean\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to boolean"] - pub fn metacall_value_cast_bool(v: *mut *mut ::std::os::raw::c_void) - -> ::std::os::raw::c_uchar; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to char\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to char"] - pub fn metacall_value_cast_char(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to short\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to short"] - pub fn metacall_value_cast_short( - v: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_short; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to int\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to int"] - pub fn metacall_value_cast_int(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to long\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to long"] - pub fn metacall_value_cast_long(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_long; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to float\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to float"] - pub fn metacall_value_cast_float(v: *mut *mut ::std::os::raw::c_void) -> f32; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to double\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to double"] - pub fn metacall_value_cast_double(v: *mut *mut ::std::os::raw::c_void) -> f64; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to string\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to a C string (null terminated)"] - pub fn metacall_value_cast_string( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to buffer\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to buffer"] - pub fn metacall_value_cast_buffer( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to array\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to array of values"] - pub fn metacall_value_cast_array( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to map\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to map"] - pub fn metacall_value_cast_map( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to ptr\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to ptr"] - pub fn metacall_value_cast_ptr( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to future\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to future"] - pub fn metacall_value_cast_future( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to function\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to function"] - pub fn metacall_value_cast_function( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to null\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to null"] - pub fn metacall_value_cast_null( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to class\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to class"] - pub fn metacall_value_cast_class( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to object\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to object"] - pub fn metacall_value_cast_object( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to exception\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to exception"] - pub fn metacall_value_cast_exception( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert value @v implicitly to throwable\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to throwable"] - pub fn metacall_value_cast_throwable( - v: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Destroy a value from scope stack\n\n @param[in] v\n Reference to the value"] - pub fn metacall_value_destroy(v: *mut ::std::os::raw::c_void); -} -pub type metacall_pid = pid_t; -pub type metacall_pre_fork_callback_ptr = ::std::option::Option< - unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, ->; -pub type metacall_post_fork_callback_ptr = ::std::option::Option< - unsafe extern "C" fn( - arg1: metacall_pid, - arg2: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, ->; -unsafe extern "C" { - #[doc = " @brief\n Initialize fork detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_fork_initialize() -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Set fork hook callback\n\n @param[in] pre_callback\n Callback to be called before fork detour is executed\n\n @param[in] post_callback\n Callback to be called after fork detour is executed"] - pub fn metacall_fork( - pre_callback: metacall_pre_fork_callback_ptr, - post_callback: metacall_post_fork_callback_ptr, - ); -} -unsafe extern "C" { - #[doc = " @brief\n Unregister fork detours and destroy shared memory"] - pub fn metacall_fork_destroy(); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_initialize_configuration_type { - pub tag: *const ::std::os::raw::c_char, - pub options: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of metacall_initialize_configuration_type"] - [::std::mem::size_of::<metacall_initialize_configuration_type>() - 16usize]; - ["Alignment of metacall_initialize_configuration_type"] - [::std::mem::align_of::<metacall_initialize_configuration_type>() - 8usize]; - ["Offset of field: metacall_initialize_configuration_type::tag"] - [::std::mem::offset_of!(metacall_initialize_configuration_type, tag) - 0usize]; - ["Offset of field: metacall_initialize_configuration_type::options"] - [::std::mem::offset_of!(metacall_initialize_configuration_type, options) - 8usize]; -}; -pub type metacall_await_callback = ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, ->; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_await_callbacks_type { - pub resolve: metacall_await_callback, - pub reject: metacall_await_callback, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of metacall_await_callbacks_type"] - [::std::mem::size_of::<metacall_await_callbacks_type>() - 16usize]; - ["Alignment of metacall_await_callbacks_type"] - [::std::mem::align_of::<metacall_await_callbacks_type>() - 8usize]; - ["Offset of field: metacall_await_callbacks_type::resolve"] - [::std::mem::offset_of!(metacall_await_callbacks_type, resolve) - 0usize]; - ["Offset of field: metacall_await_callbacks_type::reject"] - [::std::mem::offset_of!(metacall_await_callbacks_type, reject) - 8usize]; -}; -pub type metacall_await_callbacks = metacall_await_callbacks_type; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct metacall_version_type { - pub major: ::std::os::raw::c_uint, - pub minor: ::std::os::raw::c_uint, - pub patch: ::std::os::raw::c_uint, - pub revision: *const ::std::os::raw::c_char, - pub str_: *const ::std::os::raw::c_char, - pub name: *const ::std::os::raw::c_char, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of metacall_version_type"][::std::mem::size_of::<metacall_version_type>() - 40usize]; - ["Alignment of metacall_version_type"] - [::std::mem::align_of::<metacall_version_type>() - 8usize]; - ["Offset of field: metacall_version_type::major"] - [::std::mem::offset_of!(metacall_version_type, major) - 0usize]; - ["Offset of field: metacall_version_type::minor"] - [::std::mem::offset_of!(metacall_version_type, minor) - 4usize]; - ["Offset of field: metacall_version_type::patch"] - [::std::mem::offset_of!(metacall_version_type, patch) - 8usize]; - ["Offset of field: metacall_version_type::revision"] - [::std::mem::offset_of!(metacall_version_type, revision) - 16usize]; - ["Offset of field: metacall_version_type::str_"] - [::std::mem::offset_of!(metacall_version_type, str_) - 24usize]; - ["Offset of field: metacall_version_type::name"] - [::std::mem::offset_of!(metacall_version_type, name) - 32usize]; -}; -unsafe extern "C" { - #[doc = " @brief\n Returns default serializer used by MetaCall\n\n @return\n Name of the serializer to be used with serialization methods"] - pub fn metacall_serial() -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Returns default detour used by MetaCall\n\n @return\n Name of the detour to be used with detouring methods"] - pub fn metacall_detour() -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Disables MetaCall logs, must be called before @metacall_initialize.\n\n When initializing MetaCall, it initializes a default logs to stdout\n if none was defined. If you want to benchmark or simply disable this\n default logs, you can call to this function before @metacall_initialize."] - pub fn metacall_log_null(); -} -unsafe extern "C" { - #[doc = " @brief\n Flags to be set in MetaCall library\n\n @param[in] flags\n Combination of flags referring to definitions METACALL_FLAGS_*"] - pub fn metacall_flags(flags: ::std::os::raw::c_int); -} -unsafe extern "C" { - #[doc = " @brief\n Initialize MetaCall library\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_initialize() -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Initialize MetaCall library with configuration arguments\n\n @param[in] initialize_config\n Extension of the script to be loaded in memory with data to be injected\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_initialize_ex( - initialize_config: *mut metacall_initialize_configuration_type, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Initialize MetaCall application arguments\n\n @param[in] argc\n Number of additional parameters to be passed to the runtime when initializing\n\n @param[in] argv\n Additional parameters to be passed to the runtime when initializing (when using MetaCall as an application)"] - pub fn metacall_initialize_args( - argc: ::std::os::raw::c_int, - argv: *mut *mut ::std::os::raw::c_char, - ); -} -unsafe extern "C" { - #[doc = " @brief\n Get the number of arguments in which MetaCall was initialized\n\n @return\n An integer equal or greater than zero"] - pub fn metacall_argc() -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Get the arguments in which MetaCall was initialized\n\n @return\n A pointer to an array of strings with the additional arguments"] - pub fn metacall_argv() -> *mut *mut ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Check if script context is loaded by @tag\n\n @param[in] tag\n Extension of the script (if tag is NULL, it returns the status of the whole MetaCall instance)\n\n @return\n Zero if context is initialized, different from zero otherwise"] - pub fn metacall_is_initialized(tag: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Amount of function call arguments supported by MetaCall\n\n @return\n Number of arguments suported"] - pub fn metacall_args_size() -> usize; -} -unsafe extern "C" { - #[doc = " @brief\n Set a execution path defined by @path to the extension script @tag\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path to be loaded\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_execution_path( - tag: *const ::std::os::raw::c_char, - path: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Set a execution path defined by @path to the extension script @tag with length\n\n @param[in] tag\n Extension of the script\n\n @param[in] tag_length\n Length of the extension of the tag\n\n @param[in] path\n Path to be loaded\n\n @param[in] path_length\n Length of the path\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_execution_path_s( - tag: *const ::std::os::raw::c_char, - tag_length: usize, - path: *const ::std::os::raw::c_char, - path_length: usize, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Loads a script from file specified by @path\n\n @param[in] tag\n Extension of the script\n\n @param[in] paths\n Path array of files\n\n @param[in] size\n Size of the array @paths\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_load_from_file( - tag: *const ::std::os::raw::c_char, - paths: *mut *const ::std::os::raw::c_char, - size: usize, - handle: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Loads a script from memory\n\n @param[in] tag\n Extension of the script\n\n @param[in] buffer\n Memory block representing the string of the script\n\n @param[in] size\n Memory block representing the string of the script\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_load_from_memory( - tag: *const ::std::os::raw::c_char, - buffer: *const ::std::os::raw::c_char, - size: usize, - handle: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Loads a package of scrips from file specified by @path into loader defined by @extension\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path of the package\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_load_from_package( - tag: *const ::std::os::raw::c_char, - path: *const ::std::os::raw::c_char, - handle: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Loads a a list of scrips from configuration specified by @path into loader\n with the following format:\n {\n \"language_id\": \"<tag>\",\n \"path\": \"<path>\",\n \"scripts\": [ \"<script0>\", \"<script1>\", ..., \"<scriptN>\" ]\n }\n\n @param[in] path\n Path of the configuration\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @param[in] allocator\n Pointer to allocator will allocate the configuration\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_load_from_configuration( - path: *const ::std::os::raw::c_char, - handle: *mut *mut ::std::os::raw::c_void, - allocator: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallv( - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallv_s( - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallhv( - handle: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n Includes @size in order to allow variadic arguments or safe calls\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallhv_s( - handle: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacall(name: *const ::std::os::raw::c_char, ...) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallt( - name: *const ::std::os::raw::c_char, - ids: *const metacall_value_id, - ... - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallt_s( - name: *const ::std::os::raw::c_char, - ids: *const metacall_value_id, - size: usize, - ... - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallht_s( - handle: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - ids: *const metacall_value_id, - size: usize, - ... - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Get the function by @name\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] - pub fn metacall_function(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create an empty handler into a loader with name @name\n\n @param[in] loader\n Pointer to the loader which the handle belongs to\n\n @param[in] name\n Name of the handle\n\n @param[out] handle_ptr\n On success, returns the pointer to the handle created, otherwise NULL\n\n @return\n Return zero on success, different from zero on error"] - pub fn metacall_handle_initialize( - loader: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - handle_ptr: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Populate the objects of @handle_src into @handle_dest\n\n @param[inout] handle_dest\n Handle where the objects from @handle_src will be stored\n\n @param[in] handle_src\n Handle from where the objects will be copied\n\n @return\n Return zero on success, different from zero on error"] - pub fn metacall_handle_populate( - handle_dest: *mut ::std::os::raw::c_void, - handle_src: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Get the function by @name from @handle\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] - pub fn metacall_handle_function( - handle: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Get the function parameter type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n @param[in] parameter\n The index of the parameter to be retrieved\n\n @param[out] id\n The parameter type id that will be returned\n\n @return\n Return 0 if the @parameter index exists and @func is valid, 1 otherwhise"] - pub fn metacall_function_parameter_type( - func: *mut ::std::os::raw::c_void, - parameter: usize, - id: *mut metacall_value_id, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Get the function return type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n\n @param[out] id\n The value id of the return type of the function @func\n\n @return\n Return 0 if the @func is valid, 1 otherwhise"] - pub fn metacall_function_return_type( - func: *mut ::std::os::raw::c_void, - id: *mut metacall_value_id, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Get minimun mumber of arguments accepted by function @func\n\n @param[in] func\n Function reference\n\n @return\n Return mumber of arguments"] - pub fn metacall_function_size(func: *mut ::std::os::raw::c_void) -> usize; -} -unsafe extern "C" { - #[doc = " @brief\n Check if the function @func is asynchronous or synchronous\n\n @param[in] func\n Function reference\n\n @return\n Return 0 if it is syncrhonous, 1 if it is asynchronous and -1 if the function is NULL"] - pub fn metacall_function_async(func: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Get the handle by @name\n\n @param[in] tag\n Extension of the script\n\n @param[in] name\n Name of the handle\n\n @return\n Handle reference, null if the function does not exist"] - pub fn metacall_handle( - tag: *const ::std::os::raw::c_char, - name: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Get name of a @handle\n\n @param[in] handle\n Pointer to the handle to be retrieved\n\n @return\n String that references the handle"] - pub fn metacall_handle_id(handle: *mut ::std::os::raw::c_void) - -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Return a value representing the handle as a map of functions (or values)\n\n @param[in] handle\n Reference to the handle to be described\n\n @return\n A value of type map on success, null otherwise"] - pub fn metacall_handle_export( - handle: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallfv( - func: *mut ::std::os::raw::c_void, - args: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of function arguments\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallfv_s( - func: *mut ::std::os::raw::c_void, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by variable arguments @va_args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallf(func: *mut ::std::os::raw::c_void, ...) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallfs( - func: *mut ::std::os::raw::c_void, - buffer: *const ::std::os::raw::c_char, - size: usize, - allocator: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallfmv( - func: *mut ::std::os::raw::c_void, - keys: *mut *mut ::std::os::raw::c_void, - values: *mut *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallfms( - func: *mut ::std::os::raw::c_void, - buffer: *const ::std::os::raw::c_char, - size: usize, - allocator: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Register a function by name @name and arguments @va_args\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] va_args\n Varidic function parameter types\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacall_register( - name: *const ::std::os::raw::c_char, - invoke: ::std::option::Option< - unsafe extern "C" fn( - arg1: usize, - arg2: *mut *mut ::std::os::raw::c_void, - arg3: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - func: *mut *mut ::std::os::raw::c_void, - return_type: metacall_value_id, - size: usize, - ... - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacall_registerv( - name: *const ::std::os::raw::c_char, - invoke: ::std::option::Option< - unsafe extern "C" fn( - arg1: usize, - arg2: *mut *mut ::std::os::raw::c_void, - arg3: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - func: *mut *mut ::std::os::raw::c_void, - return_type: metacall_value_id, - size: usize, - types: *mut metacall_value_id, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Obtain the loader instance by @tag\n\n @param[in] tag\n Tag in which the loader is identified, normally it is the extension of the script\n\n @return\n Pointer the loader by @tag"] - pub fn metacall_loader(tag: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] loader\n Opaque pointer to the loader in which you want to register the function (this allows to register the function into a different loader than the host)\n\n @param[in] handle\n Opaque pointer to the handle in which you want to register the function (if it is NULL, it will be defined on the global scope of the loader)\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Zero if the function was registered properly, distinct from zero otherwise"] - pub fn metacall_register_loaderv( - loader: *mut ::std::os::raw::c_void, - handle: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - invoke: ::std::option::Option< - unsafe extern "C" fn( - arg1: usize, - arg2: *mut *mut ::std::os::raw::c_void, - arg3: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - return_type: metacall_value_id, - size: usize, - types: *mut metacall_value_id, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacall_await( - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Awaits for a promise and registers a callback to be executed when a future is resolved\n\n @param[in] f\n The pointer to the future\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacall_await_future( - f: *mut ::std::os::raw::c_void, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacall_await_s( - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacallfv_await( - func: *mut ::std::os::raw::c_void, - args: *mut *mut ::std::os::raw::c_void, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacallfv_await_s( - func: *mut ::std::os::raw::c_void, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func (offered without function pointers for languages without support to function pointers)\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] cb\n Pointer to struct containing the function pointers to reject and resolve that will be executed when task completion or error\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacallfv_await_struct_s( - func: *mut ::std::os::raw::c_void, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - cb: metacall_await_callbacks, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] size\n Number of elements of the arrays @keys and @values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacallfmv_await( - func: *mut ::std::os::raw::c_void, - keys: *mut *mut ::std::os::raw::c_void, - values: *mut *mut ::std::os::raw::c_void, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacallfmv_await_s( - func: *mut ::std::os::raw::c_void, - keys: *mut *mut ::std::os::raw::c_void, - values: *mut *mut ::std::os::raw::c_void, - size: usize, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacallfs_await( - func: *mut ::std::os::raw::c_void, - buffer: *const ::std::os::raw::c_char, - size: usize, - allocator: *mut ::std::os::raw::c_void, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] - pub fn metacallfms_await( - func: *mut ::std::os::raw::c_void, - buffer: *const ::std::os::raw::c_char, - size: usize, - allocator: *mut ::std::os::raw::c_void, - resolve_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - reject_callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >, - data: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Get the class by @name\n\n @param[in] name\n Name of the class\n\n @return\n Class reference, null if the class does not exist"] - pub fn metacall_class(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a class method anonymously by value array @args (this procedure assumes there's no overloaded methods and does type conversion on values)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallv_class( - cls: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a class method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallt_class( - cls: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - ret: metacall_value_id, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Create a new object instance from @cls by value array @args\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the new object\n\n @param[in] args\n Array of pointers constructor parameters\n\n @param[in] size\n Number of elements of constructor parameters\n\n @return\n Pointer to the new object value instance"] - pub fn metacall_class_new( - cls: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Get an attribute from @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the class attribute value or NULL if an error occurred"] - pub fn metacall_class_static_get( - cls: *mut ::std::os::raw::c_void, - key: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Set an attribute to @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] - pub fn metacall_class_static_set( - cls: *mut ::std::os::raw::c_void, - key: *const ::std::os::raw::c_char, - v: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Call an object method anonymously by value array @args\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallv_object( - obj: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Call a object method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] - pub fn metacallt_object( - obj: *mut ::std::os::raw::c_void, - name: *const ::std::os::raw::c_char, - ret: metacall_value_id, - args: *mut *mut ::std::os::raw::c_void, - size: usize, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Get an attribute from @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the object attribute value or NULL if an error occurred"] - pub fn metacall_object_get( - obj: *mut ::std::os::raw::c_void, - key: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Set an attribute to @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] - pub fn metacall_object_set( - obj: *mut ::std::os::raw::c_void, - key: *const ::std::os::raw::c_char, - v: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Get the value contained by throwable object @th\n\n @param[in] th\n Pointer to the throwable object\n\n @return\n Pointer to the value inside of the throwable or NULL in case of error"] - pub fn metacall_throwable_value(th: *mut ::std::os::raw::c_void) - -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Provide information about all loaded objects\n\n @param[out] size\n Size in bytes of return buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n String containing introspection information"] - pub fn metacall_inspect( - size: *mut usize, - allocator: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Provide information about all loaded objects as a value\n\n @return\n Value containing introspection information"] - pub fn metacall_inspect_value() -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Convert the value @v to serialized string\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] v\n Reference to the value\n\n @param[out] size\n Size of new allocated string\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n New allocated string containing stringified value"] - pub fn metacall_serialize( - name: *const ::std::os::raw::c_char, - v: *mut ::std::os::raw::c_void, - size: *mut usize, - allocator: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Convert the string @buffer to value\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] buffer\n String to be deserialized\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n New allocated value representing the string (must be freed)"] - pub fn metacall_deserialize( - name: *const ::std::os::raw::c_char, - buffer: *const ::std::os::raw::c_char, - size: usize, - allocator: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Clear handle from memory and unload related resources\n\n @param[in] handle\n Reference to the handle to be unloaded\n\n @return\n Zero if success, different from zero otherwise"] - pub fn metacall_clear(handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; -} -unsafe extern "C" { - #[doc = " @brief\n Get the plugin extension handle to be used for loading plugins\n\n @return\n Pointer to the extension handle, or null if it failed to load"] - pub fn metacall_plugin_extension() -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Get the handle containing all the functionality of the plugins from core\n\n @return\n Pointer to the core plugin handle, or null if it failed to load"] - pub fn metacall_plugin_core() -> *mut ::std::os::raw::c_void; -} -unsafe extern "C" { - #[doc = " @brief\n Get the plugin extension path to be used for accessing the plugins folder\n\n @return\n String containing the core plugin path, or null if it failed to load the plugin extension"] - pub fn metacall_plugin_path() -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Destroy MetaCall library"] - pub fn metacall_destroy(); -} -unsafe extern "C" { - #[doc = " @brief\n Provide the module version struct\n\n @return\n Static struct containing unpacked version"] - pub fn metacall_version() -> *const metacall_version_type; -} -unsafe extern "C" { - #[doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is @major,\n I is @minor and P is @patch\n\n @param[in] major\n Unsigned integer representing major version\n\n @param[in] minor\n Unsigned integer representing minor version\n\n @param[in] patch\n Unsigned integer representing patch version\n\n @return\n Hexadecimal integer containing packed version"] - pub fn metacall_version_hex_make( - major: ::std::os::raw::c_uint, - minor: ::std::os::raw::c_uint, - patch: ::std::os::raw::c_uint, - ) -> u32; -} -unsafe extern "C" { - #[doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is major,\n I is minor and P is patch\n\n @return\n Hexadecimal integer containing packed version"] - pub fn metacall_version_hex() -> u32; -} -unsafe extern "C" { - #[doc = " @brief\n Provide the module version string\n\n @return\n Static string containing module version"] - pub fn metacall_version_str() -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Provide the module version revision string\n\n @return\n Static string containing module version revision"] - pub fn metacall_version_revision() -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Provide the module version name\n\n @return\n Static string containing module version name"] - pub fn metacall_version_name() -> *const ::std::os::raw::c_char; -} -unsafe extern "C" { - #[doc = " @brief\n Provide the module information\n\n @return\n Static string containing module information"] - pub fn metacall_print_info() -> *const ::std::os::raw::c_char; -} +pub type __pid_t = :: std :: os :: raw :: c_int ; pub type pid_t = __pid_t ; # [repr (u32)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum metacall_allocator_id { METACALL_ALLOCATOR_STD = 0 , METACALL_ALLOCATOR_NGINX = 1 , } unsafe extern "C" { # [doc = " @brief\n Create an allocator instance\n\n @param[in] allocator_id\n Type of allocator to be created\n\n @param[in] ctx\n Context of the allocator\n\n @return\n Pointer to allocator if success, null otherwise"] pub fn metacall_allocator_create (allocator_id : metacall_allocator_id , ctx : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Reserve memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] size\n Size in bytes to be allocated\n\n @return\n Pointer to allocated data on success, null otherwise"] pub fn metacall_allocator_alloc (allocator : * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Reallocate memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Original pointer to data\n\n @param[in] size\n Original size in bytes\n\n @param[in] new_size\n New size in bytes to be reallocated\n\n @return\n Pointer to new reallocated data on success, null otherwise"] pub fn metacall_allocator_realloc (allocator : * mut :: std :: os :: raw :: c_void , data : * mut :: std :: os :: raw :: c_void , size : usize , new_size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Free memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Pointer to data to be freed"] pub fn metacall_allocator_free (allocator : * mut :: std :: os :: raw :: c_void , data : * mut :: std :: os :: raw :: c_void) ; } unsafe extern "C" { # [doc = " @brief\n Destroy an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance"] pub fn metacall_allocator_destroy (allocator : * mut :: std :: os :: raw :: c_void) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct metacall_exception_type { pub message : * const :: std :: os :: raw :: c_char , pub label : * const :: std :: os :: raw :: c_char , pub code : i64 , pub stacktrace : * const :: std :: os :: raw :: c_char , } # [allow (clippy :: unnecessary_operation , clippy :: identity_op)] const _ : () = { ["Size of metacall_exception_type"] [:: std :: mem :: size_of :: < metacall_exception_type > () - 32usize] ; ["Alignment of metacall_exception_type"] [:: std :: mem :: align_of :: < metacall_exception_type > () - 8usize] ; ["Offset of field: metacall_exception_type::message"] [:: std :: mem :: offset_of ! (metacall_exception_type , message) - 0usize] ; ["Offset of field: metacall_exception_type::label"] [:: std :: mem :: offset_of ! (metacall_exception_type , label) - 8usize] ; ["Offset of field: metacall_exception_type::code"] [:: std :: mem :: offset_of ! (metacall_exception_type , code) - 16usize] ; ["Offset of field: metacall_exception_type::stacktrace"] [:: std :: mem :: offset_of ! (metacall_exception_type , stacktrace) - 24usize] ; } ; pub type metacall_exception = * mut metacall_exception_type ; unsafe extern "C" { # [doc = " @brief\n Create an throwable value from an exception with a simple API in a single instruction\n\n @param[in] label\n Label of the exception\n\n @param[in] code\n Error code of the exception\n\n @param[in] stacktrace\n Stack trace of the exception\n\n @param[in] message\n Message of the exception to be formatted with the variable arguments\n\n @param[in] va_args\n Arguments for formatting the message\n\n @return\n The value of type throwable containing the exception created"] pub fn metacall_error_throw (label : * const :: std :: os :: raw :: c_char , code : i64 , stacktrace : * const :: std :: os :: raw :: c_char , message : * const :: std :: os :: raw :: c_char , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Retrieve the exception from a value, it can be either a throwable value with an exception inside or an exception itself\n\n @param[in] v\n Value that represents the exception to be retrieved\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to @v\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_error_from_value (v : * mut :: std :: os :: raw :: c_void , ex : metacall_exception) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Retrieve last error that has happened after a call to any API from MetaCall\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to the internal MetaCall exception\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_error_last (ex : metacall_exception) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Clear last error that has happened after a call to any API from MetaCall"] pub fn metacall_error_clear () ; } unsafe extern "C" { # [doc = " @brief\n Initialize link detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_link_initialize () -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_link_register (tag : * const :: std :: os :: raw :: c_char , library : * const :: std :: os :: raw :: c_char , symbol : * const :: std :: os :: raw :: c_char , fn_ : :: std :: option :: Option < unsafe extern "C" fn () >) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] loader\n Pointer to the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_link_register_loader (loader : * mut :: std :: os :: raw :: c_void , library : * const :: std :: os :: raw :: c_char , symbol : * const :: std :: os :: raw :: c_char , fn_ : :: std :: option :: Option < unsafe extern "C" fn () >) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Remove the hook previously registered\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_link_unregister (tag : * const :: std :: os :: raw :: c_char , library : * const :: std :: os :: raw :: c_char , symbol : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Unregister link detours and destroy shared memory"] pub fn metacall_link_destroy () ; } # [repr (u32)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum metacall_log_id { METACALL_LOG_STDIO = 0 , METACALL_LOG_FILE = 1 , METACALL_LOG_SOCKET = 2 , METACALL_LOG_SYSLOG = 3 , METACALL_LOG_NGINX = 4 , METACALL_LOG_CUSTOM = 5 , } unsafe extern "C" { # [doc = " @brief\n Create a log instance\n\n @param[in] log_id\n Type of log to be created\n\n @param[in] ctx\n Context of the log (a pointer to metacall_log_{stdio, file, socket, syslog, nginx, custom}_type)\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_log (log_id : metacall_log_id , ctx : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } # [repr (u32)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum metacall_value_id { METACALL_BOOL = 0 , METACALL_CHAR = 1 , METACALL_SHORT = 2 , METACALL_INT = 3 , METACALL_LONG = 4 , METACALL_FLOAT = 5 , METACALL_DOUBLE = 6 , METACALL_STRING = 7 , METACALL_BUFFER = 8 , METACALL_ARRAY = 9 , METACALL_MAP = 10 , METACALL_PTR = 11 , METACALL_FUTURE = 12 , METACALL_FUNCTION = 13 , METACALL_NULL = 14 , METACALL_CLASS = 15 , METACALL_OBJECT = 16 , METACALL_EXCEPTION = 17 , METACALL_THROWABLE = 18 , METACALL_SIZE = 19 , METACALL_INVALID = 20 , } unsafe extern "C" { # [doc = " @brief\n Create a value from boolean @b\n\n @param[in] b\n Boolean will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_bool (b : :: std :: os :: raw :: c_uchar) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from char @c\n\n @param[in] c\n Character will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_char (c : :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from short @s\n\n @param[in] s\n Short will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_short (s : :: std :: os :: raw :: c_short) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from integer @i\n\n @param[in] i\n Integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_int (i : :: std :: os :: raw :: c_int) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from long @l\n\n @param[in] l\n Long integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_long (l : :: std :: os :: raw :: c_long) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from single precision floating point number @f\n\n @param[in] f\n Float will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_float (f : f32) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from double precision floating point number @d\n\n @param[in] d\n Double will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_double (d : f64) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from a C string @str\n\n @param[in] str\n Constant string will be copied into value (needs to be null terminated)\n\n @param[in] length\n Length of the constant string\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_string (str_ : * const :: std :: os :: raw :: c_char , length : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value buffer from array @buffer\n\n @param[in] buffer\n Constant memory block will be copied into value array\n\n @param[in] size\n Size in bytes of data contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_buffer (buffer : * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value array from array of values @values\n\n @param[in] values\n Constant array of values will be copied into value list\n\n @param[in] size\n Number of elements contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_array (values : * mut * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value map from array of tuples @map\n\n @param[in] tuples\n Constant array of tuples will be copied into value map\n\n @param[in] size\n Number of elements contained in the map\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_map (tuples : * mut * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from pointer @ptr\n\n @param[in] ptr\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_ptr (ptr : * const :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from future @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_future (f : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from function @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_function (f : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from function @f binding a closure @c to it\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @param[in] c\n Pointer to closure that will be binded into function @f\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_function_closure (f : * mut :: std :: os :: raw :: c_void , c : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value of type null\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_null () -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from class @c\n\n @param[in] c\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_class (c : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from object @o\n\n @param[in] o\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_object (o : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from exception @ex\n\n @param[in] ex\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_exception (ex : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from throwable @th\n\n @param[in] th\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_throwable (th : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Returns the size of the value\n\n @param[in] v\n Reference to the value\n\n @return\n Size in bytes of the value"] pub fn metacall_value_size (v : * mut :: std :: os :: raw :: c_void) -> usize ; } unsafe extern "C" { # [doc = " @brief\n Returns the amount of values this value contains\n\n @param[in] v\n Reference to the value\n\n @return\n Number of values @v represents"] pub fn metacall_value_count (v : * mut :: std :: os :: raw :: c_void) -> usize ; } unsafe extern "C" { # [doc = " @brief\n Provide type id of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return type id assigned to value"] pub fn metacall_value_id (v : * mut :: std :: os :: raw :: c_void) -> metacall_value_id ; } unsafe extern "C" { # [doc = " @brief\n Provide type id in a readable form (as string) of a type id\n\n @param[in] id\n Value type identifier\n\n @return\n Return string related to the type id"] pub fn metacall_value_id_name (id : metacall_value_id) -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide type id in a readable form (as string) of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return string related to the type id assigned to value"] pub fn metacall_value_type_name (v : * mut :: std :: os :: raw :: c_void) -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Deep copies the value @v, the result copy resets\n the reference counter and ownership, including the finalizer\n\n @param[in] v\n Reference to the value to be copied\n\n @return\n Copy of the value @v on success, null otherwhise"] pub fn metacall_value_copy (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Creates a new pointer value, with a reference to the\n data contained inside the value @v. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n\n In this case, void *ptr is a value equivalent to int*,\n and it points directly to the integer contained in void *v.\n Note that if we destroy the value @v, the reference will\n point to already freed memory, causing use-after-free when used.\n\n @param[in] v\n Reference to the value to be referenced\n\n @return\n A new value of type pointer, pointing to the @v data"] pub fn metacall_value_reference (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n If you pass a reference previously created (i.e a value of\n type pointer, pointing to another value), it returns the\n original value. It does not modify the memory of the values\n neither allocates anything. If the value @v is pointing to\n has been deleted, it will cause an use-after-free. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n void *w = metacall_value_dereference(ptr);\n assert(v == w); // Both are the same value\n\n @param[in] v\n Reference to the value to be dereferenced\n\n @return\n The value containing the data which ptr is pointing to"] pub fn metacall_value_dereference (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Copies the ownership from @src to @dst, including the finalizer,\n and resets the owner and finalizer of @src\n\n @param[in] src\n Source value which will lose the ownership\n\n @param[in] dst\n Destination value which will recieve the ownership"] pub fn metacall_value_move (src : * mut :: std :: os :: raw :: c_void , dest : * mut :: std :: os :: raw :: c_void) ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to boolean\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to boolean"] pub fn metacall_value_to_bool (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_uchar ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to char\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to char"] pub fn metacall_value_to_char (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to short\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to short"] pub fn metacall_value_to_short (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_short ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to integer"] pub fn metacall_value_to_int (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to long integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to long integer"] pub fn metacall_value_to_long (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_long ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to single precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to float"] pub fn metacall_value_to_float (v : * mut :: std :: os :: raw :: c_void) -> f32 ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to double precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to dobule"] pub fn metacall_value_to_double (v : * mut :: std :: os :: raw :: c_void) -> f64 ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to string\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to C string (null terminated)"] pub fn metacall_value_to_string (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to buffer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to memory block"] pub fn metacall_value_to_buffer (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to array of values\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to array of values"] pub fn metacall_value_to_array (v : * mut :: std :: os :: raw :: c_void) -> * mut * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to map\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to map (array of tuples (array of values))"] pub fn metacall_value_to_map (v : * mut :: std :: os :: raw :: c_void) -> * mut * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to pointer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to pointer"] pub fn metacall_value_to_ptr (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to future\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to future"] pub fn metacall_value_to_future (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to function\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to function"] pub fn metacall_value_to_function (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to null\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to null"] pub fn metacall_value_to_null (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to class\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to class"] pub fn metacall_value_to_class (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to object\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to object"] pub fn metacall_value_to_object (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to exception\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to exception"] pub fn metacall_value_to_exception (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to throwable\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to throwable"] pub fn metacall_value_to_throwable (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign boolean @b to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] b\n Boolean to be assigned to value @v\n\n @return\n Value with boolean @b assigned to it"] pub fn metacall_value_from_bool (v : * mut :: std :: os :: raw :: c_void , b : :: std :: os :: raw :: c_uchar) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign character @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Character to be assigned to value @v\n\n @return\n Value with char @c assigned to it"] pub fn metacall_value_from_char (v : * mut :: std :: os :: raw :: c_void , c : :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign short @s to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] s\n Short to be assigned to value @v\n\n @return\n Value with short @s assigned to it"] pub fn metacall_value_from_short (v : * mut :: std :: os :: raw :: c_void , s : :: std :: os :: raw :: c_short) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign integer @i to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] i\n Integer to be assigned to value @v\n\n @return\n Value with integer @i assigned to it"] pub fn metacall_value_from_int (v : * mut :: std :: os :: raw :: c_void , i : :: std :: os :: raw :: c_int) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign long integer @l to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] l\n Long integer to be assigned to value @v\n\n @return\n Value with long @l assigned to it"] pub fn metacall_value_from_long (v : * mut :: std :: os :: raw :: c_void , l : :: std :: os :: raw :: c_long) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign single precision floating point @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Float to be assigned to value @v\n\n @return\n Value with float @f assigned to it"] pub fn metacall_value_from_float (v : * mut :: std :: os :: raw :: c_void , f : f32) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign double precision floating point @d to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] d\n Double to be assigned to value @v\n\n @return\n Value with double @d assigned to it"] pub fn metacall_value_from_double (v : * mut :: std :: os :: raw :: c_void , d : f64) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign string @str to value @v, truncates to @v size if it is smaller\n than @length + 1. It does not add null terminator if truncated.\n\n @param[in] v\n Reference to the value\n\n @param[in] str\n Constant string to be assigned to value @v (it needs to be null terminated)\n\n @param[in] length\n Length of the constant string @str\n\n @return\n Value with string @str assigned to it"] pub fn metacall_value_from_string (v : * mut :: std :: os :: raw :: c_void , str_ : * const :: std :: os :: raw :: c_char , length : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign array @buffer to value buffer @v\n\n @param[in] v\n Reference to the value\n\n @param[in] buffer\n Constant array to be assigned to value @v\n\n @param[in] size\n Number of elements contained in @buffer\n\n @return\n Value with array @buffer assigned to it"] pub fn metacall_value_from_buffer (v : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign array of values @values to value array @v\n\n @param[in] v\n Reference to the value\n\n @param[in] values\n Constant array of values to be assigned to value array @v\n\n @param[in] size\n Number of values contained in constant array @values\n\n @return\n Value with array of values @values assigned to it"] pub fn metacall_value_from_array (v : * mut :: std :: os :: raw :: c_void , values : * mut * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign array of values @values to value map @v\n\n @param[in] v\n Reference to the value\n\n @param[in] tuples\n Constant array of tuples to be assigned to value map @v\n\n @param[in] size\n Number of values contained in constant array @tuples\n\n @return\n Value with array of tuples @tuples assigned to it"] pub fn metacall_value_from_map (v : * mut :: std :: os :: raw :: c_void , tuples : * mut * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign pointer reference @ptr to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ptr\n Pointer to be assigned to value @v\n\n @return\n Value with pointer @ptr assigned to it"] pub fn metacall_value_from_ptr (v : * mut :: std :: os :: raw :: c_void , ptr : * const :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign future @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Future to be assigned to value @v\n\n @return\n Value with future @f assigned to it"] pub fn metacall_value_from_future (v : * mut :: std :: os :: raw :: c_void , f : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign function @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Function to be assigned to value @v\n\n @return\n Value with function @f assigned to it"] pub fn metacall_value_from_function (v : * mut :: std :: os :: raw :: c_void , f : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign null to value @v\n\n @param[in] v\n Reference to the value\n\n @return\n Value with null assigned to it"] pub fn metacall_value_from_null (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign class @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Class to be assigned to value @v\n\n @return\n Value with class @c assigned to it"] pub fn metacall_value_from_class (v : * mut :: std :: os :: raw :: c_void , c : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign object @o to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] o\n Object to be assigned to value @v\n\n @return\n Value with object @o assigned to it"] pub fn metacall_value_from_object (v : * mut :: std :: os :: raw :: c_void , o : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign exception @ex to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ex\n Exception to be assigned to value @v\n\n @return\n Value with exception @ex assigned to it"] pub fn metacall_value_from_exception (v : * mut :: std :: os :: raw :: c_void , ex : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign throwable @th to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] th\n Throwable to be assigned to value @v\n\n @return\n Value with throwable @th assigned to it"] pub fn metacall_value_from_throwable (v : * mut :: std :: os :: raw :: c_void , th : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Casts a value to a new type @id\n\n @param[in] v\n Reference to the value\n\n @param[in] id\n New type id of value to be casted\n\n @return\n Casted value or reference to @v if casting is between equivalent types"] pub fn metacall_value_cast (v : * mut :: std :: os :: raw :: c_void , id : metacall_value_id) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to boolean\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to boolean"] pub fn metacall_value_cast_bool (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_uchar ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to char\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to char"] pub fn metacall_value_cast_char (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to short\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to short"] pub fn metacall_value_cast_short (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_short ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to int\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to int"] pub fn metacall_value_cast_int (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to long\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to long"] pub fn metacall_value_cast_long (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_long ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to float\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to float"] pub fn metacall_value_cast_float (v : * mut * mut :: std :: os :: raw :: c_void) -> f32 ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to double\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to double"] pub fn metacall_value_cast_double (v : * mut * mut :: std :: os :: raw :: c_void) -> f64 ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to string\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to a C string (null terminated)"] pub fn metacall_value_cast_string (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to buffer\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to buffer"] pub fn metacall_value_cast_buffer (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to array\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to array of values"] pub fn metacall_value_cast_array (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to map\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to map"] pub fn metacall_value_cast_map (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to ptr\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to ptr"] pub fn metacall_value_cast_ptr (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to future\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to future"] pub fn metacall_value_cast_future (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to function\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to function"] pub fn metacall_value_cast_function (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to null\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to null"] pub fn metacall_value_cast_null (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to class\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to class"] pub fn metacall_value_cast_class (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to object\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to object"] pub fn metacall_value_cast_object (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to exception\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to exception"] pub fn metacall_value_cast_exception (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to throwable\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to throwable"] pub fn metacall_value_cast_throwable (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Destroy a value from scope stack\n\n @param[in] v\n Reference to the value"] pub fn metacall_value_destroy (v : * mut :: std :: os :: raw :: c_void) ; } pub type metacall_pid = pid_t ; pub type metacall_pre_fork_callback_ptr = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int > ; pub type metacall_post_fork_callback_ptr = :: std :: option :: Option < unsafe extern "C" fn (arg1 : metacall_pid , arg2 : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int > ; unsafe extern "C" { # [doc = " @brief\n Initialize fork detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_fork_initialize () -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Set fork hook callback\n\n @param[in] pre_callback\n Callback to be called before fork detour is executed\n\n @param[in] post_callback\n Callback to be called after fork detour is executed"] pub fn metacall_fork (pre_callback : metacall_pre_fork_callback_ptr , post_callback : metacall_post_fork_callback_ptr) ; } unsafe extern "C" { # [doc = " @brief\n Unregister fork detours and destroy shared memory"] pub fn metacall_fork_destroy () ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct metacall_initialize_configuration_type { pub tag : * const :: std :: os :: raw :: c_char , pub options : * mut :: std :: os :: raw :: c_void , } # [allow (clippy :: unnecessary_operation , clippy :: identity_op)] const _ : () = { ["Size of metacall_initialize_configuration_type"] [:: std :: mem :: size_of :: < metacall_initialize_configuration_type > () - 16usize] ; ["Alignment of metacall_initialize_configuration_type"] [:: std :: mem :: align_of :: < metacall_initialize_configuration_type > () - 8usize] ; ["Offset of field: metacall_initialize_configuration_type::tag"] [:: std :: mem :: offset_of ! (metacall_initialize_configuration_type , tag) - 0usize] ; ["Offset of field: metacall_initialize_configuration_type::options"] [:: std :: mem :: offset_of ! (metacall_initialize_configuration_type , options) - 8usize] ; } ; pub type metacall_await_callback = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct metacall_await_callbacks_type { pub resolve : metacall_await_callback , pub reject : metacall_await_callback , } # [allow (clippy :: unnecessary_operation , clippy :: identity_op)] const _ : () = { ["Size of metacall_await_callbacks_type"] [:: std :: mem :: size_of :: < metacall_await_callbacks_type > () - 16usize] ; ["Alignment of metacall_await_callbacks_type"] [:: std :: mem :: align_of :: < metacall_await_callbacks_type > () - 8usize] ; ["Offset of field: metacall_await_callbacks_type::resolve"] [:: std :: mem :: offset_of ! (metacall_await_callbacks_type , resolve) - 0usize] ; ["Offset of field: metacall_await_callbacks_type::reject"] [:: std :: mem :: offset_of ! (metacall_await_callbacks_type , reject) - 8usize] ; } ; pub type metacall_await_callbacks = metacall_await_callbacks_type ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct metacall_version_type { pub major : :: std :: os :: raw :: c_uint , pub minor : :: std :: os :: raw :: c_uint , pub patch : :: std :: os :: raw :: c_uint , pub revision : * const :: std :: os :: raw :: c_char , pub str_ : * const :: std :: os :: raw :: c_char , pub name : * const :: std :: os :: raw :: c_char , } # [allow (clippy :: unnecessary_operation , clippy :: identity_op)] const _ : () = { ["Size of metacall_version_type"] [:: std :: mem :: size_of :: < metacall_version_type > () - 40usize] ; ["Alignment of metacall_version_type"] [:: std :: mem :: align_of :: < metacall_version_type > () - 8usize] ; ["Offset of field: metacall_version_type::major"] [:: std :: mem :: offset_of ! (metacall_version_type , major) - 0usize] ; ["Offset of field: metacall_version_type::minor"] [:: std :: mem :: offset_of ! (metacall_version_type , minor) - 4usize] ; ["Offset of field: metacall_version_type::patch"] [:: std :: mem :: offset_of ! (metacall_version_type , patch) - 8usize] ; ["Offset of field: metacall_version_type::revision"] [:: std :: mem :: offset_of ! (metacall_version_type , revision) - 16usize] ; ["Offset of field: metacall_version_type::str_"] [:: std :: mem :: offset_of ! (metacall_version_type , str_) - 24usize] ; ["Offset of field: metacall_version_type::name"] [:: std :: mem :: offset_of ! (metacall_version_type , name) - 32usize] ; } ; unsafe extern "C" { # [doc = " @brief\n Returns default serializer used by MetaCall\n\n @return\n Name of the serializer to be used with serialization methods"] pub fn metacall_serial () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Returns default detour used by MetaCall\n\n @return\n Name of the detour to be used with detouring methods"] pub fn metacall_detour () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Disables MetaCall logs, must be called before @metacall_initialize.\n\n When initializing MetaCall, it initializes a default logs to stdout\n if none was defined. If you want to benchmark or simply disable this\n default logs, you can call to this function before @metacall_initialize."] pub fn metacall_log_null () ; } unsafe extern "C" { # [doc = " @brief\n Flags to be set in MetaCall library\n\n @param[in] flags\n Combination of flags referring to definitions METACALL_FLAGS_*"] pub fn metacall_flags (flags : :: std :: os :: raw :: c_int) ; } unsafe extern "C" { # [doc = " @brief\n Initialize MetaCall library\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_initialize () -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Initialize MetaCall library with configuration arguments\n\n @param[in] initialize_config\n Extension of the script to be loaded in memory with data to be injected\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_initialize_ex (initialize_config : * mut metacall_initialize_configuration_type) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Initialize MetaCall application arguments\n\n @param[in] argc\n Number of additional parameters to be passed to the runtime when initializing\n\n @param[in] argv\n Additional parameters to be passed to the runtime when initializing (when using MetaCall as an application)"] pub fn metacall_initialize_args (argc : :: std :: os :: raw :: c_int , argv : * mut * mut :: std :: os :: raw :: c_char) ; } unsafe extern "C" { # [doc = " @brief\n Get the number of arguments in which MetaCall was initialized\n\n @return\n An integer equal or greater than zero"] pub fn metacall_argc () -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the arguments in which MetaCall was initialized\n\n @return\n A pointer to an array of strings with the additional arguments"] pub fn metacall_argv () -> * mut * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Check if script context is loaded by @tag\n\n @param[in] tag\n Extension of the script (if tag is NULL, it returns the status of the whole MetaCall instance)\n\n @return\n Zero if context is initialized, different from zero otherwise"] pub fn metacall_is_initialized (tag : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Amount of function call arguments supported by MetaCall\n\n @return\n Number of arguments suported"] pub fn metacall_args_size () -> usize ; } unsafe extern "C" { # [doc = " @brief\n Set a execution path defined by @path to the extension script @tag\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path to be loaded\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_execution_path (tag : * const :: std :: os :: raw :: c_char , path : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Set a execution path defined by @path to the extension script @tag with length\n\n @param[in] tag\n Extension of the script\n\n @param[in] tag_length\n Length of the extension of the tag\n\n @param[in] path\n Path to be loaded\n\n @param[in] path_length\n Length of the path\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_execution_path_s (tag : * const :: std :: os :: raw :: c_char , tag_length : usize , path : * const :: std :: os :: raw :: c_char , path_length : usize) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Loads a script from file specified by @path\n\n @param[in] tag\n Extension of the script\n\n @param[in] paths\n Path array of files\n\n @param[in] size\n Size of the array @paths\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_file (tag : * const :: std :: os :: raw :: c_char , paths : * mut * const :: std :: os :: raw :: c_char , size : usize , handle : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Loads a script from memory\n\n @param[in] tag\n Extension of the script\n\n @param[in] buffer\n Memory block representing the string of the script\n\n @param[in] size\n Memory block representing the string of the script\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_memory (tag : * const :: std :: os :: raw :: c_char , buffer : * const :: std :: os :: raw :: c_char , size : usize , handle : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Loads a package of scrips from file specified by @path into loader defined by @extension\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path of the package\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_package (tag : * const :: std :: os :: raw :: c_char , path : * const :: std :: os :: raw :: c_char , handle : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Loads a a list of scrips from configuration specified by @path into loader\n with the following format:\n {\n \"language_id\": \"<tag>\",\n \"path\": \"<path>\",\n \"scripts\": [ \"<script0>\", \"<script1>\", ..., \"<scriptN>\" ]\n }\n\n @param[in] path\n Path of the configuration\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @param[in] allocator\n Pointer to allocator will allocate the configuration\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_configuration (path : * const :: std :: os :: raw :: c_char , handle : * mut * mut :: std :: os :: raw :: c_void , allocator : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv (name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_s (name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallhv (handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n Includes @size in order to allow variadic arguments or safe calls\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallhv_s (handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall (name : * const :: std :: os :: raw :: c_char , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt (name : * const :: std :: os :: raw :: c_char , ids : * const metacall_value_id , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_s (name : * const :: std :: os :: raw :: c_char , ids : * const metacall_value_id , size : usize , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallht_s (handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , ids : * const metacall_value_id , size : usize , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the function by @name\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] pub fn metacall_function (name : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create an empty handler into a loader with name @name\n\n @param[in] loader\n Pointer to the loader which the handle belongs to\n\n @param[in] name\n Name of the handle\n\n @param[out] handle_ptr\n On success, returns the pointer to the handle created, otherwise NULL\n\n @return\n Return zero on success, different from zero on error"] pub fn metacall_handle_initialize (loader : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , handle_ptr : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Populate the objects of @handle_src into @handle_dest\n\n @param[inout] handle_dest\n Handle where the objects from @handle_src will be stored\n\n @param[in] handle_src\n Handle from where the objects will be copied\n\n @return\n Return zero on success, different from zero on error"] pub fn metacall_handle_populate (handle_dest : * mut :: std :: os :: raw :: c_void , handle_src : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the function by @name from @handle\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] pub fn metacall_handle_function (handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the function parameter type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n @param[in] parameter\n The index of the parameter to be retrieved\n\n @param[out] id\n The parameter type id that will be returned\n\n @return\n Return 0 if the @parameter index exists and @func is valid, 1 otherwhise"] pub fn metacall_function_parameter_type (func : * mut :: std :: os :: raw :: c_void , parameter : usize , id : * mut metacall_value_id) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the function return type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n\n @param[out] id\n The value id of the return type of the function @func\n\n @return\n Return 0 if the @func is valid, 1 otherwhise"] pub fn metacall_function_return_type (func : * mut :: std :: os :: raw :: c_void , id : * mut metacall_value_id) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get minimun mumber of arguments accepted by function @func\n\n @param[in] func\n Function reference\n\n @return\n Return mumber of arguments"] pub fn metacall_function_size (func : * mut :: std :: os :: raw :: c_void) -> usize ; } unsafe extern "C" { # [doc = " @brief\n Check if the function @func is asynchronous or synchronous\n\n @param[in] func\n Function reference\n\n @return\n Return 0 if it is syncrhonous, 1 if it is asynchronous and -1 if the function is NULL"] pub fn metacall_function_async (func : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the handle by @name\n\n @param[in] tag\n Extension of the script\n\n @param[in] name\n Name of the handle\n\n @return\n Handle reference, null if the function does not exist"] pub fn metacall_handle (tag : * const :: std :: os :: raw :: c_char , name : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get name of a @handle\n\n @param[in] handle\n Pointer to the handle to be retrieved\n\n @return\n String that references the handle"] pub fn metacall_handle_id (handle : * mut :: std :: os :: raw :: c_void) -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Return a value representing the handle as a map of functions (or values)\n\n @param[in] handle\n Reference to the handle to be described\n\n @return\n A value of type map on success, null otherwise"] pub fn metacall_handle_export (handle : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfv (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of function arguments\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfv_s (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by variable arguments @va_args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallf (func : * mut :: std :: os :: raw :: c_void , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfs (func : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfmv (func : * mut :: std :: os :: raw :: c_void , keys : * mut * mut :: std :: os :: raw :: c_void , values : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfms (func : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Register a function by name @name and arguments @va_args\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] va_args\n Varidic function parameter types\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall_register (name : * const :: std :: os :: raw :: c_char , invoke : :: std :: option :: Option < unsafe extern "C" fn (arg1 : usize , arg2 : * mut * mut :: std :: os :: raw :: c_void , arg3 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , func : * mut * mut :: std :: os :: raw :: c_void , return_type : metacall_value_id , size : usize , ...) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall_registerv (name : * const :: std :: os :: raw :: c_char , invoke : :: std :: option :: Option < unsafe extern "C" fn (arg1 : usize , arg2 : * mut * mut :: std :: os :: raw :: c_void , arg3 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , func : * mut * mut :: std :: os :: raw :: c_void , return_type : metacall_value_id , size : usize , types : * mut metacall_value_id) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Obtain the loader instance by @tag\n\n @param[in] tag\n Tag in which the loader is identified, normally it is the extension of the script\n\n @return\n Pointer the loader by @tag"] pub fn metacall_loader (tag : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] loader\n Opaque pointer to the loader in which you want to register the function (this allows to register the function into a different loader than the host)\n\n @param[in] handle\n Opaque pointer to the handle in which you want to register the function (if it is NULL, it will be defined on the global scope of the loader)\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Zero if the function was registered properly, distinct from zero otherwise"] pub fn metacall_register_loaderv (loader : * mut :: std :: os :: raw :: c_void , handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , invoke : :: std :: option :: Option < unsafe extern "C" fn (arg1 : usize , arg2 : * mut * mut :: std :: os :: raw :: c_void , arg3 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , return_type : metacall_value_id , size : usize , types : * mut metacall_value_id) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await (name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Awaits for a promise and registers a callback to be executed when a future is resolved\n\n @param[in] f\n The pointer to the future\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await_future (f : * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await_s (name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await_s (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void , size : usize , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func (offered without function pointers for languages without support to function pointers)\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] cb\n Pointer to struct containing the function pointers to reject and resolve that will be executed when task completion or error\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await_struct_s (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void , size : usize , cb : metacall_await_callbacks , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] size\n Number of elements of the arrays @keys and @values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfmv_await (func : * mut :: std :: os :: raw :: c_void , keys : * mut * mut :: std :: os :: raw :: c_void , values : * mut * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfmv_await_s (func : * mut :: std :: os :: raw :: c_void , keys : * mut * mut :: std :: os :: raw :: c_void , values : * mut * mut :: std :: os :: raw :: c_void , size : usize , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfs_await (func : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfms_await (func : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the class by @name\n\n @param[in] name\n Name of the class\n\n @return\n Class reference, null if the class does not exist"] pub fn metacall_class (name : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a class method anonymously by value array @args (this procedure assumes there's no overloaded methods and does type conversion on values)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_class (cls : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a class method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_class (cls : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , ret : metacall_value_id , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a new object instance from @cls by value array @args\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the new object\n\n @param[in] args\n Array of pointers constructor parameters\n\n @param[in] size\n Number of elements of constructor parameters\n\n @return\n Pointer to the new object value instance"] pub fn metacall_class_new (cls : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get an attribute from @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the class attribute value or NULL if an error occurred"] pub fn metacall_class_static_get (cls : * mut :: std :: os :: raw :: c_void , key : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Set an attribute to @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] pub fn metacall_class_static_set (cls : * mut :: std :: os :: raw :: c_void , key : * const :: std :: os :: raw :: c_char , v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Call an object method anonymously by value array @args\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_object (obj : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a object method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_object (obj : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , ret : metacall_value_id , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get an attribute from @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the object attribute value or NULL if an error occurred"] pub fn metacall_object_get (obj : * mut :: std :: os :: raw :: c_void , key : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Set an attribute to @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] pub fn metacall_object_set (obj : * mut :: std :: os :: raw :: c_void , key : * const :: std :: os :: raw :: c_char , v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the value contained by throwable object @th\n\n @param[in] th\n Pointer to the throwable object\n\n @return\n Pointer to the value inside of the throwable or NULL in case of error"] pub fn metacall_throwable_value (th : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Provide information about all loaded objects\n\n @param[out] size\n Size in bytes of return buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n String containing introspection information"] pub fn metacall_inspect (size : * mut usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide information about all loaded objects as a value\n\n @return\n Value containing introspection information"] pub fn metacall_inspect_value () -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert the value @v to serialized string\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] v\n Reference to the value\n\n @param[out] size\n Size of new allocated string\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n New allocated string containing stringified value"] pub fn metacall_serialize (name : * const :: std :: os :: raw :: c_char , v : * mut :: std :: os :: raw :: c_void , size : * mut usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert the string @buffer to value\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] buffer\n String to be deserialized\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n New allocated value representing the string (must be freed)"] pub fn metacall_deserialize (name : * const :: std :: os :: raw :: c_char , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Clear handle from memory and unload related resources\n\n @param[in] handle\n Reference to the handle to be unloaded\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_clear (handle : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the plugin extension handle to be used for loading plugins\n\n @return\n Pointer to the extension handle, or null if it failed to load"] pub fn metacall_plugin_extension () -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the handle containing all the functionality of the plugins from core\n\n @return\n Pointer to the core plugin handle, or null if it failed to load"] pub fn metacall_plugin_core () -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the plugin extension path to be used for accessing the plugins folder\n\n @return\n String containing the core plugin path, or null if it failed to load the plugin extension"] pub fn metacall_plugin_path () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Destroy MetaCall library"] pub fn metacall_destroy () ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version struct\n\n @return\n Static struct containing unpacked version"] pub fn metacall_version () -> * const metacall_version_type ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is @major,\n I is @minor and P is @patch\n\n @param[in] major\n Unsigned integer representing major version\n\n @param[in] minor\n Unsigned integer representing minor version\n\n @param[in] patch\n Unsigned integer representing patch version\n\n @return\n Hexadecimal integer containing packed version"] pub fn metacall_version_hex_make (major : :: std :: os :: raw :: c_uint , minor : :: std :: os :: raw :: c_uint , patch : :: std :: os :: raw :: c_uint) -> u32 ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is major,\n I is minor and P is patch\n\n @return\n Hexadecimal integer containing packed version"] pub fn metacall_version_hex () -> u32 ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version string\n\n @return\n Static string containing module version"] pub fn metacall_version_str () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version revision string\n\n @return\n Static string containing module version revision"] pub fn metacall_version_revision () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version name\n\n @return\n Static string containing module version name"] pub fn metacall_version_name () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide the module information\n\n @return\n Static string containing module information"] pub fn metacall_print_info () -> * const :: std :: os :: raw :: c_char ; } \ No newline at end of file From 020dc0e1512729a08512c9ce2afe0c0bd2cc6fb5 Mon Sep 17 00:00:00 2001 From: Fahd Ashour <fahd.fady212@gmail.com> Date: Thu, 4 Sep 2025 18:04:05 +0300 Subject: [PATCH 436/487] fix and refactor: rust port not finding metacall shared libraries and config files (#569) * refactor(rs_port): init translating search functionality * stash * CI: update rust workflow for testing Signed-off-by: fahdfady <fahd.fady212@gmail.com> * CI(release-rust): update test job to use matrix strategy for OS compatibility Signed-off-by: fahdfady <fahd.fady212@gmail.com> * CI: rust release, remove windows * canonicalize * Update build.rs * Update release-rust.yml * Update release-rust.yml * Update release-rust.yml --------- Signed-off-by: fahdfady <fahd.fady212@gmail.com> Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- .github/workflows/release-rust.yml | 35 +++++- source/ports/rs_port/build.rs | 168 +++++++++++++++++++++++++++-- 2 files changed, 191 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index 10baaf1e7..13644cd0f 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -1,11 +1,12 @@ name: Release Rust Crates on: + workflow_dispatch: + pull_request: push: branches: [ master, develop ] paths: - - 'source/ports/rs_port/Cargo.toml' - - 'source/ports/rs_port/inline/Cargo.toml' + - 'source/ports/rs_port/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -15,9 +16,39 @@ env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} jobs: + test: + name: Rust Port Tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - name: Check out the repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install MetaCall Unix + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh + - name: Install MetaCall Windows + if: matrix.os == 'windows-latest' + run: powershell -NoProfile -ExecutionPolicy Unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/metacall/install/master/install.ps1')))" + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Build and Test the Rust Port + working-directory: source/ports/rs_port + run: | + cargo build --verbose + cargo test --verbose + release: name: Release Rust Port runs-on: ubuntu-latest + needs: test steps: - name: Check out the repo uses: actions/checkout@v4 diff --git a/source/ports/rs_port/build.rs b/source/ports/rs_port/build.rs index 4b7bcf309..1c623ca2f 100644 --- a/source/ports/rs_port/build.rs +++ b/source/ports/rs_port/build.rs @@ -1,4 +1,147 @@ -use std::env; +use std::{ + env, fs, + path::{Path, PathBuf}, + vec, +}; + +// Search for MetaCall libraries in platform-specific locations +// Handle custom installation paths via environment variables +// Find configuration files recursively +// Provide helpful error messages when things aren't found + +/// Represents the install paths for a platform +struct InstallPath { + paths: Vec<PathBuf>, + names: Vec<&'static str>, +} + +/// Find files recursively in a directory matching a pattern +fn find_files_recursively<P: AsRef<Path>>( + root_dir: P, + filename: &str, + max_depth: Option<usize>, +) -> Result<Vec<PathBuf>, Box<dyn std::error::Error>> { + let mut matches = Vec::new(); + let mut stack = vec![(root_dir.as_ref().to_path_buf(), 0)]; + + while let Some((current_dir, depth)) = stack.pop() { + if let Some(max) = max_depth { + if depth > max { + continue; + } + } + + if let Ok(entries) = fs::read_dir(¤t_dir) { + for entry in entries.flatten() { + let path = entry.path(); + + if path.is_file() { + // Simple filename comparison instead of regex + if let Some(file_name) = path.file_name().and_then(|n| n.to_str()) { + if file_name == filename { + matches.push(path); + } + } + } else if path.is_dir() { + stack.push((path, depth + 1)); + } + } + } + } + + Ok(matches) +} + +fn platform_install_paths() -> Result<InstallPath, Box<dyn std::error::Error>> { + if cfg!(target_os = "windows") { + // Defaults to path: C:\Users\Default\AppData\Local + let local_app_data = env::var("LOCALAPPDATA") + .unwrap_or_else(|_| String::from("C:\\Users\\Default\\AppData\\Local")); + + Ok(InstallPath { + paths: vec![PathBuf::from(local_app_data) + .join("MetaCall") + .join("metacall")], + names: vec!["metacall.dll"], + }) + } else if cfg!(target_os = "macos") { + Ok(InstallPath { + paths: vec![ + PathBuf::from("/opt/homebrew/lib/"), + PathBuf::from("/usr/local/lib/"), + ], + names: vec!["metacall.dylib"], + }) + } else if cfg!(target_os = "linux") { + Ok(InstallPath { + paths: vec![PathBuf::from("/usr/local/lib/"), PathBuf::from("/gnu/lib/")], + names: vec!["libmetacall.so"], + }) + } else { + Err(format!("Platform {} not supported", env::consts::OS).into()) + } +} + +/// Get search paths, checking for custom installation path first +fn get_search_config() -> Result<InstallPath, Box<dyn std::error::Error>> { + // First, check if user specified a custom path + if let Ok(custom_path) = env::var("METACALL_INSTALL_PATH") { + // For custom paths, we need to search for any metacall library variant + return Ok(InstallPath { + paths: vec![PathBuf::from(custom_path)], + names: vec!["libmetacall.so", "libmetacalld.so", "libmetacall.dylib", "libmetacalld.dylib", "metacall.dll", "metacalld.dll"] + }); + } + + // Fall back to platform-specific paths + platform_install_paths() +} + +/// Find the MetaCall library +/// This orchestrates the search process +fn find_metacall_library() -> Result<PathBuf, Box<dyn std::error::Error>> { + let search_config = get_search_config()?; + + // Search in each configured path + for search_path in &search_config.paths { + for name in &search_config.names { + // Search with no limit in depth + match find_files_recursively(search_path, &name.to_string(), None) { + Ok(files) if !files.is_empty() => { + let found_lib = fs::canonicalize(&files[0])?; + + return Ok(found_lib.clone()); + } + Ok(_) => { + // No files found in this path, continue searching + continue; + } + Err(e) => { + eprintln!( + "Error searching in {}: {}", + search_path.display(), + e + ); + continue; + } + } + } + } + + // If we get here, library wasn't found + let search_paths: Vec<String> = search_config + .paths + .iter() + .map(|p| p.display().to_string()) + .collect(); + + Err(format!( + "MetaCall library not found. Searched in: {}. \ + If you have it installed elsewhere, set METACALL_INSTALL_PATH environment variable.", + search_paths.join(", ") + ) + .into()) +} fn main() { // When running tests from CMake @@ -21,16 +164,21 @@ fn main() { } } } else { - // When building from Cargo - let profile = env::var("PROFILE").unwrap(); - match profile.as_str() { - // "debug" => { - // println!("cargo:rustc-link-lib=dylib=metacalld"); - // } - "debug" | "release" => { - println!("cargo:rustc-link-lib=dylib=metacall") + // When building from Cargo, try to find MetaCall + match find_metacall_library() { + Ok(lib_path) => { + // Extract the directory containing the library + if let Some(lib_dir) = lib_path.parent() { + println!("cargo:rustc-link-search=native={}", lib_dir.display()); + println!("cargo:rustc-link-lib=dylib=metacall"); + } } - _ => { + Err(e) => { + // Print the error + eprintln!("Failed to find MetaCall library with: {e} \ + Still trying to link in case the library is in system paths"); + + // Still try to link in case the library is in system paths println!("cargo:rustc-link-lib=dylib=metacall") } } From 57641a6a6815fb8dfa1f93c35e62e31def0ef2d3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 4 Sep 2025 17:05:19 +0200 Subject: [PATCH 437/487] Improve tcc support on C Loader. --- source/loaders/c_loader/source/c_loader_impl.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index c041ffc5c..3fffb19ec 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -1443,6 +1443,15 @@ static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_bas return data.result; } +static int c_loader_impl_tcc_relocate(TCCState *state) +{ +#ifdef TCC_RELOCATE_AUTO + return tcc_relocate(state, TCC_RELOCATE_AUTO); +#else + return tcc_relocate(state); +#endif +} + loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path paths[], size_t size) { loader_impl_c c_impl = static_cast<loader_impl_c>(loader_impl_get(impl)); @@ -1497,7 +1506,7 @@ loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path p } } - if (tcc_relocate(c_handle->state) == -1) + if (c_loader_impl_tcc_relocate(c_handle->state) == -1) { log_write("metacall", LOG_LEVEL_ERROR, "TCC failed to relocate"); goto error; @@ -1529,7 +1538,7 @@ loader_handle c_loader_impl_load_from_memory(loader_impl impl, const loader_name goto error; } - if (tcc_relocate(c_handle->state) == -1) + if (c_loader_impl_tcc_relocate(c_handle->state) == -1) { log_write("metacall", LOG_LEVEL_ERROR, "TCC failed to relocate"); goto error; From b34f79780ca0c2ea189fc5bce3acfcddb1aa3cc5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 4 Sep 2025 17:05:33 +0200 Subject: [PATCH 438/487] Solve issue with MacOS CMake. --- .github/workflows/macos-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/macos-test.yml b/.github/workflows/macos-test.yml index 2a5725996..520de1517 100644 --- a/.github/workflows/macos-test.yml +++ b/.github/workflows/macos-test.yml @@ -40,6 +40,10 @@ jobs: with: fetch-depth: 0 + - name: Uninstall CMake + run: | + brew uninstall --force cmake + - name: Uninstall NodeJS and NPM run: | npm uninstall npm -g From 832cbb4048ad296f9c6838a70b456e32483d0f9f Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 4 Sep 2025 17:10:52 +0200 Subject: [PATCH 439/487] Remove release of rust ci from PR and workflow dispatch. --- .github/workflows/release-rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index 13644cd0f..6d2f0897f 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -49,6 +49,7 @@ jobs: name: Release Rust Port runs-on: ubuntu-latest needs: test + if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request' }} steps: - name: Check out the repo uses: actions/checkout@v4 From 6afe9bef2a62c1dce103063e25b42062af67cb74 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 4 Sep 2025 17:23:29 +0200 Subject: [PATCH 440/487] Update version to v0.9.14. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6af8ded76..69010fa5b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.13 \ No newline at end of file +0.9.14 \ No newline at end of file From 4e91b7094ef52a15fcb6d56e00ea105fc8d42739 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 4 Sep 2025 18:11:54 +0200 Subject: [PATCH 441/487] Solve cmake issue in macos benchmarks ci. --- .github/workflows/benchmark.yml | 36 +++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 06b428b84..67a684cd0 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -32,9 +32,41 @@ jobs: with: fetch-depth: 0 - - name: Export XCode SDK Root + - name: Prepare MacOS Installation if: matrix.os == 'macos-latest' - run: echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV + run: | + echo "Uninstall CMake" + brew uninstall --force cmake + + echo "Uninstall NodeJS and NPM" + npm uninstall npm -g + rm -rf /usr/local/lib/node_modules/npm + + echo "Uninstall Ruby" + brew uninstall --force --ignore-dependencies ruby + brew cleanup -s ruby + brew cleanup --prune-prefix + RUBY_FRAMEWORK_DIR=$(xcrun --sdk macosx --show-sdk-path)/System/Library/Frameworks/Ruby.framework + sudo rm -rf $RUBY_FRAMEWORK_DIR + + echo "Uninstall Go" + brew uninstall --force go + brew autoremove + sudo rm -rf /usr/local/Cellar/go + sudo rm -rf /usr/local/go + sudo rm -rf /usr/local/opt/go + sudo rm -rf /etc/paths.d/go + sudo rm -rf /usr/local/bin/go + sudo rm -rf /usr/local/bin/gofmt + + echo "Uninstall Java" + sudo rm -rf /Library/Java/JavaVirtualMachines/* + sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin + sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane + unset JAVA_HOME + + echo "Export XCode SDK Root" + echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV # TODO: Add support for NetCore Bench - name: Set up the environment From 59e7b9141c81c7c0861b6759f7428932541392c4 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 5 Sep 2025 00:44:33 +0200 Subject: [PATCH 442/487] Solve more issues in build.rs. --- source/ports/rs_port/build.rs | 63 +++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/source/ports/rs_port/build.rs b/source/ports/rs_port/build.rs index 1c623ca2f..e1fe1464e 100644 --- a/source/ports/rs_port/build.rs +++ b/source/ports/rs_port/build.rs @@ -15,6 +15,12 @@ struct InstallPath { names: Vec<&'static str>, } +/// Represents the match of a library when it's found +struct LibraryPath { + path: PathBuf, + library: String, +} + /// Find files recursively in a directory matching a pattern fn find_files_recursively<P: AsRef<Path>>( root_dir: P, @@ -70,7 +76,7 @@ fn platform_install_paths() -> Result<InstallPath, Box<dyn std::error::Error>> { PathBuf::from("/opt/homebrew/lib/"), PathBuf::from("/usr/local/lib/"), ], - names: vec!["metacall.dylib"], + names: vec!["libmetacall.dylib"], }) } else if cfg!(target_os = "linux") { Ok(InstallPath { @@ -89,7 +95,14 @@ fn get_search_config() -> Result<InstallPath, Box<dyn std::error::Error>> { // For custom paths, we need to search for any metacall library variant return Ok(InstallPath { paths: vec![PathBuf::from(custom_path)], - names: vec!["libmetacall.so", "libmetacalld.so", "libmetacall.dylib", "libmetacalld.dylib", "metacall.dll", "metacalld.dll"] + names: vec![ + "libmetacall.so", + "libmetacalld.so", + "libmetacall.dylib", + "libmetacalld.dylib", + "metacall.dll", + "metacalld.dll", + ], }); } @@ -97,31 +110,48 @@ fn get_search_config() -> Result<InstallPath, Box<dyn std::error::Error>> { platform_install_paths() } +/// Get the parent path and library name +fn get_parent_and_library(path: &Path) -> Option<(PathBuf, String)> { + let parent = path.parent()?.to_path_buf(); + + // Get the file stem (filename without extension) + let stem = path.file_stem()?.to_str()?; + + // Remove "lib" prefix if present + let cleaned_stem = stem.strip_prefix("lib").unwrap_or(stem).to_string(); + + Some((parent, cleaned_stem)) +} + /// Find the MetaCall library /// This orchestrates the search process -fn find_metacall_library() -> Result<PathBuf, Box<dyn std::error::Error>> { +fn find_metacall_library() -> Result<LibraryPath, Box<dyn std::error::Error>> { let search_config = get_search_config()?; // Search in each configured path for search_path in &search_config.paths { for name in &search_config.names { // Search with no limit in depth - match find_files_recursively(search_path, &name.to_string(), None) { + match find_files_recursively(search_path, name, None) { Ok(files) if !files.is_empty() => { let found_lib = fs::canonicalize(&files[0])?; - return Ok(found_lib.clone()); + match get_parent_and_library(&found_lib) { + Some((parent, name)) => { + return Ok(LibraryPath { + path: parent, + library: name, + }) + } + None => continue, + }; } Ok(_) => { // No files found in this path, continue searching continue; } Err(e) => { - eprintln!( - "Error searching in {}: {}", - search_path.display(), - e - ); + eprintln!("Error searching in {}: {}", search_path.display(), e); continue; } } @@ -167,16 +197,15 @@ fn main() { // When building from Cargo, try to find MetaCall match find_metacall_library() { Ok(lib_path) => { - // Extract the directory containing the library - if let Some(lib_dir) = lib_path.parent() { - println!("cargo:rustc-link-search=native={}", lib_dir.display()); - println!("cargo:rustc-link-lib=dylib=metacall"); - } + println!("cargo:rustc-link-search=native={}", lib_path.path.display()); + println!("cargo:rustc-link-lib=dylib={}", lib_path.library); } Err(e) => { // Print the error - eprintln!("Failed to find MetaCall library with: {e} \ - Still trying to link in case the library is in system paths"); + eprintln!( + "Failed to find MetaCall library with: {e} \ + Still trying to link in case the library is in system paths" + ); // Still try to link in case the library is in system paths println!("cargo:rustc-link-lib=dylib=metacall") From 8364cf74007a1007665c394de579c24a67d5fa55 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 5 Sep 2025 01:04:50 +0200 Subject: [PATCH 443/487] Solve issues with cargo test. --- source/ports/rs_port/build.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/ports/rs_port/build.rs b/source/ports/rs_port/build.rs index e1fe1464e..96502c30b 100644 --- a/source/ports/rs_port/build.rs +++ b/source/ports/rs_port/build.rs @@ -197,8 +197,25 @@ fn main() { // When building from Cargo, try to find MetaCall match find_metacall_library() { Ok(lib_path) => { + // Define linker flags println!("cargo:rustc-link-search=native={}", lib_path.path.display()); println!("cargo:rustc-link-lib=dylib={}", lib_path.library); + + // Set the runtime environment variable for finding the library during tests + #[cfg(target_os = "linux")] + println!( + "cargo:rustc-env=LD_LIBRARY_PATH={}", + lib_path.path.display() + ); + + #[cfg(target_os = "macos")] + println!( + "cargo:rustc-env=DYLD_LIBRARY_PATH={}", + lib_path.path.display() + ); + + #[cfg(target_os = "windows")] + println!("cargo:rustc-env=PATH={}", lib_path.path.display()); } Err(e) => { // Print the error From 9d153cb945c2b5193807e6bdfa1a18a32685a86c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 5 Sep 2025 01:19:44 +0200 Subject: [PATCH 444/487] Comment out windows in rs_port ci. --- .github/workflows/release-rust.yml | 2 +- source/ports/rs_port/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index 6d2f0897f..a660c4597 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] # TODO: windows-latest steps: - name: Check out the repo uses: actions/checkout@v4 diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index d1030b99d..4779e08f0 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.4.3" +version = "0.4.4" [lib] crate-type = ["lib"] From 2c06892ffad1a676ddc1574dfd1ff4e2aeb29bbf Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 5 Sep 2025 17:24:05 +0200 Subject: [PATCH 445/487] Trying to solve issues with windows on rs_port. --- .github/workflows/release-rust.yml | 2 +- source/ports/rs_port/src/types/metacall_value.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index a660c4597..6d2f0897f 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] # TODO: windows-latest + os: [ubuntu-latest, macos-latest, windows-latest] steps: - name: Check out the repo uses: actions/checkout@v4 diff --git a/source/ports/rs_port/src/types/metacall_value.rs b/source/ports/rs_port/src/types/metacall_value.rs index bbc5870ff..111dbd590 100644 --- a/source/ports/rs_port/src/types/metacall_value.rs +++ b/source/ports/rs_port/src/types/metacall_value.rs @@ -162,10 +162,10 @@ impl MetaCallValue for i64 { fn from_metacall_raw_leak(v: *mut c_void) -> Result<Self, Box<dyn MetaCallValue>> { let value = unsafe { metacall_value_to_long(v) }; - Ok(value) + Ok(value as i64) } fn into_metacall_raw(self) -> *mut c_void { - unsafe { metacall_value_create_long(self) } + unsafe { metacall_value_create_long(self.try_into().unwrap()) } } } /// Equivalent to MetaCall float type. From a1eb88f2bf7994b00f2fa46e2a90948ea29050e3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 5 Sep 2025 17:41:04 +0200 Subject: [PATCH 446/487] Add load from memory in c loader. --- .../loaders/c_loader/source/c_loader_impl.cpp | 241 ++++++++++-------- .../source/metacall_c_test.cpp | 20 +- 2 files changed, 146 insertions(+), 115 deletions(-) diff --git a/source/loaders/c_loader/source/c_loader_impl.cpp b/source/loaders/c_loader/source/c_loader_impl.cpp index 3fffb19ec..70470488c 100644 --- a/source/loaders/c_loader/source/c_loader_impl.cpp +++ b/source/loaders/c_loader/source/c_loader_impl.cpp @@ -76,12 +76,42 @@ typedef struct loader_impl_c_type } * loader_impl_c; +struct loader_impl_c_handle_base_type; + +typedef struct loader_impl_c_handle_base_type *loader_impl_c_handle_base; + +typedef struct c_loader_impl_discover_visitor_data_type +{ + loader_impl impl; + loader_impl_c_handle_base c_handle; + scope sp; + int result; + +} * c_loader_impl_discover_visitor_data; + +static CXChildVisitResult c_loader_impl_discover_visitor(CXCursor cursor, CXCursor, void *data); + typedef struct loader_impl_c_handle_base_type { +public: + virtual ~loader_impl_c_handle_base_type() {} + + virtual bool recursive_includes() = 0; + + virtual int discover(loader_impl impl, context ctx) = 0; + + virtual const void *symbol(std::string &name) = 0; + + virtual int discover_visitor(std::vector<const char *> &command_line_args, void *data) = 0; + +} * loader_impl_c_handle_base; + +typedef struct loader_impl_c_handle_file_type : loader_impl_c_handle_base_type +{ public: std::vector<std::string> files; - virtual ~loader_impl_c_handle_base_type() {} + virtual ~loader_impl_c_handle_file_type() {} virtual bool recursive_includes() = 0; @@ -89,6 +119,38 @@ typedef struct loader_impl_c_handle_base_type virtual const void *symbol(std::string &name) = 0; + int discover_visitor(std::vector<const char *> &command_line_args, void *data) + { + for (std::string file : this->files) + { + /* Define the command line arguments (simulating compiler flags) */ + CXIndex index = clang_createIndex(0, 1); + CXTranslationUnit unit = NULL; + CXErrorCode error = clang_parseTranslationUnit2( + index, + file.c_str(), + command_line_args.data(), command_line_args.size(), + nullptr, 0, + CXTranslationUnit_None, + &unit); + + if (error != CXError_Success) + { + log_write("metacall", LOG_LEVEL_ERROR, "Unable to parse translation unit of: %s with error code %d", file.c_str(), error); + clang_disposeIndex(index); + return -1; + } + + CXCursor cursor = clang_getTranslationUnitCursor(unit); + clang_visitChildren(cursor, c_loader_impl_discover_visitor, data); + + clang_disposeTranslationUnit(unit); + clang_disposeIndex(index); + } + + return 0; + } + void add(const loader_path path, size_t size) { if (this->is_ld_script(path, size) == false) @@ -118,12 +180,65 @@ typedef struct loader_impl_c_handle_base_type return true; } -} * loader_impl_c_handle_base; +} * loader_impl_c_handle_file; + +typedef struct loader_impl_c_handle_memory_type : loader_impl_c_handle_base_type +{ +public: + std::string name; + std::string buffer; + + virtual ~loader_impl_c_handle_memory_type() {} + + virtual bool recursive_includes() = 0; + + virtual int discover(loader_impl impl, context ctx) = 0; + + virtual const void *symbol(std::string &name) = 0; + + int discover_visitor(std::vector<const char *> &command_line_args, void *data) + { + CXUnsavedFile unsaved_file; + + /* Simulate an in-memory file */ + unsaved_file.Filename = this->name.c_str(); + unsaved_file.Contents = this->buffer.c_str(); + unsaved_file.Length = this->buffer.length(); + + /* Define the command line arguments (simulating compiler flags) */ + CXIndex index = clang_createIndex(0, 1); + CXTranslationUnit unit = NULL; + CXErrorCode error = clang_parseTranslationUnit2( + index, + this->name.c_str(), + command_line_args.data(), command_line_args.size(), + &unsaved_file, 1, + CXTranslationUnit_None, + &unit); + + if (error != CXError_Success) + { + log_write("metacall", LOG_LEVEL_ERROR, "Unable to parse translation unit of: %s with error code %d", this->name.c_str(), error); + clang_disposeIndex(index); + return -1; + } + + CXCursor cursor = clang_getTranslationUnitCursor(unit); + clang_visitChildren(cursor, c_loader_impl_discover_visitor, data); + + clang_disposeTranslationUnit(unit); + clang_disposeIndex(index); + + return 0; + } + +} * loader_impl_c_handle_memory; static void c_loader_impl_discover_symbols(void *ctx, const char *name, const void *addr); static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_base c_handle, context ctx); -typedef struct loader_impl_c_handle_tcc_type : loader_impl_c_handle_base_type +template <typename T> +struct loader_impl_c_handle_tcc_type : T { public: TCCState *state; @@ -207,7 +322,7 @@ typedef struct loader_impl_c_handle_tcc_type : loader_impl_c_handle_base_type virtual int discover(loader_impl impl, context ctx) { /* Get all symbols */ - tcc_list_symbols(this->state, static_cast<void *>(this), &c_loader_impl_discover_symbols); + tcc_list_symbols(this->state, static_cast<void *>(&symbols), &c_loader_impl_discover_symbols); /* Parse the AST and register functions */ return c_loader_impl_discover_ast(impl, this, ctx); @@ -222,10 +337,15 @@ typedef struct loader_impl_c_handle_tcc_type : loader_impl_c_handle_base_type return this->symbols[name]; } +}; + +typedef struct loader_impl_c_handle_tcc_type<loader_impl_c_handle_file_type> loader_impl_c_handle_tcc_file_type; +typedef loader_impl_c_handle_tcc_file_type *loader_impl_c_handle_tcc_file; -} * loader_impl_c_handle_tcc; +typedef struct loader_impl_c_handle_tcc_type<loader_impl_c_handle_memory_type> loader_impl_c_handle_tcc_memory_type; +typedef loader_impl_c_handle_tcc_memory_type *loader_impl_c_handle_tcc_memory; -typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_base_type +typedef struct loader_impl_c_handle_dynlink_type : loader_impl_c_handle_file_type { public: dynlink lib; @@ -385,15 +505,6 @@ typedef struct loader_impl_c_function_type } * loader_impl_c_function; -typedef struct c_loader_impl_discover_visitor_data_type -{ - loader_impl impl; - loader_impl_c_handle_base c_handle; - scope sp; - int result; - -} * c_loader_impl_discover_visitor_data; - /* Retrieve the equivalent FFI type from type id */ static ffi_type *c_loader_impl_ffi_type(type_id id); @@ -681,9 +792,9 @@ void c_loader_impl_function_closure(ffi_cif *cif, void *ret, void *args[], void static void c_loader_impl_discover_symbols(void *ctx, const char *name, const void *addr) { - loader_impl_c_handle_tcc c_handle = static_cast<loader_impl_c_handle_tcc>(ctx); + std::map<std::string, const void *> *symbols = static_cast<std::map<std::string, const void *> *>(ctx); - c_handle->symbols.insert(std::pair<std::string, const void *>(name, addr)); + symbols->insert(std::pair<std::string, const void *>(name, addr)); } static bool c_loader_impl_file_exists(const loader_path path) @@ -1305,7 +1416,7 @@ static int c_loader_impl_discover_signature(loader_impl impl, loader_impl_c_hand return 0; } -static CXChildVisitResult c_loader_impl_discover_visitor(CXCursor cursor, CXCursor, void *data) +CXChildVisitResult c_loader_impl_discover_visitor(CXCursor cursor, CXCursor, void *data) { c_loader_impl_discover_visitor_data visitor_data = static_cast<c_loader_impl_discover_visitor_data>(data); @@ -1353,91 +1464,9 @@ static int c_loader_impl_discover_ast(loader_impl impl, loader_impl_c_handle_bas command_line_args.push_back(includes.back().c_str()); } - /* TODO: Load from memory (discover from memory) */ - /* - #include <clang-c/Index.h> - #include <stdio.h> - #include <stdlib.h> - - int main() { - const char *source_code = - "int add(int a, int b) {\n" - " return a + b;\n" - "}"; - - // Simulate an in-memory file - CXUnsavedFile unsaved_file; - unsaved_file.Filename = "example.c"; - unsaved_file.Contents = source_code; - unsaved_file.Length = (unsigned long)strlen(source_code); - - // Create index - CXIndex index = clang_createIndex(0, 0); - - // Parse translation unit from buffer (unsaved file) - CXTranslationUnit tu; - CXErrorCode err = clang_parseTranslationUnit2( - index, - "example.c", // filename for context (matches unsaved file) - NULL, 0, // command line args - &unsaved_file, 1, // unsaved files - CXTranslationUnit_None, // options - &tu - ); - - if (err != CXError_Success) { - fprintf(stderr, "Failed to parse translation unit.\n"); - return 1; - } - - // Get the cursor to the root of the translation unit - CXCursor cursor = clang_getTranslationUnitCursor(tu); - - // Visit each AST node - clang_visitChildren( - cursor, - [](CXCursor c, CXCursor parent, CXClientData client_data) { - CXString spelling = clang_getCursorSpelling(c); - CXString kind = clang_getCursorKindSpelling(clang_getCursorKind(c)); - printf("Cursor: %s (%s)\n", clang_getCString(spelling), clang_getCString(kind)); - clang_disposeString(spelling); - clang_disposeString(kind); - return CXChildVisit_Recurse; - }, - NULL - ); - - // Clean up - clang_disposeTranslationUnit(tu); - clang_disposeIndex(index); - - return 0; - } - */ - - for (std::string file : c_handle->files) + if (c_handle->discover_visitor(command_line_args, static_cast<void *>(&data)) != 0) { - /* Define the command line arguments (simulating compiler flags) */ - CXIndex index = clang_createIndex(0, 1); - CXTranslationUnit unit = clang_parseTranslationUnit( - index, - file.c_str(), - command_line_args.data(), command_line_args.size(), - nullptr, 0, - CXTranslationUnit_None); - - if (unit == nullptr) - { - log_write("metacall", LOG_LEVEL_ERROR, "Unable to parse translation unit of: %s", file.c_str()); - clang_disposeIndex(index); - return -1; - } - - CXCursor cursor = clang_getTranslationUnitCursor(unit); - clang_visitChildren(cursor, c_loader_impl_discover_visitor, static_cast<void *>(&data)); - - clang_disposeTranslationUnit(unit); - clang_disposeIndex(index); + return 1; } return data.result; @@ -1455,7 +1484,7 @@ static int c_loader_impl_tcc_relocate(TCCState *state) loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path paths[], size_t size) { loader_impl_c c_impl = static_cast<loader_impl_c>(loader_impl_get(impl)); - loader_impl_c_handle_tcc c_handle = new loader_impl_c_handle_tcc_type(); + loader_impl_c_handle_tcc_file c_handle = new loader_impl_c_handle_tcc_file_type(); if (c_handle->initialize(c_impl) == false) { @@ -1522,7 +1551,7 @@ loader_handle c_loader_impl_load_from_file(loader_impl impl, const loader_path p loader_handle c_loader_impl_load_from_memory(loader_impl impl, const loader_name name, const char *buffer, size_t size) { loader_impl_c c_impl = static_cast<loader_impl_c>(loader_impl_get(impl)); - loader_impl_c_handle_tcc c_handle = new loader_impl_c_handle_tcc_type(); + loader_impl_c_handle_tcc_memory c_handle = new loader_impl_c_handle_tcc_memory_type(); /* Apparently TCC has an unsafe API for compiling strings */ (void)size; @@ -1544,7 +1573,9 @@ loader_handle c_loader_impl_load_from_memory(loader_impl impl, const loader_name goto error; } - /* TODO: Load the buffer with the parser while iterating after loading it with TCC */ + c_handle->name = name; + c_handle->name.append(".c"); + c_handle->buffer.assign(buffer, size); return c_handle; diff --git a/source/tests/metacall_c_test/source/metacall_c_test.cpp b/source/tests/metacall_c_test/source/metacall_c_test.cpp index b661e8b39..9b4bf3f6b 100644 --- a/source/tests/metacall_c_test/source/metacall_c_test.cpp +++ b/source/tests/metacall_c_test/source/metacall_c_test.cpp @@ -284,21 +284,21 @@ TEST_F(metacall_c_test, DefaultConstructor) metacall_value_destroy(args[0]); /* Memory */ - // TODO - // const char c_buffer[] = { - // "int compiled_mult(int a, int b) { return a * b; }" - // }; + { + const char c_buffer[] = { + "int compiled_mult_memory(int a, int b) { return a * b; }" + }; - // EXPECT_EQ((int)0, (int)metacall_load_from_memory("c", c_buffer, sizeof(c_buffer), NULL)); + EXPECT_EQ((int)0, (int)metacall_load_from_memory("c", c_buffer, sizeof(c_buffer), NULL)); - // TODO - // void *ret = metacall("compiled_mult", 3, 4); + void *ret = metacall("compiled_mult_memory", 3, 4); - // EXPECT_NE((void *)NULL, (void *)ret); + EXPECT_NE((void *)NULL, (void *)ret); - // EXPECT_EQ((int)metacall_value_to_int(ret), (int)0); + EXPECT_EQ((int)metacall_value_to_int(ret), (int)12); - // metacall_value_destroy(ret); + metacall_value_destroy(ret); + } /* References (Native) */ { From fce639c6fa420eb3aa041286f66b35c928de2013 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Fri, 5 Sep 2025 17:41:35 +0200 Subject: [PATCH 447/487] Solve issues in rust port. --- source/ports/rs_port/build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ports/rs_port/build.rs b/source/ports/rs_port/build.rs index 96502c30b..3ad13b15d 100644 --- a/source/ports/rs_port/build.rs +++ b/source/ports/rs_port/build.rs @@ -68,7 +68,7 @@ fn platform_install_paths() -> Result<InstallPath, Box<dyn std::error::Error>> { paths: vec![PathBuf::from(local_app_data) .join("MetaCall") .join("metacall")], - names: vec!["metacall.dll"], + names: vec!["metacall.lib"], }) } else if cfg!(target_os = "macos") { Ok(InstallPath { @@ -100,8 +100,8 @@ fn get_search_config() -> Result<InstallPath, Box<dyn std::error::Error>> { "libmetacalld.so", "libmetacall.dylib", "libmetacalld.dylib", - "metacall.dll", - "metacalld.dll", + "metacall.lib", + "metacalld.lib", ], }); } From 301d17ba86cbeb26ae916f5f3f8f8754bf9d034d Mon Sep 17 00:00:00 2001 From: Fahd Ashour <fahd.fady212@gmail.com> Date: Mon, 8 Sep 2025 23:26:20 +0300 Subject: [PATCH 448/487] remove usage of metacall::switch and some edits in Rust docs (#573) * remove usage of metacall::switch and some edits in Rust docs * edit rs_port readme to metacall 4.4 Signed-off-by: fahdfady <fahd.fady212@gmail.com> --------- Signed-off-by: fahdfady <fahd.fady212@gmail.com> --- source/ports/rs_port/README.md | 4 ++-- source/ports/rs_port/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/ports/rs_port/README.md b/source/ports/rs_port/README.md index 06f77ab06..8b9a5531c 100644 --- a/source/ports/rs_port/README.md +++ b/source/ports/rs_port/README.md @@ -26,11 +26,11 @@ export function sum(a: number, b: number): number { `main.rs` ``` rust -use metacall::{switch, metacall, loaders}; +use metacall::{initialize, metacall, load}; fn main() { // Initialize MetaCall at the top - let _metacall = switch::initialize().unwrap(); + let _metacall = initialize().unwrap(); // Load the file load::from_single_file("ts", "sum.ts").unwrap(); diff --git a/source/ports/rs_port/src/lib.rs b/source/ports/rs_port/src/lib.rs index 328236d57..3cfb34485 100644 --- a/source/ports/rs_port/src/lib.rs +++ b/source/ports/rs_port/src/lib.rs @@ -41,11 +41,11 @@ //! Now let's jump into Rust: //! //! ``` -//! use metacall::{switch, metacall, loaders}; +//! use metacall::{initialize, metacall, load}; //! //! fn main() { //! // Initialize MetaCall at the top -//! let _metacall = switch::initialize().unwrap(); +//! let _metacall = initialize().unwrap(); //! //! // Load the file (Checkout the loaders module for loading multiple files //! // or loading from string) From 6caae7aa6e4816bf7966331be0b40d5d5322cc6a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 8 Sep 2025 22:35:01 +0200 Subject: [PATCH 449/487] Upgrade rs_port version. --- source/ports/rs_port/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index 4779e08f0..c0ce796a1 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.4.4" +version = "0.5.0" [lib] crate-type = ["lib"] From 59eaec0c6b222d4ae0fa6ceef61474487723fa19 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 8 Sep 2025 23:00:36 +0200 Subject: [PATCH 450/487] Remove windows from rust ci. --- .github/workflows/release-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index 6d2f0897f..c06c473b8 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] # TODO: , windows-latest] steps: - name: Check out the repo uses: actions/checkout@v4 From fbb721bfced23ce137f64f943f61bfba43899d52 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Mon, 8 Sep 2025 23:05:31 +0200 Subject: [PATCH 451/487] Update rust ci. --- .github/workflows/release-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index c06c473b8..528eda6b7 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -49,7 +49,7 @@ jobs: name: Release Rust Port runs-on: ubuntu-latest needs: test - if: ${{ github.event_name != 'workflow_dispatch' && github.event_name != 'pull_request' }} + if: ${{ github.event_name != 'pull_request' }} steps: - name: Check out the repo uses: actions/checkout@v4 From 9073c1c3f62f4db8a470abdb185ae052562dd810 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 9 Sep 2025 21:53:35 +0200 Subject: [PATCH 452/487] Improved portability of rs port. --- source/ports/rs_port/build.rs | 41 +- source/ports/rs_port/src/bindings.rs | 1439 +++++++++++++++++++++++++- 2 files changed, 1470 insertions(+), 10 deletions(-) diff --git a/source/ports/rs_port/build.rs b/source/ports/rs_port/build.rs index 3ad13b15d..98e2596bf 100644 --- a/source/ports/rs_port/build.rs +++ b/source/ports/rs_port/build.rs @@ -173,6 +173,21 @@ fn find_metacall_library() -> Result<LibraryPath, Box<dyn std::error::Error>> { .into()) } +fn define_library_search_path(env_var: &str, separator: &str, path: &PathBuf) -> String { + // Get the current value of the env var, if any + let existing = env::var(env_var).unwrap_or_default(); + let path_str: String = String::from(path.to_str().unwrap()); + + // Append to it + let combined = if existing.is_empty() { + path_str + } else { + format!("{}{}{}", existing, separator, path_str) + }; + + format!("{}={}", env_var, combined) +} + fn main() { // When running tests from CMake if let Ok(val) = env::var("PROJECT_OUTPUT_DIR") { @@ -203,19 +218,27 @@ fn main() { // Set the runtime environment variable for finding the library during tests #[cfg(target_os = "linux")] - println!( - "cargo:rustc-env=LD_LIBRARY_PATH={}", - lib_path.path.display() - ); + const ENV_VAR: &str = "LD_LIBRARY_PATH"; #[cfg(target_os = "macos")] - println!( - "cargo:rustc-env=DYLD_LIBRARY_PATH={}", - lib_path.path.display() - ); + const ENV_VAR: &str = "DYLD_LIBRARY_PATH"; #[cfg(target_os = "windows")] - println!("cargo:rustc-env=PATH={}", lib_path.path.display()); + const ENV_VAR: &str = "PATH"; + + #[cfg(target_os = "aix")] + const ENV_VAR: &str = "LIBPATH"; + + #[cfg(any(target_os = "linux", target_os = "macos", target_os = "aix"))] + const SEPARATOR: &str = ":"; + + #[cfg(target_os = "windows")] + const SEPARATOR: &str = ";"; + + println!( + "cargo:rustc-env={}", + define_library_search_path(ENV_VAR, SEPARATOR, &lib_path.path) + ); } Err(e) => { // Print the error diff --git a/source/ports/rs_port/src/bindings.rs b/source/ports/rs_port/src/bindings.rs index 7222ae744..04c9be017 100644 --- a/source/ports/rs_port/src/bindings.rs +++ b/source/ports/rs_port/src/bindings.rs @@ -1,3 +1,1440 @@ /* automatically generated by rust-bindgen 0.71.1 */ -pub type __pid_t = :: std :: os :: raw :: c_int ; pub type pid_t = __pid_t ; # [repr (u32)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum metacall_allocator_id { METACALL_ALLOCATOR_STD = 0 , METACALL_ALLOCATOR_NGINX = 1 , } unsafe extern "C" { # [doc = " @brief\n Create an allocator instance\n\n @param[in] allocator_id\n Type of allocator to be created\n\n @param[in] ctx\n Context of the allocator\n\n @return\n Pointer to allocator if success, null otherwise"] pub fn metacall_allocator_create (allocator_id : metacall_allocator_id , ctx : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Reserve memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] size\n Size in bytes to be allocated\n\n @return\n Pointer to allocated data on success, null otherwise"] pub fn metacall_allocator_alloc (allocator : * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Reallocate memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Original pointer to data\n\n @param[in] size\n Original size in bytes\n\n @param[in] new_size\n New size in bytes to be reallocated\n\n @return\n Pointer to new reallocated data on success, null otherwise"] pub fn metacall_allocator_realloc (allocator : * mut :: std :: os :: raw :: c_void , data : * mut :: std :: os :: raw :: c_void , size : usize , new_size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Free memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Pointer to data to be freed"] pub fn metacall_allocator_free (allocator : * mut :: std :: os :: raw :: c_void , data : * mut :: std :: os :: raw :: c_void) ; } unsafe extern "C" { # [doc = " @brief\n Destroy an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance"] pub fn metacall_allocator_destroy (allocator : * mut :: std :: os :: raw :: c_void) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct metacall_exception_type { pub message : * const :: std :: os :: raw :: c_char , pub label : * const :: std :: os :: raw :: c_char , pub code : i64 , pub stacktrace : * const :: std :: os :: raw :: c_char , } # [allow (clippy :: unnecessary_operation , clippy :: identity_op)] const _ : () = { ["Size of metacall_exception_type"] [:: std :: mem :: size_of :: < metacall_exception_type > () - 32usize] ; ["Alignment of metacall_exception_type"] [:: std :: mem :: align_of :: < metacall_exception_type > () - 8usize] ; ["Offset of field: metacall_exception_type::message"] [:: std :: mem :: offset_of ! (metacall_exception_type , message) - 0usize] ; ["Offset of field: metacall_exception_type::label"] [:: std :: mem :: offset_of ! (metacall_exception_type , label) - 8usize] ; ["Offset of field: metacall_exception_type::code"] [:: std :: mem :: offset_of ! (metacall_exception_type , code) - 16usize] ; ["Offset of field: metacall_exception_type::stacktrace"] [:: std :: mem :: offset_of ! (metacall_exception_type , stacktrace) - 24usize] ; } ; pub type metacall_exception = * mut metacall_exception_type ; unsafe extern "C" { # [doc = " @brief\n Create an throwable value from an exception with a simple API in a single instruction\n\n @param[in] label\n Label of the exception\n\n @param[in] code\n Error code of the exception\n\n @param[in] stacktrace\n Stack trace of the exception\n\n @param[in] message\n Message of the exception to be formatted with the variable arguments\n\n @param[in] va_args\n Arguments for formatting the message\n\n @return\n The value of type throwable containing the exception created"] pub fn metacall_error_throw (label : * const :: std :: os :: raw :: c_char , code : i64 , stacktrace : * const :: std :: os :: raw :: c_char , message : * const :: std :: os :: raw :: c_char , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Retrieve the exception from a value, it can be either a throwable value with an exception inside or an exception itself\n\n @param[in] v\n Value that represents the exception to be retrieved\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to @v\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_error_from_value (v : * mut :: std :: os :: raw :: c_void , ex : metacall_exception) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Retrieve last error that has happened after a call to any API from MetaCall\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to the internal MetaCall exception\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_error_last (ex : metacall_exception) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Clear last error that has happened after a call to any API from MetaCall"] pub fn metacall_error_clear () ; } unsafe extern "C" { # [doc = " @brief\n Initialize link detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_link_initialize () -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_link_register (tag : * const :: std :: os :: raw :: c_char , library : * const :: std :: os :: raw :: c_char , symbol : * const :: std :: os :: raw :: c_char , fn_ : :: std :: option :: Option < unsafe extern "C" fn () >) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] loader\n Pointer to the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_link_register_loader (loader : * mut :: std :: os :: raw :: c_void , library : * const :: std :: os :: raw :: c_char , symbol : * const :: std :: os :: raw :: c_char , fn_ : :: std :: option :: Option < unsafe extern "C" fn () >) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Remove the hook previously registered\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_link_unregister (tag : * const :: std :: os :: raw :: c_char , library : * const :: std :: os :: raw :: c_char , symbol : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Unregister link detours and destroy shared memory"] pub fn metacall_link_destroy () ; } # [repr (u32)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum metacall_log_id { METACALL_LOG_STDIO = 0 , METACALL_LOG_FILE = 1 , METACALL_LOG_SOCKET = 2 , METACALL_LOG_SYSLOG = 3 , METACALL_LOG_NGINX = 4 , METACALL_LOG_CUSTOM = 5 , } unsafe extern "C" { # [doc = " @brief\n Create a log instance\n\n @param[in] log_id\n Type of log to be created\n\n @param[in] ctx\n Context of the log (a pointer to metacall_log_{stdio, file, socket, syslog, nginx, custom}_type)\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_log (log_id : metacall_log_id , ctx : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } # [repr (u32)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum metacall_value_id { METACALL_BOOL = 0 , METACALL_CHAR = 1 , METACALL_SHORT = 2 , METACALL_INT = 3 , METACALL_LONG = 4 , METACALL_FLOAT = 5 , METACALL_DOUBLE = 6 , METACALL_STRING = 7 , METACALL_BUFFER = 8 , METACALL_ARRAY = 9 , METACALL_MAP = 10 , METACALL_PTR = 11 , METACALL_FUTURE = 12 , METACALL_FUNCTION = 13 , METACALL_NULL = 14 , METACALL_CLASS = 15 , METACALL_OBJECT = 16 , METACALL_EXCEPTION = 17 , METACALL_THROWABLE = 18 , METACALL_SIZE = 19 , METACALL_INVALID = 20 , } unsafe extern "C" { # [doc = " @brief\n Create a value from boolean @b\n\n @param[in] b\n Boolean will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_bool (b : :: std :: os :: raw :: c_uchar) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from char @c\n\n @param[in] c\n Character will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_char (c : :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from short @s\n\n @param[in] s\n Short will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_short (s : :: std :: os :: raw :: c_short) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from integer @i\n\n @param[in] i\n Integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_int (i : :: std :: os :: raw :: c_int) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from long @l\n\n @param[in] l\n Long integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_long (l : :: std :: os :: raw :: c_long) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from single precision floating point number @f\n\n @param[in] f\n Float will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_float (f : f32) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from double precision floating point number @d\n\n @param[in] d\n Double will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_double (d : f64) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from a C string @str\n\n @param[in] str\n Constant string will be copied into value (needs to be null terminated)\n\n @param[in] length\n Length of the constant string\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_string (str_ : * const :: std :: os :: raw :: c_char , length : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value buffer from array @buffer\n\n @param[in] buffer\n Constant memory block will be copied into value array\n\n @param[in] size\n Size in bytes of data contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_buffer (buffer : * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value array from array of values @values\n\n @param[in] values\n Constant array of values will be copied into value list\n\n @param[in] size\n Number of elements contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_array (values : * mut * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value map from array of tuples @map\n\n @param[in] tuples\n Constant array of tuples will be copied into value map\n\n @param[in] size\n Number of elements contained in the map\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_map (tuples : * mut * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from pointer @ptr\n\n @param[in] ptr\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_ptr (ptr : * const :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from future @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_future (f : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from function @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_function (f : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from function @f binding a closure @c to it\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @param[in] c\n Pointer to closure that will be binded into function @f\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_function_closure (f : * mut :: std :: os :: raw :: c_void , c : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value of type null\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_null () -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from class @c\n\n @param[in] c\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_class (c : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from object @o\n\n @param[in] o\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_object (o : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from exception @ex\n\n @param[in] ex\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_exception (ex : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a value from throwable @th\n\n @param[in] th\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] pub fn metacall_value_create_throwable (th : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Returns the size of the value\n\n @param[in] v\n Reference to the value\n\n @return\n Size in bytes of the value"] pub fn metacall_value_size (v : * mut :: std :: os :: raw :: c_void) -> usize ; } unsafe extern "C" { # [doc = " @brief\n Returns the amount of values this value contains\n\n @param[in] v\n Reference to the value\n\n @return\n Number of values @v represents"] pub fn metacall_value_count (v : * mut :: std :: os :: raw :: c_void) -> usize ; } unsafe extern "C" { # [doc = " @brief\n Provide type id of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return type id assigned to value"] pub fn metacall_value_id (v : * mut :: std :: os :: raw :: c_void) -> metacall_value_id ; } unsafe extern "C" { # [doc = " @brief\n Provide type id in a readable form (as string) of a type id\n\n @param[in] id\n Value type identifier\n\n @return\n Return string related to the type id"] pub fn metacall_value_id_name (id : metacall_value_id) -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide type id in a readable form (as string) of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return string related to the type id assigned to value"] pub fn metacall_value_type_name (v : * mut :: std :: os :: raw :: c_void) -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Deep copies the value @v, the result copy resets\n the reference counter and ownership, including the finalizer\n\n @param[in] v\n Reference to the value to be copied\n\n @return\n Copy of the value @v on success, null otherwhise"] pub fn metacall_value_copy (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Creates a new pointer value, with a reference to the\n data contained inside the value @v. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n\n In this case, void *ptr is a value equivalent to int*,\n and it points directly to the integer contained in void *v.\n Note that if we destroy the value @v, the reference will\n point to already freed memory, causing use-after-free when used.\n\n @param[in] v\n Reference to the value to be referenced\n\n @return\n A new value of type pointer, pointing to the @v data"] pub fn metacall_value_reference (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n If you pass a reference previously created (i.e a value of\n type pointer, pointing to another value), it returns the\n original value. It does not modify the memory of the values\n neither allocates anything. If the value @v is pointing to\n has been deleted, it will cause an use-after-free. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n void *w = metacall_value_dereference(ptr);\n assert(v == w); // Both are the same value\n\n @param[in] v\n Reference to the value to be dereferenced\n\n @return\n The value containing the data which ptr is pointing to"] pub fn metacall_value_dereference (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Copies the ownership from @src to @dst, including the finalizer,\n and resets the owner and finalizer of @src\n\n @param[in] src\n Source value which will lose the ownership\n\n @param[in] dst\n Destination value which will recieve the ownership"] pub fn metacall_value_move (src : * mut :: std :: os :: raw :: c_void , dest : * mut :: std :: os :: raw :: c_void) ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to boolean\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to boolean"] pub fn metacall_value_to_bool (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_uchar ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to char\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to char"] pub fn metacall_value_to_char (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to short\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to short"] pub fn metacall_value_to_short (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_short ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to integer"] pub fn metacall_value_to_int (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to long integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to long integer"] pub fn metacall_value_to_long (v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_long ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to single precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to float"] pub fn metacall_value_to_float (v : * mut :: std :: os :: raw :: c_void) -> f32 ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to double precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to dobule"] pub fn metacall_value_to_double (v : * mut :: std :: os :: raw :: c_void) -> f64 ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to string\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to C string (null terminated)"] pub fn metacall_value_to_string (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to buffer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to memory block"] pub fn metacall_value_to_buffer (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to array of values\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to array of values"] pub fn metacall_value_to_array (v : * mut :: std :: os :: raw :: c_void) -> * mut * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to map\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to map (array of tuples (array of values))"] pub fn metacall_value_to_map (v : * mut :: std :: os :: raw :: c_void) -> * mut * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to pointer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to pointer"] pub fn metacall_value_to_ptr (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to future\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to future"] pub fn metacall_value_to_future (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to function\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to function"] pub fn metacall_value_to_function (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to null\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to null"] pub fn metacall_value_to_null (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to class\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to class"] pub fn metacall_value_to_class (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to object\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to object"] pub fn metacall_value_to_object (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to exception\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to exception"] pub fn metacall_value_to_exception (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v to throwable\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to throwable"] pub fn metacall_value_to_throwable (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign boolean @b to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] b\n Boolean to be assigned to value @v\n\n @return\n Value with boolean @b assigned to it"] pub fn metacall_value_from_bool (v : * mut :: std :: os :: raw :: c_void , b : :: std :: os :: raw :: c_uchar) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign character @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Character to be assigned to value @v\n\n @return\n Value with char @c assigned to it"] pub fn metacall_value_from_char (v : * mut :: std :: os :: raw :: c_void , c : :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign short @s to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] s\n Short to be assigned to value @v\n\n @return\n Value with short @s assigned to it"] pub fn metacall_value_from_short (v : * mut :: std :: os :: raw :: c_void , s : :: std :: os :: raw :: c_short) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign integer @i to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] i\n Integer to be assigned to value @v\n\n @return\n Value with integer @i assigned to it"] pub fn metacall_value_from_int (v : * mut :: std :: os :: raw :: c_void , i : :: std :: os :: raw :: c_int) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign long integer @l to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] l\n Long integer to be assigned to value @v\n\n @return\n Value with long @l assigned to it"] pub fn metacall_value_from_long (v : * mut :: std :: os :: raw :: c_void , l : :: std :: os :: raw :: c_long) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign single precision floating point @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Float to be assigned to value @v\n\n @return\n Value with float @f assigned to it"] pub fn metacall_value_from_float (v : * mut :: std :: os :: raw :: c_void , f : f32) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign double precision floating point @d to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] d\n Double to be assigned to value @v\n\n @return\n Value with double @d assigned to it"] pub fn metacall_value_from_double (v : * mut :: std :: os :: raw :: c_void , d : f64) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign string @str to value @v, truncates to @v size if it is smaller\n than @length + 1. It does not add null terminator if truncated.\n\n @param[in] v\n Reference to the value\n\n @param[in] str\n Constant string to be assigned to value @v (it needs to be null terminated)\n\n @param[in] length\n Length of the constant string @str\n\n @return\n Value with string @str assigned to it"] pub fn metacall_value_from_string (v : * mut :: std :: os :: raw :: c_void , str_ : * const :: std :: os :: raw :: c_char , length : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign array @buffer to value buffer @v\n\n @param[in] v\n Reference to the value\n\n @param[in] buffer\n Constant array to be assigned to value @v\n\n @param[in] size\n Number of elements contained in @buffer\n\n @return\n Value with array @buffer assigned to it"] pub fn metacall_value_from_buffer (v : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign array of values @values to value array @v\n\n @param[in] v\n Reference to the value\n\n @param[in] values\n Constant array of values to be assigned to value array @v\n\n @param[in] size\n Number of values contained in constant array @values\n\n @return\n Value with array of values @values assigned to it"] pub fn metacall_value_from_array (v : * mut :: std :: os :: raw :: c_void , values : * mut * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign array of values @values to value map @v\n\n @param[in] v\n Reference to the value\n\n @param[in] tuples\n Constant array of tuples to be assigned to value map @v\n\n @param[in] size\n Number of values contained in constant array @tuples\n\n @return\n Value with array of tuples @tuples assigned to it"] pub fn metacall_value_from_map (v : * mut :: std :: os :: raw :: c_void , tuples : * mut * const :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign pointer reference @ptr to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ptr\n Pointer to be assigned to value @v\n\n @return\n Value with pointer @ptr assigned to it"] pub fn metacall_value_from_ptr (v : * mut :: std :: os :: raw :: c_void , ptr : * const :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign future @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Future to be assigned to value @v\n\n @return\n Value with future @f assigned to it"] pub fn metacall_value_from_future (v : * mut :: std :: os :: raw :: c_void , f : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign function @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Function to be assigned to value @v\n\n @return\n Value with function @f assigned to it"] pub fn metacall_value_from_function (v : * mut :: std :: os :: raw :: c_void , f : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign null to value @v\n\n @param[in] v\n Reference to the value\n\n @return\n Value with null assigned to it"] pub fn metacall_value_from_null (v : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign class @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Class to be assigned to value @v\n\n @return\n Value with class @c assigned to it"] pub fn metacall_value_from_class (v : * mut :: std :: os :: raw :: c_void , c : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign object @o to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] o\n Object to be assigned to value @v\n\n @return\n Value with object @o assigned to it"] pub fn metacall_value_from_object (v : * mut :: std :: os :: raw :: c_void , o : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign exception @ex to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ex\n Exception to be assigned to value @v\n\n @return\n Value with exception @ex assigned to it"] pub fn metacall_value_from_exception (v : * mut :: std :: os :: raw :: c_void , ex : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Assign throwable @th to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] th\n Throwable to be assigned to value @v\n\n @return\n Value with throwable @th assigned to it"] pub fn metacall_value_from_throwable (v : * mut :: std :: os :: raw :: c_void , th : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Casts a value to a new type @id\n\n @param[in] v\n Reference to the value\n\n @param[in] id\n New type id of value to be casted\n\n @return\n Casted value or reference to @v if casting is between equivalent types"] pub fn metacall_value_cast (v : * mut :: std :: os :: raw :: c_void , id : metacall_value_id) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to boolean\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to boolean"] pub fn metacall_value_cast_bool (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_uchar ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to char\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to char"] pub fn metacall_value_cast_char (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to short\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to short"] pub fn metacall_value_cast_short (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_short ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to int\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to int"] pub fn metacall_value_cast_int (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to long\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to long"] pub fn metacall_value_cast_long (v : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_long ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to float\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to float"] pub fn metacall_value_cast_float (v : * mut * mut :: std :: os :: raw :: c_void) -> f32 ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to double\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to double"] pub fn metacall_value_cast_double (v : * mut * mut :: std :: os :: raw :: c_void) -> f64 ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to string\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to a C string (null terminated)"] pub fn metacall_value_cast_string (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to buffer\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to buffer"] pub fn metacall_value_cast_buffer (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to array\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to array of values"] pub fn metacall_value_cast_array (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to map\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to map"] pub fn metacall_value_cast_map (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to ptr\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to ptr"] pub fn metacall_value_cast_ptr (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to future\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to future"] pub fn metacall_value_cast_future (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to function\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to function"] pub fn metacall_value_cast_function (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to null\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to null"] pub fn metacall_value_cast_null (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to class\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to class"] pub fn metacall_value_cast_class (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to object\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to object"] pub fn metacall_value_cast_object (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to exception\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to exception"] pub fn metacall_value_cast_exception (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert value @v implicitly to throwable\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to throwable"] pub fn metacall_value_cast_throwable (v : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Destroy a value from scope stack\n\n @param[in] v\n Reference to the value"] pub fn metacall_value_destroy (v : * mut :: std :: os :: raw :: c_void) ; } pub type metacall_pid = pid_t ; pub type metacall_pre_fork_callback_ptr = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int > ; pub type metacall_post_fork_callback_ptr = :: std :: option :: Option < unsafe extern "C" fn (arg1 : metacall_pid , arg2 : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int > ; unsafe extern "C" { # [doc = " @brief\n Initialize fork detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_fork_initialize () -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Set fork hook callback\n\n @param[in] pre_callback\n Callback to be called before fork detour is executed\n\n @param[in] post_callback\n Callback to be called after fork detour is executed"] pub fn metacall_fork (pre_callback : metacall_pre_fork_callback_ptr , post_callback : metacall_post_fork_callback_ptr) ; } unsafe extern "C" { # [doc = " @brief\n Unregister fork detours and destroy shared memory"] pub fn metacall_fork_destroy () ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct metacall_initialize_configuration_type { pub tag : * const :: std :: os :: raw :: c_char , pub options : * mut :: std :: os :: raw :: c_void , } # [allow (clippy :: unnecessary_operation , clippy :: identity_op)] const _ : () = { ["Size of metacall_initialize_configuration_type"] [:: std :: mem :: size_of :: < metacall_initialize_configuration_type > () - 16usize] ; ["Alignment of metacall_initialize_configuration_type"] [:: std :: mem :: align_of :: < metacall_initialize_configuration_type > () - 8usize] ; ["Offset of field: metacall_initialize_configuration_type::tag"] [:: std :: mem :: offset_of ! (metacall_initialize_configuration_type , tag) - 0usize] ; ["Offset of field: metacall_initialize_configuration_type::options"] [:: std :: mem :: offset_of ! (metacall_initialize_configuration_type , options) - 8usize] ; } ; pub type metacall_await_callback = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct metacall_await_callbacks_type { pub resolve : metacall_await_callback , pub reject : metacall_await_callback , } # [allow (clippy :: unnecessary_operation , clippy :: identity_op)] const _ : () = { ["Size of metacall_await_callbacks_type"] [:: std :: mem :: size_of :: < metacall_await_callbacks_type > () - 16usize] ; ["Alignment of metacall_await_callbacks_type"] [:: std :: mem :: align_of :: < metacall_await_callbacks_type > () - 8usize] ; ["Offset of field: metacall_await_callbacks_type::resolve"] [:: std :: mem :: offset_of ! (metacall_await_callbacks_type , resolve) - 0usize] ; ["Offset of field: metacall_await_callbacks_type::reject"] [:: std :: mem :: offset_of ! (metacall_await_callbacks_type , reject) - 8usize] ; } ; pub type metacall_await_callbacks = metacall_await_callbacks_type ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct metacall_version_type { pub major : :: std :: os :: raw :: c_uint , pub minor : :: std :: os :: raw :: c_uint , pub patch : :: std :: os :: raw :: c_uint , pub revision : * const :: std :: os :: raw :: c_char , pub str_ : * const :: std :: os :: raw :: c_char , pub name : * const :: std :: os :: raw :: c_char , } # [allow (clippy :: unnecessary_operation , clippy :: identity_op)] const _ : () = { ["Size of metacall_version_type"] [:: std :: mem :: size_of :: < metacall_version_type > () - 40usize] ; ["Alignment of metacall_version_type"] [:: std :: mem :: align_of :: < metacall_version_type > () - 8usize] ; ["Offset of field: metacall_version_type::major"] [:: std :: mem :: offset_of ! (metacall_version_type , major) - 0usize] ; ["Offset of field: metacall_version_type::minor"] [:: std :: mem :: offset_of ! (metacall_version_type , minor) - 4usize] ; ["Offset of field: metacall_version_type::patch"] [:: std :: mem :: offset_of ! (metacall_version_type , patch) - 8usize] ; ["Offset of field: metacall_version_type::revision"] [:: std :: mem :: offset_of ! (metacall_version_type , revision) - 16usize] ; ["Offset of field: metacall_version_type::str_"] [:: std :: mem :: offset_of ! (metacall_version_type , str_) - 24usize] ; ["Offset of field: metacall_version_type::name"] [:: std :: mem :: offset_of ! (metacall_version_type , name) - 32usize] ; } ; unsafe extern "C" { # [doc = " @brief\n Returns default serializer used by MetaCall\n\n @return\n Name of the serializer to be used with serialization methods"] pub fn metacall_serial () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Returns default detour used by MetaCall\n\n @return\n Name of the detour to be used with detouring methods"] pub fn metacall_detour () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Disables MetaCall logs, must be called before @metacall_initialize.\n\n When initializing MetaCall, it initializes a default logs to stdout\n if none was defined. If you want to benchmark or simply disable this\n default logs, you can call to this function before @metacall_initialize."] pub fn metacall_log_null () ; } unsafe extern "C" { # [doc = " @brief\n Flags to be set in MetaCall library\n\n @param[in] flags\n Combination of flags referring to definitions METACALL_FLAGS_*"] pub fn metacall_flags (flags : :: std :: os :: raw :: c_int) ; } unsafe extern "C" { # [doc = " @brief\n Initialize MetaCall library\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_initialize () -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Initialize MetaCall library with configuration arguments\n\n @param[in] initialize_config\n Extension of the script to be loaded in memory with data to be injected\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_initialize_ex (initialize_config : * mut metacall_initialize_configuration_type) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Initialize MetaCall application arguments\n\n @param[in] argc\n Number of additional parameters to be passed to the runtime when initializing\n\n @param[in] argv\n Additional parameters to be passed to the runtime when initializing (when using MetaCall as an application)"] pub fn metacall_initialize_args (argc : :: std :: os :: raw :: c_int , argv : * mut * mut :: std :: os :: raw :: c_char) ; } unsafe extern "C" { # [doc = " @brief\n Get the number of arguments in which MetaCall was initialized\n\n @return\n An integer equal or greater than zero"] pub fn metacall_argc () -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the arguments in which MetaCall was initialized\n\n @return\n A pointer to an array of strings with the additional arguments"] pub fn metacall_argv () -> * mut * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Check if script context is loaded by @tag\n\n @param[in] tag\n Extension of the script (if tag is NULL, it returns the status of the whole MetaCall instance)\n\n @return\n Zero if context is initialized, different from zero otherwise"] pub fn metacall_is_initialized (tag : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Amount of function call arguments supported by MetaCall\n\n @return\n Number of arguments suported"] pub fn metacall_args_size () -> usize ; } unsafe extern "C" { # [doc = " @brief\n Set a execution path defined by @path to the extension script @tag\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path to be loaded\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_execution_path (tag : * const :: std :: os :: raw :: c_char , path : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Set a execution path defined by @path to the extension script @tag with length\n\n @param[in] tag\n Extension of the script\n\n @param[in] tag_length\n Length of the extension of the tag\n\n @param[in] path\n Path to be loaded\n\n @param[in] path_length\n Length of the path\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_execution_path_s (tag : * const :: std :: os :: raw :: c_char , tag_length : usize , path : * const :: std :: os :: raw :: c_char , path_length : usize) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Loads a script from file specified by @path\n\n @param[in] tag\n Extension of the script\n\n @param[in] paths\n Path array of files\n\n @param[in] size\n Size of the array @paths\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_file (tag : * const :: std :: os :: raw :: c_char , paths : * mut * const :: std :: os :: raw :: c_char , size : usize , handle : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Loads a script from memory\n\n @param[in] tag\n Extension of the script\n\n @param[in] buffer\n Memory block representing the string of the script\n\n @param[in] size\n Memory block representing the string of the script\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_memory (tag : * const :: std :: os :: raw :: c_char , buffer : * const :: std :: os :: raw :: c_char , size : usize , handle : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Loads a package of scrips from file specified by @path into loader defined by @extension\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path of the package\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_package (tag : * const :: std :: os :: raw :: c_char , path : * const :: std :: os :: raw :: c_char , handle : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Loads a a list of scrips from configuration specified by @path into loader\n with the following format:\n {\n \"language_id\": \"<tag>\",\n \"path\": \"<path>\",\n \"scripts\": [ \"<script0>\", \"<script1>\", ..., \"<scriptN>\" ]\n }\n\n @param[in] path\n Path of the configuration\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @param[in] allocator\n Pointer to allocator will allocate the configuration\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_load_from_configuration (path : * const :: std :: os :: raw :: c_char , handle : * mut * mut :: std :: os :: raw :: c_void , allocator : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv (name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_s (name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallhv (handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n Includes @size in order to allow variadic arguments or safe calls\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallhv_s (handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall (name : * const :: std :: os :: raw :: c_char , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt (name : * const :: std :: os :: raw :: c_char , ids : * const metacall_value_id , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_s (name : * const :: std :: os :: raw :: c_char , ids : * const metacall_value_id , size : usize , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallht_s (handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , ids : * const metacall_value_id , size : usize , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the function by @name\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] pub fn metacall_function (name : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create an empty handler into a loader with name @name\n\n @param[in] loader\n Pointer to the loader which the handle belongs to\n\n @param[in] name\n Name of the handle\n\n @param[out] handle_ptr\n On success, returns the pointer to the handle created, otherwise NULL\n\n @return\n Return zero on success, different from zero on error"] pub fn metacall_handle_initialize (loader : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , handle_ptr : * mut * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Populate the objects of @handle_src into @handle_dest\n\n @param[inout] handle_dest\n Handle where the objects from @handle_src will be stored\n\n @param[in] handle_src\n Handle from where the objects will be copied\n\n @return\n Return zero on success, different from zero on error"] pub fn metacall_handle_populate (handle_dest : * mut :: std :: os :: raw :: c_void , handle_src : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the function by @name from @handle\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] pub fn metacall_handle_function (handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the function parameter type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n @param[in] parameter\n The index of the parameter to be retrieved\n\n @param[out] id\n The parameter type id that will be returned\n\n @return\n Return 0 if the @parameter index exists and @func is valid, 1 otherwhise"] pub fn metacall_function_parameter_type (func : * mut :: std :: os :: raw :: c_void , parameter : usize , id : * mut metacall_value_id) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the function return type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n\n @param[out] id\n The value id of the return type of the function @func\n\n @return\n Return 0 if the @func is valid, 1 otherwhise"] pub fn metacall_function_return_type (func : * mut :: std :: os :: raw :: c_void , id : * mut metacall_value_id) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get minimun mumber of arguments accepted by function @func\n\n @param[in] func\n Function reference\n\n @return\n Return mumber of arguments"] pub fn metacall_function_size (func : * mut :: std :: os :: raw :: c_void) -> usize ; } unsafe extern "C" { # [doc = " @brief\n Check if the function @func is asynchronous or synchronous\n\n @param[in] func\n Function reference\n\n @return\n Return 0 if it is syncrhonous, 1 if it is asynchronous and -1 if the function is NULL"] pub fn metacall_function_async (func : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the handle by @name\n\n @param[in] tag\n Extension of the script\n\n @param[in] name\n Name of the handle\n\n @return\n Handle reference, null if the function does not exist"] pub fn metacall_handle (tag : * const :: std :: os :: raw :: c_char , name : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get name of a @handle\n\n @param[in] handle\n Pointer to the handle to be retrieved\n\n @return\n String that references the handle"] pub fn metacall_handle_id (handle : * mut :: std :: os :: raw :: c_void) -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Return a value representing the handle as a map of functions (or values)\n\n @param[in] handle\n Reference to the handle to be described\n\n @return\n A value of type map on success, null otherwise"] pub fn metacall_handle_export (handle : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfv (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of function arguments\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfv_s (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by variable arguments @va_args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallf (func : * mut :: std :: os :: raw :: c_void , ...) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfs (func : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfmv (func : * mut :: std :: os :: raw :: c_void , keys : * mut * mut :: std :: os :: raw :: c_void , values : * mut * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallfms (func : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Register a function by name @name and arguments @va_args\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] va_args\n Varidic function parameter types\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall_register (name : * const :: std :: os :: raw :: c_char , invoke : :: std :: option :: Option < unsafe extern "C" fn (arg1 : usize , arg2 : * mut * mut :: std :: os :: raw :: c_void , arg3 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , func : * mut * mut :: std :: os :: raw :: c_void , return_type : metacall_value_id , size : usize , ...) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Pointer to value containing the result of the call"] pub fn metacall_registerv (name : * const :: std :: os :: raw :: c_char , invoke : :: std :: option :: Option < unsafe extern "C" fn (arg1 : usize , arg2 : * mut * mut :: std :: os :: raw :: c_void , arg3 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , func : * mut * mut :: std :: os :: raw :: c_void , return_type : metacall_value_id , size : usize , types : * mut metacall_value_id) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Obtain the loader instance by @tag\n\n @param[in] tag\n Tag in which the loader is identified, normally it is the extension of the script\n\n @return\n Pointer the loader by @tag"] pub fn metacall_loader (tag : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] loader\n Opaque pointer to the loader in which you want to register the function (this allows to register the function into a different loader than the host)\n\n @param[in] handle\n Opaque pointer to the handle in which you want to register the function (if it is NULL, it will be defined on the global scope of the loader)\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Zero if the function was registered properly, distinct from zero otherwise"] pub fn metacall_register_loaderv (loader : * mut :: std :: os :: raw :: c_void , handle : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , invoke : :: std :: option :: Option < unsafe extern "C" fn (arg1 : usize , arg2 : * mut * mut :: std :: os :: raw :: c_void , arg3 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , return_type : metacall_value_id , size : usize , types : * mut metacall_value_id) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await (name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Awaits for a promise and registers a callback to be executed when a future is resolved\n\n @param[in] f\n The pointer to the future\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await_future (f : * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacall_await_s (name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await_s (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void , size : usize , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func (offered without function pointers for languages without support to function pointers)\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] cb\n Pointer to struct containing the function pointers to reject and resolve that will be executed when task completion or error\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfv_await_struct_s (func : * mut :: std :: os :: raw :: c_void , args : * mut * mut :: std :: os :: raw :: c_void , size : usize , cb : metacall_await_callbacks , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] size\n Number of elements of the arrays @keys and @values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfmv_await (func : * mut :: std :: os :: raw :: c_void , keys : * mut * mut :: std :: os :: raw :: c_void , values : * mut * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfmv_await_s (func : * mut :: std :: os :: raw :: c_void , keys : * mut * mut :: std :: os :: raw :: c_void , values : * mut * mut :: std :: os :: raw :: c_void , size : usize , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfs_await (func : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] pub fn metacallfms_await (func : * mut :: std :: os :: raw :: c_void , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void , resolve_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , reject_callback : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: std :: os :: raw :: c_void , arg2 : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void > , data : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the class by @name\n\n @param[in] name\n Name of the class\n\n @return\n Class reference, null if the class does not exist"] pub fn metacall_class (name : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a class method anonymously by value array @args (this procedure assumes there's no overloaded methods and does type conversion on values)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_class (cls : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a class method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_class (cls : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , ret : metacall_value_id , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Create a new object instance from @cls by value array @args\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the new object\n\n @param[in] args\n Array of pointers constructor parameters\n\n @param[in] size\n Number of elements of constructor parameters\n\n @return\n Pointer to the new object value instance"] pub fn metacall_class_new (cls : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get an attribute from @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the class attribute value or NULL if an error occurred"] pub fn metacall_class_static_get (cls : * mut :: std :: os :: raw :: c_void , key : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Set an attribute to @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] pub fn metacall_class_static_set (cls : * mut :: std :: os :: raw :: c_void , key : * const :: std :: os :: raw :: c_char , v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Call an object method anonymously by value array @args\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallv_object (obj : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Call a object method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] pub fn metacallt_object (obj : * mut :: std :: os :: raw :: c_void , name : * const :: std :: os :: raw :: c_char , ret : metacall_value_id , args : * mut * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get an attribute from @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the object attribute value or NULL if an error occurred"] pub fn metacall_object_get (obj : * mut :: std :: os :: raw :: c_void , key : * const :: std :: os :: raw :: c_char) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Set an attribute to @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] pub fn metacall_object_set (obj : * mut :: std :: os :: raw :: c_void , key : * const :: std :: os :: raw :: c_char , v : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the value contained by throwable object @th\n\n @param[in] th\n Pointer to the throwable object\n\n @return\n Pointer to the value inside of the throwable or NULL in case of error"] pub fn metacall_throwable_value (th : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Provide information about all loaded objects\n\n @param[out] size\n Size in bytes of return buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n String containing introspection information"] pub fn metacall_inspect (size : * mut usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide information about all loaded objects as a value\n\n @return\n Value containing introspection information"] pub fn metacall_inspect_value () -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Convert the value @v to serialized string\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] v\n Reference to the value\n\n @param[out] size\n Size of new allocated string\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n New allocated string containing stringified value"] pub fn metacall_serialize (name : * const :: std :: os :: raw :: c_char , v : * mut :: std :: os :: raw :: c_void , size : * mut usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Convert the string @buffer to value\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] buffer\n String to be deserialized\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n New allocated value representing the string (must be freed)"] pub fn metacall_deserialize (name : * const :: std :: os :: raw :: c_char , buffer : * const :: std :: os :: raw :: c_char , size : usize , allocator : * mut :: std :: os :: raw :: c_void) -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Clear handle from memory and unload related resources\n\n @param[in] handle\n Reference to the handle to be unloaded\n\n @return\n Zero if success, different from zero otherwise"] pub fn metacall_clear (handle : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } unsafe extern "C" { # [doc = " @brief\n Get the plugin extension handle to be used for loading plugins\n\n @return\n Pointer to the extension handle, or null if it failed to load"] pub fn metacall_plugin_extension () -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the handle containing all the functionality of the plugins from core\n\n @return\n Pointer to the core plugin handle, or null if it failed to load"] pub fn metacall_plugin_core () -> * mut :: std :: os :: raw :: c_void ; } unsafe extern "C" { # [doc = " @brief\n Get the plugin extension path to be used for accessing the plugins folder\n\n @return\n String containing the core plugin path, or null if it failed to load the plugin extension"] pub fn metacall_plugin_path () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Destroy MetaCall library"] pub fn metacall_destroy () ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version struct\n\n @return\n Static struct containing unpacked version"] pub fn metacall_version () -> * const metacall_version_type ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is @major,\n I is @minor and P is @patch\n\n @param[in] major\n Unsigned integer representing major version\n\n @param[in] minor\n Unsigned integer representing minor version\n\n @param[in] patch\n Unsigned integer representing patch version\n\n @return\n Hexadecimal integer containing packed version"] pub fn metacall_version_hex_make (major : :: std :: os :: raw :: c_uint , minor : :: std :: os :: raw :: c_uint , patch : :: std :: os :: raw :: c_uint) -> u32 ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is major,\n I is minor and P is patch\n\n @return\n Hexadecimal integer containing packed version"] pub fn metacall_version_hex () -> u32 ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version string\n\n @return\n Static string containing module version"] pub fn metacall_version_str () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version revision string\n\n @return\n Static string containing module version revision"] pub fn metacall_version_revision () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide the module version name\n\n @return\n Static string containing module version name"] pub fn metacall_version_name () -> * const :: std :: os :: raw :: c_char ; } unsafe extern "C" { # [doc = " @brief\n Provide the module information\n\n @return\n Static string containing module information"] pub fn metacall_print_info () -> * const :: std :: os :: raw :: c_char ; } \ No newline at end of file +pub type __pid_t = ::std::os::raw::c_int; +pub type pid_t = __pid_t; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum metacall_allocator_id { + METACALL_ALLOCATOR_STD = 0, + METACALL_ALLOCATOR_NGINX = 1, +} +unsafe extern "C" { + #[doc = " @brief\n Create an allocator instance\n\n @param[in] allocator_id\n Type of allocator to be created\n\n @param[in] ctx\n Context of the allocator\n\n @return\n Pointer to allocator if success, null otherwise"] + pub fn metacall_allocator_create( + allocator_id: metacall_allocator_id, + ctx: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Reserve memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] size\n Size in bytes to be allocated\n\n @return\n Pointer to allocated data on success, null otherwise"] + pub fn metacall_allocator_alloc( + allocator: *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Reallocate memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Original pointer to data\n\n @param[in] size\n Original size in bytes\n\n @param[in] new_size\n New size in bytes to be reallocated\n\n @return\n Pointer to new reallocated data on success, null otherwise"] + pub fn metacall_allocator_realloc( + allocator: *mut ::std::os::raw::c_void, + data: *mut ::std::os::raw::c_void, + size: usize, + new_size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Free memory from an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance\n\n @param[in] data\n Pointer to data to be freed"] + pub fn metacall_allocator_free( + allocator: *mut ::std::os::raw::c_void, + data: *mut ::std::os::raw::c_void, + ); +} +unsafe extern "C" { + #[doc = " @brief\n Destroy an allocator instance\n\n @param[in] allocator\n Pointer to allocator instance"] + pub fn metacall_allocator_destroy(allocator: *mut ::std::os::raw::c_void); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct metacall_exception_type { + pub message: *const ::std::os::raw::c_char, + pub label: *const ::std::os::raw::c_char, + pub code: i64, + pub stacktrace: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of metacall_exception_type"][::std::mem::size_of::<metacall_exception_type>() - 32usize]; + ["Alignment of metacall_exception_type"] + [::std::mem::align_of::<metacall_exception_type>() - 8usize]; + ["Offset of field: metacall_exception_type::message"] + [::std::mem::offset_of!(metacall_exception_type, message) - 0usize]; + ["Offset of field: metacall_exception_type::label"] + [::std::mem::offset_of!(metacall_exception_type, label) - 8usize]; + ["Offset of field: metacall_exception_type::code"] + [::std::mem::offset_of!(metacall_exception_type, code) - 16usize]; + ["Offset of field: metacall_exception_type::stacktrace"] + [::std::mem::offset_of!(metacall_exception_type, stacktrace) - 24usize]; +}; +pub type metacall_exception = *mut metacall_exception_type; +unsafe extern "C" { + #[doc = " @brief\n Create an throwable value from an exception with a simple API in a single instruction\n\n @param[in] label\n Label of the exception\n\n @param[in] code\n Error code of the exception\n\n @param[in] stacktrace\n Stack trace of the exception\n\n @param[in] message\n Message of the exception to be formatted with the variable arguments\n\n @param[in] va_args\n Arguments for formatting the message\n\n @return\n The value of type throwable containing the exception created"] + pub fn metacall_error_throw( + label: *const ::std::os::raw::c_char, + code: i64, + stacktrace: *const ::std::os::raw::c_char, + message: *const ::std::os::raw::c_char, + ... + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Retrieve the exception from a value, it can be either a throwable value with an exception inside or an exception itself\n\n @param[in] v\n Value that represents the exception to be retrieved\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to @v\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_error_from_value( + v: *mut ::std::os::raw::c_void, + ex: metacall_exception, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Retrieve last error that has happened after a call to any API from MetaCall\n\n @param[out] ex\n Exception that will be used as out parameter, the lifetime of the struct fields is attached to the internal MetaCall exception\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_error_last(ex: metacall_exception) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Clear last error that has happened after a call to any API from MetaCall"] + pub fn metacall_error_clear(); +} +unsafe extern "C" { + #[doc = " @brief\n Initialize link detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_link_initialize() -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_link_register( + tag: *const ::std::os::raw::c_char, + library: *const ::std::os::raw::c_char, + symbol: *const ::std::os::raw::c_char, + fn_: ::std::option::Option<unsafe extern "C" fn()>, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Register a function pointer in order to allow function\n interposition when loading a library, if you register a\n function @symbol called 'foo', when you try to dlsym (or the equivalent\n on every platform), you will get the pointer to @fn, even if\n the symbol does not exist in the library, it will work.\n Function interposition is required in order to hook into runtimes\n and dynamically interpose our functions.\n\n @param[in] loader\n Pointer to the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @param[in] fn\n Function pointer that will be returned by dlsym (or equivalent) when accessing to @symbol\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_link_register_loader( + loader: *mut ::std::os::raw::c_void, + library: *const ::std::os::raw::c_char, + symbol: *const ::std::os::raw::c_char, + fn_: ::std::option::Option<unsafe extern "C" fn()>, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Remove the hook previously registered\n\n @param[in] tag\n Name of the loader which the @library belongs to\n\n @param[in] library\n Name of the library that is going to be hooked\n\n @param[in] symbol\n Name of the function to be interposed\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_link_unregister( + tag: *const ::std::os::raw::c_char, + library: *const ::std::os::raw::c_char, + symbol: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Unregister link detours and destroy shared memory"] + pub fn metacall_link_destroy(); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum metacall_log_id { + METACALL_LOG_STDIO = 0, + METACALL_LOG_FILE = 1, + METACALL_LOG_SOCKET = 2, + METACALL_LOG_SYSLOG = 3, + METACALL_LOG_NGINX = 4, + METACALL_LOG_CUSTOM = 5, +} +unsafe extern "C" { + #[doc = " @brief\n Create a log instance\n\n @param[in] log_id\n Type of log to be created\n\n @param[in] ctx\n Context of the log (a pointer to metacall_log_{stdio, file, socket, syslog, nginx, custom}_type)\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_log( + log_id: metacall_log_id, + ctx: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum metacall_value_id { + METACALL_BOOL = 0, + METACALL_CHAR = 1, + METACALL_SHORT = 2, + METACALL_INT = 3, + METACALL_LONG = 4, + METACALL_FLOAT = 5, + METACALL_DOUBLE = 6, + METACALL_STRING = 7, + METACALL_BUFFER = 8, + METACALL_ARRAY = 9, + METACALL_MAP = 10, + METACALL_PTR = 11, + METACALL_FUTURE = 12, + METACALL_FUNCTION = 13, + METACALL_NULL = 14, + METACALL_CLASS = 15, + METACALL_OBJECT = 16, + METACALL_EXCEPTION = 17, + METACALL_THROWABLE = 18, + METACALL_SIZE = 19, + METACALL_INVALID = 20, +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from boolean @b\n\n @param[in] b\n Boolean will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_bool(b: ::std::os::raw::c_uchar) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from char @c\n\n @param[in] c\n Character will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_char(c: ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from short @s\n\n @param[in] s\n Short will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_short(s: ::std::os::raw::c_short) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from integer @i\n\n @param[in] i\n Integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_int(i: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from long @l\n\n @param[in] l\n Long integer will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_long(l: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from single precision floating point number @f\n\n @param[in] f\n Float will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_float(f: f32) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from double precision floating point number @d\n\n @param[in] d\n Double will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_double(d: f64) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from a C string @str\n\n @param[in] str\n Constant string will be copied into value (needs to be null terminated)\n\n @param[in] length\n Length of the constant string\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_string( + str_: *const ::std::os::raw::c_char, + length: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value buffer from array @buffer\n\n @param[in] buffer\n Constant memory block will be copied into value array\n\n @param[in] size\n Size in bytes of data contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_buffer( + buffer: *const ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value array from array of values @values\n\n @param[in] values\n Constant array of values will be copied into value list\n\n @param[in] size\n Number of elements contained in the array\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_array( + values: *mut *const ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value map from array of tuples @map\n\n @param[in] tuples\n Constant array of tuples will be copied into value map\n\n @param[in] size\n Number of elements contained in the map\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_map( + tuples: *mut *const ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from pointer @ptr\n\n @param[in] ptr\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_ptr( + ptr: *const ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from future @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_future( + f: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from function @f\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_function( + f: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from function @f binding a closure @c to it\n\n @param[in] f\n Pointer to constant data will be copied into value\n\n @param[in] c\n Pointer to closure that will be binded into function @f\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_function_closure( + f: *mut ::std::os::raw::c_void, + c: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value of type null\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_null() -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from class @c\n\n @param[in] c\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_class( + c: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from object @o\n\n @param[in] o\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_object( + o: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from exception @ex\n\n @param[in] ex\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_exception( + ex: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a value from throwable @th\n\n @param[in] th\n Pointer to constant data will be copied into value\n\n @return\n Pointer to value if success, null otherwhise"] + pub fn metacall_value_create_throwable( + th: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Returns the size of the value\n\n @param[in] v\n Reference to the value\n\n @return\n Size in bytes of the value"] + pub fn metacall_value_size(v: *mut ::std::os::raw::c_void) -> usize; +} +unsafe extern "C" { + #[doc = " @brief\n Returns the amount of values this value contains\n\n @param[in] v\n Reference to the value\n\n @return\n Number of values @v represents"] + pub fn metacall_value_count(v: *mut ::std::os::raw::c_void) -> usize; +} +unsafe extern "C" { + #[doc = " @brief\n Provide type id of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return type id assigned to value"] + pub fn metacall_value_id(v: *mut ::std::os::raw::c_void) -> metacall_value_id; +} +unsafe extern "C" { + #[doc = " @brief\n Provide type id in a readable form (as string) of a type id\n\n @param[in] id\n Value type identifier\n\n @return\n Return string related to the type id"] + pub fn metacall_value_id_name(id: metacall_value_id) -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Provide type id in a readable form (as string) of value\n\n @param[in] v\n Reference to the value\n\n @return\n Return string related to the type id assigned to value"] + pub fn metacall_value_type_name( + v: *mut ::std::os::raw::c_void, + ) -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Deep copies the value @v, the result copy resets\n the reference counter and ownership, including the finalizer\n\n @param[in] v\n Reference to the value to be copied\n\n @return\n Copy of the value @v on success, null otherwhise"] + pub fn metacall_value_copy(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Creates a new pointer value, with a reference to the\n data contained inside the value @v. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n\n In this case, void *ptr is a value equivalent to int*,\n and it points directly to the integer contained in void *v.\n Note that if we destroy the value @v, the reference will\n point to already freed memory, causing use-after-free when used.\n\n @param[in] v\n Reference to the value to be referenced\n\n @return\n A new value of type pointer, pointing to the @v data"] + pub fn metacall_value_reference(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n If you pass a reference previously created (i.e a value of\n type pointer, pointing to another value), it returns the\n original value. It does not modify the memory of the values\n neither allocates anything. If the value @v is pointing to\n has been deleted, it will cause an use-after-free. For example:\n\n void *v = metacall_value_create_int(20);\n void *ptr = metacall_value_reference(v);\n void *w = metacall_value_dereference(ptr);\n assert(v == w); // Both are the same value\n\n @param[in] v\n Reference to the value to be dereferenced\n\n @return\n The value containing the data which ptr is pointing to"] + pub fn metacall_value_dereference( + v: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Copies the ownership from @src to @dst, including the finalizer,\n and resets the owner and finalizer of @src\n\n @param[in] src\n Source value which will lose the ownership\n\n @param[in] dst\n Destination value which will recieve the ownership"] + pub fn metacall_value_move(src: *mut ::std::os::raw::c_void, dest: *mut ::std::os::raw::c_void); +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to boolean\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to boolean"] + pub fn metacall_value_to_bool(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_uchar; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to char\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to char"] + pub fn metacall_value_to_char(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to short\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to short"] + pub fn metacall_value_to_short(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_short; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to integer"] + pub fn metacall_value_to_int(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to long integer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to long integer"] + pub fn metacall_value_to_long(v: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_long; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to single precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to float"] + pub fn metacall_value_to_float(v: *mut ::std::os::raw::c_void) -> f32; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to double precision floating point\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to dobule"] + pub fn metacall_value_to_double(v: *mut ::std::os::raw::c_void) -> f64; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to string\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to C string (null terminated)"] + pub fn metacall_value_to_string(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to buffer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to memory block"] + pub fn metacall_value_to_buffer(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to array of values\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to array of values"] + pub fn metacall_value_to_array( + v: *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to map\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to map (array of tuples (array of values))"] + pub fn metacall_value_to_map( + v: *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to pointer\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to pointer"] + pub fn metacall_value_to_ptr(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to future\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to future"] + pub fn metacall_value_to_future(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to function\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to function"] + pub fn metacall_value_to_function( + v: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to null\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to null"] + pub fn metacall_value_to_null(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to class\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to class"] + pub fn metacall_value_to_class(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to object\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to object"] + pub fn metacall_value_to_object(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to exception\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to exception"] + pub fn metacall_value_to_exception( + v: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v to throwable\n\n @param[in] v\n Reference to the value\n\n @return\n Value converted to throwable"] + pub fn metacall_value_to_throwable( + v: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign boolean @b to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] b\n Boolean to be assigned to value @v\n\n @return\n Value with boolean @b assigned to it"] + pub fn metacall_value_from_bool( + v: *mut ::std::os::raw::c_void, + b: ::std::os::raw::c_uchar, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign character @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Character to be assigned to value @v\n\n @return\n Value with char @c assigned to it"] + pub fn metacall_value_from_char( + v: *mut ::std::os::raw::c_void, + c: ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign short @s to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] s\n Short to be assigned to value @v\n\n @return\n Value with short @s assigned to it"] + pub fn metacall_value_from_short( + v: *mut ::std::os::raw::c_void, + s: ::std::os::raw::c_short, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign integer @i to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] i\n Integer to be assigned to value @v\n\n @return\n Value with integer @i assigned to it"] + pub fn metacall_value_from_int( + v: *mut ::std::os::raw::c_void, + i: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign long integer @l to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] l\n Long integer to be assigned to value @v\n\n @return\n Value with long @l assigned to it"] + pub fn metacall_value_from_long( + v: *mut ::std::os::raw::c_void, + l: ::std::os::raw::c_long, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign single precision floating point @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Float to be assigned to value @v\n\n @return\n Value with float @f assigned to it"] + pub fn metacall_value_from_float( + v: *mut ::std::os::raw::c_void, + f: f32, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign double precision floating point @d to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] d\n Double to be assigned to value @v\n\n @return\n Value with double @d assigned to it"] + pub fn metacall_value_from_double( + v: *mut ::std::os::raw::c_void, + d: f64, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign string @str to value @v, truncates to @v size if it is smaller\n than @length + 1. It does not add null terminator if truncated.\n\n @param[in] v\n Reference to the value\n\n @param[in] str\n Constant string to be assigned to value @v (it needs to be null terminated)\n\n @param[in] length\n Length of the constant string @str\n\n @return\n Value with string @str assigned to it"] + pub fn metacall_value_from_string( + v: *mut ::std::os::raw::c_void, + str_: *const ::std::os::raw::c_char, + length: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign array @buffer to value buffer @v\n\n @param[in] v\n Reference to the value\n\n @param[in] buffer\n Constant array to be assigned to value @v\n\n @param[in] size\n Number of elements contained in @buffer\n\n @return\n Value with array @buffer assigned to it"] + pub fn metacall_value_from_buffer( + v: *mut ::std::os::raw::c_void, + buffer: *const ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign array of values @values to value array @v\n\n @param[in] v\n Reference to the value\n\n @param[in] values\n Constant array of values to be assigned to value array @v\n\n @param[in] size\n Number of values contained in constant array @values\n\n @return\n Value with array of values @values assigned to it"] + pub fn metacall_value_from_array( + v: *mut ::std::os::raw::c_void, + values: *mut *const ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign array of values @values to value map @v\n\n @param[in] v\n Reference to the value\n\n @param[in] tuples\n Constant array of tuples to be assigned to value map @v\n\n @param[in] size\n Number of values contained in constant array @tuples\n\n @return\n Value with array of tuples @tuples assigned to it"] + pub fn metacall_value_from_map( + v: *mut ::std::os::raw::c_void, + tuples: *mut *const ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign pointer reference @ptr to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ptr\n Pointer to be assigned to value @v\n\n @return\n Value with pointer @ptr assigned to it"] + pub fn metacall_value_from_ptr( + v: *mut ::std::os::raw::c_void, + ptr: *const ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign future @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Future to be assigned to value @v\n\n @return\n Value with future @f assigned to it"] + pub fn metacall_value_from_future( + v: *mut ::std::os::raw::c_void, + f: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign function @f to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] f\n Function to be assigned to value @v\n\n @return\n Value with function @f assigned to it"] + pub fn metacall_value_from_function( + v: *mut ::std::os::raw::c_void, + f: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign null to value @v\n\n @param[in] v\n Reference to the value\n\n @return\n Value with null assigned to it"] + pub fn metacall_value_from_null(v: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign class @c to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] c\n Class to be assigned to value @v\n\n @return\n Value with class @c assigned to it"] + pub fn metacall_value_from_class( + v: *mut ::std::os::raw::c_void, + c: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign object @o to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] o\n Object to be assigned to value @v\n\n @return\n Value with object @o assigned to it"] + pub fn metacall_value_from_object( + v: *mut ::std::os::raw::c_void, + o: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign exception @ex to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] ex\n Exception to be assigned to value @v\n\n @return\n Value with exception @ex assigned to it"] + pub fn metacall_value_from_exception( + v: *mut ::std::os::raw::c_void, + ex: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Assign throwable @th to value @v\n\n @param[in] v\n Reference to the value\n\n @param[in] th\n Throwable to be assigned to value @v\n\n @return\n Value with throwable @th assigned to it"] + pub fn metacall_value_from_throwable( + v: *mut ::std::os::raw::c_void, + th: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Casts a value to a new type @id\n\n @param[in] v\n Reference to the value\n\n @param[in] id\n New type id of value to be casted\n\n @return\n Casted value or reference to @v if casting is between equivalent types"] + pub fn metacall_value_cast( + v: *mut ::std::os::raw::c_void, + id: metacall_value_id, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to boolean\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to boolean"] + pub fn metacall_value_cast_bool(v: *mut *mut ::std::os::raw::c_void) + -> ::std::os::raw::c_uchar; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to char\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to char"] + pub fn metacall_value_cast_char(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to short\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to short"] + pub fn metacall_value_cast_short( + v: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_short; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to int\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to int"] + pub fn metacall_value_cast_int(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to long\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to long"] + pub fn metacall_value_cast_long(v: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_long; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to float\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to float"] + pub fn metacall_value_cast_float(v: *mut *mut ::std::os::raw::c_void) -> f32; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to double\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to double"] + pub fn metacall_value_cast_double(v: *mut *mut ::std::os::raw::c_void) -> f64; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to string\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to a C string (null terminated)"] + pub fn metacall_value_cast_string( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to buffer\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to buffer"] + pub fn metacall_value_cast_buffer( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to array\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to array of values"] + pub fn metacall_value_cast_array( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to map\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to map"] + pub fn metacall_value_cast_map( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to ptr\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to ptr"] + pub fn metacall_value_cast_ptr( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to future\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to future"] + pub fn metacall_value_cast_future( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to function\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to function"] + pub fn metacall_value_cast_function( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to null\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to null"] + pub fn metacall_value_cast_null( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to class\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to class"] + pub fn metacall_value_cast_class( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to object\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to object"] + pub fn metacall_value_cast_object( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to exception\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to exception"] + pub fn metacall_value_cast_exception( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert value @v implicitly to throwable\n\n @param[in] v\n Reference to the reference of the value\n\n @return\n Value converted to throwable"] + pub fn metacall_value_cast_throwable( + v: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Destroy a value from scope stack\n\n @param[in] v\n Reference to the value"] + pub fn metacall_value_destroy(v: *mut ::std::os::raw::c_void); +} +pub type metacall_pid = pid_t; +pub type metacall_pre_fork_callback_ptr = ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int, +>; +pub type metacall_post_fork_callback_ptr = ::std::option::Option< + unsafe extern "C" fn( + arg1: metacall_pid, + arg2: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +unsafe extern "C" { + #[doc = " @brief\n Initialize fork detours and allocate shared memory\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_fork_initialize() -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Set fork hook callback\n\n @param[in] pre_callback\n Callback to be called before fork detour is executed\n\n @param[in] post_callback\n Callback to be called after fork detour is executed"] + pub fn metacall_fork( + pre_callback: metacall_pre_fork_callback_ptr, + post_callback: metacall_post_fork_callback_ptr, + ); +} +unsafe extern "C" { + #[doc = " @brief\n Unregister fork detours and destroy shared memory"] + pub fn metacall_fork_destroy(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct metacall_initialize_configuration_type { + pub tag: *const ::std::os::raw::c_char, + pub options: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of metacall_initialize_configuration_type"] + [::std::mem::size_of::<metacall_initialize_configuration_type>() - 16usize]; + ["Alignment of metacall_initialize_configuration_type"] + [::std::mem::align_of::<metacall_initialize_configuration_type>() - 8usize]; + ["Offset of field: metacall_initialize_configuration_type::tag"] + [::std::mem::offset_of!(metacall_initialize_configuration_type, tag) - 0usize]; + ["Offset of field: metacall_initialize_configuration_type::options"] + [::std::mem::offset_of!(metacall_initialize_configuration_type, options) - 8usize]; +}; +pub type metacall_await_callback = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct metacall_await_callbacks_type { + pub resolve: metacall_await_callback, + pub reject: metacall_await_callback, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of metacall_await_callbacks_type"] + [::std::mem::size_of::<metacall_await_callbacks_type>() - 16usize]; + ["Alignment of metacall_await_callbacks_type"] + [::std::mem::align_of::<metacall_await_callbacks_type>() - 8usize]; + ["Offset of field: metacall_await_callbacks_type::resolve"] + [::std::mem::offset_of!(metacall_await_callbacks_type, resolve) - 0usize]; + ["Offset of field: metacall_await_callbacks_type::reject"] + [::std::mem::offset_of!(metacall_await_callbacks_type, reject) - 8usize]; +}; +pub type metacall_await_callbacks = metacall_await_callbacks_type; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct metacall_version_type { + pub major: ::std::os::raw::c_uint, + pub minor: ::std::os::raw::c_uint, + pub patch: ::std::os::raw::c_uint, + pub revision: *const ::std::os::raw::c_char, + pub str_: *const ::std::os::raw::c_char, + pub name: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of metacall_version_type"][::std::mem::size_of::<metacall_version_type>() - 40usize]; + ["Alignment of metacall_version_type"] + [::std::mem::align_of::<metacall_version_type>() - 8usize]; + ["Offset of field: metacall_version_type::major"] + [::std::mem::offset_of!(metacall_version_type, major) - 0usize]; + ["Offset of field: metacall_version_type::minor"] + [::std::mem::offset_of!(metacall_version_type, minor) - 4usize]; + ["Offset of field: metacall_version_type::patch"] + [::std::mem::offset_of!(metacall_version_type, patch) - 8usize]; + ["Offset of field: metacall_version_type::revision"] + [::std::mem::offset_of!(metacall_version_type, revision) - 16usize]; + ["Offset of field: metacall_version_type::str_"] + [::std::mem::offset_of!(metacall_version_type, str_) - 24usize]; + ["Offset of field: metacall_version_type::name"] + [::std::mem::offset_of!(metacall_version_type, name) - 32usize]; +}; +unsafe extern "C" { + #[doc = " @brief\n Returns default serializer used by MetaCall\n\n @return\n Name of the serializer to be used with serialization methods"] + pub fn metacall_serial() -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Returns default detour used by MetaCall\n\n @return\n Name of the detour to be used with detouring methods"] + pub fn metacall_detour() -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Disables MetaCall logs, must be called before @metacall_initialize.\n\n When initializing MetaCall, it initializes a default logs to stdout\n if none was defined. If you want to benchmark or simply disable this\n default logs, you can call to this function before @metacall_initialize."] + pub fn metacall_log_null(); +} +unsafe extern "C" { + #[doc = " @brief\n Flags to be set in MetaCall library\n\n @param[in] flags\n Combination of flags referring to definitions METACALL_FLAGS_*"] + pub fn metacall_flags(flags: ::std::os::raw::c_int); +} +unsafe extern "C" { + #[doc = " @brief\n Initialize MetaCall library\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_initialize() -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Initialize MetaCall library with configuration arguments\n\n @param[in] initialize_config\n Extension of the script to be loaded in memory with data to be injected\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_initialize_ex( + initialize_config: *mut metacall_initialize_configuration_type, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Initialize MetaCall application arguments\n\n @param[in] argc\n Number of additional parameters to be passed to the runtime when initializing\n\n @param[in] argv\n Additional parameters to be passed to the runtime when initializing (when using MetaCall as an application)"] + pub fn metacall_initialize_args( + argc: ::std::os::raw::c_int, + argv: *mut *mut ::std::os::raw::c_char, + ); +} +unsafe extern "C" { + #[doc = " @brief\n Get the number of arguments in which MetaCall was initialized\n\n @return\n An integer equal or greater than zero"] + pub fn metacall_argc() -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Get the arguments in which MetaCall was initialized\n\n @return\n A pointer to an array of strings with the additional arguments"] + pub fn metacall_argv() -> *mut *mut ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Check if script context is loaded by @tag\n\n @param[in] tag\n Extension of the script (if tag is NULL, it returns the status of the whole MetaCall instance)\n\n @return\n Zero if context is initialized, different from zero otherwise"] + pub fn metacall_is_initialized(tag: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Amount of function call arguments supported by MetaCall\n\n @return\n Number of arguments suported"] + pub fn metacall_args_size() -> usize; +} +unsafe extern "C" { + #[doc = " @brief\n Set a execution path defined by @path to the extension script @tag\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path to be loaded\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_execution_path( + tag: *const ::std::os::raw::c_char, + path: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Set a execution path defined by @path to the extension script @tag with length\n\n @param[in] tag\n Extension of the script\n\n @param[in] tag_length\n Length of the extension of the tag\n\n @param[in] path\n Path to be loaded\n\n @param[in] path_length\n Length of the path\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_execution_path_s( + tag: *const ::std::os::raw::c_char, + tag_length: usize, + path: *const ::std::os::raw::c_char, + path_length: usize, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Loads a script from file specified by @path\n\n @param[in] tag\n Extension of the script\n\n @param[in] paths\n Path array of files\n\n @param[in] size\n Size of the array @paths\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_load_from_file( + tag: *const ::std::os::raw::c_char, + paths: *mut *const ::std::os::raw::c_char, + size: usize, + handle: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Loads a script from memory\n\n @param[in] tag\n Extension of the script\n\n @param[in] buffer\n Memory block representing the string of the script\n\n @param[in] size\n Memory block representing the string of the script\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_load_from_memory( + tag: *const ::std::os::raw::c_char, + buffer: *const ::std::os::raw::c_char, + size: usize, + handle: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Loads a package of scrips from file specified by @path into loader defined by @extension\n\n @param[in] tag\n Extension of the script\n\n @param[in] path\n Path of the package\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_load_from_package( + tag: *const ::std::os::raw::c_char, + path: *const ::std::os::raw::c_char, + handle: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Loads a a list of scrips from configuration specified by @path into loader\n with the following format:\n {\n \"language_id\": \"<tag>\",\n \"path\": \"<path>\",\n \"scripts\": [ \"<script0>\", \"<script1>\", ..., \"<scriptN>\" ]\n }\n\n @param[in] path\n Path of the configuration\n\n @param[inout] handle\n Optional pointer to reference of loaded handle. If the parameter is NULL, the symbols loaded are\n propagated to the loader scope (i.e they will share the scope between all previously loaded files and they can collide).\n Otherwise, if we pass a void* pointer set to NULL, it will behave as output parameter, obtaining the reference to the\n created handle, which can be later on used for calling to functions of that handle. The symbols will not be propagated\n to the loader scope and they will be private (this prevents collisions). The last case is if we pass an already allocated\n handle (i.e a void* pointer pointing to an previously loaded handle), then in this case, the symbols loaded will be propagated\n to the previously allocated handle, and it will behave as a in parameter.\n\n @param[in] allocator\n Pointer to allocator will allocate the configuration\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_load_from_configuration( + path: *const ::std::os::raw::c_char, + handle: *mut *mut ::std::os::raw::c_void, + allocator: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallv( + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by value array @args\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallv_s( + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallhv( + handle: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by handle @handle value array @args\n This function allows to avoid name collisions when calling functions by name\n Includes @size in order to allow variadic arguments or safe calls\n\n @param[in] handle\n Handle where the function belongs\n\n @param[in] name\n Name of the function\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of the call\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallhv_s( + handle: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacall(name: *const ::std::os::raw::c_char, ...) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallt( + name: *const ::std::os::raw::c_char, + ids: *const metacall_value_id, + ... + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallt_s( + name: *const ::std::os::raw::c_char, + ids: *const metacall_value_id, + size: usize, + ... + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by type array @ids and variable arguments @va_args\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @param[in] ids\n Array of types refered to @va_args\n\n @param[in] size\n Number of elements of the call\n\n @param[in] va_args\n Varidic function parameters\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallht_s( + handle: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + ids: *const metacall_value_id, + size: usize, + ... + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Get the function by @name\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] + pub fn metacall_function(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create an empty handler into a loader with name @name\n\n @param[in] loader\n Pointer to the loader which the handle belongs to\n\n @param[in] name\n Name of the handle\n\n @param[out] handle_ptr\n On success, returns the pointer to the handle created, otherwise NULL\n\n @return\n Return zero on success, different from zero on error"] + pub fn metacall_handle_initialize( + loader: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + handle_ptr: *mut *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Populate the objects of @handle_src into @handle_dest\n\n @param[inout] handle_dest\n Handle where the objects from @handle_src will be stored\n\n @param[in] handle_src\n Handle from where the objects will be copied\n\n @return\n Return zero on success, different from zero on error"] + pub fn metacall_handle_populate( + handle_dest: *mut ::std::os::raw::c_void, + handle_src: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Get the function by @name from @handle\n\n @param[in] handle\n Pointer to the handle returned by metacall_load_from_{file, memory, package}\n\n @param[in] name\n Name of the function\n\n @return\n Function reference, null if the function does not exist"] + pub fn metacall_handle_function( + handle: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Get the function parameter type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n @param[in] parameter\n The index of the parameter to be retrieved\n\n @param[out] id\n The parameter type id that will be returned\n\n @return\n Return 0 if the @parameter index exists and @func is valid, 1 otherwhise"] + pub fn metacall_function_parameter_type( + func: *mut ::std::os::raw::c_void, + parameter: usize, + id: *mut metacall_value_id, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Get the function return type id\n\n @param[in] func\n The pointer to the function obtained from metacall_function\n\n\n @param[out] id\n The value id of the return type of the function @func\n\n @return\n Return 0 if the @func is valid, 1 otherwhise"] + pub fn metacall_function_return_type( + func: *mut ::std::os::raw::c_void, + id: *mut metacall_value_id, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Get minimun mumber of arguments accepted by function @func\n\n @param[in] func\n Function reference\n\n @return\n Return mumber of arguments"] + pub fn metacall_function_size(func: *mut ::std::os::raw::c_void) -> usize; +} +unsafe extern "C" { + #[doc = " @brief\n Check if the function @func is asynchronous or synchronous\n\n @param[in] func\n Function reference\n\n @return\n Return 0 if it is syncrhonous, 1 if it is asynchronous and -1 if the function is NULL"] + pub fn metacall_function_async(func: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Get the handle by @name\n\n @param[in] tag\n Extension of the script\n\n @param[in] name\n Name of the handle\n\n @return\n Handle reference, null if the function does not exist"] + pub fn metacall_handle( + tag: *const ::std::os::raw::c_char, + name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Get name of a @handle\n\n @param[in] handle\n Pointer to the handle to be retrieved\n\n @return\n String that references the handle"] + pub fn metacall_handle_id(handle: *mut ::std::os::raw::c_void) + -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Return a value representing the handle as a map of functions (or values)\n\n @param[in] handle\n Reference to the handle to be described\n\n @return\n A value of type map on success, null otherwise"] + pub fn metacall_handle_export( + handle: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallfv( + func: *mut ::std::os::raw::c_void, + args: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of function arguments\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallfv_s( + func: *mut ::std::os::raw::c_void, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by variable arguments @va_args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallf(func: *mut ::std::os::raw::c_void, ...) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallfs( + func: *mut ::std::os::raw::c_void, + buffer: *const ::std::os::raw::c_char, + size: usize, + allocator: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallfmv( + func: *mut ::std::os::raw::c_void, + keys: *mut *mut ::std::os::raw::c_void, + values: *mut *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallfms( + func: *mut ::std::os::raw::c_void, + buffer: *const ::std::os::raw::c_char, + size: usize, + allocator: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Register a function by name @name and arguments @va_args\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] va_args\n Varidic function parameter types\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacall_register( + name: *const ::std::os::raw::c_char, + invoke: ::std::option::Option< + unsafe extern "C" fn( + arg1: usize, + arg2: *mut *mut ::std::os::raw::c_void, + arg3: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + func: *mut *mut ::std::os::raw::c_void, + return_type: metacall_value_id, + size: usize, + ... + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[out] func\n Will set the pointer to the function if the parameter is not null\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacall_registerv( + name: *const ::std::os::raw::c_char, + invoke: ::std::option::Option< + unsafe extern "C" fn( + arg1: usize, + arg2: *mut *mut ::std::os::raw::c_void, + arg3: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + func: *mut *mut ::std::os::raw::c_void, + return_type: metacall_value_id, + size: usize, + types: *mut metacall_value_id, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Obtain the loader instance by @tag\n\n @param[in] tag\n Tag in which the loader is identified, normally it is the extension of the script\n\n @return\n Pointer the loader by @tag"] + pub fn metacall_loader(tag: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Register a function by name @name and arguments @types\n\n @param[in] loader\n Opaque pointer to the loader in which you want to register the function (this allows to register the function into a different loader than the host)\n\n @param[in] handle\n Opaque pointer to the handle in which you want to register the function (if it is NULL, it will be defined on the global scope of the loader)\n\n @param[in] name\n Name of the function (if it is NULL, function is not registered into host scope)\n\n @param[in] invoke\n Pointer to function invoke interface (argc, argv, data)\n\n @param[in] return_type\n Type of return value\n\n @param[in] size\n Number of function arguments\n\n @param[in] types\n List of parameter types\n\n @return\n Zero if the function was registered properly, distinct from zero otherwise"] + pub fn metacall_register_loaderv( + loader: *mut ::std::os::raw::c_void, + handle: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + invoke: ::std::option::Option< + unsafe extern "C" fn( + arg1: usize, + arg2: *mut *mut ::std::os::raw::c_void, + arg3: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + return_type: metacall_value_id, + size: usize, + types: *mut metacall_value_id, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacall_await( + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Awaits for a promise and registers a callback to be executed when a future is resolved\n\n @param[in] f\n The pointer to the future\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacall_await_future( + f: *mut ::std::os::raw::c_void, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Executes an asynchronous call to the function and registers a callback to be executed when a future is resolved (it does block)\n\n @param[in] name\n The name of the function to be called asynchronously\n\n @param[in] args\n Array of pointers to the values to be passed to the function\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacall_await_s( + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacallfv_await( + func: *mut ::std::os::raw::c_void, + args: *mut *mut ::std::os::raw::c_void, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacallfv_await_s( + func: *mut ::std::os::raw::c_void, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call an asynchronous function anonymously by value array @args and function @func (offered without function pointers for languages without support to function pointers)\n\n @param[in] func\n Reference to function to be called\n\n @param[in] args\n Array of pointers to values\n\n @param[in] size\n Number of elements of the array @args\n\n @param[in] cb\n Pointer to struct containing the function pointers to reject and resolve that will be executed when task completion or error\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacallfv_await_struct_s( + func: *mut ::std::os::raw::c_void, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + cb: metacall_await_callbacks, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] size\n Number of elements of the arrays @keys and @values\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacallfmv_await( + func: *mut ::std::os::raw::c_void, + keys: *mut *mut ::std::os::raw::c_void, + values: *mut *mut ::std::os::raw::c_void, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call an asynchronous function anonymously by value map (@keys -> @values) and function @func\n\n @param[in] func\n Reference to function to be called\n\n @param[in] keys\n Array of values representing argument keys\n\n @param[in] values\n Array of values representing argument values data\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacallfmv_await_s( + func: *mut ::std::os::raw::c_void, + keys: *mut *mut ::std::os::raw::c_void, + values: *mut *mut ::std::os::raw::c_void, + size: usize, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing an array to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacallfs_await( + func: *mut ::std::os::raw::c_void, + buffer: *const ::std::os::raw::c_char, + size: usize, + allocator: *mut ::std::os::raw::c_void, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call an asynchronous function anonymously by function @func and serial @buffer of size @size\n\n @param[in] func\n Reference to function to be called\n\n @param[in] buffer\n String representing a map to be deserialized into arguments of the function\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @param[in] resolve_callback\n Pointer to function that will be executed when task completion\n @param[in] void *\n Value representing the result of the future resolution\n @param[in] void *\n A reference to @data that will be used as a closure for the chain\n @return\n Value containing the result of the operation,\n it will be wrapped into a future later on to be returned by the function\n\n @param[in] reject_callback\n Pointer to function that will be executed when task error (signature is identical as resolve_callback)\n\n @param[in] data\n Pointer to a context that will act as a closure for the chain\n\n @return\n Pointer to value containing the result of the call returned by @resolve_callback or @reject_callback wrapped in a future"] + pub fn metacallfms_await( + func: *mut ::std::os::raw::c_void, + buffer: *const ::std::os::raw::c_char, + size: usize, + allocator: *mut ::std::os::raw::c_void, + resolve_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + reject_callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, + >, + data: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Get the class by @name\n\n @param[in] name\n Name of the class\n\n @return\n Class reference, null if the class does not exist"] + pub fn metacall_class(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a class method anonymously by value array @args (this procedure assumes there's no overloaded methods and does type conversion on values)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallv_class( + cls: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a class method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallt_class( + cls: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + ret: metacall_value_id, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Create a new object instance from @cls by value array @args\n\n @param[in] cls\n Pointer to the class\n\n @param[in] name\n Name of the new object\n\n @param[in] args\n Array of pointers constructor parameters\n\n @param[in] size\n Number of elements of constructor parameters\n\n @return\n Pointer to the new object value instance"] + pub fn metacall_class_new( + cls: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Get an attribute from @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the class attribute value or NULL if an error occurred"] + pub fn metacall_class_static_get( + cls: *mut ::std::os::raw::c_void, + key: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Set an attribute to @cls by @key name\n\n @param[in] cls\n Pointer to the class\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] + pub fn metacall_class_static_set( + cls: *mut ::std::os::raw::c_void, + key: *const ::std::os::raw::c_char, + v: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Call an object method anonymously by value array @args\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallv_object( + obj: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Call a object method anonymously by value array @args and return value type @ret (helps to resolve overloading methods)\n\n @param[in] obj\n Pointer to the object\n\n @param[in] name\n Name of the method\n\n @param[in] ret\n Type of the return value of the method\n\n @param[in] args\n Array of pointers to data\n\n @param[in] size\n Number of elements of args array\n\n @return\n Pointer to value containing the result of the call"] + pub fn metacallt_object( + obj: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + ret: metacall_value_id, + args: *mut *mut ::std::os::raw::c_void, + size: usize, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Get an attribute from @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to get\n\n @return\n Pointer to the object attribute value or NULL if an error occurred"] + pub fn metacall_object_get( + obj: *mut ::std::os::raw::c_void, + key: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Set an attribute to @obj by @key name\n\n @param[in] obj\n Pointer to the object\n\n @param[in] key\n Name of the attribute to set\n\n @param[in] value\n Value to set\n\n @return\n Non-zero integer if an error ocurred"] + pub fn metacall_object_set( + obj: *mut ::std::os::raw::c_void, + key: *const ::std::os::raw::c_char, + v: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Get the value contained by throwable object @th\n\n @param[in] th\n Pointer to the throwable object\n\n @return\n Pointer to the value inside of the throwable or NULL in case of error"] + pub fn metacall_throwable_value(th: *mut ::std::os::raw::c_void) + -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Provide information about all loaded objects\n\n @param[out] size\n Size in bytes of return buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n String containing introspection information"] + pub fn metacall_inspect( + size: *mut usize, + allocator: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Provide information about all loaded objects as a value\n\n @return\n Value containing introspection information"] + pub fn metacall_inspect_value() -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Convert the value @v to serialized string\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] v\n Reference to the value\n\n @param[out] size\n Size of new allocated string\n\n @param[in] allocator\n Pointer to allocator will allocate the string\n\n @return\n New allocated string containing stringified value"] + pub fn metacall_serialize( + name: *const ::std::os::raw::c_char, + v: *mut ::std::os::raw::c_void, + size: *mut usize, + allocator: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Convert the string @buffer to value\n\n @param[in] name\n Name of the serial to be used\n\n @param[in] buffer\n String to be deserialized\n\n @param[in] size\n Size of string @buffer\n\n @param[in] allocator\n Pointer to allocator will allocate the value\n\n @return\n New allocated value representing the string (must be freed)"] + pub fn metacall_deserialize( + name: *const ::std::os::raw::c_char, + buffer: *const ::std::os::raw::c_char, + size: usize, + allocator: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Clear handle from memory and unload related resources\n\n @param[in] handle\n Reference to the handle to be unloaded\n\n @return\n Zero if success, different from zero otherwise"] + pub fn metacall_clear(handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; +} +unsafe extern "C" { + #[doc = " @brief\n Get the plugin extension handle to be used for loading plugins\n\n @return\n Pointer to the extension handle, or null if it failed to load"] + pub fn metacall_plugin_extension() -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Get the handle containing all the functionality of the plugins from core\n\n @return\n Pointer to the core plugin handle, or null if it failed to load"] + pub fn metacall_plugin_core() -> *mut ::std::os::raw::c_void; +} +unsafe extern "C" { + #[doc = " @brief\n Get the plugin extension path to be used for accessing the plugins folder\n\n @return\n String containing the core plugin path, or null if it failed to load the plugin extension"] + pub fn metacall_plugin_path() -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Destroy MetaCall library"] + pub fn metacall_destroy(); +} +unsafe extern "C" { + #[doc = " @brief\n Provide the module version struct\n\n @return\n Static struct containing unpacked version"] + pub fn metacall_version() -> *const metacall_version_type; +} +unsafe extern "C" { + #[doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is @major,\n I is @minor and P is @patch\n\n @param[in] major\n Unsigned integer representing major version\n\n @param[in] minor\n Unsigned integer representing minor version\n\n @param[in] patch\n Unsigned integer representing patch version\n\n @return\n Hexadecimal integer containing packed version"] + pub fn metacall_version_hex_make( + major: ::std::os::raw::c_uint, + minor: ::std::os::raw::c_uint, + patch: ::std::os::raw::c_uint, + ) -> u32; +} +unsafe extern "C" { + #[doc = " @brief\n Provide the module version hexadecimal value\n with format 0xMMIIPPPP where M is major,\n I is minor and P is patch\n\n @return\n Hexadecimal integer containing packed version"] + pub fn metacall_version_hex() -> u32; +} +unsafe extern "C" { + #[doc = " @brief\n Provide the module version string\n\n @return\n Static string containing module version"] + pub fn metacall_version_str() -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Provide the module version revision string\n\n @return\n Static string containing module version revision"] + pub fn metacall_version_revision() -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Provide the module version name\n\n @return\n Static string containing module version name"] + pub fn metacall_version_name() -> *const ::std::os::raw::c_char; +} +unsafe extern "C" { + #[doc = " @brief\n Provide the module information\n\n @return\n Static string containing module information"] + pub fn metacall_print_info() -> *const ::std::os::raw::c_char; +} From 8dd3f55cc6209831e933c85615f30fb9d392f878 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 9 Sep 2025 21:55:09 +0200 Subject: [PATCH 453/487] Improved rs port. --- source/ports/rs_port/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/rs_port/build.rs b/source/ports/rs_port/build.rs index 98e2596bf..30c840a64 100644 --- a/source/ports/rs_port/build.rs +++ b/source/ports/rs_port/build.rs @@ -173,7 +173,7 @@ fn find_metacall_library() -> Result<LibraryPath, Box<dyn std::error::Error>> { .into()) } -fn define_library_search_path(env_var: &str, separator: &str, path: &PathBuf) -> String { +fn define_library_search_path(env_var: &str, separator: &str, path: &Path) -> String { // Get the current value of the env var, if any let existing = env::var(env_var).unwrap_or_default(); let path_str: String = String::from(path.to_str().unwrap()); From 9070d7fc4d5de02202d29384728dfe97f747cc19 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 9 Sep 2025 22:32:14 +0200 Subject: [PATCH 454/487] Exposed the rs port find method for metacall library. --- source/ports/rs_port/Cargo.toml | 5 +- source/ports/rs_port/README.md | 18 ++ source/ports/rs_port/build.rs | 255 +--------------------------- source/ports/rs_port/sys/Cargo.toml | 7 + source/ports/rs_port/sys/src/lib.rs | 255 ++++++++++++++++++++++++++++ source/ports/rs_port/upload.sh | 2 + 6 files changed, 288 insertions(+), 254 deletions(-) create mode 100644 source/ports/rs_port/sys/Cargo.toml create mode 100644 source/ports/rs_port/sys/src/lib.rs diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index c0ce796a1..781bafb19 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.5.0" +version = "0.5.1" [lib] crate-type = ["lib"] @@ -18,3 +18,6 @@ path = "src/lib.rs" [dependencies] metacall-inline = { path = "./inline", version = "0.2.0" } + +[build-dependencies] +metacall-sys = { path = "./sys", version = "0.1.0" } diff --git a/source/ports/rs_port/README.md b/source/ports/rs_port/README.md index 8b9a5531c..a29580a55 100644 --- a/source/ports/rs_port/README.md +++ b/source/ports/rs_port/README.md @@ -15,6 +15,24 @@ MetaCall is a C plugin based library. This crate wraps the C library into Rust, curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh ``` +# Linking + +If your project uses MetaCall in a folder that is not in the system path, we encourage to use `metacall-sys` crate as a `build-dependecy`. By this way you will be able to locate and link MetaCall directly in your build system. For example: + +`Cargo.toml`: +```toml +[build-dependencies] +metacall-sys = { path = "./sys", version = "0.1.0" } +``` + +`build.rs`: +```rust +fn main() { + // Find MetaCall library + metacall_sys::build(); +} +``` + # Example `sum.ts` diff --git a/source/ports/rs_port/build.rs b/source/ports/rs_port/build.rs index 30c840a64..efb09e8f6 100644 --- a/source/ports/rs_port/build.rs +++ b/source/ports/rs_port/build.rs @@ -1,255 +1,4 @@ -use std::{ - env, fs, - path::{Path, PathBuf}, - vec, -}; - -// Search for MetaCall libraries in platform-specific locations -// Handle custom installation paths via environment variables -// Find configuration files recursively -// Provide helpful error messages when things aren't found - -/// Represents the install paths for a platform -struct InstallPath { - paths: Vec<PathBuf>, - names: Vec<&'static str>, -} - -/// Represents the match of a library when it's found -struct LibraryPath { - path: PathBuf, - library: String, -} - -/// Find files recursively in a directory matching a pattern -fn find_files_recursively<P: AsRef<Path>>( - root_dir: P, - filename: &str, - max_depth: Option<usize>, -) -> Result<Vec<PathBuf>, Box<dyn std::error::Error>> { - let mut matches = Vec::new(); - let mut stack = vec![(root_dir.as_ref().to_path_buf(), 0)]; - - while let Some((current_dir, depth)) = stack.pop() { - if let Some(max) = max_depth { - if depth > max { - continue; - } - } - - if let Ok(entries) = fs::read_dir(¤t_dir) { - for entry in entries.flatten() { - let path = entry.path(); - - if path.is_file() { - // Simple filename comparison instead of regex - if let Some(file_name) = path.file_name().and_then(|n| n.to_str()) { - if file_name == filename { - matches.push(path); - } - } - } else if path.is_dir() { - stack.push((path, depth + 1)); - } - } - } - } - - Ok(matches) -} - -fn platform_install_paths() -> Result<InstallPath, Box<dyn std::error::Error>> { - if cfg!(target_os = "windows") { - // Defaults to path: C:\Users\Default\AppData\Local - let local_app_data = env::var("LOCALAPPDATA") - .unwrap_or_else(|_| String::from("C:\\Users\\Default\\AppData\\Local")); - - Ok(InstallPath { - paths: vec![PathBuf::from(local_app_data) - .join("MetaCall") - .join("metacall")], - names: vec!["metacall.lib"], - }) - } else if cfg!(target_os = "macos") { - Ok(InstallPath { - paths: vec![ - PathBuf::from("/opt/homebrew/lib/"), - PathBuf::from("/usr/local/lib/"), - ], - names: vec!["libmetacall.dylib"], - }) - } else if cfg!(target_os = "linux") { - Ok(InstallPath { - paths: vec![PathBuf::from("/usr/local/lib/"), PathBuf::from("/gnu/lib/")], - names: vec!["libmetacall.so"], - }) - } else { - Err(format!("Platform {} not supported", env::consts::OS).into()) - } -} - -/// Get search paths, checking for custom installation path first -fn get_search_config() -> Result<InstallPath, Box<dyn std::error::Error>> { - // First, check if user specified a custom path - if let Ok(custom_path) = env::var("METACALL_INSTALL_PATH") { - // For custom paths, we need to search for any metacall library variant - return Ok(InstallPath { - paths: vec![PathBuf::from(custom_path)], - names: vec![ - "libmetacall.so", - "libmetacalld.so", - "libmetacall.dylib", - "libmetacalld.dylib", - "metacall.lib", - "metacalld.lib", - ], - }); - } - - // Fall back to platform-specific paths - platform_install_paths() -} - -/// Get the parent path and library name -fn get_parent_and_library(path: &Path) -> Option<(PathBuf, String)> { - let parent = path.parent()?.to_path_buf(); - - // Get the file stem (filename without extension) - let stem = path.file_stem()?.to_str()?; - - // Remove "lib" prefix if present - let cleaned_stem = stem.strip_prefix("lib").unwrap_or(stem).to_string(); - - Some((parent, cleaned_stem)) -} - -/// Find the MetaCall library -/// This orchestrates the search process -fn find_metacall_library() -> Result<LibraryPath, Box<dyn std::error::Error>> { - let search_config = get_search_config()?; - - // Search in each configured path - for search_path in &search_config.paths { - for name in &search_config.names { - // Search with no limit in depth - match find_files_recursively(search_path, name, None) { - Ok(files) if !files.is_empty() => { - let found_lib = fs::canonicalize(&files[0])?; - - match get_parent_and_library(&found_lib) { - Some((parent, name)) => { - return Ok(LibraryPath { - path: parent, - library: name, - }) - } - None => continue, - }; - } - Ok(_) => { - // No files found in this path, continue searching - continue; - } - Err(e) => { - eprintln!("Error searching in {}: {}", search_path.display(), e); - continue; - } - } - } - } - - // If we get here, library wasn't found - let search_paths: Vec<String> = search_config - .paths - .iter() - .map(|p| p.display().to_string()) - .collect(); - - Err(format!( - "MetaCall library not found. Searched in: {}. \ - If you have it installed elsewhere, set METACALL_INSTALL_PATH environment variable.", - search_paths.join(", ") - ) - .into()) -} - -fn define_library_search_path(env_var: &str, separator: &str, path: &Path) -> String { - // Get the current value of the env var, if any - let existing = env::var(env_var).unwrap_or_default(); - let path_str: String = String::from(path.to_str().unwrap()); - - // Append to it - let combined = if existing.is_empty() { - path_str - } else { - format!("{}{}{}", existing, separator, path_str) - }; - - format!("{}={}", env_var, combined) -} - fn main() { - // When running tests from CMake - if let Ok(val) = env::var("PROJECT_OUTPUT_DIR") { - // Link search path to build folder - println!("cargo:rustc-link-search=native={val}"); - - // Link against correct version of metacall - match env::var("CMAKE_BUILD_TYPE") { - Ok(val) => { - if val == "Debug" { - // Try to link the debug version when running tests - println!("cargo:rustc-link-lib=dylib=metacalld"); - } else { - println!("cargo:rustc-link-lib=dylib=metacall"); - } - } - Err(_) => { - println!("cargo:rustc-link-lib=dylib=metacall"); - } - } - } else { - // When building from Cargo, try to find MetaCall - match find_metacall_library() { - Ok(lib_path) => { - // Define linker flags - println!("cargo:rustc-link-search=native={}", lib_path.path.display()); - println!("cargo:rustc-link-lib=dylib={}", lib_path.library); - - // Set the runtime environment variable for finding the library during tests - #[cfg(target_os = "linux")] - const ENV_VAR: &str = "LD_LIBRARY_PATH"; - - #[cfg(target_os = "macos")] - const ENV_VAR: &str = "DYLD_LIBRARY_PATH"; - - #[cfg(target_os = "windows")] - const ENV_VAR: &str = "PATH"; - - #[cfg(target_os = "aix")] - const ENV_VAR: &str = "LIBPATH"; - - #[cfg(any(target_os = "linux", target_os = "macos", target_os = "aix"))] - const SEPARATOR: &str = ":"; - - #[cfg(target_os = "windows")] - const SEPARATOR: &str = ";"; - - println!( - "cargo:rustc-env={}", - define_library_search_path(ENV_VAR, SEPARATOR, &lib_path.path) - ); - } - Err(e) => { - // Print the error - eprintln!( - "Failed to find MetaCall library with: {e} \ - Still trying to link in case the library is in system paths" - ); - - // Still try to link in case the library is in system paths - println!("cargo:rustc-link-lib=dylib=metacall") - } - } - } + // Find MetaCall library + metacall_sys::build(); } diff --git a/source/ports/rs_port/sys/Cargo.toml b/source/ports/rs_port/sys/Cargo.toml new file mode 100644 index 000000000..4e4b15ffa --- /dev/null +++ b/source/ports/rs_port/sys/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "metacall-sys" +version = "0.1.0" +repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" +edition = "2021" +license = "Apache-2.0" +description = "Crate for finding metacall library in the system." diff --git a/source/ports/rs_port/sys/src/lib.rs b/source/ports/rs_port/sys/src/lib.rs new file mode 100644 index 000000000..02814c532 --- /dev/null +++ b/source/ports/rs_port/sys/src/lib.rs @@ -0,0 +1,255 @@ +use std::{ + env, fs, + path::{Path, PathBuf}, + vec, +}; + +// Search for MetaCall libraries in platform-specific locations +// Handle custom installation paths via environment variables +// Find configuration files recursively +// Provide helpful error messages when things aren't found + +/// Represents the install paths for a platform +struct InstallPath { + paths: Vec<PathBuf>, + names: Vec<&'static str>, +} + +/// Represents the match of a library when it's found +struct LibraryPath { + path: PathBuf, + library: String, +} + +/// Find files recursively in a directory matching a pattern +fn find_files_recursively<P: AsRef<Path>>( + root_dir: P, + filename: &str, + max_depth: Option<usize>, +) -> Result<Vec<PathBuf>, Box<dyn std::error::Error>> { + let mut matches = Vec::new(); + let mut stack = vec![(root_dir.as_ref().to_path_buf(), 0)]; + + while let Some((current_dir, depth)) = stack.pop() { + if let Some(max) = max_depth { + if depth > max { + continue; + } + } + + if let Ok(entries) = fs::read_dir(¤t_dir) { + for entry in entries.flatten() { + let path = entry.path(); + + if path.is_file() { + // Simple filename comparison instead of regex + if let Some(file_name) = path.file_name().and_then(|n| n.to_str()) { + if file_name == filename { + matches.push(path); + } + } + } else if path.is_dir() { + stack.push((path, depth + 1)); + } + } + } + } + + Ok(matches) +} + +fn platform_install_paths() -> Result<InstallPath, Box<dyn std::error::Error>> { + if cfg!(target_os = "windows") { + // Defaults to path: C:\Users\Default\AppData\Local + let local_app_data = env::var("LOCALAPPDATA") + .unwrap_or_else(|_| String::from("C:\\Users\\Default\\AppData\\Local")); + + Ok(InstallPath { + paths: vec![PathBuf::from(local_app_data) + .join("MetaCall") + .join("metacall")], + names: vec!["metacall.lib"], + }) + } else if cfg!(target_os = "macos") { + Ok(InstallPath { + paths: vec![ + PathBuf::from("/opt/homebrew/lib/"), + PathBuf::from("/usr/local/lib/"), + ], + names: vec!["libmetacall.dylib"], + }) + } else if cfg!(target_os = "linux") { + Ok(InstallPath { + paths: vec![PathBuf::from("/usr/local/lib/"), PathBuf::from("/gnu/lib/")], + names: vec!["libmetacall.so"], + }) + } else { + Err(format!("Platform {} not supported", env::consts::OS).into()) + } +} + +/// Get search paths, checking for custom installation path first +fn get_search_config() -> Result<InstallPath, Box<dyn std::error::Error>> { + // First, check if user specified a custom path + if let Ok(custom_path) = env::var("METACALL_INSTALL_PATH") { + // For custom paths, we need to search for any metacall library variant + return Ok(InstallPath { + paths: vec![PathBuf::from(custom_path)], + names: vec![ + "libmetacall.so", + "libmetacalld.so", + "libmetacall.dylib", + "libmetacalld.dylib", + "metacall.lib", + "metacalld.lib", + ], + }); + } + + // Fall back to platform-specific paths + platform_install_paths() +} + +/// Get the parent path and library name +fn get_parent_and_library(path: &Path) -> Option<(PathBuf, String)> { + let parent = path.parent()?.to_path_buf(); + + // Get the file stem (filename without extension) + let stem = path.file_stem()?.to_str()?; + + // Remove "lib" prefix if present + let cleaned_stem = stem.strip_prefix("lib").unwrap_or(stem).to_string(); + + Some((parent, cleaned_stem)) +} + +/// Find the MetaCall library +/// This orchestrates the search process +fn find_metacall_library() -> Result<LibraryPath, Box<dyn std::error::Error>> { + let search_config = get_search_config()?; + + // Search in each configured path + for search_path in &search_config.paths { + for name in &search_config.names { + // Search with no limit in depth + match find_files_recursively(search_path, name, None) { + Ok(files) if !files.is_empty() => { + let found_lib = fs::canonicalize(&files[0])?; + + match get_parent_and_library(&found_lib) { + Some((parent, name)) => { + return Ok(LibraryPath { + path: parent, + library: name, + }) + } + None => continue, + }; + } + Ok(_) => { + // No files found in this path, continue searching + continue; + } + Err(e) => { + eprintln!("Error searching in {}: {}", search_path.display(), e); + continue; + } + } + } + } + + // If we get here, library wasn't found + let search_paths: Vec<String> = search_config + .paths + .iter() + .map(|p| p.display().to_string()) + .collect(); + + Err(format!( + "MetaCall library not found. Searched in: {}. \ + If you have it installed elsewhere, set METACALL_INSTALL_PATH environment variable.", + search_paths.join(", ") + ) + .into()) +} + +fn define_library_search_path(env_var: &str, separator: &str, path: &Path) -> String { + // Get the current value of the env var, if any + let existing = env::var(env_var).unwrap_or_default(); + let path_str: String = String::from(path.to_str().unwrap()); + + // Append to it + let combined = if existing.is_empty() { + path_str + } else { + format!("{}{}{}", existing, separator, path_str) + }; + + format!("{}={}", env_var, combined) +} + +pub fn build() { + // When running tests from CMake + if let Ok(val) = env::var("PROJECT_OUTPUT_DIR") { + // Link search path to build folder + println!("cargo:rustc-link-search=native={val}"); + + // Link against correct version of metacall + match env::var("CMAKE_BUILD_TYPE") { + Ok(val) => { + if val == "Debug" { + // Try to link the debug version when running tests + println!("cargo:rustc-link-lib=dylib=metacalld"); + } else { + println!("cargo:rustc-link-lib=dylib=metacall"); + } + } + Err(_) => { + println!("cargo:rustc-link-lib=dylib=metacall"); + } + } + } else { + // When building from Cargo, try to find MetaCall + match find_metacall_library() { + Ok(lib_path) => { + // Define linker flags + println!("cargo:rustc-link-search=native={}", lib_path.path.display()); + println!("cargo:rustc-link-lib=dylib={}", lib_path.library); + + // Set the runtime environment variable for finding the library during tests + #[cfg(target_os = "linux")] + const ENV_VAR: &str = "LD_LIBRARY_PATH"; + + #[cfg(target_os = "macos")] + const ENV_VAR: &str = "DYLD_LIBRARY_PATH"; + + #[cfg(target_os = "windows")] + const ENV_VAR: &str = "PATH"; + + #[cfg(target_os = "aix")] + const ENV_VAR: &str = "LIBPATH"; + + #[cfg(any(target_os = "linux", target_os = "macos", target_os = "aix"))] + const SEPARATOR: &str = ":"; + + #[cfg(target_os = "windows")] + const SEPARATOR: &str = ";"; + + println!( + "cargo:rustc-env={}", + define_library_search_path(ENV_VAR, SEPARATOR, &lib_path.path) + ); + } + Err(e) => { + // Print the error + eprintln!( + "Failed to find MetaCall library with: {e} \ + Still trying to link in case the library is in system paths" + ); + + // Still try to link in case the library is in system paths + println!("cargo:rustc-link-lib=dylib=metacall") + } + } + } +} diff --git a/source/ports/rs_port/upload.sh b/source/ports/rs_port/upload.sh index c85fac147..4156acb04 100644 --- a/source/ports/rs_port/upload.sh +++ b/source/ports/rs_port/upload.sh @@ -31,6 +31,8 @@ function publish() { } # Publish +cd sys +publish metacall-sys cd inline publish metacall-inline cd .. From 51884008ff573bfab69e5f2601e4dc105f0cfcda Mon Sep 17 00:00:00 2001 From: Fahd Ashour <fahd.fady212@gmail.com> Date: Tue, 16 Sep 2025 22:03:54 +0300 Subject: [PATCH 455/487] edit rs port readme and providing relatable links (#575) * edit rs port readme and providing relatable links * Update README.md --------- Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- source/ports/rs_port/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ports/rs_port/README.md b/source/ports/rs_port/README.md index a29580a55..d8cc3e256 100644 --- a/source/ports/rs_port/README.md +++ b/source/ports/rs_port/README.md @@ -17,12 +17,12 @@ curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | # Linking -If your project uses MetaCall in a folder that is not in the system path, we encourage to use `metacall-sys` crate as a `build-dependecy`. By this way you will be able to locate and link MetaCall directly in your build system. For example: +If your project uses MetaCall in a folder that is not in the system path, we encourage to use [`metacall-sys`](https://crates.io/crates/metacall-sys) crate as a [`build-dependecy`](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#build-dependencies). By this way you will be able to locate and link MetaCall directly in your build system. For example: `Cargo.toml`: ```toml [build-dependencies] -metacall-sys = { path = "./sys", version = "0.1.0" } +metacall-sys = "0.1.1" ``` `build.rs`: From 37fe7cfa563b343a2524582f4bf98e775c5f63db Mon Sep 17 00:00:00 2001 From: Fahd Ashour <fahd.fady212@gmail.com> Date: Tue, 16 Sep 2025 22:17:20 +0300 Subject: [PATCH 456/487] rust metacall-sys crate: enhance searching with RPATH handling for C Libs discovery across platforms (binary) and improve metacall-sys cargo (#576) * feat(rs metacall-sys): enhance searching with RPATH handling for library discovery across platforms (binary) * Update Cargo.toml * Update Cargo.toml * Update lib.rs --------- Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- source/ports/rs_port/sys/Cargo.toml | 12 +++++++-- source/ports/rs_port/sys/src/lib.rs | 42 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/source/ports/rs_port/sys/Cargo.toml b/source/ports/rs_port/sys/Cargo.toml index 4e4b15ffa..99378eac4 100644 --- a/source/ports/rs_port/sys/Cargo.toml +++ b/source/ports/rs_port/sys/Cargo.toml @@ -1,7 +1,15 @@ [package] name = "metacall-sys" -version = "0.1.0" -repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" +version = "0.1.1" +repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port/sys" +keywords = ["ffi", "bindings", "metacall"] edition = "2021" license = "Apache-2.0" description = "Crate for finding metacall library in the system." + +[lib] +crate-type = ["lib"] +doctest = false +edition = "2021" +name = "metacall_sys" +path = "src/lib.rs" diff --git a/source/ports/rs_port/sys/src/lib.rs b/source/ports/rs_port/sys/src/lib.rs index 02814c532..f33176aaf 100644 --- a/source/ports/rs_port/sys/src/lib.rs +++ b/source/ports/rs_port/sys/src/lib.rs @@ -188,6 +188,45 @@ fn define_library_search_path(env_var: &str, separator: &str, path: &Path) -> St format!("{}={}", env_var, combined) } +/// Set RPATH for runtime library discovery +/// This binaries work outside cargo +fn set_rpath(lib_path: &Path) { + let path_str = lib_path.to_str().unwrap(); + + #[cfg(target_os = "linux")] + { + // On Linux, use RPATH with $ORIGIN for relocatable binaries + println!("cargo:rustc-link-arg=-Wl,-rpath,{}", path_str); + // Also set a backup rpath relative to the executable location + println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN"); + println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN/../lib"); + } + + #[cfg(target_os = "macos")] + { + // On macOS, use @rpath and @loader_path + println!("cargo:rustc-link-arg=-Wl,-rpath,{}", path_str); + // Also set loader-relative paths for relocatable binaries + println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path"); + println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path/../lib"); + } + + #[cfg(target_os = "aix")] + { + // Add default system library paths to avoid breaking standard lookup + println!("cargo:rustc-link-arg=-Wl,-blibpath:{}:/usr/lib:/lib", path_str); + } + + #[cfg(target_os = "windows")] + { + // Windows doesn't use RPATH, but we can inform the user + println!( + "cargo:warning=On Windows, make sure {} is in your PATH or next to your executable", + path_str + ); + } +} + pub fn build() { // When running tests from CMake if let Ok(val) = env::var("PROJECT_OUTPUT_DIR") { @@ -216,6 +255,9 @@ pub fn build() { println!("cargo:rustc-link-search=native={}", lib_path.path.display()); println!("cargo:rustc-link-lib=dylib={}", lib_path.library); + // Set RPATH so the binary can find libraries at runtime + set_rpath(&lib_path.path); + // Set the runtime environment variable for finding the library during tests #[cfg(target_os = "linux")] const ENV_VAR: &str = "LD_LIBRARY_PATH"; From b50d11ca47001d738cd5587d7d9551d6ed779d61 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 16 Sep 2025 21:43:41 +0200 Subject: [PATCH 457/487] Trying windows rust test again. --- .github/workflows/release-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index 528eda6b7..ff564a74e 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] # TODO: , windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - name: Check out the repo uses: actions/checkout@v4 From b77ae9488e498f4749bf3c5cf00cdc05c7dc4cc7 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 16 Sep 2025 21:45:37 +0200 Subject: [PATCH 458/487] Improve rust ci. --- .github/workflows/release-rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index ff564a74e..fcfd917dc 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -6,6 +6,7 @@ on: push: branches: [ master, develop ] paths: + - '.github/workflows/release-rust.yml' - 'source/ports/rs_port/**' concurrency: From 3f1c5d05962ab93bd29edf3a01c3ae979e050915 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 16 Sep 2025 21:59:15 +0200 Subject: [PATCH 459/487] Remove windows. --- .github/workflows/release-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index fcfd917dc..9ef5e2ec1 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] # TODO: , windows-latest] steps: - name: Check out the repo uses: actions/checkout@v4 From 4d095b291b9caa5d7000acb29854f313ceb918c8 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 17 Sep 2025 21:36:24 +0200 Subject: [PATCH 460/487] Corrected versions of rs_port. --- source/ports/rs_port/Cargo.toml | 4 ++-- source/ports/rs_port/README.md | 2 +- source/ports/rs_port/sys/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index 781bafb19..c0e51713a 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.5.1" +version = "0.5.2" [lib] crate-type = ["lib"] @@ -20,4 +20,4 @@ path = "src/lib.rs" metacall-inline = { path = "./inline", version = "0.2.0" } [build-dependencies] -metacall-sys = { path = "./sys", version = "0.1.0" } +metacall-sys = { path = "./sys", version = "0.1.2" } diff --git a/source/ports/rs_port/README.md b/source/ports/rs_port/README.md index d8cc3e256..53edd0936 100644 --- a/source/ports/rs_port/README.md +++ b/source/ports/rs_port/README.md @@ -22,7 +22,7 @@ If your project uses MetaCall in a folder that is not in the system path, we enc `Cargo.toml`: ```toml [build-dependencies] -metacall-sys = "0.1.1" +metacall-sys = "0.1.2" ``` `build.rs`: diff --git a/source/ports/rs_port/sys/Cargo.toml b/source/ports/rs_port/sys/Cargo.toml index 99378eac4..398dcaf52 100644 --- a/source/ports/rs_port/sys/Cargo.toml +++ b/source/ports/rs_port/sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "metacall-sys" -version = "0.1.1" +version = "0.1.2" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port/sys" keywords = ["ffi", "bindings", "metacall"] edition = "2021" From c769cc88f24fd10b56ef5dd64b020a8e0c487a32 Mon Sep 17 00:00:00 2001 From: Thomas <thomas.gummerson@piql.com> Date: Thu, 18 Sep 2025 20:15:11 +0200 Subject: [PATCH 461/487] Replace relevant EXPECT_EQ / ASSERT_EQ with EXPECT_STREQ / ASSERT_STREQ (#579) --- .../tests/adt_trie_test/source/adt_trie_test.cpp | 4 ++-- source/tests/detour_test/source/detour_test.cpp | 2 +- .../tests/dynlink_test/source/dynlink_test.cpp | 6 +++--- .../environment_test/source/environment_test.cpp | 12 ++++++------ source/tests/log_test/source/log_test.cpp | 2 +- .../metacall_configuration_exec_path_test.cpp | 2 +- ...all_configuration_exec_relative_path_test.cpp | 2 +- .../metacall_cs_test/source/metacall_cs_test.cpp | 2 +- .../source/metacall_distributable_test.cpp | 10 +++++----- .../source/metacall_ducktype_test.cpp | 8 ++++---- .../source/metacall_function_test.cpp | 2 +- .../source/metacall_handle_get_test.cpp | 4 ++-- .../source/metacall_java_test.cpp | 4 ++-- .../source/metacall_load_configuration_test.cpp | 6 +++--- .../source/metacall_map_await_test.cpp | 2 +- .../source/metacall_map_test.cpp | 2 +- .../source/metacall_node_exception_test.cpp | 4 ++-- .../source/metacall_node_extension_test.cpp | 2 +- .../source/metacall_node_port_test.cpp | 2 +- .../source/metacall_python_dict_test.cpp | 6 +++--- .../source/metacall_python_exception_test.cpp | 8 ++++---- .../source/metacall_python_loader_port_test.cpp | 4 ++-- .../source/metacall_python_open_test.cpp | 4 ++-- .../source/metacall_python_port_test.cpp | 2 +- .../source/metacall_return_monad_test.cpp | 2 +- .../metacall_ruby_parser_integration_test.cpp | 2 +- .../metacall_rust_load_from_package_dep_test.cpp | 2 +- .../metacall_rust_load_from_package_test.cpp | 2 +- .../source/metacall_rust_test.cpp | 4 ++-- .../tests/metacall_test/source/metacall_test.cpp | 12 ++++++------ .../metacall_test/source/metacall_test_split.cpp | 10 +++++----- .../source/metacall_typescript_tsx_test.cpp | 2 +- .../source/metacall_version_test.cpp | 2 +- .../source/reflect_object_class_test.cpp | 4 ++-- source/tests/serial_test/source/serial_test.cpp | 16 ++++++++-------- 35 files changed, 80 insertions(+), 80 deletions(-) diff --git a/source/tests/adt_trie_test/source/adt_trie_test.cpp b/source/tests/adt_trie_test/source/adt_trie_test.cpp index cb1edbf28..1d9541dc0 100644 --- a/source/tests/adt_trie_test/source/adt_trie_test.cpp +++ b/source/tests/adt_trie_test/source/adt_trie_test.cpp @@ -123,7 +123,7 @@ TEST_F(adt_trie_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "%" PRIuS " -> %s", iterator, value_str); - EXPECT_EQ((int)0, (int)strcmp(values_str[keys_size - iterator - 1], value_str)); + EXPECT_STREQ(values_str[keys_size - iterator - 1], value_str); vector_pop_back(keys_copy); } @@ -144,7 +144,7 @@ TEST_F(adt_trie_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "%s/", key_str); - EXPECT_EQ((int)0, (int)strcmp(keys_str[iterator], key_str)); + EXPECT_STREQ(keys_str[iterator], key_str); } vector_pop_back(keys); diff --git a/source/tests/detour_test/source/detour_test.cpp b/source/tests/detour_test/source/detour_test.cpp index 15b56ec58..4882867e8 100644 --- a/source/tests/detour_test/source/detour_test.cpp +++ b/source/tests/detour_test/source/detour_test.cpp @@ -111,7 +111,7 @@ TEST_F(detour_test, DefaultConstructor) ASSERT_NE((detour)NULL, (detour)d); - EXPECT_EQ((int)0, (int)strcmp(name, detour_name(d))); + EXPECT_STREQ(name, detour_name(d)); /* Load detour of detour library */ handle = detour_load_file(d, NULL); diff --git a/source/tests/dynlink_test/source/dynlink_test.cpp b/source/tests/dynlink_test/source/dynlink_test.cpp index 8bebf4526..0119510ca 100644 --- a/source/tests/dynlink_test/source/dynlink_test.cpp +++ b/source/tests/dynlink_test/source/dynlink_test.cpp @@ -101,7 +101,7 @@ TEST_F(dynlink_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_path(handle)); - EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); + EXPECT_STREQ(library_name, dynlink_get_name(handle)); if (handle != NULL) { @@ -146,8 +146,8 @@ TEST_F(dynlink_test, DefaultConstructor) log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file name: %s", dynlink_get_path(handle)); log_write("metacall", LOG_LEVEL_DEBUG, "Dynamic linked shared object file: %s", dynlink_get_name(handle)); - EXPECT_EQ((int)0, (int)strcmp(absolute_path, dynlink_get_path(handle))); - EXPECT_EQ((int)0, (int)strcmp(library_name, dynlink_get_name(handle))); + EXPECT_STREQ(absolute_path, dynlink_get_path(handle)); + EXPECT_STREQ(library_name, dynlink_get_name(handle)); if (handle != NULL) { diff --git a/source/tests/environment_test/source/environment_test.cpp b/source/tests/environment_test/source/environment_test.cpp index dee634141..576dfb28a 100644 --- a/source/tests/environment_test/source/environment_test.cpp +++ b/source/tests/environment_test/source/environment_test.cpp @@ -39,7 +39,7 @@ TEST_F(environment_test, variable_text) ASSERT_NE((const char *)NULL, (const char *)variable_text); - EXPECT_EQ((int)0, (int)strcmp(variable_text, "abcd")); + EXPECT_STREQ(variable_text, "abcd"); environment_variable_destroy(variable_text); } @@ -52,7 +52,7 @@ TEST_F(environment_test, variable_text_default) ASSERT_NE((const char *)NULL, (const char *)variable_text); - EXPECT_EQ((int)0, (int)strcmp(variable_text, "default")); + EXPECT_STREQ(variable_text, "default"); environment_variable_destroy(variable_text); } @@ -63,7 +63,7 @@ TEST_F(environment_test, variable_static) const char *variable_text_static = environment_variable_get(variable_text_name, "default"); - EXPECT_EQ((int)0, (int)strcmp(variable_text_static, "abcd")); + EXPECT_STREQ(variable_text_static, "abcd"); } TEST_F(environment_test, variable_path) @@ -74,7 +74,7 @@ TEST_F(environment_test, variable_path) ASSERT_NE((const char *)NULL, (const char *)variable_path); - EXPECT_EQ((int)0, (int)strcmp(variable_path, "abcd" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR)); + EXPECT_STREQ(variable_path, "abcd" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR); environment_variable_path_destroy(variable_path); } @@ -87,7 +87,7 @@ TEST_F(environment_test, variable_path_default) ASSERT_NE((const char *)NULL, (const char *)variable_path); - EXPECT_EQ((int)0, (int)strcmp(variable_path, "default_path" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR)); + EXPECT_STREQ(variable_path, "default_path" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR); environment_variable_path_destroy(variable_path); } @@ -100,7 +100,7 @@ TEST_F(environment_test, variable_path_sanitized) ASSERT_NE((const char *)NULL, (const char *)variable_path); - EXPECT_EQ((int)0, (int)strcmp(variable_path, "abcd" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR)); + EXPECT_STREQ(variable_path, "abcd" ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR); environment_variable_path_destroy(variable_path); } diff --git a/source/tests/log_test/source/log_test.cpp b/source/tests/log_test/source/log_test.cpp index 2a1505e71..3e1121bc7 100644 --- a/source/tests/log_test/source/log_test.cpp +++ b/source/tests/log_test/source/log_test.cpp @@ -85,7 +85,7 @@ TEST_F(log_test, DefaultConstructor) unsigned int value = *((unsigned int *)value_ptr); - EXPECT_EQ((int)0, (int)strcmp(log_name_list[value].name, key)); + EXPECT_STREQ(log_name_list[value].name, key); } EXPECT_EQ((int)log_map_destroy(map), (int)0); diff --git a/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp b/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp index 7458311c0..0219e58aa 100644 --- a/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp +++ b/source/tests/metacall_configuration_exec_path_test/source/metacall_configuration_exec_path_test.cpp @@ -49,7 +49,7 @@ TEST_F(metacall_configuration_exec_path_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Python hello_world: test")); + EXPECT_STREQ(metacall_value_to_string(ret), "Python hello_world: test"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_configuration_exec_relative_path_test/source/metacall_configuration_exec_relative_path_test.cpp b/source/tests/metacall_configuration_exec_relative_path_test/source/metacall_configuration_exec_relative_path_test.cpp index 9257ec918..cd56aa446 100644 --- a/source/tests/metacall_configuration_exec_relative_path_test/source/metacall_configuration_exec_relative_path_test.cpp +++ b/source/tests/metacall_configuration_exec_relative_path_test/source/metacall_configuration_exec_relative_path_test.cpp @@ -49,7 +49,7 @@ TEST_F(metacall_configuration_exec_relative_path_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Python hello_world: test")); + EXPECT_STREQ(metacall_value_to_string(ret), "Python hello_world: test"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_cs_test/source/metacall_cs_test.cpp b/source/tests/metacall_cs_test/source/metacall_cs_test.cpp index 769382b15..799b24ec0 100644 --- a/source/tests/metacall_cs_test/source/metacall_cs_test.cpp +++ b/source/tests/metacall_cs_test/source/metacall_cs_test.cpp @@ -81,7 +81,7 @@ TEST_F(metacall_cs_test, Concat) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp((const char *)metacall_value_to_string(ret), "Hello World")); + EXPECT_STREQ((const char *)metacall_value_to_string(ret), "Hello World"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp b/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp index 59138c84e..30b2033cb 100644 --- a/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp +++ b/source/tests/metacall_distributable_test/source/metacall_distributable_test.cpp @@ -106,7 +106,7 @@ TEST_F(metacall_distributable_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello Universe")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello Universe"); metacall_value_destroy(ret); } @@ -143,7 +143,7 @@ TEST_F(metacall_distributable_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello meta-programmer!")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello meta-programmer!"); metacall_value_destroy(ret); @@ -193,7 +193,7 @@ TEST_F(metacall_distributable_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "abcdef")); + EXPECT_STREQ(metacall_value_to_string(ret), "abcdef"); metacall_value_destroy(ret); @@ -201,7 +201,7 @@ TEST_F(metacall_distributable_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "efg")); + EXPECT_STREQ(metacall_value_to_string(ret), "efg"); metacall_value_destroy(ret); } @@ -246,7 +246,7 @@ TEST_F(metacall_distributable_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello World")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello World"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp b/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp index b9555204a..0b8e2e2e8 100644 --- a/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp +++ b/source/tests/metacall_ducktype_test/source/metacall_ducktype_test.cpp @@ -123,7 +123,7 @@ TEST_F(metacall_ducktype_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_cast_string(&ret), "Hello Universe")); + EXPECT_STREQ(metacall_value_cast_string(&ret), "Hello Universe"); metacall_value_destroy(ret); @@ -209,7 +209,7 @@ TEST_F(metacall_ducktype_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_cast_string(&ret), "PepicoWalas")); + EXPECT_STREQ(metacall_value_cast_string(&ret), "PepicoWalas"); metacall_value_destroy(ret); metacall_value_destroy(args[0]); @@ -260,7 +260,7 @@ TEST_F(metacall_ducktype_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_cast_string(&ret), "Hello meta-programmer!")); + EXPECT_STREQ(metacall_value_cast_string(&ret), "Hello meta-programmer!"); metacall_value_destroy(ret); @@ -344,7 +344,7 @@ TEST_F(metacall_ducktype_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_cast_string(&ret), "abcdef")); + EXPECT_STREQ(metacall_value_cast_string(&ret), "abcdef"); metacall_value_destroy(ret); diff --git a/source/tests/metacall_function_test/source/metacall_function_test.cpp b/source/tests/metacall_function_test/source/metacall_function_test.cpp index 950bf6b1a..8b837151a 100644 --- a/source/tests/metacall_function_test/source/metacall_function_test.cpp +++ b/source/tests/metacall_function_test/source/metacall_function_test.cpp @@ -221,7 +221,7 @@ TEST_F(metacall_function_test, DefaultConstructor) EXPECT_EQ((enum metacall_value_id)METACALL_STRING, (enum metacall_value_id)metacall_value_id(ret)); - EXPECT_EQ((int)0, (int)strcmp("hello world", metacall_value_to_string(ret))); + EXPECT_STREQ("hello world", metacall_value_to_string(ret)); metacall_value_destroy(ret); diff --git a/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp b/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp index fff68579b..2e8013038 100644 --- a/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp +++ b/source/tests/metacall_handle_get_test/source/metacall_handle_get_test.cpp @@ -113,7 +113,7 @@ TEST_F(metacall_handle_get_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello from s1")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello from s1"); metacall_value_destroy(ret); @@ -135,7 +135,7 @@ TEST_F(metacall_handle_get_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello from s2")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello from s2"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_java_test/source/metacall_java_test.cpp b/source/tests/metacall_java_test/source/metacall_java_test.cpp index 996ff70ca..5eb6141cc 100644 --- a/source/tests/metacall_java_test/source/metacall_java_test.cpp +++ b/source/tests/metacall_java_test/source/metacall_java_test.cpp @@ -102,8 +102,8 @@ TEST_F(metacall_java_test, DefaultConstructor) { //GET ARRAYS void *str_test = metacall_class_static_get(myclass, "STRING_TEST_Arr"); void **str_test_arr = metacall_value_to_array(str_test); - ASSERT_EQ((int)0, (int)strcmp(metacall_value_to_string(str_test_arr[0]), "Hello")); - ASSERT_EQ((int)0, (int)strcmp(metacall_value_to_string(str_test_arr[1]), "world")); + ASSERT_STREQ(metacall_value_to_string(str_test_arr[0]), "Hello"); + ASSERT_STREQ(metacall_value_to_string(str_test_arr[1]), "world"); metacall_value_destroy(str_test); void *class_test = metacall_class_static_get(myclass, "CLASS_TEST_Arr"); diff --git a/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp b/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp index 5562783fa..21657b9c8 100644 --- a/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp +++ b/source/tests/metacall_load_configuration_test/source/metacall_load_configuration_test.cpp @@ -108,7 +108,7 @@ TEST_F(metacall_load_configuration_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello Universe")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello Universe"); metacall_value_destroy(ret); @@ -192,7 +192,7 @@ TEST_F(metacall_load_configuration_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello Universe")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello Universe"); metacall_value_destroy(ret); } @@ -225,7 +225,7 @@ TEST_F(metacall_load_configuration_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello meta-programmer!")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello meta-programmer!"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp b/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp index 7c68df229..d3f1d4eb7 100644 --- a/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp +++ b/source/tests/metacall_map_await_test/source/metacall_map_await_test.cpp @@ -96,7 +96,7 @@ static void *hello_world_await_ok(void *result, void *data) fflush(stdout); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(result), "Hello World")); + EXPECT_STREQ(metacall_value_to_string(result), "Hello World"); ++success_callbacks; diff --git a/source/tests/metacall_map_test/source/metacall_map_test.cpp b/source/tests/metacall_map_test/source/metacall_map_test.cpp index 5f98a5a5f..84d641f4d 100644 --- a/source/tests/metacall_map_test/source/metacall_map_test.cpp +++ b/source/tests/metacall_map_test/source/metacall_map_test.cpp @@ -201,7 +201,7 @@ TEST_F(metacall_map_test, DefaultConstructor) ASSERT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "ACK: OK!")); + EXPECT_STREQ(metacall_value_to_string(ret), "ACK: OK!"); metacall_value_destroy(ret); */ diff --git a/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp b/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp index 9de810277..fd1c3b2e2 100644 --- a/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp +++ b/source/tests/metacall_node_exception_test/source/metacall_node_exception_test.cpp @@ -53,7 +53,7 @@ TEST_F(metacall_node_exception_test, DefaultConstructor) EXPECT_EQ((int)0, (int)metacall_error_from_value(ret, &ex)); - EXPECT_EQ((int)0, (int)strcmp("Yeet", ex.message)); + EXPECT_STREQ("Yeet", ex.message); metacall_value_destroy(ret); @@ -61,7 +61,7 @@ TEST_F(metacall_node_exception_test, DefaultConstructor) EXPECT_EQ((int)0, (int)metacall_error_from_value(ret, &ex)); - EXPECT_EQ((int)0, (int)strcmp("YeetThrown", ex.message)); + EXPECT_STREQ("YeetThrown", ex.message); metacall_value_destroy(ret); diff --git a/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp b/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp index 4e0986485..ef5fd6caf 100644 --- a/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp +++ b/source/tests/metacall_node_extension_test/source/metacall_node_extension_test.cpp @@ -52,7 +52,7 @@ TEST_F(metacall_node_extension_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp("world", metacall_value_to_string(ret))); + EXPECT_STREQ("world", metacall_value_to_string(ret)); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp b/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp index 081bf8337..ab1d6df11 100644 --- a/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp +++ b/source/tests/metacall_node_port_test/source/metacall_node_port_test.cpp @@ -59,7 +59,7 @@ TEST_F(metacall_node_port_test, DefaultConstructor) struct await_data_type *await_data = static_cast<struct await_data_type *>(data); std::unique_lock<std::mutex> lock(await_data->m); const char *str = metacall_value_to_string(v); - EXPECT_EQ((int)0, (int)strcmp(str, "Tests passed without errors")); + EXPECT_STREQ(str, "Tests passed without errors"); await_data->c.notify_one(); return NULL; }; diff --git a/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp b/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp index cab84c549..f5db7671c 100644 --- a/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp +++ b/source/tests/metacall_python_dict_test/source/metacall_python_dict_test.cpp @@ -61,7 +61,7 @@ TEST_F(metacall_python_dict_test, DefaultConstructor) } else if (strcmp(key, "hello") == 0) { - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(array[1]), "world")); + EXPECT_STREQ(metacall_value_to_string(array[1]), "world"); } else if (strcmp(key, "efg") == 0) { @@ -134,14 +134,14 @@ TEST_F(metacall_python_dict_test, DefaultConstructor) char *ret_key0 = metacall_value_to_string(ret_pair0[0]); long ret_value0 = metacall_value_to_long(ret_pair0[1]); - EXPECT_EQ((int)0, (int)strcmp(ret_key0, "new")); + EXPECT_STREQ(ret_key0, "new"); EXPECT_EQ((long)5, (long)ret_value0); void **ret_pair1 = metacall_value_to_array(ret_map[1]); char *ret_key1 = metacall_value_to_string(ret_pair1[0]); long ret_value1 = metacall_value_to_long(ret_pair1[1]); - EXPECT_EQ((int)0, (int)strcmp(ret_key1, "whatever")); + EXPECT_STREQ(ret_key1, "whatever"); EXPECT_EQ((long)7, (long)ret_value1); metacall_value_destroy(ret); diff --git a/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp b/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp index 8d902ced5..14ec35d75 100644 --- a/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp +++ b/source/tests/metacall_python_exception_test/source/metacall_python_exception_test.cpp @@ -54,9 +54,9 @@ TEST_F(metacall_python_exception_test, DefaultConstructor) EXPECT_EQ((int)0, (int)metacall_error_from_value(ret, &ex)); - EXPECT_EQ((int)0, (int)strcmp("yeet", ex.message)); + EXPECT_STREQ("yeet", ex.message); - EXPECT_EQ((int)0, (int)strcmp("TypeError", ex.label)); + EXPECT_STREQ("TypeError", ex.label); metacall_value_destroy(ret); @@ -64,9 +64,9 @@ TEST_F(metacall_python_exception_test, DefaultConstructor) EXPECT_EQ((int)0, (int)metacall_error_from_value(ret, &ex)); - EXPECT_EQ((int)0, (int)strcmp("asdf", ex.message)); + EXPECT_STREQ("asdf", ex.message); - EXPECT_EQ((int)0, (int)strcmp("BaseException", ex.label)); + EXPECT_STREQ("BaseException", ex.label); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp b/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp index 106797f36..ffa904326 100644 --- a/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp +++ b/source/tests/metacall_python_loader_port_test/source/metacall_python_loader_port_test.cpp @@ -37,7 +37,7 @@ void *callback_host(size_t argc, void *args[], void *data) printf("Host callback: %s\n", str); - EXPECT_EQ((int)0, (int)strcmp(str, "some text")); + EXPECT_STREQ(str, "some text"); return metacall_value_create_int(25); } @@ -86,7 +86,7 @@ TEST_F(metacall_python_loader_port_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_cast_string(&ret), "Hello meta-programmer!")); + EXPECT_STREQ(metacall_value_cast_string(&ret), "Hello meta-programmer!"); metacall_value_destroy(ret); diff --git a/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp b/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp index 3eda60fe5..0174eb61f 100644 --- a/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp +++ b/source/tests/metacall_python_open_test/source/metacall_python_open_test.cpp @@ -49,7 +49,7 @@ TEST_F(metacall_python_open_test, DefaultConstructor) const char *result = metacall_value_to_string(ret); - EXPECT_NE((int)0, (int)strcmp(result, "<html><head></head><body>Error</body></html>")); + EXPECT_STRNE(result, "<html><head></head><body>Error</body></html>"); metacall_value_destroy(ret); @@ -65,7 +65,7 @@ TEST_F(metacall_python_open_test, DefaultConstructor) const char *token = metacall_value_to_string(ret); - EXPECT_EQ((int)0, (int)strcmp(token, "eyJhbGciOiJIUzI1NiJ9.SGVsbG8gV29ybGQ.Iyc6PWVbK538giVdaInTeIO3jvvC1Vuy_czZUzoRRec")); + EXPECT_STREQ(token, "eyJhbGciOiJIUzI1NiJ9.SGVsbG8gV29ybGQ.Iyc6PWVbK538giVdaInTeIO3jvvC1Vuy_czZUzoRRec"); metacall_value_destroy(args[0]); diff --git a/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp b/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp index a86f7f111..7ebb7c236 100644 --- a/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp +++ b/source/tests/metacall_python_port_test/source/metacall_python_port_test.cpp @@ -46,7 +46,7 @@ TEST_F(metacall_python_port_test, DefaultConstructor) void *ret = metacallv("main", metacall_null_args); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Tests passed without errors")); + EXPECT_STREQ(metacall_value_to_string(ret), "Tests passed without errors"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp b/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp index dfcf6e70c..5194d3ab8 100644 --- a/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp +++ b/source/tests/metacall_return_monad_test/source/metacall_return_monad_test.cpp @@ -78,7 +78,7 @@ TEST_F(metacall_return_monad_test, DefaultConstructor) EXPECT_EQ((enum metacall_value_id)METACALL_STRING, (enum metacall_value_id)metacall_value_id(ret)); - EXPECT_EQ((int)0, (int)strcmp("asd", metacall_value_to_string(ret))); + EXPECT_STREQ("asd", metacall_value_to_string(ret)); value_str = metacall_serialize(metacall_serial(), ret, &size, allocator); diff --git a/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp b/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp index b269fd9c2..0e38e65ac 100644 --- a/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp +++ b/source/tests/metacall_ruby_parser_integration_test/source/metacall_ruby_parser_integration_test.cpp @@ -74,7 +74,7 @@ TEST_F(metacall_ruby_parser_integration_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "call")); + EXPECT_STREQ(metacall_value_to_string(ret), "call"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp b/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp index bc2d7930c..565883bc2 100644 --- a/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp +++ b/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp @@ -40,7 +40,7 @@ TEST_F(metacall_rust_load_from_package_dep_test, DefaultConstructor) const char *text = "{\"name\": \"John Doe\"}"; void *ret = metacall("compile", text); ASSERT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "\"John Doe\"")); + EXPECT_STREQ(metacall_value_to_string(ret), "\"John Doe\""); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp b/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp index 37f6394bb..cfb3b4995 100644 --- a/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp +++ b/source/tests/metacall_rust_load_from_package_test/source/metacall_rust_load_from_package_test.cpp @@ -93,7 +93,7 @@ TEST_F(metacall_rust_load_from_mem_test, DefaultConstructor) // void *ret = metacall("string_len", "Test String"); // EXPECT_EQ((long)11, (long)metacall_value_to_long(ret)); // ret = metacall("new_string", 123); - // EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "get number 123")); + // EXPECT_STREQ(metacall_value_to_string(ret), "get number 123"); // metacall_value_destroy(ret); // } diff --git a/source/tests/metacall_rust_test/source/metacall_rust_test.cpp b/source/tests/metacall_rust_test/source/metacall_rust_test.cpp index 85b9253da..55736c73e 100644 --- a/source/tests/metacall_rust_test/source/metacall_rust_test.cpp +++ b/source/tests/metacall_rust_test/source/metacall_rust_test.cpp @@ -94,13 +94,13 @@ TEST_F(metacall_rust_test, DefaultConstructor) // void *ret = metacall("string_len", "Test String"); // EXPECT_EQ((long)11, (long)metacall_value_to_long(ret)); // ret = metacall("new_string", 123); - // EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "get number 123")); + // EXPECT_STREQ(metacall_value_to_string(ret), "get number 123"); // metacall_value_destroy(ret); // } { void *ret = metacall("str_slice", "hellow"); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "hel")); + EXPECT_STREQ(metacall_value_to_string(ret), "hel"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_test/source/metacall_test.cpp b/source/tests/metacall_test/source/metacall_test.cpp index 3f250b3cd..ddbf10c03 100644 --- a/source/tests/metacall_test/source/metacall_test.cpp +++ b/source/tests/metacall_test/source/metacall_test.cpp @@ -216,7 +216,7 @@ TEST_F(metacall_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello Universe")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello Universe"); metacall_value_destroy(ret); @@ -276,7 +276,7 @@ TEST_F(metacall_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), web_content)); + EXPECT_STREQ(metacall_value_to_string(ret), web_content); metacall_value_destroy(ret); @@ -353,7 +353,7 @@ TEST_F(metacall_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello meta-programmer!")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello meta-programmer!"); metacall_value_destroy(ret); @@ -420,7 +420,7 @@ TEST_F(metacall_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "abcdef")); + EXPECT_STREQ(metacall_value_to_string(ret), "abcdef"); metacall_value_destroy(ret); @@ -428,7 +428,7 @@ TEST_F(metacall_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "efg")); + EXPECT_STREQ(metacall_value_to_string(ret), "efg"); metacall_value_destroy(ret); } @@ -473,7 +473,7 @@ TEST_F(metacall_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "Hello World")); + EXPECT_STREQ(metacall_value_to_string(ret), "Hello World"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_test/source/metacall_test_split.cpp b/source/tests/metacall_test/source/metacall_test_split.cpp index 49d0fc8f1..0a19bce6a 100644 --- a/source/tests/metacall_test/source/metacall_test_split.cpp +++ b/source/tests/metacall_test/source/metacall_test_split.cpp @@ -131,7 +131,7 @@ TEST_F(metacall_loader_test, Python) EXPECT_NE((value)NULL, (value)ret); - EXPECT_EQ((int)0, (int)strcmp(value_to_string(ret), "Hello Universe")); + EXPECT_STREQ(value_to_string(ret), "Hello Universe"); value_destroy(ret); } @@ -167,7 +167,7 @@ TEST_F(metacall_loader_test, Ruby) EXPECT_NE((value)NULL, (value)ret); - EXPECT_EQ((int)0, (int)strcmp(value_to_string(ret), "Hello meta-programmer!")); + EXPECT_STREQ(value_to_string(ret), "Hello meta-programmer!"); value_destroy(ret); } @@ -207,7 +207,7 @@ TEST_F(metacall_loader_test, JavascriptV8) EXPECT_NE((value)NULL, (value)ret); - EXPECT_EQ((int)0, (int)strcmp(value_to_string(ret), "abcdef")); + EXPECT_STREQ(value_to_string(ret), "abcdef"); value_destroy(ret); } @@ -251,7 +251,7 @@ TEST_F(metacall_loader_test, Mock) EXPECT_NE((value)NULL, (value)ret); - EXPECT_EQ((int)0, (int)strcmp(value_to_string(ret), "Hello World")); + EXPECT_STREQ(value_to_string(ret), "Hello World"); value_destroy(ret); @@ -259,7 +259,7 @@ TEST_F(metacall_loader_test, Mock) EXPECT_NE((value)NULL, (value)ret); - EXPECT_EQ((int)0, (int)strcmp(value_to_string(ret), "Hello World")); + EXPECT_STREQ(value_to_string(ret), "Hello World"); value_destroy(ret); } diff --git a/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp b/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp index 16404c17d..52a406737 100644 --- a/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp +++ b/source/tests/metacall_typescript_tsx_test/source/metacall_typescript_tsx_test.cpp @@ -52,7 +52,7 @@ TEST_F(metacall_tsx_test, DefaultConstructor) EXPECT_NE((void *)NULL, (void *)ret); - EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "<h1 data-reactroot=\"\">Hello metaprogrammer</h1>")); + EXPECT_STREQ(metacall_value_to_string(ret), "<h1 data-reactroot=\"\">Hello metaprogrammer</h1>"); metacall_value_destroy(ret); } diff --git a/source/tests/metacall_version_test/source/metacall_version_test.cpp b/source/tests/metacall_version_test/source/metacall_version_test.cpp index b7023840b..ef703c79a 100644 --- a/source/tests/metacall_version_test/source/metacall_version_test.cpp +++ b/source/tests/metacall_version_test/source/metacall_version_test.cpp @@ -31,7 +31,7 @@ TEST_F(metacall_version_test, DefaultConstructor) { metacall_print_info(); - ASSERT_EQ((int)0, (int)strcmp(METACALL_VERSION, metacall_version_str())); + ASSERT_STREQ(METACALL_VERSION, metacall_version_str()); /* TODO: Test other version functions */ } diff --git a/source/tests/reflect_object_class_test/source/reflect_object_class_test.cpp b/source/tests/reflect_object_class_test/source/reflect_object_class_test.cpp index a0d7e0cc2..1abd68347 100644 --- a/source/tests/reflect_object_class_test/source/reflect_object_class_test.cpp +++ b/source/tests/reflect_object_class_test/source/reflect_object_class_test.cpp @@ -500,7 +500,7 @@ TEST_F(reflect_object_class_test, DefaultConstructor) ASSERT_NE((value)NULL, (value)ret); - ASSERT_EQ((int)0, (int)strcmp(value_to_string(ret), "Hello World")); + ASSERT_STREQ(value_to_string(ret), "Hello World"); value_type_destroy(ret); @@ -557,7 +557,7 @@ TEST_F(reflect_object_class_test, DefaultConstructor) ASSERT_NE((value)NULL, (value)ret); - ASSERT_EQ((int)0, (int)strcmp(value_to_string(ret), "Hello World")); + ASSERT_STREQ(value_to_string(ret), "Hello World"); value_type_destroy(ret); diff --git a/source/tests/serial_test/source/serial_test.cpp b/source/tests/serial_test/source/serial_test.cpp index 921a417bb..bf2d158ac 100644 --- a/source/tests/serial_test/source/serial_test.cpp +++ b/source/tests/serial_test/source/serial_test.cpp @@ -35,9 +35,9 @@ class serial_test : public testing::Test ASSERT_NE((serial)NULL, (serial)s); - EXPECT_EQ((int)0, (int)strcmp(name, serial_name(s))); + EXPECT_STREQ(name, serial_name(s)); - EXPECT_EQ((int)0, (int)strcmp(extension, serial_extension(s))); + EXPECT_STREQ(extension, serial_extension(s)); } const char *rapid_json_name() @@ -140,7 +140,7 @@ TEST_F(serial_test, DefaultConstructor) EXPECT_EQ((size_t)sizeof(value_list_str), (size_t)serialize_size); EXPECT_NE((char *)NULL, (char *)buffer); - EXPECT_EQ((int)0, (int)strcmp(buffer, value_list_str)); + EXPECT_STREQ(buffer, value_list_str); value_destroy(v); @@ -161,7 +161,7 @@ TEST_F(serial_test, DefaultConstructor) EXPECT_EQ((size_t)sizeof(value_map_str), (size_t)serialize_size); EXPECT_NE((value)NULL, (value)v); - EXPECT_EQ((int)0, (int)strcmp(buffer, value_map_str)); + EXPECT_STREQ(buffer, value_map_str); value *v_map = value_to_map(v); @@ -189,7 +189,7 @@ TEST_F(serial_test, DefaultConstructor) EXPECT_EQ((size_t)sizeof(json_empty_array), (size_t)serialize_size); EXPECT_NE((value)NULL, (value)v); - EXPECT_EQ((int)0, (int)strcmp(buffer, json_empty_array)); + EXPECT_STREQ(buffer, json_empty_array); value_destroy(v); @@ -206,7 +206,7 @@ TEST_F(serial_test, DefaultConstructor) EXPECT_NE((value *)NULL, (value *)v_array); EXPECT_EQ((type_id)TYPE_STRING, (type_id)value_type_id(v_array[0])); - EXPECT_EQ((int)0, (int)strcmp(value_to_string(v_array[0]), "asdf")); + EXPECT_STREQ(value_to_string(v_array[0]), "asdf"); EXPECT_EQ((type_id)TYPE_INT, (type_id)value_type_id(v_array[1])); EXPECT_EQ((int)443, (int)value_to_int(v_array[1])); @@ -237,7 +237,7 @@ TEST_F(serial_test, DefaultConstructor) value *tupla = value_to_array(v_map[0]); EXPECT_EQ((type_id)TYPE_STRING, (type_id)value_type_id(tupla[0])); - EXPECT_EQ((int)0, (int)strcmp(value_to_string(tupla[0]), "abc")); + EXPECT_STREQ(value_to_string(tupla[0]), "abc"); EXPECT_EQ((type_id)TYPE_FLOAT, (type_id)value_type_id(tupla[1])); EXPECT_EQ((float)9.9f, (float)value_to_float(tupla[1])); @@ -250,7 +250,7 @@ TEST_F(serial_test, DefaultConstructor) tupla = value_to_array(v_map[1]); EXPECT_EQ((type_id)TYPE_STRING, (type_id)value_type_id(tupla[0])); - EXPECT_EQ((int)0, (int)strcmp(value_to_string(tupla[0]), "cde")); + EXPECT_STREQ(value_to_string(tupla[0]), "cde"); EXPECT_EQ((type_id)TYPE_FLOAT, (type_id)value_type_id(tupla[1])); EXPECT_EQ((float)1.5f, (float)value_to_float(tupla[1])); From 7f59fe8db76b658ae143630347b16d428c495fd3 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 20 Sep 2025 17:12:03 +0200 Subject: [PATCH 462/487] Add base for cxx port. --- source/ports/CMakeLists.txt | 2 +- source/ports/cxx_port/CMakeLists.txt | 111 ++--- .../cxx_port/include/metacall/metacall.hpp | 414 +++++++++++++++++- .../cxx_port/inline/metacall/metacall.inl | 2 +- source/tests/CMakeLists.txt | 1 + .../metacall_cxx_port_test/CMakeLists.txt | 151 +++++++ .../metacall_cxx_port_test/source/main.cpp | 28 ++ .../source/metacall_cxx_port_test.cpp | 96 ++++ 8 files changed, 722 insertions(+), 83 deletions(-) create mode 100644 source/tests/metacall_cxx_port_test/CMakeLists.txt create mode 100644 source/tests/metacall_cxx_port_test/source/main.cpp create mode 100644 source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp diff --git a/source/ports/CMakeLists.txt b/source/ports/CMakeLists.txt index cc73de928..e70bb151d 100644 --- a/source/ports/CMakeLists.txt +++ b/source/ports/CMakeLists.txt @@ -28,7 +28,7 @@ endif() # Project options option(OPTION_BUILD_PORTS_CS "Build C# port." OFF) -option(OPTION_BUILD_PORTS_CXX "Build C++ port." OFF) +option(OPTION_BUILD_PORTS_CXX "Build C++ port." ON) option(OPTION_BUILD_PORTS_D "Build D port." OFF) option(OPTION_BUILD_PORTS_GO "Build Go port." OFF) option(OPTION_BUILD_PORTS_JAVA "Build Java port." OFF) diff --git a/source/ports/cxx_port/CMakeLists.txt b/source/ports/cxx_port/CMakeLists.txt index bc450a068..88ce40460 100644 --- a/source/ports/cxx_port/CMakeLists.txt +++ b/source/ports/cxx_port/CMakeLists.txt @@ -9,17 +9,14 @@ endif() # Target name set(target cxx_port) -string(TOLOWER ${META_PROJECT_NAME} target_name) - -set(target_export "${META_PROJECT_NAME}-cxx") # Exit here if required dependencies are not met message(STATUS "Port ${target}") # Set API export file and macro -string(TOUPPER ${target_name} target_name_upper) -set(export_file "include/${target_name}/${target_name}_api.hpp") -set(export_macro "${target_name_upper}_API") +string(TOUPPER ${target} target_upper) +set(export_file "include/${target}/${target}_api.h") +set(export_macro "${target_upper}_API") # # Compiler warnings @@ -37,8 +34,8 @@ include(SecurityFlags) # Sources # -set(inline_path "${CMAKE_CURRENT_SOURCE_DIR}/inline/${target_name}") -set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target_name}") +set(inline_path "${CMAKE_CURRENT_SOURCE_DIR}/inline/metacall") +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/metacall") set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") set(inlines @@ -79,7 +76,7 @@ add_library(${target} add_library(${META_PROJECT_NAME}::${target} ALIAS ${target}) # Export library for downstream projects -export(TARGETS ${target} NAMESPACE ${META_PROJECT_NAME}:: FILE ${PROJECT_BINARY_DIR}/cmake/${target_name}/${target_export}-export.cmake) +export(TARGETS ${target} NAMESPACE ${META_PROJECT_NAME}:: FILE ${PROJECT_BINARY_DIR}/cmake/${target}/${target}-export.cmake) # Create API export header generate_export_header(${target} @@ -100,12 +97,16 @@ set_target_properties(${target} # # Include directories # + target_include_directories(${target} PRIVATE ${PROJECT_BINARY_DIR}/source/include ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include + + ${PROJECT_BINARY_DIR}/source/inline ${CMAKE_CURRENT_SOURCE_DIR}/inline + ${CMAKE_CURRENT_BINARY_DIR}/inline PUBLIC ${DEFAULT_INCLUDE_DIRECTORIES} @@ -114,6 +115,26 @@ target_include_directories(${target} $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> $<INSTALL_INTERFACE:include> + + + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inline> + $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/inline> + $<INSTALL_INTERFACE:inline> +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${META_PROJECT_NAME}::metacall + + PUBLIC + ${DEFAULT_LIBRARIES} + + INTERFACE + ${META_PROJECT_NAME}::metacall ) # @@ -122,9 +143,10 @@ target_include_directories(${target} target_compile_definitions(${target} PRIVATE + ${target_upper}_EXPORTS # Export API PUBLIC - $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${target_name_upper}_STATIC_DEFINE> + $<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${target_upper}_STATIC_DEFINE> ${DEFAULT_COMPILE_DEFINITIONS} INTERFACE @@ -155,72 +177,3 @@ target_link_options(${target} INTERFACE ) - -# -# Deployment -# - -# Library -install(TARGETS ${target} - EXPORT "${target_export}-export" COMPONENT dev - RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT runtime - LIBRARY DESTINATION ${INSTALL_SHARED} COMPONENT runtime - ARCHIVE DESTINATION ${INSTALL_LIB} COMPONENT dev -) - -# Inline files -install(DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/inline/${target_name} DESTINATION ${INSTALL_INCLUDE} - COMPONENT dev -) - -# Header files -install(DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/include/${target_name} DESTINATION ${INSTALL_INCLUDE} - COMPONENT dev -) - -# Generated header files -install(DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR}/include/${target_name} DESTINATION ${INSTALL_INCLUDE} - COMPONENT dev -) - -# CMake config -install(EXPORT ${target_export}-export - NAMESPACE ${META_PROJECT_NAME}:: - DESTINATION ${INSTALL_CMAKE}/${target_name} - COMPONENT dev -) - -# TODO - -# # -# # Configure test -# # - -# set(metacall_cxx_test "${target}_test") -# set(metacall_cxx_test_path "${CMAKE_CURRENT_BINARY_DIR}/${metacall_cxx_test}.cpp") - -# # -# # Define test -# # - -# add_test(NAME ${metacall_cxx_test} -# COMMAND $<TARGET_FILE:${metacall_cxx_test}> -# ) - -# # -# # Define test labels -# # - -# set_property(TEST ${metacall_cxx_test} -# PROPERTY LABELS ${metacall_cxx_test} -# ) - -# include(TestEnvironmentVariables) - -# test_environment_variables(${metacall_cxx_test} -# "" -# ${TESTS_ENVIRONMENT_VARIABLES} -# ) diff --git a/source/ports/cxx_port/include/metacall/metacall.hpp b/source/ports/cxx_port/include/metacall/metacall.hpp index 7995efa3e..83540d66e 100644 --- a/source/ports/cxx_port/include/metacall/metacall.hpp +++ b/source/ports/cxx_port/include/metacall/metacall.hpp @@ -23,17 +23,427 @@ /* -- Headers -- */ -#include <metacall/metacall_api.hpp> - +#include <cstring> +#include <memory> +#include <stdexcept> #include <string> +#include <unordered_map> +#include <vector> namespace metacall { +#include <metacall/metacall.h> + +class value_base +{ +public: + // Non-copyable, but movable + value_base(const value_base &) = delete; + value_base &operator=(const value_base &) = delete; + + value_base(value_base &&) noexcept = default; + value_base &operator=(value_base &&) noexcept = default; + + // Access the raw value + void *to_raw() const + { + return value_ptr.get(); + } + +protected: + std::unique_ptr<void, void (*)(void *)> value_ptr; + + explicit value_base(void *value_ptr, void (*destructor)(void *) = &noop_destructor) : + // TODO: &metacall_value_destroy + value_ptr(value_ptr, destructor) + { + } + + static void noop_destructor(void *) {} +}; + +template <typename T> +class METACALL_API value : public value_base +{ +public: + explicit value(const T &v) : + value_base(create(v)) + { + if (value_ptr == nullptr) + { + throw std::runtime_error("Failed to create MetaCall value"); + } + } + + explicit value(void *value_ptr) : + value_base(value_ptr, &value_base::noop_destructor) + { + if (metacall_value_id(value_ptr) != id()) + { + throw std::runtime_error("Failed to create MetaCall value, the received MetaCall value type does not match with the value class type"); + } + } + + T to_value() const + { + throw std::runtime_error("Unsupported MetaCall value"); + } + +private: + // Type-specific creation (calls specialized version below) + static void *create(const T &v); + + // Type-specific type id + static enum metacall_value_id id(); +}; + +template <> +inline void *value<bool>::create(const bool &v) +{ + return metacall_value_create_bool(v); +} + +template <> +inline enum metacall_value_id value<bool>::id() +{ + return METACALL_BOOL; +} + +template <> +inline bool value<bool>::to_value() const +{ + return metacall_value_to_bool(value_ptr.get()); +} + +template <> +inline void *value<char>::create(const char &v) +{ + return metacall_value_create_char(v); +} + +template <> +inline enum metacall_value_id value<char>::id() +{ + return METACALL_CHAR; +} + +template <> +inline char value<char>::to_value() const +{ + return metacall_value_to_char(value_ptr.get()); +} + +template <> +inline void *value<short>::create(const short &v) +{ + return metacall_value_create_short(v); +} + +template <> +inline enum metacall_value_id value<short>::id() +{ + return METACALL_SHORT; +} + +template <> +inline short value<short>::to_value() const +{ + return metacall_value_to_short(value_ptr.get()); +} + +template <> +inline void *value<int>::create(const int &v) +{ + return metacall_value_create_int(v); +} + +template <> +inline enum metacall_value_id value<int>::id() +{ + return METACALL_INT; +} + +template <> +inline int value<int>::to_value() const +{ + return metacall_value_to_int(value_ptr.get()); +} + +template <> +inline void *value<long>::create(const long &v) +{ + return metacall_value_create_long(v); +} + +template <> +inline enum metacall_value_id value<long>::id() +{ + return METACALL_LONG; +} + +template <> +inline long value<long>::to_value() const +{ + return metacall_value_to_long(value_ptr.get()); +} + +template <> +inline void *value<float>::create(const float &v) +{ + return metacall_value_create_float(v); +} + +template <> +inline enum metacall_value_id value<float>::id() +{ + return METACALL_FLOAT; +} + +template <> +inline float value<float>::to_value() const +{ + return metacall_value_to_float(value_ptr.get()); +} + +template <> +inline void *value<double>::create(const double &v) +{ + return metacall_value_create_double(v); +} + +template <> +inline enum metacall_value_id value<double>::id() +{ + return METACALL_DOUBLE; +} + +template <> +inline double value<double>::to_value() const +{ + return metacall_value_to_double(value_ptr.get()); +} + +template <> +inline void *value<std::string>::create(const std::string &v) +{ + return metacall_value_create_string(v.c_str(), v.size()); +} + +template <> +inline enum metacall_value_id value<std::string>::id() +{ + return METACALL_STRING; +} + +template <> +inline std::string value<std::string>::to_value() const +{ + return metacall_value_to_string(value_ptr.get()); +} + +template <> +inline void *value<const char *>::create(const char *const &v) +{ + return metacall_value_create_string(v, std::strlen(v)); +} + +template <> +inline enum metacall_value_id value<const char *>::id() +{ + return METACALL_STRING; +} + +template <> +inline const char *value<const char *>::to_value() const +{ + return metacall_value_to_string(value_ptr.get()); +} + +template <> +inline void *value<std::vector<char>>::create(const std::vector<char> &v) +{ + return metacall_value_create_buffer(v.data(), v.size()); +} + +template <> +inline enum metacall_value_id value<std::vector<char>>::id() +{ + return METACALL_BUFFER; +} + +template <> +inline std::vector<char> value<std::vector<char>>::to_value() const +{ + void *ptr = value_ptr.get(); + char *buffer = static_cast<char *>(metacall_value_to_buffer(ptr)); + std::vector<char> buffer_vector(buffer, buffer + metacall_value_count(ptr)); + + return buffer_vector; +} + +template <> +inline void *value<std::vector<unsigned char>>::create(const std::vector<unsigned char> &v) +{ + return metacall_value_create_buffer(v.data(), v.size()); +} + +template <> +inline enum metacall_value_id value<std::vector<unsigned char>>::id() +{ + return METACALL_BUFFER; +} + +template <> +inline std::vector<unsigned char> value<std::vector<unsigned char>>::to_value() const +{ + void *ptr = value_ptr.get(); + unsigned char *buffer = static_cast<unsigned char *>(metacall_value_to_buffer(ptr)); + std::vector<unsigned char> buffer_vector(buffer, buffer + metacall_value_count(ptr)); + + return buffer_vector; +} + +template <> +inline void *value<void *>::create(void *const &v) +{ + return metacall_value_create_ptr(v); +} + +template <> +inline enum metacall_value_id value<void *>::id() +{ + return METACALL_PTR; +} + +template <> +inline void *value<void *>::to_value() const +{ + return metacall_value_to_ptr(value_ptr.get()); +} + +template <> +inline void *value<std::nullptr_t>::create(const std::nullptr_t &) +{ + return metacall_value_create_null(); +} + +template <> +inline enum metacall_value_id value<std::nullptr_t>::id() +{ + return METACALL_NULL; +} + +template <> +inline std::nullptr_t value<std::nullptr_t>::to_value() const +{ + return nullptr; +} + +// TODO: Array, Map, Future, Function, Class, Object, Exception, Throwable... + +template <typename K, typename V> +class METACALL_API map : public value_base +{ +public: + using pair_type = std::pair<K, V>; + using pair_value_type = std::pair<value<K>, value<V>>; + + map(std::initializer_list<pair_type> list) : + value_base(metacall_value_create_map(NULL, list.size())) + { + if (value_ptr == nullptr) + { + throw std::runtime_error("Failed to create MetaCall map value"); + } + + void **map_array = metacall_value_to_map(value_ptr.get()); + size_t index = 0; + + for (const auto &pair : list) + { + void *tuple = metacall_value_create_array(nullptr, 2); + void **tuple_array = metacall_value_to_array(tuple); + + // Create the pair + auto value_pair = std::make_pair(value<K>(pair.first), value<V>(pair.second)); + + // Insert into metacall value map + tuple_array[0] = value_pair.first.to_raw(); + tuple_array[1] = value_pair.second.to_raw(); + + map_array[index++] = tuple; + + // Store into the map + m.emplace(pair.first, std::move(value_pair)); + } + } + + explicit map(void *value_ptr) : + value_base(value_ptr, &value_base::noop_destructor) + { + if (metacall_value_id(value_ptr) != METACALL_MAP) + { + throw std::runtime_error("MetaCall map initialized with a MetaCall value which is not of type map"); + } + + rehash(); + } + + void rehash() + { + void *ptr = value_ptr.get(); + void **map_array = metacall_value_to_map(ptr); + const size_t size = metacall_value_count(ptr); + + m.clear(); + + for (size_t index = 0; index < size; ++index) + { + void **tuple_array = metacall_value_to_array(map_array[index]); + + // Create the values + auto pair = std::make_pair(value<K>(tuple_array[0]), value<V>(tuple_array[1])); + + // Store into the map + m.emplace(pair.first.to_value(), std::move(pair)); + } + } + + V operator[](const K &key) const + { + return m.at(key).second.to_value(); + } + +private: + /* + // Case 1: value is value_base (e.g. nested metacall map value) + template <typename T> + static typename std::enable_if<std::is_base_of<value_base, T>::value, value<T>>::type + wrap_value(const T &v) + { + return const_cast<T &>(v); + } + + // Case 2: value is a plain type + template <typename T> + static typename std::enable_if<!std::is_base_of<value_base, T>::value, value<T>>::type + wrap_value(const T &v) + { + value<T> val(v); + return val; + } + */ + + std::unordered_map<K, pair_value_type> m; +}; + template <typename... Ts> METACALL_API int metacall(std::string name, Ts... ts); } /* namespace metacall */ +// TODO: Move everything to metacall.inl + #include <metacall/metacall.inl> #endif /* METACALL_HPP */ diff --git a/source/ports/cxx_port/inline/metacall/metacall.inl b/source/ports/cxx_port/inline/metacall/metacall.inl index 7789dff86..8223b5be0 100644 --- a/source/ports/cxx_port/inline/metacall/metacall.inl +++ b/source/ports/cxx_port/inline/metacall/metacall.inl @@ -23,7 +23,7 @@ /* -- Headers -- */ -#include <metacall/metacall_api.hpp> +#include <metacall/metacall_api.h> #include <string> diff --git a/source/tests/CMakeLists.txt b/source/tests/CMakeLists.txt index 6e6ad2ffc..2f2e6bb89 100644 --- a/source/tests/CMakeLists.txt +++ b/source/tests/CMakeLists.txt @@ -246,3 +246,4 @@ add_subdirectory(metacall_cli_core_plugin_test) add_subdirectory(metacall_cli_core_plugin_await_test) add_subdirectory(metacall_backtrace_plugin_test) add_subdirectory(metacall_sandbox_plugin_test) +add_subdirectory(metacall_cxx_port_test) diff --git a/source/tests/metacall_cxx_port_test/CMakeLists.txt b/source/tests/metacall_cxx_port_test/CMakeLists.txt new file mode 100644 index 000000000..1a4b07292 --- /dev/null +++ b/source/tests/metacall_cxx_port_test/CMakeLists.txt @@ -0,0 +1,151 @@ +# Check if this loader is enabled +if(NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_CXX) + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-cxx-port-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_cxx_port_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::cxx_port +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} + + LIBFFI_INCLUDE_DIR="${LIBFFI_INCLUDE_DIR}" + LIBFFI_LIBRARY="${LIBFFI_LIBRARY}" +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + +# +# Linker options +# + +target_link_options(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $<TARGET_FILE:${target}> +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} +) diff --git a/source/tests/metacall_cxx_port_test/source/main.cpp b/source/tests/metacall_cxx_port_test/source/main.cpp new file mode 100644 index 000000000..37d4adc23 --- /dev/null +++ b/source/tests/metacall_cxx_port_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading ruby code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp new file mode 100644 index 000000000..75f06a44e --- /dev/null +++ b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp @@ -0,0 +1,96 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading ruby code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +#include <metacall/metacall.hpp> + +using namespace metacall; + +class metacall_cxx_port_test : public testing::Test +{ +protected: +}; + +void *cxx_map_test(size_t argc, void *args[], void *data) +{ + map<std::string, float> m(args[0]); + + (void)argc; + (void)data; + + EXPECT_EQ((float)m["hello"], (float)3.0f); + EXPECT_EQ((float)m["world"], (float)4.0f); + + printf("hello => %f\n", m["hello"]); + printf("world => %f\n", m["world"]); + fflush(stdout); + + return metacall_value_create_null(); +} + +TEST_F(metacall_cxx_port_test, DefaultConstructor) +{ + ASSERT_EQ((int)0, (int)metacall_initialize()); + + { + map<std::string, float> m = { + { "hello", 3.0f }, + { "world", 4.0f } + }; + + void *args[] = { + m.to_raw() + }; + + metacall_register("cxx_map_test", cxx_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); + + void *ret = metacallv_s("cxx_map_test", args, 1); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + } + + /* Print inspect information */ + { + size_t size = 0; + + struct metacall_allocator_std_type std_ctx = { &std::malloc, &std::realloc, &std::free }; + + void *allocator = metacall_allocator_create(METACALL_ALLOCATOR_STD, (void *)&std_ctx); + + char *inspect_str = metacall_inspect(&size, allocator); + + EXPECT_NE((char *)NULL, (char *)inspect_str); + + EXPECT_GT((size_t)size, (size_t)0); + + std::cout << inspect_str << std::endl; + + metacall_allocator_free(allocator, inspect_str); + + metacall_allocator_destroy(allocator); + } + + metacall_destroy(); +} From 90f20b973e21342bc7a688b4564bfb0c99ae7143 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 24 Sep 2025 15:58:12 +0200 Subject: [PATCH 463/487] Solve issues with ownership in cxx port. --- source/ports/cxx_port/CMakeLists.txt | 16 ++++++++ .../cxx_port/include/metacall/metacall.hpp | 13 +++---- .../source/metacall_cxx_port_test.cpp | 39 +++++++++++++++++++ 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/source/ports/cxx_port/CMakeLists.txt b/source/ports/cxx_port/CMakeLists.txt index 88ce40460..22fbea19f 100644 --- a/source/ports/cxx_port/CMakeLists.txt +++ b/source/ports/cxx_port/CMakeLists.txt @@ -177,3 +177,19 @@ target_link_options(${target} INTERFACE ) + +# +# Deployment +# + +# Header files +install(DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/include/${target} DESTINATION ${INSTALL_INCLUDE} + COMPONENT dev +) + +# Inline files +install(DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/inline/${target} DESTINATION ${INSTALL_INCLUDE} + COMPONENT dev +) diff --git a/source/ports/cxx_port/include/metacall/metacall.hpp b/source/ports/cxx_port/include/metacall/metacall.hpp index 83540d66e..afecc0fa6 100644 --- a/source/ports/cxx_port/include/metacall/metacall.hpp +++ b/source/ports/cxx_port/include/metacall/metacall.hpp @@ -53,11 +53,8 @@ class value_base protected: std::unique_ptr<void, void (*)(void *)> value_ptr; - explicit value_base(void *value_ptr, void (*destructor)(void *) = &noop_destructor) : - // TODO: &metacall_value_destroy - value_ptr(value_ptr, destructor) - { - } + explicit value_base(void *value_ptr, void (*destructor)(void *) = &metacall_value_destroy) : + value_ptr(value_ptr, destructor) {} static void noop_destructor(void *) {} }; @@ -66,8 +63,8 @@ template <typename T> class METACALL_API value : public value_base { public: - explicit value(const T &v) : - value_base(create(v)) + explicit value(const T &v, void (*destructor)(void *) = &metacall_value_destroy) : + value_base(create(v), destructor) { if (value_ptr == nullptr) { @@ -365,7 +362,7 @@ class METACALL_API map : public value_base void **tuple_array = metacall_value_to_array(tuple); // Create the pair - auto value_pair = std::make_pair(value<K>(pair.first), value<V>(pair.second)); + auto value_pair = std::make_pair(value<K>(pair.first, &value_base::noop_destructor), value<V>(pair.second, &value_base::noop_destructor)); // Insert into metacall value map tuple_array[0] = value_pair.first.to_raw(); diff --git a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp index 75f06a44e..72912ecf5 100644 --- a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp +++ b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp @@ -46,6 +46,23 @@ void *cxx_map_test(size_t argc, void *args[], void *data) return metacall_value_create_null(); } +void *cxx_recursive_map_test(size_t argc, void *args[], void *data) +{ + map<std::string, float> m(args[0]); + + (void)argc; + (void)data; + + EXPECT_EQ((float)m["hello"], (float)3.0f); + EXPECT_EQ((float)m["world"], (float)4.0f); + + printf("hello => %f\n", m["hello"]); + printf("world => %f\n", m["world"]); + fflush(stdout); + + return metacall_value_create_null(); +} + TEST_F(metacall_cxx_port_test, DefaultConstructor) { ASSERT_EQ((int)0, (int)metacall_initialize()); @@ -71,6 +88,28 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) metacall_value_destroy(ret); } + /* + { + map<std::string, map<std::string, float>> m = { + { "hello", { "world", 4.0f } }, + }; + + void *args[] = { + m.to_raw() + }; + + metacall_register("cxx_recursive_map_test", cxx_recursive_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); + + void *ret = metacallv_s("cxx_recursive_map_test", args, 1); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + } + */ + /* Print inspect information */ { size_t size = 0; From 182a757139b9084c404b06824357c581ecff56be Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 24 Sep 2025 18:32:57 +0200 Subject: [PATCH 464/487] Separated CI of rust into test and build. --- .github/workflows/release-rust.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index 9ef5e2ec1..bc58a5915 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -35,16 +35,20 @@ jobs: - name: Install MetaCall Windows if: matrix.os == 'windows-latest' run: powershell -NoProfile -ExecutionPolicy Unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/metacall/install/master/install.ps1')))" + - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: stable override: true - - name: Build and Test the Rust Port + + - name: Build Test the Rust Port working-directory: source/ports/rs_port - run: | - cargo build --verbose - cargo test --verbose + run: cargo build --verbose + + - name: Test the Rust Port + working-directory: source/ports/rs_port + run: cargo test --verbose release: name: Release Rust Port From 680b6bf7a4e415df9a0d8452b83972b9d2966fbb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 24 Sep 2025 18:41:33 +0200 Subject: [PATCH 465/487] Remove version from rs_ports dependency. --- source/ports/rs_port/Cargo.toml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index c0e51713a..4ed8cee59 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -17,7 +17,13 @@ name = "metacall" path = "src/lib.rs" [dependencies] -metacall-inline = { path = "./inline", version = "0.2.0" } +metacall-inline = { path = "./inline" } [build-dependencies] -metacall-sys = { path = "./sys", version = "0.1.2" } +metacall-sys = { path = "./sys" } + +[workspace] +members = [ + "inline", + "sys", +] From 5d7c589784e3363b8507b629052a3ff7645806c1 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Tue, 30 Sep 2025 22:27:29 +0200 Subject: [PATCH 466/487] Improve few issues in c++ port. --- .github/workflows/release-rust.yml | 2 +- source/ports/cxx_port/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-rust.yml b/.github/workflows/release-rust.yml index bc58a5915..d2a0c31a4 100644 --- a/.github/workflows/release-rust.yml +++ b/.github/workflows/release-rust.yml @@ -42,7 +42,7 @@ jobs: toolchain: stable override: true - - name: Build Test the Rust Port + - name: Build the Rust Port working-directory: source/ports/rs_port run: cargo build --verbose diff --git a/source/ports/cxx_port/CMakeLists.txt b/source/ports/cxx_port/CMakeLists.txt index 22fbea19f..e3e79398a 100644 --- a/source/ports/cxx_port/CMakeLists.txt +++ b/source/ports/cxx_port/CMakeLists.txt @@ -184,12 +184,12 @@ target_link_options(${target} # Header files install(DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/include/${target} DESTINATION ${INSTALL_INCLUDE} + ${CMAKE_CURRENT_SOURCE_DIR}/include/metacall DESTINATION ${INSTALL_INCLUDE} COMPONENT dev ) # Inline files install(DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/inline/${target} DESTINATION ${INSTALL_INCLUDE} + ${CMAKE_CURRENT_SOURCE_DIR}/inline/metacall DESTINATION ${INSTALL_INCLUDE} COMPONENT dev ) From f3433115132cb9b2a8774c0ee5d3db5cc5c9b96c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 1 Oct 2025 19:02:20 +0200 Subject: [PATCH 467/487] Improve cxx port. --- .../cxx_port/include/metacall/metacall.hpp | 37 ++++++------------- .../source/metacall_cxx_port_test.cpp | 14 ++++--- 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/source/ports/cxx_port/include/metacall/metacall.hpp b/source/ports/cxx_port/include/metacall/metacall.hpp index afecc0fa6..d92a81638 100644 --- a/source/ports/cxx_port/include/metacall/metacall.hpp +++ b/source/ports/cxx_port/include/metacall/metacall.hpp @@ -336,7 +336,7 @@ inline std::nullptr_t value<std::nullptr_t>::to_value() const return nullptr; } -// TODO: Array, Map, Future, Function, Class, Object, Exception, Throwable... +// TODO: Future, Function, Class, Object, Exception, Throwable... template <typename K, typename V> class METACALL_API map : public value_base @@ -386,6 +386,17 @@ class METACALL_API map : public value_base rehash(); } + V operator[](const K &key) const + { + return m.at(key).second.to_value(); + } + + static enum metacall_value_id id() + { + return METACALL_MAP; + } + +protected: void rehash() { void *ptr = value_ptr.get(); @@ -406,31 +417,7 @@ class METACALL_API map : public value_base } } - V operator[](const K &key) const - { - return m.at(key).second.to_value(); - } - private: - /* - // Case 1: value is value_base (e.g. nested metacall map value) - template <typename T> - static typename std::enable_if<std::is_base_of<value_base, T>::value, value<T>>::type - wrap_value(const T &v) - { - return const_cast<T &>(v); - } - - // Case 2: value is a plain type - template <typename T> - static typename std::enable_if<!std::is_base_of<value_base, T>::value, value<T>>::type - wrap_value(const T &v) - { - value<T> val(v); - return val; - } - */ - std::unordered_map<K, pair_value_type> m; }; diff --git a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp index 72912ecf5..6865b258f 100644 --- a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp +++ b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp @@ -46,22 +46,23 @@ void *cxx_map_test(size_t argc, void *args[], void *data) return metacall_value_create_null(); } +// TODO: +/* void *cxx_recursive_map_test(size_t argc, void *args[], void *data) { - map<std::string, float> m(args[0]); + map<std::string, map<std::string, float>> m(args[0]); (void)argc; (void)data; - EXPECT_EQ((float)m["hello"], (float)3.0f); - EXPECT_EQ((float)m["world"], (float)4.0f); + EXPECT_EQ((float)m["hello"]["world"], (float)4.0f); - printf("hello => %f\n", m["hello"]); - printf("world => %f\n", m["world"]); + printf("hello => %f\n", m["hello"]["world"]); fflush(stdout); return metacall_value_create_null(); } +*/ TEST_F(metacall_cxx_port_test, DefaultConstructor) { @@ -88,10 +89,11 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) metacall_value_destroy(ret); } + // TODO: /* { map<std::string, map<std::string, float>> m = { - { "hello", { "world", 4.0f } }, + { "hello", { "world", 4.0f } } }; void *args[] = { From b4d673059147f11fbb917c2876ad8dd66fc071dd Mon Sep 17 00:00:00 2001 From: Thomas <thomas.gummerson@piql.com> Date: Wed, 1 Oct 2025 19:23:13 +0200 Subject: [PATCH 468/487] Reimplement and bugfix environment_variable_path_create, portability_path_get_name, portability_path_get_name_canonical (#580) - Get rid of some buffer overruns - make more functions return more sensible things on NULL arguments - properly DOCUMENT each function - Add const type qualifiers where applicable - Replace some string functions and loops with memcpy --- .../environment/environment_variable_path.h | 26 ++- .../source/environment_variable_path.c | 69 +++----- .../include/portability/portability_path.h | 50 +++++- source/portability/source/portability_path.c | 156 ++++++++---------- .../source/portability_path_test.cpp | 55 ++++++ 5 files changed, 213 insertions(+), 143 deletions(-) diff --git a/source/environment/include/environment/environment_variable_path.h b/source/environment/include/environment/environment_variable_path.h index d5492d8f6..58b8c2047 100644 --- a/source/environment/include/environment/environment_variable_path.h +++ b/source/environment/include/environment/environment_variable_path.h @@ -52,7 +52,31 @@ extern "C" { /* -- Methods -- */ -ENVIRONMENT_API char *environment_variable_path_create(const char *name, const char *default_path, size_t default_path_size, size_t *env_size); +/** + * @brief + * If the value of `name` exists as an environment variable, return a live string of its value, otherwise return a live value of `default_path` or "/". + * + * `name` should not be `NULL`. + * + * If `default_path` is not `NULL`, `default_path_size` must be set to <= the length (including 0-terminator) of the `default_path` string. + * + * If `env_size` is not `NULL`, the length (including 0-terminator) of the returned string will be set to it + * @param[in] name + * The environment variable name to look up. + * + * @param[in] default_path + * If the environment variable value is not found, the value to return instead. + * + * @param[in] default_path_size + * The length (including 0-terminator) of `default_path` in chars. + * + * @param[out] env_size + * Pointer to a size_t to write the length of the returned string to (optional). + * + * @return + * The allocated string containing the environment variable value or the default or "/". + */ +ENVIRONMENT_API char *environment_variable_path_create(const char *const name, const char *const default_path, const size_t default_path_size, size_t *const env_size); ENVIRONMENT_API void environment_variable_path_destroy(char *variable_path); diff --git a/source/environment/source/environment_variable_path.c b/source/environment/source/environment_variable_path.c index 53f492dc3..f36439a72 100644 --- a/source/environment/source/environment_variable_path.c +++ b/source/environment/source/environment_variable_path.c @@ -43,61 +43,32 @@ /* -- Methods -- */ -char *environment_variable_path_create(const char *name, const char *default_path, size_t default_path_size, size_t *env_size) +char *environment_variable_path_create(const char *const name, const char *const default_path, const size_t default_path_size, size_t *const env_size) { - const char *path_ptr = getenv(name); - char *path; - size_t length, size, last, end; - - if (path_ptr == NULL) - { - if (default_path == NULL) - { - static const char empty_path[] = ""; - - default_path = empty_path; - default_path_size = sizeof(empty_path); - } - - path_ptr = default_path; - length = default_path_size - 1; - } - else - { - length = strlen(path_ptr); - } - - last = length - 1; - - if (ENVIRONMENT_VARIABLE_PATH_SEPARATOR(path_ptr[last])) + const char *value = getenv(name); + size_t size; + if (value) + size = strlen(value) + 1; + else if (default_path) { - end = length; - size = length + 1; + value = default_path; + size = default_path_size; } else { - last = length; - end = length + 1; - size = length + 2; + value = ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR; + size = sizeof(ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR); } - - path = malloc(sizeof(char) * size); - - if (path == NULL) - { - return NULL; - } - - strncpy(path, path_ptr, length); - - path[last] = ENVIRONMENT_VARIABLE_PATH_SEPARATOR_C; - path[end] = '\0'; - - if (env_size != NULL) - { - *env_size = size; - } - + size_t alloc_size = size; + if (size > 1) + alloc_size += !ENVIRONMENT_VARIABLE_PATH_SEPARATOR(value[size - 2]); + char *const path = malloc(sizeof(char) * alloc_size); + memcpy(path, value, sizeof(char) * size); + if (size > 1) + path[alloc_size - 2] = ENVIRONMENT_VARIABLE_PATH_SEPARATOR_C; + path[alloc_size - 1] = '\0'; + if (env_size) + *env_size = alloc_size; return path; } diff --git a/source/portability/include/portability/portability_path.h b/source/portability/include/portability/portability_path.h index 79ff0761b..100b129f1 100644 --- a/source/portability/include/portability/portability_path.h +++ b/source/portability/include/portability/portability_path.h @@ -109,9 +109,55 @@ extern "C" { /* -- Methods -- */ -PORTABILITY_API size_t portability_path_get_name(const char *path, size_t path_size, char *name, size_t name_size); +/** + * @brief + * Get the file name portion out of a path and strip away the file extension if any. + * + * If `path` is NULL this will return an empty string. + * + * If `name` is NULL or `name_size is 0 this will return the size it requires in order to write `name`. + * + * If `path` or `name` are not NULL, then `path_size` or `name_size`, respectively, must be set to <= the length (including 0-terminator) of the memory regions pointed to by `path` and `name`. + * @param[in] path + * The full path to extract the name from. + * @param[in] path_size + * The length (including 0-terminator) of `path` in chars. + * @param[out] name + * The memory location to write the extracted name to. If `NULL` the size required will be returned instead of the size written. + * @param[in] name_size + * The size of the memory location pointed to by `name`. + * @return + * The size of the name. + */ +PORTABILITY_API size_t portability_path_get_name(const char *const path, const size_t path_size, char *const name, const size_t name_size); -PORTABILITY_API size_t portability_path_get_name_canonical(const char *path, size_t path_size, char *name, size_t name_size); +/** + * @brief + * Get the file name portion out of a path and strip away any amount of file extensions. + * + * When called with `"/foo/bar.baz.qux"`: + * + * - `portability_path_get_name` will produce the string `"bar.baz"` + * + * - `portability_path_get_name_canonical` will produce the string `"bar"` + * + * If `path` is NULL this will return an empty string. + * + * If `name` is NULL or `name_size is 0 this will return the size it requires in order to write `name`. + * + * If `path` or `name` are not NULL, then `path_size` or `name_size`, respectively, must be set to <= the length (including 0-terminator) of the memory regions pointed to by `path` and `name`. + * @param[in] path + * The full path to extract the name from. + * @param[in] path_size + * The length (including 0-terminator) of `path` in chars. + * @param[out] name + * The memory location to write the extracted name to. If `NULL` the size required will be returned instead of the size written. + * @param[in] name_size + * The size of the memory location pointed to by `name`. + * @return + * The size of the name. + */ +PORTABILITY_API size_t portability_path_get_name_canonical(const char *const path, const size_t path_size, char *const name, const size_t name_size); PORTABILITY_API size_t portability_path_get_fullname(const char *path, size_t path_size, char *name, size_t name_size); diff --git a/source/portability/source/portability_path.c b/source/portability/source/portability_path.c index 9606a7d69..096df995e 100644 --- a/source/portability/source/portability_path.c +++ b/source/portability/source/portability_path.c @@ -25,107 +25,81 @@ /* Define separator checking for any platform */ #define PORTABILITY_PATH_SEPARATOR_ALL(chr) (chr == '\\' || chr == '/') -size_t portability_path_get_name(const char *path, size_t path_size, char *name, size_t name_size) +static size_t basename_offset(const char *const path, const size_t path_size) { - size_t i, count, last; - - if (path == NULL || name == NULL) - { - return 0; - } - - for (i = 0, count = 0, last = 0; path[i] != '\0' && i < path_size && count < name_size; ++i) - { - name[count++] = path[i]; - - if (PORTABILITY_PATH_SEPARATOR(path[i])) - { - count = 0; - } - else if (path[i] == '.') - { - if (i > 0 && path[i - 1] == '.') - { - last = 0; - count = 0; - } - else - { - if (count > 0) - { - last = count - 1; - } - else - { - last = 0; - } - } - } - } + size_t offset = path_size; + for (; offset != 0; offset--) + if (PORTABILITY_PATH_SEPARATOR(path[offset - 1])) + break; + return offset; +} - if ((last == 0 && count > 1) || last > count) +size_t portability_path_get_name(const char *const path, const size_t path_size, char *const name, const size_t name_size) +{ + if (path == NULL) { - last = count; + if (name == NULL || name_size == 0) + return 0; + name[0] = '\0'; + return 1; } - - name[last] = '\0'; - - return last + 1; + // find rightmost path separator + const size_t name_start = basename_offset(path, path_size); + // Find rightmost dot + size_t rightmost_dot = path_size; + for (; rightmost_dot != name_start; rightmost_dot--) + if (path[rightmost_dot - 1] == '.') + break; + // No dots found, or name starts with dot and is non-empty, use whole name + if (rightmost_dot == name_start || (rightmost_dot == name_start + 1 && rightmost_dot != path_size - 1)) + rightmost_dot = path_size - 1; + // remove all consecutive dots at the end + while (rightmost_dot != name_start && path[rightmost_dot - 1] == '.') + rightmost_dot--; + const size_t length = rightmost_dot - name_start; + const size_t size = length + 1; + // Return required size + if (name == NULL || size > name_size) + return size; + if (length) + memcpy(name, path + name_start, length); + name[length] = '\0'; + return size; } -size_t portability_path_get_name_canonical(const char *path, size_t path_size, char *name, size_t name_size) +size_t portability_path_get_name_canonical(const char *const path, const size_t path_size, char *const name, const size_t name_size) { - if (path == NULL || name == NULL) + if (path == NULL) { - return 0; + if (name == NULL || name_size == 0) + return 0; + name[0] = '\0'; + return 1; } - - size_t i, count, last; - - for (i = 0, count = 0, last = 0; path[i] != '\0' && i < path_size && count < name_size; ++i) - { - name[count++] = path[i]; - - if (PORTABILITY_PATH_SEPARATOR(path[i])) - { - count = 0; - } - else if (path[i] == '.') - { - if (i > 0 && path[i - 1] == '.') - { - last = 0; - count = 0; - } - else - { - if (count > 0) - { - last = count - 1; - } - else - { - last = 0; - } - - /* This function is the same as portability_path_get_name but - returns the name of the file without any extension, for example: - - portability_path_get_name of libnode.so.72 is libnode.so - - portability_path_get_name_canonical of libnode.so.72 is libnode - */ + // find rightmost path separator + const size_t name_start = basename_offset(path, path_size); + // find leftmost dot + size_t leftmost_dot = name_start; + for (; leftmost_dot < path_size; leftmost_dot++) + if (path[leftmost_dot] == '.') + break; + // No dots found, use whole name + if (leftmost_dot == path_size) + leftmost_dot--; + // name starts with dot, use the following dot instead + if (leftmost_dot == name_start) + for (leftmost_dot = name_start + 1; leftmost_dot < path_size; leftmost_dot++) + if (path[leftmost_dot] == '.') break; - } - } - } - - if (last == 0 && count > 1) - { - last = count; - } - - name[last] = '\0'; - - return last + 1; + const size_t length = leftmost_dot - name_start; + const size_t size = length + 1; + // Return required size + if (name == NULL || size > name_size) + return size; + if (length) + memcpy(name, path + name_start, length); + name[length] = '\0'; + return size; } size_t portability_path_get_fullname(const char *path, size_t path_size, char *name, size_t name_size) diff --git a/source/tests/portability_path_test/source/portability_path_test.cpp b/source/tests/portability_path_test/source/portability_path_test.cpp index 15534b235..f4c638c2f 100644 --- a/source/tests/portability_path_test/source/portability_path_test.cpp +++ b/source/tests/portability_path_test/source/portability_path_test.cpp @@ -68,6 +68,33 @@ TEST_F(portability_path_test, portability_path_test_path_get_module_name_with_ra EXPECT_EQ((char)'\0', (char)result[size - 1]); } +TEST_F(portability_path_test, portability_path_test_path_get_name_null) +{ + static const char result[] = ""; + + string_name name; + + size_t size = portability_path_get_name(NULL, 0, name, NAME_SIZE); + + EXPECT_STREQ(name, result); + EXPECT_EQ((size_t)size, (size_t)sizeof(result)); + EXPECT_EQ((char)'\0', (char)result[size - 1]); +} + +TEST_F(portability_path_test, portability_path_test_path_get_name_empty) +{ + static const char base[] = ""; + static const char result[] = ""; + + string_name name; + + size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); + + EXPECT_STREQ(name, result); + EXPECT_EQ((size_t)size, (size_t)sizeof(result)); + EXPECT_EQ((char)'\0', (char)result[size - 1]); +} + TEST_F(portability_path_test, portability_path_test_path_get_name) { static const char base[] = "/a/b/c/asd.txt"; @@ -110,6 +137,34 @@ TEST_F(portability_path_test, portability_path_test_path_get_name_without_dot) EXPECT_EQ((char)'\0', (char)result[size - 1]); } +TEST_F(portability_path_test, portability_path_test_path_get_name_dot_in_path) +{ + static const char base[] = "/a/b.c/d/asd"; + static const char result[] = "asd"; + + string_name name; + + size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); + + EXPECT_STREQ(name, result); + EXPECT_EQ((size_t)size, (size_t)sizeof(result)); + EXPECT_EQ((char)'\0', (char)result[size - 1]); +} + +TEST_F(portability_path_test, portability_path_test_path_get_name_dot_in_path_and_name) +{ + static const char base[] = "/a/b.c/d/asd.txt"; + static const char result[] = "asd"; + + string_name name; + + size_t size = portability_path_get_name(base, sizeof(base), name, NAME_SIZE); + + EXPECT_STREQ(name, result); + EXPECT_EQ((size_t)size, (size_t)sizeof(result)); + EXPECT_EQ((char)'\0', (char)result[size - 1]); +} + TEST_F(portability_path_test, portability_path_test_path_get_name_only_separator_dot) { static const char base[] = "/."; From 282887dcdc6e585398318c5761b69159ee10535e Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 4 Oct 2025 11:26:54 +0200 Subject: [PATCH 469/487] Review of Thomas PR. --- .../environment/environment_variable_path.h | 12 +- .../source/environment_variable_path.c | 43 ++++-- .../include/portability/portability_path.h | 37 +++--- source/portability/source/portability_path.c | 125 +++++++++++++----- 4 files changed, 148 insertions(+), 69 deletions(-) diff --git a/source/environment/include/environment/environment_variable_path.h b/source/environment/include/environment/environment_variable_path.h index 58b8c2047..5f3a17ba4 100644 --- a/source/environment/include/environment/environment_variable_path.h +++ b/source/environment/include/environment/environment_variable_path.h @@ -54,13 +54,11 @@ extern "C" { /** * @brief - * If the value of `name` exists as an environment variable, return a live string of its value, otherwise return a live value of `default_path` or "/". + * If the value of @name exists as an environment variable, return a live string of its value, otherwise return a live value of @default_path or "/". + * @name should not be NULL. + * If @default_path is not NULL, @default_path_size must be set to <= the length (including null-terminator) of the @default_path string. + * If @env_size is not NULL, the length (including null-terminator) of the returned string will be set to it. * - * `name` should not be `NULL`. - * - * If `default_path` is not `NULL`, `default_path_size` must be set to <= the length (including 0-terminator) of the `default_path` string. - * - * If `env_size` is not `NULL`, the length (including 0-terminator) of the returned string will be set to it * @param[in] name * The environment variable name to look up. * @@ -68,7 +66,7 @@ extern "C" { * If the environment variable value is not found, the value to return instead. * * @param[in] default_path_size - * The length (including 0-terminator) of `default_path` in chars. + * The length (including null-terminator) of @default_path in chars. * * @param[out] env_size * Pointer to a size_t to write the length of the returned string to (optional). diff --git a/source/environment/source/environment_variable_path.c b/source/environment/source/environment_variable_path.c index f36439a72..813112a80 100644 --- a/source/environment/source/environment_variable_path.c +++ b/source/environment/source/environment_variable_path.c @@ -45,30 +45,53 @@ char *environment_variable_path_create(const char *const name, const char *const default_path, const size_t default_path_size, size_t *const env_size) { - const char *value = getenv(name); - size_t size; - if (value) - size = strlen(value) + 1; + const char *env_variable = getenv(name); + char *path; + size_t size, alloc_size; + + if (env_variable) + { + size = strlen(env_variable) + 1; + } else if (default_path) { - value = default_path; + env_variable = default_path; size = default_path_size; } else { - value = ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR; + env_variable = ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR; size = sizeof(ENVIRONMENT_VARIABLE_PATH_SEPARATOR_STR); } - size_t alloc_size = size; + + alloc_size = size; + if (size > 1) - alloc_size += !ENVIRONMENT_VARIABLE_PATH_SEPARATOR(value[size - 2]); - char *const path = malloc(sizeof(char) * alloc_size); - memcpy(path, value, sizeof(char) * size); + { + alloc_size += !ENVIRONMENT_VARIABLE_PATH_SEPARATOR(env_variable[size - 2]); + } + + path = malloc(sizeof(char) * alloc_size); + + if (path == NULL) + { + return NULL; + } + + memcpy(path, env_variable, sizeof(char) * size); + if (size > 1) + { path[alloc_size - 2] = ENVIRONMENT_VARIABLE_PATH_SEPARATOR_C; + } + path[alloc_size - 1] = '\0'; + if (env_size) + { *env_size = alloc_size; + } + return path; } diff --git a/source/portability/include/portability/portability_path.h b/source/portability/include/portability/portability_path.h index 100b129f1..38e743fbf 100644 --- a/source/portability/include/portability/portability_path.h +++ b/source/portability/include/portability/portability_path.h @@ -112,20 +112,22 @@ extern "C" { /** * @brief * Get the file name portion out of a path and strip away the file extension if any. + * If @path is NULL this will return an empty string. + * If @name is NULL or @name_size is 0 this will return the size it requires in order to write @name. + * If @path or @name are not NULL, then @path_size or @name_size, respectively, must be set to <= the length (including null-terminator) of the memory regions pointed to by @path and @name. * - * If `path` is NULL this will return an empty string. - * - * If `name` is NULL or `name_size is 0 this will return the size it requires in order to write `name`. - * - * If `path` or `name` are not NULL, then `path_size` or `name_size`, respectively, must be set to <= the length (including 0-terminator) of the memory regions pointed to by `path` and `name`. * @param[in] path * The full path to extract the name from. + * * @param[in] path_size - * The length (including 0-terminator) of `path` in chars. + * The length (including null-terminator) of @path in chars. + * * @param[out] name - * The memory location to write the extracted name to. If `NULL` the size required will be returned instead of the size written. + * The memory location to write the extracted name to. If NULL the size required will be returned instead of the size written. + * * @param[in] name_size - * The size of the memory location pointed to by `name`. + * The size of the memory location pointed to by @name. + * * @return * The size of the name. */ @@ -134,26 +136,27 @@ PORTABILITY_API size_t portability_path_get_name(const char *const path, const s /** * @brief * Get the file name portion out of a path and strip away any amount of file extensions. - * * When called with `"/foo/bar.baz.qux"`: * * - `portability_path_get_name` will produce the string `"bar.baz"` - * * - `portability_path_get_name_canonical` will produce the string `"bar"` * - * If `path` is NULL this will return an empty string. - * - * If `name` is NULL or `name_size is 0 this will return the size it requires in order to write `name`. + * If @path is NULL this will return an empty string. + * If @name is NULL or @name_size is 0 this will return the size it requires in order to write @name. + * If @path or @name are not NULL, then @path_size or @name_size, respectively, must be set to <= the length (including null-terminator) of the memory regions pointed to by @path and @name. * - * If `path` or `name` are not NULL, then `path_size` or `name_size`, respectively, must be set to <= the length (including 0-terminator) of the memory regions pointed to by `path` and `name`. * @param[in] path * The full path to extract the name from. + * * @param[in] path_size - * The length (including 0-terminator) of `path` in chars. + * The length (including null-terminator) of @path in chars. + * * @param[out] name - * The memory location to write the extracted name to. If `NULL` the size required will be returned instead of the size written. + * The memory location to write the extracted name to. If NULL the size required will be returned instead of the size written. + * * @param[in] name_size - * The size of the memory location pointed to by `name`. + * The size of the memory location pointed to by @name. + * * @return * The size of the name. */ diff --git a/source/portability/source/portability_path.c b/source/portability/source/portability_path.c index 096df995e..207a9cf29 100644 --- a/source/portability/source/portability_path.c +++ b/source/portability/source/portability_path.c @@ -25,80 +25,135 @@ /* Define separator checking for any platform */ #define PORTABILITY_PATH_SEPARATOR_ALL(chr) (chr == '\\' || chr == '/') -static size_t basename_offset(const char *const path, const size_t path_size) +static size_t portability_path_basename_offset(const char *const path, const size_t path_size) { size_t offset = path_size; - for (; offset != 0; offset--) - if (PORTABILITY_PATH_SEPARATOR(path[offset - 1])) - break; + + while (offset > 0 && !PORTABILITY_PATH_SEPARATOR(path[offset - 1])) + { + --offset; + } + return offset; } size_t portability_path_get_name(const char *const path, const size_t path_size, char *const name, const size_t name_size) { + size_t name_start, rightmost_dot, length, size; + if (path == NULL) { if (name == NULL || name_size == 0) + { return 0; + } + name[0] = '\0'; + return 1; } - // find rightmost path separator - const size_t name_start = basename_offset(path, path_size); - // Find rightmost dot - size_t rightmost_dot = path_size; - for (; rightmost_dot != name_start; rightmost_dot--) - if (path[rightmost_dot - 1] == '.') - break; - // No dots found, or name starts with dot and is non-empty, use whole name + + /* Find rightmost path separator */ + name_start = portability_path_basename_offset(path, path_size); + + /* Find rightmost dot */ + rightmost_dot = path_size; + + while (rightmost_dot != name_start && path[rightmost_dot - 1] != '.') + { + --rightmost_dot; + } + + /* No dots found, or name starts with dot and is non-empty, use whole name */ if (rightmost_dot == name_start || (rightmost_dot == name_start + 1 && rightmost_dot != path_size - 1)) + { rightmost_dot = path_size - 1; - // remove all consecutive dots at the end + } + + /* Remove all consecutive dots at the end */ while (rightmost_dot != name_start && path[rightmost_dot - 1] == '.') - rightmost_dot--; - const size_t length = rightmost_dot - name_start; - const size_t size = length + 1; - // Return required size + { + --rightmost_dot; + } + + length = rightmost_dot - name_start; + size = length + 1; + + /* Return required size */ if (name == NULL || size > name_size) + { return size; - if (length) + } + + if (length > 0) + { memcpy(name, path + name_start, length); + } + name[length] = '\0'; + return size; } size_t portability_path_get_name_canonical(const char *const path, const size_t path_size, char *const name, const size_t name_size) { + size_t name_start, leftmost_dot, length, size; + if (path == NULL) { if (name == NULL || name_size == 0) + { return 0; + } + name[0] = '\0'; + return 1; } - // find rightmost path separator - const size_t name_start = basename_offset(path, path_size); - // find leftmost dot - size_t leftmost_dot = name_start; - for (; leftmost_dot < path_size; leftmost_dot++) - if (path[leftmost_dot] == '.') - break; - // No dots found, use whole name + + /* Find rightmost path separator */ + name_start = portability_path_basename_offset(path, path_size); + + /* Find leftmost dot */ + leftmost_dot = name_start; + + while (leftmost_dot < path_size && path[leftmost_dot] != '.') + { + ++leftmost_dot; + } + + /* No dots found, use whole name */ if (leftmost_dot == path_size) - leftmost_dot--; - // name starts with dot, use the following dot instead + { + --leftmost_dot; + } + + /* Name starts with dot, use the following dot instead */ if (leftmost_dot == name_start) - for (leftmost_dot = name_start + 1; leftmost_dot < path_size; leftmost_dot++) - if (path[leftmost_dot] == '.') - break; - const size_t length = leftmost_dot - name_start; - const size_t size = length + 1; - // Return required size + { + do + { + ++leftmost_dot; + + } while (leftmost_dot < path_size && path[leftmost_dot] != '.'); + } + + length = leftmost_dot - name_start; + size = length + 1; + + /* Return required size */ if (name == NULL || size > name_size) + { return size; - if (length) + } + + if (length > 0) + { memcpy(name, path + name_start, length); + } + name[length] = '\0'; + return size; } From 77e9ddb2312950dbf0fa5b291883a799eeb94326 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Sat, 4 Oct 2025 17:48:55 +0200 Subject: [PATCH 470/487] Improve cxx port. --- source/ports/cxx_port/CMakeLists.txt | 33 ++--- .../cxx_port/include/metacall/metacall.hpp | 127 +++++++++++++++++- .../cxx_port/inline/metacall/metacall.inl | 40 ------ .../source/metacall_cxx_port_test.cpp | 81 +++++++++++ 4 files changed, 211 insertions(+), 70 deletions(-) delete mode 100644 source/ports/cxx_port/inline/metacall/metacall.inl diff --git a/source/ports/cxx_port/CMakeLists.txt b/source/ports/cxx_port/CMakeLists.txt index e3e79398a..c681dacd1 100644 --- a/source/ports/cxx_port/CMakeLists.txt +++ b/source/ports/cxx_port/CMakeLists.txt @@ -34,14 +34,9 @@ include(SecurityFlags) # Sources # -set(inline_path "${CMAKE_CURRENT_SOURCE_DIR}/inline/metacall") set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/metacall") set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") -set(inlines - ${inline_path}/metacall.inl -) - set(headers ${include_path}/metacall.hpp ) @@ -51,11 +46,8 @@ set(sources ) # Group source files -set(inline_group "Inline Files") set(header_group "Header Files (API)") set(source_group "Source Files") -source_group_by_path(${inline_path} "\\\\.inl$" - ${inline_group} ${inlines}) source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" ${header_group} ${headers}) source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" @@ -67,7 +59,6 @@ source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" # Build library add_library(${target} - ${inlines} ${sources} ${headers} ) @@ -104,10 +95,6 @@ target_include_directories(${target} ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include - ${PROJECT_BINARY_DIR}/source/inline - ${CMAKE_CURRENT_SOURCE_DIR}/inline - ${CMAKE_CURRENT_BINARY_DIR}/inline - PUBLIC ${DEFAULT_INCLUDE_DIRECTORIES} @@ -115,11 +102,6 @@ target_include_directories(${target} $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> $<INSTALL_INTERFACE:include> - - - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inline> - $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/inline> - $<INSTALL_INTERFACE:inline> ) # @@ -165,6 +147,15 @@ target_compile_options(${target} INTERFACE ) +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + # # Linker options # @@ -187,9 +178,3 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/metacall DESTINATION ${INSTALL_INCLUDE} COMPONENT dev ) - -# Inline files -install(DIRECTORY - ${CMAKE_CURRENT_SOURCE_DIR}/inline/metacall DESTINATION ${INSTALL_INCLUDE} - COMPONENT dev -) diff --git a/source/ports/cxx_port/include/metacall/metacall.hpp b/source/ports/cxx_port/include/metacall/metacall.hpp index d92a81638..443e9dbd9 100644 --- a/source/ports/cxx_port/include/metacall/metacall.hpp +++ b/source/ports/cxx_port/include/metacall/metacall.hpp @@ -86,7 +86,6 @@ class METACALL_API value : public value_base throw std::runtime_error("Unsupported MetaCall value"); } -private: // Type-specific creation (calls specialized version below) static void *create(const T &v); @@ -338,6 +337,123 @@ inline std::nullptr_t value<std::nullptr_t>::to_value() const // TODO: Future, Function, Class, Object, Exception, Throwable... +class METACALL_API value_ref +{ +public: + explicit value_ref(void *ptr) : + ptr(ptr) {} + + template <typename T> + T as() const + { + return value<T>(ptr).to_value(); + } + +private: + void *ptr; +}; + +class METACALL_API array : public value_base +{ +public: + template <typename... Args> + explicit array(Args &&...args) : + value_base(create(std::forward<Args>(args)...), &metacall_value_destroy) + { + if (value_ptr == nullptr) + { + throw std::runtime_error("Failed to create MetaCall array"); + } + } + + explicit array(void *array_value) : + value_base(array_value, &value_base::noop_destructor) {} + + void **to_value() const + { + void **array_ptr = metacall_value_to_array(value_ptr.get()); + + if (array_ptr == NULL) + { + throw std::runtime_error("Invalid MetaCall array"); + } + + return array_ptr; + } + + template <typename T> + T get(std::size_t index) const + { + void **array_ptr = to_value(); + + return value<T>(array_ptr[index]).to_value(); + } + + value_ref operator[](std::size_t index) const + { + void **array_ptr = to_value(); + + return value_ref(array_ptr[index]); + } + + static enum metacall_value_id id() + { + return METACALL_ARRAY; + } + +private: + // Recursive function to create and fill the MetaCall array + template <typename... Args> + static void *create(Args &&...args) + { + constexpr std::size_t size = sizeof...(Args); + + // Create the array with null data initially + void *array_value = metacall_value_create_array(NULL, size); + + if (array_value == NULL) + { + throw std::runtime_error("Failed to create MetaCall value array"); + } + + // Get the internal C array + void **array_ptr = metacall_value_to_array(array_value); + + // Helper to unpack the args into array + create_array(array_ptr, 0, std::forward<Args>(args)...); + + return array_value; + } + + // Recursive unpacking using fold expression (C++17+) + template <typename... Args> + static void create_array(void **array_ptr, std::size_t index, Args &&...args) + { + // Use initializer list trick to expand the pack + (( + array_ptr[index++] = value<std::decay_t<Args>>::create(std::forward<Args>(args))), + ...); + } +}; + +template <> +inline void *value<array>::create(const array &v) +{ + return metacall_value_copy(v.to_raw()); +} + +template <> +inline enum metacall_value_id value<array>::id() +{ + return METACALL_ARRAY; +} + +template <> +inline array value<array>::to_value() const +{ + return array(to_raw()); +} + template <typename K, typename V> class METACALL_API map : public value_base { @@ -422,12 +538,11 @@ class METACALL_API map : public value_base }; template <typename... Ts> -METACALL_API int metacall(std::string name, Ts... ts); +METACALL_API int metacall(std::string name, Ts... ts) +{ + return 0; +} } /* namespace metacall */ -// TODO: Move everything to metacall.inl - -#include <metacall/metacall.inl> - #endif /* METACALL_HPP */ diff --git a/source/ports/cxx_port/inline/metacall/metacall.inl b/source/ports/cxx_port/inline/metacall/metacall.inl deleted file mode 100644 index 8223b5be0..000000000 --- a/source/ports/cxx_port/inline/metacall/metacall.inl +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Format Library by Parra Studios - * A cross-platform library for supporting formatted input / output. - * - * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef METACALL_INL -#define METACALL_INL 1 - -/* -- Headers -- */ - -#include <metacall/metacall_api.h> - -#include <string> - -namespace metacall -{ -template <typename... Ts> -METACALL_API int metacall(std::string name, Ts... ts) -{ - return 0; -} - -} /* namespace metacall */ - -#endif /* METACALL_INL */ diff --git a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp index 6865b258f..516e1f27b 100644 --- a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp +++ b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp @@ -46,6 +46,48 @@ void *cxx_map_test(size_t argc, void *args[], void *data) return metacall_value_create_null(); } +void *cxx_array_test(size_t argc, void *args[], void *data) +{ + array a(args[0]); + + (void)argc; + (void)data; + + EXPECT_EQ((float)a[0].as<int>(), (int)3); + EXPECT_EQ((float)a[1].as<float>(), (float)4.0f); + + EXPECT_EQ((float)a.get<int>(0), (int)3); + EXPECT_EQ((float)a.get<float>(1), (float)4.0f); + + printf("a[0] => %d\n", a[0].as<int>()); + printf("a[1] => %f\n", a[1].as<float>()); + fflush(stdout); + + return metacall_value_create_null(); +} + +void *cxx_map_array_test(size_t argc, void *args[], void *data) +{ + map<std::string, array> m(args[0]); + + (void)argc; + (void)data; + + EXPECT_STREQ(m["includes"][0].as<std::string>().c_str(), "/a/path"); + EXPECT_STREQ(m["includes"][1].as<std::string>().c_str(), "/another/path"); + + EXPECT_STREQ(m["libraries"][0].as<std::string>().c_str(), "/a/path"); + EXPECT_STREQ(m["libraries"][1].as<std::string>().c_str(), "/another/path"); + + printf("m['includes'][0] => %s\n", m["includes"][0].as<std::string>().c_str()); + printf("m['includes'][1] => %s\n", m["includes"][1].as<std::string>().c_str()); + + printf("m['libraries'][0] => %s\n", m["libraries"][0].as<std::string>().c_str()); + printf("m['libraries'][1] => %s\n", m["libraries"][1].as<std::string>().c_str()); + + return metacall_value_create_null(); +} + // TODO: /* void *cxx_recursive_map_test(size_t argc, void *args[], void *data) @@ -89,6 +131,45 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) metacall_value_destroy(ret); } + { + array a(3, 4.0f); + + void *args[] = { + a.to_raw() + }; + + metacall_register("cxx_array_test", cxx_array_test, NULL, METACALL_NULL, 1, METACALL_ARRAY); + + void *ret = metacallv_s("cxx_array_test", args, 1); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + } + + { + map<std::string, array> m = { + { "includes", array("/a/path", "/another/path") }, + { "libraries", array("/a/path", "/another/path") } + }; + + void *args[] = { + m.to_raw() + }; + + metacall_register("cxx_map_array_test", cxx_map_array_test, NULL, METACALL_NULL, 1, METACALL_MAP); + + void *ret = metacallv_s("cxx_map_array_test", args, 1); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + + metacall_value_destroy(ret); + } + // TODO: /* { From 057d988c43d798eb9c5494d2f372a279f4c2df9c Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 9 Oct 2025 17:12:41 +0200 Subject: [PATCH 471/487] Improve metacall cxx port. --- source/ports/cxx_port/CMakeLists.txt | 8 +++ .../cxx_port/include/metacall/metacall.hpp | 51 ++++++++++++-- .../cxx_port/include/metacall/metacall.inl | 31 +++++++++ .../source/metacall_cxx_port_test.cpp | 66 +++++++------------ 4 files changed, 108 insertions(+), 48 deletions(-) create mode 100644 source/ports/cxx_port/include/metacall/metacall.inl diff --git a/source/ports/cxx_port/CMakeLists.txt b/source/ports/cxx_port/CMakeLists.txt index c681dacd1..13657ce94 100644 --- a/source/ports/cxx_port/CMakeLists.txt +++ b/source/ports/cxx_port/CMakeLists.txt @@ -41,15 +41,22 @@ set(headers ${include_path}/metacall.hpp ) +set(inline + ${include_path}/metacall.inl +) + set(sources ${source_path}/metacall.cpp ) # Group source files set(header_group "Header Files (API)") +set(inline_group "Inline Files") set(source_group "Source Files") source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" ${header_group} ${headers}) +source_group_by_path(${include_path} "\\\\.inl$" + ${inline_group} ${inlines}) source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" ${source_group} ${sources}) @@ -61,6 +68,7 @@ source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" add_library(${target} ${sources} ${headers} + ${inline} ) # Create namespaced alias diff --git a/source/ports/cxx_port/include/metacall/metacall.hpp b/source/ports/cxx_port/include/metacall/metacall.hpp index 443e9dbd9..9092bbfe9 100644 --- a/source/ports/cxx_port/include/metacall/metacall.hpp +++ b/source/ports/cxx_port/include/metacall/metacall.hpp @@ -72,8 +72,8 @@ class METACALL_API value : public value_base } } - explicit value(void *value_ptr) : - value_base(value_ptr, &value_base::noop_destructor) + explicit value(void *value_ptr, void (*destructor)(void *) = &value_base::noop_destructor) : + value_base(value_ptr, destructor) { if (metacall_value_id(value_ptr) != id()) { @@ -537,12 +537,53 @@ class METACALL_API map : public value_base std::unordered_map<K, pair_value_type> m; }; -template <typename... Ts> -METACALL_API int metacall(std::string name, Ts... ts) +namespace detail +{ +template <typename T> +constexpr bool is_value_base = std::is_base_of_v<value_base, std::remove_cv_t<std::remove_reference_t<T>>>; + +template <typename T> +value_base to_value_base(T &&arg) { - return 0; + if constexpr (is_value_base<T>) + { + return std::move(arg); + } + else + { + return value<std::decay_t<T>>(std::forward<T>(arg)); + } +} + +} /* namespace detail */ + +template <typename Ret, typename... Args> +METACALL_API Ret metacall(std::string name, Args &&...args) +{ + constexpr std::size_t size = sizeof...(Args); + std::array<value_base, size> value_args = { { detail::to_value_base(std::forward<Args>(args))... } }; + void *raw_args[size]; + + for (std::size_t i = 0; i < size; ++i) + { + raw_args[i] = value_args[i].to_raw(); + } + + void *ret = metacallv_s(name.c_str(), raw_args, size); + + if (ret == NULL) + { + throw std::runtime_error("MetaCall invokation to '" + name + "' has failed by returning NULL"); + } + + value<Ret> result(ret, &metacall_value_destroy); + + return result.to_value(); } } /* namespace metacall */ +// TODO: Move implementations to metacall.inl +#include <metacall/metacall.inl> + #endif /* METACALL_HPP */ diff --git a/source/ports/cxx_port/include/metacall/metacall.inl b/source/ports/cxx_port/include/metacall/metacall.inl new file mode 100644 index 000000000..81a48f839 --- /dev/null +++ b/source/ports/cxx_port/include/metacall/metacall.inl @@ -0,0 +1,31 @@ +/* + * Format Library by Parra Studios + * A cross-platform library for supporting formatted input / output. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef METACALL_INL +#define METACALL_INL 1 + +/* -- Headers -- */ + +namespace metacall +{ + +} /* namespace metacall */ + +#endif /* METACALL_INL */ diff --git a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp index 516e1f27b..23998054e 100644 --- a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp +++ b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp @@ -106,6 +106,20 @@ void *cxx_recursive_map_test(size_t argc, void *args[], void *data) } */ +void *cxx_float_int_int_test(size_t argc, void *args[], void *data) +{ + value<int> a0(args[0]); + value<int> a1(args[1]); + + (void)argc; + (void)data; + + EXPECT_EQ(a0.to_value(), 7); + EXPECT_EQ(a1.to_value(), 8); + + return metacall_value_create_float(3.0f); +} + TEST_F(metacall_cxx_port_test, DefaultConstructor) { ASSERT_EQ((int)0, (int)metacall_initialize()); @@ -116,37 +130,17 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) { "world", 4.0f } }; - void *args[] = { - m.to_raw() - }; - metacall_register("cxx_map_test", cxx_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); - void *ret = metacallv_s("cxx_map_test", args, 1); - - EXPECT_NE((void *)NULL, (void *)ret); - - EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); - - metacall_value_destroy(ret); + EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_map_test", m)); } { array a(3, 4.0f); - void *args[] = { - a.to_raw() - }; - metacall_register("cxx_array_test", cxx_array_test, NULL, METACALL_NULL, 1, METACALL_ARRAY); - void *ret = metacallv_s("cxx_array_test", args, 1); - - EXPECT_NE((void *)NULL, (void *)ret); - - EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); - - metacall_value_destroy(ret); + EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_array_test", a)); } { @@ -155,19 +149,9 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) { "libraries", array("/a/path", "/another/path") } }; - void *args[] = { - m.to_raw() - }; - metacall_register("cxx_map_array_test", cxx_map_array_test, NULL, METACALL_NULL, 1, METACALL_MAP); - void *ret = metacallv_s("cxx_map_array_test", args, 1); - - EXPECT_NE((void *)NULL, (void *)ret); - - EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); - - metacall_value_destroy(ret); + EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_map_array_test", m)); } // TODO: @@ -177,21 +161,17 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) { "hello", { "world", 4.0f } } }; - void *args[] = { - m.to_raw() - }; - metacall_register("cxx_recursive_map_test", cxx_recursive_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); - void *ret = metacallv_s("cxx_recursive_map_test", args, 1); - - EXPECT_NE((void *)NULL, (void *)ret); + EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_recursive_map_test", m)); + } + */ - EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_NULL); + { + metacall_register("cxx_float_int_int_test", cxx_float_int_int_test, NULL, METACALL_FLOAT, 2, METACALL_INT, METACALL_INT); - metacall_value_destroy(ret); + EXPECT_EQ(3.0f, metacall::metacall<float>("cxx_float_int_int_test", 7, 8)); } - */ /* Print inspect information */ { From ac2228f9b412fb89eac49e9717517f9a48c5fdf7 Mon Sep 17 00:00:00 2001 From: Abdelrahman Omar <128975938+abd0-omar@users.noreply.github.com> Date: Wed, 29 Oct 2025 15:26:39 +0300 Subject: [PATCH 472/487] replace string loader tags with `Tag` enum (#588) Use Tag enum instead of strings in `load::from_single_file`, `load::from_file` and `load::from_memory`. Prevents runtime errors from invalid tags like 'rust' instead of 'rs'. --- source/ports/rs_port/README.md | 2 +- source/ports/rs_port/inline/src/lib.rs | 16 ++++- source/ports/rs_port/src/lib.rs | 8 +-- source/ports/rs_port/src/load.rs | 72 ++++++++++++++++--- source/ports/rs_port/tests/inlines_test.rs | 15 ++-- .../rs_port/tests/invalid_loaders_test.rs | 15 ++-- source/ports/rs_port/tests/loaders_test.rs | 12 ++-- .../rs_port/tests/metacall_exception_test.rs | 7 +- source/ports/rs_port/tests/metacall_test.rs | 13 ++-- 9 files changed, 118 insertions(+), 42 deletions(-) diff --git a/source/ports/rs_port/README.md b/source/ports/rs_port/README.md index 53edd0936..1cce7dd4b 100644 --- a/source/ports/rs_port/README.md +++ b/source/ports/rs_port/README.md @@ -51,7 +51,7 @@ fn main() { let _metacall = initialize().unwrap(); // Load the file - load::from_single_file("ts", "sum.ts").unwrap(); + load::from_single_file(load::Tag::TypeScript, "sum.ts").unwrap(); // Call the sum function let sum = metacall::<f64>("sum", [1.0, 2.0]).unwrap(); diff --git a/source/ports/rs_port/inline/src/lib.rs b/source/ports/rs_port/inline/src/lib.rs index bb9358d5a..1b0083a16 100644 --- a/source/ports/rs_port/inline/src/lib.rs +++ b/source/ports/rs_port/inline/src/lib.rs @@ -2,7 +2,7 @@ use proc_macro::TokenStream; use quote::quote; macro_rules! gen_inline_macro { - ($($name:ident),*) => ( + ($($name:ident => $tag:ident),*) => ( $( #[proc_macro] pub fn $name(input: TokenStream) -> TokenStream { @@ -10,7 +10,7 @@ macro_rules! gen_inline_macro { let buffer = token_stream_input.to_string(); let result = quote! {{ - ::metacall::load::from_memory(stringify!($name), #buffer.to_string()).unwrap() + ::metacall::load::from_memory(::metacall::load::Tag::$tag, #buffer.to_string()).unwrap() }}; result.into() @@ -19,4 +19,14 @@ macro_rules! gen_inline_macro { ) } -gen_inline_macro!(py, node, ts, cs, rb, cob, rpc, java, wasm); +gen_inline_macro!( + py => Python, + node => NodeJS, + ts => TypeScript, + cs => CSharp, + rb => Ruby, + cob => Cobol, + rpc => RPC, + java => Java, + wasm => Wasm +); diff --git a/source/ports/rs_port/src/lib.rs b/source/ports/rs_port/src/lib.rs index 3cfb34485..2aada3f72 100644 --- a/source/ports/rs_port/src/lib.rs +++ b/source/ports/rs_port/src/lib.rs @@ -49,7 +49,7 @@ //! //! // Load the file (Checkout the loaders module for loading multiple files //! // or loading from string) -//! load::from_single_file("ts", "sum.ts").unwrap(); +//! load::from_single_file(load::Tag::TypeScript, "sum.ts").unwrap(); //! //! // Call the sum function (Also checkout other metacall functions) //! let sum = metacall::<f64>("sum", [1.0, 2.0]).unwrap(); @@ -66,14 +66,14 @@ pub(crate) use macros::private_macros::*; /// Contains MetaCall loaders from file and memory. Usage example: ... /// ``` /// // Loading a single file with Nodejs. -/// metacall::load::from_single_file("node", "index.js").unwrap(); +/// metacall::load::from_single_file(metacall::load::Tag::NodeJS, "index.js").unwrap(); /// /// // Loading multiple files with Nodejs. -/// metacall::load::from_file("node", ["index.js", "main.js"]).unwrap(); +/// metacall::load::from_file(metacall::load::Tag::NodeJS, ["index.js", "main.js"]).unwrap(); /// /// // Loading a string with Nodejs. /// let script = "function greet() { return 'hi there!' }; module.exports = { greet };"; -/// metacall::load::from_memory("node", script).unwrap(); +/// metacall::load::from_memory(metacall::load::Tag::NodeJS, script).unwrap(); /// ``` pub mod load; diff --git a/source/ports/rs_port/src/load.rs b/source/ports/rs_port/src/load.rs index 4c9f8cc55..2e40af3f1 100644 --- a/source/ports/rs_port/src/load.rs +++ b/source/ports/rs_port/src/load.rs @@ -5,28 +5,82 @@ use crate::{ }; use std::{ ffi::CString, + fmt, path::{Path, PathBuf}, ptr, }; +pub enum Tag { + C, + Cobol, + Crystal, + CSharp, + Dart, + Deno, + Extension, + File, + Java, + Julia, + JavaScript, + JSM, + Kind, + LLVM, + Lua, + Mock, + NodeJS, + Python, + Ruby, + RPC, + Rust, + TypeScript, + Wasm, +} + +impl fmt::Display for Tag { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Tag::C => write!(f, "c"), + Tag::Cobol => write!(f, "cob"), + Tag::Crystal => write!(f, "cr"), + Tag::CSharp => write!(f, "cs"), + Tag::Dart => write!(f, "dart"), + Tag::Deno => write!(f, "deno"), + Tag::Extension => write!(f, "ext"), + Tag::File => write!(f, "file"), + Tag::Java => write!(f, "java"), + Tag::Julia => write!(f, "jl"), + Tag::JavaScript => write!(f, "js"), + Tag::JSM => write!(f, "jsm"), + Tag::Kind => write!(f, "kind"), + Tag::LLVM => write!(f, "llvm"), + Tag::Lua => write!(f, "lua"), + Tag::Mock => write!(f, "mock"), + Tag::NodeJS => write!(f, "node"), + Tag::Python => write!(f, "py"), + Tag::Ruby => write!(f, "rb"), + Tag::RPC => write!(f, "rpc"), + Tag::Rust => write!(f, "rs"), + Tag::TypeScript => write!(f, "ts"), + Tag::Wasm => write!(f, "wasm"), + } + } +} + /// Loads a script from a single file. Usage example: ... /// ``` /// // A Nodejs script -/// metacall::load::from_single_file("node", "index.js").unwrap(); +/// metacall::load::from_single_file(Tag::NodeJS, "index.js").unwrap(); /// ``` -pub fn from_single_file( - tag: impl ToString, - script: impl AsRef<Path>, -) -> Result<(), MetaCallLoaderError> { +pub fn from_single_file(tag: Tag, script: impl AsRef<Path>) -> Result<(), MetaCallLoaderError> { from_file(tag, [script]) } /// Loads a script from file. Usage example: ... /// ``` /// // A Nodejs script -/// metacall::load::from_file("node", ["index.js", "main.js"]).unwrap(); +/// metacall::load::from_file(Tag::NodeJS, ["index.js", "main.js"]).unwrap(); /// ``` pub fn from_file( - tag: impl ToString, + tag: Tag, scripts: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Result<(), MetaCallLoaderError> { let c_tag = cstring_enum!(tag, MetaCallLoaderError)?; @@ -71,9 +125,9 @@ pub fn from_file( /// let script = "function greet() { return 'hi there!' }; module.exports = { greet };"; /// /// // A Nodejs script -/// metacall::load::from_memory("node", script).unwrap(); +/// metacall::load::from_memory(Tag::NodeJS, script).unwrap(); /// ``` -pub fn from_memory(tag: impl ToString, script: impl ToString) -> Result<(), MetaCallLoaderError> { +pub fn from_memory(tag: Tag, script: impl ToString) -> Result<(), MetaCallLoaderError> { let script = script.to_string(); let c_tag = cstring_enum!(tag, MetaCallLoaderError)?; let c_script = cstring_enum!(script, MetaCallLoaderError)?; diff --git a/source/ports/rs_port/tests/inlines_test.rs b/source/ports/rs_port/tests/inlines_test.rs index ff5f48308..adf06ee43 100644 --- a/source/ports/rs_port/tests/inlines_test.rs +++ b/source/ports/rs_port/tests/inlines_test.rs @@ -1,7 +1,8 @@ use metacall::{ initialize, inline::{node, py, ts}, - is_initialized, load, + is_initialized, + load::{self, Tag}, }; #[test] @@ -10,30 +11,30 @@ fn inlines() { assert!(is_initialized()); - if load::from_memory("py", "").is_ok() { + if load::from_memory(Tag::Python, "").is_ok() { py! { print("hello world") } } - if load::from_memory("py", "").is_ok() { + if load::from_memory(Tag::Python, "").is_ok() { py! {print("hello world")} } - if load::from_memory("node", "").is_ok() { + if load::from_memory(Tag::NodeJS, "").is_ok() { node! { console.log("hello world"); } } - if load::from_memory("node", "").is_ok() { + if load::from_memory(Tag::NodeJS, "").is_ok() { node! {console.log("hello world")} } - if load::from_memory("ts", "").is_ok() { + if load::from_memory(Tag::TypeScript, "").is_ok() { ts! { console.log("hello world"); } } - if load::from_memory("ts", "").is_ok() { + if load::from_memory(Tag::TypeScript, "").is_ok() { ts! {console.log("hello world")} } } diff --git a/source/ports/rs_port/tests/invalid_loaders_test.rs b/source/ports/rs_port/tests/invalid_loaders_test.rs index ec58d0bcb..559690aae 100644 --- a/source/ports/rs_port/tests/invalid_loaders_test.rs +++ b/source/ports/rs_port/tests/invalid_loaders_test.rs @@ -1,4 +1,8 @@ -use metacall::{initialize, is_initialized, load, MetaCallLoaderError}; +use metacall::{ + initialize, is_initialized, + load::{self, Tag}, + MetaCallLoaderError, +}; use std::env; #[test] @@ -9,25 +13,24 @@ fn invalid_loaders() { let scripts_dir = env::current_dir().unwrap().join("tests/scripts"); let inavlid_file = scripts_dir.join("whatever.yeet"); - let valid_file = scripts_dir.join("script.js"); + let js_file = scripts_dir.join("script.js"); if let Err(MetaCallLoaderError::FileNotFound(_)) = - load::from_single_file("random", inavlid_file) + load::from_single_file(load::Tag::NodeJS, inavlid_file) { // Everything Ok } else { panic!("Expected the loader fail with `FileNotFound` error variant!"); } - if let Err(MetaCallLoaderError::FromFileFailure) = load::from_single_file("random", valid_file) - { + if let Err(MetaCallLoaderError::FromFileFailure) = load::from_single_file(Tag::Lua, js_file) { // Everything Ok } else { panic!("Expected the loader fail with `FromFileFailure` error variant!"); } if let Err(MetaCallLoaderError::FromMemoryFailure) = - load::from_memory("random", "Invalid code!") + load::from_memory(load::Tag::NodeJS, "Invalid code!") { // Everything Ok } else { diff --git a/source/ports/rs_port/tests/loaders_test.rs b/source/ports/rs_port/tests/loaders_test.rs index c45c4c17b..00fab0751 100644 --- a/source/ports/rs_port/tests/loaders_test.rs +++ b/source/ports/rs_port/tests/loaders_test.rs @@ -1,4 +1,8 @@ -use metacall::{initialize, is_initialized, load, metacall_no_arg}; +use metacall::{ + initialize, is_initialized, + load::{self, Tag}, + metacall_no_arg, +}; use std::{ env, fs::{self, File}, @@ -17,10 +21,10 @@ fn call_greet(test: &str, num: u32) { } fn load_from_memory_test() { - load::from_memory("node", SCRIPT1).unwrap(); + load::from_memory(Tag::NodeJS, SCRIPT1).unwrap(); call_greet("load_from_memory", 1); - load::from_memory("node", SCRIPT3).unwrap(); + load::from_memory(Tag::NodeJS, SCRIPT3).unwrap(); } fn load_from_file_test() { @@ -34,7 +38,7 @@ fn load_from_file_test() { temp_js.write_all(SCRIPT2.as_bytes()).unwrap(); temp_js.flush().unwrap(); - load::from_single_file("node", temp_js_path).unwrap(); + load::from_single_file(Tag::NodeJS, temp_js_path).unwrap(); call_greet("load_from_file", 2); diff --git a/source/ports/rs_port/tests/metacall_exception_test.rs b/source/ports/rs_port/tests/metacall_exception_test.rs index 780aba056..ef8b269a4 100644 --- a/source/ports/rs_port/tests/metacall_exception_test.rs +++ b/source/ports/rs_port/tests/metacall_exception_test.rs @@ -1,4 +1,7 @@ -use metacall::{initialize, is_initialized, load}; +use metacall::{ + initialize, is_initialized, + load::{self, Tag}, +}; use std::env; #[test] @@ -10,7 +13,7 @@ fn inlines() { let tests_dir = env::current_dir().unwrap().join("tests/scripts"); let js_test_file = tests_dir.join("script.js"); - if load::from_single_file("node", js_test_file).is_ok() { + if load::from_single_file(Tag::NodeJS, js_test_file).is_ok() { // This should not generate a segmentation fault let val = metacall::metacall_no_arg::<metacall::MetaCallException>("test_exception").unwrap(); diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index d23e2e2ae..7b842da59 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -1,7 +1,8 @@ use metacall::{ - initialize, is_initialized, load, MetaCallClass, MetaCallException, MetaCallFunction, - MetaCallFuture, MetaCallNull, MetaCallObject, MetaCallPointer, MetaCallThrowable, - MetaCallValue, + initialize, is_initialized, + load::{self, Tag}, + MetaCallClass, MetaCallException, MetaCallFunction, MetaCallFuture, MetaCallNull, + MetaCallObject, MetaCallPointer, MetaCallThrowable, MetaCallValue, }; use std::{any::Any, collections::HashMap, env, fmt::Debug}; @@ -368,7 +369,7 @@ fn metacall() { let js_test_file = tests_dir.join("script.js"); let c_test_file = tests_dir.join("script.c"); let py_test_file = tests_dir.join("script.py"); - let py_loaded = load::from_single_file("py", py_test_file).is_ok(); + let py_loaded = load::from_single_file(Tag::Python, py_test_file).is_ok(); if py_loaded { test_buffer(); @@ -381,7 +382,7 @@ fn metacall() { test_string(); test_null(); } - if load::from_single_file("c", c_test_file).is_ok() { + if load::from_single_file(load::Tag::C, c_test_file).is_ok() { test_char(); test_double(); test_float(); @@ -390,7 +391,7 @@ fn metacall() { test_short(); test_mixed_numbers(); } - if load::from_single_file("node", js_test_file).is_ok() { + if load::from_single_file(load::Tag::NodeJS, js_test_file).is_ok() { test_exception(); test_throwable(); test_future(); From 9f3a6d53816d433b332120a58c23d98d82bd4580 Mon Sep 17 00:00:00 2001 From: Aly Abdelmoneim <148393799+AlyAbdelmoneim@users.noreply.github.com> Date: Wed, 29 Oct 2025 15:30:30 +0300 Subject: [PATCH 473/487] refactor: rename 'script' parameters to 'path' in file loading functions (#587) * refactor: rename 'script' parameters to 'path' in file loading functions * refactor: renaming rest of the variables from script and scripts to path and paths respectively * refactor: renaming rest of the variables from script and scripts to path and paths respectively * Update load.rs --------- Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- source/ports/rs_port/src/load.rs | 44 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/source/ports/rs_port/src/load.rs b/source/ports/rs_port/src/load.rs index 2e40af3f1..743e1f98d 100644 --- a/source/ports/rs_port/src/load.rs +++ b/source/ports/rs_port/src/load.rs @@ -66,50 +66,54 @@ impl fmt::Display for Tag { } } -/// Loads a script from a single file. Usage example: ... +/// Loads a file from a single file. Usage example: ... /// ``` -/// // A Nodejs script -/// metacall::load::from_single_file(Tag::NodeJS, "index.js").unwrap(); +/// // A Nodejs path +/// metacall::load::from_single_file("node", "index.js").unwrap(); /// ``` -pub fn from_single_file(tag: Tag, script: impl AsRef<Path>) -> Result<(), MetaCallLoaderError> { - from_file(tag, [script]) +pub fn from_single_file( + tag: impl ToString, + path: impl AsRef<Path>, +) -> Result<(), MetaCallLoaderError> { + from_file(tag, [path]) } -/// Loads a script from file. Usage example: ... + +/// Loads a path from file. Usage example: ... /// ``` /// // A Nodejs script /// metacall::load::from_file(Tag::NodeJS, ["index.js", "main.js"]).unwrap(); /// ``` pub fn from_file( tag: Tag, - scripts: impl IntoIterator<Item = impl AsRef<Path>>, + paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Result<(), MetaCallLoaderError> { let c_tag = cstring_enum!(tag, MetaCallLoaderError)?; - let mut c_script: CString; + let mut c_path: CString; - let mut new_scripts: Vec<*const i8> = Vec::new(); - for script in scripts.into_iter() { - let script_as_pathbuf = PathBuf::from(script.as_ref()); - let script_as_str = script_as_pathbuf.to_str().unwrap(); + let mut new_paths: Vec<*const i8> = Vec::new(); + for path in paths.into_iter() { + let path_as_pathbuf = PathBuf::from(path.as_ref()); + let path_as_str = path_as_pathbuf.to_str().unwrap(); - if !script_as_pathbuf.exists() { - return Err(MetaCallLoaderError::FileNotFound(script_as_pathbuf)); + if !path_as_pathbuf.exists() { + return Err(MetaCallLoaderError::FileNotFound(path_as_pathbuf)); } - if !script_as_pathbuf.is_file() { + if !path_as_pathbuf.is_file() { return Err(MetaCallLoaderError::NotAFileOrPermissionDenied( - script_as_pathbuf, + path_as_pathbuf, )); } - c_script = cstring_enum!(script_as_str, MetaCallLoaderError)?; + c_path = cstring_enum!(path_as_str, MetaCallLoaderError)?; - new_scripts.push(c_script.as_ptr()); + new_paths.push(c_path.as_ptr()); } if unsafe { metacall_load_from_file( c_tag.as_ptr(), - new_scripts.as_mut_ptr(), - new_scripts.len(), + new_paths.as_mut_ptr(), + new_paths.len(), ptr::null_mut(), ) } != 0 From bcca0eebaad2b04d688a8724f2ca6417d34c3948 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 29 Oct 2025 13:40:34 +0100 Subject: [PATCH 474/487] Solve issues with rs_port. --- source/ports/rs_port/src/load.rs | 2 +- source/ports/rs_port/tests/invalid_loaders_test.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/ports/rs_port/src/load.rs b/source/ports/rs_port/src/load.rs index 743e1f98d..2eac2898a 100644 --- a/source/ports/rs_port/src/load.rs +++ b/source/ports/rs_port/src/load.rs @@ -72,7 +72,7 @@ impl fmt::Display for Tag { /// metacall::load::from_single_file("node", "index.js").unwrap(); /// ``` pub fn from_single_file( - tag: impl ToString, + tag: Tag, path: impl AsRef<Path>, ) -> Result<(), MetaCallLoaderError> { from_file(tag, [path]) diff --git a/source/ports/rs_port/tests/invalid_loaders_test.rs b/source/ports/rs_port/tests/invalid_loaders_test.rs index 559690aae..a803c4cb4 100644 --- a/source/ports/rs_port/tests/invalid_loaders_test.rs +++ b/source/ports/rs_port/tests/invalid_loaders_test.rs @@ -13,7 +13,7 @@ fn invalid_loaders() { let scripts_dir = env::current_dir().unwrap().join("tests/scripts"); let inavlid_file = scripts_dir.join("whatever.yeet"); - let js_file = scripts_dir.join("script.js"); + let valid_file = scripts_dir.join("script.js"); if let Err(MetaCallLoaderError::FileNotFound(_)) = load::from_single_file(load::Tag::NodeJS, inavlid_file) @@ -23,7 +23,8 @@ fn invalid_loaders() { panic!("Expected the loader fail with `FileNotFound` error variant!"); } - if let Err(MetaCallLoaderError::FromFileFailure) = load::from_single_file(Tag::Lua, js_file) { + // We use JSM here because it is not implemented, it should fail + if let Err(MetaCallLoaderError::FromFileFailure) = load::from_single_file(Tag::JSM, valid_file) { // Everything Ok } else { panic!("Expected the loader fail with `FromFileFailure` error variant!"); From 25fedf1a5ef95723a8296805787b0d690f99db11 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 29 Oct 2025 13:42:01 +0100 Subject: [PATCH 475/487] Solve issues in windows with cxx port. --- source/ports/cxx_port/include/metacall/metacall.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/ports/cxx_port/include/metacall/metacall.hpp b/source/ports/cxx_port/include/metacall/metacall.hpp index 9092bbfe9..080013b26 100644 --- a/source/ports/cxx_port/include/metacall/metacall.hpp +++ b/source/ports/cxx_port/include/metacall/metacall.hpp @@ -60,7 +60,7 @@ class value_base }; template <typename T> -class METACALL_API value : public value_base +class value : public value_base { public: explicit value(const T &v, void (*destructor)(void *) = &metacall_value_destroy) : @@ -337,7 +337,7 @@ inline std::nullptr_t value<std::nullptr_t>::to_value() const // TODO: Future, Function, Class, Object, Exception, Throwable... -class METACALL_API value_ref +class value_ref { public: explicit value_ref(void *ptr) : @@ -353,7 +353,7 @@ class METACALL_API value_ref void *ptr; }; -class METACALL_API array : public value_base +class array : public value_base { public: template <typename... Args> @@ -455,7 +455,7 @@ inline array value<array>::to_value() const } template <typename K, typename V> -class METACALL_API map : public value_base +class map : public value_base { public: using pair_type = std::pair<K, V>; @@ -558,7 +558,7 @@ value_base to_value_base(T &&arg) } /* namespace detail */ template <typename Ret, typename... Args> -METACALL_API Ret metacall(std::string name, Args &&...args) +Ret metacall(std::string name, Args &&...args) { constexpr std::size_t size = sizeof...(Args); std::array<value_base, size> value_args = { { detail::to_value_base(std::forward<Args>(args))... } }; From 8b773d46b8267bfa48128fdd401b8f06cb3092f5 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 29 Oct 2025 18:51:43 +0100 Subject: [PATCH 476/487] Add new async api in rs port. --- source/ports/rs_port/Cargo.toml | 2 +- .../rs_port/src/types/metacall_future.rs | 39 +++++++------------ source/ports/rs_port/tests/metacall_test.rs | 27 +++++++------ 3 files changed, 31 insertions(+), 37 deletions(-) diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index 4ed8cee59..c238068d3 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.5.2" +version = "0.5.3" [lib] crate-type = ["lib"] diff --git a/source/ports/rs_port/src/types/metacall_future.rs b/source/ports/rs_port/src/types/metacall_future.rs index de051d0d5..6caa25d53 100644 --- a/source/ports/rs_port/src/types/metacall_future.rs +++ b/source/ports/rs_port/src/types/metacall_future.rs @@ -19,7 +19,8 @@ use std::{ /// and the second argument is the data that you may want to access when the function gets called. /// Checkout [MetaCallFuture resolve](MetaCallFuture#method.then) or /// [MetaCallFuture reject](MetaCallFuture#method.catch) for usage. -pub type MetaCallFutureHandler = fn(Box<dyn MetaCallValue>, Box<dyn Any>) -> Box<dyn MetaCallValue>; +pub type MetaCallFutureHandler = + fn(Box<dyn MetaCallValue>, Option<Box<dyn Any>>) -> Box<dyn MetaCallValue>; /// Represents MetaCallFuture. Keep in mind that it's not supported to pass a future as an argument. /// @@ -118,7 +119,12 @@ type MetaCallFutureFFIData = ( unsafe extern "C" fn resolver(resolve_data: *mut c_void, upper_data: *mut c_void) -> *mut c_void { let (resolve, _, data) = *Box::from_raw(upper_data as *mut MetaCallFutureFFIData); - let user_data = Box::from_raw(data); + + let user_data = if !data.is_null() { + Some(Box::from_raw(data)) + } else { + None + }; let result = (resolve.unwrap())( cast::raw_to_metacallobj_untyped_leak(resolve_data), @@ -133,7 +139,12 @@ unsafe extern "C" fn resolver(resolve_data: *mut c_void, upper_data: *mut c_void } unsafe extern "C" fn rejecter(reject_data: *mut c_void, upper_data: *mut c_void) -> *mut c_void { let (_, reject, data) = *Box::from_raw(upper_data as *mut MetaCallFutureFFIData); - let user_data = Box::from_raw(data); + + let user_data = if !data.is_null() { + Some(Box::from_raw(data)) + } else { + None + }; let result = (reject.unwrap())( cast::raw_to_metacallobj_untyped_leak(reject_data), @@ -273,28 +284,6 @@ impl MetaCallFuture { None }, if reject_is_some { Some(rejecter) } else { None }, - // TODO: Solve the memory leak that happens here - // For reproducing the error, use the following commands: - // cargo test --no-run - // valgrind --trace-children=yes --leak-check=full --tool=memcheck --suppressions=../../../source/tests/memcheck/valgrind-node.supp ./target/debug/deps/metacall_test-248af33824f71bd1 &> output - // ==20664== 60 (32 direct, 28 indirect) bytes in 1 blocks are definitely lost in loss record 11 of 35 - // ==20664== at 0x4842839: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) - // ==20664== by 0x17B549: alloc (alloc.rs:93) - // ==20664== by 0x17B549: alloc::alloc::Global::alloc_impl (alloc.rs:175) - // ==20664== by 0x17B342: allocate (alloc.rs:235) - // ==20664== by 0x17B342: alloc::alloc::exchange_malloc (alloc.rs:324) - // ==20664== by 0x1873D0: new<(core::option::Option<fn(alloc::boxed::Box<dyn metacall::types::metacall_value::MetaCallValue, alloc::alloc::Global>, alloc::boxed::Box<dyn metacall::types::metacall_value::MetaCallValue, alloc::alloc::Global>)>, core::option::Option<fn(alloc::boxed::Box<dyn metacall::types::metacall_value::MetaCallValue, alloc::alloc::Global>, alloc::boxed::Box<dyn metacall::types::metacall_value::MetaCallValue, alloc::alloc::Global>)>, *mut dyn metacall::types::metacall_value::MetaCallValue)> (boxed.rs:217) - // ==20664== by 0x1873D0: metacall::types::metacall_future::MetaCallFuture::await_fut (metacall_future.rs:182) - // ==20664== by 0x1296E6: metacall_test::test_future::{{closure}} (metacall_test.rs:202) - // ==20664== by 0x1286A2: metacall_test::generate_test_custom_validation (metacall_test.rs:42) - // ==20664== by 0x12625A: metacall_test::test_future (metacall_test.rs:193) - // ==20664== by 0x126954: metacall_test::metacall (metacall_test.rs:368) - // ==20664== by 0x129736: metacall_test::metacall::{{closure}} (metacall_test.rs:337) - // ==20664== by 0x1256B4: core::ops::function::FnOnce::call_once (function.rs:250) - // ==20664== by 0x166EBE: call_once<fn() -> core::result::Result<(), alloc::string::String>, ()> (function.rs:250) - // ==20664== by 0x166EBE: test::__rust_begin_short_backtrace (lib.rs:655) - // ==20664== by 0x13456B: {closure#1} (lib.rs:646) - // ==20664== by 0x13456B: core::ops::function::FnOnce::call_once{{vtable-shim}} (function.rs:250) Box::into_raw(Box::new((self.resolve, self.reject, self.data))) as *mut c_void, )) }; diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index 7b842da59..fc9ffe6ca 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -172,16 +172,21 @@ fn test_pointer() { ); } fn test_future() { - fn validate(upper_result: Box<dyn MetaCallValue>, upper_data: Box<dyn Any>) { - match upper_data.downcast::<String>() { - Ok(ret) => { - if ret.as_str() != "data" { - invalid_return_value("data", ret) + fn validate(upper_result: Box<dyn MetaCallValue>, upper_data: Option<Box<dyn Any>>) { + match upper_data { + Some(data) => { + match data.downcast::<String>() { + Ok(ret) => { + if ret.as_str() != "data" { + invalid_return_value("data", ret) + } + } + Err(original) => { + invalid_return_type("'string' for the data", original); + } } - } - Err(original) => { - invalid_return_type("'string' for the data", original); - } + }, + None => println!("user_data is None."), } match upper_result.downcast::<String>() { @@ -203,7 +208,7 @@ fn test_future() { move |future| { fn resolve( result: Box<dyn MetaCallValue>, - data: Box<dyn Any>, + data: Option<Box<dyn Any>>, ) -> Box<dyn MetaCallValue> { validate(result.clone(), data); result.clone() @@ -219,7 +224,7 @@ fn test_future() { move |future| { fn reject( result: Box<dyn MetaCallValue>, - data: Box<dyn Any>, + data: Option<Box<dyn Any>>, ) -> Box<dyn MetaCallValue> { validate(result.clone(), data); result.clone() From 8ebedff5e6536e9dca5c1dbeab71d5f147977daa Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 29 Oct 2025 19:12:41 +0100 Subject: [PATCH 477/487] Solve issues with upload in rs port. --- source/ports/rs_port/upload.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/ports/rs_port/upload.sh b/source/ports/rs_port/upload.sh index 4156acb04..a072d2c65 100644 --- a/source/ports/rs_port/upload.sh +++ b/source/ports/rs_port/upload.sh @@ -21,7 +21,7 @@ function publish() { local crate_version=`cargo search --quiet $1 | grep "$1" | head -n 1 | awk '{ print $3 }'` - local project_version=`cargo metadata --format-version=1 --no-deps | jq '.packages[0].version'` + local project_version=`cargo metadata --format-version=1 --no-deps | jq ".packages[] | select(.name == \"$1\") | .version"` # Check if versions do not match, and if so, publish them if [ ! "${crate_version}" = "${project_version}" ]; then @@ -30,10 +30,15 @@ function publish() { fi } -# Publish -cd sys +# Publish sys crate +pushd sys publish metacall-sys -cd inline +popd + +# Publish inline crate +pushd inline publish metacall-inline -cd .. +popd + +# Publish metacall crate publish metacall From 4afb879397242e1420304c4de7b4ba0cf979b8ed Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Wed, 29 Oct 2025 19:21:34 +0100 Subject: [PATCH 478/487] Update versions rs port. --- source/ports/rs_port/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index c238068d3..c4ac8eaf6 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -17,10 +17,10 @@ name = "metacall" path = "src/lib.rs" [dependencies] -metacall-inline = { path = "./inline" } +metacall-inline = { version = "0.2.0", path = "./inline" } [build-dependencies] -metacall-sys = { path = "./sys" } +metacall-sys = { version = "0.1.2", path = "./sys" } [workspace] members = [ From b01d0e3e74b46c69114aa3d9988d224f0888d856 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 12:25:59 +0100 Subject: [PATCH 479/487] Add base for handle in rs_port. --- source/ports/rs_port/inline/src/lib.rs | 2 +- source/ports/rs_port/src/lib.rs | 2 +- source/ports/rs_port/src/load.rs | 74 +++++++++++++++++-- source/ports/rs_port/src/metacall.rs | 59 ++++++++++++++- source/ports/rs_port/tests/inlines_test.rs | 12 +-- .../rs_port/tests/invalid_loaders_test.rs | 8 +- source/ports/rs_port/tests/loaders_test.rs | 8 +- .../rs_port/tests/metacall_exception_test.rs | 4 +- .../rs_port/tests/metacall_handle_test.rs | 36 +++++++++ source/ports/rs_port/tests/metacall_test.rs | 22 +++--- 10 files changed, 192 insertions(+), 35 deletions(-) create mode 100644 source/ports/rs_port/tests/metacall_handle_test.rs diff --git a/source/ports/rs_port/inline/src/lib.rs b/source/ports/rs_port/inline/src/lib.rs index 1b0083a16..094386890 100644 --- a/source/ports/rs_port/inline/src/lib.rs +++ b/source/ports/rs_port/inline/src/lib.rs @@ -10,7 +10,7 @@ macro_rules! gen_inline_macro { let buffer = token_stream_input.to_string(); let result = quote! {{ - ::metacall::load::from_memory(::metacall::load::Tag::$tag, #buffer.to_string()).unwrap() + ::metacall::load::from_memory(::metacall::load::Tag::$tag, #buffer.to_string(), None).unwrap() }}; result.into() diff --git a/source/ports/rs_port/src/lib.rs b/source/ports/rs_port/src/lib.rs index 2aada3f72..678ba3fbf 100644 --- a/source/ports/rs_port/src/lib.rs +++ b/source/ports/rs_port/src/lib.rs @@ -73,7 +73,7 @@ pub(crate) use macros::private_macros::*; /// /// // Loading a string with Nodejs. /// let script = "function greet() { return 'hi there!' }; module.exports = { greet };"; -/// metacall::load::from_memory(metacall::load::Tag::NodeJS, script).unwrap(); +/// metacall::load::from_memory(metacall::load::Tag::NodeJS, script, None).unwrap(); /// ``` pub mod load; diff --git a/source/ports/rs_port/src/load.rs b/source/ports/rs_port/src/load.rs index 2eac2898a..78b27cd99 100644 --- a/source/ports/rs_port/src/load.rs +++ b/source/ports/rs_port/src/load.rs @@ -1,13 +1,14 @@ use crate::{ - bindings::{metacall_load_from_file, metacall_load_from_memory}, + bindings::{metacall_clear, metacall_load_from_file, metacall_load_from_memory}, cstring_enum, types::MetaCallLoaderError, }; use std::{ ffi::CString, fmt, + os::raw::c_void, path::{Path, PathBuf}, - ptr, + ptr::null_mut, }; pub enum Tag { @@ -66,6 +67,39 @@ impl fmt::Display for Tag { } } +pub struct Handle(*mut c_void); + +impl Handle { + pub fn new() -> Self { + Self(null_mut()) + } + + pub fn from_mut_raw_ptr(&mut self, ptr: *mut c_void) { + self.0 = ptr + } + + pub fn as_mut_raw_ptr(&mut self) -> *mut c_void { + self.0 + } +} + +impl Default for Handle { + fn default() -> Self { + Self::new() + } +} + +impl Drop for Handle { + fn drop(&mut self) { + let result = unsafe { metacall_clear(self.0) }; + + if result != 0 { + // Log or handle the error as needed + eprintln!("Error during cleanup, metacall_clear returned: {}", result); + } + } +} + /// Loads a file from a single file. Usage example: ... /// ``` /// // A Nodejs path @@ -74,8 +108,9 @@ impl fmt::Display for Tag { pub fn from_single_file( tag: Tag, path: impl AsRef<Path>, + handle: Option<&mut Handle>, ) -> Result<(), MetaCallLoaderError> { - from_file(tag, [path]) + from_file(tag, [path], handle) } /// Loads a path from file. Usage example: ... @@ -86,6 +121,7 @@ pub fn from_single_file( pub fn from_file( tag: Tag, paths: impl IntoIterator<Item = impl AsRef<Path>>, + handle: Option<&mut Handle>, ) -> Result<(), MetaCallLoaderError> { let c_tag = cstring_enum!(tag, MetaCallLoaderError)?; let mut c_path: CString; @@ -109,18 +145,29 @@ pub fn from_file( new_paths.push(c_path.as_ptr()); } + let mut handle_ptr: *mut c_void = null_mut(); + + let handle_ref = match handle { + Some(_) => &mut handle_ptr, + None => null_mut(), + }; + if unsafe { metacall_load_from_file( c_tag.as_ptr(), new_paths.as_mut_ptr(), new_paths.len(), - ptr::null_mut(), + handle_ref, ) } != 0 { return Err(MetaCallLoaderError::FromFileFailure); } + if let Some(handle_ref) = handle { + handle_ref.from_mut_raw_ptr(handle_ptr); + } + Ok(()) } @@ -131,22 +178,37 @@ pub fn from_file( /// // A Nodejs script /// metacall::load::from_memory(Tag::NodeJS, script).unwrap(); /// ``` -pub fn from_memory(tag: Tag, script: impl ToString) -> Result<(), MetaCallLoaderError> { +pub fn from_memory( + tag: Tag, + script: impl ToString, + handle: Option<&mut Handle>, +) -> Result<(), MetaCallLoaderError> { let script = script.to_string(); let c_tag = cstring_enum!(tag, MetaCallLoaderError)?; let c_script = cstring_enum!(script, MetaCallLoaderError)?; + let mut handle_ptr: *mut c_void = null_mut(); + + let handle_ref = match handle { + Some(_) => &mut handle_ptr, + None => null_mut(), + }; + if unsafe { metacall_load_from_memory( c_tag.as_ptr(), c_script.as_ptr(), script.len() + 1, - ptr::null_mut(), + handle_ref, ) } != 0 { return Err(MetaCallLoaderError::FromMemoryFailure); } + if let Some(handle_ref) = handle { + handle_ref.from_mut_raw_ptr(handle_ptr); + } + Ok(()) } diff --git a/source/ports/rs_port/src/metacall.rs b/source/ports/rs_port/src/metacall.rs index f6e75c307..7fe38a8bc 100644 --- a/source/ports/rs_port/src/metacall.rs +++ b/source/ports/rs_port/src/metacall.rs @@ -1,6 +1,7 @@ use crate::{ - bindings::{metacall_function, metacall_value_destroy, metacallfv_s}, + bindings::{metacall_function, metacall_value_destroy, metacallfv_s, metacallhv_s}, cast, cstring_enum, + load::Handle, types::{MetaCallError, MetaCallNull, MetaCallValue}, }; use std::ffi::c_void; @@ -31,6 +32,33 @@ fn metacall_inner( Ok(ret) } + +fn metacall_inner_handle( + handle: &mut Handle, + func: impl ToString, + args: impl IntoIterator<Item = impl MetaCallValue>, +) -> Result<*mut c_void, MetaCallError> { + let c_function = cstring_enum!(func, MetaCallError)?; + + let mut c_args = cast::metacallobj_to_raw_args(args); + let args_length = c_args.len(); + + let ret = unsafe { + metacallhv_s( + handle.as_mut_raw_ptr(), + c_function.as_ptr(), + c_args.as_mut_ptr(), + args_length, + ) + }; + + for c_arg in c_args { + unsafe { metacall_value_destroy(c_arg) }; + } + + Ok(ret) +} + /// Calls a function same as [metacall](metacall) but returns a trait object /// of [MetaCallValue](MetaCallValue). This is useful when you don't know the return /// type of that function or the function may return multiple types. Checkout @@ -70,6 +98,24 @@ pub fn metacall<T: MetaCallValue>( Err(original) => Err(MetaCallError::FailedCasting(original)), } } + +/// Calls a function with arguments. The generic parameter is the return type of the function +/// you're calling. Checkout [MetaCallValue](MetaCallValue) for possible types. +/// For example: ... +/// ``` +/// let sum = metacall::metacall_handle::<i32>(handle, "sum", [1, 2]).unwrap(); +/// ``` +pub fn metacall_handle<T: MetaCallValue>( + handle: &mut Handle, + func: impl ToString, + args: impl IntoIterator<Item = impl MetaCallValue>, +) -> Result<T, MetaCallError> { + match cast::raw_to_metacallobj::<T>(metacall_inner_handle(handle, func, args)?) { + Ok(ret) => Ok(ret), + Err(original) => Err(MetaCallError::FailedCasting(original)), + } +} + /// Calls a function same as [metacall](metacall) without passing any arguments. For example: ... /// ``` /// let greet = metacall::metacall_no_arg::<String>("greet").unwrap(); @@ -77,3 +123,14 @@ pub fn metacall<T: MetaCallValue>( pub fn metacall_no_arg<T: MetaCallValue>(func: impl ToString) -> Result<T, MetaCallError> { metacall::<T>(func, [] as [MetaCallNull; 0]) } + +/// Calls a function same as [metacall](metacall) without passing any arguments. For example: ... +/// ``` +/// let greet = metacall::metacall_no_arg::<String>("greet").unwrap(); +/// ``` +pub fn metacall_handle_no_arg<T: MetaCallValue>( + handle: &mut Handle, + func: impl ToString, +) -> Result<T, MetaCallError> { + metacall_handle::<T>(handle, func, [] as [MetaCallNull; 0]) +} diff --git a/source/ports/rs_port/tests/inlines_test.rs b/source/ports/rs_port/tests/inlines_test.rs index adf06ee43..27861f2fb 100644 --- a/source/ports/rs_port/tests/inlines_test.rs +++ b/source/ports/rs_port/tests/inlines_test.rs @@ -11,30 +11,30 @@ fn inlines() { assert!(is_initialized()); - if load::from_memory(Tag::Python, "").is_ok() { + if load::from_memory(Tag::Python, "", None).is_ok() { py! { print("hello world") } } - if load::from_memory(Tag::Python, "").is_ok() { + if load::from_memory(Tag::Python, "", None).is_ok() { py! {print("hello world")} } - if load::from_memory(Tag::NodeJS, "").is_ok() { + if load::from_memory(Tag::NodeJS, "", None).is_ok() { node! { console.log("hello world"); } } - if load::from_memory(Tag::NodeJS, "").is_ok() { + if load::from_memory(Tag::NodeJS, "", None).is_ok() { node! {console.log("hello world")} } - if load::from_memory(Tag::TypeScript, "").is_ok() { + if load::from_memory(Tag::TypeScript, "", None).is_ok() { ts! { console.log("hello world"); } } - if load::from_memory(Tag::TypeScript, "").is_ok() { + if load::from_memory(Tag::TypeScript, "", None).is_ok() { ts! {console.log("hello world")} } } diff --git a/source/ports/rs_port/tests/invalid_loaders_test.rs b/source/ports/rs_port/tests/invalid_loaders_test.rs index a803c4cb4..bd59e89a9 100644 --- a/source/ports/rs_port/tests/invalid_loaders_test.rs +++ b/source/ports/rs_port/tests/invalid_loaders_test.rs @@ -16,7 +16,7 @@ fn invalid_loaders() { let valid_file = scripts_dir.join("script.js"); if let Err(MetaCallLoaderError::FileNotFound(_)) = - load::from_single_file(load::Tag::NodeJS, inavlid_file) + load::from_single_file(load::Tag::NodeJS, inavlid_file, None) { // Everything Ok } else { @@ -24,14 +24,16 @@ fn invalid_loaders() { } // We use JSM here because it is not implemented, it should fail - if let Err(MetaCallLoaderError::FromFileFailure) = load::from_single_file(Tag::JSM, valid_file) { + if let Err(MetaCallLoaderError::FromFileFailure) = + load::from_single_file(Tag::JSM, valid_file, None) + { // Everything Ok } else { panic!("Expected the loader fail with `FromFileFailure` error variant!"); } if let Err(MetaCallLoaderError::FromMemoryFailure) = - load::from_memory(load::Tag::NodeJS, "Invalid code!") + load::from_memory(load::Tag::NodeJS, "Invalid code!", None) { // Everything Ok } else { diff --git a/source/ports/rs_port/tests/loaders_test.rs b/source/ports/rs_port/tests/loaders_test.rs index 00fab0751..abb274521 100644 --- a/source/ports/rs_port/tests/loaders_test.rs +++ b/source/ports/rs_port/tests/loaders_test.rs @@ -15,16 +15,18 @@ use std::{ const SCRIPT1: &str = "function greet1() { return 'hi there!' } \nmodule.exports = { greet1 }"; const SCRIPT2: &str = "function greet2() { return 'hi there!' } \nmodule.exports = { greet2 };"; const SCRIPT3: &str = "console.log('Hello world')"; + fn call_greet(test: &str, num: u32) { let out = metacall_no_arg::<String>(format!("greet{}", num)).unwrap(); assert_eq!(out.as_str(), "hi there!", "Testing {}", test); } fn load_from_memory_test() { - load::from_memory(Tag::NodeJS, SCRIPT1).unwrap(); + load::from_memory(Tag::NodeJS, SCRIPT1, None).unwrap(); + call_greet("load_from_memory", 1); - load::from_memory(Tag::NodeJS, SCRIPT3).unwrap(); + load::from_memory(Tag::NodeJS, SCRIPT3, None).unwrap(); } fn load_from_file_test() { @@ -38,7 +40,7 @@ fn load_from_file_test() { temp_js.write_all(SCRIPT2.as_bytes()).unwrap(); temp_js.flush().unwrap(); - load::from_single_file(Tag::NodeJS, temp_js_path).unwrap(); + load::from_single_file(Tag::NodeJS, temp_js_path, None).unwrap(); call_greet("load_from_file", 2); diff --git a/source/ports/rs_port/tests/metacall_exception_test.rs b/source/ports/rs_port/tests/metacall_exception_test.rs index ef8b269a4..fe16caad7 100644 --- a/source/ports/rs_port/tests/metacall_exception_test.rs +++ b/source/ports/rs_port/tests/metacall_exception_test.rs @@ -5,7 +5,7 @@ use metacall::{ use std::env; #[test] -fn inlines() { +fn metacall_exception() { let _d = initialize().unwrap(); assert!(is_initialized()); @@ -13,7 +13,7 @@ fn inlines() { let tests_dir = env::current_dir().unwrap().join("tests/scripts"); let js_test_file = tests_dir.join("script.js"); - if load::from_single_file(Tag::NodeJS, js_test_file).is_ok() { + if load::from_single_file(Tag::NodeJS, js_test_file, None).is_ok() { // This should not generate a segmentation fault let val = metacall::metacall_no_arg::<metacall::MetaCallException>("test_exception").unwrap(); diff --git a/source/ports/rs_port/tests/metacall_handle_test.rs b/source/ports/rs_port/tests/metacall_handle_test.rs new file mode 100644 index 000000000..01bb2e07e --- /dev/null +++ b/source/ports/rs_port/tests/metacall_handle_test.rs @@ -0,0 +1,36 @@ +use metacall::{ + initialize, is_initialized, + load::{self, Handle, Tag}, + metacall_handle_no_arg, +}; + +#[test] +fn metacall_handle() { + let _d = initialize().unwrap(); + + assert!(is_initialized()); + + const SCRIPT1: &str = "function greet() { return 1 } \nmodule.exports = { greet }"; + const SCRIPT2: &str = "function greet() { return 2 } \nmodule.exports = { greet }"; + + let mut handle1 = Handle::new(); + let mut handle2 = Handle::new(); + + let result1 = load::from_memory(Tag::NodeJS, SCRIPT1, Some(&mut handle1)); + let result2 = load::from_memory(Tag::NodeJS, SCRIPT2, Some(&mut handle2)); + + assert!(result1.is_ok()); + assert!(result2.is_ok()); + + // Load first handle + if result1.is_ok() { + let out = metacall_handle_no_arg::<f64>(&mut handle1, "greet").unwrap(); + assert_eq!(out, 1.0, "Testing greet 1"); + } + + // Load second handle + if result2.is_ok() { + let out = metacall_handle_no_arg::<f64>(&mut handle2, "greet").unwrap(); + assert_eq!(out, 2.0, "Testing greet 2"); + } +} diff --git a/source/ports/rs_port/tests/metacall_test.rs b/source/ports/rs_port/tests/metacall_test.rs index fc9ffe6ca..81d73511a 100644 --- a/source/ports/rs_port/tests/metacall_test.rs +++ b/source/ports/rs_port/tests/metacall_test.rs @@ -174,17 +174,15 @@ fn test_pointer() { fn test_future() { fn validate(upper_result: Box<dyn MetaCallValue>, upper_data: Option<Box<dyn Any>>) { match upper_data { - Some(data) => { - match data.downcast::<String>() { - Ok(ret) => { - if ret.as_str() != "data" { - invalid_return_value("data", ret) - } - } - Err(original) => { - invalid_return_type("'string' for the data", original); + Some(data) => match data.downcast::<String>() { + Ok(ret) => { + if ret.as_str() != "data" { + invalid_return_value("data", ret) } } + Err(original) => { + invalid_return_type("'string' for the data", original); + } }, None => println!("user_data is None."), } @@ -374,7 +372,7 @@ fn metacall() { let js_test_file = tests_dir.join("script.js"); let c_test_file = tests_dir.join("script.c"); let py_test_file = tests_dir.join("script.py"); - let py_loaded = load::from_single_file(Tag::Python, py_test_file).is_ok(); + let py_loaded = load::from_single_file(Tag::Python, py_test_file, None).is_ok(); if py_loaded { test_buffer(); @@ -387,7 +385,7 @@ fn metacall() { test_string(); test_null(); } - if load::from_single_file(load::Tag::C, c_test_file).is_ok() { + if load::from_single_file(load::Tag::C, c_test_file, None).is_ok() { test_char(); test_double(); test_float(); @@ -396,7 +394,7 @@ fn metacall() { test_short(); test_mixed_numbers(); } - if load::from_single_file(load::Tag::NodeJS, js_test_file).is_ok() { + if load::from_single_file(load::Tag::NodeJS, js_test_file, None).is_ok() { test_exception(); test_throwable(); test_future(); From f3cb69ea48a90b1c5503b39a268a1938d04944ef Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 12:46:21 +0100 Subject: [PATCH 480/487] Improved rs port handle api. --- source/ports/rs_port/.vscode/launch.json | 22 ++++++++++++++++++- source/ports/rs_port/Cargo.toml | 2 +- source/ports/rs_port/src/load.rs | 20 ++--------------- .../rs_port/tests/metacall_handle_test.rs | 20 +++++++++++++++++ 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/source/ports/rs_port/.vscode/launch.json b/source/ports/rs_port/.vscode/launch.json index 684cfc347..838674c31 100644 --- a/source/ports/rs_port/.vscode/launch.json +++ b/source/ports/rs_port/.vscode/launch.json @@ -103,6 +103,26 @@ "args": [], "envFile": "${workspaceFolder}${/}.vscode${/}.env", "cwd": "${workspaceFolder}" - } + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug integration test 'metacall_handle_test'", + "cargo": { + "args": [ + "test", + "--no-run", + "--test=metacall_handle_test", + "--package=metacall" + ], + "filter": { + "name": "metacall_handle_test", + "kind": "test" + } + }, + "args": [], + "envFile": "${workspaceFolder}${/}.vscode${/}.env", + "cwd": "${workspaceFolder}" + }, ] } \ No newline at end of file diff --git a/source/ports/rs_port/Cargo.toml b/source/ports/rs_port/Cargo.toml index c4ac8eaf6..51428b033 100644 --- a/source/ports/rs_port/Cargo.toml +++ b/source/ports/rs_port/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "metacall" readme = "README.md" repository = "https://github.com/metacall/core/tree/develop/source/ports/rs_port" -version = "0.5.3" +version = "0.5.4" [lib] crate-type = ["lib"] diff --git a/source/ports/rs_port/src/load.rs b/source/ports/rs_port/src/load.rs index 78b27cd99..290c7071d 100644 --- a/source/ports/rs_port/src/load.rs +++ b/source/ports/rs_port/src/load.rs @@ -74,10 +74,6 @@ impl Handle { Self(null_mut()) } - pub fn from_mut_raw_ptr(&mut self, ptr: *mut c_void) { - self.0 = ptr - } - pub fn as_mut_raw_ptr(&mut self) -> *mut c_void { self.0 } @@ -145,10 +141,8 @@ pub fn from_file( new_paths.push(c_path.as_ptr()); } - let mut handle_ptr: *mut c_void = null_mut(); - let handle_ref = match handle { - Some(_) => &mut handle_ptr, + Some(handle_ptr) => &mut handle_ptr.0, None => null_mut(), }; @@ -164,10 +158,6 @@ pub fn from_file( return Err(MetaCallLoaderError::FromFileFailure); } - if let Some(handle_ref) = handle { - handle_ref.from_mut_raw_ptr(handle_ptr); - } - Ok(()) } @@ -187,10 +177,8 @@ pub fn from_memory( let c_tag = cstring_enum!(tag, MetaCallLoaderError)?; let c_script = cstring_enum!(script, MetaCallLoaderError)?; - let mut handle_ptr: *mut c_void = null_mut(); - let handle_ref = match handle { - Some(_) => &mut handle_ptr, + Some(handle_ptr) => &mut handle_ptr.0, None => null_mut(), }; @@ -206,9 +194,5 @@ pub fn from_memory( return Err(MetaCallLoaderError::FromMemoryFailure); } - if let Some(handle_ref) = handle { - handle_ref.from_mut_raw_ptr(handle_ptr); - } - Ok(()) } diff --git a/source/ports/rs_port/tests/metacall_handle_test.rs b/source/ports/rs_port/tests/metacall_handle_test.rs index 01bb2e07e..207d0c24e 100644 --- a/source/ports/rs_port/tests/metacall_handle_test.rs +++ b/source/ports/rs_port/tests/metacall_handle_test.rs @@ -33,4 +33,24 @@ fn metacall_handle() { let out = metacall_handle_no_arg::<f64>(&mut handle2, "greet").unwrap(); assert_eq!(out, 2.0, "Testing greet 2"); } + + // Now, testing loading again into an existing handle number 2 + // This should make the handle have greet (2) and yeet functions together + + // TODO: This has a bug in the core that must be reviewed + /* + const SCRIPT3: &str = "function yeet() { return 3 } \nmodule.exports = { yeet }"; + + let result3 = load::from_memory(Tag::NodeJS, SCRIPT3, Some(&mut handle2)); + + assert!(result3.is_ok()); + + if result3.is_ok() { + let out = metacall_handle_no_arg::<f64>(&mut handle2, "greet").unwrap(); + assert_eq!(out, 2.0, "Testing greet 2"); + + let out = metacall_handle_no_arg::<f64>(&mut handle2, "yeet").unwrap(); + assert_eq!(out, 3.0, "Testing yeet 2"); + } + */ } From 786580ec461b19bebc62b872033235a66fa5b122 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 14:42:49 +0100 Subject: [PATCH 481/487] Solve issue with metacall clear. --- source/loader/source/loader_impl.c | 111 ++++++++---- .../loaders/py_loader/source/py_loader_impl.c | 2 +- .../cxx_port/include/metacall/metacall.inl | 1 - .../metacall_c_metacall_test/CMakeLists.txt | 160 ++++++++++++++++++ .../metacall_c_metacall_test/source/main.cpp | 28 +++ .../source/metacall_c_metacall_test.cpp | 70 ++++++++ .../tests/metacall_clear_test/CMakeLists.txt | 3 +- .../source/metacall_clear_test.cpp | 46 +++++ 8 files changed, 385 insertions(+), 36 deletions(-) create mode 100644 source/tests/metacall_c_metacall_test/CMakeLists.txt create mode 100644 source/tests/metacall_c_metacall_test/source/main.cpp create mode 100644 source/tests/metacall_c_metacall_test/source/metacall_c_metacall_test.cpp diff --git a/source/loader/source/loader_impl.c b/source/loader/source/loader_impl.c index 260a787af..ac35595f5 100644 --- a/source/loader/source/loader_impl.c +++ b/source/loader/source/loader_impl.c @@ -1150,7 +1150,8 @@ int loader_impl_load_from_file(plugin_manager manager, plugin p, loader_impl imp { loader_handle handle; loader_path path; - size_t init_order; + size_t init_order = 0; + int init_order_not_initialized = !(handle_ptr != NULL && *handle_ptr != NULL); if (loader_impl_initialize(manager, p, impl) != 0) { @@ -1164,9 +1165,12 @@ int loader_impl_load_from_file(plugin_manager manager, plugin p, loader_impl imp return 1; } - init_order = vector_size(impl->handle_impl_init_order); + if (init_order_not_initialized) + { + init_order = vector_size(impl->handle_impl_init_order); - vector_push_back_empty(impl->handle_impl_init_order); + vector_push_back_empty(impl->handle_impl_init_order); + } handle = iface->load_from_file(impl, paths, size); @@ -1192,7 +1196,10 @@ int loader_impl_load_from_file(plugin_manager manager, plugin p, loader_impl imp { if (loader_impl_handle_register(manager, impl, path, handle_impl, handle_ptr) == 0) { - vector_set_var(impl->handle_impl_init_order, init_order, handle_impl); + if (init_order_not_initialized) + { + vector_set_var(impl->handle_impl_init_order, init_order, handle_impl); + } return 0; } @@ -1204,7 +1211,10 @@ int loader_impl_load_from_file(plugin_manager manager, plugin p, loader_impl imp set_remove(impl->handle_impl_path_map, handle_impl->path); } + if (init_order_not_initialized) { + /* Here we delete all the subsequent loaded scripts because this script can load others, + and once it is destroyed it must clear all of them */ size_t iterator; for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) @@ -1224,16 +1234,21 @@ int loader_impl_load_from_file(plugin_manager manager, plugin p, loader_impl imp } else { - size_t iterator; - - for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) + if (init_order_not_initialized) { - loader_handle_impl iterator_handle_impl = vector_at_type(impl->handle_impl_init_order, iterator, loader_handle_impl); + /* Here we delete all the subsequent loaded scripts because this script can load others, + and once it is destroyed it must clear all of them */ + size_t iterator; - loader_impl_destroy_handle(iterator_handle_impl); - } + for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) + { + loader_handle_impl iterator_handle_impl = vector_at_type(impl->handle_impl_init_order, iterator, loader_handle_impl); + + loader_impl_destroy_handle(iterator_handle_impl); + } - vector_pop_back(impl->handle_impl_init_order); + vector_pop_back(impl->handle_impl_init_order); + } } } } @@ -1276,7 +1291,8 @@ int loader_impl_load_from_memory(plugin_manager manager, plugin p, loader_impl i { loader_name name; loader_handle handle = NULL; - size_t init_order; + size_t init_order = 0; + int init_order_not_initialized = !(handle_ptr != NULL && *handle_ptr != NULL); if (loader_impl_initialize(manager, p, impl) != 0) { @@ -1297,9 +1313,12 @@ int loader_impl_load_from_memory(plugin_manager manager, plugin p, loader_impl i return 1; } - init_order = vector_size(impl->handle_impl_init_order); + if (init_order_not_initialized) + { + init_order = vector_size(impl->handle_impl_init_order); - vector_push_back_empty(impl->handle_impl_init_order); + vector_push_back_empty(impl->handle_impl_init_order); + } handle = iface->load_from_memory(impl, name, buffer, size); @@ -1322,7 +1341,10 @@ int loader_impl_load_from_memory(plugin_manager manager, plugin p, loader_impl i { if (loader_impl_handle_register(manager, impl, name, handle_impl, handle_ptr) == 0) { - vector_set_var(impl->handle_impl_init_order, init_order, handle_impl); + if (init_order_not_initialized) + { + vector_set_var(impl->handle_impl_init_order, init_order, handle_impl); + } return 0; } @@ -1334,7 +1356,10 @@ int loader_impl_load_from_memory(plugin_manager manager, plugin p, loader_impl i set_remove(impl->handle_impl_path_map, handle_impl->path); } + if (init_order_not_initialized) { + /* Here we delete all the subsequent loaded scripts because this script can load others, + and once it is destroyed it must clear all of them */ size_t iterator; for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) @@ -1354,16 +1379,21 @@ int loader_impl_load_from_memory(plugin_manager manager, plugin p, loader_impl i } else { - size_t iterator; - - for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) + if (init_order_not_initialized) { - loader_handle_impl iterator_handle_impl = vector_at_type(impl->handle_impl_init_order, iterator, loader_handle_impl); + /* Here we delete all the subsequent loaded scripts because this script can load others, + and once it is destroyed it must clear all of them */ + size_t iterator; - loader_impl_destroy_handle(iterator_handle_impl); - } + for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) + { + loader_handle_impl iterator_handle_impl = vector_at_type(impl->handle_impl_init_order, iterator, loader_handle_impl); + + loader_impl_destroy_handle(iterator_handle_impl); + } - vector_pop_back(impl->handle_impl_init_order); + vector_pop_back(impl->handle_impl_init_order); + } } } } @@ -1377,7 +1407,8 @@ int loader_impl_load_from_package(plugin_manager manager, plugin p, loader_impl { loader_impl_interface iface = loader_iface(p); loader_path subpath; - size_t init_order; + size_t init_order = 0; + int init_order_not_initialized = !(handle_ptr != NULL && *handle_ptr != NULL); if (iface != NULL && loader_impl_handle_name(manager, path, subpath) > 1) { @@ -1395,9 +1426,12 @@ int loader_impl_load_from_package(plugin_manager manager, plugin p, loader_impl return 1; } - init_order = vector_size(impl->handle_impl_init_order); + if (init_order_not_initialized) + { + init_order = vector_size(impl->handle_impl_init_order); - vector_push_back_empty(impl->handle_impl_init_order); + vector_push_back_empty(impl->handle_impl_init_order); + } handle = iface->load_from_package(impl, path); @@ -1420,7 +1454,10 @@ int loader_impl_load_from_package(plugin_manager manager, plugin p, loader_impl { if (loader_impl_handle_register(manager, impl, subpath, handle_impl, handle_ptr) == 0) { - vector_set_var(impl->handle_impl_init_order, init_order, handle_impl); + if (init_order_not_initialized) + { + vector_set_var(impl->handle_impl_init_order, init_order, handle_impl); + } return 0; } @@ -1432,7 +1469,10 @@ int loader_impl_load_from_package(plugin_manager manager, plugin p, loader_impl set_remove(impl->handle_impl_path_map, handle_impl->path); } + if (init_order_not_initialized) { + /* Here we delete all the subsequent loaded scripts because this script can load others, + and once it is destroyed it must clear all of them */ size_t iterator; for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) @@ -1452,16 +1492,21 @@ int loader_impl_load_from_package(plugin_manager manager, plugin p, loader_impl } else { - size_t iterator; - - for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) + if (init_order_not_initialized) { - loader_handle_impl iterator_handle_impl = vector_at_type(impl->handle_impl_init_order, iterator, loader_handle_impl); + /* Here we delete all the subsequent loaded scripts because this script can load others, + and once it is destroyed it must clear all of them */ + size_t iterator; - loader_impl_destroy_handle(iterator_handle_impl); - } + for (iterator = init_order + 1; iterator < vector_size(impl->handle_impl_init_order); ++iterator) + { + loader_handle_impl iterator_handle_impl = vector_at_type(impl->handle_impl_init_order, iterator, loader_handle_impl); - vector_pop_back(impl->handle_impl_init_order); + loader_impl_destroy_handle(iterator_handle_impl); + } + + vector_pop_back(impl->handle_impl_init_order); + } } } } diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index d5a11d618..77fc87016 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -58,7 +58,7 @@ * and threading flow for improving the debug of memory leaks and async bugs. * Set it to 0 in order to remove all the noise. */ -#define DEBUG_PRINT_ENABLED 1 +#define DEBUG_PRINT_ENABLED 0 typedef struct loader_impl_py_function_type { diff --git a/source/ports/cxx_port/include/metacall/metacall.inl b/source/ports/cxx_port/include/metacall/metacall.inl index 81a48f839..9a36cec3a 100644 --- a/source/ports/cxx_port/include/metacall/metacall.inl +++ b/source/ports/cxx_port/include/metacall/metacall.inl @@ -25,7 +25,6 @@ namespace metacall { - } /* namespace metacall */ #endif /* METACALL_INL */ diff --git a/source/tests/metacall_c_metacall_test/CMakeLists.txt b/source/tests/metacall_c_metacall_test/CMakeLists.txt new file mode 100644 index 000000000..00d36ad94 --- /dev/null +++ b/source/tests/metacall_c_metacall_test/CMakeLists.txt @@ -0,0 +1,160 @@ +# Check if this loader is enabled +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_C OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_C) + return() +endif() + +# +# Executable name and options +# + +# Target name +set(target metacall-c-metacall-test) +message(STATUS "Test ${target}") + +# +# Compiler warnings +# + +include(Warnings) + +# +# Compiler security +# + +include(SecurityFlags) + +# +# Sources +# + +set(include_path "${CMAKE_CURRENT_SOURCE_DIR}/include/${target}") +set(source_path "${CMAKE_CURRENT_SOURCE_DIR}/source") + +set(sources + ${source_path}/main.cpp + ${source_path}/metacall_c_metacall_test.cpp +) + +# Group source files +set(header_group "Header Files (API)") +set(source_group "Source Files") +source_group_by_path(${include_path} "\\\\.h$|\\\\.hpp$" + ${header_group} ${headers}) +source_group_by_path(${source_path} "\\\\.cpp$|\\\\.c$|\\\\.h$|\\\\.hpp$" + ${source_group} ${sources}) + +# +# Create executable +# + +# Build executable +add_executable(${target} + ${sources} +) + +# Create namespaced alias +add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) + +# +# Project options +# + +set_target_properties(${target} + PROPERTIES + ${DEFAULT_PROJECT_OPTIONS} + FOLDER "${IDE_FOLDER}" +) + +# +# Include directories +# + +target_include_directories(${target} + PRIVATE + ${DEFAULT_INCLUDE_DIRECTORIES} + ${PROJECT_BINARY_DIR}/source/include +) + +# +# Libraries +# + +target_link_libraries(${target} + PRIVATE + ${DEFAULT_LIBRARIES} + + GTest + + ${META_PROJECT_NAME}::metacall +) + +# +# Compile definitions +# + +target_compile_definitions(${target} + PRIVATE + ${DEFAULT_COMPILE_DEFINITIONS} + + METACALL_INCLUDE_DIR="${CMAKE_SOURCE_DIR}/source/metacall/include" + METACALL_API_INCLUDE_DIR="${CMAKE_BINARY_DIR}/source/metacall/include" + METACALL_LIBRARY="${PROJECT_OUTPUT_DIR}" +) + +# +# Compile options +# + +target_compile_options(${target} + PRIVATE + ${DEFAULT_COMPILE_OPTIONS} +) + +# +# Compile features +# + +target_compile_features(${target} + PRIVATE + cxx_std_17 +) + +# +# Linker options +# + +target_link_options(${target} + PRIVATE + ${DEFAULT_LINKER_OPTIONS} +) + +# +# Define test +# + +add_test(NAME ${target} + COMMAND $<TARGET_FILE:${target}> +) + +# +# Define dependencies +# + +add_dependencies(${target} + c_loader +) + +# +# Define test properties +# + +set_property(TEST ${target} + PROPERTY LABELS ${target} +) + +include(TestEnvironmentVariables) + +test_environment_variables(${target} + "" + ${TESTS_ENVIRONMENT_VARIABLES} +) diff --git a/source/tests/metacall_c_metacall_test/source/main.cpp b/source/tests/metacall_c_metacall_test/source/main.cpp new file mode 100644 index 000000000..37d4adc23 --- /dev/null +++ b/source/tests/metacall_c_metacall_test/source/main.cpp @@ -0,0 +1,28 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading ruby code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +} diff --git a/source/tests/metacall_c_metacall_test/source/metacall_c_metacall_test.cpp b/source/tests/metacall_c_metacall_test/source/metacall_c_metacall_test.cpp new file mode 100644 index 000000000..f26e1471b --- /dev/null +++ b/source/tests/metacall_c_metacall_test/source/metacall_c_metacall_test.cpp @@ -0,0 +1,70 @@ +/* + * Loader Library by Parra Studios + * A plugin for loading ruby code at run-time into a process. + * + * Copyright (C) 2016 - 2025 Vicente Eduardo Ferrer Garcia <vic798@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <gtest/gtest.h> + +#include <metacall/metacall.h> + +class metacall_c_metacall_test : public testing::Test +{ +protected: +}; + +TEST_F(metacall_c_metacall_test, DefaultConstructor) +{ + ASSERT_EQ((int)0, (int)metacall_initialize()); + + ASSERT_EQ((int)0, metacall_execution_path("c", METACALL_INCLUDE_DIR)); + ASSERT_EQ((int)0, metacall_execution_path("c", METACALL_API_INCLUDE_DIR)); + ASSERT_EQ((int)0, metacall_execution_path("c", METACALL_LIBRARY)); + + ASSERT_EQ((int)0, (int)metacall_load_from_package("c", "metacall", NULL)); + + void *ret = metacall("metacall_print_info"); + + ASSERT_EQ((void *)NULL, (void *)ret); + + EXPECT_EQ((enum metacall_value_id)metacall_value_id(ret), (enum metacall_value_id)METACALL_STRING); + + EXPECT_EQ((int)0, strncmp(metacall_value_to_string(ret), "MetaCall", 8)); + + /* Print inspect information */ + { + size_t size = 0; + + struct metacall_allocator_std_type std_ctx = { &std::malloc, &std::realloc, &std::free }; + + void *allocator = metacall_allocator_create(METACALL_ALLOCATOR_STD, (void *)&std_ctx); + + char *inspect_str = metacall_inspect(&size, allocator); + + EXPECT_NE((char *)NULL, (char *)inspect_str); + + EXPECT_GT((size_t)size, (size_t)0); + + std::cout << inspect_str << std::endl; + + metacall_allocator_free(allocator, inspect_str); + + metacall_allocator_destroy(allocator); + } + + metacall_destroy(); +} diff --git a/source/tests/metacall_clear_test/CMakeLists.txt b/source/tests/metacall_clear_test/CMakeLists.txt index 859807d95..6698be908 100644 --- a/source/tests/metacall_clear_test/CMakeLists.txt +++ b/source/tests/metacall_clear_test/CMakeLists.txt @@ -1,5 +1,5 @@ # Check if this loader is enabled -if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY) +if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_NODE) return() endif() @@ -146,6 +146,7 @@ add_test(NAME ${target} add_dependencies(${target} py_loader + node_loader ) # diff --git a/source/tests/metacall_clear_test/source/metacall_clear_test.cpp b/source/tests/metacall_clear_test/source/metacall_clear_test.cpp index f6dbc7fcb..3eab66835 100644 --- a/source/tests/metacall_clear_test/source/metacall_clear_test.cpp +++ b/source/tests/metacall_clear_test/source/metacall_clear_test.cpp @@ -76,5 +76,51 @@ TEST_F(metacall_clear_test, DefaultConstructor) } #endif /* OPTION_BUILD_LOADERS_PY */ +/* NodeJS */ +#if defined(OPTION_BUILD_LOADERS_NODE) + { + static const char script1[] = "function greet() { return 1 }\nmodule.exports = { greet }"; + static const char script2[] = "function greet() { return 2 }\nmodule.exports = { greet }"; + static const char script3[] = "function yeet() { return 3 }\nmodule.exports = { yeet }"; + + void *handle1 = NULL; + void *handle2 = NULL; + + void *ret; + + ASSERT_EQ((int)0, (int)metacall_load_from_memory("node", script1, sizeof(script1), &handle1)); + + ret = metacallhv(handle1, "greet", metacall_null_args); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((double)1.0, (double)metacall_value_to_double(ret)); + + ASSERT_EQ((int)0, (int)metacall_load_from_memory("node", script2, sizeof(script2), &handle2)); + + ret = metacallhv(handle2, "greet", metacall_null_args); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((double)2.0, (double)metacall_value_to_double(ret)); + + metacall_value_destroy(ret); + + // Now load script number 3 into handle number 2 + ASSERT_EQ((int)0, (int)metacall_load_from_memory("node", script3, sizeof(script3), &handle2)); + + ret = metacallhv(handle2, "yeet", metacall_null_args); + + EXPECT_NE((void *)NULL, (void *)ret); + + EXPECT_EQ((double)3.0, (double)metacall_value_to_double(ret)); + + metacall_value_destroy(ret); + + EXPECT_EQ((int)0, (int)metacall_clear(handle1)); + EXPECT_EQ((int)0, (int)metacall_clear(handle2)); + } +#endif /* OPTION_BUILD_LOADERS_NODE */ + metacall_destroy(); } From f22fd15dde98a6c10492e1504d90c82fd0726fbb Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 15:16:42 +0100 Subject: [PATCH 482/487] Solve issues in metacall cxx port test. --- .../source/metacall_cxx_port_test.cpp | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp index 23998054e..3d55099ff 100644 --- a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp +++ b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp @@ -22,8 +22,6 @@ #include <metacall/metacall.hpp> -using namespace metacall; - class metacall_cxx_port_test : public testing::Test { protected: @@ -31,7 +29,7 @@ class metacall_cxx_port_test : public testing::Test void *cxx_map_test(size_t argc, void *args[], void *data) { - map<std::string, float> m(args[0]); + metacall::map<std::string, float> m(args[0]); (void)argc; (void)data; @@ -43,12 +41,12 @@ void *cxx_map_test(size_t argc, void *args[], void *data) printf("world => %f\n", m["world"]); fflush(stdout); - return metacall_value_create_null(); + return metacall::metacall_value_create_null(); } void *cxx_array_test(size_t argc, void *args[], void *data) { - array a(args[0]); + metacall::array a(args[0]); (void)argc; (void)data; @@ -63,12 +61,12 @@ void *cxx_array_test(size_t argc, void *args[], void *data) printf("a[1] => %f\n", a[1].as<float>()); fflush(stdout); - return metacall_value_create_null(); + return metacall::metacall_value_create_null(); } void *cxx_map_array_test(size_t argc, void *args[], void *data) { - map<std::string, array> m(args[0]); + metacall::map<std::string, metacall::array> m(args[0]); (void)argc; (void)data; @@ -85,14 +83,14 @@ void *cxx_map_array_test(size_t argc, void *args[], void *data) printf("m['libraries'][0] => %s\n", m["libraries"][0].as<std::string>().c_str()); printf("m['libraries'][1] => %s\n", m["libraries"][1].as<std::string>().c_str()); - return metacall_value_create_null(); + return metacall::metacall_value_create_null(); } // TODO: /* void *cxx_recursive_map_test(size_t argc, void *args[], void *data) { - map<std::string, map<std::string, float>> m(args[0]); + metacall::map<std::string, metacall::map<std::string, float>> m(args[0]); (void)argc; (void)data; @@ -108,8 +106,8 @@ void *cxx_recursive_map_test(size_t argc, void *args[], void *data) void *cxx_float_int_int_test(size_t argc, void *args[], void *data) { - value<int> a0(args[0]); - value<int> a1(args[1]); + metacall::value<int> a0(args[0]); + metacall::value<int> a1(args[1]); (void)argc; (void)data; @@ -117,39 +115,39 @@ void *cxx_float_int_int_test(size_t argc, void *args[], void *data) EXPECT_EQ(a0.to_value(), 7); EXPECT_EQ(a1.to_value(), 8); - return metacall_value_create_float(3.0f); + return metacall::metacall_value_create_float(3.0f); } TEST_F(metacall_cxx_port_test, DefaultConstructor) { - ASSERT_EQ((int)0, (int)metacall_initialize()); + ASSERT_EQ((int)0, (int)metacall::metacall_initialize()); { - map<std::string, float> m = { + metacall::map<std::string, float> m = { { "hello", 3.0f }, { "world", 4.0f } }; - metacall_register("cxx_map_test", cxx_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); + metacall::metacall_register("cxx_map_test", cxx_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_map_test", m)); } { - array a(3, 4.0f); + metacall::array a(3, 4.0f); - metacall_register("cxx_array_test", cxx_array_test, NULL, METACALL_NULL, 1, METACALL_ARRAY); + metacall::metacall_register("cxx_array_test", cxx_array_test, NULL, METACALL_NULL, 1, METACALL_ARRAY); EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_array_test", a)); } { - map<std::string, array> m = { - { "includes", array("/a/path", "/another/path") }, - { "libraries", array("/a/path", "/another/path") } + metacall::map<std::string, metacall::array> m = { + { "includes", metacall::array("/a/path", "/another/path") }, + { "libraries", metacall::array("/a/path", "/another/path") } }; - metacall_register("cxx_map_array_test", cxx_map_array_test, NULL, METACALL_NULL, 1, METACALL_MAP); + metacall::metacall_register("cxx_map_array_test", cxx_map_array_test, NULL, METACALL_NULL, 1, METACALL_MAP); EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_map_array_test", m)); } @@ -157,18 +155,18 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) // TODO: /* { - map<std::string, map<std::string, float>> m = { + metacall::map<std::string, metacall::map<std::string, float>> m = { { "hello", { "world", 4.0f } } }; - metacall_register("cxx_recursive_map_test", cxx_recursive_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); + metacall::metacall_register("cxx_recursive_map_test", cxx_recursive_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_recursive_map_test", m)); } */ { - metacall_register("cxx_float_int_int_test", cxx_float_int_int_test, NULL, METACALL_FLOAT, 2, METACALL_INT, METACALL_INT); + metacall::metacall_register("cxx_float_int_int_test", cxx_float_int_int_test, NULL, METACALL_FLOAT, 2, METACALL_INT, METACALL_INT); EXPECT_EQ(3.0f, metacall::metacall<float>("cxx_float_int_int_test", 7, 8)); } @@ -177,11 +175,11 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) { size_t size = 0; - struct metacall_allocator_std_type std_ctx = { &std::malloc, &std::realloc, &std::free }; + metacall::metacall_allocator_std_type std_ctx = { &std::malloc, &std::realloc, &std::free }; - void *allocator = metacall_allocator_create(METACALL_ALLOCATOR_STD, (void *)&std_ctx); + void *allocator = metacall_allocator_create(metacall::METACALL_ALLOCATOR_STD, (void *)&std_ctx); - char *inspect_str = metacall_inspect(&size, allocator); + char *inspect_str = metacall::metacall_inspect(&size, allocator); EXPECT_NE((char *)NULL, (char *)inspect_str); @@ -189,10 +187,10 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) std::cout << inspect_str << std::endl; - metacall_allocator_free(allocator, inspect_str); + metacall::metacall_allocator_free(allocator, inspect_str); - metacall_allocator_destroy(allocator); + metacall::metacall_allocator_destroy(allocator); } - metacall_destroy(); + metacall::metacall_destroy(); } From f60eff60c104f16a8275a7f81b6cacc0cf5993d2 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 15:26:27 +0100 Subject: [PATCH 483/487] Solve issues cxx port. --- .../source/metacall_cxx_port_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp index 3d55099ff..90e987e0a 100644 --- a/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp +++ b/source/tests/metacall_cxx_port_test/source/metacall_cxx_port_test.cpp @@ -128,7 +128,7 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) { "world", 4.0f } }; - metacall::metacall_register("cxx_map_test", cxx_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); + metacall::metacall_register("cxx_map_test", cxx_map_test, NULL, metacall::METACALL_NULL, 1, metacall::METACALL_MAP); EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_map_test", m)); } @@ -136,7 +136,7 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) { metacall::array a(3, 4.0f); - metacall::metacall_register("cxx_array_test", cxx_array_test, NULL, METACALL_NULL, 1, METACALL_ARRAY); + metacall::metacall_register("cxx_array_test", cxx_array_test, NULL, metacall::METACALL_NULL, 1, metacall::METACALL_ARRAY); EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_array_test", a)); } @@ -147,7 +147,7 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) { "libraries", metacall::array("/a/path", "/another/path") } }; - metacall::metacall_register("cxx_map_array_test", cxx_map_array_test, NULL, METACALL_NULL, 1, METACALL_MAP); + metacall::metacall_register("cxx_map_array_test", cxx_map_array_test, NULL, metacall::METACALL_NULL, 1, metacall::METACALL_MAP); EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_map_array_test", m)); } @@ -159,14 +159,14 @@ TEST_F(metacall_cxx_port_test, DefaultConstructor) { "hello", { "world", 4.0f } } }; - metacall::metacall_register("cxx_recursive_map_test", cxx_recursive_map_test, NULL, METACALL_NULL, 1, METACALL_MAP); + metacall::metacall_register("cxx_recursive_map_test", cxx_recursive_map_test, NULL, metacall::METACALL_NULL, 1, metacall::METACALL_MAP); EXPECT_EQ(nullptr, metacall::metacall<std::nullptr_t>("cxx_recursive_map_test", m)); } */ { - metacall::metacall_register("cxx_float_int_int_test", cxx_float_int_int_test, NULL, METACALL_FLOAT, 2, METACALL_INT, METACALL_INT); + metacall::metacall_register("cxx_float_int_int_test", cxx_float_int_int_test, NULL, metacall::METACALL_FLOAT, 2, metacall::METACALL_INT, metacall::METACALL_INT); EXPECT_EQ(3.0f, metacall::metacall<float>("cxx_float_int_int_test", 7, 8)); } From f33842924dc13d0fa1aebef7d9f471f7e9805bbe Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 15:39:00 +0100 Subject: [PATCH 484/487] Solve more issues in metacall. --- source/ports/cxx_port/include/metacall/metacall.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/ports/cxx_port/include/metacall/metacall.hpp b/source/ports/cxx_port/include/metacall/metacall.hpp index 080013b26..593b472ea 100644 --- a/source/ports/cxx_port/include/metacall/metacall.hpp +++ b/source/ports/cxx_port/include/metacall/metacall.hpp @@ -23,6 +23,7 @@ /* -- Headers -- */ +#include <array> #include <cstring> #include <memory> #include <stdexcept> From 89266f6c65b1e146856fab42515518803ea1f831 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 15:54:03 +0100 Subject: [PATCH 485/487] Disable cxx port. --- source/ports/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ports/CMakeLists.txt b/source/ports/CMakeLists.txt index e70bb151d..cc73de928 100644 --- a/source/ports/CMakeLists.txt +++ b/source/ports/CMakeLists.txt @@ -28,7 +28,7 @@ endif() # Project options option(OPTION_BUILD_PORTS_CS "Build C# port." OFF) -option(OPTION_BUILD_PORTS_CXX "Build C++ port." ON) +option(OPTION_BUILD_PORTS_CXX "Build C++ port." OFF) option(OPTION_BUILD_PORTS_D "Build D port." OFF) option(OPTION_BUILD_PORTS_GO "Build Go port." OFF) option(OPTION_BUILD_PORTS_JAVA "Build Java port." OFF) From 2b9bad084515a267b3d093af5e20ab1e2bbe95b0 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 16:06:59 +0100 Subject: [PATCH 486/487] Update version to v0.9.15. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 69010fa5b..6f16bd325 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.14 \ No newline at end of file +0.9.15 \ No newline at end of file From fd5375b5fc61be67b781163f943f59a4030c0829 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <vic798@gmail.com> Date: Thu, 30 Oct 2025 16:09:01 +0100 Subject: [PATCH 487/487] Solve issues with rs port and core. --- source/ports/rs_port/tests/metacall_handle_test.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/ports/rs_port/tests/metacall_handle_test.rs b/source/ports/rs_port/tests/metacall_handle_test.rs index 207d0c24e..516d5b52f 100644 --- a/source/ports/rs_port/tests/metacall_handle_test.rs +++ b/source/ports/rs_port/tests/metacall_handle_test.rs @@ -36,9 +36,6 @@ fn metacall_handle() { // Now, testing loading again into an existing handle number 2 // This should make the handle have greet (2) and yeet functions together - - // TODO: This has a bug in the core that must be reviewed - /* const SCRIPT3: &str = "function yeet() { return 3 } \nmodule.exports = { yeet }"; let result3 = load::from_memory(Tag::NodeJS, SCRIPT3, Some(&mut handle2)); @@ -52,5 +49,4 @@ fn metacall_handle() { let out = metacall_handle_no_arg::<f64>(&mut handle2, "yeet").unwrap(); assert_eq!(out, 3.0, "Testing yeet 2"); } - */ }