kekyo / IL2C

IL2C - A translator for ECMA-335 CIL/MSIL to C language.
Apache License 2.0
401 stars 36 forks source link

Upgrade to Visual Studio 2019 environments. #80

Closed kekyo closed 4 years ago

kekyo commented 5 years ago

Topics:

kekyo commented 5 years ago

Ouch, current CMake toolchain is older so can't build 2019 projects.

https://kekyo.visualstudio.com/IL2C/_build/results?buildId=288&view=logs&j=2d2b3007-3c5c-5840-9bb0-2b1ea49925f3

NotoriousRebel commented 4 years ago

Any updates on this issue? Trying to do the basic example and not working with latest version of Visual Studio 2019.

kekyo commented 4 years ago

@NotoriousRebel Thanks trying my project! I join masters degree and doing other research project now, so I suspended developing IL2C (and NOT retired :)

Hmm, are you meaning it failed GettingStartedIL2C sample on VS2019? Did you see what cause failure with message? I'll fix it.

NotoriousRebel commented 4 years ago

Apologies for the late reply! Good luck with your master's degree :). This is an awesome project I am following this guide. While following that when you get to modifying the GettingStartedIL2Cmain.vcxproj this is the line that seems to break things

<ItemDefinitionGroup Condition="..."> <!-- each conditions -->

I get this error: D:\repos\TestILC\GettingStartedIL2CMain\GettingStartedIL2CMain.vcxproj : error : Specified condition "..." evaluates to "..." instead of a boolean I was able to fix it by doing this

<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">`
``

Cloning the repo and going to samples it seems to compile just fine without the need for the fix; however, I was curious if Pinvoke was supported? For example, attempting to pinvoke MessageBox from user32.dll (.net core 2.0)
I get greeted with errors. 
    [DllImport("user32.dll")]
    public static extern int MessageBoxA(
       IntPtr hWnd,
       String text,
       String caption,
       int options);

image

kekyo commented 4 years ago

@NotoriousRebel Sorry too late too :)

It had two problems about:

  1. System.IntPtr.Zero was not implemented.
  2. P/Invoke with string in parameters cannot be handled.

These problems are fixed, but it isn't packaging now. Maybe you can do the guide chapter 1 manually. I'll update latest binary packages when fixed broken CI.

kekyo commented 4 years ago

@NotoriousRebel You can test Win32 MessageBox api with P/Invoke, but it has limitation for only using unicode string (wchar_t*). It means we have to use win32 api for unicode version entry point (MessageBoxW instead MessageBoxA).

I added sample MessageBoxW code in updated chapter 1. Please refer.

kekyo commented 4 years ago

I gave up and can't understand why Azure Pipelines couldn't execute (and ignored) any unit tests... All unit tests succeeded on local Visual Studio environment :(

I feel cause by both CI environment and package nuspec related problems.

Will ignore now these problems, go to next.

kekyo commented 4 years ago

Prebuilt nuget packages 0.4.100 were published on myget.

kekyo commented 4 years ago

0.4.100 was broken for package version dependency informations. Updated RelaxVersioner and 0.4.101 were published on myget.

kekyo commented 4 years ago

Related https://social.msdn.microsoft.com/Forums/vstudio/en-US/109c2303-b4a5-4aa1-8f61-01663d358fa5/using-metadata-in-conditions?forum=msbuild

kekyo commented 4 years ago

Prebuilt nuget packages 0.4.102 were published on myget.

kekyo commented 4 years ago

Verified msbuild scripts on VC2019.

kekyo commented 4 years ago

Bump 0.4.110 and done 🎉