language-ext icon indicating copy to clipboard operation
language-ext copied to clipboard

Release build fails for a big application

Open mirceamuresanse opened this issue 9 months ago • 5 comments

We have an application that it contains a lot of code. Building the app in Visual Studio in debug mode it always works fine. When attempting to build in release mode, it takes a much longer time and in the end it throws these errors in the log (see attached files). This happens if I build both in Visual Studio or from command line.

The reason I opened the ticket here is that I noticed that it is related to this library. release build - partial log 1.txt release build - partial log 2.txt

mirceamuresanse avatar May 02 '24 20:05 mirceamuresanse

Looks like a compiler bug to me. I'd make sure everything is up to date (latest compiler, latest .NET SDK). If it still doesn't work you'll have to report it on the Roslyn repo I think

Another thing that I guess could be worth considering: are you using AOT or any other tree-shaking?

louthy avatar May 02 '24 21:05 louthy

I'm on Mircea's team and have been staring hard at this weird error too. :)

We were wondering something like that ourselves. We have tried turning off AOT and changing the linker behavior to don't link. Unfortunately, we got the same error. Any other settings to tweak?

jeremy-bridges avatar May 03 '24 00:05 jeremy-bridges

To be clear, this is occurring in the Windows and Android release builds.

jeremy-bridges avatar May 03 '24 00:05 jeremy-bridges

Not that I know of. Differences between a debug and release build really would hint to me that it's compiler related, I'd look for the difference in builds and try working out what setting is the cause. Other than that it's anybody's guess.

louthy avatar May 03 '24 10:05 louthy

System.OverflowException: Arithmetic operation resulted in an overflow. -- is also pretty suspect. Obviously, without knowing the internals of the roslyn IL code-gen I can't know what the problem is, but an integer overflow might suggest they're using byte or short for something, possibly number of members, number of types, or number of variables. Do you have an excess of those in that area of the code?

I would still expect it to fall over in the debug build though. Unless this is literally part of the release-IL optimisation.

louthy avatar May 03 '24 10:05 louthy