Recent

Author Topic: Checksum changed, unit not found - packages required by packages  (Read 464 times)

CCRDude

  • Hero Member
  • *****
  • Posts: 596
I have written and packages some interfacing units to standardize access. E.g.:
JSON: access through FCL, but also through other libraries, e.g. the Leonin Koninin one.
HTTPS: access through Synapse, but also Indy 10.

I've created a package with the base class and the standard implementation, e.g. JSON & FCL, HTTPS & Synapse.
Then I've created an additional package for LKJSON, requiring the base package.
And one for Indy 10, requiring the base package.

JSON works fine, https causes this:

Quote
Verbose: PPU Loading D:\Development\Packages\firefly-layers\lib\i386-win32-package-transport\Layers.Transport.Synapse.ppu
Verbose: PPU Source: Layers.Transport.Synapse.pas not found
Warning: Recompiling Layers.Transport.Synapse, checksum changed for D:\Development\Packages\firefly-layers\lib\i386-win32-package-transport-indy10\Layers.Transport.Debugger.List.ppu
Fatal: Can't find unit Layers.Transport.Synapse used by SafeBrowsingTest.UI.FormMain
Verbose: Compilation aborted

The missing unit is only the the base package (and only in its lib path). It exists in that folder.
The "checksum changed" unit is, in compiled form, in both lib paths. Same size, different hash because of different bytes in the header.

How can I avoid this?
Not having the standard solution in the base package probably would not help, because in my test code, I have two different implementations to be able to run all code tests, for example.

Why does a packages lib folder include files from a required package?

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: Checksum changed, unit not found - packages required by packages
« Reply #1 on: April 01, 2023, 08:28:39 pm »
I assumed this is an "in search path issue", and separated abstract base class from actual implementations, both by package and path. This helped :)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Checksum changed, unit not found - packages required by packages
« Reply #2 on: April 01, 2023, 10:05:39 pm »
This error can sometimes happen when
1) units using each other circular.
2) Those units have inlined procedures

In that case it's a bug in the compiler. Sometimes it works if you build the package clean. If not, then remove the inlines.

 

TinyPortal © 2005-2018