WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Missing dependencies for 64-bit extensions  (Read 2992 times)

Offline andyj

  • Hero Member
  • *****
  • Posts: 1022
Missing dependencies for 64-bit extensions
« on: February 23, 2016, 08:09:16 AM »
As I work on getting my extensions ready to submit I'm finding a few things along the way:

Xorg-7.7-bin is missing a dependency on libdmx
pcre is missing dependencies on readline and bzip2-lib
elfutils is missing dependencies on bzip2-lib and liblzma
gtk3 is missing dependencies on libcups, liblcms2, and colord (which might only be an issue for printing)

Also, my apps browser doesn't download. I click on GO and a terminal window pops open and then nothing happens. tce-load still works as expected.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: Missing dependencies for 64-bit extensions
« Reply #1 on: February 23, 2016, 08:45:48 AM »
Aside from /bin and /sbin, are you checking for deps for /usr/local/lib/*.so alone or /usr/local/lib/somedir/*.so as well?

Deps from  /usr/local/lib/somedir/*.so could be considered optional.

The apps gui is working fine for me, what happens if you start it from terminal window and try?

Edit: see pcre info file
« Last Edit: February 23, 2016, 08:47:52 AM by Juanito »

Offline andyj

  • Hero Member
  • *****
  • Posts: 1022
Re: Missing dependencies for 64-bit extensions
« Reply #2 on: February 23, 2016, 10:03:02 AM »
Apps has the same behavior when started from a terminal window. It doesn't download.

I don't know of a good way to tell the required dependencies from the optional ones automagically. PHP is full of optional ones but they're conveniently in an extensions directory. Basically I'm looping through all the files in a directory tree, running ldd, then looping through its output recursively looking for the referenced libraries. If it has /local/ in the path of the library it's referencing (which I assume it gets from the ld.so.cache thanks to ldconfig) then I search through the /tmp/tcloop tree to see which extension it is actually in (this requires that copy2fs not be used). If ldd returns not found, then I use the app browser to figure out what extension has the missing file.  Here's my script. I'm not convinced that I'm breaking out of the circular reference trap right, and it throws off the library counts, but it does seem to work OK in most cases:

Code: [Select]
#!/bin/sh

list_libs(){
local t
t=$(($1 + 1))
ldd "$2" | grep '=>' | while read SLIB SEP DLIB ADDR; do
if [ "$DLIB $ADDR" = "not found" ] ; then
echo -e "\\n***ERROR*** $SLIB not found ***\\n"
else
x=$DLIB
eval "x$t=$x"
c=0
for z in $(seq $t); do
eval "y=\$x$z"
if [ $z -lt $t -a "$x" = "$y" ] ; then
c=$(($t - $z))
fi
echo -e -n \\t
done
echo -n "$t ==>> $x"
echo $x | grep -q /local/ && echo -n "  extension: $(find /tmp/tcloop -name $(basename "$x") | cut -d/ -f4).tcz"
echo
if [ $c -gt 0 ] ; then
echo -e "\\n***ERROR*** CIRCULAR REFERENCES FOUND *** BACKING UP $c LEVELS *** $y\\n"
return $c
else
list_libs $t "$x"
c=$?
if [ $c -gt 0 ] ; then
c=$(($c - 1))
return $c
fi
fi
fi
done
}

for a in $@; do
echo $a
list_libs 0 "$a"
echo -e \\n
done

Then I do some gleaning of the output like this:

Code: [Select]
grep extension saved-lib-tree.out | cut -d\  -f6 | sort | uniq -c | sort -n
to see what I really need. I'm also assuming that anything that shows up more than once is referenced by a dependency so I don't need to add those to the deps file.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: Missing dependencies for 64-bit extensions
« Reply #3 on: February 23, 2016, 11:19:58 PM »
Xorg-7.7-bin, elfutils and elfutils-dev dep files updated; gtk3 info file updated - thanks.

If I recall correctly @JasonW is your man for recursive dep scripts  :)