     for transitiveDependencyId in dependencyInfo.directDependencies! {
       try checkExplicitModuleBuildJobDependencies(job: job, pcmArgs: pcmArgs, 
                                                   moduleInfo: dependencyOracle.getExternalModuleInfo(of: transitiveDependencyId)!,
-                                                  dependencyOracle: dependencyOracle)
+                                                  dependencyOracle: dependencyOracle,
+                                                  pcmFileEncoder: pcmFileEncoder)
 
     }
   }
 }
 
-private func pcmArgsEncodedRelativeModulePath(for moduleName: String, with pcmArgs: [String]
-) throws -> RelativePath {
-  return RelativePath(
-    try ExplicitDependencyBuildPlanner.targetEncodedClangModuleName(for: moduleName,
-                                                                hashParts: pcmArgs) + ".pcm")
+private func pcmArgsEncodedRelativeModulePath(for moduleName: String, with pcmArgs: [String],
+                                              pcmModuleNameEncoder: (String, [String]) -> String
+) -> RelativePath {
+  return RelativePath(pcmModuleNameEncoder(moduleName, pcmArgs) + ".pcm")
 }
 
 /// Test that for the given JSON module dependency graph, valid jobs are generated

      if driver.targetTriple.isDarwin {
        pcmArgs9.append(contentsOf: ["-Xcc", "-fapinotes-swift-version=5"])
      }

      for job in jobs {
        guard job.kind != .interpret else { continue }
        XCTAssertEqual(job.outputs.count, 1)
        switch (job.outputs[0].file) {
          case .relative(RelativePath("A.swiftmodule")):
            try checkExplicitModuleBuildJob(job: job, pcmArgs: pcmArgsCurrent, moduleId: .swift("A"),
                                            dependencyOracle: dependencyOracle)
          case .relative(RelativePath("Swift.swiftmodule")):
            try checkExplicitModuleBuildJob(job: job, pcmArgs: pcmArgsCurrent, moduleId: .swift("Swift"),
                                            dependencyOracle: dependencyOracle)
          case .relative(RelativePath("SwiftOnoneSupport.swiftmodule")):
            try checkExplicitModuleBuildJob(job: job, pcmArgs: pcmArgsCurrent, moduleId: .swift("SwiftOnoneSupport"),
                                            dependencyOracle: dependencyOracle)
          case .relative(try pcmArgsEncodedRelativeModulePath(for: "A", with: pcmArgsCurrent)):
            try checkExplicitModuleBuildJob(job: job, pcmArgs: pcmArgsCurrent, moduleId: .clang("A"),
                                            dependencyOracle: dependencyOracle)
          case .relative(try pcmArgsEncodedRelativeModulePath(for: "B", with: pcmArgsCurrent)):
            try checkExplicitModuleBuildJob(job: job, pcmArgs: pcmArgsCurrent, moduleId: .clang("B"),
                                            dependencyOracle: dependencyOracle)
          case .relative(try pcmArgsEncodedRelativeModulePath(for: "C", with: pcmArgsCurrent)):
            try checkExplicitModuleBuildJob(job: job, pcmArgs: pcmArgsCurrent, moduleId: .clang("C"),
                                            dependencyOracle: dependencyOracle)
          case .relative(try pcmArgsEncodedRelativeModulePath(for: "SwiftShims", with: pcmArgs9)):
            try checkExplicitModuleBuildJob(job: job, pcmArgs: pcmArgs9, moduleId: .clang("SwiftShims"),
                                            dependencyOracle: dependencyOracle)
          case .relative(try pcmArgsEncodedRelativeModulePath(for: "SwiftShims", with: pcmArgsCurrent)):
            try checkExplicitModuleBuildJob(job: job, pcmArgs: pcmArgsCurrent, moduleId: .clang("SwiftShims"),
                                            dependencyOracle: dependencyOracle)
          default:
            XCTFail("Unexpected module dependency build job output: \(job.outputs[0].file)")
        }

        XCTAssertEqual(dependencyArtifacts!.modulePath,
                       prebuiltModuleDetails.compiledModulePath)
      case .clang(let clangDependencyDetails):
        let clangDependencyModulePathString = pcmFileEncoder(dependencyInfo, pcmArgs)
        let clangDependencyModulePath =
          TypedVirtualPath(file: clangDependencyModulePathString, type: .pcm)
        let clangDependencyModuleMapPath =
