diff --git a/.vscode/launch.json b/.vscode/launch.json index 41cea85f29..924f134415 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -645,12 +645,12 @@ "name": "app (golang) (lldb, launch)", "type": "lldb", "request": "launch", - "program": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/bin/main", - "cwd": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/", + "program": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/bin/main", + "cwd": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/", "env": { - "LD_LIBRARY_PATH": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/ten_packages/system/ten_runtime/lib:${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/ten_packages/system/ten_runtime_go/lib:${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/ten_packages/system/ten_runtime_python/lib", + "LD_LIBRARY_PATH": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/system/ten_runtime/lib:${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/system/ten_runtime_go/lib:${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/system/ten_runtime_go/lib", "DYLD_LIBRARY_PATH": "${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/go/access_property_go/access_property_goo_app/lib", - "CGO_LDFLAGS": "-L${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/python/go_app_python/go_app_python_app/ten_packages/system/ten_runtime_go/lib -lten_runtime_go -Wl,-rpath,@loader_path/lib -Wl,-rpath,@loader_path/../lib", + "CGO_LDFLAGS": "-L${workspaceFolder}/out/linux/x64/tests/ten_runtime/integration/go/access_property_go/access_property_go_app/ten_packages/system/ten_runtime_go/lib -lten_runtime_go -Wl,-rpath,@loader_path/lib -Wl,-rpath,@loader_path/../lib", "TEN_ENABLE_PYTHON_DEBUG": "true", }, "initCommands": [ diff --git a/core/src/ten_runtime/binding/go/native/app/app.c b/core/src/ten_runtime/binding/go/native/app/app.c index 425b7719c2..e7615a09b5 100644 --- a/core/src/ten_runtime/binding/go/native/app/app.c +++ b/core/src/ten_runtime/binding/go/native/app/app.c @@ -65,7 +65,6 @@ static void proxy_on_init(ten_app_t *app, ten_env_t *ten_env) { TEN_ASSERT(app_bridge, "Should not happen."); ten_go_ten_env_t *ten_bridge = ten_go_ten_env_wrap(ten_env); - ten_bridge->c_ten_env_proxy = ten_env_proxy_create(ten_env, 1, NULL); tenGoAppOnInit(app_bridge->bridge.go_instance, ten_go_ten_env_go_handle(ten_bridge)); diff --git a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c index 0784cfbe6c..6637568f31 100644 --- a/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c +++ b/core/src/ten_runtime/binding/go/native/ten_env/ten_env_log.c @@ -124,10 +124,9 @@ void ten_go_ten_env_log(uintptr_t bridge_addr, int level, const void *func_name, false, &err)) { goto done; } + ten_event_wait(info->completed, -1); } - ten_event_wait(info->completed, -1); - done: ten_error_deinit(&err); ten_env_notify_log_info_destroy(info); diff --git a/core/src/ten_runtime/binding/python/native/app/app.c b/core/src/ten_runtime/binding/python/native/app/app.c index bddd1b13be..8eeccc86a0 100644 --- a/core/src/ten_runtime/binding/python/native/app/app.c +++ b/core/src/ten_runtime/binding/python/native/app/app.c @@ -118,7 +118,7 @@ static PyObject *ten_py_app_create(PyTypeObject *type, PyObject *args, return ten_py_raise_py_type_error_exception("Expect 0 argument."); } - py_app->c_app = ten_app_create(proxy_on_init, proxy_on_deinit, NULL); + py_app->c_app = ten_app_create(NULL, proxy_on_init, proxy_on_deinit, NULL); if (!py_app->c_app) { TEN_ASSERT(0, "Failed to create TEN app."); diff --git a/core/src/ten_runtime/binding/python/native/extension/extension.c b/core/src/ten_runtime/binding/python/native/extension/extension.c index 5929df8da9..68cea82b46 100644 --- a/core/src/ten_runtime/binding/python/native/extension/extension.c +++ b/core/src/ten_runtime/binding/python/native/extension/extension.c @@ -103,16 +103,12 @@ static void proxy_on_init(ten_extension_t *extension, ten_env_t *ten_env) { py_extension && ten_py_extension_check_integrity(py_extension, true), "Invalid argument."); - ten_py_ten_env_t *py_ten_env = ten_py_ten_wrap(ten_env); - py_extension->py_ten_env = (PyObject *)py_ten_env; - - py_ten_env->c_ten_env_proxy = ten_env_proxy_create(ten_env, 1, NULL); - TEN_ASSERT(py_ten_env->c_ten_env_proxy && - ten_env_proxy_check_integrity(py_ten_env->c_ten_env_proxy), - "Invalid argument."); + PyObject *py_ten_env = py_extension->py_ten_env; + TEN_ASSERT(py_ten_env, "Should not happen."); - PyObject *py_res = PyObject_CallMethod((PyObject *)py_extension, "on_init", - "O", py_ten_env->actual_py_ten_env); + PyObject *py_res = + PyObject_CallMethod((PyObject *)py_extension, "on_init", "O", + ((ten_py_ten_env_t *)py_ten_env)->actual_py_ten_env); Py_XDECREF(py_res); bool err_occurred = ten_py_check_and_clear_py_error();