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
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -290,6 +290,44 @@ The project uses **electron** - a local MCP tool for inspecting and debugging th
290
290
291
291
---
292
292
293
+
## CI / Linux E2E pipeline debugging
294
+
295
+
### Architecture constraints on Apple Silicon
296
+
297
+
Full E2E simulation on Apple Silicon (arm64 Mac) is **not feasible** locally:
298
+
299
+
-`act` with arm64 catthehacker images: wdio downloads an x86_64 Chromedriver → `rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2`
300
+
-`act --container-architecture linux/amd64` (QEMU): act injects its own arm64 node into the amd64 container → `node: executable file not found in $PATH`
301
+
- Native arm64 Docker containers: Electron runs, but Chromedriver is always fetched as x86_64
302
+
303
+
**Definitive validation requires pushing to GitHub and letting the real `ubuntu-latest` (x86_64) runners execute the E2E suite.**
304
+
305
+
### Known Linux CI gotchas
306
+
307
+
-**D-Bus deadlock**: `autoUpdater.checkForUpdates()` in `electron-updater` makes a blocking D-Bus IPC call on Linux when the system D-Bus daemon is running (always present on `ubuntu-latest`). In E2E mode, this deadlocks the Electron main process before the renderer loads. **Fix**: guard `startUpdateCheck()` with `if (!isE2EMode)` in `app/src/main/index.ts`. The `isE2EMode` flag is set when `process.argv.includes('--sproutgit-e2e')`, which wdio passes when launching Electron.
308
+
-**Headless display**: Electron requires a display server on Linux. Wrap the E2E command with `xvfb-run --auto-servernum --server-args="-screen 0 1280x800x24"` and ensure `xvfb` is installed in the apt-get step.
309
+
-**Sandbox**: pass `--no-sandbox --disable-setuid-sandbox` to Electron in CI (already in `wdio.conf.ts`).
310
+
311
+
### Proving a Linux-specific hang locally (arm64 Docker)
312
+
313
+
To confirm whether a code path causes a main-process freeze on Linux with D-Bus present, use the cached `sproutgit-dbus-proof-arm64:latest` Docker image:
314
+
315
+
```bash
316
+
# Build the app inside the container, start Xvfb + D-Bus, run Electron for 5s,
317
+
# and check whether the renderer emitted any log lines.
318
+
docker run --rm \
319
+
-v "$(pwd):/src:ro" \
320
+
-v "/tmp/your-proof.sh:/proof.sh:ro" \
321
+
sproutgit-dbus-proof-arm64:latest \
322
+
bash /proof.sh
323
+
```
324
+
325
+
Key detection heuristic: after 5 seconds, if no `[renderer]` lines appear in the Electron log, the main process is frozen (D-Bus deadlock). If `[renderer]` lines appear, the app is alive.
326
+
327
+
The image already has: ubuntu 24.04, Node 22, pnpm, xvfb, dbus, all Electron system deps. Rebuild it with `docker build -t sproutgit-dbus-proof-arm64:latest .` from a Dockerfile that installs those deps if it becomes stale.
328
+
329
+
---
330
+
293
331
## Common pitfalls
294
332
295
333
-**Don't import from `old/`** — it's the Tauri/SvelteKit source for reference only.
0 commit comments