Sourcery: Error in Xcode 10
I’m getting an error running Sourcery since I passed to Xcode 10 and updated Sourcery to 0.14.0:
No config file provided or it does not exist. Using command line arguments.
Scanning sources...
Found 676 types.
Loading templates...
Loaded 5 templates.
Generating code...
error: Error Domain=NSOSStatusErrorDomain Code=-1 "kCFStreamErrorHTTPParseFailure / kCFSocketError / kCFStreamErrorDomainCustom / kCSIdentityUnknownAuthorityErr / qErr / telGenericError / dsNoExtsMacsBug / kMovieLoadStateError / cdevGenErr: Could not parse the request/response. / / custom to the kind of stream in question / / queue element not found during deletion / / not a SysErr, just a placeholder / / General error; gray cdev w/o alert" UserInfo={terminationReason=__ObjC.Process.TerminationReason, error=dyld: Symbol not found: __T0BOWV
Referenced from: /Users/david/Library/Caches/Sourcery/AutoCodable.swifttemplate/../SourceryRuntime.framework/Versions/A/SourceryRuntime
Expected in: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCore.dylib
in /Users/david/Library/Caches/Sourcery/AutoCodable.swifttemplate/../SourceryRuntime.framework/Versions/A/SourceryRuntime
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 22 (3 by maintainers)
I was also experiencing this issue with v0.15.0.
Deleting
~/Library/Caches/Sourcery
fixed the problem for me.@tskulbru try to use sourcery with command line options (without config files .sourcery.yml), and include
--disableCache
attribute for example:0.15.0 seems to have solved my issue. Thanks!
With sourcery
0.14.0
, you need to use swift4.1.2
. So to check if your CLI uses the correct version run/usr/bin/swiftc --version
.If it uses Xcode 9, it should print something like this:
And you’d be good to go.
However, with Xcode 10, you’d have something like this:
On my mac, I have 2 Xcode installations:
/Applications/Xcode.app
/Applications/Xcode-10.app
To be able to run sourcery locally on my mac, I would just run
sudo xcode-select --switch /Applications/Xcode.app
.This is not ideal and will not work outside of a local environment but it may do the trick.
Maybe you could also limit the scope of the swift version selection to the sourcery execution using the
TOOLCHAINS
variable but I have not looked into that much and I am not sure this would even work 🤔