Skip to content

Commit 4d26a9a

Browse files
committed
PackageLoading: enable the manifest VFS on Windows
Ensure that the path string is escaped when emitting the paths. The VFS paths are serialised as either JSON or YAML, both of which require the path string be escaped.
1 parent 132fe00 commit 4d26a9a

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

Sources/PackageLoading/ManifestLoader.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -538,17 +538,11 @@ public final class ManifestLoader: ManifestLoaderProtocol {
538538
let manifestTempFilePath = tempDir.appending("manifest.swift")
539539
try localFileSystem.writeFileContents(manifestTempFilePath, bytes: ByteString(manifestPreamble.contents + manifestContents))
540540

541-
#if os(Windows)
542-
// On Windows, we seem to have issues with the VFS overlay, so let's disable it for now.
543-
let effectiveManifestPath = manifestTempFilePath
544-
let vfsOverlayTempFilePath: AbsolutePath? = nil
545-
#else
546-
let effectiveManifestPath = manifestPath
547541
let vfsOverlayTempFilePath = tempDir.appending("vfs.yaml")
548542
try VFSOverlay(roots: [
549-
VFSOverlay.File(name: manifestPath.pathString, externalContents: manifestTempFilePath.pathString)
543+
VFSOverlay.File(name: manifestPath._nativePathString(escaped: true),
544+
externalContents: manifestTempFilePath._nativePathString(escaped: true))
550545
]).write(to: vfsOverlayTempFilePath, fileSystem: localFileSystem)
551-
#endif
552546

553547
validateImports(manifestPath: manifestTempFilePath, toolsVersion: toolsVersion, callbackQueue: callbackQueue) { result in
554548
dispatchPrecondition(condition: .onQueue(callbackQueue))
@@ -557,7 +551,7 @@ public final class ManifestLoader: ManifestLoaderProtocol {
557551
try result.get()
558552

559553
try self.evaluateManifest(
560-
at: effectiveManifestPath,
554+
at: manifestPath,
561555
vfsOverlayPath: vfsOverlayTempFilePath,
562556
packageIdentity: packageIdentity,
563557
toolsVersion: toolsVersion,

0 commit comments

Comments
 (0)