Support loading dynamic addon modules (`.node` files) when embedding the Node.js shared library without needing to link with `node.def`
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 122k
- Forks
- 37.3k
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 283
Descripción
What is the problem this feature will solve?
Node.js addon modules on Windows current import from the node.exe executable, when you build Node.js as a shared library, it reexports all the needed symbols from the node shared library from the executable using a generated node.def file.
If you embed the Node.js shared library into a different executable/program, for loading such addon modules to work, that executable will need to be linked with node.def to reexport the needed symbols.
node-gyp also adds win_delay_load_hook.cc to addons on Windows to make them work when the Node.js executable is renamed.
What is the feature you are proposing to solve the problem?
Maybe we can support loading such addon modules without this requirement?
For example, what if the delay load hook looked for an env var (e.g. NODE_LIBRARY) that it would then pass to GetModuleHandle instead of NULL if it is set, and when Node.js is built as a shared library, it would set this env var before dynamically loading a module?
Though I'm not sure what security implications such a mechanism may have...
What alternatives have you considered?
No response
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con win_delay_load_hook.cc de node-gyp y la ruta de carga de bibliotecas compartidas de Node.js descrita en el issue, incluidos node.def y GetModuleHandle. Determina un mecanismo compatible para que los programas embebidos carguen módulos .node sin enlazar node.def y define el comportamiento de seguridad; se considera terminado cuando esto funcione para Node.js embebido en Windows sin romper los ejecutables renombrados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, node.js
- Área
- operating-systems
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 32/100