-
-
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
mysql 8.0.33 causes issues when building mysqlclient
Python package
#130258
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This solve the issue $ export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient) |
We are working around this bug for our GitHub Actions workflow with: - name: Work around Homebrew MySQL being broken
run: |
brew install zlib
ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib |
Can confirm this works locally too in MacOS with 13.3.1 M1 Pro |
This is also causing issues in installing the |
if you get this error -> mac os global environment run: -> in your virtualenv or other environment ->
|
This looks like an upstream issue to me. Has anyone checked if the same problem cannot be reproduced when installing |
Also, an alternative workaround might be to do /usr/bin/sed -i .bak -e 's/\-lzlib/-lz/' "$(brew --prefix mysql)/bin/mysql_config" |
The problem is that most (all?) other platforms with 8.0.33 deployed seem to do so with the MySQL-bundled zlib rather than an external library, and so
|
Probably because MySQL insists on a very new version of Zlib, which is why we don't even use the one that ships with macOS. |
My solution is: BREW_PREFIX=$(brew --prefix)
export LDFLAGS="-L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/lib"
export CPPFLAGS="-I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/include"
export MYSQLCLIENT_LDFLAGS="${LDFLAGS} -L${BREW_PREFIX}/opt/zlib/lib"
export MYSQLCLIENT_CFLAGS="${CPPFLAGS} -I${BREW_PREFIX}/opt/zlib/include" % pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.1.1-cp310-cp310-macosx_13_0_arm64.whl
Installing collected packages: mysqlclient
Successfully installed mysqlclient-2.1.1 (Mac m2) |
We're having similar issues with the ruby mysql2 gem, this solved it for us on macOS gem install mysql2 -- --with-mysql-dir=$(brew --prefix mysql) or if you're using bundler bundle config --local build.mysql2 --with-mysql-dir=$(brew --prefix mysql)
bundle install |
@ytyng, tks for your solution! It helped me, but now I'm getting a new error while trying to install mysqlclient: MySQLdb/_mysql.c:29:10: fatal error: 'mysql.h' file not found Do you know something I can try? Full error: Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning. [36m error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully.
-I/opt/homebrew/opt/openssl/include -I/opt/homebrew/include -Dversion_info=(2,1,1,'final',0) -D__version__=2.1.1 -I/opt/homebrew/opt/openssl/include note: This error originates from a subprocess, and is likely not a problem with pip. |
The I suspect the recently-added patch taken from https://bugs.mysql.com/bug.php?id=110745 (which MySQL haven't released yet) had changed how the value for that flag gets set. |
TL;DR: This is an upstream bug. Can someone report this upstream please? Looking at their build scripts, the linker flags come from the CMake variable libs="$libs -l@LIBMYSQL_OS_OUTPUT_NAME@ @CONFIG_CLIENT_LIBS@" which is set here SET(CONFIG_CLIENT_LIBS "${CLIENT_LIBS}") while EXTRACT_LINK_LIBRARIES(mysqlclient CLIENT_LIBS) with the Their scripts call Zlib ELSEIF (lib MATCHES "^ext::")
STRING(REGEX MATCH "ext::([a-z]+)" MATCH_LIB "${lib}")
SET(SYSTEM_LIB ${CMAKE_MATCH_1})
SET(${var} "${${var}} -l${SYSTEM_LIB} ") For reference, other libraries are called Maybe the fix is just to replace Alternatively, |
Once we have an upstream bug report I'm happy to apply a workaround directly to the formula. |
Current version has issues ( Homebrew/homebrew-core#130258 ) Also adjust openssl paths as older version (1.1) of that is the dependency for the 5.7 mysql-client See osdn #48016 Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
Current version has issues ( Homebrew/homebrew-core#130258 ) Also adjust openssl paths as older version (1.1) of that is the dependency for the 5.7 mysql-client See osdn #48016 Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
Current version has issues ( Homebrew/homebrew-core#130258 ) Also adjust openssl paths as older version (1.1) of that is the dependency for the 5.7 mysql-client See osdn #48016 Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
Current version has issues ( Homebrew/homebrew-core#130258 ) Also adjust openssl paths as older version (1.1) of that is the dependency for the 5.7 mysql-client See osdn #48016 Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
Current version has issues ( Homebrew/homebrew-core#130258 ) Also adjust openssl paths as older version (1.1) of that is the dependency for the 5.7 mysql-client See osdn #48016 Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
Current version has issues ( Homebrew/homebrew-core#130258 ) Also adjust openssl paths as older version (1.1) of that is the dependency for the 5.7 mysql-client See osdn #48016 Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
this works for me. thanks a lot. |
Ok, this is work for me ! os version: |
This comment was marked as outdated.
This comment was marked as outdated.
This also appears to be impacting the percona-xtrabackup Formula when it tries to build DBD:mysql. |
This got me going on ubuntu:
|
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
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)?
Trying to install
mysqlclient
Python package after upgradingmysql
brew package to 8.0.33pip install mysqlclient
What happened (include all command output)?
What did you expect to happen?
I expected mysqlclient setup to be able to use
mysql
package (andzlib
) with no issuemysql_config --libs
has changed its output between 8.0.32 and 8.0.33 following this commit: 9aaec7fNow
-lzlib
is returnedStep-by-step reproduction instructions (by running
brew
commands)Here you can see the added
-lzlib
flagNow trying to install
mysqlclient
fails:I have
zlib
installed thoughI tried various combinations of
LIBRARY_PATH
,CFLAGS
,LDFLAGS
to try to havezlib
found but with no success. Downgrading tomysql@5.7
solved the issueThe text was updated successfully, but these errors were encountered: