[Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-13 Thread Bo Berglund via lazarus
I am constantly using strip -s to reduce the size of the application binary and
now I wonder if there is a way to make Lazarus NOT include the symbols in the
first place?

It seems like these are only used when debugging and that is started by clicking
the green arrow button, so Lazarus should be able to figure out when the symbols
are needed (for debug) and not add them when not needed...

The reason I have for finding a way to do this is that the binary will be added
to version control and then it may happen that one forgets the strip -s step
before committing the state, thus sending an overly bloated binary into
subversion.


-- 
Bo Berglund
Developer in Sweden

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-13 Thread Dimitrios Chr. Ioannidis via lazarus

Hi,

Στις 13/12/2021 10:01 μ.μ., ο/η Bo Berglund via lazarus έγραψε:

I am constantly using strip -s to reduce the size of the application binary and
now I wonder if there is a way to make Lazarus NOT include the symbols in the
first place?

It seems like these are only used when debugging and that is started by clicking
the green arrow button, so Lazarus should be able to figure out when the symbols
are needed (for debug) and not add them when not needed...

The reason I have for finding a way to do this is that the binary will be added
to version control and then it may happen that one forgets the strip -s step
before committing the state, thus sending an overly bloated binary into
subversion.


I suppose one way is to use Lazarus's build modes.

i.e.

Add a "release" build mode to your project with the settings you want 
including strip -s support.


Then make a script /batch which builds it using that build mode (i.e.  
lazbuild with --build-mode= or --bm=build mode> ) and copies the "release" stripped to the relevant location 
( i.e. local repocitory) before commits it .


Or if you don't want a script / batch, I think that you can add the copy 
functionality for that "release" build mode to the "Project Options -> 
Compiler  Options -> Compiler Commands -> Execute after -> Command" and 
leave only the build checkbox checked. With such a configuration, every 
time you build that mode you'll have a stripped "release" binary which 
will be copied to the location after the build ends .


regards,

--

Dimitrios Chr. Ioannidis

regards,

--

Dimitrios Chr. Ioannidis

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-13 Thread Bo Berglund via lazarus
On Mon, 13 Dec 2021 22:34:55 +0200, "Dimitrios Chr. Ioannidis via lazarus"
 wrote:

>Hi,
>
> 13/12/2021 10:01 ?.?., ?/? Bo Berglund via lazarus ??:
>> I am constantly using strip -s to reduce the size of the application binary 
>> and
>> now I wonder if there is a way to make Lazarus NOT include the symbols in the
>> first place?
>>
>> It seems like these are only used when debugging and that is started by 
>> clicking
>> the green arrow button, so Lazarus should be able to figure out when the 
>> symbols
>> are needed (for debug) and not add them when not needed...
>>
>> The reason I have for finding a way to do this is that the binary will be 
>> added
>> to version control and then it may happen that one forgets the strip -s step
>> before committing the state, thus sending an overly bloated binary into
>> subversion.
>
>I suppose one way is to use Lazarus's build modes.
>
>i.e.
>
>Or if you don't want a script / batch, I think that you can add the copy 
>functionality for that "release" build mode to the "Project Options -> 
>Compiler  Options -> Compiler Commands -> Execute after -> Command" and 
>leave only the build checkbox checked. With such a configuration, every 
>time you build that mode you'll have a stripped "release" binary which 
>will be copied to the location after the build ends .
>

This sounds like what I need.
I looked at the project options and found that there is one box to enter the
Execute after command. And checkboxes to set when it is used.

But I would need *two* commands:
- copy to the svn location
- strip -s on that copy

Does this mean I will have to use a batch file (on Windows) to perform both
steps?
How do I then transfer the name of the executable into that command?

And will Lazarus use the standard binary or the one created in the release
folder when debugging?


-- 
Bo Berglund
Developer in Sweden

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-13 Thread Bart via lazarus
On Mon, Dec 13, 2021 at 10:29 PM Bo Berglund via lazarus
 wrote:


> This sounds like what I need.
> I looked at the project options and found that there is one box to enter the
> Execute after command. And checkboxes to set when it is used.
>
> But I would need *two* commands:
> - copy to the svn location
> - strip -s on that copy
>

In compiler options you can set various debugging related options as well.
One is to strip symbols.
- uncheck: "generate infor for the debugger"
- check: Strip symbols from executable
You apply those debugging options to your "Release" build mode.
You keep all relevant debugging options checked for your "Debug" build-mode.

Now you develop in "Debug" build-mode.
Once you're ready to release: swicth build-mode to "Release" and compile.

(You might want a "Release and copy to svn" build mode with the
"Execute after command", sou you can also test your release mode build
(if you use e.g. different optimizations, some yet unnoticed bug may
crop up.)



-- 
Bart
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Can I configure Lazarus (or the project) to only add symbols on debug?

2021-12-13 Thread Juha Manninen via lazarus
On Mon, Dec 13, 2021 at 10:01 PM Bo Berglund via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> ... the binary will be added to version control ...


You are misusing a version (or revision) control system, Subversion in your
case if I understand right.
Generated binaries should not be added there. It is only for source files.
A revision control system stores diffs between revisions. A diff between 2
binaries is not useful information.
You can share the binaries through a file system, FTP server, web page or
something like that.

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus