[IronPython] IronPython 1.0 Beta 3 on Mono

Sanghyeon Seo sanxiyn at gmail.com
Thu Feb 16 07:48:01 PST 2006

This is an update on "IronPython 1.0 Beta 2 on Mono" mail.

"Mono SVN trunk" referred below is revision 56919, in case that matters.

Neither current Mono release nor current Mono SVN trunk can run Beta 3
binary. Both fails at startup with:

Unhandled Exception: System.NotImplementedException: The requested
feature is not implemented.
in <...> System.Reflection.Emit.DynamicMethod:DefineParameter (Int32
position, ParameterAttributes attributes, System.String strParamName)

Looking up the Mono source, this method is marked "MonoTODO".

However, Mono SVN trunk can compile Beta 3 source! Well, compiling
isn't that useful if you can't run the result, but it turned out that
there's a simple workaround for now. Here's how:

1. Download and unzip IronPython 1.0 Beta 3.
2. Delete IronMath.dll, IronPython.dll, IronPythonConsole.exe. (We
will rebuild.)
3. Change to Src directory.
4. Edit makefile.
4-1. Change "csc" to "gmcs".
4-2. Change "mkdir" to "mkdir -p".
5. Edit IronPython/Compiler/Options.cs.
5-1. Change OptimizeReflectCalls to false at line 43.
6. Type "make".

You will get a lot of warnings. A topic for another mail... Anyway,
you should see "Compilation succeeded" message.

Resulting binary can be run with both current Mono release and Mono SVN trunk.

time module problem I mentioned earlier is still there. With current
Mono release, you get "Missing member" message as expected. With Mono
SVN trunk, you get "An exception was thrown by the type initializer
for IronPython.Modules.Time", and this exception is really
NotImplementedException. IsDaylightSavingTime is marked "MonoTODO" in
the Mono source.

There's another simple workaround for this though. Add this to site.py:

# A hack for Mono
    import time

Importing time *the second time* will succeed. Don't ask me why.

With above two workarounds, it seems pretty usable. I will experiment more now.

Seo Sanghyeon

More information about the users mailing list