Jump to content
aehimself

Splitting component suite = strange internal error

Recommended Posts

Hello,

 

We had a large legacy component suite which I managed to split into Runtime and Design time packages in preparation to be able to build our application in 64 bit. I don't have much experience, so what I did was, basically:

- Created a new package, set it as runtime only, moved all contains and requires section from the old suite

- Created a new package, set it as design time only

- Attempt to compile the runtime package

- Move units to the design time package which blocks compilation (has references to designide, etc)

- Repeat until both packages compiled error free

- Added "implicitly imported" units to design time package

 

All works fine, except one strange issue. Delphi chooses a seemingly random unit and throws an Internal Error when I want to install the package (compiling works fine both in 32 bit Debug / Release).

Here's the twist: if I close Delphi, modify the unit with VS code and add a line break to the end of the unit (or remove one - basically change something completely insignificant) and save, reopen and install - all works just fine.

 

I'm wondering if I missed something when creating the packages? Did anyone face this before? Does anyone has any tips I can check?

 

Thank you!

Share this post


Link to post
23 minutes ago, aehimself said:

Added "implicitly imported" units to design time package

Instead of adding the units from the runtime package into the design time you should add the runtime package as required. (The 32 bit version of the runtime package must inside the path).

 

 

Share this post


Link to post
34 minutes ago, Lajos Juhász said:

Instead of adding the units from the runtime package into the design time you should add the runtime package as required. (The 32 bit version of the runtime package must inside the path).

I just went to doublecheck, the runtime package is already included in the Requires section of my designtime package. Seems I added it, I just forgot 🙂

Share this post


Link to post

After some time investigating the issue I found out that custom property editors are causing this. We had about 4, removing one from the package caused the Internal Error to simply point to a different one.

 

I have a theory which I will test out during the upcoming week(s). Will post an update once I have any news...

Share this post


Link to post
10 hours ago, aehimself said:

After some time investigating the issue I found out that custom property editors are causing this. We had about 4, removing one from the package caused the Internal Error to simply point to a different one.

 

I have a theory which I will test out during the upcoming week(s). Will post an update once I have any news...

I fought a similar problem  couple of years ago. In that case for reason that the package contained too much "something" that Windows or Delphi was unable to handle after moving to newer version of Delphi. The solution was to break the package into two.

Share this post


Link to post

My theory doesn't seem to work. I created a second design-time package and moved the property editors there as some property editors were using components which are to be installed in the very same package... no luck.

Now the component package installs just fine, the package containing the property editors are throwing the errors.

 

I read that the code in property editors have to be extra clean (no WITH statements, no "confusing" parts for the compiler) so I made a cleanup there too.

Share this post


Link to post

It seems so far that I solved the issue, the Internal Errors are gone - at least I can not reproduce them no matter how hard I abuse switching branches (where the component suite is the old) or building-installing.

What I ended up doing was to have a runtime package, a design time package for component installation in the IDE and one more design time package for the property editors.

 

This didn't work until I realized I set the required package of the property editors to the runtime package. In the moment I changed this so the property editors "only" require the first design time package, all started to work.

During the trial process I also trashed several old units which function is now covered by Delphi itself and corrected some programming issues too but the error itself went away by changing the required package.

 

I don't know what caused the issue at the first place (and more importantly why it went away...?) but this can be a possible solution too.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×