Skip to content

Fix all remaining spelling errors throughout the codebase #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name SwiftBuild>
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature ExistentialAny>"
"$<$<COMPILE_LANGUAGE:Swift>: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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)
}
}
4 changes: 2 additions & 2 deletions Sources/SWBBuildSystem/DependencyCycleFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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" : "")
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/BuildFileResolution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/BuildRequestContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Sources/SWBCore/BuildRuleCondition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 10 additions & 10 deletions Sources/SWBCore/DependencyResolution.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 })
Expand Down
16 changes: 8 additions & 8 deletions Sources/SWBCore/LibSwiftDriver/LibSwiftDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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] = [:]

Expand Down Expand Up @@ -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() {}

Expand Down Expand Up @@ -199,35 +199,35 @@ public final class SwiftModuleDependencyGraph: SwiftGlobalExplicitDependencyGrap
public func addExplicitDependencyBuildJobs(_ jobs: [SwiftDriverJob], workingDirectory: Path,
producerMap: inout [Path: LibSwiftDriver.JobKey]) throws -> Set<LibSwiftDriver.JobKey> {
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":
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/LibSwiftDriver/PlannedBuild.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/MacroConfigFileLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/MacroEvaluationExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/OptimizationRemarks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/PlatformFiltering.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/PlatformRegistry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public final class PlatformRegistry {
/// The list of all registered platforms, ordered by identifier.
public private(set) var platforms = Array<Platform>()

/// The map of platforms by identifer.
/// The map of platforms by identifier.
@_spi(Testing) public private(set) var platformsByIdentifier = Dictionary<String, Platform>()

/// The map of platforms by name.
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/ProjectModel/BuildFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading