Recent

Author Topic: [SOLVED] Build Error On AlmaLinux 8.9  (Read 4327 times)

hymcode

  • New Member
  • *
  • Posts: 27
[SOLVED] Build Error On AlmaLinux 8.9
« on: July 11, 2024, 07:54:07 pm »
Hello,
We are trying to build our software on a new AlmaLinux machine we are currently testing. To the best of my knowledge, I have set up the development environment identical to our CentOS 7.9 machine, however after executing the following command in a Terminal Window:

Code: Bash  [Select][+][-]
  1. $ lazbuild -B linuxconveripfiles.lpi

I get the following error messages:

Code: Bash  [Select][+][-]
  1. (9022) Compiling resource /PCSOURCE/NEXTLX_ALMA/LINUXPASCAL/lib/x86_64-linux/convertipfiles.or
  2. Error: No known file format detected for file 'convertipfiles.res'
  3. /PCSOURCE/NEXTLX_ALMA/LINUXPASCAL/convertipfiles.lpr(23,1) Error: (9029) Error while compiling resources
  4. /PCSOURCE/NEXTLX_ALMA/LINUXPASCAL/convertipfiles.lpr(23,1) Fatal: (10026) There were 1 errors compiling module, stopping
  5. Fatal: (1018) Compilation aborted
  6. Error: /usr/bin/ppcx64 returned an error exitcode
  7. Error: (lazarus) Compile Project, Target: convertipfiles: stopped with exit code 1
  8. Error: (lazbuild) failed compiling of project /PCSOURCE/NEXTLX_ALMA/LINUXPASCAL/linuxconvertipfiles.lpi

We have Free Pascal Compiler Version: 3.2.0,  lazbuild Version: 2.0.12 and they were installed via the yum package manager.

The files and directories listed above in the error messages are located on a Samba server which our AlmaLinux machine has mounted, and we are building within the mounted drive as the root user.

I hope this information helps, and thank you for your assistance.
« Last Edit: July 16, 2024, 04:31:43 pm by hymcode »
Don’t wish it were easier; wish you were better. – Jim Rohn

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Build Error On AlmaLinux 8.9
« Reply #1 on: July 12, 2024, 02:55:10 am »
Error: No known file format detected for file 'convertipfiles.res'

You are using a very old version of Lazarus (and FPC). Could it be that the convertipfiles.res was made by a newer version ? Not sure I'd recommend such old tools to be honest.

I'd also check its permissions, size (ie is it an empty file) and ownership given you have been running Lazarus as root. IMHO, that is very bad practice.

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

hymcode

  • New Member
  • *
  • Posts: 27
Re: Build Error On AlmaLinux 8.9
« Reply #2 on: July 12, 2024, 10:59:26 am »
Error: No known file format detected for file 'convertipfiles.res'

You are using a very old version of Lazarus (and FPC). Could it be that the convertipfiles.res was made by a newer version ? Not sure I'd recommend such old tools to be honest.

I'd also check its permissions, size (ie is it an empty file) and ownership given you have been running Lazarus as root. IMHO, that is very bad practice.

Davo

Hello Davo, I have removed the Lazarus development environment that is provided by yum as you're right it's very old and now have installed via the .rpm files found on Sourceforge.

I tried to build the software again but now I get the following error message:

Code: Bash  [Select][+][-]
  1. [root@dev00 LINUXPASCAL]# lazbuild -B linuxconvertipfiles.lpi
  2. Error: (lazarus) invalid Lazarus directory "/usr/lib64/lazarus/": directory not found
  3. Error: (lazarus) Building failed: linuxconvertipfiles.lpi

Any ideas on this?
Don’t wish it were easier; wish you were better. – Jim Rohn

af0815

  • Hero Member
  • *****
  • Posts: 1379
Re: Build Error On AlmaLinux 8.9
« Reply #3 on: July 12, 2024, 11:12:01 am »
One problem is, different linux use different path.

For me, i use often: fpc from the distribution and lazarus build from sources. Path are correct with this. And no root is nessesary. I never use shares as a base for the sources, always only a source control tool like git (or svn). With this, it is for me meaningless on what platform i have to work. And i am working on different linux, raspbian and windows.

BTW: I can use a crosscompiling sytsem to compile from windows to the linux targets. The only goal is, to have the correct libs on the windows machine for the different linux'es.
 
regards
Andreas

TRon

  • Hero Member
  • *****
  • Posts: 3650
Re: Build Error On AlmaLinux 8.9
« Reply #4 on: July 12, 2024, 11:19:14 am »
In addition to af0815's response and using the default package manager's version of fpc you can either work your way up if that version is too old or extract the ppc executable from the provided packages of the previous compiler version to use as bootstrap compiler for building the latest FPC compiler.

Building and installing Lazarus from source is a trivial matter.

There is no need whatsoever to run FPC and/or Lazarus as root and should be discouraged.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

cdbc

  • Hero Member
  • *****
  • Posts: 1673
    • http://www.cdbc.dk
Re: Build Error On AlmaLinux 8.9
« Reply #5 on: July 12, 2024, 11:44:27 am »
Hi
I'm wondering  ...isn't 'fpcupdeluxe' a viable option on AlmaLinux?!?
That worked great for me here.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Build Error On AlmaLinux 8.9
« Reply #6 on: July 12, 2024, 11:48:07 am »
Hmm, you are still building as root ?  Please do not confuse running as root on Linux with running as administrator on Windows, not the same thing.

RPM systems are not my specialty but I do know "some" use the library /usr/lib64/ and its possible the rpm install puts some executables there. That might mean the install you did has failed. My guess is the packages were not tested on  AlmaLinux but its just a guess.

Be cool if someone else here uses Alma to be honest ! Not sure if I have heard it mentioned here ...

Failing better advice from someone more knowledgeable, my only suggestion would be to remove the fpc and Lazarus rpms and install both directly into user space using a FPC tarball - https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#Downloading_FPC_tar_balls  and using that to build Lazarus.3.4 from source, (https://wiki.freepascal.org/Installing_Lazarus_on_Linux#Build_Lazarus_from_Source). Its how I always do such things. Lazarus in particular is a lot happier running purely in user space and both installs are very easy.

For FPC its just running a script from the tarball, and setting a path to the (local) install's bin dir. For Lazarus, just extract the source from a zip and run the command "make bigid". Don't bother to install lazarus, use it directly from its build directory.

If you want to give it a try, please have a look at those wiki pages and give us a yell if anything is not clear.

Benny - yes, I agree, a good case for fpcupdeluxe too. Probably be a lot quicker someone a bit out of their space.

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

hymcode

  • New Member
  • *
  • Posts: 27
Re: Build Error On AlmaLinux 8.9
« Reply #7 on: July 15, 2024, 12:56:51 pm »
Error: No known file format detected for file 'convertipfiles.res'

You are using a very old version of Lazarus (and FPC). Could it be that the convertipfiles.res was made by a newer version ? Not sure I'd recommend such old tools to be honest.

I'd also check its permissions, size (ie is it an empty file) and ownership given you have been running Lazarus as root. IMHO, that is very bad practice.

Davo

Hello Davo, I have removed the Lazarus development environment that is provided by yum as you're right it's very old and now have installed via the .rpm files found on Sourceforge.

I tried to build the software again but now I get the following error message:

Code: Bash  [Select][+][-]
  1. [root@dev00 LINUXPASCAL]# lazbuild -B linuxconvertipfiles.lpi
  2. Error: (lazarus) invalid Lazarus directory "/usr/lib64/lazarus/": directory not found
  3. Error: (lazarus) Building failed: linuxconvertipfiles.lpi

Any ideas on this?

Update: 15/07/2024
I was able to correct the build error message by updating the command to the following:

Code: Bash  [Select][+][-]
  1. lazbuild -B --primary-config-path=/usr/bin/ linuxconvertipfiles.lpi

Interestingly enough, after doing a complete clean install of the .rpm files again, which I got from SourceForge the original build command worked fine  %)
« Last Edit: July 15, 2024, 03:17:16 pm by hymcode »
Don’t wish it were easier; wish you were better. – Jim Rohn

hymcode

  • New Member
  • *
  • Posts: 27
Re: Build Error On AlmaLinux 8.9
« Reply #8 on: July 15, 2024, 03:03:48 pm »
In addition to af0815's response and using the default package manager's version of fpc you can either work your way up if that version is too old or extract the ppc executable from the provided packages of the previous compiler version to use as bootstrap compiler for building the latest FPC compiler.

Building and installing Lazarus from source is a trivial matter.

There is no need whatsoever to run FPC and/or Lazarus as root and should be discouraged.

Hello TRon, I am in agreement that the current build process used under the root user account is bad practice, and this is something I aim to address once I have a better understanding of the build process currently in use. Unfortunately, I do not have any documentation or knowledge as to why it is done this way, so best to understand what's currently at play before moving to a better system.
Don’t wish it were easier; wish you were better. – Jim Rohn

hymcode

  • New Member
  • *
  • Posts: 27
Re: Build Error On AlmaLinux 8.9
« Reply #9 on: July 15, 2024, 03:15:17 pm »
One problem is, different linux use different path.

For me, i use often: fpc from the distribution and lazarus build from sources. Path are correct with this. And no root is nessesary. I never use shares as a base for the sources, always only a source control tool like git (or svn). With this, it is for me meaningless on what platform i have to work. And i am working on different linux, raspbian and windows.

BTW: I can use a crosscompiling sytsem to compile from windows to the linux targets. The only goal is, to have the correct libs on the windows machine for the different linux'es.

Hello af0815, I would very much like to learn how I could achieve a cross compiling system from windows. This has been on my mind for a while now. The current history I have on this software that I am trying to get working is as follows:

  • Originally written and compiled for OpenVMS
  • Ported to CentOS 7 and compiled on the distro
  • Copied source code from CentOS 7 and now attempting to build on AlmaLinux

Currently, the source code is stored on a Windows Server and when building for Linux, the network directory is mounted via Samba and the lazbuild command is used to compile the source code.

Additionally, the majority of the source code was not written within the Lazarus IDE as there wasn't one for OpenVMS, it was all done using the inbuilt text editor (not sure if that affects anything).
Don’t wish it were easier; wish you were better. – Jim Rohn

Thaddy

  • Hero Member
  • *****
  • Posts: 16198
  • Censorship about opinions does not belong here.
Re: Build Error On AlmaLinux 8.9
« Reply #10 on: July 15, 2024, 04:10:15 pm »
If almalinux is as it states on their website binary compatible with Red Hat, there should be no problems at all. Did you try to install from a red hat package (RHEL)? That should simply work.
If I smell bad code it usually is bad code and that includes my own code.

hymcode

  • New Member
  • *
  • Posts: 27
Re: Build Error On AlmaLinux 8.9
« Reply #11 on: July 15, 2024, 05:29:34 pm »
I run a trial using my own basic Lazarus GUI program.

I was able to build the program successfully using Lazarus 2.2.4 on my Windows 10 machine.

I then mounted the samba share where the source is located on my AlmaLinux 8.9 machine, then execute the following command:

Code: Bash  [Select][+][-]
  1. lazbuild -B project1.lpi

I am no longer doing this as root, however I got the following error output:

Code: Bash  [Select][+][-]
  1. [tester@dev00 buildTest]$ lazbuild -B project1.lpi
  2. Hint: (11030) Start of reading config file /etc/fpc.cfg
  3. Hint: (11031) End of reading config file /etc/fpc.cfg
  4. Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
  5. Copyright (c) 1993-2021 by Florian Klaempfl and others
  6. Error: No known file format detected for file 'project1.res'
  7. (1002) Target OS: Linux for x86-64
  8. (3104) Compiling project1.lpr
  9. (3104) Compiling unit1.pas
  10. (9022) Compiling resource /DEVSOURCE/buildTest/lib/x86_64-linux/project1.or
  11. /DEVSOURCE/buildTest/project1.lpr(24,1) Error: (9029) Error while compiling resources
  12. /DEVSOURCE/buildTest/project1.lpr(24,1) Fatal: (10026) There were 1 errors compiling module, stopping
  13. Fatal: (1018) Compilation aborted
  14. Error: /usr/bin/ppcx64 returned an error exitcode
  15. Error: (lazarus) Compile Project, Target: /DEVSOURCE/buildTest/project1: stopped with exit code 1
  16. Error: (lazbuild) failed compiling of project /DEVSOURCE/buildTest/project1.lpi

I am really at a loss now with this all  %). My only guess is with the version of lazbuild on the AlmaLinux machine, which is at version 3.4
Don’t wish it were easier; wish you were better. – Jim Rohn

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11947
  • FPC developer.
Re: Build Error On AlmaLinux 8.9
« Reply #12 on: July 15, 2024, 09:23:51 pm »
Do you have gorc installed? Maybe redhat somehow packages that differently

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Build Error On AlmaLinux 8.9
« Reply #13 on: July 16, 2024, 02:21:46 am »
> Error: No known file format detected for file 'project1.res'

Seems to be consistently the problem. Further up, I suggested you check ownership, permissions and content of the .res file, did you ?

Apps like Lazarus that assume they are running as a user and are running in user spaces (where they have normal write and execute permissions) can get confused by running as root (seems thats behind us) and running on some network shares.  Someone mentioned the share above and I dismissed it but maybe wrongly !

Please check you have execute (and, write) permissions on the samba share. The samba config will list them, the mount command might list them but sometimes is fooled.  A really reliable way ?

Make a small executable script, copy it to the samba drive and run it !  (May be a good idea to check first line, RedHad can be funny)

Code: Pascal  [Select][+][-]
  1. #!/usr/bin/bash  
  2. echo "Hello world" > test.txt

Make a file with that content (lets call it test.bash) , ensure you do have bash in /usr/bin/bash and make that file executable, don't execute it using bash, make it executable -

Code: [Select]
>$ chmod u+x test.bash
and then run it (don't forget the dot slash at the start to ensure we run this file) -

Code: [Select]
>$ ./test.bash
Now, if you see no error message a new file should have appeared, "test.txt", lets look at it -

Code: [Select]
>$ cat test.txt
And we should see our "Hello World" message. If thats all good, I have wasted a few minutes of your time, sorry. If you seee a error message at any stage during that test, please report it here.

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

hymcode

  • New Member
  • *
  • Posts: 27
Re: Build Error On AlmaLinux 8.9
« Reply #14 on: July 16, 2024, 04:30:53 pm »
> Error: No known file format detected for file 'project1.res'

Seems to be consistently the problem. Further up, I suggested you check ownership, permissions and content of the .res file, did you ?

Apps like Lazarus that assume they are running as a user and are running in user spaces (where they have normal write and execute permissions) can get confused by running as root (seems thats behind us) and running on some network shares.  Someone mentioned the share above and I dismissed it but maybe wrongly !

Please check you have execute (and, write) permissions on the samba share. The samba config will list them, the mount command might list them but sometimes is fooled.  A really reliable way ?

Make a small executable script, copy it to the samba drive and run it !  (May be a good idea to check first line, RedHad can be funny)

Code: Pascal  [Select][+][-]
  1. #!/usr/bin/bash  
  2. echo "Hello world" > test.txt

Make a file with that content (lets call it test.bash) , ensure you do have bash in /usr/bin/bash and make that file executable, don't execute it using bash, make it executable -

Code: [Select]
>$ chmod u+x test.bash
and then run it (don't forget the dot slash at the start to ensure we run this file) -

Code: [Select]
>$ ./test.bash
Now, if you see no error message a new file should have appeared, "test.txt", lets look at it -

Code: [Select]
>$ cat test.txt
And we should see our "Hello World" message. If thats all good, I have wasted a few minutes of your time, sorry. If you seee a error message at any stage during that test, please report it here.

Davo

Hello Davo,
Thank you for your helpful input. In the end, like yourself and the rest of those who provided their input into this issue. It turns out the cause was permissions related.

Even though I updated the Samba permissions and checked on the Linux machine to ensure the correct ownership and group were in place, I guess it just didn't like that fact the top level directory was still in the root / location.

I ended up copying all the files locally onto the Linux Machine and building it there with success.

I will go ahead and update this question to solved now.
Don’t wish it were easier; wish you were better. – Jim Rohn

 

TinyPortal © 2005-2018