From e5b1a23f27e9279d65b0c3f5c944356f62efe4af Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 27 Feb 2026 10:23:22 -0500 Subject: [PATCH] c++modules: Revert partial implementation of per-importer BMIs for 4.3 Introduced in commit 5c00749c5d (cmCxxModuleUsageEffects: Collect and apply BMI compatibility requirements, 2025-12-29, v4.3.0-rc1~43^2), this has exploded the set of BMIs generated in existing builds. Revert this partial implementation and comment out its corresponding test for the 4.3 release. Work towards a full implementation will proceed in post-4.3 development. Issue: #27597 --- Source/cmCxxModuleUsageEffects.cxx | 25 ++++++------------- .../CXXModulesCompile/RunCMakeTest.cmake | 3 ++- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Source/cmCxxModuleUsageEffects.cxx b/Source/cmCxxModuleUsageEffects.cxx index 8985a58520..aa1a13f583 100644 --- a/Source/cmCxxModuleUsageEffects.cxx +++ b/Source/cmCxxModuleUsageEffects.cxx @@ -2,28 +2,17 @@ file LICENSE.rst or https://cmake.org/licensing for details. */ #include "cmCxxModuleUsageEffects.h" -#include - -#include "cmCryptoHash.h" -#include "cmGeneratorTarget.h" -#include "cmTarget.h" - -cmCxxModuleUsageEffects::cmCxxModuleUsageEffects(cmGeneratorTarget const* gt) +cmCxxModuleUsageEffects::cmCxxModuleUsageEffects( + cmGeneratorTarget const* /*gt*/) + : Hash("0000000000000000000000000000000000000000") { - cmCryptoHash hasher(cmCryptoHash::AlgoSHA3_512); - this->Hash = hasher.HashString(gt->GetName()); - - // Collect compile features from the consuming target. - for (auto const& feature : gt->Target->GetCompileFeaturesEntries()) { - this->CompileFeatures.emplace_back(feature); - } + // TODO: collect information from the generator target as to what might + // affect module consumption. } -void cmCxxModuleUsageEffects::ApplyToTarget(cmTarget* tgt) +void cmCxxModuleUsageEffects::ApplyToTarget(cmTarget* /*tgt*/) { - for (auto const& feature : this->CompileFeatures) { - tgt->AppendProperty("COMPILE_FEATURES", feature.Value, feature.Backtrace); - } + // TODO: apply the information collected in the constructor } std::string const& cmCxxModuleUsageEffects::GetHash() const diff --git a/Tests/RunCMake/CXXModulesCompile/RunCMakeTest.cmake b/Tests/RunCMake/CXXModulesCompile/RunCMakeTest.cmake index e45ed7d129..6df0a8af15 100644 --- a/Tests/RunCMake/CXXModulesCompile/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModulesCompile/RunCMakeTest.cmake @@ -185,7 +185,8 @@ if ("named" IN_LIST CMake_TEST_MODULE_COMPILATION) # BMI generation if ("cxx_std_23" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND RunCMake_GENERATOR MATCHES "Ninja") - run_cxx_module_test(mixed-bmi-compatibility) + # FIXME(#27597): Restore per-importer BMI and enable this test. + # run_cxx_module_test(mixed-bmi-compatibility) endif() if ("cxx_std_23" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND