-
Notifications
You must be signed in to change notification settings - Fork 457
Ask the swift compiler for SWIFT_HOST_MODULE_TRIPLE if not supplied #2454
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
Merged
Merged
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.
Uh oh!
There was an error while loading. Please reload this page.
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 wonder if the current
if
contents is even worth keeping.SWIFT_HOST_MODULE_TRIPLE
would be set when this is part of the compiler build. So we'd only be in here if standalone, in which case falling back to the module triple from-print-target-info
sounds the most reasonable to me anyway. Thoughts @etcwilde / @compnerd?(And thanks @dabrahams, this LGTM even if we don't rip out the rest of the if).
Uh oh!
There was an error while loading. Please reload this page.
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.
Yeah, something like this should work for all cases, I believe.
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 had the same thought but didn't want to presume.
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.
@etcwilde You probably know CMake much better than me but your version seems like a lot of code for what I did in two lines. Is there a reason to make it so elaborate?
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.
The extra bits I added are for cross-compiling. Running
-print-target-info
alone will only give you the module triple for the triple that the compiler was configured to output to by default. If someone has specified the triple they want to output to, we want to ensure that the module triple reflects that. It's not always set, so we need to ensure that it is before adding it to the command.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 definitely prefer @etcwilde's approach - cross-compilation is going to be most likely the path we take to get the Windows ARM64 toolchain release setup.
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.
So are y'all suggesting I replace lines 65-80 with @etcwilde's code?
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 ask because @bnbarham approved these changes as-is, but I can't run the CI or merge myself, and I'd like to move the PR forward. If that means making the edit I just described, please LMK.
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'd be good to do, I am fine to merge this as is though - it's an improvement regardless. If you'd like to put up another (or you @etcwilde), feel free :). I'll run tests and merge. Thanks @dabrahams!
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 for one encourage @etcwilde to submit the improved PR once this lands.