RxSwift: Xcode 11.4 beta: 'NSTextView' is incompatible with 'weak' references
Short description of the issue:
When building using the just released Xcode 11.4 beta, RxCocoa fails to build on the following line: https://github.com/ReactiveX/RxSwift/blob/c3c0cac3d4c176b04404e3574d62b51776277384/RxCocoa/macOS/NSTextView%2BRx.swift#L20
Expected outcome:
RxCocoa compiles without errors or warnings.
What actually happens:
The compile fails with the following error:
RxSwift/RxCocoa/macOS/NSTextView+Rx.swift:20:12: 'NSTextView' is incompatible with 'weak' references
RxSwift/RxCocoa/RxBlocking/RxTest version/commit
Version 5.0.1
Platform/Environment
- iOS
- macOS
- tvOS
- watchOS
- playgrounds
How easy is to reproduce? (chances of successful reproduce after running the self contained code)
- easy, 100% repro
- sometimes, 10%-100%
- hard, 2% - 10%
- extremely hard, %0 - 2%
Xcode version:
Version 11.4 beta (11N111s)
Installation method:
- CocoaPods
- Carthage
- Git submodules
I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)
- yes (11.3.1, 11.4 beta 1)
- no
Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)
- just starting
- I have a small code base
- I have a significant code base
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 26 (21 by maintainers)
Commits related to this issue
- Raise the minimum deployment target for macOS to 10.12 NSTextView did not support weak references until this macOS release. Xcode 11.4 has started to call this out, as before this commit, the project... — committed to tonyarnold/RxSwift by tonyarnold 4 years ago
- Raise the minimum deployment target for macOS to 10.12 NSTextView did not support weak references until this macOS release. Xcode 11.4 has started to call this out, as before this commit, the project... — committed to tonyarnold/RxSwift by tonyarnold 4 years ago
- Raise the minimum deployment target for macOS to 10.12 NSTextView did not support weak references until this macOS release. Xcode 11.4 has started to call this out, as before this commit, the project... — committed to tonyarnold/RxSwift by tonyarnold 4 years ago
- work around ReactiveX/RxSwift#2125 https://github.com/ReactiveX/RxSwift/issues/2125 macOS prior to 10.12 does not support weak references to NSTextViews, and Xcode 11.4 beta enforces this as a compi... — committed to mayoff/RxSwift by deleted user 4 years ago
- macOS deployment target bumped to 10.12 Discussion: https://github.com/ReactiveX/RxSwift/issues/2125 — committed to dannyow/RxSwift by dannyow 4 years ago
Yup, this works. I’m cutting a patch release:
OK, I’ve filed this as FB7566796.
I guess let’s wait to see what the AppKit/Xcode team have to say about this - my guess is that this error was meant to be turned on a while back (or is considered an improvement to diagnostics & warnings), and we may be stuck with it.
Here’s the relevant code from
NSTextView.h
:I understand your reluctance to bump deployment targets for a bug that might be transitory, but I don’t think raising the deployment target is a bad thing for a major release. Consider the impact on yourself and the other developers of this project in supporting code that needs to compile and run on an operating system you no longer have access to. I believe you can’t even run CI anywhere for Yosemite?
Hey, you’re right! This is odd, was sure I pushed all of them. Taking care of the rest RN.
I have no issue with bumping the versions, but I’m not a macOS developer myself, so bumping a version of a platform I don’t have intimate knowledge with seems a bit careless from my part.
Regardless, let’s wait for Apple and if we don’t get appropriate feedback, we might decide to bump.
Thanks for the research and time you’ve put into this @tonyarnold !