【发布时间】:2020-02-21 23:07:52
【问题描述】:
上下文:
当我遇到一些问题时,我试图在 gitlab 管道上构建我的项目。在 AWS 上的管道中运行 gitlab-ci.yml 时,在两个测试部分中,其中一个在 conan install 步骤中失败。
成功部分:
- conan install .. --build missing -s build_type=Release
失败的部分:
- conan install .. --build missing -s build_type=Debug
两者之间唯一真正的区别似乎是 conan build_type,因为两者都使用相同的 docker 映像。我猜测我从中得到的错误是由于 build_type 更改,使其尝试找到具有额外依赖项的额外包(soci 和 mariadb-connector)。
错误:
mariadb-connector-c/3.0.10@omitted/stable: Configuring sources in /root/.conan/data/mariadb-connector-c/3.0.10/omitted/stable/source
WARN: OpenSSL/1.1.0j@conan/stable: requirement zlib/1.2.11@conan/stable overridden by mariadb-connector-c/3.0.10@omitted/stable to zlib/1.2.11
OpenSSL/1.1.0j@conan/stable: WARN: ----------MAKE OPENSSL 1.1.0j-------------
ERROR: mariadb-connector-c/3.0.10@omitted/stable: Error in source() method, line 23
"https://downloads.mariadb.org/f/connector-c-{0}/mariadb-connector-c-{0}-src.zip".format(self.version))
NotFoundException: Not found: https://downloads.mariadb.org/f/connector-c-3.0.10/mariadb-connector-c-3.0.10-src.zip
柯南文件:
from conans import ConanFile, CMake
class ProjectConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = "rfc/2.2@ommited/stable", "soci/3.2.3@ommited/stable", "libxml2/2.9.9", "zlib/1.2.11"
default_options = {"qt:openssl": "False", "qt:with_sqlite3": "False",
"qt:with_mysql": "False", "qt:with_odbc": "False", "qt:with_pq": "False"}
generators = "cmake"
def requirements(self):
if self.settings.os == "Windows":
self.requires("libiconv/1.15@bincrafters/stable")
self.requires("qt/5.13.2@bincrafters/stable")
def configure(self):
if self.settings.os == "Windows":
self.generators.append("qt")
def imports(self):
if self.settings.os == "Windows":
self.copy("*.dll", dst="bin", src="bin")
self.copy("*.pdb", dst="bin", src="bin")
self.copy("*.dylib*", dst="bin", src="lib")
self.copy("*.so*", dst="lib", src="lib")
我在网上搜索了一些关于conan package build_types的信息,但无法从官方文章中理解Debug和Release build_types之间的区别。我还查看了我的项目柯南文件(上图),在其中找不到调试和发布 build_types 之间的依赖关系的任何差异。
问题:
Conan Release 和 Debug build_types 可以有不同的包依赖关系吗?如果有,我在哪里可以找到它们?
如果它们不能有不同的包依赖关系,Release 和 Debug build_types 有什么区别?
如果我需要提供任何其他信息,请告诉我。
谢谢!
【问题讨论】:
-
如果有人需要,我也可以提供完整的gitlab-ci.yml命令
-
大概发布版本可以作为您平台的预构建包使用,但调试不是,构建失败,因为配方中的源位置似乎不正确
-
@AlanBirtles 是的,我们在源位置没有 mariadb 3.0.10,但你知道我在哪里可以找到调试构建类型的配方吗?