From 552efd250e32634491c3137910da6f29bbcc0832 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 6 Jul 2026 07:41:18 -0700 Subject: [PATCH 1/2] fix(windows): resolve CRT DLLs via Sysnative to survive WOW64 redirection Flutter may drive the CMake install step with the 32-bit cmake.exe bundled in VS Build Tools. Under WOW64 file-system redirection that process sees C:\Windows\System32 rewritten to SysWOW64, which holds x86 CRT DLLs and has no vcruntime140_1.dll, so the x64 build copies wrong-arch DLLs and then fails with "file INSTALL cannot find vcruntime140_1.dll". Prefer the Sysnative pseudo-folder (visible only to 32-bit processes, maps to the real 64-bit System32) when present, falling back to System32 for native 64-bit cmake. Fixes flet-dev/flet#6436 --- .../windows/CMakeLists.txt | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/serious_python_windows/windows/CMakeLists.txt b/src/serious_python_windows/windows/CMakeLists.txt index 573388c6..7ff9319f 100644 --- a/src/serious_python_windows/windows/CMakeLists.txt +++ b/src/serious_python_windows/windows/CMakeLists.txt @@ -190,13 +190,31 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) # This list could contain prebuilt libraries, or libraries created by an # external build triggered from this build file. string(REPLACE "\\" "/" SERIOUS_PYTHON_WINDIR "$ENV{WINDIR}") + +# CRT runtime DLLs (msvcp140 / vcruntime140 / vcruntime140_1) are harvested from +# the OS's 64-bit System32. Flutter may drive the CMake install step with the +# 32-bit cmake.exe bundled in VS Build Tools (users without full Visual Studio). +# Under WOW64 file-system redirection a 32-bit process sees C:\Windows\System32 +# transparently rewritten to SysWOW64, which holds the x86 CRT and doesn't +# contain vcruntime140_1.dll at all — so the x64 build copies wrong-arch DLLs and +# then fails with "cannot find vcruntime140_1.dll" (flet-dev/flet#6436). +# "Sysnative" is the documented pseudo-folder that maps a 32-bit process back to +# the real 64-bit System32; it's visible only to 32-bit processes, so a native +# 64-bit cmake has no Sysnative and keeps using System32. Configure- and +# install-time cmake are the same binary under Flutter, so the path resolved here +# stays valid when cmake_install.cmake later runs. +set(_sp_crt_dir "${SERIOUS_PYTHON_WINDIR}/System32") +if(EXISTS "${SERIOUS_PYTHON_WINDIR}/Sysnative") + set(_sp_crt_dir "${SERIOUS_PYTHON_WINDIR}/Sysnative") +endif() + set(serious_python_windows_bundled_libraries "${PYTHON_PACKAGE}/python${PYTHON_VERSION_NODOT}$<$:_d>.dll" "${PYTHON_PACKAGE}/python3$<$:_d>.dll" "$,${DART_BRIDGE_DEBUG_DLL},${DART_BRIDGE_RELEASE_DLL}>" - "${SERIOUS_PYTHON_WINDIR}/System32/msvcp140.dll" - "${SERIOUS_PYTHON_WINDIR}/System32/vcruntime140.dll" - "${SERIOUS_PYTHON_WINDIR}/System32/vcruntime140_1.dll" + "${_sp_crt_dir}/msvcp140.dll" + "${_sp_crt_dir}/vcruntime140.dll" + "${_sp_crt_dir}/vcruntime140_1.dll" PARENT_SCOPE ) From a9c0c62d24b89dee3ccc0bd6c25bb025f1074726 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Mon, 6 Jul 2026 09:45:00 -0700 Subject: [PATCH 2/2] Bump to 4.2.2: Windows CRT WOW64/Sysnative fix Bump all serious_python_* packages to 4.2.2. The substantive change is the Windows CRT DLL harvesting fix (Sysnative fallback) for flet-dev/flet#6436; other platforms are alignment-only bumps. --- src/serious_python/CHANGELOG.md | 4 ++++ src/serious_python/pubspec.yaml | 2 +- src/serious_python_android/CHANGELOG.md | 4 ++++ src/serious_python_android/android/build.gradle.kts | 2 +- src/serious_python_android/pubspec.yaml | 2 +- src/serious_python_darwin/CHANGELOG.md | 4 ++++ .../darwin/serious_python_darwin.podspec | 2 +- src/serious_python_darwin/pubspec.yaml | 2 +- src/serious_python_linux/CHANGELOG.md | 4 ++++ src/serious_python_linux/pubspec.yaml | 2 +- src/serious_python_platform_interface/CHANGELOG.md | 4 ++++ src/serious_python_platform_interface/pubspec.yaml | 2 +- src/serious_python_windows/CHANGELOG.md | 4 ++++ src/serious_python_windows/pubspec.yaml | 2 +- 14 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/serious_python/CHANGELOG.md b/src/serious_python/CHANGELOG.md index dfa7f545..7eec667f 100644 --- a/src/serious_python/CHANGELOG.md +++ b/src/serious_python/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.2.2 + +* **Windows:** fix `flet build windows` failing with `file INSTALL cannot find "C:/WINDOWS/System32/vcruntime140_1.dll"` for users who build with VS Build Tools rather than full Visual Studio (a WOW64 file-system-redirection issue with the bundled 32-bit cmake). See `serious_python_windows` 4.2.2. + ## 4.2.1 * **iOS/macOS:** ctypes packages that ship plain `.dylib` shared libraries (e.g. `llama-cpp-python`'s `libllama` / `libggml`) now load on the **iOS simulator**. Such `.dylib`s are now packaged as per-slice xcframeworks (previously only `.so` C-extensions were), so they carry a simulator slice instead of shipping the device build and failing `dlopen` with `incompatible platform (have 'iOS', need 'iOS-simulator')`; their install-name is preserved so multi-lib packages still resolve their sibling libs. See `serious_python_darwin` 4.2.1. diff --git a/src/serious_python/pubspec.yaml b/src/serious_python/pubspec.yaml index 97d1a686..eea615ca 100644 --- a/src/serious_python/pubspec.yaml +++ b/src/serious_python/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python description: A cross-platform plugin for adding embedded Python runtime to your Flutter apps. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.2.1 +version: 4.2.2 platforms: ios: diff --git a/src/serious_python_android/CHANGELOG.md b/src/serious_python_android/CHANGELOG.md index 369c0781..37966409 100644 --- a/src/serious_python_android/CHANGELOG.md +++ b/src/serious_python_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.2.2 + +* Version bump aligning with the `serious_python_*` 4.2.2 release. + ## 4.2.1 * Bump the bundled python-build snapshot to `20260701`; aligns with the `serious_python_*` 4.2.1 release. The Android runtimes are byte-identical to `20260630` (the release only rebuilds the iOS runtime). diff --git a/src/serious_python_android/android/build.gradle.kts b/src/serious_python_android/android/build.gradle.kts index 68d5c8a4..129038d0 100644 --- a/src/serious_python_android/android/build.gradle.kts +++ b/src/serious_python_android/android/build.gradle.kts @@ -21,7 +21,7 @@ buildscript { } group = "com.flet.serious_python_android" -version = "4.2.1" +version = "4.2.2" rootProject.allprojects { repositories { diff --git a/src/serious_python_android/pubspec.yaml b/src/serious_python_android/pubspec.yaml index 04edf59e..dffd9415 100644 --- a/src/serious_python_android/pubspec.yaml +++ b/src/serious_python_android/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_android description: Android implementation of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.2.1 +version: 4.2.2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_darwin/CHANGELOG.md b/src/serious_python_darwin/CHANGELOG.md index 27a509b2..c6970401 100644 --- a/src/serious_python_darwin/CHANGELOG.md +++ b/src/serious_python_darwin/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.2.2 + +* Version bump aligning with the `serious_python_*` 4.2.2 release. + ## 4.2.1 * Framework-ize ctypes `.dylib` shared libs (not just `.so` C-extensions) when syncing iOS site-packages, so `.dylib`-shipping packages (e.g. `llama-cpp-python`) load on the **iOS simulator** instead of failing `dlopen` with `incompatible platform (have 'iOS', need 'iOS-simulator')`. Each `.dylib` becomes a device+simulator xcframework + `.fwork` pointer, exactly like `.so`; unlike `.so` (whose id is rewritten to the framework path), the `.dylib` install-name is preserved so multi-lib packages resolve their sibling libs. The `.so` path is unchanged. diff --git a/src/serious_python_darwin/darwin/serious_python_darwin.podspec b/src/serious_python_darwin/darwin/serious_python_darwin.podspec index 83e93967..69249969 100644 --- a/src/serious_python_darwin/darwin/serious_python_darwin.podspec +++ b/src/serious_python_darwin/darwin/serious_python_darwin.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'serious_python_darwin' - s.version = '4.2.1' + s.version = '4.2.2' s.summary = 'A cross-platform plugin for adding embedded Python runtime to your Flutter apps.' s.description = <<-DESC A cross-platform plugin for adding embedded Python runtime to your Flutter apps. diff --git a/src/serious_python_darwin/pubspec.yaml b/src/serious_python_darwin/pubspec.yaml index 9ef38137..40b6787f 100644 --- a/src/serious_python_darwin/pubspec.yaml +++ b/src/serious_python_darwin/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_darwin description: iOS and macOS implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.2.1 +version: 4.2.2 environment: # The Swift Package Manager build path needs Flutter 3.44 / Dart 3.11 (the diff --git a/src/serious_python_linux/CHANGELOG.md b/src/serious_python_linux/CHANGELOG.md index 9b232ba5..8232d70f 100644 --- a/src/serious_python_linux/CHANGELOG.md +++ b/src/serious_python_linux/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.2.2 + +* Version bump aligning with the `serious_python_*` 4.2.2 release. + ## 4.2.1 * Bump the bundled python-build snapshot to `20260701`; aligns with the `serious_python_*` 4.2.1 release. The Linux runtimes are byte-identical to `20260630` (the release only rebuilds the iOS runtime). diff --git a/src/serious_python_linux/pubspec.yaml b/src/serious_python_linux/pubspec.yaml index 526b5e34..0f2d39f2 100644 --- a/src/serious_python_linux/pubspec.yaml +++ b/src/serious_python_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_linux description: Linux implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.2.1 +version: 4.2.2 environment: sdk: '>=3.1.3 <4.0.0' diff --git a/src/serious_python_platform_interface/CHANGELOG.md b/src/serious_python_platform_interface/CHANGELOG.md index 0374f5fa..445d0657 100644 --- a/src/serious_python_platform_interface/CHANGELOG.md +++ b/src/serious_python_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.2.2 + +* Version bump aligning with the `serious_python_*` 4.2.2 release. + ## 4.2.1 * Version bump aligning with the `serious_python_*` 4.2.1 release. diff --git a/src/serious_python_platform_interface/pubspec.yaml b/src/serious_python_platform_interface/pubspec.yaml index ea303247..01fb06e9 100644 --- a/src/serious_python_platform_interface/pubspec.yaml +++ b/src/serious_python_platform_interface/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_platform_interface description: A common platform interface for the serious_python plugin. homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.2.1 +version: 4.2.2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/src/serious_python_windows/CHANGELOG.md b/src/serious_python_windows/CHANGELOG.md index efb47934..a34ad324 100644 --- a/src/serious_python_windows/CHANGELOG.md +++ b/src/serious_python_windows/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.2.2 + +* **Fix `flet build windows` failing with `file INSTALL cannot find "C:/WINDOWS/System32/vcruntime140_1.dll"`** for users who have VS Build Tools installed rather than full Visual Studio. The plugin harvests the CRT runtime DLLs (`msvcp140.dll` / `vcruntime140.dll` / `vcruntime140_1.dll`) from `%WINDIR%\System32`, but Flutter drives the CMake install step with the **32-bit** `cmake.exe` bundled in VS Build Tools. Under WOW64 file-system redirection that process sees `System32` transparently rewritten to `SysWOW64`, which holds the x86 CRT and doesn't contain `vcruntime140_1.dll` at all — so the x64 build copied wrong-arch DLLs and then failed. The CRT directory is now resolved via the `Sysnative` pseudo-folder (visible only to 32-bit processes, mapping back to the real 64-bit `System32`) when present, falling back to `System32` for native 64-bit cmake. See flet-dev/flet#6436. + ## 4.2.1 * Bump the bundled python-build snapshot to `20260701`; aligns with the `serious_python_*` 4.2.1 release. The Windows runtimes are byte-identical to `20260630` (the release only rebuilds the iOS runtime). diff --git a/src/serious_python_windows/pubspec.yaml b/src/serious_python_windows/pubspec.yaml index 03a0bf20..3daf6eb7 100644 --- a/src/serious_python_windows/pubspec.yaml +++ b/src/serious_python_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: serious_python_windows description: Windows implementations of the serious_python plugin homepage: https://flet.dev repository: https://github.com/flet-dev/serious-python -version: 4.2.1 +version: 4.2.2 environment: sdk: '>=3.1.3 <4.0.0'