Comments (4)
I think in general @electron/rebuild
can be smarter around napi binaries. The problem is it's quite hardly to safely know if the native module is truly an napi module, I've seen some napi modules that still for whatever reason call nan
or v8
methods directly 🙃
Do you have a ref to your module? Would probs help someone look into this with a "repro case"
from rebuild.
Ideally I should be able to put something in my package.json which says 'Im node-api, trust me'. If I was to do that and still use nan
or v8
or something, then its clearly a bug in my library.
But I am not sure if this will be good enough for platforms where I don't provide prebuilds, which could be an issue in some scenarios.
I think electron-builder approaches this by invoking the install
script for the package (with some env variables set to tell it to run for another target), under the assumption that a library will need to use that script to ensure it has an appropriate binary.
This came out of https://github.com/Julusian/node-midi, from a user issue, which includes a reproduction https://github.com/navelpluisje/midi-electron-test.
On ubuntu/debian, building the module requires the libasound2-dev
package to be installed.
Another example which I assume will also be rebuilt, (I haven't verified) is https://github.com/julusian/node-jpeg-turbo. Which uses a tool yasm
to process some assembly as part of the compilation. If that tool was not found it will fallback to c implementations, costing performance.
from rebuild.
I think in general
@electron/rebuild
can be smarter around napi binaries. The problem is it's quite hardly to safely know if the native module is truly an napi module, I've seen some napi modules that still for whatever reason callnan
orv8
methods directly 🙃Do you have a ref to your module? Would probs help someone look into this with a "repro case"
Yeah , such as level
, It has prebuild binary, don`t need rebuild on pack;On my project , rebuild failed , Appreciate if you can take a look classic-level rebuild failed
from rebuild.
I have some libraries which provide node-api prebuilds for all common platforms. This means that electron-rebuild should almost never need to rebuild my library. Rebuilding it forces users to spend more time waiting for the rebuild to happen, and can require them to install some dependencies/tools for the rebuild to succeed. (In one, there is an optional tool that if available will produce a more performant binary).
So ultimately, the forced rebuild is hurting users, with little/no benefit. Is there either:
- A way I can mark my library as not needing to be rebuilt? Perhaps a flag I should be setting in the
package.json
?- A way that users can tell electron-rebuild to ignore my library? They could use
--only
to do this, but it would be much better to be able to ignore a specific dependency instead of having to name all but one explicitly
I checked the doc, maybe below can help. add below in forge.config.js
rebuildConfig: {
onlyModules: [],
},
from rebuild.
Related Issues (20)
- How to rebuild .node file without existing in a node_module?
- Error related to `.forge-meta` file HOT 1
- GCC_PREFIX_HEADER & GCC_PRECOMPILE_PREFIX_HEADER incompatible with Electron 20
- error rebuild canvas on Windows HOT 3
- Rebuilding node-canvas with electron-rebuild fails HOT 4
- Could not detect abi for version 22.3.3 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron at getAbi HOT 8
- no file node_modules/.bin/electron-rebuild in 3.2.11 HOT 1
- Error when rebuilding node-java package HOT 1
- Python 2 died 1,259 days ago on 1/1/2020. Why still use it? HOT 1
- Cross Compile on Linux
- Help using rebuild to package node-sqlite3 to use with Electron HOT 2
- ERR_REQUIRE_ESM HOT 1
- Follow OS conventions for storing cache
- it is not rebuilding for electron from the package root HOT 2
- need to upgrade node-gyp HOT 6
- Complains for deprecated move-file
- @electron/rebuild ignores symlinks for native modules, which crashes the application HOT 1
- Module build fails with empty binding.gyp HOT 3
- Windows CI Failing
- Not rebuilding with --which-module argument
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rebuild.