Skip to content

Commit 4986e11

Browse files
authored
Merge pull request swiftlang#592 from swiftlang/owenv/cache-availability-cleanup
Cleanup compilation caching feature availability flags
2 parents f3098de + a4b0186 commit 4986e11

File tree

15 files changed

+7
-45
lines changed

15 files changed

+7
-45
lines changed

Sources/SWBCore/Extensions/FeatureAvailabilityExtension.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ public struct FeatureAvailabilityExtensionPoint: ExtensionPoint {
2121
}
2222

2323
public protocol FeatureAvailabilityExtension: Sendable {
24-
var supportsCompilationCaching: Bool { get }
2524
}

Sources/SWBCore/Settings/Settings.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -764,15 +764,6 @@ public final class Settings: PlatformBuildContext, Sendable {
764764
(scope.evaluate(BuiltinMacros.IS_ZIPPERED) && scope.evaluate(BuiltinMacros.INDEX_ENABLE_BUILD_ARENA))
765765
}
766766

767-
public static func supportsCompilationCaching(_ core: Core) -> Bool {
768-
@preconcurrency @PluginExtensionSystemActor func featureAvailabilityExtensions() -> [any FeatureAvailabilityExtensionPoint.ExtensionProtocol] {
769-
core.pluginManager.extensions(of: FeatureAvailabilityExtensionPoint.self)
770-
}
771-
return featureAvailabilityExtensions().contains {
772-
$0.supportsCompilationCaching
773-
}
774-
}
775-
776767
public var enableTargetPlatformSpecialization: Bool {
777768
return Settings.targetPlatformSpecializationEnabled(scope: globalScope)
778769
}

Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,6 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
824824
language: GCCCompatibleLanguageDialect,
825825
clangInfo: DiscoveredClangToolSpecInfo?
826826
) -> Bool {
827-
guard cbc.producer.supportsCompilationCaching else { return false }
828-
829827
// Disabling compilation caching for index build, for now.
830828
guard !cbc.scope.evaluate(BuiltinMacros.INDEX_ENABLE_BUILD_ARENA) else {
831829
return false

Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,8 +1414,6 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi
14141414
}
14151415

14161416
private func swiftCachingEnabled(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate, _ moduleName: String, _ useIntegratedDriver: Bool, _ explicitModuleBuildEnabled: Bool, _ disabledPCHCompile: Bool) async -> Bool {
1417-
guard cbc.producer.supportsCompilationCaching else { return false }
1418-
14191417
guard cbc.scope.evaluate(BuiltinMacros.SWIFT_ENABLE_COMPILE_CACHE) else {
14201418
return false
14211419
}

Sources/SWBCore/TaskGeneration.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,6 @@ public protocol CommandProducer: PlatformBuildContext, SpecLookupContext, Refere
264264

265265
var targetShouldBuildModuleForInstallAPI: Bool { get }
266266

267-
var supportsCompilationCaching: Bool { get }
268-
269267
func lookupLibclang(path: Path) -> (libclang: Libclang?, version: Version?)
270268

271269
var userPreferences: UserPreferences { get }

Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,10 +1390,6 @@ extension TaskProducerContext: CommandProducer {
13901390
return globalProductPlan.targetsWhichShouldBuildModulesDuringInstallAPI?.contains(configuredTarget) ?? false
13911391
}
13921392

1393-
public var supportsCompilationCaching: Bool {
1394-
return Settings.supportsCompilationCaching(workspaceContext.core)
1395-
}
1396-
13971393
public var systemInfo: SystemInfo? {
13981394
return workspaceContext.systemInfo
13991395
}

Sources/SWBTaskExecution/BuildDescriptionManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ package final class BuildDescriptionManager: Sendable {
183183

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

188188
// Add the SFR identifier for target-independent tasks.
189189
staleFileRemovalIdentifierPerTarget[nil] = plan.staleFileRemovalTaskIdentifier(for: nil)

Sources/SWBTestSupport/CoreBasedTests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,6 @@ extension CoreBasedTests {
243243
}
244244
}
245245

246-
/// If compilation caching is supported.
247-
package var supportsCompilationCaching: Bool {
248-
get async throws {
249-
let core = try await getCore()
250-
return Settings.supportsCompilationCaching(core)
251-
}
252-
}
253-
254246
package var supportsSDKImports: Bool {
255247
get async throws {
256248
#if os(macOS)

Sources/SWBTestSupport/DummyCommandProducer.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ package struct MockCommandProducer: CommandProducer, Sendable {
229229
false
230230
}
231231

232-
package var supportsCompilationCaching: Bool {
233-
false
234-
}
235-
236232
package var systemInfo: SystemInfo? {
237233
return nil
238234
}

Sources/SWBTestSupport/SkippedTestSupport.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,6 @@ extension Trait where Self == Testing.ConditionTrait {
367367
}
368368
}
369369

370-
package static var requireCompilationCaching: Self {
371-
enabled("compilation caching is not supported") {
372-
try await ConditionTraitContext.shared.supportsCompilationCaching
373-
}
374-
}
375-
376370
package static var requireDependencyScannerPlusCaching: Self {
377371
disabled {
378372
let libclang = try #require(try await ConditionTraitContext.shared.libclang)
@@ -397,7 +391,7 @@ extension Trait where Self == Testing.ConditionTrait {
397391

398392
package static var requireCASValidation: Self {
399393
enabled {
400-
guard try await ConditionTraitContext.shared.supportsCompilationCaching, UserDefaults.enableCASValidation else {
394+
guard UserDefaults.enableCASValidation else {
401395
return false
402396
}
403397
guard let path = try? await ConditionTraitContext.shared.llvmCasToolPath else {

0 commit comments

Comments
 (0)