I am working on a test that uses a component class implemented in a
Python plugin. For it to work, babeltrace therefore needs to be able to
load the python plugin provider lib. It currently isn't found:
LIB/PLUGIN init_python_plugin_provider@plugin.c:84 Loading Python plugin provider module.
LIB/PLUGIN init_python_plugin_provider@plugin.c:94 Cannot open `libbabeltrace2-python-plugin-provider.so`: libbabeltrace2-python-plugin -provider.so: cannot open shared object file: No such file or directory: continuing without Python plugin support.
This patch makes run_python_bt2 add the right path to LD_LIBRARY_PATH
(PATH on Windows) so that babeltrace can load python plugins.
With this added we don't need the feature of run_python_bt2 and
run_python_bt2 that allowed to append an additional directory to
LD_LIBRARY_PATH, so it is removed.
Change-Id: Ie72f59c9ef4866c7f0eae0e6f49025d2fa1ba127
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1608
CI-Build: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
run_python_bt2_test \
"${BT_TESTS_SRCDIR}/python-plugin-provider" \
run_python_bt2_test \
"${BT_TESTS_SRCDIR}/python-plugin-provider" \
- test_python_plugin_provider.py \
- "${BT_TESTS_BUILDDIR}/../src/python-plugin-provider/.libs"
+ test_python_plugin_provider.py
local lib_search_var
local lib_search_path
local lib_search_var
local lib_search_path
+ local python_provider_path="${BT_TESTS_BUILDDIR}/../src/python-plugin-provider/.libs"
+ local main_lib_path="${BT_TESTS_BUILDDIR}/../src/lib/.libs"
+
# Set the library search path so the python interpreter can load libbabeltrace2
if [ "x${MSYSTEM:-}" != "x" ]; then
lib_search_var="PATH"
# Set the library search path so the python interpreter can load libbabeltrace2
if [ "x${MSYSTEM:-}" != "x" ]; then
lib_search_var="PATH"
- lib_search_path="${BT_TESTS_BUILDDIR}/../src/lib/.libs:${PATH:-}"
+ lib_search_path="${python_provider_path}:${main_lib_path}:${PATH:-}"
else
lib_search_var="LD_LIBRARY_PATH"
else
lib_search_var="LD_LIBRARY_PATH"
- lib_search_path="${BT_TESTS_BUILDDIR}/../src/lib/.libs:${LD_LIBRARY_PATH:-}"
- fi
- if [ "x${test_lib_search_path:-}" != "x" ]; then
- lib_search_path+=":${test_lib_search_path}"
+ lib_search_path="${python_provider_path}:${main_lib_path}:${LD_LIBRARY_PATH:-}"
#
# $1 : The directory containing the python test scripts
# $2 : The pattern to match python test script names (optional)
#
# $1 : The directory containing the python test scripts
# $2 : The pattern to match python test script names (optional)
-# $3 : Additionnal library search path (optional)
run_python_bt2_test() {
local test_dir="$1"
local test_pattern="${2:-}" # optional
run_python_bt2_test() {
local test_dir="$1"
local test_pattern="${2:-}" # optional
- local test_lib_search_path="${3:-}" # optional
local ret
local test_runner_args=()
local ret
local test_runner_args=()