Skip to content

Commit f61175a

Browse files
authored
[NFC] Remove TSCBasic.InMemoryFileSystem dependency (#7484)
### Motivation: As we'd like to quickly iterate on asyncification of our file system code and since TSC package is deprecated we should reduce our number of dependencies on it. ### Modifications: Removed `import class TSCBasic.InMemoryFileSystem` statements. ### Result: We have less dependencies on the TSC package.
1 parent 9a718f6 commit f61175a

File tree

55 files changed

+62
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+62
-147
lines changed

Benchmarks/Benchmarks/PackageGraphBenchmarks/PackageGraphBenchmarks.swift

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import PackageModel
77
@_spi(DontAdoptOutsideOfSwiftPMExposedForBenchmarksAndTestsOnly)
88
import func PackageGraph.loadModulesGraph
99

10-
import class TSCBasic.InMemoryFileSystem
1110
import Workspace
1211

1312
let benchmarks = {

Sources/Basics/SQLiteBackedCache.swift

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import Foundation
1414

1515
import protocol TSCBasic.Closable
16-
import class TSCBasic.InMemoryFileSystem
1716
import var TSCBasic.localFileSystem
1817

1918
/// SQLite backed persistent cache.

Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2020-2023 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -20,7 +20,6 @@ import struct Foundation.URL
2020
import PackageModel
2121

2222
import protocol TSCBasic.Closable
23-
import class TSCBasic.InMemoryFileSystem
2423

2524
final class SQLitePackageCollectionsStorage: PackageCollectionsStorage, Closable {
2625
private static let packageCollectionsTableName = "package_collections"

Sources/Workspace/PackageContainer/RegistryPackageContainer.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -17,8 +17,6 @@ import PackageLoading
1717
import PackageModel
1818
import PackageRegistry
1919

20-
import class TSCBasic.InMemoryFileSystem
21-
2220
import struct TSCUtility.Version
2321

2422
public class RegistryPackageContainer: PackageContainer {

Sources/Workspace/Workspace+Editing.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -11,13 +11,13 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import struct Basics.AbsolutePath
14+
import class Basics.InMemoryFileSystem
1415
import class Basics.ObservabilityScope
1516
import struct Basics.RelativePath
1617
import func Basics.temp_await
1718
import struct PackageGraph.PackageGraphRootInput
1819
import struct PackageModel.ProvidedLibrary
1920
import struct SourceControl.Revision
20-
import class TSCBasic.InMemoryFileSystem
2121

2222
extension Workspace {
2323
/// Edit implementation.

Sources/Workspace/Workspace.swift

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import SourceControl
2323

2424
import func TSCBasic.findCycle
2525
import protocol TSCBasic.HashAlgorithm
26-
import class TSCBasic.InMemoryFileSystem
2726
import struct TSCBasic.KeyedPair
2827
import struct TSCBasic.SHA256
2928
import var TSCBasic.stderrStream

Sources/_InternalTestSupport/MockPackageGraphs.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import struct Basics.AbsolutePath
14+
import class Basics.InMemoryFileSystem
1415
import class Basics.ObservabilitySystem
1516
import class Basics.ObservabilityScope
1617

@@ -24,7 +25,6 @@ import struct PackageModel.ProductDescription
2425
import enum PackageModel.ProductType
2526
import struct PackageModel.TargetDescription
2627
import protocol TSCBasic.FileSystem
27-
import class TSCBasic.InMemoryFileSystem
2828

2929
package typealias MockPackageGraph = (
3030
graph: ModulesGraph,

Tests/BasicsTests/Archiver/TarArchiverTests.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -15,7 +15,6 @@ import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
1515
import _InternalTestSupport
1616
import XCTest
1717

18-
import class TSCBasic.InMemoryFileSystem
1918
import struct TSCBasic.FileSystemError
2019

2120
final class TarArchiverTests: XCTestCase {

Tests/BasicsTests/Archiver/UniversalArchiverTests.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -15,7 +15,6 @@ import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
1515
import _InternalTestSupport
1616
import XCTest
1717

18-
import class TSCBasic.InMemoryFileSystem
1918
import struct TSCBasic.FileSystemError
2019

2120
final class UniversalArchiverTests: XCTestCase {

Tests/BasicsTests/Archiver/ZipArchiverTests.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -15,10 +15,9 @@ import _InternalTestSupport
1515
import XCTest
1616
import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
1717

18-
import class TSCBasic.InMemoryFileSystem
1918
import struct TSCBasic.FileSystemError
2019

21-
class ZipArchiverTests: XCTestCase {
20+
final class ZipArchiverTests: XCTestCase {
2221
func testZipArchiverSuccess() async throws {
2322
try await testWithTemporaryDirectory { tmpdir in
2423
let archiver = ZipArchiver(fileSystem: localFileSystem)

Tests/BasicsTests/FileSystem/FileSystemTests.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
99
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
1413
@testable import Basics
1514
import TSCTestSupport
1615
import XCTest
1716

18-
import class TSCBasic.InMemoryFileSystem
19-
2017
final class FileSystemTests: XCTestCase {
2118
func testStripFirstLevelComponent() throws {
2219
let fileSystem = InMemoryFileSystem()

Tests/BasicsTests/SandboxTests.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -18,10 +18,6 @@ import XCTest
1818
import Darwin
1919
#endif
2020

21-
import class TSCBasic.InMemoryFileSystem
22-
import class Basics.AsyncProcess
23-
import struct Basics.AsyncProcessResult
24-
2521
final class SandboxTest: XCTestCase {
2622
func testSandboxOnAllPlatforms() throws {
2723
try withTemporaryDirectory { path in

Tests/BuildTests/BuildOperationTests.swift

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import _InternalTestSupport
2323
import XCTest
2424

2525
import class TSCBasic.BufferedOutputByteStream
26-
import class TSCBasic.InMemoryFileSystem
2726

2827
private func mockBuildOperation(
2928
productsBuildParameters: BuildParameters,

Tests/BuildTests/CrossCompilationBuildPlanTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import struct Basics.AbsolutePath
14+
import class Basics.InMemoryFileSystem
1415
import class Basics.ObservabilitySystem
1516
import class Build.BuildPlan
1617
import class Build.ProductBuildDescription
@@ -35,7 +36,6 @@ import func _InternalTestSupport.trivialPackageGraph
3536
import struct _InternalTestSupport.BuildPlanResult
3637
import func _InternalTestSupport.XCTAssertMatch
3738
import func _InternalTestSupport.XCTAssertNoDiagnostics
38-
import class TSCBasic.InMemoryFileSystem
3939

4040
import XCTest
4141

Tests/BuildTests/LLBuildManifestBuilderTests.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2015-2023 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2015-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -23,7 +23,6 @@ import struct SPMBuildCore.BuildParameters
2323
@_spi(SwiftPMInternal)
2424
import _InternalTestSupport
2525

26-
import class TSCBasic.InMemoryFileSystem
2726
import XCTest
2827

2928
final class LLBuildManifestBuilderTests: XCTestCase {

Tests/BuildTests/ModuleAliasingBuildTests.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2022-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -24,8 +24,6 @@ import SwiftDriver
2424
import Workspace
2525
import XCTest
2626

27-
import class TSCBasic.InMemoryFileSystem
28-
2927
final class ModuleAliasingBuildTests: XCTestCase {
3028
func testModuleAliasingEmptyAlias() throws {
3129
let fs = InMemoryFileSystem(

Tests/BuildTests/ProductBuildDescriptionTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -13,8 +13,8 @@
1313
@testable
1414
import Build
1515

16+
import class Basics.InMemoryFileSystem
1617
import class Basics.ObservabilitySystem
17-
import class TSCBasic.InMemoryFileSystem
1818

1919
import class PackageModel.Manifest
2020
import struct PackageModel.TargetDescription

Tests/CommandsTests/MermaidPackageSerializerTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import class Basics.InMemoryFileSystem
1314
import class Basics.ObservabilitySystem
1415

1516
@_spi(DontAdoptOutsideOfSwiftPMExposedForBenchmarksAndTestsOnly)
@@ -18,7 +19,6 @@ import func PackageGraph.loadModulesGraph
1819
import class PackageModel.Manifest
1920
import struct PackageModel.ProductDescription
2021
import struct PackageModel.TargetDescription
21-
import class TSCBasic.InMemoryFileSystem
2222
import func _InternalTestSupport.XCTAssertNoDiagnostics
2323

2424
@testable

Tests/CommandsTests/MultiRootSupportTests.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2019 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -16,10 +16,7 @@ import _InternalTestSupport
1616
import Workspace
1717
import XCTest
1818

19-
import class TSCBasic.InMemoryFileSystem
20-
2119
final class MultiRootSupportTests: CommandsTestCase {
22-
2320
func testWorkspaceLoader() throws {
2421
let fs = InMemoryFileSystem(emptyFiles: [
2522
"/tmp/test/dep/Package.swift",

Tests/CommandsTests/PackageCommandTests.swift

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import XCTest
2727

2828
import struct TSCBasic.ByteString
2929
import class TSCBasic.BufferedOutputByteStream
30-
import class TSCBasic.InMemoryFileSystem
3130
import enum TSCBasic.JSON
3231
import class Basics.AsyncProcess
3332

Tests/FunctionalTests/ModuleMapTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information

Tests/LLBuildManifestTests/LLBuildManifestTests.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -11,13 +11,12 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import struct Basics.AbsolutePath
14+
import class Basics.InMemoryFileSystem
1415
import class Foundation.PropertyListDecoder
1516
@testable import LLBuildManifest
1617
import _InternalTestSupport
17-
import class TSCBasic.InMemoryFileSystem
1818
import XCTest
1919

20-
2120
private let testEntitlement = "test-entitlement"
2221

2322
final class LLBuildManifestTests: XCTestCase {

Tests/PackageCollectionsTests/PackageCollectionsSourcesStorageTest.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -15,8 +15,6 @@ import Basics
1515
import _InternalTestSupport
1616
import XCTest
1717

18-
import class TSCBasic.InMemoryFileSystem
19-
2018
final class PackageCollectionsSourcesStorageTest: XCTestCase {
2119
func testHappyCase() async throws {
2220
let mockFileSystem = InMemoryFileSystem()

Tests/PackageCollectionsTests/PackageIndexConfigurationTests.swift

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2022 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2022-2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
99
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import class Basics.InMemoryFileSystem
1314
import PackageCollections
1415
import XCTest
1516

16-
import class TSCBasic.InMemoryFileSystem
17-
18-
class PackageIndexConfigurationTests: XCTestCase {
17+
final class PackageIndexConfigurationTests: XCTestCase {
1918
func testSaveAndLoad() throws {
2019
let url = URL("https://package-index.test")
2120
let configuration = PackageIndexConfiguration(url: url)

0 commit comments

Comments
 (0)