[Mono-list] I kind of built nant 8.3 on RH9+Mono, but then ...

A Rafael D Teixeira rafaelteixeirabr@hotmail.com
Thu, 02 Oct 2003 00:04:29 -0300


Well, I had to fiddle with the mininant makefile, had to copy/rename dll 
from log4net-1.2.0-beta8, had to create an mininant.exe.config and make 
changes in NAnt.exe.config (not yet on the source it is compiled), and NAnt 
8.3 runs, but:

I had to keep NAnt.exe in /usr/lib/ with NAnt.*Tasks.dll assemblies or it 
would not find the tasks (mono linux-friendly separation of exes and dlls, 
plays havoc with NAnt autoconfigurable factories...). I may have missed some 
setting that would help with that but...

I had to uncomment code on resgentask.cs, for it to work correctly in linux, 
as needed for next step

Then I built NUnit 2.1.4 using NAnt, with a shortened buildfile (avoiding 
SWF dependencies)

<output>

[rafael@redhat9 build]$ mono nunit-console.exe
NUnit version 2.1.4
Copyright (C) 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. 
Vorontsov, Charlie Poole.
Copyright (C) 2000-2003 Philip Craig.
All Rights Reserved.

fatal error: no inputs specified

NUNIT-CONSOLE [inputfiles] [options]

Runs a set of NUnit tests from the console.

You may specify one or more assemblies or a single
project file of type .nunit.

Options:
/fixture=STR         Fixture to test
/xml=STR             Name of XML output file
/transform=STR       Name of transform file
/nologo              Do not display the logo
/help                Display help (Short format: /?)
/wait                Require input to close console window
/xmlConsole          Display XML to the console
/config=STR          Project configuration to load

</output>

At the end I could run NAnt to build Bamboo.Prevalence, but then mcs balks 
inside libmono.so:

<output>

NAnt version 0.8.3 Copyright (C) 2001-2003 Gerry Shaw
http://nant.sourceforge.net

Buildfile: 
file://home/rafael/projetos/Bamboo.Prevalence/Bamboo.Prevalence.build

setDebugProperties:


init:


Bamboo.Prevalence:

      [csc] Compiling 26 files to 
/home/rafael/projetos/Bamboo.Prevalence/bin/Bamboo.Prevalence.dll.
            In type: 
Bamboo.Prevalence.Attributes.PrincipalSensitiveAttribute
[Tasks.ExternalProgramBase:  - [] <>]

[Tasks.ExternalProgramBase:Unhandled Exception: 
System.NullReferenceException: A null value was found where an object 
instance was required  - [] <>]
            Unhandled Exception: System.NullReferenceException: A null value 
was found where an object instance was required
[Tasks.ExternalProgramBase:in (unmanaged) 
/usr/lib/libmono.so.0(mono_class_setup_vtable+0x19e) [0x400f0693]  - [] <>]
            in (unmanaged) 
/usr/lib/libmono.so.0(mono_class_setup_vtable+0x19e) [0x400f0693]
[Tasks.ExternalProgramBase:in (unmanaged) /usr/lib/libmono.so.0 [0x400aa80a] 
  - [] <>]
            in (unmanaged) /usr/lib/libmono.so.0 [0x400aa80a]
[Tasks.ExternalProgramBase:in (unmanaged) 
/usr/lib/libmono.so.0(mono_reflection_create_runtime_class+0xb0) 
[0x400aaeeb]  - [] <>]
            in (unmanaged) 
/usr/lib/libmono.so.0(mono_reflection_create_runtime_class+0xb0) 
[0x400aaeeb]
[Tasks.ExternalProgramBase:in <0x001e8> 00 
System.Reflection.Emit.TypeBuilder:CreateType ()  - [] <>]
            in <0x001e8> 00 System.Reflection.Emit.TypeBuilder:CreateType ()
[Tasks.ExternalProgramBase:in <0x00092> 00 
Mono.CSharp.TypeContainer:CloseType ()  - [] <>]
            in <0x00092> 00 Mono.CSharp.TypeContainer:CloseType ()
[Tasks.ExternalProgramBase:in <0x000c6> 00 
Mono.CSharp.TypeContainer:CloseType ()  - [] <>]
            in <0x000c6> 00 Mono.CSharp.TypeContainer:CloseType ()
[Tasks.ExternalProgramBase:in <0x00252> 00 
Mono.CSharp.RootContext:CloseTypes ()  - [] <>]
            in <0x00252> 00 Mono.CSharp.RootContext:CloseTypes ()
[Tasks.ExternalProgramBase:in <0x008ab> 00 Mono.CSharp.Driver:MainDriver 
(string[])  - [] <>]
            in <0x008ab> 00 Mono.CSharp.Driver:MainDriver (string[])
[Tasks.ExternalProgramBase:in <0x0001b> 00 Mono.CSharp.Driver:Main 
(string[])  - [] <>]
            in <0x0001b> 00 Mono.CSharp.Driver:Main (string[])

</output>

Well, type PrincipalSensitiveAttribute has two peculiarities: it's an 
Attribute that (a) implements an interface and (b) contains an internal 
class. See:

<snippet>

	[Serializable]

	[AttributeUsage(AttributeTargets.Class, AllowMultiple=false)]

	public class PrincipalSensitiveAttribute : System.Attribute, 
ICommandDecorator

	{

		ICommand ICommandDecorator.Decorate(ICommand command)

		{

			IPrincipal principal = Thread.CurrentPrincipal;

			if (null == principal)

			{

				return command;

			}

			return new PrincipalRecoveryCommand(command, principal);

		}



		[Serializable]

		class PrincipalRecoveryCommand : ICommand {

</snippet>

I don't think I understand libmono enough to find the culprit, but I may try 
if no generous soul comes to my rescue...

Anyway, I intend to stabilize those N-beasts on Mono-Linux, and may end 
packaging then for who may want  to simply use then, on the miriad open 
source projects now sporting buildfiles.
I'm not sure if maintainers would accept my patches to make them mono 
friendly.

Also I don't know if it is reasonable to add these new versions to mono cvs, 
as they have broader dependencies (log4net, NDoc, #cvslib) and also some 
still unresolved ones (VS.NET specific assemblies, and Interop for 
SourceSafe ActiveX interface, are good examples).

Well, let me stop babbling,

Best regards,

Rafael Teixeira
Brazilian Polymath
Mono Hacker since 16 Jul 2001

_________________________________________________________________
MSN Messenger: instale grátis e converse com seus amigos. 
http://messenger.msn.com.br