Recent

Author Topic: Need Lazarus 1.4.x in Ubuntu 22.04 [workaround found]  (Read 3219 times)

99Percent

  • Full Member
  • ***
  • Posts: 160
Need Lazarus 1.4.x in Ubuntu 22.04 [workaround found]
« on: June 23, 2023, 02:16:38 am »
I need to recover and upgrade some very old legacy code written in Lazarus 1.4.4

However it seems like Lazarus 1.4 cannot be compiled with the FPC compiler that Ubuntu supplies through apt (>3.2) fpcupdeluxe throws this error:

Code: Bash  [Select][+][-]
  1. /home/david/fpcupdeluxe/lazarus/components/codetools/codecache.pas(1173,12) Error: (4103) Invalid assignment, procedures return no value

I tried to install the version of FPC that I had running with my legacy code which is 2.6.4 with fpcupdeluxe but it throws a cryptic error 512 (no "details" given):
Code: Text  [Select][+][-]
  1. /home/david/fpcupdeluxe/fpcsrc/compiler/ppc1 -Ur -Ur -Xs -O2 -n -Fi../inc -Fi../x86_64 -Fi../unix -Fix86_64 -FE. -FU/home/david/fpcupdeluxe/fpcsrc/rtl/units/x86_64-linux -Cg -Sg -vw-n-h-l-d-u-t-p-c- -dx86_64 -dRELEASE -Us -Sg system.pp
  2.  
  3. fpcupdeluxe: ERROR: FPC Native Installer (BuildModule: FPC): Error running /usr/bin/make for FPC failed with exit code 512
  4. . Details:

Apparently fpcupdeluxe can only compile FPC stable 3.2 in ubuntu 22.04

Is this possible to do or will I have to create a VM with Ubuntu 20.04 or 18.04 to be able to recover my old IDE?
« Last Edit: June 28, 2023, 01:24:48 am by 99Percent »

TRon

  • Hero Member
  • *****
  • Posts: 4272
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #1 on: June 23, 2023, 04:41:50 am »
Is this possible to do or will I have to create a VM with Ubuntu 20.04 or 18.04 to be able to recover my old IDE?
You could try and give https://sourceforge.net/projects/freepascal/files/Linux/2.6.4/fpc-2.6.4.x86_64-linux.tar/download a whirl.
Today is tomorrow's yesterday.

dbannon

  • Hero Member
  • *****
  • Posts: 3305
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #2 on: June 23, 2023, 07:25:44 am »
And some help installing it -

https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#FPC_Tar_Balls

Then, build Lazarus 1.4.4 from source, https://wiki.freepascal.org/Installing_Lazarus_on_Linux#Build_Lazarus_from_Source

Note neither needs to be "installed".

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4272
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #3 on: June 23, 2023, 05:59:12 pm »
fwiw: I tried to do exactly that on my bookworm distro but it seems that 2.6.4 generates segfaulting executables for me. I need more time to investigate what might be causing it (maybe try to build the compiler from source is a better option as the pre-compiled version perhaps relied on something that conflicts with my current setup).
Today is tomorrow's yesterday.

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #4 on: June 23, 2023, 11:50:04 pm »
I was able to install fpc 2.6.4 from the link provided by TRon.

But it Lazarus 1.4.x will not build from source.

...
make -C ide ide
make[1]: Entering directory '/home/david/Downloads/lazarus-t-fixes-1_4/ide'
/usr/bin/mkdir -p ../units/x86_64-linux/gtk2
../tools/svn2revisioninc .. revision.inc
make[1]: *** [Makefile:4212: revisioninc] Segmentation fault

I might be missing some dependency? gtk2?


TRon

  • Hero Member
  • *****
  • Posts: 4272
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #5 on: June 23, 2023, 11:52:26 pm »
I might be missing some dependency? gtk2?
No, you seem to run into the same issue as I seem to have. The tool svn2revisioninc is segfaulting.
Today is tomorrow's yesterday.

dbannon

  • Hero Member
  • *****
  • Posts: 3305
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #6 on: June 24, 2023, 02:27:33 am »
I was able to install fpc 2.6.4 from the link provided by TRon.

But it Lazarus 1.4.x will not build from source.

...
make -C ide ide
make[1]: Entering directory '/home/david/Downloads/lazarus-t-fixes-1_4/ide'
/usr/bin/mkdir -p ../units/x86_64-linux/gtk2
../tools/svn2revisioninc .. revision.inc
make[1]: *** [Makefile:4212: revisioninc] Segmentation fault

I might be missing some dependency? gtk2?

You are seeing that segfault during the build phase ?  I'm guessing here that its lazbuild that is failing. I wonder if a current lazbuild binary would do a better job ?  I doubt there would be much difference between the behaviour of the old and new lazbuild ?

But I do wonder if you are heading in the wrong direction ?

Building a VM of an old distro might be a lot easier, I had an old U16.04 Mate VM in my archives, I cloned it, installed FPC 3.0.0 from the Ubuntu repo and pulled down the Lazarus Fixes_1.4 source, built in a few minutes, passed the one button window test.

(and the goths would be really excited, it all came up in a dark theme !)

On the other hand, if you are doing anything more than the simplest fix to your app, maybe you would be better bringing it up to a current version of FPC/Lazarus ?  Long term, might be the best approach. FPC/Lazarus tries quite hard to be backwardly compatible, some things must break but probably not too many ?  Perhaps ....

Davo

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4272
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #7 on: June 24, 2023, 05:15:47 am »
You are seeing that segfault during the build phase ?  I'm guessing here that its lazbuild that is failing. I wonder if a current lazbuild binary would do a better job ?  I doubt there would be much difference between the behaviour of the old and new lazbuild ?
it is FPC that created/compiled the svn2revisioninc. AS said, it is FPC 2.6.4 that seem unable to create executables without segfaulting. A simple hello world compiled with 2.6.4 will also segfault. Unfortunately there is nothing that lazbuild can do to help there.

Quote
But I do wonder if you are heading in the wrong direction ?
True.

I would try to load into the latest Lazarus first but it might be TS already tried that and the jump from 1.4.1 to 2.2.6 is too big and causes other issues or perhaps some 3th party components are not available/compatible for latest Lazarus (anymore).



Unable to build fpc 2.6.4 (bootstrap 2.6.2) and 3.2.0 (bootstrap 3.0.4) from source, both segfaulting during build process. First version that does build for me on x86_64 bookworm is 3.2.2 (bootstrap 3.2.0) which seem to suggest that 3.2.0 is the first version to be working on this setup.
« Last Edit: June 24, 2023, 07:54:03 am by TRon »
Today is tomorrow's yesterday.

dbannon

  • Hero Member
  • *****
  • Posts: 3305
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #8 on: June 24, 2023, 01:08:36 pm »
Perhaps I was not clear.

Ubuntu 16.04 has FPC 3.0.0 in its official repo, thats a short step up from 2.6.4.

And, in practice, a short enough step that fpc 3.0.0 can build Lazarus fixes_1_4. And fixes_1_4 is almost certainly what 99Percent needs.

Putting a VM together must be far more practicable than trying to build the old FPC/Lazarus on a current system.  It took me about 10 minutes, allow another 20 minutes to build the Virtual Box VM. The added benefit might be that you can then, when this upgrade is done, tuck that VM away for next time. And you can bet there will be a next time !

Davo

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4272
Re: Need Lazarus 1.4.x in Ubuntu 22.04
« Reply #9 on: June 24, 2023, 01:20:03 pm »
Perhaps I was not clear.
No, my bad as I misunderstood.

Quote
Putting a VM together must be far more practicable than trying to build the old FPC/Lazarus on a current system
A full build (including dependencies and fetching them) takes about 5-10 minutes and I never had issues doing so with bullseye/stretch so, it's a first for me  %)
Today is tomorrow's yesterday.

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Need Lazarus 1.4.x in Ubuntu 22.04 [workaround found]
« Reply #10 on: June 28, 2023, 01:23:18 am »
I gave up installing Lazarus 1.4.x in Ubuntu 22.04, apparently some libraries that come in Ubuntu 22.04 are simply incompatible.

Notably fpcupdeluxe is completely useless here. I was not even able to use the fpc 2.6.4 I was able to get working, to use with fpcupdeluxe.

The way I got it to work was to first install qemu, and create an Ubuntu 18.04 virtual machine.

I had fortunately saved the source files for Lazarus 1.4.4, FPC 2.6.4 and fpc-src 2.6.4. The Lazarus 1.4 that comes in the lazarus github (t-fixes-1_4) did not work.

I compiled fpc and fpc-src, lazarus 1.4.4 and installed the required packages (which I had also saved), and is now working at least good enough to be able to upgrade all the code to the latest and greatest versions.

 

TinyPortal © 2005-2018