Close loophole for strict checking Starlark code with runfiles symlink manipulation
This was missed when adding the support for passing depsets of symlinks in an earlier change [1].
[1]
@@ -971,9 +971,10 @@ public final class StarlarkRuleContext implements StarlarkRuleContextApi<Constra
builder.addTransitiveArtifacts(transitiveArtifacts);
}
if (isDepset(symlinks)) {
+ // If Starlark code directly manipulates symlinks, activate more stringent validity checking.
+ checkConflicts = true;
builder.addSymlinks(((Depset) symlinks).getSet(SymlinkEntry.class));
} else if (isNonEmptyDict(symlinks)) {
- // If Starlark code directly manipulates symlinks, activate more stringent validity checking.
checkConflicts = true;
for (Map.Entry<String, Artifact> entry :
Dict.cast(symlinks, String.class, Artifact.class, "symlinks").entrySet()) {
@@ -981,6 +982,7 @@ public final class StarlarkRuleContext implements StarlarkRuleContextApi<Constra
}
}
if (isDepset(rootSymlinks)) {
+ checkConflicts = true;
builder.addRootSymlinks(((Depset) rootSymlinks).getSet(SymlinkEntry.class));
} else if (isNonEmptyDict(rootSymlinks)) {
checkConflicts = true;
