Repository navigation
Conversation
Contributor
Author
|
Superseded by #194454 |
gmackall
pushed a commit
to gmackall/flutter
that referenced
this pull request
Oct 16, 2026
…lutter#194454) Depends on flutter#194471 `Linux local_engine_builds` fails on 16% of postsubmit runs when a Windows sub-build dies at `ACTION //flutter/third_party/angle:angle_commit_id` with `FAILED: gen/angle/angle_commit.h`. `engine/src/.gn` runs every GN action through `vpython3`, and on Windows more than 100 concurrent `vpython3.exe` processes contend on the shared virtualenv store. This PR fetches a hermetic `cpython3` through `DEPS` and points `script_executable` at it, the same way [Chromium](https://chromium.googlesource.com/chromium/src/+/ce8851b40f37e74adcb7813256930792f35b8039/.gn#12) and [ANGLE](https://chromium.googlesource.com/angle/angle/+/45c55079f225/.gn#17) do. This replaces flutter#193954, which used `python3` from `PATH`. ## The flake | Where | Failure rate | Window | |---|---|---| | Postsubmit, last 200 builds | **16.0%** (32/200) | `display builds\|windows/*` failing on `angle_commit.h` or `venv derivation`, Oct 3 to Oct 15 | | Try, without the fix (logging-only build) | 1/7 | one wave on [`65b69d1e0db`](mdebbar@65b69d1) | | Try, with the fix | **0/52** | see [Proof of fix](#proof-of-fix-after-the-fix) | Example postsubmit failures (`FAILURE` in `display builds|windows/*`): [4322](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20local_engine_builds/4322/overview), [4314](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20local_engine_builds/4314/overview), [4310](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20local_engine_builds/4310/overview). ## Root cause 1. `engine/src/.gn` sets `script_executable = "vpython3"`, so every GN `action()` and the Windows [`tool("copy")`](https://github.com/flutter/flutter/blob/8274c72edd454f28f044908463289f7976b270af/engine/src/build/toolchain/win/BUILD.gn#L266) run through `vpython3.exe`. 2. `vpython3` finds its spec by walking up from the script. For `angle/src/commit_id.py` (stdlib only) it finds [`angle/vpython.toml`](https://flutter.googlesource.com/third_party/angle/+/a8d74ca3e5e9e4ffa241330ceedcbe302443e472/vpython.toml), which declares 80+ test wheels. 3. Under RBE (`ninja -j 1000`), the first ~340 steps are mostly `COPY`/`ACTION`, so more than 100 `vpython3.exe` processes run at once against `vpython-root.0\store`. 4. When `angle_commit_id` runs inside that burst, `cipkg` fails to reference the venv package (inferred: lock/reference contention): ``` failed to generate venv derivation: failed to reference the package: vpython_requirements+6a6r820h3nqlaqp6gjqd7r2ecc: package does not exist ``` **Why it passes ~84% of the time:** it depends on whether `angle_commit_id` gets scheduled during the burst. In the failing sub-build it ran at step `[260/10139]` with `peak_vpython_procs=101`. Passing sub-builds ran it after the burst drained (`[1302/10053]`, 4 processes) or finished it early (`[335/9855]`). **Why it started now:** unknown. It spans the whole baseline window. ## Proof of root cause (before the fix) | Build | Result | What to look for | |---|---|---| | [10993](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/10993/overview) ([log](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8668651665918817921/+/u/build_android_profile_arm64/stdout)) | failed | `[DEFLAKE_PROBE]` logs `peak_vpython_procs=101`; step `[260/10139]` fails with `vpython_requirements+6a6r820h3nqlaqp6gjqd7r2ecc: package does not exist` | | [10993](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/10993/overview) ([log](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8668651665918817873/+/u/build_android_release_arm64/stdout)) | passed (control) | `[DEFLAKE_PROBE]` logs `vp_samples=[87, 4, 4, 4, 4, 4]`; `angle_commit_id` runs at `[1302/10053]` after the burst drains | | [10993](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/10993/overview) ([log](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8668651665918818001/+/u/build_android_debug_arm64/stdout)) | passed (control) | `[DEFLAKE_PROBE]` logs `peak_vpython_procs=116 angle_commit_h_ms=2619`; `angle_commit_id` finishes at `[335/9855]` | ## The fix This removes `vpython3` from the build graph entirely. Every GN action now runs `../../flutter/third_party/cpython3/bin/python3`, a plain CPython 3.11.9 from CIPD (`infra/3pp/tools/cpython3`, the same version Chromium pins). There's no virtualenv, no spec lookup, and no shared store. It also stays independent of whatever `python3` is on a developer's `PATH`, which was the reason for switching to `vpython3` in flutter-team-archive/buildroot#590. Pieces that come with it: - **GN roll** `81b24e01531e` → `f9eca75ae554`. The old GN [treats `script_executable` as a literal path](https://gn.googlesource.com/gn/+/81b24e01531ecf0eff12ec9359a555ec3944ec4e/src/gn/setup.cc#842). Support for `//` paths landed in [gn@4a060c55dcc5](https://gn.googlesource.com/gn/+/4a060c55dcc5380837a8684949b74400e929b85e). - **`gn format`**: the new GN rewraps comments and adds blank lines in 49 `.gn` files under `engine/src/flutter`. No semantic changes. - **License checker**: `licenses_cpp` [crawls every non-git `DEPS` directory](https://github.com/flutter/flutter/blob/8274c72edd454f28f044908463289f7976b270af/engine/src/flutter/tools/licenses_cpp/src/license_checker.cc#L516-L548), so I excluded `flutter/third_party/cpython3`. After pulling this, you need to run `gclient sync`. ## Rejected alternatives | Alternative | Why not (TL;DR) | Evidence | |---|---|---| | `script_executable = "python3"` (PR 193954) | Fixes the flake (64/64 green) but local builds then depend on `PATH` order again | `history`: [buildroot 590](flutter-team-archive/buildroot#590), [issue 108122](flutter#108122 (comment)) | | Roll GN to tip (Chromium's `0817afa57742`) | Turns on `check_includes_strict` by default; `gn gen --check` fails on every engine config | `constraint`: [gn@526295467bd1](https://gn.googlesource.com/gn/+/526295467bd18f5f8d9cb11f03a1c56cb40b7b28) | | Add a root `engine/src/.vpython3` spec | `vpython3` hits `angle/vpython.toml` first when walking up from `commit_id.py` | `constraint`: [`angle/BUILD.gn`](https://flutter.googlesource.com/third_party/angle/+/a8d74ca3e5e9e4ffa241330ceedcbe302443e472/BUILD.gn#950) | | Keep `vpython3` and pre-warm `angle/vpython.toml` | Still spawns 100+ wrappers per build and installs 80+ unused wheels | `history`: [issue 88719](flutter#88719), [buildroot 507](flutter-team-archive/buildroot#507) | <details><summary>Details and evidence</summary> **`python3` from `PATH`.** flutter#193954 verified 64/64 green with `script_executable = "python3"`. But `.gn` moved from `python3` to `vpython3` in [buildroot 590](flutter-team-archive/buildroot#590) so workstations wouldn't pick up a broken system `python3` or the Windows Store stub ahead of `depot_tools` ([issue 108122](flutter#108122 (comment))). A pinned `cpython3` keeps that guarantee without `vpython3`. **GN tip.** Chromium's pin includes [gn@526295467bd1](https://gn.googlesource.com/gn/+/526295467bd18f5f8d9cb11f03a1c56cb40b7b28) "Enable check_includes_strict by default". Running `flutter/tools/gn` with it fails `gen --check` on host, Android, web, and Fuchsia configs with `Public headers cannot include private dependencies` and `Can't include this header from here`. `f9eca75ae554` is its parent. Whoever rolls GN next will have to either set `check_includes_strict = false` or fix those includes. **Root `.vpython3` / pre-warming.** `vpython3` resolves the nearest spec walking up from the script, and [`angle_commit_id`](https://flutter.googlesource.com/third_party/angle/+/a8d74ca3e5e9e4ffa241330ceedcbe302443e472/BUILD.gn#950) lives under `flutter/third_party/angle/`. Pre-warming still runs every Windows `COPY` through `vpython3.exe`, and `vpython` cache flakes on Windows are why [buildroot 507](flutter-team-archive/buildroot#507) reverted the first move to `vpython3` ([issue 88719](flutter#88719)). </details> ## Proof of fix (after the fix) | Commit | Builds | Result | What to look for | |---|---|---|---| | [`d44d28f3df7`](mdebbar@d44d28f) (`cpython3` + GN roll) | [11360](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11360/overview)–[11369](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11369/overview) | 10/10 green | all `SUCCESS` | | [`f6c011ba36e`](mdebbar@f6c011b) (this PR's diff) | [11371](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11371/overview)–[11424](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11424/overview) | 42/42 Windows green | 39 `SUCCESS`; [11376](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11376/overview), [11378](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11378/overview), [11389](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11389/overview) are `wasm_*` 60m task timeouts after slow `Mount caches` (same as prod [4148](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20local_engine_builds/4148/overview)) | If the fix did nothing, 52/52 green Windows sub-builds would have probability (1 − 0.16)^52 ≈ 1.2 × 10^-4. Since `script_executable` only points at `//flutter/third_party/cpython3/bin/python3`, every green Windows sub-build ran its actions on `cpython3`. One build each of `windows_unopt`, `windows_host_engine`, `windows_arm_host_engine`, `windows_host_engine_test`, `mac_unopt`, `mac_host_engine`, `mac_ios_engine`, `linux_unopt`, `linux_host_engine`, `linux_arm_host_engine`, `linux_web_engine`, `linux_fuchsia`, `linux_android_aot_engine`, `linux_clang_tidy` and `linux_license` (among others) also passed on these commits. <details><summary>All 52 verification builds</summary> [11360](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11360/overview), [11361](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11361/overview), [11362](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11362/overview), [11363](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11363/overview), [11364](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11364/overview), [11365](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11365/overview), [11366](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11366/overview), [11367](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11367/overview), [11368](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11368/overview), [11369](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11369/overview), [11371](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11371/overview), [11372](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11372/overview), [11373](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11373/overview), [11374](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11374/overview), [11375](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11375/overview), [11376](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11376/overview), [11377](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11377/overview), [11378](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11378/overview), [11379](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11379/overview), [11380](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11380/overview), [11386](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11386/overview), [11387](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11387/overview), [11388](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11388/overview), [11389](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11389/overview), [11390](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11390/overview), [11391](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11391/overview), [11392](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11392/overview), [11393](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11393/overview), [11394](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11394/overview), [11395](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11395/overview), [11396](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11396/overview), [11399](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11399/overview), [11400](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11400/overview), [11401](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11401/overview), [11402](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11402/overview), [11403](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11403/overview), [11404](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11404/overview), [11405](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11405/overview), [11406](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11406/overview), [11407](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11407/overview), [11408](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11408/overview), [11409](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11409/overview), [11415](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11415/overview), [11416](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11416/overview), [11417](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11417/overview), [11418](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11418/overview), [11419](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11419/overview), [11420](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11420/overview), [11421](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11421/overview), [11422](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11422/overview), [11423](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11423/overview), [11424](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11424/overview) </details> Investigation branch: https://github.com/mdebbar/flutter/tree/cpython3-flutter-flake-fix-2 Fixes flutter#193175
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…lutter#194454) Depends on flutter#194471 `Linux local_engine_builds` fails on 16% of postsubmit runs when a Windows sub-build dies at `ACTION //flutter/third_party/angle:angle_commit_id` with `FAILED: gen/angle/angle_commit.h`. `engine/src/.gn` runs every GN action through `vpython3`, and on Windows more than 100 concurrent `vpython3.exe` processes contend on the shared virtualenv store. This PR fetches a hermetic `cpython3` through `DEPS` and points `script_executable` at it, the same way [Chromium](https://chromium.googlesource.com/chromium/src/+/ce8851b40f37e74adcb7813256930792f35b8039/.gn#12) and [ANGLE](https://chromium.googlesource.com/angle/angle/+/45c55079f225/.gn#17) do. This replaces flutter#193954, which used `python3` from `PATH`. ## The flake | Where | Failure rate | Window | |---|---|---| | Postsubmit, last 200 builds | **16.0%** (32/200) | `display builds\|windows/*` failing on `angle_commit.h` or `venv derivation`, Oct 3 to Oct 15 | | Try, without the fix (logging-only build) | 1/7 | one wave on [`65b69d1e0db`](mdebbar@65b69d1) | | Try, with the fix | **0/52** | see [Proof of fix](#proof-of-fix-after-the-fix) | Example postsubmit failures (`FAILURE` in `display builds|windows/*`): [4322](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20local_engine_builds/4322/overview), [4314](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20local_engine_builds/4314/overview), [4310](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20local_engine_builds/4310/overview). ## Root cause 1. `engine/src/.gn` sets `script_executable = "vpython3"`, so every GN `action()` and the Windows [`tool("copy")`](https://github.com/flutter/flutter/blob/8274c72edd454f28f044908463289f7976b270af/engine/src/build/toolchain/win/BUILD.gn#L266) run through `vpython3.exe`. 2. `vpython3` finds its spec by walking up from the script. For `angle/src/commit_id.py` (stdlib only) it finds [`angle/vpython.toml`](https://flutter.googlesource.com/third_party/angle/+/a8d74ca3e5e9e4ffa241330ceedcbe302443e472/vpython.toml), which declares 80+ test wheels. 3. Under RBE (`ninja -j 1000`), the first ~340 steps are mostly `COPY`/`ACTION`, so more than 100 `vpython3.exe` processes run at once against `vpython-root.0\store`. 4. When `angle_commit_id` runs inside that burst, `cipkg` fails to reference the venv package (inferred: lock/reference contention): ``` failed to generate venv derivation: failed to reference the package: vpython_requirements+6a6r820h3nqlaqp6gjqd7r2ecc: package does not exist ``` **Why it passes ~84% of the time:** it depends on whether `angle_commit_id` gets scheduled during the burst. In the failing sub-build it ran at step `[260/10139]` with `peak_vpython_procs=101`. Passing sub-builds ran it after the burst drained (`[1302/10053]`, 4 processes) or finished it early (`[335/9855]`). **Why it started now:** unknown. It spans the whole baseline window. ## Proof of root cause (before the fix) | Build | Result | What to look for | |---|---|---| | [10993](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/10993/overview) ([log](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8668651665918817921/+/u/build_android_profile_arm64/stdout)) | failed | `[DEFLAKE_PROBE]` logs `peak_vpython_procs=101`; step `[260/10139]` fails with `vpython_requirements+6a6r820h3nqlaqp6gjqd7r2ecc: package does not exist` | | [10993](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/10993/overview) ([log](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8668651665918817873/+/u/build_android_release_arm64/stdout)) | passed (control) | `[DEFLAKE_PROBE]` logs `vp_samples=[87, 4, 4, 4, 4, 4]`; `angle_commit_id` runs at `[1302/10053]` after the burst drains | | [10993](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/10993/overview) ([log](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8668651665918818001/+/u/build_android_debug_arm64/stdout)) | passed (control) | `[DEFLAKE_PROBE]` logs `peak_vpython_procs=116 angle_commit_h_ms=2619`; `angle_commit_id` finishes at `[335/9855]` | ## The fix This removes `vpython3` from the build graph entirely. Every GN action now runs `../../flutter/third_party/cpython3/bin/python3`, a plain CPython 3.11.9 from CIPD (`infra/3pp/tools/cpython3`, the same version Chromium pins). There's no virtualenv, no spec lookup, and no shared store. It also stays independent of whatever `python3` is on a developer's `PATH`, which was the reason for switching to `vpython3` in flutter-team-archive/buildroot#590. Pieces that come with it: - **GN roll** `81b24e01531e` → `f9eca75ae554`. The old GN [treats `script_executable` as a literal path](https://gn.googlesource.com/gn/+/81b24e01531ecf0eff12ec9359a555ec3944ec4e/src/gn/setup.cc#842). Support for `//` paths landed in [gn@4a060c55dcc5](https://gn.googlesource.com/gn/+/4a060c55dcc5380837a8684949b74400e929b85e). - **`gn format`**: the new GN rewraps comments and adds blank lines in 49 `.gn` files under `engine/src/flutter`. No semantic changes. - **License checker**: `licenses_cpp` [crawls every non-git `DEPS` directory](https://github.com/flutter/flutter/blob/8274c72edd454f28f044908463289f7976b270af/engine/src/flutter/tools/licenses_cpp/src/license_checker.cc#L516-L548), so I excluded `flutter/third_party/cpython3`. After pulling this, you need to run `gclient sync`. ## Rejected alternatives | Alternative | Why not (TL;DR) | Evidence | |---|---|---| | `script_executable = "python3"` (PR 193954) | Fixes the flake (64/64 green) but local builds then depend on `PATH` order again | `history`: [buildroot 590](flutter-team-archive/buildroot#590), [issue 108122](flutter#108122 (comment)) | | Roll GN to tip (Chromium's `0817afa57742`) | Turns on `check_includes_strict` by default; `gn gen --check` fails on every engine config | `constraint`: [gn@526295467bd1](https://gn.googlesource.com/gn/+/526295467bd18f5f8d9cb11f03a1c56cb40b7b28) | | Add a root `engine/src/.vpython3` spec | `vpython3` hits `angle/vpython.toml` first when walking up from `commit_id.py` | `constraint`: [`angle/BUILD.gn`](https://flutter.googlesource.com/third_party/angle/+/a8d74ca3e5e9e4ffa241330ceedcbe302443e472/BUILD.gn#950) | | Keep `vpython3` and pre-warm `angle/vpython.toml` | Still spawns 100+ wrappers per build and installs 80+ unused wheels | `history`: [issue 88719](flutter#88719), [buildroot 507](flutter-team-archive/buildroot#507) | <details><summary>Details and evidence</summary> **`python3` from `PATH`.** flutter#193954 verified 64/64 green with `script_executable = "python3"`. But `.gn` moved from `python3` to `vpython3` in [buildroot 590](flutter-team-archive/buildroot#590) so workstations wouldn't pick up a broken system `python3` or the Windows Store stub ahead of `depot_tools` ([issue 108122](flutter#108122 (comment))). A pinned `cpython3` keeps that guarantee without `vpython3`. **GN tip.** Chromium's pin includes [gn@526295467bd1](https://gn.googlesource.com/gn/+/526295467bd18f5f8d9cb11f03a1c56cb40b7b28) "Enable check_includes_strict by default". Running `flutter/tools/gn` with it fails `gen --check` on host, Android, web, and Fuchsia configs with `Public headers cannot include private dependencies` and `Can't include this header from here`. `f9eca75ae554` is its parent. Whoever rolls GN next will have to either set `check_includes_strict = false` or fix those includes. **Root `.vpython3` / pre-warming.** `vpython3` resolves the nearest spec walking up from the script, and [`angle_commit_id`](https://flutter.googlesource.com/third_party/angle/+/a8d74ca3e5e9e4ffa241330ceedcbe302443e472/BUILD.gn#950) lives under `flutter/third_party/angle/`. Pre-warming still runs every Windows `COPY` through `vpython3.exe`, and `vpython` cache flakes on Windows are why [buildroot 507](flutter-team-archive/buildroot#507) reverted the first move to `vpython3` ([issue 88719](flutter#88719)). </details> ## Proof of fix (after the fix) | Commit | Builds | Result | What to look for | |---|---|---|---| | [`d44d28f3df7`](mdebbar@d44d28f) (`cpython3` + GN roll) | [11360](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11360/overview)–[11369](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11369/overview) | 10/10 green | all `SUCCESS` | | [`f6c011ba36e`](mdebbar@f6c011b) (this PR's diff) | [11371](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11371/overview)–[11424](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11424/overview) | 42/42 Windows green | 39 `SUCCESS`; [11376](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11376/overview), [11378](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11378/overview), [11389](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11389/overview) are `wasm_*` 60m task timeouts after slow `Mount caches` (same as prod [4148](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20local_engine_builds/4148/overview)) | If the fix did nothing, 52/52 green Windows sub-builds would have probability (1 − 0.16)^52 ≈ 1.2 × 10^-4. Since `script_executable` only points at `//flutter/third_party/cpython3/bin/python3`, every green Windows sub-build ran its actions on `cpython3`. One build each of `windows_unopt`, `windows_host_engine`, `windows_arm_host_engine`, `windows_host_engine_test`, `mac_unopt`, `mac_host_engine`, `mac_ios_engine`, `linux_unopt`, `linux_host_engine`, `linux_arm_host_engine`, `linux_web_engine`, `linux_fuchsia`, `linux_android_aot_engine`, `linux_clang_tidy` and `linux_license` (among others) also passed on these commits. <details><summary>All 52 verification builds</summary> [11360](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11360/overview), [11361](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11361/overview), [11362](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11362/overview), [11363](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11363/overview), [11364](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11364/overview), [11365](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11365/overview), [11366](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11366/overview), [11367](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11367/overview), [11368](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11368/overview), [11369](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11369/overview), [11371](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11371/overview), [11372](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11372/overview), [11373](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11373/overview), [11374](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11374/overview), [11375](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11375/overview), [11376](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11376/overview), [11377](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11377/overview), [11378](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11378/overview), [11379](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11379/overview), [11380](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11380/overview), [11386](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11386/overview), [11387](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11387/overview), [11388](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11388/overview), [11389](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11389/overview), [11390](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11390/overview), [11391](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11391/overview), [11392](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11392/overview), [11393](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11393/overview), [11394](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11394/overview), [11395](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11395/overview), [11396](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11396/overview), [11399](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11399/overview), [11400](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11400/overview), [11401](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11401/overview), [11402](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11402/overview), [11403](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11403/overview), [11404](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11404/overview), [11405](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11405/overview), [11406](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11406/overview), [11407](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11407/overview), [11408](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11408/overview), [11409](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11409/overview), [11415](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11415/overview), [11416](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11416/overview), [11417](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11417/overview), [11418](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11418/overview), [11419](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11419/overview), [11420](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11420/overview), [11421](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11421/overview), [11422](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11422/overview), [11423](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11423/overview), [11424](https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20local_engine_builds/11424/overview) </details> Investigation branch: https://github.com/mdebbar/flutter/tree/cpython3-flutter-flake-fix-2 Fixes flutter#193175
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linux local_engine_buildsfails on ~13.5% of postsubmit runs when a Windows sub-build (display builds|windows/*) aborts atACTION //flutter/third_party/angle:angle_commit_id(FAILED: gen/angle/angle_commit.h).engine/src/.gnsetsscript_executable = "vpython3", spawning >100 concurrentvpython3.exeprocesses during the initial NinjaCOPY/ACTIONburst that collide invpython-root.0\storewhileangle_commit_idwalks up toflutter/third_party/angle/vpython.toml. This PR setsscript_executable = "python3"inengine/src/.gnso GN rules run CIPDpython3.exedirectly.The flake
Linux local_engine_builds65b69d1e0dbExample postsubmit failures (
FAILUREindisplay builds|windows/*withFAILED: gen/angle/angle_commit.h): 4146, 4125, 4113.Root cause
engine/src/.gnsetsscript_executable = "vpython3"(set in buildroot PR 590 / issue 108122 so local builds resolvedepot_toolsPython onPATH), which GN binds to$python_pathfor Windowstool("copy")(tool_wrapper.py recursive-mirror) andACTIONrules.vpython3locates its spec by walking upward from the target script's directory.engine/srchas no root.vpython3(root_vpython3=False), andcommit_id.pyimports only Python 3 standard-library modules (pathlib,subprocess,sys,os), butflutter/third_party/angle/hasvpython.toml+vpython.toml.uv.lock(rolled in PR 193133, replacing ANGLE's.vpython3) declaring 80+ standalone test/infra wheels.ninja -j 1000), the first ~340 Ninja steps are almost allCOPYandACTIONrules, spawning >100 concurrentvpython3.exeprocesses (peak_vpython_procs=101) againstvpython-root.0\store.ACTION //flutter/third_party/angle:angle_commit_id(../../flutter/third_party/angle/src/commit_id.py) runs during that >100-process burst,vpython3.exewalks up toflutter/third_party/angle/vpython.tomland intermittently fails due to internalcipkgpackage-reference/lock contention(inferred):Why it passes ~86.5% of the time: pass vs. fail depends on
vpython3.execoncurrency andangle_commit_idscheduling relative to the initial ~335-stepCOPYburst. In the failing sub-build of 10993,angle_commit_idruns at step[260/10139]whilepeak_vpython_procs=101(vp_samples=[101, 2, 2, 2, 2, 2, 2]). In passing sub-builds of 10993,angle_commit_ideither runs at[1302/10053]after the burst drains to 4 processes (peak_vpython_procs=87,vp_samples=[87, 4, 4, 4, 4, 4]) or finishes at[335/9855](angle_commit_h_ms=2619,peak_vpython_procs=116) without colliding.Why it started now: unknown. The flake spans the full 200-build baseline window (27/200 = 13.5%); PR 193133 rolled ANGLE from
.vpython3tovpython.tomlon Oct 2, changing the failingcipkgpackage name tovpython_requirements+6a6r820h3nqlaqp6gjqd7r2ecc.Proof of root cause (before the fix)
[DEFLAKE_PROBE]logsroot_vpython3=False angle_vpython3=Falseandpeak_vpython_procs=101; step[260/10139]fails withvpython_requirements+6a6r820h3nqlaqp6gjqd7r2ecc: package does not exist[DEFLAKE_PROBE]logspeak_vpython_procs=87 vp_samples=[87, 4, 4, 4, 4, 4];angle_commit_idruns at[1302/10053]after theCOPYburst drains[DEFLAKE_PROBE]logspeak_vpython_procs=116 vp_samples=[116, 3, 2] angle_commit_h_ms=2619;angle_commit_idcompletes at[335/9855]The fix
Setting
script_executable = "python3"inengine/src/.gnmakes GNexec_script(),ACTION, andCOPYrules invoke CIPDpython3.exedirectly (matching Dart's.gnand all 14 hooks inDEPS), removingvpython3.exevirtualenv derivation from Ninja build steps (vpython_procs=1, only the outer recipe runner). Trade-off: local developer builds rely ondepot_tools(or a validpython3) preceding any broken systempython3stub onPATH(issue 108122); see Suggested Alternative (cpython3inDEPS) below to preservePATH-independent hermeticity.Rejected alternatives
cpython3inDEPS(Suggested Alternative)PATH-independent local hermeticity withoutvpython3, but requires new cross-platformDEPSCIPD entries; deferred to keep this fix minimal.precedent:ce8851b40f3,45c55079f22, issue 108122engine/src/.vpython3orvpython.tomlspecangle_commit_id:vpython3walks upward fromangle/src/commit_id.pyand hitsflutter/third_party/angle/vpython.tomlbeforeengine/src/.constraint:angle/BUILD.gn,angle/vpython.tomlvpython3in.gnand pre-warmangle/vpython.tomlopencv,pandas,grpcio) and spawns >100vpython3.exewrappers on WindowsCOPYsteps.history: issue 88719, buildroot 507, buildroot 590, 10993Details and evidence
Suggested Alternative — Provision hermetic
cpython3inDEPS(script_executable = "//third_party/cpython3/host/bin/python3"). In Aug 2021, buildroot PR 501 switched.gntovpython3so Fuchsia'sgen_dart_package_config.pycouldimport yaml. That caused Windowsvpythoncache flakes (issue 88719), so buildroot PR 507 reverted.gntopython3and engine PR 28413 vendoredthird_party/pyyamlintoDEPS. In July 2022, buildroot PR 590 / issue 108474 re-landedscript_executable = "vpython3"in.gnnot for wheel management, but so local workstations would resolvedepot_tools's bundled Python even if a broken systempython3(or Windows Store stub) precededdepot_toolsonPATH(issue 108122 comment). If we want to preserve thatPATH-independent hermeticity without invokingvpython3during GN/Ninja builds, we can follow Chromium (ce8851b40f3, Aug 2026) and ANGLE (45c55079f22, Sept 2026): fetchinfra/3pp/tools/cpython3/${{platform}}viaDEPS(as noted in issue 108122) and pointscript_executableat the hermeticcpython3binary.Add a root
engine/src/.vpython3orvpython.tomlspec.vpython3resolves specs by walking upward from the target script's directory. Becauseangle_commit_idruns../../flutter/third_party/angle/src/commit_id.py,vpython3walks up toflutter/third_party/angle/vpython.tomlbefore ever reachingengine/src/.Keep
vpython3in.gnand pre-warmangle/vpython.toml. Neither Chromium nor ANGLE runs GNaction()scripts undervpython3(angle/.gnusescpython3). Keepingscript_executable = "vpython3"inengine/src/.gnforces every engine build that compiles ANGLE to materialize 80+ standalone ANGLE test wheels (opencv-python,pandas,numpy,grpcio,selenium,cryptography,pywin32) fromangle/vpython.tomljust to run 40-line stdlibcommit_id.py, while still spawning >100 concurrentvpython3.exewrapper processes across WindowsCOPYsteps (10993).Proof of fix (after the fix)
1fe39ff406e(fix + telemetry)[DEFLAKE_PROBE]in 11036 (log) logsexe=C:\b\s\w\ir\cipd_bin_packages\cpython3\bin\python3.exeandvpython_procs=1991dfddcce4(this PR's diff)If the fix did nothing, 64/64 green would have probability (1 − 0.135)^64 ≈ 0.0093% (9.3 × 10^-5).
All 64 verification builds
11003, 11004, 11005, 11006, 11007, 11008, 11009, 11010, 11011, 11012, 11014, 11015, 11016, 11017, 11018, 11019, 11020, 11021, 11022, 11023, 11025, 11026, 11027, 11028, 11029, 11030, 11031, 11032, 11033, 11034, 11036, 11037, 11038, 11039, 11040, 11041, 11042, 11043, 11044, 11045, 11046, 11047, 11048, 11049, 11050, 11051, 11052, 11053, 11054, 11055, 11056, 11057, 11058, 11059, 11060, 11061, 11062, 11063, 11064, 11065, 11066, 11067, 11068, 11069
Investigation branch (instrumented history): https://github.com/mdebbar/flutter/tree/vivid_halo_climbs_18h12
Follow-up: Upstream LUCI
vpython3.exe(cipkg) race on Windows when >100 processes concurrently accessvpython-root.0\store— not filedFixes #193175