Skip to content

playwright-driver: use upstream chromium build#383876

Merged
phaer merged 2 commits intoNixOS:masterfrom
NyCodeGHG:playwright-chromium
May 19, 2025
Merged

playwright-driver: use upstream chromium build#383876
phaer merged 2 commits intoNixOS:masterfrom
NyCodeGHG:playwright-chromium

Conversation

@NyCodeGHG
Copy link
Member

@NyCodeGHG NyCodeGHG commented Feb 21, 2025

This makes playwright always use the upstream recommended chromium version.
I think this is necessary, because chromium updates get backported, which can (and will) break playwright versions on stable, as well as chromium always moving a bit ahead of playwright and we can't expect to delay a browser update for playwright.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Feb 21, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Feb 21, 2025
@nix-owners nix-owners bot requested a review from kalekseev February 21, 2025 10:06
@NyCodeGHG
Copy link
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 383876


x86_64-linux

⏩ 4 packages marked as broken and skipped:
  • froide
  • froide.dist
  • python312Packages.froide
  • python312Packages.froide.dist
❌ 8 packages failed to build:
  • python312Packages.great-tables
  • python312Packages.great-tables.dist
  • python312Packages.shiny
  • python312Packages.shiny.dist
  • python313Packages.great-tables
  • python313Packages.great-tables.dist
  • python313Packages.shiny
  • python313Packages.shiny.dist
✅ 11 packages built:
  • pinnwand
  • pinnwand.dist
  • playwright-test
  • python312Packages.django-filingcabinet
  • python312Packages.django-filingcabinet.dist
  • python312Packages.pytest-playwright
  • python312Packages.pytest-playwright.dist
  • python313Packages.django-filingcabinet
  • python313Packages.django-filingcabinet.dist
  • python313Packages.pytest-playwright
  • python313Packages.pytest-playwright.dist

@kalekseev
Copy link
Contributor

I don't have a strong opinion on this topic but maybe we should just use chromium from playwright bundle as we do for the rest of the browsers (and now for chromium headless shell as well). We can also provide some utility to build custom set of browsers, eg.

playwright-browsers.withBrowsers(b: [
  b.chromium-headless-shell
  b.chromium-from-nixpkgs
  # b.chromium-bundled
  b.firefox, 
  ...
])

@NyCodeGHG NyCodeGHG force-pushed the playwright-chromium branch from 6eeea0e to 2a9c428 Compare March 28, 2025 11:51
@github-actions github-actions bot removed the 6.topic: python Python is a high-level, general-purpose programming language. label Mar 28, 2025
@NyCodeGHG NyCodeGHG changed the title playwright-driver: use chromium built from source playwright-driver: use upstream chromium build Mar 28, 2025
@NyCodeGHG NyCodeGHG force-pushed the playwright-chromium branch from 2a9c428 to bf27800 Compare March 28, 2025 11:54
@NyCodeGHG
Copy link
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 383876


x86_64-linux

⏩ 6 packages marked as broken and skipped:
  • froide
  • froide-govplan
  • froide-govplan.dist
  • froide.dist
  • python312Packages.froide
  • python312Packages.froide.dist
✅ 19 packages built:
  • pinnwand
  • pinnwand.dist
  • playwright-test
  • python312Packages.django-filingcabinet
  • python312Packages.django-filingcabinet.dist
  • python312Packages.great-tables
  • python312Packages.great-tables.dist
  • python312Packages.pytest-playwright
  • python312Packages.pytest-playwright.dist
  • python312Packages.shiny
  • python312Packages.shiny.dist
  • python313Packages.django-filingcabinet
  • python313Packages.django-filingcabinet.dist
  • python313Packages.great-tables
  • python313Packages.great-tables.dist
  • python313Packages.pytest-playwright
  • python313Packages.pytest-playwright.dist
  • python313Packages.shiny
  • python313Packages.shiny.dist

Copy link
Member

@phaer phaer left a comment

Choose a reason for hiding this comment

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

In favor of this! Chromium was the only browser we supported for playwright for quite a while, until #298944 was merged.


@kalekseev's suggestion of playwright-browsers.withBrowsers also makes sense to me, as the current mechanism could use a cleanup after so many iterations, but that doesn't need to happen in this PR IMO.

@NyCodeGHG NyCodeGHG force-pushed the playwright-chromium branch from bf27800 to d5625d7 Compare May 9, 2025 08:15
NyCodeGHG added 2 commits May 9, 2025 12:18
Use the exact chromium version upstream uses for playwright, to prevent breaking from browser updates in nixpkgs.
@NyCodeGHG NyCodeGHG force-pushed the playwright-chromium branch from d5625d7 to 9424a47 Compare May 9, 2025 10:18
Copy link
Member

@phaer phaer left a comment

Choose a reason for hiding this comment

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

LGTM!

But such a change is probably "breaking" in a sense, so maybe lets wait until the 25.05 branch off with a merge?

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label May 13, 2025
@NyCodeGHG
Copy link
Member Author

LGTM!

But such a change is probably "breaking" in a sense, so maybe lets wait until the 25.05 branch off with a merge?

Browser updates also get backported, so this would leave 25.05 users still with a potentially broken playwright + chromium combo. I would prefer to still get this into 25.05

@phaer
Copy link
Member

phaer commented May 14, 2025

I am a pretty new committer, so don't have much experience with that. But I think the process to get this into 25.05 is do to a backport right after?

@NyCodeGHG
Copy link
Member Author

Only if the branch-off already happened, which didn't happen yet: #390768

@phaer phaer merged commit a13ba41 into NixOS:master May 19, 2025
29 checks passed
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented May 19, 2025

Successfully created backport PR for release-25.05:

@nixpkgs-ci nixpkgs-ci bot added the 8.has: port to stable This PR already has a backport to the stable release. label May 19, 2025
@NyCodeGHG NyCodeGHG deleted the playwright-chromium branch May 20, 2025 06:33
@aaronmondal
Copy link
Contributor

aaronmondal commented May 21, 2025

FYI I believe the hash for x86_64-linux is wrong:

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
  outputs = { self, nixpkgs }: {
    packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.playwright-test;
  };
}
nix run

error: hash mismatch in fixed-output derivation '/nix/store/87wxmfp51hmr4fjciww25q9bwv321l50-source.drv':
         specified: sha256-9bK8HOGoQY5kYYfJypYHeuAoVlXIh/1tv1IsXPpUTpA=
            got:    sha256-7oQQCAIt1VJiMNFEJO40K8oENK/L0BICXm2D/3fZ8bA=
error: 1 dependencies of derivation '/nix/store/d6272la60vczdwnf9hr8lpzy49hm77kz-playwright-chromium.drv' failed to build
error: 1 dependencies of derivation '/nix/store/snrv9319cwjldcd8drl1dajxp2qxi41x-playwright-browsers.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1d62fxvpmwn3x8paddpgfxsrzh4kr86d-nix-shell-env.drv' failed to build

Edit: Whoops already fixed on master: #409116

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

Labels

8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants