Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2023-12

Lazarus 2.2.6 on Raspberry Pi5B, error during build

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I am setting up my new RPi3B with 64 bit Pi-OS Bookworm and have now come to FreePascal/Lazarus.

Freepascal is built from sources (trunk of 3.2.3) using a seed compiler 3.2.2 earlier obtained as an apt install on an RPi4B also running Pi-OS 64 bit Bookworm.

On this new system I want to build from sources to get everything inside my $HOME environment. That is why I did not install fpc 3.2.2 via apt. Fpc built just fine with these sources so that is how I got 3.2.3.

Note that I am using fpc 3.2.3 head revision on this system since no other version seems to be possible to build on the 64 bit Pi-OS. But that version builds without problems.

So I am using the self-compiled fpc 3.2.3 to build Lazarus 2.2.6 and it fails during build with the following exit message (only end of output shown):

make bigide....

(9009) Assembling translations
(3104) Compiling uitypes.pas
/home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas(105,14) Error: (3285) Expected another 2 array elements
/home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas(93,58) Fatal: (10026) There were 1 errors compiling module, stopping Fatal: (1018) Compilation aborted
make[1]: *** [Makefile:3394: lazutils.ppu] Error 1 make[1]: Leaving directory
'/home/bosse/devtools/lazarus/2.2.6/components/lazutils' make: *** [Makefile:3802: lazutils] Error 2

This is how the file looks like at the location indicated:

62 interface
63
64 type
65 // Message dialog related
66 TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom);
67 TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, 68 mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose); 69 TMsgDlgButtons = set of TMsgDlgBtn;
70
71 // ModalResult
72 TModalResult = low(Integer)..high(Integer);
73 PModalResult = ^TModalResult;
74
75 const
76 // Used for ModalResult
77 mrNone = 0;
78 mrOK = mrNone + 1;
79 mrCancel = mrNone + 2;
80 mrAbort = mrNone + 3;
81 mrRetry = mrNone + 4;
82 mrIgnore = mrNone + 5;
83 mrYes = mrNone + 6;
84 mrNo = mrNone + 7;
85 mrAll = mrNone + 8;
86 mrNoToAll = mrNone + 9;
87 mrYesToAll = mrNone + 10;
88 mrClose = mrNone + 11;
89 mrLast = mrClose;
90 {$ENDIF}
91
92 // String representation of ModalResult values 93 ModalResultStr: array[mrNone..mrLast] of shortstring = ( 94 'mrNone',
95 'mrOk',
96 'mrCancel',
97 'mrAbort',
98 'mrRetry',
99 'mrIgnore',
100 'mrYes',
101 'mrNo',
102 'mrAll',
103 'mrNoToAll',
104 'mrYesToAll',
105 'mrClose');
106
107

To me it seems like the number of elements is not in error...

What can cause this failure and how can I solve it?

Bo Berglund Developer in Sweden

Reply by email

Maxim Ganetsky
to Bo Berglund

10.12.2023 19:51, Bo Berglund via lazarus ?????:

Show quoted text 16 lines
I am setting up my new RPi3B with 64 bit Pi-OS Bookworm and have now come to FreePascal/Lazarus. Freepascal is built from sources (trunk of 3.2.3) using a seed compiler 3.2.2 earlier obtained as an apt install on an RPi4B also running Pi-OS 64 bit Bookworm. [...] Note that I am using fpc 3.2.3 head revision on this system since no other version seems to be possible to build on the 64 bit Pi-OS. But that version builds without problems. So I am using the self-compiled fpc 3.2.3 to build Lazarus 2.2.6 and it fails during build with the following exit message (only end of output shown):

This combination of FPC and Lazarus won't work. You should use head revisions of Lazarus from `fixes_3_0` or `main` branches? if you want use FPC 3.2.3 and up.

Show quoted text 15 lines
make bigide.... (9009) Assembling translations (3104) Compiling uitypes.pas /home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas(105,14) Error: (3285) Expected another 2 array elements /home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas(93,58) Fatal: (10026) There were 1 errors compiling module, stopping Fatal: (1018) Compilation aborted make[1]: *** [Makefile:3394: lazutils.ppu] Error 1 make[1]: Leaving directory '/home/bosse/devtools/lazarus/2.2.6/components/lazutils' make: *** [Makefile:3802: lazutils] Error 2 [...]
Best regards, Maxim Ganetsky mailto:

Reply by email

Mehmet Erol Sanliturk
to Bo Berglund: I am setting up my new RPi3B with 64 bit Pi-OS Bookworm and have now come to…

There is a statement

90 {$ENDIF}

Its outside of {$IFDEF } is not listed .

It is very likely that

mrNone..mrLast

values are defined outside of ( IFDEF , ENDIF ) pairs .

Mehmet Erol Sanliturk

On Sun, Dec 10, 2023 at 7:59?PM Bo Berglund via lazarus <

Show quoted text 106 lines
wrote: I am setting up my new RPi3B with 64 bit Pi-OS Bookworm and have now come to FreePascal/Lazarus. Freepascal is built from sources (trunk of 3.2.3) using a seed compiler 3.2.2 earlier obtained as an apt install on an RPi4B also running Pi-OS 64 bit Bookworm. On this new system I want to build from sources to get everything inside my $HOME environment. That is why I did not install fpc 3.2.2 via apt. Fpc built just fine with these sources so that is how I got 3.2.3. Note that I am using fpc 3.2.3 head revision on this system since no other version seems to be possible to build on the 64 bit Pi-OS. But that version builds without problems. So I am using the self-compiled fpc 3.2.3 to build Lazarus 2.2.6 and it fails during build with the following exit message (only end of output shown): make bigide.... (9009) Assembling translations (3104) Compiling uitypes.pas /home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas(105,14) Error: (3285) Expected another 2 array elements /home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas(93,58) Fatal: (10026) There were 1 errors compiling module, stopping Fatal: (1018) Compilation aborted make[1]: *** [Makefile:3394: lazutils.ppu] Error 1 make[1]: Leaving directory '/home/bosse/devtools/lazarus/2.2.6/components/lazutils' make: *** [Makefile:3802: lazutils] Error 2 This is how the file looks like at the location indicated: 62 interface 63 64 type 65 // Message dialog related 66 TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom); 67 TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, 68 mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose); 69 TMsgDlgButtons = set of TMsgDlgBtn; 70 71 // ModalResult 72 TModalResult = low(Integer)..high(Integer); 73 PModalResult = ^TModalResult; 74 75 const 76 // Used for ModalResult 77 mrNone = 0; 78 mrOK = mrNone + 1; 79 mrCancel = mrNone + 2; 80 mrAbort = mrNone + 3; 81 mrRetry = mrNone + 4; 82 mrIgnore = mrNone + 5; 83 mrYes = mrNone + 6; 84 mrNo = mrNone + 7; 85 mrAll = mrNone + 8; 86 mrNoToAll = mrNone + 9; 87 mrYesToAll = mrNone + 10; 88 mrClose = mrNone + 11; 89 mrLast = mrClose; 90 {$ENDIF} 91 92 // String representation of ModalResult values 93 ModalResultStr: array[mrNone..mrLast] of shortstring = ( 94 'mrNone', 95 'mrOk', 96 'mrCancel', 97 'mrAbort', 98 'mrRetry', 99 'mrIgnore', 100 'mrYes', 101 'mrNo', 102 'mrAll', 103 'mrNoToAll', 104 'mrYesToAll', 105 'mrClose'); 106 107 To me it seems like the number of elements is not in error... What can cause this failure and how can I solve it? -- Bo Berglund Developer in Sweden -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20231210/dc1b2f34/attachment-0001.htm>

Reply by email

Bo Berglund
to Maxim Ganetsky: 10.12.2023 19:51, Bo Berglund via lazarus ?????: This combination of FPC and Lazarus…
Maxim Ganetsky wrote 5 lines
> So I am using the self-compiled fpc 3.2.3 to build Lazarus 2.2.6 and it fails > during build with the following exit message (only end of output shown): This combination of FPC and Lazarus won't work. You should use head revisions of Lazarus from `fixes_3_0` or `main` branches? if you want use FPC 3.2.3 and up.

Well, the failed test *was* with FPC compiled from sources with last change date on github a week ago, i.e. head I believe...

I have not been able to build anything else on this 64 bit machine.

But I gave up and used apt to install fpc 3.2.2:
sudo apt install fpc

After removing the symlinks to the self-compiled fpc version I could use the apt retrieved compiler and then Lazarus built to the end and is now running fine.

But going forward I don't know how to handle future upgrades to the compiler. Will Lazarus complain if I get the next version of fpc to my system via a normal update/upgrade cycle? Since it is done by apt it may well change in the future without me noting.

Or do I have to reconfigure something at that time?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Mehmet Erol Sanliturk: There is a statement 90 {$ENDIF} Its outside of {$IFDEF } is not listed . It is very…
Mehmet Erol Sanliturk wrote 11 lines
There is a statement 90 {$ENDIF} Its outside of {$IFDEF } is not listed . It is very likely that mrNone..mrLast values are defined outside of ( IFDEF , ENDIF ) pairs .

Below is the full text of that file and the only define used is on line 2 where the fpc compiler is checked to be 3.2.0 or above in which case the reading of the file should be lines 3..56 and then continue on line 91.

So since the compiler is fpc ver 3.2.2 this should NOT bring us down to line 58..89, but it seems like it jumps there anyway...

Where is the identifier FPC_FULLVERSION defined??

Anyway, I gave up and disabled my own compiler and installed fpc 3.2.2 via apt and then the issue does not appear anymore.
But now I have the fpc compiler *outside* of my $HOME file hierarchy...

See also my notes at the bottom of the file (lines 89 and 105).

File body:/home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas
----------------------------------------------------------------------------
  1 unit UITypes
  2 {$IF FPC_FULLVERSION >= 30200}
  3 deprecated 'Use System.UITypes instead (available since FPC 3.2.0)';
  4
  5 {$mode objfpc}{$H+}
  6
  7 interface
  8
  9 uses
 10   System.UITypes;
 11
 12 const
 13   mtWarning      = System.UITypes.TMsgDlgType.mtWarning;
 14   mtError        = System.UITypes.TMsgDlgType.mtError;
 15   mtInformation  = System.UITypes.TMsgDlgType.mtInformation;
 16   mtConfirmation = System.UITypes.TMsgDlgType.mtConfirmation;
 17   mtCustom       = System.UITypes.TMsgDlgType.mtCustom;
 18
 19   mbYes      = System.UITypes.TMsgDlgBtn.mbYes;
 20   mbNo       = System.UITypes.TMsgDlgBtn.mbNo;
 21   mbOK       = System.UITypes.TMsgDlgBtn.mbOK;
 22   mbCancel   = System.UITypes.TMsgDlgBtn.mbCancel;
 23   mbAbort    = System.UITypes.TMsgDlgBtn.mbAbort;
 24   mbRetry    = System.UITypes.TMsgDlgBtn.mbRetry;
 25   mbIgnore   = System.UITypes.TMsgDlgBtn.mbIgnore;
 26   mbAll      = System.UITypes.TMsgDlgBtn.mbAll;
 27   mbNoToAll  = System.UITypes.TMsgDlgBtn.mbNoToAll;
 28   mbYesToAll = System.UITypes.TMsgDlgBtn.mbYesToAll;
 29   mbHelp     = System.UITypes.TMsgDlgBtn.mbHelp;
 30   mbClose    = System.UITypes.TMsgDlgBtn.mbClose;
 31
 32 type
 33   // Message dialog related
 34   TMsgDlgType    = System.UITypes.TMsgDlgType;
 35   TMsgDlgBtn     = System.UITypes.TMsgDlgBtn;
 36   TMsgDlgButtons = set of System.UITypes.TMsgDlgBtn;
 37
 38   // ModalResult
 39   TModalResult = System.UITypes.TModalResult;
 40   PModalResult = System.UITypes.PModalResult;
 41
 42 const
 43   // Used for ModalResult
 44   mrNone = System.UITypes.mrNone;
 45   mrOK = System.UITypes.mrOK;
 46   mrCancel = System.UITypes.mrCancel;
 47   mrAbort = System.UITypes.mrAbort;
 48   mrRetry = System.UITypes.mrRetry;
 49   mrIgnore = System.UITypes.mrIgnore;
 50   mrYes = System.UITypes.mrYes;
 51   mrNo = System.UITypes.mrNo;
 52   mrAll = System.UITypes.mrAll;
 53   mrNoToAll = System.UITypes.mrNoToAll;
 54   mrYesToAll = System.UITypes.mrYesToAll;
 55   mrClose = System.UITypes.mrClose;
 56   mrLast = System.UITypes.mrLast;
 57 {$ELSE}
 58 ;
 59
 60 {$mode objfpc}{$H+}
 61
 62 interface
 63
 64 type
 65   // Message dialog related
 66   TMsgDlgType    = (mtWarning, mtError, mtInformation, mtConfirmation,
mtCustom);
 67   TMsgDlgBtn     = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore,
 68                     mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose);
 69   TMsgDlgButtons = set of TMsgDlgBtn;
 70
 71   // ModalResult
 72   TModalResult = low(Integer)..high(Integer);
 73   PModalResult = ^TModalResult;
 74
 75 const
 76   // Used for ModalResult
 77   mrNone = 0;
 78   mrOK = mrNone + 1;
 79   mrCancel = mrNone + 2;
 80   mrAbort = mrNone + 3;
 81   mrRetry = mrNone + 4;
 82   mrIgnore = mrNone + 5;
 83   mrYes = mrNone + 6;
 84   mrNo = mrNone + 7;
 85   mrAll = mrNone + 8;
 86   mrNoToAll = mrNone + 9;
 87   mrYesToAll = mrNone + 10;
 88   mrClose = mrNone + 11;
 89   mrLast = mrClose; //Should this be: mrLast = mrNone + 12 maybe???
 90 {$ENDIF}
 91
 92   // String representation of ModalResult values
 93   ModalResultStr: array[mrNone..mrLast] of shortstring = (
 94     'mrNone',
 95     'mrOk',
 96     'mrCancel',
 97     'mrAbort',
 98     'mrRetry',
 99     'mrIgnore',
100     'mrYes',
101     'mrNo',
102     'mrAll',
103     'mrNoToAll',
104     'mrYesToAll',
105     'mrClose');  //Should there be another line for mrLast maybe???
106
107
108 implementation
109
110 end.

------------------------------------------

Bo Berglund Developer in Sweden

Reply by email

Mehmet Erol Sanliturk
to Bo Berglund

( 1 )

Please notice statement 3 :

1 unit UITypes
2 {$IF FPC_FULLVERSION >= 30200}
3 deprecated 'Use System.UITypes instead (available since FPC 3.2.0)';

( 2 )

Present form of this unit is defective :

2 {$IF FPC_FULLVERSION >= 30200}
... ( A )
57 {$ELSE}
... ( B )
90 {$ENDIF}

( A ) and ( B ) parts are determining different values for

mrNone..mrLast

and they are used in the part

91
...
106

part .

91 ... 106 statements should be defined for each case

in ( A ) and ( B ) parts separately when such a different limits occur .

Mehmet Erol Sanliturk

On Mon, Dec 11, 2023 at 3:04?AM Bo Berglund via lazarus <

Show quoted text 166 lines
wrote: On Sun, 10 Dec 2023 20:10:38 +0300, Mehmet Erol Sanliturk via lazarus wrote: >There is a statement > > 90 {$ENDIF} > >Its outside of {$IFDEF } is not listed . >It is very likely that > >mrNone..mrLast > >values are defined outside of ( IFDEF , ENDIF ) pairs . > Below is the full text of that file and the only define used is on line 2 where the fpc compiler is checked to be 3.2.0 or above in which case the reading of the file should be lines 3..56 and then continue on line 91. So since the compiler is fpc ver 3.2.2 this should NOT bring us down to line 58..89, but it seems like it jumps there anyway... Where is the identifier FPC_FULLVERSION defined?? Anyway, I gave up and disabled my own compiler and installed fpc 3.2.2 via apt and then the issue does not appear anymore. But now I have the fpc compiler *outside* of my $HOME file hierarchy... See also my notes at the bottom of the file (lines 89 and 105). File body:/home/bosse/devtools/lazarus/2.2.6/components/lazutils/uitypes.pas ---------------------------------------------------------------------------- 1 unit UITypes 2 {$IF FPC_FULLVERSION >= 30200} 3 deprecated 'Use System.UITypes instead (available since FPC 3.2.0)'; 4 5 {$mode objfpc}{$H+} 6 7 interface 8 9 uses 10 System.UITypes; 11 12 const 13 mtWarning = System.UITypes.TMsgDlgType.mtWarning; 14 mtError = System.UITypes.TMsgDlgType.mtError; 15 mtInformation = System.UITypes.TMsgDlgType.mtInformation; 16 mtConfirmation = System.UITypes.TMsgDlgType.mtConfirmation; 17 mtCustom = System.UITypes.TMsgDlgType.mtCustom; 18 19 mbYes = System.UITypes.TMsgDlgBtn.mbYes; 20 mbNo = System.UITypes.TMsgDlgBtn.mbNo; 21 mbOK = System.UITypes.TMsgDlgBtn.mbOK; 22 mbCancel = System.UITypes.TMsgDlgBtn.mbCancel; 23 mbAbort = System.UITypes.TMsgDlgBtn.mbAbort; 24 mbRetry = System.UITypes.TMsgDlgBtn.mbRetry; 25 mbIgnore = System.UITypes.TMsgDlgBtn.mbIgnore; 26 mbAll = System.UITypes.TMsgDlgBtn.mbAll; 27 mbNoToAll = System.UITypes.TMsgDlgBtn.mbNoToAll; 28 mbYesToAll = System.UITypes.TMsgDlgBtn.mbYesToAll; 29 mbHelp = System.UITypes.TMsgDlgBtn.mbHelp; 30 mbClose = System.UITypes.TMsgDlgBtn.mbClose; 31 32 type 33 // Message dialog related 34 TMsgDlgType = System.UITypes.TMsgDlgType; 35 TMsgDlgBtn = System.UITypes.TMsgDlgBtn; 36 TMsgDlgButtons = set of System.UITypes.TMsgDlgBtn; 37 38 // ModalResult 39 TModalResult = System.UITypes.TModalResult; 40 PModalResult = System.UITypes.PModalResult; 41 42 const 43 // Used for ModalResult 44 mrNone = System.UITypes.mrNone; 45 mrOK = System.UITypes.mrOK; 46 mrCancel = System.UITypes.mrCancel; 47 mrAbort = System.UITypes.mrAbort; 48 mrRetry = System.UITypes.mrRetry; 49 mrIgnore = System.UITypes.mrIgnore; 50 mrYes = System.UITypes.mrYes; 51 mrNo = System.UITypes.mrNo; 52 mrAll = System.UITypes.mrAll; 53 mrNoToAll = System.UITypes.mrNoToAll; 54 mrYesToAll = System.UITypes.mrYesToAll; 55 mrClose = System.UITypes.mrClose; 56 mrLast = System.UITypes.mrLast; 57 {$ELSE} 58 ; 59 60 {$mode objfpc}{$H+} 61 62 interface 63 64 type 65 // Message dialog related 66 TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom); 67 TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, 68 mbAll, mbNoToAll, mbYesToAll, mbHelp, mbClose); 69 TMsgDlgButtons = set of TMsgDlgBtn; 70 71 // ModalResult 72 TModalResult = low(Integer)..high(Integer); 73 PModalResult = ^TModalResult; 74 75 const 76 // Used for ModalResult 77 mrNone = 0; 78 mrOK = mrNone + 1; 79 mrCancel = mrNone + 2; 80 mrAbort = mrNone + 3; 81 mrRetry = mrNone + 4; 82 mrIgnore = mrNone + 5; 83 mrYes = mrNone + 6; 84 mrNo = mrNone + 7; 85 mrAll = mrNone + 8; 86 mrNoToAll = mrNone + 9; 87 mrYesToAll = mrNone + 10; 88 mrClose = mrNone + 11; 89 mrLast = mrClose; //Should this be: mrLast = mrNone + 12 maybe??? 90 {$ENDIF} 91 92 // String representation of ModalResult values 93 ModalResultStr: array[mrNone..mrLast] of shortstring = ( 94 'mrNone', 95 'mrOk', 96 'mrCancel', 97 'mrAbort', 98 'mrRetry', 99 'mrIgnore', 100 'mrYes', 101 'mrNo', 102 'mrAll', 103 'mrNoToAll', 104 'mrYesToAll', 105 'mrClose'); //Should there be another line for mrLast maybe??? 106 107 108 implementation 109 110 end. ------------------------------------------ -- Bo Berglund Developer in Sweden -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20231211/389e42d2/attachment-0001.htm>

Reply by email

Bo Berglund
to Mehmet Erol Sanliturk
Mehmet Erol Sanliturk wrote 34 lines
( 1 ) Please notice statement 3 : 1 unit UITypes 2 {$IF FPC_FULLVERSION >= 30200} 3 deprecated 'Use System.UITypes instead (available since FPC 3.2.0)'; ( 2 ) Present form of this unit is defective : 2 {$IF FPC_FULLVERSION >= 30200} ... ( A ) 57 {$ELSE} ... ( B ) 90 {$ENDIF} ( A ) and ( B ) parts are determining different values for mrNone..mrLast and they are used in the part 91 ... 106 part . 91 ... 106 statements should be defined for each case in ( A ) and ( B ) parts separately when such a different limits occur .

Yes, I did notice that. But the code is inside the official Lazarus sources for release 2.2.6 from gitlab, so I cannot do anything about it.

Furthermore, if I change the fpc version used to build Lazarus from the 3.2.2 created by compiling the official sources of fpc to a 3.2.2 version retrieved via apt, then the error goes away without changing the Lazarus sources. It is still there in the file but with the apt retrieved compiler is does not trigger the error even though building from the same sources....

Sigh,
I don't have the knowledge to dig deeper into this so I will keep using the fpc retrieved via apt instead of building from sources even though that pollutes my system with files outside of $HOME.

And this problem only happens on the 64 bit arm system...

Bo Berglund Developer in Sweden

Reply by email