Recent

Author Topic: [SOLVED] Trying to install package without source code --> Checksum error...  (Read 8921 times)

bhreis88

  • New Member
  • *
  • Posts: 27
Hi all,

so I am trying to make a release version of my package. I have read a lot on the subject so far and tried to follow the instructions properly, specially from http://prezi.com/vpuyxca-qboq/how-to-create-a-closed-source-package-with-lazarus/ .

The code was written in Lazarus 1.2.0, i386-win32, fpc 2.6.2, Windows 7 32 bit.

But the binary version cannot be installed in any other computer unless first I install the package with the source code, uninstall it, and install again the package only with the binary files. Which is not useful.

The majority of the tests was done on another computer with exactly the same configuration (Lazarus 1.2.0, i386-win32, fpc 2.6.2, Windows 7 32 bit). But I've also tried on a Windows 8 64, with both Lazarus 1.2.2 and 1.2.4 i386-win32, and the result was the same: only possible after compiling once with the source code first.

With "-vut" activated, the error is like this:
Code: [Select]
.
.
.
Unitsearch: PbAbout.ppu
Unitsearch: PbAbout.pp
Unitsearch: PbAbout.pas
Unitsearch: C:\release_0707141543\bin\LAZ\lib\i386-win32\PbAbout.ppu
PPU Loading C:\release_0707141543\bin\LAZ\lib\i386-win32\PbAbout.ppu
(PBABOUT)  PPU Name: C:\release_0707141543\bin\LAZ\lib\i386-win32\PbAbout.ppu
(PBABOUT)  PPU Time: 2014/07/07 15:43:38
(PBABOUT)  PPU Flags: 741507
(PBABOUT)  PPU Crc: C0E63896
(PBABOUT)  PPU Crc: 1C86CAFE (intfc)
(PBABOUT)  PPU Crc: 1249ECCF (indc)
(PBABOUT)  Number of definitions: 66
(PBABOUT)  Number of symbols: 74
(PBABOUT)  PPU Source: PbAbout.pas not found
(PBABOUT)  PPU Source: compilers.inc not found
(PBABOUT)  Load from PBABOUT (interface) unit SYSTEM
(PBABOUT)  Adding dependency: PBABOUT depends on SYSTEM
(PBABOUT)  Load from PBABOUT (interface) unit OBJPAS
(PBABOUT)  Adding dependency: PBABOUT depends on OBJPAS
(PBABOUT)  Load from PBABOUT (interface) unit WINDOWS
(PBABOUT)  Adding dependency: PBABOUT depends on WINDOWS
(PBABOUT)  Load from PBABOUT (interface) unit LCLINTF
(PBABOUT)  Adding dependency: PBABOUT depends on LCLINTF
(PBABOUT)  Recompiling PbAbout, checksum changed for LCLIntf
Unitsearch: PbAbout.pp
Unitsearch: PbAbout.pas
Unitsearch: C:\lazarus\designer\PbAbout.pp
Unitsearch: C:\lazarus\designer\PbAbout.pas
Unitsearch: C:\lazarus\debugger\PbAbout.pp
Unitsearch: C:\lazarus\debugger\PbAbout.pas
Unitsearch: C:\lazarus\debugger\frames\PbAbout.pp
Unitsearch: C:\lazarus\debugger\frames\PbAbout.pas
.
.
.
Unitsearch: C:\lazarus\fpc\2.6.2\bin\i386-win32\PbAbout.pp
Unitsearch: C:\lazarus\fpc\2.6.2\bin\i386-win32\PbAbout.pas
PbAbout.pas(72,12) Fatal: Can not find PbAbout used by ssv1laz, ppu=C:\release_0707141543\bin\LAZ\lib\i386-win32\PbAbout.ppu, package ssv1laz

So I think the compiler tries to update the binary files because, in another Lazarus configuration, it finds mismatching dates between files PbAbout.ppu from my package and LCLIntf.ppu from target Lazarus installation. Of course it cannot compile without the source file PbAbout.pas and the installation stops.

I get the same error if I try to install the binary version from command line:
Code: [Select]
lazbuild --skip-dependencies --add-package ssv1laz.lpk --builde-ide=and even if I remove the unit LCLIntf from PbAbout.pas, when the message is:
Code: [Select]
(PBABOUT)  Recompiling PbAbout, checksum changed for LCLTypewhich is the same error for another necessary unit.

So what can be done about that? How to tell the compiler not to compile PbAbout.ppu if it finds an "old" LCLIntf.ppu? Shouldn't this be obvious, since "-Ur" is activated for the package?

Thanks for your time!
« Last Edit: July 11, 2014, 10:03:31 am by bhreis88 »

bhreis88

  • New Member
  • *
  • Posts: 27
Re: Trying to install package without source code --> Checksum error...
« Reply #1 on: July 10, 2014, 01:05:57 pm »
Updating...

I've discovered I can install the binary version, without the source code, on another machine running Lazarus 1.2.0, i386-win32, fpc 2.6.2, Win8-64, if first I rebuild the IDE with "Clean Up + Build all" + "Clean all" in Tools/Configure Build Lazarus ... .

Unfortunately it doesn't work if I do the same thing in the same target machine with Lazarus 1.2.2 or 1.2.4 and fpc 2.6.4. Even after recompiling the binary files with a brand new installation of Lazarus 1.2.2 or 1.2.4 and fpc 2.6.4 in the source code machine.

Any thoughts? Seriously, any idea is much welcome!

Cheers

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Trying to install package without source code --> Checksum error...
« Reply #2 on: July 10, 2014, 01:21:46 pm »
a unit must be compiled with a compatible compiler in order to be usable. Thus, if it's compiled with FPC 2.6.2, then using it in FPC 2.6.4 will result in PPU checksum error. This has been explained in the wiki: http://wiki.freepascal.org/Releasing_units_without_source_code

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Trying to install package without source code --> Checksum error...
« Reply #3 on: July 10, 2014, 01:23:54 pm »
The majority of the tests was done on another computer with exactly the same configuration (Lazarus 1.2.0, i386-win32, fpc 2.6.2, Windows 7 32 bit). But I've also tried on a Windows 8 64, with both Lazarus 1.2.2 and 1.2.4 i386-win32, and the result was the same: only possible after compiling once with the source code first.
AFAIR, the Lazarus wiki article on closed source ppus explicilty mentions that only the *exact same* Laz+FPC version is supported. No idea whether the article you linked to mentions that too.

Edit: Leledumbo was there first - what he said ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

bhreis88

  • New Member
  • *
  • Posts: 27
Re: Trying to install package without source code --> Checksum error...
« Reply #4 on: July 10, 2014, 03:27:57 pm »
Thank you very very much, Leledumbo and BigChimp!
It's great to finally have some clarity in this subject!

So it makes sense the need to use the exact same Laz+FPC version. But I have trouble accepting I need also the same OS in both machines, because my package did install in a Win8-64bit machine after compiling with Win7-32bit, both with Laz-1.2.0+FPC-2.6.2. .

I am testing a few more possibilities here and I'll soon post the results.  :D

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Trying to install package without source code --> Checksum error...
« Reply #5 on: July 10, 2014, 03:44:29 pm »
But I have trouble accepting I need also the same OS in both machines, because my package did install in a Win8-64bit machine after compiling with Win7-32bit, both with Laz-1.2.0+FPC-2.6.2. .
Who says you need the same OS? Leledumbo's link talks about the Target OS setting, not exact operating system.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Trying to install package without source code --> Checksum error...
« Reply #7 on: July 10, 2014, 05:32:40 pm »
Thank you very very much, Leledumbo and BigChimp!
It's great to finally have some clarity in this subject!

So it makes sense the need to use the exact same Laz+FPC version. But I have trouble accepting I need also the same OS in both machines, because my package did install in a Win8-64bit machine after compiling with Win7-32bit, both with Laz-1.2.0+FPC-2.6.2. .

I am testing a few more possibilities here and I'll soon post the results.  :D
You don't need to use the same OS, but you do need to compile the units for the target machine. You can't reuse i386-win32 compiled units for x86_64-win64 target.

bhreis88

  • New Member
  • *
  • Posts: 27
Re: Trying to install package without source code --> Checksum error...
« Reply #8 on: July 11, 2014, 10:02:37 am »
Who says you need the same OS? Leledumbo's link talks about the Target OS setting, not exact operating system.
Well, I guess I misunderstood this sentence: "The Target OS of the provided unit should match the target OS used for compiling the client program."

FYI, the Lazarus equivalent is here
http://wiki.lazarus.freepascal.org/Lazarus_Packages#Creating_a_closed_sourced_package
in case you haven't found it already
Yeah, this also helps!

You don't need to use the same OS, but you do need to compile the units for the target machine. You can't reuse i386-win32 compiled units for x86_64-win64 target.
So that's what my tests confirm. But there is also something else to consider that is missing from both links.

My tests show that I am able to install my closed source package regardless of OS differences between compiling and installing machines, as long as Laz+FPC are the same. But the catch is: if one has already rebuilt the IDE (for whatever reason) on the compiling machine, the target machine will only be able to install the package after (at least once) the target IDE is rebuilt too, even if Laz+FPC are the same. Otherwise, "checksum" error appears again!  :o

This is important because if the IDE in the compiling machine has never been rebuilt, the client can only use the compiled package if he/she never rebuilds the IDE too. Then there would be no stability to provide the package. After one little clean up in the client machine, no longer the package would be available.

So I guess that, to produce a safe release of the package, one must first rebuild its IDE (with clean up options activated) and after that compile the package. In this case, the provider of the package must also warn the client to do the same (at least once) before installing the package.

Bottom line is: perfectly possible to provide a closed source package with Lazarus (as expected) and my problem is SOLVED!  :D

So thank you very much Leledumbo and BigChimp one more time!

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Trying to install package without source code --> Checksum error...
« Reply #9 on: July 11, 2014, 10:13:36 am »
My tests show that I am able to install my closed source package regardless of OS differences between compiling and installing machines, as long as Laz+FPC are the same. But the catch is: if one has already rebuilt the IDE (for whatever reason) on the compiling machine, the target machine will only be able to install the package after (at least once) the target IDE is rebuilt too, even if Laz+FPC are the same. Otherwise, "checksum" error appears again!  :o
Mmmm... strange. Are you sure the settings used in recompiling the IDE are exactly those used for the original IDE (perhaps ppudump can give info on what settings were used, haven't looked into this kind of thing)?

Different settings would of course explain the need for rebuild...

Anyway, glad you got a solution!
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

ttomas

  • Full Member
  • ***
  • Posts: 245
You can check Raudus close source project and welding.exe tool to resolve checksum error on compiled units. It's some kind of hack compiled units.
http://forum.lazarus.freepascal.org/index.php?topic=20786.0
http://www.raudus.com/

bhreis88

  • New Member
  • *
  • Posts: 27
Mmmm... strange. Are you sure the settings used in recompiling the IDE are exactly those used for the original IDE (perhaps ppudump can give info on what settings were used, haven't looked into this kind of thing)?

Different settings would of course explain the need for rebuild...

Anyway, glad you got a solution!
Well, the thing is if I've made any changes they were done unconsciously and the same thing could happen to a regular user, which makes the release again unstable.
But if I am (or my boss is) still not satisfied about recompiling everything, I'll consider searching for ppudump and checking these peculiarities even further. Thanks again, man!

You can check Raudus close source project and welding.exe tool to resolve checksum error on compiled units. It's some kind of hack compiled units.
http://forum.lazarus.freepascal.org/index.php?topic=20786.0
http://www.raudus.com/
Also a good alternative in case I am not satisfied with recompiling. Thank you very much ttomas!

cbsistem

  • New Member
  • *
  • Posts: 39
Hello
Did you solve this problem?

Cristiano Barbosa

 

TinyPortal © 2005-2018