Skip to content

Commit

Permalink
DO NOT IMPORT: Debug invalid absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Apr 9, 2023
1 parent e803a09 commit 8043408
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/google/devtools/build/lib/vfs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/profiler",
"//src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec",
"//src/main/java/com/google/devtools/build/lib/util:filetype",
"//src/main/java/com/google/devtools/build/lib/util:os",
"//src/main/java/com/google/devtools/build/skyframe:skyframe-objects",
"//src/main/java/com/google/devtools/common/options",
"//third_party:caffeine",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static com.google.common.base.Preconditions.checkArgument;

import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec;
import com.google.devtools.build.lib.util.OS;
import com.google.devtools.build.skyframe.SkyKey;
import java.util.Comparator;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -53,6 +54,11 @@ public final class RootedPath implements Comparable<RootedPath>, FileStateKey {
@AutoCodec.Instantiator
@AutoCodec.VisibleForSerialization
static RootedPath createInternal(Root root, PathFragment rootRelativePath) {
if (OS.getCurrent() == OS.WINDOWS && root.isAbsolute() && rootRelativePath.toString()
.equals("/")) {
throw new IllegalStateException(
"Path " + rootRelativePath + ", " + rootRelativePath.getClass());
}
checkArgument(
rootRelativePath.isAbsolute() == root.isAbsolute(),
"rootRelativePath: %s root: %s",
Expand Down

0 comments on commit 8043408

Please sign in to comment.