Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keith/swift-syntax-bazel
Bazel support for SwiftSyntax
https://github.com/keith/swift-syntax-bazel
Last synced: 3 days ago
JSON representation
Bazel support for SwiftSyntax
- Host: GitHub
- URL: https://github.com/keith/swift-syntax-bazel
- Owner: keith
- License: mit
- Created: 2021-06-17T17:27:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-17T20:42:45.000Z (over 1 year ago)
- Last Synced: 2024-10-12T06:08:07.420Z (about 1 month ago)
- Language: Starlark
- Homepage: https://github.com/keith/swift-syntax-bazel/releases
- Size: 23.4 KB
- Stars: 20
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# swift-syntax-bazel
This repo provides a bazel target for
[`SwiftSyntax`](https://github.com/apple/swift-syntax). Most importantly
it handles vendoring `lib_InternalSwiftSyntaxParser` as a static library
so your tool doesn't depend on a specific Xcode.app path or version.## Usage
1. Make sure you've setup
[`rules_apple`](https://github.com/bazelbuild/rules_apple)
2. Go to the [releases
page](https://github.com/keith/swift-syntax-bazel/releases) to grab
the WORKSPACE snippet for the Xcode version you're using
3. Add this target to your `deps`:```bzl
deps = [
"@com_github_keith_swift_syntax//:SwiftSyntax",
]
```## Details
Previously if you built `SwiftSyntax` in your bazel build, the final
binary would end up with a `rpath` like this:```
/Applications/Xcode-12.4.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx
```This meant if you used a remote bazel cache in your builds, everyone's
Xcode path would have to match for this to work correctly. This repo
links [a static
binary](https://github.com/keith/StaticInternalSwiftSyntaxParser) for
`lib_InternalSwiftSyntaxParser` instead.