[Mono-dev] Getting started on mono sources
Edward Ned Harvey (mono)
edward.harvey.mono at clevertrove.com
Tue Feb 18 01:20:01 UTC 2014
> From: Jean-Michel.Perraud at csiro.au [mailto:Jean-Michel.Perraud at csiro.au]
> At least a couple of people including myself have an interest in
> recommended dev env to work on Mono itself (
> http://lists.ximian.com/pipermail/mono-devel-list/2013-July/040638.html). A
> Howto on recommended setup for Mono contributions would save a fair bit
> of time and hassle for contributors, but I have not heard of such a document.
I found the .sln files and msbuild instructions to be nonfunctional on a modern system... But I managed to find a workable solution, thanks to Marek, who said:
> I am using Xamarin Studio (it should work with MonoDevelop as well) to
> debug and write BCL source code.
> You compile your own mono then use Project -> Set Active runtime to point
> to your locally build sources then untick Debug project code only in
> Preferences and you are set to go.
The above information proved vital, but I still encountered plenty of difficulty, but I am nothing if not diligent about documenting things as I go along. So here is something more closely resembling a step-by-step:
On OSX Mavericks, (Goes without saying) Requires XCode, and the command line tools. Which no longer include (since 2013) autoconf, automake, libtool. So used homebrew to install autoconf, automake, libtool.
brew install autoconf
brew install automake
brew install libtool
Installed the latest MonoDevelop (Xamarin Studio) and latest mono.
Followed instructions to build from Git.
Note: The instructions only say to "make" and don't say to "make install" afterward (which seems to be an oversight). Furthermore, the first time I ran "make" it ended with an error message, DoesNotExist referenced by TOC doesn't exist. Abort. But then, to my surprise, I simply ran "make && make install" and it worked fine the second time around. Weird. Also - before anybody wastes time trying this for the first time - I did not get a functional result on the "Master" branch of the git repo. I used SourceTree to checkout the 3.2.6 Tag. (I'm sure you could use any git client you like, including command line.)
Anyway, it all took 2G of disk space and a few hours to checkout, configure, build, but after mono finished building...
Inside Xamarin Studio, create some dumb new project. By default only a single runtime registered so the Project / Active Runtime menu item doesn't appear. I had to go to Xamarin Studio / Preferences / .NET Runtimes / Add. Add the newly built runtime environment. The system thinks a while (beachball) and then the Project / Active Runtime menu becomes available, to select my newly compiled runtime.
Go to Xamarin Studio / Preferences / Debugger. And un-check the checkbox:
[_] Debug project code only; do not step into framework code
And now for example, I'm able to write an app with:
RSACryptoServiceProvider myrsa = new RSACryptoServiceProvider (3072);
myrsa.ExportParameters (includePrivateParameters: false);
And I'm able to Start Debugging. And step into the RSA code to see what it's doing internally. Hooray! :-)
More information about the Mono-devel-list