Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1591,13 +1591,12 @@ if [[ "${OUTPUT_BE_BINARY}" -eq 1 ]]; then
mkdir "${BE_HADOOP_HDFS_DIR}"
HADOOP_DEPS_JAR_DIR="${DORIS_HOME}/fe/be-java-extensions/${HADOOP_DEPS_NAME}/target"
echo "HADOOP_DEPS_JAR_DIR: ${HADOOP_DEPS_JAR_DIR}"
if [[ "${BUILD_BE_JAVA_EXTENSIONS}" -eq 1 && ! -d "${HADOOP_DEPS_JAR_DIR}/lib" ]]; then
echo "WARN: lib directory missing (likely due to Maven cache). Regenerating..."
pushd "${DORIS_HOME}/fe/be-java-extensions/${HADOOP_DEPS_NAME}"
"${MVN_CMD}" dependency:copy-dependencies -DskipTests -Dcheckstyle.skip=true
mv target/dependency target/lib
popd
fi
# target/lib is present even when the Maven build cache restored this module instead of
# building it: fe/.mvn/maven-build-cache-config.xml forces copy-dependencies to run on a
# cache hit, for hadoop-deps and every plugin alike. There used to be a fallback here
# that re-ran the goal from the command line when the directory was missing; besides
# covering only this one module, it ran the goal without the pom's runtime-scope
# filter and so put the test-scope closure (JUnit and friends) into lib/hadoop_hdfs.
if [[ -f "${HADOOP_DEPS_JAR_DIR}/${HADOOP_DEPS_NAME}.jar" ]]; then
echo "Copy Be Extensions hadoop deps jar to ${BE_HADOOP_HDFS_DIR}"
cp "${HADOOP_DEPS_JAR_DIR}/${HADOOP_DEPS_NAME}.jar" "${BE_HADOOP_HDFS_DIR}"
Expand Down
30 changes: 29 additions & 1 deletion fe/.mvn/maven-build-cache-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,42 @@ under the License.
</input>
<executionControl>
<runAlways>
<!-- Checkstyle is a quality gate that must always execute; never use a cached result. -->
<executions>
<!-- Checkstyle is a quality gate that must always execute; never use a cached result. -->
<execution artifactId="maven-checkstyle-plugin">
<execIds>
<execId>validate</execId>
</execIds>
</execution>
<!-- The wipe of target/lib that be-java-extensions/pom.xml binds right before the
copy-dependencies forced below. The two run as a pair or not at all: a copy
without the wipe deploys the union of every dependency set the directory has
ever held, which is the drift that wipe exists to prevent. -->
<execution artifactId="maven-clean-plugin">
<execIds>
<execId>wipe-plugin-lib</execId>
</execIds>
</execution>
</executions>
<goalsLists>
<!-- A cache hit restores a module's jar and nothing else: whatever a skipped mojo
wrote elsewhere under target/ stays missing. Every BE Java plugin (and
hadoop-deps) deploys as a thin jar plus the runtime closure copy-dependencies
writes to target/lib, which build.sh copies verbatim, so a cache-restored
plugin would ship with no dependencies at all and fail the closure rule of
tools/be-java-plugins/check_plugin_layout.py. Harmless on a working copy, which
still holds the target/lib of its last real build; fatal in CI, which wipes
target/ before every build (git clean -fdx) while ~/.m2/build-cache survives -
the first build on an agent seeds the cache and every later one deploys empty
plugins. Forcing the goal only copies jars out of the local repository, far
cheaper than keeping the closure (hundreds of jars per plugin) in the cache as
attached outputs. -->
<goalsList artifactId="maven-dependency-plugin">
<goals>
<goal>copy-dependencies</goal>
</goals>
</goalsList>
</goalsLists>
</runAlways>
</executionControl>
</cache>
7 changes: 5 additions & 2 deletions fe/be-java-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ under the License.
copy-dependencies refills it makes an incremental build's plugin directory equal to a
clean one's.

A cache-restored module skips both executions and keeps the target/lib its own last
real build wrote, which is consistent for the same reason.
Both executions are also forced under runAlways in fe/.mvn/maven-build-cache-config.xml.
A build-cache hit restores the module jar and nothing else, so without that a cache-
restored module has no target/lib at all: harmless on a working copy, which still
holds the directory its last real build wrote, but CI wipes target/ before every
build while the cache survives, and deployed every plugin empty.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Loading