Sign in Join

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

Mailing lists / lazarus / 2012-08

Components dcu?

19 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Chavoux Luyt

Hi guys

I remember reading a long time ago that Lazarus has to be rebuilt whenever a new component is added. I know that this is not necessary in Delphi. Can someone explain why? Or refer me to the right documentation (or code). Is this a FPC problem or Lazarus specific? What I really want to know is how much work is it going to be to get Lazarus to install new components without recompiling? If it is possible, I would like to help getting this to work in Lazarus. What magic is Delphi using? I assume that somehow Delphi dynamically link the .dcu object files?

Are there any open source IDE' s that can add new components without needing a rebuilt?

Thanks
Chavoux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120828/d16934d7/attachment.html>

Reply by email

Mattias Gaertner
to Chavoux Luyt

Chavoux Luyt hat am 28. August 2012 um 16:23 geschrieben:

Show quoted text 14 lines
Hi guys I remember reading a long time ago that Lazarus has to be rebuilt whenever a new component is added. I know that this is not necessary in Delphi. Can someone explain why? Or refer me to the right documentation (or code). Is this a FPC problem or Lazarus specific? What I really want to know is how much work is it going to be to get Lazarus to install new components without recompiling? If it is possible, I would like to help getting this to work in Lazarus. What magic is Delphi using? I assume that somehow Delphi dynamically link the .dcu object files? Are there any open source IDE' s that can add new components without needing a rebuilt?

Read this page first:
http://wiki.freepascal.org/packages

Mattias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120828/15ea5a0e/attachment-0001.html>

Reply by email

Graeme Geldenhuys
to Chavoux Luyt: Hi guys I remember reading a long time ago that Lazarus has to be rebuilt whenever a new…
Chavoux Luyt wrote
I remember reading a long time ago that Lazarus has to be rebuilt whenever a new component is added. I know that this is not necessary in Delphi.

As Mattias suggested, read the wiki page to fully understand the issue (or non-issue).

Coming from a Delphi background (where developers can't rebuild the IDE), it must sound like a daunting task, but it fact it is no different to compiling your own projects. Lazarus IDE even includes a menu item in the "Tools" menu to help facilitate the process. Once you have done it a handful of times, it becomes a no-brainer. Plus it's not like you install new components every day either.

Regards,
- Graeme -

Reply by email

Chavoux Luyt
to Graeme Geldenhuys

Thanks for the link guys!

Graeme Geldenhuys wrote 10 lines
As Mattias suggested, read the wiki page to fully understand the issue (or non-issue). Coming from a Delphi background (where developers can't rebuild the IDE), it must sound like a daunting task, but it fact it is no different to compiling your own projects. Lazarus IDE even includes a menu item in the "Tools" menu to help facilitate the process. Once you have done it a handful of times, it becomes a no-brainer. Plus it's not like you install new components every day either.

I read through the wiki, but it seems like they only discuss the possibilities. Nothing has been done yet? Do we actually know how Delphi did it (on the wiki it looks like we are still guessing)? I wrote a few components for Delphi and would like to import them into Lazarus. I just thought it would be nice to do it without needing to recompile Lazarus every-time (and if I made a stuff-up my whole IDE will not be dysfunctional).

Cheers
Chavoux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120828/60ea7b96/attachment.html>

Reply by email

Graeme Geldenhuys
to Chavoux Luyt
Chavoux Luyt wrote
I read through the wiki, but it seems like they only discuss the possibilities. Nothing has been done yet? Do we actually know how Delphi did it (on the wiki it looks like we are still guessing)?

It's not about "how Delphi did it" or "can FPC implement it", it is simply about Delphi doesn't overcome the same problem FPC faces. Delphi simply have the luck of the draw that there is no daily compiler or VCL snapshots, no builds between releases etc. So coding components for Delphi is easy, because you only target one compiler/vcl version per year.

With FPC and Lazarus, there is continuous development and most developers will use Lazarus directly from the code repositories. So even if FPC had "delphi package" support, with each new code revision those "delphi packages" would be broken, because the FPC (fixes branch) or Lazarus (fixes branch) will not be the same as the release branch.

Recompiling Lazarus IDE from a clean directory structure may take around a minute to complete. After that, there already exists *.ppu (compiled units) files, so only changed units are recompiled and the executable linked. So such secondary compiles take mere seconds - probably just as long as it would have taken to compile and install similar components in the Delphi IDE.

every-time (and if I made a stuff-up my whole IDE will not be dysfunctional).

That's not the end of the world, but I always make a backup of the lazarus executable before I do a rebuild. If the rebuild went horribly wrong for some reason, I simply revert my changes and copy back the old executable.

Regards,
- Graeme -

Reply by email

Sven Barth
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
On 28/08/12 16:45, Chavoux Luyt wrote: > I read through the wiki, but it seems like they only discuss the > possibilities. Nothing has been done yet? Do we actually know how Delphi > did it (on the wiki it looks like we are still guessing)? It's not about "how Delphi did it" or "can FPC implement it", it is simply about Delphi doesn't overcome the same problem FPC faces. Delphi simply have the luck of the draw that there is no daily compiler or VCL snapshots, no builds between releases etc. So coding components for Delphi is easy, because you only target one compiler/vcl version per year.

Let's not forget the point that this feature wants to be implemented at least for the major platforms Windows, Linux and Mac OS X...

Regards,
Sven

Reply by email

Hans-Peter Diettrich
to Sven Barth
Show quoted text 15 lines
On 28.08.2012 18:46, Graeme Geldenhuys wrote: > On 28/08/12 16:45, Chavoux Luyt wrote: >> I read through the wiki, but it seems like they only discuss the >> possibilities. Nothing has been done yet? Do we actually know how Delphi >> did it (on the wiki it looks like we are still guessing)? > > It's not about "how Delphi did it" or "can FPC implement it", it is > simply about Delphi doesn't overcome the same problem FPC faces. Delphi > simply have the luck of the draw that there is no daily compiler or VCL > snapshots, no builds between releases etc. So coding components for > Delphi is easy, because you only target one compiler/vcl version per > year. Let's not forget the point that this feature wants to be implemented at least for the major platforms Windows, Linux and Mac OS X...

That's why the Delphi IDE is bound to Windows. Even Kylix required Wine for the IDE. For other projects it's much easier to provide loadable package support, or to turn off "build with packages" for all platforms where it is not implemented.

DoDi

Reply by email

Michael Schnell
to Chavoux Luyt: Hi guys I remember reading a long time ago that Lazarus has to be rebuilt whenever a new…
Chavoux Luyt wrote
I remember reading a long time ago that Lazarus has to be rebuilt whenever a new component is added. I know that this is not necessary in Delphi.

Recompiling is just part of the normal process of installing a package that provides one or more visual components. I feel you hardly notice it if you don't look too close and just click OK. :-) .

So what is the problem ?

-Michael

Reply by email

Chavoux Luyt
to Michael Schnell

Hi Michael

Michael Schnell wrote 11 lines
On 08/28/2012 04:23 PM, Chavoux Luyt wrote: > I remember reading a long time ago that Lazarus has to be rebuilt > whenever a new component is added. I know that this is not necessary in > Delphi. > Recompiling is just part of the normal process of installing a package that provides one or more visual components. I feel you hardly notice it if you don't look too close and just click OK. :-) . So what is the problem ?

My real problem was getting my Delphi Components to work in Lazarus without breaking the whole IDE. It seems like the best thing to do is to just backup the lazarus executable before trying to add the new component?

Regards
Chavoux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120829/20bc5dd8/attachment-0001.html>

Reply by email

Mattias Gaertner
to Chavoux Luyt
Show quoted text 19 lines
Hi Michael On 29 August 2012 09:50, Michael Schnell wrote: > On 08/28/2012 04:23 PM, Chavoux Luyt wrote: > >> I remember reading a long time ago that Lazarus has to be rebuilt >> whenever a new component is added. I know that this is not necessary in >> Delphi. >> > Recompiling is just part of the normal process of installing a package > that provides one or more visual components. I feel you hardly notice it if > you don't look too close and just click OK. :-) . > > So what is the problem ? My real problem was getting my Delphi Components to work in Lazarus without breaking the whole IDE. It seems like the best thing to do is to just backup the lazarus executable before trying to add the new component?

Yes. The IDE creates one backup for you, named lazarus.old(.exe).

If you loose your backup executable:
You can build the default IDE without extra packages with: make clean all

Mattias

Reply by email

Michael Schnell
to Chavoux Luyt: Hi Michael My real problem was getting my Delphi Components to work in Lazarus without…
Chavoux Luyt wrote 5 lines
My real problem was getting my Delphi Components to work in Lazarus without breaking the whole IDE. It seems like the best thing to do is to just backup the lazarus executable before trying to add the new component?

(I suppose you do mean "Package" not "Component". )

AFAIK, this is not necessary..

If the new package does not compile the old IDE will be kept.

If it compiles, it is not used until you choose to use a component included in the new package. If you don't there is no reason for a crash.

-Michael

Reply by email

Graeme Geldenhuys
to Chavoux Luyt: Hi Michael My real problem was getting my Delphi Components to work in Lazarus without…
Chavoux Luyt wrote
My real problem was getting my Delphi Components to work in Lazarus without breaking the whole IDE.

The general rule of component development [even in Delphi], is to first test your component without installing it in the IDE. If it works, then register it with the IDE, and test again.

backup the lazarus executable before trying to add the new component?

+1

Graeme.

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 9 lines
On 29/08/12 10:21, Chavoux Luyt wrote: > > My real problem was getting my Delphi Components to work in Lazarus without > breaking the whole IDE. The general rule of component development [even in Delphi], is to first test your component without installing it in the IDE. If it works, then register it with the IDE, and test again.

Yes.

Also note, that most Lazarus packages don't need to be installed. You can simply use them in your project. No install and no IDE restart is required. You can even use packages with a different compiler, for example another version or when cross compiling.

Mattias

Reply by email

Kostas Michalopoulos
to Michael Schnell

I'd also like to see Lazarus supporting dynamically loaded components.

My biggest problem with the whole thing isn't recompiling lazarus (it takes a few seconds to a minute even in ages old computers), but implementing plugin systems that can use the GUI. In my 3D world editor ( http://chiselapp.com/user/badsector/repository/rtworld/home ) i'd like to have the sidebar contain panels and widgets registered by plugins at some point.

My current solution is to replicate most of LCL's common controls in a C friendly interface, expose that to plugins and recreate an API. This is tedious, error prone and at the end of the day i don't get to use Lazarus' strong point: its RAD GUI development features.

A "version independent" way for DLLs to communicate with each other and the main program should be implemented so that concerns like changing a minor version breaking all plugins wouldn't exist (obviously if a DLL needs a feature/method/property that doesn't exist in the main program it wont work, but the method should be at least backwards compatible).

Kostas "Bad Sector" Michalopoulos

Michael Schnell wrote 15 lines
On 08/29/2012 11:47 AM, Mattias Gaertner wrote: > > Also note, that most Lazarus packages don't need to be installed. I suppose the OP meant by "installing a component" "installing a package that contains a a visual component". -Michael -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Michael Schnell
to Kostas Michalopoulos
Kostas Michalopoulos wrote
I'd also like to see Lazarus supporting dynamically loaded components....

I understand in Delphi this is called "Runtime Package": a DLL that provides a standardized interface that is only usable with Delphi programs.

Of course this would be a nice addition to Lazarus, but it would need to support all available archs.

-Michael

Reply by email

Mattias Gaertner
to Michael Schnell

Michael Schnell hat am 29. August 2012 um 12:42

Kostas Michalopoulos wrote
> I'd also like to see Lazarus supporting dynamically loaded components.... > I understand in Delphi this is called "Runtime Package": a DLL that provides a standardized interface that is only usable with Delphi programs.

Do you mean "Runtime package" vs "Design time package"?

Of course this would be a nice addition to Lazarus, but it would need to support all available archs.

It should be written with x-platform in mind. It does not need to be supported on all available archs. If the first version only works on one of the major platforms it would be good enough for me to extend the IDE.

Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120829/1b558555/attachment.html>

Reply by email

Michael Schnell
to Mattias Gaertner
Mattias Gaertner wrote
Do you mean "Runtime package" vs "Design time package"?

Yep. (I'm not very deep into Delphi and never did such a thingy, yet)

Show quoted text 10 lines
> Of course this would be a nice addition to Lazarus, but it would need to > support all available archs. It should be written with x-platform in mind. It does not need to be supported on all available archs. If the first version only works on one of the major platforms it would be good enough for me to extend the IDE.

As you know I am always against tying functionality to GUI platforms. So I think this (if ever) should be implemented just based on the OS ("DLL" or "so", or whatever is provided on Mac and friends). Of course any supported GUI framework ("platform") needs top get working on top of that.

Anyway you are right that if it's not available for some of the supported archs, it does not harm that much.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120829/8be1bd0c/attachment-0001.html>

Reply by email

Sven Barth
to Michael Schnell
Michael Schnell wrote 12 lines
> > Of course this would be a nice addition to Lazarus, but it would > need to > > support all available archs. > > It should be written with x-platform in mind. It does not need to be > supported on all available archs. If the first version only works on > one of the major platforms it would be good enough for me to extend > the IDE. As you know I am always against tying functionality to GUI platforms. So I think this (if ever) should be implemented just based on the OS ("DLL" or "so", or whatever is provided on Mac and friends). Of course any supported GUI framework ("platform") needs top get working on top of that.

Of course it would be implemented based on the OS' capabilities and not based on the GUI. After all it has nothing to do with GUI just with the capability to have the class hierarchy (and code) distributed over multiple dynamically loadable files...

Regards,
Sven

Reply by email