From e39832f10a9ee60c819bca1362717203a9b501d0 Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Mon, 5 May 2025 10:29:15 -0700 Subject: [PATCH] Turn on the inclusive language soundness check --- .github/workflows/pull_request.yml | 1 - .../cmake-smoke-test/cmake-smoke-test.swift | 2 +- Sources/SWBCore/Settings/Settings.swift | 2 +- .../Tools/SwiftCompiler.swift | 45 +++++++++---------- Sources/SWBUtil/Debugger.swift | 2 +- Sources/SWBUtil/PbxCp.swift | 2 +- .../SWBBuildServiceConnection.swift | 2 +- .../SwiftBuild/SWBBuildServiceSession.swift | 2 +- .../BuildTaskBehaviorTests.swift | 2 +- .../CodeSignTaskConstructionTests.swift | 8 ++-- ...SwiftModuleOnlyTaskConstructionTests.swift | 12 ++--- .../SwiftTaskConstructionTests.swift | 10 ++--- Tests/SWBUtilTests/ProcessTests.swift | 2 +- Tests/SWBUtilTests/WaitConditionTests.swift | 2 +- .../ConsoleCommands/CLIConnection.swift | 4 +- .../ConsoleCommands/ServiceConsoleTests.swift | 2 +- 16 files changed, 49 insertions(+), 51 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9ea980b9..47ce72a9 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -66,5 +66,4 @@ jobs: with: license_header_check_project_name: "Swift" api_breakage_check_enabled: false - unacceptable_language_check_enabled: false format_check_enabled: false diff --git a/Plugins/cmake-smoke-test/cmake-smoke-test.swift b/Plugins/cmake-smoke-test/cmake-smoke-test.swift index bb220124..4d1b6fb0 100644 --- a/Plugins/cmake-smoke-test/cmake-smoke-test.swift +++ b/Plugins/cmake-smoke-test/cmake-smoke-test.swift @@ -191,7 +191,7 @@ extension Process { Diagnostics.progress("Using process spawning workaround") // Linux workaround for https://github.com/swiftlang/swift-corelibs-foundation/issues/4772 // Foundation.Process on Linux seems to inherit the Process.run()-calling thread's signal mask, creating processes that even have SIGTERM blocked - // This manifests as CMake hanging when invoking 'uname' with incorrectly configured signal handlers. + // This manifests as CMake getting stuck when invoking 'uname' with incorrectly configured signal handlers. var fileActions = posix_spawn_file_actions_t() defer { posix_spawn_file_actions_destroy(&fileActions) } var attrs: posix_spawnattr_t = posix_spawnattr_t() diff --git a/Sources/SWBCore/Settings/Settings.swift b/Sources/SWBCore/Settings/Settings.swift index f74c0119..52617acd 100644 --- a/Sources/SWBCore/Settings/Settings.swift +++ b/Sources/SWBCore/Settings/Settings.swift @@ -5066,7 +5066,7 @@ private class SettingsBuilder { return [] } - // For performance, we're only going to check the Resources build phase because that's where xcstrings are expected to hang out. + // For performance, we're only going to check the Resources build phase because that's where xcstrings are expected to be. let buildFiles = standardTarget.resourcesBuildPhase?.buildFiles ?? [] let resolver = FilePathResolver(scope: scope) diff --git a/Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift b/Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift index 66daabff..826b2917 100644 --- a/Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift +++ b/Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift @@ -2132,7 +2132,6 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi // Compute the inputs and object output dependency paths. // Note that we compute the object file output paths here even if the compilation mode won't produce any, because these paths are used to compute the paths to other generated files. - // FIXME: If we want to match what Xcode did, then when using non-parallel WMO, we should include $(TARGET_NAME)-master.o as an output file, but not include the per-input-file object files as output files. let outputObjectExtension: String switch cbc.scope.evaluate(BuiltinMacros.SWIFT_LTO) { case .yes, .yesThin: @@ -2161,11 +2160,11 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi // Add const metadata outputs to extra compilation outputs if await supportConstSupplementaryMetadata(cbc, delegate, compilationMode: compilationMode) { - // If using whole module optimization then we use the -master.swiftconstvalues file from the sole compilation task. + // If using whole module optimization then we use the -primary.swiftconstvalues file from the sole compilation task. if isUsingWholeModuleOptimization { if let outputPath = objectOutputPaths.first { - let masterSwiftBaseName = cbc.scope.evaluate(BuiltinMacros.TARGET_NAME) + compilationMode.moduleBaseNameSuffix + "-master" - let supplementaryConstMetadataOutputPath = outputPath.dirname.join(masterSwiftBaseName + ".swiftconstvalues") + let primarySwiftBaseName = cbc.scope.evaluate(BuiltinMacros.TARGET_NAME) + compilationMode.moduleBaseNameSuffix + "-primary" + let supplementaryConstMetadataOutputPath = outputPath.dirname.join(primarySwiftBaseName + ".swiftconstvalues") extraOutputPaths.append(supplementaryConstMetadataOutputPath) delegate.declareGeneratedSwiftConstMetadataFile(supplementaryConstMetadataOutputPath, architecture: arch) } @@ -2232,11 +2231,11 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi // // FIXME: Can we simplify this to not require the full macro scope? // - // If using whole module optimization then we use the -master.d file as the dependency file. + // If using whole module optimization then we use the -primary.d file as the dependency file. if let outputPath = objectOutputPaths.first { if Self.shouldUseWholeModuleOptimization(for: cbc.scope).result { - let masterSwiftBaseName = cbc.scope.evaluate(BuiltinMacros.TARGET_NAME) + compilationMode.moduleBaseNameSuffix + "-master" - let dependenciesFilePath = outputPath.dirname.join(masterSwiftBaseName + ".d") + let primarySwiftBaseName = cbc.scope.evaluate(BuiltinMacros.TARGET_NAME) + compilationMode.moduleBaseNameSuffix + "-primary" + let dependenciesFilePath = outputPath.dirname.join(primarySwiftBaseName + ".d") return dependenciesFilePath } else { // if not using WMO, we use the first .d file as all are the same @@ -2348,8 +2347,8 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi let dependencyData: DependencyDataStyle? if await shouldEmitMakeStyleDependencies(cbc.producer, cbc.scope, delegate: delegate) { // FIXME: Duplication with `SwiftCompilerSpec.computeOutputFileMapContents` - let masterSwiftBaseName = cbc.scope.evaluate(BuiltinMacros.TARGET_NAME) + compilationMode.moduleBaseNameSuffix + "-master" - let emitModuleDependenciesFilePath = objectFileDir.join(masterSwiftBaseName + "-emit-module.d") + let primarySwiftBaseName = cbc.scope.evaluate(BuiltinMacros.TARGET_NAME) + compilationMode.moduleBaseNameSuffix + "-primary" + let emitModuleDependenciesFilePath = objectFileDir.join(primarySwiftBaseName + "-emit-module.d") dependencyData = eagerCompilationEnabled ? .makefileIgnoringSubsequentOutputs(emitModuleDependenciesFilePath) : dependencyInfoPath.map(DependencyDataStyle.makefileIgnoringSubsequentOutputs) } else { dependencyData = nil @@ -2755,7 +2754,7 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi moduleDirPath = scope.evaluate(BuiltinMacros.BUILT_PRODUCTS_DIR).join(moduleName + ".swiftmodule") } if isProject { - // Copy this content to the Project subdir so we could master them out when installing. + // Copy this content to the Project subdir so we can exclude them by filename pattern when installing. return moduleDirPath.join("Project") } return moduleDirPath @@ -3047,7 +3046,7 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi // Compute strings that will be used at various points when building the map. let moduleBaseNameSuffix = compilationMode.moduleBaseNameSuffix - let masterSwiftBaseName = cbc.scope.evaluate(BuiltinMacros.TARGET_NAME) + moduleBaseNameSuffix + "-master" + let primarySwiftBaseName = cbc.scope.evaluate(BuiltinMacros.TARGET_NAME) + moduleBaseNameSuffix + "-primary" let emitConstSideCarValues = await supportConstSupplementaryMetadata(cbc, delegate, compilationMode: compilationMode) func createCommonFileEntry(input: FileToBuild) -> (objectFilePath: Path, fileMapEntry: SwiftOutputFileMap.Entry) { @@ -3110,25 +3109,25 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi var fileMapEntry = SwiftOutputFileMap.Entry() // The file used by Swift to manage intermodule dependencies. - let globalSwiftDependenciesFilePath = objectFileDir.join(masterSwiftBaseName + ".swiftdeps") + let globalSwiftDependenciesFilePath = objectFileDir.join(primarySwiftBaseName + ".swiftdeps") fileMapEntry.swiftDependencies = globalSwiftDependenciesFilePath.str // The diagnostics file. - let diagnosticsFilePath = objectFileDir.join(masterSwiftBaseName + ".dia") + let diagnosticsFilePath = objectFileDir.join(primarySwiftBaseName + ".dia") fileMapEntry.diagnostics = diagnosticsFilePath.str // The diagnostics file for emit-module jobs. - let emitModuleDiagnosticsFilePath = objectFileDir.join(masterSwiftBaseName + "-emit-module.dia") + let emitModuleDiagnosticsFilePath = objectFileDir.join(primarySwiftBaseName + "-emit-module.dia") fileMapEntry.emitModuleDiagnostics = emitModuleDiagnosticsFilePath.str if await shouldEmitMakeStyleDependencies(cbc.producer, cbc.scope, delegate: delegate) { // The dependency file for emit-module jobs. - let emitModuleDependenciesFilePath = objectFileDir.join(masterSwiftBaseName + "-emit-module.d") + let emitModuleDependenciesFilePath = objectFileDir.join(primarySwiftBaseName + "-emit-module.d") fileMapEntry.emitModuleDependencies = emitModuleDependenciesFilePath.str } // The PCH file path for generatePCH job. - let bridgingHeaderPCHPath = objectFileDir.join(masterSwiftBaseName + "-Bridging-header.pch") + let bridgingHeaderPCHPath = objectFileDir.join(primarySwiftBaseName + "-Bridging-header.pch") fileMapEntry.pch = bridgingHeaderPCHPath.str // Add the global entry to the map. @@ -3146,35 +3145,35 @@ public final class SwiftCompilerSpec : CompilerSpec, SpecIdentifierType, SwiftDi var fileMapEntry = SwiftOutputFileMap.Entry() // The diagnostics file. - let diagnosticsFilePath = objectFileDir.join(masterSwiftBaseName + ".dia") + let diagnosticsFilePath = objectFileDir.join(primarySwiftBaseName + ".dia") fileMapEntry.diagnostics = diagnosticsFilePath.str // The diagnostics file for emit-module jobs. - let emitModuleDiagnosticsFilePath = objectFileDir.join(masterSwiftBaseName + "-emit-module.dia") + let emitModuleDiagnosticsFilePath = objectFileDir.join(primarySwiftBaseName + "-emit-module.dia") fileMapEntry.emitModuleDiagnostics = emitModuleDiagnosticsFilePath.str if await shouldEmitMakeStyleDependencies(cbc.producer, cbc.scope, delegate: delegate) { // The dependency file for emit-module jobs. - let emitModuleDependenciesFilePath = objectFileDir.join(masterSwiftBaseName + "-emit-module.d") + let emitModuleDependenciesFilePath = objectFileDir.join(primarySwiftBaseName + "-emit-module.d") fileMapEntry.emitModuleDependencies = emitModuleDependenciesFilePath.str // The dependencies file, used to discover implicit dependencies. This file will be in Makefile format. - let dependenciesFilePath = objectFileDir.join(masterSwiftBaseName + ".d") + let dependenciesFilePath = objectFileDir.join(primarySwiftBaseName + ".d") fileMapEntry.dependencies = dependenciesFilePath.str } // The file used by Swift to manage intermodule dependencies. - let swiftDependenciesFilePath = objectFileDir.join(masterSwiftBaseName + ".swiftdeps") + let swiftDependenciesFilePath = objectFileDir.join(primarySwiftBaseName + ".swiftdeps") fileMapEntry.swiftDependencies = swiftDependenciesFilePath.str // The requested compile-time values if emitConstSideCarValues && compilationMode.compileSources { - fileMapEntry.constValues = objectFileDir.join(masterSwiftBaseName + ".swiftconstvalues").str + fileMapEntry.constValues = objectFileDir.join(primarySwiftBaseName + ".swiftconstvalues").str } // The PCH file path for generatePCH job. - let bridgingHeaderPCHPath = objectFileDir.join(masterSwiftBaseName + "-Bridging-header.pch") + let bridgingHeaderPCHPath = objectFileDir.join(primarySwiftBaseName + "-Bridging-header.pch") fileMapEntry.pch = bridgingHeaderPCHPath.str // Add the global entry to the map. diff --git a/Sources/SWBUtil/Debugger.swift b/Sources/SWBUtil/Debugger.swift index 3bac6eac..7bec1c4b 100644 --- a/Sources/SWBUtil/Debugger.swift +++ b/Sources/SWBUtil/Debugger.swift @@ -64,7 +64,7 @@ public enum Debugger: Sendable { if isXcodeAutoAttachEnabled { try await waitForAttachment() { // Exit if parent process died while waiting for debugger - if kill(getppid(), 0) != 0 { + if kill(getppid(), 0) != 0 { // ignore-unacceptable-language; POSIX API throw StubError.error("Parent process exited while waiting for debugger") } return true diff --git a/Sources/SWBUtil/PbxCp.swift b/Sources/SWBUtil/PbxCp.swift index e372db81..c917f411 100644 --- a/Sources/SWBUtil/PbxCp.swift +++ b/Sources/SWBUtil/PbxCp.swift @@ -612,7 +612,7 @@ public func pbxcp(_ argv: [String], cwd: Path) async -> (success: Bool, output: } } - // Do some sanity-checking. + // Do some correctness-checking. if srcPath.isRoot { outStream <<< "error: Invalid source path: '\(srcPath.str)'\n" return (false, outStream.bytes.asString) diff --git a/Sources/SwiftBuild/SWBBuildServiceConnection.swift b/Sources/SwiftBuild/SWBBuildServiceConnection.swift index 60547066..67265583 100644 --- a/Sources/SwiftBuild/SWBBuildServiceConnection.swift +++ b/Sources/SwiftBuild/SWBBuildServiceConnection.swift @@ -950,7 +950,7 @@ fileprivate final class OutOfProcessConnection: ConnectionTransport { // If IBAutoAttach is enabled, send the message so Xcode will attach to the inferior. try Debugger.requestXcodeAutoAttachIfEnabled(task.processIdentifier) } catch { - // Terminate the subprocess if start() is going to throw, so that close() will not hang + // Terminate the subprocess if start() is going to throw, so that close() will not get stuck. task.terminate() } #endif diff --git a/Sources/SwiftBuild/SWBBuildServiceSession.swift b/Sources/SwiftBuild/SWBBuildServiceSession.swift index b43dc49e..f6d89617 100644 --- a/Sources/SwiftBuild/SWBBuildServiceSession.swift +++ b/Sources/SwiftBuild/SWBBuildServiceSession.swift @@ -630,7 +630,7 @@ extension SWBBuildServiceSession { throw StubError.error("Unexpected message: \(msgOpt.map(String.init(describing:)) ?? "")") } - // NOTE: If any GetProvisioningTaskInputsRequest/ExternalToolExecutionRequest messages are received, cancellation may result in them never receiving a reply, which could result in background operations hanging. We should find a way to handle that better. + // NOTE: If any GetProvisioningTaskInputsRequest/ExternalToolExecutionRequest messages are received, cancellation may result in them never receiving a reply, which could result in background operations getting stuck. We should find a way to handle that better. // nil indicates Task cancellation (we broke out of the loop) return nil diff --git a/Tests/SWBBuildSystemTests/BuildTaskBehaviorTests.swift b/Tests/SWBBuildSystemTests/BuildTaskBehaviorTests.swift index 8c9b69f8..c7ae170f 100644 --- a/Tests/SWBBuildSystemTests/BuildTaskBehaviorTests.swift +++ b/Tests/SWBBuildSystemTests/BuildTaskBehaviorTests.swift @@ -368,7 +368,7 @@ fileprivate struct BuildTaskBehaviorTests: CoreBasedTests { try await withTaskCancellationHandler { switch await operation.build() { case .cancelled, .failed: - // If the build already failed, cancel the task that waits for the script so the test doesn't hang forever. + // If the build already failed, cancel the task that waits for the script so the test doesn't get stuck forever. task.cancel() case .succeeded: break diff --git a/Tests/SWBTaskConstructionTests/CodeSignTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/CodeSignTaskConstructionTests.swift index 5ead63d3..33972fe8 100644 --- a/Tests/SWBTaskConstructionTests/CodeSignTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/CodeSignTaskConstructionTests.swift @@ -627,10 +627,10 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { } // Check that flags without a dedicated build setting are passed through as expected. - await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", overrides: ["ENABLE_LIBRARY_VALIDATION": "YES", "ENABLE_HARDENED_RUNTIME": "YES", "CODE_SIGN_RESTRICT": "YES", "OTHER_CODE_SIGN_FLAGS": "--options kill,hard,host,expires,linker-signed"]), runDestination: .macOS) { results in + await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", overrides: ["ENABLE_LIBRARY_VALIDATION": "YES", "ENABLE_HARDENED_RUNTIME": "YES", "CODE_SIGN_RESTRICT": "YES", "OTHER_CODE_SIGN_FLAGS": "--options kill,hard,host,expires,linker-signed"]), runDestination: .macOS) { results in // ignore-unacceptable-language; codesign tool option results.checkTarget("macOSFramework") { target in results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in - task.checkCommandLineMatches(["/usr/bin/codesign", "--force", "--sign", "-", "--options", "expires,hard,host,kill,library,linker-signed,restrict,runtime", "--entitlements", .suffix("macOSFramework.framework.xcent"), "--generate-entitlement-der", "/tmp/aProject.dst/Library/Frameworks/macOSFramework.framework/Versions/A"]) + task.checkCommandLineMatches(["/usr/bin/codesign", "--force", "--sign", "-", "--options", "expires,hard,host,kill,library,linker-signed,restrict,runtime", "--entitlements", .suffix("macOSFramework.framework.xcent"), "--generate-entitlement-der", "/tmp/aProject.dst/Library/Frameworks/macOSFramework.framework/Versions/A"]) // ignore-unacceptable-language; codesign tool option } } @@ -638,10 +638,10 @@ fileprivate struct CodeSignTaskConstructionTests: CoreBasedTests { } // Check that flags without a dedicated build setting are passed through as expected, in conjunction with DISABLE_FREEFORM_CODE_SIGN_OPTION_FLAGS removing disabled, known ones. - await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", overrides: ["ENABLE_LIBRARY_VALIDATION": "NO", "ENABLE_HARDENED_RUNTIME": "NO", "CODE_SIGN_RESTRICT": "YES", "OTHER_CODE_SIGN_FLAGS": "--options kill,hard,host,expires,linker-signed"]), runDestination: .macOS) { results in + await tester.checkBuild(BuildParameters(action: .install, configuration: "Release", overrides: ["ENABLE_LIBRARY_VALIDATION": "NO", "ENABLE_HARDENED_RUNTIME": "NO", "CODE_SIGN_RESTRICT": "YES", "OTHER_CODE_SIGN_FLAGS": "--options kill,hard,host,expires,linker-signed"]), runDestination: .macOS) { results in // ignore-unacceptable-language; codesign tool option results.checkTarget("macOSFramework") { target in results.checkTask(.matchTarget(target), .matchRuleType("CodeSign")) { task in - task.checkCommandLineMatches(["/usr/bin/codesign", "--force", "--sign", "-", "--options", "expires,hard,host,kill,linker-signed,restrict", "--entitlements", .suffix("macOSFramework.framework.xcent"), "--generate-entitlement-der", "/tmp/aProject.dst/Library/Frameworks/macOSFramework.framework/Versions/A"]) + task.checkCommandLineMatches(["/usr/bin/codesign", "--force", "--sign", "-", "--options", "expires,hard,host,kill,linker-signed,restrict", "--entitlements", .suffix("macOSFramework.framework.xcent"), "--generate-entitlement-der", "/tmp/aProject.dst/Library/Frameworks/macOSFramework.framework/Versions/A"]) // ignore-unacceptable-language; codesign tool option } } diff --git a/Tests/SWBTaskConstructionTests/SwiftModuleOnlyTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/SwiftModuleOnlyTaskConstructionTests.swift index 91a026e0..e3d75e46 100644 --- a/Tests/SWBTaskConstructionTests/SwiftModuleOnlyTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/SwiftModuleOnlyTaskConstructionTests.swift @@ -632,7 +632,7 @@ fileprivate struct SwiftModuleOnlyTaskConstructionTests: CoreBasedTests { } // Check the dependency data. - #expect(task.dependencyData == .makefileIgnoringSubsequentOutputs(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-master-emit-module.d"))) + #expect(task.dependencyData == .makefileIgnoringSubsequentOutputs(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-primary-emit-module.d"))) } } @@ -683,11 +683,11 @@ fileprivate struct SwiftModuleOnlyTaskConstructionTests: CoreBasedTests { let globalDict = try #require(dict[""]) XCTAssertEqualPropertyListItems(globalDict, .plDict([ - "swift-dependencies": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-master.swiftdeps").str), - "diagnostics": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-master.dia").str), - "emit-module-diagnostics": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-master-emit-module.dia").str), - "emit-module-dependencies": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-master-emit-module.d").str), - "pch": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-master-Bridging-header.pch").str), + "swift-dependencies": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-primary.swiftdeps").str), + "diagnostics": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-primary.dia").str), + "emit-module-diagnostics": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-primary-emit-module.dia").str), + "emit-module-dependencies": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-primary-emit-module.d").str), + "pch": .plString(archBuildDir.join("\(tpc.targetName)\(platformSuffix)-primary-Bridging-header.pch").str), ])) } diff --git a/Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift b/Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift index a6dc243a..89277df7 100644 --- a/Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift +++ b/Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift @@ -302,11 +302,11 @@ fileprivate struct SwiftTaskConstructionTests: CoreBasedTests { // Check the global dictionary. if let globalDict = dict[""] { XCTAssertEqualPropertyListItems(globalDict, .plDict([ - "swift-dependencies": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-master.swiftdeps"), - "diagnostics": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-master.dia"), - "emit-module-diagnostics": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-master-emit-module.dia"), - "emit-module-dependencies": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-master-emit-module.d"), - "pch": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-master-Bridging-header.pch"), + "swift-dependencies": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-primary.swiftdeps"), + "diagnostics": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-primary.dia"), + "emit-module-diagnostics": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-primary-emit-module.dia"), + "emit-module-dependencies": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-primary-emit-module.d"), + "pch": .plString("\(SRCROOT)/build/aProject.build/Debug/AppTarget.build/Objects-normal/x86_64/AppTarget-primary-Bridging-header.pch"), ])) } else { diff --git a/Tests/SWBUtilTests/ProcessTests.swift b/Tests/SWBUtilTests/ProcessTests.swift index b70660cc..9c7e837d 100644 --- a/Tests/SWBUtilTests/ProcessTests.swift +++ b/Tests/SWBUtilTests/ProcessTests.swift @@ -124,7 +124,7 @@ fileprivate struct ProcessTests { #ifdef _WIN32 TerminateProcess(GetCurrentProcess(), 0xC0000009); // STATUS_BAD_INITIAL_STACK #else - kill(getpid(), SIGKILL); + kill(getpid(), SIGKILL); // ignore-unacceptable-language; POSIX API #endif return 0; } diff --git a/Tests/SWBUtilTests/WaitConditionTests.swift b/Tests/SWBUtilTests/WaitConditionTests.swift index ba389408..307e1b46 100644 --- a/Tests/SWBUtilTests/WaitConditionTests.swift +++ b/Tests/SWBUtilTests/WaitConditionTests.swift @@ -27,7 +27,7 @@ import Testing await condition.wait() } - /// Regression test for `wait()` hanging when called from multiple tasks. + /// Regression test for `wait()` getting stuck when called from multiple tasks. @Test func multipleWaiters() async { let condition = WaitCondition() diff --git a/Tests/SwiftBuildTests/ConsoleCommands/CLIConnection.swift b/Tests/SwiftBuildTests/ConsoleCommands/CLIConnection.swift index f97d7891..3b987a81 100644 --- a/Tests/SwiftBuildTests/ConsoleCommands/CLIConnection.swift +++ b/Tests/SwiftBuildTests/ConsoleCommands/CLIConnection.swift @@ -172,8 +172,8 @@ final class CLIConnection { throw Win32Error(GetLastError()) } #else - if SWBLibc.kill(processIdentifier, SIGKILL) != 0 { - throw POSIXError(errno, context: "kill", String(processIdentifier), String(SIGKILL)) + if SWBLibc.kill(processIdentifier, SIGKILL) != 0 { // ignore-unacceptable-language; POSIX API + throw POSIXError(errno, context: "kill", String(processIdentifier), String(SIGKILL)) // ignore-unacceptable-language; POSIX API } #endif } diff --git a/Tests/SwiftBuildTests/ConsoleCommands/ServiceConsoleTests.swift b/Tests/SwiftBuildTests/ConsoleCommands/ServiceConsoleTests.swift index 8266297f..017090a5 100644 --- a/Tests/SwiftBuildTests/ConsoleCommands/ServiceConsoleTests.swift +++ b/Tests/SwiftBuildTests/ConsoleCommands/ServiceConsoleTests.swift @@ -144,7 +144,7 @@ extension Processes { #else Task.detached { while true { - // We use getpgid() here to detect when the process has exited (it is not a child). Surprisingly, getpgid() is substantially faster than using kill(pid, 0) here because kill still returns success for zombies, and the service has been reparented to launchd. + // We use getpgid() here to detect when the process has exited (it is not a child). Surprisingly, getpgid() is substantially faster than using kill(pid, 0) here because kill still returns success for zombies, and the service has been reparented to launchd. // ignore-unacceptable-language; POSIX API do { if getpgid(pid) < 0 { // We expect the signal to eventually fail with "No such process".