This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 7aeef628bae branch-4.0: [chore](build) Add feature list to version
info #56604 (#56970)
7aeef628bae is described below
commit 7aeef628baee8ed7bb3977334b71e804487788cb
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Oct 16 09:56:05 2025 +0800
branch-4.0: [chore](build) Add feature list to version info #56604 (#56970)
Cherry-picked from #56604
Co-authored-by: Gavin Chou <[email protected]>
---
be/src/common/version_internal.cpp | 3 +++
be/src/common/version_internal.h | 2 ++
be/src/util/debug_util.cpp | 4 ++++
build.sh | 11 +++++++++++
cloud/src/main.cpp | 6 ++++--
fe/fe-core/src/main/java/org/apache/doris/DorisFE.java | 5 +++++
.../doris/httpv2/controller/HardwareInfoController.java | 1 +
gensrc/script/gen_build_version.sh | 5 +++++
8 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/be/src/common/version_internal.cpp
b/be/src/common/version_internal.cpp
index 55402fab209..cba6f7332fb 100644
--- a/be/src/common/version_internal.cpp
+++ b/be/src/common/version_internal.cpp
@@ -56,6 +56,9 @@ const char* doris_build_time() {
const char* doris_build_info() {
return DORIS_BUILD_INFO;
}
+const std::string doris_feature_list() {
+ return std::string(DORIS_FEATURE_LIST);
+}
} // namespace version
diff --git a/be/src/common/version_internal.h b/be/src/common/version_internal.h
index f4deaa15aff..6c0ead332bb 100644
--- a/be/src/common/version_internal.h
+++ b/be/src/common/version_internal.h
@@ -16,6 +16,7 @@
// under the License.
#pragma once
+#include <string>
namespace doris {
namespace version {
@@ -32,6 +33,7 @@ extern const char* doris_build_hash();
extern const char* doris_build_short_hash();
extern const char* doris_build_time();
extern const char* doris_build_info();
+extern const std::string doris_feature_list();
} // namespace version
diff --git a/be/src/util/debug_util.cpp b/be/src/util/debug_util.cpp
index 0856b10c051..b98dd76967b 100644
--- a/be/src/util/debug_util.cpp
+++ b/be/src/util/debug_util.cpp
@@ -22,6 +22,7 @@
#include <gen_cpp/PlanNodes_types.h>
#include <stdint.h>
+#include <cstring>
#include <iomanip>
#include <map>
#include <sstream> // IWYU pragma: keep
@@ -46,6 +47,7 @@ std::string print_plan_node_type(const TPlanNodeType::type&
type) {
std::string get_build_version(bool compact) {
std::stringstream ss;
+ // clang-format off
ss << version::doris_build_version()
#if defined(__x86_64__) || defined(_M_X64)
#ifdef __AVX2__
@@ -74,7 +76,9 @@ std::string get_build_version(bool compact) {
<< " with BLSAN"
#endif
#endif
+ << (version::doris_feature_list().empty() ? "" : " features: " +
version::doris_feature_list())
<< " (build " << version::doris_build_hash() << ")";
+ // clang-format on
if (!compact) {
ss << std::endl
diff --git a/build.sh b/build.sh
index 44ff05442c6..048fa48484d 100755
--- a/build.sh
+++ b/build.sh
@@ -508,6 +508,17 @@ echo "Get params:
WITH_TDE_DIR -- ${WITH_TDE_DIR}
"
+FEAT=()
+FEAT+=($([[ -n "${WITH_TDE_DIR}" ]] && echo "+TDE" || echo "-TDE"))
+FEAT+=($([[ "${ENABLE_HDFS_STORAGE_VAULT:-OFF}" == "ON" ]] && echo
"+HDFS_STORAGE_VAULT" || echo "-HDFS_STORAGE_VAULT"))
+FEAT+=($([[ ${BUILD_UI} -eq 1 ]] && echo "+UI" || echo "-UI"))
+FEAT+=($([[ "${BUILD_AZURE}" == "ON" ]] && echo
"+AZURE_BLOB,+AZURE_STORAGE_VAULT" || echo "-AZURE_BLOB,-AZURE_STORAGE_VAULT"))
+FEAT+=($([[ ${BUILD_HIVE_UDF} -eq 1 ]] && echo "+HIVE_UDF" || echo
"-HIVE_UDF"))
+FEAT+=($([[ ${BUILD_BE_JAVA_EXTENSIONS} -eq 1 ]] && echo "+BE_JAVA_EXTENSIONS"
|| echo "-BE_JAVA_EXTENSIONS"))
+
+export DORIS_FEATURE_LIST=$(IFS=','; echo "${FEAT[*]}")
+echo "Feature List: ${DORIS_FEATURE_LIST}"
+
# Clean and build generated code
if [[ "${CLEAN}" -eq 1 ]]; then
clean_gensrc
diff --git a/cloud/src/main.cpp b/cloud/src/main.cpp
index 92ea5f72c50..861956e802d 100644
--- a/cloud/src/main.cpp
+++ b/cloud/src/main.cpp
@@ -136,15 +136,17 @@ static void help() {
static std::string build_info() {
std::stringstream ss;
+// clang-format off
#if defined(NDEBUG)
ss << "version:{" DORIS_CLOUD_BUILD_VERSION "-release}"
#else
ss << "version:{" DORIS_CLOUD_BUILD_VERSION "-debug}"
#endif
- << " code_version:{commit=" DORIS_CLOUD_BUILD_HASH " time="
DORIS_CLOUD_BUILD_VERSION_TIME
- "}"
+ << " code_version:{commit=" DORIS_CLOUD_BUILD_HASH " time="
DORIS_CLOUD_BUILD_VERSION_TIME "}"
+ << " features:{" DORIS_CLOUD_FEATURE_LIST "}"
<< " build_info:{initiator=" DORIS_CLOUD_BUILD_INITIATOR " build_at="
DORIS_CLOUD_BUILD_TIME
" build_on=" DORIS_CLOUD_BUILD_OS_VERSION "}\n";
+ // clang-format on
return ss.str();
}
diff --git a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
index 1c15c6321dc..787989be8c9 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
@@ -432,6 +432,11 @@ public class DorisFE {
LOG.info("Build hash: {}", Version.DORIS_BUILD_HASH);
LOG.info("Java compile version: {}",
Version.DORIS_JAVA_COMPILE_VERSION);
+ if (!Version.DORIS_FEATURE_LIST.isEmpty()) {
+ LogUtils.stdout("Features: " + Version.DORIS_FEATURE_LIST);
+ LOG.info("Features: {}", Version.DORIS_FEATURE_LIST);
+ }
+
if (Config.isCloudMode()) {
LogUtils.stdout("Run FE in the cloud mode, cloud_unique_id: " +
Config.cloud_unique_id
+ ", meta_service_endpoint: " +
Config.meta_service_endpoint);
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/HardwareInfoController.java
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/HardwareInfoController.java
index d751f72f719..203aa039e52 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/HardwareInfoController.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/HardwareInfoController.java
@@ -69,6 +69,7 @@ public class HardwareInfoController {
map.put("Git", Version.DORIS_BUILD_HASH);
map.put("BuildInfo", Version.DORIS_BUILD_INFO);
map.put("BuildTime", Version.DORIS_BUILD_TIME);
+ map.put("Features", Version.DORIS_FEATURE_LIST);
content.put("VersionInfo", map);
}
diff --git a/gensrc/script/gen_build_version.sh
b/gensrc/script/gen_build_version.sh
index 6366835ed81..b4ca87e0df0 100755
--- a/gensrc/script/gen_build_version.sh
+++ b/gensrc/script/gen_build_version.sh
@@ -47,6 +47,7 @@ if [[ -n "${build_version_rc_version}" ]]; then
build_version+="-${build_version_rc_version}"
fi
+doris_feature_list="${DORIS_FEATURE_LIST-""}"
# This version is used to check FeMetaVersion is not changed during release
build_fe_meta_version=0
unset LANG
@@ -139,6 +140,7 @@ public class Version {
public static final int DORIS_BUILD_VERSION_PATCH = ${build_version_patch};
public static final int DORIS_BUILD_VERSION_HOTFIX = ${build_version_hotfix};
public static final String DORIS_BUILD_VERSION_RC_VERSION =
"${build_version_rc_version}";
+ public static final String DORIS_FEATURE_LIST = "${doris_feature_list}";
public static final String DORIS_BUILD_VERSION = "${build_version}";
public static final String DORIS_BUILD_HASH = "${build_hash}";
@@ -154,6 +156,7 @@ public class Version {
System.out.println("doris_build_version_minor: " +
DORIS_BUILD_VERSION_MINOR);
System.out.println("doris_build_version_patch: " +
DORIS_BUILD_VERSION_PATCH);
System.out.println("doris_build_version_rc_version: " +
DORIS_BUILD_VERSION_RC_VERSION);
+ System.out.println("doris_feature_list: " + DORIS_FEATURE_LIST);
System.out.println("doris_build_version: " + DORIS_BUILD_VERSION);
System.out.println("doris_build_hash: " + DORIS_BUILD_HASH);
@@ -207,6 +210,7 @@ namespace doris {
#define DORIS_BUILD_SHORT_HASH "${build_short_hash}"
#define DORIS_BUILD_TIME "${build_time}"
#define DORIS_BUILD_INFO "${build_info}"
+#define DORIS_FEATURE_LIST "${doris_feature_list}"
} // namespace doris
@@ -268,6 +272,7 @@ namespace doris::cloud {
#define DORIS_CLOUD_BUILD_VERSION_PATCH ${build_version_patch}
#define DORIS_CLOUD_BUILD_VERSION_HOTFIX ${build_version_hotfix}
#define DORIS_CLOUD_BUILD_VERSION_RC_VERSION R"(${build_version_rc_version})"
+#define DORIS_CLOUD_FEATURE_LIST R"(${doris_feature_list})"
#define DORIS_CLOUD_BUILD_VERSION R"(${build_version})"
#define DORIS_CLOUD_BUILD_HASH R"(${build_hash})"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]