ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.38k stars 4.17k forks source link

RxSwift 5.1.1 and Carthage issues #2185

Closed paulBuchanan closed 4 years ago

paulBuchanan commented 4 years ago

Short description of the issue:

Using RxSwift 5.1.1 with Carthage causes the debugger to crash when it hits a breakpoint in Xcode 11.4.1 if I build the libraries with:

carthage update --platform iOS --no-use-binaries

Debugger crashes with:

Message from debugger: The LLDB RPC server has exited unexpectedly. Please file a bug if you have reproducible steps.

If instead I use this and take the pre-compiled binaries:

carthage update --platform iOS

I get the following warning when the debugger hits a breakpoint:

warning: Swift error in fallback scratch context: error: virtual filesystem overlay file '/Users/freak4pc/Library/Developer/Xcode/DerivedData/Rx-hfzwoptkeprdnlcyedtxjnwyojdp/Build/Intermediates.noindex/ArchiveIntermediates/RxCocoa/IntermediateBuildFilesPath/Rx.build/Release-iphoneos/RxCocoa.build/all-product-headers.yaml' not found

However, the debugger does not crash.

Expected outcome:

Debugger does not crash, and virtual filesystem overlay file warning does not display.

Platform/Environment

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

Xcode version:

  11.4.1

Installation method:

I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)

Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)

freak4pc commented 4 years ago

Hey @paulBuchanan - given this doesn't occur with SPM or CocoaPods, I think this bug fits better within Carthage or Swift's bug tracker, and doesn't seem like an RxSwift issue by itself.

cmxconsulting commented 3 years ago

any news please ? It really seems due to compilation parameters (with Carthage indeed).

freak4pc commented 3 years ago

Again, this seems like a Carthage-specific issue and not related to this project directly. If you have a specific idea on how to resolve it from the Carthage side, I'll try my best to help.

cmxconsulting commented 3 years ago

Hello @freak4pc @paulBuchanan , i think i found it. It's working fine for me. This seems to be related to the Apple Clang Enable Modules (c objective c). By switching to "No" it's working. I'm using RxSwift 5.1.0

I rebuilt it from Carthage by doing this : carthage checkout sed -i '' -e "s|CLANG_ENABLE_MODULES = YES;|CLANG_ENABLE_MODULES = NO;|g" Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj carthage build --platform ios --no-use-binaries

Here are the consequences : https://stackoverflow.com/questions/36265490/turning-off-clang-enable-module-debugging-consequences

I can do a pull request if your want. Please let me know.

Thank you. Chris.

freak4pc commented 3 years ago

Thanks for the research and glad you found a resolution to this.

Unfortunately turning off this flag just to support Carthage isn't something I feel comfortable doing. The consequences are quite large here. If you have a different solution around this I'll be happy to hear. But otherwise perhaps opening a Carthage bug would be a better idea.

Thank you! Shai