Sourcery: _InternalSwiftSyntaxParser error with 1.3.0

Steps to reproduce:

$ brew install sourcery
$ sourcery --version
1.3.0
$ git clone http://github.com/realm/SwiftLint
$ cd SwiftLint
$ git checkout 92061e8
$ rm Source/SwiftLintFramework/Models/PrimaryRuleList.swift Tests/SwiftLintFrameworkTests/AutomaticRuleTests.generated.swift Tests/LinuxMain.swift
$ make sourcery 
sourcery --sources Source/SwiftLintFramework/Rules --templates .sourcery/PrimaryRuleList.stencil --output .sourcery
No config file provided or it does not exist. Using command line arguments.
Scanning sources...
error: The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntax
The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntaxmake: *** [Source/SwiftLintFramework/Models/PrimaryRuleList.swift] Error 3
$ xcode-select -p
/Applications/Xcode-12.4.app/Contents/Developer
$ xcodebuild -version
Xcode 12.4
Build version 12D4e

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (19 by maintainers)

Most upvoted comments

I’m having the same issue with the newly released version of Xcode 12.5.

The loaded '_InternalSwiftSyntaxParser' library is from a toolchain that is not compatible with this version of SwiftSyntax

I’ll try to find some time on the weekend to wrap up the open prs

@danielPeloton until we migrate fully to self-contained SPM via #935, you want to use brew or binary distributions because both of those rewrite rPath to be exact version we use and not rely on your machine setup, mint just runs swift package manager and that setup isn’t properly handling dylib yet

unfortunately it seems this is not doable in pure spm package as far as I could tell, spm doesn’t support linker flags when building through command line so mint won’t work until Apple fixes it 😞