pin dora-rs to v1.0.1 instead of tracking main
Cloning main made the build non-reproducible and free to drift from the dora runtime that launches the node. DORA_GIT_TAG can still pin a tag explicitly, and an installed dora CLI continues to take precedence so the bindings match the runtime, now with a warning when that CLI predates the 1.0 this node targets.
This commit is contained in:
+17
-3
@@ -40,7 +40,15 @@ if(DORA_ROOT_DIR AND EXISTS "${DORA_ROOT_DIR}/Cargo.toml")
|
|||||||
set(dora_link_dirs ${DORA_ROOT_DIR}/target/debug)
|
set(dora_link_dirs ${DORA_ROOT_DIR}/target/debug)
|
||||||
else()
|
else()
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
set(DORA_GIT_TAG "main")
|
|
||||||
|
# This node targets dora 1.0+. Set DORA_GIT_TAG to pin a tag explicitly;
|
||||||
|
# left empty it follows the installed dora CLI so the bindings match the
|
||||||
|
# runtime, and falls back to the default below when no CLI is present.
|
||||||
|
set(DORA_GIT_TAG "" CACHE STRING "dora-rs git tag to build against (empty: follow the dora CLI)")
|
||||||
|
set(_dora_tag "${DORA_GIT_TAG}")
|
||||||
|
|
||||||
|
if(NOT _dora_tag)
|
||||||
|
set(_dora_tag "v1.0.1")
|
||||||
find_program(DORA_CLI dora)
|
find_program(DORA_CLI dora)
|
||||||
if(DORA_CLI)
|
if(DORA_CLI)
|
||||||
execute_process(
|
execute_process(
|
||||||
@@ -53,15 +61,21 @@ else()
|
|||||||
if(_dora_version_result EQUAL 0)
|
if(_dora_version_result EQUAL 0)
|
||||||
string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" _dora_version_match "${_dora_version_out}")
|
string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" _dora_version_match "${_dora_version_out}")
|
||||||
if(_dora_version_match)
|
if(_dora_version_match)
|
||||||
set(DORA_GIT_TAG "v${CMAKE_MATCH_1}")
|
set(_dora_tag "v${CMAKE_MATCH_1}")
|
||||||
|
if(CMAKE_MATCH_1 VERSION_LESS 1.0)
|
||||||
|
message(WARNING "dora CLI ${CMAKE_MATCH_1} is older than the 1.0 this node targets")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "dora-rs: building C++ bindings from ${_dora_tag}")
|
||||||
|
|
||||||
ExternalProject_Add(Dora
|
ExternalProject_Add(Dora
|
||||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/dora
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/dora
|
||||||
GIT_REPOSITORY https://github.com/dora-rs/dora.git
|
GIT_REPOSITORY https://github.com/dora-rs/dora.git
|
||||||
GIT_TAG ${DORA_GIT_TAG}
|
GIT_TAG ${_dora_tag}
|
||||||
BUILD_IN_SOURCE True
|
BUILD_IN_SOURCE True
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
BUILD_COMMAND
|
BUILD_COMMAND
|
||||||
|
|||||||
Reference in New Issue
Block a user