This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new eb3be18063e [opt](build) use mvn to compile thrift for fe (#61486)
eb3be18063e is described below
commit eb3be18063e78beda806d87f1aad11e84808c263
Author: morrySnow <[email protected]>
AuthorDate: Tue Mar 24 10:08:06 2026 +0800
[opt](build) use mvn to compile thrift for fe (#61486)
---
fe/fe-thrift/pom.xml | 38 +++++++++++++++++++++++++++++++++++++-
fe/fe-type/pom.xml | 2 +-
generated-source.sh | 2 --
gensrc/thrift/Makefile | 9 ---------
regression-test/framework/pom.xml | 34 ++++++++++++++++++++++++++++++++++
run-regression-test.sh | 11 +----------
6 files changed, 73 insertions(+), 23 deletions(-)
diff --git a/fe/fe-thrift/pom.xml b/fe/fe-thrift/pom.xml
index 88bf6a40415..c94bb94127c 100644
--- a/fe/fe-thrift/pom.xml
+++ b/fe/fe-thrift/pom.xml
@@ -26,6 +26,23 @@ under the License.
<artifactId>fe</artifactId>
<relativePath>../pom.xml</relativePath>
</parent>
+ <properties>
+
<doris.thrift.executable>${project.parent.basedir}/../thirdparty/installed/bin/thrift</doris.thrift.executable>
+
<doris.thrift.source>${project.parent.basedir}/../gensrc/thrift</doris.thrift.source>
+ </properties>
+ <profiles>
+ <profile>
+ <id>thrift-executable-override</id>
+ <activation>
+ <property>
+ <name>env.DORIS_THIRDPARTY</name>
+ </property>
+ </activation>
+ <properties>
+
<doris.thrift.executable>${env.DORIS_THIRDPARTY}/installed/bin/thrift</doris.thrift.executable>
+ </properties>
+ </profile>
+ </profiles>
<artifactId>fe-thrift</artifactId>
<packaging>jar</packaging>
<name>Doris FE Generated Thrift RPC</name>
@@ -40,7 +57,7 @@ under the License.
</dependencies>
<build>
- <finalName>doris-fe-catalog</finalName>
+ <finalName>doris-fe-thrift</finalName>
<directory>${project.basedir}/target/</directory>
<plugins>
<!-- Build source jar -->
@@ -59,6 +76,25 @@ under the License.
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.thrift</groupId>
+ <artifactId>thrift-maven-plugin</artifactId>
+ <version>0.10.0</version>
+ <configuration>
+ <generator>java:fullcamel</generator>
+
<thriftExecutable>${doris.thrift.executable}</thriftExecutable>
+ <thriftSourceRoot>${doris.thrift.source}</thriftSourceRoot>
+ </configuration>
+ <executions>
+ <execution>
+ <id>thrift-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/fe/fe-type/pom.xml b/fe/fe-type/pom.xml
index b562f853637..a4ad19e2a3e 100644
--- a/fe/fe-type/pom.xml
+++ b/fe/fe-type/pom.xml
@@ -63,7 +63,7 @@ under the License.
</dependencies>
<build>
- <finalName>doris-fe-catalog</finalName>
+ <finalName>doris-fe-type</finalName>
<directory>${project.basedir}/target/</directory>
<plugins>
<!-- Build source jar -->
diff --git a/generated-source.sh b/generated-source.sh
index 8fd3597c6ee..0275e2b2813 100755
--- a/generated-source.sh
+++ b/generated-source.sh
@@ -45,8 +45,6 @@ rm -rf
"${DORIS_HOME}/fe/fe-thrift/src/main/java/org/apache/doris/thrift" "${DOR
rm -rf "${DORIS_HOME}/fe/fe-common/src/main/java/org/apache/doris/thrift"
"${DORIS_HOME}/fe/fe-common/src/main/java/org/apache/parquet"
rm -rf "${DORIS_HOME}/fe/fe-core/src/main/java/org/apache/doris/thrift"
"${DORIS_HOME}/fe/fe-core/src/main/java/org/apache/parquet"
-cp -r "build/gen_java/org/apache/doris/thrift"
"${DORIS_HOME}/fe/fe-thrift/src/main/java/org/apache/doris"
-cp -r "build/gen_java/org/apache/parquet"
"${DORIS_HOME}/fe/fe-thrift/src/main/java/org/apache/"
cd "${DORIS_HOME}/"
echo "Done"
exit 0
diff --git a/gensrc/thrift/Makefile b/gensrc/thrift/Makefile
index 689f4acb6d3..f6a196390ee 100644
--- a/gensrc/thrift/Makefile
+++ b/gensrc/thrift/Makefile
@@ -29,19 +29,10 @@ GEN_OBJECTS = $(patsubst ${BUILD_DIR}/thrift/%.thrift,
${BUILD_DIR}/gen_cpp/%_ty
all: ${GEN_OBJECTS} ${OBJECTS}
.PHONY: all
-$(shell mkdir -p ${BUILD_DIR}/gen_java)
-
THRIFT_CPP_ARGS = -I ${CURDIR} -I ${BUILD_DIR}/thrift/ --gen
cpp:moveable_types,no_skeleton -out ${BUILD_DIR}/gen_cpp --allow-64bit-consts
-strict
-THRIFT_JAVA_ARGS = -I ${CURDIR} -I ${BUILD_DIR}/thrift/ --gen java:fullcamel
-out ${BUILD_DIR}/gen_java --allow-64bit-consts -strict
${BUILD_DIR}/gen_cpp:
mkdir -p $@
# handwrite thrift
${BUILD_DIR}/gen_cpp/%_types.cpp: ${CURDIR}/%.thrift | ${BUILD_DIR}/gen_cpp
${THRIFT} ${THRIFT_CPP_ARGS} $<
- ${THRIFT} ${THRIFT_JAVA_ARGS} $<
-
-# generated thrift
-${BUILD_DIR}/gen_cpp/%_types.cpp: ${BUILD_DIR}/thrift/%.thrift |
${BUILD_DIR}/gen_cpp
- ${THRIFT} ${THRIFT_CPP_ARGS} $<
- ${THRIFT} ${THRIFT_JAVA_ARGS} $<
diff --git a/regression-test/framework/pom.xml
b/regression-test/framework/pom.xml
index a3db3f4b09b..d25a5d0d98e 100644
--- a/regression-test/framework/pom.xml
+++ b/regression-test/framework/pom.xml
@@ -66,6 +66,8 @@ under the License.
</mailingLists>
<properties>
<doris.home>${basedir}/../../</doris.home>
+
<doris.thrift.executable>${doris.home}/thirdparty/installed/bin/thrift</doris.thrift.executable>
+ <doris.thrift.source>${doris.home}/gensrc/thrift</doris.thrift.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
@@ -78,6 +80,19 @@ under the License.
<!-- Arrow 18 only supports jdk17 -->
<arrow.version>17.0.0</arrow.version>
</properties>
+ <profiles>
+ <profile>
+ <id>thrift-executable-override</id>
+ <activation>
+ <property>
+ <name>env.DORIS_THIRDPARTY</name>
+ </property>
+ </activation>
+ <properties>
+
<doris.thrift.executable>${env.DORIS_THIRDPARTY}/installed/bin/thrift</doris.thrift.executable>
+ </properties>
+ </profile>
+ </profiles>
<build>
<plugins>
<plugin>
@@ -157,6 +172,25 @@ under the License.
<visitor>true</visitor>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.thrift</groupId>
+ <artifactId>thrift-maven-plugin</artifactId>
+ <version>0.10.0</version>
+ <configuration>
+ <generator>java:fullcamel</generator>
+
<thriftExecutable>${doris.thrift.executable}</thriftExecutable>
+ <thriftSourceRoot>${doris.thrift.source}</thriftSourceRoot>
+ </configuration>
+ <executions>
+ <execution>
+ <id>thrift-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
diff --git a/run-regression-test.sh b/run-regression-test.sh
index d3dca92b93a..7087f5eb7a1 100755
--- a/run-regression-test.sh
+++ b/run-regression-test.sh
@@ -199,15 +199,6 @@ if ! test -f ${RUN_JAR:+${RUN_JAR}}; then
return 1
}
- # Build generated code
- cd "${DORIS_HOME}/gensrc/thrift" || { echo "Failed to change directory";
exit 1; }
- if ! make; then
- echo "Make command failed in ${DORIS_HOME}/gensrc/thrift"
- exit 1
- fi
-
- cp -rf "${DORIS_HOME}/gensrc/build/gen_java/org/apache/doris/thrift"
"${FRAMEWORK_APACHE_DIR}/doris/"
-
# Navigate to framework directory and build with retry
cd "${DORIS_HOME}/regression-test/framework" || { echo "Failed to change
directory"; exit 1; }
@@ -327,4 +318,4 @@ if [[ "${ONLY_COMPILE}" -eq 0 ]]; then
-jar ${RUN_JAR:+${RUN_JAR}} \
-cf "${CONFIG_FILE}" \
${REGRESSION_OPTIONS_PREFIX:+${REGRESSION_OPTIONS_PREFIX}} "$@"
-fi
\ No newline at end of file
+fi
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]