Recent

Author Topic: [SOLVED] Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD  (Read 6447 times)

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
After installing FPC 3.2.2 (with sources) i try to gmake clean bigide and it crashes half the way
Code: [Select]
(3104) Compiling iphttpbroker.pas
Fatal: (10022) Can't find unit cNetDB used by netdb
Fatal: (1018) Compilation aborted
gmake[2]: *** [Makefile:3294: turbopoweripro.ppu] Error 1
gmake[2]: Leaving directory '/tmp/lazarus/components/turbopower_ipro'
gmake[1]: *** [Makefile:1829: bigide] Error 2
gmake[1]: Leaving directory '/tmp/lazarus/components'
gmake: *** [Makefile:3729: bigidecomponents] Error 2
It's OpenBSD 7.0 AMD64.

Now, i've already ran into this error once, but DonAlfredo has provided a patch and the error has been averted for good. But now, even after i edited /usr/share/fpcsrc/3.2.2/packages/fcl-net/fpmake.pp to change the line
Code: Pascal  [Select][+][-]
  1. T:=P.Targets.AddUnit('cnetdb.pp',[linux,freebsd,solaris,android])
to
Code: Pascal  [Select][+][-]
  1. T:=P.Targets.AddUnit('cnetdb.pp',[linux,freebsd,openbsd,dragonfly,solaris,android]);
it still fails to build.

Any ideas?
« Last Edit: March 21, 2022, 09:53:25 pm by TCH »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11727
  • FPC developer.
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #1 on: February 05, 2022, 04:16:51 pm »
Do a "make distclean"  _Twice_ and retry.

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #2 on: February 07, 2022, 06:19:08 pm »
Why? I do this from a script and the script pulls the sources of Lazarus each time. There is nothing there to clean. Or you mean this?
Code: Bash  [Select][+][-]
  1. gmake clean bigide
  2. make distclean
  3. make distclean
  4. gmake clean bigide

PascalDragon

  • Hero Member
  • *****
  • Posts: 5644
  • Compiler Developer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #3 on: February 08, 2022, 09:45:38 am »
Why? I do this from a script and the script pulls the sources of Lazarus each time. There is nothing there to clean.

cNetDB is part of FPC, not Lazarus. So you need to make sure that FPC is cleanly rebuild which is what marcov meant.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11727
  • FPC developer.
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #4 on: February 08, 2022, 09:48:30 am »
I thought you were rebuilding FPC.  You rebuild Lazarus after modifying FPC sources, but not installed FPC.

This is wrong. You need to fully rebuild FPC and install it over the old version.

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #5 on: February 09, 2022, 07:36:25 pm »
Oh, i see...but if FPC should be rebuilt when that file has been changed, then why did it work with Lazarus 2.0.12 by simply modifying it?

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #6 on: February 10, 2022, 01:48:45 pm »
Using make is only yielding a ton of errors; gmake should be used.

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #7 on: February 10, 2022, 02:14:54 pm »
I've rebuilt FPC and this the result i got when i tried to build Lazarus:
Code: [Select]
(1002) Target OS: OpenBSD for x86-64
(3104) Compiling fcllaz.pas
(10001) PPU Loading /usr/lib/fpc/3.2.2/units/x86_64-openbsd/fcl-db/db.ppu
(10011) PPU Source: db.pas not available
(10011) PPU Source: dataset.inc not available
(10011) PPU Source: fields.inc not available
(10011) PPU Source: datasource.inc not available
(10011) PPU Source: database.inc not available
(10011) PPU Source: dsparams.inc not available
(10028) Recompiling DB, checksum changed for /usr/local/lib/fpc/3.2.2/units/x86_64-openbsd/rtl/classes.ppu
/tmp/lazarus/packager/registration/fcllaz.pas(11,3) Fatal: (10022) Can't find unit DB used by fcllaz
Fatal: (1018) Compilation aborted
gmake[1]: *** [Makefile:3294: fcllaz.ppu] Error 1
gmake[1]: Leaving directory '/tmp/lazarus/packager/registration'
gmake: *** [Makefile:3712: registration] Error 2
I think it is the best if i publish the script i use to do this:
Code: Bash  [Select][+][-]
  1. #!/bin/sh
  2.  
  3. if [ "$#" -lt 3 ];
  4. then
  5.         echo "Usage: install_lazarus_openbsd.sh <i386/x86_64> <fpc version> <lazarus version> [lazarus source revision]"
  6.         exit 0
  7. fi
  8.  
  9. case "$1" in
  10.         "i386")
  11.                 carch="386"
  12.         ;;
  13.         "x86_64")
  14.                 carch="x64"
  15.         ;;
  16.         *)
  17.                 echo "Invalid architecture."
  18.                 exit 0
  19.         ;;
  20. esac
  21.  
  22. pkg_add bash
  23. pkg_add gtk2mm
  24. pkg_add gmake
  25. pkg_add unzip
  26.  
  27. cd /tmp
  28.  
  29. if [ ! -f "/usr/bin/ppc""$carch" ];
  30. then
  31.         DNAME="fpc-""$2"".""$1""-openbsd"
  32.         ANAME="$DNAME"".tar"
  33.         ftp "ftp://ftp.hu.freepascal.org/pub/fpc/dist/""$2""/""$1""-openbsd/""$ANAME" -o "$ANAME"
  34.         if [ ! -f "$ANAME" ];
  35.         then
  36.                 echo "Could not download FreePascal binaries."
  37.                 exit 0
  38.         fi
  39.         tar -xvf "$ANAME"
  40.         rm "$ANAME"
  41.         cd "$DNAME"
  42.         echo "Install to /usr/ instead of /usr/local/"
  43.         ./install.sh
  44.         cd ..
  45.         rm -rf "$DNAME"
  46. fi
  47.  
  48. cd /tmp
  49.  
  50. if [ ! -f "/usr/share/fpcsrc/""$2""/Makefile" ];
  51. then
  52.         ANAME="fpc-""$2"".source.zip"
  53.         ftp "https://netcologne.dl.sourceforge.net/project/freepascal/Source/""$2""/""$ANAME" -o "$ANAME" -S dont
  54.         if [ ! -f "$ANAME" ];
  55.         then
  56.                 echo "Could not download FreePascal sources."
  57.                 exit 0
  58.         fi
  59.         unzip "$ANAME"
  60.         rm "$ANAME"
  61.         mkdir /usr/share/fpcsrc/
  62.         mv "fpc-""$2" "/usr/share/fpcsrc/""$2"
  63.         cd "/usr/share/fpcsrc/""$2"
  64.         sed -i "s/'cnetdb\.pp',\[linux,freebsd,solaris,android\]/'cnetdb\.pp',\[linux,freebsd,openbsd,dragonfly,solaris,android\]/" "packages/fcl-net/fpmake.pp"
  65.         gmake distclean
  66.         gmake distclean
  67.         gmake install
  68. fi
  69.  
  70. cd /tmp
  71.  
  72. if [ ! -f "/usr/local/lazarus/lazarus" ];
  73. then
  74.         mkdir /usr/local/lazarus
  75.         if [ ! -d "lazarus" ];
  76.         then
  77.                 REV=""
  78.                 if [ "$4" != "" ];
  79.                 then
  80.                         REV="-""$4"
  81.                 fi
  82.                 ANAME="lazarus-""$3""$REV"".zip"
  83.                 ftp "https://netix.dl.sourceforge.net/project/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%20""$3""/""$ANAME" -o "$ANAME" -S dont
  84.                 if [ ! -f "$ANAME" ];
  85.                 then
  86.                         echo "Could not download Lazarus sources."
  87.                         exit 0
  88.                 fi
  89.                 unzip "$ANAME"
  90.                 rm "$ANAME"
  91.         fi
  92.         cd lazarus
  93.         gmake clean bigide
  94.         if [ -f lazarus ];
  95.         then
  96.                 gmake install
  97.         fi
  98.         cd ..
  99.         if [ -f "/usr/local/share/lazarus/lazarus" ];
  100.         then
  101.                 rm -rf lazarus
  102.         fi
  103. fi
  104.  
I call it with ./install_lazarus_openbsd.sh x86_64 3.2.2 2.2.0 0
« Last Edit: February 10, 2022, 04:10:57 pm by TCH »

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #8 on: February 15, 2022, 03:32:21 pm »
Up.

Any tips what i am doing wrong?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11727
  • FPC developer.
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #9 on: February 15, 2022, 05:16:07 pm »
Change to "make all install"

Thaddy

  • Hero Member
  • *****
  • Posts: 15506
  • Censorship about opinions does not belong here.
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #10 on: February 15, 2022, 06:23:26 pm »
Or make clean all install
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #11 on: February 16, 2022, 01:27:47 pm »
Using make only yields tons of error. If i do:
Code: Bash  [Select][+][-]
  1. gmake distclean
  2. gmake distclean
  3. gmake clean all install
then nothing is changed, it prints the same error as above when i try to compile Lazarus.
However i noticed, that the installing command stopped with this error message:
Code: [Select]
gmake[1]: Leaving directory '/usr/share/fpcsrc/3.2.2/installer'
/bin/rm -f build-stamp.*
/bin/rm -f base.build-stamp.*
Makefile:2810: *** The only supported starting compiler version is 3.0.4. You are trying to build with 3.2.2..  Stop.

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #12 on: February 23, 2022, 10:13:15 pm »
Up.

Any ideas why is this failing?

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #13 on: February 23, 2022, 11:03:31 pm »
Quote
The only supported starting compiler version is 3.0.4. You are trying to build with 3.2.2..  Stop.

Did you build with FPC 3.0.4 or not?

TCH

  • Full Member
  • ***
  • Posts: 242
    • Oldschool computer
Re: Building Lazarus 2.2.0 with FreePascal 3.2.2 fails under OpenBSD
« Reply #14 on: March 03, 2022, 11:16:29 pm »
No, i did not, i used 3.2.2, but why should i use 3.0.4? This error message can't be serious. If i did not use gmake clean all install, just gmake install then it built with 3.2.2, it just cannot build Lazarus after then. Also, FPC should be able to compile itself, right?

 

TinyPortal © 2005-2018