Skip to content

Commit ddf8829

Browse files
committed
windows: copy cached dart_bridge DLLs to stable name in build tree
Windows jobs in run 27356505799 hit `Failed to load dynamic library 'dart_bridge_d.dll': The specified module could not be found (error code 126)` — same shape as the Linux issue I caught while writing the cache patch. Flutter's bundled_libraries machinery preserves filenames as-is, so pointing bundled_libraries at the arch-suffixed cache file (`dart_bridge-windows-x86_64.dll`) lands it in the .app under that name. The Dart side opens by the unsuffixed `dart_bridge[_d].dll`, so the loader can't find it. Mirror the Linux fix: download into cache under the upstream filename, then `configure_file(... COPYONLY)` to a stable `dart_bridge.dll` / `dart_bridge_d.dll` in CMAKE_BINARY_DIR/dart_bridge/, and have bundled_libraries reference the build-tree names. iOS 3.14 timed out in the same run with 1h35m of silence after Xcode build (iOS 3.12 + 3.13 both passed) — simulator flake, unrelated.
1 parent 6a87c5e commit ddf8829

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

src/serious_python_windows/windows/CMakeLists.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,28 @@ endif()
8282
# (_d.dll) is what `fvm flutter run` / Debug builds consume. Both ship in
8383
# every release of flet-dev/dart-bridge; we bundle both and let Flutter's
8484
# CONFIG-aware copy machinery pick the right one at app launch time.
85-
set(DART_BRIDGE_RELEASE_DLL "${DB_CACHE}/dart_bridge-windows-x86_64.dll")
86-
set(DART_BRIDGE_DEBUG_DLL "${DB_CACHE}/dart_bridge_d-windows-x86_64.dll")
85+
#
86+
# Cached under the upstream arch-qualified filenames so multiple flet-dev/
87+
# dart-bridge versions can coexist in $FLET_CACHE_DIR. Copied to stable
88+
# unqualified names in the build tree because Flutter's bundled_libraries
89+
# machinery preserves filenames as-is, and the Dart side opens the DLL by
90+
# `dart_bridge[_d].dll` (no arch suffix).
91+
set(DART_BRIDGE_RELEASE_CACHED "${DB_CACHE}/dart_bridge-windows-x86_64.dll")
92+
set(DART_BRIDGE_DEBUG_CACHED "${DB_CACHE}/dart_bridge_d-windows-x86_64.dll")
8793

8894
_sp_download(
8995
"https://github.com/flet-dev/dart-bridge/releases/download/v${DART_BRIDGE_VERSION}/dart_bridge-windows-x86_64.dll"
90-
"${DART_BRIDGE_RELEASE_DLL}")
96+
"${DART_BRIDGE_RELEASE_CACHED}")
9197
_sp_download(
9298
"https://github.com/flet-dev/dart-bridge/releases/download/v${DART_BRIDGE_VERSION}/dart_bridge_d-windows-x86_64.dll"
93-
"${DART_BRIDGE_DEBUG_DLL}")
99+
"${DART_BRIDGE_DEBUG_CACHED}")
100+
101+
set(DART_BRIDGE_DIR "${CMAKE_BINARY_DIR}/dart_bridge")
102+
set(DART_BRIDGE_RELEASE_DLL "${DART_BRIDGE_DIR}/dart_bridge.dll")
103+
set(DART_BRIDGE_DEBUG_DLL "${DART_BRIDGE_DIR}/dart_bridge_d.dll")
104+
file(MAKE_DIRECTORY "${DART_BRIDGE_DIR}")
105+
configure_file("${DART_BRIDGE_RELEASE_CACHED}" "${DART_BRIDGE_RELEASE_DLL}" COPYONLY)
106+
configure_file("${DART_BRIDGE_DEBUG_CACHED}" "${DART_BRIDGE_DEBUG_DLL}" COPYONLY)
94107

95108
# Any new source files that you add to the plugin should be added here.
96109
list(APPEND PLUGIN_SOURCES

0 commit comments

Comments
 (0)