[fpc-pascal] When are used units recompiled? (wiki page added)

Tom Verhoeff T.Verhoeff at tue.nl
Thu Apr 6 22:59:06 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 incompatibility
> > between System units can cause a recompile.  Any other such dependencies?
> > 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 all
> 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 updating
> > your System unit will invalidate all (?) precompiled units (at least
> > the ones that somehow "depend" on it).  Or am I missing something here?
> 
> 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
effect).

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.

	Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL     | Fac. of Math. & Computing Science
PHONE:  +31 40 247 41 25        | Eindhoven University of Technology
FAX:    +31 40 247 54 04        | PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands



More information about the fpc-pascal mailing list