[fix](build) Run copy-dependencies on a build-cache hit so a cache-restored BE plugin still deploys its dependencies - #68000
Merged
CalvinKirs merged 1 commit intoSep 15, 2026
Conversation
…stored BE plugin still deploys its dependencies Since apache#66729 every BE Java extension deploys as a thin module jar plus the runtime closure that maven-dependency-plugin:copy-dependencies writes to target/lib at the package phase; build.sh copies that directory verbatim into plugins/jni/<name>. The Maven build cache restores a module's jar on a hit and nothing else - the log says so outright, "Skipping plugin execution (cached): dependency:copy-dependencies" - so a cache-restored plugin has no target/lib at all. On a working copy that is harmless: target/lib is still there from the module's last real build, which is what the comment in be-java-extensions/pom.xml relied on. CI is the opposite case. TeamCity runs `git clean -f -d -x` before every build, so target/ is always fresh, while /home/work/.m2 - build-cache included - is mounted from the host and survives. The first build on an agent after apache#66729 built the plugins for real and seeded the cache; every later build on that agent restored the thin jars, deployed each plugin as a single jar, and failed check_plugin_layout.py's closure-self-contained rule with a few hundred "is in no jar of this plugin directory" problems (Compile builds 121702, 121701, 121700, 121695, 121689 on 2026-09-15, one PR after another). Only a module whose inputs the PR happened to touch, such as java-udf behind a Config.java change, was rebuilt and came out whole. Force the goal under runAlways in fe/.mvn/maven-build-cache-config.xml, the same mechanism that already keeps checkstyle running on a cache hit. It is matched by goal rather than execution id so the plugins' copy-plugin-dependencies and hadoop-deps' copy-dependencies are covered alike, and so is any module that adds the goal later. The wipe-plugin-lib clean execution that precedes it is forced too: the two exist as a pair, and a copy without the wipe would deploy the union of every dependency set the directory has ever held. Forcing the goal costs a copy out of the local repository; the alternative, keeping the closure in the cache as attached outputs, would store hundreds of jars per plugin per checksum. build.sh had a fallback for exactly this for hadoop-deps only (apache#60964), re-running the goal from the command line when target/lib was missing. It goes: the forced execution covers hadoop-deps as well, and the fallback ran the goal without the pom's runtime-scope filter, so the be/lib/hadoop_hdfs/lib it produced carried the test-scope closure - the JUnit 5 stack, hamcrest, awaitility, opentest4j - in every CI build where hadoop-deps hit the cache (167 jars where the pom's execution yields 149). Verified locally on master@846d9b2ebfc with jdbc-scanner and hadoop-deps: a real build (12 and 149 jars in target/lib), then rm -rf target and a rebuild with the old config restores the module from the cache and leaves target/ holding only the jar; the same rebuild with this config logs "Mojo execution is forced by project property: dependency:copy-dependencies" and refills target/lib with the identical 12 and 149 jars. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ja986K4PEm2LD8u44L9jd2
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 16961 ms |
Contributor
TPC-DS: Total hot run time: 82165 ms |
Contributor
ClickBench: Total hot run time: 14.65 s |
Contributor
Author
|
skip buildall |
CalvinKirs
approved these changes
Sep 15, 2026
luwei16
added a commit
to luwei16/Doris
that referenced
this pull request
Sep 15, 2026
### What problem does this PR solve? Issue Number: close apache#67099 Related PR: apache#67813, apache#68000 Problem Summary: The performance pipeline fails before benchmarks because Maven cache hits restore Java plugin jars without their runtime dependencies. Merge upstream master and adopt its equivalent cache cleanup/copy fix, resolving conflicts with the local repair and removing duplicate changes from this PR. Preserve the cloud version-cache invalidation changes. ### Release note None ### Check List (For Author) - Test: Manual test - build.sh --be-java-extensions passed after the merge. - All eight plugins and hadoop-deps hit the cache, regenerated the same runtime dependency manifests as an uncached build, and removed stale jars. - All eight plugins passed the existing layout checker; Checkstyle for the nine modules and PR diff whitespace checks passed. - Behavior changed: No (adopt the equivalent upstream build repair) - Does this need documentation: No
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
|
PR approved by at least one committer and no changes requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #66729 (the plugin layout this breaks under the build cache), #60964 (the hadoop-deps-only fallback this removes)
Problem Summary:
Since #66729 merged (2026-09-15 10:52 CST), the TeamCity Compile step fails for one PR after another with a few hundred
closure-self-containedproblems fromcheck_plugin_layout.py, e.g. build 121702 (pull/67966), 121701 / 121695 (pull/67551), 121700 / 121689 (pull/67675):(The
output/ms missingerror the CI wrapper prints afterwards is a symptom:build.shexits at the plugin check, before it copiescloud/outputtooutput/ms.)Root cause. Every BE Java extension now deploys as a thin module jar plus the runtime closure that
maven-dependency-plugin:copy-dependencieswrites totarget/libat thepackagephase, andbuild.shcopies that directory verbatim intoplugins/jni/<name>. The Maven build cache restores a module's jar on a hit and nothing else — the log says so outright:On a working copy that is harmless, because
target/libis still there from the module's last real build — which is what the comment inbe-java-extensions/pom.xmlrelied on. CI is the opposite case: TeamCity runsgit clean -f -d -xbefore every build, sotarget/is always fresh, while/home/work/.m2(build cache included) is mounted from the host and survives. So the first build on each agent after #66729 built the plugins for real and seeded the cache (e.g. 121674 on agent 172.16.0.115: hudi 238 / iceberg 148 / jdbc 13 / paimon 155 / trino 99 jars, green), and the very next build on the same agent (121702, same checksums,Found cached build, restoring ...) deployed each plugin as a single jar and failed. Only a module whose inputs the PR happened to touch —java-udfbehind aConfig.javachange, since it depends onfe-common— was rebuilt and came out whole, which is why the count is 322 problems for some PRs and 352 for others.Fix. Force the goal under
runAlwaysinfe/.mvn/maven-build-cache-config.xml, the same mechanism that already keeps checkstyle running on a cache hit. It is matched by goal rather than execution id so the plugins'copy-plugin-dependenciesand hadoop-deps'copy-dependenciesare covered alike, and so is any module that adds the goal later. Thewipe-plugin-libclean execution that precedes it is forced too: the two exist as a pair, and a copy without the wipe would deploy the union of every dependency set the directory has ever held. Forcing the goal costs a copy out of the local repository; the alternative — keeping the closure in the cache as attached outputs — would store hundreds of jars per plugin per checksum.build.shhad a fallback for exactly this, for hadoop-deps only (#60964): re-run the goal from the command line whentarget/libwas missing. It goes, for two reasons. The forced execution covers hadoop-deps as well; and the fallback ran the goal without the pom's runtime-scope filter, so thebe/lib/hadoop_hdfs/libit produced carried the test-scope closure — the JUnit 5 stack, hamcrest, awaitility, opentest4j, plus provided-scope zookeeper and the netty QUIC natives — in every CI build where hadoop-deps hit the cache (167 jars, where the pom's execution yields 149; build 121702 shows the junit jars being copied intooutput/be/lib/hadoop_hdfs/lib/).The comment in
be-java-extensions/pom.xmlthat described the old (wrong) assumption is corrected to point at the forced executions.Release note
None
Check List (For Author)
Test
Manual test (add detailed scripts or steps below)
On master@846d9b2ebfc,
cd fe && mvn -pl be-java-extensions/jdbc-scanner,be-java-extensions/hadoop-deps -am package -DskipTests -Dcheckstyle.skip=true, simulating CI'sgit clean -fdxwithrm -rfof the modules'target/between runs:Local build was not found by checksum 2c03b13c59c59c7b→target/lib12 jarsFound cached build, restoring ... 2c03b13c59c59c7b,Skipping plugin execution (cached): dependency:copy-dependencies→target/holds onlyjdbc-scanner.jar, no lib (the CI failure)Mojo execution is forced by project property: clean:clean/dependency:copy-dependencies→target/lib12 jars, byte-for-byte the same list as run 1Found cached build, restoring ... 7df78f352270b07a, forced copy → 149 jars, same list as run 3The config change does not alter module checksums (run 3 hits the entry run 1 wrote), so existing cache entries on the CI agents keep being used and simply regain their
target/lib.Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ja986K4PEm2LD8u44L9jd2