[2.x] fix: Avoid updateFull (#9290)

**Problem**
updateFull is called in no-op compile.

**Solution**
Avoid it for the default dependency mode.
This commit is contained in:
eugene yokota 2026-06-01 07:00:21 -04:00 committed by GitHub
parent 25cb2f3e60
commit fcd247e7c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 58 additions and 26 deletions

View File

@ -2744,17 +2744,31 @@ object Classpaths {
dependencyMode.value match
case DependencyMode.Transitive =>
Def.task { dependencyClasspath.value }
case mode =>
case DependencyMode.Direct =>
Def.task {
val internalFiltered = ClasspathImpl.filterInternalByMode(
mode,
DependencyMode.Direct,
thisProjectRef.value,
settingsData.value,
buildDependencies.value,
internalDependencyClasspath.value,
)
val externalFiltered = ClasspathImpl.filterByDependencyMode(
mode,
val externalFiltered = ClasspathImpl.filterByDirectDeps(
allDependencies.value,
externalDependencyClasspath.value,
)
internalFiltered ++ externalFiltered
}
case DependencyMode.PlusOne =>
Def.task {
val internalFiltered = ClasspathImpl.filterInternalByMode(
DependencyMode.PlusOne,
thisProjectRef.value,
settingsData.value,
buildDependencies.value,
internalDependencyClasspath.value,
)
val externalFiltered = ClasspathImpl.filterByPlusOne(
allDependencies.value,
projectID.value,
classpathConfiguration.value,
@ -2822,28 +2836,46 @@ object Classpaths {
// Note: invoking this task from shell would block indefinitely because it will
// wait for the upstream compilation to start.
dependencyPicklePath := Def.uncached {
// This is a conditional task. Do not refactor.
if (incOptions.value.pipelining) {
val mode = dependencyMode.value
val internalFiltered = ClasspathImpl.filterInternalByMode(
mode,
thisProjectRef.value,
settingsData.value,
buildDependencies.value,
internalDependencyPicklePath.value,
)
val externalFiltered = ClasspathImpl.filterByDependencyMode(
mode,
allDependencies.value,
projectID.value,
classpathConfiguration.value,
updateFull.value,
externalDependencyClasspath.value,
)
internalFiltered ++ externalFiltered
} else {
filteredDependencyClasspath.value
}
Def.taskDyn {
(incOptions.value.pipelining, dependencyMode.value) match
case (false, _) =>
Def.task { filteredDependencyClasspath.value }
case (true, DependencyMode.Transitive) =>
Def.task { dependencyClasspath.value }
case (true, DependencyMode.Direct) =>
Def.task {
val internalFiltered = ClasspathImpl.filterInternalByMode(
DependencyMode.Direct,
thisProjectRef.value,
settingsData.value,
buildDependencies.value,
internalDependencyClasspath.value,
)
val externalFiltered = ClasspathImpl.filterByDirectDeps(
allDependencies.value,
externalDependencyClasspath.value,
)
internalFiltered ++ externalFiltered
}
case (true, DependencyMode.PlusOne) =>
Def.task {
val internalFiltered = ClasspathImpl.filterInternalByMode(
DependencyMode.PlusOne,
thisProjectRef.value,
settingsData.value,
buildDependencies.value,
internalDependencyClasspath.value,
)
val externalFiltered = ClasspathImpl.filterByPlusOne(
allDependencies.value,
projectID.value,
classpathConfiguration.value,
updateFull.value,
externalDependencyClasspath.value,
)
internalFiltered ++ externalFiltered
}
}.value
},
internalDependencyPicklePath := ClasspathImpl.internalDependencyPicklePathTask.value,
exportedPickles := ClasspathImpl.exportedPicklesTask.value,