Automattic / node-canvas

Node canvas is a Cairo backed Canvas implementation for NodeJS.
10.01k stars 1.15k forks source link

True multi-build install #1518

Open FelixJongleur42 opened 4 years ago

FelixJongleur42 commented 4 years ago

I wonder how and if it is possible to have a true multi-build install. The goal is to get one node_modules folder that will suffice for different platforms (especially Windows and Linux).

e.g. looking at my node_modules, "bufferutil" und "utf-8-validate" seem to do it differently?

see.

find node_modules -name "*.node" node_modules/utf-8-validate/prebuilds/darwin-x64/electron-napi.node node_modules/utf-8-validate/prebuilds/darwin-x64/node-napi.node node_modules/utf-8-validate/prebuilds/win32-x64/electron-napi.node node_modules/utf-8-validate/prebuilds/win32-x64/node-napi.node node_modules/utf-8-validate/prebuilds/linux-x64/electron-napi.node node_modules/utf-8-validate/prebuilds/linux-x64/node-napi.node node_modules/utf-8-validate/prebuilds/win32-ia32/electron-napi.node node_modules/utf-8-validate/prebuilds/win32-ia32/node-napi.node node_modules/canvas/build/Release/canvas.node node_modules/bufferutil/prebuilds/darwin-x64/electron-napi.node node_modules/bufferutil/prebuilds/darwin-x64/node-napi.node node_modules/bufferutil/prebuilds/win32-x64/electron-napi.node node_modules/bufferutil/prebuilds/win32-x64/node-napi.node node_modules/bufferutil/prebuilds/linux-x64/electron-napi.node node_modules/bufferutil/prebuilds/linux-x64/node-napi.node node_modules/bufferutil/prebuilds/win32-ia32/electron-napi.node node_modules/bufferutil/prebuilds/win32-ia32/node-napi.node

how to achieve this with canvas? "canvas-prebuilt" does not seem an option. For reference, see Wiki: https://github.com/Automattic/node-canvas/wiki/Installation:-Prebuilt

zbjornson commented 4 years ago

Each prebuild is downloaded separately because bundling them all together would be a >250 MB download. Once we move to N-API it will be significantly smaller and potentially possible. What's your goal -- do you want to be able to move your node_modules to another OS and have it work without actually reinstalling?

FelixJongleur42 commented 4 years ago

Yes, that would be my goal. I'm trying to build an multi-os install package for target machines (with either Windows or Linux) that do not have internet access. And I want the contents of node_modules to be deterministic.