[SOLVED] Build Error On AlmaLinux 8.9 lazarus / 66-Unix ---------------------------------------------------------------------- hymcode · 2024-07-11 17:54 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ lazbuild -B linuxconveripfiles.lpi I get the following error messages: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (9022) Compiling resource /PCSOURCE/NEXTLX_ALMA/LINUXPASCAL/lib/x86_64- linux/convertipfiles.orError: No known file format detected for file ' convertipfiles.res'/PCSOURCE/NEXTLX_ALMA/LINUXPASCAL/convertipfiles.lp r(23,1) Error: (9029) Error while compiling resources/PCSOURCE/NEXTLX_ALMA/LINUXPASCAL/convertipfiles.lpr(23,1) Fatal: (10026) There were 1 errors compiling module, stoppingFatal: (1018) Compilation abortedError: /usr/bin/ppcx64 returned an error exitcodeError: (lazarus) Compile Project, Target: convertipfiles: stopped with exit code 1Error: (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. ---------------------------------------------------------------------- dbannon · 2024-07-12 00:55 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 ---------------------------------------------------------------------- hymcode · 2024-07-12 08:59 Quote from: dbannon on July 12, 2024, 02:55:10 amError: 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i [root@dev00 LINUXPASCAL]# lazbuild -B linuxconvertipfiles.lpi Error: (lazarus) invalid Lazarus directory "/usr/lib64/lazarus/": directory not foundError: (lazarus) Building failed: linuxconvertipfiles.lpi Any ideas on this? ---------------------------------------------------------------------- af0815 · 2024-07-12 09:12 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. ---------------------------------------------------------------------- TRon · 2024-07-12 09:19 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. ---------------------------------------------------------------------- cdbc · 2024-07-12 09:44 Hi I'm wondering  ...isn't 'fpcupdeluxe' a viable option on AlmaLinux?!? That worked great for me here. Regards Benny ---------------------------------------------------------------------- dbannon · 2024-07-12 09:48 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.freep ascal.org/Installing_the_Free_Pascal_Compiler#Downloading_FPC_tar_ball s  and using that to build Lazarus.3.4 from source, (https://wiki.free pascal.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 ---------------------------------------------------------------------- hymcode · 2024-07-15 10:56 Quote from: hymcode on July 12, 2024, 10:59:26 amQuote from: dbannon on July 12, 2024, 02:55:10 amError: 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i [root@dev00 LINUXPASCAL]# lazbuild -B linuxconvertipfiles.lpi Error: (lazarus) invalid Lazarus directory "/usr/lib64/lazarus/": directory not foundError: (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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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 ---------------------------------------------------------------------- hymcode · 2024-07-15 13:03 Quote from: TRon on July 12, 2024, 11:19:14 amIn 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. ---------------------------------------------------------------------- hymcode · 2024-07-15 13:15 Quote from: af0815 on July 12, 2024, 11:12:01 amOne 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 OpenVMSPorted to CentOS 7 and compiled on the distroCopied 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). ---------------------------------------------------------------------- Thaddy · 2024-07-15 14:10 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. ---------------------------------------------------------------------- hymcode · 2024-07-15 15:29 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i lazbuild -B project1.lpi I am no longer doing this as root, however I got the following error output: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i [tester@dev00 buildTest]$ lazbuild -B project1.lpiHint: (11030) Start of reading config file /etc/fpc.cfgHint: (11031) End of reading config file /etc/fpc.cfgFree Pascal Compiler version 3.2.2 [2021/05/16] for x86_64Copyright (c) 1993-2021 by Florian Klaempfl and othersError: No known file format detected for file 'project1.res'(1002) Target OS: Linux for x86-64(3104) Compiling project1.lpr(3104) Compiling unit1.pas(9022) Compiling resource /DEVSOURCE/buildTest/lib/x86_64- linux/project1.or/DEVSOURCE/buildTest/project1.lpr(24,1) Error: (9029) Error while compiling resources/DEVSOURCE/buildTest/project1.lpr(24,1) Fatal: (10026) There were 1 errors compiling module, stoppingFatal: (1018) Compilation abortedError: /usr/bin/ppcx64 returned an error exitcodeError: (lazarus) Compile Project, Target: /DEVSOURCE/buildTest/project1: stopped with exit code 1Error: (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 ---------------------------------------------------------------------- marcov · 2024-07-15 19:23 Do you have gorc installed? Maybe redhat somehow packages that differently ---------------------------------------------------------------------- dbannon · 2024-07-16 00:21 > 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #!/usr/bin/bash  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 ---------------------------------------------------------------------- hymcode · 2024-07-16 14:30 Quote from: dbannon 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #!/usr/bin/bash  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.