fix(ci): actually compile the native audio module, and prove it
OpenSSF Scorecard / Scorecard analysis (push) Waiting to run
CI / Build & test (Node 20) (push) Canceled after 0s
CI / Build & test (Node 24) (push) Canceled after 0s
CI / Build & test (push) Canceled after 0s
CodeQL / Analyze (javascript-typescript) (push) Canceled after 0s
Security / Secret scan (gitleaks) (push) Canceled after 0s
Security / Dependency scan (OSV-Scanner) (push) Canceled after 0s
Security / IaC/config scan (Trivy) (push) Canceled after 0s
Security / License compliance scan (Trivy) (push) Canceled after 0s
OpenSSF Scorecard / Scorecard analysis (push) Waiting to run
CI / Build & test (Node 20) (push) Canceled after 0s
CI / Build & test (Node 24) (push) Canceled after 0s
CI / Build & test (push) Canceled after 0s
CodeQL / Analyze (javascript-typescript) (push) Canceled after 0s
Security / Secret scan (gitleaks) (push) Canceled after 0s
Security / Dependency scan (OSV-Scanner) (push) Canceled after 0s
Security / IaC/config scan (Trivy) (push) Canceled after 0s
Security / License compliance scan (Trivy) (push) Canceled after 0s
The previous run went green and produced an installer with no system-audio capture in it — the exact silent failure this module exists to prevent. Two causes. electron-rebuild takes -w as one comma-separated list, not a repeated flag; passing it twice made argv.w an array and the CLI threw 'argv.w.split is not a function', which also broke uiohook-napi's rebuild that had been working. And pnpm 10 refuses to run a dependency's build script unless it is listed in onlyBuiltDependencies, so node-gyp never ran for it at all — the log said 'Ignored build scripts' and nothing else complained. Neither surfaced because desktop's postinstall ends in , which exists so contributors without build tools can install. That is reasonable locally and dangerous in CI, so the workflow now asserts a compiled .node exists and fails loudly when it does not, instead of trusting an exit code that was designed to lie.
This commit is contained in:
@@ -60,6 +60,22 @@ jobs:
|
|||||||
- name: Build shared package
|
- name: Build shared package
|
||||||
run: pnpm --filter @backspace/shared build
|
run: pnpm --filter @backspace/shared build
|
||||||
|
|
||||||
|
# O postinstall termina em `|| console.warn` para que quem não tem
|
||||||
|
# ferramentas de build consiga instalar. No CI isso transforma falha em
|
||||||
|
# sucesso silencioso: o instalador sai sem o módulo nativo e o app
|
||||||
|
# compartilha tela sem som, sem erro nenhum. Então verifica-se o
|
||||||
|
# resultado em vez de confiar no código de saída.
|
||||||
|
- name: Verify native audio module compiled
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
found=$(find node_modules/.pnpm -path '*electron-native-screenshare*' -name '*.node' 2>/dev/null | head -5)
|
||||||
|
if [ -z "$found" ]; then
|
||||||
|
echo "::error::electron-native-screenshare has no compiled .node — the installer would ship without system-audio capture"
|
||||||
|
find node_modules/.pnpm -maxdepth 1 -name 'electron-native-screenshare*' -printf '%p\n' 2>/dev/null || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "OK:"; echo "$found"
|
||||||
|
|
||||||
- name: Compile desktop TypeScript
|
- name: Compile desktop TypeScript
|
||||||
working-directory: packages/desktop
|
working-directory: packages/desktop
|
||||||
run: pnpm exec tsc
|
run: pnpm exec tsc
|
||||||
|
|||||||
+3
-2
@@ -2,7 +2,7 @@
|
|||||||
"name": "backspace",
|
"name": "backspace",
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Open, self-hosted communication platform — text, voice, video, and federation",
|
"description": "Open, self-hosted communication platform \u2014 text, voice, video, and federation",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"author": "Jannis Braun",
|
"author": "Jannis Braun",
|
||||||
"homepage": "https://github.com/TheZwiss/backspace",
|
"homepage": "https://github.com/TheZwiss/backspace",
|
||||||
@@ -32,8 +32,9 @@
|
|||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"better-sqlite3",
|
"better-sqlite3",
|
||||||
"esbuild",
|
|
||||||
"electron",
|
"electron",
|
||||||
|
"electron-native-screenshare",
|
||||||
|
"esbuild",
|
||||||
"sharp"
|
"sharp"
|
||||||
],
|
],
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"clean": "rm -rf dist dist-electron",
|
"clean": "rm -rf dist dist-electron",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"postinstall": "electron-rebuild -f -w uiohook-napi -w electron-native-screenshare || node -e \"console.warn('[desktop] uiohook-napi native rebuild skipped - needs build tools (make, g++, python3). Only required to RUN the desktop app; the server, web client, and Docker image are unaffected.')\""
|
"postinstall": "electron-rebuild -f -w uiohook-napi,electron-native-screenshare || node -e \"console.warn('[desktop] uiohook-napi native rebuild skipped - needs build tools (make, g++, python3). Only required to RUN the desktop app; the server, web client, and Docker image are unaffected.')\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-native-screenshare": "^1.2.0",
|
"electron-native-screenshare": "^1.2.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user