A small wrapper package that helps to replace SwiftSyntax's dependency on lib_internalSwiftSyntaxParser.dylib with StaticInternalSwiftSyntaxParser.
When deploying command line tools such as periphery, to keep them as portable as possible, it is much more appropriate to statically link any library dependencies, something that swift-syntax does not currently do. By statically linking the lib_internalSwiftSyntaxParser dependency, a command line tool's installation becomes much simpler since there is no longer a need to ensure that dynamic libraries are copied into the location that ws specified by the r_path.
To use this package, include it as a dependency alongside SwiftSyntax and proceed to importing SwiftSyntaxParser in your code like normal:
let package = Package(
name: "Periphery",
products: [
.executable(name: "periphery", targets: ["Frontend"])
],
dependencies: [
.package(name: "SwiftSyntax", url: "https://github.com/apple/swift-syntax", .exact("0.50600.1")),
.package(name: "StaticSwiftSyntaxParser", url: "https://github.com/peripheryapp/static-swift-syntax-parser.git", .exact("5.6"))
],
targets: [
.target(
name: "Frontend",
dependencies: [
.product(name: "SwiftSyntax", package: "SwiftSyntax"),
.product(name: "StaticSwiftSyntaxParser", package: "StaticSwiftSyntaxParser")
]
)
]
)While you don't have to do anything with StaticSwiftSyntaxParser in your code, the presence of the dependency will link StaticInternalSwiftSyntaxParser and ensure that the now redundant dylib is stripped.