-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Can't install mysql2
gem after installing mysql
8.0.33
formula
#131407
Comments
Did you report this to the authors of the gem? Because I'm not sure how this could be a package issue on brews side. |
Very similar to #130258: the output from I guess it should have |
Try doing export LDFLAGS=-L/opt/homebrew/lib |
No change. I don't think Ruby's |
I have not, I traced the cause to the output of the HomeBrew-provided |
Try this: /usr/bin/sed -i .bak -E -e '/^libs="\-L/ s;"$; -L/opt/homebrew/lib";' "$(brew --prefix mysql)/bin/mysql_config" You can do |
This is another upstream bug. It used to be handled by: https://github.com/mysql/mysql-server/blob/ea7087d885006918ad54458e7aad215b1650312c/scripts/CMakeLists.txt#L334-L337 but this code is no longer executed after the change to use |
@carlocab thanks for the suggestions. I'm indirectly asking people to use this library via a gem dependency, and to roll this out I'd have to direct them to manually edit the I can certainly do the edit. I reported this because I thought HomeBrew would provide a @Bo98 aha, that's the code that would previously be called before the recent Makefile change (adding interfaces for the library dependencies). |
I'm happy to apply a workaround to |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Closing this as an upstream issue. Here's a workaround that can be applied to the formula: diff --git a/Formula/mysql.rb b/Formula/mysql.rb
index aaf91e11ece..2fd11200b87 100644
--- a/Formula/mysql.rb
+++ b/Formula/mysql.rb
@@ -106,8 +106,10 @@ class Mysql < Formula
system "cmake", "--install", "build"
# Fix bad linker flags in `mysql_config`.
- # https://bugs.mysql.com/bug.php?id=111011
- inreplace bin/"mysql_config", "-lzlib", "-lz"
+ inreplace bin/"mysql_config" do |s|
+ s.gsub!("-lzlib", "-lz") # https://bugs.mysql.com/bug.php?id=111011
+ s.gsub!(/^libs="-L\$pkglibdir/, "\\0 -L#{HOMEBREW_PREFIX}/lib") # bug reference here
+ end
(prefix/"mysql-test").cd do
system "./mysql-test-run.pl", "status", "--vardir=#{Dir.mktmpdir}" Feel free to open a pull request that applies this patch once it's been reported upstream. Replace |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputbrew config
brew doctor
Verification
brew doctor
output" saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
bundle install
in a repo with a Gemfile likeWhat happened (include all command output)?
What did you expect to happen?
That the
mysql2
gem would compile its native extensions and install without error.Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: