mysqlclient-sys
mysqlclient-sys copied to clipboard
use mysql_config to generate linker args
This adds support for percona-server.
Bump (I just updated and ran into it again).
@sgrif Can this get merged? I ran into it again. Hard to remember how to fix it every time :)
Can you explain more what this does and why it's needed? The current behavior already uses mysql_config
as its fallback case.
I get this error:
% cargo install diesel_cli
...
Compiling diesel_cli v1.3.1
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-m64" " ... "-framework" "Security" "-lsqlite3" "-lpq" "-lmysqlclient" "-lSystem" "-lresolv" "-lpthread" "-lc" "-lm"
= note: ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
ld: library not found for -lmysqlclient
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
It installs ok if with my change. I'm on a mac and use homebrew. I don't have mysql installed, but I do have percona-server installed (https://github.com/Homebrew/homebrew-core/blob/master/Formula/percona-server.rb). It provides the same binaries, but the libraries have different names.
My output:
% mysql_config --libs
-L/usr/local/Cellar/percona-server/5.6.37-82.2/lib -lperconaserverclient -lz -lssl -lcrypto
Am I doing something wrong so I don't use mysql_config
in the existing release? Do I need a flag / config to use it?
Thoughts on merging this?
@nerdrew I'm facing the same issue, and I've found an easy work-around that seems to do the trick.
brew install mysql-client # keg-only, so it won't conflict with percona binaries
export PKG_CONFIG_PATH="/usr/local/opt/mysql-client/lib/pkgconfig"
cargo install diesel_cli --no-default-features --features=mysql
@sgrif I'm running into this as well. The issue here is that the percona-server package in homebrew does not install a link for libmysqlclient.dylib -> libperconaserverclient.dylib
. The percona-server implementation is a complete replacement for the mysqlclient implementation and should be totally safe to merge.
Closed as this is implemented by #40