Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 293704

Summary: [Help Wanted] [Make Target View] Arguments of build command are lost in Create/Modify Dialogs when builder settings are used
Product: [Tools] CDT Reporter: Andrew Gvozdev <angvoz.dev>
Component: cdt-buildAssignee: Andrew Gvozdev <angvoz.dev>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: aegges
Version: 6.0Keywords: helpwanted
Target Milestone: 7.0   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
add build arguments
none
add build arguments2
none
add build arguments3 angvoz.dev: iplog+

Description Andrew Gvozdev CLA 2009-10-29 13:27:22 EDT
1. In project properties, C/C++ Build - Builder Settings set build command to a custom command with arguments, like "echo AAA".
2. Open a dialog to create make target in Make Target View. Build command figures "echo" but loses arguments "AAA". The target executed correctly though.
Comment 1 Andrew Gvozdev CLA 2009-10-29 13:29:13 EDT
This should be fairly easy to fix. If anybody wants to take a stub help is appreciated.
Comment 2 Axel Mueller CLA 2010-03-29 17:48:09 EDT
Created attachment 163332 [details]
add build arguments

This patch adds the build arguments to the build command shown in the dialog.
Comment 3 Andrew Gvozdev CLA 2010-03-29 22:01:27 EDT
(In reply to comment #2)
> Created an attachment (id=163332)
> add build arguments
> This patch adds the build arguments to the build command shown in the dialog.
- It does not work if I disable "Use builder settings" and then enable.
- It causes some weirdness when copying target like that to another project. The custom arguments of build command of the second project get overwritten by arguments from the first project - while still showing "Use builder settings" enabled. I expect in the copy "Use builder settings" also be enabled and so full build command of the second project as a result.
Comment 4 Axel Mueller CLA 2010-04-04 11:10:43 EDT
Created attachment 163784 [details]
add build arguments2

(In reply to comment #3)
>- It does not work if I disable "Use builder settings" and then enable.
>- It causes some weirdness when copying target like that to another project.
OK, the fix was more complex than expected. Anfrw, you ruined my day with all your testings :) (just kidding)
This patch should address all you concerns.
Comment 5 Andrew Gvozdev CLA 2010-04-07 23:29:50 EDT
(In reply to comment #4)
> Created an attachment (id=163784)
> add build arguments2
> (In reply to comment #3)
> >- It does not work if I disable "Use builder settings" and then enable.
> >- It causes some weirdness when copying target like that to another project.
> OK, the fix was more complex than expected. Anfrw, you ruined my day with all
> your testings :) (just kidding)
> This patch should address all you concerns.
Still does not work quite right. When adding an argument to the build command in properties the new argument does not appear in existing target. It appears in the build command when the target is run though. When you look at that, note a special case. In the "Behavior" tab, there are flags "Stop on first build error" and "Use parallel build". If you tick those and switch to "Builder Settings" you can see they add -k -j flags. Yeah, this bug is trickier than anticipated.
Comment 6 Axel Mueller CLA 2010-04-08 15:51:01 EDT
Created attachment 164277 [details]
add build arguments3

Yeah, this bug seemed so easy to fix and appears hard to tackle. But now, I have hunted him down finally (perhaps I should not say finally).
Comment 7 Andrew Gvozdev CLA 2010-04-11 14:01:00 EDT
(In reply to comment #6)
> Created an attachment (id=164277)
> add build arguments3
> Yeah, this bug seemed so easy to fix and appears hard to tackle. But now, I have
> hunted him down finally (perhaps I should not say finally).

Indeed, I was not able to find the case where it fails. There is still some suspicious behavior using "Stop on first build error" but not related to the fix. Committed on HEAD (7.0). Thanks for the patch!
Comment 8 Andrew Gvozdev CLA 2010-04-11 23:12:20 EDT
I also did cleanup kind of changes to clear possible confusion (hopefully). Please update your workspace. I might go through some other files too.