cmake: Stop pointing users at logs on configure errors

Since commit 18e1bfbb3c (cmake: On configure error suggest looking at
CMake*.log files, 2013-07-09, v2.8.12~210^2), when configuring a project
fails, we print `See also .../CMake{Output,Error}.log` near the end of
the output.  This was intended to help users find failures in system and
compiler inspection checks, but for normal project errors the messages
may be misleading.  The logs may contain incidental errors that are part
of normal operation and do not need to be addressed by the user.

Since commit f6ed2585e5 (Modules: Record system inspection steps in the
configure log, 2023-01-16), CMake's builtin modules no longer log
information to the old-style `CMake{Output,Error}.log` files anyway,
so stop mentioning them.

Fixes: #22131
Issue: #23200
This commit is contained in:
Brad King 2023-01-16 17:57:56 -05:00
parent eae1398d09
commit 317aac14ef
7 changed files with 0 additions and 25 deletions

View File

@ -1354,14 +1354,6 @@ void cmGlobalGenerator::Configure()
std::ostringstream msg; std::ostringstream msg;
if (cmSystemTools::GetErrorOccurredFlag()) { if (cmSystemTools::GetErrorOccurredFlag()) {
msg << "Configuring incomplete, errors occurred!"; msg << "Configuring incomplete, errors occurred!";
const char* logs[] = { "CMakeOutput.log", "CMakeError.log", nullptr };
for (const char** log = logs; *log; ++log) {
std::string f = cmStrCat(this->CMakeInstance->GetHomeOutputDirectory(),
"/CMakeFiles/", *log);
if (cmSystemTools::FileExists(f)) {
msg << "\nSee also \"" << f << "\".";
}
}
} else { } else {
msg << "Configuring done"; msg << "Configuring done";
} }

View File

@ -2416,9 +2416,6 @@ int cmake::ActualConfigure()
// info to save time // info to save time
if (!this->GetIsInTryCompile()) { if (!this->GetIsInTryCompile()) {
this->GlobalGenerator->ClearEnabledLanguages(); this->GlobalGenerator->ClearEnabledLanguages();
this->TruncateOutputLog("CMakeOutput.log");
this->TruncateOutputLog("CMakeError.log");
} }
#if !defined(CMAKE_BOOTSTRAP) #if !defined(CMAKE_BOOTSTRAP)

View File

@ -1 +0,0 @@
1

View File

@ -1,4 +0,0 @@
CMake Error at ErrorLogs.cmake:[0-9]+ \(message\):
Some error!
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)

View File

@ -1,3 +0,0 @@
-- Configuring incomplete, errors occurred!
See also ".*/Tests/RunCMake/Configure/ErrorLogs-build/CMakeFiles/CMakeOutput\.log"\.
See also ".*/Tests/RunCMake/Configure/ErrorLogs-build/CMakeFiles/CMakeError\.log"\.

View File

@ -1,5 +0,0 @@
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Some detailed output information!\n")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Some detailed error information!\n")
message(SEND_ERROR "Some error!")

View File

@ -3,7 +3,6 @@ include(RunCMake)
run_cmake(ContinueAfterError) run_cmake(ContinueAfterError)
run_cmake(CopyFileABI) run_cmake(CopyFileABI)
run_cmake(CustomTargetAfterError) run_cmake(CustomTargetAfterError)
run_cmake(ErrorLogs)
# Use a single build tree for a few tests without cleaning. # Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build)