Tikv can`t compile by cargo vendor

上不了外网,就想办法用 cargo vendor 下了一份vendor。期间解决了 crossbeam 和encoding_rs的版本冲突问题。
现在用Dockerfile 编译,报错。
对Dockerfie的修改:


在79行增加了
ADD vendor vendor
然后把 cargo vendor 生成的依赖放到了 etc/cargo.config.dist里面了

开始编译:
docker build .
报错:

    For compatibility with older versions of CMake, try_compile is not honoring
    caller config-specific compiler flags (e.g.  CMAKE_C_FLAGS_DEBUG) in the
    test project.
  Call Stack (most recent call first):
    /usr/share/cmake3/Modules/CMakeTestCXXCompiler.cmake:67 (CMAKE_DETERMINE_COMPILER_ABI)
    CMakeLists.txt:2 (project)
  This warning is for project developers.  Use -Wno-dev to suppress it.

     Called from: [3]   /usr/share/cmake3/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake3/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /tikv/vendor/libtitan_sys/titan/CMakeLists.txt
  CMake Warning (dev) at /usr/share/cmake3/Modules/CMakeDetermineCompilerABI.cmake:48 (try_compile):
    Policy CMP0056 is not set: Honor link flags in try_compile() source-file
    signature.  Run "cmake --help-policy CMP0056" for policy details.  Use the
    cmake_policy command to set the policy and suppress this warning.

    For compatibility with older versions of CMake, try_compile is not honoring
    caller link flags (e.g.  CMAKE_EXE_LINKER_FLAGS) in the test project.
  Call Stack (most recent call first):
    /usr/share/cmake3/Modules/CMakeTestCXXCompiler.cmake:67 (CMAKE_DETERMINE_COMPILER_ABI)
    CMakeLists.txt:2 (project)
  This warning is for project developers.  Use -Wno-dev to suppress it.

     Called from: [3]   /usr/share/cmake3/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake3/Modules/CMakeTestCXXCompiler.cmake
                  [1]   /tikv/vendor/libtitan_sys/titan/CMakeLists.txt
  CMake Error at cmake/rocksdb_flags.cmake:14 (find_package):
    By not providing "Findsnappy.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "snappy", but
    CMake did not find one.

    Could not find a package configuration file provided by "snappy" with any
    of the following names:

      snappyConfig.cmake
      snappy-config.cmake

    Add the installation prefix of "snappy" to CMAKE_PREFIX_PATH or set
    "snappy_DIR" to a directory containing one of the above files.  If "snappy"
    provides a separate development package or SDK, be sure it has been
    installed.
  Call Stack (most recent call first):
    CMakeLists.txt:31 (include)


     Called from: [2]   /tikv/vendor/libtitan_sys/titan/cmake/rocksdb_flags.cmake
                  [1]   /tikv/vendor/libtitan_sys/titan/CMakeLists.txt
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /tikv/vendor/cmake/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

然后尝试在79行增加
yum install -y snappy snappy-devel
再次编译,依然报上面的错。

请大神帮忙看看!谢谢

Duplicate with the topic in asktug.com.

There is no correct answer on asktug。

We have not tested with cargo vendor mode, contributions are welcome.

Maybe you can building it in container env with this file.

1 Like