-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Remove -enable-ossa-modules for Synchronization and Distributed #77314
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 smoke test |
Please test with following pull request: @swift-ci Please test |
Is this really easier than just adding |
stdlib/public/core/CMakeLists.txt
Outdated
@@ -353,6 +353,9 @@ set(swiftCore_common_options | |||
SWIFT_COMPILE_FLAGS | |||
${swift_stdlib_compile_flags} -Xcc -DswiftCore_EXPORTS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}) | |||
|
|||
# Enable OSSA Modules for swift stdlib |
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 you can remove this since it comes for free with the changes in stdlib/cmake/modules/AddSwiftStdlib.cmake
.
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.
Done
These modules import Darwin which is not in ossa. -enable-ossa-modules results in a one-time recompilation of dependencies when they are not in ossa. This is not compatible with Explicit Build Modules when the original invocation did not have -enable-ossa-modules.
…s for building the interface
@Azoy Adding |
Please test with following pull request: @swift-ci Please test |
// soft reject, silently ignore. | ||
// Diagnose only when explicit build modules is enabled | ||
if (Ctx.SerializationOpts.ExplicitModuleBuild) { | ||
Ctx.Diags.diagnose(diagLoc, |
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 is this only diagnosed for explicit module builds?
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 have left the behavior as is for implicit module builds. It's useful for testing -enable-ossa-modules
on a module level until support for implicit module builds exist.
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.
Would it be possible to instead introduce a flag that allows OSSA to be lenient for testing, while making both explicit and implicit module builds strict in the same way by default?
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.
Basically looks good to me
@@ -901,6 +901,9 @@ ERROR(serialization_target_too_new_repl,none, | |||
"deployment target of %0 %3: %4", | |||
(StringRef, llvm::VersionTuple, Identifier, llvm::VersionTuple, | |||
StringRef)) | |||
ERROR(serialization_non_ossa_module_incompatible, Fatal, | |||
"cannot import non-ossa module into an ossa-module", |
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.
Maybe:
"cannot import non-OSSA module into an OSSA module"
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.
Done
6d44548
to
6a718be
Compare
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.
Not entirely sure on the implications for the Distributed module but seems fine to me?
@swift-ci test |
@swift-ci test |
Please test with following pull request: @swift-ci Please test |
Please test with following pull request: @swift-ci Please test |
Please test with following pull request: @swift-ci Please test windows platform |
Hi @meg-gupta , this PR broke the LLDB builds: https://ci.swift.org/view/LLDB/job/oss-lldb-incremental-macos-cmake/8289/console Whenever an API in |
@shahmishal Why didn't the pre-merge CI catch this? |
@adrian-prantl the llvm change it was tested with was never merged |
that's a relief, I was worried that during the rebranch we introduced a bot misconfiguration! |
Synchronization
andDistributed
are serialized in OSSA, they importDarwin
which is non-ossa. With implicit modules builds, this results in a one time recompilation ofDarwin
with-enable-ossa-modules
.However with Explicit Build Modules, all dependencies are treating equally and
-enable-ossa-modules
will be passed on only when present in the original compiler invocation.This PR removes
-enable-ossa-modules
forSynchronization
andDistributed
and adds a diagnostic whenever we are trying to import a non-ossa module into an ossa module when Explicit Build Modules are enabled.As a consequence one of the perf constraint tests in
Synchronization
started failing due to presence of copies which was previously eliminated due to being in ossa. I added @_transparent to the relevant stdlib function -Atomic.deinit
to workaround this since@_transparent
functions are always serialized as ossa irrespective of the presence of-enable-ossa-modules
.This is a temporary fix until ossa modules are default.
Fixes rdar://138407068