You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
precommit: license-check go-fix go-tidy lint test unstaged-changes
48
53
49
54
################################
@@ -392,7 +397,7 @@ playwright-install:
392
397
@if [ -z"$$PLAYWRIGHT_BROWSERS_PATH" ];then\
393
398
npx playwright install --with-deps;\
394
399
else\
395
-
echo"Skipping playwright install because PLAYWRIGHT_BROWSERS_PATH is set to $$PLAYWRIGHT_BROWSERS_PATH";\
400
+
echo"Skipping playwright install because PLAYWRIGHT_BROWSERS_PATH is set to $$PLAYWRIGHT_BROWSERS_PATH. This should have been handled by nix-develop already to prevent sudo prompt.";\
Copy file name to clipboardExpand all lines: docs/nix-setup.md
+7-19Lines changed: 7 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ make nix-setup
24
24
25
25
This will drop you into a new shell with all the required tools in your `PATH`:
26
26
27
-
- Go (1.26.1)
28
-
- Node.js (24.14.0)
29
-
- OpenJDK 25
27
+
- Go
28
+
- Node.js
29
+
- OpenJDK
30
30
- Terraform, Cloud SDK, Minikube, Skaffold, etc.
31
31
32
32
You can verify the versions by looking at the output message when you enter the shell.
@@ -107,26 +107,14 @@ Playwright's WebKit browser requires some special handling in a Nix environment
107
107
108
108
We have handled this in `flake.nix`:
109
109
110
-
1.**Correct Library Versions**: We use `libxml2_13` instead of the default `libxml2` because it provides the exact `libxml2.so.2` file WebKit expects, avoiding brittle symlink hacks.
110
+
1.**Correct Library Versions**: We use `libxml2_13` instead of the default `libxml2` because it provides the exact `libxml2.so.2` file WebKit expects, avoiding brittle symlink hacks. We also added `woff2` to support web fonts.
111
111
2.**Automatic Patching**: When you enter the shell (`nix develop`), it automatically checks if Playwright browsers are installed in `.nix/browsers`. If found, it patches the `MiniBrowser` wrapper script to preserve your `LD_LIBRARY_PATH` instead of overwriting it.
112
112
113
-
### Clean Build of the Environment
113
+
### Why we don't use `--with-deps`
114
114
115
-
If you run into issues with browsers or want to ensure a clean setup:
115
+
We do not use `npx playwright install --with-deps` in `make nix-setup` because it attempts to use the host system's package manager (like `apt`) to install dependencies. On newer Linux distributions (like Ubuntu 24.04), this can fail due to package name changes (e.g., asking for `libasound2` when only `libasound2t64` is available).
116
116
117
-
1.**Clean Playwright Cache**: Delete the cached browsers to force a redownload.
118
-
```bash
119
-
rm -rf .nix/browsers
120
-
```
121
-
2. **Re-install Browsers**: Run the install command again (inside `nix develop`).
122
-
```bash
123
-
npx playwright install
124
-
```
125
-
3. **Re-enter Shell**: Exit and re-enter `nix develop` to trigger the automatic patching again!
126
-
```bash
127
-
exit
128
-
nix develop
129
-
```
117
+
By managing dependencies in `flake.nix` and using Nix's environment, we avoid polluting the host system and prevent these distribution-specific installation failures.
0 commit comments