Make target settings are behavior incompatible

Andreas Pakulat apaku at gmx.de
Sun Jan 7 01:23:39 UTC 2007


On 06.01.07 19:44:54, Andras Mantia wrote:
> On Saturday 06 January 2007 17:55, Andreas Pakulat wrote:
> > On 06.01.07 17:33:32, Andras Mantia wrote:
> > >  Since the changes in the make/run target handling, things got
> > > broken if you load an old project. The bugs I noticed:
> > > 1) on loading, the "Main Program" setting is unticked in the Run
> > > Options dialog, which means that now the "Execut Program" doesn't
> > > build and run the main program. This is behavioral incompatible,
> > > I'd suggest to use Main Program by default when loading old
> > > projects.
> >
> > For Automake and QMake projects that is by purpose. The reason is
> > that those provide the main program via their active target and
> > building+executing that should work. Else the AM or QM is broken.
> 
> I don't understand this. If I never had an active target, but just a 
> main program in the project why is it suddenly not compiled? I don't 
> care if this option gets disabled as soon as you define an active 
> target, but if you don't, this should not be touched.

For AM there's _always_ an active target, AFAIK. At least there's no Ui
to unset an active target. 

As for QMake projects, its the same thing, just that you always have a
selected subproject there.

I don't know about the rebuild-before-execute logic, Jens recently
looked into that and said its a mess and it only works in half of the
cases.

> > > 2) This is the more serious one. Until now the Executable (in Run
> > > options) was a relative path to the build directory (or Working
> > > Directory as it is called now). Now instead of that one, the
> > > Executable line is appended to the *source* directory, which is
> > > again not how it worked before and I consider to be plain wrong.
> >
> > You can specify the Working directory in which the launch should be
> > done via the active target's option dialog.
> 
> Again, what if I don't use any active target?

For AM you can't, as well for QM. For any other project managers the
options in the Run dialog should be activated. If they're not, please
tell me what project manager you use.

> What you say results in fact that every time an active target MUST be
> defined and than this Main program setting is just superfluous and
> must be removed.

Well, for AM/QM it is superflous, thats why its disabled by default.
However the same dialog (code-wise) is used for all other project
managers and those don't have targets or subprojects.

> Also in that case the Build Project action should be removed and 
> replaced with the Build Active Project.

Huh? Build Project builds your whole project. If you want to build only
a subproject or target there context menu actions for that as well as
buttons on the project managers.

> > > Furthermore the file dialog for the Executable line starts from my
> > > home directory instead of the Working Directory (or even the source
> > > dir).
> >
> > The file dialog normally starts from the build directory of your
> > project. 
> No. :-) Configure options-Build 
> directory: /data/development/build/kde-3.5/kdewebdev
> The file dialog for the Executable line starts from $HOME.

I can't reproduce that here, sorry.

> > It uses the project managers buildDirectory() value, 
> > whatever the project manager returns for that.
> 
> Something is broken than...

Not for me. What project manager do you use?

> > > As of now, I have to specify the full path to the exeuctable, which
> > > is incovenient and introduce another local specific setting for no
> > > good reason.
> >
> > The reason is simply that what we had before was
> >
> > a) confusing to new users and myself
> 
> Now it is confusing for old users. ;-)

Hehe, we don't care about old users, those will find their way through
the maze ;)

Seriously though, this is an attempt to have less places for the
different options and to simplify it. For example before our changes
there wasn't really a hint that without anything in the executable and
arguments lines the AM would take the settings for the currently active
target.

> > b) didn't work properly with all project managers
> > c) spread the settings over different pages in the Ui
> > d) didn't work properly in the project manager it was designer for,
> > i.e. automake.
> 
> See the first part. Now it is *really* confusing, especially why it 
> tries to start from the source directory.

It doesn't for me. It starts from whereever I set it to via the targets
Options dialog (last tab). 

Although I today fixed a small problem, where the "Execute target"
button in the lower part of the Automake manager would always run from
the builddirectory of the target.

> My assumption of how it should work is:
> 
> 1) if Main program is activated in the project and Executable is a 
> relative path, the path is appended to the build directory, F8 (Build 
> Project) builds and runs this executable,

F8 never started the build, so this won't happen, ever.

> whatever it points (the default is the starting path). The file dialog 
> chooser for executable should start from the buld directory.

As I said above, it does for me.

> F7 (Build Active Target) builds the configured active target if exists, 

It always exists.

> and acts as F8 as there is no active target (or gives an error).

see above.

> Run - runs the main program if set and activated or runs the active
> target (what if the target is a library?).

For libraries nothing happens when running. We should maybe post a
dialog box saying so.

> 2) if there is no main program specified or this setting is not 
> activated:
> F8 - gives an error

Build has nothing to do with the executable.

> This would be logical, just running the active target is not that clear, 
> if this is not an executable. Think about developing a complex 
> application, like KDevelop, when you might make the active target a 
> library you work on, still to test it you want to execute the main 
> program, not the active target.

Hmm, you have a point here. Although you can set the main app in the run
dialog to achieve this.

Andreas

-- 
You look tired.




More information about the KDevelop-devel mailing list