From 4d9e67e84f49934ca4ed34bb2ed06645f2532a58 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Fri, 15 Oct 2021 15:52:55 +0800 Subject: [PATCH] Feature/sangshuduo/td 10469 blm3 (#8269) * [TD-10469]: use blm to replace httpd * add blm3 as submodule and modify the install script. * make http disabled by default. * use external project for go build. * make install and systemctl works. * change blm3 to official repo. * fix alert build missing sqlx package. * update README regarding golang env setup. * remove blm3. * modify script to support blm3 * udpate submodule in CI * update jenkinsfile * update blm3 with statsd port changed and config file name changed. * still use tdengine's httpd for lite version. * include blm.toml in released packages. * merge with develop branch. * update grafana plugin to support telegraf. * fix python test framework * fix blm3.toml name * comment off restful test for blm3 CI. * fix blm.toml name * comment off http related case for blm3. * fix cmake define.inc for windows build * update grafanaplugin * update blm3 * update grafana. * update grafana plugin to support statsd. * update blm3 to support lower version go. * update grafanaplugin and blm3 bugfix. * update grafana plugin, dashboard name changed. update blm3 for cinterface error code. * disable blm3 in arm32 * support blm3 --version Co-authored-by: liuyq-617 --- src/plugins/CMakeLists.txt | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 3f7157691d..8cb98f78ec 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -31,7 +31,24 @@ IF (TD_BUILD_HTTP) ELSE () MESSAGE("") MESSAGE("${Green} use blm3 as httpd ${ColourReset}") - MESSAGE("") + EXECUTE_PROCESS( + COMMAND cd blm3 + ) + EXECUTE_PROCESS( + COMMAND git rev-parse --short HEAD + RESULT_VARIABLE commit_sha1 + OUTPUT_VARIABLE blm3_commit_sha1 + ) + IF ("${blm3_commit_sha1}" STREQUAL "") + SET(blm3_commit_sha1 "unknown") + ELSE () + STRING(SUBSTRING "${blm3_commit_sha1}" 0 7 blm3_commit_sha1) + STRING(STRIP "${blm3_commit_sha1}" blm3_commit_sha1) + ENDIF () + MESSAGE("${Green} blm3 commit: ${blm3_commit_sha1} ${ColourReset}") + EXECUTE_PROCESS( + COMMAND cd .. + ) include(ExternalProject) ExternalProject_Add(blm3 PREFIX "blm3" @@ -40,7 +57,7 @@ ELSE () DEPENDS taos BUILD_IN_SOURCE 1 CONFIGURE_COMMAND cmake -E echo "blm3 no need cmake to config" - BUILD_COMMAND CGO_CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}/../inc CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/build/lib go build + BUILD_COMMAND CGO_CFLAGS=-I${CMAKE_CURRENT_SOURCE_DIR}/../inc CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/build/lib go build -ldflags "-s -w -X github.com/taosdata/blm3/version.CommitID=${blm3_commit_sha1}" INSTALL_COMMAND cmake -E copy blm3 ${CMAKE_BINARY_DIR}/build/bin COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test/cfg/ COMMAND cmake -E copy ./example/config/blm.toml ${CMAKE_BINARY_DIR}/test/cfg/ ) ENDIF () -- GitLab