[Lazarus] Packages can't compile - checksum changed error

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Thu Jun 25 12:41:09 CEST 2015


This is a odd one, but I'll try and explain as best I can.

This relates to the *.lpk packages in the tiOPF project. These packages
haven't changed for years. But in recent months they sometimes fail to
compile. I say sometimes, because it is very strange. On my native OSX
and FreeBSD systems the 'tiopflcl.lpk' package fails to compile, but in
my Linux and Windows VM that exact same package compiles without
problems. Same version of FPC and tiOPF.

I first thought it was related to the Build Modes & "Additions and
Overrides" changes, but the Linux VM that works is using a Lazarus v1.5
from 3 weeks ago.

I have two packages in the tiOPF project:

  tiOPF.lpk              // GUI independent code
  tiOPFLCL.lpk           // units that require LCL

Each package has a different unit output directory, and the second
package depends on the first package. What I find very weird (and
consider wrong) is that in my unit output directories I have duplicate
compiled units (units found in the first package). I would have expected
the second package to reuse the already compiled units from the first
package. The compiler options are matched exactly between packages.

ls ./Compilers/FPC/lib/x86_64-freebsd/lcl
./Compilers/FPC/lib/x86_64-freebsd -1 | sort | uniq -c | sort

      2 dzlib.o
      2 dzlib.ppu
      2 tiCompressZLib.o
      2 tiCompressZLib.ppu
      2 tiDataBuffer_BOM.o
      2 tiDataBuffer_BOM.ppu
      2 tiDataBuffer_Cli.o
      2 tiDataBuffer_Cli.ppu
      2 tiQueryCSV.o
      2 tiQueryCSV.ppu
      2 tiQueryDataset.o
      2 tiQueryDataset.ppu
      2 tiQuerySqldbIB.o
      2 tiQuerySqldbIB.ppu
      2 tiQuerySqldb.o
      2 tiQuerySqldb.ppu
      2 tiQueryTAB.o
      2 tiQueryTAB.ppu
      2 tiQueryTXTAbs.o
      2 tiQueryTXTAbs.ppu
      2 tiQueryXMLLight.o
      2 tiQueryXMLLight.ppu
      2 tiXML.o
      2 tiXML.ppu
      2 tiXMLToTIDataset.o
      2 tiXMLToTIDataset.ppu

So why the duplicate units? Obviously this is what causes the checksum
changed issue and ultimately makes FPC go pear shaped. But more puzzling
is why this confusion happens on some systems, but not on others.

I opened each package and clicked the "Show Options" button. Here are
the compiler settings for each package. As you can see, the second
package does include the unit output directory from the first package
(Compilers/FPC/lib/x86_64-freebsd), but why does it still decide to
recompile some units (duplicates shown above). I can also add that the
duplicates are only a subset of units found in the first package.

*****  tiOPF  *****
-MObjFPC -Scai -Cg -O1 -g -gl -l -vewnhibq -vm5024

*****  tiOPF+LCL  *****
-MObjFPC -Scai -Cg -O1 -g -gl -l -vewnhibq

Does anybody know what could be going wrong here? In help would be very
much appreciated. As a work around I used IDE Macros in my project,
instead of Lazarus Packages, then my project compiles just fine. The
other alternative is to create a new package just for my project that
contains all required tiOPF units in a single package, and not use the
packages included with tiOPF. Both workarounds are not ideal.

The problem doesn't occur just on my system. In the last week, somebody
else also reported this issue in the tiOPF newsgroups. They use Linux.
So the issue isn't even specific to OSX or FreeBSD either.

If you want to have a try at compiling these packages yourself, you can
grab a copy of the code via Git, or download a snapshot via SourceForge.

  git clone git://git.code.sf.net/p/tiopf/code tiopf


  via your web browser:

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the Lazarus mailing list