Skip to content

Bump to 6.1.1: Release Windows apps drop Python's debug modules again - #260

Merged
FeodorFitsner merged 1 commit into
mainfrom
fix/windows-release-strip-debug-pyds
Oct 28, 2026
Merged

FeodorFitsner merged 1 commit into
mainfrom
fix/windows-release-strip-debug-pyds

Conversation

@FeodorFitsner

Copy link
Copy Markdown
Contributor

Release Windows apps ship Python's debug modules next to the release ones (_ctypes.pyd and _ctypes_d.pyd, _ssl.pyd and _ssl_d.pyd, …). In a Flet app built with flet build windows that's 23 files, ~10 MB (about 10% of the unpacked app), and when the app is code-signed, as many extra signatures.

Cause

python-build's Windows package carries both Release and Debug builds of CPython, so Debug Flutter builds can load the debug runtime. Before 3.0.0, CopyPythonDLLs removed the debug files from Release builds:

COMMAND IF "$<$<CONFIG:Release>:release>" == "release" DEL ".../runner/Release/DLLs\*_d.*" /S /Q

The 3.0.0 rewrite (#209) replaced the cmd.exe DELs with cmake -E rm / rm_globs.cmake. The .ico, .cat, tcl86t.dll and tk86t.dll removals came across, but this Release-only one didn't; only its comment stayed.

Fix

CopyPythonDLLs removes DLLs/*_d.* again in every non-Debug build (Release and Profile), through the same rm_globs.cmake helper. Debug builds keep them ($<IF:$<CONFIG:Debug>,__none__,*_d.*>; __none__ matches nothing). The python3*_d.dll / dart_bridge_d.dll choice is unchanged: serious_python_windows_bundled_libraries already picks those per config.

Also:

  • Version bump to 6.1.1 across all packages (pubspecs, Android build.gradle.kts, the Darwin podspec, the example lockfiles), with changelog entries.
  • The comment above the Tk removal no longer claims to strip the debug modules.

Testing

Not built on Windows from this branch yet. Seen in a Release app built with 6.1.0 (flet build windows on a Flet Studio builder): DLLs/ held 23 *_d.* files, 9.9 MB uncompressed. After the release, the same build should list none.

The 3.0.0 rewrite of the CopyPythonDLLs step (cmd.exe DEL -> rm_globs.cmake)
lost the Release-only removal of DLLs\*_d.*, so every Release Windows app
shipped each extension module twice (_ctypes.pyd and _ctypes_d.pyd, ...):
23 files, ~10 MB, and as many extra signatures when the app is code-signed.
Release and Profile builds remove them again; Debug builds keep them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FeodorFitsner
FeodorFitsner merged commit 4415683 into main Oct 28, 2026
57 of 85 checks passed
@FeodorFitsner
FeodorFitsner deleted the fix/windows-release-strip-debug-pyds branch October 28, 2026 20:33
@FeodorFitsner
FeodorFitsner restored the fix/windows-release-strip-debug-pyds branch October 28, 2026 20:33
@FeodorFitsner
FeodorFitsner deleted the fix/windows-release-strip-debug-pyds branch October 28, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant