Sign in Join

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

Mailing lists / lazarus / 2014-06

How to get rid of duplicate ppu?

9 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Giuliano Colla

Hi lazarus developers.

Since some time I get a number of annoying warning, whenever I re-compile Lazarus to include a package containing some customized components. Sort of:

The unit lazutf8sysutils exists twice in the unit path of the IDE:

1. "/usr/lib/lazarus/components/lazutils/lib/i386-linux/lazutf8sysutils.ppu"
2. "/home/colla/Applicazioni/Lazarus/Extra/lib/i386-/lazutf8sysutils.ppu"

Hint: Check if two packages contain a unit with the same name.

Of course I might select "Ignore All", but then I'd miss a real units conflict.

My components are derived from standard ones: I have a TButton1 derived from TButton, TLabel1 derived from TLabel, etc.
It happens that when compiling the package a number of standard units are compiled again, but ppu's go into my package's directory, so I get the same ppu's both in the standard lazarus tree, and in my package directory. This occurs both if the lazarus directory is writable, or not.

I tried to adjust search paths here and there, without success. Could someone point me to a "clean" solution to this issue?

Giuliano

Reply by email

Michael Van Canneyt
to Giuliano Colla
Giuliano Colla wrote 24 lines
Hi lazarus developers. Since some time I get a number of annoying warning, whenever I re-compile Lazarus to include a package containing some customized components. Sort of: The unit lazutf8sysutils exists twice in the unit path of the IDE: 1. "/usr/lib/lazarus/components/lazutils/lib/i386-linux/lazutf8sysutils.ppu" 2. "/home/colla/Applicazioni/Lazarus/Extra/lib/i386-/lazutf8sysutils.ppu" Hint: Check if two packages contain a unit with the same name. Of course I might select "Ignore All", but then I'd miss a real units conflict. My components are derived from standard ones: I have a TButton1 derived from TButton, TLabel1 derived from TLabel, etc. It happens that when compiling the package a number of standard units are compiled again, but ppu's go into my package's directory, so I get the same ppu's both in the standard lazarus tree, and in my package directory. This occurs both if the lazarus directory is writable, or not. I tried to adjust search paths here and there, without success. Could someone point me to a "clean" solution to this issue?

I think you need to add the necessary LCL, LCLBase package dependencies to your package ?

Michael.

Reply by email

Giuliano Colla
to Michael Van Canneyt

Il 11/06/2014 12:10, Michael Van Canneyt ha scritto:

Show quoted text 12 lines
On Wed, 11 Jun 2014, Giuliano Colla wrote: > Hi lazarus developers. > > Since some time I get a number of annoying warning, whenever I > re-compile Lazarus to include a package containing some customized > components. Sort of: > > The unit lazutf8sysutils exists twice in the unit path of the IDE: >

[..]

Show quoted text 6 lines
> I tried to adjust search paths here and there, without success. > Could someone point me to a "clean" solution to this issue? I think you need to add the necessary LCL, LCLBase package dependencies to your package ?

Unfortunately LCL dependency is there (lpk file attached). I tried to add also LCLBase, but it claims that LCL already has it. And the warning pops up nonetheless.

That's the full list of the ppu's I find in my package /lib/i386 directory:

Show quoted text 5 lines
avglvltree.ppu lazlogger.ppu masks.ppu QTraslate.ppu extra.ppu lazmethodlist.ppu QBitBtn1.ppu registerextra.ppu fileutil.ppu lazutf8.ppu qbutton1.ppu lazclasses.ppu lazutf8sysutils.ppu QGauge.ppu lazloggerbase.ppu lazutilsstrconsts.ppu qlabel1.ppu

Giuliano

-------------- next part --------------
A non-text attachment was scrubbed...
Name: extra.lpk
Type: text/lazarus-package
Size: 2534 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140611/75f6ebaa/attachment.bin>

Reply by email

Mattias Gaertner
to Giuliano Colla: Hi lazarus developers. Since some time I get a number of annoying warning, whenever I…
Show quoted text 9 lines
Hi lazarus developers. Since some time I get a number of annoying warning, whenever I re-compile Lazarus to include a package containing some customized components. Sort of: The unit lazutf8sysutils exists twice in the unit path of the IDE: 1. "/usr/lib/lazarus/components/lazutils/lib/i386-linux/lazutf8sysutils.ppu"

That's good.

2. "/home/colla/Applicazioni/Lazarus/Extra/lib/i386-/lazutf8sysutils.ppu"

That's wrong.
Please delete those ppu files and delete all unit search paths in your package.

The search paths are added by the IDE. You only need to add the LCL, SynEdit, ... to your dependencies.

Mattias

Reply by email

Mattias Gaertner
to Giuliano Colla: Il 11/06/2014 12:10, Michael Van Canneyt ha scritto: [..] Unfortunately LCL dependency is…
<OtherUnitFiles Value="$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS);$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType);$(LazarusDir)/components/codetools/units/$(TargetCPU)-$(TargetOS);$(LazarusDir)/components/custom;$(LazarusDir)/components/lazutils;$(LazarusDir)/packager/units/$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib/$(TargetCPU)-$(Target_OS)"/> <SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType);$(LazarusDir)/components/synedit;$(LazarusDir)/components/codetools"/>

Delete them all.

Use packages LCL and Codetools instead.

Mattias

Reply by email

Giuliano Colla
to Mattias Gaertner

Il 11/06/2014 16:11, Mattias Gaertner ha scritto:

Show quoted text 9 lines
On Wed, 11 Jun 2014 13:10:25 +0200 Giuliano Colla wrote: > <OtherUnitFiles Value="$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS);$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType);$(LazarusDir)/components/codetools/units/$(TargetCPU)-$(TargetOS);$(LazarusDir)/components/custom;$(LazarusDir)/components/lazutils;$(LazarusDir)/packager/units/$(TargetCPU)-$(TargetOS)"/> > <UnitOutputDirectory Value="lib/$(TargetCPU)-$(Target_OS)"/> > <SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType);$(LazarusDir)/components/synedit;$(LazarusDir)/components/codetools"/> Delete them all. Use packages LCL and Codetools instead.

Thanks a lot.

Giuliano

Reply by email

Michael Van Canneyt
to Mattias Gaertner: On Wed, 11 Jun 2014 13:10:25 +0200 Delete them all. Use packages LCL and Codetools…
Mattias Gaertner wrote 10 lines
On Wed, 11 Jun 2014 13:10:25 +0200 Giuliano Colla wrote: > <OtherUnitFiles Value="$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS);$(LazarusDir)/lcl/units/$(TargetCPU)-$(TargetOS)/$(LCLWidgetType);$(LazarusDir)/components/codetools/units/$(TargetCPU)-$(TargetOS);$(LazarusDir)/components/custom;$(LazarusDir)/components/lazutils;$(LazarusDir)/packager/units/$(TargetCPU)-$(TargetOS)"/> > <UnitOutputDirectory Value="lib/$(TargetCPU)-$(Target_OS)"/> > <SrcPath Value="$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType);$(LazarusDir)/components/synedit;$(LazarusDir)/components/codetools"/> Delete them all. Use packages LCL and Codetools instead.

Maybe the IDE should check whether one of the paths points to the sources directory of a known package. If so, it could offer to replace the path with a dependency of the package.

It happened not once that I saw a project where the author put explicitly the path to an existing package. The fix has always been to do as I described above...

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Show quoted text 5 lines
On Wed, 11 Jun 2014, Mattias Gaertner wrote: [...] Maybe the IDE should check whether one of the paths points to the sources directory of a known package.

The IDE now shows warnings for these cases.

If so, it could offer to replace the path with a dependency of the package.

Good idea.
Because of macros it can be tricky to find out, which path has added the directory. For some common cases it is possible. I added todos.

It happened not once that I saw a project where the author put explicitly the path to an existing package.

I saw. Some people just don't like packages.

The fix has always been to do as I described above...

That's one half of the fix.
The other is to explain to the user that packages are compiled separately, that fpc creates ppu files, which are like caches and duplicate caches are a mess.

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 22 lines
On Wed, 11 Jun 2014 17:06:49 +0200 (CEST) Michael Van Canneyt wrote: > > > On Wed, 11 Jun 2014, Mattias Gaertner wrote: > [...] > Maybe the IDE should check whether one of the paths points to the sources directory of a known package. The IDE now shows warnings for these cases. > If so, it could offer to replace the path with a dependency of the package. Good idea. Because of macros it can be tricky to find out, which path has added the directory. For some common cases it is possible. I added todos. > It happened not once that I saw a project where the author put explicitly the path to an existing package. I saw. Some people just don't like packages.

A pity, because Lazarus handles packages really SO much better than Delphi :(

Show quoted text 6 lines
> The fix has always been to do as I described above... That's one half of the fix. The other is to explain to the user that packages are compiled separately, that fpc creates ppu files, which are like caches and duplicate caches are a mess.

Indeed. I never thought of it as a cache, but you are right.

Michael.

Reply by email