Recent

Author Topic: "Configure Lazarus IDE"  (Read 4799 times)

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
"Configure Lazarus IDE"
« on: November 09, 2022, 09:54:53 am »
If you move / build FPC / Lazarus, you get this dreaded dialog, with a lot of red exclamation marks, that I cannot resolve. Is there a manual?

Like, it asks you to select the location of a file, but when you do, it complains that there is another file it cannot find. And there is an option to build a new config file, which only works if you manage to get all the problems resolved.

The last few times, I managed to find a working config file somewhere, but no such luck this time.

I get that this is probably extremely simple if you know how it works, but I don't.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9867
  • Debugger - SynEdit - and more
    • wiki
Re: "Configure Lazarus IDE"
« Reply #1 on: November 09, 2022, 10:23:33 am »
If you move FPC, then (most likely) your fpc.cfg (which usually contains absolute paths) is broken.
This file is not part of the dialog, Lazarus expects a working FPC.

Otherwise (most) of the dialog should be straight forward. If you installed a new FPC (and removed the old), then just find the paths/files requested.

"FPPKG" is the one item that (IMHO) is an issue. But it can be skipped too.
Create a file lazarus.cfg in your lazarus folder (next to lazarus.exe and startlazaru.exe) and put the following line in it (requires 2.3.0 / main branch):
Code: Text  [Select][+][-]
  1. --skip-checks=Debbugger,Fppkg

Debugger, can be skipped, if you use FpDebug.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: "Configure Lazarus IDE"
« Reply #2 on: November 09, 2022, 11:17:52 am »
"FPPKG" is the one item that (IMHO) is an issue. But it can be skipped too.
Create a file lazarus.cfg in your lazarus folder (next to lazarus.exe and startlazaru.exe) and put the following line in it (requires 2.3.0 / main branch):
Code: Text  [Select][+][-]
  1. --skip-checks=Debbugger,Fppkg

Thanks for that Martin, I've neither seen it documented nor seen it mentioned when various other people have been having problems.

Another way is to use an fppkg.cfg from an older version, I posted one (to get it into the record) at the link below.

https://forum.lazarus.freepascal.org/index.php/topic,60994.msg457678.html

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: "Configure Lazarus IDE"
« Reply #3 on: November 09, 2022, 11:19:52 am »
Ok. It seems you need:

1. A bootstrap compiler with tools.
2. A working install.
3. A compiled repository.
4. 2 or more cfg files with stuff.

I cannot get it to work. Whatever. Fortunately, there's fpcupdeluxe.

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: "Configure Lazarus IDE"
« Reply #4 on: November 09, 2022, 11:23:29 am »
If you move / build FPC / Lazarus, you get this dreaded dialog, with a lot of red exclamation marks, that I cannot resolve. Is there a manual?
What I always do is on the first exclamation mark browse to the FPC directory, then the bin and select fpc.exe.
Then the second needs to be set to the FPC directory itself.
After that, the other options usually fall into place and you can press Start IDE.

I haven't found a method to create a default config after doing a complete clean install from trunk so I always get that dialog the first time I start afterwards.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: "Configure Lazarus IDE"
« Reply #5 on: November 09, 2022, 11:29:01 am »
After that, the other options usually fall into place and you can press Start IDE.

I agree, at least on Linux. There /used/ to be problems- ten years or more ago- with the dialogue allowing insufficient delay before trying to auto-check a part-entered name, but apart from that the only problem I've had is that extremely frustrating one relating to fpc.cfg which appears to be the IDE demanding an older version of the file than FPC now thinks is standard.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9867
  • Debugger - SynEdit - and more
    • wiki
Re: "Configure Lazarus IDE"
« Reply #6 on: November 09, 2022, 11:35:49 am »
1) Are you compiling your own FPC ?

If you install it (depending on OS?) with the FPC installer then you may need 2 or 3 installations (compiler&rtl / packages (if not part of the first) / sources).
You can use Lazarus without FPC sources, but codetools will be limited.

If you compile it yourself, then "make install" should do the work. But you may want to check => there should be an fpc.cfg file
- on Linux this is can be in various places / including global /etc )
  on linux you also need ppc* in the PATH env. So *only* one fpc install (there are ways to get more than one, but ....)
- on Windows it should be next to the fpc.exe

In either case the fpc.cfg contains pathes (fully qualified) to the ppu directories.
(And if you have more than one fpc install, and the wrong fpc.cfg is found, then the compiler will not work  / On Windows, the correct file should be found as it is in the same dir as fpc.exe)

So then you should have:
- The fpc sources (downloaded, or git clone, or exported from git, ....)
- the installed fpc binaries (fpc /ppc* / ....)
- an fpc.cfg that contains unit paths to the correct ppu of the RTL and fpc-packages
 
Test that the compiler works outside the Lazarus IDE.



2) With the above you have all that you need to fill in, into the setup-dialog (ignore debugger and fppkg and silence them / and configure fpdebug if not done automatically)

If you have more than one Lazarus, then check the wiki for multiple lazarus (create a lazarus.cfg with a --pcp=...)





config files:

FPC: As above: fpc.cfg

Lazarus: ~/.lazarus   C:\Users\USERNAME\AppData\Local\lazarus
-various in primary config path:
  EnvironmentOptions.xml  contains paths to fpc, and various directories
  packagefiles.xml  CACHE of where your package .lpk files are (if you have one and the same package in several location, make sure it is correct)
  *.xml  like EditorOptions, but does not affect startup
 

FPPKG: One config file. Not sure of details
Can be ignored in most cases.
« Last Edit: November 09, 2022, 11:42:31 am by Martin_fr »

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: "Configure Lazarus IDE"
« Reply #7 on: November 09, 2022, 11:53:43 am »
Just did a clean trunk build with "make fpc_baseinfo all install" on FPC and "make bigide" on Lazarus.
It all seems to work fine.

I didn't get the fppkg anymore in the dialog.
Selected fpc.exe and the Compiler, Make and Debugger automatically filled in.
After that I only needed to set the fpc directory and was good to go.

BTW. Is there an option to set these automatically after compilation/build?
(I'll try to set an environment variable in my script the next time I build to see if the dialog picks it up)

It also bothers me I always need to select English (while my Windows is set to English and not Dutch).


MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: "Configure Lazarus IDE"
« Reply #8 on: November 09, 2022, 12:21:38 pm »
FPPKG: One config file. Not sure of details
Can be ignored in most cases.

In that case please could we /urgently/ have an "ignore this" button on that initial configuration screen.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9867
  • Debugger - SynEdit - and more
    • wiki
Re: "Configure Lazarus IDE"
« Reply #9 on: November 09, 2022, 12:44:40 pm »
FPPKG: One config file. Not sure of details
Can be ignored in most cases.

In that case please could we /urgently/ have an "ignore this" button on that initial configuration screen.

Feel free to add to the bugtracker.


Here are some details about the whole FPPKG (as far as I know / could be wrong).

1) There is a repository (like OPM) of packages that can be used with fpc, and don't need Lazarus.
I don't have the URL.

2) The config (on Windows) is in
   C:\Users\USERNAME\AppData\Local\FreePascal\fppkg\

If you had a config for longer, it can contain old URL (timeout), and they may only be updated if you delete the config by hand (at least I had that issue, and it took me a year to find out)

3) If you use packages from there (installed via fppkg, outside of Lazarus), and you have Lazarus correctly configured, then the benefit you get is, that Lazarus will show those packages in the dependencies of other packages. (Afaik, it is display only)

For that Lazarus must call fppkg (on startup), and this connects to the server, and adds time to the startup.

4) If you switch between different versions of fpc, there is only one fppkg config, and the folder has ppu pre-build by the fpc that was used at the time....

5) Some of the fppkg packages have an lpk file and can be downloaded and used "Lazarus style"... (downloading manually, means follow dependencies by manually / same for getting updates :( )

---
And that is all I gathered over the years.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: "Configure Lazarus IDE"
« Reply #10 on: November 09, 2022, 05:29:16 pm »
Feel free to add to the bugtracker.

There's already a three-year-old bug report for this.

https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/35254

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

BrunoK

  • Sr. Member
  • ****
  • Posts: 452
  • Retired programmer
Re: "Configure Lazarus IDE"
« Reply #11 on: July 15, 2023, 07:28:56 pm »
Does this thing (FPPKG) work at least in Linux ?

Does someone use it ?

In windows it is so riddled of error regarding places where the compiler is, the fpc source are etc... not giving any consideration to the lazarus options. Cryptic labels on the configuration + windows that opens nearly fully out of the screen.

Does someone use it ? Would it be justified to salvage it.

Please know all, remind some of us can read code, so ironic comments are not welcome.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9867
  • Debugger - SynEdit - and more
    • wiki
Re: "Configure Lazarus IDE"
« Reply #12 on: July 15, 2023, 07:42:26 pm »
Does this thing (FPPKG) work at least in Linux ?

Does someone use it ?

In windows it is so riddled of error regarding places where the compiler is, the fpc source are etc... not giving any consideration to the lazarus options. Cryptic labels on the configuration + windows that opens nearly fully out of the screen.

Does someone use it ? Would it be justified to salvage it.

I believe there are people who use it.

In any case, afaik Lazarus 3.0  does no longer have it in the setup dialog.
I am not sure if those who use it, now need to install a package, or if the IDE detects if there is a working version.

There are some packages distributed via fppkg. They can alternatively be downloaded, and depending on if they have an lpk file be used that way, or by adding paths.



wp

  • Hero Member
  • *****
  • Posts: 11916
Re: "Configure Lazarus IDE"
« Reply #13 on: July 15, 2023, 08:13:28 pm »
I once bookmarked this documentation of fppkg: https://fppkg.cnoc.nl/documentation

TRon

  • Hero Member
  • *****
  • Posts: 2513
Re: "Configure Lazarus IDE"
« Reply #14 on: July 15, 2023, 09:02:20 pm »
If you move FPC, then (most likely) your fpc.cfg (which usually contains absolute paths) is broken.
Not most likely but /will/ be broken. By default it indeed uses absolute paths. You can fix that with supplying a custom config for fpmkcfg (though I'm note sure how to incorporate that into the existing build script).

But easier, and also let Lazarus always find your "FPC executable" is not to use the standard solution that relies on the path environment variable (and fpc(.exe)).

Instead, let your path point (that will be static) to something like a script directory which contain a shell script named fpc and let that invoke the commandline compiler (using the installed/moved path). Though it might be Lazarus picked up on the fpc symlink (pointing to the fpc script) that is located in the same script directory.

Besides that you can make a fpc.cfg file that makes use of an environment variable so that you are able to convert all absolute paths to relative paths (see also the remark about fpmkcfg).

fwiw I always wondered why it is not possible for fpc.cfg (or the compiler) to set a root directory which would then allow to use relative paths for the rest of the configuration file. On the other hand it is solvable with a environment variable but unfortunately for Windows users that requires admin rights (never understood that move from M$).
« Last Edit: July 15, 2023, 09:48:07 pm by TRon »

 

TinyPortal © 2005-2018