From 8c3bcd27f07fc69fb84cf5a385477294fb6cc14b Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Thu, 21 Dec 2023 10:20:47 +0100 Subject: [PATCH 1/4] 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. --- .../next/macOS/2023-12-21-10-20-41.gh-issue-65701.Q2hNbN.rst | 2 ++ Tools/freeze/README | 5 +++++ Tools/freeze/freeze.py | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 Misc/NEWS.d/next/macOS/2023-12-21-10-20-41.gh-issue-65701.Q2hNbN.rst 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 index 00000000000000..b489d235c3ca6d --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2023-12-21-10-20-41.gh-issue-65701.Q2hNbN.rst @@ -0,0 +1,2 @@ +The freeze tool doesn't work with framework builds of Python. Document this +and bail out early when running the tool with such a build. diff --git a/Tools/freeze/README b/Tools/freeze/README index 9b3ea1f2c723b1..516077bc7daa89 100644 --- a/Tools/freeze/README +++ b/Tools/freeze/README @@ -218,6 +218,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 ----- diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py index bc5e43f4853deb..de9772732cdb5d 100755 --- a/Tools/freeze/freeze.py +++ b/Tools/freeze/freeze.py @@ -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 From 36705b54b5224382d59a05a02bce57dc1e5ea1ab Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Thu, 21 Dec 2023 10:47:07 +0100 Subject: [PATCH 2/4] Update Misc/NEWS.d/next/macOS/2023-12-21-10-20-41.gh-issue-65701.Q2hNbN.rst Co-authored-by: Erlend E. Aasland --- .../next/macOS/2023-12-21-10-20-41.gh-issue-65701.Q2hNbN.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index b489d235c3ca6d..870b84a4d1af80 100644 --- 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 @@ -1,2 +1,2 @@ -The freeze tool doesn't work with framework builds of Python. Document this -and bail out early when running the tool with such a build. +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. From 68327f3bad95b176730b67bb5f1d610e1df43879 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Thu, 21 Dec 2023 10:47:14 +0100 Subject: [PATCH 3/4] Update Tools/freeze/README Co-authored-by: Erlend E. Aasland --- Tools/freeze/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/freeze/README b/Tools/freeze/README index 516077bc7daa89..9665484c2b35e4 100644 --- a/Tools/freeze/README +++ b/Tools/freeze/README @@ -221,7 +221,7 @@ 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. +On macOS the :program:`freeze` tool is not supported for framework builds. Usage ----- From 8af3a4d058947ce76f22175db26166ce49b077d8 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Thu, 21 Dec 2023 11:06:33 +0100 Subject: [PATCH 4/4] This isn't a rest file... --- Tools/freeze/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/freeze/README b/Tools/freeze/README index 9665484c2b35e4..516077bc7daa89 100644 --- a/Tools/freeze/README +++ b/Tools/freeze/README @@ -221,7 +221,7 @@ window, by specifying the option '-s windows'. See the Usage below. Usage under macOS ----------------- -On macOS the :program:`freeze` tool is not supported for framework builds. +On macOS the freeze tool is not supported for framework builds. Usage -----