Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Please provide CPU agnostic binaries of the native module. #131

Closed
egandro opened this issue Mar 4, 2021 · 4 comments
Closed

Please provide CPU agnostic binaries of the native module. #131

egandro opened this issue Mar 4, 2021 · 4 comments

Comments

@egandro
Copy link

egandro commented Mar 4, 2021

There are some bugs with this:

microsoft/vscode-arduino#1207
#124

The main issue is an architecture specific module:

node_modules/usb-detection/build/Release $ file detection.node 

detection.node: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=97745d38cf6d793b9fbccd3dbbc5dae6ad88c705, stripped

I don't really know how to handle this. In an enterprise enviornment we would go with a build farm, that is creating binaries for

  • Linux (x86_64, x86?, arm64, armv7l)
  • macOS (x86_64, arm)
  • Windows?

No idea how we should deal with an Opensource project.

I guess - as Microsoft has an issue with this on VS Code for arm, too - you might get help. @adiazulay is the maintainer of the Arduino Plugin for VS Code.

Maybe we can just ripp the npm in parts? (make linux-x86_64 default and let the community deal with their archs)

  • node-usb-detection-driver-linux-x86
  • node-usb-detection-driver-linux-arm64
  • node-usb-detection-driver-linux-armv7l
  • ...

Within the specific driver you provide a getVersion() and this must match the the main implementation?

@todbot
Copy link

todbot commented Mar 4, 2021

This library requires OS-specific bindings compiled for a specific architecture, so I'm not sure what you mean by "CPU agnostic binaries"? As a convenience, the maintainers offer "prebuilds" of the bindings for the most common architectures. It sounds like what you're asking is to provide architecture-specific prebuilds for additional architectures? I don't understand what you're asking.

@MadLittleMods
Copy link
Owner

It's also unclear to me what your question is and what you're asking for.

Maybe you're looking for a rewrite with the N-API and make the code context-aware? There is a open PR for that but still needs some work: #127

@egandro
Copy link
Author

egandro commented Mar 5, 2021

This library requires OS-specific bindings compiled for a specific architecture, so I'm not sure what you mean by "CPU agnostic binaries"?

Provide these binaries :) In electron apps - e.g. like VS the plugin is not recompiled if it is bundled.

@MadLittleMods
Copy link
Owner

MadLittleMods commented Mar 5, 2021

@egandro There are already prebuild binaries for Electron, see https://github.com/MadLittleMods/node-usb-detection/releases/tag/v4.10.0 for example with the whole list.

Those are automatically used when you're installing the library (npm install usb-detection). If it's not using one of those binaries already for you, which one is missing for your platform? (Which version of Electron? What OS? etc)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants