Skip to content

Commit 5137fd0

Browse files
committed
ci: pre-clone flet shallowly; surface package-command progress
Two changes to debug the Windows hang from run 27323701393 — Windows jobs sat for 40min without log output after "Extracting Python distributive". package_command.dart: explicitly log "Python distributive extracted to …" once tar finishes, and log the python.exe invocation that follows (previously gated behind --verbose). With these, a silent pip git clone won't look like a hang any more. ci.yml: each flet_ffi_* job now does an explicit `git clone --depth 1 --branch dart-bridge https://github.com/flet-dev/flet.git` into runner.temp and passes the local sdk/python/packages/flet path as --requirements. This bypasses pip's git source install path — pip's internal git clone has no progress output and on Windows is the most plausible source of the 40-minute black hole. Also temporarily gating off the macOS/iOS/Android/Linux FFI jobs so the next CI run focuses on Windows debugging only. Re-enable once Windows goes green.
1 parent d58f22f commit 5137fd0

2 files changed

Lines changed: 48 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ env:
2424
# older flet whose transitive deps (e.g. msgpack) have wheels for the
2525
# target python_version / platform, leaving the two halves mismatched.
2626
FLET_VERSION: "0.85.3"
27-
# Python flet for the FFI-transport example is pulled from a git ref —
28-
# FletDartBridgeServer isn't on PyPI yet. Source installs require
29-
# SERIOUS_PYTHON_ALLOW_SOURCE_DISTRIBUTIONS=flet on mobile targets to
30-
# bypass --only-binary :all:; see package_command.dart.
31-
FLET_FFI_REQUIREMENT: "flet @ git+https://github.com/flet-dev/flet.git@dart-bridge#subdirectory=sdk/python/packages/flet"
27+
# Python flet for the FFI-transport example is pinned to a git ref —
28+
# FletDartBridgeServer isn't on PyPI yet. The git URL is given to pip via
29+
# --requirements, which would normally clone the whole flet repo (large)
30+
# inside pip itself. On Windows this can take 30+ minutes and looks like
31+
# a hang because pip emits no progress during git clone. So the FFI jobs
32+
# first do an explicit `git clone --depth 1` into ${{ runner.temp }}/flet
33+
# and then pass the local subpath as the requirement.
34+
FLET_GIT_REF: "dart-bridge"
35+
FLET_GIT_URL: "https://github.com/flet-dev/flet.git"
36+
# Source installs additionally require SERIOUS_PYTHON_ALLOW_SOURCE_DISTRIBUTIONS=flet
37+
# on mobile targets to bypass --only-binary :all:; see package_command.dart.
3238

3339
jobs:
3440
macos:
@@ -266,6 +272,8 @@ jobs:
266272
flet_ffi_macos:
267273
name: Test Flet FFI example on macOS (Python ${{ matrix.python_version }})
268274
runs-on: macos-26
275+
# Temporarily gated off while we debug the Windows hang — re-enable after.
276+
if: false
269277
strategy:
270278
fail-fast: false
271279
matrix:
@@ -283,15 +291,20 @@ jobs:
283291
path: '.fvmrc'
284292
cache: true
285293

294+
- name: Shallow-clone flet (dart-bridge)
295+
run: |
296+
git clone --depth 1 --branch "${FLET_GIT_REF}" "${FLET_GIT_URL}" "${{ runner.temp }}/flet-src"
297+
286298
- name: Run tests
287299
working-directory: "src/serious_python/example/flet_ffi_example"
288300
run: |
289-
dart run serious_python:main package app/src --platform Darwin --python-version ${{ matrix.python_version }} --requirements "${{ env.FLET_FFI_REQUIREMENT }}"
301+
dart run serious_python:main package app/src --platform Darwin --python-version ${{ matrix.python_version }} --requirements "${{ runner.temp }}/flet-src/sdk/python/packages/flet"
290302
flutter test integration_test --device-id macos --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }}
291303
292304
flet_ffi_ios:
293305
name: Test Flet FFI example on iOS (Python ${{ matrix.python_version }})
294306
runs-on: macos-26
307+
if: false # see `flet_ffi_macos:` rationale
295308
strategy:
296309
fail-fast: false
297310
matrix:
@@ -321,15 +334,20 @@ jobs:
321334
shutdown_after_job: true
322335
wait_for_boot: true
323336

337+
- name: Shallow-clone flet (dart-bridge)
338+
run: |
339+
git clone --depth 1 --branch "${FLET_GIT_REF}" "${FLET_GIT_URL}" "${{ runner.temp }}/flet-src"
340+
324341
- name: Run tests
325342
working-directory: "src/serious_python/example/flet_ffi_example"
326343
run: |
327-
dart run serious_python:main package app/src --platform iOS --python-version ${{ matrix.python_version }} --requirements "${{ env.FLET_FFI_REQUIREMENT }}"
344+
dart run serious_python:main package app/src --platform iOS --python-version ${{ matrix.python_version }} --requirements "${{ runner.temp }}/flet-src/sdk/python/packages/flet"
328345
flutter test integration_test --device-id ${{ steps.simulator.outputs.udid }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }}
329346
330347
flet_ffi_android:
331348
name: Test Flet FFI example on Android (Python ${{ matrix.python_version }})
332349
runs-on: ubuntu-latest
350+
if: false # see `flet_ffi_macos:` rationale
333351
strategy:
334352
fail-fast: false
335353
matrix:
@@ -365,6 +383,10 @@ jobs:
365383
~/.android/adb*
366384
key: avd-ffi
367385

386+
- name: Shallow-clone flet (dart-bridge)
387+
run: |
388+
git clone --depth 1 --branch "${FLET_GIT_REF}" "${FLET_GIT_URL}" "${{ runner.temp }}/flet-src"
389+
368390
- name: Setup Android Emulator + Run tests
369391
uses: reactivecircus/android-emulator-runner@v2
370392
env:
@@ -384,7 +406,7 @@ jobs:
384406
pre-emulator-launch-script: |
385407
sdkmanager --list_installed
386408
script: |
387-
cd src/serious_python/example/flet_ffi_example && dart run serious_python:main package app/src --platform Android --python-version ${{ matrix.python_version }} --requirements "${{ env.FLET_FFI_REQUIREMENT }}"
409+
cd src/serious_python/example/flet_ffi_example && dart run serious_python:main package app/src --platform Android --python-version ${{ matrix.python_version }} --requirements "${{ runner.temp }}/flet-src/sdk/python/packages/flet"
388410
cd src/serious_python/example/flet_ffi_example && flutter test integration_test --device-id emulator-${{ env.EMULATOR_PORT }} --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }}
389411
390412
flet_ffi_windows:
@@ -407,15 +429,22 @@ jobs:
407429
path: '.fvmrc'
408430
cache: true
409431

432+
- name: Shallow-clone flet (dart-bridge)
433+
shell: bash
434+
run: |
435+
git clone --depth 1 --branch "${FLET_GIT_REF}" "${FLET_GIT_URL}" "${RUNNER_TEMP}/flet-src"
436+
410437
- name: Run tests
411438
working-directory: "src/serious_python/example/flet_ffi_example"
439+
shell: bash
412440
run: |
413-
dart run serious_python:main package app/src --platform Windows --python-version ${{ matrix.python_version }} --requirements "${{ env.FLET_FFI_REQUIREMENT }}"
441+
dart run serious_python:main package app/src --platform Windows --python-version ${{ matrix.python_version }} --requirements "${RUNNER_TEMP}/flet-src/sdk/python/packages/flet"
414442
flutter test integration_test -d windows --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }}
415443
416444
flet_ffi_linux:
417445
name: Test Flet FFI example on Linux ${{ matrix.title }} (Python ${{ matrix.python_version }})
418446
runs-on: ${{ matrix.runner }}
447+
if: false # see `flet_ffi_macos:` rationale
419448
strategy:
420449
fail-fast: false
421450
matrix:
@@ -482,11 +511,15 @@ jobs:
482511
gstreamer1.0-libav
483512
fi
484513
514+
- name: Shallow-clone flet (dart-bridge)
515+
run: |
516+
git clone --depth 1 --branch "${FLET_GIT_REF}" "${FLET_GIT_URL}" "${{ runner.temp }}/flet-src"
517+
485518
- name: Run tests
486519
working-directory: src/serious_python/example/flet_ffi_example
487520
run: |
488521
flutter pub get
489-
dart run serious_python:main package app/src --platform Linux --python-version ${{ matrix.python_version }} --requirements "${{ env.FLET_FFI_REQUIREMENT }}"
522+
dart run serious_python:main package app/src --platform Linux --python-version ${{ matrix.python_version }} --requirements "${{ runner.temp }}/flet-src/sdk/python/packages/flet"
490523
xvfb-run flutter test integration_test -d linux --dart-define=EXPECTED_PYTHON_VERSION=${{ matrix.python_version }}
491524
492525
bridge_example_macos:

src/serious_python/bin/package_command.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ class PackageCommand extends Command {
727727
await Process.run(
728728
'tar', ['-xzf', pythonArchivePath, '-C', _pythonDir!.path]);
729729

730+
stdout.writeln("Python distributive extracted to ${_pythonDir!.path}");
731+
730732
if (Platform.isMacOS) {
731733
duplicateSysconfigFile(_pythonDir!.path);
732734
}
@@ -737,8 +739,9 @@ class PackageCommand extends Command {
737739
? path.join(_pythonDir!.path, 'python', 'python.exe')
738740
: path.join(_pythonDir!.path, 'python', 'bin', 'python3');
739741

740-
// Run the python executable
741-
verbose([pythonExePath, ...args].join(" "));
742+
// Always log the Python command so a silent pip install (typical during
743+
// `pip install git+…` while git is cloning) doesn't look like a hang.
744+
stdout.writeln("Running: ${[pythonExePath, ...args].join(" ")}");
742745
return await runExec(pythonExePath, args, environment: environment);
743746
}
744747

0 commit comments

Comments
 (0)