Recent

Author Topic: Problem building runtime package on Lazarus 4.0 RC1 on macOS [SOLVED]  (Read 795 times)

carl_caulkett

  • Hero Member
  • *****
  • Posts: 649
* Mac Mini M1
* macOS 14.6.1
* Lazarus 3.99
* Lazarus 4.0 RC1
* FPC 3.3.1

I have a small runtime package which builds quite happily on Lazarus 3.99, but fails to build on Lazarus 4.0 RC1.
This is the offending line of code...
Code: Pascal  [Select][+][-]
  1. unit caEdit;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, StdCtrls, ExtCtrls;
  9.  

and this is the error message given...
Code: Pascal  [Select][+][-]
  1. caedit.pas(8,22) Error: Cannot find Forms used by caEdit, incompatible ppu=/Applications/Lazarus_4.0/lcl/units/aarch64-darwin/forms.ppu, package LCLBase
  2.  

Needless to say, this is a complete showstopper! Any ideas, anyone?
« Last Edit: October 28, 2024, 04:59:47 pm by carl_caulkett »
"It builds... ship it!"

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Incompatible ppu means that there somewhere is a ppu that was build by another fpc version (could even be an older 3.3.1).

That can happen if the path settings are wrong, and a unit is seen twice => generating 2 ppu for it in 2 different places. And then later only one gets replaced.

It could also be, that the package for some reason was not rebuild....

1) Try opening the package and click "Compile clean" (drop down at the end of the toolbar)

2) If that does not help:
Find all ppu for this file (or the entire package). Including any that may have gotten in the project folder (in this case IDE folder) or any other place. Or in different sub-folders of that package.
Delete all those ppu, and all there .o files.



If you found any ppu were they don't belong => then there is an issue with your path settings.

If you upgraded from an older 3.3.1 to a newer 3.3.1 => then it is probable that you need to clean build by yourself. For the IDE it probably (not sure) still is the same compiler. And the sources haven't changed, so the IDE wouldn't see a need to recompile.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 649
1) Try opening the package and click "Compile clean" (drop down at the end of the toolbar)

That didn't seem to help!

2) If that does not help:
Find all ppu for this file (or the entire package). Including any that may have gotten in the project folder (in this case IDE folder) or any other place. Or in different sub-folders of that package.
Delete all those ppu, and all there .o files.

I manually deleted (renamed) forms.ppu and forms.o. Now when I build the package I get...
Code: Pascal  [Select][+][-]
  1. caedit.pas(8,22) Error: Cannot find Forms used by caEdit. Check if package LCLBase creates Forms.ppu, check nothing deletes this file and check that no two packages have access to the unit source..
  2.  
"It builds... ship it!"

carl_caulkett

  • Hero Member
  • *****
  • Posts: 649
If you upgraded from an older 3.3.1 to a newer 3.3.1 => then it is probable that you need to clean build by yourself. For the IDE it probably (not sure) still is the same compiler. And the sources haven't changed, so the IDE wouldn't see a need to recompile.

Do you mean do a clean build of the package? Isn't that what you suggested before? "Try opening the package and click "Compile clean" (drop down at the end of the toolbar)"
"It builds... ship it!"

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
If you upgraded from an older 3.3.1 to a newer 3.3.1 => then it is probable that you need to clean build by yourself. For the IDE it probably (not sure) still is the same compiler. And the sources haven't changed, so the IDE wouldn't see a need to recompile.

Do you mean do a clean build of the package? Isn't that what you suggested before? "Try opening the package and click "Compile clean" (drop down at the end of the toolbar)"

Yes, but what I meant here was more: In general, whenever you upgrade fpc from git (keeping its version number) then you should do that for all of your code. Not just this package.

And I would even do that always when switching fpc in any way at all, even if the IDE normally detects that at least if the version of fpc changed.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 649
Yes, but what I meant here was more: In general, whenever you upgrade fpc from git (keeping its version number) then you should do that for all of your code. Not just this package.

And I would even do that always when switching fpc in any way at all, even if the IDE normally detects that at least if the version of fpc changed.

The only thing is that I copied the fpc, fpcbootstrap, ftppkgconfig and fpcsrc folders from my existing Lazarus 3.99 folder to my new Lazarus 4.0 folder, so fpc should be identical in both cases!

I was using an FpcUpDeluxe installed version of fpc 3.3.1 with Lazarus 3.99, in case I didn't mention it!
« Last Edit: October 28, 2024, 02:35:03 pm by carl_caulkett »
"It builds... ship it!"

carl_caulkett

  • Hero Member
  • *****
  • Posts: 649
I've just used FcpUpDeluxe to install a fresh fpc 3.3.1 in my Lazarus_4.0 folder. When I try to build the package in question, it still complains about the Forms unit, and presumably will also complain about the other units as well.
Code: Pascal  [Select][+][-]
  1. unit caEdit;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, StdCtrls, ExtCtrls;
  9.  

caedit.pas(8,22) Error: Cannot find Forms used by caEdit, incompatible ppu=/Applications/Lazarus_4.0/lcl/units/aarch64-darwin/forms.ppu, package LCLBase
"It builds... ship it!"

carl_caulkett

  • Hero Member
  • *****
  • Posts: 649
I'm up and running!

I went into Configure "Build Lazarus" and set the option to Clean All along with Switch after building to automatically, and kicked off the rebuild.

I had a slight hiccup when the rebuild failed because...
Code: Text  [Select][+][-]
  1. "svn2revisioninc" can't be opened because Apple cannot check it for malicious software.
  2. This software needs to be updated. Contact the developer for more information.
  3.  

but this was easily solved by opening the Svn2RevisionInc.lpi project in Lazarus 4.0 and building it.

The only slight problem is that the startlazarus loader doesn't seem to be working. It gives the error message...
Code: Text  [Select][+][-]
  1.  
  2. File not found
  3. Can't find the lazarus executable / Applications/Lazarus_4.0/ startlazarus.app/Contents/MacOS/ lazarus
  4.  

In normal circumstances, it doesn't matter because I normally use the lazarus.app bundle to launch Lazarus and all is well. It's just that the Rebuild Lazarus option seems to insist on calling the startlazarus loader.

@TRon said recently that... "btw it is advisable to run startlazarus instead of lazarus (but I do not know if the mac build creates startlazarus)." but given that it doesn't work for me, I'll stick to the lazarus.app bundle ;)

Thanks to @Martin_fr, who provided me with enough clues to enable me to figure it out 🙏🏽
« Last Edit: October 28, 2024, 05:03:10 pm by carl_caulkett »
"It builds... ship it!"

 

TinyPortal © 2005-2018