Add sanity check that the runfiles middleman root is a middleman root
This would have prevented a large breakage.
@@ -86,6 +86,7 @@ public final class MiddlemanFactory {
public Artifact createRunfilesMiddleman(
ActionOwner owner, @Nullable Artifact owningArtifact, Iterable<Artifact> inputs,
Root middlemanDir, String tag) {
+ Preconditions.checkArgument(middlemanDir.isMiddlemanRoot());
if (hasExactlyOneInput(inputs)) { // Optimization: No middleman for just one input.
return Iterables.getOnlyElement(inputs);
}
