-
Notifications
You must be signed in to change notification settings - Fork 236
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
add support for riscv64 #752
Conversation
@@ -47,6 +47,8 @@ function(get_swift_host_arch result_var_name) | |||
set("${result_var_name}" "i686" PARENT_SCOPE) | |||
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "wasm32") | |||
set("${result_var_name}" "wasm32" PARENT_SCOPE) | |||
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "riscv64") |
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 looks like this is just for computing the module triple.
If that's the case, rather than continuing to extend this tower of if
statements, would you be okay swapping out the module triple computation for this:
if(NOT SwiftFormat_MODULE_TRIPLE)
set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info)
if(CMAKE_Swift_COMPILER_TARGET)
list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET})
endif()
execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
string(JSON SwiftFormat_MODULE_TRIPLE GET "${target_info_json}" "target" "moduleTriple")
endif()
It scales better and means that this will build for anything that the compiler supports, rather than what we've manually listed out.
Please see the conversation on swiftlang/swift-corelibs-foundation#4959
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, I understand your reasoning for suggesting this change and if this was the only project with this change I would agree.
Unfortunately it is not. This is just one of 19 separate projects in the swift toolchain that require these changes.
https://github.com/orgs/swift-riscv/projects/2
Some of these have already been approved and merged.
For the sake of code conformity across all the different projects I would rather leave this PR as I submitted it if that is acceptable.
Thanks.
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.
For the ones that have merged, sure, we can update them later when the next architecture comes along.
I think we've hit a critical mass where expecting identical behavior across all of the repos is unlikely to happen and I would prefer to see incremental improvements over time over not improving anything to keep uniformity.
Sort of like how LLVM rolls out changes to policies, instead of making a gigantic patch that updates all of the code, folks are supposed to clean up the code around what they're working on.
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 so you are refusing to accept this PR as is?
If so, please state this clearly so I can take further action.
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 have requested changes and given my reasoning.
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 thats unfortunate.
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.
Sorry, hit the wrong button.
Closing this PR as requested changes have been unreasonably refused by @etcwilde |
To be clear, I didn't ask for you to close the PR, I asked for you to change it so that instead of tacking on new architectures to an ever-growing list, we do something that queries the compiler and will work for any architecture that the compiler supports. |
@etcwilde - To be clear. |
Hey @futurejones, I think there was a misunderstanding here. We appreciate your effort to port Swift to If I understand correctly, the reason why @etcwilde marked the PR as “request changes” is because he accidentally hit “accept” beforehand and GitHub doesn’t allow changing a review to the “neutral” style, which we usually use. I don’t think it was because he explicitly disapproved your PR, just suggesting improvements. Going forward, I would suggest that we merge this PR as you proposed it. Cleaning up the if branches with the code snippet that @etcwilde suggested would be an amazing follow-up PR that would be highly appreciated. |
Add support for
riscv64
as host architecture.