Comments (12)
Sorry, I've been busy at work and these notifications went to my personal email (since they weren't on work repo) and I missed them. We lowered the priority of moving to node-crc@2
and have been digging in to a few other things lately. I don't have any code to share, I only got as far as playing with prebuildify
to learn a bit before I tried to get it working on this codebase.
from node-crc.
Leaving some links here for documentation:
- Linux:
- gnu/musl detection: https://github.com/lovell/detect-libc
- rust flag-fix: rust-lang/cargo#7154 (comment)
- macOS
- Windows:
- need to be considered? sharkdp/fd#726
from node-crc.
I think this a great idea. Any PR is welcome!
from node-crc.
Using prebuild binaries would probably solve #8 too.
from node-crc.
@wraithan how are your plans regarding this? If you don't plan a PR soon, I would give it a try...
from node-crc.
@wraithan are you still there? Any comment on this?
from node-crc.
I also gave prebuildify
a short try today, but getting this error when running prebuildify --all --strip
:
node:events:371
throw er; // Unhandled 'error' event
^
Error: spawn node-gyp ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:480:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:480:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn node-gyp',
path: 'node-gyp',
spawnargs: [
'rebuild',
'--target=5.0.0',
'--devdir=/var/folders/79/20rjf5910x9c32y41kvvtcv80000gn/T/prebuildify/node',
'--target_arch=x64',
'--release'
]
}
from node-crc.
So I finally found the time to search for a solution, first I was playing around with napi-rs. It was possible to produce a prebuild binary which can be used with require
(see rafaelmaeuer/node-crc/tree/dev/napi).
Then I found out, that cargo already produces the prebuild-binary index.node
which can be used as main
file in package.json. Mocca-Tests are still passing and I tested it in docker without the need of installing the rust toolchain.
I have made the following PR, please review and test it: #12
from node-crc.
Just found this error in github-actions:
Error: /home/runner/work/***/***/node_modules/node-crc/index.node: invalid ELF header
Seems like pre-compiling need to handle all the possible OS (win/mac/linux) and platform types (x86/x64/arm64/aarch64).
from node-crc.
After learning about the necessity of cross-platform binaries (invalid ELF header
in Github actions) I ended up writing a build-script based on cross-rs and rustup/cross-compilation which can produce binaries for following platforms:
- macOS x64
- macOS ARM64
- Linux x64 (gnu/musl)
- Linux x86 (gnu/musl)
- Linux ARM64 (gnu/musl)
- Windows x64
- Windows x86
I slightly modified the lib to load the correct binary on each platform, I updated #12 accordingly.
from node-crc.
@magiclen would you mind reviewing or commenting on it?
from node-crc.
@rafaelmaeuer Thank you for everything you have done. My idea is to separate the precompiled .node
files and automatically download them from the internet during the npm install node-crc
stage. If the download fails, then local compilation will be performed.
I guess we need a script to build the .node
files for different architectures and upload them to github releases. And when running npm install node-crc
, we need a script to detect the environment and download the corresponding .node
file or run the compilation.
from node-crc.
Related Issues (10)
- Error: Cannot find module '../index.node' HOT 1
- crc64 can't get right answer HOT 4
- [Q] How to do a CRC8 HOT 5
- Dynamically import crc algorithm HOT 1
- Installation errors HOT 1
- How to carry out crc16 MODBUS HOT 3
- cant npm install the pacakge HOT 4
- Add changelog?
- Error installing ^2.0.0 with yarn HOT 8
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 node-crc.