Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix(build): the ONNX requirement must not apply to Intel Macs
EtienneLescotd4df7c65e304
diff --git a/scripts/before-pack.cjs b/scripts/before-pack.cjsindex 02a1d9fd7..4b97a35a3 100644--- a/scripts/before-pack.cjs+++ b/scripts/before-pack.cjs@@ -68,20 +68,27 @@ const HELPER_SOURCE_PATHS = [* `mac.extraResources` ships this directory wholesale (`filter: ["darwin-*/*"]`), so* "present here" is the same thing as "present in the installed app".*/+/**+ * L'exigence ONNX Runtime de macOS, séparée parce qu'elle ne vaut QUE sur arm64.+ *+ * L'amont ne publie aucun binaire ONNX pour les Macs Intel : `fetch-onnxruntime.mjs` le constate+ * et sort en 0 sans rien poser. Un paquet x64 sans la bibliothèque est donc CORRECT, et l'exiger+ * là ferait échouer à l'empaquetage une build parfaitement saine — la garde se retournerait+ * contre ce qu'elle protège.+ *+ * Sur arm64 en revanche son absence ne casse rien de visible : `Segmenter::load` refuse, le+ * compositeur dessine la webcam telle quelle, et le contrôle disparaît de l'éditeur. Le paquet+ * est silencieusement amputé, ce qui est exactement la panne que cette garde existe pour+ * attraper et qu'aucun test ne peut voir puisque tout se dégrade proprement.+ */+const MAC_ONNX_REQUIRED = {+ match: (name) => name === "libonnxruntime.dylib",+ what: "the ONNX Runtime library the camera-background segmentation loads",+ breaks: "the camera-background control vanishes from the editor and every effect is a no-op",+ fix: "Stage it with:\n\n npm run fetch:onnxruntime",+};+const MAC_REQUIRED = [- // Pas d'entrée sur x64 : l'amont ne publie aucun binaire ONNX pour les Macs Intel, donc un- // paquet Intel SANS la bibliothèque est correct. `fetch-onnxruntime.mjs` le dit et sort en 0.- // L'effet de fond de caméra est le seul dont la présence dépend d'un binaire optionnel, et- // son absence ne casse RIEN de visible : `Segmenter::load` refuse, le compositeur dessine la- // webcam telle quelle, et le contrôle disparaît de l'éditeur. Un paquet livré sans elle est- // donc silencieusement amputé — la panne exacte que cette garde existe pour attraper, et- // celle qu'aucun test ne peut voir puisque tout se dégrade proprement.- {- match: (name) => name === "libonnxruntime.dylib",- what: "the ONNX Runtime library the camera-background segmentation loads",- breaks: "the camera-background control vanishes from the editor and every effect is a no-op",- fix: "Stage it with:\n\n npm run fetch:onnxruntime",- },{match: (name) => name === "compositor_view.node",what: "the Metal compositor addon",@@ -454,10 +461,13 @@ function checkWinNativePayload() {}function checkMacNativePayload(context) {- const dir = path.join(ROOT, "electron", "native", "bin", `darwin-${archTagFor(context)}`);+ const arch = archTagFor(context);+ const dir = path.join(ROOT, "electron", "native", "bin", `darwin-${arch}`);checkNativePayload({dir,- required: MAC_REQUIRED,+ // Voir `MAC_ONNX_REQUIRED` : exiger la bibliothèque sur Intel ferait échouer une build+ // que l'amont rend impossible à satisfaire.+ required: arch === "arm64" ? [...MAC_REQUIRED, MAC_ONNX_REQUIRED] : MAC_REQUIRED,osLabel: "macOS",bundleNoun: "the .app",emptyDirFix: `${FIX_MAC}\n\nThe STT helper and the capture helper are separate builds — see\ntechnical-documentation/engineering/build-and-packaging.md.`,diff --git a/src/native/contracts.ts b/src/native/contracts.tsindex 14108ddb7..7e7fc11c9 100644--- a/src/native/contracts.ts+++ b/src/native/contracts.ts@@ -134,7 +134,8 @@ export interface CompositorBackendResult {* `"no-runtime"` — no ONNX Runtime library. Upstream publishes none for Intel Macs, and a dev* checkout or a `--dir` build has none staged either.* `"no-model"` — the runtime is there but the `.onnx` does not resolve.- * `"none"` — no native addon at all; the pure-web/dev case, not a degraded machine.+ * `"none"` — no usable native addon: none loaded at all (the pure-web/dev case), or one+ * too old to answer the probe. Not a degraded machine, and not a verdict on the runtime.** Asked rather than guessed. Gating on `process.platform` was wrong in both directions: it hid* the control on a Linux box that could segment, and showed it on an Intel Mac that never can. */