-
Notifications
You must be signed in to change notification settings - Fork 10.5k
utils: build a few extra copies of swift-syntax #75206
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
Closed
Closed
Changes from all commits
Commits
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
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
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.
I'm a little confused about this part and maybe I'm misreading. Yes, the macros themselves are SDK content, but they still run on the builder with the rest of the toolchain. You shouldn't need to ship a Swift-Syntax to an android-arm*, unless you're planning on running a compiler there? For swift-syntax, if you're pre-building a copy so that you don't need to rebuild it (assuming aligning versions), I would expect that you build it for the machines that toolchain will be used with.
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.
Right, this is currently needed due to the need for swiftlang/swift-foundation#714 to be merged.
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? The macros in Swift-Foundation are built against what is on the machine doing the build, not the machine it's building for.
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.
Alas, if it were ... that is what that PR sets out to accomplish :)
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.
swift-foundation macros should ideally build for both the machine doing the build and the machine that the toolchain will run on (but not the destination target of each SDK) - will this allow us to accomplish both of those?
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.
Yes, I think that the changes in the referenced PR should allow us to do that. This change will then obviously need to be altered, but, I'm not only fine with that, I'm in favour of that.
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.
It needs to be built "twice", once for the builder machine, and once for the toolchain that they're going into. That part's fine. Twice in quotes because we'll actually need to build them for every toolchain if we want the SDK to work across toolchains (thinking of the static Linux SDK), so maybe 22 times? macos, Ubuntu 20.04, 22.04, 23.10, 24.04, Fedora 39, Debian 12, AmazonLinux2, UBI9, centOS7, and Windows, and each of those for intel and ARM. RIP build times...
That said, I would prefer teaching the swift-foundation build how to not build the macros. We shouldn't need swift-syntax on Android unless someone is actually compiling macros on their phone, but then they can figure out how to get Swift-Syntax on their phone.
I maybe misunderstood this comment. I thought you were saying these were both required, not that this PR was working around that issue.
This PR, no. swiftlang/swift-foundation#714, gets us closer to that, yes.
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.
No, this change is working around the fact that I need a build for android currently. IMO, that is not what we want in the long term - we want to build swift-syntax only for the toolchain hosts - Windows x64, ARM64, macOS x64, ARM64, Linux ... I don't know.
I assume that you mean to not build the macros for the host but rather the build and standalone right? That would allow us to build the macros for the various toolchains that we want to support and not worry about the myriad of hosts that we want to support.
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.
Yep