[IronPython] Building IronPython 0.9 with Mono 1.1.8.2

Seo Sanghyeon tinuviel at sparcs.kaist.ac.kr
Thu Aug 4 05:18:53 CEST 2005


Hello,

I tried to build IronPython 0.9 with Mono 1.1.8.2. I used Debian package
currently in Sid.

With attached "patch", I succeeded building it, but it doesn't really
run. Transcript follows:

 * * *

tinuviel at debian:~/fepy$ mono --version
Mono JIT compiler version 1.1.8.2, (C) 2002-2005 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC)
        SIGSEGV      : normal
        Globalization: normal
tinuviel at debian:~/fepy$ gmcs --version
Mono C# compiler version 1.1.5.0

 * * *

tinuviel at debian:~/fepy$ ls
IronPython-0.9.zip  mono-build.patch
tinuviel at debian:~/fepy$ unzip -q IronPython-0.9.zip
tinuviel at debian:~/fepy$ patch -p0 < mono-build.patch
patching file IronPython-0.9/IronPython/Hosting/PythonEngine.cs
patching file IronPython-0.9/IronPython/Modules/__builtin__.cs
patching file IronPython-0.9/IronPython/Objects/PythonFile.cs
patching file IronPython-0.9/IronPython/Objects/ReflectedPackage.cs
patching file IronPython-0.9/IronPython/Objects/StringOps.cs
patching file IronPython-0.9/IronPythonConsole/PythonCommandLine.cs
patching file IronPython-0.9/IronPythonConsole/SuperConsole.cs
patching file IronPython-0.9/makefile

 * * *

tinuviel at debian:~/fepy$ cd IronPython-0.9
tinuviel at debian:~/fepy/IronPython-0.9$ rm -rf bin
tinuviel at debian:~/fepy/IronPython-0.9$ mkdir bin
tinuviel at debian:~/fepy/IronPython-0.9$ make
gmcs -warn:0 -t:library -out:bin/IronMath.dll -recurse:IronMath/*.cs
gmcs -warn:0 -t:library -r:bin/IronMath.dll -out:bin/IronPython.dll -recurse:IronPython/*.cs
gmcs -warn:0 -t:exe -r:bin/IronPython.dll -out:bin/IronPythonConsole.exe -recurse:IronPythonConsole/*.cs

 * * *

tinuviel at debian:~/fepy/IronPython-0.9$ mono bin/IronPythonConsole.exe
IronPython 0.9.2042 on .NET 2.0.50215.16
Copyright (c) Microsoft Corporation. All rights reserved.
>>> 1 + 1
System.NullReferenceException: Object reference not set to an instance of an object
in <0x00010> IronPython.Objects.Frame:SetGlobal (System.String name, System.Object value)
in <0x00067> input_0:Run (IronPython.Objects.Frame frame)
in <0x002b0> IronPython.Hosting.PythonEngine:DoOneInteractive (IronPython.Objects.Frame topFrame)
in <0x00064> IronPython.Hosting.PythonEngine:RunInteractive ()
>>>

 * * *

Any idea?

Seo Sanghyeon
-------------- next part --------------
diff -ur IronPython-0.9.old/IronPython/Hosting/PythonEngine.cs IronPython-0.9/IronPython/Hosting/PythonEngine.cs
--- IronPython-0.9.old/IronPython/Hosting/PythonEngine.cs	2005-07-29 11:21:38.000000000 +0900
+++ IronPython-0.9/IronPython/Hosting/PythonEngine.cs	2005-08-04 11:52:59.426015816 +0900
@@ -258,19 +258,10 @@
                 if (ExceptionDetail) {
                     MyConsole.WriteLine(e.ToString(), Style.Error);
                 } else {
-                    string stack = e.StackTrace;
                     MyConsole.Write(e.GetType().ToString(), Style.Error);
                     MyConsole.Write(": ", Style.Error);
                     MyConsole.WriteLine(e.Message, Style.Error);
-                    string[] frames = stack.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
-                    foreach (string frame in frames) {
-                        if (frame.StartsWith("   at IronPython.") ||
-                            frame.StartsWith("   at ReflectOpt.") ||
-                            frame.StartsWith("   at IronPythonConsole.")) {
-                            continue;
-                        }
-                        MyConsole.WriteLine(frame, Style.Error);
-                    }
+                    MyConsole.WriteLine(e.StackTrace, Style.Error);
                 }
                 e = e.InnerException;
             }
diff -ur IronPython-0.9.old/IronPython/Modules/__builtin__.cs IronPython-0.9/IronPython/Modules/__builtin__.cs
--- IronPython-0.9.old/IronPython/Modules/__builtin__.cs	2005-07-26 03:53:24.000000000 +0900
+++ IronPython-0.9/IronPython/Modules/__builtin__.cs	2005-08-04 11:54:10.899150248 +0900
@@ -576,13 +576,13 @@
         }
 
         public static double round(double x) {
-            return Math.Round(x, MidpointRounding.AwayFromZero);
+            return Math.Round(x);
         }
 
         public static double round(double x, int n) {
             if (n < 0) { //!!! certinaly imprecise
                 double factor = Math.Pow(10.0, -n);
-                return factor * Math.Round(x / factor, MidpointRounding.AwayFromZero);
+                return factor * Math.Round(x / factor);
             }
             return Math.Round(x, n);
         }
@@ -725,4 +725,4 @@
         public static object WindowsError = Ops.GetDynamicTypeFromType(typeof(PythonWindowsError));
         #endregion
     }
-}
\ No newline at end of file
+}
diff -ur IronPython-0.9.old/IronPython/Objects/PythonFile.cs IronPython-0.9/IronPython/Objects/PythonFile.cs
--- IronPython-0.9.old/IronPython/Objects/PythonFile.cs	2005-07-23 22:48:06.000000000 +0900
+++ IronPython-0.9/IronPython/Objects/PythonFile.cs	2005-08-04 11:55:00.207654216 +0900
@@ -188,13 +188,6 @@
             stream.Flush();
         }
 
-        public int fileno() {
-            if (fstream != null) {
-                System.Runtime.InteropServices.SafeHandle sh = fstream.SafeFileHandle;
-                return (int)sh.DangerousGetHandle();
-            } else return -1;
-        }
-
         public bool isatty() {
             return false;
         }
diff -ur IronPython-0.9.old/IronPython/Objects/ReflectedPackage.cs IronPython-0.9/IronPython/Objects/ReflectedPackage.cs
--- IronPython-0.9.old/IronPython/Objects/ReflectedPackage.cs	2005-07-26 23:53:20.000000000 +0900
+++ IronPython-0.9/IronPython/Objects/ReflectedPackage.cs	2005-08-04 11:55:41.801331016 +0900
@@ -24,12 +24,7 @@
     [PythonType("package#")]
     public class ReflectedPackage : ICustomAttributes {
         public static string GetCoreTypeName(Type type) {
-            string name = type.Name;
-            if (type.IsGenericType) {
-                int backtick = name.IndexOf('`');
-                if (backtick != -1) return name.Substring(0, backtick);
-            }
-            return name;
+            return type.Name;
         }
 
         private static ReflectedPackage topPackage = new ReflectedPackage("<top>");
diff -ur IronPython-0.9.old/IronPython/Objects/StringOps.cs IronPython-0.9/IronPython/Objects/StringOps.cs
--- IronPython-0.9.old/IronPython/Objects/StringOps.cs	2005-07-23 22:48:08.000000000 +0900
+++ IronPython-0.9/IronPython/Objects/StringOps.cs	2005-08-04 11:57:09.976926288 +0900
@@ -707,14 +707,6 @@
             return ret;
         }
 
-        private static List split(string _value, string[] seps, int maxsplit) {
-            string[] r = maxsplit == -1 ? _value.Split(seps, StringSplitOptions.None)
-                                        : _value.Split(seps, maxsplit + 1, StringSplitOptions.None);
-            List ret = List.MakeEmptyList(r.Length);
-            foreach (string s in r) ret.Add(s); //Str.make(s));  //!!! more evidence that multple strings is bad
-            return ret;
-        }
-
         public static List split(string _value) {
             return split(_value, (char[])null, -1);
         }
@@ -731,7 +723,7 @@
             } else if (sep.Length == 1) {
                 return split(_value, new char[] { sep[0] }, maxsplit);
             } else {
-                return split(_value, new string[] { sep }, maxsplit);
+                throw new Exception("non-char separator");
             }
         }
         //
diff -ur IronPython-0.9.old/IronPythonConsole/PythonCommandLine.cs IronPython-0.9/IronPythonConsole/PythonCommandLine.cs
--- IronPython-0.9.old/IronPythonConsole/PythonCommandLine.cs	2005-07-29 11:21:38.000000000 +0900
+++ IronPython-0.9/IronPythonConsole/PythonCommandLine.cs	2005-08-04 11:57:25.817518152 +0900
@@ -204,7 +204,7 @@
                         if (tabState == null) tabState = new TabState(this, null); //ComputeChoiceList(b.ToString(), topFrame));
                         tabState.WriteNextChoice();
                         continue;
-                    case ConsoleKey.Backspace:
+                    case ConsoleKey.BackSpace:
                         b.Remove(b.Length - 1, 1);
                         Console.CursorLeft -= 1;
                         Console.Write(' ');
diff -ur IronPython-0.9.old/IronPythonConsole/SuperConsole.cs IronPython-0.9/IronPythonConsole/SuperConsole.cs
--- IronPython-0.9.old/IronPythonConsole/SuperConsole.cs	2005-07-29 14:21:40.000000000 +0900
+++ IronPython-0.9/IronPythonConsole/SuperConsole.cs	2005-08-04 11:57:42.265017752 +0900
@@ -365,7 +365,7 @@
                 ConsoleKeyInfo key = Console.ReadKey(true);
 
                 switch (key.Key) {
-                    case ConsoleKey.Backspace:
+                    case ConsoleKey.BackSpace:
                         Backspace();
                         break;
                     case ConsoleKey.Delete:
diff -ur IronPython-0.9.old/makefile IronPython-0.9/makefile
--- IronPython-0.9.old/makefile	2005-07-23 22:48:10.000000000 +0900
+++ IronPython-0.9/makefile	2005-08-04 11:51:30.437544120 +0900
@@ -1,4 +1,4 @@
-CSC=csc
+CSC=gmcs -warn:0
 
 all:bin/IronMath.dll bin/IronPython.dll bin/IronPythonConsole.exe 
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20050804/a1d1e082/attachment.pgp>


More information about the Ironpython-users mailing list