Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for publishing NPM modules with binary targets #131

Open
2 tasks
sehz opened this issue Jan 12, 2021 · 3 comments
Open
2 tasks

Support for publishing NPM modules with binary targets #131

sehz opened this issue Jan 12, 2021 · 3 comments
Labels
build help wanted Extra attention is needed nj-cli

Comments

@sehz
Copy link
Collaborator

sehz commented Jan 12, 2021

node-bindgen is primary used for building native-modules using Rust. However, it assumes that consume of the modules has rust/cargo toolschain installed and expected to use to build modules. We need to enable for non rust users to consume the modules.

In order to do so we should do following

  • Enhance Nj-cli to publish NPM modules with binaries bundles in. It should have list of rust target that should be included in the published module. For example: [x86_64-apple-darwin, x86_64-unknown-linux-gnu].
  • When modules are installed, it should only keep binaries that are specific to host
@sehz sehz added help wanted Extra attention is needed nj-cli labels Jan 14, 2021
@simlay simlay self-assigned this Feb 8, 2021
@diegopy
Copy link

diegopy commented Mar 4, 2021

Regarding your 2nd point, there are at least two ways of doing it:

  1. Bundle the binaries for all platforms in the npm package itself, then post-install just link the relevant one and ignore/discard the rest.
  2. Keep the binaries packaged as github releases, not on the npm package. The npm package will download the relevant binary post install. We get a smaller npm package in exchange for an extra download during package installation.

Thoughts?

@sehz
Copy link
Collaborator Author

sehz commented Aug 14, 2021

Thanks for suggestion. Building binaries for different platform seems to be one of the pain points. This need to be higher priority

@sehz sehz added the build label Aug 14, 2021
@sehz
Copy link
Collaborator Author

sehz commented Aug 14, 2021

I agree. First is to support loading binaries from anywhere including GitHub release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build help wanted Extra attention is needed nj-cli
Projects
None yet
Development

No branches or pull requests

3 participants