Recent

Author Topic: lazbuild + hints and warnings  (Read 6471 times)

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 365
lazbuild + hints and warnings
« on: October 08, 2021, 01:59:28 am »
I want to see hints and warnings when I compile my projects in the IDE. but when I build them using lazbuild in a CI build, for example, I just don't want to see them. Is there a way I can see hints and warnings in the IDE but not lazbuild?

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: lazbuild + hints and warnings
« Reply #1 on: October 08, 2021, 02:12:01 am »
What I do Graham, in the IDE, for each project, debug mode has all the warnings displayed, release mode does not. That information is saved in with the project and, normally, when building with Lazbuild, its for release. So, no warnings.

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

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 365
Re: lazbuild + hints and warnings
« Reply #2 on: October 08, 2021, 03:08:44 am »
Thanks. I'll think about that but the CI build builds debug versions and runs the tests. I don't know whether the tests pass in release build.

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 365
Re: lazbuild + hints and warnings
« Reply #3 on: November 12, 2021, 05:18:07 am »
This doesn't work - I'm compiling a build mode with hints and warnings off, and passing -q -q to lazbuild, and still getting all the hints and warnings... so it seems like I can't turn them off?

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: lazbuild + hints and warnings
« Reply #4 on: November 13, 2021, 01:17:33 am »
There are two approaches I use, I am sure there are others that work as well.

Firstly, using lazbuild : while in the IDE, you configure the various modes of your project, for the 'release' ones you turn off all the messages you don't want to see in project options, verbosity and  messages.  Then, when using lazbuild to build a project in that mode, those settings are applied.

Secondly, if you build directly using FPC instead of lazbuild, you pass things like " -vm6058,2005,5027 " to the compiler. Depending on what you are doing, building with FPC directly can get you a lot more flexibility.

Note that the 6058, relating to functions not being inlined does not exist in fpc304 so if you want to build "with any old compiler" your scripts need to check which compiler is being used (fpc -iV). I recently dropped support for fpc304 for just this reason. But mean I could remove a whole lot of ifdefs so not a bad thing.

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

 

TinyPortal © 2005-2018