Recent

Author Topic: [SOLVED]Lazarus&CI/CD  (Read 2954 times)

zamtmn

  • Hero Member
  • *****
  • Posts: 594
[SOLVED]Lazarus&CI/CD
« on: February 03, 2022, 12:47:15 pm »
I try appveyor.com for build my app. Build is performed by this script https://github.com/zamtmn/zcad/blob/master/appveyor.yml
In project options Execute before compile i have $(Make) crutch_before_compilation to which I always get an error:
Code: Pascal  [Select][+][-]
  1. Error: (lazarus) [TExternalTool.DoExecute.CheckError] Error=missing executable "C:\lazarus\$Lazarusdir\fpc\3.2.2\bin\i386-win32\make.exe"
  2. Error: (lazarus) Project: Executing command before: missing executable "C:\lazarus\$Lazarusdir\fpc\3.2.2\bin\i386-win32\make.exe"
  3. Error: (lazbuild) failed "tool before" of project C:\projects\zcad\cad_source\zcad.lpi
  4. make: *** [zcadelectrotech] Error 2
There are no problems with this on the local computer. I understand correctly that lazarus needs a startup to complete this setup, and since I compile the project immediately after installation, some things don't work?
« Last Edit: February 04, 2022, 09:52:28 pm by zamtmn »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Lazarus&CI/CD
« Reply #1 on: February 03, 2022, 11:30:24 pm »
Your script suggests the executable is at: C:\lazarus\fpc\3.2.2\bin\i386-win32\make.exe

The error message says it cannot find the executable at: C:\lazarus\$Lazarusdir\fpc\3.2.2\bin\i386-win32\make.exe

Being unfamiliar with your process and setup all I can suggest is that you change your script and relocate make.exe to C:\lazarus\$Lazarusdir\fpc\3.2.2\bin\i386-win32\ instead of C:\lazarus\fpc\3.2.2\bin\i386-win32\


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus&CI/CD
« Reply #2 on: February 04, 2022, 12:02:51 am »
Check c:\lazarus\environmentoptions.xml

Maybe some path is wrong. The installer is supposed to set them.

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: Lazarus&CI/CD
« Reply #3 on: February 04, 2022, 09:59:37 am »
C:\lazarus \$Lazarusdir\fpc\3.2.2\bin\i386-win32\make.exe
lazbuild does not correctly substitute the $(Make) macro

The problem is that I run lazbuild immediately after installing Lazarus. My scripts want that the configuration folder "C:\Documents and Settings\test\AppData\Local\lazarus\" has already been created and filled.

Here is an example fragment my Makefile
Code: Pascal  [Select][+][-]
  1. PCP=$(LOCALAPPDATA)\lazarus
  2. lazbuild --pcp=$(PCP) myprog.lpi

But the installer does not do this, it only happens when Lazarus is first started. How do I create and fill it myself? or specify that lazbuild do it?

update:
Another question arose: where can I download the official Lazarus builds from? Are there official mirrors for new releases?
Code: Pascal  [Select][+][-]
  1. curl -fsSL -o lazarus-2.2.0-fpc-3.2.2-win32.exe "https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%202.2.0/lazarus-2.2.0-fpc-3.2.2-win32.exe/download"
sourceforge give 404 for appveyor
« Last Edit: February 04, 2022, 10:22:32 am by zamtmn »

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: Lazarus&CI/CD
« Reply #4 on: February 04, 2022, 10:15:32 am »
make clashes with make.... (Embardacodereowhatever make? )
Specialize a type, not a var.

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: Lazarus&CI/CD
« Reply #5 on: February 04, 2022, 10:21:40 am »
No. Embarcodero doesn't smell here

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: Lazarus&CI/CD
« Reply #6 on: February 04, 2022, 10:44:52 am »
Check c:\lazarus\environmentoptions.xml

Maybe some path is wrong. The installer is supposed to set them.
Yes, installer generate buggy c:\lazarus\environmentoptions.xml
Code: Pascal  [Select][+][-]
  1. <?xml version="1.0"?>
  2. <CONFIG>
  3.   <EnvironmentOptions>
  4.     <Version Value="110" Lazarus="2.2.0"/>
  5.     <LazarusDirectory Value="C:\lazarus">
  6.     </LazarusDirectory>
  7.     <CompilerFilename Value="$Lazarusdir\fpc\3.2.2\bin\i386-win32\\fpc.exe">
  8.     </CompilerFilename>
  9.     <FPCSourceDirectory Value="$(LazarusDir)fpc\$(FPCVer)\source">
  10.     </FPCSourceDirectory>
  11.     <MakeFilename Value="$Lazarusdir\fpc\3.2.2\bin\i386-win32\\make.exe">
  12.     </MakeFilename>
  13.     <TestBuildDirectory Value="C:\Users\test\AppData\Local\Temp\">
  14.     </TestBuildDirectory>
  15.     <Debugger>
  16.       <Configs>
  17.         <Config ConfigName="FpDebug" ConfigClass="TFpDebugDebugger" Active="True"/>
  18.         <Config ConfigName="Gdb" ConfigClass="TGDBMIDebugger" DebuggerFilename="$(LazarusDir)\mingw\$(TargetCPU)-$(TargetOS)\bin\gdb.exe"/>
  19.       </Configs>
  20.     </Debugger>
  21.   </EnvironmentOptions>
  22. </CONFIG>
$Lazarusdir instead $(LazarusDir)

I create https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39630
« Last Edit: February 04, 2022, 11:14:10 am by zamtmn »

 

TinyPortal © 2005-2018