-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SwiftRemoteMirror: add a host build for the tools #21904
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
Conversation
@swift-ci please test |
Build failed |
@swift-ci please test macOS platform |
Build failed |
103bcb9
to
700cf58
Compare
@swift-ci please test |
Build failed |
Build failed |
When I try your patch, I get a different issue as the one in the PR testing: My build-script invocation: |
I think I understand. add_swift_target_library above is called, because SWIFT_BUILD_REMOTE_MIRROR is defined. And I suppose this will create a swiftRemoteMirror-macos target |
Ugh, you're right. My condition isn't strict enough for avoiding the second definition. |
I managed to build locally with a variant of your patch, where I removed the SWIFT_BUILD_REMOTE_MIRROR condition from the first if and moved it to the one you added. I don't know under which circumstances SWIFT_BUILD_REMOTE_MIRROR is defined, so this might be totally wrong, but ti works for my config. |
|
700cf58
to
e691ed5
Compare
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test macOS platform |
Build failed |
e691ed5
to
d013c25
Compare
@swift-ci please test |
Build failed |
Hmm, I think that the fat linking might be getting confused as the |
d013c25
to
5bd9655
Compare
@swift-ci please test |
@swift-ci test |
If Fred is cool with this, I am cool with this. |
Sorry for the delay, took me some time to get back to this. I just tried this and it still doesn't work for me in the way I already described above. SWIFT_BUILD_REMOTE_MIRROR and SWIFT_INCLUDE_TOOLS will be defined in my build configuration. This will create duplicate targets in stdlib/public/SwiftRemoteMirror/CMakeLists.txt. I think we need to remove the SWIFT_BUILD_REMOTE_MIRROR condition from the first condition in this CMakeList.txt and add it to the conditional block this PR is adding. This seems to get the build further for me. |
@@ -2,14 +2,35 @@ | |||
# always built as a shared library. | |||
if(SWIFT_BUILD_DYNAMIC_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR) |
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 SWIFT_BUILD_REMOTE_MIRROR needs to be removed from here and moved to the new host code. Not sure what this build setting is for. Is it always set at the same time as SWIFT_INCLUDE_TOOLS, or is it different?)
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 is up to the user to decide if the remote mirror should be built or not. Personally, I am of the opinion that if Apple doesn't build in a configuration where it matters, we should remove the option and always build it when SWIFT_INCLUDE_TOOLS
is defined. We now have a differentiation between the host and target bits, and if we are building tools, we should just build it for the host.
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's unclear to me whether you're agreeing with me that the SWIFT_BUILD_REMOTE_MIRROR should be moved to the host part, or whether you're arguing something different
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 arguing for something more drastic (the removal of the option). I'm interested in how the current version doesn't work though as the if(NOT SWIFT_BUILD_STDLIB AND NOT SWIFT_BUILD_REMOTE_MIRROR)
should prevent the duplicate umbrella target. Note that if we can understand why this condition is insufficient, then I'm also okay with getting that changed and merged to get you unblocked.
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 issue is not a duplicate target in this case, but missing targets. add_swift_target_library will create build targets for all the different targets (iphonesimulator, watchsimulator, ...) that have been configured to build. But the swiftReflection side never ran add_swift_target_library(), so the reflection dependencies of those build targets don't exist. Sorry for the overloaded use of 'target'. Here's an example:
CMake Error at cmake/modules/AddSwift.cmake:2277 (add_dependencies):
The dependency target "swiftReflection-iphonesimulator" of target
"swiftRemoteMirror-iphonesimulator-i386" does not exist.
Call Stack (most recent call first):
stdlib/public/SwiftRemoteMirror/CMakeLists.txt:18 (add_swift_target_library)
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.
Alos, I think we have one build configuration where we build only RemoteMirrors for some external tools to use. This might be the reason for the existence of SWIFT_BUILD_REMOTE_MIRROR.
@@ -2,14 +2,35 @@ | |||
# always built as a shared library. | |||
if(SWIFT_BUILD_DYNAMIC_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR) |
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 issue is not a duplicate target in this case, but missing targets. add_swift_target_library will create build targets for all the different targets (iphonesimulator, watchsimulator, ...) that have been configured to build. But the swiftReflection side never ran add_swift_target_library(), so the reflection dependencies of those build targets don't exist. Sorry for the overloaded use of 'target'. Here's an example:
CMake Error at cmake/modules/AddSwift.cmake:2277 (add_dependencies):
The dependency target "swiftReflection-iphonesimulator" of target
"swiftRemoteMirror-iphonesimulator-i386" does not exist.
Call Stack (most recent call first):
stdlib/public/SwiftRemoteMirror/CMakeLists.txt:18 (add_swift_target_library)
@fredriss hmm, so it should be okay to remove |
I think this would work. |
5bd9655
to
7aa4948
Compare
Sweet! I'm cool with that then! Lets get that taken care of :-) |
@swift-ci please test |
Build failed |
This adds an explicit version of the SwiftRemoteMirror library for use in the tools that comprise the toolchain. This is a separate build from the target specific builds of the library even though we may be building the runtime for the (same) host.
7aa4948
to
85f45df
Compare
Build failed |
@swift-ci please test |
Build failed |
Build failed |
This seems to work for LLDB. @Rostepher will this have any impact on the SwiftMirrors standalone build? |
We do use the |
Spoke with @Rostepher. We should merge this for LLDB, and find a different solution for remote mirror only builds. |
@fredriss @zisko @Rostepher - this is ready, just waiting for you guys to say when to merge this change |
Sorry, I should have merged this a while ago. |
This adds an explicit version of the SwiftRemoteMirror library for use
in the tools that comprise the toolchain. This is a separate build from
the target specific builds of the library even though we may be building
the runtime for the (same) host.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.