synopse / mORMot2

OpenSource RESTful ORM/SOA/MVC Framework for Delphi and FreePascal
https://synopse.info
Other
485 stars 122 forks source link

Internal Error: URW1147 #255

Closed Uefi1 closed 3 weeks ago

Uefi1 commented 1 month ago

Hello in the new version 2.2 when trying to compile on Delphi XE2 error F2084 Internal Error: URW1147 this error occurs in the file mormot.core.json

synopse commented 1 month ago

Did you try with the latest trunk revision?

Uefi1 commented 1 month ago

Oh, sorry, not version 2.2, but the latest one, if downloaded via github>code>download

synopse commented 1 month ago

This is a compiler bug, specific to XE2. I don't have this compiler installed, so I can't fix it. It work on my side with Delphi 2010 and XE4.

Uefi1 commented 1 month ago

This is a compiler bug, specific to XE2. I don't have this compiler installed, so I can't fix it. It work on my side with Delphi 2010 and XE4.

You know, I once encountered such a bug, the problem was in the inline directive

synopse commented 1 month ago

Yes, I know but without a compiler, I don't know how to circumvent it.

You could try to disable some "inline;" in the source code, perhaps not even in mormot.core.json but in mormot.core.rtti. Try first to add {$undef HASSAFEINLINE} in the beginning of the unit.

Uefi1 commented 1 month ago

Damn, there’s something deeper there, I tried as you said, but it didn’t work ( I can’t even track this error with a debugger (

Uefi1 commented 1 month ago

Hi, it looks like the latest release that compiled without this error is https://github.com/synopse/mORMot2/commit/b5465402ba62ec049da25851d70d125feff87259

synopse commented 1 month ago

I don't get how https://github.com/synopse/mORMot2/commit/30b619c2813a3 (the very next commit) could be invalid for Delphi XE2. It is 64-bit specific code, which is not used by XE2 at all.

Uefi1 commented 1 month ago

Or maybe the binaries do not fit the latest library and that’s why the error occurs?

synopse commented 1 month ago

URW errors are a pure Delphi compiler bugs. It is just a bug of the compiler which is not able to compile the code. Nothing to do with static linking of external librairies.

Uefi1 commented 1 month ago

Can you somehow fix this ?

synopse commented 1 month ago

Without the compiler itself, I can't.

Uefi1 commented 4 weeks ago

Try downloading Delphi XE2 ?

Uefi1 commented 4 weeks ago

Hello, I actually found the latest version that still compiles on Delphi XE2, this one: https://github.com/synopse/mORMot2/commit/0f65917f96cacfcd3cafc1abcd623629b8ffd268

synopse commented 4 weeks ago

What if you change procedure AddU(Value: PtrUInt); into procedure AddU(Value: cardinal); in mormot.core.text ?

Uefi1 commented 4 weeks ago

No, unfortunately it didn’t help =(

synopse commented 3 weeks ago

I was able to install a Delphi XE2 compiler.

First of all, I see no problem with Win32 target. Only on Win64 I got this F2084 Internal Error: URW1147. I will try to investigate. Delphi is just buggy as hell.

It sounds linked to generics: https://stackoverflow.com/questions/9429484/what-should-i-do-about-an-internal-error-when-i-declare-a-generic-array-of-t But even if I disable generics... it does not compile...

synopse commented 3 weeks ago

@Uefi1 Did you install all available updates on your Delphi XE2? That is UP4+HF1? https://blog.marcocantu.com/blog/delphi_xe2_hotfix_4_1.html

synopse commented 3 weeks ago

Please try with this above commit.

Uefi1 commented 3 weeks ago

Please try with this above commit.

Yes, this commit compiles successfully, it worked, thank you very much =)

Uefi1 commented 3 weeks ago

Hurray, the latest version now compiles if you download it from github>Code>download zip thanks for the correction !