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

Node sqlite3 dependency only distributed for macOS/Darwin platforms #249

Open
aj-stein-nist opened this issue Oct 31, 2023 · 2 comments
Open

Comments

@aj-stein-nist
Copy link

I will investigate and examine how I can contribute a fix back when I review more, but in the context of evaluating scitt-community/scitt-examples#2, I am unable to build this in a current version of Ubuntu Linux 22.04 for the amd64 ISA because the necessary sqlite3 dependency requires compiled bindings that are platform specific. The only provided binding is Darwin/macOS.

Given the platform below,

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
$ node --version
v16.19.0
$ npm --version
8.19.3

I received the following error.

$ npm ci 
$ $(npm bin)/transmute
node:internal/modules/cjs/loader:1249
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /home/me/code/scitt-examples/nodejs/node_modules/@transmute/cli/dist/lib/binding/napi-v6-darwin-unknown-arm64/node_sqlite3.node: invalid ELF header
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1249:18)
    at Module.load (node:internal/modules/cjs/loader:1043:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1067:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.53751 (/home/me/code/scitt-examples/nodejs/node_modules/@transmute/cli/dist/index.js:245:113933)
    at __nccwpck_require__ (/home/me/code/scitt-examples/nodejs/node_modules/@transmute/cli/dist/index.js:254:456010)
    at Object.80729 (/home/me/code/scitt-examples/nodejs/node_modules/@transmute/cli/dist/index.js:226:5388)
    at __nccwpck_require__ (/home/me/code/scitt-examples/nodejs/node_modules/@transmute/cli/dist/index.js:254:456010)
    at Object.54946 (/home/me/code/scitt-examples/nodejs/node_modules/@transmute/cli/dist/index.js:226:5463) {
  code: 'ERR_DLOPEN_FAILED'
}

Note: I currently do not have a macOS system to test, but I will try to determine a recommended fix as I confirm it is macOS-specific.

@OR13
Copy link
Sponsor Member

OR13 commented Oct 31, 2023

Seems that ncc build is dundling macOS related stuff for sqlite... that is causing the tool to fail in other envs.

Suggested fix is for us to drop the sqlite stuff for now, and just stick to JSON files for the local ledger.

I will report back when I think its been fixed.

@OR13
Copy link
Sponsor Member

OR13 commented Oct 31, 2023

I dropped the sqlite ledger for now, the latest version just uses a json file.

npm i -g @transmute/cli@0.8.30

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