柯南无法从新构建服务器中找到包 ID
Conan cannot find package id from new build server
我正在和 Conan 一起消费神器中的一个项目。
工件是在我的 Jenkins 管道中构建的,并已上传到工件库。
我有 2 个构建服务器,我想从旧服务器迁移到新服务器。
当我使用在新构建服务器中构建的工件时,出现以下错误:
[2020-10-06T14:49:07.485Z] Requirements
[2020-10-06T14:49:07.485Z] ext_TPC/11.8.128@prod/master from 'conan-extTPC' - Downloaded
[2020-10-06T14:49:07.485Z] ext_cli_plugins/11.800.30@prod/master from 'conan-CliPlugins' - Downloaded
[2020-10-06T14:49:07.485Z] ext_dotnet_plugins/11.800.44@prod/master from 'conan-DotNetPlugins' - Downloaded
[2020-10-06T14:49:07.485Z] Packages
[2020-10-06T14:49:07.485Z] ext_TPC/11.8.128@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Missing
[2020-10-06T14:49:07.485Z] ext_cli_plugins/11.800.30@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Download
[2020-10-06T14:49:07.485Z] ext_dotnet_plugins/11.800.44@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Download
[2020-10-06T14:49:07.485Z]
[2020-10-06T14:49:07.485Z] Installing (downloading, building) binaries...
[2020-10-06T14:49:07.485Z]
[2020-10-06T14:49:07.485Z] ERROR: Missing binary: ext_TPC/11.8.128@prod/master:63da998e3642b50bee33f4449826b2d623661505
[2020-10-06T14:49:07.485Z] ext_TPC/11.8.128@prod/master: WARN: Can't find a 'ext_TPC/11.8.128@prod/master' package for the specified settings, options and dependencies:
[2020-10-06T14:49:07.485Z] - Settings: arch=x86_64, build_type=Release, compiler=Visual Studio, compiler.runtime=MD, compiler.version=14, os=Windows
[2020-10-06T14:49:07.485Z] - Options:
[2020-10-06T14:49:07.485Z] - Dependencies:
[2020-10-06T14:49:07.485Z] - Requirements:
[2020-10-06T14:49:07.485Z] - Package ID: 63da998e3642b50bee33f4449826b2d623661505
[2020-10-06T14:49:07.485Z]
[2020-10-06T14:49:07.485Z] ERROR: Missing prebuilt package for 'ext_TPC/11.8.128@prod/master'
[2020-10-06T14:49:07.485Z] Try to build it from sources with "--build ext_TPC"
[2020-10-06T14:49:07.485Z] Or read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package"
[2020-10-06T14:49:07.485Z]
script returned exit code 1
这是我运行来自BAT文件的命令:
"conan install Scripts\NotCppConanFile.py -s os=Windows -s os_build=Windows -s arch=%ARCH% -s arch_build=%ARCH% -s build_type=%CONFIG% -s compiler="Visual Studio" -s compiler.version=14 -s compiler.runtime=%COMPILER_RUNTIME%
@IF NOT %ERRORLEVEL% == 0 EXIT /b %ERRORLEVEL%"
The Conan upload command: "conan upload ext_TPC/%PACKAGE_VERSION% --all -r=extTPC-conan --confirm"
这就是上传的输出:
"[2020-10-05T23:37:35.088Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>conan export-pkg ./Scripts prod/master -f
[2020-10-05T23:37:36.064Z] Auto detecting your dev setup to initialize the default profile (c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\profiles\default)
[2020-10-05T23:37:36.335Z] Found Visual Studio 15
[2020-10-05T23:37:36.335Z] Default settings
[2020-10-05T23:37:36.335Z] os=Windows
[2020-10-05T23:37:36.335Z] os_build=Windows
[2020-10-05T23:37:36.335Z] arch=x86_64
[2020-10-05T23:37:36.335Z] arch_build=x86_64
[2020-10-05T23:37:36.335Z] compiler=Visual Studio
[2020-10-05T23:37:36.335Z] compiler.version=15
[2020-10-05T23:37:36.335Z] build_type=Release
[2020-10-05T23:37:36.335Z] *** You can change them in c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\profiles\default ***
[2020-10-05T23:37:36.335Z] *** Or override with -s compiler='other' -s ...s***
[2020-10-05T23:37:36.335Z]
[2020-10-05T23:37:36.335Z]
[2020-10-05T23:37:36.335Z] Exporting package recipe
[2020-10-05T23:37:36.335Z] ext_TPC/11.8.128@prod/master: A new conanfile.py version was exported
[2020-10-05T23:37:36.335Z] ext_TPC/11.8.128@prod/master: Folder: c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\data\ext_TPC.8.128\prod\master\export
[2020-10-05T23:37:36.336Z] ext_TPC/11.8.128@prod/master: Exported revision: b4153452b7268b78be94d8acdfd58e5a
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Forced build from source
[2020-10-05T23:37:36.697Z] Packaging to 6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Generating the package
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Package folder c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\data\ext_TPC.8.128\prod\master\packagecc50b139b9c3d27b3e9042d5f5372d327b3a9f7
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Calling package()
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.txt' file: 3rdPartyLicense.txt
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 9 '.dll' files
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.exe' file: CyberArk.TPC.exe
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.config' file: CyberArk.TPC.exe.config
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Package '6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7' created
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Created package revision d5a1027449330f6e032dadf415327f0c
[2020-10-05T23:37:36.697Z] [HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'url'. It is recommended to add it as attribute
[2020-10-05T23:37:36.697Z] [HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'license'. It is recommended to add it as attribute
[2020-10-05T23:37:36.697Z]
[2020-10-05T23:37:36.697Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>REM **** the package to artifactory...
[2020-10-05T23:37:36.697Z]
[2020-10-05T23:37:36.697Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>conan upload ext_TPC/11.8.128 --all -r=extTPC-conan --confirm
[2020-10-05T23:37:37.666Z] Uploading to remote 'extTPC-conan':
[2020-10-05T23:37:37.666Z]
Uploading ext_TPC/11.8.128@prod/master to remote 'extTPC-conan'
[2020-10-05T23:37:37.928Z]
Uploading conanfile.py
Uploading conanmanifest.txt
[2020-10-05T23:37:37.928Z]
[2020-10-05T23:37:37.928Z]
Uploaded conan recipe 'ext_TPC/11.8.128@prod/master' to 'extTPC-conan': https://ca-dev-artifactory/artifactory/api/conan/extTPC-conan-latest-local
[2020-10-05T23:37:37.928Z]
Uploading package 1/1: 6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7 to 'extTPC-conan'
[2020-10-05T23:37:37.928Z] Compressing package...
[2020-10-05T23:37:41.719Z] [==================================================]
[2020-10-05T23:37:41.719Z]
[2020-10-05T23:37:41.719Z]
[2020-10-05T23:37:42.292Z]
Uploading conan_package.tgz
[2020-10-05T23:37:42.292Z]
[2020-10-05T23:37:42.555Z]
Uploading conaninfo.txt
Uploading conanmanifest.txt
[2020-10-05T23:37:42.555Z]"
当我使用旧的构建服务器时,消耗正常。
我注意到当我从旧构建服务器和新构建服务器上传工件时包 ID 不同。
从网上的资料了解到,package id是一个hash,我无法控制。
所以我的问题是为什么柯南期待旧的哈希值,我该如何更改它?
您尝试在新服务器中安装的二进制文件正在请求此二进制文件:
[2020-10-06T14:49:07.485Z] - Settings: arch=x86_64, build_type=Release, compiler=Visual Studio, compiler.runtime=MD, compiler.version=14, os=Windows
所以您正在尝试使用 compiler.version=14
安装它
您可以检查创建的包,用于构建它的配置是:
[2020-10-05T23:37:36.335Z] Found Visual Studio 15
[2020-10-05T23:37:36.335Z] Default settings
[2020-10-05T23:37:36.335Z] os=Windows
[2020-10-05T23:37:36.335Z] os_build=Windows
[2020-10-05T23:37:36.335Z] arch=x86_64
[2020-10-05T23:37:36.335Z] arch_build=x86_64
[2020-10-05T23:37:36.335Z] compiler=Visual Studio
[2020-10-05T23:37:36.335Z] compiler.version=15
[2020-10-05T23:37:36.335Z] build_type=Release
即compiler.version=15
默认配置文件是 auto-detected 并使用系统中找到的最新 Visual Studio 编译器。对于生产用途,建议使用您自己的配置文件,而不是自动检测的配置文件。
确保您使用相同的配置来创建包并使用它。您可以根据需要创建和上传任意数量的配置,但是当您 install
它时,默认情况下它应该存在(可以使用 --build
从源请求构建它,但默认行为是找到一个匹配的二进制文件或失败)
我正在和 Conan 一起消费神器中的一个项目。
工件是在我的 Jenkins 管道中构建的,并已上传到工件库。
我有 2 个构建服务器,我想从旧服务器迁移到新服务器。
当我使用在新构建服务器中构建的工件时,出现以下错误:
[2020-10-06T14:49:07.485Z] Requirements
[2020-10-06T14:49:07.485Z] ext_TPC/11.8.128@prod/master from 'conan-extTPC' - Downloaded
[2020-10-06T14:49:07.485Z] ext_cli_plugins/11.800.30@prod/master from 'conan-CliPlugins' - Downloaded
[2020-10-06T14:49:07.485Z] ext_dotnet_plugins/11.800.44@prod/master from 'conan-DotNetPlugins' - Downloaded
[2020-10-06T14:49:07.485Z] Packages
[2020-10-06T14:49:07.485Z] ext_TPC/11.8.128@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Missing
[2020-10-06T14:49:07.485Z] ext_cli_plugins/11.800.30@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Download
[2020-10-06T14:49:07.485Z] ext_dotnet_plugins/11.800.44@prod/master:63da998e3642b50bee33f4449826b2d623661505 - Download
[2020-10-06T14:49:07.485Z]
[2020-10-06T14:49:07.485Z] Installing (downloading, building) binaries...
[2020-10-06T14:49:07.485Z]
[2020-10-06T14:49:07.485Z] ERROR: Missing binary: ext_TPC/11.8.128@prod/master:63da998e3642b50bee33f4449826b2d623661505
[2020-10-06T14:49:07.485Z] ext_TPC/11.8.128@prod/master: WARN: Can't find a 'ext_TPC/11.8.128@prod/master' package for the specified settings, options and dependencies:
[2020-10-06T14:49:07.485Z] - Settings: arch=x86_64, build_type=Release, compiler=Visual Studio, compiler.runtime=MD, compiler.version=14, os=Windows
[2020-10-06T14:49:07.485Z] - Options:
[2020-10-06T14:49:07.485Z] - Dependencies:
[2020-10-06T14:49:07.485Z] - Requirements:
[2020-10-06T14:49:07.485Z] - Package ID: 63da998e3642b50bee33f4449826b2d623661505
[2020-10-06T14:49:07.485Z]
[2020-10-06T14:49:07.485Z] ERROR: Missing prebuilt package for 'ext_TPC/11.8.128@prod/master'
[2020-10-06T14:49:07.485Z] Try to build it from sources with "--build ext_TPC"
[2020-10-06T14:49:07.485Z] Or read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-missing-prebuilt-package"
[2020-10-06T14:49:07.485Z]
script returned exit code 1
这是我运行来自BAT文件的命令:
"conan install Scripts\NotCppConanFile.py -s os=Windows -s os_build=Windows -s arch=%ARCH% -s arch_build=%ARCH% -s build_type=%CONFIG% -s compiler="Visual Studio" -s compiler.version=14 -s compiler.runtime=%COMPILER_RUNTIME%
@IF NOT %ERRORLEVEL% == 0 EXIT /b %ERRORLEVEL%"
The Conan upload command: "conan upload ext_TPC/%PACKAGE_VERSION% --all -r=extTPC-conan --confirm"
这就是上传的输出:
"[2020-10-05T23:37:35.088Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>conan export-pkg ./Scripts prod/master -f
[2020-10-05T23:37:36.064Z] Auto detecting your dev setup to initialize the default profile (c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\profiles\default)
[2020-10-05T23:37:36.335Z] Found Visual Studio 15
[2020-10-05T23:37:36.335Z] Default settings
[2020-10-05T23:37:36.335Z] os=Windows
[2020-10-05T23:37:36.335Z] os_build=Windows
[2020-10-05T23:37:36.335Z] arch=x86_64
[2020-10-05T23:37:36.335Z] arch_build=x86_64
[2020-10-05T23:37:36.335Z] compiler=Visual Studio
[2020-10-05T23:37:36.335Z] compiler.version=15
[2020-10-05T23:37:36.335Z] build_type=Release
[2020-10-05T23:37:36.335Z] *** You can change them in c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\profiles\default ***
[2020-10-05T23:37:36.335Z] *** Or override with -s compiler='other' -s ...s***
[2020-10-05T23:37:36.335Z]
[2020-10-05T23:37:36.335Z]
[2020-10-05T23:37:36.335Z] Exporting package recipe
[2020-10-05T23:37:36.335Z] ext_TPC/11.8.128@prod/master: A new conanfile.py version was exported
[2020-10-05T23:37:36.335Z] ext_TPC/11.8.128@prod/master: Folder: c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\data\ext_TPC.8.128\prod\master\export
[2020-10-05T23:37:36.336Z] ext_TPC/11.8.128@prod/master: Exported revision: b4153452b7268b78be94d8acdfd58e5a
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Forced build from source
[2020-10-05T23:37:36.697Z] Packaging to 6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Generating the package
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Package folder c:\Jenkins\workspace\aster_CPM-TPC-master-full_master\.conan\data\ext_TPC.8.128\prod\master\packagecc50b139b9c3d27b3e9042d5f5372d327b3a9f7
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Calling package()
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.txt' file: 3rdPartyLicense.txt
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 9 '.dll' files
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.exe' file: CyberArk.TPC.exe
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master package(): Packaged 1 '.config' file: CyberArk.TPC.exe.config
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Package '6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7' created
[2020-10-05T23:37:36.697Z] ext_TPC/11.8.128@prod/master: Created package revision d5a1027449330f6e032dadf415327f0c
[2020-10-05T23:37:36.697Z] [HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'url'. It is recommended to add it as attribute
[2020-10-05T23:37:36.697Z] [HOOK - attribute_checker.py] pre_export(): WARN: Conanfile doesn't have 'license'. It is recommended to add it as attribute
[2020-10-05T23:37:36.697Z]
[2020-10-05T23:37:36.697Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>REM **** the package to artifactory...
[2020-10-05T23:37:36.697Z]
[2020-10-05T23:37:36.697Z] c:\jenkins\workspace\aster_CPM-TPC-master-full_master>conan upload ext_TPC/11.8.128 --all -r=extTPC-conan --confirm
[2020-10-05T23:37:37.666Z] Uploading to remote 'extTPC-conan':
[2020-10-05T23:37:37.666Z]
Uploading ext_TPC/11.8.128@prod/master to remote 'extTPC-conan'
[2020-10-05T23:37:37.928Z]
Uploading conanfile.py
Uploading conanmanifest.txt
[2020-10-05T23:37:37.928Z]
[2020-10-05T23:37:37.928Z]
Uploaded conan recipe 'ext_TPC/11.8.128@prod/master' to 'extTPC-conan': https://ca-dev-artifactory/artifactory/api/conan/extTPC-conan-latest-local
[2020-10-05T23:37:37.928Z]
Uploading package 1/1: 6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7 to 'extTPC-conan'
[2020-10-05T23:37:37.928Z] Compressing package...
[2020-10-05T23:37:41.719Z] [==================================================]
[2020-10-05T23:37:41.719Z]
[2020-10-05T23:37:41.719Z]
[2020-10-05T23:37:42.292Z]
Uploading conan_package.tgz
[2020-10-05T23:37:42.292Z]
[2020-10-05T23:37:42.555Z]
Uploading conaninfo.txt
Uploading conanmanifest.txt
[2020-10-05T23:37:42.555Z]"
当我使用旧的构建服务器时,消耗正常。
我注意到当我从旧构建服务器和新构建服务器上传工件时包 ID 不同。
从网上的资料了解到,package id是一个hash,我无法控制。
所以我的问题是为什么柯南期待旧的哈希值,我该如何更改它?
您尝试在新服务器中安装的二进制文件正在请求此二进制文件:
[2020-10-06T14:49:07.485Z] - Settings: arch=x86_64, build_type=Release, compiler=Visual Studio, compiler.runtime=MD, compiler.version=14, os=Windows
所以您正在尝试使用 compiler.version=14
安装它您可以检查创建的包,用于构建它的配置是:
[2020-10-05T23:37:36.335Z] Found Visual Studio 15
[2020-10-05T23:37:36.335Z] Default settings
[2020-10-05T23:37:36.335Z] os=Windows
[2020-10-05T23:37:36.335Z] os_build=Windows
[2020-10-05T23:37:36.335Z] arch=x86_64
[2020-10-05T23:37:36.335Z] arch_build=x86_64
[2020-10-05T23:37:36.335Z] compiler=Visual Studio
[2020-10-05T23:37:36.335Z] compiler.version=15
[2020-10-05T23:37:36.335Z] build_type=Release
即compiler.version=15
默认配置文件是 auto-detected 并使用系统中找到的最新 Visual Studio 编译器。对于生产用途,建议使用您自己的配置文件,而不是自动检测的配置文件。
确保您使用相同的配置来创建包并使用它。您可以根据需要创建和上传任意数量的配置,但是当您 install
它时,默认情况下它应该存在(可以使用 --build
从源请求构建它,但默认行为是找到一个匹配的二进制文件或失败)