Open hideishi-m opened 2 years ago
Hey @hideishi-m, that's unfortunate 😕 It look like CentOS 7 ships with libstdc++ 6.0.19, which I believe comes from GCC 4.8.x and came out around 2014/2015.
I've been unable to find a way to compile the binaries with compatibility for this, so I'm stuck on how we could fix this. If you know of a way, I'd be glad to hear 🙂
In the mean time, you'll have to compile node-sqlite3
from source, or update the libraries your machine uses
Hello @daniellockyer. I did a quick research and I think I found a way. Instead of using ubuntu-latest runner for CI, could you try using ubuntu-18.04 runner? It seems ubuntu-18.04 runner is shipped with libstdc++-6.0 which is compatible with CentOS 7's libstdc++ 6.0.19.
Hey @hideishi-m 🙂 I can't seem to get that to work. My CI run here was done on ubuntu-18.04
and the napi-v6-linux-glibc-x64
binary inside the artifact zip still shows the same error on CentOS 7 😕
Hello @daniellockyer, I see ... in that case I have also no idea how you can fix this. At least the existing prebuild binaries work on CentOS Stream 8 and AlmaLinux8. For CentOS 7, I will continue building my own binary via node-pre-gyp.
By the way, I also had to do some tweaks to build my own binary that node-pre-gyp sets -std=gnu++14
where as old gcc tool chain on CentOS 7 doesn't support this. I had to replace with -std=gnu++11
instead.
I'm about to release 5.0.5 but it won't contain the fix for this 😕 I'll see if I can take another look soon 🙂
I've been unable to find a way to compile the binaries with compatibility for this, so I'm stuck on how we could fix this. If you know of a way, I'd be glad to hear 🙂
For your reference, as previously node-sqlite3 (<= 5.0.2) did not provide arm built, users were hard to install Uptime Kuma, so I forked this project to support it.
In order to cover more systems, in my fork, I built arm64
and amd64
directly on CentOS 7 docker image.
https://github.com/louislam/node-sqlite3/blob/master/build.dockerfile
Although it was built on CentOS 7, the binary file is still working on the latest Debian (Bullseye).
I recently merged node-sqlite3 upstream source (5.0.3) with my build script, it is still working on CentOS 7.
Hi there, back then sharp
also had this issue with their pre-built binaries
I believe their solution was to use CentOS 7 docker container within the Ubuntu runner, https://github.com/lovell/sharp/issues/2119#issuecomment-597301435
^ However, the associated commit in that comment was back when they were still using Travis
A few months after that, they migrated to GitHub Actions (https://github.com/lovell/sharp/commit/e59e14688707215233bfb11e46cb9b58b2705d04), and they still stick with the same method Their latest CI actions config lives here https://github.com/lovell/sharp/blob/main/.github/workflows/ci.yml, which hopefully can be of reference
I'm having a similar issue trying to build sqlite3 from source on a CentOS 7 using node v16. The specific error I'm getting is:
yarn global add sqlite3@5.0.8 ... omitted output ... g++: error: unrecognized command line option '-std=gnu++14'
Running the same command using node v14 build successfully. I inspected the generated files and it is using `-std=gnu++1y' instead. Does anyone have any idea why v14 works but v16 does not?
:edit:
Naturally 5 minutes after I posted this I found an answer. Node v16.2.0 changed the gnu++1y
flag to gnu++14
because gnu++1y
was deprecated. I ended up editing node-v16/include/node/common.gypi
and changed the references. Everything built successfully after that. I'm not sure if this is the proper way to handle this, but it works for me for now.
Any thoughts on this? I'm having some issues where I need to bump from 5.0.2 to support ARM but doing so breaks CentOS 7.
I found this thread that seems to address a similar issue. This is my understanding so far:
Then, when running your Node.js app, you need to set LD_LIBRARY_PATH=$PATH::/YourPathTo/gcc-10.2.0/lib64/
.
For example, LD_LIBRARY_PATH=$PATH::/YourPathTo/gcc-10.2.0/lib64/ node my-script.js
I have not tested this workaround yet, since I don't have a centos7/rhel7 instance at hand. If anyone can try, I would be interested in the result.
I can confirm that the suggestion above by @davidrapin works nicely (CentOS 7.9.2009, node-sqlite3 v5.0.10)
gcc10-libstdc++
(available at least in Ghettoforge: https://mirror.ghettoforge.org/distributions/gf/el/7/gf/x86_64/)LD_LIBRARY_PATH=$PATH:/opt/gcc-10.2.1/usr/lib64
for my node appThanks for the tip!
I'm having a similar issue trying to build sqlite3 from source on a CentOS 7 using node v16. The specific error I'm getting is:
yarn global add sqlite3@5.0.8 ... omitted output ... g++: error: unrecognized command line option '-std=gnu++14'
Running the same command using node v14 build successfully. I inspected the generated files and it is using `-std=gnu++1y' instead. Does anyone have any idea why v14 works but v16 does not?
:edit:
Naturally 5 minutes after I posted this I found an answer. Node v16.2.0 changed the
gnu++1y
flag tognu++14
becausegnu++1y
was deprecated. I ended up editingnode-v16/include/node/common.gypi
and changed the references. Everything built successfully after that. I'm not sure if this is the proper way to handle this, but it works for me for now.
@cjbland, it's possible to build from source in node v16.16.0
on centOS 7 without changing any references:
$ node --version
v16.16.0
$ node
Welcome to Node.js v16.16.0.
Type ".help" for more information.
> require("sqlite3")
Uncaught:
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/***/myproject/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-x64/node_sqlite3.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) {
code: 'ERR_DLOPEN_FAILED'
}
> .exit
$ rm -rf node-modules
$ npm i --build-from-source
added 107 packages, and audited 108 packages in 2m
5 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm ls sqlite3
myproject@0.0.1 /home/***/myproject
└── sqlite3@5.0.11
$ node
Welcome to Node.js v16.16.0.
Type ".help" for more information.
> require("sqlite3")
{
Database: [Function: Database],
Statement: [Function: Statement],
Backup: [Function: Backup],
OPEN_READONLY: 1,
OPEN_READWRITE: 2,
OPEN_CREATE: 4,
OPEN_FULLMUTEX: 65536,
OPEN_URI: 64,
OPEN_SHAREDCACHE: 131072,
OPEN_PRIVATECACHE: 262144,
VERSION: '3.39.2',
SOURCE_ID: '2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603',
VERSION_NUMBER: 3039002,
OK: 0,
ERROR: 1,
INTERNAL: 2,
PERM: 3,
ABORT: 4,
BUSY: 5,
LOCKED: 6,
NOMEM: 7,
READONLY: 8,
INTERRUPT: 9,
IOERR: 10,
CORRUPT: 11,
NOTFOUND: 12,
FULL: 13,
CANTOPEN: 14,
PROTOCOL: 15,
EMPTY: 16,
SCHEMA: 17,
TOOBIG: 18,
CONSTRAINT: 19,
MISMATCH: 20,
MISUSE: 21,
NOLFS: 22,
AUTH: 23,
FORMAT: 24,
RANGE: 25,
NOTADB: 26,
cached: { Database: [Function: Database], objects: {} },
verbose: [Function (anonymous)]
}
.exit
$
Just wanted to add thanks to @davidrapin and @heikkipora this was the best solution I could find for now.
In case anyone wants to try ghost on uberspace with sqlite, you'd do this:
cd GHOSTDIR
mkdir lib
cd lib
wget https://mirror.ghettoforge.org/distributions/gf/el/7/gf/x86_64/gcc10-libstdc++-10.2.1-7.gf.el7.x86_64.rpm
rpm2cpio gcc10-libstdc++-10.2.1-7.gf.el7.x86_64.rpm | cpio -idmv
mv ./opt/gcc-10.2.1/usr/lib64/* ./
rm -r ./opt/
LD_LIBRARY_PATH=$PATH:/path/to/your/GHOSTDIR/lib
# start ghost
This fetches the mentioned version of libstdc++ and unpacks it locally.
Hello, unfortunately another issue with prebuilt binary on CentOS 7. Additionally, older libstdc++ compatiblity is required.