-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Add infrastructure to build and run tests on multiple targets. #36082
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please test. |
@swift-ci please test windows. |
@swift-ci please test Windows platform. |
@swift-ci please test Windows. |
Build failed |
Build failed |
b9265e7
to
574004e
Compare
@swift-ci please clean smoke test macOS. |
574004e
to
0c2f36e
Compare
@swift-ci please clean smoke test macOS. |
@@ -1,4 +1,4 @@ | |||
// RUN: %target-swift-frontend -enable-cxx-interop -I %S/Inputs %s -emit-ir | %FileCheck %s | |||
// RUN: %cxx-all-targets(-I %S/Inputs %s -emit-ir | %FileCheck %s) |
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.
Note to self: revert this change; it requires macos.
a55d466
to
73473c7
Compare
Once compnerd/uswift/pull/19 lands I should be able to run the bots here. |
@swift-ci please smoke test. |
@swift-ci please test Windows. |
@swift-ci please test windows |
@shahmishal no pressure, but would you like to review this? |
@compnerd would you mind reviewing this patch? I'm about to push a rebased version but the logic is all the same. I know you want us to support Windows better, specifically around IRGen. I think this patch will help that effort a lot. If we can test all platforms on any device, we will inevitably support all platforms better. Edit: when I say "push a rebased version" I mean "push a rebased version to the PR for review." Sorry for not being more clear. |
73473c7
to
69b5ba5
Compare
@swift-ci please smoke test. |
) | ||
|
||
# Build uswift for each target. | ||
for (( i=1; i<${uswift_targets_length}+1; i+=2 )); |
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? Why not do:
for target in ${uswift_targets[@]} ; do
done
else | ||
all_cmake_options=( | ||
"${all_cmake_options[@]}" | ||
-D CMAKE_Swift_FLAGS="-Xfrontend -disable-legacy-type-info" |
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 not do this unconditionally?
|
||
Whether this product is produced by build-script-impl. | ||
""" | ||
return True |
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.
We really should not add a new build-script-impl product but rather move it here.
@@ -11,15 +11,15 @@ | |||
"swift-argument-parser": { | |||
"remote": { "id": "apple/swift-argument-parser" } }, | |||
"swift-atomics": { | |||
"remote": { "id": "apple/swift-atomics" } }, | |||
"remote": { "id": "apple/swift-atomics" } }, |
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.
Could you split out and pre-apply the whitespace changes please?
@@ -2134,6 +2134,16 @@ if platform.system() != 'Darwin' or swift_test_mode == 'optimize_none_with_impli | |||
# | |||
|
|||
config.substitutions.append(('%target-clangxx', '%s -std=c++11' % config.target_clang)) | |||
config.substitutions.append(('%cxx-all-targets\(([^)]+)\)', |
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 think that moving this to the next commit is better. Additionally, I'm not sure how I feel about this - this is a really really really complex way to do this. We already push lit well beyond what it should be used as, and this is particularly horrendous. Can we use a different approach for this? I think that adding the subdirectory as a multiple test suites in a lit.local.cfg might be better.
…e targets. Updates the build script, update checkout script, and lit config to support cross compiling uswift, then using uswift to cross compile and run tests on multiple targets locally.
69b5ba5
to
6779745
Compare
…titution. This patch updates most of the Interop/Cxx IRGen tests to use the %cxx-all-targets lit substituion which will run these tests on several targets. This commit only changes tests which didn't require further modification to pass, there are still 11 tests which could use this subsitution but would require some sort of change.
6779745
to
c18da8b
Compare
@swift-ci please test. |
Updates the build script, update checkout script, and lit config to support cross-compiling uswift to allow running tests on multiple targets locally. Introduces the
%cxx-all-targets
to run tests on several targets. Currently, this is only used on the C++ interop IRGen tests, but another lit substitution could be added for other tests.Here are the targets we currently cross-compile to:
arm64-apple-macosx10.9
x86_64-apple-macosx10.9
armv7-unknown-linux-androideabi
x86_64-unknown-windows-msvc
Main changes:
Link to the forum post.