Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-02

LCL recompilation

9 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Hans-Peter Diettrich

The new handling of the LCL recompilation causes some trouble to me :-(

In former times it was possible to configure and compile the LCL in a defined way. Now project specific settings can result in a recompilation of the LCL, with every project, with chances that the recompilation fails for a bunch of reasons. Even a "make clean all" can not help any more, when testing a project forces another recompilation of the LCL :-(

Is it possible to "fix" the LCL compilation (i.e. no implied rebuild)?

Is it possible to use the Lazarus.lpi project for testing changes to the LCL or IDE interface? Since this project does *not* recompile the LCL, how can the LCL be rebuilt for such testing, without recompilation of the current IDE?

Is it possible to have different LCL versions, for the IDE and other projects? Rebuilding the IDE, e.g. to add or remove packages, should be possible without adding eventual modifications to the LCL. I'd like to have a single stable IDE on my system, that is never affected by exploring different SVN branches or other local changes to the codebase.

Is it possible to have different debug settings, for projects and the LCL? Code navigation (goto declaration...) and stepping through LCL code, down to the widgetset level, seems to require a debug version of the LCL.

DoDi

Reply by email

Mattias Gaertner
to Hans-Peter Diettrich
Show quoted text 7 lines
The new handling of the LCL recompilation causes some trouble to me :-( In former times it was possible to configure and compile the LCL in a defined way. Now project specific settings can result in a recompilation of the LCL, with every project, with chances that the recompilation fails for a bunch of reasons. Even a "make clean all" can not help any more, when testing a project forces another recompilation of the LCL :-(

The LCL is only recompiled if needed, that means:
If the project defines another target (widget/os/cpu) and the LCL was not yet compiled for that target, the LCL will be recompiled. Or if you change the compiler, e.g. you switch from 2.4.2 to 2.5.1. Or if you change the source of the LCL.
Or if you change the IDEBuildOptions.

If you spot a recompile without need please report the bug.

Is it possible to "fix" the LCL compilation (i.e. no implied rebuild)?

Since the LCL is a normal package, you can open it and set the automatic rebuild to manually.
This setting is stored in the lpk.

Is it possible to use the Lazarus.lpi project for testing changes to the LCL or IDE interface? Since this project does *not* recompile the LCL, how can the LCL be rebuilt for such testing, without recompilation of the current IDE?

The lazarus.lpi has disabled compile in its compiler options. You can compile via the Tools / Build Lazarus.
To test changes to the LCL/IDEIntf without recompiling the IDE, create a project and add IDEIntf as requirement to the project.

Show quoted text 5 lines
Is it possible to have different LCL versions, for the IDE and other projects? Rebuilding the IDE, e.g. to add or remove packages, should be possible without adding eventual modifications to the LCL. I'd like to have a single stable IDE on my system, that is never affected by exploring different SVN branches or other local changes to the codebase.

Use two different lazarus source directories and the --pcp switch.

Is it possible to have different debug settings, for projects and the LCL?

The LCL is compiled separately from the project and uses its own compiler settings. Therefore the debug and optimization settings of the project are not applied to the LCL.

Code navigation (goto declaration...) and stepping through LCL code, down to the widgetset level, seems to require a debug version of the LCL.

Code navigation ignores all debug settings. The debugger and stack traces requires a debug version of the LCL.

Mattias

Reply by email

Alexander Klenin
to Mattias Gaertner
Mattias Gaertner wrote
The LCL is only recompiled if needed, that means:

BTW, I recently tried this change, and I like it very much. I can now test LCL modifications without IDE rebuild.

Alexander S. Klenin

Reply by email

Felipe Monteiro de Carvalho
to Alexander Klenin
Alexander Klenin wrote
BTW, I recently tried this change, and I like it very much. I can now test LCL modifications without IDE rebuild.

That was already possible before. You just needed to set LCL to Build and the rest to None. Build Lazarus (which would build only the LCL). Then rebuild your project.

Felipe Monteiro de Carvalho

Reply by email

Hans-Peter Diettrich
to Mattias Gaertner: On Thu, 03 Feb 2011 06:38:44 +0100 The LCL is only recompiled if needed, that means: If…
Show quoted text 6 lines
The LCL is only recompiled if needed, that means: If the project defines another target (widget/os/cpu) and the LCL was not yet compiled for that target, the LCL will be recompiled. Or if you change the compiler, e.g. you switch from 2.4.2 to 2.5.1. Or if you change the source of the LCL. Or if you change the IDEBuildOptions.

How can I find out the reason for the rebuild, in detail when different build options are involved? When the former procedure missed to find applicable compiled units, it simply rejected to proceed, and I could rebuild the LCL manually with known settings. Nowadays I'm somewhat lost, and most rebuilds don't complete so that I have to restart from "make clean all" :-(

Most recompilations stop with "file not found" errors, with different files. Since the files exist, and are found by the IDE, I assume that search path options are involved.

If you spot a recompile without need please report the bug.

What information should I include, so that a bug report makes sense?

Show quoted text 5 lines
> Is it possible to "fix" the LCL compilation (i.e. no implied rebuild)? Since the LCL is a normal package, you can open it and set the automatic rebuild to manually. This setting is stored in the lpk.

Fine, I'll test that immediately :-)

Show quoted text 7 lines
> Is it possible to use the Lazarus.lpi project for testing changes to the > LCL or IDE interface? Since this project does *not* recompile the LCL, > how can the LCL be rebuilt for such testing, without recompilation of > the current IDE? The lazarus.lpi has disabled compile in its compiler options. You can compile via the Tools / Build Lazarus.

How do I build a new IDE, without overwriting the old (working) one?

To test changes to the LCL/IDEIntf without recompiling the IDE, create a project and add IDEIntf as requirement to the project.

Thanks, this might help to spot above "file not found" errors.

Show quoted text 7 lines
> Is it possible to have different LCL versions, for the IDE and other > projects? Rebuilding the IDE, e.g. to add or remove packages, should be > possible without adding eventual modifications to the LCL. I'd like to > have a single stable IDE on my system, that is never affected by > exploring different SVN branches or other local changes to the codebase. Use two different lazarus source directories and the --pcp switch.

This is what I do, but I feel lost in finding the involved config files.

Currently I have an compiler in an PP directory, and more in several FPC subdirectories. And one in the Lazarus directory, containing all the needed build tools, and this one also is in the system Path. It's hard to make such an compiler work, because "make install" does not install all the build tools nor the source files, and also doesn't create an usable fpc.cfg file. All this requires much manual reconfiguration, and that's why I suspect some problems in my configuration.

I already tried to set up another user, but this didn't eliminate all dependencies on other parts of the common installation (0.9.28?). That's why I would like to use a complete installation of some FPC version (>2.2.4), that is usable with the Lazarus trunk and 0.30 branch.

Show quoted text 6 lines
> Is it possible to have different debug settings, for projects and the > LCL? The LCL is compiled separately from the project and uses its own compiler settings. Therefore the debug and optimization settings of the project are not applied to the LCL.

Hmm, then I wonder why after "make clean all" the LCL is recompiled later. I already checked the environment options, to match the "make" options, but I'm not really sure. It would be nice to have some indication, which config files etc. are used by "make", so that the IDE can be configured to use the same settings.

IOW I'm happy to have got Lazarus and LCL compile and work, somehow, but I'm not sure how this really is achieved, and whether the same settings are used in my various Lazarus directories.

Show quoted text 5 lines
> Code navigation (goto declaration...) and stepping through LCL > code, down to the widgetset level, seems to require a debug version of > the LCL. Code navigation ignores all debug settings.

But what's missing then, when I cannot go to lower level source code in the IDE? Currently I cannot follow the call chain (go to declaration) into the win32 (target) specific source files.

DoDi

Reply by email

Mattias Gaertner
to Hans-Peter Diettrich

?

Hans-Peter Diettrich hat am 3. Februar 2011 um 14:16 geschrieben:

Show quoted text 11 lines
Mattias Gaertner schrieb: > The LCL is only recompiled if needed, that means: > If the project defines another target (widget/os/cpu) and the LCL was > not yet compiled for that target, the LCL will be recompiled. > Or if you change the compiler, e.g. you switch from 2.4.2 to 2.5.1. > Or if you change the source of the LCL. > Or if you change the IDEBuildOptions. How can I find out the reason for the rebuild, in detail when different build options are involved??

Start the ide with --debug-log=log.txt
It logs the exact reason.
?

When the former procedure missed to find applicable compiled units, it simply rejected to proceed, and I could rebuild the LCL manually with known settings.?

?
?

Nowadays I'm somewhat lost, and most rebuilds don't complete so that I have to restart from "make clean all" :-(?

If lazarus does not compile please create a bug report with the build log. ?
?

Most recompilations stop with "file not found" errors, with different files. Since the files exist, and are found by the IDE, I assume that search path options are involved.?

In the last week some people had trouble, because they didn't make clean or had mixed an older lazarus with a newer lazarus or they used an outdated mirror. An older IDE can not compile the current. You must use make. If you use the snapshot, make sure to clean up the old directory. ?
?

> If you spot a recompile without need please report the bug. What information should I include, so that a bug report makes sense??

The --debug-log and the way how you installed lazarus.? ?
?
?

Show quoted text 5 lines
[...] > The lazarus.lpi has disabled compile in its compiler options. You can > compile via the Tools / Build Lazarus. How do I build a new IDE, without overwriting the old (working) one??

First of all: Backup the working one. Backups are always a good idea. You can pass an -o option if you want.
?
?

Show quoted text 7 lines
[...] > The LCL is compiled separately from the project and uses its own > compiler settings. Therefore the debug and optimization settings of the > project are not applied to the LCL. Hmm, then I wonder why after "make clean all" the LCL is recompiled later.?

Maybe you defined some options in the "Configure build lazarus" dialog? These are the IDEBuildOptions. The debug-log will tell. ?

I already checked the environment options, to match the "make" > options, but I'm not really sure. It would be nice to have some indication, which config files etc. are used by "make", so that the IDE can be configured to use the same settings.?

For the LCL "make" uses only your fpc.cfg. This is also used by the IDE. But the IDE can add IDEBuildOptions and project options.
?
?

Show quoted text 10 lines
? >> Code navigation (goto declaration...) and stepping through LCL >> code, down to the widgetset level, seems to require a debug version of >> the LCL. > > Code navigation ignores all debug settings. But what's missing then, when I cannot go to lower level source code in the IDE? Currently I cannot follow the call chain (go to declaration) into the win32 (target) specific source files.?

Can you be more specific? What find declaration does not work?? ?
Mattias
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110203/12209cac/attachment-0001.html>

Reply by email

Hans-Peter Diettrich
to Mattias Gaertner
Show quoted text 8 lines
> How can I find out the reason for the rebuild, in detail when different > build options are involved? Start the ide with --debug-log=log.txt It logs the exact reason.

Okay, this cleared up the first bug/error. The active project was Lazarus.lpi of a different Lazarus version. Lazarus seems to import *also* the LCL from that other version, with fatal consequences. Should I create an bug report, because this project prevented the ToDo list to appear?

Here's the log:
[BTW: the log has some bad line endings on Windows]

SetPrimaryConfigPath
NewValue="D:\repos\Lazarus-0.9.30rc\fixes_0_9_30\cfg" -> "D:\repos\Lazarus-0.9.30rc\fixes_0_9_30\cfg"
### TCodeToolManager.HandleException: "include file not found "lcl_defines.inc"" at Line=28 Col=5 in
"D:\git2\lazarus\lcl\controls.pp"### TCodeToolManager.HandleException: ""interface" expected, but found" at Line=28 Col=4 in "D:\git2\lazarus\lcl\controls.pp"### TCodeToolManager.HandleException: "include file not found "lcl_defines.inc"" at Line=30 Col=5 in "D:\git2\lazarus\lcl\forms.pp"TMainIDE.DoOpenProjectFile IDETodoWindow:TIDETodoWindow
TDesignerTCodeBrowserView.WorkGetScopeOptions
STARTTCodeBrowserView.WorkGatherPackages RootOwner=" Project"TCodeBrowserView.WorkFreeUnusedPackages
STARTTCodeBrowserView.WorkGatherFiles
STARTTCodeBrowserView.WorkUpdateFiles
ProjectTCodeBrowserView.WorkGatherFiles
STARTTCodeBrowserView.WorkGetViewOptions UpdateNeeded=True ChangeStamp=TrueTCodeBrowserView.UpdateTreeView
UnitFilter=TApplication.HandleException Access violation Stack trace:
$00B24082 TIDETODOWINDOW__SETOWNERFILENAME, line 325 of todolist.pas $00B2396F VIEWTODOLIST, line 140 of tododlg.pas
$0074F1AA TIDECOMMAND__EXECUTE, line 875 of idecommands.pas $00808D5B TIDEMENUCOMMAND__MENUITEMCLICK, line 1628 of menuintf.pas $0055BF6E TMENUITEM__CLICK, line 75 of ./include/menuitem.inc $0055C5A8 TMENUITEM__DOCLICKED, line 269 of ./include/menuitem.inc $0040B826
$0062BA7F CUSTOMFORMWNDPROC, line 357 of win32wsforms.pp $77736238
$777368EA
$77737D31
$77737DFA
$00572D68
$00421FC9
$0042240F
$0047DD73
$004223CA
LAZARUS END - cleaning up ...

DoDi

Reply by email

Hans-Peter Diettrich
to Mattias Gaertner: ? Hans-Peter Diettrich hat am 3. Februar 2011 um 14:16 geschrieben: Start the ide with…
Show quoted text 7 lines
> But what's missing then, when I cannot go to lower level source code in > the IDE? Currently I cannot follow the call chain (go to declaration) > into the win32 (target) specific source files. Can you be more specific? What find declaration does not work?

E.g. in CustomListView.inc:

TWSCustomListViewClass(WidgetSetClass).SetSort(Self, FSortType, FSortColumn)

I cannot navigate to SetSort. It works for TWSCustomListViewClass (found in WSComCtrls). In this case it may be the typecast that confuses the IDE. I'll report again, when I find an example without an typecast.

DoDi

Reply by email

Hans-Peter Diettrich
to Mattias Gaertner: ? Hans-Peter Diettrich hat am 3. Februar 2011 um 14:16 geschrieben: Start the ide with…
Show quoted text 7 lines
> How do I build a new IDE, without overwriting the old (working) one? First of all: Backup the working one. Backups are always a good idea. You can pass an -o option if you want.

Can you give an example?

I added -oL2.exe to the build options, but a Lazarus.new.exe was created. (built without "Restart after building...")

DoDi

Reply by email