-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Runtimes][CMake] Set up supplemental super-build #81006
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
As we add libraries, it will become more tedious to manage building all of them independently. When built together, they should mostly take the same arguments specifying where they are installed, what compilers to use, and what configuration to use when building them. The super-build pattern is useful for this purpose. For certain distributions, it is useful to configure libraries with specific flags, but for most purposes, that is unnecessary. This moves the StringProcessing library to use the supplemental super build in CI.
@swift-ci please smoke test |
- Distributed | ||
- Observation | ||
- StringProcessing | ||
- SwiftRuntime |
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 we should use the user visible name, not the one we need to specify in the CMake code
- SwiftRuntime | |
- Runtime |
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 assume that SwiftRuntime
is actually Backtracing
? If so, I think that we should clarify this as there is a SwiftRuntime in core as well.
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 @al45tair was planning on exposing more of the lower-level runtime code to Swift through this module, not just backtracing. This is referring to the RuntimeModule portion of the stdlib though.
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. There are other things that I (and others) would like to put into the Runtime
module, which is why it is not just called Backtracing
.
if(SwiftCore_DIR) | ||
set(SwiftCore_DIR_FLAG "-DSwiftCore_DIR=${SwiftCore_DIR}") |
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.
Should we use SwiftCore_ROOT
instead? If I'm following the documentation properly, <PackageName>_DIR
is supposed to be an env variable from an user perspective, and the matching cache variable is mostly managed by CMake itself (which can change it if invalid)
if(SwiftCore_DIR) | |
set(SwiftCore_DIR_FLAG "-DSwiftCore_DIR=${SwiftCore_DIR}") | |
if(SwiftCore_ROOT) | |
set(SwiftCore_ROOT_FLAG "-DSwiftCore_ROOT=${SwiftCore_ROOT}") |
- Distributed | ||
- Observation | ||
- StringProcessing | ||
- SwiftRuntime |
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 assume that SwiftRuntime
is actually Backtracing
? If so, I think that we should clarify this as there is a SwiftRuntime in core as well.
ExternalProject_Add("${stdlib_target}-StringProcessing" | ||
SOURCE_DIR | ||
"${CMAKE_CURRENT_SOURCE_DIR}/Runtimes/Supplemental/StringProcessing" | ||
ExternalProject_Add("${stdlib_target}-Supplemental" |
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 this is a stronger reason to setup a proper build in Supplemental. We are now doing two levels of external project :(
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.
There are good reasons to not turning Supplemental into one large project. Not every distribution wants/needs all of the libraries and we have a history of not being great about tracking what can be masked out of the build together resulting in broken builds, for instance. The split projects mean that each library is responsible for using find_package
to pull in the other bits that they depend on or they'll fail to link, ensuring that the dependencies don't get out of sync and we can continue to build/configure each piece independently. The current structure also ensures that each library can be built independently if you're using a build system that allows splitting the projects across machines. Much like the LLVM_ENABLE_RUNTIMES variable, the super build (and configuring the runtime build through the same CMake invocation as the compiler) is a convenience.
@swift-ci please smoke test Linux |
@swift-ci please smoke test Windows |
|
||
set(COMMON_OPTIONS | ||
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} | ||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} |
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 added
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
-DCMAKE_INSTALL_NAME_DIR=${CMAKE_INSTALL_NAME_DIR}
-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=${CMAKE_BUILD_WITH_INSTALL_NAME_DIR}
In my synchronization PR so the supplemental super build could pass those through (assuming each uses the same install destination). Not sure if that's the best approach but it's similar to install_prefix
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 need to tackle any of my feedback, I realized it is best to have something working now to base all the other libraries on top of, and iterate on that depending on the issues/challenges we hit.
Duplicate of #81179 |
Continue with #81006 Will land the common Cmake modules next before implementing Synchronization build
As we add libraries, it will become more tedious to manage building all of them independently. When built together, they should mostly take the same arguments specifying where they are installed, what compilers to use, and what configuration to use when building them. The super-build pattern is useful for this purpose. For certain distributions, it is useful to configure libraries with specific flags, but for most purposes, that is unnecessary.
This moves the StringProcessing library to use the supplemental super build in CI.
This is splitting out the super-build pattern form the Differentiation PR: #80513