-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
Build failure: playwright #215450
Comments
Is there a way to make nix use the Microsoft |
Can we create a single |
That would be what's called an IFD, which is not allowed in the Nixpkgs repository because it hinders parallelism while building.
That's correct.
We've actually had this discussion before: #184511 (comment). Personally, I still don't think there's a need to split up the package any further than it already is. Correct me if I'm wrong, but Python shouldn't be a dependency on |
thanks, I seemed to have missed #184511 in my previous search. |
After a quick second review, I can confirm that the official nix package As this is a Python library it is not built to be used as a cli tool but rather imported into a Nix-packaged Python project. EDIT: I was just reading further and I might still be missing a few things... |
no, just tried to install dependencies with the CLI and no luck... It doesn't know how to install from Nix, it is looking for Ubuntu...
|
The thing is I know the browser dependencies are installed as I have |
Okay, a few points here:
Example$ nix build --impure --expr 'with builtins; with getFlake "nixpkgs"; legacyPackages.x86_64-linux.python3.withPackages (p: [p.playwright])'
$ ./result/bin/python -m playwright
Usage: playwright [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
open [options] [url] open page in browser specified via -b, --browser
codegen [options] [url] open page and generate code for user actions
install [options] [browser...] ensure browsers necessary for this version of Playwright are installed
install-deps [options] [browser...] install dependencies necessary to run browsers (will ask for sudo permissions)
cr [options] [url] open page in Chromium
ff [options] [url] open page in Firefox
wk [options] [url] open page in WebKit
screenshot [options] <url> <filename> capture a page screenshot
pdf [options] <url> <filename> save page as pdf
show-trace [options] [trace...] show trace viewer
help [command] display help for command
All in all, if you want a CLI, try this one-liner: PLAYWRIGHT_BROWSERS_PATH=$(nix build --print-out-paths --no-link nixpkgs#playwright.browsers) nix run nixpkgs#playwright -- open nixos.org
As mentioned above, the Nixpkgs package currently points to
You probably have system-wide Firefox and / or Chrome installations, which are completely independent of Playwright. In fact, this is also the case when using Playwright on non-Nix(OS), since |
Thank you very much for the script, it worked beautifully. This is advanced magic that I need to learn! Finally, my main and last question is this, how can I setup my Thank you very much for your help. 😀 Maybe we need a |
Ah, now I see what you're trying to do 😉 If you're only looking for the CLI, try something like this: {
users.users.myuser.packages = [
(pkgs.runCommand "wrapped-playwright" {} ''
mkdir -p "$out/bin"
makeWrapper "${pkgs.playwright}/bin/playwright" "$out/bin/playwright" \
--set PLAYWRIGHT_BROWSERS_PATH "${pkgs.playwright.browsers}
}))
];
} This will create a new package with a single binary |
Thank you very much.
Ran:
I tried to add Should I start making a "sub" config where these special wrapper commands go? |
Dammit, I forgot to add
Edit: If you want to learn more about |
Worked like a charm!
|
I used to use Arch BTW... lol |
Awesome, glad to hear! |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/running-playwright-tests/25655/1 |
Should the
my config: users.users.omega = {
packages = with pkgs; [
playwright
(runCommand "wrapped-playwright" { buildInputs = [ makeWrapper ]; } ''
mkdir -p "$out/bin"
makeWrapper "${playwright}/bin/playwright" "$out/bin/playwright" \
--set PLAYWRIGHT_BROWSERS_PATH "${playwright.browsers}"
'')
];
}; |
There was a bit of shuffling recently and playwright.browsers does'nt exist anymore pkgs/development/python-modules/playwright/default.nix . You can use |
This went through now, thank you: users.users.omega = {
packages = with pkgs; [
playwright
(runCommand "wrapped-playwright" { buildInputs = [ makeWrapper ]; } ''
mkdir -p "$out/bin"
makeWrapper "${playwright}/bin/playwright" "$out/bin/playwright" \
--set PLAYWRIGHT_BROWSERS_PATH "${playwright-driver.browsers}"
'')
];
}; But when I did a
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/running-playwright-tests/25655/8 |
@pbek the browsers installed by |
I need to get back to a system where I don't have nixos on first to produce a working playwright test. 😆 |
I took this over to #227071 (comment). |
DISCLAIMER: I just installed NixOS for the first time (about a week ago) and I am IN LOVE!!! (and have a lot of passion right now) so excuse any over the top excitment
Steps To Reproduce
Steps to reproduce the behavior:
playwright
on NixOS via theconfiguration.nix
playwright install
command after installBEWARE: your OS is not officially supported by Playwright; downloading fallback build.
playwright
commands after that you get the error (see at the end):Additional context
Here is the BUG on the playwright's github package](microsoft/playwright#5501)
It sounds like they are willing to support NixOS if only someone from the Nix community will help them with the dependency management.
(This is what Nix does best people! Let's do this!)
Notify maintainers
@techknowlogick
@yrd
@SuperSandro2000
Metadata
The text was updated successfully, but these errors were encountered: