conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
942 stars 1.7k forks source link

[package] sqlite3/3.39.2: FindSQLite3.cmake fails on Windows with conan <= 1.49.0 #12576

Open pcbennion opened 2 years ago

pcbennion commented 2 years ago

Package and Environment Details

Conan profile

[settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=Visual Studio compiler.runtime=MD compiler.version=16 os=Windows os_build=Windows [options] [conf] [build_requires] [env]

Steps to reproduce

On windows, using conan 1.49.0 and earlier, consume the conancenter sqlite3 package with the following CMakeLists.txt:

cmake_minimum_required(VERSION 3.16)
find_package(SQLite3        MODULE REQUIRED)
message(STATUS  "Sqlite3 dirs: ${SQLite3_INCLUDE_DIRS}")

find_package will fail to populate any of the associated sqlite3 targets or variables.

Logs

Click to expand log ``` conanfile.py (Sqlite3Consumer/0.0.1): Calling build() ********************************************************************** ** Visual Studio 2019 Developer Command Prompt v16.4.5 ** Copyright (c) 2019 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x64' -- Conan: Using autogenerated FindSQLite3.cmake -- Library sqlite3 not found in package, might be system one -- Library sqlite3 not found in package, might be system one -- Sqlite3 dirs: ```
pcbennion commented 2 years ago

I suspect #12078 may have broken compatability with older conan installs.

OSX and Linux builds seem to be unaffected. UPDATE: The cmake scripts are broken for all platforms; our OSX and Linux were failing silently because they automatically fall back to system sqlite3 libraries.

Updating my windows machine to conan 1.51.3 fixed the issue.

uilianries commented 2 years ago

@pcbennion please, read CCI documentation, how to isolate my project from upstream changes

The Conan Center Index expects that every user is running the latest version available. We know not any company can switch from one version to another easier, so for those cases, we recommend Lockfiles.

Also, we started to prepared official recipes to support Conan v2, which should become the standard version in few months.

SpaceIm commented 2 years ago

Did it fail with CMakeDeps or cmake_find_package?

For CMakeDeps, there was this kind of issue for example: https://github.com/conan-io/conan/issues/11862, (fixed by https://github.com/conan-io/conan/pull/11874).

CCI recipes can't track conan client issues & regressions of each generator, and set a required_conan_version depending on which generator you use to consume a recipe.

pcbennion commented 2 years ago

@uilianries

@pcbennion please, read CCI documentation, how to isolate my project from upstream changes

The Conan Center Index expects that every user is running the latest version available. We know not any company can switch from one version to another easier, so for those cases, we recommend Lockfiles.

Also, we started to prepared official recipes to support Conan v2, which should become the standard version in few months.

We isolate our projects by hosting our own conan server. On the occasions we pull from conancenter (usually while updating dependency versions/options), we specify recipe revisions and use a lockfile. Our lock on sqlite3 was last updated to pull in 3.39.2.

conanfile.py ``` from conans import ConanFile class CommonSoftwareConan(ConanFile): name = "common-software" version = "0.0.4" description = "A dummy package to help pull in all of the third-party software needed by other projects" settings = "os", "compiler", "build_type", "arch" topics = ("conan") license = "MIT" @property def _is_mobile(self): return self.settings.os == "Android" or self.settings.os == "iOS" def requirements(self): if not self._is_mobile and not self.settings.os == "Windows": self.requires("icu/71.1#bfeae0d51b98282b0cd60ab4bcb7cec4") self.requires("bzip2/1.0.8#b056f852bd2d5af96fc7171aadfd6c0b") self.requires("gtest/1.11.0#a1a0495dee5515ab44f510e93b85d45f") self.requires("libcurl/7.75.0#c19b72492553ec9670a0e4e8c234ba2e") self.requires("libiconv/1.17#afd1aadb534bff5f0dc9e6969eb4cd02") self.requires("openssl/1.1.1q#5f25b2ff5bed8a6bec73b90fe963d93c") self.requires("sqlite3/3.39.2#bcbc402aeced01e756cb1e7199a7f188") self.requires("zlib/1.2.12#3b9e037ae1c615d045a06c67d88491ae") self.requires("rapidjson/cci.20211112#65b4e5feb6f1edfc8cbac0f669acaf17") self.requires("flatcc/0.6.1#3019afc482d1370aa03ce960f38f9faf") def configure(self): if self.settings.os == "Linux": self.options["openssl"].shared = True ```
windows.lock ``` { "graph_lock": { "nodes": { "0": { "ref": "common-software/0.0.4", "options": "bzip2:build_executable=True\nbzip2:shared=False\nflatcc:fast_double=False\nflatcc:gnu_posix_memalign=True\nflatcc:ignore_const_condition=False\nflatcc:native_optim=False\nflatcc:portable=False\nflatcc:reflection=True\nflatcc:runtime_lib_only=False\nflatcc:shared=False\nflatcc:verify_assert=False\nflatcc:verify_trace=False\ngtest:build_gmock=True\ngtest:hide_symbols=False\ngtest:no_main=False\ngtest:shared=False\nlibcurl:shared=False\nlibcurl:with_brotli=False\nlibcurl:with_c_ares=False\nlibcurl:with_ca_bundle=None\nlibcurl:with_ca_path=None\nlibcurl:with_cookies=True\nlibcurl:with_crypto_auth=True\nlibcurl:with_dict=True\nlibcurl:with_docs=False\nlibcurl:with_file=True\nlibcurl:with_ftp=True\nlibcurl:with_gopher=True\nlibcurl:with_http=True\nlibcurl:with_imap=True\nlibcurl:with_ipv6=True\nlibcurl:with_largemaxwritesize=False\nlibcurl:with_ldap=False\nlibcurl:with_libidn=False\nlibcurl:with_librtmp=False\nlibcurl:with_libssh2=False\nlibcurl:with_mqtt=True\nlibcurl:with_nghttp2=False\nlibcurl:with_ntlm=True\nlibcurl:with_ntlm_wb=True\nlibcurl:with_pop3=True\nlibcurl:with_proxy=True\nlibcurl:with_rtsp=True\nlibcurl:with_smb=True\nlibcurl:with_smtp=True\nlibcurl:with_ssl=openssl\nlibcurl:with_symbol_hiding=False\nlibcurl:with_telnet=True\nlibcurl:with_tftp=True\nlibcurl:with_threaded_resolver=True\nlibcurl:with_unix_sockets=True\nlibcurl:with_verbose_debug=True\nlibcurl:with_verbose_strings=True\nlibcurl:with_zlib=True\nlibcurl:with_zstd=False\nlibiconv:shared=False\nopenssl:386=False\nopenssl:capieng_dialog=False\nopenssl:enable_capieng=False\nopenssl:enable_weak_ssl_ciphers=False\nopenssl:no_aria=False\nopenssl:no_asm=False\nopenssl:no_async=False\nopenssl:no_bf=False\nopenssl:no_blake2=False\nopenssl:no_camellia=False\nopenssl:no_cast=False\nopenssl:no_chacha=False\nopenssl:no_cms=False\nopenssl:no_comp=False\nopenssl:no_ct=False\nopenssl:no_deprecated=False\nopenssl:no_des=False\nopenssl:no_dgram=False\nopenssl:no_dh=False\nopenssl:no_dsa=False\nopenssl:no_dso=False\nopenssl:no_ec=False\nopenssl:no_ecdh=False\nopenssl:no_ecdsa=False\nopenssl:no_engine=False\nopenssl:no_filenames=False\nopenssl:no_gost=False\nopenssl:no_hmac=False\nopenssl:no_idea=False\nopenssl:no_md4=False\nopenssl:no_md5=False\nopenssl:no_mdc2=False\nopenssl:no_ocsp=False\nopenssl:no_pinshared=False\nopenssl:no_rc2=False\nopenssl:no_rfc3779=False\nopenssl:no_rmd160=False\nopenssl:no_rsa=False\nopenssl:no_seed=False\nopenssl:no_sha=False\nopenssl:no_sm2=False\nopenssl:no_sm3=False\nopenssl:no_sm4=False\nopenssl:no_sock=False\nopenssl:no_srp=False\nopenssl:no_srtp=False\nopenssl:no_sse2=False\nopenssl:no_ssl=False\nopenssl:no_ssl3=False\nopenssl:no_stdio=False\nopenssl:no_tests=False\nopenssl:no_threads=False\nopenssl:no_tls1=False\nopenssl:no_ts=False\nopenssl:no_whirlpool=False\nopenssl:openssldir=None\nopenssl:shared=False\nsqlite3:build_executable=True\nsqlite3:disable_gethostuuid=False\nsqlite3:enable_column_metadata=True\nsqlite3:enable_dbpage_vtab=False\nsqlite3:enable_dbstat_vtab=False\nsqlite3:enable_default_secure_delete=False\nsqlite3:enable_default_vfs=True\nsqlite3:enable_explain_comments=False\nsqlite3:enable_fts3=False\nsqlite3:enable_fts3_parenthesis=False\nsqlite3:enable_fts4=False\nsqlite3:enable_fts5=False\nsqlite3:enable_json1=False\nsqlite3:enable_math_functions=True\nsqlite3:enable_preupdate_hook=False\nsqlite3:enable_rtree=True\nsqlite3:enable_soundex=False\nsqlite3:enable_unlock_notify=True\nsqlite3:max_blob_size=None\nsqlite3:max_column=None\nsqlite3:max_variable_number=None\nsqlite3:omit_deprecated=False\nsqlite3:omit_load_extension=False\nsqlite3:shared=False\nsqlite3:threadsafe=1\nsqlite3:use_alloca=False\nzlib:shared=False", "requires": [ "1", "2", "3", "6", "4", "7", "5", "8", "9" ], "path": "conanfile.py", "context": "host" }, "1": { "ref": "bzip2/1.0.8#b056f852bd2d5af96fc7171aadfd6c0b", "options": "build_executable=True\nshared=False", "package_id": "d16a91eadaaf5829b928b12d2f836ff7680d3df5", "prev": "0", "context": "host" }, "2": { "ref": "gtest/1.11.0#a1a0495dee5515ab44f510e93b85d45f", "options": "build_gmock=True\nhide_symbols=False\nno_main=False\nshared=False", "package_id": "5ad274d83035c78ba2b205e6cf4f1b317aee8e05", "prev": "0", "context": "host" }, "3": { "ref": "libcurl/7.75.0#c19b72492553ec9670a0e4e8c234ba2e", "options": "shared=False\nwith_brotli=False\nwith_c_ares=False\nwith_ca_bundle=None\nwith_ca_path=None\nwith_cookies=True\nwith_crypto_auth=True\nwith_dict=True\nwith_docs=False\nwith_file=True\nwith_ftp=True\nwith_gopher=True\nwith_http=True\nwith_imap=True\nwith_ipv6=True\nwith_largemaxwritesize=False\nwith_ldap=False\nwith_libidn=False\nwith_librtmp=False\nwith_libssh2=False\nwith_mqtt=True\nwith_nghttp2=False\nwith_ntlm=True\nwith_ntlm_wb=True\nwith_pop3=True\nwith_proxy=True\nwith_rtsp=True\nwith_smb=True\nwith_smtp=True\nwith_ssl=openssl\nwith_symbol_hiding=False\nwith_telnet=True\nwith_tftp=True\nwith_threaded_resolver=True\nwith_unix_sockets=True\nwith_verbose_debug=True\nwith_verbose_strings=True\nwith_zlib=True\nwith_zstd=False\nopenssl:386=False\nopenssl:capieng_dialog=False\nopenssl:enable_capieng=False\nopenssl:enable_weak_ssl_ciphers=False\nopenssl:no_aria=False\nopenssl:no_asm=False\nopenssl:no_async=False\nopenssl:no_bf=False\nopenssl:no_blake2=False\nopenssl:no_camellia=False\nopenssl:no_cast=False\nopenssl:no_chacha=False\nopenssl:no_cms=False\nopenssl:no_comp=False\nopenssl:no_ct=False\nopenssl:no_deprecated=False\nopenssl:no_des=False\nopenssl:no_dgram=False\nopenssl:no_dh=False\nopenssl:no_dsa=False\nopenssl:no_dso=False\nopenssl:no_ec=False\nopenssl:no_ecdh=False\nopenssl:no_ecdsa=False\nopenssl:no_engine=False\nopenssl:no_filenames=False\nopenssl:no_gost=False\nopenssl:no_hmac=False\nopenssl:no_idea=False\nopenssl:no_md4=False\nopenssl:no_md5=False\nopenssl:no_mdc2=False\nopenssl:no_ocsp=False\nopenssl:no_pinshared=False\nopenssl:no_rc2=False\nopenssl:no_rfc3779=False\nopenssl:no_rmd160=False\nopenssl:no_rsa=False\nopenssl:no_seed=False\nopenssl:no_sha=False\nopenssl:no_sm2=False\nopenssl:no_sm3=False\nopenssl:no_sm4=False\nopenssl:no_sock=False\nopenssl:no_srp=False\nopenssl:no_srtp=False\nopenssl:no_sse2=False\nopenssl:no_ssl=False\nopenssl:no_ssl3=False\nopenssl:no_stdio=False\nopenssl:no_tests=False\nopenssl:no_threads=False\nopenssl:no_tls1=False\nopenssl:no_ts=False\nopenssl:no_whirlpool=False\nopenssl:openssldir=None\nopenssl:shared=False\nzlib:shared=False", "package_id": "5ef83da282b649952adc10f683cd07f7370f6543", "prev": "0", "requires": [ "4", "5" ], "context": "host" }, "4": { "ref": "openssl/1.1.1q#5f25b2ff5bed8a6bec73b90fe963d93c", "options": "386=False\ncapieng_dialog=False\nenable_capieng=False\nenable_weak_ssl_ciphers=False\nno_aria=False\nno_asm=False\nno_async=False\nno_bf=False\nno_blake2=False\nno_camellia=False\nno_cast=False\nno_chacha=False\nno_cms=False\nno_comp=False\nno_ct=False\nno_deprecated=False\nno_des=False\nno_dgram=False\nno_dh=False\nno_dsa=False\nno_dso=False\nno_ec=False\nno_ecdh=False\nno_ecdsa=False\nno_engine=False\nno_filenames=False\nno_gost=False\nno_hmac=False\nno_idea=False\nno_md4=False\nno_md5=False\nno_mdc2=False\nno_ocsp=False\nno_pinshared=False\nno_rc2=False\nno_rfc3779=False\nno_rmd160=False\nno_rsa=False\nno_seed=False\nno_sha=False\nno_sm2=False\nno_sm3=False\nno_sm4=False\nno_sock=False\nno_srp=False\nno_srtp=False\nno_sse2=False\nno_ssl=False\nno_ssl3=False\nno_stdio=False\nno_tests=False\nno_threads=False\nno_tls1=False\nno_ts=False\nno_whirlpool=False\nopenssldir=None\nshared=False", "package_id": "3fb49604f9c2f729b85ba3115852006824e72cab", "prev": "0", "context": "host" }, "5": { "ref": "zlib/1.2.12#3b9e037ae1c615d045a06c67d88491ae", "options": "shared=False", "package_id": "3fb49604f9c2f729b85ba3115852006824e72cab", "prev": "0", "context": "host" }, "6": { "ref": "libiconv/1.17#afd1aadb534bff5f0dc9e6969eb4cd02", "options": "shared=False", "package_id": "3fb49604f9c2f729b85ba3115852006824e72cab", "prev": "0", "context": "host" }, "7": { "ref": "sqlite3/3.39.2#bcbc402aeced01e756cb1e7199a7f188", "options": "build_executable=True\ndisable_gethostuuid=False\nenable_column_metadata=True\nenable_dbpage_vtab=False\nenable_dbstat_vtab=False\nenable_default_secure_delete=False\nenable_default_vfs=True\nenable_explain_comments=False\nenable_fts3=False\nenable_fts3_parenthesis=False\nenable_fts4=False\nenable_fts5=False\nenable_json1=False\nenable_math_functions=True\nenable_preupdate_hook=False\nenable_rtree=True\nenable_soundex=False\nenable_unlock_notify=True\nmax_blob_size=None\nmax_column=None\nmax_variable_number=None\nomit_deprecated=False\nomit_load_extension=False\nshared=False\nthreadsafe=1\nuse_alloca=False", "package_id": "1cb7125758648b3fd39bd045f772ec43fd26f71a", "prev": "0", "context": "host" }, "8": { "ref": "rapidjson/cci.20211112#65b4e5feb6f1edfc8cbac0f669acaf17", "options": "", "package_id": "5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9", "prev": "0", "context": "host" }, "9": { "ref": "flatcc/0.6.1#3019afc482d1370aa03ce960f38f9faf", "options": "fast_double=False\ngnu_posix_memalign=True\nignore_const_condition=False\nnative_optim=False\nportable=False\nreflection=True\nruntime_lib_only=False\nshared=False\nverify_assert=False\nverify_trace=False", "package_id": "80dee32e38011e73cd0976d887bd54b817647365", "prev": "0", "context": "host" } }, "revisions_enabled": true }, "version": "0.4", "profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=Visual Studio\ncompiler.runtime=MD\ncompiler.version=16\nos=Windows\nos_build=Windows\n[options]\n[build_requires]\n[env]\nCC=cl.exe\nCONAN_CMAKE_GENERATOR=Ninja\nCXX=cl.exe" } ```

--building the older sqlite3 recipe rev still results in a broken .cmake script. Using conan 1.49.0, the only way I've been able to make a working sqlite3 since the PR above was by checking out a prior conan-center-index commit and building it from there.

@SpaceIm

Did it fail with CMakeDeps or cmake_find_package?

For CMakeDeps, there was this kind of issue for example: conan-io/conan#11862, (fixed by conan-io/conan#11874).

CCI recipes can't track conan client issues & regressions of each generator, and set a required_conan_version depending on which generator you use to consume a recipe.

We use cmake_find_package.