[Lazarus] IDE trunk cannot build on fpc 3.0.2

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] IDE trunk cannot build on fpc 3.0.2

Free Pascal - Lazarus mailing list
macOS 10.8, FPC 3.0.2 2017/02/12 for i386

pkgmanager.pas(77,78) Error (5000) Id not found TObjectArray$2

PS-- I use fpc 3.0.2 because I had problems to compile CudaText with
3.0.4 on macOS in 2019

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IDE trunk cannot build on fpc 3.0.2

Free Pascal - Lazarus mailing list
On Tue, Feb 25, 2020 at 8:05 PM AlexeyT via lazarus <[hidden email]> wrote:
pkgmanager.pas(77,78) Error (5000) Id not found TObjectArray$2

The line is:
  TPackagePackageArray = specialize TObjectArray<TLazPackageID, TLazPackageID>;

I turned TObjectArray into a generics container to reduce typecasts.
It uses a very basic syntax, similar to what unit fgl has used for ages.
  generic TObjectArray<TItem, TObj> = class

Does "TObjectArray$2" mean the compiler does not find the second parameter?
Why wouldn't it? Both parameters are the same "TLazPackageID".

Juha


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IDE trunk cannot build on fpc 3.0.2

Free Pascal - Lazarus mailing list
>> On Tue, Feb 25, 2020 at 8:05 PM AlexeyT wrote
>> pkgmanager.pas(77,78) Error (5000) Id not found TObjectArray$2

I'm hitting this error on Windows.  fpc 3.0.4

> Does "TObjectArray$2" mean the compiler does not find the second parameter?

No idea.  Warning - the following does not contain known facts!  Wildly guessing (honestly) that for 3.0.4 the code in fgl only accepts types and you compiled with 3.1 which may have improved support for classes?  Dunno.

My solution for now is to revert to revision 62638

Cheers

Mike

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IDE trunk cannot build on fpc 3.0.2

Free Pascal - Lazarus mailing list
On Thu, Feb 27, 2020 at 7:59 AM Michael Thompson via lazarus <[hidden email]> wrote:
>> On Tue, Feb 25, 2020 at 8:05 PM AlexeyT wrote
>> pkgmanager.pas(77,78) Error (5000) Id not found TObjectArray$2

I'm hitting this error on Windows.  fpc 3.0.4

I built Lazarus with with FPC 3.0.4. It works with 100% certainty.

No idea.  Warning - the following does not contain known facts!  Wildly guessing (honestly) that for 3.0.4 the code in fgl only accepts types and you compiled with 3.1 which may have improved support for classes?  Dunno.

A class is also a type. Generics have worked with classes from the beginning.

My solution for now is to revert to revision 62638

I guess the right solution is to build clean, so that old .ppu files get deleted. The unit ObjectLists (and class TObjectArray) was moved to another place. The left-over compiled files may cause problems.

Juha


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IDE trunk cannot build on fpc 3.0.2

Free Pascal - Lazarus mailing list
>> My solution for now is to revert to revision 62638
> I guess the right solution is to build clean

Yes, thanks for that.  Something had gone wrong with my system somewhere.  Even after a make clean I was having problems with main.pp.  I use Tortoise SVN, and multiple SVN Clean with all options enabled wasn't having an effect.  Ended up deleting the whole lazarus_trunk folder and starting again.  All good now..

Many thanks

Mike

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IDE trunk cannot build on fpc 3.0.2

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 27.02.2020 10:03, Juha Manninen via lazarus wrote:
On Thu, Feb 27, 2020 at 7:59 AM Michael Thompson via lazarus <[hidden email]> wrote:
>> On Tue, Feb 25, 2020 at 8:05 PM AlexeyT wrote
>> pkgmanager.pas(77,78) Error (5000) Id not found TObjectArray$2

I'm hitting this error on Windows.  fpc 3.0.4

I built Lazarus with with FPC 3.0.4. It works with 100% certainty.

No idea.  Warning - the following does not contain known facts!  Wildly guessing (honestly) that for 3.0.4 the code in fgl only accepts types and you compiled with 3.1 which may have improved support for classes?  Dunno.

A class is also a type. Generics have worked with classes from the beginning.

Well, generics may cause an internal error on a simple compile. A clean rebuild is needed to compile even after a small change.

This happens a lot for me now. Sometimes in the changes from r62639, sometimes in different code. If I work on the source of the Lazarus IDE and I recompile it, I get an internal error. Then I have to rebuild Lazarus IDE clean, which takes a lot of time.

It is really frustrating when this happens every 10 minutes :/ I really don't see a point to change working code to generics.

Ondrej


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IDE trunk cannot build on fpc 3.0.2

Free Pascal - Lazarus mailing list
On Thu, Mar 19, 2020 at 10:11 AM Ondrej Pokorny via lazarus <[hidden email]> wrote:
Well, generics may cause an internal error on a simple compile. A clean rebuild is needed to compile even after a small change.

It may be true when a generics class definition changes. Typically they don't change often.

This happens a lot for me now. Sometimes in the changes from r62639, sometimes in different code. If I work on the source of the Lazarus IDE and I recompile it, I get an internal error. Then I have to rebuild Lazarus IDE clean, which takes a lot of time.

r62639 required a clean compile also because the container class was moved to LazUtils. Other containers are already there.
If the old .ppu remains in its old place, it causes an incompatible ppu error.
An internal error happens because of a bug in FPC. I also get them a lot but I didn't notice any connection to generics. The error comes in unexpected places, not related to changes I made. Usually no generics are used there.
I am also worried when the FPC bug or bugs get fixed. It is not a new thing and it may have gotten worse. There are bug reports like:

It is really frustrating when this happens every 10 minutes :/ I really don't see a point to change working code to generics.

Please don't blame my refactoring if it happens every 10 minutes. It was a one-time shot.
The change was related to a substantial new feature for the package system provided by Sven Barth.
See issues :
Generics make a lot of sense in containers bringing type checking and safety also there. The code becomes more self-documenting as well.
In this particular case the container usage was not obvious. The Pointer -> Pointer container was used in 2 different ways in the same unit, now specialized as TPackagePackageArray and TOwnerPackageArray.
Unit ObjectLists is now used only in unit PkgManager but it looks like a useful container and deserves to be in LazUtils.

Juha


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] IDE trunk cannot build on fpc 3.0.2

Free Pascal - Lazarus mailing list
On 20.03.2020 12:05, Juha Manninen via lazarus wrote:
On Thu, Mar 19, 2020 at 10:11 AM Ondrej Pokorny via lazarus <[hidden email]> wrote:

It is really frustrating when this happens every 10 minutes :/ I really don't see a point to change working code to generics.

Please don't blame my refactoring if it happens every 10 minutes. It was a one-time shot.

I meant the internal error happens that often. Today it was good but 2 weeks ago it was really almost impossible to work on the IDE. I changed 3 lines of code, wanted to compile and bang, internal error :/ And that all the time. It must depend on the files one works on.

I have to admit that I have no evidence the internal errors are connected to generics. I will investigate further.

Anyway, thanks for the description and sorry for the rant.

Ondrej

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus