Skip to content

Disable VFS overlay on Windows #5980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Sources/PackageLoading/ManifestLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,17 @@ public final class ManifestLoader: ManifestLoaderProtocol {
let manifestTempFilePath = tempDir.appending(component: "manifest.swift")
try localFileSystem.writeFileContents(manifestTempFilePath, bytes: ByteString(manifestPreamble.contents + manifestContents))

#if os(Windows)
// On Windows, we seem to have issues with the VFS overlay, so let's disable it for now.
let effectiveManifestPath = manifestTempFilePath
let vfsOverlayTempFilePath: AbsolutePath? = nil
#else
let effectiveManifestPath = manifestPath
let vfsOverlayTempFilePath = tempDir.appending(component: "vfs.yaml")
try VFSOverlay(roots: [
VFSOverlay.File(name: manifestPath.pathString, externalContents: manifestTempFilePath.pathString)
]).write(to: vfsOverlayTempFilePath, fileSystem: localFileSystem)
#endif

validateImports(manifestPath: manifestTempFilePath, toolsVersion: toolsVersion, callbackQueue: callbackQueue) { result in
dispatchPrecondition(condition: .onQueue(callbackQueue))
Expand All @@ -524,7 +531,7 @@ public final class ManifestLoader: ManifestLoaderProtocol {
try result.get()

try self.evaluateManifest(
at: manifestPath,
at: effectiveManifestPath,
vfsOverlayPath: vfsOverlayTempFilePath,
packageIdentity: packageIdentity,
toolsVersion: toolsVersion,
Expand Down
4 changes: 4 additions & 0 deletions Tests/PackageLoadingTests/PD_5_6_LoadingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ class PackageDescription5_6LoadingTests: PackageDescriptionLoadingTests {

/// Tests access to the package's directory contents.
func testPackageContextDirectory() throws {
#if os(Windows)
throw XCTSkip("Skipping since this tests does not fully work without the VFS overlay which is currently disabled on Windows")
#endif

let content = """
import PackageDescription
import Foundation
Expand Down