[fpc-devel] strange error "checksum changed" in package, when compiling project.

Martin lazarus at mfriebe.de
Sun Oct 20 19:33:57 CEST 2013

On 20/10/2013 18:03, Jonas Maebe wrote:
> On 20 Oct 2013, at 18:52, Martin wrote:
>> On 20/10/2013 17:21, Jonas Maebe wrote:
>>> On 20 Oct 2013, at 17:30, Martin wrote:
>>>> Just checking, if there may be a simple fault on my side, or if I stumbled on a bug (fpc 2.6.2 and trunk (from a few weeks ago))
>>>> It happens with circular unit references via uses in implementation. (I know "not advisable design", but a valid language feature)
>>> http://lists.freepascal.org/lists/fpc-devel/2011-July/024974.html
>> Ok, thanks.
>> This at least helped me to get it working again. (I had to remove some "inline").
>> It still leaves me curious, how does an inline change the interface?
>> And does that mean it is considered a bug or not.
> http://bugs.freepascal.org/view.php?id=19673

Thanks again.

I see there are still open related issues, so maybe some hope...

> That is how the inlining is implemented by design currently. The 
> availability of an inline function body changes the unit interface 
> checksum, so that other units using that unit will be recompiled the 
> next time and can use the inline body (since the first time the inline 
> body was not yet available, it could not yet be inlined). 

I have a very limited understanding of this, but I think I disagree 
(well I do disagree, I think tha I am correct to do so...)

AFAIX, ppu already have more than one checksum?

Then it would just be a question to make that yet another checksum. And 
if *only* this new checksum has changed, then recompile *if* the source 
is available.
If not, than keep things as they are.

After all what seems to happen:

- PackageUnit1 uses PackageUnit2 via implementation
- PackageUnit2 use PackageUnit1

So PackageUnit2 compiles with the "no inline body" interface of 
PackageUnit1. Then PackageUnit1 changes.

Now if project uses PackageUnit2 then fpc wants to recompile it (because 
PackageUnit1 changed).
But since compiling the project, there are only the ppu avail, and no 
source, it can not recompile.

Yet PackageUnit2 is actually valid, it only misses an optimization, but 
it can be used as it is.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20131020/628a3947/attachment.html>

More information about the fpc-devel mailing list