From 1c0c22002fad6d78cf5725a3ae34a3491a1a4111 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 10 Jul 2025 15:37:29 -0700 Subject: [PATCH 1/3] SwiftDriverExecution: add explicit dependency on libllbuild The module directly imports libllbuild, and while the dependency _should_ be available due to the dependency on `llbuildSwift`, this ensures that we do not rely on ordering but rather the explicit dependency is codified into the build graph. --- Sources/SwiftDriverExecution/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/SwiftDriverExecution/CMakeLists.txt b/Sources/SwiftDriverExecution/CMakeLists.txt index c42a4decb..ccbfaa06d 100644 --- a/Sources/SwiftDriverExecution/CMakeLists.txt +++ b/Sources/SwiftDriverExecution/CMakeLists.txt @@ -17,6 +17,7 @@ target_link_libraries(SwiftDriverExecution PUBLIC SwiftOptions SwiftDriver) target_link_libraries(SwiftDriverExecution PRIVATE + libllbuild llbuildSwift) set_property(GLOBAL APPEND PROPERTY SWIFTDRIVER_EXPORTS SwiftDriverExecution) From 8edee63e8d05eff8aa2fdc810efcf3c6ed0cbfa9 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 10 Jul 2025 20:19:06 -0700 Subject: [PATCH 2/3] SwiftDriverExecution: share the import across both sides `llbuild` is imported always. Simply import that unconditionally. --- Sources/SwiftDriverExecution/llbuild.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/SwiftDriverExecution/llbuild.swift b/Sources/SwiftDriverExecution/llbuild.swift index a1280c58b..85f8a70ad 100644 --- a/Sources/SwiftDriverExecution/llbuild.swift +++ b/Sources/SwiftDriverExecution/llbuild.swift @@ -22,10 +22,8 @@ import protocol TSCBasic.FileSystem // We either import the llbuildSwift shared library or the llbuild framework. #if canImport(llbuildSwift) @_implementationOnly import llbuildSwift -@_implementationOnly import llbuild -#else -@_implementationOnly import llbuild #endif +@_implementationOnly import llbuild /// An llbuild value. protocol LLBuildValue: Codable { From 92db03af7a7b6bc6dfae776d283541ef46db973f Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 10 Jul 2025 20:22:11 -0700 Subject: [PATCH 3/3] build: correct the llbuild build when vendored The value needs to be pushed through the cache as there is no control over the flags for the sub-build and `set` is scoped to the current directory. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d334d7ff8..6781b886f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ if(NOT LLBuild_FOUND) find_package(LLBuild REQUIRED) else() message("-- Vending swift-llbuild") - set(LLBUILD_SUPPORT_BINDINGS Swift) + set(LLBUILD_SUPPORT_BINDINGS Swift CACHE STRING "") FetchContent_Declare(LLBuild GIT_REPOSITORY https://github.com/apple/swift-llbuild GIT_TAG main)