Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

NPM install unreasonably long on ARM devices, binary distribution needed #597

Closed

Description

@alexellis

I've been using sqlite3 with node for some time now and the major complaint and drawback I see is:

  • The build time on ARMv7 i.e. Raspberry PI is too long
  • The build time on ARMv6 devices needs a swap file to be created that thrashes its SD card over and over and takes an age to build.

Last night I spent over two hours trying to get the npm module to install on a PI Zero, this takes me a few seconds on a 64-bit PC because it uses a pre-built binary. When I do an npm install on my Mac I get a message like this:

[sqlite3] Success: /blah/l1/node_modules/sqlite3/lib/binding/node-v46-darwin-x64/node_sqlite3.node" is installed via remote

If I am to include sqlite3 in open source projects because it's aimed at embedded devices like the PI Zero/A+, it seems crazy to have to give all the instructions about creating a swap file and waiting an hour+ for a single module to build.

Is there any way to get statically linked pre-built binaries made available to npm so that it can install this module on a PI as quickly as it does on a low-end 64-bit machine?

Activity

  1. changed the title [-]Build takes unreasonably long on ARM devices, binary distribution needed[/-] [+]NPM install unreasonably long on ARM devices, binary distribution needed[/+] on Feb 10, 2016
  2. rzr commented on Apr 9, 2018

    @rzr
    Contributor

    Is there the actual identified reason why it's so slow?

    Even on ARMv8 (PI3) sqlite-4.0.0 it's taking forever to build, as mentioned by @zerox029 at:

    #933 (comment)

    I noticed that CPU gets stuck at 100% during 6min just for building Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o :

    /usr/lib/gcc/arm-linux-gnueabihf/6/cc1 -quiet -I /home/pi/.node-gyp/8.11.1/include/node -I /home/pi/.node-gyp/8.11.1/src -I /home/pi/.node-gyp/8.11.1/deps/uv/include -I /home/pi/.node-gyp/8.11.1/deps/v8/include -I ./Release/obj/gen/sqlite-autoconf-3150000 -imultilib . -imultiarch arm-linux-gnueabihf -MMD Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.d -MF ./Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o.d.raw -MQ Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o -D_REENTRANT -D NODE_GYP_MODULE_NAME=sqlite3 -D USING_UV_SHARED=1 -D USING_V8_SHARED=1 -D V8_DEPRECATION_WARNINGS=1 -D _LARGEFILE_SOURCE -D _FILE_OFFSET_BITS=64 -D _REENTRANT=1 -D SQLITE_THREADSAFE=1 -D SQLITE_ENABLE_FTS3 -D SQLITE_ENABLE_FTS4 -D SQLITE_ENABLE_FTS5 -D SQLITE_ENABLE_JSON1 -D SQLITE_ENABLE_RTREE -D NDEBUG Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c -quiet -dumpbase sqlite3.c -march=armv6 -mfloat-abi=hard -mfpu=vfp -mtls-dialect=gnu -auxbase-strip Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o -O3 -Wall -Wextra -Wno-unused-parameter -std=c99 -fPIC -fno-omit-frame-pointer -o /tmp/cc17xNwE.s

    My env:

    node --version
    v8.11.1

    gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516

    Raspbian GNU/Linux 9 (stretch)

    https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-12-01/2017-11-29-raspbian-stretch-lite.zip

    Other relevant errors:

    [1/5] ⡀ sqlite3: 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.0/node-v57-linux-arm.tar.gz

    Until someone nail the problem I will try to workaround a method and keep this thread updated...

  3. springmeyer commented on Jun 23, 2018

    @springmeyer
    Contributor

    Is there the actual identified reason why it's so slow?

    This large memory requirement is due to us using the single-source-file (aka amalgamated) version of the libsqlite3 library. One alternative is that you could build libsqlite3 yourself, first, and then point node-sqlite3 at it using the npm install --sqlite flag per https://github.com/mapbox/node-sqlite3#source-install

    Is there any way to get statically linked pre-built binaries made available to npm so that it can install this module on a PI as quickly as it does on a low-end 64-bit machine?

    See #418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions