Skip to content

fix(install): scope Playwright override to too-new apt releases + keep step interruptible (#35166) - #54078

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-18e18c33
Jun 28, 2026
Merged

fix(install): scope Playwright override to too-new apt releases + keep step interruptible (#35166)#54078
teknium1 merged 2 commits into
mainfrom
hermes/hermes-18e18c33

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

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 install stalls forever — and because GNU timeout runs 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.sh
    • Scope the override retry to the real hang condition. New playwright_host_unrecognized() returns true only on apt releases newer than Playwright knows (Ubuntu > 24.04 / Debian > 13, version-sorted). run_playwright_install() now retries with PLAYWRIGHT_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 captures DISTRO_VERSION from /etc/os-release.
    • Keep the step interruptible (folds in the self-closed fix(install): make Playwright browser install interruptible #35304): the download runs under timeout --foreground -k 10 (probed once, plain-timeout fallback for BusyBox, direct exec where timeout is absent). --foreground lets a terminal Ctrl+C reach the child; -k 10 force-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

Scenario Before After
Ubuntu 26.04, install stalls Hangs forever, Ctrl+C ignored Retries with ubuntu24.04 override; Ctrl+C works
Ubuntu 24.04, real network failure n/a Surfaces failure (no override forced)
Fedora / non-apt, failure n/a Surfaces failure (no override)
Native install succeeds No retry, no override
Operator-pinned override Respected, single attempt

scripts/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

install-hang-fixed-35166

kshitijk4poor and others added 2 commits June 28, 2026 01:26
…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.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-18e18c33 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 11615 on HEAD, 11615 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 6097 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard tool/browser Browser automation (CDP, Playwright) P2 Medium — degraded but workaround exists labels Jun 28, 2026
@teknium1
teknium1 merged commit c0b4a34 into main Jun 28, 2026
30 checks passed
@teknium1
teknium1 deleted the hermes/hermes-18e18c33 branch June 28, 2026 09:05

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: New playwright_host_unrecognized(), playwright_fallback_platform(), run_playwright_install() functions; updated run_browser_install_with_timeout() with GNU flags
  • tests/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists tool/browser Browser automation (CDP, Playwright) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Installation stuck at "Installing Playwright Chromium with system dependencies"

4 participants