[IronPython] IronPython on Unix issues.

Miguel de Icaza miguel at novell.com
Fri Aug 10 15:56:26 PDT 2007


Hello,

     To get IronPython to run on Unix, it is necessary to swap some
code, it seems that the code in SystemState.cs tries to swap some
builtins before the builtins are loaded.

     The code is the check for Unix inside InitializeBuiltins (patch is
attached for those on Unix).

     Also Sanghyeon pointed out that the Makefile I posted was wrong:

> Sorry, but this Makefile doesn't do resource generation for
> Microsoft.Scripting.dll and IronPython.dll, and the resulting
> IronPython console won't work correctly.

You are correct Sanghyeon, I merely used the assemblies to do some work
on our build system for Moonlight.

I have now included a modified version of your nant build file.   To get
a working ipy.exe it is still necessary to move some code around.

Miguel
-------------- next part --------------
--- IronPython/Runtime/SystemState.cs.~1~	2007-08-10 13:10:47.000000000 -0400
+++ IronPython/Runtime/SystemState.cs	2007-08-10 18:51:34.000000000 -0400
@@ -536,21 +536,6 @@
             // We should register builtins, if any, from IronPython.dll
             _autoLoadBuiltins.Add(typeof(SystemState).Assembly);
 
-            if (Environment.OSVersion.Platform == PlatformID.Unix) {
-                // we make our nt package show up as a posix package
-                // on unix platforms.  Because we build on top of the 
-                // CLI for all file operations we should be good from
-                // there, but modules that check for the presence of
-                // names (e.g. os) will do the right thing.
-                Debug.Assert(_builtinsDict.ContainsKey("nt"));
-                _builtinsDict["posix"] = _builtinsDict["nt"];
-                _builtinsDict.Remove("nt");
-            }            
-
             DynamicHelpers.TopPackage.AssemblyLoaded += new EventHandler<AssemblyLoadedEventArgs>(TopPackage_AssemblyLoaded);
 
             PythonExtensionTypeAttribute._sysState = this;
@@ -562,6 +547,17 @@
             foreach(Assembly builtinsAssembly in _autoLoadBuiltins) {
                 LoadBuiltins(builtinsAssembly);
             }
+            if (Environment.OSVersion.Platform == PlatformID.Unix) {
+                // we make our nt package show up as a posix package
+                // on unix platforms.  Because we build on top of the 
+                // CLI for all file operations we should be good from
+                // there, but modules that check for the presence of
+                // names (e.g. os) will do the right thing.
+                Debug.Assert(_builtinsDict.ContainsKey("nt"));
+                _builtinsDict["posix"] = _builtinsDict["nt"];
+                _builtinsDict.Remove("nt");
+            }            
+
         }
 
         private void TopPackage_AssemblyLoaded(object sender, AssemblyLoadedEventArgs e) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IronPython.build
Type: application/xml
Size: 2265 bytes
Desc: not available
Url : http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20070810/012af7ec/attachment.xml 


More information about the Users mailing list