fix(install): scope Playwright override to too-new apt releases + keep step interruptible (#35166) - #54078
Merged
Conversation
…cognized host (#35166) On apt releases newer than the bundled Playwright recognizes (Ubuntu 26.04, Debian 14, and future distros), 'npx playwright install --with-deps chromium' hangs uninterruptibly at 'Installing Playwright Chromium with system dependencies' because Playwright's resolver maps the host to a platform with no download build (#35166). Wrap every installer Playwright call in run_playwright_install(), which tries the native install first and, only if it fails or times out, retries once with PLAYWRIGHT_HOST_PLATFORM_OVERRIDE pinned to the newest known build (ubuntu24.04-<arch>). This is the escape hatch Playwright's maintainers bless for unrecognized platforms (microsoft/playwright#33434). Try-native-first (not a hardcoded distro/version table) is deliberate: - Self-correcting — when Playwright already supports the host (e.g. Ubuntu 26.04 on Playwright >=1.61) the first attempt succeeds and the override is never applied, so we never force a mismatched-glibc build onto a release Playwright handles correctly (microsoft/playwright#35114). - Zero-maintenance — new distro releases work the moment Playwright adds them. - Covers Debian 14+ and future releases, not just Ubuntu 26.04. An operator-set PLAYWRIGHT_HOST_PLATFORM_OVERRIDE is always respected (applied to the first attempt; retry skipped). Non-x64/arm64 arches have no fallback build and skip the retry. Refs #35166
…p step interruptible Follow-up on #54032 for #35166: - Gate the PLAYWRIGHT_HOST_PLATFORM_OVERRIDE retry on the host being an apt release newer than Playwright recognizes (Ubuntu >24.04 / Debian >13) via playwright_host_unrecognized(), instead of retrying on ANY install failure. A network/disk/permission failure on a supported host now surfaces unchanged rather than getting a mismatched-glibc build forced onto it. - detect_os() now captures DISTRO_VERSION from os-release. - Fold in the interruptibility fix (was PR #35304, self-closed): wrap the download in 'timeout --foreground -k 10' (probed, with plain-timeout fallback) so a terminal Ctrl+C reaches the child and a wedged download is force-killed after the deadline. - Add behavioral tests that source the helpers and assert the retry fires only on Ubuntu 26.04 / Debian 14, not on supported hosts, non-apt distros, native-success, operator-pinned override, or unsupported arch.
Contributor
🔎 Lint report:
|
This was referenced Jun 28, 2026
Closed
tonydwb
reviewed
Jun 28, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: LGTM
Scopes Playwright override to too-new apt releases and keeps the step interruptible. On apt releases newer than Playwright recognizes (Ubuntu 26.04, Debian 14), retries once with PLAYWRIGHT_HOST_PLATFORM_OVERRIDE pinned to ubuntu24.04. Also adds --foreground -k 10 to GNU timeout for Ctrl+C support.
Changes
scripts/install.sh: Newplaywright_host_unrecognized(),playwright_fallback_platform(),run_playwright_install()functions; updatedrun_browser_install_with_timeout()with GNU flagstests/test_install_sh_browser_install.py: 8 behavioral tests + 3 unit tests
Looks Good
- Scoped to the actual hang condition (too-new apt), not any failure
- Operator-provided override always respected
- Arch-aware fallback (x64/arm64)
- Comprehensive behavioral tests driving real shell functions
- GNU flag probe with BusyBox/non-GNU fallback
Reviewed by Hermes Agent
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.
Summary
The installer no longer hangs uninterruptibly at "Installing Playwright Chromium" on Ubuntu 26.04 — and the platform-override escape hatch now fires only on the apt releases that actually trigger the hang, not on every install failure.
Root cause (#35166): on apt releases newer than Playwright's resolver recognizes (Ubuntu 26.04, Debian 14, future distros), Playwright returns a platform identifier with no CDN build, so
npx playwright installstalls forever — and because GNUtimeoutruns the child in its own process group, a terminal Ctrl+C never reaches it.This builds on @kshitijk4poor's #54032 (cherry-picked, authorship preserved) with two corrections.
Changes
scripts/install.shplaywright_host_unrecognized()returns true only on apt releases newer than Playwright knows (Ubuntu > 24.04 / Debian > 13, version-sorted).run_playwright_install()now retries withPLAYWRIGHT_HOST_PLATFORM_OVERRIDE=ubuntu24.04-<arch>only in that case — instead of retrying on any failure. A network/disk/permission error on a supported host surfaces unchanged rather than getting a mismatched-glibc build forced onto it ([Bug]: version `GLIBC_2.36' not found... microsoft/playwright#35114).detect_os()now capturesDISTRO_VERSIONfrom/etc/os-release.timeout --foreground -k 10(probed once, plain-timeoutfallback for BusyBox, direct exec wheretimeoutis absent).--foregroundlets a terminal Ctrl+C reach the child;-k 10force-kills a wedged download after the deadline.tests/test_install_sh_browser_install.py: 7 new behavioral tests that source the helpers in a stubbed shell and assert the retry fires on Ubuntu 26.04 / Debian 14 but not on supported Ubuntu, non-apt distros, native success, operator-pinned override, or unsupported arch — plus the interruptibility guard.Validation
ubuntu24.04override; Ctrl+C worksscripts/run_tests.sh tests/test_install_sh_browser_install.py→ 15 passed.bash -n scripts/install.sh→ OK. Version-gate verified across 10 distro/version edges (24.04/25.10/26.04, Debian 12/13/14, empty version, non-apt).Closes #35166.
Infographic