             }
             return AbsolutePath(location).pathString
         } else if parseScheme(dependencyLocation) == nil {
-            // If the dependency URL is not remote, try to "fix" it.
             // If the URL has no scheme, we treat it as a path (either absolute or relative to the base URL).
-            return AbsolutePath(dependencyLocation, relativeTo: packagePath).pathString
-        }
-
-        return dependencyLocation
+            switch packageKind {
+            case .root(let packagePath), .fileSystem(let packagePath), .localSourceControl(let packagePath):
+                return AbsolutePath(dependencyLocation, relativeTo: packagePath).pathString
+            case .remoteSourceControl, .registry:
+                // nothing to "fix"
+                return dependencyLocation
+            }
+        } else {
+            // nothing to "fix"
+            return dependencyLocation
+        }
     }
 
     private static func parsePlatforms(_ package: JSON) throws -> [PlatformDescription] {

        fileSystem: TSCBasic.FileSystem
    ) throws -> PackageDependency {
        // cleans up variants of path based location
        var location = try fixDependencyLocation(fileSystem: fileSystem, packageKind: packageKind, dependencyLocation: location)
        // location mapping (aka mirrors) if any
        location = identityResolver.mappedLocation(for: location)
        // a package in a git location, may be a remote URL or on disk

        identityResolver: IdentityResolver,
        fileSystem: TSCBasic.FileSystem
    ) throws -> PackageDependency {
        let location = try sanitizeDependencyLocation(fileSystem: fileSystem, packageKind: packageKind, dependencyLocation: location)
        let path: AbsolutePath
        do {
            path = try AbsolutePath(validating: location)
