Recent

Author Topic: Manual Lazarus build  (Read 2601 times)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11782
  • FPC developer.
Re: Manual Lazarus build
« Reply #15 on: August 20, 2024, 09:59:57 am »
So, let's start from the beginning  :)

I am on pure Windows so no cygwin, msys, wsl or whatever.

And you are doing a pure Win64 build?

Quote
I obtained the gnu tools for windows 64-bit and build and installed the FPC compiler (that went smooth).

(from FPC FPCBUILD repository, or a release I assume?)

Quote
First hurdle is that for some obscure reason the .exe file extension is forced by the makefile. Perhaps something to be expected for a platform that heavily relies on that extension (no it actually isn't, that is why the mime types exist) but it is annoying as hell. So, I had to waste quite some time to work around that issue.

I don't get this. Force an exe extension on what? The generated lazarus for a windows build? That sounds normal to me.

Quote
To make sure I got my head screwed on right I did display the make help to make sure what I can and can't use and for sure the make install option is advertised (though it does also tell at the bottom that you /can/ use install for which we can assume it is not required but also not forbidden or unsupported).

It could be an artifact of the makefile generator always generating it. Anyway, my knowledge runs out as said in the previous message. I never installed lazarus on Windows or linux, and am not 100% sure what it is meant to do.

But I never did Lazarus release packaging, don't know what steps are needed for that.


Bart

  • Hero Member
  • *****
  • Posts: 5375
    • Bart en Mariska's Webstek
Re: Manual Lazarus build
« Reply #16 on: August 20, 2024, 10:01:35 am »
IIRC the install_prefix doesn't work as expected for Lazarus.
I don't think the make file is really meant to do a "proper" install (as Windows installers do) on Windows.
Maybe we should make that clear on the wiki?

On Window one would normally:
- have an install of fpc (and thus the toolchain needed like make.exe)
- have the compiler in %path%
- build lazaus using make bigide (or make all)
- setup a shortcut to the ide

This suffices for multipe setups (I used to have truk and fixes built this way).

> First hurdle is that for some obscure reason the .exe file extension is forced by the makefile.

Well, on Windows executable are expected to have the .exe extension, so why does that bother you?

Bart

MarkMLl

  • Hero Member
  • *****
  • Posts: 7725
Re: Manual Lazarus build
« Reply #17 on: August 20, 2024, 10:22:09 am »
Now, that said, it built cleanly and runs fine. But why does it take Windows some 13 minutes to unzip a lazarus zipball and on the same hardware, Linux can do it in about 5 seconds ?  I know Windows file systems struggle with lots of files but there must be more than that going on ! A factor of 100 ??  Everything else seem as expected, its slower but not by a huge margin.

Zip or tar? I think I've seen that with some very old Windows ports of tar (which might also have lacked the compression options), and I believe it was down to a complete lack of any file buffering presumably because the libraries being used were unable to work out that input or output wasn't being piped.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

TRon

  • Hero Member
  • *****
  • Posts: 3300
Re: Manual Lazarus build
« Reply #18 on: August 20, 2024, 10:29:45 am »
And you are doing a pure Win64 build?
Yes.

Quote
(from FPC FPCBUILD repository, or a release I assume?)
From the FPC build binaries. But to be clear a normal FPC 3.2.2 and Lazarus 3.4 git checkout.

Quote
I don't get this. Force an exe extension on what? The generated lazarus for a windows build? That sounds normal to me.
As I wrote the original (otherwise working) FPC setup uses a script named fpc.bat that can be found by providing a path to to that file. I can launch FPC using fpc because of the existing .bat mime definition (another way is to use cmd extension or add a custom mime type).

- If I do not provide FPC=xxx then the lazarus makefile does not find the bat file (to be expected, nothing unexpected there).
- If I provide FPC=C:\scripts\fpc to lazarus make then it searches for fpc.exe
- If I provide FPC=C:\scripts\fpc.bat to lazarus make then it searches for fpc.bat.exe

To illustrate further, if I use the direct location of the fpc or ppc compiler than there is no (working) fpc.cfg file (environment variables setup in the script). Thus building lazarus fails because it can't find the fpc units. Trying to circumvent that by providing the unit directories causes an issue because lazarus searches for the menus unit and find that in the freevision package and tries to recompile that because providing unit directory at the lazarus make file as fpc opt override (put in front) the Lazarus unit directories.

I worked around that by creating a temporary custom fpc.cfg file that fed that to the lazarus makefile as OPT=

Quote
It could be an artifact of the makefile generator always generating it. Anyway, my knowledge runs out as said in the previous message. I never installed lazarus on Windows or linux, and am not 100% sure what it is meant to do.
In basics it copies the files of the build to another location but with that allows to setup a fair amount of custom directories for certain files. That way one is able to make a consistent setup at another location. Very convenient in case you cross build for different platforms or wish to create different versions in a single session.

It is also used by (cross)zipinstall ibn order to create an archived version of the build.

Quote
But I never did Lazarus release packaging, don't know what steps are needed for that.
Well release packaging is something completely different, at least for windows. The release uses a special installer (inno) that puts everything into a single executable. To make it clear, that is not what I am attempting to accomplish. And for a release build I (sh/w)ould have used FPCBuild instead.

My humble goal is to have the compiled parts out of the build directory, something that works as intended on Linux and is fairly common for makefiles to do when issuing a make install.

As said, I do not mind if that is not the intention of the makefile (for a particular target or otherwise) but it would have been far more practical to either not list the install option or issue a simple echo that it ain't supported instead of some half baked attempt at doing something that it isn't able to do (as it simply waste everyone's time) :)
« Last Edit: August 20, 2024, 10:42:40 am by TRon »
This tagline is powered by AI

Thaddy

  • Hero Member
  • *****
  • Posts: 15747
  • Censorship about opinions does not belong here.
Re: Manual Lazarus build
« Reply #19 on: August 20, 2024, 11:03:37 am »
I just tested the old way on windows 11:

- checkout lazarus
- cd  <where you checked out>
- make clean all bigide
- edit fpc.cfg to include the lazarus directories, wildcard * is allowed. Only needed first time.
- start with startlazarus
Result: complete working Lazarus.

This is because I did not believe you still not succeeded. I was right...
« Last Edit: August 20, 2024, 12:18:24 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

TRon

  • Hero Member
  • *****
  • Posts: 3300
Re: Manual Lazarus build
« Reply #20 on: August 20, 2024, 11:28:19 am »
IIRC the install_prefix doesn't work as expected for Lazarus.
Well, it does for Linux.

Quote
I don't think the make file is really meant to do a "proper" install (as Windows installers do) on Windows.
Make install can mean different things but usually that the build is installed into your system. I am aware that the windows version of FPC and Lazarus takes another approach with using inno setup when using FPCBuild.

Basically it copies over the (required) files to a location usually in your system but optionally to a location of your choice. Configure, make then make install is the usual sequence.

Quote
Maybe we should make that clear on the wiki?
I prefer the makefile itself but somewhere might be a good start  :)

Quote
On Window one would normally:
- have the compiler in %path%
Not necessary. It is a choice.

Quote
- build lazaus using make bigide (or make all)
- setup a shortcut to the ide
Not an option for doing multiple builds... and what is up with dragging the git history alongside your installation(s) ? (it is not only you)

Quote
This suffices for multipe setups (I used to have truk and fixes built this way).
Yes, I know the drill I run 12 different FPC compilers and 6 versions of Lazarus from a usb flashdrive :)

Quote
> First hurdle is that for some obscure reason the .exe file extension is forced by the makefile.
Well, on Windows executable are expected to have the .exe extension, so why does that bother you?
See reply to marcov.
This tagline is powered by AI

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11782
  • FPC developer.
Re: Manual Lazarus build
« Reply #21 on: August 20, 2024, 01:24:31 pm »
As I wrote the original (otherwise working) FPC setup uses a script named fpc.bat that can be found by providing a path to to that file. I can launch FPC using fpc because of the existing .bat mime definition (another way is to use cmd extension or add a custom mime type).

If you employ that hack, but I'm not sure that hack is valid in all cases. Yes, it works if you execute manually from a shell, but I wonder if programs like lazarus and fpmake execute the compiler over the shell by default, rather than directly.  You can put options in OPT=

It might work if you manually launch the batchfiles from ashell. Other programs (like lazarus/lazbuild and fpmake) might not execute programs over the shell since that even delays compiler execution more on windows.

Quote
I worked around that by creating a temporary custom fpc.cfg file that fed that to the lazarus makefile as OPT=

Yeah, that  (-n and @) is the way. 

Quote
Quote
It could be an artifact of the makefile generator always generating it. Anyway, my knowledge runs out as said in the previous message. I never installed lazarus on Windows or linux, and am not 100% sure what it is meant to do.
In basics it copies the files of the build to another location but with that allows to setup a fair amount of custom directories for certain files.

That is what the auto generated part does, but it is meant to, or a side effect of using the generator for the main build ?  Toplevel makefiles are more complicated anyway, also with FPC.

Quote
That way one is able to make a consistent setup at another location. Very convenient in case you cross build for different platforms or wish to create different versions in a single session.

I understand why (though I would go for a build directory approach if I'd change anything), but as I haven't done it in nearly 25 years Lazarus, I have my doubts.

Quote
It is also used by (cross)zipinstall ibn order to create an archived version of the build.

Similarly a byproduct of fpcmake the makefile generator. The old textmode installs of FPC (before the inno setups) used such zips. But lazarus went with innosetup much earlier.

Quote
My humble goal is to have the compiled parts out of the build directory, something that works as intended on Linux and is fairly common for makefiles to do when issuing a make install.

Most applications don't use their own sourcecode to recompile themselves. In that case Lazarus is special. You need source to sanely operate it.

Quote
As said, I do not mind if that is not the intention of the makefile (for a particular target or otherwise) but it would have been far more practical to either not list the install option or issue a simple echo that it ain't supported instead of some half baked attempt at doing something that it isn't able to do (as it simply waste everyone's time) :)

Maybe it is possible to override such targets in Makefile.fpc. But that is always a bit of a hassle.

TRon

  • Hero Member
  • *****
  • Posts: 3300
Re: Manual Lazarus build
« Reply #22 on: August 21, 2024, 12:31:58 am »
If you employ that hack, but I'm not sure that hack is valid in all cases.
I am opposing to naming it a hack. The compiler clearly supports it.

Quote
Yes, it works if you execute manually from a shell, but I wonder if programs like lazarus and fpmake execute the compiler over the shell by default, rather than directly.
For Linux that works. Having said that, with every new release of Lazarus it seems to restrict these kind of things more and more (another thing that annoys me to boredom because in the end my resistance against that kind of restraints will overcome). It is imho useless for Lazarus to restrict the compiler in what it is able to do.

Ofc you are correct regarding windows because the make system and Lazarus again expects a forced .exe. Lazarus issue can be fixed by pointing directly to the FPC exe and providing my custom fpc.cfg but then chokes that it is unable to locate the units because of the environment variables = Lazarus created this mess so lazarus is at fault for not accommodating normal compiler behaviour.

Every other 3th party editor out there has no issues whatsoever with my custom setup except for lazarus on Windows.

Quote
It might work if you manually launch the batchfiles from ashell. Other programs (like lazarus/lazbuild and fpmake) might not execute programs over the shell since that even delays compiler execution more on windows.
invoking lazbuild from a shell works that way as well. Lazarus for windows complains, see above paragraph.

Quote
That is what the auto generated part does, but it is meant to, or a side effect of using the generator for the main build ?  Toplevel makefiles are more complicated anyway, also with FPC.
It is as advertised in the main makefile help (for both FPC and Lazarus)

Quote
I understand why (though I would go for a build directory approach if I'd change anything), but as I haven't done it in nearly 25 years Lazarus, I have my doubts.
Yes, but it is going through hoops when the makefile advertises it as being supported.


Quote
Similarly a byproduct of fpcmake the makefile generator. The old textmode installs of FPC (before the inno setups) used such zips. But lazarus went with innosetup much earlier.
I have also no idea when that happened but i do know that since that change the makefile (well fpcmake file actually) seem to never have been touched again for Windows platform.

Quote
Most applications don't use their own sourcecode to recompile themselves. In that case Lazarus is special. You need source to sanely operate it.
Yes, but if that is part of an (normal) install then make install should automatically take care of that as well  :)

Quote
Maybe it is possible to override such targets in Makefile.fpc. But that is always a bit of a hassle.
I simply do not understand (well actually I do) that something that works out of the box for Linux isn't copied to also work for windows. It is literally a case of doing exactly the same thing but then for Windows.

The actually I do part stems from the fact that perhaps someone at some time had thought to create a Windows conform installation with the makefile(s) but along the way it was decided to use something like inno and this part of the makefile was left and hasn't received any love anymore.

Just for my own sanity... in case the whole fpmake system is finished (gnu make dependency removed as I presume that is/was the goal) then we would not be talking about this anymore , or would we ?
This tagline is powered by AI

 

TinyPortal © 2005-2018