[fpc-pascal] When are used units recompiled? (wiki page added)
peter at freepascal.org
Fri Apr 7 10:24:59 CEST 2006
> On Thu, Apr 06, 2006 at 08:18:28AM +0200, Peter Vreman wrote:
>> > Apparently, there is a dependency on the System unit, and
>> > between System units can cause a recompile. Any other such
>> > Is every separately compiled unit dependent on System? If not, under
>> > what circumstances will it depend on System? And on what other units?
>> Units and programs always depend on System. It is the main unit where
>> the basic types are defined.
> I have added a page titled "Releasing units without source code" to
> the FreePascal Wiki (look under FPC).
> I (once more) propose to improve the message when the compiler attempts
> to recompile a unit because of an incompatible System unit, i.e. the
> message "Recompiling ..., checksum changed for System":
> It would certainly have helped me if the word "unit" was prepended to
> "System". Furthermore, the checksum did not "change" (there are two
> separate contexts; neither of which changed), but it differs from
> the one used to compile the unit being loaded. Thus, a better message
> might be: "checksum of current unit System differs from the one used
> to compile unit Fig0.ppu", or "unit Fig0.ppu was compiled with an
> incompatible System unit".
> Note: The two contexts are:
> * the compiler installation of the provider of the compiled unit
> * the compiler installation of the user of the compiled unit
> Should I put this message-improvement request in the bug reporter?
>> > That sounds rather vague. From my analysis above, it seems that
>> > your System unit will invalidate all (?) precompiled units (at least
>> > the ones that somehow "depend" on it). Or am I missing something
>> You are correct. That is the reason why it is recommended to use the
>> stable releases.
> This raises the concern that precompiled units become obsolete when
> the user of such a unit upgrades the compiler. The compiler apparently
> requires that the System unit of the precompiled unit and of the using
> program are IDENTICAL (which is enforced by the somewhat weaker check
> of comparing their checksums; but in practice that will have the same
> Thus, there is NO "backward compatibility". I would hope that IF the
> newer System unit provides at least the services of (and possibly
> more/better services than) the System unit used for compiling the
> provided unit, THEN the "by-now-aged" precompiled unit can still be used
> without having its sources. In the current situation, the provider of a
> precompiled unit needs to publish *.ppu and *.o files for ALL 'relevant'
> System units (and Target OSs, of course).
> This makes it much less attractive to release units without source
> code. That may be understandable from an open-source perspective,
> but in teaching I find it useful or even necessary to provide units
> without source code.
There is nothing different compared with TP / Delphi. The internal PPU
format is made for speed and contains direct references from one PPU to
another PPU. Incompatible PPUs can therefor never be used together.
The release of closed source PPUs need to be done on a per stable release.
Just like with delphi and tp7.
So please don't make a big issue out of this, the situation is still the
same as it was for the last 20+ years.
More information about the fpc-pascal