Bug #1423
opentests/lib/test-plugins.sh should not reference .lib
0%
Description
reference .lib in tests/lib/test-plugins.sh as the following show:
"${BT_TESTS_BUILDDIR}/lib/test-plugins" "${BT_TESTS_BUILDDIR}/lib/test-plugins-plugins/.libs"
.libs are used as the temporary directory, we should not reference a temporary directory.
Updated by Kienan Stewart 18 days ago
- Status changed from New to Feedback
- Assignee set to Bin Lan
Hi Bin Lan,
the test uses the shared objects in ${BT_TESTS_BUILDDIR}/lib/test-plugins-plugins/.libs
. Those shared objects are produced there by automake/libtool and not installed elsewhere.
Do you have an alternative solution in mind?
thanks,
kienan
Updated by Kienan Stewart 18 days ago
Hi again Bin Lan,
could you also explain the context of why this change is important to you? What steps of building and testing (and on which platform) led to this being an issue?
thanks,
kienan
Updated by Bin Lan 17 days ago
Hi kienan,
I am working to upgrade babeltrace from 2.0.6 to 2.1.0 for Yocto openembedded-core. Reproduction step is:
Download Yocto Poky.
Apply my patch: https://lists.openembedded.org/g/openembedded-core/message/212733.
I have to patch tests/lib/test-plugins.sh, then the test cases can pass.
Updated by Kienan Stewart 17 days ago
Hi Bin Lan,
thanks for the link to the yocto patches and discussion. When I cross-compile babeltrace2 locally without being in the context of poky, the cross-compiled shared libraries are in ".libs".
Eg.
# Environment variables elided # On an x86_64 build host ./configure --host=aarch64-linux-gnu make -j find tests/ -iname "*.so*"
If the change you are proposing is to simply remove ".libs" that would break the default behaviour for tests run following both native and cross compilation outside of the yocto context. Do you have a more general solution in mind?
I'm still familiarizing myself with the poky environment, but from what I can see when I use bitbake to build the babeltrace2 recipe, the build dir contains ".libs/" with shared objects as expected. E.g.,
debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ find tests/ -iname '*.so' tests/lib/test-plugin-plugins/.libs/plugin-sfs.so tests/lib/test-plugin-plugins/.libs/plugin-minimal.so
Furthermore, the LT_OBJDIR
/objdir
for libtool seem to be ".libs" within the poky build directory:
debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ grep -r LT_OBJDIR config.status:D["LT_OBJDIR"]=" \".libs/\"" src/common/config.h:#define LT_OBJDIR ".libs/" config.log:| #define LT_OBJDIR ".libs/" config.log:| #define LT_OBJDIR ".libs/" config.log:| #define LT_OBJDIR ".libs/" config.log:| #define LT_OBJDIR ".libs/" config.log:#define LT_OBJDIR ".libs/" debian@pleased-dinosaur:~/test/build/tmp/work/armv8a-poky-linux/babeltrace2/2.0.6/build$ grep -r objdir config* config.log:configure:12953: checking for objdir config.log:lt_cv_objdir=.libs config.status:objdir='.libs' config.status:archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ config.status: cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ config.status: echo "local: *; };" >> $output_objdir/$libname.ver~ config.status: $CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' config.status:objdir=$objdir
Is the recipe running the tests with only the contents of the "install" step or something like that?
thanks,
kienan
P.S. With respect to libtool itself the objdir
is not always ".libs". On ms-dos, for example, it would be "_libs". One way to get this information could be a short function e.g.
OBJDIR=$( source < <(libtool --config) echo $objdir )
Updated by Kienan Stewart 16 days ago
Hi Bin Lan,
after looking further at do_install_ptest
in babeltrace2_2.0.6.bb, it looks like it's the recipe copying the ".so" files out of ".libs" directory into the parent.
thanks,
kienan