Test output directory presence for skylark repositories without a FileValue
Using a FileValue depenendency was not needed and create over-invalidation
of the repository. On a cold server, this duplicate the call to the repository
function, including potential slow operation like downloads.
MOS_MIGRATED_REVID=147032408
@@ -23,7 +23,6 @@ import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.rules.repository.RepositoryDirectoryValue;
import com.google.devtools.build.lib.rules.repository.RepositoryFunction;
-import com.google.devtools.build.lib.skyframe.FileValue;
import com.google.devtools.build.lib.syntax.BaseFunction;
import com.google.devtools.build.lib.syntax.EvalException;
import com.google.devtools.build.lib.syntax.Mutability;
@@ -117,14 +116,7 @@ public class SkylarkRepositoryFunction extends RepositoryFunction {
throw new RepositoryFunctionException(e, Transience.TRANSIENT);
}
- FileValue repositoryValue = getRepositoryDirectory(outputDirectory, env);
- if (repositoryValue == null) {
- // TODO(bazel-team): If this returns null, we unnecessarily recreate the symlink above on the
- // second execution.
- return null;
- }
-
- if (!repositoryValue.isDirectory()) {
+ if (!outputDirectory.isDirectory()) {
throw new RepositoryFunctionException(
new IOException(rule + " must create a directory"), Transience.TRANSIENT);
}
