Skip to content

Instantly share code, notes, and snippets.

@luhenry
Forked from Geotha/gsoc-report.md
Created August 14, 2017 13:03
Show Gist options
  • Save luhenry/fa6cbd52ad8ab76bcc8f26a39dd93890 to your computer and use it in GitHub Desktop.
Save luhenry/fa6cbd52ad8ab76bcc8f26a39dd93890 to your computer and use it in GitHub Desktop.

This is a report for my contribution to Mono Project as Google Summer of Code 2017 student

Description

Mono is a open source development platform based on the .Net Framework and allows developers to build cross-platform applications. Mono's .NET implementation is based on the ECMA standards for C# and the Common Language Infrastructure. It includes both developer tools and the infrastructure needed to run .NET client and server applications on Linux, Microsoft Windows, Mac OS X, BSD, Sun Solaris, Nintendo Wii, Sony PlayStation 3, Apple iPhone and Android.

Mono is supported by Microsoft and .Net Foundation and consisted by:

Goal

The implementation of Pipe Streams in Mono doesn't support some functionalities such as parallel builds on msbuild. CoreFX is the foundational libraries for .NET Core. The implementation of Pipe Streams in CoreFx fixes the previous problems. So, the goal of the project was to import System.IO.Pipes.PipeStream from CoreFX to Mono. Doing this, new features is offered by Mono.

Work process

Initially, I learned more about Mono Project and explored platform structure. Mono Project in order to manage running at different platforms, has implemented layer abstraction. So, there is common_System.Core.dll.sources which includes source files with no platform specific code. For platform specific code, there are win32_net_4_x_System.Core.dll.sources, linux_net_4_x_System.Core.dll.sources and darwin_System.Core.dll.sources that include files with system calls and other elements which are executed by the lower layer of each platform.

I should have imported from CoreFx the files that are in this csproj file. Firstly, I split the no platform specific from platform specific files and replaced corresponding files from common_System.Core.dll.sources, win32_net_4_x_System.Core.dll.sources, linux_net_4_x_System.Core.dll.sources and darwin_System.Core.dll.sources. The import of CoreFx code was easy because the code existed as submodule in repo. Also, I added some errors messages in SR.cs file that are existed now due to new CoreFx code.

When I resolved some duplicated references between Mono and CoreFx code, built mono with my changes. Running tests, I found out that some APIs of Mono were dropped by CoreFx. So, then I changed CoreFx code in order to support the broken APIs of Mono.

Afterwards, I imported System.IO.Pipes.PipeStream from CoreFx to build and basic profile with similar way as before. I built and run tests on Windows and Linux platform. The results of tests were successful. For macOS platform, I couldn't build and run tests because didn't have a machine.

Also, I tried to import my changes to testing_aot_full and testing_aot_hybrid profile which are relative to Ahead Of Time Compiler of Mono. But there was crash in the runtime in stable version of Mono, so it prevented me from testing. About monotouch and monodroid profiles, I couldn't test them because it was very hard to test on Android and IOS environment. The profiles, that I couldn't test with System.IO.Pipes.PipeStream from CoreFx, have the initial version of Mono.

At the end, I enabled signing of libraries for security reasons.

Here are the commits that I did in Mono and CoreFx repos:

Extra Work

In addition to proposed work, I undertook to run msbuild with parallel builds enabled on Linux using mono. Before my changes, parallel builds weren't possible because of problem with System.IO.Pipes.PipeStream in Task Parallel Library Dataflow. So, the purpose was to check if this important feature will work with CoreFx implementation. Running tests on msbuild with mono and without parallel builds enabled, I took errors both stable and my version of mono. Enabling parallel builds, errors were remaining and I couldn't determine if my version works properly.

Future work

  • Test CoreFx implementation to testing_aot_full and testing_aot_hybrid profiles, when runtime crash is resolved.
  • Test CoreFx implementation to monotouch and monodroid profiles, when there is suitable equipment.
  • Test mono on msbuild with parallel builds enabled, when tests will run successfully.

Acknowledgement

Finally, I would like to thank my mentor Ludovic Henry for guidance, immense support and excellent collaboration that we had.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment