libRocket broken if installed at runtime, using PackageInstaller

Bug #953847 reported by powerpup118
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
Fix Released
Medium
rdb

Bug Description

1) When rocket is required as a package, through "packp3d -r rocket" there is no issue and the error is non-existant, see python code below:

import direct.directbase.DirectStart
from panda3d.rocket import *
run()

Turn the above into a p3d file using: "packp3d -o myapp.p3d -r rocket"
No issue occurs, which is the correct behavior.

2) Rocket being installed at-runtime, using PackageInstaller (DWBPackageInstalller in this case) raises an error:
"ImportError: libboost_python.so.1.48.0: cannot open shared object file: No such file or directory"
See code below:

import direct.directbase.DirectStart
from direct.p3d.DWBPackageInstaller import DWBPackageInstaller

def onFinish(worked):
    print 'onFinish(%s)' % worked
    from panda3d.rocket import LoadFontFace

pi = DWBPackageInstaller(base.appRunner, parent = base.a2dTopRight, scale = 0.5, pos = (-0.6, 0, -0.1), finished = onFinish)
pi.addPackage('rocket', 'cmu_1.8')
pi.donePackages()
run()

As you can see, the above code will install the rocket package at runtime, and once done, attempt to load the rocket module (by simply importing LoadFontFace from the panda3d.rocket module)

Compile the above into a p3d simply with: "packp3d -o myapp.p3d"

for more information, see this thread: http://www.panda3d.org/forums/viewtopic.php?p=83245#83245

Revision history for this message
rdb (rdb) wrote :

Hmm, looking at the code in PackageInfo.py, it doesn't seem that the installation code actually puts the directory on the system's LD_LIBRARY_PATH. However, I'm not that familiar with this code, so I'd like David to comment on it before I make any changes - is adding the package directory to LD_LIBRARY_PATH (etc) supposed to be done elsewhere?

Revision history for this message
powerpup118 (powerpup118) wrote :

I've gone ahead and removed the libRocket libraries installed on my own system (to the best of my knowledge, from my /lib dir and my libRocket/Build dir), the error still occurs. So it would make sense that perhaps LD_LIBRARY_PATH is non set, or at least whichever code might supposed to be doing that, may be working improperly.

Another issue, which may be related to this same problem, is the audio package, also is unable to be installed at runtime.
No error occurs, however no audio can be played. (This may be likely due to some sort of initialization code or something of the sort, I'd imagine anyway)

You can try this snippet to see that (you'll need to have GUI_click.wav in the same directory so packp3d -o myapp.p3d correctly packages it):

import direct.directbase.DirectStart
from direct.p3d.DWBPackageInstaller import DWBPackageInstaller

def onFinish(worked):
 print 'onFinish(%s)' % worked
 sfx = loader.loadSfx('GUI_click.wav')
 sfx.setLoop(True)
 sfx.play()

pi = DWBPackageInstaller(base.appRunner, parent = base.a2dTopRight, scale = 0.5, pos = (-0.6, 0, -0.1), finished = onFinish)
pi.addPackage('audio', 'cmu_1.8')
pi.donePackages()
run()

Do note however, that the audio package really is a non-big deal for me, since I really have no legitimate reason at all, to install the audio package at runtime, I just figured it may lead to some sort of information to fix the core issue at hand, the rocket package being installed.

Appreciate your thoughts,
~powerpup118

Revision history for this message
David Rose (droklaunchpad) wrote :

Hmm, you're right; I think it should be adding the directory to LD_LIBRARY_PATH (and PATH, and DYLD_LIBRARY_PATH) in PackageInfo.installPackage().

I think the only reason I hadn't noticed that it was failing to do this is that in Toontown and PIrates, the only package we installed with C++ code was the Panda package; and panda3d.py (and pandac.py) will automatically add *this* directory to the path when loading it.

David

Revision history for this message
powerpup118 (powerpup118) wrote :

David or rdb,

Could either of you point me in the correct direction?
I (believe) I am fully up to the task of modifiying the PackageInfo.installPackage method to modify LD_LIBRARY_PATH, PATH, and DYLD_LIBRARY_PATH, and I will be able to test them on windows and linux (sadly I have no mac, someone else might be able to test that though)

In fact I thought this to be a rather easy task, however it proved me wrong quite quickly.
So my first thought was that if I modified the PackageInfo.py file under the 'direct' module, that I would be able to quickly edit and test the code. After that I built my p3d file again, ran it, and, well, the print statement I added into PackageInfo.installPackage never get's printed.

This is because (I believe) the entire direct/* tree is either compiled into or downloaded by the panda3d runtime, from runtime.panda3d.org, so I set out to build the panda3d runtime.

I used makepanda.py with the everything and runtime options, it gave me a working runtime, however it still fetches the direct/* tree from runtime.panda3d.org, which is of course, the code I'm trying to modify.

SO my questions:
How can I build the packages hosted on runtime.panda3d.org myself? And is the direct/* tree actually hosted there? Or where else does the runtime actually get those python modules?

Otherwise do you have any suggestion as to how I might go about fixing this bug? I realize both of you have much more relevant things to work on and fix, and that this bug is probably very low priority, so I'm only looking for a little guidance if you're able to help :)

Thank you,
~powerpup118

Revision history for this message
rdb (rdb) wrote :

Sorry, I'd forgotten about this bug. Checked in a fix.

Changed in panda3d:
assignee: nobody → rdb (rdb)
importance: Undecided → Medium
milestone: none → 1.8.1
status: New → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.