Conversation
This enables F# apps to be built against CoreRT until System.Diagnostics.Tracing is ported to Unix
- This fixes "unimplemented runtime method" runtime error for GetNativeSystemInfo method. - Achieves successful run of a simple "Hello Wolrd!" F# console app
Fix failed Windows CI build
@@ -59,6 +59,7 @@ public static void FailFast(String message, Exception exception) | |||
RuntimeExceptionHelpers.FailFast(message, exception); | |||
} | |||
|
|||
#if !PLATFORM_UNIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please move this to Environment.Windows.cs
instead of adding the ifdef?
(BTW: We are using corefx coding guidelines in CoreRT - https://github.com/dotnet/corefx/tree/master/Documentation/coding-guidelines.)
_SC_NPROCESSORS_ONLN = 3, | ||
} | ||
|
||
[DllImport(Interop.Libraries.CoreLibNative, EntryPoint = "CoreLibNative_SysConf", SetLastError = true)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to just reference the implementation in Libraries.SystemNative
(just like in corefx), and avoid adding the C++ impl.
Are there problems you are running into if you do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I do use Libraries.SystemNative
the F# app builds fine but then produces a 42097 segmentation fault
when executed. Still in the process of debugging it though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can trying merging with #2170 - it may fix the segmentation faults you are seeing.
@@ -104,4 +104,9 @@ extern "C" | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be able to delete GetNativeSystemInfo from this file - it should not be needed anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetNativeSystemInfo has been removed
Move Windows specific ProcessorCount method to Environment.Windows.cs
The GetNativeSystemInfo method is no longer called on unix so can be removed
System.Native native lib already includes a SysConf method
@jkotas having an updated |
Thank you! |
Awesome dude! 👍 |
This PR lays the groundwork for native compilation of F# programs with CoreRT.
Successful compilation and execution of a simple "Hello World!" F# program was achieved
#2057