Recent

Author Topic: Question about FPC and licensing  (Read 1199 times)

440bx

  • Hero Member
  • *****
  • Posts: 2365
Question about FPC and licensing
« on: April 15, 2021, 12:24:36 pm »
Hello,

Actually, I have a number of questions.  I believe that a little background will be helpful to understand the nature of the questions and what I'm thinking of doing.

Long ago (Win95 era) I wrote a little utility for myself to make Delphi 2 compile hundreds of programs (close to a thousand) just by dragging and dropping the "root" directory that contained all the programs each in their own subdirectory.  The utility simply walks the directories and does a full build of the program found in each directory.  Aside from the convenience of a single drag n drop operation to compile a large number of programs, the utility made compiling about twice as fast as it would normally be.  On an ancient machine (if memory serves, Celeron at 800 Mhz), that utility got Delphi 2 to compile a little over 10,000 lines per second, which is very useful when there are so many programs to compile/recompile.

One of the utility's characteristics is that it included a copy of Delphi 2 as a binary resource.  That way it was self contained.  Since it was (and still is) strictly for personal use, i.e, never distributed, that was not a problem.

The reason for this post is that I am considering creating a version of that utility for FPC and, I am also considering making the utility available to anyone who could benefit from it.

That brings up a licensing concern.  Specifically, the utility would have a copy of ppc386.exe and ppcrossx64.exe embedded as binary resources (untouched, exactly as they appeared in the FPC distribution, i.e, no customization of any kind in the source code nor the embedded binary.)  My first question is: would embedding those untouched, binary-only copies of FPC legally require that I make the utility's source code available ?  (I would definitely prefer not)

The other question is related to the exe sizes of ppc386.exe and ppcrossx64.exe.  together they weigh about 4.5 megabytes and, I was wondering if there are "Windows only" versions of them that are smaller ?  if the answer is "yes" where can I find them ?

Any and all information concerning the above is appreciated,

Thank you for your help.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 535
  • Professional amateur ;-P
Re: Question about FPC and licensing
« Reply #1 on: April 15, 2021, 12:37:55 pm »
Hey 440bx,

This may be a dumb question for lack of not knowing the big image and all that, but doesn't the compiler need the source files of the FLC,LCL, etc?
If you only bundle app and compiler, how are you gonna solve the issue of the missing source or *.ppu?
And if you encounter an *.lpi, wouldn't it make more sense to lazbuild it?

I'm sorry, it can be sleep deprivation induced, but this baffles me.

Cheers,
Gus
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

Thaddy

  • Hero Member
  • *****
  • Posts: 10784
Re: Question about FPC and licensing
« Reply #2 on: April 15, 2021, 12:45:39 pm »
This may be a dumb question for lack of not knowing the big image and all that, but doesn't the compiler need the source files of the FLC,LCL, etc?
If you only bundle app and compiler, how are you gonna solve the issue of the missing source or *.ppu
No, the compiler itself does not need any LCL files, only the rtl.

440bx

  • Hero Member
  • *****
  • Posts: 2365
Re: Question about FPC and licensing
« Reply #3 on: April 15, 2021, 12:51:26 pm »
doesn't the compiler need the source files of the FLC,LCL, etc?
It needs access to the compiled units that are not part of the project being compiled, e.g, Windows, Messages, etc.  That's not a problem, a configuration file takes care of that.

If you only bundle app and compiler, how are you gonna solve the issue of the missing source or *.ppu?
The compiler needs access to the .ppu of used units but not their source.  The location of .ppu/units can be configured.

And if you encounter an *.lpi, wouldn't it make more sense to lazbuild it?
the utility may have to parse .lpi and .lps files but, the utility can have its own global settings to apply to all the programs being recompiled. 

I'm sorry, it can be sleep deprivation induced, but this baffles me.
It might be time for you to consider getting some sleep. ;)
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 535
  • Professional amateur ;-P
Re: Question about FPC and licensing
« Reply #4 on: April 15, 2021, 01:03:48 pm »
Hey 440bx,

The compiler needs access to the .ppu of used units but not their source.  The location of .ppu/units can be configured.

Ahhh, this is beginning to make a lot more sense!!

Still one question though: What added value do you consider having a bundled compiler over just pointing at one in a config file?

the utility may have to parse .lpi and .lps files but, the utility can have its own global settings to apply to all the programs being recompiled.

In my humble opinion, I see this as re-inventing the wheel. So I ask again: What value are you adding that a simple config pointing to lazbuild wouldn't cover?

And I want to make this clear: I'm not trying to bring you down, I really am not.
It's just plain curiosity on your vision of the tool.

It might be time for you to consider getting some sleep. ;)

You are absolutely right. But I'm fighting it like a petulant child that doesn't wanna go to bed ;)

Cheers,
Gus
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

440bx

  • Hero Member
  • *****
  • Posts: 2365
Re: Question about FPC and licensing
« Reply #5 on: April 15, 2021, 01:16:46 pm »
Still one question though: What added value do you consider having a bundled compiler over just pointing at one in a config file?
Personally, I like turnkey solutions.  The more things a program depends on, the greater the likelyhood that something is going to go wrong.  If the program has no external dependencies, the more likely it is that it will operate reliably (reliability is very important.)

In my humble opinion, I see this as re-inventing the wheel. So I ask again: What value are you adding that a simple config pointing to lazbuild wouldn't cover?
As stated above, I want the utility to be fully self contained (or at least, as close as reasonably possible.) If that requires more work, I have no problem with that.

And I want to make this clear: I'm not trying to bring you down, I really am not.
It's just plain curiosity on your vision of the tool.
Don't worry about it.  Questions are good, makes me think about what has to be done and taken into consideration.

FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9336
  • FPC developer.
Re: Question about FPC and licensing
« Reply #6 on: April 15, 2021, 01:17:37 pm »
Strictly speaking, it depends on if the embedding is seen as a linking step. The compiler's license (GPL) talks about that.

I think it can be seen like that, so yes, that makes the combination subject to GPL.

But maybe there is some exception in the GPL details that I don't know about. But e.g. resources are not really a *nix concept, so I doubt it.

PascalDragon

  • Hero Member
  • *****
  • Posts: 3062
  • Compiler Developer
Re: Question about FPC and licensing
« Reply #7 on: April 15, 2021, 01:21:38 pm »
The other question is related to the exe sizes of ppc386.exe and ppcrossx64.exe.  together they weigh about 4.5 megabytes and, I was wondering if there are "Windows only" versions of them that are smaller ?  if the answer is "yes" where can I find them ?

There is no "Window only". Any compiler binary can generate code for any target that the compiler supports for its current processor architecture. And even if there were such: the part that is OS-specific inside the compiler is relatively small compared to the parser and the code generator.

440bx

  • Hero Member
  • *****
  • Posts: 2365
Re: Question about FPC and licensing
« Reply #8 on: April 15, 2021, 01:29:28 pm »
Strictly speaking, it depends on if the embedding is seen as a linking step. The compiler's license (GPL) talks about that.

I think it can be seen like that, so yes, that makes the combination subject to GPL.

But maybe there is some exception in the GPL details that I don't know about. But e.g. resources are not really a *nix concept, so I doubt it.
Is it the case that using a GPL'd library requires publishing the source of the application that uses it ?



There is no "Window only". Any compiler binary can generate code for any target that the compiler supports for its current processor architecture. And even if there were such: the part that is OS-specific inside the compiler is relatively small compared to the parser and the code generator.
Fair enough.  Thank you for providing that information.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9336
  • FPC developer.
Re: Question about FPC and licensing
« Reply #9 on: April 15, 2021, 01:55:52 pm »
Strictly speaking, it depends on if the embedding is seen as a linking step. The compiler's license (GPL) talks about that.

I think it can be seen like that, so yes, that makes the combination subject to GPL.

But maybe there is some exception in the GPL details that I don't know about. But e.g. resources are not really a *nix concept, so I doubt it.
Is it the case that using a GPL'd library requires publishing the source of the application that uses it ?

Yes, that is true, but there is one important exception, if the library comes with the OS. (the exact definition of "OS" is complex here, e.g. do linux packaging systems count?). So you can link to Linux GPL glibc without problems.

Note that the library case is dynamic linking, and the binary-into-exe is a form of static linking, so those two are not entirely the same.


ASBzone

  • Hero Member
  • *****
  • Posts: 613
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Question about FPC and licensing
« Reply #10 on: April 15, 2021, 05:16:10 pm »
That brings up a licensing concern.  Specifically, the utility would have a copy of ppc386.exe and ppcrossx64.exe embedded as binary resources (untouched, exactly as they appeared in the FPC distribution, i.e, no customization of any kind in the source code nor the embedded binary.)  My first question is: would embedding those untouched, binary-only copies of FPC legally require that I make the utility's source code available ?  (I would definitely prefer not)

Hey, @44bx:

You didn't mention if you had seen the following, but I think it is instructive as per your plans here:

https://wiki.freepascal.org/licensing

Particularly the section entitled "Licensing relating to FPC (the compiler)/Lazarus program (IDE) itself"

This line would seem to suggest that you should only call, rather than embed (unchanged or not), the compiler, in order to avoid GPL implications such as releasing your source:

So in short the GPL only applies if you try to integrate a core FPC binary (fpc.exe, ppudump.exe etc) into your application. Not if you merely call it. There is one unpleasant side detail though, see the Lazarus licensing section."

But, in my view, it does appear to make it clear that if you only called the executables in your program, no source would need to be provided at all.
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.0.13 r64843 / FPC v3.2.1-r49055 (via FpcUpDeluxe) -- Windows 64-bit install w/Win32 and Linux/Arm cross-compiles
Primary System: Windows 10 Pro x64, Version 2009 (Build 19042)
Other Systems: Windows 10 Pro x64, Version 2009 (Build 19042) or greater

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 535
  • Professional amateur ;-P
Re: Question about FPC and licensing
« Reply #11 on: April 16, 2021, 01:06:21 am »
Hey 440bx,

Personally, I like turnkey solutions.  The more things a program depends on, the greater the likelyhood that something is going to go wrong.  If the program has no external dependencies, the more likely it is that it will operate reliably (reliability is very important.)

That's a rather valid point and I'm now satisfied on your vision. So please plod on :)

Don't worry about it.  Questions are good, makes me think about what has to be done and taken into consideration.

Uuufff, thank you for understanding!!
As you may have noticed, I sometimes mess up my wording and it appears that I'm just dissing people.
I'm glad you got it :)

Cheers,
Gus
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 535
  • Professional amateur ;-P
Re: Question about FPC and licensing
« Reply #12 on: April 16, 2021, 01:13:24 am »
Hey 440bx,

After reading the answers on the licensing, I feel that your turnkey approach is gonna be hampered.

I would love to have such a tool available, mainly due to the batch processing and the problems you would need to solve.
Even if I couldn't study the source. Just having the possibility would be ace!

And it seems my suggestion of not bundling the compiler would be more suitable for your closed source needs...

Cheers,
Gus
Lazarus 2.1.0(trunk) FPC 3.3.1(trunk) Ubuntu 21.04 64b Dark Theme
Lazarus 2.0.12(stable) FPC 3.2.2(stable) Ubuntu 21.04 64b Dark Theme
http://github.com/gcarreno

440bx

  • Hero Member
  • *****
  • Posts: 2365
Re: Question about FPC and licensing
« Reply #13 on: April 16, 2021, 01:28:24 am »
You didn't mention if you had seen the following, but I think it is instructive as per your plans here:

https://wiki.freepascal.org/licensing

Particularly the section entitled "Licensing relating to FPC (the compiler)/Lazarus program (IDE) itself"

This line would seem to suggest that you should only call, rather than embed (unchanged or not), the compiler, in order to avoid GPL implications such as releasing your source:

So in short the GPL only applies if you try to integrate a core FPC binary (fpc.exe, ppudump.exe etc) into your application. Not if you merely call it. There is one unpleasant side detail though, see the Lazarus licensing section."

But, in my view, it does appear to make it clear that if you only called the executables in your program, no source would need to be provided at all.
I hadn't seen that but, this discussion has made it clear that the method I used for Delphi 2 is "questionable" as far as the GPL goes. 

Because of that, I'm going to play it safe and use a different method that doesn't run afoul of the GPL.  It will be a little more work but, it looks like it's worth it.  Keep my nose clean. :)

Thank you for pointing those things out.
FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

ASBzone

  • Hero Member
  • *****
  • Posts: 613
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Question about FPC and licensing
« Reply #14 on: April 16, 2021, 03:17:05 am »
I hadn't seen that but, this discussion has made it clear that the method I used for Delphi 2 is "questionable" as far as the GPL goes. 

Because of that, I'm going to play it safe and use a different method that doesn't run afoul of the GPL.  It will be a little more work but, it looks like it's worth it.  Keep my nose clean. :)

Thank you for pointing those things out.

You are most welcome.  Clean is definitely better here. 

I'm glad I could assist.  (I'm usually on the receiving side)  :D
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.0.13 r64843 / FPC v3.2.1-r49055 (via FpcUpDeluxe) -- Windows 64-bit install w/Win32 and Linux/Arm cross-compiles
Primary System: Windows 10 Pro x64, Version 2009 (Build 19042)
Other Systems: Windows 10 Pro x64, Version 2009 (Build 19042) or greater

 

TinyPortal © 2005-2018