Break dependency on vfs from the interface of syntax and cmdline.

These libs are exposed externally, implying that the vfs is also exposed externally.

We break out PathFragment from vfs to still use this in their interface. This class is a much smaller dependency than the entire vfs.

PiperOrigin-RevId: 174729373
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/Path.java b/src/main/java/com/google/devtools/build/lib/vfs/Path.java
index 52b8af3..ab5ad5c 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/Path.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/Path.java
@@ -15,6 +15,8 @@
 
 import com.google.common.base.Predicate;
 import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
+import com.google.devtools.build.lib.skylarkinterface.SkylarkPrintable;
+import com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter;
 import com.google.devtools.build.lib.util.Preconditions;
 import com.google.devtools.build.lib.util.StringCanonicalizer;
 import com.google.devtools.build.lib.vfs.FileSystem.HashFunction;
@@ -37,21 +39,20 @@
 import java.util.Objects;
 
 /**
- * <p>Instances of this class represent pathnames, forming a tree
- * structure to implement sharing of common prefixes (parent directory names).
- * A node in these trees is something like foo, bar, .., ., or /. If the
- * instance is not a root path, it will have a parent path. A path can also
- * have children, which are indexed by name in a map.
+ * Instances of this class represent pathnames, forming a tree structure to implement sharing of
+ * common prefixes (parent directory names). A node in these trees is something like foo, bar, ..,
+ * ., or /. If the instance is not a root path, it will have a parent path. A path can also have
+ * children, which are indexed by name in a map.
  *
- * <p>There is some limited support for Windows-style paths. Most importantly, drive identifiers
- * in front of a path (c:/abc) are supported. However, Windows-style backslash separators
+ * <p>There is some limited support for Windows-style paths. Most importantly, drive identifiers in
+ * front of a path (c:/abc) are supported. However, Windows-style backslash separators
  * (C:\\foo\\bar) and drive-relative paths ("C:foo") are explicitly not supported, same with
  * advanced features like \\\\network\\paths and \\\\?\\unc\\paths.
  *
  * <p>{@link FileSystem} implementations maintain pointers into this graph.
  */
 @ThreadSafe
-public class Path implements Comparable<Path>, Serializable {
+public class Path implements Comparable<Path>, Serializable, SkylarkPrintable {
 
   /** Filesystem-specific factory for {@link Path} objects. */
   public static interface PathFactory {
@@ -427,6 +428,11 @@
     return builder.toString();
   }
 
+  @Override
+  public void repr(SkylarkPrinter printer) {
+    printer.append(getPathString());
+  }
+
   /**
    * Returns the path as a string.
    */