Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ public struct FeatureAvailabilityExtensionPoint: ExtensionPoint {
}

public protocol FeatureAvailabilityExtension: Sendable {
var supportsCompilationCaching: Bool { get }
}
9 changes: 0 additions & 9 deletions Sources/SWBCore/Settings/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -764,15 +764,6 @@ public final class Settings: PlatformBuildContext, Sendable {
(scope.evaluate(BuiltinMacros.IS_ZIPPERED) && scope.evaluate(BuiltinMacros.INDEX_ENABLE_BUILD_ARENA))
}

public static func supportsCompilationCaching(_ core: Core) -> Bool {
@preconcurrency @PluginExtensionSystemActor func featureAvailabilityExtensions() -> [any FeatureAvailabilityExtensionPoint.ExtensionProtocol] {
core.pluginManager.extensions(of: FeatureAvailabilityExtensionPoint.self)
}
return featureAvailabilityExtensions().contains {
$0.supportsCompilationCaching
}
}

public var enableTargetPlatformSpecialization: Bool {
return Settings.targetPlatformSpecializationEnabled(scope: globalScope)
}
Expand Down
2 changes: 0 additions & 2 deletions Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,6 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
language: GCCCompatibleLanguageDialect,
clangInfo: DiscoveredClangToolSpecInfo?
) -> Bool {
guard cbc.producer.supportsCompilationCaching else { return false }

// Disabling compilation caching for index build, for now.
guard !cbc.scope.evaluate(BuiltinMacros.INDEX_ENABLE_BUILD_ARENA) else {
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1414,8 +1414,6 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
}

private func swiftCachingEnabled(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate, _ moduleName: String, _ useIntegratedDriver: Bool, _ explicitModuleBuildEnabled: Bool, _ disabledPCHCompile: Bool) async -> Bool {
guard cbc.producer.supportsCompilationCaching else { return false }

guard cbc.scope.evaluate(BuiltinMacros.SWIFT_ENABLE_COMPILE_CACHE) else {
return false
}
Expand Down
2 changes: 0 additions & 2 deletions Sources/SWBCore/TaskGeneration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ public protocol CommandProducer: PlatformBuildContext, SpecLookupContext, Refere

var targetShouldBuildModuleForInstallAPI: Bool { get }

var supportsCompilationCaching: Bool { get }

func lookupLibclang(path: Path) -> (libclang: Libclang?, version: Version?)

var userPreferences: UserPreferences { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1390,10 +1390,6 @@ extension TaskProducerContext: CommandProducer {
return globalProductPlan.targetsWhichShouldBuildModulesDuringInstallAPI?.contains(configuredTarget) ?? false
}

public var supportsCompilationCaching: Bool {
return Settings.supportsCompilationCaching(workspaceContext.core)
}

public var systemInfo: SystemInfo? {
return workspaceContext.systemInfo
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBTaskExecution/BuildDescriptionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ package final class BuildDescriptionManager: Sendable {

var casValidationInfos: OrderedSet<BuildDescription.CASValidationInfo> = []
let buildGraph = planRequest.buildGraph
let shouldValidateCAS = Settings.supportsCompilationCaching(plan.workspaceContext.core) && UserDefaults.enableCASValidation
let shouldValidateCAS = UserDefaults.enableCASValidation

// Add the SFR identifier for target-independent tasks.
staleFileRemovalIdentifierPerTarget[nil] = plan.staleFileRemovalTaskIdentifier(for: nil)
Expand Down
8 changes: 0 additions & 8 deletions Sources/SWBTestSupport/CoreBasedTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,6 @@ extension CoreBasedTests {
}
}

/// If compilation caching is supported.
package var supportsCompilationCaching: Bool {
get async throws {
let core = try await getCore()
return Settings.supportsCompilationCaching(core)
}
}

package var supportsSDKImports: Bool {
get async throws {
#if os(macOS)
Expand Down
4 changes: 0 additions & 4 deletions Sources/SWBTestSupport/DummyCommandProducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,6 @@ package struct MockCommandProducer: CommandProducer, Sendable {
false
}

package var supportsCompilationCaching: Bool {
false
}

package var systemInfo: SystemInfo? {
return nil
}
Expand Down
8 changes: 1 addition & 7 deletions Sources/SWBTestSupport/SkippedTestSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,6 @@ extension Trait where Self == Testing.ConditionTrait {
}
}

package static var requireCompilationCaching: Self {
enabled("compilation caching is not supported") {
try await ConditionTraitContext.shared.supportsCompilationCaching
}
}

package static var requireDependencyScannerPlusCaching: Self {
disabled {
let libclang = try #require(try await ConditionTraitContext.shared.libclang)
Expand All @@ -397,7 +391,7 @@ extension Trait where Self == Testing.ConditionTrait {

package static var requireCASValidation: Self {
enabled {
guard try await ConditionTraitContext.shared.supportsCompilationCaching, UserDefaults.enableCASValidation else {
guard UserDefaults.enableCASValidation else {
return false
}
guard let path = try? await ConditionTraitContext.shared.llvmCasToolPath else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SWBTestSupport
import SWBUtil

@Suite(.skipHostOS(.windows, "Windows platform has no CAS support yet"),
.requireCompilationCaching, .requireDependencyScannerPlusCaching,
.requireDependencyScannerPlusCaching,
.flaky("A handful of Swift Build CAS tests fail when running the entire test suite"), .bug("rdar://146781403"))
fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
let canUseCASPlugin: Bool
Expand Down
2 changes: 1 addition & 1 deletion Tests/SWBBuildSystemTests/ClangModuleVerifierTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ fileprivate struct ClangModuleVerifierTests: CoreBasedTests {
}
}

@Test(.requireSDKs(.macOS), .requireClangFeatures(.wSystemHeadersInModule), .requireDependencyScannerPlusCaching, .requireCompilationCaching,
@Test(.requireSDKs(.macOS), .requireClangFeatures(.wSystemHeadersInModule), .requireDependencyScannerPlusCaching,
.flaky("A handful of Swift Build CAS tests fail when running the entire test suite"), .bug("rdar://146781403"))
func cachedBuild() async throws {
try await withTemporaryDirectory { (tmpDirPath: Path) in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SWBUtil
import SWBTaskExecution
import SWBProtocol

@Suite(.requireSwiftFeatures(.compilationCaching), .requireCompilationCaching,
@Suite(.requireSwiftFeatures(.compilationCaching),
.flaky("A handful of Swift Build CAS tests fail when running the entire test suite"), .bug("rdar://146781403"))
fileprivate struct SwiftCompilationCachingTests: CoreBasedTests {
@Test(.requireSDKs(.iOS))
Expand Down
2 changes: 1 addition & 1 deletion Tests/SWBBuildSystemTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5146,7 +5146,7 @@ fileprivate struct SwiftDriverTests: CoreBasedTests {
}
}

@Test(.requireSDKs(.macOS))
@Test(.requireSDKs(.macOS), .requireSwiftFeatures(.compilationCaching), .skipSwiftPackage)
func ensureIdenticalCommandLinesWithDifferentDependenciesAreNotDeduplicated() async throws {
try await withTemporaryDirectory { tmpDir in
let testWorkspace = try await TestWorkspace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SWBCore

@Suite
fileprivate struct CompilationCachingTaskConstructionTests: CoreBasedTests {
@Test(.requireSDKs(.macOS, comment: "Caching requires explicit modules, which requires libclang and is only available on macOS"), .requireCompilationCaching)
@Test(.requireSDKs(.macOS, comment: "Caching requires explicit modules, which requires libclang and is only available on macOS"))
func settingRemoteCacheSupportedLanguages() async throws {
let testProject = try await TestProject(
"aProject",
Expand Down
Loading