Skip to content

Build driver from source instead of downloading from CDN#1

Closed
Skn0tt wants to merge 22 commits into
mainfrom
skn0tt/build-driver-from-source
Closed

Build driver from source instead of downloading from CDN#1
Skn0tt wants to merge 22 commits into
mainfrom
skn0tt/build-driver-from-source

Conversation

@Skn0tt

@Skn0tt Skn0tt commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Build the Playwright driver from source instead of the CDN

setup.py no longer downloads prebuilt driver bundles from cdn.playwright.dev.
Instead it clones microsoft/playwright at tag v{driver_version} and builds the
six platform bundles from source via the upstream
utils/build/build-playwright-driver.sh, then embeds them into the platform wheels
exactly as before. Same released version, same artifacts — just self-built.

What changed

  • setup.py: download_driverensure_driver_bundle, which shells out to a new
    portable scripts/build_driver.sh <version> (skips the build if the zip already
    exists). build_driver.py removed.
  • scripts/build_driver.sh: new portable bash builder (shareable with the other
    language forks), builds all 6 bundles on a single host.
  • CI (.github/workflows/ci.yml): a single build-driver job builds the bundles
    once on Linux and shares them via the driver-bundles artifact; infra, build,
    test-stable, and build-conda download + verify the bundles instead of building
    per-job. (Cross-platform builds all happen on Linux — upstream's script fetches a
    per-target Node, so Windows/macOS only need the prebuilt zips.)
  • meta.yaml: conda host gains git + nodejs.
  • Docs: CONTRIBUTING.md, ROLLING.md, CLAUDE.md,
    .claude/skills/playwright-roll/SKILL.md updated for the build-from-source flow.

CI status

Windows/conda/stable jobs are green. The only failures are pre-existing infra
issues unrelated to this change
: Stable (macos-latest, chrome) (hdiutil .dmg
flake) and Build (macos-15-xlarge, webkit) (paid larger runner unavailable on a
fork).

⚠️ Remote / base note

This PR is fork-internal (Skn0tt:mainSkn0tt:skn0tt/build-driver-from-source)
and exists to validate CI on the fork. If this is intended as an upstream
contribution to microsoft/playwright-python, it must NOT be retargeted as-is: this
branch is based on a stale Skn0tt/main (pre-1.60.0), so a cross-repo PR against
microsoft:main would show a diff that appears to revert upstream's recent commits
(the 1.60.0 roll, FormData, etc.). The correct path is to rebase onto
upstream/main, reconcile setup.py with the 1.60.0 driver roll, then open a fresh
cross-repo PR — a PR's base repo can't be changed after creation.

Skn0tt and others added 19 commits April 30, 2026 15:26
…icrosoft#3055)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…microsoft#3049)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ross 1 directory (microsoft#3041)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…107 (microsoft#2975)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…soft#3063)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Skn0tt <14912729+Skn0tt@users.noreply.github.com>
)

Co-authored-by: Simon Knott <info@simonknott.de>
@Skn0tt Skn0tt marked this pull request as ready for review June 8, 2026 11:05
@Skn0tt Skn0tt marked this pull request as draft June 8, 2026 11:13
Skn0tt and others added 3 commits June 8, 2026 13:46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
Stop downloading the prebuilt Playwright driver bundle from
cdn.playwright.dev. Instead, clone microsoft/playwright at the tag
matching driver_version and build the per-platform bundles from source
via upstream's utils/build/build-playwright-driver.sh.

- scripts/build_driver.sh: portable bash script (shareable across the
  language forks) that clones, builds (npm ci && npm run build), runs the
  upstream driver build, and stages all 6 platform zips into driver/.
- setup.py: ensure_driver_bundle() shells out to the script when a bundle
  is missing; stale extract-dir cleanup before extraction.
- CI/release: add Node 24 (matching the bundled runtime major) wherever
  wheels are built — ci.yml, publish_docker.yml, test_docker.yml host,
  Azure NodeTool; meta.yaml conda host gains git + nodejs.
- Docs: ROLLING.md, CONTRIBUTING.md, CLAUDE.md, playwright-roll SKILL.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The per-job source build can't run on Windows (Git Bash lacks zip/unzip and
the heavy upstream monorepo build is not exercised there), and rebuilding the
fully cross-platform driver in every wheel job is redundant and slow.

Add a single 'build-driver' job that builds all six platform bundles on Linux
and uploads them as a workflow artifact. Every wheel-building job (Lint, Build,
Stable, Conda) now downloads that artifact into driver/ so setup.py's
ensure_driver_bundle early-returns and embeds the prebuilt zip -- no Node, bash
or zip/unzip needed on Windows/macOS. A verify step asserts all six bundles are
present before building.

Docker and Azure publish are unchanged: they run on Linux and build the driver
once on their own host, which already works.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Skn0tt Skn0tt force-pushed the skn0tt/build-driver-from-source branch from cd59be0 to 088fda1 Compare June 8, 2026 11:49
@Skn0tt

Skn0tt commented Jun 8, 2026

Copy link
Copy Markdown
Owner Author

Superseded by the upstream PR against microsoft/playwright-python:main (rebased onto upstream/main, driver rolled to 1.60.0, conda changes dropped to match microsoft#3091). Closing this fork-internal CI-validation PR.

@Skn0tt Skn0tt closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants