[Lazarus] Build Lazarus with Clean all - cleaning packages
cobines
cobines at gmail.com
Sat Oct 29 22:25:22 CEST 2011
2011/10/29 Mattias Gaertner <nc-gaertnma at netcologne.de>:
> On Sat, 29 Oct 2011 21:09:50 +0200
> cobines <cobines at gmail.com> wrote:
>
>> Shouldn't the package files be rebuilt automatically?
>
> Yes. They are. The IDE even add the -B option if needed.
> But there are some corner cases.
>
....
>
> It does work in normal cases.
When package is built even manually, from the IDE or using lazbuild
not all files are rebuilt. I think it is FPC issue because it doesn't
always work with 2.4.4 but it does with 2.5.1 and 2.7.1.
I'll put things into example.
I have virtualtreeview installed. In the package there is
VTHeaderPopup that uses VirtualTrees and VirtualTrees that uses
Controls (from LCL). I introduce a new function:
function TControl.AutoSizeSomething: Boolean; virtual;
begin
Result := True;
end;
I change TControl.AutoSizeDelayedHandle:
begin
- Result := (Parent = nil);
+ Result := (Parent = nil) and AutoSizeSomething;
end;
so that the function is used somewhere.
I clean virtualtreeview manually, open the .lpk press compile. The
VTHeaderPopup.o contains ...AUTOSIZESOMETHING symbol.
I rename AutoSizeSomething -> AutoSizeNothing.
I open the virtualtreeview.lpk and press Compile. It rebuilds LCLBase,
LCL and virtualtreeview. The VirtualTrees unit is rebuilt and now
contains AUTOSIZENOTHING but the VTHeaderPopup unit is not rebuilt, it
still contains AUTOSIZESOMETHING, so linking IDE would fail because
cannot find the symbol. If from the package editor I choose
"More/Recompile all required" then VTHeaderPopup is rebuilt (maybe
adds -B?).
But like I said the problem seems to be gone starting with FPC 2.5.1,
so as long as files are added to .lpk they should be rebuilt. The
reason for cleaning might be when source files are not in .lpk or have
been deleted but the *.ppu and *.o still exist.
--
cobines
More information about the Lazarus
mailing list