Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-02

IDE trunk cannot build on fpc 3.0.2

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

AlexeyT

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

Reply by email

Juha Manninen
to AlexeyT

On Tue, Feb 25, 2020 at 8:05 PM AlexeyT via lazarus <

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200225/57694f43/attachment.html>

Reply by email

Michael Thompson
to Juha Manninen
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200227/777a0a13/attachment.html>

Reply by email

Juha Manninen
to Michael Thompson

On Thu, Feb 27, 2020 at 7:59 AM Michael Thompson via lazarus <

Show quoted text 7 lines
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200227/369a8fe4/attachment.html>

Reply by email

Michael Thompson
to Juha Manninen
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200228/8b8673a1/attachment.html>

Reply by email

Ondrej Pokorny
to Juha Manninen: On Thu, Feb 27, 2020 at 7:59 AM Michael Thompson via lazarus < I built Lazarus with with…
Juha Manninen wrote 20 lines
On Thu, Feb 27, 2020 at 7:59 AM Michael Thompson via lazarus < <mailto:>> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200319/2f8e518b/attachment.html>

Reply by email

Juha Manninen
to Ondrej Pokorny

On Thu, Mar 19, 2020 at 10:11 AM Ondrej Pokorny via lazarus <

Show quoted text 5 lines
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: https://bugs.freepascal.org/view.php?id=33087

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 :
https://bugs.freepascal.org/view.php?id=36654
https://bugs.freepascal.org/view.php?id=36734
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200320/af4d637e/attachment.html>

Reply by email

Ondrej Pokorny
to Juha Manninen
Juha Manninen wrote 9 lines
On Thu, Mar 19, 2020 at 10:11 AM Ondrej Pokorny via lazarus < <mailto:>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200320/41e22028/attachment.html>

Reply by email