Bug 317587 - Launch target from previous build directory after build dir switch
Summary: Launch target from previous build directory after build dir switch
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (show other bugs)
Version: 4.5.60
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 4.3.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-30 08:05 UTC by Sergey Vidyuk
Modified: 2013-04-30 18:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
project to reproduce issue (389.00 KB, application/x-compressed-tar)
2013-04-24 07:10 UTC, Sergey Vidyuk
Details
simple project to reproduce the issue (932 bytes, application/x-7z-compressed)
2013-04-26 15:30 UTC, Sergey Vidyuk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Vidyuk 2013-03-30 08:05:06 UTC
I have project with 2 build configurations in KDevelop:
 * Blackberry Tablet OS (armv7) cross-compilation
 * Linux desktop (x86_64) host compilation

Launch configuration initally created during host version development by right click on target in project manager view and "Debug Application" entry in context menu. Then I was working with crosscompile confiduration for some time (several rebuilds of KDevelop from 4.5 git branch). 

Yesterday I've switched back to desktop configuration and pressed F9 to run in debug however KDevelop tried to execute binary from previous build configuration and had some problems to run armv7 binary on x86_64 hardware. Delete and create launch configuration again doesn't solve the issue. The only workaround was to set correct executable path in launch configuration instead of specifying project target.

I've configured launcher back to use project target after KDevelop restart (build configuration at startup is host build configuration) and now correct executable is started. Looks like KDevelop use build directory path of the configuration at startup/project load and do not recalculate launcher path on configuration switch.

Reproducible: Didn't try




Linux distro Arch 64bit with up to date packages. Kdevelop is build from 4.5 git branch KDevPlatform is build from 1.5 git branch
Comment 1 Aleix Pol 2013-04-23 00:42:48 UTC
I just tried to execute a target and switch build directories and it works fine. Am I missing something?
Comment 2 Sergey Vidyuk 2013-04-23 08:25:21 UTC
Searching for a simple example to reproduce, hope to find it today. Some notes: I'm using Ninja for build. My build directories were created from console and then addad to kdevelop. one of build configurations uses toolchain.
Comment 3 Sergey Vidyuk 2013-04-24 07:10:45 UTC
Created attachment 79408 [details]
project to reproduce issue

Failed to find simple project to reproduse this bug. There is a hobby project I'm working on which always reproduces this behaviour.
Comment 4 Christoph Feck 2013-04-24 10:05:02 UTC
Does comment #3 provide the required information? Please set the status correctly.
Comment 5 Sergey Vidyuk 2013-04-24 10:09:41 UTC
Yes comment #3 provides project to reproduce this issue. Moving status to unconfirmed since it's the only valuable status I can set different from needs info.
Comment 6 Sergey Vidyuk 2013-04-26 15:30:00 UTC
Created attachment 79467 [details]
simple project to reproduce the issue

I have found the origin of the issue and have created example project to reproduce it.

If executable target have RUNTIME_OUTPUT_DIRECTORY property set the path to the executable is calculated only once on project load by the function CMakeManager::parse. If this property value is some path relative to a build dir (like ${CMAKE_BINARY_DIR}/bin) then cache should be recalculated when build configuration changed.
Comment 7 Sergey Vidyuk 2013-04-27 08:31:25 UTC
https://git.reviewboard.kde.org/r/110215/ possible fix
Comment 8 Aleix Pol 2013-04-30 18:03:29 UTC
Git commit 8424a911212d74cfe482bcff70595465f4f0b52f by Aleix Pol.
Committed on 30/04/2013 at 20:03.
Pushed by apol into branch 'master'.

Explicitly reload the model whenever the cache has changed

This way we make sure the project is re-parsed with the new CMakeCache, this
was a problem with some projects that use RUNTIME_OUTPUT_DIRECTORY

M  +1    -0    projectmanagers/cmake/settings/cmakepreferences.cpp

http://commits.kde.org/kdevelop/8424a911212d74cfe482bcff70595465f4f0b52f