Recent

Author Topic: lazarus execute after vs lazbuild execute after  (Read 1018 times)

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
lazarus execute after vs lazbuild execute after
« on: November 10, 2022, 10:51:44 am »
Hello,
I have a lpi where there is a execute after assigned for build (see pic.).

Code: Text  [Select][+][-]
  1. cmd /C myscript.bat
  2.  

I see that when I do "Build" or "Clean up and build" from lazarus, myscript.bat is called as expected, but if I use lazbuild script isn't called.

currently I was doing:

Code: Text  [Select][+][-]
  1. c:\projectdir>lazbuild myproject.lpi
  2.  

Is it possible to obtain the same result in lazbuild?

Thanks



FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: lazarus execute after vs lazbuild execute after
« Reply #1 on: November 11, 2022, 11:34:19 am »
Any ideas?
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: lazarus execute after vs lazbuild execute after
« Reply #2 on: November 11, 2022, 01:05:43 pm »
Works correctly on Linux, I routinely use it to output a date and time on completion.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 14213
  • Probably until I exterminate Putin.
Re: lazarus execute after vs lazbuild execute after
« Reply #3 on: November 11, 2022, 01:13:04 pm »
@MarkMLI
So cmd /C works on Linux?  ;D ;D
And I suppose a .bat extension also works on Linux with the correct interpretation?  O:-) :D

Both are MS dos and/or Windows specific.

@tt
I never use LazBuild - I use make - , so may be you can give a small, but full example that demonstrates this. It should work either way, but may depend on settings, not code. E.g. It may be the case the .lpi does not contain the full configuration
« Last Edit: November 11, 2022, 01:22:32 pm by Thaddy »
Specialize a type, not a var.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: lazarus execute after vs lazbuild execute after
« Reply #4 on: November 11, 2022, 02:14:41 pm »
Thaddy, you know effing well what I mean: execute-after works correctly on Linux.

So kindly stop being so gratuitously obtuse: your comment that you don't use Lazbuild is even less helpful than my implied comment that I don't use Windows.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: lazarus execute after vs lazbuild execute after
« Reply #5 on: November 11, 2022, 02:44:51 pm »
Hey guys,
by chance I tried to do

Code: Text  [Select][+][-]
  1. lazbuild -B myproject.lpi
  2.  

and about magically I had

Code: Text  [Select][+][-]
  1. Info: (lazarus) Execute Title="Project: Executing command after"
  2. Info: (lazarus) Working Directory=".....some local path...."
  3. Info: (lazarus) Executable=".....some local bat...."
  4.  

I therefore conclude that passing the -B option is equivalent to doing the Build in the IDE.
Sorry but from the wiki nor from the inline help it was not very clear to me, but ok I am about 50 so my head isn't so fast anymore, if it has ever been.

Note: I have a project whose code is compiled both under linux and windows. I use separate lpis that point to the same lpr/pas. In this way the linux lpi calls a sh and the windows lpi calls a bat, to make similar operations using different syntaxes, of course.
« Last Edit: November 11, 2022, 02:47:42 pm by tt »
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: lazarus execute after vs lazbuild execute after
« Reply #6 on: November 11, 2022, 02:59:18 pm »
Another question related to lazbuild: is it possible to emulate the IDE operation "Clean up and build..."?
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: lazarus execute after vs lazbuild execute after
« Reply #7 on: November 11, 2022, 03:12:43 pm »
@MarkMLI
So cmd /C works on Linux?  ;D ;D
And I suppose a .bat extension also works on Linux with the correct interpretation?  O:-) :D

Both are MS dos and/or Windows specific.

@tt
I never use LazBuild - I use make - , so may be you can give a small, but full example that demonstrates this. It should work either way, but may depend on settings, not code. E.g. It may be the case the .lpi does not contain the full configuration

In attach a very simple example.

Doing lazbuild -B it does the job instead.
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: lazarus execute after vs lazbuild execute after
« Reply #8 on: November 11, 2022, 03:16:19 pm »
Another question related to lazbuild: is it possible to emulate the IDE operation "Clean up and build..."?

Not that I can immediately see, referring to the source and also to the --help output.

In my case I typically keep a makefile so that I can build a console-only version of a program for unix, and makefile doctrine implies a "clean" target to get rid of all intermediate files and a "distclean" that also wipes binaries. I note that (according to --help etc.) lazbuild has a --create-makefile option, but have never used it.

MarkMLl

Sorry but from the wiki nor from the inline help it was not very clear to me, but ok I am about 50 so my head isn't so fast anymore, if it has ever been.
[/quote]

Youngster :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: lazarus execute after vs lazbuild execute after
« Reply #9 on: November 11, 2022, 03:23:55 pm »
Another question related to lazbuild: is it possible to emulate the IDE operation "Clean up and build..."?

Not that I can immediately see, referring to the source and also to the --help output.

In my case I typically keep a makefile so that I can build a console-only version of a program for unix, and makefile doctrine implies a "clean" target to get rid of all intermediate files and a "distclean" that also wipes binaries. I note that (according to --help etc.) lazbuild has a --create-makefile option, but have never used it.

MarkMLl

Sorry but from the wiki nor from the inline help it was not very clear to me, but ok I am about 50 so my head isn't so fast anymore, if it has ever been.

Youngster :-)

MarkMLl

Thanks I will give a deeper look in the direction of make or fpcmake in order to make more automatic certail building processes, including the clean and build, that I feel very necessary.
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: lazarus execute after vs lazbuild execute after
« Reply #10 on: November 11, 2022, 03:28:47 pm »
Thanks I will give a deeper look in the direction of make or fpcmake in order to make more automatic certail building processes, including the clean and build, that I feel very necessary.

Example makefile at https://github.com/MarkMLl/hp2671/blob/main/hp2671/Makefile

However I might redo some of that if Lazbuild's makefile generation is halfway decent.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 14213
  • Probably until I exterminate Putin.
Re: lazarus execute after vs lazbuild execute after
« Reply #11 on: November 11, 2022, 04:01:51 pm »
So kindly stop being so gratuitously obtuse: your comment that you don't use Lazbuild is even less helpful than my implied comment that I don't use Windows.
That is by no means gratuitously: OS and shell files are essential to the solution. You make yourself silly by not noting that and "works on Linux".
It is something different: it works on Windows too with correct configuration. Period.
Specialize a type, not a var.

Bogen85

  • Hero Member
  • *****
  • Posts: 595
Re: lazarus execute after vs lazbuild execute after
« Reply #12 on: November 12, 2022, 06:13:43 am »
My take on the banter between Thaddy and MarkMLI...

Quote
If something works it does not mean it can fail. TEST

I guess if every one reading Thaddy's signature was support to test (evaluate) it (and provide feedback) we have likely all failed (or most of us at least).
But I guess because anything Thaddy says can't be wrong no one has (or very few have) publicly provided feedback on it.
« Last Edit: November 12, 2022, 06:18:04 am by Bogen85 »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: lazarus execute after vs lazbuild execute after
« Reply #13 on: November 12, 2022, 08:58:24 am »
I guess if every one reading Thaddy's signature was support to test (evaluate) it (and provide feedback) we have likely all failed (or most of us at least).
But I guess because anything Thaddy says can't be wrong no one has (or very few have) publicly provided feedback on it.

I took Thaddy's sig as wryly meta: he's making a valid point, and in making the point is providing an example :-)

Incidentally, I took a look at lazbuild's --create-makefile yesterday and couldn't get it to do anything. Can anybody comment either way (irrespective of platform)?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018