Question or problem
I tried to port our project to Tuist to see if the using cache would improve our build times (it does, by 53% ).
However, Xcode previews do not work anymore.
It’s important to note that our code is split in multiple local small Swift packages (actually they are multiple targets inside a single SPM package) + a big app target. So in order to use previews, we have to first select the scheme corresponding to the target. Then, previews work. The big app target is too big and previews never worked (it loads indefinitely and we never figured out why).
When porting the project to Tuist, I turned each local Swift package into a static library target. However when I select the scheme corresponding to a target, previews no longer work (they build but they don’t start).
Changing the preview driver to the legacy one doesn’t work because it’s unable to preview “plain” static libraries (it worked before because they were Swift packages targets).
The error logs are below.
Expectation
I expect the previews to work as they do in the project, as they do without using Tuist.
Context
- Tuist version: 4.37.0
- Xcode version: 16.1.0
Reproduction (mandatory for problems)
== PREVIEW UPDATE ERROR:
[Remote] JITError: Runtime linking failure
Additional Link Time Errors:
Symbols not found: [ ___isPlatformVersionAtLeast ]
Symbols not found: [ ___isPlatformVersionAtLeast ]
In static-UITools, failed to materialize { _$sSS15SwiftRichStringE3set5style5rangeSo019NSMutableAttributedC0CSgSS_So8_NSRangeVSgtF }, due to unsatisfied dependencies { (static-UITools, { _$s15SwiftRichString13StylesManagerC6sharedACvau }) } (dependencies removed or in error state)
==================================
| [Remote] LLVMError
|
| LLVMError: LLVMError(description: "Failed to materialize symbols: { (static-UITools, { __replacement_tag$429 }) }")
== VERSION INFO:
Tools: 16B40
OS: 24B91
PID: 44580
Model: MacBook Pro
Arch: arm64e
== ENVIRONMENT:
openFiles = [
/Redacted.swift
]
wantsNewBuildSystem = true
newBuildSystemAvailable = true
activeScheme = UITools
activeRunDestination = iPhone 16 Pro variant iphonesimulator arm64
workspaceArena = [x]
buildArena = [x]
buildableEntries = [
libUITools.a
]
runMode = JIT Executor
== SELECTED RUN DESTINATION:
Simulator - iOS 18.1 | iphonesimulator | arm64 | iPhone 16 Pro | no proxy
== EXECUTION MODE OVERRIDES:
Workspace JIT mode user setting: true
Falling back to Dynamic Replacement: false
== JIT LINKAGE:
Run Destination: B696D6E3-9E09-4373-BF5B-277CA73071F6-iphonesimulator18.1-arm64-iphonesimulator
JIT Link Description {
10:libUITools.a [
4:libAudioTools.a
6:libModels.a
5:libReporting.a
2:libResources.a
3:libTools.a
]
}
== Truncated for brevity, if the rest is necessary I can provide it
UITools
is the name of the target I am trying to preview. The different libXXX.a
files are local dependencies of UITools
(so other local targets in the project).
SwiftRichString in a SPM dependency that’s added to the target. It builds fine outside of previews. It’s missing from JIT LINKAGE, maybe this is the issue?