Mono support

26 views
Skip to first unread message

Richard Towers

unread,
Sep 5, 2014, 8:07:18 AM9/5/14
to ccnet...@googlegroups.com
Hi Guys,

I had a look at getting ccnet to build under mono / ubuntu. Am I right in thinking that this is something that's not expected to work out of the box at the moment, but that has worked to some extent in the past?

I don't know if people have come across vagrant. I think that this would be a good way of us sharing a consistent linux environment for work on improving mono compatibility. The workflow would be something like:

Initial setup:
    • Install vagrant and virtualbox on your development machine
Then:
    • cd into the CruiseControl.Net directory
    • run vagrant up
      • This will create and provision a virtual machine according to a Vagrantfile which we'd have checked into source control
        • I think this can just be a plain ubuntu machine with mono-devel installed
    • vagrant ssh to connect to the VM
    • run the build / tests
There's a vagrant branch on my github fork which contains some initial hacking about.

Here's a quick summary of my attempts to get it to build under that linux VM:
  • I had some problems with NAnt picking the wrong version of xbuild, so for now I've been ignoring NAnt and running xbuild directly.
  • Running: 
    xbuild project/ccnet.sln /property:DISABLE_JSCRIPT=true /property:DISABLE_COM=true
    Nearly worked, but there were a couple of windows-specific BuildEvents which failed.
  • I added conditionals to the projects that use windows CMD in build events with unix alternatives (see aa65c88 and 10dd702)
  • The build got a bit further this time, but the Visual Basic demo still failed. I removed that from the solution file since I don't think mono deals with VB all that well.
  • This seems to have fixed the build!
  • I tried to run mono Build/Server/ccnet.exe but this crashed immediately (see [0] below)
  • CCCmd seems to run ok (at least, it displays the help text without crashing :-)
  • The web dashboard appears to run fine with xsp --nonstop
So, all in all a fairly promising start.

One problem with the vagrant approach is that it isn't GUI friendly, so I haven't been able to debug with the usual tools. I'll need to have a think about how best to investigate. I don't suppose anyone has any ideas on the error?

Cheers,
Rich

0:
vagrant@packer-virtualbox-iso:/vagrant$ mono Build/Server/ccnet.exe
CruiseControl.NET Server 0.0.0.0 -- .NET Continuous Integration Server
Copyright © 2003 - 2014 ThoughtWorks Inc. All Rights Reserved.
.NET Runtime Version: 4.0.30319.17020 [Mono] Image Runtime Version: v4.0.30319
OS Version: Unix 3.13.0.24 Server locale: en-US

log4net:ERROR XmlHierarchyConfigurator: Could not create Appender [Console] of type [log4net.Appender.ColoredConsoleAppender]. Reported error follows.
System.EntryPointNotFoundException: GetConsoleOutputCP
at (wrapper managed-to-native) log4net.Appender.ColoredConsoleAppender:GetConsoleOutputCP ()
at log4net.Appender.ColoredConsoleAppender.ActivateOptions () [0x00000] in <filename unknown>:0
at log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender (System.Xml.XmlElement appenderElement) [0x00000] in <filename unknown>:0
log4net:ERROR XmlHierarchyConfigurator: Appender named [Console] not found.
An unexpected error has caused the console to crash, please press any key to continue...

Ruben Willems

unread,
Sep 5, 2014, 8:28:16 AM9/5/14
to ccnet-devel
Hi

The idea is that CCNet should work out of the box on mono,
but for the moment that is not the case :-(

Any help on this topic is greatly appreciated, since I'm not a linux dev expert.
It could be that we must change the logger from log4net to Nlog, which should make the logging on mono easier (colored console and the like)

The error you have there is from the logger, you could change the following in ccnet.exe.config :
from
<appender name="Console" type="log4net.Appender.ColoredConsoleAppender">
to
<appender name="Console" type="log4net.Appender.ConsoleAppender">


the coloredconsole appender from log4neet is know to cause problems on Linux :-(  
(something with ansi values of the screen)


If you need more info let me know


with kind regards
Ruben Willems


--

---
You received this message because you are subscribed to the Google Groups "ccnet-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ccnet-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Towers

unread,
Sep 5, 2014, 10:00:22 AM9/5/14
to ccnet...@googlegroups.com
Ah ha! Cracked it. Switching to ConsoleAppender did the trick. There were just a couple of trivial issues with the "MyFirstProject" config being windows specific:
  • (ping.exe isn't on the path on unix machines (ping is though, but it needs a -c 1 argument or it never stops pinging)
  • The paths default to C:\CCNet\... which should be /home/username/ccnet/... on unix machines)
Once I fixed those things it worked without issue, including communicating with the webdashboard. I'll put together a PR fixing the BuildEvents I mentioned above, which I think are the only code change needed to get this working. I think everything else could be addressed with documentation for now.

Next steps in terms of mono support:
  • get NAnt running
  • get a unix ccnet CI running under unix
  • get the tests passing
I'll raise issues for these.

Thanks for your help!
Richard
Reply all
Reply to author
Forward
0 new messages