From 4bbe1b918a04a05154fc3932a3c1c1ea4faa75bf Mon Sep 17 00:00:00 2001 From: Chris Eastwood <106503529+eastwood-c@users.noreply.github.com> Date: Thu, 22 Oct 2026 15:59:11 -0400 Subject: [PATCH] build(tools): install playwright deps only when that needs no prompt (#39905) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Debian/Ubuntu outside GitHub Actions, `tools/playwright.sh` always ran `pnpm exec playwright install --with-deps`. Installing system packages needs root: when it isn't root, Playwright tries `sudo` and falls back to `su`, so a non-root user without passwordless sudo sees `make playwright` — and the targets depending on it, `make test-e2e` and `make test-frontend` — either stop and ask for the root password mid-build or fail outright with `su: System error`. Related: #38860, which added this script. --------- Co-authored-by: silverwind --- tools/playwright.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/playwright.sh b/tools/playwright.sh index daf361b8452..9148b01481e 100755 --- a/tools/playwright.sh +++ b/tools/playwright.sh @@ -3,7 +3,12 @@ set -euo pipefail # playwright only supports ubuntu/debian officially, and on CI VMs its system deps are pre-installed if [ -z "${GITHUB_ACTIONS:-}" ] && [ "$(uname -s)" = "Linux" ] && grep -qE '^ID(_LIKE)?=.*(ubuntu|debian)' /etc/os-release 2>/dev/null; then - pnpm exec playwright install --with-deps "$@" + if [ "$(id -u)" = 0 ] || { command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; }; then # Avoid Playwright's interactive su fallback. + pnpm exec playwright install --with-deps "$@" + else + pnpm exec playwright install "$@" + echo "Skipped playwright system dependencies (not root and no passwordless sudo), install them with: pnpm exec playwright install-deps" >&2 + fi else pnpm exec playwright install "$@" fi