eosnetworkfoundation/eos-system-contracts

Version mismatch between CDT 4.0 and contracts version 3.1.1.

Closed this issue · 2 comments

A new 4.0 eos-system-contracts should be released and the CDT max version bumped to 4.0.

arhag commented

This should be done, but I think the version of contracts will be 3.2.0 instead. And it will depend on the new yet-to-be-released 4.1 version of CDT.

eos-system-contracts builds fine with CDT 4.0. I was able to build and test the contracts using CDT 4.0.1-rc1. Using --trace-expand it shows that it picked up the correct CDT and found the correct version.

/usr/local/lib/cmake/cdt/cdt-config.cmake(1):  if(CDT_ROOT STREQUAL  OR NOT CDT_ROOT )
/usr/local/lib/cmake/cdt/cdt-config.cmake(2):  set(CDT_ROOT /local/eosnetworkfoundation/repos/antelope/cdt/build )
/usr/local/lib/cmake/cdt/cdt-config.cmake(5):  set(CDT_VERSION 4.0.1-rc1 )
/usr/local/lib/cmake/cdt/cdt-config.cmake(7):  list(APPEND CMAKE_MODULE_PATH /local/eosnetworkfoundation/repos/antelope/cdt/build/lib/cmake/cdt )
/usr/local/lib/cmake/cdt/cdt-config.cmake(9):  include(CDTMacros )
/local/eosnetworkfoundation/repos/antelope/cdt/build/lib/cmake/cdt/CDTMacros.cmake(1):  macro(add_contract CONTRACT_NAME TARGET )
/local/eosnetworkfoundation/repos/antelope/cdt/build/lib/cmake/cdt/CDTMacros.cmake(12):  macro(target_ricardian_directory TARGET DIR )
/local/eosnetworkfoundation/repos/antelope/cdt/build/lib/cmake/cdt/CDTMacros.cmake(21):  macro(add_native_library TARGET )
/local/eosnetworkfoundation/repos/antelope/cdt/build/lib/cmake/cdt/CDTMacros.cmake(26):  macro(add_native_executable TARGET )
/usr/local/lib/cmake/cdt/cdt-config.cmake(11):  function(EXTRACT_MAJOR_MINOR_FROM_VERSION version success major minor )
/usr/local/lib/cmake/cdt/cdt-config.cmake(29):  function(CDT_CHECK_VERSION output version hard_min soft_max hard_max )
/local/eosnetworkfoundation/repos/ENF/eos-system-contracts/CMakeLists.txt(22):  option(SYSTEM_CONFIGURABLE_WASM_LIMITS Enables use of the host functions activated by the CONFIGURABLE_WASM_LIMITS protocol feature ON )
/local/eosnetworkfoundation/repos/ENF/eos-system-contracts/CMakeLists.txt(25):  option(SYSTEM_BLOCKCHAIN_PARAMETERS Enables use of the host functions activated by the BLOCKCHAIN_PARAMETERS protocol feature ON )
/local/eosnetworkfoundation/repos/ENF/eos-system-contracts/CMakeLists.txt(28):  option(SYSTEM_ENABLE_LEAP_VERSION_CHECK Enables a configure-time check that the version of Leap's tester library is compatible with this project's unit tests ON )
/local/eosnetworkfoundation/repos/ENF/eos-system-contracts/CMakeLists.txt(31):  option(SYSTEM_ENABLE_CDT_VERSION_CHECK Enables a configure-time check that the version of CDT is compatible with this project's contracts ON )

Checking both output from cmake and make I do not see an error that the version of CDT is bad. This is odd considering the following code.

set(CDT_VERSION_MIN "3.0")
set(CDT_VERSION_SOFT_MAX "3.0")
# set(CDT_VERSION_HARD_MAX "")
# Check the version of CDT
if(SYSTEM_ENABLE_CDT_VERSION_CHECK)
set(VERSION_MATCH_ERROR_MSG "")
CDT_CHECK_VERSION(VERSION_OUTPUT "${CDT_VERSION}" "${CDT_VERSION_MIN}" "${CDT_VERSION_SOFT_MAX}"
"${CDT_VERSION_HARD_MAX}" VERSION_MATCH_ERROR_MSG)
if(VERSION_OUTPUT STREQUAL "MATCH")
message(STATUS "Using CDT version ${CDT_VERSION}")
elseif(VERSION_OUTPUT STREQUAL "WARN")
message(
WARNING
"Using CDT version ${CDT_VERSION} even though it exceeds the maximum supported version of ${CDT_VERSION_SOFT_MAX}; continuing with configuration, however build may fail.\nIt is recommended to use CDT version ${CDT_VERSION_SOFT_MAX}.x"
)
else() # INVALID OR MISMATCH
message(
FATAL_ERROR
"Found CDT version ${CDT_VERSION} but it does not satisfy version requirements: ${VERSION_MATCH_ERROR_MSG}\nPlease use CDT version ${CDT_VERSION_SOFT_MAX}.x"
)
endif()
endif()