Skip to content

Commit 841cc61

Browse files
committed
Move bridge C sources to src/native_bridge/ (consolidation step 1, take 2)
First attempt (commit fb60a8c, reverted by c7d71b0) used filesystem symlinks in darwin/Classes/ pointing outside the pod's directory tree. CocoaPods 1.16 silently rejects source_files whose resolved path lies outside the pod's enclosing dir — pod install crashed at "Adding source files" with an unhelpful "undefined method `map' for nil" from the error-reporting fallback. Replace the symlink approach with committed real-file copies under serious_python_bridge/darwin/Classes/ that the podspec keeps in sync with src/native_bridge/ at pod-evaluation time via a small Ruby block: __native_bridge = File.expand_path('../../../native_bridge', __dir__) if File.directory?(__native_bridge) FileUtils.cp ... # refresh Classes/ from canonical source end Monorepo dev: each `pod install` refreshes Classes/ from the canonical src/native_bridge/. End users pulling the published pod from pub.dev have only the committed copies; the relative path doesn't exist for them, so the sync block is a no-op and CocoaPods sees real files inside the pod dir as expected. HEADER_SEARCH_PATHS updated to point at "${PODS_TARGET_SRCROOT}/Classes" rather than the previous "../native". Other platforms (linux/windows/android) use add_subdirectory("../../native_bridge") directly — CMake doesn't care about CocoaPods's directory boundary rule. CI workflow paths (ci.yml Android cross-build + test-bridge-build.yml Windows-Debug shim compile) and serious_python_bridge/python/setup.py's NATIVE_ROOT also rewritten to the new path.
1 parent c7d71b0 commit 841cc61

26 files changed

Lines changed: 5698 additions & 27 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,9 @@ jobs:
535535
$CC -shared -fPIC -fvisibility=hidden \
536536
-DPy_LIMITED_API=0x030c0000 \
537537
-I"$INCLUDE_DIR" \
538-
-I"src/serious_python_bridge/native" \
539-
src/serious_python_bridge/native/dart_bridge.c \
540-
src/serious_python_bridge/native/dart_api/dart_api_dl.c \
538+
-I"src/native_bridge" \
539+
src/native_bridge/dart_bridge.c \
540+
src/native_bridge/dart_api/dart_api_dl.c \
541541
"$LIBPYTHON" \
542542
-Wl,-z,max-page-size=16384 \
543543
-o "$OUT"

.github/workflows/test-bridge-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
$vcvars = "$vsPath\VC\Auxiliary\Build\vcvars64.bat"
6464
Write-Host "vcvars: $vcvars"
6565
66-
$shimSrc = (Resolve-Path 'src/serious_python_bridge/native/dart_bridge_shim.c').Path
66+
$shimSrc = (Resolve-Path 'src/native_bridge/dart_bridge_shim.c').Path
6767
$includeDir = (Resolve-Path "pywin-$pyver/include").Path
6868
$libDir = (Resolve-Path "pywin-$pyver/libs").Path
6969
$outDir = "$PWD\debug_build"
@@ -222,8 +222,8 @@ jobs:
222222
$CC -shared -fPIC -fvisibility=hidden \
223223
-DPy_LIMITED_API=0x030c0000 \
224224
-I"$INCLUDE_DIR" \
225-
-I"src/serious_python_bridge/native" \
226-
src/serious_python_bridge/native/dart_bridge_shim.c \
225+
-I"src/native_bridge" \
226+
src/native_bridge/dart_bridge_shim.c \
227227
"$LIBPYTHON" \
228228
-ldl \
229229
-Wl,-z,max-page-size=16384 \
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/serious_python_bridge/native/dart_api/internal/dart_api_dl_impl.h renamed to src/native_bridge/dart_api/internal/dart_api_dl_impl.h

File renamed without changes.

0 commit comments

Comments
 (0)