ningsh7 opened a new pull request, #11180:
URL: https://github.com/apache/gravitino/pull/11180

   ### What changes were proposed in this pull request?
   
   This change adds a dedicated cleanDistributionPackage task to remove stale 
distribution/package and distribution/package-all outputs before distribution 
copy tasks write new artifacts.
   
   Copy tasks that write into the distribution package directories are wired to 
depend on cleanDistributionPackage, so compileDistribution starts from a clean 
package output.
   
   ### Why are the changes needed?
   
   compileDistribution previously copied new files into distribution/package 
without removing files that were no longer produced by the current build. After 
dependency version bumps, stale jars could remain in the distribution package 
and stay on the runtime classpath.
   
   This may cause non-deterministic local failures when old and new versions of 
the same jar coexist.
   
   I avoided deleting the package directories directly in 
compileDistribution.doFirst because compileDistribution depends on several copy 
tasks. A doFirst action on compileDistribution may run after those dependent 
copy tasks and delete files that were just copied.
   
   Fix: #11164
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This only changes the local distribution build behavior.
   
   ### How was this patch tested?
   
   - `./gradlew clean compileDistribution -PskipWeb=true -x test`
   - Temporarily bumped `lance` in `gradle/libs.versions.toml`
   - Re-ran `./gradlew compileDistribution -PskipWeb=true -x test`
   - Confirmed the old `lance-core` jar was removed from `distribution/package` 
and `distribution/package-all`
   - Reverted the temporary version bump
   - `./gradlew spotlessApply`
   - `git diff --check`
   
   <!--
   1. Title: [#<issue>] <type>(<scope>): <subject>
      Examples:
        - "[#123] feat(operator): Support xxx"
        - "[#233] fix: Check null before access result in xxx"
        - "[MINOR] refactor: Fix typo in variable name"
        - "[MINOR] docs: Fix typo in README"
        - "[#255] test: Fix flaky test NameOfTheTest"
      Reference: https://www.conventionalcommits.org/en/v1.0.0/
   2. If the PR is unfinished, please mark this PR as draft.
   -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to