Hi Martin,

With the pyinstaller bootstrap code as currently written, I don't see a 
clean way of building the executable with append_pkg true while still 
keeping the app signable with codesign. The reason is that codesign expects 
the LINKEDIT segment to be at the end of the executable, but pyinstaller 
expects a magic number (MEI\014\013\012\013\016, specifically) to be at the 
end of the archive, which also forces it to be at the end of the file when 
append_pkg is true. 

Now, pyinstaller does include the ability to look backwards from the end of 
the executable a little ways in an effort to find the magic number (a 
feature that was apparently added to support digital signatures on 
Windows), so a relatively small change might add support for sticking the 
archive further back in the executable. One possibility would be sticking 
the archive in a TEXT segment of the executable (caveat: I haven't 
investigated that thoroughly), but then the pyinstaller build script would 
need to be able to intelligently reconstruct the executable with a valid 
MachO structure, all without disrupting the pointers in the "load commands" 
section of the file.

Another possibility (that I haven't looked into much) would be to build the 
pyinstaller bootloader for OS X 10.5 or earlier. Apple changed the MachO 
format for OS X 10.6, and I know that codesign treats executables built for 
the earlier MachO format differently than it does for the MachO format 
present in 10.6 and later.  Some quick Googling suggests that codesign 
*might* be able to sign those older MachO executables even with data 
present after the LINKEDIT segment, but there are some rumors that doing so 
could impact the developer's ability to distribute the app in Apple's MacOS 
store.

Jeff


On Tuesday, December 11, 2012 10:13:59 AM UTC-7, Martin Z wrote:
>
> Jeff Keacher píše v Po 10. 12. 2012 v 14:40 -0800: 
> > The problem appears to be that when append_pkg is True (the default, 
> > at least on pyinstaller 1.6), the archive is directly appended to the 
> > executable. Since codesign expects the LINKEDIT segment to be at the 
> > end of a MachO executable, codesign wasn't happy.  From looking at the 
> > pyinstaller source, it appeared that append_pkg should default to 
> > False for non-ELF executables, but that doesn't appear to be happening 
> > on OS X for some reason. 
>
> Hi Jeff, 
>
> having append_pkg False would break some other features (like --onefile) 
> of pyinstaller. 
>
> Do you have any idea how to append archive to the executable and still 
> having LINKEDIT segment at the end of executable? 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pyinstaller/-/lUS08D1-xjcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

Reply via email to