Skip to content
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

Remove TSCBasic.InMemoryFileSystem dependency #7484

Draft
wants to merge 1 commit into
base: maxd/test-toolchain-argument
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Sources/Basics/SQLiteBackedCache.swift
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
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
3 changes: 1 addition & 2 deletions Sources/SPMTestSupport/InMemoryGitRepository.swift
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 All @@ -18,7 +18,6 @@ import SourceControl
import struct TSCBasic.ByteString
import enum TSCBasic.FileMode
import struct TSCBasic.FileSystemError
import class TSCBasic.InMemoryFileSystem

/// The error encountered during in memory git repository operations.
package enum InMemoryGitRepositoryError: Swift.Error {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SPMTestSupport/MockPackageGraphs.swift
Expand Up @@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//

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

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

package typealias MockPackageGraph = (
graph: ModulesGraph,
Expand Down
4 changes: 1 addition & 3 deletions Sources/SPMTestSupport/MockWorkspace.swift
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 @@ -19,8 +19,6 @@ import SourceControl
import Workspace
import XCTest

import class TSCBasic.InMemoryFileSystem

import struct TSCUtility.Version

package final class MockWorkspace {
Expand Down
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
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.LibraryMetadata
import struct SourceControl.Revision
import class TSCBasic.InMemoryFileSystem

extension Workspace {
/// Edit implementation.
Expand Down
1 change: 0 additions & 1 deletion Sources/Workspace/Workspace.swift
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
3 changes: 1 addition & 2 deletions Tests/BasicsTests/Archiver/TarArchiverTests.swift
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 SPMTestSupport
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
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 SPMTestSupport
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
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 SPMTestSupport
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
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
3 changes: 1 addition & 2 deletions Tests/BasicsTests/SandboxTests.swift
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,7 +18,6 @@ import XCTest
import Darwin
#endif

import class TSCBasic.InMemoryFileSystem
import class TSCBasic.Process
import struct TSCBasic.ProcessResult

Expand Down
1 change: 0 additions & 1 deletion Tests/BuildTests/BuildOperationTests.swift
Expand Up @@ -24,7 +24,6 @@ import SPMBuildCore
import XCTest

import class TSCBasic.BufferedOutputByteStream
import class TSCBasic.InMemoryFileSystem

final class BuildOperationTests: XCTestCase {
func testDetectUnexpressedDependencies() throws {
Expand Down
1 change: 0 additions & 1 deletion Tests/BuildTests/BuildPlanTests.swift
Expand Up @@ -28,7 +28,6 @@ import Workspace
import XCTest

import struct TSCBasic.ByteString
import class TSCBasic.InMemoryFileSystem

import enum TSCUtility.Diagnostics

Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/CrossCompilationBuildPlanTests.swift
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 @@ -31,7 +32,6 @@ import func SPMTestSupport.trivialPackageGraph
import struct SPMTestSupport.BuildPlanResult
import func SPMTestSupport.XCTAssertMatch
import func SPMTestSupport.XCTAssertNoDiagnostics
import class TSCBasic.InMemoryFileSystem

import XCTest

Expand Down
3 changes: 1 addition & 2 deletions Tests/BuildTests/LLBuildManifestBuilderTests.swift
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 @@ -22,7 +22,6 @@ import struct SPMBuildCore.BuildParameters

import SPMTestSupport

import class TSCBasic.InMemoryFileSystem
import XCTest

final class LLBuildManifestBuilderTests: XCTestCase {
Expand Down
4 changes: 1 addition & 3 deletions Tests/BuildTests/ModuleAliasingBuildTests.swift
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
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
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 SPMTestSupport.XCTAssertNoDiagnostics

@testable
Expand Down
5 changes: 1 addition & 4 deletions Tests/CommandsTests/MultiRootSupportTests.swift
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 SPMTestSupport
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
3 changes: 1 addition & 2 deletions Tests/CommandsTests/PackageCommandTests.swift
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 Down Expand Up @@ -32,7 +32,6 @@ import XCTest

import struct TSCBasic.ByteString
import class TSCBasic.BufferedOutputByteStream
import class TSCBasic.InMemoryFileSystem
import enum TSCBasic.JSON
import class TSCBasic.Process

Expand Down
5 changes: 2 additions & 3 deletions Tests/LLBuildManifestTests/LLBuildManifestTests.swift
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 SPMTestSupport
import class TSCBasic.InMemoryFileSystem
import XCTest


private let testEntitlement = "test-entitlement"

final class LLBuildManifestTests: XCTestCase {
Expand Down