         $0 <<< "import E;"
         $0 <<< "import G;"
       }
-      let packageRootPath = URL(fileURLWithPath: #file).pathComponents
-        .prefix(while: { $0 != "Tests" }).joined(separator: "/").dropFirst()
-      let testInputsPath = packageRootPath + "/TestInputs"
-      let cHeadersPath : String = testInputsPath + "/ExplicitModuleBuilds/CHeaders"
-      let swiftModuleInterfacesPath : String = testInputsPath + "/ExplicitModuleBuilds/Swift"
+
+      let cHeadersPath: String =
+          testInputsPath.appending(component: "ExplicitModuleBuilds")
+                        .appending(component: "CHeaders")
+                        .pathString
+      let swiftModuleInterfacesPath: String =
+          testInputsPath.appending(component: "ExplicitModuleBuilds")
+                        .appending(component: "Swift")
+                        .pathString
       let sdkArgumentsForTesting = (try? Driver.sdkArgumentsForTesting()) ?? []
       var driver = try Driver(args: ["swiftc",
-                                     "-I", cHeadersPath,
-                                     "-I", swiftModuleInterfacesPath,
+                                     "-I", cHeadersPath.nativePathString().escaped(),
+                                     "-I", swiftModuleInterfacesPath.nativePathString().escaped(),
                                      "-import-objc-header",
                                      "-explicit-module-build",
-                                     "-working-directory", path.pathString,
+                                     "-working-directory", path.pathString.nativePathString().escaped(),
                                      "-disable-clang-target",
-                                     main.pathString] + sdkArgumentsForTesting,
+                                     main.pathString.escaped()] + sdkArgumentsForTesting,
                               env: ProcessEnv.vars)
       let resolver = try ArgsResolver(fileSystem: localFileSystem)
       var scannerCommand = try driver.dependencyScannerInvocationCommand().1.map { try resolver.resolve($0) }

        $0 <<< "import E;"
        $0 <<< "import G;"
      }
      let packageRootPath = URL(fileURLWithPath: #file).pathComponents
        .prefix(while: { $0 != "Tests" }).joined(separator: "/").dropFirst()
      let testInputsPath = packageRootPath + "/TestInputs"
      let cHeadersPath : String = testInputsPath + "/ExplicitModuleBuilds/CHeaders"
      let swiftModuleInterfacesPath : String = testInputsPath + "/ExplicitModuleBuilds/Swift"
      let sdkArgumentsForTesting = (try? Driver.sdkArgumentsForTesting()) ?? []
      let scannerCommand = ["-scan-dependencies",
                            "-import-prescan",
                            "-I", cHeadersPath,
                            "-I", swiftModuleInterfacesPath,
                            "-I", stdLibPath.description,
                            "-I", shimsPath.description,
                            main.pathString] + sdkArgumentsForTesting

      let imports =
        try! dependencyOracle.getImports(workingDirectory: path,

      let sdkArgumentsForTesting = (try? Driver.sdkArgumentsForTesting()) ?? []
      var driver = try Driver(args: ["swiftc",
                                     "-explicit-module-build",
                                     "-working-directory", path.pathString.nativePathString().escaped(),
                                     main.pathString.escaped()] + lotsOfInputs + sdkArgumentsForTesting,
                              env: ProcessEnv.vars)
      let scannerJob = try driver.dependencyScanningJob()

