Nodejs version upgrade to connect with SQLite 3



  • Hi,

    I have been reading a lot of documentation to use SQLite 3 with my Omega 2s+ but without success (i know i can use python instead).
    It seems the current Node package version is 8.10 and SQLite 3 only works with Node.js v11.x, v12.x, v13.x and v14.x.

    The current version is 8.10 in the official Open WRT repository. I have seen a pull request in GitHub to test a new version i think. I could make a test with our architecture.
    https://github.com/nxhack/openwrt-node-packages/tree/openwrt-18.06

    Anyone knows how to include as a package or how to generate a new one? Including this line src-git node https://github.com/nxhack/openwrt-node-packages.git in /etc/opkg/distfeeds.conf is not working for me.

    Is there anything Omega creators could do? I don't have enough knowledge to do it.
    Could i use other BBDD instead?

    Thanks,
    Edu



  • @Kegozo :

    /etc/opkg/distfeeds.conf is purely meant to install packages from onion/openwrt repositories.

    Here is a blog link:
    https://rahulrav.svbtle.com/devtools-adventures-with-an-omega2pro

    This explains the step-by-step to get node (v8, though) compiled.

    The process involves cross-compiling for Omega2 in a Linux desktop.
    I have not tried it; may you be able to get v12 compiled by following those steps.

    Here is another person, p3x-robot, reporting that he has (somehow) built v12 from nxhack gihub repository:

    https://github.com/nxhack/openwrt-node-packages/issues/464

    Thanks..



  • Thank you very much for all the information @tjoseph1 . It's a great starting point!!!

    I'm using Windows 10 right now but i could use Windows Subsystem for Linux (WSL) to follow the instruction above. V12 would be enough to use SQLite3 and to have access with Nodejs if it works ...

    I will keep the community on the loop.

    Thanks!!!!



  • @Kegozo :
    Would be great if you could post the steps for v12.

    This WSL link looks promising:
    https://docs.microsoft.com/en-us/windows/wsl/install-win10

    It has been many years since I used windows, no idea on WSL...

    Ubuntu 18.04 (2018 April release) might be more matured compared to the latest 20.04.
    https://www.microsoft.com/en-in/p/ubuntu-1804-lts/9n9tngvndl3q?rtc=1&activetab=pivot:overviewtab

    For WSL1 vs WSL2 have a look:
    https://fossbytes.com/what-is-windows-subsystem-for-linux-wsl/

    As mentioned there, running Virtualbox on windows and getting Linux installed on top of that, is another option that gives a better Linux environment.

    Thanks..



  • An Ubuntu Linux over Windows 10 using WSL is running in my computer now with success. I'm following the steps and compiling Nodejs v12 but i have some errors in the 'make' process.
    I hope to fix all issues carefully. Let's see ...
    I'll post the changes made to the post you mentioned above. Thanks @tjoseph1



  • Hi again,

    After a while, I could build the toolchain with the Omega2+ configuration. It took more than 2 hours with an i7 processor.
    I have used Ubuntu 18.04 as Windows subsystem (using WSL2) using the guide that @tjoseph1 posted above.
    Keep in mind these tricks following https://rahulrav.svbtle.com/devtools-adventures-with-an-omega2pro:

    git clone git@github.com:OnionIoT/source.git --> not worked for me. I used git clone https://github.com/OnionIoT/source.git
    git checkout .config --> This file doesn't exist. Omega 2 repository has multiple hidden .optionXXX files in 'source' folder. I have used .config.O2 copying to .config to execute make -j command

    After 2 hours i had all packages compiled to my O2+

    The problem is when i launch the command make package/compile node/node using the nxhack/openwrt-node-packages with ready to use Node.js packages for OpenWRT. This tracks the stable version of Node v12.19 and it's compatible with SQLite 3.

    First issue (fixed):
    /usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
    #include <bits/libc-header-start.h>

    The -m32 is telling gcc to compile for a 32-bit platform. On a 64-bit machine, gcc normally only comes with 64-bit libraries. You have to install 32-bit headers and libraries.
    I launch sudo apt-get install gcc-multilib g++-multilib to install the missing 32 bit libraries.

    Second issue (not fixed)
    issue2.png

    hydro@Surface:~/source$ find . -name "environment.cc"
    ./build_dir/target-mipsel_24kc_musl/node-v12.19.0/src/api/environment.cc

    hydro@Surface:~/source$ find . -name "uv.h"
    vi ./build_dir/target-mipsel_24kc_musl/node-v12.19.0/deps/uv/include/uv.h

    I don't know how to fix it. uv.h has the definition but the implementation is missing. I have seen all the deps folders but i didn't find anything. I have installed libuv1 and libuv1-dev packages but this didn't work either.

    Does anyone have a suggestion? @Lazar-Demin may be you can help me ....

    Thanks in advance



  • I have found this comment from nxhack:
    The cross compilation environment is broken in v12.5.0.
    The situation is difficult.

    When i launch make package/compile node/node. Make uses 12.19.0 so i should use other branch using 12.4.0 or below.



  • @Kegozo:
    I just downloaded node src's for v12.4.0, v12.5.0, v12.6.0 & v12.19.0 from https://nodejs.org/download/release/, for example, https://nodejs.org/download/release/v12.6.0/node-v12.6.0.tar.xz
    When checked ./configure --help, the following are the options of interest (not all output details included):

    node-v12.4.0:
    --dest-cpu=DEST_CPU => CPU architecture to build for (arm, arm64, ia32, ppc,ppc64, x32, x64, x86, x86_64, s390, s390x)

    node-v12.5.0:
    --dest-cpu=DEST_CPU => CPU architecture to build for (arm, arm64, ia32, ppc,ppc64, x32, x64, x86, x86_64, s390, s390x)
    node-v12.6.0:
    --dest-cpu=DEST_CPU => CPU architecture to build for (arm, arm64, ia32, mips, mipsel, mips64el, ppc, ppc64, x32, x64, x86, x86_64, s390, s390x)

    node-v12.19.0:
    --dest-cpu=DEST_CPU => CPU architecture to build for (arm, arm64, ia32, mips, mipsel, mips64el, ppc, ppc64, x32, x64, x86, x86_64, s390x)

    Further:
    Starting from V12.6.0, the following mips specific options are added:
    --with-mips-arch-variant=MIPS_ARCH_VARIANT MIPS arch variant (loongson, r1, r2, r6, rx) [default: r2]
    --with-mips-fpu-mode=MIPS_FPU_MODE MIPS FPU mode (fp32, fp64, fpxx) [default: fp32]
    --with-mips-float-abi=MIPS_FLOAT_ABI MIPS floating-point ABI (soft, hard) [default: hard]

    --fully-static => Generate an executable without external dynamic libraries. This will not work on OSX when using the default compilation environment

    Only in v12.19.0:
    --v8-lite-mode => compile V8 in lite mode for constrained environments (lowers V8 memory footprint, but also implies no just-in-time compilation support, thus much slower execution)

    I am wondering if nxhack was providing mips support while mips was not among the supported cpus; starting from 12.6.0, nodejs might be supporting mips out of the box?

    Thanks ..



  • @tjoseph1
    As far as I know, following commits in his own branch, nxhack has fixed node to version 12.8 using mips platform compatible with openwrt 18.06 and O2+
    a6ba0bd2-43ce-4ab7-8e58-9e32ae052ab9-imagen.png .
    This work has not been continued in the following versions.

    12.8 is enought to use sqlite3. My only option is to change the packages from this commit and compile to obtain 12.8 node version, but i would like to configure feed.conf to it automatically. Something like:

    feeds.conf to include this line->
    src-git node https://github.com/nxhack/openwrt-node-packages.git;openwrt-18.06<commit cb2f5f3>



  • Finally i will clone the nxhack repository (master branch), checkout to this commit and copy to the correct folder to compile again

    I'll keep you updated!


  • Banned

    Thanks for sharing this information!


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.