diff --git a/CMakeLists.txt b/CMakeLists.txt index ce85223a..00f40cf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ add_compile_options("$<$:SHELL:-package-name SwiftBuild> "$<$:SHELL:-enable-upcoming-feature ExistentialAny>" "$<$:SHELL:-enable-upcoming-feature InternalImportsByDefault>") -# Prefer the static initialisation for the pluigns. +# Prefer the static initialization for the plugins. add_compile_definitions(USE_STATIC_PLUGIN_INITIALIZATION) find_package(ArgumentParser) diff --git a/Sources/SWBApplePlatform/Specs/RealityAssetsCompilerSpec.swift b/Sources/SWBApplePlatform/Specs/RealityAssetsCompilerSpec.swift index 7b400892..54bdd6ad 100644 --- a/Sources/SWBApplePlatform/Specs/RealityAssetsCompilerSpec.swift +++ b/Sources/SWBApplePlatform/Specs/RealityAssetsCompilerSpec.swift @@ -47,7 +47,7 @@ package final class RealityAssetsCompilerSpec: GenericCompilerSpec, SpecIdentifi private func environmentBindings(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate) -> EnvironmentBindings { var environmentBindings: [(String, String)] = environmentFromSpec(cbc, delegate) - // this is required to pass the funtional/integration tests in sandbox mode + // this is required to pass the functional/integration tests in sandbox mode // because LLVM seems to create default.profraw files in the test directories environmentBindings.append(("LLVM_PROFILE_FILE", Path.null.str)) @@ -168,7 +168,7 @@ package final class RealityAssetsCompilerSpec: GenericCompilerSpec, SpecIdentifi var inputs = [delegate.createDirectoryTreeNode(rkAssetsPath) as (any PlannedNode)] let outputs = [delegate.createNode(cbc.output) as (any PlannedNode)] - // need to add in o ptional --schema-file + // need to add in optional --schema-file if let usdaSchemaPath { commandLine.append("--schema-file") commandLine.append(.path(usdaSchemaPath)) @@ -215,12 +215,12 @@ package final class RealityAssetsCompilerSpec: GenericCompilerSpec, SpecIdentifi } public func constructTasks(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate, moduleWithDependencies: ModuleWithDependencies) async { - // Construct the realitool 'create-schema' preprocess swift -> schema .usda task. + // Construct the realitytool 'create-schema' preprocess swift -> schema .usda task. await constructRealityAssetsCreateSchemaTasks(cbc, delegate, moduleWithDependencies: moduleWithDependencies) } public override func constructTasks(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate) async { - // Construct the realitool 'compile' .rkassets [schema .usda] -> .reality task. + // Construct the realitytool 'compile' .rkassets [schema .usda] -> .reality task. await constructRealityAssetCompilerTasks(cbc, delegate) } } diff --git a/Sources/SWBBuildSystem/DependencyCycleFormatter.swift b/Sources/SWBBuildSystem/DependencyCycleFormatter.swift index 434b8d93..bdbe027d 100644 --- a/Sources/SWBBuildSystem/DependencyCycleFormatter.swift +++ b/Sources/SWBBuildSystem/DependencyCycleFormatter.swift @@ -502,8 +502,8 @@ struct DependencyCycleFormatter { suffix = " because the scheme has implicit dependencies enabled and the Target '\(lastTargetsName)' references the file '\(filename)' in the build phase '\(buildPhase)'" case let .implicitBuildSettingLinkage(settingName, options)?: suffix = " because the scheme has implicit dependencies enabled and the Target '\(lastTargetsName)' defines the options '\(options.joined(separator: " "))' in the build setting '\(settingName)'" - case let .impliedByTransitiveDependencyViaRemovedTargets(intermediateTargetName: intermdiateTargetName): - suffix = " via its transitive dependency through '\(intermdiateTargetName)'" + case let .impliedByTransitiveDependencyViaRemovedTargets(intermediateTargetName: intermediateTargetName): + suffix = " via its transitive dependency through '\(intermediateTargetName)'" case nil: if !buildDescription.targetsBuildInParallel { suffix = " due to target order in a “Target Dependencies” build phase" + (buildRequest.schemeCommand != nil ? " or the scheme" : "") diff --git a/Sources/SWBCore/BuildFileResolution.swift b/Sources/SWBCore/BuildFileResolution.swift index 98df3b52..29d99478 100644 --- a/Sources/SWBCore/BuildFileResolution.swift +++ b/Sources/SWBCore/BuildFileResolution.swift @@ -46,7 +46,7 @@ extension BuildFileResolution { } else { // FIXME: A more reliable fallback might be to use GlobalProductPlan.productPathsToProducingTargets (where GlobalProductPlan conforms to TargetInfoProvider) if the absolute path of the product reference in this context were passed in. // If the reference is a product reference, then we want to use the settings for the configured target which produced it in this build, as it may have been built for a different platform and so we need to look up its information in the context of that platform. - // FIXME: This is potentially janky since there's no inherent guarantee that this configured target exists in the build graph, but I think in practice it should work? + // FIXME: This is potentially unsound since there's no inherent guarantee that this configured target exists in the build graph, but I think in practice it should work? let potentialSettings = globalTargetInfoProvider.getTargetSettings(ConfiguredTarget(parameters: parameters, target: productRefTarget)) // If the `productRefTarget` needs specialization, we need to override `SDKROOT`. // FIXME: Ideally, we would be in a position where we can just use the right configured target here. diff --git a/Sources/SWBCore/BuildRequestContext.swift b/Sources/SWBCore/BuildRequestContext.swift index 4e1993bf..208e3567 100644 --- a/Sources/SWBCore/BuildRequestContext.swift +++ b/Sources/SWBCore/BuildRequestContext.swift @@ -149,7 +149,7 @@ extension BuildRequestContext { let currentPlatformFilter = PlatformFilter(settings.globalScope) - // FIXME: It is a bit unfortunate that we need to compute all this for the `uniquingSuffix` behaviour. + // FIXME: It is a bit unfortunate that we need to compute all this for the `uniquingSuffix` behavior. var sourceCodeFileToBuildableReference = [Path:Reference]() if let target = target.target as? StandardTarget { if let buildableReferences = try! target.sourcesBuildPhase?.buildFiles.compactMap({ (buildFile) -> Reference? in diff --git a/Sources/SWBCore/BuildRuleCondition.swift b/Sources/SWBCore/BuildRuleCondition.swift index 014ce6d3..14440810 100644 --- a/Sources/SWBCore/BuildRuleCondition.swift +++ b/Sources/SWBCore/BuildRuleCondition.swift @@ -98,9 +98,9 @@ public final class BuildRuleFileNameCondition: BuildRuleCondition { /// Evaluates the condition against the candidate, returning a `.normal` match priority level if its file name matches any of the patterns, or `.none` if there is no match. public func match(_ candidate: FileToBuild, _ scope: MacroEvaluationScope) -> BuildRuleConditionMatchPriority { for namePattern in namePatterns { - let evalutedNamePattern = scope.evaluate(namePattern) + let evaluatedNamePattern = scope.evaluate(namePattern) do { - if try fnmatch(pattern: evalutedNamePattern, input: candidate.absolutePath.str) { + if try fnmatch(pattern: evaluatedNamePattern, input: candidate.absolutePath.str) { return .normal } } catch { diff --git a/Sources/SWBCore/DependencyResolution.swift b/Sources/SWBCore/DependencyResolution.swift index 84534387..9c3981d7 100644 --- a/Sources/SWBCore/DependencyResolution.swift +++ b/Sources/SWBCore/DependencyResolution.swift @@ -253,7 +253,7 @@ struct SpecializationParameters: Hashable, CustomStringConvertible { else { overridingSdk = nil } - // This seems like an unfortunate way to get from the SDK to its platform. But SettingsBuilder.computeBoundProperties() creates a scope to evalulate the PLATFORM_NAME defined in the SDK's default properties, so maybe there isn't a clearly better way. + // This seems like an unfortunate way to get from the SDK to its platform. But SettingsBuilder.computeBoundProperties() creates a scope to evaluate the PLATFORM_NAME defined in the SDK's default properties, so maybe there isn't a clearly better way. if let overridingSdk, let overridingPlatform = workspaceContext.core.platformRegistry.platforms.filter({ $0.sdks.contains(where: { $0.canonicalName == overridingSdk.canonicalName }) }).first { platformName = overridingPlatform.name } else { @@ -274,7 +274,7 @@ struct SpecializationParameters: Hashable, CustomStringConvertible { if let suffix = try? workspaceContext.sdkRegistry.lookup(sdk, activeRunDestination: parameters.activeRunDestination)?.canonicalNameSuffix, !suffix.isEmpty { sdkSuffix = suffix } else { - // Treat a run destination that uses the public SDK as one that does not express an opinion about internalness instead of one that *requires* the public SDK. + // Treat a run destination that uses the public SDK as one that does not express an opinion about internal-ness instead of one that *requires* the public SDK. sdkSuffix = nil } } else { @@ -739,19 +739,19 @@ extension SpecializationParameters { let shouldImposePlatform = settings.enableTargetPlatformSpecialization var imposedSupportedPlatforms: [String]? - let specializatonIsSupported: Bool + let specializationIsSupported: Bool if let specializedSupportedPlatforms = specialization.supportedPlatforms { // If `SDKROOT` is automatic, specialize supported platforms, but only if there is a non-empty intersection with the current value. - specializatonIsSupported = !Set(supportedPlatforms).intersection(specializedSupportedPlatforms).isEmpty - imposedSupportedPlatforms = specializatonIsSupported && shouldImposePlatform ? specialization.supportedPlatforms : nil + specializationIsSupported = !Set(supportedPlatforms).intersection(specializedSupportedPlatforms).isEmpty + imposedSupportedPlatforms = specializationIsSupported && shouldImposePlatform ? specialization.supportedPlatforms : nil } else { imposedSupportedPlatforms = nil - specializatonIsSupported = false + specializationIsSupported = false } let imposedPlatform: Platform? if shouldImposePlatform { - if specializatonIsSupported { + if specializationIsSupported { imposedPlatform = specialization.platform } else { // There may be an existing `SUPPORTED_PLATFORMS` override in the parameters passed down by the client, so we want to make sure to provide our own, even if it might not be strictly necessary. @@ -798,7 +798,7 @@ extension SpecializationParameters { // iOS targets get SUPPORTS_MACCATALYST by default, but SDKROOT=auto targets get an inconsistent view. let isHostTool = settings.productType?.conformsTo(identifier: "com.apple.product-type.tool.host-build") == true - if specializatonIsSupported && !isHostTool { + if specializationIsSupported && !isHostTool { imposedSdkVariant = specialization.sdkVariant ?? imposedPlatform?.defaultSDKVariant } else { imposedSdkVariant = imposedPlatform?.defaultSDKVariant @@ -814,7 +814,7 @@ extension SpecializationParameters { let initialFilteredSpecialization = SpecializationParameters(source: .synthesized, platform: imposedPlatform, sdkVariant: imposedSdkVariant, supportedPlatforms: imposedSupportedPlatforms, toolchain: nil, canonicalNameSuffix: nil) let initialSettings = buildRequestContext.getCachedSettings(initialFilteredSpecialization.imposed(on: parameters, workspaceContext: workspaceContext), target: forTarget) let specializationSDKOptions = initialSettings.globalScope.evaluate(BuiltinMacros.SPECIALIZATION_SDK_OPTIONS) - if specializatonIsSupported { + if specializationIsSupported { // If specialization explicitly requires public, but the target itself requires internal, emit an error. if let sdkSuffixFromSpecialization = specialization.canonicalNameSuffix, sdkSuffixFromSpecialization.isEmpty, !specializationSDKOptions.isEmpty { let specializationSuffix: String @@ -869,7 +869,7 @@ extension SpecializationParameters { // If we are imposing a platform, we also need to impose the toolchain, but skip it if the explicit setting already matches what we would impose. let imposedToolchain: [String]? - if shouldImposePlatform && specializatonIsSupported { + if shouldImposePlatform && specializationIsSupported { let specializationWithoutToolchainImposition = SpecializationParameters(source: .synthesized, platform: imposedPlatform, sdkVariant: imposedSdkVariant, supportedPlatforms: imposedSupportedPlatforms, toolchain: nil, canonicalNameSuffix: imposedCanonicalNameSuffix) let settingsWithToolchainImposition = buildRequestContext.getCachedSettings(specializationWithoutToolchainImposition.imposed(on: parameters, workspaceContext: workspaceContext), target: forTarget) let configuredToolchains = settingsWithToolchainImposition.toolchains.map({ $0.identifier }) diff --git a/Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift b/Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift index c76e85c6..196b7d51 100644 --- a/Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift +++ b/Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift @@ -47,7 +47,7 @@ public protocol SwiftGlobalExplicitDependencyGraph : AnyObject { } /// Keeps track of all of the explicit module dependency build jobs as depended on by individual target builds -private struct GlobalExplicitDepependencyTracker { +private struct GlobalExplicitDependencyTracker { /// Maps a SwiftDriverJob's UniqueID to its index in this store private var uniqueIndexMap: [Int: Int] = [:] @@ -120,7 +120,7 @@ public final class SwiftModuleDependencyGraph: SwiftGlobalExplicitDependencyGrap private let registryQueue = SWBQueue(label: "SwiftModuleDependencyGraph", autoreleaseFrequency: .workItem) private var registry: [String: LibSwiftDriver] = [:] - private var globalExplicitDepependencyTracker = GlobalExplicitDepependencyTracker() + private var globalExplicitDependencyTracker = GlobalExplicitDependencyTracker() public init() {} @@ -199,35 +199,35 @@ public final class SwiftModuleDependencyGraph: SwiftGlobalExplicitDependencyGrap public func addExplicitDependencyBuildJobs(_ jobs: [SwiftDriverJob], workingDirectory: Path, producerMap: inout [Path: LibSwiftDriver.JobKey]) throws -> Set { try registryQueue.blocking_sync { - try globalExplicitDepependencyTracker.addExplicitDependencyBuildJobs(jobs, workingDirectory: workingDirectory, producerMap: &producerMap) + try globalExplicitDependencyTracker.addExplicitDependencyBuildJobs(jobs, workingDirectory: workingDirectory, producerMap: &producerMap) } } public func getExplicitDependencyBuildJobs(for keys: [LibSwiftDriver.JobKey]) -> [LibSwiftDriver.PlannedBuild.PlannedSwiftDriverJob] { registryQueue.blocking_sync { - globalExplicitDepependencyTracker.getExplicitDependencyBuildJobs(for: keys) + globalExplicitDependencyTracker.getExplicitDependencyBuildJobs(for: keys) } } public func plannedExplicitDependencyBuildJob(for key: LibSwiftDriver.JobKey) -> LibSwiftDriver.PlannedBuild.PlannedSwiftDriverJob? { registryQueue.blocking_sync { - globalExplicitDepependencyTracker.plannedExplicitDependencyBuildJob(for: key) + globalExplicitDependencyTracker.plannedExplicitDependencyBuildJob(for: key) } } public func explicitDependencies(for job: LibSwiftDriver.PlannedBuild.PlannedSwiftDriverJob) -> [LibSwiftDriver.PlannedBuild.PlannedSwiftDriverJob] { registryQueue.blocking_sync { - globalExplicitDepependencyTracker.explicitDependencies(for: job) + globalExplicitDependencyTracker.explicitDependencies(for: job) } } public var isEmpty: Bool { registryQueue.blocking_sync { - globalExplicitDepependencyTracker.plannedExplicitDependencyJobs.isEmpty + globalExplicitDependencyTracker.plannedExplicitDependencyJobs.isEmpty } } public func generatePrecompiledModulesReport(in directory: Path, fs: any FSProxy) async throws -> String { // Collect DependencyInfo of every module built during the current build. var jobsByModuleID: [String: [SwiftDriverJob]] = [:] - for job in globalExplicitDepependencyTracker.plannedExplicitDependencyJobs { + for job in globalExplicitDependencyTracker.plannedExplicitDependencyJobs { let qualifier: String switch job.driverJob.ruleInfoType { case "CompileModuleFromInterface": diff --git a/Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift b/Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift index e3a2718b..8a3af062 100644 --- a/Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift +++ b/Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift @@ -80,7 +80,7 @@ public struct SwiftDriverJob: Serializable, CustomDebugStringConvertible { public let outputs: [Path] /// The command line to execute for this job public let commandLine: [SWBUtil.ByteString] - /// A signature which uniquely idnetifies the job. + /// A signature which uniquely identifies the job. public let signature: SWBUtil.ByteString /// Cache keys for the swift-frontend invocation (one key per output producing input) public let cacheKeys: [String] diff --git a/Sources/SWBCore/MacroConfigFileLoader.swift b/Sources/SWBCore/MacroConfigFileLoader.swift index c2dc91bc..d532f768 100644 --- a/Sources/SWBCore/MacroConfigFileLoader.swift +++ b/Sources/SWBCore/MacroConfigFileLoader.swift @@ -59,7 +59,7 @@ final class MacroConfigFileLoader: Sendable { return loadSettingsFromConfig(data: data, path: path, namespace: namespace, searchPaths: searchPaths, filesSignature: filesSignature) } - /// Stores data about previosuly visited xcconfig files. + /// Stores data about previously visited xcconfig files. fileprivate final class AncestorInclude { let path: Path let fs: any FSProxy diff --git a/Sources/SWBCore/MacroEvaluationExtensions.swift b/Sources/SWBCore/MacroEvaluationExtensions.swift index edfca81b..57fc5441 100644 --- a/Sources/SWBCore/MacroEvaluationExtensions.swift +++ b/Sources/SWBCore/MacroEvaluationExtensions.swift @@ -47,7 +47,7 @@ public extension PropertyListItem let parsedString = scope.table.namespace.parseString(string) let result = scope.evaluate(parsedString, lookup: preservingLookup) if anyReferencesWerePreserved { - // If we preserved any refererences, then we need to convert the '\$\(((' in the result back to '$('. + // If we preserved any references, then we need to convert the '\$\(((' in the result back to '$('. return result.replacingOccurrences(of: "\\$\\(((", with: "$(") } return result diff --git a/Sources/SWBCore/OptimizationRemarks.swift b/Sources/SWBCore/OptimizationRemarks.swift index a42dcf1c..a07b53db 100644 --- a/Sources/SWBCore/OptimizationRemarks.swift +++ b/Sources/SWBCore/OptimizationRemarks.swift @@ -276,7 +276,7 @@ extension Diagnostic { public init?(_ remark: OptimizationRemark, workingDirectory: Path) { guard let debugLoc = remark.debugLoc else { return nil } // skip if no debug location let path = Path(debugLoc.sourceFilePath) - // Paths can be both asbolute and relative to the working directory. + // Paths can be both absolute and relative to the working directory. let absolutePath = path.makeAbsolute(relativeTo: workingDirectory) ?? path self.init(behavior: .remark, location: .path(absolutePath, line: Int(debugLoc.sourceLine), column: Int(debugLoc.sourceColumn)), data: DiagnosticData(remark.message)) } diff --git a/Sources/SWBCore/PlatformFiltering.swift b/Sources/SWBCore/PlatformFiltering.swift index 6aa1df35..d3397bdb 100644 --- a/Sources/SWBCore/PlatformFiltering.swift +++ b/Sources/SWBCore/PlatformFiltering.swift @@ -18,7 +18,7 @@ extension PlatformFilter { let os = (!scope.evaluate(BuiltinMacros.__USE_PLATFORM_NAME_FOR_FILTERS) ? scope.evaluate(BuiltinMacros.SWIFT_PLATFORM_TARGET_PREFIX).nilIfEmpty : nil) ?? platformName // We always want developers to set platform filters for a device platform *and* its simulator counterpart as a *single* inseparable unit. - // To implicitly enforce this behaviour (and avoid the need for Swift Build clients to replicate it individually) for any target platform + // To implicitly enforce this behavior (and avoid the need for Swift Build clients to replicate it individually) for any target platform // whose *environment* is "simulator" we simply omit it, effectively treating the target the same as the corresponding device platform. let targetTripleSuffix = scope.evaluate(BuiltinMacros.LLVM_TARGET_TRIPLE_SUFFIX) let env = targetTripleSuffix == "-simulator" ? "" : targetTripleSuffix diff --git a/Sources/SWBCore/PlatformRegistry.swift b/Sources/SWBCore/PlatformRegistry.swift index 329badb6..3f1346f4 100644 --- a/Sources/SWBCore/PlatformRegistry.swift +++ b/Sources/SWBCore/PlatformRegistry.swift @@ -298,7 +298,7 @@ public final class PlatformRegistry { /// The list of all registered platforms, ordered by identifier. public private(set) var platforms = Array() - /// The map of platforms by identifer. + /// The map of platforms by identifier. @_spi(Testing) public private(set) var platformsByIdentifier = Dictionary() /// The map of platforms by name. diff --git a/Sources/SWBCore/ProjectModel/BuildFile.swift b/Sources/SWBCore/ProjectModel/BuildFile.swift index f3251559..68d3db75 100644 --- a/Sources/SWBCore/ProjectModel/BuildFile.swift +++ b/Sources/SWBCore/ProjectModel/BuildFile.swift @@ -79,7 +79,7 @@ public final class BuildFile: ProjectModelItem { /// Whether to remove header from the file (directory), if copies. public let removeHeadersOnCopy: Bool - /// Whether to weak linkly, for linking build files. + /// Whether to link weakly, for linking build files. public let shouldLinkWeakly: Bool /// On Demand Resources asset tags diff --git a/Sources/SWBCore/ProvisionalTask.swift b/Sources/SWBCore/ProvisionalTask.swift index a4c7d5af..ebef9ed0 100644 --- a/Sources/SWBCore/ProvisionalTask.swift +++ b/Sources/SWBCore/ProvisionalTask.swift @@ -133,7 +133,7 @@ public protocol ProvisionalTaskValidationContext: AnyObject /// A create directory provisional task is used in creating the product structure. public final class CreateDirectoryProvisionalTask: ProvisionalTask { - /// If `true`, then the task for this provisional task will be nullified if there is another task which is producing this directory. If `false`, then the task will never be disacarded for that reason. We might want to nullify if, for example, the project is copying a folder reference into place for this directory. However, if this directory task is going to be mutated - e.g. if it's the top-level product - then we don't want to nullify it, since we presently can't handle mutating an alternate task in this way. + /// If `true`, then the task for this provisional task will be nullified if there is another task which is producing this directory. If `false`, then the task will never be discarded for that reason. We might want to nullify if, for example, the project is copying a folder reference into place for this directory. However, if this directory task is going to be mutated - e.g. if it's the top-level product - then we don't want to nullify it, since we presently can't handle mutating an alternate task in this way. let nullifyIfProducedByAnotherTask: Bool public init(identifier: String, mustBeDependedOn: Bool = true, nullifyIfProducedByAnotherTask: Bool) { diff --git a/Sources/SWBCore/Provisioning.swift b/Sources/SWBCore/Provisioning.swift index 306b03a2..aba0c0c9 100644 --- a/Sources/SWBCore/Provisioning.swift +++ b/Sources/SWBCore/Provisioning.swift @@ -27,7 +27,7 @@ public func wrappedBundleIdentifier(for bundleIdentifier: String) -> String { public func computeBundleIdentifier(from scope: MacroEvaluationScope, bundleIdentifierFromInfoPlist: MacroStringExpression) -> String { let productBundleIdentifier = scope.evaluate(BuiltinMacros.PRODUCT_BUNDLE_IDENTIFIER) if !productBundleIdentifier.isEmpty { - // When a test bundle is being signed **AND** that test bundle is being hosted in a test runner, then the bundle identifier should actualy match the test runner and **not** the test bundle. + // When a test bundle is being signed **AND** that test bundle is being hosted in a test runner, then the bundle identifier should actually match the test runner and **not** the test bundle. if scope.evaluate(BuiltinMacros.USES_XCTRUNNER) { return wrappedBundleIdentifier(for: productBundleIdentifier) } diff --git a/Sources/SWBCore/SDKRegistry.swift b/Sources/SWBCore/SDKRegistry.swift index 45c338aa..af5a8b05 100644 --- a/Sources/SWBCore/SDKRegistry.swift +++ b/Sources/SWBCore/SDKRegistry.swift @@ -1164,7 +1164,7 @@ public final class SDKRegistry: SDKRegistryLookup, CustomStringConvertible, Send } // Iterate through all of the SDKs looking for the best match. - // We sort the values by canoical name in reverse-lexicographic order solely to ensure determinism in any potential weird edge cases someone might accidentally stumble into that we haven't considered. + // We sort the values by canonical name in reverse-lexicographic order solely to ensure determinism in any potential weird edge cases someone might accidentally stumble into that we haven't considered. var matchedSDK: (sdk: SDK, components: SDK.CanonicalNameComponents)? = nil for candidateSDK in sdksByCanonicalName.values.sorted(by: { $0.canonicalName > $1.canonicalName }) { // Get the components for the candidate SDK. diff --git a/Sources/SWBCore/SWBFeatureFlag.swift b/Sources/SWBCore/SWBFeatureFlag.swift index 4d998a2f..a8b979ef 100644 --- a/Sources/SWBCore/SWBFeatureFlag.swift +++ b/Sources/SWBCore/SWBFeatureFlag.swift @@ -137,7 +137,7 @@ public enum SWBFeatureFlag { public static let generatePrecompiledModulesReport = SWBFeatureFlagProperty("GeneratePrecompiledModulesReport", defaultValue: false) - /// Turn on llbuild's ownership analyis. + /// Turn on llbuild's ownership analysis. /// Remove this feature flag after landing rdar://104894978 (Write "perform-ownership-analysis" = "yes" to build manifest by default) public static let performOwnershipAnalysis = SWBFeatureFlagProperty("PerformOwnershipAnalysis", defaultValue: false) diff --git a/Sources/SWBCore/Settings/BuiltinMacros.swift b/Sources/SWBCore/Settings/BuiltinMacros.swift index 94b0812b..fecb289b 100644 --- a/Sources/SWBCore/Settings/BuiltinMacros.swift +++ b/Sources/SWBCore/Settings/BuiltinMacros.swift @@ -2636,7 +2636,7 @@ public enum ModuleVerifierKind: String, Equatable, Hashable, EnumerationMacroTyp case both } -/// Enumeration macro type for the value of the `IFNOPLIST_KEY_LSApplicationCategoryType` build setting. +/// Enumeration macro type for the value of the `INFOPLIST_KEY_LSApplicationCategoryType` build setting. public enum ApplicationCategory: String, Equatable, Hashable, EnumerationMacroType { public static let defaultValue = ApplicationCategory.none diff --git a/Sources/SWBCore/Settings/Settings.swift b/Sources/SWBCore/Settings/Settings.swift index 641265e4..cba18a70 100644 --- a/Sources/SWBCore/Settings/Settings.swift +++ b/Sources/SWBCore/Settings/Settings.swift @@ -558,7 +558,7 @@ final class WorkspaceSettings: Sendable { // Do not add arm64e to ARCHS_STANDARD by default table.push(BuiltinMacros.ENABLE_POINTER_AUTHENTICATION, literal: false) - // Enable additional codesign tracking by default, but opt-out of scripts phases as their outputs are free-form, and thus have the potential to introduce cycles in the build some circumstances. If that does happen, these build settings provide a relief valve while projects authors figure out how to break the cycle they are introducing (or how we break the target dependencies more granualarly). + // Enable additional codesign tracking by default, but opt-out of scripts phases as their outputs are free-form, and thus have the potential to introduce cycles in the build some circumstances. If that does happen, these build settings provide a relief valve while projects authors figure out how to break the cycle they are introducing (or how we break the target dependencies more granularly). table.push(BuiltinMacros.ENABLE_ADDITIONAL_CODESIGN_INPUT_TRACKING, literal: true) table.push(BuiltinMacros.ENABLE_ADDITIONAL_CODESIGN_INPUT_TRACKING_FOR_SCRIPT_OUTPUTS, literal: true) @@ -1682,7 +1682,7 @@ private class SettingsBuilder { sdkroot = createScope(effectiveTargetConfig, sdkToUse: sdk).evaluate(BuiltinMacros.SDKROOT).str // We will replace SDKROOT values of "auto" here if the run destination is compatible. - let usesReplacableAutomaticSDKRoot: Bool + let usesReplaceableAutomaticSDKRoot: Bool if sdkroot == "auto", let activePlatform = parameters.activeRunDestination?.platform { let destinationIsMacCatalyst = parameters.activeRunDestination?.sdkVariant == MacCatalystInfo.sdkVariantName @@ -1691,15 +1691,15 @@ private class SettingsBuilder { let runDestinationIsSupported = supportedPlatforms.contains(activePlatform) let supportsMacCatalyst = Settings.supportsMacCatalyst(scope: scope, core: core) if destinationIsMacCatalyst && supportsMacCatalyst { - usesReplacableAutomaticSDKRoot = true + usesReplaceableAutomaticSDKRoot = true } else { - usesReplacableAutomaticSDKRoot = runDestinationIsSupported + usesReplaceableAutomaticSDKRoot = runDestinationIsSupported } } else { - usesReplacableAutomaticSDKRoot = false + usesReplaceableAutomaticSDKRoot = false } - if usesReplacableAutomaticSDKRoot, let activeSDK = parameters.activeRunDestination?.sdk { + if usesReplaceableAutomaticSDKRoot, let activeSDK = parameters.activeRunDestination?.sdk { sdkroot = activeSDK } @@ -1712,7 +1712,7 @@ private class SettingsBuilder { if let s = sdk { // Evaluate the SDK variant, if there is one. let sdkVariantName: String - if usesReplacableAutomaticSDKRoot, let activeSDKVariant = parameters.activeRunDestination?.sdkVariant { + if usesReplaceableAutomaticSDKRoot, let activeSDKVariant = parameters.activeRunDestination?.sdkVariant { sdkVariantName = activeSDKVariant } else { sdkVariantName = createScope(effectiveTargetConfig, sdkToUse: s).evaluate(BuiltinMacros.SDK_VARIANT) @@ -2031,7 +2031,7 @@ private class SettingsBuilder { var table = MacroValueAssignmentTable(namespace: core.specRegistry.internalMacroNamespace) let scope = createScope(sdkToUse: sdk) - // FIXME: Previously, both of these were handled with dynamic property expressions, so they could be pushed in the same place as Xcode in the tierless model, and as a way to ensure the definition matched the intent. However, we move this until later and then do it in a manner close to what Xcode does, and if it suffices then we may want to stick with it just to avoid the complexity of dynamic expressions (which are tracked by: Add support for "dynamic" macro expressions). + // FIXME: Previously, both of these were handled with dynamic property expressions, so they could be pushed in the same place as Xcode in the tier-less model, and as a way to ensure the definition matched the intent. However, we move this until later and then do it in a manner close to what Xcode does, and if it suffices then we may want to stick with it just to avoid the complexity of dynamic expressions (which are tracked by: Add support for "dynamic" macro expressions). // If there is no INSTALL_PATH, then SKIP_INSTALL is set to YES. if scope.evaluate(BuiltinMacros.INSTALL_PATH).isEmpty { @@ -3546,7 +3546,7 @@ private class SettingsBuilder { // specific DriverKit suffixed SDK to the platform-neutral DriverKit suffixed SDK ("driverkit.foo") // making the concrete SDK resolution ambiguous again. Thus without considering aliases, we could end up // changing the SDKROOT of a target configured with driverkit.macosx.foo back to driverkit.foo, - // and if the run destination were NOT macOS, we could end up changing the platformness of the SDK. + // and if the run destination were NOT macOS, we could end up changing the platform-ness of the SDK. guard newSDKCanonicalName != targetSDK.canonicalName && !targetSDK.aliases.contains(newSDKCanonicalName) else { return } diff --git a/Sources/SWBCore/Specs/CommandLineToolSpec.swift b/Sources/SWBCore/Specs/CommandLineToolSpec.swift index 29cf317f..81be9669 100644 --- a/Sources/SWBCore/Specs/CommandLineToolSpec.swift +++ b/Sources/SWBCore/Specs/CommandLineToolSpec.swift @@ -60,7 +60,7 @@ public extension InputFileGroupingStrategy { } } -/// A grouping strategy that groups all files in a build phase which matchn a given build rule into the same group. For example, all files to be processed by the Swift compiler in a build phase will be passed to a single invocation of the compiler. +/// A grouping strategy that groups all files in a build phase which match a given build rule into the same group. For example, all files to be processed by the Swift compiler in a build phase will be passed to a single invocation of the compiler. @_spi(Testing) public final class AllInputFilesGroupingStrategy : InputFileGroupingStrategy, Encodable { /// Group identifier that’s returned for every path. @@ -1670,7 +1670,7 @@ fileprivate extension Diagnostic.FixIt { public func generateIndexOutputPath(from output: Path, basePath: Path) -> Path? { // We want the paths in the index store to be relocatable. This could be // relative, but use an absolute path instead to ensure no accidental - // absoluting by eg. the compilers. + // conversion to absolute by eg. the compilers. if let relative = output.relativeSubpath(from: basePath) { if let newPath = Path(relative).makeAbsolute(relativeTo: Path(Path.pathSeparatorString)) { return newPath diff --git a/Sources/SWBCore/Specs/LinkerSpec.swift b/Sources/SWBCore/Specs/LinkerSpec.swift index bed2fcc1..df135901 100644 --- a/Sources/SWBCore/Specs/LinkerSpec.swift +++ b/Sources/SWBCore/Specs/LinkerSpec.swift @@ -56,7 +56,7 @@ open class LinkerSpec : CommandLineToolSpec, @unchecked Sendable { /// The path of the input. public let path: Path - /// The mode to use when linking the library. Not all modes make sense for all knds. + /// The mode to use when linking the library. Not all modes make sense for all kinds. public let mode: Mode /// Whether the library should be found via the linker search path. diff --git a/Sources/SWBCore/Specs/ProductTypes.swift b/Sources/SWBCore/Specs/ProductTypes.swift index 5c02d2de..397f727d 100644 --- a/Sources/SWBCore/Specs/ProductTypes.swift +++ b/Sources/SWBCore/Specs/ProductTypes.swift @@ -328,7 +328,7 @@ public class ProductTypeSpec : Spec, SpecType, @unchecked Sendable { return false } - /// Returns whether the product type's target should be configured as a mergeable library (have `MERGEABLE_LIBRARY` set in target speciaization) if an merged binary target depends on it, as part of superimposed properties in `DependencyResolver`. + /// Returns whether the product type's target should be configured as a mergeable library (have `MERGEABLE_LIBRARY` set in target specialization) if an merged binary target depends on it, as part of superimposed properties in `DependencyResolver`. public func autoConfigureAsMergeableLibrary(_ scope: MacroEvaluationScope) -> Bool { return false } diff --git a/Sources/SWBCore/Specs/Tools/CodeSign.swift b/Sources/SWBCore/Specs/Tools/CodeSign.swift index 1a8c1202..33710aa1 100644 --- a/Sources/SWBCore/Specs/Tools/CodeSign.swift +++ b/Sources/SWBCore/Specs/Tools/CodeSign.swift @@ -156,7 +156,7 @@ public final class CodesignToolSpec : CommandLineToolSpec, SpecIdentifierType, @ extraInputs.append(Path(entitlementsFilePath)) } - // Add designatred requirements if we need to. + // Add designated requirements if we need to. if generateDesignatedRequirements { if let unevaluatedDesignatedRequirements = provisioningTaskInputs.designatedRequirements { if let designatedRequirements = defaultDesignatedRequirements(cbc, commandLine, unevaluatedDesignatedRequirements) { @@ -206,7 +206,7 @@ public final class CodesignToolSpec : CommandLineToolSpec, SpecIdentifierType, @ uniquingKeysWith: { (_, second) in second }) // Normally, the additional inputs shouldn't be applied on a resign-task for the target as doing so can create a cycle between the Copy Files Phase and Run Script Phase. However, due to the way that app hosted tests work (e.g. misuse the copy phase to inject content into the app bundle), we need to provide a provision to track that in order to properly-resign the app bundle (cf: testIncrementalCodesignForCopyFileChangesWithAppHostedTests). - // NOTE: This does mean that the users can actually introduce a cycle if they have a script phase that also injects content into the app bundle related to the test bundle that is geing copied in. However, this should be an obscure usage. + // NOTE: This does mean that the users can actually introduce a cycle if they have a script phase that also injects content into the app bundle related to the test bundle that is getting copied in. However, this should be an obscure usage. // NOTE: This also means that we can tend to over-sign some of the additional test infrastructure libraries... not sure it's actually worth trying to filter those out and if we can do it reliably without over filtering. if !isReSignTask || !cbc.scope.evaluate(BuiltinMacros.TEST_HOST).isEmpty { extraInputs = (extraInputs + delegate.additionalCodeSignInputs).sorted() diff --git a/Sources/SWBCore/Specs/Tools/LinkerTools.swift b/Sources/SWBCore/Specs/Tools/LinkerTools.swift index b2ba2782..e07a3f32 100644 --- a/Sources/SWBCore/Specs/Tools/LinkerTools.swift +++ b/Sources/SWBCore/Specs/Tools/LinkerTools.swift @@ -390,7 +390,7 @@ public final class LdLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @unchec delegate.declareGeneratedInfoPlistContent(infoPlistContent) } - // Add flags to emity dependency info. + // Add flags to emit dependency info. let dependencyInfo = await self.dependencyData(cbc: cbc, delegate: delegate, outputs: &outputs) // FIXME: Honor LD_QUITE_LINKER_ARGUMENTS_FOR_COMPILER_DRIVER == NO ? @@ -1447,7 +1447,7 @@ public final class LibtoolLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @u var outputs: [any PlannedNode] = [delegate.createNode(cbc.output)] + cbc.commandOrderingOutputs - // Add flags to emity dependency info. + // Add flags to emit dependency info. var dependencyInfo: DependencyDataStyle? let dependencyInfoFile = cbc.scope.evaluate(BuiltinMacros.LIBTOOL_DEPENDENCY_INFO_FILE) if !dependencyInfoFile.isEmpty { diff --git a/Sources/SWBCore/Specs/Tools/SwiftCompiler.swift b/Sources/SWBCore/Specs/Tools/SwiftCompiler.swift index 1d84f52e..8f233c08 100644 --- a/Sources/SWBCore/Specs/Tools/SwiftCompiler.swift +++ b/Sources/SWBCore/Specs/Tools/SwiftCompiler.swift @@ -1610,7 +1610,7 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi let typeStr = cbc.scope.evaluate(BuiltinMacros.PRODUCT_TYPE) let productType = ProductTypeIdentifier(typeStr) - // For some targets, a tbd can be emitted to allow donwstream targets to begin linking earlier. + // For some targets, a tbd can be emitted to allow downstream targets to begin linking earlier. let supportsTBDEmissionForEagerLinking = cbc.producer.supportsEagerLinking(scope: cbc.scope) // InstallAPI support requires explicit opt-in and a compatible product type. @@ -2083,7 +2083,7 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi // Pass in access notes if present. // "Access notes" are YAML files to override attributes on Swift declarations in this module. // We want to be able to add an access note for a particular target without changing anything in the project itself, including the project file. So instead of setting SWIFT_ACCESS_NOTES_PATH only in targets that have an access note, SWIFT_ACCESS_NOTES_PATH can be set by default in SDKs that contain access notes. - // But that means SWIFT_ACCESS_NOTES_PATH is often set in targets which don't actually have a corresponding access note. A nonexistent access note is not an error--in fact, it's the most common case. Swift Build must threfore check not only whether SWIFT_ACCESS_NOTES_PATH is non-empty, but also whether there is a file at the path it specifies, before it knows whether to pass the path to the compiler. + // But that means SWIFT_ACCESS_NOTES_PATH is often set in targets which don't actually have a corresponding access note. A nonexistent access note is not an error--in fact, it's the most common case. Swift Build must therefore check not only whether SWIFT_ACCESS_NOTES_PATH is non-empty, but also whether there is a file at the path it specifies, before it knows whether to pass the path to the compiler. // This special case only covers nonexistent files. Other errors (e.g. bad permissions, directory instead of file, parse errors) will be diagnosed by the compiler, so Swift Build doesn't check for them. let accessNotesPath = Path(cbc.scope.evaluate(BuiltinMacros.SWIFT_ACCESS_NOTES_PATH)) if !accessNotesPath.isEmpty && delegate.fileExists(at: accessNotesPath) { diff --git a/Sources/SWBCore/TaskGeneration.swift b/Sources/SWBCore/TaskGeneration.swift index eb3472a1..7d35af6d 100644 --- a/Sources/SWBCore/TaskGeneration.swift +++ b/Sources/SWBCore/TaskGeneration.swift @@ -691,7 +691,7 @@ public protocol TaskGenerationDelegate: AnyObject, TargetDiagnosticProducingDele /// /// This file will be added to the generated files headermap. // - // FIXME: Could we handle this automatically based simply on the declared outputs? We know from the file type which are soure files. + // FIXME: Could we handle this automatically based simply on the declared outputs? We know from the file type which are source files. func declareGeneratedSourceFile(_ path: Path) /// Declare a generated info plist addition. @@ -741,7 +741,7 @@ public protocol TaskGenerationDelegate: AnyObject, TargetDiagnosticProducingDele /// Returns true if a file exists at `path`, and adds the path to the list of paths which invalidate the build description. func fileExists(at path: Path) -> Bool - /// Record an arbitrary attachment as part of the build desceription, which can be accessed at the returned path. + /// Record an arbitrary attachment as part of the build description, which can be accessed at the returned path. func recordAttachment(contents: ByteString) -> Path /// User preferences diff --git a/Sources/SWBGenericUnixPlatform/Unix.xcspec b/Sources/SWBGenericUnixPlatform/Unix.xcspec index baac4c70..484b04ea 100644 --- a/Sources/SWBGenericUnixPlatform/Unix.xcspec +++ b/Sources/SWBGenericUnixPlatform/Unix.xcspec @@ -59,7 +59,7 @@ ); }, - // Dynamic library (masquarading as a framework to placate Swift's project structure) + // Dynamic library (masquerading as a framework to placate Swift's project structure) { Domain = generic-unix; Type = ProductType; diff --git a/Sources/SWBMacro/MacroConditionExpression.swift b/Sources/SWBMacro/MacroConditionExpression.swift index 3d6575f0..38ed351a 100644 --- a/Sources/SWBMacro/MacroConditionExpression.swift +++ b/Sources/SWBMacro/MacroConditionExpression.swift @@ -545,7 +545,7 @@ private final class MacroConditionContainsExpression: MacroConditionBinaryBoolea { override func evaluateAsBoolean(_ scope: MacroEvaluationScope, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> Bool { - // As the contains operator works on strings, we're assuming that both expressions, left and right, will be strings. Also of note, we currently assume the substring search will be case insensitive. It might be good in the future to allow the user to specify case sensitivity vs. nonsensitivity. As a point of comparison, NSPredicate does this by appending '[c]' to the operator. + // As the contains operator works on strings, we're assuming that both expressions, left and right, will be strings. Also of note, we currently assume the substring search will be case insensitive. It might be good in the future to allow the user to specify case sensitivity vs. non-sensitivity. As a point of comparison, NSPredicate does this by appending '[c]' to the operator. let leftString = leftExpr != nil ? leftExpr!.evaluateAsString(scope, lookup: lookup) : "" let rightString = rightExpr != nil ? rightExpr!.evaluateAsString(scope, lookup: lookup) : "" return leftString.contains(rightString) diff --git a/Sources/SWBMacro/MacroConfigFileParser.swift b/Sources/SWBMacro/MacroConfigFileParser.swift index cb0308eb..a465ac27 100644 --- a/Sources/SWBMacro/MacroConfigFileParser.swift +++ b/Sources/SWBMacro/MacroConfigFileParser.swift @@ -365,7 +365,7 @@ public final class MacroConfigFileParser { while let chunk = parseNonListAssignmentRHS() { // we have already ensured chunk doesn't have trailing spaces if chunk.hasSuffix("\\") { - // we should drop the line contunuation character from the chunk + // we should drop the line continuation character from the chunk let trimmed = chunk.dropLast().trimmingCharacters(in: .whitespaces) if !trimmed.isEmpty { // no need to add empty lines chunks.append(String(trimmed)) @@ -410,7 +410,7 @@ public final class MacroConfigFileParser { endIdx -= 1 } - // Trim any trailing semicolon (and preceeding whitespace). + // Trim any trailing semicolon (and preceding whitespace). if bytes[endIdx-1] == /* ';' */ 59 { endIdx -= 1 while endIdx > valueMarkIdx && bytes[endIdx-1].isASCIISpace { diff --git a/Sources/SWBMacro/MacroEvaluationProgram.swift b/Sources/SWBMacro/MacroEvaluationProgram.swift index 4663957d..530329c5 100644 --- a/Sources/SWBMacro/MacroEvaluationProgram.swift +++ b/Sources/SWBMacro/MacroEvaluationProgram.swift @@ -547,7 +547,7 @@ final class MacroEvaluationResultBuilder { /// Create a macro result builder. init() { } - /// If the “needs list element separator” flag has been set, this function adds a list separator for the index corresponding to the current end of the acculuator string, and clears the flag. Otherwise, this function does nothing. Clients never invoke this function directly — instead, they note the need for a list element separator and let it be created the next time anything is appended. + /// If the “needs list element separator” flag has been set, this function adds a list separator for the index corresponding to the current end of the accumulator string, and clears the flag. Otherwise, this function does nothing. Clients never invoke this function directly — instead, they note the need for a list element separator and let it be created the next time anything is appended. private func applyPendingListElementSeparatorIfNeeded() { // If the flag is set, we record the current end index of the accumulated string as the start index of the next element, and clear the flag. guard needsListElementSeparator else { return } diff --git a/Sources/SWBMacro/MacroEvaluationScope.swift b/Sources/SWBMacro/MacroEvaluationScope.swift index 2f87ffec..ab31749f 100644 --- a/Sources/SWBMacro/MacroEvaluationScope.swift +++ b/Sources/SWBMacro/MacroEvaluationScope.swift @@ -25,7 +25,7 @@ private extension MacroValueAssignmentTable { } } -/// A lightweight parameterized “view” of a MacroValueAssignmentTable, allowing clients to evaluate macro expressions under a particular set of conditions. In the future a MacroEvaluationScope will also bind conditions to affect the values that are found in the table. Unlike many of the other classes in the macro evaluation subsystem, MacroEvaluationScope is a prominent class from a client perspective — after declaring macros, parsing macro expressions, and creating macro-to-expression tables, all actual evalution occurs through a MacroEvaluationScope. +/// A lightweight parameterized “view” of a MacroValueAssignmentTable, allowing clients to evaluate macro expressions under a particular set of conditions. In the future a MacroEvaluationScope will also bind conditions to affect the values that are found in the table. Unlike many of the other classes in the macro evaluation subsystem, MacroEvaluationScope is a prominent class from a client perspective — after declaring macros, parsing macro expressions, and creating macro-to-expression tables, all actual evaluation occurs through a MacroEvaluationScope. public final class MacroEvaluationScope: Serializable, Sendable { static let evaluations = Statistic("MacroEvaluationScope.evaluations", "The number of evaluation requests.") @@ -45,7 +45,7 @@ public final class MacroEvaluationScope: Serializable, Sendable { /// Convenience accessor to get the namespace for the scope's table, so clients can perform parsing of things they want to evaluate. public var namespace: MacroNamespace { return table.namespace } - /// Mapping of condition parameters to values (affects lookup of conditional macro value assignments in `table`). The values are an array to accommodate fallback conditional values spplied by base SDKs. + /// Mapping of condition parameters to values (affects lookup of conditional macro value assignments in `table`). The values are an array to accommodate fallback conditional values supplied by base SDKs. public let conditionParameterValues: [MacroConditionParameter: [String]] /// Cache of evaluated string values. @@ -92,12 +92,12 @@ public final class MacroEvaluationScope: Serializable, Sendable { /// Evaluate the given string expression and return the result. /// - /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentionally supply an alternate expression to evaluate. + /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentially supply an alternate expression to evaluate. public func evaluate(_ expr: MacroStringExpression, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> String { // FIXME: We should be able to leverage the cache within the macro evaluation context for expressions: Fix expression evaluation to not bypass scope evaluation cache MacroEvaluationScope.exprEvaluations.increment() - // If the expressoin is a literal, return it immediately. + // If the expression is a literal, return it immediately. if let literal = expr.asLiteralString { return literal } @@ -110,7 +110,7 @@ public final class MacroEvaluationScope: Serializable, Sendable { /// Evaluate the given macro as a string (regardless of type) and return the result. /// - /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentionally supply an alternate expression to evaluate. + /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentially supply an alternate expression to evaluate. public func evaluateAsString(_ macro: T, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> String { MacroEvaluationScope.evaluations.increment() @@ -147,14 +147,14 @@ public final class MacroEvaluationScope: Serializable, Sendable { /// Evaluate the given boolean macro and return the result. /// - /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentionally supply an alternate expression to evaluate. + /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentially supply an alternate expression to evaluate. public func evaluate(_ macro: BooleanMacroDeclaration, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> Bool { return evaluateAsString(macro, lookup: lookup).boolValue } /// Evaluate the given string macro and return the result. /// - /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentionally supply an alternate expression to evaluate. + /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentially supply an alternate expression to evaluate. /// - Parameter default: If provided, this value is returned if the macro evaluates to an empty string. public func evaluate(_ macro: StringMacroDeclaration, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil, default: String = "") -> String { let value = evaluateAsString(macro, lookup: lookup) @@ -172,21 +172,21 @@ public final class MacroEvaluationScope: Serializable, Sendable { /// Evaluate the given enumeration macro and return the result. /// - /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentionally supply an alternate expression to evaluate. + /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentially supply an alternate expression to evaluate. @_disfavoredOverload public func evaluate(_ macro: EnumMacroDeclaration, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> T? { return T(rawValue: evaluateAsString(macro, lookup: lookup)) } /// Evaluate the given enumeration macro and return the result. /// - /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentionally supply an alternate expression to evaluate. + /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentially supply an alternate expression to evaluate. public func evaluate(_ macro: EnumMacroDeclaration, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> T { return T(rawValue: evaluateAsString(macro, lookup: lookup)) ?? T.defaultValue } /// Evaluate the given string list macro expression and return the result. /// - /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentionally supply an alternate expression to evaluate. + /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentially supply an alternate expression to evaluate. public func evaluate(_ expr: MacroStringListExpression, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> Array { // FIXME: We should be able to leverage the cache within the macro evaluation context for expressions: Fix expression evaluation to not bypass scope evaluation cache MacroEvaluationScope.exprEvaluations.increment() @@ -199,7 +199,7 @@ public final class MacroEvaluationScope: Serializable, Sendable { /// Evaluate the given string list macro and return the result. /// - /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentionally supply an alternate expression to evaluate. + /// - Parameter lookup: If provided, this closure will be invoked for each initial macro lookup to potentially supply an alternate expression to evaluate. public func evaluate(_ macro: StringListMacroDeclaration, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> [String] { MacroEvaluationScope.evaluations.increment() diff --git a/Sources/SWBMacro/MacroExpressionParsing.swift b/Sources/SWBMacro/MacroExpressionParsing.swift index d2b3fb91..601927a4 100644 --- a/Sources/SWBMacro/MacroExpressionParsing.swift +++ b/Sources/SWBMacro/MacroExpressionParsing.swift @@ -108,7 +108,7 @@ public final class MacroExpressionParser { let markIdx = currIdx while isAtWhitespace { advance() } - // If directed to capture the whitespace as a list separator, then we do so - *except* that if the whitespace is at the end of the string, then we don't treat it as a list sepatror. + // If directed to capture the whitespace as a list separator, then we do so - *except* that if the whitespace is at the end of the string, then we don't treat it as a list separator. if parseAsListSeparator && !isAtEnd { delegate.foundListElementSeparator(utf8[markIdx ..< currIdx], parser: self) } @@ -553,7 +553,7 @@ public protocol MacroExpressionParserDelegate { /// Invoked for each “retrieval” operator found inside a macro substitution expression of the form `$(XYZ)`. The operator name is always non-empty. This callback function is always invoked with the parser’s cursor positioned immediately after the operator name. func foundRetrievalOperator(_ operatorName: Input, parser: MacroExpressionParser) - /// Invoked at the start of a “replacement” operator found inside a macro substitution expression of the form `$(XYZ)`. The operator name is always non-empty. This call is always balanced by a later call to `foundEndOfReplacementOperator()`. This callback function is always invoked with the parser’s cursor positioned immediately after the `=` character that follows the operator name; this is the same as the start position of the replacement operatand subexpression. + /// Invoked at the start of a “replacement” operator found inside a macro substitution expression of the form `$(XYZ)`. The operator name is always non-empty. This call is always balanced by a later call to `foundEndOfReplacementOperator()`. This callback function is always invoked with the parser’s cursor positioned immediately after the `=` character that follows the operator name; this is the same as the start position of the replacement operand subexpression. func foundStartOfReplacementOperator(_ operatorName: Input, parser: MacroExpressionParser) /// Invoked at the end of a “replacement” operator found inside a macro substitution expression of the form `$(XYZ)`. This call always balances an earlier call to `foundStartOfReplacementOperator()`. The same operator name is passed in both calls. This callback function is always invoked with the parser’s cursor positioned immediately after the operand expression. Note that if the operand expression is empty, the `foundEndOfReplacementOperator()` call will occur immediately after the `foundStartOfReplacementOperator()` call, and the cursor position will be unchanged between the two. diff --git a/Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift b/Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift index cd8f617c..2db34cf5 100644 --- a/Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift +++ b/Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift @@ -357,7 +357,7 @@ extension PIF.ImpartedBuildProperties : PIFRepresentable { extension PIF.BuildSettings : PIFRepresentable { public func serialize(to serializer: any IDEPIFSerializer) -> PIFDict { - // Borderline hacky, but the main thing is that adding or changing a build setting does not require any changes to the property list representation code. Using a handcoded serializer might be more efficient but not even remotely as robust, and robustness is the key factor for this use case, as there aren't going to be millions of BuildSettings structs. + // Borderline hacky, but the main thing is that adding or changing a build setting does not require any changes to the property list representation code. Using a hand-coded serializer might be more efficient but not even remotely as robust, and robustness is the key factor for this use case, as there aren't going to be millions of BuildSettings structs. var dict = PIFDict() let mirror = Mirror(reflecting: self) for child in mirror.children { @@ -374,7 +374,7 @@ extension PIF.BuildSettings : PIFRepresentable { case let value as [String]: dict[name] = value default: - // FIXME: I haven't found a way of distinguishing a value of an unexpected type from a value that is nil; they all seem to go throught the `default` case instead of the `nil` case above. Currently we will silently fail to serialize any struct field that isn't a `String` or a `[String]` (or an optional of either of those two). This would only come up if a property of a type other than `String` or `[String]` were to be added to `BuildSettings`. + // FIXME: I haven't found a way of distinguishing a value of an unexpected type from a value that is nil; they all seem to go through the `default` case instead of the `nil` case above. Currently we will silently fail to serialize any struct field that isn't a `String` or a `[String]` (or an optional of either of those two). This would only come up if a property of a type other than `String` or `[String]` were to be added to `BuildSettings`. continue } } diff --git a/Sources/SWBProtocol/ProjectModel/BuildRule.swift b/Sources/SWBProtocol/ProjectModel/BuildRule.swift index 97b91350..5a33fe71 100644 --- a/Sources/SWBProtocol/ProjectModel/BuildRule.swift +++ b/Sources/SWBProtocol/ProjectModel/BuildRule.swift @@ -14,7 +14,7 @@ public import SWBUtil public struct BuildRule: Sendable { public enum InputSpecifier: Sendable { - // FIXME: We should consider if we can deprecate the abililty to expand macros in the patterns. + // FIXME: We should consider if we can deprecate the ability to expand macros in the patterns. case patterns(MacroExpressionSource) case fileType(identifier: String) } diff --git a/Sources/SWBQNXPlatform/QNX.xcspec b/Sources/SWBQNXPlatform/QNX.xcspec index fa2a85bd..3c72c620 100644 --- a/Sources/SWBQNXPlatform/QNX.xcspec +++ b/Sources/SWBQNXPlatform/QNX.xcspec @@ -59,7 +59,7 @@ ); }, - // Dynamic library (masquarading as a framework to placate Swift's project structure) + // Dynamic library (masquerading as a framework to placate Swift's project structure) { Domain = qnx; Type = ProductType; diff --git a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/BuildRuleTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/BuildRuleTaskProducer.swift index 502a99b3..4027b4f9 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/BuildRuleTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/BuildRuleTaskProducer.swift @@ -120,7 +120,7 @@ final class BuildRuleTaskProducer: StandardTaskProducer, TaskProducer, ShellBase var environment = computeScriptEnvironment(.shellScriptPhase, scope: cbc.scope, settings: context.settings, workspaceContext: context.workspaceContext) // If we are in a headers build phase, expose visibility and output dir - // infomation to the script and set the HEADER_OUTPUT_DIR macro value + // information to the script and set the HEADER_OUTPUT_DIR macro value // for output path resolution. if buildPhase is HeadersBuildPhase { if let headerVisibility = input.headerVisibility, let outputDir = TargetHeaderInfo.outputPath(for: input.absolutePath, visibility: headerVisibility, scope: cbc.scope)?.dirname { diff --git a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift index 55ea2a07..01364f9c 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/CopyFilesTaskProducer.swift @@ -241,7 +241,7 @@ class CopyFilesTaskProducer: FilesBasedBuildPhaseTaskProducerBase, FilesBasedBui let stripBitcode = scope.evaluate(BuiltinMacros.STRIP_BITCODE_FROM_COPIED_FILES) && codeSignAfterCopying // SUPPORT FOR MERGEABLE LIBRARIES - // If this file was built as mergeable, and either we are a merged binary which is merging or reeexporting that file (and embedding it, which is the step that we're setting up here), or we are embedding that merged/reexported binary product as well as this product, then we need to skip copying the product's binary. + // If this file was built as mergeable, and either we are a merged binary which is merging or re-exporting that file (and embedding it, which is the step that we're setting up here), or we are embedding that merged/reexported binary product as well as this product, then we need to skip copying the product's binary. // Note that we remove the binary even for the debug workflow, because the SourcesTaskProducer will copy only the binary part of the product into the merged product to mimic the actual merge workflow. // FIXME: At present only products of other targets in this build, and XCFrameworks, are supported here. var subpathsToExclude = [String]() @@ -378,7 +378,7 @@ class CopyFilesTaskProducer: FilesBasedBuildPhaseTaskProducerBase, FilesBasedBui } default: // These types do not support mergeable metadata. This should have been caught at XCFramework creation time, but perhaps someone edited the XCFramework after creation. - // In this case, we emit a warning and copy these items normally, withoutn stripping any mergeable metadata they may have. We may refine this in the future. + // In this case, we emit a warning and copy these items normally, without stripping any mergeable metadata they may have. We may refine this in the future. context.warning("XCFramework claims \(library.libraryType.libraryTypeName) contains mergeable metadata, which is not supported: \(resolvedBuildFile.absolutePath)") } } diff --git a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ResourcesTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ResourcesTaskProducer.swift index 6a0e7eaf..63369026 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ResourcesTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ResourcesTaskProducer.swift @@ -42,7 +42,7 @@ final class ResourcesTaskProducer: FilesBasedBuildPhaseTaskProducerBase, FilesBa // If no resources are going to be processed, then we're done here! guard shouldProcessResources(scope) else { return } - // Add all of the resources as inputs as any change to a resource will result in an output that goes into a product that will be signed. This is a slightly naive approach to this, but calculating everything can be expensive and this should suffice without oversigning the product. + // Add all of the resources as inputs as any change to a resource will result in an output that goes into a product that will be signed. This is a slightly naive approach to this, but calculating everything can be expensive and this should suffice without over-signing the product. context.addAdditionalCodeSignInputs(buildPhase.buildFiles, context) } diff --git a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellScriptTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellScriptTaskProducer.swift index f3ffbfda..c38f4390 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellScriptTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/ShellScriptTaskProducer.swift @@ -66,7 +66,7 @@ final class ShellScriptTaskProducer: PhasedTaskProducer, TaskProducer, ShellBase // This is to provide a fallback to prevent any unexpected side-effects this close to shipping... guard scope.evaluate(BuiltinMacros.ENABLE_ADDITIONAL_CODESIGN_INPUT_TRACKING) else { return } - // Due to the free-form nature of how script outputs can be formed, it can be problematic to blanketly add these as doing so can trigger cycles from downstream targets. + // Due to the free-form nature of how script outputs can be formed, it can be problematic to blanket add these as doing so can trigger cycles from downstream targets. guard scope.evaluate(BuiltinMacros.ENABLE_ADDITIONAL_CODESIGN_INPUT_TRACKING_FOR_SCRIPT_OUTPUTS) else { return } // There is no reason to process any files if we're not building into a wrapper. diff --git a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift index 285dd578..c5b782c5 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift @@ -21,7 +21,7 @@ package import SWBMacro /// This class adapts the TaskGenerationDelegate protocol used by the Core to that provided by the producer delegate API, for use inside the sources build phase. /// -/// This delegate auto-attachs constructed tasks to the generated headers completion ordering gates, and chains to another delegate for performing the actual work. +/// This delegate auto-attaches constructed tasks to the generated headers completion ordering gates, and chains to another delegate for performing the actual work. private final class SourcesPhaseBasedTaskGenerationDelegate: TaskGenerationDelegate { /// The producer we are operating on behalf of. let producer: SourcesTaskProducer @@ -667,8 +667,8 @@ final class SourcesTaskProducer: FilesBasedBuildPhaseTaskProducerBase, FilesBase } func prepare() { - // CodeSigning in a monster... really, it is. Further, we don't actually have a model where we can perform proper pre-planning to determine what inputs will cause downstream outputs to end up in a particular location. Every source file has the potential to contribute some type of ouput that ends up in the wrapper. - // For example, every metal file creates a library that is embedded into the product wrapper. However, the build system doesn't actually *know* that, as the ouputs aren't really tracked in a way that the CodeSign task itself can depend on it. + // CodeSigning in a monster... really, it is. Further, we don't actually have a model where we can perform proper pre-planning to determine what inputs will cause downstream outputs to end up in a particular location. Every source file has the potential to contribute some type of output that ends up in the wrapper. + // For example, every metal file creates a library that is embedded into the product wrapper. However, the build system doesn't actually *know* that, as the outputs aren't really tracked in a way that the CodeSign task itself can depend on it. // What the build system does _know_, is that _all_ source files run tools that can potentially end up invalidating the code signature. Until we have a proper pre-planning (e.g. or dry-run) model (or a model that allows us to have dependencies on task producers), we need to be more conservative in our tracking of inputs, even if they can result in additional codesign work. // An additional note: if out output file, such as a metallib, is changed by something other than a source input, the codesign task will still not know about it, and that incremental build will fail to sign properly. That should be less likely to happen, but just goes to point out that we need to re-work how our codesign model works, in general. @@ -1751,8 +1751,8 @@ final class SourcesTaskProducer: FilesBasedBuildPhaseTaskProducerBase, FilesBase NSBundle.mainBundle.bundleURL ]; - for (NSURL* candiate in candidates) { - NSURL *bundlePath = [candiate URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.bundle", bundleName]]; + for (NSURL* candidate in candidates) { + NSURL *bundlePath = [candidate URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.bundle", bundleName]]; NSBundle *bundle = [NSBundle bundleWithURL:bundlePath]; if (bundle != nil) { @@ -1955,7 +1955,7 @@ final class SourcesTaskProducer: FilesBasedBuildPhaseTaskProducerBase, FilesBase /// `ENABLE_DEBUG_DYLIB` is set on the main target, we need to add the previews /// dylib to the list of libraries to link for the test target. /// - /// `TEST_HOST` and `BUNDLE_LOADER` in fluence the `hostTargetForTargets` mapping. + /// `TEST_HOST` and `BUNDLE_LOADER` influence the `hostTargetForTargets` mapping. /// So if this target is present in there, we have a host we need to check. /// /// If the host has `EXECUTABLE_DEBUG_DYLIB_PATH`, then it had the preview dylib @@ -2015,7 +2015,7 @@ private extension Target { return (self as? StandardTarget)?.sourcesBuildPhase?.buildFiles.compactMap { try? context.resolveBuildFileReference($0).fileType }.filter { $0.conformsTo(context.getSpec("sourcecode.swift") as! FileTypeSpec) }.count ?? 0 > 0 } - /// Check whether a target has atleast one asset catalog. + /// Check whether a target has at least one asset catalog. func hasAssetCatalog(scope: MacroEvaluationScope, context: TaskProducerContext, includeGenerated: Bool) -> Bool { guard let standardTarget = (self as? StandardTarget) else { return false } let buildPhases = [standardTarget.resourcesBuildPhase, standardTarget.sourcesBuildPhase].compactMap { $0 } diff --git a/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift index 7c8a1866..bdff7889 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/ProductPostprocessingTaskProducer.swift @@ -15,7 +15,7 @@ import SWBUtil import SWBMacro /// Returns an array of build variant-macro evaluation scope pairs for the given scope for a list of build variants. -/// - parameter scope: The base scope for which to return the varianted subscropes. +/// - parameter scope: The base scope for which to return the varianted subscopes. /// - parameter variants: If non-nil, then the subscopes for the given variants will be returned. If nil, then subscopes for the values of `$(BUILD_VARIANTS)` evaluated in the given scope will be returned. private func perVariantSubscopes(_ scope: MacroEvaluationScope, variants: [String]? = nil) -> [(variant: String, scope: MacroEvaluationScope)] { let effectiveVariants = variants ?? scope.evaluate(BuiltinMacros.BUILD_VARIANTS) diff --git a/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SanitizerTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SanitizerTaskProducer.swift index 05557d0c..0783e5de 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SanitizerTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/SanitizerTaskProducer.swift @@ -59,7 +59,7 @@ final class SanitizerTaskProducer: PhasedTaskProducer, TaskProducer { // Sanitizer tasks are generated only if this product type supports embedding the libraries. guard context.settings.productType?.canEmbedCompilerSanitizerLibraries ?? false else { return [] } - // Determine the macro evaluation scopes to consider when determing whether to embed each sanitizer. + // Determine the macro evaluation scopes to consider when determining whether to embed each sanitizer. // For most build actions, consider the subscopes for all build variants, but skip this for the "install" // action and only consider the non-variant conditionalized scope. This is because // these sanitizer dylibs are much less useful in "install" scenarios since Xcode does not facilitate using them. @@ -101,7 +101,7 @@ final class SanitizerTaskProducer: PhasedTaskProducer, TaskProducer { } // The sanitizer libraries are bundled with the clang in the toolchain we're using. Moreover, there is a separate library for each platform, and it lives in a directory based on the version of the clang in that platform. - // So, we have to do some pathematics to compute the location of the library. Fortunately, we can ask the clang specification to be used for the its version. + // So, we have to do some path calculations to compute the location of the library. Fortunately, we can ask the clang specification to be used for the its version. guard let clangInfo = try? await context.clangSpec.discoveredCommandLineToolSpecInfo(context, scope, delegate, forLanguageOfFileType: nil), !clangInfo.toolPath.isEmpty else { context.error("Could not find path to clang binary to locate \(sanitizerName) Sanitizer library") return diff --git a/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift index 5b9aab7a..5423a898 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers/TargetOrderTaskProducer.swift @@ -279,7 +279,7 @@ final class TargetOrderTaskProducer: StandardTaskProducer, TaskProducer { return true }() - /// Workhorse utility method for computing the input node for use for immediate dependend-on (upstream) targets of a target. + /// Workhorse utility method for computing the input node for use for immediate depended-on (upstream) targets of a target. /// - parameter lookup: A lookup method which takes a `ConfiguredTarget` and returns an input `PlannedNode`, or nil if there are no inputs. /// - returns: A tuple of synchronized lists of input `PlannedNode`s and their corresponding `ConfiguredTarget`s private func inputsForDependencies(_ lookup: (ConfiguredTarget, ConfiguredTarget) -> (any PlannedNode)?) -> (inputs: [any PlannedNode], resolvedTargetDependencies: [ResolvedTargetDependency]) { diff --git a/Sources/SWBTaskConstruction/TaskProducers/StandardTaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/StandardTaskProducer.swift index 3006ff9e..76cd9b94 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/StandardTaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/StandardTaskProducer.swift @@ -153,7 +153,7 @@ open class PhasedTaskProducer: StandardTaskProducer { /// /// - Parameters: /// - tasks: The task array to append to. - /// - usePhasedOrdering: If true, the tasks are bound between the phase start and end, otherwise they will preceed the target end task. + /// - usePhasedOrdering: If true, the tasks are bound between the phase start and end, otherwise they will precede the target end task. /// - Returns: The generated tasks and outputs. @discardableResult func appendGeneratedTasks(_ tasks: inout [any PlannedTask], usePhasedOrdering: Bool, options: TaskOrderingOptions? = nil, body: (any TaskGenerationDelegate) async -> T) async -> (tasks: [any PlannedTask], outputs: [FileToBuild], result: T) { diff --git a/Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift b/Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift index 6d4a9a4c..100a390d 100644 --- a/Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift +++ b/Sources/SWBTaskConstruction/TaskProducers/TaskProducer.swift @@ -165,17 +165,17 @@ public class TaskProducerContext: StaleFileRemovalContext, BuildFileResolution /// The set of additional inputs for codesigning. These are tracked explicitly on the codesign task and are captured during the `.planning` phase. private var _additionalCodeSignInputs: OrderedSet = [] - /// Notes generated by the internal state of the task prodcer context. These are harvested by the `BuildPlan` once all task producers have been run. + /// Notes generated by the internal state of the task producer context. These are harvested by the `BuildPlan` once all task producers have been run. /// /// This is an `OrderedSet` because the context is shared among all task producers for a target, and multiple producers could cause the same note to be emitted private(set) var notes = OrderedSet() - /// Warnings generated by the internal state of the task prodcer context. These are harvested by the `BuildPlan` once all task producers have been run. + /// Warnings generated by the internal state of the task producer context. These are harvested by the `BuildPlan` once all task producers have been run. /// /// This is an `OrderedSet` because the context is shared among all task producers for a target, and multiple producers could cause the same warning to be emitted private(set) var warnings = OrderedSet() - /// Errors generated by the internal state of the task prodcer context. These are harvested by the `BuildPlan` once all task producers have been run. + /// Errors generated by the internal state of the task producer context. These are harvested by the `BuildPlan` once all task producers have been run. /// /// This is an `OrderedSet` because the context is shared among all task producers for a target, and multiple producers could cause the same error to be emitted . private(set) var errors = OrderedSet() @@ -630,7 +630,7 @@ public class TaskProducerContext: StaleFileRemovalContext, BuildFileResolution // This API should only be used during the `planning` phase. assert(phase == .planning) - // A feature guard to provide a fallback mechanims, primarily to alleviate risk. + // A feature guard to provide a fallback mechanism, primarily to alleviate risk. guard scope.evaluate(BuiltinMacros.ENABLE_ADDITIONAL_CODESIGN_INPUT_TRACKING) else { return } queue.blocking_sync { @@ -1655,7 +1655,7 @@ class ProducerBasedTaskGenerationDelegate: TaskGenerationDelegate { /// This class adapts the TaskGenerationDelegate protocol used by the Core to that provided by the producer delegate API, to provide phase ordering among tasks created by different `PhasedTaskProducers`. /// -/// This delegate auto-attachs constructed tasks to the phase ordering gates. +/// This delegate auto-attaches constructed tasks to the phase ordering gates. class PhasedProducerBasedTaskGenerationDelegate: ProducerBasedTaskGenerationDelegate { let phaseStartNodes: [any PlannedNode] let phaseEndTask: any PlannedTask diff --git a/Sources/SWBTaskExecution/BuildDescription.swift b/Sources/SWBTaskExecution/BuildDescription.swift index 1bb2fae0..cde56161 100644 --- a/Sources/SWBTaskExecution/BuildDescription.swift +++ b/Sources/SWBTaskExecution/BuildDescription.swift @@ -50,7 +50,7 @@ package extension BuildDescriptionConstructionDelegate { /// Persistable representation of the complete set of tasks needed for a build. /// -/// This representation primarily is in the form of a build file suitable for use with llbuild's BuildSystem library, but also contains additional task-specific data used for the xecution of internal tasks, as well as metadata to allow matching up status information from llbuild to the corresponding Swift Build and PIF objects. +/// This representation primarily is in the form of a build file suitable for use with llbuild's BuildSystem library, but also contains additional task-specific data used for the execution of internal tasks, as well as metadata to allow matching up status information from llbuild to the corresponding Swift Build and PIF objects. package final class BuildDescription: Serializable, Sendable, Encodable, CacheableValue { enum CodingKeys: CodingKey { @@ -1317,7 +1317,7 @@ extension BuildDescription { } } - // the above task of emitting the status messages overlaps with the parllel processing of Gate/Constructed tasks + // the above task of emitting the status messages overlaps with the parallel processing of Gate/Constructed tasks try await sortedTasks.enumerated().parallelForEach(group: &group, maximumParallelism: 100) { _, task in try _Concurrency.Task.checkCancellation() progressContinuation.yield(()) @@ -1341,7 +1341,7 @@ extension BuildDescription { // Diagnose attempts to define multiple producers (tasks) for an output. var outputsSet = Set>() // for identifying duplicate output nodes across tasks for (_, task) in sortedTasks.enumerated() { - let amendedOutputs = builder.taskOutputMap[Ref(task)] ?? [] // get the amended ouputs of the task + let amendedOutputs = builder.taskOutputMap[Ref(task)] ?? [] // get the amended outputs of the task for output in amendedOutputs { if outputsSet.contains(Ref(output)) { // This condition should almost never appear on a user projects, but we surface it as an error versus an assert in case there are valid situations where the user can author a project that would hit it. diff --git a/Sources/SWBTaskExecution/BuildDescriptionManager.swift b/Sources/SWBTaskExecution/BuildDescriptionManager.swift index 3aa72a7c..a39a4c43 100644 --- a/Sources/SWBTaskExecution/BuildDescriptionManager.swift +++ b/Sources/SWBTaskExecution/BuildDescriptionManager.swift @@ -445,7 +445,7 @@ package final class BuildDescriptionManager: Sendable { if messageShortening != .full || userPreferences.enableDebugActivityLogs { - constructionDelegate.updateProgress(statusMessage: "Attemping to load build description from disk", showInLog: request.workspaceContext.userPreferences.enableDebugActivityLogs) + constructionDelegate.updateProgress(statusMessage: "Attempting to load build description from disk", showInLog: request.workspaceContext.userPreferences.enableDebugActivityLogs) } let taskActionRegistry = try await TaskActionRegistry(pluginManager: request.workspaceContext.core.pluginManager) diff --git a/Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift b/Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift index b4180bd7..510a61a9 100644 --- a/Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift +++ b/Sources/SWBTaskExecution/DynamicTaskSpecs/CompilationCachingDataPruner.swift @@ -43,7 +43,7 @@ package struct ClangCachingPruneDataTaskKey: Hashable, Serializable, CustomDebug } /// Manages the growth of the on-disk CAS by setting a size limit and pruning its data when necessary. -/// Each CAS instance will be attempted to be prunned once per build, but this happens concurrently +/// Each CAS instance will be attempted to be pruned once per build, but this happens concurrently /// with the rest of the build and in a lower QoS priority. It is expected to have one pruning action /// per used toolchain. package final class CompilationCachingDataPruner: Sendable { diff --git a/Sources/SWBTaskExecution/TaskActions/ConstructStubExecutorInputFileListTaskAction.swift b/Sources/SWBTaskExecution/TaskActions/ConstructStubExecutorInputFileListTaskAction.swift index e421889d..4baef637 100644 --- a/Sources/SWBTaskExecution/TaskActions/ConstructStubExecutorInputFileListTaskAction.swift +++ b/Sources/SWBTaskExecution/TaskActions/ConstructStubExecutorInputFileListTaskAction.swift @@ -18,12 +18,12 @@ public import SWBLLBuild /// rdar://125894897 (🚨 fetchOperationServiceEndpoint seems completely broken for app extensions implemented in Swift (SwiftUI: Swift entry point data not found.)) /// /// We need to the final stub executor to contain the `__swift5_entry` trampoline to -/// jump to the debug dylib's `__swfit5_entry` IFF it has one. Prior to addressing +/// jump to the debug dylib's `__swift5_entry` IFF it has one. Prior to addressing /// the above, we always emitted the trampoline and assumed it would be inert unless /// used. But for older delegate style extensions, the presence of this linker -/// section dermines the launch lifecycle used. +/// section determines the launch lifecycle used. /// -/// To accomodate this at link time, we are choosing a variant of the stub executor +/// To accommodate this at link time, we are choosing a variant of the stub executor /// library, one with or without the entry point, based on whether the entry point /// is present in the user's debug dylib. To do this, we need to inspect the binary /// so we'll do this in a new task that will write the chosen library path to a file diff --git a/Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift b/Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift index dbcbd8e7..3f5ceab5 100644 --- a/Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift +++ b/Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift @@ -315,7 +315,7 @@ public final class InfoPlistProcessorTaskAction: TaskAction } // LSSupportsOpeningDocumentsInPlace has some special checks: - // - When building for iOS, warn if it doesn't seclare whether it supports either open-in-place or document browsing (see ). + // - When building for iOS, warn if it doesn't declare whether it supports either open-in-place or document browsing (see ). // - When building for macOS, error if it sets 'LSSupportsOpeningDocumentsInPlace = NO', as that mode is not supported on macOS (see . // (We can't just force it to YES because it's a declaration of behavior, so the app could still do something very bad on macOS no matter what the entry is.) // LSSupportsOpeningDocumentsInPlace is only relevant when document types are also defined. @@ -641,7 +641,7 @@ public final class InfoPlistProcessorTaskAction: TaskAction // The general theory of this method is that we now have a bunch of INFOPLIST_KEY-prefixed build settings that are used to define sufficiently simple Info.plist content, and we go to those (which will either have appropriate backstops set as necessary, or be empty) to determine the content to generate. /// Get the macro name corresponding to the given Info.plist key name. - /// This accomodates platform-specific override names like UISomething~ipad, which may use proper capitalization in the build setting. + /// This accommodates platform-specific override names like UISomething~ipad, which may use proper capitalization in the build setting. func macroNameForInfoPlistKey(key: String, prefix: String) -> String { let replacements = [ "~iphone": "_iPhone", "~ipad": "_iPad" ] @@ -1453,7 +1453,7 @@ public final class InfoPlistProcessorTaskAction: TaskAction case watchOS } - /// The values of the key that are deprecated, if only specific values are deprecated. `nil` indcates the key as a whole is deprecated. + /// The values of the key that are deprecated, if only specific values are deprecated. `nil` indicates the key as a whole is deprecated. let values: [PropertyListItem]? /// An infix to display in the "use (alternative) instead" portion of the deprecation message. @@ -1545,7 +1545,7 @@ public final class InfoPlistProcessorTaskAction: TaskAction return encoded } - // Get the package type code and signature (a.k.a. creator) code from the Info.plist. We do various correctness checks. One of the more interesting restrictions is that both the type code and the signature code have to be convertable to Mac OS Roman encoding. The reason for this is that both four-character codes are really OSTypes, which were implicitly encoded in Mac OS Roman back in historical times. + // Get the package type code and signature (a.k.a. creator) code from the Info.plist. We do various correctness checks. One of the more interesting restrictions is that both the type code and the signature code have to be convertible to Mac OS Roman encoding. The reason for this is that both four-character codes are really OSTypes, which were implicitly encoded in Mac OS Roman back in historical times. let pkgInfoBytes = (OutputByteStream() <<< getFourCharCode(forKey: "CFBundlePackageType") <<< getFourCharCode(forKey: "CFBundleSignature")).bytes diff --git a/Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift b/Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift index c877ae39..f135b54f 100644 --- a/Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift +++ b/Sources/SWBTaskExecution/TaskActions/PrecompileClangModuleTaskAction.swift @@ -75,7 +75,7 @@ final public class PrecompileClangModuleTaskAction: TaskAction, BuildValueValida public override func taskSetup(_ task: any ExecutableTask, executionDelegate: any TaskExecutionDelegate, dynamicExecutionDelegate: any DynamicTaskExecutionDelegate) { let clangModuleDependencyGraph = dynamicExecutionDelegate.operationContext.clangModuleDependencyGraph - // If a precompile task action is executing, it is expected that the scanning action already happend, so the + // If a precompile task action is executing, it is expected that the scanning action already happened, so the // dependencies for this module should already be present in the ModuleDependencyGraph. let dependencyInfo: ClangModuleDependencyGraph.DependencyInfo do { diff --git a/Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift b/Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift index 19c7e9c8..63b9fb64 100644 --- a/Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift +++ b/Sources/SWBTaskExecution/TaskActions/ProcessProductEntitlementsTaskAction.swift @@ -254,7 +254,7 @@ public final class ProcessProductEntitlementsTaskAction: TaskAction // let input = task.workingDirectory.join(options.inputPath) // Not presently used let output = task.workingDirectory.join(options.outputPath) - // Updating entitlements is not something that is actively encouraged or supported, however, this is a compatability pain point for certain projects that we need to maintain some ability to do this. A better approach is to plumb this through the system so that we can track this as a proper dependency mechanism, potentially through our virtual task producers... however, until then, we enable this functionality for those existing clients. + // Updating entitlements is not something that is actively encouraged or supported, however, this is a compatibility pain point for certain projects that we need to maintain some ability to do this. A better approach is to plumb this through the system so that we can track this as a proper dependency mechanism, potentially through our virtual task producers... however, until then, we enable this functionality for those existing clients. // Also, we never modify the signed entitlements when building for simulators and ENTITLEMENTS_DESTINATION is __entitlements, since those are only expected to contain get-task-allow; see rdar://55324156. let entitlementsVariantToModify: EntitlementsVariant = scope.evaluate(BuiltinMacros.ENTITLEMENTS_DESTINATION) == .entitlementsSection ? .simulated : .signed diff --git a/Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift b/Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift index 09bccd9d..56167f9f 100644 --- a/Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift +++ b/Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift @@ -107,7 +107,7 @@ public final class ProcessXCFrameworkTaskAction: TaskAction { return .failed } - // Provide a friendly message up-front if the given library is not found within the XCFramwork. This can occur when the Info.plist for an XCFramework points to a supported platform, but the corresponding library entry is incorrect or points to a location that does not exist on disk. + // Provide a friendly message up-front if the given library is not found within the XCFramework. This can occur when the Info.plist for an XCFramework points to a supported platform, but the corresponding library entry is incorrect or points to a location that does not exist on disk. let rootPathToLibrary = path.join(library.libraryIdentifier) let copyLibraryFromPath = rootPathToLibrary.join(library.libraryPath) if !fs.exists(copyLibraryFromPath) { diff --git a/Sources/SWBTestSupport/BuildOperationTester.swift b/Sources/SWBTestSupport/BuildOperationTester.swift index de830f45..f50107a5 100644 --- a/Sources/SWBTestSupport/BuildOperationTester.swift +++ b/Sources/SWBTestSupport/BuildOperationTester.swift @@ -66,7 +66,7 @@ package protocol BuildRequestCheckingResult { } extension BuildRequestCheckingResult { - /// The target architecture of the run destination in the build request. Returns `undefined_arch` if the build request has no run destination, or the run destination has no target archotecture. + /// The target architecture of the run destination in the build request. Returns `undefined_arch` if the build request has no run destination, or the run destination has no target architecture. package var runDestinationTargetArchitecture: String { return buildRequest.parameters.activeRunDestination?.targetArchitecture ?? "undefined_arch" } @@ -224,7 +224,7 @@ package final class BuildOperationTester { } } - /// Describes a single event which ocurred as a part of a task, during the build. + /// Describes a single event which occurred as a part of a task, during the build. package enum TaskEvent: Hashable, Equatable, CustomStringConvertible, Sendable { /// The task was started. @@ -1318,7 +1318,7 @@ package final class BuildOperationTester { } } - // Add overrides from the parameters we were passed, which will supercede the default overrides above. + // Add overrides from the parameters we were passed, which will supersede the default overrides above. overrides.addContents(of: parameters.overrides) // Create and return the effective parameters. diff --git a/Sources/SWBTestSupport/CoreBasedTests+SDKHelpers.swift b/Sources/SWBTestSupport/CoreBasedTests+SDKHelpers.swift index 49b3b77c..d5c4f694 100644 --- a/Sources/SWBTestSupport/CoreBasedTests+SDKHelpers.swift +++ b/Sources/SWBTestSupport/CoreBasedTests+SDKHelpers.swift @@ -97,7 +97,7 @@ extension CoreBasedTests { /// Utility method to compute the build directories for a build. /// - parameter baseDir: The root directory under which all the build directories will be located. - /// - parameter buildType: A string indicating the type of build, distinguishing it from other builds in the same test. This can be a usefully symbolic name, but functionallty is the subdirectory of the `baseDir` in which the root dirs are defined. + /// - parameter buildType: A string indicating the type of build, distinguishing it from other builds in the same test. This can be a usefully symbolic name, but functionally is the subdirectory of the `baseDir` in which the root dirs are defined. /// - returns: A tuple with the `SYMROOT`, `OBJROOT` and `DSTROOT` absolute paths. package func buildDirs(in baseDir: Path, for buildType: String) -> (symroot: String, objroot: String, dstroot: String) { let buildTypePath = baseDir.join(buildType) diff --git a/Sources/SWBTestSupport/Misc.swift b/Sources/SWBTestSupport/Misc.swift index c5581822..79a6100d 100644 --- a/Sources/SWBTestSupport/Misc.swift +++ b/Sources/SWBTestSupport/Misc.swift @@ -106,7 +106,7 @@ package extension ConfiguredTarget { var platformDiscriminator: String? { // Converts the sdkroot/sdkvariant info into a set of normalized values. func normalize(platform: String, variant: String?) -> String { - // The suffix is not important in the discrimator as that can be verified via other means if necessary. + // The suffix is not important in the discriminator as that can be verified via other means if necessary. let platform = String(platform.split(separator: ".").first ?? "") if let variant, platform == "macosx" { return variant } diff --git a/Sources/SWBTestSupport/SkippedTestSupport.swift b/Sources/SWBTestSupport/SkippedTestSupport.swift index e84e9d08..8df53d08 100644 --- a/Sources/SWBTestSupport/SkippedTestSupport.swift +++ b/Sources/SWBTestSupport/SkippedTestSupport.swift @@ -121,7 +121,7 @@ extension Trait where Self == Testing.ConditionTrait { } /// Constructs a condition trait that causes a test to be disabled if not running on the specified host OS. - /// - parameter when: An additional constraint to apply such that the host OS requirement is only applied if this parameer is _also_ true. Defaults to true. + /// - parameter when: An additional constraint to apply such that the host OS requirement is only applied if this parameter is _also_ true. Defaults to true. package static func requireHostOS(_ os: OperatingSystem, when condition: Bool = true) -> Self { enabled("This test requires a \(os) host OS.", { try ProcessInfo.processInfo.hostOperatingSystem() == os && condition }) } @@ -289,12 +289,12 @@ extension Trait where Self == Testing.ConditionTrait { }) } - /// Constructs a condition trait that causes a test to be disabled if not running against a version of Xcode including the SDK which is equal to or newer than at least one of the given versions wihin the same release. + /// Constructs a condition trait that causes a test to be disabled if not running against a version of Xcode including the SDK which is equal to or newer than at least one of the given versions within the same release. package static func requireMinimumSDKBuildVersion(sdkName: String, requiredVersions: [String], sourceLocation: SourceLocation = #_sourceLocation) -> Self { requireMinimumSDKBuildVersion(sdkName: sdkName, requiredVersions: try requiredVersions.map { try ProductBuildVersion($0) }, sourceLocation: sourceLocation) } - /// Constructs a condition trait that causes a test to be disabled if not running against a version of Xcode including the SDK which is equal to or newer than at least one of the given versions wihin the same release. + /// Constructs a condition trait that causes a test to be disabled if not running against a version of Xcode including the SDK which is equal to or newer than at least one of the given versions within the same release. package static func requireMinimumSDKBuildVersion(sdkName: String, requiredVersions: @Sendable @autoclosure @escaping () throws -> [ProductBuildVersion], sourceLocation: SourceLocation = #_sourceLocation) -> Self { disabled("SDK build version is too old", sourceLocation: sourceLocation, { let sdkVersion = try await InstalledXcode.currentlySelected().productBuildVersion(sdkCanonicalName: sdkName) diff --git a/Sources/SWBTestSupport/TaskConstructionTester.swift b/Sources/SWBTestSupport/TaskConstructionTester.swift index 50859c49..3859ff36 100644 --- a/Sources/SWBTestSupport/TaskConstructionTester.swift +++ b/Sources/SWBTestSupport/TaskConstructionTester.swift @@ -544,7 +544,7 @@ package final class TaskConstructionTester { break } } - // Note that the cycle reported here flows *downstream* (from producer task to output). This is the reverse of the order in which cycles emitted by llbuild are printed (which shows the output first and then its producer task). I don't remeber why I did it this way. + // Note that the cycle reported here flows *downstream* (from producer task to output). This is the reverse of the order in which cycles emitted by llbuild are printed (which shows the output first and then its producer task). I don't remember why I did it this way. Issue.record("dependency cycle found: \(cycle)", sourceLocation: sourceLocation) return } @@ -638,7 +638,7 @@ package final class TaskConstructionTester { return (try minimumDistance(from: Ref(origin), to: Ref(predecessor), successors: _successors)) } - /// Compute the shortest path from a task to a potential precessor and return the list of nodes. + /// Compute the shortest path from a task to a potential predecessor and return the list of nodes. /// /// This will *not* include edges which traverse mutated nodes. func shortestPath(from origin: any PlannedTask, to predecessor: any PlannedTask) throws -> [Ref]? { @@ -781,7 +781,7 @@ package final class TaskConstructionTester { if runDestination != nil { overrides["ONLY_ACTIVE_ARCH"] = "YES" } - // Add overrides from the parameters we were passed, which will supercede the default overrides above. + // Add overrides from the parameters we were passed, which will supersede the default overrides above. overrides.addContents(of: parameters.overrides) // Create and return the effective parameters. diff --git a/Sources/SWBTestSupport/TasksCheckingResult.swift b/Sources/SWBTestSupport/TasksCheckingResult.swift index c646ee77..d53387ae 100644 --- a/Sources/SWBTestSupport/TasksCheckingResult.swift +++ b/Sources/SWBTestSupport/TasksCheckingResult.swift @@ -263,7 +263,7 @@ extension CommandLineCheckable { // We presently don't have a method to check that a command line does not contain an array of strings in a non-contiguous block. - /// Checks that the receiver's command line does not contain the given strings as a continguous block. + /// Checks that the receiver's command line does not contain the given strings as a contiguous block. package func checkCommandLineDoesNotContainUninterrupted(_ strings: [String], sourceLocation: SourceLocation = #_sourceLocation) { if _commandLineAsStrings.contains(strings) { Issue.record("found sequence '\(strings)' in command line: \(_commandLineAsStrings.quotedDescription)", sourceLocation: sourceLocation) diff --git a/Sources/SWBTestSupport/TestWorkspaces.swift b/Sources/SWBTestSupport/TestWorkspaces.swift index 4b620666..2d8ffc0d 100644 --- a/Sources/SWBTestSupport/TestWorkspaces.swift +++ b/Sources/SWBTestSupport/TestWorkspaces.swift @@ -140,7 +140,7 @@ package final class TestFile: TestInternalStructureItem, CustomStringConvertible private let sourceTree: TestSourceTree private let expectedSignature: String? - /// We use stable GUIDs for file references, since they are indirected to. + /// We use stable GUIDs for file references, since they are referenced indirectly. /// /// Test projects are expected to not have collisions in these. package var guid: String { diff --git a/Sources/SWBUniversalPlatform/Specs/PBXCp.xcspec b/Sources/SWBUniversalPlatform/Specs/PBXCp.xcspec index 964ebc34..0c74a0f0 100644 --- a/Sources/SWBUniversalPlatform/Specs/PBXCp.xcspec +++ b/Sources/SWBUniversalPlatform/Specs/PBXCp.xcspec @@ -25,7 +25,7 @@ ); RuleFormat = "$(pbxcp_rule_name:quote) $(Output:quote) $(Input:quote)"; ExecDescription = "Copy $(InputFileName)"; - /* This description is dynamically overriden for certain rule types. */ + /* This description is dynamically overridden for certain rule types. */ ProgressDescription = "Copying $(CommandProgressByType) files"; DeeplyStatInputDirectories = YES; CaresAboutInclusionDependencies = NO; diff --git a/Sources/SWBUniversalPlatform/Specs/en.lproj/Apple Clang.strings b/Sources/SWBUniversalPlatform/Specs/en.lproj/Apple Clang.strings index 58e2b81d..8a159c12 100644 --- a/Sources/SWBUniversalPlatform/Specs/en.lproj/Apple Clang.strings +++ b/Sources/SWBUniversalPlatform/Specs/en.lproj/Apple Clang.strings @@ -465,7 +465,7 @@ In C, every `else` branch belongs to the innermost possible `if` statement, whic "[GCC_WARN_CHECK_SWITCH_STATEMENTS]-value-[YES]" = "Yes"; "[GCC_WARN_UNUSED_FUNCTION]-name" = "Unused Functions"; -"[GCC_WARN_UNUSED_FUNCTION]-description" = "Warn whenever a static function is declared but not defined or a noninline static function is unused."; +"[GCC_WARN_UNUSED_FUNCTION]-description" = "Warn whenever a static function is declared but not defined or a non-inline static function is unused."; "[GCC_WARN_UNUSED_FUNCTION]-value-[NO]" = "No"; "[GCC_WARN_UNUSED_FUNCTION]-value-[YES]" = "Yes"; @@ -664,7 +664,7 @@ The compiler may not detect all cases where an automatic variable is initialized "[GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS]-value-[YES]" = "Yes"; "[GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO]-name" = "Undefined Use of offsetof Macro"; -"[GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO]-description" = "Unchecking this setting will suppress warnings from applying the `offsetof` macro to a non-POD type. According to the 1998 ISO C++ standard, applying `offsetof` to a non-POD type is undefined. In existing C++ implementations, however, `offsetof` typically gives meaningful results even when applied to certain kinds of non-POD types, such as a simple struct that fails to be a POD type only by virtue of having a constructor. This flag is for users who are aware that they are writing nonportable code and who have deliberately chosen to ignore the warning about it. +"[GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO]-description" = "Unchecking this setting will suppress warnings from applying the `offsetof` macro to a non-POD type. According to the 1998 ISO C++ standard, applying `offsetof` to a non-POD type is undefined. In existing C++ implementations, however, `offsetof` typically gives meaningful results even when applied to certain kinds of non-POD types, such as a simple struct that fails to be a POD type only by virtue of having a constructor. This flag is for users who are aware that they are writing non-portable code and who have deliberately chosen to ignore the warning about it. The restrictions on `offsetof` may be relaxed in a future version of the C++ standard."; "[GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO]-value-[NO]" = "No"; @@ -1057,7 +1057,7 @@ The restrictions on `offsetof` may be relaxed in a future version of the C++ sta "[CLANG_ANALYZER_GCD_PERFORMANCE]-value-[YES]" = "Yes"; "[CLANG_ANALYZER_LIBKERN_RETAIN_COUNT]-name" = "Violation of IOKit and libkern Reference Counting Rules"; -"[CLANG_ANALYZER_LIBKERN_RETAIN_COUNT]-description" = "Finds leaks and overreleases associated with objects inheriting from OSObject."; +"[CLANG_ANALYZER_LIBKERN_RETAIN_COUNT]-description" = "Finds leaks and over-releases associated with objects inheriting from OSObject."; "[CLANG_ANALYZER_LIBKERN_RETAIN_COUNT]-value-[NO]" = "No"; "[CLANG_ANALYZER_LIBKERN_RETAIN_COUNT]-value-[YES]" = "Yes"; diff --git a/Sources/SWBUtil/Array.swift b/Sources/SWBUtil/Array.swift index 901b03d7..5f01ef96 100644 --- a/Sources/SWBUtil/Array.swift +++ b/Sources/SWBUtil/Array.swift @@ -152,7 +152,7 @@ extension Sequence where Element: Sendable { try await withThrowingTaskGroup(of: (Int, T).self) { group in var index = 0 for element in self { - // Expand the results arrray with initial value nil + // Expand the results array with initial value nil // which will be later be replaced with the final value results.append(nil) defer { diff --git a/Sources/SWBUtil/ByteString.swift b/Sources/SWBUtil/ByteString.swift index dc94ece6..f13375c5 100644 --- a/Sources/SWBUtil/ByteString.swift +++ b/Sources/SWBUtil/ByteString.swift @@ -15,7 +15,7 @@ public import protocol Foundation.DataProtocol /// A `ByteString` represents a sequence of bytes. /// -/// This struct provides useful operations for working with buffers of bytes. Conceptually it is just a contiguous array of bytes (UInt8), but it contains methods and default behavor suitable for common operations done using bytes strings. +/// This struct provides useful operations for working with buffers of bytes. Conceptually it is just a contiguous array of bytes (UInt8), but it contains methods and default behavior suitable for common operations done using bytes strings. /// /// This struct *is not* intended to be used for significant mutation of byte strings, we wish to retain the flexibility to micro-optimize the memory allocation of the storage (for example, by inlining the storage for small strings or and by eliminating wasted space in growable arrays). For construction of byte arrays, clients should use the `OutputByteStream` class and then convert to a `ByteString` when complete. @DebugDescription @@ -133,7 +133,7 @@ extension ByteString: ByteStreamable { } } -/// StringLiteralConvertable conformance for a ByteString. +/// StringLiteralConvertible conformance for a ByteString. extension ByteString: ExpressibleByStringLiteral { public typealias UnicodeScalarLiteralType = StringLiteralType public typealias ExtendedGraphemeClusterLiteralType = StringLiteralType diff --git a/Sources/SWBUtil/EmptyState.swift b/Sources/SWBUtil/EmptyState.swift index 1d12dadb..04bfd27b 100644 --- a/Sources/SWBUtil/EmptyState.swift +++ b/Sources/SWBUtil/EmptyState.swift @@ -18,7 +18,7 @@ public protocol EmptyState { extension EmptyState { /// Returns `nil` if this instance is considered empty, otherwise returns `self`. /// - /// This is used to aid in constructing expressions of form `x.isEmpty ? x : y` where `x` is a complex exression, by allowing it to be instead written as `x.nilIfEmpty ?? y`. + /// This is used to aid in constructing expressions of form `x.isEmpty ? x : y` where `x` is a complex expression, by allowing it to be instead written as `x.nilIfEmpty ?? y`. public var nilIfEmpty: Self? { return isEmpty ? nil : self } diff --git a/Sources/SWBUtil/FSProxy.swift b/Sources/SWBUtil/FSProxy.swift index 5b9d7fc1..817b7c73 100644 --- a/Sources/SWBUtil/FSProxy.swift +++ b/Sources/SWBUtil/FSProxy.swift @@ -123,7 +123,7 @@ public enum FileSystemMode: Sendable { /// /// This protocol is used to allow one part of the codebase to interact with a natural filesystem interface, while still allowing clients to transparently substitute a virtual file system or redirect file system operations. /// -/// NOTE: All of these APIs are sychnronous and could block. +/// NOTE: All of these APIs are synchronous and could block. // // FIXME: This API needs error handling support. // @@ -1079,7 +1079,7 @@ public class PseudoFS: FSProxy, @unchecked Sendable { public let fileSystemMode: FileSystemMode - /// The root filesytem. + /// The root filesystem. private var root: Node public init(ignoreFileSystemDeviceInodeChanges: Bool = UserDefaults.ignoreFileSystemDeviceInodeChanges) { diff --git a/Sources/SWBUtil/HashContext.swift b/Sources/SWBUtil/HashContext.swift index b36c7280..40e2841a 100644 --- a/Sources/SWBUtil/HashContext.swift +++ b/Sources/SWBUtil/HashContext.swift @@ -147,7 +147,7 @@ fileprivate final class SwiftCryptoHashContext: HashContext { extension SwiftCryptoHashContext: Sendable { } #endif -/// Convert a hexadecimal digit to a lowecase ASCII character value. +/// Convert a hexadecimal digit to a lowercase ASCII character value. private func hexchar(_ value: UInt8) -> UInt8 { assert(value >= 0 && value < 16) if value < 10 { diff --git a/Sources/SWBUtil/Int.swift b/Sources/SWBUtil/Int.swift index 1a9ddce0..83dfeae2 100644 --- a/Sources/SWBUtil/Int.swift +++ b/Sources/SWBUtil/Int.swift @@ -16,7 +16,7 @@ extension Int { return String(format: format, self) } - /// Returns a string form of the receiver as an adjective, e.g. 1st, 2nd, 3rd, 4th, th. This only makes grammatical sense for positive integers, but is supported for nonpositive integers for ease of use. + /// Returns a string form of the receiver as an adjective, e.g. 1st, 2nd, 3rd, 4th, th. This only makes grammatical sense for positive integers, but is supported for non-positive integers for ease of use. public var asOrdinal: String { let tensDigit = self / 10 % 10 switch self % 10 { @@ -38,7 +38,7 @@ extension UInt { return String(format: format, self) } - /// Returns a string form of the receiver as an adjective, e.g. 1st, 2nd, 3rd, 4th, th. This only makes grammatical sense for positive integers, but is supported for nonpositive integers for ease of use. + /// Returns a string form of the receiver as an adjective, e.g. 1st, 2nd, 3rd, 4th, th. This only makes grammatical sense for positive integers, but is supported for non-positive integers for ease of use. public var asOrdinal: String { let tensDigit = self / 10 % 10 switch self % 10 { diff --git a/Sources/SWBUtil/MachO.swift b/Sources/SWBUtil/MachO.swift index 3dd34c0e..275394f8 100644 --- a/Sources/SWBUtil/MachO.swift +++ b/Sources/SWBUtil/MachO.swift @@ -34,7 +34,7 @@ public import struct Foundation.Data public import struct Foundation.UUID public enum SwiftABIVersion: Equatable, Hashable, Sendable { - /// For compatiblity, we still need to deal with the unstable ABI for Swift <5. + /// For compatibility, we still need to deal with the unstable ABI for Swift <5. case unstable(Int) /// All future version of Swift >= 5 will use a stable ABI. @@ -154,7 +154,7 @@ public struct BuildVersion: Equatable, Hashable, Sendable { /// The minimum OS version supported. public let minOSVersion: Version - /// The SDK version that is targetted. + /// The SDK version that is targeted. public let sdkVersion: Version } @@ -192,7 +192,7 @@ extension Set where Element == BuildVersion.Platform { case 2 where self == [.macOS, .macCatalyst]: return "macOS (zippered)" default: - // Multiple load commands (except the zippered case above) is defined as an invalid Mach-O, but historically many developers have used `lipo` to form "universal" static libraries for device and simlator platforms, and this is very common so make sure to show a good diagnostic for it. + // Multiple load commands (except the zippered case above) is defined as an invalid Mach-O, but historically many developers have used `lipo` to form "universal" static libraries for device and simulator platforms, and this is very common so make sure to show a good diagnostic for it. return sorted(by: \.rawValue).map { $0.displayName(infoLookup: infoLookup) }.joined(separator: " + ") } } @@ -205,7 +205,7 @@ public protocol BinaryDataType { init() } -/// Providesa protocol for working with binary data that can be read from. +/// Provides a protocol for working with binary data that can be read from. public protocol BinaryData { /// Reads the binary data at the given offset. func read(from offset: Int) throws -> T @@ -440,7 +440,7 @@ public enum BinaryReaderError: Error, CustomStringConvertible { /// Expresses an out-of-range error while attempting to read a structure from the binary data. case invalidRead(startingAt: Int, type: Any.Type, typeSize: Int, dataSize: Int) - /// Expressess an error while attempting to seek within the binary data. + /// Expresses an error while attempting to seek within the binary data. case invalidSeek(cursor: BinaryReader.Cursor, numberOfBytes: Int) /// Output a friendly description of the error. @@ -584,7 +584,7 @@ public protocol MachOFatHeader { func offset(byteSwappedIfNeeded swap: Bool) -> UInt64 func size(byteSwappedIfNeeded swap: Bool) -> UInt64 - // The reserved field is intentially left missing from here for fat_arch_64. + // The reserved field is intentionally left missing from here for fat_arch_64. var structSize: Int { get } } @@ -634,7 +634,7 @@ public protocol MachOHeader { var sizeofcmds: UInt32 { get } var flags: UInt32 { get } - // The reserved field is intentially left missing from here for mach_header_64. + // The reserved field is intentionally left missing from here for mach_header_64. var structSize: Int { get } } @@ -866,7 +866,7 @@ public final class MachO { } return (slices, linkage) } catch MachOError.staticArchive { - // Since we've encounted a potential static archive, attempt to re-read it and implicitly unwrap its slices. + // Since we've encountered a potential static archive, attempt to re-read it and implicitly unwrap its slices. let archive = try StaticArchive(reader: BinaryReader(data: reader.data, startingAt: 0)) return (try archive.machOs().flatMap { try $0.slices() }, .static) } @@ -882,7 +882,7 @@ public final class MachO { /// in turn each contains a series of Mach-O object files. /// /// If the root file is a thin Mach-O file, the `MachO` object will - /// simply contain a single `Slice` reprenting the thin Mach-O file itself. + /// simply contain a single `Slice` representing the thin Mach-O file itself. public struct Slice { private let reader: BinaryReader private let header: Header diff --git a/Sources/SWBUtil/PropertyList.swift b/Sources/SWBUtil/PropertyList.swift index 53bed42e..8479ec41 100644 --- a/Sources/SWBUtil/PropertyList.swift +++ b/Sources/SWBUtil/PropertyList.swift @@ -925,7 +925,7 @@ extension PropertyListSerialization { /// This is a shim NSDictionary implementation which we use to vend a stable (sorted key order) view of an underlying dictionary. /// - /// This is *NOT* intended to be a general purpose NSDictionary subclass, it is only intended to be used with property list serialiation. + /// This is *NOT* intended to be a general purpose NSDictionary subclass, it is only intended to be used with property list serialization. final class SWBStablePropertyListDictionary: NSDictionary { private var dictionary = NSDictionary() private var orderedKeys = NSArray() diff --git a/Sources/SWBUtil/ScopedKeepAliveCache.swift b/Sources/SWBUtil/ScopedKeepAliveCache.swift index 2aecce02..1c5059d9 100644 --- a/Sources/SWBUtil/ScopedKeepAliveCache.swift +++ b/Sources/SWBUtil/ScopedKeepAliveCache.swift @@ -20,7 +20,7 @@ public final class ScopedKeepAliveCache private struct State { - /// Tracks the number of active invoations of `keepAlive` + /// Tracks the number of active invocations of `keepAlive` var keepAliveCount = UInt(0) /// Used to store cache entries when `keepAlive` is active diff --git a/Sources/SWBUtil/Serialization.swift b/Sources/SWBUtil/Serialization.swift index db494eb7..ad9ecfa5 100644 --- a/Sources/SWBUtil/Serialization.swift +++ b/Sources/SWBUtil/Serialization.swift @@ -679,7 +679,7 @@ extension PendingSerializableCodable { // MARK: PolymorphicSerializable protocol. -/// Protocol for types which can be serialized as polymorphic elements, where the type of each element is read during deserialization so the correct class or struct can be instatiated. The top-level class typically will implement `classForCode()` to return the class to be instantiated based on the code it is passed by the deserializer, while all classes will implement the other methods. Each class should return a unique value for `serializableTypeCode`, although this is not enforced. +/// Protocol for types which can be serialized as polymorphic elements, where the type of each element is read during deserialization so the correct class or struct can be instantiated. The top-level class typically will implement `classForCode()` to return the class to be instantiated based on the code it is passed by the deserializer, while all classes will implement the other methods. Each class should return a unique value for `serializableTypeCode`, although this is not enforced. /// /// Elements of these types will be wrapped in a `PolymorphicSerializableWrapper` struct to be serialized. They should never be serialized directly (which is why this protocol does not adopt `Serializable`). /// diff --git a/Sources/SWBUtil/Signatures.swift b/Sources/SWBUtil/Signatures.swift index 6c07384d..f9997d22 100644 --- a/Sources/SWBUtil/Signatures.swift +++ b/Sources/SWBUtil/Signatures.swift @@ -23,7 +23,7 @@ public struct CodeSignatureInfo: Codable, Sendable { enum CodingKeys: String, CodingKey { case isSigned = "signed" - case identifier = "bundleIndentifier" + case identifier = "bundleIndentifier" // NOTE: bundle identifier is mis-spelled case mainExecutable = "mainExecutable" case source = "source" case runtimeVersion = "runtimeVersion" diff --git a/Sources/SWBUtil/String.swift b/Sources/SWBUtil/String.swift index c869fbab..6069c5ef 100644 --- a/Sources/SWBUtil/String.swift +++ b/Sources/SWBUtil/String.swift @@ -233,17 +233,17 @@ public extension String { return result } - /// Transform the receiver to a legal C identifer and return it. This will replace characters which are not legal in a C identifier with underscores ('`_`'). C identifiers allow underscores, but not periods or dashes. + /// Transform the receiver to a legal C identifier and return it. This will replace characters which are not legal in a C identifier with underscores ('`_`'). C identifiers allow underscores, but not periods or dashes. var asLegalCIdentifier: String { return asIdentifierOfType(.c) } - /// Transform the receiver to a legal RFC 1034 identifer and return it. This will replace characters which are not legal in an RFC 1034 identifier with dashes ('`-`'). RFC 1034 identifiers allow dashes but not periods or underscores. + /// Transform the receiver to a legal RFC 1034 identifier and return it. This will replace characters which are not legal in an RFC 1034 identifier with dashes ('`-`'). RFC 1034 identifiers allow dashes but not periods or underscores. var asLegalRfc1034Identifier: String { return asIdentifierOfType(.rfc1034) } - /// Transform the receiver to a legal bundle identifer and return it. This will replace characters which are not legal in a bundle identifier with underscores ('`_`'). Bundle identifiers allow periods and dashes but not underscores. + /// Transform the receiver to a legal bundle identifier and return it. This will replace characters which are not legal in a bundle identifier with underscores ('`_`'). Bundle identifiers allow periods and dashes but not underscores. var asLegalBundleIdentifier: String { return asIdentifierOfType(.bundle) } @@ -378,7 +378,7 @@ fileprivate extension Unicode.Scalar { } } -// MARK: Quoted String List Represenatation +// MARK: Quoted String List Representation /// Extension of String for quoted string list representation. This isn't exactly the same as shell script quoting. public extension String { diff --git a/Sources/SWBUtil/Version.swift b/Sources/SWBUtil/Version.swift index 7eedbb8a..70bafbe0 100644 --- a/Sources/SWBUtil/Version.swift +++ b/Sources/SWBUtil/Version.swift @@ -20,7 +20,7 @@ public struct Version: CustomStringConvertible, Sendable { /// The raw components that make up the version. public let rawValue: RawValue - /// Initialize a `Version` from the given `rawValue`. This is a convience form as there are no failable constructs for `Version`. + /// Initialize a `Version` from the given `rawValue`. This is a convenience form as there are no failable constructs for `Version`. public init(_ rawValue: RawValue) { self.rawValue = rawValue } diff --git a/Sources/SWBUtil/fnmatch.swift b/Sources/SWBUtil/fnmatch.swift index 77568b1c..0e8eb102 100644 --- a/Sources/SWBUtil/fnmatch.swift +++ b/Sources/SWBUtil/fnmatch.swift @@ -48,7 +48,7 @@ private extension StringProtocol { /// Multi-platform fnmatch implementation. This is intended to be a close match the the POSIX fnmatch of all platforms including Windows (though not all options are supported). /// -/// - parameter pattern: The pattern to match. When using the ``FnmatchOptions/pathname`` option, any path representation in the pattern is expected to use the POSIX path separator (`/`) to match with the input, and on Windows, the path seperator (`/`) will be matched to either separator in the input string ( both `/` and `\` will be matched). +/// - parameter pattern: The pattern to match. When using the ``FnmatchOptions/pathname`` option, any path representation in the pattern is expected to use the POSIX path separator (`/`) to match with the input, and on Windows, the path separator (`/`) will be matched to either separator in the input string ( both `/` and `\` will be matched). /// - parameter input: The input string to match. /// - parameter options: The ``FnmatchOptions`` to use. /// - returns: `true` if the pattern matches the input, `false` otherwise. diff --git a/Sources/SwiftBuild/ProjectModel/References.swift b/Sources/SwiftBuild/ProjectModel/References.swift index 2c1b6816..cc4cd8a8 100644 --- a/Sources/SwiftBuild/ProjectModel/References.swift +++ b/Sources/SwiftBuild/ProjectModel/References.swift @@ -16,7 +16,7 @@ import SWBProtocol extension ProjectModel { // MARK: - References - /// Base enum for all items in the group hierarhcy. + /// Base enum for all items in the group hierarchy. public enum Reference: Sendable, Hashable { /// Determines the base path for a reference's relative path. public enum RefPathBase: String, Sendable, Hashable, Codable { diff --git a/Sources/SwiftBuild/SWBBuildServiceConnection.swift b/Sources/SwiftBuild/SWBBuildServiceConnection.swift index ce0426a6..afbdbdab 100644 --- a/Sources/SwiftBuild/SWBBuildServiceConnection.swift +++ b/Sources/SwiftBuild/SWBBuildServiceConnection.swift @@ -249,7 +249,7 @@ typealias swb_build_service_connection_message_handler_t = @Sendable (UInt64, SW } } - /// Suspends the connection (but doesn’t terminate or even suspend the Swift Build service process). After suspending the connection, no futher messages will be dispatched until it is resumed again. Does nothing if the connection is already suspended. + /// Suspends the connection (but doesn’t terminate or even suspend the Swift Build service process). After suspending the connection, no further messages will be dispatched until it is resumed again. Does nothing if the connection is already suspended. public func suspend() { // If we are already suspended, do nothing. // Otherwise, mark the connection as suspended. @@ -382,7 +382,7 @@ extension SWBBuildServiceConnection { } } - /// Enqueues `data` to be sent on the specified channel, and returns immediately. The channel must be one that has already been opened using the `openChannel(messageHandler:)` method, and it must not have been closed again. Any replies will be sent to the block that was associated with the channed when it was opened. It is valid for `data` to be empty, but not to be `nil`. + /// Enqueues `data` to be sent on the specified channel, and returns immediately. The channel must be one that has already been opened using the `openChannel(messageHandler:)` method, and it must not have been closed again. Any replies will be sent to the block that was associated with the channel when it was opened. It is valid for `data` to be empty, but not to be `nil`. func send(_ data: SWBDispatchData, onChannel channel: UInt64) { // Immediately reply with an error if the service has been terminated. // We only do this for "real" channels; the zero channel is used for special one-way messages. @@ -842,7 +842,7 @@ fileprivate final class OutOfProcessConnection: ConnectionTransport { var updatedEnvironment = ProcessInfo.processInfo.environment // Add the contents of the SWBBuildServiceEnvironmentOverrides user default. updatedEnvironment = updatedEnvironment.addingContents(of: (UserDefaults.standard.dictionary(forKey: "SWBBuildServiceEnvironmentOverrides") as? [String: String]) ?? [:]) - // Remove inferior DYLD_LIBRARY_PATH paths into toolchains, or which contain a compiler library known to cause issues when mismatched. Swift Build does not need these when used by an inferior Xcode, and they can intefere with loading of correct clang and swift libraries. + // Remove inferior DYLD_LIBRARY_PATH paths into toolchains, or which contain a compiler library known to cause issues when mismatched. Swift Build does not need these when used by an inferior Xcode, and they can interfere with loading of correct clang and swift libraries. if let libraryPaths = updatedEnvironment["DYLD_LIBRARY_PATH"]?.components(separatedBy: ":") { updatedEnvironment["DYLD_LIBRARY_PATH"] = try libraryPaths.filter { var path = Path($0).normalize() diff --git a/Sources/SwiftBuildTestSupport/CoreQualificationTester.swift b/Sources/SwiftBuildTestSupport/CoreQualificationTester.swift index fc0bd337..8495d9ff 100644 --- a/Sources/SwiftBuildTestSupport/CoreQualificationTester.swift +++ b/Sources/SwiftBuildTestSupport/CoreQualificationTester.swift @@ -83,7 +83,7 @@ final package class CoreQualificationTester: Sendable { try loggedEvents.append(String(decoding: JSONEncoder(outputFormatting: [.sortedKeys, .withoutEscapingSlashes]).encode(event), as: UTF8.self)) } - // TODO: Longer term, we should find a way to share code with BuildOperationTester, which has a number of APIs for building up a human readable build transscript. + // TODO: Longer term, we should find a way to share code with BuildOperationTester, which has a number of APIs for building up a human readable build transcript. //activity.attach(name: "Event Log", plistObject: loggedEvents) //activity.attach(name: "Diagnostics", plistObject: diagnostics.map { $0.description }) //activity.attach(name: "Output", string: events.allOutput().bytes.unsafeStringValue) diff --git a/SwiftBuild.docc/Development/test-development-project-tests.md b/SwiftBuild.docc/Development/test-development-project-tests.md index 36cd4695..00731525 100644 --- a/SwiftBuild.docc/Development/test-development-project-tests.md +++ b/SwiftBuild.docc/Development/test-development-project-tests.md @@ -74,7 +74,7 @@ These test methods are normally placed in a test class derived from `XCTestCase` ## Evaluation -The next phase invoves building the project, which requires setting up a test harness which operates on the project or workspace set up in the previous section, and allows operations to be performed on it. +The next phase involves building the project, which requires setting up a test harness which operates on the project or workspace set up in the previous section, and allows operations to be performed on it. For task construction tests, create a `TaskConstructionTester`: diff --git a/SwiftBuild.docc/TaskConstruction/mergeable-libraries.md b/SwiftBuild.docc/TaskConstruction/mergeable-libraries.md index a2739ff7..29637366 100644 --- a/SwiftBuild.docc/TaskConstruction/mergeable-libraries.md +++ b/SwiftBuild.docc/TaskConstruction/mergeable-libraries.md @@ -23,7 +23,7 @@ In debug builds: * When those target dependency products are embedded in either the merged binary product, or into a product containing the merged binary product, then their binaries will not be included in the embedded copy. (I.e., same as the release case.) * Those target dependency products will also be copied into a special location in the merged binary product, but containing only their binary, and the merged binary product will have an additional `@rpath` into that location. -The goal of the debug workflow is to imitate the release workflow, but without the additional cost of creating the mergeable metadata and performing the merge of all of the libraries. This could someday change if the overhead of that work is determined to be small enough. This imitiative behavior is intended to prevent developers from accidentally adding a dependency in their project to one of the mergeable libraries, and then wonder why that dependency causes the app to crash in release builds because the mergeable library is missing (since its content was merged into the merged binary). +The goal of the debug workflow is to imitate the release workflow, but without the additional cost of creating the mergeable metadata and performing the merge of all of the libraries. This could someday change if the overhead of that work is determined to be small enough. This imitative behavior is intended to prevent developers from accidentally adding a dependency in their project to one of the mergeable libraries, and then wonder why that dependency causes the app to crash in release builds because the mergeable library is missing (since its content was merged into the merged binary). ## Implementation diff --git a/Tests/SWBBuildSystemTests/BuildCommandTests.swift b/Tests/SWBBuildSystemTests/BuildCommandTests.swift index 1a55eee6..0a093d51 100644 --- a/Tests/SWBBuildSystemTests/BuildCommandTests.swift +++ b/Tests/SWBBuildSystemTests/BuildCommandTests.swift @@ -20,7 +20,7 @@ import Testing /// Tests the behavior of various alternative build commands of a build request, including single-file compiles. @Suite fileprivate struct BuildCommandTests: CoreBasedTests { - /// Check compilation of a single file in C, ObjC and Swift, including the `uniquingSuffix` behaviour. + /// Check compilation of a single file in C, ObjC and Swift, including the `uniquingSuffix` behavior. @Test(.requireSDKs(.host)) func singleFileCompile() async throws { try await withTemporaryDirectory { tmpDirPath async throws -> Void in @@ -333,4 +333,4 @@ fileprivate struct BuildCommandTests: CoreBasedTests { } } } -} \ No newline at end of file +} diff --git a/Tests/SWBBuildSystemTests/BuildOperationTests.swift b/Tests/SWBBuildSystemTests/BuildOperationTests.swift index 635268c0..e4865bd0 100644 --- a/Tests/SWBBuildSystemTests/BuildOperationTests.swift +++ b/Tests/SWBBuildSystemTests/BuildOperationTests.swift @@ -1734,13 +1734,13 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script stream <<< "magic string\n" } - let overridenParameters = BuildParameters(configuration: "Debug", overrides: [ + let overriddenParameters = BuildParameters(configuration: "Debug", overrides: [ "FUSE_BUILD_SCRIPT_PHASES": "NO", "FAKE_PATH_OUT": Path(SRCROOT).join("aProject/magic.txt").str ]) // Check the initial build. - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that the expected tasks ran. results.consumeTasksMatchingRuleTypes(["CreateBuildDirectory", "Gate"]) @@ -1774,7 +1774,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script // We should avoid scheduling upstream/downstream tasks. try await tester.fs.updateTimestamp(Path(SRCROOT).join("aProject/magic.txt")) - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that the script ran. results.consumeTasksMatchingRuleTypes(["Gate"]) @@ -1783,7 +1783,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script results.checkNoDiagnostics() } - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that the script ran. results.consumeTasksMatchingRuleTypes(["Gate"]) @@ -1798,7 +1798,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script stream <<< "modified string" } - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that the script ran. results.consumeTasksMatchingRuleTypes(["Gate"]) @@ -1818,7 +1818,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script // We must re-run the script to re-create the file try tester.fs.remove(Path(SRCROOT).join("aProject/magic.txt")) - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that the script ran. results.consumeTasksMatchingRuleTypes(["Gate"]) @@ -1913,13 +1913,13 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script stream <<< "magic string\n" } - let overridenParameters = BuildParameters(configuration: "Debug", overrides: [ + let overriddenParameters = BuildParameters(configuration: "Debug", overrides: [ "FAKE_PATH_IN": Path(SRCROOT).join("aProject/magic.txt").str, "FUSE_BUILD_SCRIPT_PHASES": "NO" ]) // Check the initial build. - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that the expected tasks ran. results.consumeTasksMatchingRuleTypes(["CreateBuildDirectory", "Gate"]) @@ -1956,7 +1956,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script results.checkNoDiagnostics() } - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in results.consumeTasksMatchingRuleTypes(["Gate"]) results.checkNoTask() } @@ -1965,7 +1965,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script stream <<< "magic modified string" } - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that the script ran. results.consumeTasksMatchingRuleTypes(["Gate"]) @@ -1984,7 +1984,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script stream <<< "supermagic string" } - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that the script ran. results.consumeTasksMatchingRuleTypes(["Gate"]) @@ -3705,7 +3705,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script """ } - // Write a basebones Info.plist file. + // Write a barebones Info.plist file. try await tester.fs.writePlist(testWorkspace.sourceRoot.join("TestProject/Info.plist"), .plDict([ "CFBundleDevelopmentRegion": .plString("en"), "CFBundleExecutable": .plString("$(EXECUTABLE_NAME)") @@ -3779,7 +3779,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script #expect(dependencyInfo.version == expectedDependencyInfo.version) XCTAssertSuperset(Set(dependencyInfo.inputs), Set(expectedDependencyInfo.inputs)) - // Ensure that the depenedency info is correct. Due to the changing nature of how Swift overlays are added, there is no need to be explicit about each one, so only the mechanism is validated by checking a handful of stable Swift overlays. + // Ensure that the dependency info is correct. Due to the changing nature of how Swift overlays are added, there is no need to be explicit about each one, so only the mechanism is validated by checking a handful of stable Swift overlays. if shouldFilterSwiftLibs && !shouldBackDeploySwiftConcurrency { #expect(dependencyInfo == expectedDependencyInfo) } @@ -3824,7 +3824,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script #expect(unitTestsDependencyInfo.version == unitTestsExpectedDependencyInfo.version) XCTAssertSuperset(Set(unitTestsDependencyInfo.inputs), Set(unitTestsExpectedDependencyInfo.inputs)) - // Ensure that the depenedency info is correct. Due to the changing nature of how Swift overlays are added, there is no need to be explicit about each one, so only the mechanism is validated by checking a handful of stable Swift overlays. + // Ensure that the dependency info is correct. Due to the changing nature of how Swift overlays are added, there is no need to be explicit about each one, so only the mechanism is validated by checking a handful of stable Swift overlays. if shouldFilterSwiftLibs && !shouldBackDeploySwiftConcurrency { #expect(unitTestsDependencyInfo == unitTestsExpectedDependencyInfo) } @@ -3993,7 +3993,7 @@ That command depends on command in Target 'agg2' (project \'aProject\'): script contents <<< "}\n" } - // Write a basebones Info.plist file. + // Write a barebones Info.plist file. try await tester.fs.writePlist(testWorkspace.sourceRoot.join("TestProject/Info.plist"), .plDict([ "CFBundleDevelopmentRegion": .plString("en"), "CFBundleExecutable": .plString("$(EXECUTABLE_NAME)") diff --git a/Tests/SWBBuildSystemTests/BuildTaskBehaviorTests.swift b/Tests/SWBBuildSystemTests/BuildTaskBehaviorTests.swift index d276f02e..ff66d057 100644 --- a/Tests/SWBBuildSystemTests/BuildTaskBehaviorTests.swift +++ b/Tests/SWBBuildSystemTests/BuildTaskBehaviorTests.swift @@ -558,7 +558,7 @@ fileprivate struct BuildTaskBehaviorTests: CoreBasedTests { let testNode = MakePlannedPathNode(testPath) let initialVirtualNode = MakePlannedVirtualNode("") - // We intentially declare these using mustPrecede to validate those edges are checked for chaining. + // We intentionally declare these using mustPrecede to validate those edges are checked for chaining. let append1VirtualNode = MakePlannedVirtualNode("") let append1Task = createTask(ruleInfo: ["APPEND-1"], commandLine: ["builtin-append-contents"], inputs: [testNode], outputs: [testNode, append1VirtualNode], mustPrecede: [], action: AppendingTaskAction(contents: ", world", to: testNode)) let initialTaskAction = MockTaskAction(contents: "Hello", output: testNode) @@ -676,7 +676,7 @@ fileprivate struct BuildTaskBehaviorTests: CoreBasedTests { let testNode = MakePlannedPathNode(testPath) let initialVirtualNode = MakePlannedVirtualNode("") - // We intentially declare these using mustPrecede to validate those edges are checked for chaining. + // We intentionally declare these using mustPrecede to validate those edges are checked for chaining. let initialTaskAction = MockTaskAction(contents: "Hello", output: testNode) let initialTask = createTask(ruleInfo: ["INITIAL"], commandLine: ["builtin-create-file"], inputs: [], outputs: [testNode, initialVirtualNode], mustPrecede: [], action: initialTaskAction, preparesForIndexing: true) let append1VirtualNode = MakePlannedVirtualNode("") diff --git a/Tests/SWBBuildSystemTests/ClangModuleVerifierTests.swift b/Tests/SWBBuildSystemTests/ClangModuleVerifierTests.swift index 4e88ed8b..90f56f53 100644 --- a/Tests/SWBBuildSystemTests/ClangModuleVerifierTests.swift +++ b/Tests/SWBBuildSystemTests/ClangModuleVerifierTests.swift @@ -158,7 +158,7 @@ fileprivate struct ClangModuleVerifierTests: CoreBasedTests { #include """) - // A regular build will just build the currect architecture. + // A regular build will just build the correct architecture. try await tester.checkBuild(persistent: true) { results in results.checkNoDiagnostics() @@ -254,7 +254,7 @@ fileprivate struct ClangModuleVerifierTests: CoreBasedTests { #include """) - // A regular build will just build the currect architecture. + // A regular build will just build the correct architecture. try await tester.checkBuild(persistent: true) { results in // There are no non-verification PrecompileModule tasks. results.checkNoTask(.matchRuleType("PrecompileModule")) diff --git a/Tests/SWBBuildSystemTests/DevelopmentAssetsDiagnosticTests.swift b/Tests/SWBBuildSystemTests/DevelopmentAssetsDiagnosticTests.swift index b0671a68..6984b6a8 100644 --- a/Tests/SWBBuildSystemTests/DevelopmentAssetsDiagnosticTests.swift +++ b/Tests/SWBBuildSystemTests/DevelopmentAssetsDiagnosticTests.swift @@ -342,7 +342,7 @@ fileprivate struct DevelopmentAssetsDiagnosticTests: CoreBasedTests { } @Test(.requireSDKs(.macOS)) - func developmentAssetsOverridenSRCROOT() async throws { + func developmentAssetsOverriddenSRCROOT() async throws { try await withTemporaryDirectory { tmpDirPath in // Some environments override SRCROOT but that shouldn't interfer with relative paths in DEVELOPMENT_ASSET_PATHS since they are based in PROJECT_DIR let testProject = TestProject( diff --git a/Tests/SWBBuildSystemTests/DiscoveredDependenciesBuildOperationTests.swift b/Tests/SWBBuildSystemTests/DiscoveredDependenciesBuildOperationTests.swift index 32f955d9..c46c354f 100644 --- a/Tests/SWBBuildSystemTests/DiscoveredDependenciesBuildOperationTests.swift +++ b/Tests/SWBBuildSystemTests/DiscoveredDependenciesBuildOperationTests.swift @@ -232,7 +232,7 @@ fileprivate struct DiscoveredDependenciesBuildOperationTests: CoreBasedTests { try await tester.checkBuild(persistent: true, serial: true) { results in // We should rebuild Dep, recopy its .swiftmodule, rebuild the client, and relink both. // - // FIXME: Why doesn't this trigger the bug where we sometiems stat the module ahead of when it is needed? That was the purpose of this test so we need to get this to fail more before we fix it. + // FIXME: Why doesn't this trigger the bug where we sometimes stat the module ahead of when it is needed? That was the purpose of this test so we need to get this to fail more before we fix it. results.consumeTasksMatchingRuleTypes(["Gate"]) checkDriverContainerTasks(results) diff --git a/Tests/SWBBuildSystemTests/EntitlementsBuildOperationTests.swift b/Tests/SWBBuildSystemTests/EntitlementsBuildOperationTests.swift index ded1b871..439060f3 100644 --- a/Tests/SWBBuildSystemTests/EntitlementsBuildOperationTests.swift +++ b/Tests/SWBBuildSystemTests/EntitlementsBuildOperationTests.swift @@ -374,7 +374,7 @@ fileprivate struct EntitlementsBuildOperationTests: CoreBasedTests { let parameters = BuildParameters(action: .build, configuration: "Debug") let entitlements: PropertyListItem = [ - // Specify jsut the baseline entitlements, since other entitlements should be added via build settings. + // Specify just the baseline entitlements, since other entitlements should be added via build settings. "com.apple.application-identifier": "$(AppIdentifierPrefix)$(CFBundleIdentifier)", ] let provisioningInputs = ["App": ProvisioningTaskInputs(identityHash: "-", signedEntitlements: entitlements, simulatedEntitlements: entitlements)] @@ -438,7 +438,7 @@ fileprivate struct EntitlementsBuildOperationTests: CoreBasedTests { // Perform the initial for-launch build. let parameters = BuildParameters(action: .build, configuration: "Debug") let entitlements: PropertyListItem = [ - // Specify jsut the baseline entitlements, since other entitlements should be added via build settings. + // Specify just the baseline entitlements, since other entitlements should be added via build settings. "com.apple.application-identifier": "$(AppIdentifierPrefix)$(CFBundleIdentifier)", ] let provisioningInputs = ["App": ProvisioningTaskInputs(identityHash: "-", signedEntitlements: entitlements, simulatedEntitlements: [:])] diff --git a/Tests/SWBBuildSystemTests/IndexBuildOperationTests.swift b/Tests/SWBBuildSystemTests/IndexBuildOperationTests.swift index 6e8475de..ca834e51 100644 --- a/Tests/SWBBuildSystemTests/IndexBuildOperationTests.swift +++ b/Tests/SWBBuildSystemTests/IndexBuildOperationTests.swift @@ -1480,7 +1480,7 @@ fileprivate struct IndexBuildOperationTests: CoreBasedTests { try await checkBuild(macosFramework, .macOS, discriminator: "macos", matchingTarget: macosFramework) try await checkBuild(iosFramework, .iOS, discriminator: "iphoneos", matchingTarget: iosFramework) - // No run destination match, macos because it's lexographically-first + // No run destination match, macos because it's lexicographically-first try await checkBuild(macosFramework, .watchOS, discriminator: "macos", matchingTarget: macosFramework) try await checkBuild(iosFramework, .watchOS, discriminator: "macos", matchingTarget: macosFramework) } diff --git a/Tests/SWBBuildSystemTests/OnDemandResourcesTests.swift b/Tests/SWBBuildSystemTests/OnDemandResourcesTests.swift index 8f7a9e26..52067475 100644 --- a/Tests/SWBBuildSystemTests/OnDemandResourcesTests.swift +++ b/Tests/SWBBuildSystemTests/OnDemandResourcesTests.swift @@ -587,7 +587,7 @@ fileprivate struct OnDemandResourcesTests: CoreBasedTests { try await withTemporaryDirectory { tmpDirPath in let srcRoot = tmpDirPath.join("srcroot") - // Create the project and teter to use. + // Create the project and tester to use. let tester = try await createODRProjectAndTester(srcRoot) let fs = tester.fs diff --git a/Tests/SWBBuildSystemTests/ShellScriptSandboxingTests.swift b/Tests/SWBBuildSystemTests/ShellScriptSandboxingTests.swift index 0fdb4ad8..c144cb57 100644 --- a/Tests/SWBBuildSystemTests/ShellScriptSandboxingTests.swift +++ b/Tests/SWBBuildSystemTests/ShellScriptSandboxingTests.swift @@ -118,10 +118,10 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { stream <<< "Hello World!\n" } - let overridenParameters = BuildParameters(configuration: "Debug") + let overriddenParameters = BuildParameters(configuration: "Debug") // Ensure content of checksum*.txt is 8ddd8be4b179a529afa5f2ffae4b9858 with no violation. - try await tester.checkBuild(parameters: overridenParameters) { results in + try await tester.checkBuild(parameters: overriddenParameters) { results in results.checkNoDiagnostics() try results.checkTask(.matchRuleType("PhaseScriptExecution"), .matchRuleItemPattern(.contains("ChecksumFileInRootViaAbsolutePath"))) { task in @@ -241,10 +241,10 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { stream <<< "Hello World!\n" } - let overridenParameters = BuildParameters(configuration: "Debug") + let overriddenParameters = BuildParameters(configuration: "Debug") // Clean build: Ensure content of checksum*.txt is 8ddd8be4b179a529afa5f2ffae4b9858 with no violation. - try await tester.checkBuild(parameters: overridenParameters) { results in + try await tester.checkBuild(parameters: overriddenParameters) { results in try results.checkTask(.matchRuleType("PhaseScriptExecution"), .matchRuleItemPattern(.contains("TaskA"))) { task in #expect(task.commandLine.first == "/usr/bin/sandbox-exec") @@ -256,7 +256,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Null build - try await tester.checkBuild(parameters: overridenParameters) { results in + try await tester.checkBuild(parameters: overriddenParameters) { results in results.checkNoTask() results.checkNoDiagnostics() } @@ -266,7 +266,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { stream <<< "Hola Amigos\n" } - try await tester.checkBuild(parameters: overridenParameters) { results in + try await tester.checkBuild(parameters: overriddenParameters) { results in try results.checkTask(.matchRuleType("PhaseScriptExecution"), .matchRuleItemPattern(.contains("TaskA"))) { task in let path = task.outputPaths[0].withoutTrailingSlash() let checksum = try tester.fs.read(path).asString @@ -431,7 +431,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { let tester = try await BuildOperationTester(getCore(), testWorkspace, simulated: false, continueBuildingAfterErrors: false) let SRCROOT = tester.workspace.projects[0].sourceRoot.str - let overridenParameters = BuildParameters(configuration: "Debug") + let overriddenParameters = BuildParameters(configuration: "Debug") // Write initial files to disk try await tester.fs.writeFileContents(Path(SRCROOT).join("myCryptoProject/raw/libX.fake-h")) { stream in @@ -447,7 +447,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Check clean build - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -473,7 +473,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Check null build after first clean build - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in results.checkNoDiagnostics() results.consumeTasksMatchingRuleTypes(["Gate"]) results.checkNoTask() @@ -485,7 +485,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Ensure changes to raw file are propagated - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -505,7 +505,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Ensure null build is indeed null - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in results.checkNoDiagnostics() results.consumeTasksMatchingRuleTypes(["Gate"]) results.checkNoTask() @@ -612,13 +612,13 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { let tester = try await BuildOperationTester(getCore(), testWorkspace, simulated: false) for enableSandboxingInTest in ["YES", "NO"] { - var overridenParameters = BuildParameters(configuration: "Debug", - overrides: ["ENABLE_USER_SCRIPT_SANDBOXING": enableSandboxingInTest, - "A_DOT_TXT_PREFIX": "A_PREFIX", - "B_DOT_TXT_PREFIX": "B_PREFIX", - ]) + var overriddenParameters = BuildParameters(configuration: "Debug", + overrides: ["ENABLE_USER_SCRIPT_SANDBOXING": enableSandboxingInTest, + "A_DOT_TXT_PREFIX": "A_PREFIX", + "B_DOT_TXT_PREFIX": "B_PREFIX", + ]) - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -632,7 +632,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Null build - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -642,14 +642,14 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Change $A_DOT_TXT_PREFIX - overridenParameters = BuildParameters(configuration: "Debug", - overrides: ["ENABLE_USER_SCRIPT_SANDBOXING": enableSandboxingInTest, - "A_DOT_TXT_PREFIX": "UPDATED_A_PREFIX", - "B_DOT_TXT_PREFIX": "B_PREFIX", - ]) + overriddenParameters = BuildParameters(configuration: "Debug", + overrides: ["ENABLE_USER_SCRIPT_SANDBOXING": enableSandboxingInTest, + "A_DOT_TXT_PREFIX": "UPDATED_A_PREFIX", + "B_DOT_TXT_PREFIX": "B_PREFIX", + ]) // Incremental build to reflect the change in environment variable - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -663,7 +663,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // null build - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -673,11 +673,11 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Change $B_DOT_TXT_PREFIX - overridenParameters = BuildParameters(configuration: "Debug", - overrides: ["ENABLE_USER_SCRIPT_SANDBOXING": enableSandboxingInTest, - "A_DOT_TXT_PREFIX": "UPDATED_A_PREFIX", - "B_DOT_TXT_PREFIX": "UPDATED_B_PREFIX", - ]) + overriddenParameters = BuildParameters(configuration: "Debug", + overrides: ["ENABLE_USER_SCRIPT_SANDBOXING": enableSandboxingInTest, + "A_DOT_TXT_PREFIX": "UPDATED_A_PREFIX", + "B_DOT_TXT_PREFIX": "UPDATED_B_PREFIX", + ]) // Swift Build cannot detect ahead of time that change to B_DOT_TXT_PREFIX will have no effect on the input of TaskC // In this case rescheduling TaskAB and TaskC due to change in environment variables is correct.. @@ -687,7 +687,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { // // Even if we roll ChecksumOnlyFileSystem Swift Build will need to rerun TaskC // due to changes in environment variables - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -799,12 +799,12 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { let tester = try await BuildOperationTester(getCore(), testWorkspace, simulated: false, continueBuildingAfterErrors: false) - let overridenParameters = BuildParameters(configuration: "Debug", - overrides: ["A_DOT_TXT_PREFIX": "A_PREFIX", - "B_DOT_TXT_PREFIX": "B_PREFIX", - ]) + let overriddenParameters = BuildParameters(configuration: "Debug", + overrides: ["A_DOT_TXT_PREFIX": "A_PREFIX", + "B_DOT_TXT_PREFIX": "B_PREFIX", + ]) - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build fails results.checkError( .and(.prefix("Multiple commands produce"), @@ -1037,13 +1037,13 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { let tester = try await BuildOperationTester(getCore(), testWorkspace, simulated: false) let SRCROOT = tester.workspace.projects[0].sourceRoot.str - let overridenParameters = BuildParameters(configuration: "Debug", overrides: ["ENABLE_USER_SCRIPT_SANDBOXING": enableSandboxingInTest]) + let overriddenParameters = BuildParameters(configuration: "Debug", overrides: ["ENABLE_USER_SCRIPT_SANDBOXING": enableSandboxingInTest]) try await tester.fs.writeFileContents(Path(SRCROOT).join("myCryptoProject/raw.txt")) { stream in stream <<< "Output from TaskA for a.txt!\n" } - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -1058,7 +1058,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // First null build - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() results.consumeTasksMatchingRuleTypes(["Gate"]) @@ -1066,7 +1066,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Second null build - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() results.consumeTasksMatchingRuleTypes(["Gate"]) @@ -1078,7 +1078,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { stream <<< "Updated output from TaskA for a.txt!\n" } - try await tester.checkBuild(parameters: overridenParameters, persistent: true) { results in + try await tester.checkBuild(parameters: overriddenParameters, persistent: true) { results in // Check that build succeeds results.checkNoDiagnostics() @@ -1161,22 +1161,22 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Override FAKE_PATH with testWorkspace.sourceRoot.join("aProject/A.txt") - let overridenParameters = BuildParameters(configuration: "Debug", - overrides: ["FAKE_PATH": Path(SRCROOT).join("aProject/A.txt").str]) + let overriddenParameters = BuildParameters(configuration: "Debug", + overrides: ["FAKE_PATH": Path(SRCROOT).join("aProject/A.txt").str]) // Note: the two user scripts are not dependent on each other. // We manually run each target in the test via `firstBuildRequest` and `secondBuildRequest` - let firstBuildRequest = BuildRequest(parameters: overridenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overridenParameters, target: tester.workspace.projects[0].targets[0])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) + let firstBuildRequest = BuildRequest(parameters: overriddenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overriddenParameters, target: tester.workspace.projects[0].targets[0])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) - try await tester.checkBuild(parameters: overridenParameters, buildRequest: firstBuildRequest) { results in + try await tester.checkBuild(parameters: overriddenParameters, buildRequest: firstBuildRequest) { results in results.checkWarning(.contains("'ScriptWithUndeclaredInput' will be run during every build because it does not specify any outputs.")) self.checkForFlakyViolations(results, #/file-read-data .*/aProject/A.txt .*/#) results.checkNoDiagnostics() } - let secondBuildRequest = BuildRequest(parameters: overridenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overridenParameters, target: tester.workspace.projects[0].targets[1])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) + let secondBuildRequest = BuildRequest(parameters: overriddenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overriddenParameters, target: tester.workspace.projects[0].targets[1])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) - try await tester.checkBuild(parameters: overridenParameters, buildRequest: secondBuildRequest) { results in + try await tester.checkBuild(parameters: overriddenParameters, buildRequest: secondBuildRequest) { results in try results.checkTask(.matchRuleType("PhaseScriptExecution"), .matchRuleItemPattern(.contains("ScriptWithUndeclaredOutput"))) { task in do { let path = task.workingDirectory.join("build/aProject.build/Debug/TargetWithUndeclaredOutput.build/DerivedSources/new-folder/log.txt") @@ -1276,22 +1276,22 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Override FAKE_PATH with testWorkspace.sourceRoot.join("aProject/A.txt") - let overridenParameters = BuildParameters(configuration: "Debug", - overrides: ["FAKE_PATH": Path(SRCROOT).join("aProject/A.txt").str]) + let overriddenParameters = BuildParameters(configuration: "Debug", + overrides: ["FAKE_PATH": Path(SRCROOT).join("aProject/A.txt").str]) // Note: the two user scripts are not dependent on each other. // We manually run each target in the test via `firstBuildRequest` and `secondBuildRequest` - let firstBuildRequest = BuildRequest(parameters: overridenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overridenParameters, target: tester.workspace.projects[0].targets[0])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) + let firstBuildRequest = BuildRequest(parameters: overriddenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overriddenParameters, target: tester.workspace.projects[0].targets[0])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) - try await tester.checkBuild(parameters: overridenParameters, buildRequest: firstBuildRequest) { results in + try await tester.checkBuild(parameters: overriddenParameters, buildRequest: firstBuildRequest) { results in results.checkWarning(.contains("'ScriptWithUndeclaredInput' will be run during every build because it does not specify any outputs.")) self.checkForFlakyViolations(results, #/file-read-data .*/aProject/A.txt .*/#) results.checkNoDiagnostics() } - let secondBuildRequest = BuildRequest(parameters: overridenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overridenParameters, target: tester.workspace.projects[0].targets[1])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) + let secondBuildRequest = BuildRequest(parameters: overriddenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overriddenParameters, target: tester.workspace.projects[0].targets[1])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) - try await tester.checkBuild(parameters: overridenParameters, buildRequest: secondBuildRequest) { results in + try await tester.checkBuild(parameters: overriddenParameters, buildRequest: secondBuildRequest) { results in try results.checkTask(.matchRuleType("PhaseScriptExecution"), .matchRuleItemPattern(.contains("ScriptWithUndeclaredOutput"))) { task in let path = task.workingDirectory.join("build/aProject.build/Debug/TargetWithUndeclaredOutput.build/DerivedSources/new-folder/log.txt") let output = try tester.fs.read(path).asString @@ -1430,11 +1430,11 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { stream <<< "$(DERIVED_FILE_DIR)/checksum.txt\n" } - let overridenParameters = BuildParameters(configuration: "Debug", - overrides: ["FAKE_PATH_IN": Path(SRCROOT).join("myCryptoProject/raw.txt").str]) + let overriddenParameters = BuildParameters(configuration: "Debug", + overrides: ["FAKE_PATH_IN": Path(SRCROOT).join("myCryptoProject/raw.txt").str]) // Ensure content of checksum.txt is 8422bdbdffd21972340e63e377d9dbcf with no violation. - try await tester.checkBuild(parameters: overridenParameters) { results in + try await tester.checkBuild(parameters: overriddenParameters) { results in results.checkNoDiagnostics() try results.checkTask(.matchRuleType("PhaseScriptExecution")) { task in @@ -1502,21 +1502,21 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { } // Override FAKE_PATH with testWorkspace.sourceRoot.join("aProject/undeclared-input.txt") - let overridenParameters = BuildParameters(configuration: "Debug", - overrides: ["FAKE_PATH": Path(SRCROOT).join("aProject/undeclared-input.txt").str]) + let overriddenParameters = BuildParameters(configuration: "Debug", + overrides: ["FAKE_PATH": Path(SRCROOT).join("aProject/undeclared-input.txt").str]) - let firstBuildRequest = BuildRequest(parameters: overridenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overridenParameters, target: tester.workspace.projects[0].targets[0])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) + let firstBuildRequest = BuildRequest(parameters: overriddenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overriddenParameters, target: tester.workspace.projects[0].targets[0])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) - try await tester.checkBuild(parameters: overridenParameters, buildRequest: firstBuildRequest) { results in + try await tester.checkBuild(parameters: overriddenParameters, buildRequest: firstBuildRequest) { results in results.checkWarning(.contains("'ScriptWithUndeclaredInput' will be run during every build because it does not specify any outputs.")) self.checkForFlakyViolations(results, #/file-read-data .*/aProject/undeclared-input.txt .*/#) results.checkNoDiagnostics() } - let secondBuildRequest = BuildRequest(parameters: overridenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overridenParameters, target: tester.workspace.projects[0].targets[1])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) + let secondBuildRequest = BuildRequest(parameters: overriddenParameters, buildTargets: [BuildRequest.BuildTargetInfo(parameters: overriddenParameters, target: tester.workspace.projects[0].targets[1])], continueBuildingAfterErrors: true, useParallelTargets: true, useImplicitDependencies: false, useDryRun: false) - try await tester.checkBuild(parameters: overridenParameters, buildRequest: secondBuildRequest) { results in + try await tester.checkBuild(parameters: overriddenParameters, buildRequest: secondBuildRequest) { results in results.checkWarning(.contains("'ScriptWithUndeclaredOutput' will be run during every build because it does not specify any outputs.")) self.checkForFlakyViolations(results, #/file-write-create .*/aProject/undeclared-output.txt .*/#) @@ -1604,7 +1604,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { /// The problematic scenario: /// Target B depends on A.txt (and A.txt is listed as input dependency) but A.txt is emitted by Target A, and Target A has not listed it as output file /// Note that A.txt needs to be in SRCROOT. - /// Current sandbox policy permits read/writes of undeclared dependancies outside of the source and build folders. + /// Current sandbox policy permits read/writes of undeclared dependencies outside of the source and build folders. /// /// This is problematic because /// 1. If we run Target A, it may not trigger a rebuild for Target B @@ -1760,9 +1760,9 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { stream <<< "The quick brown fox jumps over the lazy dog" // 43 bytes } - let overridenParameters = BuildParameters(configuration: "Debug") + let overriddenParameters = BuildParameters(configuration: "Debug") - try await tester.checkBuild(parameters: overridenParameters) { results in + try await tester.checkBuild(parameters: overriddenParameters) { results in try results.checkTask(.matchRuleType("PhaseScriptExecution")) { task in let path = task.outputPaths[0] let output = try tester.fs.read(path).asString @@ -1800,7 +1800,7 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { /// PROJECT_DIR and SRCROOT mostly have the same value /// SRCROOT is overridable /// PROJECT_DIR is not an overridable value. - /// This test ensures writing to PROJECT_DIR is blocked even when SRCROOT is overriden to a different path + /// This test ensures writing to PROJECT_DIR is blocked even when SRCROOT is overridden to a different path @Test(.requireSDKs(.macOS)) func ensureProjectDirIsBlocked() async throws { try await withTemporaryDirectory { tmpDirPath async throws -> Void in @@ -1891,11 +1891,11 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { // This is an edge case that (for now) we are okay with not handling let derivedData = tmpDirPath.join("DerivedData") let arena = ArenaInfo.buildArena(derivedDataRoot: derivedData) - let overridenParameters = BuildParameters(configuration: "Debug", arena: arena) + let overriddenParameters = BuildParameters(configuration: "Debug", arena: arena) try tester.fs.createDirectory(Path(SRCROOT), recursive: true) - try await tester.checkBuild(parameters: overridenParameters) { results in + try await tester.checkBuild(parameters: overriddenParameters) { results in results.checkNoDiagnostics() try results.checkTask(.matchRuleType("PhaseScriptExecution"), .matchRuleItemPattern(.contains("WriteToDerivedDataDir"))) { task in @@ -1960,9 +1960,9 @@ fileprivate struct ShellScriptSandboxingTests: CoreBasedTests { stream <<< "Hello World!\n" } - let overridenParameters = BuildParameters(configuration: "Debug") + let overriddenParameters = BuildParameters(configuration: "Debug") - try await tester.checkBuild(parameters: overridenParameters) { results in + try await tester.checkBuild(parameters: overriddenParameters) { results in results.checkNoDiagnostics() try results.checkTask(.matchRuleType("RuleScriptExecution")) { task in diff --git a/Tests/SWBBuildSystemTests/SwiftDriverTests.swift b/Tests/SWBBuildSystemTests/SwiftDriverTests.swift index d32f4258..aa8ba3a4 100644 --- a/Tests/SWBBuildSystemTests/SwiftDriverTests.swift +++ b/Tests/SWBBuildSystemTests/SwiftDriverTests.swift @@ -862,7 +862,7 @@ fileprivate struct SwiftDriverTests: CoreBasedTests { do { let buildParameters = BuildParameters(configuration: "Debug", commandLineOverrides: ["SWIFT_ENABLE_EXPLICIT_MODULES":"YES"]) - // Ensure explicit moduels are enabled as per the default + // Ensure explicit modules are enabled as per the default try await tester.fs.writeFileContents(blockListFilePath) { file in file <<< """ diff --git a/Tests/SWBBuildSystemTests/TrackedDomainOperationTests.swift b/Tests/SWBBuildSystemTests/TrackedDomainOperationTests.swift index 6864c02d..ae82632c 100644 --- a/Tests/SWBBuildSystemTests/TrackedDomainOperationTests.swift +++ b/Tests/SWBBuildSystemTests/TrackedDomainOperationTests.swift @@ -209,7 +209,7 @@ fileprivate struct TrackedDomainOperationTests: CoreBasedTests { """ } - // Write a basebones Info.plist file. + // Write a barebones Info.plist file. try await tester.fs.writePlist(testWorkspace.sourceRoot.join("TestProject/Info.plist"), .plDict([ "CFBundleDevelopmentRegion": .plString("en"), "CFBundleExecutable": .plString("$(EXECUTABLE_NAME)"), @@ -505,7 +505,7 @@ fileprivate struct TrackedDomainOperationTests: CoreBasedTests { """ } - // Write a basebones Info.plist file. + // Write a barebones Info.plist file. try await tester.fs.writePlist(testWorkspace.sourceRoot.join("TestProject/Info.plist"), .plDict([ "CFBundleDevelopmentRegion": .plString("en"), "CFBundleExecutable": .plString("$(EXECUTABLE_NAME)"), diff --git a/Tests/SWBBuildSystemTests/UnitTestBuildOperationTests.swift b/Tests/SWBBuildSystemTests/UnitTestBuildOperationTests.swift index f10cab27..4bc03d67 100644 --- a/Tests/SWBBuildSystemTests/UnitTestBuildOperationTests.swift +++ b/Tests/SWBBuildSystemTests/UnitTestBuildOperationTests.swift @@ -199,7 +199,7 @@ fileprivate struct UnitTestBuildOperationTests: CoreBasedTests { return } - // Check tbhat the app sign task runs after the test targets' end gate tasks. + // Check that the app sign task runs after the test targets' end gate tasks. results.check(event: .taskHadEvent(testOneGateTask, event: .completed), precedes: .taskHadEvent(appSignTask, event: .started)) results.check(event: .taskHadEvent(testTwoGateTask, event: .completed), precedes: .taskHadEvent(appSignTask, event: .started)) diff --git a/Tests/SWBBuildSystemTests/WatchKitTests.swift b/Tests/SWBBuildSystemTests/WatchKitTests.swift index c891bbbc..ed8393f5 100644 --- a/Tests/SWBBuildSystemTests/WatchKitTests.swift +++ b/Tests/SWBBuildSystemTests/WatchKitTests.swift @@ -135,7 +135,7 @@ fileprivate struct WatchKitTests: CoreBasedTests { case "i386": break default: - Issue.record("Uexpected architecture \(slice.arch)") + Issue.record("Unexpected architecture \(slice.arch)") } } } diff --git a/Tests/SWBBuildSystemTests/XCFrameworkBuildOperationTests.swift b/Tests/SWBBuildSystemTests/XCFrameworkBuildOperationTests.swift index ac08ed0f..3b5e2534 100644 --- a/Tests/SWBBuildSystemTests/XCFrameworkBuildOperationTests.swift +++ b/Tests/SWBBuildSystemTests/XCFrameworkBuildOperationTests.swift @@ -511,7 +511,7 @@ fileprivate struct XCFrameworkBuildOperationTests: CoreBasedTests { } @Test(.requireSDKs(.macOS, .iOS)) - func missingMetatadaFoldersProducesDiagnostics() async throws { + func missingMetadataFoldersProducesDiagnostics() async throws { try await withTemporaryDirectory { (tmpDir: Path) in let testProject = TestProject( "aProject", diff --git a/Tests/SWBCoreTests/BuildParametersTests.swift b/Tests/SWBCoreTests/BuildParametersTests.swift index b6499acb..71a752ac 100644 --- a/Tests/SWBCoreTests/BuildParametersTests.swift +++ b/Tests/SWBCoreTests/BuildParametersTests.swift @@ -18,7 +18,7 @@ import SWBProtocol @Suite fileprivate struct BuildParametersTests { @Test - func serializationDoesNotContainUnstablaHash() throws { + func serializationDoesNotContainUnstableHash() throws { let action = BuildAction.build let configuration = "Debug" let activeRunDestination = RunDestinationInfo( diff --git a/Tests/SWBCoreTests/CommandLineSpecTests.swift b/Tests/SWBCoreTests/CommandLineSpecTests.swift index 82394017..61cabff6 100644 --- a/Tests/SWBCoreTests/CommandLineSpecTests.swift +++ b/Tests/SWBCoreTests/CommandLineSpecTests.swift @@ -1403,7 +1403,7 @@ import SWBMacro table.push(BuiltinMacros.variant, literal: "normal") table.push(BuiltinMacros.MACH_O_TYPE, literal: "dylib") - // Construst data we can re-use across the tests. + // Construct data we can re-use across the tests. let producer = try MockCommandProducer(core: core, productTypeIdentifier: "com.apple.product-type.framework", platform: "macosx") let mockFileType: FileTypeSpec = try core.specRegistry.getSpec("file") diff --git a/Tests/SWBCoreTests/SettingsTests.swift b/Tests/SWBCoreTests/SettingsTests.swift index 13cf64f8..8e65d98c 100644 --- a/Tests/SWBCoreTests/SettingsTests.swift +++ b/Tests/SWBCoreTests/SettingsTests.swift @@ -593,7 +593,7 @@ import SWBMacro #expect(settings.tableForTesting.lookupMacro(BuiltinMacros.TARGET_BUILD_DIR)?.next?.next?.expression.stringRep == "$(CONFIGURATION_BUILD_DIR)$(TARGET_BUILD_SUBPATH)") #expect(settings.tableForTesting.lookupMacro(BuiltinMacros.CONFIGURATION_TEMP_DIR)?.next?.next?.expression.stringRep == nil) - // This setting is always overriden by the project defaults. + // This setting is always overridden by the project defaults. #expect(settings.tableForTesting.lookupMacro(BuiltinMacros.CONFIGURATION_BUILD_DIR)?.next?.next?.expression.stringRep == nil) // Check that the correct build system defaults are exported (should be the native ones). @@ -790,7 +790,7 @@ import SWBMacro expectedExcludedFileNames: ["docs/*", "/tmp/Workspace/aProject/AppTarget/Preview Resources/*"]) } - // However, if DEPLOYMENT_LOCATION is explicitely set to NO, development assets should not be excluded + // However, if DEPLOYMENT_LOCATION is explicitly set to NO, development assets should not be excluded for action in [BuildAction.analyze, .clean, .build] { try await test(buildSettings: ["DEVELOPMENT_ASSET_PATHS": "'AppTarget/Preview Resources'", "EXCLUDED_SOURCE_FILE_NAMES": "$(inherited) docs/*"], @@ -1376,7 +1376,7 @@ import SWBMacro "ENABLE_POINTER_AUTHENTICATION": "YES"], expectedARCHS_STANDARD: ["arm64", "arm64e"]) - // explicitely opting out of pointer authentication does not add arm64e + // explicitly opting out of pointer authentication does not add arm64e try await test(buildSettings: ["SDKROOT": platform, "ENABLE_POINTER_AUTHENTICATION": "NO"], expectedARCHS_STANDARD: ["arm64"]) @@ -2973,7 +2973,7 @@ import SWBMacro } @Test(.requireSDKs(.iOS)) - func previewsDisablingHardedRuntimeWithAdHocSigning() async throws { + func previewsDisablingHardenedRuntimeWithAdHocSigning() async throws { let testWorkspace = try await TestWorkspace( "Workspace", projects: [TestProject( @@ -3003,7 +3003,7 @@ import SWBMacro "ENABLE_XOJIT_PREVIEWS": "YES", "CODE_SIGN_IDENTITY": "An Engineer", - "ENABLE_HARDED_RUNTIME_EXPECTED": "YES", + "ENABLE_HARDENED_RUNTIME_EXPECTED": "YES", ]), ], buildPhases: [TestSourcesBuildPhase(["main.swift"])] @@ -3022,7 +3022,7 @@ import SWBMacro "ENABLE_XOJIT_PREVIEWS": "YES", "CODE_SIGN_IDENTITY": "-", - "ENABLE_HARDED_RUNTIME_EXPECTED": "NO", + "ENABLE_HARDENED_RUNTIME_EXPECTED": "NO", ]), ], buildPhases: [TestSourcesBuildPhase(["main.swift"])] @@ -3035,7 +3035,7 @@ import SWBMacro let parameters = BuildParameters(action: .build, configuration: "Debug", overrides: [:]) - let expectedMacro = try BuiltinMacros.namespace.declareBooleanMacro("ENABLE_HARDED_RUNTIME_EXPECTED") + let expectedMacro = try BuiltinMacros.namespace.declareBooleanMacro("ENABLE_HARDENED_RUNTIME_EXPECTED") for target in testProject.targets { let settings = Settings( diff --git a/Tests/SWBCoreTests/SpecLoadingTests.swift b/Tests/SWBCoreTests/SpecLoadingTests.swift index 2c1aed02..9554d668 100644 --- a/Tests/SWBCoreTests/SpecLoadingTests.swift +++ b/Tests/SWBCoreTests/SpecLoadingTests.swift @@ -107,7 +107,7 @@ import SWBMacro let superSpec = core.specRegistry.getSpec("sourcecode.c")! #expect(spec.basedOnSpec === superSpec) - // Validate that we loaded specs from IDE pugins. + // Validate that we loaded specs from IDE plugins. #expect(core.specRegistry.getSpec("com.apple.product-type.bundle", domain: "embedded") != nil) // Validate use of default proxy as fallback for based on references. @@ -916,7 +916,7 @@ import SWBMacro let clangSpec = try core.specRegistry.getSpec("com.apple.compilers.llvm.clang.1_0") as CompilerSpec #expect(clangSpec.execDescription == clangCompilerSpec.execDescription) - // Validate overriden class loading. + // Validate overridden class loading. let codesignSpec = core.specRegistry.getSpec("com.apple.build-tools.codesign") #expect(codesignSpec is CodesignToolSpec) diff --git a/Tests/SWBCoreTests/SwiftCompilerTests.swift b/Tests/SWBCoreTests/SwiftCompilerTests.swift index b1f9fc0f..637fa1c2 100644 --- a/Tests/SWBCoreTests/SwiftCompilerTests.swift +++ b/Tests/SWBCoreTests/SwiftCompilerTests.swift @@ -467,7 +467,7 @@ fileprivate final class TestSwiftParserDelegate: TaskOutputParserDelegate, Senda } @Test - func executationDescription() async throws { + func executionDescription() async throws { do { let (delegate, _) = try await makeTestParserWithMessages([ [ "kind": "began", "name": "compile", "pid": 1, "inputs": ["/tmp/file.swift"]], diff --git a/Tests/SWBCoreTests/TargetDependencyResolverTests.swift b/Tests/SWBCoreTests/TargetDependencyResolverTests.swift index 22230f73..66ba6254 100644 --- a/Tests/SWBCoreTests/TargetDependencyResolverTests.swift +++ b/Tests/SWBCoreTests/TargetDependencyResolverTests.swift @@ -1572,7 +1572,7 @@ fileprivate enum TargetPlatformSpecializationMode { let targets = buildGraph.allTargets.filter { $0.target.name == name } #expect(targets.count == expectedPlatforms.count) - var unexepectedPlatforms: [String] = [] + var unexpectedPlatforms: [String] = [] var visitedPlatforms = Set(expectedPlatforms) for target in targets { let settings = buildRequestContext.getCachedSettings(target.parameters, target: target.target) @@ -1581,12 +1581,12 @@ fileprivate enum TargetPlatformSpecializationMode { continue } if visitedPlatforms.remove(platform.name) == nil { - unexepectedPlatforms.append(platform.name) + unexpectedPlatforms.append(platform.name) } } #expect(visitedPlatforms == []) - #expect(unexepectedPlatforms == []) + #expect(unexpectedPlatforms == []) } let specializationWorkspace_basic: TestWorkspace = { @@ -2007,9 +2007,9 @@ fileprivate enum TargetPlatformSpecializationMode { try checkTarget(graphType, buildRequestContext, buildGraph, name: "SinglePlatformFramework", expectedPlatform: "macosx") try checkTarget(graphType, buildRequestContext, buildGraph, name: "Intermediate", expectedPlatforms: ["macosx"]) - // NOTE: Due to how the aggegrate targets are specialized "transparently", this means this project configuration is actually non-deterministc - // as our depedency resolver can run concurrently. This test forces the order to verify the specialization is happening correctly, but the - // project configuration itself is non-determinstic. It's also an odd setup as the leaf framework is not used by any of the top-level targets, + // NOTE: Due to how the aggregate targets are specialized "transparently", this means this project configuration is actually non-deterministic + // as our dependency resolver can run concurrently. This test forces the order to verify the specialization is happening correctly, but the + // project configuration itself is non-deterministic. It's also an odd setup as the leaf framework is not used by any of the top-level targets, // which would mean this target would be specialized. try checkTarget(graphType, buildRequestContext, buildGraph, name: "MultiPlatformFramework", expectedPlatforms: [expectedPlatform]) @@ -4118,7 +4118,7 @@ fileprivate enum TargetPlatformSpecializationMode { /// This is a specific regression test for part of rdar://73361908. @Test(.requireSDKs(.macOS, .iOS)) - func implicitDependencyResolutionMultiPlatDepsSameProdutName() async throws { + func implicitDependencyResolutionMultiPlatDepsSameProductName() async throws { let core = try await getCore() let testProject = try await TestProject( @@ -4733,7 +4733,7 @@ fileprivate enum TargetPlatformSpecializationMode { let workspaceContext = WorkspaceContext(core: core, workspace: workspace, processExecutionCache: .sharedForTesting) let project = workspace.projects[0] - // The key thing that's being tested here is that all of the targets are top-level targets, but since MergedFwkTarget has AUTOMATICALLY_MERGE_DEPENDENCIES set, it will imppose on its framework & dylib dependencies, and we want to make sure that none of them show up more than once, there should only be one of each, with MERGEABLE_LIBRARY enabled. + // The key thing that's being tested here is that all of the targets are top-level targets, but since MergedFwkTarget has AUTOMATICALLY_MERGE_DEPENDENCIES set, it will impose on its framework & dylib dependencies, and we want to make sure that none of them show up more than once, there should only be one of each, with MERGEABLE_LIBRARY enabled. // TaskConstructionTests.MergeableLibraryTests will also exercise this, but this is a lower-level test exercising target dependency resolution specifically. let parameters = BuildParameters(configuration: "Release") let targets = project.targets.map({ BuildRequest.BuildTargetInfo(parameters: parameters, target: $0) }) diff --git a/Tests/SWBCoreTests/XCFrameworkTests.swift b/Tests/SWBCoreTests/XCFrameworkTests.swift index 8c53df31..37abdf1b 100644 --- a/Tests/SWBCoreTests/XCFrameworkTests.swift +++ b/Tests/SWBCoreTests/XCFrameworkTests.swift @@ -741,8 +741,8 @@ import SWBUtil } // Now validate that when we serialize the xcframework back out, we get the sanitized versions. - let rountripPlist = try PropertyList.fromBytes([UInt8](try xcframework.serialize())) - let libraries = rountripPlist.dictValue?["AvailableLibraries"]?.arrayValue ?? [] + let roundtripPlist = try PropertyList.fromBytes([UInt8](try xcframework.serialize())) + let libraries = roundtripPlist.dictValue?["AvailableLibraries"]?.arrayValue ?? [] #expect(libraries.count == 3) #expect(libraries[0].dictValue?["SupportedPlatformVariant"]?.stringValue == "maccatalyst") #expect(libraries[1].dictValue?["SupportedPlatformVariant"]?.stringValue == "maccatalyst") @@ -1477,7 +1477,7 @@ fileprivate struct XCFrameworkCreationCommandTests: CoreBasedTests { @Test func XCFrameworkCommandForDynamicLibraries_swift_internalDistribution() async throws { - try await _testXCFrameworkCommandForDynamicLibraries(useSwift: true, allowInternalDistrubtion: true) + try await _testXCFrameworkCommandForDynamicLibraries(useSwift: true, allowInternalDistribution: true) } @Test @@ -1485,7 +1485,7 @@ fileprivate struct XCFrameworkCreationCommandTests: CoreBasedTests { try await _testXCFrameworkCommandForDynamicLibraries(useSwift: false) } - func _testXCFrameworkCommandForDynamicLibraries(useSwift: Bool, allowInternalDistrubtion: Bool = false) async throws { + func _testXCFrameworkCommandForDynamicLibraries(useSwift: Bool, allowInternalDistribution: Bool = false) async throws { try await withTemporaryDirectory { tmpDir -> Void in let infoLookup = try await getCore() @@ -1522,7 +1522,7 @@ fileprivate struct XCFrameworkCreationCommandTests: CoreBasedTests { let bcsymPath3b = try createFakeDebugFile(at: path3, basename: "bitcode2", fileExtension: "bcsymbolmap") let commandLine: [String] - commandLine = ["createXCFramework", "-library", path1.str, "-debug-symbols", dsymPath1.str, "-headers", path1.dirname.join("include").str, "-library", path2.str, "-headers", path2.dirname.join("include").str, "-library", path3.str, "-headers", path3.dirname.join("include").str, "-debug-symbols", dsymPath3.str, "-debug-symbols", bcsymPath3a.str, "-debug-symbols", bcsymPath3b.str, "-output", outputPath.str] + (allowInternalDistrubtion ? ["-allow-internal-distribution"] : []) + commandLine = ["createXCFramework", "-library", path1.str, "-debug-symbols", dsymPath1.str, "-headers", path1.dirname.join("include").str, "-library", path2.str, "-headers", path2.dirname.join("include").str, "-library", path3.str, "-headers", path3.dirname.join("include").str, "-debug-symbols", dsymPath3.str, "-debug-symbols", bcsymPath3a.str, "-debug-symbols", bcsymPath3b.str, "-output", outputPath.str] + (allowInternalDistribution ? ["-allow-internal-distribution"] : []) // Validate that the output is correct. let (passed, output) = XCFramework.createXCFramework(commandLine: commandLine, currentWorkingDirectory: tmpDir, infoLookup: infoLookup) @@ -1599,19 +1599,19 @@ fileprivate struct XCFrameworkCreationCommandTests: CoreBasedTests { if useSwift { let macosSwiftModuleDir = outputPath.join(macos.libraryIdentifier).join(macos.headersPath!).join("sample.swiftmodule") - #expect(localFS.exists(macosSwiftModuleDir.join("x86_64.swiftmodule")) == allowInternalDistrubtion) + #expect(localFS.exists(macosSwiftModuleDir.join("x86_64.swiftmodule")) == allowInternalDistribution) #expect(localFS.exists(macosSwiftModuleDir.join("sample.swiftinterface"))) #expect(localFS.exists(macosSwiftModuleDir.join("x86_64.swiftdoc"))) let iphoneosSwiftModuleDir = outputPath.join(iphoneos.libraryIdentifier).join(iphoneos.headersPath!).join("sample.swiftmodule") - #expect(localFS.exists(iphoneosSwiftModuleDir.join("arm64.swiftmodule")) == allowInternalDistrubtion) - #expect(localFS.exists(iphoneosSwiftModuleDir.join("arm64e.swiftmodule")) == allowInternalDistrubtion) + #expect(localFS.exists(iphoneosSwiftModuleDir.join("arm64.swiftmodule")) == allowInternalDistribution) + #expect(localFS.exists(iphoneosSwiftModuleDir.join("arm64e.swiftmodule")) == allowInternalDistribution) #expect(localFS.exists(iphoneosSwiftModuleDir.join("sample.swiftinterface"))) #expect(localFS.exists(iphoneosSwiftModuleDir.join("arm64.swiftdoc"))) #expect(localFS.exists(iphoneosSwiftModuleDir.join("arm64e.swiftdoc"))) let iphonesimulatorSwiftModuleDir = outputPath.join(iphonesimulator.libraryIdentifier).join(iphonesimulator.headersPath!).join("sample.swiftmodule") - #expect(localFS.exists(iphonesimulatorSwiftModuleDir.join("x86_64.swiftmodule")) == allowInternalDistrubtion) + #expect(localFS.exists(iphonesimulatorSwiftModuleDir.join("x86_64.swiftmodule")) == allowInternalDistribution) #expect(localFS.exists(iphonesimulatorSwiftModuleDir.join("sample.swiftinterface"))) #expect(localFS.exists(iphonesimulatorSwiftModuleDir.join("x86_64.swiftdoc"))) } diff --git a/Tests/SWBMacroTests/MacroBasicTests.swift b/Tests/SWBMacroTests/MacroBasicTests.swift index 9bd5ff2b..bc4c3ea0 100644 --- a/Tests/SWBMacroTests/MacroBasicTests.swift +++ b/Tests/SWBMacroTests/MacroBasicTests.swift @@ -85,7 +85,7 @@ import SWBMacro @Test - func macroExpressionEquatableness() { + func macroExpressionEquality() { let namespace = MacroNamespace(debugDescription: "test") let expr1 = namespace.parseString("something") @@ -104,7 +104,7 @@ import SWBMacro func macroNamespaceInheritance() throws { let lowerNamespace = MacroNamespace(debugDescription: "lower") - // Declarate a string macro in the lower namespace. + // Declare a string macro in the lower namespace. let lowerStringDecl = try lowerNamespace.declareStringMacro("StringMacro") #expect(lowerStringDecl.type == .string) diff --git a/Tests/SWBMacroTests/MacroEvaluationTests.swift b/Tests/SWBMacroTests/MacroEvaluationTests.swift index 58b7cddd..dce7a883 100644 --- a/Tests/SWBMacroTests/MacroEvaluationTests.swift +++ b/Tests/SWBMacroTests/MacroEvaluationTests.swift @@ -233,7 +233,7 @@ import SWBTestSupport let X = try namespace.declareStringMacro("X") let Y = try namespace.declareStringMacro("Y") - // Push down several values that use inheritance in its different forms, alteranting between X and Y. + // Push down several values that use inheritance in its different forms, alternating between X and Y. table.push(X, literal: "a") table.push(Y, literal: "b") table.push(X, namespace.parseString("($(Y))")) @@ -687,7 +687,7 @@ import SWBTestSupport #expect(scope.evaluate(stringExpr) == expectedStringValue) } - // Test evalating various strings both as string lists and as strings. + // Test evaluating various strings both as string lists and as strings. try checkStringListEvaluatedAsString("LEADING_TRAILING_SPACES", " $(X) ", ["x"], " x ") try checkStringListEvaluatedAsString("LEADING_TRAILING_WHITESPACE", "\n $(X)\n\n\n", ["x"], "\n x\n\n\n") try checkStringListEvaluatedAsString("LEADING_TRAILING_ESCAPES", "\\a$(X)\\b", ["axb"], "\\ax\\b") diff --git a/Tests/SWBMacroTests/MacroNamespaceTests.swift b/Tests/SWBMacroTests/MacroNamespaceTests.swift index 4eea2af9..f03a4cd3 100644 --- a/Tests/SWBMacroTests/MacroNamespaceTests.swift +++ b/Tests/SWBMacroTests/MacroNamespaceTests.swift @@ -80,7 +80,7 @@ import SWBMacro // the values are MacroValueAssignments, which are a linked list of values consisting of the // condition parameter set and macro expression value. While the keys of the table are enumerated // deterministically during serialization, the creation of the MacroValueAssignment linked list - // must also be determinstic from the input dictionary to ensure they are written deterministically + // must also be deterministic from the input dictionary to ensure they are written deterministically // as well. let table = try namespace.parseTable([ "SETTING[sdk=macosx*]": "value", diff --git a/Tests/SWBMacroTests/MacroParsingTests.swift b/Tests/SWBMacroTests/MacroParsingTests.swift index 6f9f5064..7e6778b7 100644 --- a/Tests/SWBMacroTests/MacroParsingTests.swift +++ b/Tests/SWBMacroTests/MacroParsingTests.swift @@ -992,7 +992,7 @@ fileprivate func ==(lhs: ParseDelegateCallLogEntry, rhs: ParseDelegateCallLogEnt } } -/// For testing purposes. Helper delegate that keeps a log of the methods that were called, and in what order and with what parameters. Then we can compare that against what was exected. +/// For testing purposes. Helper delegate that keeps a log of the methods that were called, and in what order and with what parameters. Then we can compare that against what was expected. fileprivate final class TestDelegate : MacroExpressionParserDelegate { // Keep an array of call log entries, and add to it whenever we get a call. var callLogEntries: [ParseDelegateCallLogEntry] = [] diff --git a/Tests/SWBProtocolTests/ProjectModelTests.swift b/Tests/SWBProtocolTests/ProjectModelTests.swift index 86b78b4b..b4bda23f 100644 --- a/Tests/SWBProtocolTests/ProjectModelTests.swift +++ b/Tests/SWBProtocolTests/ProjectModelTests.swift @@ -14,7 +14,7 @@ import SWBProtocol import SWBUtil import Testing -/// Test that we are generating the expected errors for invalid/unexpected type codes when serialiazing various types. +/// Test that we are generating the expected errors for invalid/unexpected type codes when serializing various types. @Suite fileprivate struct SWBProtocolUnexpectedTypecodeTests { @Test func buildableItemGUID() { let serializer = MsgPackSerializer() diff --git a/Tests/SWBTaskConstructionTests/AppIntentsMetadataTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/AppIntentsMetadataTaskConstructionTests.swift index 64ac288a..84beb3e3 100644 --- a/Tests/SWBTaskConstructionTests/AppIntentsMetadataTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/AppIntentsMetadataTaskConstructionTests.swift @@ -842,7 +842,7 @@ fileprivate struct AppIntentsMetadataTaskConstructionTests: CoreBasedTests { } // Ensure SSU tasks are enabled by-default for public SDK clients, - // but can be overriden with 'APP_SHORTCUTS_ENABLE_FLEXIBLE_MATCHING=NO' + // but can be overridden with 'APP_SHORTCUTS_ENABLE_FLEXIBLE_MATCHING=NO' @Test(.requireSDKs(.iOS)) func overrideSSUTasksIfPublicSDK() async throws { try await withTemporaryDirectory { tmpDir in diff --git a/Tests/SWBTaskConstructionTests/BuildRuleTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/BuildRuleTaskConstructionTests.swift index 581ba17f..ab1507bf 100644 --- a/Tests/SWBTaskConstructionTests/BuildRuleTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/BuildRuleTaskConstructionTests.swift @@ -111,7 +111,7 @@ fileprivate struct BuildRuleTaskConstructionTests: CoreBasedTests { } // Build a command line tool, that uses custom build rules, to validate - // input and ouptut file lists. + // input and output file lists. @Test(.requireSDKs(.host)) func customBuildRulesInputAndOutputFileList() async throws { let testProject = TestProject( @@ -309,7 +309,7 @@ fileprivate struct BuildRuleTaskConstructionTests: CoreBasedTests { } } - /// Test some special behavors in custom build rules, including: + /// Test some special behaviors in custom build rules, including: /// - That a custom build rule can define flags to be passed to the tool which processes its output files. /// - Rules with multiple file patterns. /// - Rules matching header files. @@ -533,7 +533,7 @@ fileprivate struct BuildRuleTaskConstructionTests: CoreBasedTests { } } - /// Test some special behavors in custom build rules and files existing in your project. + /// Test some special behaviors in custom build rules and files existing in your project. @Test(.requireSDKs(.macOS)) func multipleFileProcessedError() async throws { let srcroot = Path("/var/tmp/aProject") diff --git a/Tests/SWBTaskConstructionTests/BuildToolTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/BuildToolTaskConstructionTests.swift index 3aaf1e83..042afecb 100644 --- a/Tests/SWBTaskConstructionTests/BuildToolTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/BuildToolTaskConstructionTests.swift @@ -102,7 +102,7 @@ fileprivate struct BuildToolTaskConstructionTests: CoreBasedTests { ]), ], buildPhases: [ - // Copy Files will not unidfef unless APPLY_RULES_IN_COPY_FILES is set. + // Copy Files will not unifdef unless APPLY_RULES_IN_COPY_FILES is set. TestCopyFilesBuildPhase([ "Header.h", "ModuleMap.modulemap", diff --git a/Tests/SWBTaskConstructionTests/CodeSignTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/CodeSignTaskConstructionTests.swift index abc8b2fb..41cb8a6b 100644 --- a/Tests/SWBTaskConstructionTests/CodeSignTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/CodeSignTaskConstructionTests.swift @@ -457,7 +457,7 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { TestFile("resource.txt"), TestFile("other.txt"), TestFile("nope.txt"), - // This is a special handling issue due to the inablity to have inputs that do not actually exist on disk. See TaskProducer.addAdditionalCodeSignInput for more info. + // This is a special handling issue due to the inability to have inputs that do not actually exist on disk. See TaskProducer.addAdditionalCodeSignInput for more info. TestFile("doesnotexist.txt"), TestFile("Info.plist"), @@ -1019,7 +1019,7 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { let testWorkspace = TestWorkspace("aWorkspace", projects: [testProject]) let tester = try await TaskConstructionTester(getCore(), testWorkspace) - // Check --launch-constraint-self is passsed when the build setting is configured + // Check --launch-constraint-self is passed when the build setting is configured await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", activeRunDestination: .macOS, overrides: ["LAUNCH_CONSTRAINT_SELF": "/tmp/SelfLaunchConstraint.plist"])) { results in results.checkTarget("Tool") { target in results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in @@ -1028,7 +1028,7 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { } } - // Check --launch-constraint-parent is passsed when the build setting is configured + // Check --launch-constraint-parent is passed when the build setting is configured await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", activeRunDestination: .macOS, overrides: ["LAUNCH_CONSTRAINT_PARENT": "/tmp/ParentLaunchConstraint.plist"])) { results in results.checkTarget("Tool") { target in results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in @@ -1038,7 +1038,7 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { } - // Check --launch-constraint-responsible is passsed when the build setting is configured + // Check --launch-constraint-responsible is passed when the build setting is configured await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", activeRunDestination: .macOS, overrides: ["LAUNCH_CONSTRAINT_RESPONSIBLE": "/tmp/ResponsibleLaunchConstraint.plist"])) { results in results.checkTarget("Tool") { target in results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in @@ -1047,7 +1047,7 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { } } - // Check that all launch constraint arguments are passsed when the build settings are configured + // Check that all launch constraint arguments are passed when the build settings are configured await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", activeRunDestination: .macOS, overrides: ["LAUNCH_CONSTRAINT_SELF": "/tmp/SelfLaunchConstraint.plist", "LAUNCH_CONSTRAINT_PARENT": "/tmp/ParentLaunchConstraint.plist", "LAUNCH_CONSTRAINT_RESPONSIBLE": "/tmp/ResponsibleLaunchConstraint.plist"])) { results in results.checkTarget("Tool") { target in results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in @@ -1091,7 +1091,7 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { let testWorkspace = TestWorkspace("aWorkspace", projects: [testProject]) let tester = try await TaskConstructionTester(getCore(), testWorkspace) - // Check --library-constraint is passsed when the build setting is configured on macOS 14 + // Check --library-constraint is passed when the build setting is configured on macOS 14 await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", activeRunDestination: .macOS, overrides: ["LIBRARY_LOAD_CONSTRAINT": "/tmp/LibraryLoadConstraint.plist"]), systemInfo: SystemInfo(operatingSystemVersion: Version(14), productBuildVersion: "99A98", nativeArchitecture: "arm64")) { results in results.checkTarget("Tool") { target in results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in @@ -1100,7 +1100,7 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { } } - // Check --library-constraint is *not* passsed when the build setting is configured on macOS 13 + // Check --library-constraint is *not* passed when the build setting is configured on macOS 13 await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", activeRunDestination: .macOS, overrides: ["LIBRARY_LOAD_CONSTRAINT": "/tmp/LibraryLoadConstraint.plist"]), systemInfo: SystemInfo(operatingSystemVersion: Version(13), productBuildVersion: "99A98", nativeArchitecture: "arm64")) { results in results.checkTarget("Tool") { target in results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in diff --git a/Tests/SWBTaskConstructionTests/DebugInformationTests.swift b/Tests/SWBTaskConstructionTests/DebugInformationTests.swift index 4d2651d7..b2e94a68 100644 --- a/Tests/SWBTaskConstructionTests/DebugInformationTests.swift +++ b/Tests/SWBTaskConstructionTests/DebugInformationTests.swift @@ -20,7 +20,7 @@ import SWBTestSupport fileprivate struct DebugInformationTests: CoreBasedTests { /// Test the different DWARF version formats we support. @Test(.requireSDKs(.macOS)) - func debugInformationVersiom() async throws { + func debugInformationVersion() async throws { let testProject = try await TestProject( "aProject", groupTree: TestGroup( @@ -204,7 +204,7 @@ fileprivate struct DebugInformationTests: CoreBasedTests { results.checkNoDiagnostics() } - // Check install behaviour with `DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT` enabled. + // Check install behavior with `DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT` enabled. await tester.checkBuild(BuildParameters(action: .install, configuration: "Debug", overrides: [ "DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT": "YES", "DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym", @@ -234,7 +234,7 @@ fileprivate struct DebugInformationTests: CoreBasedTests { results.checkNoDiagnostics() } - // Check build behaviour with `DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT` enabled. + // Check build behavior with `DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT` enabled. await tester.checkBuild(BuildParameters(action: .build, configuration: "Debug", overrides: [ "DWARF_DSYM_FILE_SHOULD_ACCOMPANY_PRODUCT": "YES", "DEBUG_INFORMATION_FORMAT": "dwarf-with-dsym", diff --git a/Tests/SWBTaskConstructionTests/EagerCompilationTests.swift b/Tests/SWBTaskConstructionTests/EagerCompilationTests.swift index 2b16bb1b..a0fc2590 100644 --- a/Tests/SWBTaskConstructionTests/EagerCompilationTests.swift +++ b/Tests/SWBTaskConstructionTests/EagerCompilationTests.swift @@ -2062,7 +2062,7 @@ fileprivate struct EagerCompilationTests: CoreBasedTests { results.checkTaskDoesNotFollow(compilationRequirementTargetC, antecedent: copyTask) } - // Check that compilation requirement is waiting for compilartion requirements of dependency targets + // Check that compilation requirement is waiting for compilation requirements of dependency targets results.checkTaskFollows(compilationRequirementTargetB, antecedent: compilationRequirementTargetA) results.checkTaskDoesNotFollow(compilationRequirementTargetA, antecedent: compilationRequirementTargetB) results.checkTaskDoesNotFollow(compilationRequirementTargetA, antecedent: compilationRequirementTargetC) diff --git a/Tests/SWBTaskConstructionTests/IndexBuildTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/IndexBuildTaskConstructionTests.swift index ac685980..a2818044 100644 --- a/Tests/SWBTaskConstructionTests/IndexBuildTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/IndexBuildTaskConstructionTests.swift @@ -96,7 +96,7 @@ fileprivate struct IndexBuildTaskConstructionTests: CoreBasedTests { ]) let tester = try await TaskConstructionTester(getCore(), testProject) - // Check that we get tasks for all the supported platforms, indepedent of the run destination in the build request. + // Check that we get tasks for all the supported platforms, independent of the run destination in the build request. func checkResults(_ results: TaskConstructionTester.PlanningResults) { results.checkTarget(macApp.name) { target in diff --git a/Tests/SWBTaskConstructionTests/MergeableLibraryTests.swift b/Tests/SWBTaskConstructionTests/MergeableLibraryTests.swift index 7cb54b35..2828d9ca 100644 --- a/Tests/SWBTaskConstructionTests/MergeableLibraryTests.swift +++ b/Tests/SWBTaskConstructionTests/MergeableLibraryTests.swift @@ -1999,7 +1999,7 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests { ]), ] ), - // Not-mergeeable framework target + // Not-mergeable framework target TestStandardTarget( "NormalFwkTarget", type: .framework, @@ -2425,7 +2425,7 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests { // App sources TestFile("Application.swift"), - // Dramework sources + // Framework sources TestFile("ClassOne.swift"), TestFile("ClassTwo.swift"), ]), @@ -2485,7 +2485,7 @@ fileprivate struct MergeableLibraryTests: CoreBasedTests { ]), ] ), - // Not-Mmrgeable framework target, which the mergeable framework target depends on, but which is not merged. + // Non-mergeable framework target, which the mergeable framework target depends on, but which is not merged. TestStandardTarget( "NormalFwkTarget", type: .framework, diff --git a/Tests/SWBTaskConstructionTests/ModuleMapTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/ModuleMapTaskConstructionTests.swift index f279c513..83b99186 100644 --- a/Tests/SWBTaskConstructionTests/ModuleMapTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/ModuleMapTaskConstructionTests.swift @@ -426,7 +426,7 @@ fileprivate struct ModuleMapTaskConstructionTests: CoreBasedTests { // There are some more tie breakers in the code but they're arbitrary and we don't // really care which umbrella looking header gets used. // 1. x.h is preferred over y.H. - // 2. When all else fails, lexigraphic order is used. + // 2. When all else fails, lexicographic order is used. // Don't add Swift contents to the module if the Objective-C compatibility header isn't generated. TestStandardTarget( diff --git a/Tests/SWBTaskConstructionTests/ModuleVerifierTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/ModuleVerifierTaskConstructionTests.swift index cfac592d..32779689 100644 --- a/Tests/SWBTaskConstructionTests/ModuleVerifierTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/ModuleVerifierTaskConstructionTests.swift @@ -141,7 +141,7 @@ fileprivate struct ModuleVerifierTaskConstructionTests: CoreBasedTests { FRAMEWORK_SEARCH_PATHS = /XCCONFIG_PATH """) - // A regular build will just build the currect architecture. + // A regular build will just build the correct architecture. await tester.checkBuild(BuildParameters(configuration: "Debug", commandLineOverrides: ["OTHER_CFLAGS": "-DCLI_FLAG"], environmentConfigOverridesPath: xcconfig), fs: fs) { results in let arch = results.runDestinationTargetArchitecture results.checkNoDiagnostics() @@ -359,7 +359,7 @@ fileprivate struct ModuleVerifierTaskConstructionTests: CoreBasedTests { ]) let tester = try await TaskConstructionTester(getCore(), testProject) - // A regular build will just build the currect architecture. + // A regular build will just build the correct architecture. await tester.checkBuild() { results in results.checkNoDiagnostics() @@ -457,7 +457,7 @@ fileprivate struct ModuleVerifierTaskConstructionTests: CoreBasedTests { ]) let tester = try await TaskConstructionTester(getCore(), testProject) - // A regular build will just build the currect architecture. + // A regular build will just build the correct architecture. await tester.checkBuild() { results in results.checkNoDiagnostics() @@ -574,7 +574,7 @@ fileprivate struct ModuleVerifierTaskConstructionTests: CoreBasedTests { ]) let tester = try await TaskConstructionTester(getCore(), testProject) - // A regular build will just build the currect architecture. + // A regular build will just build the correct architecture. await tester.checkBuild() { results in results.checkNoDiagnostics() @@ -638,7 +638,7 @@ fileprivate struct ModuleVerifierTaskConstructionTests: CoreBasedTests { let tester = try await TaskConstructionTester(getCore(), testProject) let SRCROOT = tester.workspace.projects[0].sourceRoot.str - // A regular build will just build the currect architecture. + // A regular build will just build the correct architecture. await tester.checkBuild() { results in let arch = results.runDestinationTargetArchitecture results.checkNoDiagnostics() @@ -707,7 +707,7 @@ fileprivate struct ModuleVerifierTaskConstructionTests: CoreBasedTests { let tester = try TaskConstructionTester(core, testProject) let SRCROOT = tester.workspace.projects[0].sourceRoot.str - // A regular build will just build the currect architecture. + // A regular build will just build the correct architecture. await tester.checkBuild() { results in let arch = results.runDestinationTargetArchitecture results.checkNoDiagnostics() diff --git a/Tests/SWBTaskConstructionTests/ResourceTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/ResourceTaskConstructionTests.swift index b316d65b..c8255d5f 100644 --- a/Tests/SWBTaskConstructionTests/ResourceTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/ResourceTaskConstructionTests.swift @@ -1608,7 +1608,7 @@ fileprivate struct ResourcesTaskConstructionTests: CoreBasedTests { task.checkRuleInfo(["CpResource", "/tmp/Test/aProject/build/Debug/CoreFoo.framework/Versions/A/Resources/Bar.fake-xcspec-twostep", "/tmp/Test/aProject/build/aProject.build/Debug/CoreFoo.build/DerivedSources/Bar.fake-xcspec-twostep"]) } - // We should not have any other CpResource or RuleScriptExeuction tasks. + // We should not have any other CpResource or RuleScriptExecution tasks. results.checkNoTask(.matchRuleType("RuleScriptExecution")) results.checkNoTask(.matchRuleType("CpResource")) } @@ -1674,7 +1674,7 @@ fileprivate struct ResourcesTaskConstructionTests: CoreBasedTests { task.checkRuleInfo(["Copy", "\(SRCROOT)/build/Debug/CoreFoo.framework/Versions/A/Resources/Bar.fake-twostep", "\(SRCROOT)/build/aProject.build/Debug/CoreFoo.build/DerivedSources/Bar.fake-twostep"]) } - // We should not have any other CpResource or RuleScriptExeuction tasks. + // We should not have any other CpResource or RuleScriptExecution tasks. results.checkNoTask(.matchRuleType("RuleScriptExecution")) results.checkNoTask(.matchRuleType("CpResource")) } diff --git a/Tests/SWBTaskConstructionTests/SignatureCollectionTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/SignatureCollectionTaskConstructionTests.swift index 18e6a7d1..aa6cf94f 100644 --- a/Tests/SWBTaskConstructionTests/SignatureCollectionTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/SignatureCollectionTaskConstructionTests.swift @@ -102,7 +102,7 @@ fileprivate struct SignatureCollectionTaskConstructionTests: CoreBasedTests { try fs.createDirectory(Path(SRCROOT), recursive: true) try fs.write(Path(SRCROOT).join("file.c"), contents: "int f() { return 0; }") - let googiesXCFramework = try XCFramework(version: Version(1, 0), libraries: [ + let goodiesXCFramework = try XCFramework(version: Version(1, 0), libraries: [ XCFramework.Library(libraryIdentifier: "x86_64-apple-macos\(core.loadSDK(.macOS).defaultDeploymentTarget)", supportedPlatform: "macos", supportedArchitectures: ["x86_64"], platformVariant: nil, libraryPath: Path("Goodies.framework"), binaryPath: Path("Goodies.framework/Versions/A/Goodies"), headersPath: nil), XCFramework.Library(libraryIdentifier: "arm64-apple-iphoneos\(core.loadSDK(.iOS).defaultDeploymentTarget)", supportedPlatform: "ios", supportedArchitectures: ["arm64", "arm64e"], platformVariant: nil, libraryPath: Path("Goodies.framework"), binaryPath: Path("Goodies.framework/Goodies"), headersPath: nil), XCFramework.Library(libraryIdentifier: "x86_64-apple-ios\(core.loadSDK(.iOS).defaultDeploymentTarget)-maccatalyst", supportedPlatform: "ios", supportedArchitectures: ["x86_64"], platformVariant: "macabi", libraryPath: Path("Goodies.framework"), binaryPath: Path("Goodies.framework/Goodies"), headersPath: nil), @@ -110,7 +110,7 @@ fileprivate struct SignatureCollectionTaskConstructionTests: CoreBasedTests { let goodiesXCFrameworkPath = Path(SRCROOT).join("Goodies.xcframework") try fs.createDirectory(goodiesXCFrameworkPath, recursive: true) let infoLookup = try await getCore() - try await XCFrameworkTestSupport.writeXCFramework(googiesXCFramework, fs: fs, path: goodiesXCFrameworkPath, infoLookup: infoLookup) + try await XCFrameworkTestSupport.writeXCFramework(goodiesXCFramework, fs: fs, path: goodiesXCFrameworkPath, infoLookup: infoLookup) try await tester.checkBuild(BuildParameters(configuration: "Debug", activeRunDestination: .macOS, overrides: ["ENABLE_SIGNATURE_AGGREGATION": "YES"]), fs: fs) { results in // NOTE: The signature collection pulls out the framework signature information **NOT** the xcframework signature info. diff --git a/Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift index 1642143f..41aff0a8 100644 --- a/Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift @@ -3295,7 +3295,7 @@ fileprivate struct SwiftTaskConstructionTests: CoreBasedTests { } } - // Test frontend flag -library-level inferrence from the INSTALL_PATH. + // Test frontend flag -library-level inference from the INSTALL_PATH. @Test(.requireSDKs(.macOS)) func libraryLevel() async throws { if try await !swiftFeatures.has(.libraryLevel) { @@ -3876,7 +3876,7 @@ fileprivate struct SwiftTaskConstructionTests: CoreBasedTests { } } @Test(.requireSDKs(.host)) - func nonConformantPathsCauseDiganostics() async throws { + func nonConformantPathsCauseDiagnostics() async throws { let destination: RunDestinationInfo = .host let testFilename = (destination == .windows) ? "main\t\n.swift": "main\u{0}.swift" let testProject = try await TestProject( diff --git a/Tests/SWBTaskConstructionTests/TaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/TaskConstructionTests.swift index 02c28c25..e916e0f6 100644 --- a/Tests/SWBTaskConstructionTests/TaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/TaskConstructionTests.swift @@ -1963,13 +1963,13 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { ], destinationSubfolder: .frameworks, onlyForDeployment: false), // The destination here matches how the "XPCServices" popup in the build phase UI populates it. See TestCopyFilesBuildPhase([ - TestBuildFile("Servicible.xpc", codeSignOnCopy: true), + TestBuildFile("Serviceable.xpc", codeSignOnCopy: true), ], destinationSubfolder: .builtProductsDir, destinationSubpath: "$(CONTENTS_FOLDER_PATH)/XPCServices", onlyForDeployment: false), TestCopyFilesBuildPhase([ TestBuildFile("Extending.appex", codeSignOnCopy: true), ], destinationSubfolder: .plugins, onlyForDeployment: false), ], - dependencies: ["FwkTarget", "Servicible", "Extending"] + dependencies: ["FwkTarget", "Serviceable", "Extending"] ), TestStandardTarget( "FwkTarget", @@ -1989,7 +1989,7 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { ] ), TestStandardTarget( - "Servicible", + "Serviceable", type: .xpcService, buildConfigurations: [ TestBuildConfiguration("Debug", buildSettings: [:]), @@ -2035,9 +2035,9 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { results.checkTask(.matchTarget(target), .matchRuleType("CodeSign"), .matchRuleItem("\(SRCROOT)/build/Debug/FwkTarget.framework/Versions/A")) { task in } } - results.checkTarget("Servicible") { target in + results.checkTarget("Serviceable") { target in // There should be one codesign task. - results.checkTask(.matchTarget(target), .matchRuleType("CodeSign"), .matchRuleItem("\(SRCROOT)/build/Debug/Servicible.xpc")) { task in + results.checkTask(.matchTarget(target), .matchRuleType("CodeSign"), .matchRuleItem("\(SRCROOT)/build/Debug/Serviceable.xpc")) { task in } } results.checkTarget("Extending") { target in @@ -2053,9 +2053,9 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { } // For the XPC service, there should be a copy task, and no signing task. - results.checkTask(.matchTarget(target), .matchRuleType("Copy"), .matchRuleItem("\(SRCROOT)/build/Debug/AppTarget.app/Contents/XPCServices/Servicible.xpc"), .matchRuleItem("\(SRCROOT)/build/Debug/Servicible.xpc")) { task in + results.checkTask(.matchTarget(target), .matchRuleType("Copy"), .matchRuleItem("\(SRCROOT)/build/Debug/AppTarget.app/Contents/XPCServices/Serviceable.xpc"), .matchRuleItem("\(SRCROOT)/build/Debug/Serviceable.xpc")) { task in } - results.checkNoTask(.matchTarget(target), .matchRuleType("CodeSign"), .matchRuleItem("\(SRCROOT)/build/Debug/AppTarget.app/Contents/XPCServices/Servicible.xpc")) + results.checkNoTask(.matchTarget(target), .matchRuleType("CodeSign"), .matchRuleItem("\(SRCROOT)/build/Debug/AppTarget.app/Contents/XPCServices/Serviceable.xpc")) // For the appex, there should be a copy task, no signing task, and a validation task. results.checkTask(.matchTarget(target), .matchRuleType("Copy"), .matchRuleItem("\(SRCROOT)/build/Debug/AppTarget.app/Contents/PlugIns/Extending.appex"), .matchRuleItem("\(SRCROOT)/build/Debug/Extending.appex")) { task in @@ -2237,7 +2237,7 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { ]) let tester = try await TaskConstructionTester(getCore(), testProject) - // Test a regular build. Since `only-for-deplyment` is set, this should not result in any tasks. + // Test a regular build. Since `only-for-deployment` is set, this should not result in any tasks. let buildParameters = BuildParameters(action: .build, configuration: "Debug", overrides: [:]) await tester.checkBuild(buildParameters) { results in // We need to filter out boilerplate tasks such as `Gate` and `WriteAuxiliaryFile`, but there should be no others besides those. @@ -2415,7 +2415,7 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { ]) } - // Ignore all Gate and build direcotry tasks. + // Ignore all Gate and build directory tasks. results.checkTasks(.matchRuleType("Gate")) { _ in } results.checkTasks(.matchRuleType("CreateBuildDirectory")) { _ in } @@ -2661,7 +2661,7 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { } } - // Test vaguaries of build variant handling. + // Test vagaries of build variant handling. @Test(.requireSDKs(.macOS)) func buildVariants() async throws { let variants = ["normal", "debug"] @@ -5212,7 +5212,7 @@ fileprivate struct TaskConstructionTests: CoreBasedTests { let tester = try TaskConstructionTester(core, project) let SRCROOT = tester.workspace.projects[0].sourceRoot.str - // We need to construct a csutom build request because `PACKAGE_BUILD_DYNAMICALLY` only works in the per-target parameters. + // We need to construct a custom build request because `PACKAGE_BUILD_DYNAMICALLY` only works in the per-target parameters. let targets = tester.workspace.projects[0].targets.map({ BuildRequest.BuildTargetInfo(parameters: buildParameters.replacing(activeRunDestination: destination, activeArchitecture: nil), target: $0) }) let buildRequest = BuildRequest(parameters: buildParameters.replacing(activeRunDestination: destination, activeArchitecture: nil), buildTargets: targets, continueBuildingAfterErrors: false, useParallelTargets: true, useImplicitDependencies: true, useDryRun: false) diff --git a/Tests/SWBTaskConstructionTests/UnitTestTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/UnitTestTaskConstructionTests.swift index ce58e20d..a2579a54 100644 --- a/Tests/SWBTaskConstructionTests/UnitTestTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/UnitTestTaskConstructionTests.swift @@ -856,7 +856,7 @@ fileprivate struct UnitTestTaskConstructionTests: CoreBasedTests { /// Test task construction for a unit test target for watchOS. Both debug and install builds are tested for the device, and a debug build is tested for the simulator. /// - /// This test is primarily intended to validate some pecularities of building for watchOS. + /// This test is primarily intended to validate some peculiarities of building for watchOS. @Test(.requireSDKs(.watchOS)) func applicationUnitTestTarget_watchOS() async throws { diff --git a/Tests/SWBTaskConstructionTests/XCFrameworkTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/XCFrameworkTaskConstructionTests.swift index 5c17e35f..d9550277 100644 --- a/Tests/SWBTaskConstructionTests/XCFrameworkTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/XCFrameworkTaskConstructionTests.swift @@ -91,7 +91,7 @@ fileprivate struct XCFrameworkTaskConstructionTests: CoreBasedTests { try results.checkTarget("App") { target in results.checkNoDiagnostics() - // Validate that the compile tas has the include path, which is simply the default of "-I\(SRCROOT)/build/Debug/include". Also ensure there are no unexpecte items. + // Validate that the compile tas has the include path, which is simply the default of "-I\(SRCROOT)/build/Debug/include". Also ensure there are no unexpected items. try results.checkTask(.matchTarget(target), .matchRuleType("CompileC")) { task in // There needs to be a strong dependency on the XCFramework processing. results.checkTaskFollows(task, antecedent: try #require(processSupportXCFrameworkTask)) @@ -200,7 +200,7 @@ fileprivate struct XCFrameworkTaskConstructionTests: CoreBasedTests { processSupportXCFrameworkTask = task } - // Validate that the compile tas has the include path, which is simply the default of "-I\(SRCROOT)/build/Debug/include". Also ensure there are no unexpecte items. + // Validate that the compile tas has the include path, which is simply the default of "-I\(SRCROOT)/build/Debug/include". Also ensure there are no unexpected items. try results.checkTask(.matchTarget(target), .matchRuleType("CompileC")) { task in // There needs to be a strong dependency on the XCFramework processing. results.checkTaskFollows(task, antecedent: try #require(processSupportXCFrameworkTask)) @@ -235,7 +235,7 @@ fileprivate struct XCFrameworkTaskConstructionTests: CoreBasedTests { processSupportXCFrameworkTask = task } - // Validate that the compile tas has the include path, which is simply the default of "-I\(SRCROOT)/build/Debug/include". Also ensure there are no unexpecte items. + // Validate that the compile tas has the include path, which is simply the default of "-I\(SRCROOT)/build/Debug/include". Also ensure there are no unexpected items. try results.checkTask(.matchTarget(target), .matchRuleType("CompileC")) { task in // There needs to be a strong dependency on the XCFramework processing. results.checkTaskFollows(task, antecedent: try #require(processSupportXCFrameworkTask)) @@ -332,7 +332,7 @@ fileprivate struct XCFrameworkTaskConstructionTests: CoreBasedTests { try results.checkTarget("App") { target in results.checkNoDiagnostics() - // Validate that the compile tas has the include path, which is simply the default of "-I\(SRCROOT)/build/Debug/include". Also ensure there are no unexpecte items. + // Validate that the compile tas has the include path, which is simply the default of "-I\(SRCROOT)/build/Debug/include". Also ensure there are no unexpected items. try results.checkTask(.matchTarget(target), .matchRuleType("CompileC")) { task in // There needs to be a strong dependency on the XCFramework processing. results.checkTaskFollows(task, antecedent: try #require(processSupportXCFrameworkTask)) diff --git a/Tests/SWBTaskExecutionTests/PBXCpTests.swift b/Tests/SWBTaskExecutionTests/PBXCpTests.swift index 92ee134f..474e994b 100644 --- a/Tests/SWBTaskExecutionTests/PBXCpTests.swift +++ b/Tests/SWBTaskExecutionTests/PBXCpTests.swift @@ -461,7 +461,7 @@ fileprivate struct PBXCpTests: CoreBasedTests { #expect(result.output == ( "copying src/...\n copying file...\n \(size) bytes\n" )) - // Check permssions + // Check permissions let dstPerm = try fs.getFilePermissions(dName) #expect(dstPerm == 0o644) // files are created with u+rw, g+wr, o+rw (and +x if src is executable) permissions and umask will adjust #expect(FileManager.default.contentsEqual(atPath: sName.str, andPath: dName.str)) diff --git a/Tests/SWBTaskExecutionTests/ProcessProductPackagingTaskTests.swift b/Tests/SWBTaskExecutionTests/ProcessProductPackagingTaskTests.swift index 0e89ded4..8433f549 100644 --- a/Tests/SWBTaskExecutionTests/ProcessProductPackagingTaskTests.swift +++ b/Tests/SWBTaskExecutionTests/ProcessProductPackagingTaskTests.swift @@ -305,7 +305,7 @@ fileprivate struct ProcessProductEntitlementsTaskTests { fileprivate struct ProcessProductProvisioningProfileTaskTests { @Test func diagnostics() async { - func checkDiagnostics(_ commandLine: [String], errors: [String] = [], warnings: [String] = [], notes: [String] = [], sourceLocaction: SourceLocation = #_sourceLocation) async + func checkDiagnostics(_ commandLine: [String], errors: [String] = [], warnings: [String] = [], notes: [String] = [], sourceLocation: SourceLocation = #_sourceLocation) async { let action = ProcessProductProvisioningProfileTaskAction() let task = Task(forTarget: nil, ruleInfo: [], commandLine: commandLine, workingDirectory: Path(""), action: action) @@ -320,10 +320,10 @@ fileprivate struct ProcessProductProvisioningProfileTaskTests { outputDelegate: outputDelegate ) - #expect(result == .failed, sourceLocation: sourceLocaction) - #expect(outputDelegate.errors == errors.map { "error: \($0)" }, sourceLocation: sourceLocaction) - #expect(outputDelegate.warnings == warnings.map { "warning: \($0)" }, sourceLocation: sourceLocaction) - #expect(outputDelegate.notes == notes.map { "note: \($0)" }, sourceLocation: sourceLocaction) + #expect(result == .failed, sourceLocation: sourceLocation) + #expect(outputDelegate.errors == errors.map { "error: \($0)" }, sourceLocation: sourceLocation) + #expect(outputDelegate.warnings == warnings.map { "warning: \($0)" }, sourceLocation: sourceLocation) + #expect(outputDelegate.notes == notes.map { "note: \($0)" }, sourceLocation: sourceLocation) } await checkDiagnostics([], errors: ["no input file specified", "missing required option: -o"]) diff --git a/Tests/SWBUtilTests/FSProxyTests.swift b/Tests/SWBUtilTests/FSProxyTests.swift index f008d1fe..a6db4897 100644 --- a/Tests/SWBUtilTests/FSProxyTests.swift +++ b/Tests/SWBUtilTests/FSProxyTests.swift @@ -1280,7 +1280,7 @@ import SWBTestSupport /// /// - Parameters: /// - fs: The filesystem to test on. -/// - basePath: The path at which the temporary file strucutre should be created. +/// - basePath: The path at which the temporary file structure should be created. private func removeFileTreeTester(fs: any FSProxy, basePath path: Path, sourceLocation: SourceLocation = #_sourceLocation) { // Test removing folders. let folders = path.join("foo/bar/baz") diff --git a/Tests/SWBUtilTests/PropertyListTests.swift b/Tests/SWBUtilTests/PropertyListTests.swift index 38a9dad9..3bd3f5e1 100644 --- a/Tests/SWBUtilTests/PropertyListTests.swift +++ b/Tests/SWBUtilTests/PropertyListTests.swift @@ -449,7 +449,7 @@ import SWBUtil ]) #expect(heterogeneousPlistDict.deterministicDescription == "PLDict<[\"array\": PLArray<[\"foo\", \"bar\"]>, \"bool\": true, \"dict\": PLDict<[\"ack\": \"It's a\", \"bar\": \"trap!\"]>, \"double\": 5.3, \"int\": 6]>") - // Make sure we nestedly call deterministicDescription on arrays and dictionaries. + // Make sure we call deterministicDescription recursively on arrays and dictionaries. let nestedPlistDict: PropertyListItem = .plDict([ "array": .plArray([ .plDict([ diff --git a/Tests/SwiftBuildTests/DeferredExecutionTests.swift b/Tests/SwiftBuildTests/DeferredExecutionTests.swift index 9491ec00..06d7447e 100644 --- a/Tests/SwiftBuildTests/DeferredExecutionTests.swift +++ b/Tests/SwiftBuildTests/DeferredExecutionTests.swift @@ -184,7 +184,7 @@ fileprivate func withConfirmations(invert: Bool, _ body: (_ assetCatalogExpectat try await confirmation("Clang deferred execution requested", expectedCount: expectedCount) { clangExpectation in try await confirmation("Swift deferred execution requested", expectedCount: swiftExpectedCount) { swiftExpectation in try await confirmation("Linker deferred execution requested", expectedCount: expectedCount) { linkerExpectation in - try await confirmation("Touch deferred exeucution requested", expectedCount: expectedCount) { touchExpectation in + try await confirmation("Touch deferred execution requested", expectedCount: expectedCount) { touchExpectation in try await confirmation("derq deferred execution requested", expectedCount: expectedCount) { derqExpectation in try await body(assetCatalogExpectation, codeSignExpectation, clangExpectation, swiftExpectation, linkerExpectation, touchExpectation, derqExpectation) }