Compile python into single file executable packages
===Pyinstaller seems broken out of the box.===
First I had to run dos2unix on all the files to get the right new line chars.
Syntax error in /tmp/pyinstaller-1.3/optparse.py
(‘invalid syntax’, (‘/tmp/pyinstaller-1.3/optparse.py’, 6, 257, ‘”"”\r\noptparse — forward-compatibility wrapper for use with Python 2.2.x and\r\nearlier. If you import from \’optparse\’ rather than \’optik\’, your code\r\nwill work on base Python 2.3 (and later), or on earlier Pythons with\r\nOptik 1.4.1 or later installed.\r\n”"”\r\n’))
Traceback (most recent call last):
Then I had to find a patch to fix the kernel-rt problem with the linux-vdso.so.1 missing messages.
cannot find linux-vdso.so.1 in path
===Time to fix it…===
$ patch bindepend.py pyinstaller-x68_64.patch
I found I could run MakeSpec.py and Build.py to compile python scripts into executables after patching. Here’s what the patch does.
— pyinstaller-1.3/bindepend.py 2006-02-06 15:41:29.000000000 +0100
+++ pyinstaller-1.3.new/bindepend.py 2008-05-04 12:18:26.000000000 +0200
@@ -284,7 +284,7 @@
m = re.search(r”\s+(.*?)\s+=>\s+(.*?)\s+\(.*\)”, line)
name, lib = m.group(1), m.group(2)
- if name[:10] == ‘linux-gate’:
+ if name[:10] in (‘linux-gate’, ‘linux-vdso’):
It’s still not very portable.
I didn’t expect to be able to run my executable on a 32 bit machine, but I was suprised to find that I couldn’t run the executable created on Fedora 11 x86_64 on an older Fedora x86_64. That’s even worse than what I started with, because the same native python script runs on both machines. So i’m sort of back to square one. I don’t like pyinstaller and it seems there’s just no complete solution out there.