-
Notifications
You must be signed in to change notification settings - Fork 2k
unified: Add Swift parser based on swift-syntax
#22195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tausbn
wants to merge
13
commits into
main
Choose a base branch
from
tausbn/swift-syntax-rs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
89e11e5
unified: Add `swift-syntax-rs`
tausbn 87c8173
unified: Don't emit empty trivia
tausbn 446ff7c
unified: Add mapping from swift-syntax JSON to yeast AST
tausbn 8909fae
unified: Extract locations from `swift-syntax` AST
tausbn ddab6cc
unified: Emit locations for comments
tausbn 58ddeac
unified: Hook up swift-syntax AST
tausbn 3e2daf2
Support building swift-syntax-rs on macOS
Copilot 1577d82
Upgrade swift-syntax-rs to swift-syntax 603.0.2 / Swift 6.3.2
Copilot 3eb353e
swift-syntax-rs: Address PR review feedback
tausbn 46d6a11
yeast: Clarify Ast::with_schema registration doc
tausbn 205c9a9
swift-syntax-rs: Fix bazel formatting
tausbn 7474a33
unified: Hardcode swift_version
tausbn da1bbb7
Bazel: regenerate vendored cargo dependencies
tausbn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,8 +10,21 @@ exports_files([".swift-version"]) | |||||||||||||||||||||||||||||||||||||
| # Targets in this package require a Swift toolchain (Linux or macOS). | ||||||||||||||||||||||||||||||||||||||
| # `select()` gives us OR-of-OSes; other platforms get marked incompatible | ||||||||||||||||||||||||||||||||||||||
| # so `bazel build/test //...` skips them cleanly. | ||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||
| # The Linux branch additionally requires x86_64: the only registered standalone | ||||||||||||||||||||||||||||||||||||||
| # Linux Swift toolchain (`swift_toolchain_exec_ubuntu24.04`, see //:MODULE.bazel) | ||||||||||||||||||||||||||||||||||||||
| # is x86_64-only. Without the CPU constraint, Linux/aarch64 targets would stay | ||||||||||||||||||||||||||||||||||||||
| # "compatible" and then fail toolchain resolution instead of being skipped. | ||||||||||||||||||||||||||||||||||||||
| config_setting( | ||||||||||||||||||||||||||||||||||||||
| name = "linux_x86_64", | ||||||||||||||||||||||||||||||||||||||
| constraint_values = [ | ||||||||||||||||||||||||||||||||||||||
| "@platforms//os:linux", | ||||||||||||||||||||||||||||||||||||||
| "@platforms//cpu:x86_64", | ||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| _SWIFT_SUPPORTED_PLATFORMS = select({ | ||||||||||||||||||||||||||||||||||||||
| "@platforms//os:linux": [], | ||||||||||||||||||||||||||||||||||||||
| ":linux_x86_64": [], | ||||||||||||||||||||||||||||||||||||||
| "@platforms//os:macos": [], | ||||||||||||||||||||||||||||||||||||||
| "//conditions:default": ["@platforms//:incompatible"], | ||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following is slightly sloppy (as we cannot build on Arm64 Linux), but this is consistent with what we do for code build in other languages. I also don't think this needs a clarifying comment for that reason.
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed? And why is this the right approach to this change (instead of registering an Arm64 tool chain)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I have no idea why Copilot chose that solution. A better solution is probably to just register an Arm64 tool chain.
This goes back to your other comment as well -- we probably ought to have someone more intimate with the Bazel setup take a look at this. (Or at the very least once we get close to being production-ready.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can have a look at that.
This we should probably do as soon as possible, because I am concerned that the changes here might affect the rest of the build in ways that I do not understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.