RavenDB on Mono
So is it possible?
Yes, it is.
There, that was a short blog entry wasn’t it?
I’ve patched RavenDB in a few places, both to workaround the bug/mismatch between Mono and Microsoft’s implementation of ThreadLocal.Value, dealing with the standard path-based issues and adding a couple of specific checks for Mono in the outer layers of the application (Did you know that Environment.UserInteractive is always false in Mono?)
I’ve submitted the pull request, but if you really want to get RavenDB working on Mono right now, then I suggest you do the following:
- Download and install Mono 2.8 (Yup, you don’t need to build from source – hurrah)
- Pull my fork and branch of RavenDB for Mono https://github.com/robashton/ravendb/tree/mono
- Run xBuild with the following arguments
MONO_IOMAP=all xbuild /property:DocumentationFile='' /property:TreatWarningsAsErrors='false' RavenDB.sln
- Run Mono Raven.Server.exe
- Proceed as normal
I’ve tested the following configurations
- Raven.Server running as an HTTP process
- Connecting to the Raven server from client code
- Running RavenDB Embedded within an application
- Running RavenDB Embedded with an HTTP server in an application
Some caveats to this
- the xUnit tests currently hang if you don’t clean the test-bed every time you run them, this is likely a problem with the tests that need fixing
- Basic functions appear to be fully capable, you don’t get DTC (Obviously), some sharding stuff appears to be a bit off and multi-tenancy seems to be a bit weird too.
NB: This is unofficial support for Mono, it's a low priority as far as the core project goes, but I am eager to make this work
Thanks and Attribution:
Jérémie Laval (http://twitter.com/#!/jeremie_laval) has been instrumental in moving this forwards with a heap of Mono know-how, the instructions on now to build on Mono have come from him, as have a number of fixes. He is currently working on some other issues with some failing tests too, looks like this ball is going to keep rolling!