use rtld_global when loading plugins - fixes debugpy/numpy import issue
This commit is contained in:
parent
35dc005e0a
commit
9327e4d4e9
3 changed files with 3 additions and 2 deletions
|
@ -63,6 +63,7 @@ if (pybind11_FOUND)
|
||||||
target_link_libraries(mana-plugin-python PRIVATE mana mesytec-mnode rxi-logc pybind11::embed)
|
target_link_libraries(mana-plugin-python PRIVATE mana mesytec-mnode rxi-logc pybind11::embed)
|
||||||
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/mana_python_test_plugin.py ${CMAKE_BINARY_DIR}/mana_python_test_plugin.py COPY_ON_ERROR SYMBOLIC)
|
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/mana_python_test_plugin.py ${CMAKE_BINARY_DIR}/mana_python_test_plugin.py COPY_ON_ERROR SYMBOLIC)
|
||||||
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/mana_python_plugin_test_numpy.py ${CMAKE_BINARY_DIR}/mana_python_plugin_test_numpy.py COPY_ON_ERROR SYMBOLIC)
|
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/mana_python_plugin_test_numpy.py ${CMAKE_BINARY_DIR}/mana_python_plugin_test_numpy.py COPY_ON_ERROR SYMBOLIC)
|
||||||
|
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/mana_python_plugin_test_debugpy.py ${CMAKE_BINARY_DIR}/mana_python_plugin_test_debugpy.py COPY_ON_ERROR SYMBOLIC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(mana-plugin-nng-server SHARED mana_plugin_nng_server.cc)
|
add_library(mana-plugin-nng-server SHARED mana_plugin_nng_server.cc)
|
||||||
|
|
|
@ -365,7 +365,7 @@ PluginWrapper load_mana_plugin(const std::string &filename,
|
||||||
const std::vector<std::string> &pluginArgs)
|
const std::vector<std::string> &pluginArgs)
|
||||||
{
|
{
|
||||||
PluginWrapper result;
|
PluginWrapper result;
|
||||||
result.pluginHandle = boost::dll::shared_library(filename);
|
result.pluginHandle = boost::dll::shared_library(filename, boost::dll::load_mode::rtld_global);
|
||||||
|
|
||||||
if (auto entryPoint = result.pluginHandle.get<mana_sink_plugin_t()>("mana_get_sink_plugin"))
|
if (auto entryPoint = result.pluginHandle.get<mana_sink_plugin_t()>("mana_get_sink_plugin"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@ MANA_DEFINE_PLUGIN_INIT(init)
|
||||||
ctx->usercode = py::module_::import(filename.c_str());
|
ctx->usercode = py::module_::import(filename.c_str());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// py::exec(R"(import debugpy; debugpy.listen(5678))");
|
py::exec(R"(import debugpy; debugpy.listen(5678))");
|
||||||
// py::exec(R"(import numpy)");
|
// py::exec(R"(import numpy)");
|
||||||
// py::module::import("numpy");
|
// py::module::import("numpy");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue