(SA002)在运行cmake .
时发生的错误: "Operation timed out after 30000 milliseconds ..."
在使用cmake .
编译vsag
时出现错误:
[1448 bytes data]
[1448 bytes data]
[1448 bytes data]
Operation timed out after 30000 milliseconds with 37498381 out of 100717067
bytes receivedClosing connection 0
--- LOG END ---
gmake[2]: *** [CMakeFiles/roaringbitmap-populate.dir/build.make/roaringbitmap-populate-prefix/src/roaringbitmap-populate-stamp/roaringbitmap-populate-download] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/roaringbitmap-populate.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2CMake Error at /usr/share/cmake/Modules/FetchContent.cmake:1622 (message):
Build step for roaringbitmap failed: 2
Call Stack (most recent call first):
/usr/share/cmake/Modules/FetchContent.cmake:1762:EVAL:2 (__FetchContent_directPopulate)
/usr/share/cmake/Modules/FetchContent.cmake:1762 (cmake_language)
_deps/vsag-src/extern/roaringbitmap/roaringbitmap.cmake:28 (FetchContent_Populate)
_deps/vsag-src/CMakeLists.txt:183 (include)
大致意思是下载操作超时了,将这一段扔给ai会给你说将超时阈值(错误信息中的30000 milliseconds ,下文提到的timeout
)调高即可。
但是需要注意的是,timeout
不仅可以在主cmake文件中可以指定,也可以在下载单个模块时指定,这样我们在主cmake文件中设置的timeout
就被覆盖了。如代码所示:
FetchContent_Declare(
vsag
URL http://vsagcache.oss-rg-china-mainland.aliyuncs.com/vsag/v0.11.6.tar.gz
URL_HASH MD5=e79a42205e67afda73d6515e07d83f68
DOWNLOAD_NO_PROGRESS 0
INACTIVITY_TIMEOUT 5
TIMEOUT 30
)
(跳转到提到的_deps/vsag-src/extern/roaringbitmap/roaringbitmap.cmake:28
就可以找到了、这段代码了)
因此将TIMOUT 30
改为TIMEOUT 300
(300秒)即可。