Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build sharp on node@9 #1008

Closed
makepanic opened this issue Nov 1, 2017 · 15 comments
Closed

Unable to build sharp on node@9 #1008

makepanic opened this issue Nov 1, 2017 · 15 comments

Comments

@makepanic
Copy link

makepanic commented Nov 1, 2017

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
@lovell
Copy link
Owner

lovell commented Nov 1, 2017

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 isaacs/node-tar@ea90c6c

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

@lovell lovell added this to the v0.19.0 milestone Nov 1, 2017
@ram-you
Copy link

ram-you commented Nov 3, 2017

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.

@lovell
Copy link
Owner

lovell commented Nov 3, 2017

@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.

@janwo
Copy link

janwo commented Dec 16, 2017

@lovell libvips v8.6.0 was released last week.

@lovell
Copy link
Owner

lovell commented Dec 17, 2017

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.

@lovell
Copy link
Owner

lovell commented Dec 27, 2017

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

@enzy
Copy link

enzy commented Jan 3, 2018

Why this waits for libvips when it's not related to it? Is there a reason not to publish a patch version?

@lovell
Copy link
Owner

lovell commented Jan 4, 2018

@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?

@lovell
Copy link
Owner

lovell commented Jan 6, 2018

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.

@makepanic
Copy link
Author

With librsvg releasing 2.42.0 including your fix, do you know how this will affect the v0.19.0 release?

@lovell
Copy link
Owner

lovell commented Jan 11, 2018

The packaging scripts have been updated to include the Rust toolchain and the latest librsvg - see lovell/sharp-libvips@d4d2019 - so you can expect v0.19.0 within the next day or so.

@lovell
Copy link
Owner

lovell commented Jan 12, 2018

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

@lovell lovell closed this as completed Jan 12, 2018
@makepanic
Copy link
Author

Thanks for all the hard work 👍

@du5rte
Copy link

du5rte commented Jan 19, 2018

Still getting this error on v0.19.0

P:\...>npm i -S sharp

> sharp@0.19.0 install P:\...\node_modules\sharp
> node-gyp rebuild


P:\...\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Traceback (most recent call last):
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main
    return gyp_main(args)
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 514, in gyp_main
    options.duplicate_basename_check)
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load
    generator.CalculateVariables(default_variables, params)
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1900, in CalculateVariables
    generator_flags.get('msvs_version', 'auto'))
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion
    versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
KeyError: '2017'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd P:\...\node_modules\sharp
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-S" "sharp"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! sharp@0.19.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.19.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sharp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sharp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sharp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     P:\...\npm-debug.log

@lovell
Copy link
Owner

lovell commented Jan 19, 2018

@du5rte This issue was about Node v9 support but your report states Node v6.11.2.

https://github.com/nodejs/node-gyp/search?q=_DetectVisualStudioVersions+KeyError+2017&type=Issues&utf8=%E2%9C%93

You'll probably need to upgrade node-gyp for MSVC 2017 support

Repository owner locked and limited conversation to collaborators Jan 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants