ForNeVeR / PascalABC.NET.SDK

MSBuild SDK for PascalABC.NET
MIT License
17 stars 2 forks source link

Support platforms other than Windows #4

Open ForNeVeR opened 2 years ago

ForNeVeR commented 2 years ago

Right now, we are trying to run the pabcnetc.exe directly, which will only work on platforms that support this executable (Windows mainly).

We should support Mono on other platforms as well.

(Unfortunately, the story about the compiler which highly depends on System.Reflection.Emit on modern .NET runtimes is very complex, and we'll unlikely be able to run it, say, on .NET 6 soon).

kant2002 commented 2 years ago

Isn’t first step should be just migrate pascalabc project files to more modern msbuild. I think that can improve ability to experiment with running on modern Net

ForNeVeR commented 2 years ago

No, it's not that easy. PascalABC.NET compiler is a heavy user of reflection and Reflection.Emit. It saves the assembly by calling AssemblyBuilder.Save, which is still broken.

But there's an interesting thing. While looking for its usages of AssemblyBuilder.Save, I found that the compiler has some coe to check IsDotnet5(): https://github.com/pascalabcnet/pascalabcnet/blob/673e3882c9a7bd02be54ef122e99d50c700298ce/NETGenerator/NETGenerator.cs#L459-L468

So maybe the situation is better than I thought? And cross-platform targets are supported?