Closed Superpiffer closed 5 years ago
There is something that I'm missing and can be done without explicit build sqlite3 from source?
Sadly the sqlite3 package does not provide precompiled binaries for ARM, so the only solution is to build it on your machine (or just skip it).
That being said you are using Node 11, which is not supported by sqlite3 yet.
I've tried also with node 10 but I had the same problem. I know that I have to build it on my machine, but I'm confused because I thought that npm without the --build-from-source on an unsupported architecture was able to build the package.
So to follow debian package we would need to do the following:
--no-optional
in pkgbuild
sudo npm install sqlite3 --no-package-lock --prefix {figure out where arch installs it} --unsafe-perm
in post_install
I'm unsure why --build-from-source
is needed in this case, and whether it forcefully builds even if it can download a precompiled one. Maybe --fallback-to-build=true
will also work?
It's exactly what I did in my PKGBUILD. I've also tried --fallback-to-build=true
but no luck,
Anyway, I think that the PKGBUILD for v3 should have those lines, to solve my problem I can manually add --build-from-source
during installation.
I don't know what else to do. Any ideas?
Here's the complete logs, with and without --build-from-source
with node 10.
EDIT: Ok, I'va compared the logs and I found out that without the command, node-pre-gyp calls all the function two times:
> sqlite3@4.0.3 install /home/pi/thelounge/pkg/thelounge-rc/usr/lib/node_modules/thelounge/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.3/node-v64-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.0.3 and node@10.13.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Pre-built binaries not installable for sqlite3@4.0.3 and node@10.13.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error Connection closed while downloading tarball file
make: ingresso nella directory "/home/pi/thelounge/pkg/thelounge-rc/usr/lib/node_modules/thelounge/node_modules/sqlite3/build"
make: ingresso nella directory "/home/pi/thelounge/pkg/thelounge-rc/usr/lib/node_modules/thelounge/node_modules/sqlite3/build"
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c
TOUCH Release/obj.target/deps/action_before_build.stamp
TOUCH Release/obj.target/deps/action_before_build.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3240000/sqlite3.o
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3240000/sqlite3.o
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c: In function ‘strftimeFunc’:
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c: In function ‘strftimeFunc’:
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c:13800:27: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3MallocSize)
^
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c:21428:52: note: in expansion of macro ‘SQLITE_DYNAMIC’
z==zBuf ? SQLITE_TRANSIENT : SQLITE_DYNAMIC);
^~~~~~~~~~~~~~
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c:13800:27: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3MallocSize)
^
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c:21428:52: note: in expansion of macro ‘SQLITE_DYNAMIC’
z==zBuf ? SQLITE_TRANSIENT : SQLITE_DYNAMIC);
^~~~~~~~~~~~~~
With the command, the functions are colled only one time:
> sqlite3@4.0.3 install /home/pi/thelounge/pkg/thelounge-rc/usr/lib/node_modules/thelounge/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
make: ingresso nella directory "/home/pi/thelounge/pkg/thelounge-rc/usr/lib/node_modules/thelounge/node_modules/sqlite3/build"
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c
TOUCH Release/obj.target/deps/action_before_build.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3240000/sqlite3.o
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c: In function ‘strftimeFunc’:
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c:13800:27: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3MallocSize)
^
Release/obj/gen/sqlite-autoconf-3240000/sqlite3.c:21428:52: note: in expansion of macro ‘SQLITE_DYNAMIC’
z==zBuf ? SQLITE_TRANSIENT : SQLITE_DYNAMIC);
^~~~~~~~~~~~~~
Maybe that's the problem...
Here's the problem: https://github.com/mapbox/node-pre-gyp/pull/428 I just tried and with Node 8 it works just fine. So we have to wait until this commit is merged in a new version. Thanks for all. :)
I just tried to build with nodejs 11 the new stable version from AUR and it works! This issue can be closed now. :)
I'm doing some experiments with the new thelounge version on ArchlinuxArm. I've edited the PKGBUILD in order to use the new rc version and the sqlite log feature on a Raspberry Pi 3 and I have some issues.
On ARM architecture, the sqlite package doesn't exist on repo:
So npm tries to build the package, but if fails:
After that I've tried to follow the new deb build method (https://github.com/thelounge/thelounge-deb/pull/33):
but the error is the same.
For some reason the only way to build sqlite with npm is adding
--build-from-source
(source: https://github.com/mapbox/node-sqlite3/issues/994#issuecomment-413998241):npm install sqlite3 --no-lock-file --prefix "$pkgdir/usr/lib/node_modules/_npmname" --unsafe-perm --build-from-source
With this line, the package is built without errors.For reference I attach my PKGBUILD file, hoping that this can be useful in preparation of the release of version 3.
I've found this issue only on ARM, on x64 works as expected with the original PKGBUILD. There is something that I'm missing and can be done without explicit build sqlite3 from source? Maybe have different lines in package() for different architectures? Thanks.