Domain: Software Engineering / Integrated Development Environment (IDE) Support & DevOps
Persona: Senior Lead IDE Support Engineer
2. Summarize (Strict Objectivity)
Abstract:
This report synthesizes a long-standing technical issue (CPP-17414) within the CLion IDE regarding the failure of the CMake Project Manager to display all valid build targets. Spanning over six years of user reports and developer investigations, the issue involves the "Run/Debug Configuration" dropdown failing to populate targets that are otherwise buildable via the command line. While the root cause remains elusive due to reproducibility challenges, evidence points toward corruption within the .idea configuration directory—specifically the workspace.xml file—often triggered by Git branch switching, Catch2 test discovery, or external CMake Preset modifications. Current resolutions focus on manual deletion of IDE metadata or adjusting advanced persistence settings.
Technical Summary and Timeline of Issue CPP-17414:
[Over 6 years ago] Initial Incident Report: User Alexander Zaitsev reports that CLion fails to show specific CMake targets in the UI. He confirms targets remain buildable via manual make commands. A temporary fix is identified: deleting the .idea folder and re-importing the project.
[About 6 years ago] Target Profiling: Users confirm the bug affects executable targets added after initial project generation, even on recent CMake versions (3.15+).
[Over 5 years ago] Trigger Identification: Oskar Truffer identifies Git branch switching as a potential catalyst. He notes that while the IDE fails to show the target, the underlying cmake --build command generated by the IDE still functions if called manually.
[Over 5 years ago] UI Discrepancies: Users report that missing targets sometimes appear in the "Edit Configurations..." dropdown but are absent from the primary target selection menu.
[Almost 5 years ago] Metadata Corruption: Verification that deleting the .idea folder restores visibility, suggesting the IDE's internal state becomes desynchronized from the CMake cache.
[About 4 years ago] XML Persistence Findings: Samuel Pauls discovers a specific workaround: deleting the <generated> element within .idea/workspace.xml. This suggests CLion’s logic for tracking "already present" targets is preventing the restoration of missing ones.
[About 2 years ago] External Triggers: Reports indicate that adding CMake Presets externally or via git pull frequently triggers target disappearance.
[Over 1 year ago] Structural Analysis: Diffing workspace.xml reveals that targets may exist in the CMakeRunConfigurationManager component but go missing from the RunManager list during the bug state.
[12 months to 6 months ago] Catch2 Correlation: Multiple users link the issue to Catch2 test discovery. Running a single test from the editor gutter can cause the main binary target to be replaced by a temporary single-test configuration, which then fails to revert.
[6 months ago] Root Cause Hypothesis: Senior Developer Evgenii Novozhilov identifies "sticky" persistence logic designed to prevent the auto-recreation of manually deleted configurations. If the IDE incorrectly flags a target as "user-deleted," it will never reappear.
[6 months ago] Advanced Workaround: A new workaround is proposed: disabling the advanced setting "Delete configurations for missing targets automatically (CMake, Makefile, and Meson projects)."
[3 months ago] Refined Cleanup: Users report that for a full manual reset, both the generated section and the RunManager component in the XML must be cleared.
Key Takeaways:
Persistent Configuration Logic: The bug is likely a side effect of CLion's logic intended to respect manual user deletion of configurations.
State Conflict: Inconsistency between the CMakeRunConfigurationManager (what CMake says exists) and the RunManager (what the UI shows) is the primary technical symptom.
Metadata Sensitivity: The .idea directory is the focal point of the corruption; clearing workspace.xml is the most surgical recovery method.
Race Conditions: Slow systems or those with high-latency I/O (WSL, Windows Defender) may experience heightened susceptibility due to race conditions during project indexing/loading.