Recent

Author Topic: Possible to use a Package without source (only ppu and .o)?  (Read 1757 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5963
    • wiki
Re: Possible to use a Package without source (only ppu and .o)?
« Reply #15 on: December 06, 2019, 10:43:07 pm »
If package X doesn't only depends on FPC, but also on Lazarus units (like lclintf), then that just means those ALSO compile those units with -Ur on both sides.
Well, the 3rd party offering the ppu can not affect this.
They can only build against whatever the Lazarus release contains.

LCLIntf is not build with -Ur
But....
If you build a project, or even your own package, then LCLIntf units are not rebuild. And fpc can not choose to do so. Fpc will not even see the LclIntf sources, Lazarus only hands over the path to the ppu of that package.

Fpc will only see a package pas sources, if that package is explicitly recompiled. (And if that happens, the -Ur is probably of little good, because the user wants it to happen).
Lazarus will recompile a package, if
- you choose so from the packages own window
- You explicitly choose "recompile parent packages" in a depended package,
- You build Lazarus with "all clean"
- You made changes to the source.

A simple patch eg. svn number change and a recompile can change this
Is a change to the source. It requires the rebuild, and therefore breaks the dependent ppu.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7934
Re: Possible to use a Package without source (only ppu and .o)?
« Reply #16 on: December 06, 2019, 11:15:53 pm »
If interface crc doesn't match between various imports of the ppu that will trigger a recompile unless -Ur.

af0815

  • Sr. Member
  • ****
  • Posts: 461
Re: Possible to use a Package without source (only ppu and .o)?
« Reply #17 on: December 08, 2019, 09:08:51 am »
can somebody give me an advice where the manual for the ppu format is .I searched with google, but all results are not useable for me. Maybe the wrong keywords :-)
regards
Andreas

PascalDragon

  • Hero Member
  • *****
  • Posts: 968
  • Compiler Developer
Re: Possible to use a Package without source (only ppu and .o)?
« Reply #18 on: December 08, 2019, 11:22:18 am »
In theory, you should be able to re-build the lazarus packages, and they should end up with the same checksums.
But I do not know the exact details on how fpc computes them.
I would guess that changing optimization level, if it for example changes inline-ability, could change the checksum. I also am not sure, which checksums must match interface, or also implementation....
The important part is the checksum of the interface. As long as a unit's interface section is not touched (that also includes units used in the implementation section, but not further down) and it's compiled with the same settings then the checksum should stay the same. That also allows patching function/method bodies.

Closed source packages should only be provided for release versions anyway and there patching shouldn't be necessary (and definitely shouldn't be done if it involves any interface section).

can somebody give me an advice where the manual for the ppu format is .I searched with google, but all results are not useable for me. Maybe the wrong keywords :-)
There is none.