Recent

Author Topic: Compiled package  (Read 3205 times)

Ed78z

  • Jr. Member
  • **
  • Posts: 82
Compiled package
« on: October 22, 2025, 06:05:24 am »
Is there any plan to have something like Delphi's BPL files but much better?
To share compiled custom components or codes easily and distribute the packages without sharing the source code?

Khrys

  • Sr. Member
  • ****
  • Posts: 391
Re: Compiled package
« Reply #1 on: October 22, 2025, 07:05:58 am »
There's a wiki entry on closed-source packages. Have you seen this?

cdbc

  • Hero Member
  • *****
  • Posts: 2616
    • http://www.cdbc.dk
Re: Compiled package
« Reply #2 on: October 22, 2025, 09:18:34 am »
Hi
@PascalDragon is working on it and I think @RuneWalsh' update/rewrite of the 'Heap-Manager', is contributing to make it happen sooner, rather than later... ;D
<spoiler> Suddenly I don't need 'sharemem' or 'cmem' to run my plugin-framework </spoiler>
Regards Benny
« Last Edit: October 22, 2025, 09:20:25 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

PascalDragon

  • Hero Member
  • *****
  • Posts: 6321
  • Compiler Developer
Re: Compiled package
« Reply #3 on: October 24, 2025, 10:57:52 pm »
@PascalDragon is working on it and I think @RuneWalsh' update/rewrite of the 'Heap-Manager', is contributing to make it happen sooner, rather than later... ;D

The heap manager has nothing to do with it.

cdbc

  • Hero Member
  • *****
  • Posts: 2616
    • http://www.cdbc.dk
Re: Compiled package
« Reply #4 on: October 25, 2025, 04:07:49 am »
Hi
Ok Sven/Sarah, thanks -- My bad  :-[ I surely didn't want to belittle your work.

It's just that I've noticed a change in the behavior regarding libraries, that makes things work, that (in my mind) shouldn't...?!? e.g.: managed types across app/library boundries :: Things that make you go Hmmmmm..... %)
...Oh well, I'll chalk it up to "Things I can't explain"  ;D
Regards Benny
« Last Edit: October 25, 2025, 04:11:30 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12645
  • FPC developer.
Re: Compiled package
« Reply #5 on: October 25, 2025, 12:58:32 pm »
Is there any plan to have something like Delphi's BPL files but much better?
To share compiled custom components or codes easily and distribute the packages without sharing the source code?

Even if FPC had something like Delphi's bpl, I doubt it would matter that much. Simply too many versions and platforms in circulation for that to be practical.

If you just look at the forum users, you see 3.2.2, 3.2.3, 3.2.4rc1 and various trunk versions in use.
« Last Edit: October 25, 2025, 01:15:26 pm by marcov »

Ed78z

  • Jr. Member
  • **
  • Posts: 82
Re: Compiled package
« Reply #6 on: November 29, 2025, 03:51:46 pm »
There's a wiki entry on closed-source packages. Have you seen this?


Thank you for your comment...
I've gathered a guide to do this task; see the attached files....
However, the main issue is: Lazarus is VERY strict about .ppu & .o files :(
Basically, we need to compile our component for each OS and Lazarus version!!!
I wish the Lazarus development team would add a universal solution for this feature in future updates....
Can they?!

Thaddy

  • Hero Member
  • *****
  • Posts: 18729
  • To Europe: simply sell USA bonds: dollar collapses
Re: Compiled package
« Reply #7 on: November 29, 2025, 04:09:35 pm »
Not even Delphi has achieved true version independence with their bpl format.
What makes you think otherwise?
Then again, you can put non-visual code inside shared libraries without much effort.
« Last Edit: November 29, 2025, 04:12:17 pm by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

Thaddy

  • Hero Member
  • *****
  • Posts: 18729
  • To Europe: simply sell USA bonds: dollar collapses
Re: Compiled package
« Reply #8 on: November 29, 2025, 04:40:48 pm »
I put copyright or other rights restricted code in dll' s or so's. Simple.These are always shareable, independent of version.
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

PascalDragon

  • Hero Member
  • *****
  • Posts: 6321
  • Compiler Developer
Re: Compiled package
« Reply #9 on: November 29, 2025, 04:41:43 pm »
However, the main issue is: Lazarus is VERY strict about .ppu & .o files :(
Basically, we need to compile our component for each OS and Lazarus version!!!
I wish the Lazarus development team would add a universal solution for this feature in future updates....
Can they?!

No, that simply does not work. Dynamic packages will only work with the exact same version of RTL and compiler, because these things depend on each other. For example if one version had a method Foo with an Integer argument, but the next version changed that to a enum, then things would crash, thus the compiler and RTL must make sure that it's not possible or at least not trivial to mix and match versions to avoid unnecessary support burden.
Also FPC compiles to binary code, so you simply can't use a binary compiled for platform X on platform Y (emulation doesn't count).

If you want Write Once, Run Anywhere then use something that's intended for that like Java, .NET or interpreted languages. FPC is Write Once, Compile Anywhere.

Ed78z

  • Jr. Member
  • **
  • Posts: 82
Re: Compiled package
« Reply #10 on: November 29, 2025, 05:28:43 pm »
I put copyright or other rights restricted code in dll' s or so's. Simple.These are always shareable, independent of version.

Now, I see what you mean, writing functions/procedure in a library (DLL) and use a wrapper in component with external reference to the DLL file.... yes, this way works but when component is mostly non-visual... This will not work for the highly visual components...unfortunately my components are heavily visual and it's almost impossible to convert them into DLL version...
It seems there is no solution as @PascalDragon said: FPC is Write Once, Compile Anywhere not Write Once, Run Anywhere!

Ed78z

  • Jr. Member
  • **
  • Posts: 82
Re: Compiled package
« Reply #11 on: December 03, 2025, 05:19:17 am »
I prepared an utility program to export and create library file for the non-visual parts of project, I called it MoveToDLL...
please test it... still needs some work ...

I don't have the Pascal Parser, but I guess the Lazarus development team can add a feature like my MoveToDLL to the Lazarus to save lots of times for the users...
Will they?! :)




Update: I just fixed some small bugs!
« Last Edit: December 04, 2025, 12:05:13 am by Ed78z »

PascalDragon

  • Hero Member
  • *****
  • Posts: 6321
  • Compiler Developer
Re: Compiled package
« Reply #12 on: December 04, 2025, 09:42:02 pm »
Will they?! :)

Why should we? The current solution works and the correct alternative is a work-in-progress.

Ed78z

  • Jr. Member
  • **
  • Posts: 82
Re: Compiled package
« Reply #13 on: December 04, 2025, 10:26:14 pm »
What's the alternative?

PascalDragon

  • Hero Member
  • *****
  • Posts: 6321
  • Compiler Developer
Re: Compiled package
« Reply #14 on: December 08, 2025, 11:04:05 pm »
Dynamic packages, which this thread is about after all?

 

TinyPortal © 2005-2018