Skip to content
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

TCA Example fails to build when "iosapp" minimum_os_version is set to 17+ #1002

Closed
codeman9 opened this issue Apr 9, 2024 · 1 comment
Closed

Comments

@codeman9
Copy link

codeman9 commented Apr 9, 2024

TCA has a Perception library that is a backport of Observation to iOS 13. It has some @available checks like this:

@available(iOS, introduced: 13, obsoleted: 17, message: "Use @Bindable without the 'Perception.' prefix.")

When I change the minimum_os_version of the "iosapp" example target to "17.0" in the "tca_example", the build fails with the following errors (among many other like this):

external/rules_swift_package_manager~~swift_deps~swiftpkg_swift_perception/Sources/Perception/Bindable.swift:26:32: error: 'Bindable' is unavailable in iOS: Use @Bindable without the 'Perception.' prefix.
    public var projectedValue: Bindable<Value> {
                               ^~~~~~~~
external/rules_swift_package_manager~~swift_deps~swiftpkg_swift_perception/Sources/Perception/Bindable.swift:15:17: note: 'Bindable' was obsoleted in iOS 17
  public struct Bindable<Value> {

This indicates that we are hitting this availability check.

When I download TCA directly and open up the Xcode project and update the deployment to 17.0, there are expected errors and once I fix those, the example app builds successfully. Looking at the .swiftmodule and .swiftsourceinfo output from Xcode, I see that these modules (Perception and its direct dependency XCTestOerlay) are built with the flag: -target arm64-apple-ios13.0-simulator while the rest of the app's modules are built with the flag: -target arm64-apple-ios17.0-simulator. Simply adding the flag in copts like so:

    copts = [
        "-target",
        "arm64-apple-ios13.0-simulator",
    ]

in the generated BUILD.bazel files gets farther (Perception builds fine), but the app build still eventually fails with very similar errors in the TCA library itself.

@codeman9 codeman9 closed this as completed Apr 9, 2024
@codeman9
Copy link
Author

codeman9 commented Apr 9, 2024

Sorry, duplicate of: #892

@brentleyjones brentleyjones closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants