From 1d9f0512b3d9f9fa03864bd14c52e492be84db80 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 6 Jun 2019 14:57:13 -0400 Subject: [PATCH] Fix: lib: expose bt_lib_log_level symbol The Python plugin provider does not work. It fails to be loaded: $ ./cli/babeltrace -v list-plugins --plugin-path /tmp/python ... 06-06 15:03:51.883 13378 13378 I PLUGIN init_python_plugin_provider@plugin.c:80 Cannot open `libbabeltrace-python-plugin-provider.so`: /home/smarchi/build/babeltrace/python-plugin-provider/.libs/libbabeltrace-python-plugin-provider.so: undefined symbol: bt_lib_log_level: continuing without Python plugin support. ... The Python plugin provider is built as a .so separate from the main libbabeltrace.so lib. However, it uses the logging system of the lib, including the bt_lib_log_level symbol. This symbol is currently not exposed to other shared objects because it is marked as BT_HIDDEN. Remove BT_HIDDEN to make the symbol visible to the python plugin provider shared object. Now that the Python bindings are merged, re-enable the Python plugin provider test, which exposes the problem. Note that the Python plugin provider is built as a separate .so for packaging purposes (so it can be distributed separately), but is still considered part of the lib. This is why it is allowed to include and use internal lib things. Reported-by: Jonathan Rajotte Change-Id: I716ae2eb6e2457c7a4f130a394f97391d56454e4 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/1388 Tested-by: jenkins Reviewed-by: Philippe Proulx --- lib/logging.c | 1 - tests/python-plugin-provider/test_python_plugin_provider.py | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/logging.c b/lib/logging.c index cf5c9955..871c0629 100644 --- a/lib/logging.c +++ b/lib/logging.c @@ -44,7 +44,6 @@ # define DEFAULT_LOG_LEVEL BT_LOG_NONE #endif /* BT_DEV_MODE */ -BT_HIDDEN int bt_lib_log_level = DEFAULT_LOG_LEVEL; enum bt_logging_level bt_logging_get_minimal_level(void) diff --git a/tests/python-plugin-provider/test_python_plugin_provider.py b/tests/python-plugin-provider/test_python_plugin_provider.py index 12bdac5a..0e3cc13b 100644 --- a/tests/python-plugin-provider/test_python_plugin_provider.py +++ b/tests/python-plugin-provider/test_python_plugin_provider.py @@ -3,7 +3,6 @@ import bt2 import os -@unittest.skip('depends on Python bindings, which are broken') class PythonPluginProviderTestCase(unittest.TestCase): def test_python_plugin_provider(self): path = os.environ['PYTHON_PLUGIN_PROVIDER_TEST_PLUGIN_PATH'] -- 2.34.1