New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Staticx fails to recognize a PyInstaller archive #71
Comments
Hi Ole, Staticx doesn't know a lot about PyInstaller archives. When building an archive, So I'm not sure why being a position-independent executable would cause You could confirm this by running You could also post a non-working executable from Gentoo and I can take a look. |
I am attaching a simple test case. It is a PyInstaller single file archive generated from
I can dump the contents using
Anyway, after running staticx on it, the resulting binary gives:
This is, since staticx fails to recognize "test" as a PyInstaller generated archive. For whatever reason... |
Hi Ole, I'm trying to play with the binary you provided, but it is crashing on this instruction:
So, I'm working just off of the information you've provided above. First, can you confirm that the application built with PyInstaller works without staticx? This error:
...is actually printed by the PyInstaller bootloader (in To debug this further, I think we need the debug output of the PyInstaller bootloader. Can you first build your PyInstaller application with
Hopefully this output will tell us why PyInstaller doesn't like the application that we dropped out. I'm adding a similar |
I am having the same issue. I have used the
When running the pyinstaller generated binary, it succeeds with:
Not really sure what else to try. |
Hi Jonathon, first of all, sorry for getting back to this VERY late. Luckily this is not an issue for me any more. I am compiling the pyinstaller loader using -no-pie and then everything works like a charm. Interestingly it also looks like the latest default on Gentoo (at least using gcc8) seems to be non-pie executables as well. Anyway, when I am using -pie in my compile of the pyinstaller loader, I am still able to reproduce the issue. Unfortunately the loader for --debug, which is
for me. is compiled as non-pie even when using -pie in CFLAGS. Don't know why. So, I am unsure how to help any further. As the issue can be perfectly worked around with using a non-pie loader of pyinstaller, I think a note in the docs could easily do it. @sbneto: You should check, if this also works for you. BTW: The 0.7.0 does not seem to have the --debug option yet. So there is no debug output for pyinstaller (as the loader is always no-pie) and no debug output for staticx as well with my installation. Sorry about that. I am anyway attaching a tarball just as a reference how I was using pyinstaller and staticx for testing. Thanks a lot for this great tool. Helped me out of some trouble! Cheers, Ole |
This is fixed in pyinstaller/pyinstaller#5511. You can close this. |
Great! Thanks for letting me know, @bwoodsend. |
Hi |
The fix hasn't been released yet. You'd need to install the development version of PyInstaller.
Then rebuild but add the |
Thank you for the pointer, will pull and do the build
I am new to python and pyinstaller , I am kind of curious to understand though why the previously working
python-3.7
pyinstaller-3.5
staticx-0.7.0
versions in the ldap are not working now. Is it anything to do with Active Directory environment?
Thanks,
…________________________________
From: Brénainn Woodsend ***@***.***>
Sent: Friday, April 2, 2021 5:17 PM
To: JonathonReinhart/staticx ***@***.***>
Cc: Subashree Suresh ***@***.***>; Comment ***@***.***>
Subject: [External] Re: [JonathonReinhart/staticx] Staticx fails to recognize a PyInstaller archive (#71)
The fix hasn't been released yet. You'd need to install the development version of PyInstaller.
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
Then rebuild but add the --clean option.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#71 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATQKAO3IHNNDERI7YNAP4Q3TGYX73ANCNFSM4GE3HLAA>.
|
@ssuresh-10 Given that the issue is caused by the particular PyInstaller build options, I don't see how Active Directory is involved. However, please read these caveats regarding NSS. |
Hi Jonathon,
finally I got PyInstaller working natively on Gentoo (amd64). But now staticx fails to recognize the single file binary as a PyInstaller archive. The reason apparently is, Gentoo creates the PyInstaller bootloader as
The cause for staticx failing is the "pie", position independent executable. If I force the PyInstaller bootloader to be compiled with "-no-pie" it works.
Does this make any sense to you? If staticx just requires the PyInstaller bootloader to be compiled/linked like this, I am fine with that. Just wanted to check back with you, as this may bother someone else as well.
Let me know, if you need any additional information.
Thanks, Ole
The text was updated successfully, but these errors were encountered: