Sign in Join

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

Mailing lists / lazarus / 2016-07

Package issues

12 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Werner Pamler

Package hell is back...

After somehow getting around the compilation issues with fpspreadsheet, not knowing how, I somehow ran into another trap with tvplanit. As you may know from the forum I am refurbishing the Turbo Power libraray VisualPlanIt for use in Lazarus.

At the moment there are three packages:

* laz_visualplanit.lpk: the main component package,
* laz_visualplanit_sqlite3.lpk: an extension with a datastore for sqlite3 (requires laz_visualplanit), and
* laz_visualplanit_zeos.lpk: another extension with a datastore for zeos database components (requires laz_visualplanit).

They share the same source folder, and compile into the same units folder - maybe this is a problem, but the same works for TAChart.

The three packages do compile fine separately. But the final step, installation into the IDE, crashes. Compilation of Lazarus stops in lazarus.lpi with the message

    "lazarus.pp(1,1) Fatal: Cannot find laz_visualplanit used by
    Lazarus, incompatible
    ppu=D:\Prog_Lazarus\svn\lazarus-ccr\components\tvplanit\packages\lib\i386-win32\laz_visualplanit.ppu,
    multiple packages: laz_visualplanit, laz_visualplanit_sqlite3".

Then I, blindly, erase folders with compiled units, do a clean rebuild, sometimes a normal rebuild. And all of a sudden, after some time, the compilation ends sucessfully. Since I am actively working with these components, however, I run into the same situation when I have to rebuild Lazarus again. At the moment to only way to get a working system it to remove the two dependent packages, laz_visialplanit_sqlite3 and laz_visualplanit_zeos, from the installation list. Therefore, I suspect that compiling all three packages into the same folder could be the culprit.

If somebody wants to see this by himself: the sources are in Lazarus-ccr, folder components/tvplanit. I hope the issue is reproducible on other systems...

Any idea?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160701/1dd55042/attachment.html>

Reply by email

Michael Van Canneyt
to Werner Pamler
Werner Pamler wrote 36 lines
Package hell is back... After somehow getting around the compilation issues with fpspreadsheet, not knowing how, I somehow ran into another trap with tvplanit. As you may know from the forum I am refurbishing the Turbo Power libraray VisualPlanIt for use in Lazarus. At the moment there are three packages: * laz_visualplanit.lpk: the main component package, * laz_visualplanit_sqlite3.lpk: an extension with a datastore for sqlite3 (requires laz_visualplanit), and * laz_visualplanit_zeos.lpk: another extension with a datastore for zeos database components (requires laz_visualplanit). They share the same source folder, and compile into the same units folder - maybe this is a problem, but the same works for TAChart. The three packages do compile fine separately. But the final step, installation into the IDE, crashes. Compilation of Lazarus stops in lazarus.lpi with the message "lazarus.pp(1,1) Fatal: Cannot find laz_visualplanit used by Lazarus, incompatible ppu=D:\Prog_Lazarus\svn\lazarus-ccr\components\tvplanit\packages\lib\i386-win32\laz_visualplanit.ppu, multiple packages: laz_visualplanit, laz_visualplanit_sqlite3". Then I, blindly, erase folders with compiled units, do a clean rebuild, sometimes a normal rebuild. And all of a sudden, after some time, the compilation ends sucessfully. Since I am actively working with these components, however, I run into the same situation when I have to rebuild Lazarus again. At the moment to only way to get a working system it to remove the two dependent packages, laz_visialplanit_sqlite3 and laz_visualplanit_zeos, from the installation list. Therefore, I suspect that compiling all three packages into the same folder could be the culprit.

You should never do this, it is bad practice.

I install all packages always in separate directories.

Did you try un-checking the option 'add package unit to uses section' ?

Michael.

Reply by email

Werner Pamler
to Michael Van Canneyt
Show quoted text 7 lines
You should never do this, it is bad practice. I install all packages always in separate directories. Did you try un-checking the option 'add package unit to uses section' ? Michael.

No, it does not help.

But keeping sources and compiled units folder apart, in fact, seems to resolve the issue. I followed the example of LazReport which consists of several packages as well, but every package has its own source and destination folders.

I still wonder why the IDE compiles correctly with TAChart - it constists of the main package TAChartLazarusPkg and several dependent packages such as TAChartWMF or TAChartFPVectorial. None of these has "Add package unit to uses section" unchecked. All sources and packages are in the same source folder and compile into the same destination folder. I never had any compilation issues with TAChart.

Reply by email

Michael Van Canneyt
to Werner Pamler
Werner Pamler wrote 22 lines
> You should never do this, it is bad practice. > > I install all packages always in separate directories. > > Did you try un-checking the option 'add package unit to uses section' ? > > Michael. No, it does not help. But keeping sources and compiled units folder apart, in fact, seems to resolve the issue. I followed the example of LazReport which consists of several packages as well, but every package has its own source and destination folders. I still wonder why the IDE compiles correctly with TAChart - it constists of the main package TAChartLazarusPkg and several dependent packages such as TAChartWMF or TAChartFPVectorial. None of these has "Add package unit to uses section" unchecked. All sources and packages are in the same source folder and compile into the same destination folder. I never had any compilation issues with TAChart.

Does tvplanit contain interdependent units ?
That could explain the problem.

Michael.

Reply by email

Luiz Americo Pereira Camara
to Werner Pamler: Package hell is back... After somehow getting around the compilation issues with…

2016-07-01 14:31 GMT-03:00 Werner Pamler :

Show quoted text 14 lines
Package hell is back... After somehow getting around the compilation issues with fpspreadsheet, not knowing how, I somehow ran into another trap with tvplanit. As you may know from the forum I am refurbishing the Turbo Power libraray VisualPlanIt for use in Lazarus. At the moment there are three packages: - laz_visualplanit.lpk: the main component package, - laz_visualplanit_sqlite3.lpk: an extension with a datastore for sqlite3 (requires laz_visualplanit), and

If you are using sqldb, no need to have a separated package since is already in the fcl/fpc and the library is loaded dynamically. Those that don't use sqlite3 will not be affected

Luiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160701/4fbcf9b1/attachment.html>

Reply by email

Mattias Gaertner
to Werner Pamler: Package hell is back... After somehow getting around the compilation issues with…
[...] They share the same source folder[...]

In general this won't work, because you risk that the compiler may recompile a ppu, invalidating a dependent ppu.
It works only in some special cases, for example
- if they do not use the same units
- or if they have different output directories and the packages are mutually exclusive

Show quoted text 10 lines
- maybe this is a problem, but the same works for TAChart. The three packages do compile fine separately. But the final step, installation into the IDE, crashes. Compilation of Lazarus stops in lazarus.lpi with the message "lazarus.pp(1,1) Fatal: Cannot find laz_visualplanit used by Lazarus, incompatible ppu=D:\Prog_Lazarus\svn\lazarus-ccr\components\tvplanit\packages\lib\i386-win32\laz_visualplanit.ppu, multiple packages: laz_visualplanit, laz_visualplanit_sqlite3".

Yes, the IDE even warns that the ppu has two creators.

Show quoted text 5 lines
Then I, blindly, erase folders with compiled units, do a clean rebuild, sometimes a normal rebuild. And all of a sudden, after some time, the compilation ends sucessfully. [...] Any idea?

With careful compilation order you can compile such a construct. But as soon as you change a uses clause you can get into trouble again. Solution: Either merge the packages or split the source directories.

Mattias

Reply by email

Mattias Gaertner
to Werner Pamler: What do you mean by "interdependent"? Circular dependence? No. laz_visualplanit is the…
Show quoted text 6 lines
> Does tvplanit contain interdependent units ? > That could explain the problem. > > Michael. What do you mean by "interdependent"? Circular dependence? No.

For example first package uses unit A, which uses unit B. So compiler creates a.ppu and b.ppu.
Second package uses only unit B. When the compiler recompiles unit B, the a.ppu can become invalid.

Mattias

Reply by email

Werner Pamler
to Mattias Gaertner: On Fri, 1 Jul 2016 21:34:12 +0200 Because these packages are mutually exclusive. You…
Mattias Gaertner wrote 11 lines
On Fri, 1 Jul 2016 21:34:12 +0200 Werner Pamler wrote: > [...] > I still wonder why the IDE compiles correctly with TAChart - it > constists of the main package TAChartLazarusPkg and several dependent > packages such as TAChartWMF or TAChartFPVectorial. Because these packages are mutually exclusive. You never use both in an application. Mattias

No. Why shouldn't it be possible to store a chart as wmf *AND* as svg?

Reply by email

Mattias Gaertner
to Werner Pamler
Show quoted text 13 lines
Am 02.07.2016 um 02:22 schrieb Mattias Gaertner: > On Fri, 1 Jul 2016 21:34:12 +0200 > Werner Pamler wrote: > >> [...] >> I still wonder why the IDE compiles correctly with TAChart - it >> constists of the main package TAChartLazarusPkg and several dependent >> packages such as TAChartWMF or TAChartFPVectorial. > Because these packages are mutually exclusive. You never use both in > an application. > > Mattias No. Why shouldn't it be possible to store a chart as wmf *AND* as svg?

You are right.
Probably it works because they both use TAChartLazarusPkg, which compiles all shared units, which pins the compilation order.

Mattias

Reply by email

Werner Pamler
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
You are right. Probably it works because they both use TAChartLazarusPkg, which compiles all shared units, which pins the compilation order. Mattias

Unless there's an unintentional usage of some unit, tvplanit should be the same. Anyway, it looks quite mysterious to me, and I think that TAChart could be a time-bomb leading once to the same issues. What's the opinion here to separate it into different folders as well, just to be on the safe side? It will force users of trunk to reinstall TAChart though.

Reply by email