Michael Van Canneyt wrote 8 lines
On Sat, 18 Mar 2023, Mattias Gaertner via lazarus wrote:
>
> As this happens seldom there is no detection built in (yet) to handle
> this automatically.
If possible, might be a good idea.
Afaik there are 2 scenarios.
1) The duplicate.
The user has the package installed, that now became a base package. So units are used twice.
For this there may be a very simple solution.
- staticpackes is used by lazarus.pp
- So we could add new core-packackage-units to a different unit's use clause. Then they don't appear twice in the same uses clause. E.g. we could add a unit LazCorePackages, and that just contains a uses clause.? It would be used first in the uses of lazarus.pp.
It may also be able to do some trickery with IFDEF. If core packages are in the lazarus.pp uses clause, appearing only after staticpackages, then there could be {$IF not
defined(symbol_from_new_core_unit)}.
Haven't tested that, don't know if it would actually work.
2) The "unit not found"
The user does not have the package installed, yet. Say when we added IdeDebugger package. This would have added units to the "core" uses clause.
But not only. Units of IdeDebugger are used throughout the entire IDE code. And if you do not have that package installed (and use an old IDE, that does not have it as core yet), then the package's path is not in the list of unit-search paths.
So you will get "unit not found" errors.
To rebuild, you must first install the package that will become core.
Not sure how an old IDE can learn about that.
(The point (2) does not happen with every package. If the package is just used, so it can register itself, then that will be fine.) E.g.
- LazDebuggerFpLldb => core, but only registration
- SynEdit => core, and units get used