Skip to content
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 not found when install by conan #2257

Open
vinikjkkj opened this issue Feb 13, 2025 · 9 comments
Open

mysql not found when install by conan #2257

vinikjkkj opened this issue Feb 13, 2025 · 9 comments

Comments

@vinikjkkj
Copy link

When you install drogon with with_mysql it installs libmysqlclient/8.1.0, but the package name is libmysqlclient not MySQL
And if you try to install libmariadb manually, it installs with package name mariadb-connector-c not unofficial-libmariadb

if (BUILD_MYSQL)

@rafeeque1
Copy link

@an-tao please take a look , i am also facing the same issues.

@an-tao
Copy link
Member

an-tao commented Feb 20, 2025

Sorry, I'm not very familiar with the Conan package manager. Let's ask the submitter of the Drogon package, @gav2xlin. Do you know how to solve this issue?

@gav2xlin
Copy link

I just updated the version, but I'm not a maintainer. That requirement is written here: https://github.com/conan-io/conan-center-index/blob/master/recipes/drogon/all/conanfile.py

class DrogonConan(ConanFile): ... def requirements(self): ... if self.options.get_safe("with_mysql"): self.requires("libmysqlclient/8.1.0")

https://conan.io/center/recipes/libmysqlclient?version=8.1.0
https://conan.io/center/recipes/drogon

def generate(self): .. tc = CMakeToolchain(self) ... tc.variables["BUILD_MYSQL"] = self.options.get_safe("with_mysql", False)

https://github.com/drogonframework/drogon/blob/master/CMakeLists.txt
CMAKE_DEPENDENT_OPTION(BUILD_MYSQL "Build with mysql support" ON "BUILD_ORM" OFF)

The Conan package manager is simple

@gav2xlin
Copy link

The vpckg package depends on libmariadb https://vcpkg.link/ports/drogon.json, but not Conan
{ "name": "libmariadb", "href": "https://vcpkg.link/ports/libmariadb", "is_host": false, "with_default_features": true, "version_constraint": null, "platform": "!osx" }

@rafeeque1
Copy link

@an-tao @gav2xlin i think conan should fetch MariaDB Connector/C not libmysqlclient, because ORM source code is based on MariaDB Connector/C , i already created one issue here #2244

@an-tao
Copy link
Member

an-tao commented Feb 20, 2025

@gav2xlin Thanks for your quick reply. Drogon uses mariadb connector library for MySQL, should we change the dependency in conan?

@rafeeque1
Copy link

@an-tao yes we need to replace dependency from libmysqlclient to mariadb connector in conan.

@an-tao
Copy link
Member

an-tao commented Feb 20, 2025

@an-tao yes we need to replace dependency from libmysqlclient to mariadb connector in conan.

Would u like to make a PR to the conan center repo for this? I don’t have a conan development environment.
Thanks.

@gav2xlin
Copy link

Would u like to make a PR to the conan center repo for this? I don’t have a conan development environment.
@an-tao

It's not so difficult. I cloned the git repo to update the version https://github.com/conan-io/conan-center-index/tree/master

https://docs.conan.io/2/tutorial/developing_packages/local_package_development_flow.html

https://github.com/conan-io/conan-center-index/blob/master/recipes/drogon/config.yml is for versions.

https://github.com/conan-io/conan-center-index/blob/master/recipes/drogon/all/conandata.yml is for sources

sources: "1.9.9": url: "https://github.com/drogonframework/drogon/archive/v1.9.9.tar.gz" sha256: "4155f78196902ef2f9d06b708897c9e8acaa1536cc4a8c8da9726ceb8ada2aaf"

https://github.com/conan-io/conan-center-index/blob/master/recipes/drogon/all/conanfile.py is obviously the core script that configures CMake and etc.

https://github.com/conan-io/conan-center-index/tree/master/recipes/drogon/all/patches are used in conandata.yml
patches: "1.9.9": - patch_file: "patches/1.8.5-0001-remove-shared-libs.patch" patch_description: "remove shared libs option" patch_type: "conan" - patch_file: "patches/1.9.7-0002-find-cci-packages.patch" patch_description: "Fix jsoncpp cmake target name" patch_type: "conan"

https://github.com/conan-io/conan-center-index/tree/master/recipes/drogon/all/test_package is for tests
...
https://docs.conan.io/2/tutorial/developing_packages/local_package_development_flow.html
conan source fetches the sources specified in conandata.yml
But you need to provide the version because it's not set: conan source --version 1.9.9

https://docs.conan.io/2/tutorial/versioning/versions.html is optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants