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

fix drogon with sqlite on conan #1483

Open
okaerin opened this issue Jan 18, 2023 · 2 comments
Open

fix drogon with sqlite on conan #1483

okaerin opened this issue Jan 18, 2023 · 2 comments

Comments

@okaerin
Copy link

okaerin commented Jan 18, 2023

Describe the bug
drogon cannot be built with wit sqlite support using the official conan recipe. A PR with the fix is placed conan-center-index but awaits approval. The issue is the custom FindSQLite3.cmake which is not used in the conan case and therefore the target SQLite3_lib is not created and thus not properly linking to sqlite3.

To Reproduce
Steps to reproduce the behavior:

  1. install dependencies with conan: conan install -r conancenter -pr:b default -b missing ..
  2. See error
Show build output
In file included from ~/.conan/data/drogon/1.8.2/_/_/build/29b7a10fab013440ab3aa45962e0ad849f6963d8/src/orm_lib/src/sqlite3_impl/Sqlite3Connection.h:18,
                 from ~/.conan/data/drogon/1.8.2/_/_/build/29b7a10fab013440ab3aa45962e0ad849f6963d8/src/orm_lib/src/sqlite3_impl/Sqlite3Connection.cc:15:
~/.conan/data/drogon/1.8.2/_/_/build/29b7a10fab013440ab3aa45962e0ad849f6963d8/src/orm_lib/src/sqlite3_impl/Sqlite3ResultImpl.h:19:10: fatal error: sqlite3.h: No such file or directory
   19 | #include <sqlite3.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/drogon.dir/build.make:692: CMakeFiles/drogon.dir/orm_lib/src/sqlite3_impl/Sqlite3Connection.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/drogon.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Expected behavior
A successfully built and installed package

Additional context

conan recipe
from conan import ConanFile


class Recipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"

    default_options = {
        "drogon:with_ctl": True,
        "drogon:with_orm": True,
        "drogon:with_sqlite": True,
    }
    def layout(self):
        self.folders.generators = "conan"

    def requirements(self):
        self.requires("fmt/9.0.0")
        self.requires("drogon/1.8.2")
    

    def build_requirements(self):
        self.test_requires("catch2/3.0.1")

    def imports(self):
        self.copy("drogon_ctl",dst="packages/bin",src="bin", root_package="drogon")
@okaerin
Copy link
Author

okaerin commented Jan 27, 2023

It is fixed the conan recipe for the versions 1.8.0 and 1.8.2 . In time I will try to supply a permanent fix here too, so conan recipes don't require the patches for further versions anymore

@an-tao
Copy link
Member

an-tao commented Jan 28, 2023

It is fixed the conan recipe for the versions 1.8.0 and 1.8.2 . In time I will try to supply a permanent fix here too, so conan recipes don't require the patches for further versions anymore

Thanks so much.

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

2 participants