Skip to content

Commit 6c5f5c9

Browse files
authored
Merge pull request #1838 from ahoppen/merge-conflict
Fix merge conflict
2 parents 8d13afa + 76304db commit 6c5f5c9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ package actor SwiftPMBuildSystem: BuiltInBuildSystem {
315315
validating: projectRoot.appendingPathComponent(".build").appendingPathComponent("index-build").filePath
316316
)
317317
} else if let scratchDirectory = options.swiftPMOrDefault.scratchPath,
318-
let scratchDirectoryPath = try? AbsolutePath(validating: scratchDirectory, relativeTo: AbsolutePath(projectRoot))
318+
let scratchDirectoryPath = try? AbsolutePath(
319+
validating: scratchDirectory,
320+
relativeTo: AbsolutePath(validating: projectRoot.filePath)
321+
)
319322
{
320323
location.scratchDirectory = scratchDirectoryPath
321324
}

Tests/BuildSystemIntegrationTests/SwiftPMBuildSystemTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ final class SwiftPMBuildSystemTests: XCTestCase {
9292

9393
func testRelativeScratchPath() async throws {
9494
try await withTestScratchDir { tempDir in
95-
try localFileSystem.createFiles(
95+
try FileManager.default.createFiles(
9696
root: tempDir,
9797
files: [
9898
"pkg/Sources/lib/a.swift": "",
@@ -122,8 +122,8 @@ final class SwiftPMBuildSystemTests: XCTestCase {
122122
)
123123

124124
let dataPath = await swiftpmBuildSystem.destinationBuildParameters.dataPath
125-
let expectedScratchPath = packageRoot.appending(component: try XCTUnwrap(options.swiftPMOrDefault.scratchPath))
126-
XCTAssertTrue(AbsolutePath(dataPath).isDescendant(of: expectedScratchPath))
125+
let expectedScratchPath = packageRoot.appendingPathComponent(try XCTUnwrap(options.swiftPMOrDefault.scratchPath))
126+
XCTAssertTrue(dataPath.asURL.isDescendant(of: expectedScratchPath))
127127
}
128128
}
129129

0 commit comments

Comments
 (0)