sharp: Unable to build sharp on node@9

We’ve enabled node@9 on our travis build and it failed while trying to install sharp:

https://travis-ci.org/piobyte/flamingo/jobs/295751049#L5352-L5409

relevant error log:

gyp info spawn /opt/pyenv/shims/python2
gyp info spawn args [ '/home/travis/.nvm/versions/node/v9.0.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/travis/build/piobyte/flamingo/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/travis/.nvm/versions/node/v9.0.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/travis/.node-gyp/9.0.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/travis/.node-gyp/9.0.0',
gyp info spawn args   '-Dnode_gyp_dir=/home/travis/.nvm/versions/node/v9.0.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/travis/.node-gyp/9.0.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/travis/build/piobyte/flamingo/node_modules/sharp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
/home/travis/.nvm/versions/node/v9.0.0/bin/node[6641]: ../src/node_zlib.cc:430:static void node::{anonymous}::ZCtx::Init(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed.
 1: node::Abort() [node]
 2: node::Assert(char const* const (*) [4]) [node]
 3: 0x1251ea1 [node]
 4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [node]
 5: 0xb74c3c [node]
 6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 7: 0x157404e842fd
Aborted (core dumped)
gyp: Call to 'node -e "require('./binding').download_vips()"' returned exit status 134 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/travis/.nvm/versions/node/v9.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:135:13)
gyp ERR! stack     at ChildProcess.emit (events.js:224:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.4.0-93-generic
gyp ERR! command "/home/travis/.nvm/versions/node/v9.0.0/bin/node" "/home/travis/.nvm/versions/node/v9.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/travis/build/piobyte/flamingo/node_modules/sharp
gyp ERR! node -v v9.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 15 (9 by maintainers)

Most upvoted comments

The packaging scripts have been updated to include the Rust toolchain and the latest librsvg - see https://github.com/lovell/sharp-libvips/commit/d4d2019a7d9ed7a0adea036d19a4816de02c5da7 - so you can expect v0.19.0 within the next day or so.

@ram-you When libvips v8.6.0 is released the prebuilt binaries can be created and some final leak testing will be carried out. This issue is tagged as v0.19.0 so you will be alerted when it is published.

Hello, this is caused by the minizlib transitive dependency.

The forthcoming sharp v0.19.0 will increment the major version of the tar dependency to pick up commit https://github.com/npm/node-tar/commit/ea90c6cec64044a45448b90bd363c4bf603aff9f

https://github.com/lovell/sharp/blob/suit/package.json#L78

sharp v0.19.0 with libvips v8.6.1 as a dependency is now available.

Memory leak testing has revealed there’s a possible problem in librsvg v2.40.20 that sharp v0.19.0 would expose - see https://gitlab.gnome.org/GNOME/librsvg/merge_requests/2 for a proposed upstream fix.

@lovell libvips v8.6.0 was released last week.

Hi @lovell Would you mind please tell us if you have an idea about the release date even an estimation one for the upcoming 0.19.0. Thank you.

@enzy Hello, I’ve been focused on getting sharp v0.19.0 and libvips v8.6.1 released. Is there a specific feature of Node 9 (vs Node 8) useful to users of sharp that should divert this attention?

sharp v0.19.0 will wait for and depend on the forthcoming libvips v8.6.1 as it will include the fix for a memory leak discovered in v8.6.0 - see https://github.com/jcupitt/libvips/pull/835

I’m at the “leak testing” stage for the forthcoming v0.19.0 and it has uncovered something I hope is a false-positive but needs investigating before release.