Author Topic: Automatically Determining Dependancies  (Read 7806 times)

Armagon

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • http://
Automatically Determining Dependancies
« on: March 22, 2006, 04:37:41 pm »
Update: I've made a dependency finder script, see post 8, and let me know if it works for you.

--

Hi.

I'm looking for a handy script that'll take a pdaXrom executable, and tell me what the package dependencies are (so that I can put that in the ipk control file.)  Does anyone have such a beast?

I assume that it'd have to use the output of ldd on the Zaurus, or the output of
Code: [Select]
armv5tel-cacko-linux-objdump -x executable_filename | grep NEEDED when you cross-compile.  I also presume that it'd need to use (possibly several) Filelist files, from the feeds that contain the dependancies.

So, again, does anyone have such a script, or a similar solution?  (Barring that, would anyone write such a script?)

Thanks,
Armagon
« Last Edit: March 24, 2006, 01:24:25 pm by Armagon »
Sharp Zaurus SL-C1000 -- 2 GB SD Card -- Zippy Slim Mini Keyboard -- Loving pdaXii13!

koen

  • Hero Member
  • *****
  • Posts: 1008
    • View Profile
    • http://dominion.thruhere.net/koen/cms/
Automatically Determining Dependancies
« Reply #1 on: March 22, 2006, 05:04:10 pm »
Quote
Hi.

I'm looking for a handy script that'll take a pdaXrom executable, and tell me what the package dependancies are (so that I can put that in the ipk control file.)  Does anyone have such a beast?

I assume that it'd have to use the output of ldd on the Zaurus, or the output of
Code: [Select]
armv5tel-cacko-linux-objdump -x executable_filename | grep NEEDED when you cross-compile.  I also presume that it'd need to use (possibly several) Filelist files, from the feeds that contain the dependancies.

So, again, does anyone have such a script, or a similar solution?  (Barring that, would anyone write such a script?)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119828\"][{POST_SNAPBACK}][/a][/div]

OpenEmbedded
Forums are not bugtrackers!!! Smart questions
Ångström release team
iPAQ h2210, iPAQ h5550, iPAQ hx4700, Zaurus SL-C700, Nokia 770, all running some form of GPE
My blog

adf

  • Hero Member
  • *****
  • Posts: 2807
    • View Profile
    • http://
Automatically Determining Dependancies
« Reply #2 on: March 22, 2006, 08:38:20 pm »
Quote
Quote
Hi.

I'm looking for a handy script that'll take a pdaXrom executable, and tell me what the package dependancies are (so that I can put that in the ipk control file.)  Does anyone have such a beast?

I assume that it'd have to use the output of ldd on the Zaurus, or the output of
Code: [Select]
armv5tel-cacko-linux-objdump -x executable_filename | grep NEEDED when you cross-compile.  I also presume that it'd need to use (possibly several) Filelist files, from the feeds that contain the dependancies.

So, again, does anyone have such a script, or a similar solution?  (Barring that, would anyone write such a script?)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119828\"][{POST_SNAPBACK}][/a][/div]

OpenEmbedded
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119830\"][{POST_SNAPBACK}][/a][/div]

In theory.  In practice firefox won't install on OZ on my freshly flashed 6000l using the simple command"ipkg -d sd install firefox"  It downloads firefox,whips up a bunch dependencies, decides it should install thunderbird, can't find thunderbird, and stops.  I didn't request thunderbird there, and firefox isn't dependant on thunderbird. I would view this as indicative of a not-quite-stable-at-best solution for managing dependecies.  

I hate to say stuff like this. I really do.  gpe 2.7 is gorgeous, the minibrowser is cool, even if a lot of sites crash it, and the work that went into OZ and openembedded, the idea of a unified handheld OS, is to be commended.

On the other hand OZ guys posting OZ or OE propaganda in pdaXrom threads is really not too cool. Especially when their stuff still doesn't seem to work as well as pdaXrom.  proof:  If I type "ipkg -d sd install firefox" on pdaxrom on my 6000 I get firefox working on my 6000. If I do it in OZ/GPE I get a failed attempt to install Thunderbird.
Which do you think constitutes a better fit to any reasonable definition of "working?"
I realize Armegon was talking about ipkg generation, not installation, but wasn't it OE that generated the firefox ipkg that thinks it needs thunderbird?

Firefox is not some bit of useless exotica. If I want to access any of my work sites, or do online banking, the gpe browser won't do it. It is a pretty standard piece of software with widely known dependencies that should NOT be a problem to install.

I'm not trying to flame here. I really think OZ has improved.  But let's not kid ourselves. OE is not (yet at least) the solution the dev team would like it to be.  Maybe it is a case of too much familiarity (no pun intended). To someone working on OE and with OZ constantly, misbehaviours of the sort I cited must look pretty trivial.

But to me, at least, this pushing OE stuff is kinda like the guy at the office who forces everybody to look at baby pictures. you know?
« Last Edit: March 22, 2006, 08:48:22 pm by adf »
**3100 Zubuntu Jaunty,(working on Cacko dualboot), 16G A-Data internal CF, 4G SD, Ambicom WL-1100C Cf, linksys usb ethernet,  BelkinF8T020 BT card, Belkin F8U1500-E Ir kbd, mini targus usb mouse, rechargeble AC/DC powered USB hub, psp cables and battery extenders.

**6000l  Tetsuized Sharprom, installed on internal flash only 1G sd, 2G cf

koen

  • Hero Member
  • *****
  • Posts: 1008
    • View Profile
    • http://dominion.thruhere.net/koen/cms/
Automatically Determining Dependancies
« Reply #3 on: March 23, 2006, 03:22:00 am »
Quote
Quote
Quote
Hi.

I'm looking for a handy script that'll take a pdaXrom executable, and tell me what the package dependancies are (so that I can put that in the ipk control file.)  Does anyone have such a beast?

I assume that it'd have to use the output of ldd on the Zaurus, or the output of
Code: [Select]
armv5tel-cacko-linux-objdump -x executable_filename | grep NEEDED when you cross-compile.  I also presume that it'd need to use (possibly several) Filelist files, from the feeds that contain the dependancies.

So, again, does anyone have such a script, or a similar solution?  (Barring that, would anyone write such a script?)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119828\"][{POST_SNAPBACK}][/a][/div]

OpenEmbedded
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119830\"][{POST_SNAPBACK}][/a][/div]

In theory.  In practice firefox won't install on OZ on my freshly flashed 6000l using the simple command"ipkg -d sd install firefox"  It downloads firefox,whips up a bunch dependencies, decides it should install thunderbird, can't find thunderbird, and stops.  I didn't request thunderbird there, and firefox isn't dependant on thunderbird. I would view this as indicative of a not-quite-stable-at-best solution for managing dependecies.  
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119847\"][{POST_SNAPBACK}][/a][/div]

That error was being caused by some person removing stuff form the feeds without checking if it was needed. As expected, it blew up.
Forums are not bugtrackers!!! Smart questions
Ångström release team
iPAQ h2210, iPAQ h5550, iPAQ hx4700, Zaurus SL-C700, Nokia 770, all running some form of GPE
My blog

koen

  • Hero Member
  • *****
  • Posts: 1008
    • View Profile
    • http://dominion.thruhere.net/koen/cms/
Automatically Determining Dependancies
« Reply #4 on: March 23, 2006, 04:28:07 am »
FWIW, the content of the control file of the firefox I've just built:

Code: [Select]
Package: firefox
Version: 1.5-r0
Depends: libc6 (>= 2.4), libgcc1 (>= 4.1.0), libstdc++6 (>= 4.1.0), libidl-2-0 (>= 0.8.6), libglib-2.0-0 (>= 2.8.4), gtk+ (>= 2.8.9), libatk-1.0-0 (>= 1.10.1), pango (>= 1.10.2), libcairo2 (>= 1.0.4), libxt6 (>= 1.0.0), libx11-6 (>= X11R7.0-1.0.0), libxft2 (>= 2.1.8.2), libxrender1 (>= 0.9.0.2), libfontconfig1 (>= 2.2.95), libfreetype6 (>= 2.1.10), libz1 (>= 1.2.3)
Section: x11/utils
Architecture: armv5te
Maintainer: OpenEmbedded Team
MD5Sum: c143c380313bd4f1818e53cb81435beb
Size: 8308680
Filename: firefox_1.5-r0_armv5te.ipk
Source: http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/1.5/source/firefox-1.5-source.tar.bz2 file://xptcstubs.patch;patch=1 file://no-xmb.patch;patch=1 file://jsautocfg.h file://extensions-hack.patch;patch=1 file://mozconfig file://mozilla-firefox.png file://mozilla-firefox.desktop
Description: Version 1.5-r0 of package firefox
Forums are not bugtrackers!!! Smart questions
Ångström release team
iPAQ h2210, iPAQ h5550, iPAQ hx4700, Zaurus SL-C700, Nokia 770, all running some form of GPE
My blog

Hrw

  • Hero Member
  • *****
  • Posts: 1366
    • View Profile
Automatically Determining Dependancies
« Reply #5 on: March 23, 2006, 06:39:13 am »
Code: [Select]
Package: firefox
Version: 1.0.6-r0
Depends: libc6 (>= 2.3.5+cvs20050627), libgcc1 (>= 3.4.4), libstdc++6 (>= 3.4.4), libidl-2-0 (>= 0.8.6), libglib-2.0-0 (>= 2.6.4), gtk+ (>= 2.6.10), libatk-1.0-0 (>= 1.9.0), pango (>= 1.8.1), libxt6 (>= 0.1.5), libx11-6 (>= 6.2.1), libxft2 (>= 2.1.6), libfreetype6 (>= 2.1.10), libz1 (>= 1.2.3), libxrender1 (>= 0.8.4), libfontconfig1 (>= 2.2.95), gconf-dbus (>= 0.0cvs20060102), dbus-1 (>= 0.23.4), gnome-vfs-dbus (>= 2.8.4.4), libgnome (>= 2.12.0.1), libpopt0 (>= 1.7), libbonobo (>= 2.10.0), orbit2 (>= 2.10.2)
Status: install user unpacked
Section: x11/utils
Architecture: arm
maintainer: OpenEmbedded Team
MD5Sum: 33d200b0ded7b809daf662d0880510d0
Size: 8283430
Filename: firefox_1.0.6-r0_arm.ipk
Source: http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/1.0.6/source/firefox-1.0.6-source.tar.bz2 file://xptcstubs.patch;patch=1 file://no-xmb.patch;patch=1 file://firefox-cc-fix.patch;patch=1 file://jsautocfg.h file://extensions-hack.patch;patch=1 file://mozconfig file://mozilla-firefox.png file://mozilla-firefox.desktop
Description: Version 1.0.6-r0 of package firefox

Thats updated firefox in OZ 3.5.4 feed - I had to clean a bit feeds after 'world' build.
OpenZaurus 3.5.4x Release Manager
OpenEmbedded, Ångström, Poky developer
My website

Misc embedded hardware.

sashz

  • Sr. Member
  • ****
  • Posts: 388
    • View Profile
    • http://
Automatically Determining Dependancies
« Reply #6 on: March 23, 2006, 11:13:33 am »
Quote
Quote
Hi.

I'm looking for a handy script that'll take a pdaXrom executable, and tell me what the package dependancies are (so that I can put that in the ipk control file.)  Does anyone have such a beast?

I assume that it'd have to use the output of ldd on the Zaurus, or the output of
Code: [Select]
armv5tel-cacko-linux-objdump -x executable_filename | grep NEEDED when you cross-compile.  I also presume that it'd need to use (possibly several) Filelist files, from the feeds that contain the dependancies.

So, again, does anyone have such a script, or a similar solution?  (Barring that, would anyone write such a script?)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119828\"][{POST_SNAPBACK}][/a][/div]

OpenEmbedded
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119830\"][{POST_SNAPBACK}][/a][/div]

OE can generate dependencies by looking executable file???!!! Look into it;)
« Last Edit: March 23, 2006, 11:16:03 am by sashz »

Armagon

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • http://
Automatically Determining Dependancies
« Reply #7 on: March 24, 2006, 12:58:07 am »
Quote
I'm looking for a handy script that'll take a pdaXrom executable, and tell me what the package dependancies are (so that I can put that in the ipk control file.)  Does anyone have such a beast?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119828\"][{POST_SNAPBACK}][/a][/div]

OK, I've written one.  I want to put it up here before I go to bed tonight.  It may still have bugs, and I'm sure it can be improved.

You'll need to remove the .txt extension, and make the attached python script executable.  You will also need to download a filelist (such as the one for the C700 feed), and edit a couple of lines.  I suspect this'll work natively if you change
Code: [Select]
objdump = "armv5tel-cacko-linux-objdump" to
Code: [Select]
objdump = "objdump".

Sample Output

This is sample output, when I'm in a subshell of runsdk.sh.

Code: [Select]
user@desktop:~/Zaurus/Cross/install/bin$ ./depfind.py inkscape

PACKAGE         :  MEETS DEPENDANCIES FOR

atk             :  libatk-1.0.so.0;
fontconfig      :  libfontconfig.so.1;
freetype        :  libfreetype.so.6;
gconf           :  libgconf-2.so.4;
glib2           :  libglib-2.0.so.0;  libgmodule-2.0.so.0;  libgobject-2.0.so.0;  libgthread-2.0.so.0;
glibc           :  libpthread.so.0;  libdl.so.2;  libc.so.6;  libm.so.6;
gnome-vfs       :  libgnomevfs-2.so.0;
gtk2            :  libgdk-x11-2.0.so.0;  libgdk_pixbuf-2.0.so.0;  libgtk-x11-2.0.so.0;
libbonobo       :  libbonobo-2.so.0;  libbonobo-activation.so.4;
libgcc          :  libgcc_s.so.1;
libiconv        :  libiconv.so.2;
libpng          :  libpng12.so.0;
libstdcxx       :  libstdc++.so.6;
libxml2         :  libxml2.so.2;
libxslt         :  libxslt.so.1;
libz            :  libz.so.1;
orbit2          :  libORBit-2.so.0;
pango           :  libpango-1.0.so.0;  libpangoft2-1.0.so.0;  libpangox-1.0.so.0;  libpangoxft-1.0.so.0;
popt            :  libpopt.so.0;
xfree           :  libXrender.so.1;  libXft.so.2;

THE FOLLOWING LIBRARIES HAVE UNMET DEPENDANCIES
libgtkmm-2.4.so.1
libgdkmm-2.4.so.1
libatkmm-1.6.so.1
libpangomm-1.4.so.1
libglibmm-2.4.so.1
libsigc-2.0.so.0
libgc.so.1


Dependancies:  atk fontconfig freetype gconf glib2 glibc gnome-vfs gtk2 libbonobo libgcc libiconv libpng libstdcxx libxml2 libxslt libz orbit2 pango popt xfree

[Those unmet dependancies, are, of course, in my feed.]

Good luck!
Sharp Zaurus SL-C1000 -- 2 GB SD Card -- Zippy Slim Mini Keyboard -- Loving pdaXii13!

rgrep

  • Full Member
  • ***
  • Posts: 149
    • View Profile
Automatically Determining Dependancies
« Reply #8 on: March 25, 2006, 11:02:45 pm »
I didn't notice that Armagon had already solved this but I whipped up a quick shell script to list the dependencies for any given binary.

The script was originally a one-liner so it's a tad ugly and crude but it works.  It uses ldd to find the list of required libraries so I'm not sure how this compares to objdump.  It also requires the /usr/lib/ipkg/info/* files so will need to be run on your Zaurus or this could be changed to read a feed file list.

The list of dependencies is pruned to be as compact as possible by removing any packages that are already covered by others.  For example if your binary uses Zlib and SDL then only "sdl" will be listed as SDL depends on xfree and xfree depends on libz.  I have also hardcoded it to remove glibc and libgcc from the depends list as they are provided with the base install of pdaXrom.

Code: [Select]
#!/bin/sh

BINARY=$1

if [ -z "$BINARY" ]; then
    echo "Usage: $(basename $0) [package to ignore...]"
    exit 1
fi

shift

IGNORE="glibc libgcc $*"

PKGS=$(for file in $(for lib in $(ldd $BINARY | awk '{ print($3) }'); do grep -l "^${lib}$" /usr/lib/ipkg/info/*; done | sort | uniq); do basename $file | sed 's/.list$//'; done)

IGNORE="$IGNORE $(for pkg in $(echo $PKGS | tr ' ' '\n'); do ipkg info $pkg Depends | cut -f2- -d\ | grep -v ^Depends | sed 's/, /\n/g' | sort | uniq; done)"

DEPENDS=$(echo $PKGS | tr ' ' '\n' | grep -v $(for pkg in $(echo $IGNORE | tr ' ' '\n'); do echo "-e $pkg "; done))

echo $DEPENDS | sed 's/ /, /g'
[img]https://www.oesf.org/forums/style_emoticons/default/smile.gif\" border=\"0\" class=\"linked-sig-image\" /] Has: Dynamism C760 / Linksys WCF12 WiFi / Kingston 512MB SD
[img]https://www.oesf.org/forums/style_emoticons/default/biggrin.gif\" border=\"0\" class=\"linked-sig-image\" /] Loves: pdaXrom / Warwalking
[img]https://www.oesf.org/forums/style_emoticons/default/sad.gif\" border=\"0\" class=\"linked-sig-image\" /] Hates: NetGear MA701 WiFi / SanDisk 256MB SD / C760 Charging Faults

Armagon

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • http://
Automatically Determining Dependancies
« Reply #9 on: March 26, 2006, 12:13:29 am »
Quote
I didn't notice that Armagon had already solved this but I whipped up a quick shell script to list the dependencies for any given binary.

Awesome!  Thank you, rgrep.

How did people figure out the dependencies before this?

Armagon
Sharp Zaurus SL-C1000 -- 2 GB SD Card -- Zippy Slim Mini Keyboard -- Loving pdaXii13!

rgrep

  • Full Member
  • ***
  • Posts: 149
    • View Profile
Automatically Determining Dependancies
« Reply #10 on: March 26, 2006, 02:42:43 am »
A lot of people don't list dependencies at all or only list the ones they can think of.  I used to do it manually using ldd and "ipkg search <lib.so>".  I don't know if the pdaXrom builder scripts do anything clever to calculate the dependencies or if they are entered manually in the ipkg control file.  It's common practise (in Debian, BitBake, etc) to calculate them dynamically when the package is built.
[img]https://www.oesf.org/forums/style_emoticons/default/smile.gif\" border=\"0\" class=\"linked-sig-image\" /] Has: Dynamism C760 / Linksys WCF12 WiFi / Kingston 512MB SD
[img]https://www.oesf.org/forums/style_emoticons/default/biggrin.gif\" border=\"0\" class=\"linked-sig-image\" /] Loves: pdaXrom / Warwalking
[img]https://www.oesf.org/forums/style_emoticons/default/sad.gif\" border=\"0\" class=\"linked-sig-image\" /] Hates: NetGear MA701 WiFi / SanDisk 256MB SD / C760 Charging Faults