hackerspace-bootstrap / strichliste

DEPRECATED - strichliste is a tool to replace a tally sheet inside a hackerspace, this module is the api for the strichliste
MIT License
17 stars 12 forks source link

Build error with node10 #278

Closed NicoHood closed 6 years ago

NicoHood commented 6 years ago
npm WARN deprecated furg@1.1.1: not maintained anymore

> sqlite3@3.1.13 install /build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.0.0 (node-v64 ABI) (falling back to source compile with node-gyp) 
gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/lib/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/lib/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/usr/lib/node_modules/node-gyp/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/lib/node_modules/node-gyp/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/lib/node_modules/node-gyp/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/lib/node_modules/node-gyp/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/lib/node_modules/node-gyp/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:149:21)
gyp ERR! System Linux 4.16.6-1-ARCH
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64"
gyp ERR! cwd /build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3
gyp ERR! node -v v10.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:947:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
node-pre-gyp ERR! System Linux 4.16.6-1-ARCH
node-pre-gyp ERR! command "/usr/bin/node" "/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3
node-pre-gyp ERR! node -v v10.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@3.1.13 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@3.1.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /build/.npm/_logs/2018-05-05T06_40_24_398Z-debug.log

I guess that is due to the nodejs 10 update. The problem is, that even my currently compiled/running nodejs also fails to start (log not shown here). I really need a fix for this. I tried to update the package.json file for sqlite 4.0.0, but that also seems to be not available as precompiled download.

I changed the PKGBUILD as follows:

# Maintainer: NicoHood <archlinux {cat} nicohood {dog} de>
# PGP ID: 97312D5EB9D7AE7D0BD4307351DAE9B7C1AE9161

pkgname='strichliste'
pkgdesc="strichliste is a tool to replace a tally sheet inside a hackerspace, this module is the api for the strichliste"
pkgver=1.7.0
pkgrel=2
arch=('any')
url="https://github.com/hackerspace-bootstrap/strichliste"
license=('MIT')
depends=('nodejs' 'sqlite')
makedepends=('npm' 'python2' 'node-gyp')
optdepends=('strichliste-web: frontend')
backup=('etc/strichliste.js')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/hackerspace-bootstrap/${pkgname}/archive/v${pkgver}.tar.gz"
        "strichliste.service"
        "strichliste.sysusers"
        "strichliste-tmpfile.conf"
        "strichliste.sh")
sha512sums=('16b7fecced67e6ce4e3a88bd13c37cbc924225e7ac355642285b91724e82ed67ce335a4a5bc6c9c16c70c760247cd21bcd79b11e308ef50ac9db12b83cfd6286'
            '67f6448fec34909865077e97fc73c66e7903517733704f048568ff86022fb326690b9701b929e4d40dea7cecef288be395cc3d093d21118c57401f1ce66ba25c'
            '96d76ad5fa7fae5859c6e54f45542692d1a8c8e91303b791048f64c5bb8cf46f59b3011b144afd6d33e7cc6b9726172d25821ba0b2806b2e62538a498c05626e'
            '53e69b8d60c51440d2d1e753d45777e607dd474d71248bc532a0bbf7bba24a55dee8b991300fe171636817320da2785af91c0b7764240bbf41f224b799cc049f'
            'e0d3104c63d6c477ec2ddb1e3de876c9ae068768f5d39cf9268772318766ee1737def2b60163f2c23ecb9a8cf7f19f7ef3655f21467d6efdeaa7d3c3fe7482ac')
validpgpkeys=('') # TODO https://github.com/hackerspace-bootstrap/strichliste/issues/277

prepare()
{
    cd "${srcdir}"

    # Use newer sqlite version and repackage tar file
    sed -i 's/"sqlite3":.*/"sqlite3": "^4.0.0",/' "${pkgname}-${pkgver}/package.json"
    tar -zcf "${pkgname}-${pkgver}_new.tar.gz" "${pkgname}-${pkgver}"
}

package() {
    install -Dm644 strichliste.service "${pkgdir}/usr/lib/systemd/system/strichliste.service"
    install -Dm644 strichliste.sysusers "${pkgdir}/usr/lib/sysusers.d/strichliste.conf"
    install -Dm644 strichliste-tmpfile.conf "${pkgdir}/usr/lib/tmpfiles.d/strichliste.conf"
    install -Dm755 strichliste.sh  "${pkgdir}/usr/bin/strichliste"

    # Fix usage of python2 for manual recompilation
    PYTHON=/usr/bin/python2.7
    ln -s $PYTHON python
    export PATH=$(pwd):$PATH

    cd "${srcdir}/${pkgname}-${pkgver}"
    npm install --production -g --user root --prefix "${pkgdir}"/usr "${srcdir}/${pkgname}-${pkgver}_new.tar.gz"
    rm -rf "${pkgdir}"/usr/etc

    install -d "${pkgdir}/usr/share/licenses/${pkgname}"
    ln -s "../../../lib/node_modules/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

    # Copy default config to /etc
    install -Dm644 configuration/default.js "${pkgdir}/etc/strichliste.js"

    # Fix ownership issue
    #chown root:root "${pkgdir}/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v??-linux-x64/node_sqlite3.node"
    chown -R root:root "${pkgdir}/usr/lib/node_modules/strichliste/node_modules/sqlite3/build/Release/obj/gen/sqlite-autoconf-3150000"

    # Fix npm derp
    find "${pkgdir}/usr" -type d -exec chmod 755 '{}' +
}

It compiles fine, but running strichliste still fails:

$ strichliste 
internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module '/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v59-linux-x64/node_sqlite3.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module '/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v59-linux-x64/node_sqlite3.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
seriousManual commented 6 years ago

You need a configured build environment

On Sat, May 5, 2018, 08:45 Nico notifications@github.com wrote:

npm WARN deprecated furg@1.1.1: not maintained anymore

sqlite3@3.1.13 install /build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3 node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-linux-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.0.0 (node-v64 ABI) (falling back to source compile with node-gyp) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (/usr/lib/node_modules/node-gyp/lib/configure.js:483:19) gyp ERR! stack at PythonFinder. (/usr/lib/node_modules/node-gyp/lib/configure.js:397:16) gyp ERR! stack at F (/usr/lib/node_modules/node-gyp/node_modules/which/which.js:68:16) gyp ERR! stack at E (/usr/lib/node_modules/node-gyp/node_modules/which/which.js:80:29) gyp ERR! stack at /usr/lib/node_modules/node-gyp/node_modules/which/which.js:89:16 gyp ERR! stack at /usr/lib/node_modules/node-gyp/node_modules/isexe/index.js:42:5 gyp ERR! stack at /usr/lib/node_modules/node-gyp/node_modules/isexe/mode.js:8:5 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:149:21) gyp ERR! System Linux 4.16.6-1-ARCH gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64" gyp ERR! cwd /build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3 gyp ERR! node -v v10.0.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64' (1) node-pre-gyp ERR! stack at ChildProcess. (/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:947:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5) node-pre-gyp ERR! System Linux 4.16.6-1-ARCH node-pre-gyp ERR! command "/usr/bin/node" "/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3 node-pre-gyp ERR! node -v v10.0.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.38 node-pre-gyp ERR! not ok Failed to execute '/usr/bin/node /usr/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/build/strichliste/pkg/strichliste/usr/lib/node_modules/strichliste/node_modules/sqlite3/lib/binding/node-v64-linux-x64' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sqlite3@3.1.13 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sqlite3@3.1.13 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /build/.npm/_logs/2018-05-05T06_40_24_398Z-debug.log

I guess that is due to the nodejs 10 update. The problem is, that even my currently compiled/running nodejs also fails to start (log not shown here). I really need a fix for this. I tried to update the package.json file, but that did not help, it still tries to download 3.1.13!?

prepare() { cd "${srcdir}/${pkgname}-${pkgver}" sed -i 's/"sqlite3":.*/"sqlite3": "^4.0.0",/' package.json cat package.json }

Output of cat:

"once": "^1.4.0",
"seq": "^0.3.5",
"sqlite3": "^4.0.0",
"squel": "^5.12.0",
"yargs": "^10.1.0"

} }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hackerspace-bootstrap/strichliste/issues/278, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRLZkoMJpHNrLqU9JsAsZgykeDSpKWkks5tvUqGgaJpZM4TzhZV .

NicoHood commented 6 years ago

@seriousManual Could you please give me a few more details at what I need to look at?