Skip to content

Commit beac457

Browse files
committed
DO NOT IMPORT: Debug invalid absolute paths
1 parent e803a09 commit beac457

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/google/devtools/build/lib/vfs/RootedPath.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import static com.google.common.base.Preconditions.checkArgument;
1717

1818
import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
19+
import com.google.devtools.build.lib.util.OS;
1920
import com.google.devtools.build.skyframe.SkyKey;
2021
import java.util.Comparator;
2122
import javax.annotation.Nullable;
@@ -53,6 +54,11 @@ public final class RootedPath implements Comparable<RootedPath>, FileStateKey {
5354
@AutoCodec.Instantiator
5455
@AutoCodec.VisibleForSerialization
5556
static RootedPath createInternal(Root root, PathFragment rootRelativePath) {
57+
if (OS.getCurrent() == OS.WINDOWS && root.isAbsolute() && rootRelativePath.toString()
58+
.equals("/")) {
59+
throw new IllegalStateException(
60+
"Path " + rootRelativePath + ", " + rootRelativePath.getClass());
61+
}
5662
checkArgument(
5763
rootRelativePath.isAbsolute() == root.isAbsolute(),
5864
"rootRelativePath: %s root: %s",

0 commit comments

Comments
 (0)