]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-65701: document that freeze doesn't work with framework builds on macOS...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 22 Dec 2023 10:16:30 +0000 (11:16 +0100)
committerGitHub <noreply@github.com>
Fri, 22 Dec 2023 10:16:30 +0000 (11:16 +0100)
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 df1eec3dae3b1eddff819fd70f58b03b3fbd0eda)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Misc/NEWS.d/next/macOS/2023-12-21-10-20-41.gh-issue-65701.Q2hNbN.rst [new file with mode: 0644]
Tools/freeze/README
Tools/freeze/freeze.py

diff --git a/Misc/NEWS.d/next/macOS/2023-12-21-10-20-41.gh-issue-65701.Q2hNbN.rst b/Misc/NEWS.d/next/macOS/2023-12-21-10-20-41.gh-issue-65701.Q2hNbN.rst
new file mode 100644 (file)
index 0000000..870b84a
--- /dev/null
@@ -0,0 +1,2 @@
+The :program:`freeze` tool doesn't work with framework builds of Python.
+Document this and bail out early when running the tool with such a build.
index 098107c5d1a9d21a8b4c72dfd1dded9cfa761bcc..18815fa03fbe46aecb9563302d5ca1f5a776d624 100644 (file)
@@ -222,6 +222,11 @@ source tree).
 It is possible to create frozen programs that don't have a console
 window, by specifying the option '-s windows'. See the Usage below.
 
+Usage under macOS
+-----------------
+
+On macOS the freeze tool is not supported for framework builds.
+
 Usage
 -----
 
index bc5e43f4853deb6d2403a5369cc5ce1b0ed2a4d4..de9772732cdb5d410f43f9b08a524ea4540fb880 100755 (executable)
@@ -136,6 +136,11 @@ def main():
     makefile = 'Makefile'
     subsystem = 'console'
 
+    if sys.platform == "darwin" and sysconfig.get_config_var("PYTHONFRAMEWORK"):
+        print(f"{sys.argv[0]} cannot be used with framework builds of Python", file=sys.stderr)
+        sys.exit(1)
+
+
     # parse command line by first replacing any "-i" options with the
     # file contents.
     pos = 1