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

Compilation warning when running yarn install #16110

Closed
thomasneirynck opened this issue Jan 17, 2018 · 14 comments
Closed

Compilation warning when running yarn install #16110

thomasneirynck opened this issue Jan 17, 2018 · 14 comments
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Visualizations Generic visualization features (in case no more specific feature label is available)

Comments

@thomasneirynck
Copy link
Contributor

thomasneirynck commented Jan 17, 2018

The canvas package is an optional-dependency of the vega-scenegraph package, which in turn is a dependency of vega, which Kibana relies on.

This message is basically spam. It has no impact on either the user or developer.

This is an upstream issue with vega.

warning Error running install script for optional dependency: "/Users/kim/dev/elastic/master/kibana/node_modules/canvas: Command failed.\nExit code: 1\nCommand: node-gyp rebuild\nArguments: \nDirectory: /Users/kim/dev/elastic/master/kibana/node_modules/canvas\nOutput:\ngyp info it worked if it ends with ok\ngyp info using [email protected]\ngyp info using [email protected] | darwin | x64\ngyp info spawn /usr/local/bin/python2\ngyp info spawn args [ '/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',\ngyp info spawn args 'binding.gyp',\ngyp info spawn args '-f',\ngyp info spawn args 'make',\ngyp info spawn args '-I',\ngyp info spawn args '/Users/kim/dev/elastic/master/kibana/node_modules/canvas/build/config.gypi',\ngyp info spawn args '-I',\ngyp info spawn args '/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',\ngyp info spawn args '-I',\ngyp info spawn args '/Users/kim/.node-gyp/6.12.2/include/node/common.gypi',\ngyp info spawn args '-Dlibrary=shared_library',\ngyp info spawn args '-Dvisibility=default',\ngyp info spawn args '-Dnode_root_dir=/Users/kim/.node-gyp/6.12.2',\ngyp info spawn args '-Dnode_gyp_dir=/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp',\ngyp info spawn args '-Dnode_lib_file=node.lib',\ngyp info spawn args '-Dmodule_root_dir=/Users/kim/dev/elastic/master/kibana/node_modules/canvas',\ngyp info spawn args '--depth=.',\ngyp info spawn args '--no-parallel',\ngyp info spawn args '--generator-output',\ngyp info spawn args 'build',\ngyp info spawn args '-Goutput_dir=.' ]\nPackage cairo was not found in the pkg-config search path.\nPerhaps you should add the directory containing cairo.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'cairo' found\ngyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp\ngyp ERR! configure error \ngyp ERR! stack Error: gyp` failed with exit code: 1\ngyp ERR! stack at ChildProcess.onCpExit (/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)\ngyp ERR! stack at emitTwo (events.js:106:13)\ngyp ERR! stack at ChildProcess.emit (events.js:191:7)\ngyp ERR! stack at Process.Chis

@thomasneirynck thomasneirynck added bug Fixes for quality problems that affect the customer experience Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Jan 17, 2018
@thomasneirynck
Copy link
Contributor Author

You can avoid this compilation error and suppress the warning by running either:

yarn install --ignore-scripts

or

npm install --no-optional

@nyurik
Copy link
Contributor

nyurik commented Jan 17, 2018

Upstream issue: vega/vega#1073

@kimjoar
Copy link
Contributor

kimjoar commented Jan 18, 2018

Have we got a feel for if this will be prioritized? Doesn’t look like a big community (2 people with more than 3 commits the last 6 months, from what I can see). Would it be easy for us to contribute the necessary changes? I don’t know if you found out why stuff failed for @chrisronline yesterday, but if that error happens with others we need to consider doing something asap (Telling people to run yarn install --ignore-scripts is okey for a couple days, but it's not a solution).

@thomasneirynck
Copy link
Contributor Author

thomasneirynck commented Jan 18, 2018

@kjbekkelund yes, I think the real solution is indeed a fix from Vega. I can't speak to timing on their end.

The message is spam, just like the react-warnings, only longer. It only displays once, at the first install.

An interim solution is that we host our own pre-built vega without the canvas package, similar to how we host some other 3rd party libraries (e.g. numeral, ...) in a mirror. This would avoid the spam, and we can replace the dependency once Vega fixes the problem.

@kimjoar
Copy link
Contributor

kimjoar commented Jan 18, 2018

Hm, weird, I'm seeing it every time:

~/dev/elastic/master/kibana master*
❯ yarn
yarn install v1.3.2
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > [email protected]" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
[5/5] 📃  Building fresh packages...
[1/1] ⠂ canvas: spawn args   '-Goutput_dir=.' ]
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
warning Error running install script for optional dependency: "/Users/kim/dev/elastic/master/kibana/node_modules/canvas: Command failed.\nExit code: 1\nCommand: node-gyp rebuild\nArguments: \nDirectory: /Users/kim/dev/elastic/master/kibana/node_modules/canvas\nOutput:\ngyp info it worked if it ends with ok\ngyp info using [email protected]\ngyp info using [email protected] | darwin | x64\ngyp info spawn /usr/local/bin/python2\ngyp info spawn args [ '/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',\ngyp info spawn args   'binding.gyp',\ngyp info spawn args   '-f',\ngyp info spawn args   'make',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/kim/dev/elastic/master/kibana/node_modules/canvas/build/config.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/kim/.node-gyp/6.12.2/include/node/common.gypi',\ngyp info spawn args   '-Dlibrary=shared_library',\ngyp info spawn args   '-Dvisibility=default',\ngyp info spawn args   '-Dnode_root_dir=/Users/kim/.node-gyp/6.12.2',\ngyp info spawn args   '-Dnode_gyp_dir=/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp',\ngyp info spawn args   '-Dnode_lib_file=node.lib',\ngyp info spawn args   '-Dmodule_root_dir=/Users/kim/dev/elastic/master/kibana/node_modules/canvas',\ngyp info spawn args   '--depth=.',\ngyp info spawn args   '--no-parallel',\ngyp info spawn args   '--generator-output',\ngyp info spawn args   'build',\ngyp info spawn args   '-Goutput_dir=.' ]\nPackage cairo was not found in the pkg-config search path.\nPerhaps you should add the directory containing `cairo.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'cairo' found\ngyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp\ngyp ERR! configure error \ngyp ERR! stack Error: `gyp` failed with exit code: 1\ngyp ERR! stack     at ChildProcess.onCpExit (/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)\ngyp ERR! stack     at emitTwo (events.js:106:13)\ngyp ERR! stack     at ChildProcess.emit (events.js:191:7)\ngyp ERR! stack     at Process.Chisuccess Saved lockfile.
✨  Done in 11.93s.

~/dev/elastic/master/kibana master* 13s
❯ yarn
yarn install v1.3.2
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > [email protected]" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
[5/5] 📃  Building fresh packages...
[1/1] ⠂ canvas: info spawn args   '-Goutput_dir=.' ]
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
warning Error running install script for optional dependency: "/Users/kim/dev/elastic/master/kibana/node_modules/canvas: Command failed.\nExit code: 1\nCommand: node-gyp rebuild\nArguments: \nDirectory: /Users/kim/dev/elastic/master/kibana/node_modules/canvas\nOutput:\ngyp info it worked if it ends with ok\ngyp info using [email protected]\ngyp info using [email protected] | darwin | x64\ngyp info spawn /usr/local/bin/python2\ngyp info spawn args [ '/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',\ngyp info spawn args   'binding.gyp',\ngyp info spawn args   '-f',\ngyp info spawn args   'make',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/kim/dev/elastic/master/kibana/node_modules/canvas/build/config.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',\ngyp info spawn args   '-I',\ngyp info spawn args   '/Users/kim/.node-gyp/6.12.2/include/node/common.gypi',\ngyp info spawn args   '-Dlibrary=shared_library',\ngyp info spawn args   '-Dvisibility=default',\ngyp info spawn args   '-Dnode_root_dir=/Users/kim/.node-gyp/6.12.2',\ngyp info spawn args   '-Dnode_gyp_dir=/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp',\ngyp info spawn args   '-Dnode_lib_file=node.lib',\ngyp info spawn args   '-Dmodule_root_dir=/Users/kim/dev/elastic/master/kibana/node_modules/canvas',\ngyp info spawn args   '--depth=.',\ngyp info spawn args   '--no-parallel',\ngyp info spawn args   '--generator-output',\ngyp info spawn args   'build',\ngyp info spawn args   '-Goutput_dir=.' ]\nPackage cairo was not found in the pkg-config search path.\nPerhaps you should add the directory containing `cairo.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'cairo' found\ngyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. while trying to load binding.gyp\ngyp ERR! configure error \ngyp ERR! stack Error: `gyp` failed with exit code: 1\ngyp ERR! stack     at ChildProcess.onCpExit (/Users/kim/.nvm/versions/node/v6.12.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)\ngyp ERR! stack     at emitTwo (events.js:106:13)\ngyp ERR! stack     at ChildProcess.emit (events.js:191:7)\ngyp ERR! stack     at Process.Chisuccess Saved lockfile.
✨  Done in 12.11s.

@kimjoar
Copy link
Contributor

kimjoar commented Jan 18, 2018

Good point re the React warnings, I opened #16127 to fix it.

@thomasneirynck
Copy link
Contributor Author

@kjbekkelund I guess you're right about the messages. Discard what I said earlier.

@kimjoar
Copy link
Contributor

kimjoar commented Jan 18, 2018

++ I like the self-hosted solution, if it's not easy to get a fix in upstream.

@nyurik
Copy link
Contributor

nyurik commented Jan 18, 2018

Vega's @jheer said he will try to work on it next week, so it might make sense to wait a bit on this one. I tried a "brute force" approach of copying the compiled (pre-ES6) Vega lib into its own npm package, but that didn't work too well with the webpack - it failed because require('canvas') was not found and couldn't be merged (even though the Vega code handles it correctly). The proper solution would be to clone all the affected repos, and modifying them all, but this is not a good long term strategy. There are at least three that would need modifications - vega-scenegraph, vega-wordcloud, and the main vega itself.

@nyurik
Copy link
Contributor

nyurik commented Jan 18, 2018

I fixed this issue in #16137 (hack), but hopefully there will be a better alternative upstream

@thomasneirynck
Copy link
Contributor Author

my suggestion would be to see what Vega is doing. If they are fixing this soon (ie. early next week), we just bump dependency. If not, we use the #16137 work-around.

@kimjoar
Copy link
Contributor

kimjoar commented Jan 18, 2018

++ agreed

Thanks for the quick turnaround on this, btw. :elasticheart:

@nyurik
Copy link
Contributor

nyurik commented Jan 18, 2018

Hmm, for some reason the run:optimizeBuild fails when used with the compiled version -- https://kibana-ci.elastic.co/job/elastic+kibana+pull-request+multijob-selenium/10927/console

@nyurik
Copy link
Contributor

nyurik commented Jan 26, 2018

This has now been fixed (but not merged) with #16137 - it uses a new vega-lib package that I'm maintaining, but hopefully it will be moved to core vega soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Visualizations Generic visualization features (in case no more specific feature label is available)
Projects
None yet
Development

No branches or pull requests

3 participants