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

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Jun 25 13:05:41 CEST 2015


On Thu, 25 Jun 2015 11:41:09 +0100
Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:

>[...]
>   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.

If you let the compiler choose between source and ppu file it
often chooses source, because source rulez.

Make sure your packages have their own separate unit output directories
(separate from sources and from other packages) and that the second
package unit paths do not include any directories of the first package.
Lazarus adds the unit output directory automatically.
A normal package has only a "Unit output directory" and all other
paths are empty.


> 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.

Maybe a compiler bug.

 
> 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
> -Fi/data/devel/Wisa/fpcpackages/tiopf/Core
> -Fu/data/devel/Wisa/fpcpackages/tiopf/Core
> -Fu/data/devel/Wisa/fpcpackages/tiopf/Options
> -Fu/data/devel/Wisa/fpcpackages/tiopf/Compilers/FPC/
> -FU/data/devel/Wisa/fpcpackages/tiopf/Compilers/FPC/lib/x86_64-freebsd/
> -dLINK_CSV
> -dLINK_TAB
> -dLINK_FBLx
> -dLINK_SQLDB_IB
> -dLINK_SQLDB_PQx
> -dLINK_SQLDB_Oraclex
> -dLINK_SQLDB_SQLite3x
> -dLINK_SQLDB_ODBCx
> -dLINK_SQLDB_MySQL40x
> -dLINK_SQLDB_MySQL41x
> -dLINK_SQLDB_MySQL50x
> -dLINK_XMLLIGHT
> -dLINK_ZEOS_FBx
> -dUseCThreads
> 
> 
> *****  tiOPF+LCL  *****
> -MObjFPC -Scai -Cg -O1 -g -gl -l -vewnhibq
> -Fi/data/devel/Wisa/fpcpackages/tiopf/Core
> -Fu/data/devel/Wisa/fpcpackages/tiopf/Options

The above path is shared. If it contains source files, remove it.

> -Fu/data/devel/Wisa/fpcpackages/tiopf/GUI
> -Fu/data/devel/Wisa/fpcpackages/tiopf/GUI/LCL
> -Fu/data/devel/lazarus/packager/units/x86_64-freebsd
> -Fu/data/devel/Wisa/fpcpackages/tiopf/Compilers/FPC/lib/x86_64-freebsd
> -Fu/data/devel/lazarus/components/lazutils/lib/x86_64-freebsd
> -Fu/data/devel/lazarus/lcl/units/x86_64-freebsd
> -Fu/data/devel/lazarus/lcl/units/x86_64-freebsd/gtk2
> -Fu/data/devel/Wisa/fpcpackages/tiopf/Compilers/FPC/

And that one.

> -FU/data/devel/Wisa/fpcpackages/tiopf/Compilers/FPC/lib/x86_64-freebsd/lcl/
> -dLCL
> -dLCLgtk2
> -dUseCThreads
> 
> 
> Does anybody know what could be going wrong here? In help would be very
> much appreciated.

It's on my todo list to generate warnings, if packages share source
directories.
It is a common problem with "unit not found" messages, that users
starts *adding* search paths, instead of cleaning up.

> 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.

Agreed.

 
Mattias




More information about the Lazarus mailing list