mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
build(deps): declare node-gyp for the embedded MPV native build (#1625)
`apps/electron-backend/build-embedded-mpv.js` resolves the compiler with
`require.resolve('node-gyp/bin/node-gyp.js')` and its comment claimed the
package was "a declared devDependency" — it never was. node-gyp reached the
tree only as a transitive of `@electron/rebuild`, in pnpm's hidden hoist
(`node_modules/.pnpm/node_modules`). pnpm's `.bin` shims export that
directory on NODE_PATH, which is why `pnpm nx …`, `pnpm run build:backend`
and CI kept building the addon, while a plain
`node apps/electron-backend/build-embedded-mpv.js` on a clean install failed
with "Unable to resolve node-gyp".
Declare node-gyp 12.4.0 (the version already in the lockfile store) as a root
devDependency so the resolution no longer depends on a shim implementation
detail, correct the stale comment, and record the contract in the
embedded-MPV architecture doc plus the Agent Bootstrap notes.
No packaged-build change: the no-runtime skip and its
`embedded-mpv-unavailable.txt` marker are untouched.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
c016c73f86
commit
634a66b1e4
7 files changed
+43
-5
No files matched your search
@@ -987,6 +987,13 @@ The Electron main process holds an `electron.powerSaveBlocker` of type `prevent-
|
||||
Current development behavior:
|
||||
|
||||
- The addon build supports `darwin`, `win32`, and `linux`; Windows and Linux builds require running on that target OS.
|
||||
- The addon is compiled by upstream `node-gyp`, declared as a root
|
||||
`devDependency` and resolved with `require.resolve` in
|
||||
`apps/electron-backend/build-embedded-mpv.js`. That resolution must not rely
|
||||
on the `NODE_PATH` that pnpm's `.bin` shims export: it only reaches pnpm's
|
||||
hidden hoist (`node_modules/.pnpm/node_modules`), so an undeclared
|
||||
`node-gyp` works under `pnpm nx …` and in CI but fails from a plain
|
||||
`node apps/electron-backend/build-embedded-mpv.js` on a clean install.
|
||||
- The build script first looks for staged inputs at `vendor/embedded-mpv/<platform>-<arch>/`. On Linux, local development can fall back to distribution `libmpv-dev` headers and libraries. `LIBMPV_INCLUDE_DIR` overrides the header root. `LINUX_NATIVE_LIBRARY_DIR` is a link-time override and must name a directory already visible to the system dynamic loader; it is never inherited as helper `LD_LIBRARY_PATH`.
|
||||
- When the staged-input path is used, it must contain `include/mpv/client.h`,
|
||||
`runtime-manifest.json`, and the platform runtime/build files. The Linux
|
||||
|
||||
Reference in new issue
Block a user