Building SwiftSyntax and missing _InternalSwiftSyntaxParser

Hi,

Not sure if that's the right place to ask, but didn't find any better. I'm trying to build SwiftSyntax along the swift build (--swiftsyntax) but encounter a problem. When build swift with this command:

swift/utils/build-script --release-debuginfo --swiftpm --llbuild --build-swift-static-stdlib --swiftsyntax --skip-ios --skip-tvos --skip-watchos --skip-test-cmark --skip-test-swift --skip-test-llbuild --skip-test-swiftpm

it ends with

swift-source/swift-syntax/Sources/SwiftSyntax/SyntaxParser.swift:17:8: error: no such module '_InternalSwiftSyntaxParser'
import _InternalSwiftSyntaxParser
       ^

Error: Building SwiftSyntax failed

Swift source tag swift-5.0-DEVELOPMENT-SNAPSHOT-2019-01-23-a

Am I doing something wrong here? I guess my question is how to build swift-syntax master?

2 Likes

SwiftSyntax's master branch uses a new, much faster interface to the compiler that isn't available in Swift's 5.0 branch—it's only in Swift's master branch. (Yes, there's already stuff in master that isn't in the beta—there wasn't enough time to thoroughly test such a large change.)

Make sure that your compiler and SwiftSyntax repos are on matching branches. The easiest way to do this is by running utils/update-checkout --scheme swift-5.0-branch or utils/update-checkout --scheme master, depending on which one you want to build.

1 Like

Great. thanks. Will build master then.

You can also use the master development snapshots if you'd prefer not to build the swift compiler.

1 Like

I'm trying to use SwiftSyntax on iOS 13 (Simulator) using Xcode 11.0 (11A420a) -- AppStore

I added SwiftSyntax using Xcode's GUI, and it indicates the version is 0.50100.0

-- What's the right tag to use for SwiftSyntax to get exactly the version in my current Xcode? I'm getting the following error:
Could not find or use auto-linked library '_InternalSwiftSyntaxParser'

To be clear: I'm not trying to Build Swift from Source, and my code compiles fine, it just doesn't link!

You can find more info on rigging it for macOS in the following thread, but iOS may involve additional hurdles (if it works at all...)

1 Like