I'm getting this warning on macOS Sierra PB1 when I run crystal compiler. It probably prevents to run a simple Kemal app (it's web framework written in Crystal language). Apparently the problem lies in libevent. Tthe library would belong to https://github.com/Homebrew/homebrew-core/issues/1957 list.
It seems the fix is the following https://codereview.chromium.org/2134603002/diff/20001/base/third_party/libevent/kqueue.c (according to a guy from Crystal IRC).
Refs:
I'd be fine with us adopting the patch proposed in https://github.com/libevent/libevent/pull/377, but it may be reasonable to wait on some upstream feedback to the PR there given upstream is fairly active.
Still no change, even brew install libevent --HEAD doesn't fix the issue.
Have to continue using my Linux machine to stay with Crystal; a fantastic Ruby alternative.
Yeah, I can reproduce. The upstream fix doesn't seem completely sufficient, at least for crystal-lang.
It makes a significant difference though, at least on the surface. I don't know enough about crystal-lang to poke around deeper:
~> brew install libevent --HEAD && brew install crystal-lang -v
==> make crystal release=true
clang++ -c -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc `/usr/local/opt/llvm/bin/llvm-config --cxxflags`
clang -fPIC -c -o src/ext/sigfault.o src/ext/sigfault.c
ar -rcs src/ext/libcrystal.a src/ext/sigfault.o
./bin/crystal build --release -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
Deprecation: The build command was renamed to compile and will be removed in a future version.
...
==> Summary
馃嵑 /usr/local/Cellar/crystal-lang/0.18.7: 631 files, 34.3M, built in 4 minutes 49 seconds
$ crystal
Usage: crystal [command] [switches] [program file] [--] [arguments]
Compared to:
~> brew install libevent && brew install crystal-lang -v
==> make crystal release=true
clang++ -c -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc `/usr/local/opt/llvm/bin/llvm-config --cxxflags`
clang -fPIC -c -o src/ext/sigfault.o src/ext/sigfault.c
ar -rcs src/ext/libcrystal.a src/ext/sigfault.o
./bin/crystal build --release -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
Deprecation: The build command was renamed to compile and will be removed in a future version.
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
...
==> Summary
馃嵑 /usr/local/Cellar/crystal-lang/0.18.7: 631 files, 34.3M, built in 4 minutes 18 seconds
$ crystal
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
Usage: crystal [command] [switches] [program file] [--] [arguments]
It works for me on macOS 10.12 beta3 with Xcode 8 beta3 :-)
Uninstalled libevent, llvm and cleaned up brew.
Run brew update twice and then brew install libevent --HEAD && brew install crystal-lang -v
I also saw this message
==> make crystal release=true
clang++ -c -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc `/usr/local/opt/llvm/bin/llvm-config --cxxflags`
clang -fPIC -c -o src/ext/sigfault.o src/ext/sigfault.c
ar -rcs src/ext/libcrystal.a src/ext/sigfault.o
./bin/crystal build --release -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
Deprecation: The build command was renamed to compile and will be removed in a future version.
But at the end the installation was successful.
==> /private/tmp/crystal-lang-20160727-38564-1a406ho/crystal-0.18.7/bin/crystal build -o /private/tmp/crystal-lang-20160727-38564-1a406ho/crystal-0.18.7/.build/shards src/shards.cr
Using compiled compiler at .build/crystal
==> Cleaning
==> Finishing up
ln -s ../../Cellar/crystal-lang/0.18.7/etc/bash_completion.d/crystal crystal
ln -s ../Cellar/crystal-lang/0.18.7/bin/crystal crystal
ln -s ../Cellar/crystal-lang/0.18.7/bin/shards shards
ln -s ../../../Cellar/crystal-lang/0.18.7/share/zsh/site-functions/crystal crystal
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
==> Summary
馃嵑 /usr/local/Cellar/crystal-lang/0.18.7: 631 files, 34.3M, built in 4 minutes 31 seconds
I've applied the upstream patch to our libevent formula in stable, so you should be able to brew update & then use a vanilla brew install libevent && brew install crystal-lang -v without issue.
Since we seem to have _mostly_ resolved this specific issue I've added this into our tracking thread @ https://github.com/Homebrew/homebrew-core/issues/1957 & will close here. Please shout if you uncover any deeper errors though, so we can go back upstream to libevent as necessary.
It works! I uninstalled libevent, llvm and crystal-lang then let brew install everything again but without --HEAD. Thanks, man!
Great! Thanks for the confirmation on your end. Happy to help.
Just for future reference, I ran into the same problem with tmux. Was able to solve by reinstalling libevent and tmux:
$ brew reinstall libevent
$ brew reinstall tmux
I've tried reinstalling libevent , tmux , llvm and crystal lang. But not work , I've always the same error:
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
I had the same problem. It happened because i had 2 installs from the chromedriver. What i did: Uninstall chromedriver with brew brew uninstall chromedriver. Than type chromedriver in your terminal. If it still exists than remove it. In my case i installed it in my global node modules. So i deleted it with npm npm uninstall -g chromedriver and installed it again with brew. That did the trick for me.
I had the same issue with chromedriver, the following worked for me:
brew update
brew reinstall libevent
brew reinstall chromedriver
I've tried reinstalling libevent , tmux , llvm and crystal lang. I am still getting the same error:
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
I've tried reinstalling libevent,llvm,chromewebdriver,upgrade brew and ect.... It's doesn't work....still.....help me....

@learnsomuch @MordaBoy Please report this to the upstream project, it's not our issue.
Most helpful comment
Just for future reference, I ran into the same problem with
tmux. Was able to solve by reinstallinglibeventandtmux: