Bug 420572 - Targets in launches don't update until reboot
Summary: Targets in launches don't update until reboot
Status: REPORTED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (other bugs)
Version First Reported In: 5.2.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-25 14:42 UTC by Steve132
Modified: 2020-04-25 14:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve132 2020-04-25 14:42:08 UTC
SUMMARY
The available targets for a CMake project are not accurate until KDevelop is rebooted: the CMake cache does not get rescanned for project executables when the cache is updated, but merely on KDevelop reboot

STEPS TO REPRODUCE
1. Create a cmake project
2. Add an executable hello_world target in the CMakeLists.txt file.  
3. Save and build.
3. go to Configure Launches.  There are no available targets.
4.  Reboot KDevelop
5.  Go to configure launches.  now the executable is available for launching

OBSERVED RESULT

The executable added in the cmakelists.txt is not available for launching until KDevelop reboots, even if it builds properly.

EXPECTED RESULT

The executable should be available in the configured launches immediately.  More generally, the project targets and launches should automatically be repopulated when any CMakeLists.txt goes out of date (or at least when the CMake Cache is updated).

There are actually several bugs here caused by this issue.  Another one can be reproduced if you create an executable target, create a launch for it, then rename it in the CMakeLists.txt:  The old executable sits around in the cmake cache, and the launch configuration for the old executable remains even though it no longer exists in the project.

The end result is that if you rename an executable in the cmake lists, then immediately run or debug run the default launch configuration, two things happen:  First, the project appears to rebuild as expected before the run (because the cmake configuration is out of date), and no errors occur.  Second, the old executable runs from the cache instead of the one that was just built, and the program appears to run.   But it's simply erroneously running the old binary.   This behavior caused me almost an hour of debugging time to figure out.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Linux Mint 19 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION