Recent

Author Topic: (Solved) Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)  (Read 2003 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 8510
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #15 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.
« Last Edit: August 12, 2019, 05:42:05 pm by Thaddy »
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.

rvk

  • Hero Member
  • *****
  • Posts: 3785
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #16 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.

Thaddy

  • Hero Member
  • *****
  • Posts: 8510
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #17 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.
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.

rvk

  • Hero Member
  • *****
  • Posts: 3785
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #18 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")


jdp

  • Jr. Member
  • **
  • Posts: 76
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #19 on: August 12, 2019, 06:05:39 pm »
This is like a character set problem.

rvk

  • Hero Member
  • *****
  • Posts: 3785
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #20 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=
« Last Edit: August 12, 2019, 06:13:32 pm by rvk »

jdp

  • Jr. Member
  • **
  • Posts: 76
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #21 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.  

rvk

  • Hero Member
  • *****
  • Posts: 3785
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #22 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.

jdp

  • Jr. Member
  • **
  • Posts: 76
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #23 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?

GetMem

  • Hero Member
  • *****
  • Posts: 3478
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #24 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.

Thaddy

  • Hero Member
  • *****
  • Posts: 8510
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #25 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.
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.

jdp

  • Jr. Member
  • **
  • Posts: 76
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #26 on: August 12, 2019, 10:20:07 pm »
@GetMem Nope, still the same. Special characters where the names should be.

« Last Edit: August 12, 2019, 10:23:38 pm by jdp »

jdp

  • Jr. Member
  • **
  • Posts: 76
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #27 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.

jdp

  • Jr. Member
  • **
  • Posts: 76
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi 4 (Buster)
« Reply #28 on: August 13, 2019, 06:35:29 pm »
Who can help with this issue? Should I report it on Git or SVN ?

rvk

  • Hero Member
  • *****
  • Posts: 3785
Re: Lazarus 2.1.0 Controls Problem on Raspberry Pi
« Reply #29 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")