{"action":"created","issue":{"url":"https://api.github.com/repos/tootsuite/mastodon/issues/2804","repository_url":"https://api.github.com/repos/tootsuite/mastodon","labels_url":"https://api.github.com/repos/tootsuite/mastodon/issues/2804/labels{/name}","comments_url":"https://api.github.com/repos/tootsuite/mastodon/issues/2804/comments","events_url":"https://api.github.com/repos/tootsuite/mastodon/issues/2804/events","html_url":"https://github.com/tootsuite/mastodon/issues/2804","id":226493334,"number":2804,"title":"Need Documentation: Error installing cld2 gem with gcc 6+","user":{"login":"yookoala","id":91274,"avatar_url":"https://avatars1.githubusercontent.com/u/91274?v=3","gravatar_id":"","url":"https://api.github.com/users/yookoala","html_url":"https://github.com/yookoala","followers_url":"https://api.github.com/users/yookoala/followers","following_url":"https://api.github.com/users/yookoala/following{/other_user}","gists_url":"https://api.github.com/users/yookoala/gists{/gist_id}","starred_url":"https://api.github.com/users/yookoala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yookoala/subscriptions","organizations_url":"https://api.github.com/users/yookoala/orgs","repos_url":"https://api.github.com/users/yookoala/repos","events_url":"https://api.github.com/users/yookoala/events{/privacy}","received_events_url":"https://api.github.com/users/yookoala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-05T07:24:39Z","updated_at":"2017-05-05T20:05:15Z","closed_at":null,"body":"## Problem\r\n\r\nThe [current Gemfile](https://github.com/tootsuite/mastodon/blob/4d22d03fabc5f249fd2a93037916b980e4d3f99b/Gemfile#L22) includes `cld2` for language detection functionality, which **seems to be incompatible with gcc-6+**.\r\n\r\nI tried to do a simple `bundle install` on my Ubuntu 16.10 machine (which comes with gcc 6.2.0 by default). When processing the `cld2` gem installation (effectively `gem install cld2 -v '1.0.3'`), I got some spectacular error messages:\r\n\r\n```\r\nBuilding native extensions.  This could take a while...\r\nERROR:  Error installing cld2:\r\n\tERROR: Failed to build gem native extension.\r\n\r\n    current directory: /home/foobar/.rvm/gems/ruby-2.4.1/gems/cld2-1.0.3/ext/cld\r\n/home/foobar/.rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20170505-6029-169rn4c.rb extconf.rb\r\nchecking for -lstdc++... yes\r\ncreating Makefile\r\n\r\ncurrent directory: /home/foobar/.rvm/gems/ruby-2.4.1/gems/cld2-1.0.3/ext/cld\r\nmake \"DESTDIR=\" clean\r\n\r\ncurrent directory: /home/foobar/.rvm/gems/ruby-2.4.1/gems/cld2-1.0.3/ext/cld\r\nmake \"DESTDIR=\"\r\ncompiling internal/cldutil.cc\r\ncc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++\r\ncc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++\r\ncc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++\r\nIn file included from internal/cldutil.h:24:0,\r\n                 from internal/cldutil.cc:20:\r\ninternal/cldutil_shared.h:404:54: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]\r\n                                       uint32 quadhash) {\r\n                                                      ^\r\ninternal/cldutil_shared.h:432:62: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]\r\n                                           uint64 longwordhash) {\r\n                                                              ^\r\ncc1plus: warning: unrecognized command line option ‘-Wno-self-assign’\r\n\r\n...\r\n(skipped)\r\n...\r\n\r\ninternal/cld_generated_cjk_uni_prop_80.cc:7089:1: error: narrowing conversion of ‘-9’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside { } [-Wnarrowing]\r\ninternal/cld_generated_cjk_uni_prop_80.cc:7089:1: error: narrowing conversion of ‘-9’ from ‘int’ to ‘CLD2::uint8 {aka unsigned char}’ inside { } [-Wnarrowing]\r\ncc1plus: warning: unrecognized command line option ‘-Wno-self-assign’\r\ncc1plus: warning: unrecognized command line option ‘-Wno-constant-logical-operand’\r\ncc1plus: warning: unrecognized command line option ‘-Wno-parentheses-equality’\r\nMakefile:209: recipe for target 'internal/cld_generated_cjk_uni_prop_80.o' failed\r\nmake: *** [internal/cld_generated_cjk_uni_prop_80.o] Error 1\r\n\r\nmake failed, exit code 2\r\n\r\nGem files will remain installed in /home/foobar/.rvm/gems/ruby-2.4.1/gems/cld2-1.0.3 for inspection.\r\nResults logged to /home/foobar/.rvm/gems/ruby-2.4.1/extensions/x86_64-linux/2.4.0/cld2-1.0.3/gem_make.out\r\n\r\n```\r\n\r\n## Solution (Need Documentation)\r\n\r\nI found similar issues on [some gist](https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91) in Github. Then I tried this(*) before another `bundle install`:\r\n\r\n```\r\nsudo apt-get install gcc-5 g++-5 -y\r\nsudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5;\r\n```\r\n\r\nThen `bundle install` works.\r\n\r\nProbably need to document this somewhere. Just don't know where...\r\n\r\n(*) Need to `sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 62 --slave /usr/bin/g++ g++ /usr/bin/g++-6` afterwards to revert default gcc version to 6.2.0.\r\n\r\n* * * *\r\n\r\n- [x] I searched or browsed the repo’s other issues to ensure this is not a duplicate.\r\n- [ ] This bug happens on a [tagged release](https://github.com/tootsuite/mastodon/releases) and not on `master` (If you're a user, don't worry about this).\r\n"},"comment":{"url":"https://api.github.com/repos/tootsuite/mastodon/issues/comments/299562999","html_url":"https://github.com/tootsuite/mastodon/issues/2804#issuecomment-299562999","issue_url":"https://api.github.com/repos/tootsuite/mastodon/issues/2804","id":299562999,"user":{"login":"lexpierce","id":5649235,"avatar_url":"https://avatars1.githubusercontent.com/u/5649235?v=3","gravatar_id":"","url":"https://api.github.com/users/lexpierce","html_url":"https://github.com/lexpierce","followers_url":"https://api.github.com/users/lexpierce/followers","following_url":"https://api.github.com/users/lexpierce/following{/other_user}","gists_url":"https://api.github.com/users/lexpierce/gists{/gist_id}","starred_url":"https://api.github.com/users/lexpierce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lexpierce/subscriptions","organizations_url":"https://api.github.com/users/lexpierce/orgs","repos_url":"https://api.github.com/users/lexpierce/repos","events_url":"https://api.github.com/users/lexpierce/events{/privacy}","received_events_url":"https://api.github.com/users/lexpierce/received_events","type":"User","site_admin":false},"created_at":"2017-05-05T20:05:15Z","updated_at":"2017-05-05T20:05:15Z","body":"Solution only works on platform which has a 'compat' gcc available. This does not work on Fedora 25, for example."}}
{"actor":{"display_login":"lexpierce"}}