-
Notifications
You must be signed in to change notification settings - Fork 435
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
Better support for building on Windows #484
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #484 +/- ##
=======================================
Coverage 84.32% 84.32%
=======================================
Files 6 6
Lines 555 555
=======================================
Hits 468 468
Misses 87 87 Continue to review full report at Codecov.
|
mysqlclient can be built against either the MySQL Connector/C or the MariaDB Connector/C. Previously, which library was used was hardcoded in setup_windows.py while the path to the library was in site.cfg. Now both settings can be specified in site.cfg, as environment variables, or auto-detected. If a client isn't specified but a connector path is, that path will be searched for either mariadbclient.lib or mysqlclient.lib to set the client type. If a client is specified but a connector path isn't, the default path used by the pre-built .msi installers will be assumed. This will probably be "C:\Program Files\MariaDB\MariaDB Connector C" for mariadbclient and "C:\Program Files\MySQL\MySQL Connector C 6.1" for mysqlclient ("C:\Program Files (x86)" will be used on 32-bit builds). If neither client nor connector are specified, both client types will be checked to see if the appropriate .lib file exists in the default connector directory. These changes will allow users to install from source via pip (if binary wheels aren't available) without having to clone this repo to edit site.cfg. They can either install one of the connectors in the default location or install it somewhere else and set the path in the `MYSQLCLIENT_CONNECTOR` environment variable before installing. One other slight change was to add additional install and library directories for mariadbclient. This is because the pre-built connector binaries install the needed files in `include` and `lib` whereas building from source (like this repo's workflow does) leaves them in `include/mariadb` and `lib/mariadb`.
methane
reviewed
Mar 8, 2021
MySQL Connector/C is not longer published since 2017. New builds are always done against MariaDB Connector/C. Dropping support for the deprecated MySQL Connector simplifies the Windows build process.
This was referenced Nov 18, 2021
Merged
1 task
This was referenced Mar 7, 2022
This was referenced Mar 26, 2022
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I know that you are not a Windows user and that you don't wish to provide support for source builds on Windows. However, I am a Windows user and have had to build mysqlclient from source because you do not provide wheels for 32-bit versions of Python (which I need for other reasons). I am hoping that you will accept this PR that should make it easier for users like me to be able to install mysqlclient from source without needing to clone this repo to edit site.cfg and setup_windows.py.
I know this cannot account for all possible setups, but at least with these changes it has a chance of building under some setups, which should be an improvement on the current defaults in setup_windows.py and site.cfg which I don't believe have any chance at building correctly. This PR includes 5 small improvements:
MYSQLCLIENT_CLIENT
andMYSQLCLIENT_CONNECTOR
so that someone who knows what they are doing can point the build script to their copy of the connector while installing from pip without needing to clone this repo to edit site.cfg.directory.
include
andlib
whereas building from source (like this repo's workflow does) leaves them ininclude/mariadb
andlib/mariadb
. I'm not sure why these differ, but it shouldn't be harmful to add both locations to the include/lib paths so that either works.I'm happy to break up these changes if you would like to accept some of them but not others. Also, while I can confirm that building against MySQL Connector/C 6.1 does still work, since it has not been updated in over 3 years and it seems like you do not build against it anymore, we could simplify things by removing support for it. We could go back to hardcoding the client library as mariadbclient if that were the only one we support and then there would just be a single site.cfg option and environment variable, and a single default directory.