Sign in Join

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

Mailing lists / lazarus / 2012-01

Package depencies and order of compiling when building lazarus

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Ludo Brands

Hi,

I have made a typelib import utility (already in fpc trunk) and a freepascal implementation of a visual activeX container. I've made also a package that adds the ActiveX container component to the component tabs and that adds an "Import Type Library" menu item in the Project menu. All this works fine except for one problem: one of the options for importing a typelib is to create a package with the new ActiveX component. The importer will create the package, prompt for a directory to store the package and then open the new package. I have done this with a call to PkgBoss.DoOpenPackageFile. This needs BasePkgManager which is in the IDE package. So I have added IDE as dependency to my package. Now, when I upgrade the compiler and rebuild lazarus, my package is apparently build before the IDE package and the compiler wants to rebuild BasePkgManager but can't find the sources. Since IDE is a dependency for my package, I would expect IDE to be compiled before. I need to uninstall my package and whatever ActiveX component I have installed (they depend on my package), rebuild lazarus and then re-install the packages again. Am I doing something wrong? Is there another way to do this?

Thanks, Ludo

Reply by email

Mattias Gaertner
to Ludo Brands
Show quoted text 11 lines
Hi, I have made a typelib import utility (already in fpc trunk) and a freepascal implementation of a visual activeX container. I've made also a package that adds the ActiveX container component to the component tabs and that adds an "Import Type Library" menu item in the Project menu. All this works fine except for one problem: one of the options for importing a typelib is to create a package with the new ActiveX component. The importer will create the package, prompt for a directory to store the package and then open the new package. I have done this with a call to PkgBoss.DoOpenPackageFile. This needs BasePkgManager which is in the IDE package.

No. It needs unit PackageIntf from package IDEIntf. PackageEditingInterface.DoOpenPackageFile

So I have added IDE as dependency to my package.

I knew that this package would cause trouble.
This package is only for testing IDE features - for the IDE developers. Nothing in the ide package is supported and can change at any time. I will add a check, so that no package can be installed that uses the ide.lpk.

Show quoted text 8 lines
Now, when I upgrade the compiler and rebuild lazarus, my package is apparently build before the IDE package and the compiler wants to rebuild BasePkgManager but can't find the sources. Since IDE is a dependency for my package, I would expect IDE to be compiled before. I need to uninstall my package and whatever ActiveX component I have installed (they depend on my package), rebuild lazarus and then re-install the packages again. Am I doing something wrong? Is there another way to do this?

Mattias

Reply by email

Ludo Brands
to Mattias Gaertner
No. It needs unit PackageIntf from package IDEIntf. PackageEditingInterface.DoOpenPackageFile

OK, that works.
I didn't find any doc on this and the lazarus source uses PkgBoss to open a package. PackageIntf was already in use for the TPkgOpenFlag enum.

Show quoted text 10 lines
> So I have added IDE as > dependency to my package. I knew that this package would cause trouble. This package is only for testing IDE features - for the IDE developers. Nothing in the ide package is supported and can change at any time. I will add a check, so that no package can be installed that uses the ide.lpk.

Thanks a lot, Ludo

Reply by email

Mattias Gaertner
to Ludo Brands
Show quoted text 7 lines
> > No. It needs unit PackageIntf from package IDEIntf. > PackageEditingInterface.DoOpenPackageFile OK, that works. I didn't find any doc on this and the lazarus source uses PkgBoss to open a package. PackageIntf was already in use for the TPkgOpenFlag enum.

I added an example:
http://wiki.lazarus.freepascal.org/Extending_the_IDE#Open_a_package_file_.28lpk.29

Show quoted text 9 lines
> > > So I have added IDE as > > dependency to my package. > > I knew that this package would cause trouble. > This package is only for testing IDE features - for the IDE > developers. Nothing in the ide package is supported and can > change at any time. I will add a check, so that no package > can be installed that uses the ide.lpk.

The IDE now forbids to install it.

Mattias

Reply by email

Ludo Brands
to Mattias Gaertner
Show quoted text 6 lines
> I didn't find any doc on this and the lazarus source uses PkgBoss to open a > package. PackageIntf was already in use for the TPkgOpenFlag enum. I added an example: http://wiki.lazarus.freepascal.org/Extending_the_IDE#Open_a_pa

ckage_file_.28lpk.29

I think there is a typo in the example:
var
  p: TIDEPackage;
...
Pkg:=PackageEditingInterface.FindPackageWithName(ExtractFilenameOnly(LPKFile
name));

P != Pkg.

It's probably also worth mentioning that PackageIntf is in the package IDEIntf.

Show quoted text 11 lines
> > > So I have added IDE as > > dependency to my package. > > I knew that this package would cause trouble. > This package is only for testing IDE features - for the IDE > developers. Nothing in the ide package is supported and can > change at any time. I will add a check, so that no package > can be installed that uses the ide.lpk. The IDE now forbids to install it.

Thanks, Ludo

Reply by email

Marco van de Voort
to Mattias Gaertner: On Sat, 7 Jan 2012 15:21:08 +0100 No. It needs unit PackageIntf from package IDEIntf.…
Mattias Gaertner wrote 6 lines
I knew that this package would cause trouble. This package is only for testing IDE features - for the IDE developers. Nothing in the ide package is supported and can change at any time. I will add a check, so that no package can be installed that uses the ide.lpk.

Add "experimental" modifiers to such classes ?

Reply by email

Mattias Gaertner
to Marco van de Voort
Show quoted text 9 lines
On Sat, Jan 07, 2012 at 06:53:21PM +0100, Mattias Gaertner wrote: > > I knew that this package would cause trouble. > This package is only for testing IDE features - for the IDE developers. > Nothing in the ide package is supported and can change at any time. > I will add a check, so that no package can be installed that uses the > ide.lpk. Add "experimental" modifiers to such classes ?

What classes?

Mattias

Reply by email

Marco van de Voort
to Mattias Gaertner
Mattias Gaertner wrote 6 lines
> > I will add a check, so that no package can be installed that uses the > > ide.lpk. > > Add "experimental" modifiers to such classes ? What classes?

Classes in the IDE you don't want externally used. (because you want them to use them via *intf) And then see if you can surpress the warnings for the "regular" (within IDE) usage.

But it is just a wild idea, I haven't experimented with "experimental", except to check it gives a warning.

Reply by email

Mattias Gaertner
to Marco van de Voort
Show quoted text 11 lines
On Sun, Jan 08, 2012 at 08:05:11PM +0100, Mattias Gaertner wrote: > > > I will add a check, so that no package can be installed that uses the > > > ide.lpk. > > > > Add "experimental" modifiers to such classes ? > > What classes? Classes in the IDE you don't want externally used. (because you want them to use them via *intf) And then see if you can surpress the warnings for the "regular" (within IDE) usage.

Everything in IDEIntf can be used, the rest should not be used.

But it is just a wild idea, I haven't experimented with "experimental", except to check it gives a warning.

Mattias

Reply by email