Build driver from source instead of downloading from CDN#1
Closed
Skn0tt wants to merge 22 commits into
Closed
Conversation
…icrosoft#3055) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: lp07 <lisa.ppatel26@gmail.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: 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>
cd59be0 to
088fda1
Compare
Owner
Author
|
Superseded by the upstream PR against |
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.
Build the Playwright driver from source instead of the CDN
setup.pyno longer downloads prebuilt driver bundles fromcdn.playwright.dev.Instead it clones
microsoft/playwrightat tagv{driver_version}and builds thesix platform bundles from source via the upstream
utils/build/build-playwright-driver.sh, then embeds them into the platform wheelsexactly as before. Same released version, same artifacts — just self-built.
What changed
setup.py:download_driver→ensure_driver_bundle, which shells out to a newportable
scripts/build_driver.sh <version>(skips the build if the zip alreadyexists).
build_driver.pyremoved.scripts/build_driver.sh: new portable bash builder (shareable with the otherlanguage forks), builds all 6 bundles on a single host.
.github/workflows/ci.yml): a singlebuild-driverjob builds the bundlesonce on Linux and shares them via the
driver-bundlesartifact;infra,build,test-stable, andbuild-condadownload + verify the bundles instead of buildingper-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 gainsgit+nodejs.CONTRIBUTING.md,ROLLING.md,CLAUDE.md,.claude/skills/playwright-roll/SKILL.mdupdated 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.dmgflake) and
Build (macos-15-xlarge, webkit)(paid larger runner unavailable on afork).
This PR is fork-internal (
Skn0tt:main←Skn0tt: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: thisbranch is based on a stale
Skn0tt/main(pre-1.60.0), so a cross-repo PR againstmicrosoft:mainwould 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, reconcilesetup.pywith the 1.60.0 driver roll, then open a freshcross-repo PR — a PR's base repo can't be changed after creation.