You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by ch...@apache.org on 2026/02/04 10:18:58 UTC
(incubator-gluten) 01/01: fix: Write build-info directly to output directory
This is an automated email from the ASF dual-hosted git repository.
changchen pushed a commit to branch fix/improve-incremental-build
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
commit 7c48ecb9a904a0b34ff69471872c6293c6e18421
Author: Chang chen <ch...@microsoft.com>
AuthorDate: Wed Feb 4 10:18:43 2026 +0000
fix: Write build-info directly to output directory
This fixes the issue where moving build-info generation to
prepare-package phase caused gluten-build-info.properties to be
missing from classpath. Previously the file was generated in
generated-resources and copied during process-resources, but
prepare-package runs after process-resources.
The fix:
- Allow GLUTEN_BUILD_INFO_OUTPUT_DIR env var in gluten-build-info.sh
- Pass ${project.build.outputDirectory} to write directly to classes
- Remove unused generated-resources from resources configuration
---
dev/gluten-build-info.sh | 3 ++-
gluten-core/pom.xml | 6 +++---
gluten-substrait/pom.xml | 2 ++
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dev/gluten-build-info.sh b/dev/gluten-build-info.sh
index d4bd424d67..d26d55bd15 100755
--- a/dev/gluten-build-info.sh
+++ b/dev/gluten-build-info.sh
@@ -19,7 +19,8 @@
GLUTEN_ROOT=$(cd $(dirname -- $0)/..; pwd -P)
-EXTRA_RESOURCE_DIR=$GLUTEN_ROOT/gluten-core/target/generated-resources
+# Default output directory, can be overridden by --output-dir parameter
+EXTRA_RESOURCE_DIR=${GLUTEN_BUILD_INFO_OUTPUT_DIR:-$GLUTEN_ROOT/gluten-core/target/generated-resources}
BUILD_INFO="$EXTRA_RESOURCE_DIR"/gluten-build-info.properties
DO_REMOVAL="$1" && shift
if [ "true" = "$DO_REMOVAL" ]; then
diff --git a/gluten-core/pom.xml b/gluten-core/pom.xml
index db1d25c595..4d69786dd7 100644
--- a/gluten-core/pom.xml
+++ b/gluten-core/pom.xml
@@ -150,9 +150,7 @@
<resource>
<directory>${project.basedir}/src/main/resources</directory>
</resource>
- <resource>
- <directory>${project.build.directory}/generated-resources</directory>
- </resource>
+ <!-- Note: generated-resources is no longer needed since build-info is written directly to output directory -->
</resources>
<plugins>
<!-- compile proto buffer files using copied protoc binary -->
@@ -188,7 +186,9 @@
<phase>prepare-package</phase>
<configuration>
<target>
+ <!-- Write directly to output directory so build-info is on classpath immediately -->
<exec executable="bash" osfamily="unix">
+ <env key="GLUTEN_BUILD_INFO_OUTPUT_DIR" value="${project.build.outputDirectory}"/>
<arg value="${project.basedir}/../dev/gluten-build-info.sh"/>
<arg value="true"/>
<arg value="--version"/>
diff --git a/gluten-substrait/pom.xml b/gluten-substrait/pom.xml
index e667c03491..cf3d18f486 100644
--- a/gluten-substrait/pom.xml
+++ b/gluten-substrait/pom.xml
@@ -228,7 +228,9 @@
<phase>prepare-package</phase>
<configuration>
<target>
+ <!-- Write directly to gluten-core output directory so build-info is on classpath immediately -->
<exec executable="bash" osfamily="unix">
+ <env key="GLUTEN_BUILD_INFO_OUTPUT_DIR" value="${project.basedir}/../gluten-core/target/scala-${scala.binary.version}/classes"/>
<arg value="${project.basedir}/../dev/gluten-build-info.sh"/>
<arg value="false"/>
<arg value="--backend"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org