Problem
npm commands fail on most kartotherian projects. For example,
cd kartotherian/packages/snapshot npm install
Result:
... (much compiling ensues)
../src/mapnik_vector_tile.hpp:11:37: fatal error: vector_tile_merc_tile.hpp: No such file or directory
compilation terminated.
mapnik.target.mk:240: recipe for target 'Release/obj.target/mapnik/src/node_mapnik.o' failed
make: *** [Release/obj.target/mapnik/src/node_mapnik.o] Error 1
make: Leaving directory '/srv/kartotherian/packages/snapshot/node_modules/@kartotherian/mapnik/build'
The error changes every time. I've tried a lot of things with no success.
Ideally, we can make mapnik build reliably, but many have tried and perished on this quest. As a last resort, we might upgrade mapnik and its library from upstream, see for example T210815. This might give us access to the precompiled node-gyp binaries.
Implementation
We found that the forked mapnik's node-gyp-pre settings could be manipulated such that it behaved like the magic --build-from-source npm client flag is passed everywhere. This lets us simplify away that detail from our client usages.
Then, the attached gerrit patches can be merged.