Skip to content

[NFC] Remove TSCBasic.InMemoryFileSystem dependency #7484

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 7 commits into from
Jul 2, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import PackageModel
@_spi(DontAdoptOutsideOfSwiftPMExposedForBenchmarksAndTestsOnly)
import func PackageGraph.loadModulesGraph

import class TSCBasic.InMemoryFileSystem
import Workspace

let benchmarks = {
Expand Down
1 change: 0 additions & 1 deletion Sources/Basics/SQLiteBackedCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import Foundation

import protocol TSCBasic.Closable
import class TSCBasic.InMemoryFileSystem
import var TSCBasic.localFileSystem

/// SQLite backed persistent cache.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2020-2023 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -20,7 +20,6 @@ import struct Foundation.URL
import PackageModel

import protocol TSCBasic.Closable
import class TSCBasic.InMemoryFileSystem

final class SQLitePackageCollectionsStorage: PackageCollectionsStorage, Closable {
private static let packageCollectionsTableName = "package_collections"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2021 Apple Inc. and the Swift project authors
// Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -17,8 +17,6 @@ import PackageLoading
import PackageModel
import PackageRegistry

import class TSCBasic.InMemoryFileSystem

import struct TSCUtility.Version

public class RegistryPackageContainer: PackageContainer {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Workspace/Workspace+Editing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -11,13 +11,13 @@
//===----------------------------------------------------------------------===//

import struct Basics.AbsolutePath
import class Basics.InMemoryFileSystem
import class Basics.ObservabilityScope
import struct Basics.RelativePath
import func Basics.temp_await
import struct PackageGraph.PackageGraphRootInput
import struct PackageModel.ProvidedLibrary
import struct SourceControl.Revision
import class TSCBasic.InMemoryFileSystem

extension Workspace {
/// Edit implementation.
Expand Down
1 change: 0 additions & 1 deletion Sources/Workspace/Workspace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import SourceControl

import func TSCBasic.findCycle
import protocol TSCBasic.HashAlgorithm
import class TSCBasic.InMemoryFileSystem
import struct TSCBasic.KeyedPair
import struct TSCBasic.SHA256
import var TSCBasic.stderrStream
Expand Down
2 changes: 1 addition & 1 deletion Sources/_InternalTestSupport/MockPackageGraphs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//

import struct Basics.AbsolutePath
import class Basics.InMemoryFileSystem
import class Basics.ObservabilitySystem
import class Basics.ObservabilityScope

Expand All @@ -24,7 +25,6 @@ import struct PackageModel.ProductDescription
import enum PackageModel.ProductType
import struct PackageModel.TargetDescription
import protocol TSCBasic.FileSystem
import class TSCBasic.InMemoryFileSystem

package typealias MockPackageGraph = (
graph: ModulesGraph,
Expand Down
3 changes: 1 addition & 2 deletions Tests/BasicsTests/Archiver/TarArchiverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -15,7 +15,6 @@ import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
import _InternalTestSupport
import XCTest

import class TSCBasic.InMemoryFileSystem
import struct TSCBasic.FileSystemError

final class TarArchiverTests: XCTestCase {
Expand Down
3 changes: 1 addition & 2 deletions Tests/BasicsTests/Archiver/UniversalArchiverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -15,7 +15,6 @@ import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported
import _InternalTestSupport
import XCTest

import class TSCBasic.InMemoryFileSystem
import struct TSCBasic.FileSystemError

final class UniversalArchiverTests: XCTestCase {
Expand Down
5 changes: 2 additions & 3 deletions Tests/BasicsTests/Archiver/ZipArchiverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2022 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -15,10 +15,9 @@ import _InternalTestSupport
import XCTest
import TSCclibc // for SPM_posix_spawn_file_actions_addchdir_np_supported

import class TSCBasic.InMemoryFileSystem
import struct TSCBasic.FileSystemError

class ZipArchiverTests: XCTestCase {
final class ZipArchiverTests: XCTestCase {
func testZipArchiverSuccess() async throws {
try await testWithTemporaryDirectory { tmpdir in
let archiver = ZipArchiver(fileSystem: localFileSystem)
Expand Down
5 changes: 1 addition & 4 deletions Tests/BasicsTests/FileSystem/FileSystemTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2021 Apple Inc. and the Swift project authors
// Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//


@testable import Basics
import TSCTestSupport
import XCTest

import class TSCBasic.InMemoryFileSystem

final class FileSystemTests: XCTestCase {
func testStripFirstLevelComponent() throws {
let fileSystem = InMemoryFileSystem()
Expand Down
6 changes: 1 addition & 5 deletions Tests/BasicsTests/SandboxTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors
// Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -18,10 +18,6 @@ import XCTest
import Darwin
#endif

import class TSCBasic.InMemoryFileSystem
import class Basics.AsyncProcess
import struct Basics.AsyncProcessResult

final class SandboxTest: XCTestCase {
func testSandboxOnAllPlatforms() throws {
try withTemporaryDirectory { path in
Expand Down
1 change: 0 additions & 1 deletion Tests/BuildTests/BuildOperationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import _InternalTestSupport
import XCTest

import class TSCBasic.BufferedOutputByteStream
import class TSCBasic.InMemoryFileSystem

private func mockBuildOperation(
productsBuildParameters: BuildParameters,
Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/CrossCompilationBuildPlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//

import struct Basics.AbsolutePath
import class Basics.InMemoryFileSystem
import class Basics.ObservabilitySystem
import class Build.BuildPlan
import class Build.ProductBuildDescription
Expand All @@ -35,7 +36,6 @@ import func _InternalTestSupport.trivialPackageGraph
import struct _InternalTestSupport.BuildPlanResult
import func _InternalTestSupport.XCTAssertMatch
import func _InternalTestSupport.XCTAssertNoDiagnostics
import class TSCBasic.InMemoryFileSystem

import XCTest

Expand Down
3 changes: 1 addition & 2 deletions Tests/BuildTests/LLBuildManifestBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2015-2023 Apple Inc. and the Swift project authors
// Copyright (c) 2015-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -23,7 +23,6 @@ import struct SPMBuildCore.BuildParameters
@_spi(SwiftPMInternal)
import _InternalTestSupport

import class TSCBasic.InMemoryFileSystem
import XCTest

final class LLBuildManifestBuilderTests: XCTestCase {
Expand Down
4 changes: 1 addition & 3 deletions Tests/BuildTests/ModuleAliasingBuildTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Copyright (c) 2022-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -24,8 +24,6 @@ import SwiftDriver
import Workspace
import XCTest

import class TSCBasic.InMemoryFileSystem

final class ModuleAliasingBuildTests: XCTestCase {
func testModuleAliasingEmptyAlias() throws {
let fs = InMemoryFileSystem(
Expand Down
4 changes: 2 additions & 2 deletions Tests/BuildTests/ProductBuildDescriptionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2021 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -13,8 +13,8 @@
@testable
import Build

import class Basics.InMemoryFileSystem
import class Basics.ObservabilitySystem
import class TSCBasic.InMemoryFileSystem

import class PackageModel.Manifest
import struct PackageModel.TargetDescription
Expand Down
2 changes: 1 addition & 1 deletion Tests/CommandsTests/MermaidPackageSerializerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===//

import class Basics.InMemoryFileSystem
import class Basics.ObservabilitySystem

@_spi(DontAdoptOutsideOfSwiftPMExposedForBenchmarksAndTestsOnly)
Expand All @@ -18,7 +19,6 @@ import func PackageGraph.loadModulesGraph
import class PackageModel.Manifest
import struct PackageModel.ProductDescription
import struct PackageModel.TargetDescription
import class TSCBasic.InMemoryFileSystem
import func _InternalTestSupport.XCTAssertNoDiagnostics

@testable
Expand Down
5 changes: 1 addition & 4 deletions Tests/CommandsTests/MultiRootSupportTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2019 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -16,10 +16,7 @@ import _InternalTestSupport
import Workspace
import XCTest

import class TSCBasic.InMemoryFileSystem

final class MultiRootSupportTests: CommandsTestCase {

func testWorkspaceLoader() throws {
let fs = InMemoryFileSystem(emptyFiles: [
"/tmp/test/dep/Package.swift",
Expand Down
1 change: 0 additions & 1 deletion Tests/CommandsTests/PackageCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import XCTest

import struct TSCBasic.ByteString
import class TSCBasic.BufferedOutputByteStream
import class TSCBasic.InMemoryFileSystem
import enum TSCBasic.JSON
import class Basics.AsyncProcess

Expand Down
2 changes: 1 addition & 1 deletion Tests/FunctionalTests/ModuleMapTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2017 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand Down
5 changes: 2 additions & 3 deletions Tests/LLBuildManifestTests/LLBuildManifestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -11,13 +11,12 @@
//===----------------------------------------------------------------------===//

import struct Basics.AbsolutePath
import class Basics.InMemoryFileSystem
import class Foundation.PropertyListDecoder
@testable import LLBuildManifest
import _InternalTestSupport
import class TSCBasic.InMemoryFileSystem
import XCTest


private let testEntitlement = "test-entitlement"

final class LLBuildManifestTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Copyright (c) 2020-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
Expand All @@ -15,8 +15,6 @@ import Basics
import _InternalTestSupport
import XCTest

import class TSCBasic.InMemoryFileSystem

final class PackageCollectionsSourcesStorageTest: XCTestCase {
func testHappyCase() async throws {
let mockFileSystem = InMemoryFileSystem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Copyright (c) 2022-2024 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import class Basics.InMemoryFileSystem
import PackageCollections
import XCTest

import class TSCBasic.InMemoryFileSystem

class PackageIndexConfigurationTests: XCTestCase {
final class PackageIndexConfigurationTests: XCTestCase {
func testSaveAndLoad() throws {
let url = URL("https://package-index.test")
let configuration = PackageIndexConfiguration(url: url)
Expand Down
Loading