Closed kloczek closed 1 year ago
I've previously asked for:
test_include.sh
file: ref. https://github.com/libstorage/libstoragemgmt/issues/461#issuecomment-820464010The file _clib.so
is missing. I don't know why and I don't know why we aren't getting messages that it's missing as we explicitly check for it. As I mentioned in this comment: https://github.com/libstorage/libstoragemgmt/issues/461#issuecomment-819867214 we should have the message the file was copied, or an error that it wasn't found. We don't have either, so I can only conclude you are running a modified file.
I'd really like to help you solve this, but I need more information that I've previously asked for.
OK I found cause .. and it is caused by my patch however it is only part of the issue 😋 I'ev added remove all use chrpath. Here is the patch
--- a/configure.ac
+++ b/configure.ac
@@ -141,13 +141,8 @@
PKG_CHECK_MODULES([LIBCHECK], [check >= 0.9.8 ])
dnl =====================================================================
- dnl Check for chrpath, valgrind, wc, used for make check
+ dnl Check for valgrind, wc, used for make check
dnl =====================================================================
- AC_PATH_PROG([CHRPATH], chrpath)
- if test -z $CHRPATH ;then
- AC_MSG_ERROR([Need 'chrpath' to run test cases])
- fi
-
AC_ARG_WITH([mem-leak-test],
[AS_HELP_STRING([--without-mem-leak-test],
[Do not run memory leak test])],
--- a/test/test_include.sh
+++ b/test/test_include.sh
@@ -226,25 +226,6 @@
_good $LIBTOOL_CMD_NO_WARN --mode install \
install "${build_dir}/c_binding/libstoragemgmt.la" "$LSM_TEST_C_LIB_DIR"
- # libtool 'install' mode does not work against python C extension,
- # use manual copy instead
- CLIB_FOUND=0
- if [ -e "${build_dir}/python_binding/lsm/.libs/_clib.so" ]
- then
- _good cp "${build_dir}/python_binding/lsm/.libs/_clib.so" \
- "${LSM_TEST_PY_MODULE_DIR}/lsm/_clib.so"
- _good chrpath -d "${LSM_TEST_PY_MODULE_DIR}/lsm/_clib.so"
- CLIB_FOUND=1
- fi
-
- if [ -e "${build_dir}/python_binding/lsm/.libs/_clib3.so" ]
- then
- _good cp "${build_dir}/python_binding/lsm/.libs/_clib3.so" \
- "${LSM_TEST_PY_MODULE_DIR}/lsm/_clib3.so"
- _good chrpath -d "${LSM_TEST_PY_MODULE_DIR}/lsm/_clib3.so"
- CLIB_FOUND=1
- fi
-
if [ $CLIB_FOUND -eq 0 ]; then
_fail "Unable to find _clib.so or _clib3.so python C extension"
fi
@@ -261,7 +246,6 @@
"${LSM_TEST_BIN_DIR}/lsmcli"
_good $LIBTOOL_CMD_NO_WARN --mode install \
install "${build_dir}/test/tester" "${LSM_TEST_BIN_DIR}/tester"
- _good chrpath -d "${LSM_TEST_BIN_DIR}/tester"
_good install "${build_dir}/test/plugin_test.py" \
"${LSM_TEST_BIN_DIR}/plugin_test.py"
_good install "${build_dir}/test/cmdtest.py" \
@@ -302,8 +283,6 @@
find ${LSM_TEST_PY_MODULE_DIR} -type d -exec chmod +w {} \;
_good cp -fv "${build_dir}/plugin/nfs_plugin/.libs/nfs_clib.so" \
"${LSM_TEST_PY_MODULE_DIR}/lsm/plugin/nfs_plugin/nfs_clib.so"
- _good chrpath -d \
- "${LSM_TEST_PY_MODULE_DIR}/lsm/plugin/nfs_plugin/nfs_clib.so"
fi
legal_plugin_type=1
@@ -289,7 +289,6 @@
for c_plugin in $_LSM_C_PLUGINS; do
_good $LIBTOOL_CMD_NO_WARN --mode install \
install -D "${build_dir}/plugin/$c_plugin" "$LSM_TEST_PLUGIN_DIR"
- _good chrpath -d "${LSM_TEST_PLUGIN_DIR}/$(basename $c_plugin)"
done
legal_plugin_type=1
fi
Second part of that story is that this patch is kind of OK because all altering of the loading module or library can be done be $LD_LIBRARY_PATH or $PYTHONPATH env variables. Many yeaes ago I found that if someone is usimg chrpath in build/test suites more or less it means that someting is broken by design. In this case fiddling in elf binaries is not needed. 😋 In other words this unit can be way simpler ..
Thanks for supplying the information I asked for and I'm glad you've located the cause of the issue you were running into with your change.
In other words this unit can be way simpler ..
If you would like to submit a PR that makes it simpler, please do so.
This is continuation of the https://github.com/libstorage/libstoragemgmt/issues/461
Looks like test unit is trying to assemble some env in /tmp and is not copying 'lsm._clib'. Despite that it should work because I'm passing to the env variabled $PYTHONPATH pointing to python sitearch in
</install/prefix>
.