-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
freeze.py not working properly with OS X framework builds #65701
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
Comments
Command: Error: Basically the problem is on lines 235~239: config should be config-3.4m, python%s on two lines should be python%sm After I corrected these errors, the command works, asking me to run make, except a warning about "unknown modules remains". So I run make, another error occurs: I guess that 'Python.framework/Versions/3.4/Python' using a relative location might be a problem, so I go into the Makefile, changed PYTHONFRAMEWORKDIR=Python.framework Now the above problem disappeared, but a new appeared: Now it is out of my comprehension. What is wrong? How can I get freeze.py to work? I have a program doing very very heavy computation, so I really hope I can compile it into binary so that it could run much faster. Thanks. |
Sorry, I've finally gotten around to taking a longer look at this and it seems that freeze support is kind of a mess. First, it looks like some of the issues you ran into were fixed in 3.4.1 (changes associated with bpo-11824 and bpo-16047). Unfortunately, one of them introduced a new problem that I've documented in bpo-23405 (and which can be worked around by editing the freeze Makefile to use
shared build framework build This difference causes problems when linking the frozen executable: because the framework build configuration presents a dynamic shared lib, the resulting executable has a runtime dependency on the shared lib: % otool -L hello and the frozen executable cannot be run on another system which does not have a compatible version of Python installed. I don't know of an easy freeze build workaround for this. I think the correct solution for freeze is to always only provide the static library in the config* directory for all Python build configurations. But I'm not sure whether there are any compelling reasons to provide shared lib links as well for other users of the config* directory (e.g. for embedding Python); if so, the static and dynamic libs may have to have distinct names. Ronald, do you have other thoughts on this? At the moment, I think the safest solution for using freeze on OS X is to use a non-shared, non-framework build of Python, which probably means building Python 3.4 yourself. |
Is this still relevant? |
@ned-deily would be able to see if this is still relevant? |
I'll take a look. |
Sorry, but I have never used freeze. But given the description in the readme I'd expect that freeze is not really useful with a framework (or shared library!) build because you'll end up with dependencies to the framework/shared library. This is worse on macOS than on other unix-y platforms because the load command for shared libraries contains an absolute path to the library (that is, a frozen script won't rely on IMHO it is better to document that freeze is not compatible with framework builds, unless someone is willing to put in the work to fix issues (with test cases!) and document the limitations. |
+1 |
…ds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway.
The attached PR documents that framework builds aren't supported in the README file, and also bails out in freeze.py when it detects a framework build. I looked into adding a test, but ended up not doing this because the test machinery tries to do a separate install in a temporary directory and that's problematic with framework builds as well (alternate prefix doesn't work, and is not something we should try to support because it is incompatible with platform standards) |
…macOS (#113352) * gh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. Co-authored-by: Erlend E. Aasland <[email protected]>
…ds on macOS (pythonGH-113352) * pythongh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. (cherry picked from commit df1eec3) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
…ds on macOS (pythonGH-113352) * pythongh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. (cherry picked from commit df1eec3) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
…lds on macOS (GH-113352) (#113362) gh-65701: document that freeze doesn't work with framework builds on macOS (GH-113352) * gh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. (cherry picked from commit df1eec3) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
…lds on macOS (GH-113352) (#113361) gh-65701: document that freeze doesn't work with framework builds on macOS (GH-113352) * gh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. (cherry picked from commit df1eec3) Co-authored-by: Ronald Oussoren <[email protected]> Co-authored-by: Erlend E. Aasland <[email protected]>
…ds on macOS (python#113352) * pythongh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. Co-authored-by: Erlend E. Aasland <[email protected]>
…ds on macOS (python#113352) * pythongh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. Co-authored-by: Erlend E. Aasland <[email protected]>
…ds on macOS (python#113352) * pythongh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. Co-authored-by: Erlend E. Aasland <[email protected]>
…ds on macOS (python#113352) * pythongh-65701: document that freeze doesn't work with framework builds on macOS The framework install is inherently incompatible with freeze. Document that that freeze doesn't work with framework builds and bail out early when trying to run freeze anyway. Co-authored-by: Erlend E. Aasland <[email protected]>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: