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
Breakes with -OO flag in script #6345
Comments
This looks like a bug way down the dependency chain. Can you try this minimal example? # test.py
import pycparser
pycparser.CParser() Run it in optimized mode:
I expect that you get the same error but shorter? |
@bwoodsend , it gives the same result. Btw -O flag is obviously working. |
OK, in that case I suggest you report that that code snippet fails to eliben/pycparser. For what it's worth, using |
Thanks for hint. So waiting for pyCParser resolve this issue. |
@bwoodsend , according to pyCParser |
Sounds like downgrading to |
I suppose if we really did want to keep it we could replace compiling via |
Or another ugly option I suppose would be to add |
You mean somewhere in the docs, there's a section that encourages people to use |
Maybe we could also detect |
Yeah it's here.
I think if we were to do that I'd prefer the logic to be if importing win32ctypes fails and |
That sounds reasonable, too. |
Running with -OO no longer works on Windows, makes such an insignificant difference to the overall output size and as generally agreed to be more trouble than it's worth.
No objections. Apologies for not responding sooner. |
* Windows: Catch/re-raise failure to load win32ctypes under -OO. PyInstaller can no longer run under Python's optimised mode due to the dependency chain PyInstaller -> win32ctypes -> cffi -> pycparser which has started using/ Yacc which interprets grammars from docstrings. * Docs: Remove running with optimisations section (#6345). Running with -OO no longer works on Windows, makes such an insignificant difference to the overall output size and as generally agreed to be more trouble than it's worth. * Linux: Explicitly check that binutils tools are available. This should catch issues like: #6358 (comment) * Abort build if any obsolete stdlib backports are installed. Most prominently, check for `enum34` - the backport of `enum` - which masks the stdlib variant causing issues like #5728. Co-authored-by: Jasper Harrison <legorooj@protonmail.com>
* Windows: Catch/re-raise failure to load win32ctypes under -OO. PyInstaller can no longer run under Python's optimised mode due to the dependency chain PyInstaller -> win32ctypes -> cffi -> pycparser which has started using/ Yacc which interprets grammars from docstrings. * Docs: Remove running with optimisations section (#6345). Running with -OO no longer works on Windows, makes such an insignificant difference to the overall output size and as generally agreed to be more trouble than it's worth. * Linux: Explicitly check that binutils tools are available. This should catch issues like: #6358 (comment) * Abort build if any obsolete stdlib backports are installed. Most prominently, check for `enum34` - the backport of `enum` - which masks the stdlib variant causing issues like #5728. Co-authored-by: Jasper Harrison <legorooj@protonmail.com>
…t sure why it didn't cause problems before tbh)
1) PyInstaller no longer lets you use -OO for built apps. Which is a shame, because -OO did significantly improve performance on some systems. In any case, the optimization level's been reduced to -O, which is hopefully still good enough for everyone. See pyinstaller/pyinstaller#6345 2) It seems the PyInstaller initialization code itself now uses the threading module, so excluding it is no longer safe even if the target application doesn't use that module. So I removed that option.
Hey guys just to add to this issue. Some programs make sense to run with any This is why this cffi + pycparser issue is so frustrating. Apart from downgrading pycparser, is there a more general way to have 1 dependency be unoptimized and the rest optimized with pyinstaller? |
Description of the issue
Running pyinstaller (python 3.10) with double optimization raises error: yacc: Can not build parser.
Context information (for bug reports)
pyinstaller --version
:(paste here)
A minimal example program which shows the error
Stacktrace / full error message
The text was updated successfully, but these errors were encountered: