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

Eventmachine 1.2.5 not installing in Mac OS high Sierra #830

Closed
suyesh opened this issue Apr 16, 2018 · 9 comments · Fixed by #831
Closed

Eventmachine 1.2.5 not installing in Mac OS high Sierra #830

suyesh opened this issue Apr 16, 2018 · 9 comments · Fixed by #831
Milestone

Comments

@suyesh
Copy link

suyesh commented Apr 16, 2018

Ruby version 2.2.2p95
using rbenv

`Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/suyesh/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/eventmachine-1.2.5/ext
/Users/suyesh/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20180416-3442-1imrq5f.rb extconf.rb
--with-cppflags=-I/usr/local/opt/openssl/include
checking for main() in -lcrypto... yes
checking for main() in -lssl... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... no
checking for accept4() in sys/socket.h... no
checking for SOCK_CLOEXEC in sys/socket.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for clock_gettime()... yes
checking for CLOCK_MONOTONIC_RAW in time.h... yes
checking for CLOCK_MONOTONIC in time.h... yes
CXXFLAGS=$(cxxflags) -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result
-Wno-address
creating Makefile

current directory: /Users/suyesh/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/eventmachine-1.2.5/ext
make "DESTDIR=" clean

current directory: /Users/suyesh/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/eventmachine-1.2.5/ext
make "DESTDIR="
compiling page.cpp
In file included from page.cpp:21:
In file included from ./project.h:170:
In file included from ./em.h:24:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:1710:
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:19: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:36: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
2 warnings generated.
compiling pipe.cpp
In file included from pipe.cpp:20:
In file included from ./project.h:170:
In file included from ./em.h:24:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:1710:
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:19: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:36: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
2 warnings generated.
compiling binder.cpp
In file included from binder.cpp:20:
In file included from ./project.h:170:
In file included from ./em.h:24:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:1710:
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:19: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:36: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
2 warnings generated.
compiling rubymain.cpp
In file included from rubymain.cpp:20:
In file included from ./project.h:170:
In file included from ./em.h:24:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:1710:
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:19: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:36: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
2 warnings generated.
compiling ssl.cpp
In file included from ssl.cpp:23:
In file included from ./project.h:170:
In file included from ./em.h:24:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:1710:
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:19: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:36: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
2 warnings generated.
compiling ed.cpp
In file included from ed.cpp:20:
In file included from ./project.h:170:
In file included from ./em.h:24:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:1710:
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:19: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);

/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:36: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
2 warnings generated.
compiling cmain.cpp
In file included from cmain.cpp:20:
In file included from ./project.h:170:
In file included from ./em.h:24:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:1710:
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:19: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:36: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
2 warnings generated.
compiling em.cpp
In file included from em.cpp:23:
In file included from ./project.h:170:
In file included from ./em.h:24:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby.h:33:
In file included from /Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/ruby.h:1710:
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:19: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                  ^~~~~~~~~
/Users/suyesh/.rbenv/versions/2.2.2/include/ruby-2.2.0/ruby/intern.h:47:36: warning: 'register' storage class
specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
                                   ^~~~~~~~~
em.cpp:1242:59: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long &>' and 'int')
                if (bind (sd, (struct sockaddr *)&bind_to, bind_to_len) < 0) {
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/system_error:492:1: note: candidate function not viable: no known
conversion from '__bind<int &, sockaddr *, unsigned long &>' to 'const std::__1::error_condition' for 1st argument
operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/system_error:569:1: note: candidate function not viable: no known
conversion from '__bind<int &, sockaddr *, unsigned long &>' to 'const std::__1::error_code' for 1st argument
operator<(const error_code& __x, const error_code& __y) _NOEXCEPT
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/utility:572:1: note: candidate template ignored: could not match 'pair'
against '__bind'
operator< (const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/iterator:702:1: note: candidate template ignored: could not match
'reverse_iterator' against '__bind'
operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/iterator:1143:1: note: candidate template ignored: could not match
'move_iterator' against '__bind'
operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/iterator:1512:1: note: candidate template ignored: could not match
'__wrap_iter' against '__bind'
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/tuple:1187:1: note: candidate template ignored: could not match 'tuple'
against '__bind'
operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/memory:2920:1: note: candidate template ignored: could not match
'unique_ptr' against '__bind'
operator< (const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y)

/usr/local/Cellar/llvm/6.0.0/include/c++/v1/memory:2978:1: note: candidate template ignored: could not match
'unique_ptr' against '__bind'
operator<(const unique_ptr<_T1, _D1>& __x, nullptr_t)
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/memory:2987:1: note: candidate template ignored: could not match
'unique_ptr<type-parameter-0-0, type-parameter-0-1>' against 'int'
operator<(nullptr_t, const unique_ptr<_T1, _D1>& __x)
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/memory:4758:1: note: candidate template ignored: could not match
'shared_ptr' against '__bind'
operator<(const shared_ptr<_Tp>& __x, const shared_ptr<_Up>& __y) _NOEXCEPT
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/memory:4823:1: note: candidate template ignored: could not match
'shared_ptr' against '__bind'
operator<(const shared_ptr<_Tp>& __x, nullptr_t) _NOEXCEPT
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/memory:4831:1: note: candidate template ignored: could not match
'shared_ptr<type-parameter-0-0>' against 'int'
operator<(nullptr_t, const shared_ptr<_Tp>& __x) _NOEXCEPT
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/string_view:671:6: note: candidate template ignored: could not match
'basic_string_view' against '__bind'
bool operator<(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
     ^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/string_view:678:6: note: candidate template ignored: could not match
'basic_string_view' against '__bind'
bool operator<(basic_string_view<_CharT, _Traits> __lhs,
     ^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/string_view:686:6: note: candidate template ignored: could not match
'basic_string_view<type-parameter-0-0, type-parameter-0-1>' against 'int'
bool operator<(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs, 
     ^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/string:3650:1: note: candidate template ignored: could not match
'basic_string' against '__bind'
operator< (const basic_string<_CharT, _Traits, _Allocator>& __lhs,
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/string:3659:1: note: candidate template ignored: could not match
'basic_string' against '__bind'
operator< (const basic_string<_CharT, _Traits, _Allocator>& __lhs,
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/string:3668:1: note: candidate template ignored: could not match 'const
_CharT *' against '__bind<int &, sockaddr *, unsigned long &>'
operator< (const _CharT* __lhs,
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/map:1407:1: note: candidate template ignored: could not match 'map'
against '__bind'
operator< (const map<_Key, _Tp, _Compare, _Allocator>& __x,
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/map:1872:1: note: candidate template ignored: could not match 'multimap'
against '__bind'
operator< (const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/set:754:1: note: candidate template ignored: could not match 'set' against
'__bind'
operator< (const set<_Key, _Compare, _Allocator>& __x,
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/set:1164:1: note: candidate template ignored: could not match 'multiset'
against '__bind'
operator< (const multiset<_Key, _Compare, _Allocator>& __x,
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/vector:3326:1: note: candidate template ignored: could not match 'vector'
against '__bind'
operator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
^
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/deque:2868:1: note: candidate template ignored: could not match 'deque'
against '__bind'
operator< (const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
`
@sodabrew
Copy link
Member

Looking for the error: line I see:

em.cpp:1242:59: error: invalid operands to binary expression ('__bind<int &, sockaddr *, unsigned long &>' and 'int')
                if (bind (sd, (struct sockaddr *)&bind_to, bind_to_len) < 0) {
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
/usr/local/Cellar/llvm/6.0.0/include/c++/v1/system_error:492:1: note: candidate function not viable: no known
conversion from '__bind<int &, sockaddr *, unsigned long &>' to 'const std::__1::error_condition' for 1st argument
operator<(const error_condition& __x, const error_condition& __y) _NOEXCEPT
^

First thing I found around the web suggests changing bind to ::bind. Can you try making this modification locally and report back if that helps?

@sodabrew
Copy link
Member

OK so the issue is not that your on Mac OS, it's that you're using LLVM 6.0 and C++17, so it's not looking at bind() the socket function, it looking at std::bind the partial function application. http://en.cppreference.com/w/cpp/utility/functional/bind

There's a using namespace std; line in project.h that tells the compiler that we want it to try to resolve functions under std:: first before going to external symbols, so this is a natural consequence of the new std::bind method that did not exist in earlier C++ versions.

https://github.com/eventmachine/eventmachine/blob/master/ext/project.h#L118

@suyesh
Copy link
Author

suyesh commented Apr 16, 2018

Can i comment the line 118?

@suyesh
Copy link
Author

suyesh commented Apr 16, 2018

well that didnt work lol. At this point idk what i am doing.

@suyesh
Copy link
Author

suyesh commented Apr 16, 2018

Got this fixed by uninstalling llvm that was installed using homeBrew

@sodabrew sodabrew added this to the v1.3.0 milestone Apr 16, 2018
@sodabrew
Copy link
Member

Thanks for reporting this issue! I'm going to leave it open because I will fix it for the next release. I see what needs to be done in the code to resolve this.

sodabrew added a commit to sodabrew/eventmachine that referenced this issue Apr 17, 2018
This resolves the conflict of socket bind() vs std::bind(), as more
std:: functions may be introduced in future versions of C++.

Resolves eventmachine#830
sodabrew added a commit to sodabrew/eventmachine that referenced this issue Apr 18, 2018
This resolves the conflict of socket bind() vs std::bind(), as more
std:: functions may be introduced in future versions of C++.

Resolves eventmachine#830
sodabrew added a commit that referenced this issue Apr 18, 2018
This resolves the conflict of socket bind() vs std::bind(), as more
std:: functions may be introduced in future versions of C++.

Resolves #830
sodabrew added a commit to sodabrew/eventmachine that referenced this issue Apr 30, 2018
…tmachine#831)

This resolves the conflict of socket bind() vs std::bind(), as more
std:: functions may be introduced in future versions of C++.

Resolves eventmachine#830
sodabrew added a commit to sodabrew/eventmachine that referenced this issue Apr 30, 2018
…tmachine#831)

This resolves the conflict of socket bind() vs std::bind(), as more
std:: functions may be introduced in future versions of C++.

Resolves eventmachine#830
@ericboehs
Copy link

I was having this issue with eventmachine 1.0.9.1 on Mac OS 10.13.6 using Ruby 2.3.7 and 2.4.4. brew uninstall llvm fixed this for me as well. Thank you @suyesh!

@bekicot
Copy link

bekicot commented Dec 18, 2018

For some reason, I have to use eventmachine v1.2.0.1.
brew uninstall llvm also fixed the problem in MacOS Mojave (10.14.2).

@MSP-Greg
Copy link
Contributor

Not a MacOS type. I've also got a few commits on top of the current EM.

See https://travis-ci.org/MSP-Greg/eventmachine/builds/464361679

MacOS (10.13?) is passing with Ruby 2.3.8, 2.4.5, & 2.5.3. I could add 2.2.x to the matrix if needed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants