Lazarus

Programming => General => Topic started by: jdp on August 04, 2019, 11:22:58 pm

Title: (Solved) Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 04, 2019, 11:22:58 pm
Hi all.

I compiled Lazarus 2.1.0 from the source on the Raspberry Pi. I now found that all the controls have special characters in the units field and if I double click it it will not create the events procedures.



Title: Re: Lazarus 2.0.2 Controls Problem
Post by: RAW on August 04, 2019, 11:32:26 pm
I've never seen this on WINDOWS ... , so change the OS and be happy ...  :P
Title: Re: Lazarus 2.0.2 Controls Problem
Post by: jdp on August 04, 2019, 11:52:45 pm
Hahah really helpfull. Nope sorry but Windows does not run on the Raspberry Pi the same way as Raspbian  ;)
Title: Re: Lazarus 2.0.2 Controls Problem
Post by: RAW on August 05, 2019, 12:11:44 am
Unfortunately I cannot test this on RP, because I don't have any ...
But you could try DosBox and Win 3.1 ...  :P again ...  :D
Title: Re: Lazarus 2.0.2 Controls Problem on Raspberry Pi
Post by: jdp on August 05, 2019, 06:03:22 pm
OK is there somebody that can help me for real? Why is Lazarus doing this after a compile from the source?
Title: Re: Lazarus 2.0.2 Controls Problem on Raspberry Pi
Post by: Martin_fr on August 05, 2019, 07:21:17 pm
I have no idea, but a couple of guesses...

Afaik the unit name is stored by fpc (on the TObject.unitname). So the first question here is: What version of fpc? And in case it not 3.0.4, does it work with 3.0.4?

This could be an encoding issue. I.e. maybe fpc stores the strings in some ansi encoding, but Lazarus expects them in utf8.
Title: Re: Lazarus 2.0.2 Controls Problem on Raspberry Pi
Post by: jdp on August 05, 2019, 08:55:49 pm
I am running the latest FPC

Code: Pascal  [Select][+][-]
  1. pi@PI4:~ $ fpc -iWDSOTP
  2. 3.3.1 2019/07/30 linux arm

And I downloaded Lazarus from SVN and compiled it.
Title: Re: Lazarus 2.0.2 Controls Problem on Raspberry Pi
Post by: jdp on August 05, 2019, 09:09:08 pm
Lazarus is.

Code: Pascal  [Select][+][-]
  1. Version# 2.1.0
  2. Date 2019-07-30
  3. FPC Version: 3.3.1
  4. SVN Revision : 61644
  5. arm-linux-gtk2
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 07, 2019, 09:19:04 am
Has nobody seen this before?
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: rvk on August 08, 2019, 01:58:31 am
Is this with all projects?
Or just one?

Try to make a simple new (empty) project and see if the error continues.
If not... We would need to see the source of the problem-project.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: Thaddy on August 08, 2019, 06:47:53 am
Which version of Raspbian are you running? Buster? Wheezy? Jessie?
I can't reproduce it with trunk/trunk on GTK2/Raspbian Buster
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 11, 2019, 10:37:54 pm
Hi. Thanks for getting back. I have been away for the weekend.

It is with all the projects.

I am running Buster as it is on a Raspberry Pi 4.

Code: Pascal  [Select][+][-]
  1. pi@PI4:~ $ cat /etc/os-release
  2. PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
  3. NAME="Raspbian GNU/Linux"
  4. VERSION_ID="10"
  5. VERSION="10 (buster)"
  6. VERSION_CODENAME=buster
  7. ID=raspbian
  8. ID_LIKE=debian
  9. HOME_URL="http://www.raspbian.org/"
  10. SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
  11. BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
  12. pi@PI4:~ $


I downloaded a new Trunk last week and it is still doing it.

Lazarus IDE v2.1.0 r61673





Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 11, 2019, 10:51:03 pm
I can give you remote access to the Pi and you can check it out if you don't have a Pi 4.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: rvk on August 12, 2019, 05:14:48 pm
Yep. Can confirm. I have the same problem under RPI 3/Buster and freshly compiled trunk.

Fun part is, I can rebuild the IDE (which by my account also makes use of the same components)  %)
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 12, 2019, 05:21:48 pm
Yes, I can compile the IDE and add other components and I can compile my projects. But I can not double click on the component for the event code to be added. I am glad you also have the issue so that then says there is a problem with Lazarus on Buster. So where do we go from there?
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: Thaddy on August 12, 2019, 05:35:50 pm
Do you also have buster-backports? (that can be added to /etc/apt/sources.list) That's what I have and may be different from yours.. Since the new video back end this may be a possible cause in the OS.
I have this configured:
Code: Bash  [Select][+][-]
  1. asta@thaddyginaasta:~ $ cat /etc/apt/sources.list
  2. deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
  3. # Uncomment line below then 'apt-get update' to enable 'apt-get source'
  4. deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
  5. deb http://httpredir.debian.org/debian buster-backports main contrib non-free
  6. asta@thaddyginaasta:~ $


This can be a X issue.
After adapting sources.list do a rebuild and see if it still persists.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: rvk on August 12, 2019, 05:41:25 pm
I can't even create a new project. Adding a TButton doesn't add StdCtrls to my units. Manually adding it I can compile and run.

Somehow the component-registration (for example which unit has TButton is screwed up).

Do you also have buster-backports? (that'can be added to /etc/apt/sources.list) That's what I have and may be different from yours.. Since the new video back end this may be a possible cause in the OS.
Mmm, I wonder what package could be using this problem in trunk.
I downloaded everything via svn.

No backport in sources.list
Code: [Select]
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
I did need to use apt update once because apt-get update gave me an error for InRelease (I had a slightly older Buster).

I might try a new Buster distro tomorrow.
But I can't imagine something like that screwing up the config-file for components and not anything else.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: Thaddy on August 12, 2019, 05:43:11 pm
But I can't imagine something like that screwing up the config-file for components and not anything else.
Me neither, but I had display issues.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: rvk on August 12, 2019, 05:49:52 pm
But I can't imagine something like that screwing up the config-file for components and not anything else.
Me neither, but I had display issues.
And what package did you install manually from backport (with  -t buster-backports)?
Because packages don't automatically get installed from the backport (which is for testing only).

Or did you add AutomaticUpgrades: yes?
(because that would be very "dangerous")

Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 12, 2019, 06:05:39 pm
This is like a character set problem.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: rvk on August 12, 2019, 06:11:54 pm
Code: [Select]
pi@raspberrypi:~ $ locale -a
C
C.UTF-8
en_GB.utf8
POSIX

Other normal Debian system (Intel):
Code: [Select]
root@space01:~# locale -a
C
C.UTF-8
en_US.utf8
POSIX


Pi:
Code: [Select]
pi@raspberrypi:~ $ locale
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

Other:
Code: [Select]
root@space01:~# locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 12, 2019, 06:19:15 pm
I have the same. What does Lazarus want by default ?

Code: Pascal  [Select][+][-]
  1. pi@PI4:~ $ locale
  2. LANG=en_US.UTF-8
  3. LANGUAGE=en_US.UTF-8
  4. LC_CTYPE="en_US.UTF-8"
  5. LC_NUMERIC="en_US.UTF-8"
  6. LC_TIME="en_US.UTF-8"
  7. LC_COLLATE="en_US.UTF-8"
  8. LC_MONETARY="en_US.UTF-8"
  9. LC_MESSAGES="en_US.UTF-8"
  10. LC_PAPER="en_US.UTF-8"
  11. LC_NAME="en_US.UTF-8"
  12. LC_ADDRESS="en_US.UTF-8"
  13. LC_TELEPHONE="en_US.UTF-8"
  14. LC_MEASUREMENT="en_US.UTF-8"
  15. LC_IDENTIFICATION="en_US.UTF-8"
  16. LC_ALL=en_US.UTF-8
  17.  
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: rvk on August 12, 2019, 06:27:36 pm
I think any xx.UTF-8 should be fine. The components don't have any special characters and neither do the config files. So this shouldn't happen.

And if charset would be a problem... there would be problems all over the IDE and the rest of the IDE seems to be fine.

I still don't know where the Lazarus IDE takes the component-palette info from.
That file (of files) should be examined.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 12, 2019, 07:22:15 pm
This seems to be a major problem on Buster. Who looks after this on the Lazarus team?
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: balazsszekely on August 12, 2019, 08:44:17 pm
@rvk
Quote
still don't know where the Lazarus IDE takes the component-palette info from.
From the package files. Unfortunately I don't have raspberry pi, but you can check if the unit name is correctly read from the lpk file. Just put a breakpoint at procedure "UpdateUnitName" first line, unit packagedefs.pas(packager subfolder). Is the value of FUnitName is already wrong? If yes, then the lpk file(basically an xml) is not parsed correctly for some reason. Perhaps the latest changes to parse doted filenames(like laz.whatever.unit) could cause the issue. But this is just a guess.

@jdp
What happens if you use the component window(Ctrl+Alt + P), I assume the same thing but you can give it a try.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: Thaddy on August 12, 2019, 08:51:23 pm
But I can't imagine something like that screwing up the config-file for components and not anything else.
Me neither, but I had display issues.
And what package did you install manually from backport (with  -t buster-backports)?
I did not install anything specific for Lazarus or fpc. I installed back-ports updates..... That's something completely different. The cause seems Buster.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 12, 2019, 10:20:07 pm
@GetMem Nope, still the same. Special characters where the names should be.

Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: jdp on August 12, 2019, 10:32:52 pm
@Thaddy so if your install is working what is the difference? I flashed the SD card image of Raspbian and did an upgrade to the latest before I installed Lazarus.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 13, 2019, 06:35:29 pm
Who can help with this issue? Should I report it on Git or SVN ?
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
Post by: rvk on August 13, 2019, 06:43:47 pm
Quote
still don't know where the Lazarus IDE takes the component-palette info from.
From the package files. Unfortunately I don't have raspberry pi, but you can check if the unit name is correctly read from the lpk file. Just put a breakpoint at procedure "UpdateUnitName" first line, unit packagedefs.pas(packager subfolder). Is the value of FUnitName is already wrong? If yes, then the lpk file(basically an xml) is not parsed correctly for some reason. Perhaps the latest changes to parse doted filenames(like laz.whatever.unit) could cause the issue. But this is just a guess.
I think those are for the loaded packages. And those file- and unit-names display correctly (Open Loaded packages).

The problem, as far as I can see now, is around class function TObject.UnitName in objpas.inc.


Code: Pascal  [Select][+][-]
  1.       class function TObject.UnitName : {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}ansistring{$else FPC_HAS_FEATURE_ANSISTRINGS}shortstring{$endif FPC_HAS_FEATURE_ANSISTRINGS};
  2.         type
  3.           TClassTypeInfo = {$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}packed{$endif}record
  4.             Attributes: Pointer;
  5.             ClassType: TClass;
  6.             ParentInfo: Pointer;
  7.             PropCount: SmallInt;
  8.             UnitName: ShortString;
  9.           end;
  10.           PClassTypeInfo = ^TClassTypeInfo;
  11.         var
  12.           classtypeinfo: PClassTypeInfo;
  13.         begin
  14.           classtypeinfo:=ClassInfo;
  15.           if Assigned(classtypeinfo) then
  16.           begin
  17.             // offset PTypeInfo by Length(Name) + 2 (ShortString length byte + SizeOf(Kind))
  18.             inc(Pointer(classtypeinfo), PByte(Pointer(classtypeinfo)+1)^ + 2);
  19.             {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
  20.             classtypeinfo:=aligntoqword(classtypeinfo);
  21.             {$endif}
  22.             result:=classtypeinfo^.UnitName;
  23.           end
  24.           else
  25.             result:='';
  26.         end;

Even Self.UnitName doesn't return a correct string.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   Showmessage(Self.UnitName);
  4. end;
(I had to manually add the FormCreate in the .lfm because the IDE doesn't create it but gives the error "unable to create method")
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 13, 2019, 06:56:12 pm
Note for previous post.
FPC_REQUIRES_PROPER_ALIGNMENT is true on RPI.

I have a feeling (and can see that debugging) the UnitName is 4 bytes offset from the correct UnitName.

I'm not sure if I've added something wrong during compiling trunk.

Can somebody else confirm the UnitName problem in RPI/Buster?
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 13, 2019, 07:22:15 pm
I have now installed Debian Buster in a Virtual machine on my PC and I am following the same steps I followed to install on the PI. Will test if I have the same issue on Intel.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 13, 2019, 08:07:53 pm
I followed the same steps but using the i386 Linux file but get an error when I make FPC 3.3.1.

So at this stage, I can not do anything else than wait till you find what is wrong with the IDE on Buster.

Code: Pascal  [Select][+][-]
  1. make[7]: *** [Makefile:3941: system.ppu] Segmentation fault
  2. make[7]: Leaving directory '/home/pi/source/fpc-3.3.1/rtl/linux'
  3. make[6]: *** [Makefile:2065: linux_all] Error 2
  4. make[6]: Leaving directory '/home/pi/source/fpc-3.3.1/rtl'
  5. make[5]: *** [Makefile:4686: rtl] Error 2
  6. make[5]: Leaving directory '/home/pi/source/fpc-3.3.1/compiler'
  7. make[4]: *** [Makefile:4528: next] Error 2
  8. make[4]: Leaving directory '/home/pi/source/fpc-3.3.1/compiler'
  9. make[3]: *** [Makefile:4542: ppc3] Error 2
  10. make[3]: Leaving directory '/home/pi/source/fpc-3.3.1/compiler'
  11. make[2]: *** [Makefile:4550: cycle] Error 2
  12. make[2]: Leaving directory '/home/pi/source/fpc-3.3.1/compiler'
  13. make[1]: *** [Makefile:2846: compiler_cycle] Error 2
  14. make[1]: Leaving directory '/home/pi/source/fpc-3.3.1'
  15. make: *** [Makefile:2878: build-stamp.i386-linux] Error 2
  16. pi@debian10:~/source/fpc-3.3.1$

Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 14, 2019, 04:44:00 pm
I installed Lazarus on Debian 10 Buster on Itel using

Code: Pascal  [Select][+][-]
  1. sudo apt-get install lazarus

It installed FPC 3.0.4 and Lazarus 2.0.0.

That seems to work 100%. I am not able to install it from the source.

So now I am stuck. What should I do on the Pi 4 as it only runs Buster ?
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 14, 2019, 04:52:06 pm
It seems Lazarus (of even FPC) on Intel/Buster/i386 indeed doesn't compile.
ppc2 gives a segmentation fault.
FPCUPdeluxe also doen't work (gives the same problem).
Trying stable in FPCUPdeluxe doesn't work (gives a URL error).

FPCUPdeluxe on the buster/raspberry gives the same problem with Control.UnitName.
(didn't try stable yet)

I was trying it again on stretch but my sdcard was too small (ran out of space).

You could bring the buster/raspberry/trunk problem to the mailing-list for developers.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 14, 2019, 06:05:21 pm
How do I do that? I just want to point them to this problem.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 14, 2019, 06:39:48 pm
It seems Lazarus (of even FPC) on Intel/Buster/i386 indeed doesn't compile.
FPC compiles OK. Lazarus trunk does not. Package install Lazarus? is in repo 1.8.4  but I did not test an install.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 14, 2019, 06:53:38 pm
It seems Lazarus (of even FPC) on Intel/Buster/i386 indeed doesn't compile.
FPC compiles OK. Lazarus trunk does not. Package install Lazarus? is in repo 1.8.4  but I did not test an install.
For me (and even fpcupdeluxe) it crashes with compiling fpc. The intermediate ppc2 which is created during the process gives a segmentation fault.

This is current trunk on Debian 10 buster i386.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 14, 2019, 07:00:46 pm
For me (and even fpcupdeluxe) it crashes with compiling fpc. The intermediate ppc2 which is created during the process gives a segmentation fault.

This is current trunk on Debian 10 buster i386.
Well, the only problem I have is that my builds suddenly favor Russian.
Code: Bash  [Select][+][-]
  1.  fpc -v
  2. Компилятор Free Pascal версии 3.3.1-r42660 [2019/08/12] для arm
  3.  
  4. uname -a
  5. Linux thaddyginaasta 4.19.58-v7+ #1245 SMP Fri Jul 12 17:25:51 BST 2019 armv7l GNU/Linux
  6.  
That's fpc compiled and running ob Raspbian Buster.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 14, 2019, 08:01:52 pm
Yikes.
Just installed trunk on a fresh Debian Stretch 9.9 on RPI 3 and have the same problem.

@Thaddy, how did you compile trunk on RPI?
With what commands and options?
And what start-compiler did you use?
Did you upgrade to buster (with an older stretch) or did you use a fresh install?

(But even with fpcupdeluxe it didn't work. You might think it passes the correct compiler-options)
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Cyrax on August 14, 2019, 08:04:56 pm
It seems Lazarus (of even FPC) on Intel/Buster/i386 indeed doesn't compile.
FPC compiles OK. Lazarus trunk does not. Package install Lazarus? is in repo 1.8.4  but I did not test an install.
For me (and even fpcupdeluxe) it crashes with compiling fpc. The intermediate ppc2 which is created during the process gives a segmentation fault.

This is current trunk on Debian 10 buster i386.

Strange. As for me, i386-linux and x86-64-linux targets compiles successfully (Arch Linux). You can try lower or disable optimization (OPT="-O-").
Check that your distro binutils package are least in version 2.32.

FPC trunk r42685 and Lazarus trunk r61691.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 14, 2019, 09:03:02 pm
Yikes.
Just installed trunk on a fresh Debian Stretch 9.9 on RPI 3 and have the same problem.

@Thaddy, how did you compile trunk on RPI?
With what commands and options?
And what start-compiler did you use?
Did you upgrade to buster (with an older stretch) or did you use a fresh install?

(But even with fpcupdeluxe it didn't work. You might think it passes the correct compiler-options)
I installed a new Raspbiamn on an RPi 4 and upgraded buster on my RPi3's

Built with a fpc 3.0.4 as a starting compiler (from apt)
svn co etc.
Code: Bash  [Select][+][-]
  1. sudo make clean all install REVSTR=42691 REVINC=force PP=/usr/bin/fpc INSTALL_PREFIX=/usr/local GCCLIBDIR=/usr/lib/gcc/arm-linux-gnueabihf/8 OPT="-CpARMv7a -OpARMv7a -CfVFPv3 -CX -XX -Xs"
  2. sudo cp /usr/local/lib/fpc/3.3.1/ppcarm /usr/local/bin
  3.  
  4. fpc  -v
  5.  $ fpc -v
  6. Компилятор Free Pascal версии 3.3.1-r42691 [2019/08/14] для arm
  7. Copyright (c) 1993-2019 by Florian Klaempfl and others
  8.  
  9.  $ cat /etc/apt/sources.list
  10. deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
  11. # Uncomment line below then 'apt-get update' to enable 'apt-get source'
  12. deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
  13. deb http://httpredir.debian.org/debian buster-backports main contrib non-free
  14.  
I have only the issue that I have a Russian version instead of an English one and I have no clue why?
Solved. the fpc.cfg from apt has all message files uncommented. if that is not corrected, simple re-comment them.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 14, 2019, 09:25:02 pm
@Thaddy does your Lazarus work correctly. Are the components correct? My FPC works fine but the IDE is screwed up.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 14, 2019, 09:39:53 pm
Here are the steps I took.

The book states you have to make the swap file bigger. On a pi with 1 GB of RAM that is a must but I have a 4GB and the swap space stays 0 so it is fine.

Download FPC from this site and install it.

https://www.freepascal.org/down/arm/linux-hungary.html

fpc-3.0.4.arm-linux-eabihf-raspberry.tar

Code: Pascal  [Select][+][-]
  1. cd /home/pi/Downloads/fpc-3.0.4.arm-linux
  2.  
  3. tar xvf fpc-3.0.4.arm-linux-eabihf-raspberry.tar
  4.  
  5. cd ~/Downloads/fpc-3.0.4.arm-linux
  6.  
  7. sudo ./install.sh



Then you have to download the source of FPC 3.3.1 and compile it.

Code: Pascal  [Select][+][-]
  1. cd
  2. mkdir source
  3.  
  4.  
  5. Install subversion
  6.  
  7. sudo apt-get install -y subversion
  8.  
  9. cd ~/source
  10.  
  11. svn co http://svn.freepascal.org/svn/fpc/trunk fpc-3.3.1


Compile 3.3.1

Code: Pascal  [Select][+][-]
  1. cd ~/source/fpc-3.3.1
  2. make all OPT=-dFPC_ARMHF
  3.  
  4. sudo make install OPT=-dFPC_ARMF PREFIX=/usr/local
  5.  
  6.  
  7. sudo rm –f /usr/local/bin/ppcarm
  8.  
  9. sudo ln –sf /usr/local/lib/fpc/3.3.1/ppcarm /usr/local/bin/ppcarm
  10.  

Then you have to install all the packages

Code: Pascal  [Select][+][-]
  1. sudo apt-get install -y libgtk2.0-dev
  2. sudo apt-get install -y libcairo2-dev
  3. sudo apt-get install -y libpango1.0-dev
  4. sudo apt-get install -y libpangox-1.0-dev
  5. sudo apt-get install -y libgdk-pixbuf2.0-dev
  6. sudo apt-get install -y libx11-dev
  7. sudo apt-get install -y gir1.2-coglpango-1.0
  8. sudo apt-get install -y xorg-dev
  9.  

Download Lazarus trunk

Code: Pascal  [Select][+][-]
  1. cd ~/source
  2. svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
  3.  
Compile Lazarus

Code: Pascal  [Select][+][-]
  1. cd ~/source/lazarus
  2.  
  3. make all OPT=-dFPC_ARMHF
  4.  
  5. sudo make install OPT=-dFPC_ARMHF PREFIX=/usr/local


Then you get a compiled Lazarus with broken components




Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 14, 2019, 10:26:23 pm
You are doing things way to complicated.
First use my steps for fpc.
Second checkout lazarus trunk
make clean all

I can reproduce that codetools is not working now I rebuild from source for this subject.
Also there seems something wrong with component registration.
 
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 14, 2019, 10:27:23 pm
On stretch I had the same problem.
Now I have gone back to rev 40721 for FPC and rev 59961 for Lazarus. Both version from januari 1st.

And that one works.

Tomorrow I will try again with buster and see what version exactly doesn't work. The problem is in FPC, not in Lazarus. It's in Component.UnitName. So I can write a script to increase the revision and just test FPC only (which is much faster).

Code: [Select]
pi@raspberrypi:~ $ cat test.pas
program test;
uses classes;
var
  O: TObject;
begin
  O := TObject.Create;
  writeln(O.UnitName);
end.

pi@raspberrypi:~ $ ./dev/fpc/bin/fpc test.pas
Free Pascal Compiler version 3.3.1 [2019/08/14] for arm
Copyright (c) 1993-2018 by Florian Klaempfl and others
Target OS: Linux for ARMHF
Compiling test.pas
Linking test
9 lines compiled, 1.5 sec
pi@raspberrypi:~ $ ./test
System
pi@raspberrypi:~ $

Maybe you can test this test.pas on buster already to see if it gives junk.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 14, 2019, 10:43:46 pm
No name returned indeed. confirmed.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 14, 2019, 10:46:26 pm
No name returned indeed. confirmed.
What happens if you hover over the TButton in Lazarus (compiled with that FPC version)?

Do you see some Chinese character and another normal character (where the UnitName should be)?
(under the component name)

What happens in Lazarus IDE when you create a new project and double click the form?

Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 14, 2019, 10:56:30 pm
With the current version I can reproduce those issues.
I akso checked the unitname implementation.
It looks like the typeinfo is screwed up. There have been quite some rtti changes since January that could have caused this.
This code is also touched by the attributes feature.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 15, 2019, 07:25:53 am
reported as: mantis 0035965

I think It is not related to Raspbian Buster or RPi4 as such, it may be related to attributes and rtti. Possibly only on armhf? and/or arm-like platforms.
That is: unless alignment requirements for Buster have changed: Buster now uses version 7 of the ARM architecture specification. ( for reference, see also the Debian Buster release notes)
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 15, 2019, 08:41:49 am
@Thaddy, I am not a Lazarus Guru. I followed the steps in the book I bought.
So you are now also seeing the issue I have. The IDE is broken and you are not able to add a new event by double-clicking on the components.

I just want the IDE to work on the Pi 4. I want to make sure the system we build is future proof and at this stage I am stuck.
Who from the Lazarus team looks after this. Rik you stated I can add it to a mailing list somewhere but not sure where or should I leave it with you 2 to sort out  ;D ?
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 15, 2019, 09:22:10 am
@Thaddy, I am not a Lazarus Guru. I followed the steps in the book I bought.
So you are now also seeing the issue I have. The IDE is broken and you are not able to add a new event by double-clicking on the components.

I just want the IDE to work on the Pi 4. I want to make sure the system we build is future proof and at this stage I am stuck.
Who from the Lazarus team looks after this. Rik you stated I can add it to a mailing list somewhere but not sure where or should I leave it with you 2 to sort out  ;D ?
There is not much I can do, but I reported the bug (it is a serious one) on the bugtracker. The mailing list you want is fpc-devel.
For now, if you install FPC 3.0.4 and Lazarus 1.8.4 from apt, so not the newer versions, you can still work with Lazarus on the Raspberry Pi 1/2/3/4
First remove your FPC and Lazarus.
sudo rm -rf /usr/bin/fpc
sudo rm -rf /usr/local/bin/fpc
sudo rm -rf /usrlocal/lib/fpc
Same for Lazarus.
adapt your sources.list like mine.
sudo apt update && sudo apt dist-upgrade -y
sudo apt install fpc
sudo apt install lazarus
sudo apt autoremove
check the /etc/fpc.cfg file if all paths are correct.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 15, 2019, 09:47:08 am
I just want the IDE to work on the Pi 4. I want to make sure the system we build is future proof and at this stage I am stuck.
Trunk versions are considered unstable and might contain bugs. But these bugs are usually responded to very (and i mean VERY) quickly, if they are found. But this one went unnoticed. I'm in the process of checking out at what revision FPC broke for arm (fun to do with a slow-ass rpi3  %)).

When checking out FPC with svn you can add -r40721 (which makes it checkout revision 40721 from januari 1st).
You could also use svn to checkout https://svn.freepascal.org/svn/fpc/branches/fixes_3_2/

fixes_3_2 is stable with some critical fixes added to them.
https://www.freepascal.org/develop.html

https://bugs.freepascal.org/view.php?id=35965
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 15, 2019, 11:11:14 am
@Thaddy how do I remove Lazarus? You gave me the commands for FPC. I just want to make sure I don't miss a step.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 15, 2019, 11:50:54 am
@Thaddy how do I remove Lazarus? You gave me the commands for FPC. I just want to make sure I don't miss a step.
Code: Bash  [Select][+][-]
  1. sudo apt-get purge lazarus
  2. sudo apt autoremove
If you installed through aptitude (apt, apt-get)
Otherwise simply delete the lazarus directories with sudo  rm -rf <lazarus directory root>
You may want to check lazarus hidden directory (written as .lazarus , note the dot) left-overs and /usr/local/lib /usr/local/bin too.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 15, 2019, 11:53:51 am
@Thaddy how do I remove Lazarus? You gave me the commands for FPC. I just want to make sure I don't miss a step.
Code: Bash  [Select][+][-]
  1. sudo apt-get purge lazarus
Off course, that only works if you installed Lazarus with apt-get.
If you installed it with svn and make (like you mentioned) you can remove the created directories manually.

I'm not sure where it was installed in your case.
That why always install "as user" in /home/pi/dev/fpc

Code: [Select]
make -s clean all install OPT="-v0" OS_TARGET=linux CPU_TARGET=arm INSTALL_PREFIX=/home/pi/dev/fpc PP=/home/pi/dev/compiler3/ppcarmIn that case, removing it would mean just deleting that directory (including /home/pi/.lazarus which might be created).

Edit:
I'm currently at revision 42475 -> 42500.
As I see it, I think the problem is in 42486 where Florian made a change in typinfo.pp.
or maybe 42488 where some changes in aligned strings RTTI for arm were made.
Will confirm.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 15, 2019, 12:06:57 pm

I forgot: fpc 3.2.0 seems not affected. Sven (fpc core developer) suspects rtti too.
So that should be fine to install.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 15, 2019, 12:44:03 pm
I did not install Lazarus using apt-get I did a build from the trunk source as stated in the steps I took. I just did a rm of all the Lazarus folders.

I installed it now using apt-get and version 2.0.0 is now running. I had some fun and games adding components as it kept asking for packages that are there so I just opened them using the open loaded packages tool and then all seems to compile.

My project now compiles and I am able to add components. I had to roll back some of the dynamic arrays I had a problem with last time as I am now using FPC 3.0.4 and not 3.3.1. 

Aaa the fun and games of software development.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 15, 2019, 01:37:49 pm
Just my luck. Was trying between revision 42475 and 42500.
And of course the problem is with r42476  :o
Compiling with r42475 gave a correct result, with r42476 a wrong result.

Quote
Revision: 42476
Author: florian
Date: zondag 21 juli 2019 10:28:29
Message:
* more fixes to rtti after attribute branch merging
----
Modified : /trunk/compiler/ncgrtti.pas
Modified : /trunk/compiler/symconst.pas
Modified : /trunk/rtl/inc/dynarr.inc
Modified : /trunk/rtl/inc/rtti.inc
Modified : /trunk/rtl/inc/rttidecl.inc
Modified : /trunk/rtl/objpas/typinfo.pp
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 15, 2019, 02:25:35 pm
OK so what even florian did broke the IDE.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 15, 2019, 05:06:34 pm
Well, boys and girls: Its is Fixed!! Tnx PascalDragon. !!
I still have to test Lazarus, but in FPC it is fixed. (commit 42697)

Tested Lazarus 2.1.0-61696 /fpc 3.3.1-r42701

Everything works again.

And thx to Rik to point it out.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: Thaddy on August 15, 2019, 08:08:42 pm
Now we can focus on the other bugs in this discussion 8-), which are unrelated.... :o

Btw: this bux fix fixed more things. Small fix, big impact.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: rvk on August 15, 2019, 10:52:19 pm
Yes, it is fixed. Also for Lazarus.

I can't seem to add another note in the bug tracker.
Am I only allowed one note?
Or is adding notes disabled after a fix.

@Thaddy, you can confirm and close the issue on bug tracker.

Next issue would be the segmentation fault on i386/debian.
First a good nights sleep.
Title: Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
Post by: jdp on August 15, 2019, 11:24:49 pm
Thanks all for the efforts. I saw that this bug fix also made the project compile faster.

My project is now working on Lazarus 2.1.0 using FPC 3.3.1
TinyPortal © 2005-2018