hmlongco / Resolver

Swift Ultralight Dependency Injection / Service Locator framework
MIT License
2.14k stars 188 forks source link

Building Resolver-Dynamic fails with TSan enabled #116

Closed josh150 closed 2 years ago

josh150 commented 3 years ago

I ran into this while trying to use Thread Sanitizer with my app tests. It also happens if you open the package directly, add the tests to the dynamic scheme, and enable Thread Sanitizer.

ld: Could not open or create -dependency_info file: /Users/jmiller/Library/Developer/Xcode/DerivedData/Resolver-fmzomswvruekyabpgzcagfrpyyuh/Build/Intermediates.noindex/Resolver.build/Debug-iphonesimulator/Resolver-Dynamic.build/Objects-normal-tsan/x86_64/Resolver-Dynamic_dependency_info.dat

Seems like it could be a bug with SPM itself.

Update: Was able to work around by forking and then setting the "Resolver" target to .dynamic and referencing that instead of "Resolver-Dynamic".

hmlongco commented 3 years ago

Sorry for the delay here. I haven't had a chance to use SPM a lot, so there could be issues there. Is a change needed?

josh150 commented 3 years ago

I haven't looked into it any further since the original post. I created a fork and applied that naming update as a workaround. Not sure if that is a fix you can apply for everyone. It definitely feels like a bug within SPM itself.