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

Compatibility of build/Release/simpleble.node #132

Open
cwilling opened this issue Dec 2, 2023 · 4 comments
Open

Compatibility of build/Release/simpleble.node #132

cwilling opened this issue Dec 2, 2023 · 4 comments

Comments

@cwilling
Copy link

cwilling commented Dec 2, 2023

When running any example, the supplied simpleble.node generates an error:

chris@d8:~/src/webbluetooth$ node examples/selector.js 
/home/chris/src/webbluetooth/node_modules/bindings/bindings.js:121
        throw e;
        ^

Error: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /home/chris/src/webbluetooth/build/Release/simpleble.node)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at bindings (/home/chris/src/webbluetooth/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/home/chris/src/webbluetooth/dist/adapters/simpleble.js:29:36)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'ERR_DLOPEN_FAILED'
}

I can fix this locally by running npm run build:all which generates a new simpleble.node and everything works fine.

I initially thought the error would be due to your build machine having a glibc version which is too recent for what I have on the machine I'm using. I see in your .github/workflows/prebuild.yml that linux-x64 jobs run on ubuntu-latest and maybe that is a problem for other systems out in the wild (not everyone wants/is able to run the very latest). However I also tried all this on another machine running Ubuntu 22.04 (full updated) and had the same issue so I'm a bit confused.

@thegecko
Copy link
Owner

thegecko commented Dec 2, 2023

@cwilling to help me tie down the issue, can you confirm if this is broken in the released versions? I know you were testing with some unreleased binaries.

@cwilling
Copy link
Author

cwilling commented Dec 2, 2023

On a fresh machine, a git clone (after pull of #131), submodule update & npm install results in a simpleble.node dated Aug 23 i.e. the old version. If I replace it with the artifacts version from earlier today (Dec 2 05:30), all works OK. Also OK if I do npm run build:all - a good version of simpleble.node is produced.

The problem is therefore that npm install doesn't pull the correct simpleble.node. I see that I have a file ~/.npm/_prebuilds/673995-webbluetooth-v3.1.0-napi-v6-linux-x64.tar.gz which I presume is what provides the (wrong) simpleble.node.

@cwilling
Copy link
Author

cwilling commented Dec 2, 2023

However back on my normal machine with glibc-2.33, even the newer artifacts version fails because it wants glibc-2.34. In that case the only solution is to rebuild simpleble.node locally.

I'm not sure there's anything you can do about that - probably a result of ubunt-latest in your workflow.

@thegecko
Copy link
Owner

thegecko commented Dec 2, 2023

OK, I think the best fix for this will be to use prebuildify-cross in a similar way to how we do it in node-usb.
This will require prebuildify to support cmake-js, which I'll look in to.

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

2 participants