diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-11-21 14:19:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-11-21 16:09:38 (GMT) |
commit | ec1e589bec6567c955db24adeb6294258e3db463 (patch) | |
tree | b1f6d51dcefe592def1208486b6b12111736258d | |
parent | 9d2769ecbd497dd51405ae2586ae62b828712a07 (diff) | |
download | CMake-ec1e589bec6567c955db24adeb6294258e3db463.zip CMake-ec1e589bec6567c955db24adeb6294258e3db463.tar.gz CMake-ec1e589bec6567c955db24adeb6294258e3db463.tar.bz2 |
Ninja: Revert exact collation dependencies for 3.27
Revert commit b6a5382217 (Ninja: depend on language module information
files directly, 2023-02-10, v3.27.0-rc1~502^2) from !8197.
This reverts the "exact dependencies" for collation inputs and returns
to "get all targets" and target-ordering. Use of exact dependencies
caused a parade of use cases that had not been tested previously to be
found and need fixing over the 3.27 release series. To stop the flow on
3.27, revert to the 3.26 strategy. We will continue in 3.28.
Note that this is a restoration of 3.26 semantics where incremental
rebuilds may be subtly incorrect in the presence of stale
`<LANG>Modules.json` files. However, since C++ support is experimental
and Fortran has always had this problem as of 3.27, it is not considered
a regression.
See: #25112
See: #25123
See: #25252
See: #25365
See: #25417
See: #25425
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index d712d71..bc04d1f 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1034,11 +1034,6 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements( cmNinjaBuild build(this->LanguageDyndepRule(language, config)); build.Outputs.push_back(this->GetDyndepFilePath(language, config)); - build.ImplicitOuts.push_back( - cmStrCat(this->Makefile->GetCurrentBinaryDirectory(), '/', - this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget), - this->GetGlobalGenerator()->ConfigDirectory(config), '/', - language, "Modules.json")); for (auto const& scanFiles : scanningFiles) { if (!scanFiles.ScanningOutput.empty()) { build.ExplicitDeps.push_back(scanFiles.ScanningOutput); @@ -1050,10 +1045,17 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements( this->WriteTargetDependInfo(language, config); - for (std::string const& l : - this->GetLinkedTargetDirectories(language, config)) { - build.ImplicitDeps.push_back(cmStrCat(l, '/', language, "Modules.json")); - } + // Make sure dyndep files for all our dependencies have already + // been generated so that the '<LANG>Modules.json' files they + // produced as side-effects are available for us to read. + // Ideally we should depend on the '<LANG>Modules.json' files + // from our dependencies directly, but we don't know which of + // our dependencies produces them. Fixing this will require + // refactoring the Ninja generator to generate targets in + // dependency order so that we can collect the needed information. + this->GetLocalGenerator()->AppendTargetDepends( + this->GeneratorTarget, build.OrderOnlyDeps, config, fileConfig, + DependOnTargetArtifact); this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig), build); |