Skip to content

Merge main into release/6.2 #472

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 44 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2842c27
Pass -ftyped-cxx-new-delete as a linker arg.
usama54321 Apr 23, 2025
8515f09
App Sandbox build setting ends up in iOS signed app (#432)
baujla Apr 24, 2025
d4fe853
Revert "Annotate "$targetA is missing a dependency on $targetB" diagn…
mirza-garibovic Apr 24, 2025
e2f5506
Simplify a few API calls in FSProxy
jakepetroules Apr 21, 2025
382cc20
Remove confusing SWBDispatchQueue.async overload
jakepetroules Apr 24, 2025
c704557
Add new libcxx flag for disabling container overflow checks
thetruestblue Apr 24, 2025
9ad44f1
Test targets emit incorrect 'The ENABLE_APP_SANDBOX build setting is …
baujla Apr 25, 2025
b784996
Merge pull request #430 from swiftlang/usama54321/sua-back-deployment…
usama54321 Apr 25, 2025
622ebc7
[Explicit Module Builds] Enable incremental dependency scanning\nWith…
artemcm Apr 24, 2025
93322b9
Merge pull request #434 from artemcm/EnableIncrementalScan
artemcm Apr 25, 2025
0d54cb4
[SE-0466] Add SWIFT_DEFAULT_ACTOR_ISOLATION build setting
xedin Apr 25, 2025
39041d4
Merge pull request #437 from swiftlang/bg/add-new-libcpp-flag
thetruestblue Apr 25, 2025
cb6dfa2
`compatibleConfiguredTarget` should consider toolchains (#439)
neonichu Apr 25, 2025
4993822
Fix typo in `isCompatible` (#440)
neonichu Apr 25, 2025
377eb6f
Merge pull request #442 from swiftlang/rdar-145751834
xedin Apr 26, 2025
52578ea
Fix shellcheck issue in perf tests script (#448)
owenv Apr 28, 2025
bd5f673
Remove a trailing comma to restore 6.0 compatibility (#447)
owenv Apr 28, 2025
b82da06
Improve cmake-smoke-test command plugin
owenv Apr 28, 2025
0e2c781
[CAS] Adjust the caching report text to not mention 'miss'
akyrtzi Apr 27, 2025
f2a290b
Merge pull request #449 from swiftlang/owenv/cmake-smoke-test-fixes
owenv Apr 28, 2025
d7751e2
Added needed dependency to iOSAppSandboxAndHardnedRuntimeBuildSetting…
baujla Apr 28, 2025
0971657
Force git to check out text files with Unix newlines
jakepetroules Apr 28, 2025
1beb6ea
Skip large file copy test in GitHub actions (#451)
owenv Apr 28, 2025
3038e01
Add missing host SDK requirement to test
owenv Apr 28, 2025
0b4a664
Check for the index workspace description rather than index arena
bnbarham Apr 23, 2025
bb19f0d
Add -ftyped-cxx-delete to CLANG_ENABLE_CPLUSPLUS_TYPED_ALLOCATOR_SUPPORT
usama54321 Apr 28, 2025
adcc695
Export CMake targets for use by SwiftPM
owenv Apr 2, 2025
53032d0
Merge pull request #453 from swiftlang/owenv/test-sdk-dep
owenv Apr 28, 2025
ea8d619
Inclusive language: rename master object file to prelinked object file
jakepetroules Apr 28, 2025
056d2e3
Restore support for the llvm-bc (bitcode) field in the Swift file map.
mhrawdon Apr 28, 2025
e97614b
[CI] Add support for GitHub Actions (#446)
shahmishal Apr 29, 2025
8258eb5
Merge pull request #376 from swiftlang/cmake-exports
owenv Apr 29, 2025
d42d61d
Update CODEOWNERS
aciidgh Apr 29, 2025
392cca6
Add missing license header to CMake filewq
owenv Apr 29, 2025
f0af94b
Merge pull request #461 from swiftlang/owenv/license-header
owenv Apr 29, 2025
08e7bfe
Add automerge action for scheduled updates to release branch
owenv Apr 30, 2025
c216ede
Skip tests which fail in the GitHub actions runner environment
owenv Apr 30, 2025
d5d7c0a
Run tests in GitHub actions workflows
owenv Apr 30, 2025
e6ed315
Remove blocking_sync usages from SWBLLBuildTests
jakepetroules Apr 29, 2025
1bfdd81
Merge pull request #467 from swiftlang/owenv/automerge
owenv Apr 30, 2025
276a25a
Avoid blocking a Swift Task in the read() syscall
jakepetroules Apr 29, 2025
9572e6d
Merge pull request #464 from swiftlang/usama54321/cpp-secure-allocato…
usama54321 Apr 30, 2025
cd4fb4e
Merge pull request #459 from swiftlang/owenv/actions-debugging
owenv Apr 30, 2025
0a9c76a
Add missing deprecated GENERATE_MASTER_OBJECT_FILE API
jakepetroules Apr 30, 2025
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
17 changes: 17 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Create PR to merge main into release branch
# In the first period after branching the release branch, we typically want to include many changes from `main` in the release branch. This workflow automatically creates a PR every Monday to merge main into the release branch.
# Later in the release cycle we should stop this practice to avoid landing risky changes by disabling this workflow. To do so, disable the workflow as described in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
on:
schedule:
- cron: '0 9 * * MON'
workflow_dispatch:
jobs:
create_merge_pr:
name: Create PR to merge main into release branch
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@main
with:
base_branch: release/6.2
permissions:
contents: write
pull-requests: write
if: (github.event_name == 'schedule' && github.repository == 'swiftlang/swift-build') || (github.event_name != 'schedule') # Ensure that we don't run this on a schedule in a fork
29 changes: 29 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull request

on:
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Test
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9"]'
linux_pre_build_command: command -v apt >/dev/null 2>&1 && apt update && apt install -y libsqlite3-dev libncurses-dev || (command -v yum >/dev/null 2>&1 && yum update -y && yum install -y sqlite-devel ncurses-devel)
linux_build_command: 'swift test --no-parallel'
linux_swift_versions: '["nightly-main", "nightly-6.2"]'
windows_swift_versions: '["nightly-main"]'
windows_build_command: 'swift test --no-parallel'
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
license_header_check_project_name: "Swift"
api_breakage_check_enabled: false
unacceptable_language_check_enabled: false
format_check_enabled: false
11 changes: 11 additions & 0 deletions .license_header_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@@===----------------------------------------------------------------------===@@
@@
@@ This source file is part of the Swift open source project
@@
@@ Copyright (c) YEARS Apple Inc. and the Swift project authors
@@ Licensed under Apache License v2.0 with Runtime Library Exception
@@
@@ See http://swift.org/LICENSE.txt for license information
@@ See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
@@
@@===----------------------------------------------------------------------===@@
9 changes: 9 additions & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/*.mlmodel
**/*.pbxproj
**/*.png
**/*.xcworkspacedata
**/Package.swift
.dir-locals.el
.editorconfig
CODEOWNERS
Package.swift
41 changes: 40 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ cmake_minimum_required(VERSION 3.26...3.29)
project(SwiftBuild
LANGUAGES C CXX Swift)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

set(CMAKE_INSTALL_RPATH "$<IF:$<PLATFORM_ID:Darwin>,@loader_path/..,$ORIGIN>")
set(CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH YES)

set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)

option(BUILD_SHARED_LIBS "Build shared libraries by default" YES)

set(CMAKE_C_VISIBILITY hidden)
set(CMAKE_CXX_VISIBILITY hidden)
set(CMAKE_CXX_STANDARD 17)
Expand All @@ -35,7 +47,33 @@ add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name SwiftBuild>
# rdar://137809703
# "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature RegionBasedIsolation>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature ExistentialAny>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature InternalImportsByDefault>")
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-upcoming-feature InternalImportsByDefault>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-no-toolchain-stdlib-rpath>"
# Turn off autolinking within this project to reduce linker overhead.
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBLibc>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBAndroidPlatform>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBApplePlatform>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBBuildService>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCLibc>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBGenericUnixPlatform>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBTaskConstruction>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBUtil>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBUniversalPlatform>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBWindowsPlatform>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SwiftBuild>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBWebAssemblyPlatform>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCSupport>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBMacro>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBProjectModel>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBTaskExecution>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBServiceCore>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBQNXPlatform>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBProtocol>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBLLBuild>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCore>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCAS>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBBuildSystem>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-autolink-library -Xfrontend SWBCore>")

# Prefer the static initialization for the plugins.
add_compile_definitions(USE_STATIC_PLUGIN_INITIALIZATION)
Expand All @@ -50,3 +88,4 @@ find_package(Threads)
find_package(SQLite3)

add_subdirectory(Sources)
add_subdirectory(cmake/modules)
4 changes: 2 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* @jakepetroules @mirza-garibovic @mhrawdon @neonichu @owenv
* @aciidgh @jakepetroules @mirza-garibovic @mhrawdon @neonichu @owenv
*XCStrings* @matthewseaman @kulpreetchilana @jakepetroules @mirza-garibovic @mhrawdon @neonichu @owenv
*StringCatalog* @matthewseaman @kulpreetchilana @jakepetroules @mirza-garibovic @mhrawdon @neonichu @owenv
*Preview* @jonathanpenn @jakepetroules @mirza-garibovic @mhrawdon @neonichu @owenv
*Preview* @jonathanpenn @jakepetroules @mirza-garibovic @mhrawdon @neonichu @owenv
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ let package = Package(
swiftSettings: swiftSettings(languageMode: .v5)),
.target(
name: "SWBCSupport",
exclude: ["empty.swift"],
publicHeadersPath: ".",
cSettings: [
.define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])),
Expand Down
55 changes: 40 additions & 15 deletions Plugins/cmake-smoke-test/cmake-smoke-test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,56 @@ import Foundation
struct CMakeSmokeTest: CommandPlugin {
func performCommand(context: PluginContext, arguments: [String]) async throws {
var args = ArgumentExtractor(arguments)

let hostOS = try OS.host()

guard args.extractFlag(named: "disable-sandbox") > 0 else {
throw Errors.missingRequiredOption("--disable-sandbox")
}

guard let cmakePath = args.extractOption(named: "cmake-path").last else { throw Errors.missingRequiredOption("--cmake-path") }
print("using cmake at \(cmakePath)")
let cmakeURL = URL(filePath: cmakePath)
guard let ninjaPath = args.extractOption(named: "ninja-path").last else { throw Errors.missingRequiredOption("--ninja-path") }
print("using ninja at \(ninjaPath)")
let ninjaURL = URL(filePath: ninjaPath)
guard let sysrootPath = args.extractOption(named: "sysroot-path").last else { throw Errors.missingRequiredOption("--sysroot-path") }
print("using sysroot at \(sysrootPath)")
let sysrootPath = args.extractOption(named: "sysroot-path").last
if let sysrootPath {
print("using sysroot at \(sysrootPath)")
}

let moduleCachePath = context.pluginWorkDirectoryURL.appending(component: "module-cache").path()

let swiftBuildURL = context.package.directoryURL
let swiftBuildBuildURL = context.pluginWorkDirectoryURL.appending(component: "swift-build")
print("swift-build: \(swiftBuildURL.path())")

let swiftToolsSupportCoreURL = try findSiblingRepository("swift-tools-support-core", swiftBuildURL: swiftBuildURL)
let swiftToolsSupportCoreURL = try findDependency("swift-tools-support-core", pluginContext: context)
let swiftToolsSupportCoreBuildURL = context.pluginWorkDirectoryURL.appending(component: "swift-tools-support-core")

let swiftSystemURL = try findSiblingRepository("swift-system", swiftBuildURL: swiftBuildURL)
let swiftSystemURL = try findDependency("swift-system", pluginContext: context)
let swiftSystemBuildURL = context.pluginWorkDirectoryURL.appending(component: "swift-system")

let llbuildURL = try findSiblingRepository("llbuild", swiftBuildURL: swiftBuildURL)
let llbuildURL = try findDependency("swift-llbuild", pluginContext: context)
let llbuildBuildURL = context.pluginWorkDirectoryURL.appending(component: "llbuild")

let swiftArgumentParserURL = try findSiblingRepository("swift-argument-parser", swiftBuildURL: swiftBuildURL)
let swiftArgumentParserURL = try findDependency("swift-argument-parser", pluginContext: context)
let swiftArgumentParserBuildURL = context.pluginWorkDirectoryURL.appending(component: "swift-argument-parser")

let swiftDriverURL = try findSiblingRepository("swift-driver", swiftBuildURL: swiftBuildURL)
let swiftDriverURL = try findDependency("swift-driver", pluginContext: context)
let swiftDriverBuildURL = context.pluginWorkDirectoryURL.appending(component: "swift-driver")

for url in [swiftToolsSupportCoreBuildURL, swiftSystemBuildURL, llbuildBuildURL, swiftArgumentParserBuildURL, swiftDriverBuildURL, swiftBuildBuildURL] {
try FileManager.default.createDirectory(at: url, withIntermediateDirectories: true)
}

let sharedSwiftFlags = [
"-sdk", sysrootPath,
var sharedSwiftFlags = [
"-module-cache-path", moduleCachePath
]

if let sysrootPath {
sharedSwiftFlags += ["-sdk", sysrootPath]
}

let cMakeProjectArgs = [
"-DArgumentParser_DIR=\(swiftArgumentParserBuildURL.appending(components: "cmake", "modules").path())",
"-DLLBuild_DIR=\(llbuildBuildURL.appending(components: "cmake", "modules").path())",
Expand Down Expand Up @@ -107,11 +115,28 @@ struct CMakeSmokeTest: CommandPlugin {
print("Built swift-build")
}

func findSiblingRepository(_ name: String, swiftBuildURL: URL) throws -> URL {
let url = swiftBuildURL.deletingLastPathComponent().appending(component: name)
print("\(name): \(url.path())")
guard FileManager.default.fileExists(atPath: url.path()) else { throw Errors.missingRepository(url.path()) }
return url
func findDependency(_ name: String, pluginContext: PluginContext) throws -> URL {
var stack: [Package] = pluginContext.package.dependencies.map { $0.package }
var visited = Set(stack.map { $0.id })
var transitiveDependencies = pluginContext.package.dependencies.map { $0.package }
while let current = stack.popLast() {
for dependency in current.dependencies {
guard visited.insert(dependency.package.id).inserted else {
continue
}
transitiveDependencies.append(dependency.package)
stack.append(dependency.package)
}
}
guard let dependency = transitiveDependencies.first(where: { $0.id == name }) else {
throw Errors.missingRepository(name)
}
let dependencyURL = dependency.directoryURL
print("\(name): \(dependencyURL.path())")
guard FileManager.default.fileExists(atPath: dependencyURL.path()) else {
throw Errors.missingRepository(dependencyURL.path())
}
return dependencyURL
}
}

Expand Down
10 changes: 9 additions & 1 deletion Sources/SWBAndroidPlatform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ file(CONFIGURE
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)

add_library(SWBAndroidPlatform STATIC
add_library(SWBAndroidPlatform
AndroidSDK.swift
Plugin.swift)
target_link_libraries(SWBAndroidPlatform PUBLIC
Expand All @@ -37,3 +37,11 @@ target_link_libraries(SWBAndroidPlatform PUBLIC
SWBUtil)
target_sources(SWBAndroidPlatform PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")

set_target_properties(SWBAndroidPlatform PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})

set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBAndroidPlatform)

install(TARGETS SWBAndroidPlatform
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")
10 changes: 9 additions & 1 deletion Sources/SWBApplePlatform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ file(CONFIGURE
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)

add_library(SWBApplePlatform STATIC
add_library(SWBApplePlatform
AppIntentsMetadataCompiler.swift
AppIntentsMetadataTaskProducer.swift
AppIntentsSSUTrainingCompiler.swift
Expand Down Expand Up @@ -75,3 +75,11 @@ target_link_libraries(SWBApplePlatform PUBLIC
SWBTaskConstruction)
target_sources(SWBApplePlatform PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")

set_target_properties(SWBApplePlatform PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})

set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBApplePlatform)

install(TARGETS SWBApplePlatform
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")
8 changes: 8 additions & 0 deletions Sources/SWBBuildService/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ target_link_libraries(SWBBuildService PUBLIC
SWBWebAssemblyPlatform
SWBWindowsPlatform
$<$<NOT:$<PLATFORM_ID:Darwin>>:SwiftSystem::SystemPackage>)

set_target_properties(SWBBuildService PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})

set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBBuildService)

install(TARGETS SWBBuildService
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")
2 changes: 2 additions & 0 deletions Sources/SWBBuildServiceBundle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ target_link_libraries(SWBBuildServiceBundle PRIVATE
SWBCore)

install(TARGETS SWBBuildServiceBundle)

set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBBuildServiceBundle)
22 changes: 11 additions & 11 deletions Sources/SWBBuildSystem/BuildOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,8 @@ package final class BuildOperation: BuildSystemOperation {
adaptor.withActivity(ruleInfo: "CompilationCacheMetrics", executionDescription: "Report compilation cache metrics", signature: signature, target: nil, parentActivity: nil) { activity in
func getSummary(hits: Int, misses: Int) -> String {
let hitPercent = Int((Double(hits) / Double(hits + misses) * 100).rounded())
return "\(hits) hit\(hits == 1 ? "" : "s") (\(hitPercent)%), \(misses) miss\(misses == 1 ? "" : "es")"
let total = hits + misses
return "\(hits) hit\(hits == 1 ? "" : "s") / \(total) cacheable task\(total == 1 ? "" : "s") (\(hitPercent)%)"
}
delegate.emit(diagnostic: Diagnostic(behavior: .note, location: .unknown, data: DiagnosticData(getSummary(hits: cacheHits, misses: cacheMisses))), for: activity, signature: signature)
return .succeeded
Expand Down Expand Up @@ -881,15 +882,8 @@ package final class BuildOperation: BuildSystemOperation {
}

package func taskDiscoveredRequiredTargetDependency(target: ConfiguredTarget, antecedent: ConfiguredTarget, reason: RequiredTargetDependencyReason, warningLevel: BooleanWarningLevel) {
let diagnosticBehavior: SWBUtil.Diagnostic.Behavior
switch warningLevel {
case .yesError: diagnosticBehavior = .error
case .yes: diagnosticBehavior = .warning
case .no: return
}
let targetDiagnosticsEngine = buildOutputDelegate.diagnosticsEngine(for: target)

if !transitiveDependencyExists(target: target, antecedent: antecedent) {

// Ensure we only diagnose missing dependencies when platform and SDK variant match. We perform this check as late as possible since computing settings can be expensive.
let targetSettings = requestContext.getCachedSettings(target.parameters, target: target.target)
let antecedentSettings = requestContext.getCachedSettings(antecedent.parameters, target: antecedent.target)
Expand All @@ -907,8 +901,14 @@ package final class BuildOperation: BuildSystemOperation {
} else {
message = DiagnosticData("'\(target.target.name)' is missing a dependency on '\(antecedent.target.name)' because \(reason)")
}

targetDiagnosticsEngine.emit(Diagnostic(behavior: diagnosticBehavior, location: .unknown, data: message))
switch warningLevel {
case .yes:
buildOutputDelegate.emit(Diagnostic(behavior: .warning, location: .unknown, data: message))
case .yesError:
buildOutputDelegate.emit(Diagnostic(behavior: .error, location: .unknown, data: message))
default:
break
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions Sources/SWBBuildSystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ target_link_libraries(SWBBuildSystem PUBLIC
SWBCore
SWBTaskConstruction
SWBTaskExecution)

set_target_properties(SWBBuildSystem PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})

set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBBuildSystem)

install(TARGETS SWBBuildSystem
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")
8 changes: 8 additions & 0 deletions Sources/SWBCAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ set_target_properties(SWBCAS PROPERTIES
target_link_libraries(SWBCAS PUBLIC
SWBUtil
SWBCSupport)

set_target_properties(SWBCAS PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})

set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBCAS)

install(TARGETS SWBCAS
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")
8 changes: 8 additions & 0 deletions Sources/SWBCLibc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ add_library(SWBCLibc
libc.c)
target_include_directories(SWBCLibc INTERFACE
include)

target_include_directories(SWBCLibc PUBLIC
${CMAKE_CURRENT_BINARY_DIR})

set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBCLibc)

install(TARGETS SWBCLibc
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")
Loading