-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
playwright-driver: init at 1.30.1 #223382
Conversation
63fa8ba
to
b4d5fc3
Compare
I wanted to override the driver version to get newer browsers but that was not easy without this. |
I've added some reveiwers so we can get this into nixos-23-05 |
The split into dedicated packages makes sense to me, however playwright-driver is still not functional regarding firefox and maybe even darwin as a whole as this seems untested 🤷. There is also #197899 which attempts to fix firefox so that it can be used with playwright. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as far as I can tell. Package seems to build as well.
@yrd Unfortunately building says not much here because of the behavior of the original derivation. |
Yeah… At the time of writing the original derivation patching up a directory structure that matches what Playwright expects worked okay for both browsers, if I'm remembering correctly. I haven't been keeping up with Playwright development recently, so I'm not sure if something fundamental changed upstream that now actually requires their browser patches for regular operation… |
@yrd: on which system? NixOS / Linux or darwin? Does
|
driver = playwright-driver; | ||
tests = { | ||
inherit driver browsers; | ||
driver = playwright-driver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
driver = playwright-driver; | |
tests = { | |
inherit driver browsers; | |
driver = playwright-driver; | |
inherit driver; | |
tests = { | |
inherit driver browsers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
sha256 = { | ||
x86_64-linux = "0x71b4kb8hlyacixipgfbgjgrbmhckxpbmrs2xk8iis7n5kg7539"; | ||
aarch64-linux = "125lih7g2gj91k7j196wy5a5746wyfr8idj3ng369yh5wl7lfcfv"; | ||
x86_64-darwin = "0z2kww4iby1izkwn6z2ai94y87bkjvwak8awdmjm8sgg00pa9l1a"; | ||
aarch64-darwin = "0qajh4ac5lr1sznb2c471r5c5g2r0dk2pyqz8vhvnbk36r524h1h"; | ||
}.${system} or throwSystem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are using finalAttrs above, how is the hash overwriting supposed to work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as usual with overrideAttrs(...: src = )
? maybe i dont understand
}.${system} or throwSystem; | ||
} '' | ||
export PLAYWRIGHT_BROWSERS_PATH=$out | ||
${driver}/bin/playwright install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt that we are cross friendly right now but we should put driver into nativeBuildInputs to be more ready for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just code moving around, if someone wants to do cross compilation he can do it in a follow up PR
jq | ||
]; | ||
} ('' | ||
BROWSERS_JSON=${driver}/package/browsers.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be an env? Otherwise we should put it into a nix string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was just copy/pasted from the current derivation
b741b36
to
a47d041
Compare
so I've adopted most of the recommendations but just for context: this is mostly refactoring, moving code from one file to another. |
a47d041
to
1ae4115
Compare
--set SSL_CERT_FILE /etc/ssl/certs/ca-bundle.crt \ | ||
--set FONTCONFIG_FILE ${fontconfig} | ||
'' + lib.optionalString withFirefox '' | ||
FIREFOX_REVISION=$(jq -r '.browsers[] | select(.name == "firefox").revision' $BROWSERS_JSON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove as this is broken (playwright ff https://nixos.org
) or integrate this PR #197899 - however it will be easier to review if this is contributed separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw it was removed on master, I hesitated to remove it because I preferred to have firefox even if faulty but I followed your advice. I've let some (useless) nix code like withChromium
as it may be reused again once we fix+reintroduce firefox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you approve the PR in which case I'll merge and submit the node "playwright test" package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. LGTM!
it was actually moved from pkgs/development/python-modules/playwright/default.nix to its own pkgs/development/web/playwright/driver.nix . I am trying to package the typescript version of playwright and the browsers are needed there, it's more convenient to split them away from the python module. Careful playwright.browsers is not accessible anymore. Apply suggestions from code review Co-authored-by: Yannik Rödel <hey@yannik.info>
1ae4115
to
5d2cc16
Compare
Awesome, thank you @teto ! |
it was actually moved from
pkgs/development/python-modules/playwright/default.nix to its own pkgs/development/web/playwright/driver.nix .
I am trying to package the typescript version of playwright and the browsers are needed there, it's more convenient to split them away from the python module.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)