为什么我的 Conan 包似乎损坏了?
Why do my Conan packages appear to be getting corrupted?
背景
我有一个项目正在使用 boost/1.71.0@conan/stable
,并且给我一个编译时错误。我决定尝试 boost/1.72.0
只是因为它可能会修复它。当我这样做时,我得到了这个:
1> [CMake] ERROR: boost/1.72.0: Error in source() method, line 151
1> [CMake] tools.get(**self.conan_data["sources"][self.version])
1> [CMake] AttributeError: 'NoneType' object has no attribute 'token'
1> [CMake] CMake Error at out/build/x64-Debug/conan.cmake:402 (message):
1> [CMake] Conan install failed='1'
1> [CMake] Call Stack (most recent call first):
1> [CMake] out/build/x64-Debug/conan.cmake:497 (conan_cmake_install)
1> [CMake] CMakeLists.txt:41 (conan_cmake_run)
它引用了我 CMakeLists.txt 中的 conan_cmake_run()
调用:
if(CONAN_EXPORTED) # in conan local cache
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
else() # in user space
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(CONANFILE conanfile.txt
BASIC_SETUP
BUILD missing)
endif()
和 boost 中的第 151 行 conanfile.py:
if tools.os_info.is_windows:
sha256 = "85a94ac71c28e59cf97a96714e4c58a18550c227ac8b0388c260d6c717e47a69"
extension = ".zip"
else:
sha256 = "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee"
extension = ".tar.bz2"
zip_name = "%s%s" % (self.folder_name, extension)
url = "https://dl.bintray.com/boostorg/release/%s/source/%s" % (self.version, zip_name)
151: tools.get(url, sha256=sha256)
...
我的conanfile.txt:
[requires]
boost/1.72.0
...some of my own packages...
[generators]
cmake
[options]
boost:shared=True
我试过的
- 正在将柯南从 1.21 升级到 1.23。这给了我一个不同的错误("Forbidden" 某事或其他),所以在尝试摆脱它一段时间后,我恢复了。我还在此处的某处更新了 Pip。
- 使用
conan remove boost/*
删除增强包
- 其他增强版本...我已尝试
boost/1.71.0
、boost/1.72.0
和 boost/1.71.0@conan/stable
。后者最初有效,在删除所有增强包后不再有效。与此相关,当我第二次生成 CMake 缓存时(即 boost 包已经在本地缓存中),我收到这些警告:
1> [CMake] boost/1.72.0: Configuring sources in C:\.conan3b85
1> [CMake] boost/1.72.0: WARN: Package is corrupted, removing folder: C:\.conan4baa
1> [CMake] boost/1.72.0: WARN: Build folder is dirty, removing it: C:\.conanc708
1> [CMake] boost/1.72.0: WARN: Trying to remove corrupted source folder
1> [CMake] boost/1.72.0: WARN: This can take a while for big packages
1> [CMake] ERROR: boost/1.72.0: Error in source() method, line 151]
... snip: the additional errors already copied at the beginning of the post ...
所以,我怀疑即使是以前工作的 boost/1.71.0@conan/stable
在重新拉动后也会被破坏。
注意:当指示 Visual Studio 生成 CMake 缓存时会发生这种情况。
包配方中使用的 URL:https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2,无效。下载 URL 似乎有问题,您可以尝试在浏览器中下载。所以与柯南无关,不是食谱的问题。
背景
我有一个项目正在使用 boost/1.71.0@conan/stable
,并且给我一个编译时错误。我决定尝试 boost/1.72.0
只是因为它可能会修复它。当我这样做时,我得到了这个:
1> [CMake] ERROR: boost/1.72.0: Error in source() method, line 151
1> [CMake] tools.get(**self.conan_data["sources"][self.version])
1> [CMake] AttributeError: 'NoneType' object has no attribute 'token'
1> [CMake] CMake Error at out/build/x64-Debug/conan.cmake:402 (message):
1> [CMake] Conan install failed='1'
1> [CMake] Call Stack (most recent call first):
1> [CMake] out/build/x64-Debug/conan.cmake:497 (conan_cmake_install)
1> [CMake] CMakeLists.txt:41 (conan_cmake_run)
它引用了我 CMakeLists.txt 中的 conan_cmake_run()
调用:
if(CONAN_EXPORTED) # in conan local cache
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
else() # in user space
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(CONANFILE conanfile.txt
BASIC_SETUP
BUILD missing)
endif()
和 boost 中的第 151 行 conanfile.py:
if tools.os_info.is_windows:
sha256 = "85a94ac71c28e59cf97a96714e4c58a18550c227ac8b0388c260d6c717e47a69"
extension = ".zip"
else:
sha256 = "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee"
extension = ".tar.bz2"
zip_name = "%s%s" % (self.folder_name, extension)
url = "https://dl.bintray.com/boostorg/release/%s/source/%s" % (self.version, zip_name)
151: tools.get(url, sha256=sha256)
...
我的conanfile.txt:
[requires]
boost/1.72.0
...some of my own packages...
[generators]
cmake
[options]
boost:shared=True
我试过的
- 正在将柯南从 1.21 升级到 1.23。这给了我一个不同的错误("Forbidden" 某事或其他),所以在尝试摆脱它一段时间后,我恢复了。我还在此处的某处更新了 Pip。
- 使用
conan remove boost/*
删除增强包
- 其他增强版本...我已尝试
boost/1.71.0
、boost/1.72.0
和boost/1.71.0@conan/stable
。后者最初有效,在删除所有增强包后不再有效。与此相关,当我第二次生成 CMake 缓存时(即 boost 包已经在本地缓存中),我收到这些警告:
1> [CMake] boost/1.72.0: Configuring sources in C:\.conan3b85
1> [CMake] boost/1.72.0: WARN: Package is corrupted, removing folder: C:\.conan4baa
1> [CMake] boost/1.72.0: WARN: Build folder is dirty, removing it: C:\.conanc708
1> [CMake] boost/1.72.0: WARN: Trying to remove corrupted source folder
1> [CMake] boost/1.72.0: WARN: This can take a while for big packages
1> [CMake] ERROR: boost/1.72.0: Error in source() method, line 151]
... snip: the additional errors already copied at the beginning of the post ...
所以,我怀疑即使是以前工作的 boost/1.71.0@conan/stable
在重新拉动后也会被破坏。
注意:当指示 Visual Studio 生成 CMake 缓存时会发生这种情况。
包配方中使用的 URL:https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2,无效。下载 URL 似乎有问题,您可以尝试在浏览器中下载。所以与柯南无关,不是食谱的问题。