Recent

Author Topic: [SOLVED] Lazarus IDE Start Up Issue and Re-Build Issue  (Read 1624 times)

Aruna

  • Hero Member
  • *****
  • Posts: 627
[SOLVED] Lazarus IDE Start Up Issue and Re-Build Issue
« on: March 23, 2025, 02:45:30 pm »
Hi everyone,

The first attached screenshot shows an error message that has been around for quite some time. I usually just click "Skip" and continue working without issues. The second screenshot, however, is from just a few minutes ago when I asked the IDE to rebuild itself — this is a new error that I haven’t seen before.

As for the first error, I believe it’s related to a missing custom component I created using an earlier version of the IDE. It hasn’t caused any real problems, but I think it’s time to resolve it properly. What’s the best way to cleanly fix this?

The second question: how can I get the IDE to start building itself again? I was working on a Notepad example and wanted to check if it would be automatically included in the examples, which is why I attempted the rebuild.

Thanks in advance for any advice!
« Last Edit: April 11, 2025, 03:30:27 am by Aruna »

paweld

  • Hero Member
  • *****
  • Posts: 1354
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #1 on: March 23, 2025, 02:50:24 pm »
Menu > Package > Instal/Uninstall Packages ...
Find package "NewComponent1" on the left list, select them ad click "Uninstall selection"
next click "Build IDE"
Best regards / Pozdrawiam
paweld

Aruna

  • Hero Member
  • *****
  • Posts: 627
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #2 on: March 23, 2025, 03:40:39 pm »
Menu > Package > Instal/Uninstall Packages ...
Find package "NewComponent1" on the left list, select them ad click "Uninstall selection"
next click "Build IDE"
Thank you @paweld please watch this to the end else no one will believe me: Lazarus IDE Startup and Rebuild Issues most of the errors are of my own doing and does not prevent me from coding but is a nuisance now. The building of the IDE I have no clue why it does that and chokes like that?

paweld

  • Hero Member
  • *****
  • Posts: 1354
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #3 on: March 23, 2025, 05:27:56 pm »
Problem with non-existent packages will solve with a full rebuild of lazarus in the “Clean and Build All” profile: Menu > Tools > Configure “Build Lazarus” ... > set “Profile to build” to “Clean and build all” > press “Build”
BUT before that you have to solve the error with missing file “clocale.ppu” - for this you need to compile FPC
Best regards / Pozdrawiam
paweld

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11027
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #4 on: March 23, 2025, 06:01:29 pm »
"Checksum Changed" for an FPC/RTL unit usually means you have more than one version of that ppu in the unit/ppu seach path. This may be in your lazarus config, the project config, or the fpc.cfg config.

Or you have a 2nd file called clocale. (E.g. a copy or modified copy of that file). Such a 2nd pas file would cause a 2nd ppu file.

It can also happen, if you did compile FPC yourself, and did not compile with -Ur (not sure maybe -UR ?? => search: compile unit for release).

Aruna

  • Hero Member
  • *****
  • Posts: 627
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #5 on: March 23, 2025, 06:24:46 pm »
Problem with non-existent packages will solve with a full rebuild of lazarus in the “Clean and Build All” profile: Menu > Tools > Configure “Build Lazarus” ... > set “Profile to build” to “Clean and build all” > press “Build”
BUT before that you have to solve the error with missing file “clocale.ppu” - for this you need to compile FPC
Alright, thanks once again. I will try to figure out how to solve the clocal.ppu missing error.

Aruna

  • Hero Member
  • *****
  • Posts: 627
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #6 on: March 23, 2025, 06:31:11 pm »
"Checksum Changed" for an FPC/RTL unit usually means you have more than one version of that ppu in the unit/ppu seach path. This may be in your lazarus config, the project config, or the fpc.cfg config.

Or you have a 2nd file called clocale. (E.g. a copy or modified copy of that file). Such a 2nd pas file would cause a 2nd ppu file.

It can also happen, if you did compile FPC yourself, and did not compile with -Ur (not sure maybe -UR ?? => search: compile unit for release).
@Martin_frI I have honestly lost count of the number of Lazarus installations I have. I know they are definitely more than 4. The very first one I started with a 2.2.* something then I upgraded to another 2.8.* something then I remembered I used the deb's and installed an RC4.0 then I cloned the gitlab repo and did compile and built FPC so could be any one of those things. In between doing those I was trying my own experiments with the IDE. I also have 3.*.* lying around.... it is a royal mess but so far I have managed to work with it :)

So yes you are right there are multiple versions of lazIDE on this hard drive. I have to now figure out how to fix that clocale error.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11027
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #7 on: March 23, 2025, 07:51:17 pm »
First of all, clocale is FPC => so versions of FPC.

Then, I take it from your anwer you did not make any copies of clocale.pas (or .pp)? Good.



Are the fpc (if more than one) all installed from official installer?

If they are from fpcupdeluxe, are they wrapped in the script provided by fpcupdeluxe?

On Linux, having more than one fpc may require some attention, because they all want to use /etc/fpc.cfg (or the fpc.cfg somewhere in the home dir...).

So if you installed (rpm/dep/...) a newer fpc, then the older may give errors.

Though usually that would be an error about ppu version... Strange.

Make sure that in your Lazarus and your project dir (and any package used by lazarus) there is no clocale.ppu anywhere. That must only exist in the fpc installation.

And the path to 3.2.2 in the error is the path of your fpc install, that you are using?


Aruna

  • Hero Member
  • *****
  • Posts: 627
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #8 on: March 23, 2025, 10:36:33 pm »
First of all, clocale is FPC => so versions of FPC.
Ok, good to know. I did not know this. Thank you.

Then, I take it from your anwer you did not make any copies of clocale.pas (or .pp)? Good.
'I' did not make copies but when I search using *find* ths iis what I see:
Code: Text  [Select][+][-]
  1. aruna@debian:~$ sudo find / -type f -name "*clocale.pas*" 2>/dev/null
  2. aruna@debian:~$ sudo find / -type f -name "*clocale.pp*" 2>/dev/null
  3. /usr/local/lib/fpc/3.2.2/units/x86_64-linux/rtl-extra/clocale.ppu
  4. /usr/share/fpcsrc/3.2.2/packages/rtl-extra/src/unix/clocale.pp
  5. /usr/share/fpcsrc/3.2.2/packages/rtl-extra/src/android/clocale.pp
  6. /usr/share/fpcsrc/3.2.2/packages/rtl-extra/units/x86_64-linux/clocale.ppu
  7. /usr/lib/fpc/3.2.2/units/x86_64-linux/rtl-extra/clocale.ppu
  8. /home/aruna/FPC-Source/source/packages/rtl-extra/src/unix/clocale.pp
  9. /home/aruna/FPC-Source/source/packages/rtl-extra/src/android/clocale.pp
  10. /home/aruna/keelazide/source/packages/rtl-extra/src/unix/clocale.pp
  11. /home/aruna/keelazide/source/packages/rtl-extra/src/android/clocale.pp
  12. /home/aruna/keelazide/source/packages/rtl-extra/units/x86_64-linux/clocale.ppu
  13. aruna@debian:~$


Are the fpc (if more than one) all installed from official installer?

If they are from fpcupdeluxe, are they wrapped in the script provided by fpcupdeluxe?
No only the first two were installed using the offical installer after that I started experimenting.. I stayed away from fpcupdeluxe even though many people regard it highly as some reviews had horror stories. Once I undesratnd enough about how things work under the hood I guess I may try fpcupdeluxe at this moment uh-uh.

On Linux, having more than one fpc may require some attention, because they all want to use /etc/fpc.cfg (or the fpc.cfg somewhere in the home dir...).
Using linux *find* agian I get this:
Code: Text  [Select][+][-]
  1. aruna@debian:~$ sudo find / -type f -name "fpc.cfg" 2>/dev/null
  2. /etc/fpc.cfg
  3. /home/aruna/lazarus/forum-demos/shock/test/fpc.cfg
  4. aruna@debian:~$

So if you installed (rpm/dep/...) a newer fpc, then the older may give errors.
I use Linux Debian so they were *.deb's

Though usually that would be an error about ppu version... Strange.
'I' was doing 'strange' experiments so most probably I broke something? Or did something I am not supposed to do like change the name of a project folder while working on /that/ folder whic initially had me climbing the wall but now I fix like it is nothing. Experience is the best teacher I guess :)

Make sure that in your Lazarus and your project dir (and any package used by lazarus) there is no clocale.ppu anywhere. That must only exist in the fpc installation.
I will check again...

And the path to 3.2.2 in the error is the path of your fpc install, that you are using?
I cloned and built from the source the fpc so I am not dead certain. Let me check and verify then report back ?
« Last Edit: March 23, 2025, 10:38:06 pm by Aruna »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11027
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #9 on: March 23, 2025, 11:04:49 pm »
I probably wont be able to give you a definite answer. But...

It is normal that there are sources for different OS. But only one would have been build and installed as ppu. And it is ppu that matters. At that time the compiler should not have access to the sources of the rtl.
=> Yet strangely, in your error it says "recompiling" and does not give an error that it did not find the source.
Either the error is just filtered out, or there is a further issue...

If you have any setup that compiles fpc units from within the Lazarus IDE => you will have trouble (there are cases / stuff that can be done, but it needs some more understanding, so lets just say: don't compile fpc sources from lazarus)



If you can  get the error with a small(er) project (e.g. maybe just "uses clocale") and you compile it with
    -va

If inside the IDE, the IDE will hide many messages, and you need to do "copy all".
So maybe do that from outside the IDE.

It will tell you every file the compiler tried to access, and if it found it or not.

So,
if you know
- what fpc you are using,
- and where that fpc should have its ppu,
- and that the source files should not be found by fpc
then you can go through that list, and check for what happens for clocale.* (and units right before).

Its a lot of work (and I wont be able to do it for you, even if you upload the entire log / sorry limited time).

You will also see what fpc.cfg it accesses, and you can check inside of them what search path are used, and if they match where that fpc should be installed.

The upside, after that, you have a better understanding how all of this works.

Aruna

  • Hero Member
  • *****
  • Posts: 627
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #10 on: March 24, 2025, 01:10:01 am »
I probably wont be able to give you a definite answer. But...

It is normal that there are sources for different OS. But only one would have been build and installed as ppu. And it is ppu that matters. At that time the compiler should not have access to the sources of the rtl.
=> Yet strangely, in your error it says "recompiling" and does not give an error that it did not find the source.
Either the error is just filtered out, or there is a further issue...

If you have any setup that compiles fpc units from within the Lazarus IDE => you will have trouble (there are cases / stuff that can be done, but it needs some more understanding, so lets just say: don't compile fpc sources from lazarus)



If you can  get the error with a small(er) project (e.g. maybe just "uses clocale") and you compile it with
    -va

If inside the IDE, the IDE will hide many messages, and you need to do "copy all".
So maybe do that from outside the IDE.

It will tell you every file the compiler tried to access, and if it found it or not.

So,
if you know
- what fpc you are using,
- and where that fpc should have its ppu,
- and that the source files should not be found by fpc
then you can go through that list, and check for what happens for clocale.* (and units right before).

Its a lot of work (and I wont be able to do it for you, even if you upload the entire log / sorry limited time).

You will also see what fpc.cfg it accesses, and you can check inside of them what search path are used, and if they match where that fpc should be installed.

The upside, after that, you have a better understanding how all of this works.

@Martin_fr, I would never even think of asking you to go through my logs that is way too much work and will take a lot of time. I was trying lot's of things and under Project-->Project Options-->Compiler options I saw a button that said 'test' so I went and clicked it. The attached screenshot tell's me what my problem is? You know whoever was responsible for the initial thinking and planning of the Lazarus IDE they were most certainly not ordinary folk. I remain humbled and in awe once again. I wonder who wrote the code for that 'test' button? I thank you once again for all the guidance and help. What do you think about that screenshot?

Aruna

  • Hero Member
  • *****
  • Posts: 627
Re: Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #11 on: April 11, 2025, 03:30:04 am »
Hello @paweld and @Martin_fr,
I’ve got some good news to share. I finally figured out the root cause of the issue and managed to fix everything, so things are back to normal. I thought it would be helpful to document the steps here. For others, but also because I’ll probably forget what I did later!

Cause:
I had manually compiled FPC, and it ended up being installed under /usr/local/lib/fpc/3.2.2. That was the reason behind the “There are several Free Pascal compilers in your path” error.

Solution:
1.    sudo rm -rf /usr/local/lib/fpc/3.2.2
2.    make bigide

And that’s it—problem solved! All the errors are gone, Lazarus IDE now starts up perfectly without any hiccups.
I had no choice but to rebuild the IDE anyway, since I needed to test a custom component. 🙂

paweld

  • Hero Member
  • *****
  • Posts: 1354
Re: [SOLVED] Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #12 on: April 11, 2025, 06:52:37 am »
Quote from: Aruna"
make bigide
This build mode helps you get Lazarus up and running, but note that it does not include any additionally installed components. Next rebuilding Lazarus from Menu > Tools > Build Lazarus with Profile: ... will reattach all the components you previously installed, and you may again have problems with yours test components.
Best regards / Pozdrawiam
paweld

Aruna

  • Hero Member
  • *****
  • Posts: 627
Re: [SOLVED] Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #13 on: April 11, 2025, 11:34:30 pm »
Quote from: Aruna"
make bigide
This build mode helps you get Lazarus up and running, but note that it does not include any additionally installed components. Next rebuilding Lazarus from Menu > Tools > Build Lazarus with Profile: ... will reattach all the components you previously installed, and you may again have problems with yours test components.
Hi! Yes, you were right. I learned that the hard way! But this time, I also managed to find a fix. The fix I found was to delete or remove all the package files that might be causing issues, and then rebuild the IDE from scratch.

I'm thinking, maybe when I have a bit of time, I’ll write a little how-to guide — something like “how to break the Lazarus IDE and how to fix it again”! 😄

I do have a question though:
When you're adding a custom control for the first time, Lazarus lets you specify icons in 24x24, 26x36, and 48x48 sizes — and I tested this, it works great. But let’s say later on, after the component is already installed, I want to change the icon… how on earth do you do that? I’ve tried everything and so far no luck. 😅


TRon

  • Hero Member
  • *****
  • Posts: 4304
Re: [SOLVED] Lazarus IDE Start Up Issue and Re-Build Issue
« Reply #14 on: April 11, 2025, 11:48:03 pm »
I'm thinking, maybe when I have a bit of time, I’ll write a little how-to guide — something like “how to break the Lazarus IDE and how to fix it again”! 😄
By far the easiest solution to 'fix' the IDE in case having installed a component that breaks things is by reverting back to the backup version of the executable (which should be generated automatically). A clean startup can be done by either removing/clearing the configuration directory (pcp) or set it to another directory (which is empty)
Today is tomorrow's yesterday.

 

TinyPortal © 2005-2018