Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread R0b0t1 via Lazarus
Sorry list, I'm trying to stop my double posting.

On Tuesday, November 28, 2017, R0b0t1  wrote:
> Hello,
>
> On Tuesday, November 28, 2017, Mattias Gaertner via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:
>> On Tue, 28 Nov 2017 10:46:01 -0600
>> R0b0t1 via Lazarus  wrote:
>>
>>>[...]
>>> To be clear, for some reason most of the time the unit (and every
>>> other unit) was rebuilding properly, but one time it didn't. Perhaps
>>> it is a linking issue?
>>
>> If you cannot reproduce it then your issue is not related to this
>> thread.
>>
>
> Seeing as the OP took years to reproduce his issue, I may not have that
informatuon for a long time. I realize what I experienced may not be
precisely relevant but it seemed close enough that I felt I shouldn't
remain silent.
>

It looks like I came across https://bugs.freepascal.org/view.php?id=25797,
this issue but with inline functions.

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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread R0b0t1 via Lazarus
Hello,

On Tuesday, November 28, 2017, Mattias Gaertner via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:
> On Tue, 28 Nov 2017 10:46:01 -0600
> R0b0t1 via Lazarus  wrote:
>
>>[...]
>> To be clear, for some reason most of the time the unit (and every
>> other unit) was rebuilding properly, but one time it didn't. Perhaps
>> it is a linking issue?
>
> If you cannot reproduce it then your issue is not related to this
> thread.
>

Seeing as the OP took years to reproduce his issue, I may not have that
informatuon for a long time. I realize what I experienced may not be
precisely relevant but it seemed close enough that I felt I shouldn't
remain silent.

Cheers,
R0b0t1
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread Donald Ziesig via Lazarus

On 11/28/2017 05:50 AM, Mattias Gaertner via Lazarus wrote:

On Tue, 28 Nov 2017 08:41:05 -0200
"Marcos Douglas B. Santos via Lazarus" 
wrote:


[...]

Are your 'Other unit files (-Fu)' paths in project inspector and
your package empty?

And is this correct, package empty?

It is normal.

Mattias


I posted a bug-tracker entry (twice, the first one was rejected due 
tothe size of the demo).  Issue 32739 is the correct one


Don

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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread Mattias Gaertner via Lazarus
On Tue, 28 Nov 2017 10:46:01 -0600
R0b0t1 via Lazarus  wrote:

>[...]
> To be clear, for some reason most of the time the unit (and every
> other unit) was rebuilding properly, but one time it didn't. Perhaps
> it is a linking issue?

If you cannot reproduce it then your issue is not related to this
thread.

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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread R0b0t1 via Lazarus
Apologies for the additional post:

On Tue, Nov 28, 2017 at 10:44 AM, R0b0t1  wrote:
> Hello,
>
> On Mon, Nov 27, 2017 at 12:15 PM, Donald Ziesig via Lazarus
>  wrote:
>> Hi All!
>>
>> I have been having a problem for a long, long time when developing/debugging
>> code which is included in a package and which contains generics.
>>
>> It took me years :'(, but I finally figured out what I was doing so that I
>> could cause the issue to appear consistently. :-[
>>
>> My usual debugging process is:
>>
>> Edit the library code
>> Compile/Run
>> Debug.
>>
>> My current insight is:
>>
>> What would happen was that changes made to the library code would compile,
>> but not be included in the code which specializes the generic item.  When I
>> entered the debugger, I could see the newly changed code, but
>> single-stepping ignored my changes.  If I let the program run without
>> debugging, the resulting behavior was the same as it was before the edit.
>>
>> I have a work around for this (when I remember to use it):
>>
>> Edit the library code
>> Compile the package
>> Use Run | Cleanup and build ...
>> Debug
>>
>> TL;DR   Library packages which declare generics do compile, but do not get
>> included in the code that specializes them unless I "Cleanup and build" the
>> whole program.  (Workable, but much slower than programs without generics).
>>
>> I searched the bug tracker, but did not see anything resembling this
>> problem.  I would submit a bug report but I'm not sure whether this is an
>> IDE problem, a package problem or a compiler/linker problem.  Would someone
>> more familiar with this part of the architecture give me pointers?
>>
>
> I think this may be a bug, but I do not think it has to do with
> generics or packages. I encountered a very similar issue with a
> project I help maintain, where I fixed some issue in a unit but that
> unit was not automatically recompiled after being changed. I had to
> clean and rebuild the project. As you say, this is not extremely
> expedient.
>

To be clear, for some reason most of the time the unit (and every
other unit) was rebuilding properly, but one time it didn't. Perhaps
it is a linking issue?

Cheers,
 R0b0t1
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread R0b0t1 via Lazarus
Hello,

On Mon, Nov 27, 2017 at 12:15 PM, Donald Ziesig via Lazarus
 wrote:
> Hi All!
>
> I have been having a problem for a long, long time when developing/debugging
> code which is included in a package and which contains generics.
>
> It took me years :'(, but I finally figured out what I was doing so that I
> could cause the issue to appear consistently. :-[
>
> My usual debugging process is:
>
> Edit the library code
> Compile/Run
> Debug.
>
> My current insight is:
>
> What would happen was that changes made to the library code would compile,
> but not be included in the code which specializes the generic item.  When I
> entered the debugger, I could see the newly changed code, but
> single-stepping ignored my changes.  If I let the program run without
> debugging, the resulting behavior was the same as it was before the edit.
>
> I have a work around for this (when I remember to use it):
>
> Edit the library code
> Compile the package
> Use Run | Cleanup and build ...
> Debug
>
> TL;DR   Library packages which declare generics do compile, but do not get
> included in the code that specializes them unless I "Cleanup and build" the
> whole program.  (Workable, but much slower than programs without generics).
>
> I searched the bug tracker, but did not see anything resembling this
> problem.  I would submit a bug report but I'm not sure whether this is an
> IDE problem, a package problem or a compiler/linker problem.  Would someone
> more familiar with this part of the architecture give me pointers?
>

I think this may be a bug, but I do not think it has to do with
generics or packages. I encountered a very similar issue with a
project I help maintain, where I fixed some issue in a unit but that
unit was not automatically recompiled after being changed. I had to
clean and rebuild the project. As you say, this is not extremely
expedient.

My apologies for not keeping more details, but I was quite happy to
have gotten it working at the time.

Cheers,
 R0b0t1
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread Mattias Gaertner via Lazarus
On Tue, 28 Nov 2017 09:01:56 -0200
"Marcos Douglas B. Santos via Lazarus" 
wrote:

> On Tue, Nov 28, 2017 at 8:50 AM, Mattias Gaertner via Lazarus
>  wrote:
> > On Tue, 28 Nov 2017 08:41:05 -0200
> > "Marcos Douglas B. Santos via Lazarus" 
> > wrote:
> >  
> >>[...]  
> >> > Are your 'Other unit files (-Fu)' paths in project inspector and
> >> > your package empty?  
> >>
> >> And is this correct, package empty?  
> >
> > It is normal.  
> 
> Ok... but is there some "advantages" adding files in the package?
> If there is not, why do we have this option?

The 'Other unit files (-Fu)' paths are usually empty. It is not
empty if a package has multiple source directories.

You should add all source files to the package.

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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread Marcos Douglas B. Santos via Lazarus
On Tue, Nov 28, 2017 at 8:50 AM, Mattias Gaertner via Lazarus
 wrote:
> On Tue, 28 Nov 2017 08:41:05 -0200
> "Marcos Douglas B. Santos via Lazarus" 
> wrote:
>
>>[...]
>> > Are your 'Other unit files (-Fu)' paths in project inspector and
>> > your package empty?
>>
>> And is this correct, package empty?
>
> It is normal.

Ok... but is there some "advantages" adding files in the package?
If there is not, why do we have this option?

Thanks,

Best regards,
Marcos Douglas
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread Mattias Gaertner via Lazarus
On Tue, 28 Nov 2017 08:41:05 -0200
"Marcos Douglas B. Santos via Lazarus" 
wrote:

>[...]
> > Are your 'Other unit files (-Fu)' paths in project inspector and
> > your package empty?  
> 
> And is this correct, package empty?

It is normal.

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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-28 Thread Marcos Douglas B. Santos via Lazarus
On Mon, Nov 27, 2017 at 4:41 PM, Mattias Gaertner via Lazarus
 wrote:
> On Mon, 27 Nov 2017 13:33:13 -0500
> Donald Ziesig via Lazarus  wrote:
>
>>[...]
>> > When you change a pas file of your package and you compile your project,
>> > does the IDE automatically compile your package?
>> Yes (at least it catches typos).  Also, the same problem occurs when I
>> compile the package manually, then run the program without using
>> "cleanup and build".  (I am gradually discovering the extent of the
>> problem ;-)).
>
> Are your 'Other unit files (-Fu)' paths in project inspector and
> your package empty?

And is this correct, package empty?

Best regards,
Marcos Douglas
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-27 Thread Donald Ziesig via Lazarus

On 11/27/2017 04:27 PM, Mattias Gaertner via Lazarus wrote:

On Mon, 27 Nov 2017 15:52:09 -0500
Donald Ziesig via Lazarus  wrote:


[...]

Are your 'Other unit files (-Fu)' paths in project inspector and
your package empty?

Yes, both are empty.

Good.
If your project and packages have their own directories, it seems
you found a compiler bug.
Can you reproduce it in a small example?

Will do.


Mattias



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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-27 Thread Mattias Gaertner via Lazarus
On Mon, 27 Nov 2017 15:52:09 -0500
Donald Ziesig via Lazarus  wrote:

>[...]
> > Are your 'Other unit files (-Fu)' paths in project inspector and
> > your package empty?  
> Yes, both are empty.

Good. 
If your project and packages have their own directories, it seems
you found a compiler bug.
Can you reproduce it in a small example?


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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-27 Thread Donald Ziesig via Lazarus

On 11/27/2017 01:41 PM, Mattias Gaertner via Lazarus wrote:

On Mon, 27 Nov 2017 13:33:13 -0500
Donald Ziesig via Lazarus  wrote:


[...]

When you change a pas file of your package and you compile your project,
does the IDE automatically compile your package?

Yes (at least it catches typos).  Also, the same problem occurs when I
compile the package manually, then run the program without using
"cleanup and build".  (I am gradually discovering the extent of the
problem ;-)).

Are your 'Other unit files (-Fu)' paths in project inspector and
your package empty?

Yes, both are empty.


Mattias



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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-27 Thread Mattias Gaertner via Lazarus
On Mon, 27 Nov 2017 13:33:13 -0500
Donald Ziesig via Lazarus  wrote:

>[...]
> > When you change a pas file of your package and you compile your project,
> > does the IDE automatically compile your package?  
> Yes (at least it catches typos).  Also, the same problem occurs when I 
> compile the package manually, then run the program without using 
> "cleanup and build".  (I am gradually discovering the extent of the 
> problem ;-)).

Are your 'Other unit files (-Fu)' paths in project inspector and
your package empty?

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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-27 Thread Donald Ziesig via Lazarus

On 11/27/2017 01:28 PM, Mattias Gaertner via Lazarus wrote:

On Mon, 27 Nov 2017 13:15:36 -0500
Donald Ziesig via Lazarus  wrote:


[...]
TL;DR   Library packages which declare generics do compile, but do not
get included in the code that specializes them unless I "Cleanup and
build" the whole program.  (Workable, but much *slower* than programs
without generics).

I searched the bug tracker, but did not see anything resembling this
problem.  I would submit a bug report but I'm not sure whether this is
an IDE problem, a package problem or a compiler/linker problem.  Would
someone more familiar with this part of the architecture give me pointers?

When you change a pas file of your package and you compile your project,
does the IDE automatically compile your package?
Yes (at least it catches typos).  Also, the same problem occurs when I 
compile the package manually, then run the program without using 
"cleanup and build".  (I am gradually discovering the extent of the 
problem ;-)).


Mattias



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


Re: [Lazarus] Compiling/linking/debugging package with generics

2017-11-27 Thread Mattias Gaertner via Lazarus
On Mon, 27 Nov 2017 13:15:36 -0500
Donald Ziesig via Lazarus  wrote:

>[...]
> TL;DR   Library packages which declare generics do compile, but do not 
> get included in the code that specializes them unless I "Cleanup and 
> build" the whole program.  (Workable, but much *slower* than programs 
> without generics).
> 
> I searched the bug tracker, but did not see anything resembling this 
> problem.  I would submit a bug report but I'm not sure whether this is 
> an IDE problem, a package problem or a compiler/linker problem.  Would 
> someone more familiar with this part of the architecture give me pointers?

When you change a pas file of your package and you compile your project,
does the IDE automatically compile your package?


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


[Lazarus] Compiling/linking/debugging package with generics

2017-11-27 Thread Donald Ziesig via Lazarus

Hi All!

I have been having a problem for a long, long time when 
developing/debugging code which is included in a *package* and which 
contains *generics*.


It took me years :'(, but I finally figured out what I was doing so that 
I could cause the issue to appear consistently. :-[


My usual debugging process is:

1. Edit the library code
2. Compile/Run
3. Debug.

My current insight is:

What would happen was that changes made to the library code would 
compile, but not be included in the code which specializes the generic 
item.  When I entered the debugger, I could see the newly changed code, 
but single-stepping *ignored* my changes.  If I let the program run 
without debugging, the resulting behavior was the *same as it was before 
the edit*.


I have a work around for this (when I remember to use it):

1. Edit the library code
2. Compile the package
3. Use *Run | **Cleanup and build ...*
4. Debug

TL;DR   Library packages which declare generics do compile, but do not 
get included in the code that specializes them unless I "Cleanup and 
build" the whole program.  (Workable, but much *slower* than programs 
without generics).


I searched the bug tracker, but did not see anything resembling this 
problem.  I would submit a bug report but I'm not sure whether this is 
an IDE problem, a package problem or a compiler/linker problem.  Would 
someone more familiar with this part of the architecture give me pointers?


Thanks,

Don Ziesig


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