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

Serialport prebuilds removed by NFT - PR coming soon #413

Closed
RogerHardiman opened this issue May 3, 2024 · 3 comments
Closed

Serialport prebuilds removed by NFT - PR coming soon #413

RogerHardiman opened this issue May 3, 2024 · 3 comments

Comments

@RogerHardiman
Copy link
Contributor

Hi
The nodeJS SerialPort module comes with a prebuilds folder with .node files for Windows, Mac, Linux (32 and 64 bit variants, and glibc and musl variants)
Because it uses a runtime generated path to select which .node file to load, NFT will remove these files.

I've used the special-cases code to add in a rule for @serialport/bindings-cpp.

It is working great so I'll fork and do a Pull Request for you.

I noticed you had code to detect .node files from bind.js, but the paths that parses does not include a prebuilds, with sub folders for each OS, Arch and C Library, so think special-cases is the place to fix this.

@RogerHardiman
Copy link
Contributor Author

For info, my patch on the installed nft (ie in Javascript) is

    '@serialport/bindings-cpp'({ id, emitAssetDirectory }) {
        if (id.endsWith('@serialport/bindings-cpp/dist/index.js')) {
            // SerialPort ships with prebuilt .node files for multiple OS and Arch types
            emitAssetDirectory((0, path_1.resolve)((0, path_1.dirname)(id), '..', 'prebuilds'));
        }
    },

I'm off to add this at the Typescript level next

@RogerHardiman
Copy link
Contributor Author

Pull Request #415 submitted to fix this issue

@RogerHardiman
Copy link
Contributor Author

many thanks for merging in the PR.
Also thanks for PKG and for NCC, both of which I've used in the past, so glad I could contribute something back.

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

No branches or pull requests

1 participant