public interface SupportsDependencyFileRuleKey extends BuildRule
Modifier and Type | Method and Description |
---|---|
java.util.function.Predicate<SourcePath> |
getCoveredByDepFilePredicate(SourcePathResolverAdapter pathResolver)
Returns a predicate that can tell whether a given path is covered by dep-file or not.
|
java.util.function.Predicate<SourcePath> |
getExistenceOfInterestPredicate(SourcePathResolverAdapter pathResolver)
Returns a predicate that can tell whether the existence of a given path may be of interest to
compiler.
|
com.google.common.collect.ImmutableList<SourcePath> |
getInputsAfterBuildingLocally(BuildContext context,
CellPathResolver cellPathResolver)
Returns a list of source paths that were actually used for the rule.
|
boolean |
useDependencyFileRuleKeys() |
compareTo, getBuildDeps, getBuildSteps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, getSourcePathToOutput, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolver
getDependencies, getSourcePathOutputs
getType
boolean useDependencyFileRuleKeys()
java.util.function.Predicate<SourcePath> getCoveredByDepFilePredicate(SourcePathResolverAdapter pathResolver)
I.e. this predicate should return true only for source paths that *may* be returned from
getInputsAfterBuildingLocally(BuildContext, CellPathResolver)
. This information is
used by the rule key builder to infer that inputs *not* in this list should be included
unconditionally in the rule key. Inputs that *are* in this list should be included in the rule
key if and only if they are actually being used for the rule. I.e. if they are present in the
dep-file listed by getInputsAfterBuildingLocally(BuildContext, CellPathResolver)
.
java.util.function.Predicate<SourcePath> getExistenceOfInterestPredicate(SourcePathResolverAdapter pathResolver)
The main purpose of this predicate is to support scenarios where compiler decides whether to use a file or not solely based on its path. Of course, if compiler decides to use the file, it should list it in the dep-file in which case both the path and the content will be included in the rule key. However, relying only on presence in the dep-file for such paths is not sufficient. The problem occurs when a new such file just gets added, in which case it won't be present in the dep-file produced in the previous build, and yet if we run a local build now the compiler may decide to use it. For that reason rule key needs to reflect existence of all such files and change when a such a file gets added or removed.
com.google.common.collect.ImmutableList<SourcePath> getInputsAfterBuildingLocally(BuildContext context, CellPathResolver cellPathResolver) throws IOException
IOException