Skip to content

The Composable Architecture compatibility issues #6320

@iharandreyev

Description

@iharandreyev

What problem or need do you have?

When using Tuist 4.12.1 and linking TCA as .staticFramework, the following errors occured when running tests.

Tuist-TCA-TestLinkingError

After updating to Tuist 4.14.0, the aforementioned errors have gone away, but now runtime crashes started occuring.

TCA uses environment checks in runtime to determine which logic to use under the hood. For iOS 17 and upwards, it uses Apple's ObservationRegistrar to observe changes. For anything below -> _PerceptionRegistrar.

However there is an issue with these checks if the project is generated with tuist.

When instantiating the registrar, everything is going according to plan:

PerceptionRegistrar init

However, when trying to mutate the registrar, non-iOS 17 if branch is used, even though when inspecting app state through lldb, the picture is different:

PerceptionRegistrar withMutation

Updating to Tuist 4.1.15 does not help. Changing product type to .dynamicLibrary does not help. Linking TCA as project package instead of target dependency causes even more linking issues (similar to initial errors).

I've asked Brandon for help, but he suggested to seek for help here. He claims this is not the first time people are having issues with marrying Tuist and TCA, so I hope someone here may have the expertise.

The sample project can be found here

Please help

Potential solution

No response

macOS version

14.5

Tuist version

4.1.15

Xcode version

15.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:needReport needs or problems you came across that are not bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions