Incorrect PPU file produced: CRC for a 'Use Unit' section wrongly stored into calling unit
Original Reporter info from Mantis: ChrisF
-
Reporter name:
Original Reporter info from Mantis: ChrisF
- Reporter name:
Description:
The PPU CRC value for a depending unit is wrongly stored into the PPU file calling this former unit.
Steps to reproduce:
-Start a new Lazarus/FPC project,
-add this declaration: 'uses IdStreamVCL;' into unit1.pas,
-put the attached files (i.e. IdStreamVCL.pas and other related files) into the project directory. These files are exactly the current concerned files of the Indy 10 package (i.e. Indy10_4967). Note that the IdStreamVCL.pas unit is referring to the IdGlobal.pas one,
-compile (clean compilation) the project,
-the CRC value stored in the IdStreamVCL.ppu file is not the correct value for the 'Use Unit' section concerning the IdGlobal.pas file.
Extracts of PPUDump reports:
----------------------------
Header for IdGlobal.ppu:
...
Checksum : 89F13836
Interface Checksum : B8501FC5
Indirect Checksum : B284D3D9
...
Data in IdStreamVCL.ppu:
...
Uses unit: IdGlobal (Crc: 16EB5A90, IntfcCrc: B8501FC5, IndCrc: B284D3D9)
...
Clearly, 89F13836 <> 16EB5A90 ! Though the other CRC values (Interface Checksum and Indirect Checksum) are always OK.
EDIT: Running several times this test gives -sometimes- a correct CRC value. If it's the case during the tests, try to recompile the whole project again (with a clean compile).
Additional information:
Trying to make a clean installation (i.e. without any errors) of one of the latest versions of the Indy package into Lazarus, turned rapidly into a nightmare (at least in Windows). Briefly, the package compilation is OK, but the reconstruction of the Lazarus IDE gives an error; it occurs when it tries to recompile again one of the file of the Indy package (which should be obviously unnecessary; the whole package compilation has been done just before).
The reason is the bug reported above. The IdStreamVCL.ppu obtained during the package compilation is incorrect, concerning the IdGlobal.pas dependency (as in my sample).
A few more pieces of information:
1/ The wrong CRC value is obtained only during the IdStreamVCL->IdGlobals compilation. If you try this declaration within the unit.pas sample project 'uses IdStreamVCL, IdGlobal;' for instance, the CRC value stored into the unit1.ppu file is OK:
Data in unit1.ppu:
...
Uses unit: IdGlobal (Crc: 89F13836, IntfcCrc: B8501FC5, IndCrc: B284D3D9)
....
2/ If you compile the IdGlobal.pas another way (and before the IdStreamVCL.pas compilation), this time the CRC value stored into the IdStreamVCL.ppu file is OK. For instance, with this declaration into the unit1.pas sample project: 'uses IdGlobal, IdStreamVCL;'. Curiously, the value stored into unit1.ppu file is also OK, though IdGlobal has been this time compiled during the unit1.pas compilation.
3/ The problem seems to be not relative to the main declaration file: replacing the '{I IdCompilerDefines.inc}' declaration into the IdStreamVCL.pas with a correct equivalence (i.e. '{
DEFINE STREAM_SIZE_64}'), or even with no define at all, gives exactly the same error (providing that the IsGlobal.pas file is still compiled during the compilation of the IdStreamVCL.pas file).
It's possible there is something wrong into the code of the IdStreamVCL.pas Indy unit: I've not really looked at it. Anyway, I can't imagine a good reason and/or situation to have such an improper CRC value when the whole compilation is OK (i.e. without any errors reported).
Mantis conversion info:
- Mantis ID: 24121
- OS: Windows
- OS Build: XP
- Platform: i386-win32
- Version: 2.6.2
- Fixed in version: 3.0.0
- Fixed in revision: 27192 (#1ac40211)
- Monitored by: » Vincent (Vincent Snijders)