Problems in generating OSX installer

Hello, I can’t generate OSX installer. To show the problem I use a minimal example. I have this file main.py:

import direct.directbase.DirectStart
run()

If I pack it (with packp3d -o minimal.p3d) and I run it (with panda3d minimal.p3d) I have no problems.

I can create OSX executable (with pdeploy -P osx_i386 minimal.p3d standalone) and it works without problems.

The problem is when I try to generate the installer. I submit the following command:

pdeploy -v 0.1 -P osx_i386 minimal.p3d installer

but I receive errors on my tries. On Windows Seven I obtain:

:Installer: Creating ./osx_i386/minimal.app...
:PackageInfo: p3dembed downloading http://runtime.panda3d.org/p3dembed/osx_i386/p3dembed.osx_i386.xml
:Standalone: Creating ./osx_i386/minimal.app/Contents/MacOS/minimal...
:Installer: Creating ./osx_i386/minimal 0.1.pkg...
Traceback (most recent call last):
  File "C:\panda3d-1.7.0\built_cmu\direct\showbase\Messenger.py", line 352, in __taskChainDispatch
  File "C:\panda3d-1.7.0\built_cmu\direct\showbase\Messenger.py", line 410, in __dispatch
  File "C:\panda3d-1.7.0\built_cmu\direct\p3d\AppRunner.py", line 493, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/pdeploy.py", line 251, in <module>
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 260, in build
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 528, in buildPKG
  File "C:\Python26\Lib\zipfile.py", line 1025, in write
    zinfo.header_offset = self.fp.tell()    # Start of header bytes
  File "C:\panda3d-1.7.0\built_cmu\direct\stdpy\file.py", line 218, in tell
ValueError
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "C:\panda3d-1.7.0\built_cmu\direct\p3d\AppRunner.py", line 411, in run
  File "C:\panda3d-1.7.0\built_cmu\direct\task\Task.py", line 496, in run
  File "C:\panda3d-1.7.0\built_cmu\direct\task\Task.py", line 454, in step
  File "C:\panda3d-1.7.0\built_cmu\direct\showbase\Messenger.py", line 352, in __taskChainDispatch
  File "C:\panda3d-1.7.0\built_cmu\direct\showbase\Messenger.py", line 410, in __dispatch
  File "C:\panda3d-1.7.0\built_cmu\direct\p3d\AppRunner.py", line 493, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/pdeploy.py", line 251, in <module>
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 260, in build
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 528, in buildPKG
  File "C:\Python26\Lib\zipfile.py", line 1025, in write
    zinfo.header_offset = self.fp.tell()    # Start of header bytes
  File "C:\panda3d-1.7.0\built_cmu\direct\stdpy\file.py", line 218, in tell
ValueError
Failure on startup.

On OSX I obtain:

:Installer: Creating ./osx_i386/minimal.app...
:PackageInfo: p3dembed downloading http://runtime.panda3d.org/p3dembed/osx_i386/p3dembed.osx_i386.xml
:Standalone: Creating ./osx_i386/minimal.app/Contents/MacOS/minimal...
:Installer: Creating ./osx_i386/minimal 0.1.pkg...
Traceback (most recent call last):
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 352, in __taskChainDispatch
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 410, in __dispatch
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 493, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/pdeploy.py", line 251, in <module>
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 260, in build
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 515, in buildPKG
  File "/Users/rdb/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py", line 1979, in add
  File "/Users/rdb/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py", line 1998, in addfile
  File "/Users/rdb/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py", line 996, in tobuf
  File "/Users/rdb/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py", line 1045, in create_pax_header
LookupError: no codec search functions registered: can't find encoding
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 411, in run
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/task/Task.py", line 496, in run
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/task/Task.py", line 454, in step
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 352, in __taskChainDispatch
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 410, in __dispatch
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 493, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/pdeploy.py", line 251, in <module>
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 260, in build
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 515, in buildPKG
  File "/Users/rdb/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py", line 1979, in add
  File "/Users/rdb/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py", line 1998, in addfile
  File "/Users/rdb/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py", line 996, in tobuf
  File "/Users/rdb/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/tarfile.py", line 1045, in create_pax_header
LookupError: no codec search functions registered: can't find encoding
Successfully joined thread: 0
Failure on startup.

I tried also on Linux (Ubuntu) but I obtain the same error as the OSX one.

Where am I wrong? Thanks!

Excuse me if the following question is too trivial, but I’m a newbie. I’m again on this problem, I searched a lot on internet and I want to do some experiments, but I haven’t never modified the Panda’s files.

Looking at the output posted on previous message, I see that I should modify files involved in the Traceback e.g.

File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py", line 515, in buildPKG

but the file /Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/DeploymentTools.py isn’t on my machine (maybe is in a multifile?). If I want to modify this kind of files I need to rebuild Panda or I can modify only these files? And, in the second case, where are these files (I located DeploymentTools.py but modifying it doesn’t affect the output)?

Thanks!

That file is compiled into pdeploy.p3d. When a Python file is compiled, it (unfortunately) stores the original location of the file (where it was at the time when it was compiled), for tracebacks. So, what you’re seeing there is the path of that file where it was when I packed it into a .p3d file (hence the ‘rdb’ :wink:)

If you want to make modifications to direct/p3d/DeploymentTools.py and test them, you should either rebuild the .p3d file or run direct/p3d/pdeploy.py directly.

Thanks, this solved my problem! Running directly pdeploy.py doesn’t generate the error!

After, I had another problem (I write here in the case others will have my same problem): installing the package on my Snow Leopard machine, during the installation I received this error: “The following install step failed: run postflight script for minimal”.

This is an excerpt from /var/log/install.log:

Installer[249]: run postflight script for minimal
runner[254]: postflight[262]: chmod: /Applications/minimal.app/hosts/: No such file or directory

So, on my machine I patched the file DeploymentTools.py as follows:

--- DeploymentTools.py	2010-04-28 11:23:44.647258210 +0200
+++ DeploymentToolsNew.py	2010-04-28 11:17:05.073762000 +0200
@@ -402,6 +402,8 @@
         print >>plist, '</plist>'
         plist.close()
 
+        Filename(output, "hosts/").makeDir()
+        
         return output
 
     def buildPKG(self, output, platform):

After this modification, I obtain a package that works without errors. But I don’t know if this is a correct method!

I have an idea what may be causing pdeploy to raise that errors when packaged as .p3d - just checked in a fix for that.

Also, I’ve checked in your other change.

Thanks very much for your help!

Thanks to you!

I would help testing your modification, but I’ve downloaded the daily build, and in panda3d_2010.04.29~karmic53_i386.deb/data.tar.gz/usr/bin/ I don’t found pdeploy… Where is it? On my production machine, I installed Panda from 1.7.0 distribution, and if I submit whereis pdeploy I receive pdeploy: /usr/bin/pdeploy. I searched in a bad way?

The .p3d tools aren’t shipped in the daily builds - due to design restrictions, they are only built at every official release. You can run pdeploy.py directly, though.

Ok, very thanks!