Fix: lib: expose bt_lib_log_level symbol
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 6 Jun 2019 18:57:13 +0000 (14:57 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 6 Jun 2019 23:12:28 +0000 (19:12 -0400)
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 <jonathan.rajotte-julien@efficios.com>
Change-Id: I716ae2eb6e2457c7a4f130a394f97391d56454e4
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1388
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
lib/logging.c
tests/python-plugin-provider/test_python_plugin_provider.py

index cf5c9955376c330c8233b86de4f389b2da62d148..871c062933aca2517d2a3b954e0ffb61adfd20c7 100644 (file)
@@ -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)
index 12bdac5a688a6e18424204916115691cd357022a..0e3cc13bc3cdf9d9e3b494fe14288a169c1cfe2d 100644 (file)
@@ -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']
This page took 0.025784 seconds and 4 git commands to generate.