[IronPython] Hosting IP2 Beta2 in Mono?

Douglas S. Blank dblank at brynmawr.edu
Mon May 19 23:49:35 CEST 2008


On Mon, May 19, 2008 4:12 pm, Zoltan Varga said:
> Hi,
>
> The relevant code is the following:

[snip]

I had already identified the code, and have workarounds (see URL). But I
suspect that they are not correct.

> As for the resource problem, try this in the nant build file:

Excellent! That fixed the issue, and IP2B2 runs fine on Mono (so far).

I'll update:
http://wiki.roboteducation.org/IronPython2B2

Thanks!

-Doug

> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 		<resgen input="Microsoft.Scripting.Core/Microsoft.Scripting.txt"
> output="Microsoft.Scripting.Core/Microsoft.Scripting.Core.resources"/>
> 		<csc target="library" define="${defines}"
> output="Microsoft.Scripting.Core.dll">
> 			<sources>
> 				<include name="Microsoft.Scripting.Core/**/*.cs"/>
> 			</sources>
> 			<resources dynamicprefix="true" basedir="Microsoft.Scripting.Core">
> 				<include name="Microsoft.Scripting.Core.resources"/>
> 			</resources>
> 			<references>
> 				<include name="System.Configuration.dll"/>
> 			</references>
> 		</csc>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>                                 Zoltan
>
> On Mon, May 19, 2008 at 8:52 PM, Douglas S. Blank <dblank at brynmawr.edu>
> wrote:
>> I'm attempting to bring the IronPython Community Edition up to date with
>> IP2B2, and having a couple of issues. I've documented everything needed
>> to
>> build it here:
>>
>> http://wiki.roboteducation.org/IronPython2B2
>>
>> The first is a problem with mapSite in
>> Src/IronPython/Runtime/Builtin.cs.
>> The Mono csharp compiler is complaining that mapSite is uninitialized.
>> Any
>> ideas?
>>
>> The second is comping up with a valid nant xml with the right pieces
>> defined. I can get it to build, and run, but it crashes with:
>>
>> $ mono Src/ipy.exe
>> IronPython 2.0 Beta (0.0.0.0) on .NET 2.0.50727.42
>> Copyright (c) Microsoft Corporation. All rights reserved.
>>>>> 1
>> Unhandled exception:
>>
>> Unhandled Exception: System.Resources.MissingManifestResourceException:
>> Could not find any resources appropriate for the specified culture or
>> the
>> neutral culture.  Make sure "Microsoft.Scripting.Core.resources" was
>> correctly embedded or linked into assembly "Microsoft.Scripting.Core" at
>> compile time, or that all the satellite assemblies required are loadable
>> and
>> fully signed.
>>  at System.Resources.ResourceManager.AssemblyResourceMissing
>> (System.String
>> fileName) [0x00000]
>>  at System.Resources.ResourceManager.InternalGetResourceSet
>> (System.Globalization.CultureInfo culture, Boolean Createifnotexists,
>> Boolean tryParents) [0x00000]
>> ...
>>
>> I suspect that the nant xml is incorrect. The relevant part I have added
>> is:
>>
>>    <csc target="library" output="Microsoft.Scripting.Core.dll"
>>        warninglevel="${warn}">
>>        <sources>
>>            <include name="Microsoft.Scripting.Core/**/*.cs"/>
>>        </sources>
>>        <references>
>>            <include name="System.Configuration.dll"/>
>>        </references>
>>    </csc>
>>
>> Any ideas on these two points would be very helpful.
>>
>> -Doug
>>
>> Douglas S. Blank wrote:
>>>
>>> On Fri, May 9, 2008 11:37 pm, Curt Hagenlocher said:
>>>>
>>>> We added Microsoft.Scripting.Core.dll in Beta2; you'll probably need
>>>> to
>>>> add
>>>> a reference to that.
>>>
>>> Curt, thanks for the quick feedback! You are right, and now I need to
>>> figure out how to make that happen.
>>>
>>> Seo, et al: any chance of updating the IPCE build to work with
>>> IP2Beta2?
>>> It looks like the Microsoft.Scripting.Core.dll requirement isn't going
>>> away, so it won't be wasted effort. (Or someone point me in the right
>>> direction, and I'll try to do it).
>>>
>>> I did try using the MS .dll's directly from CodePlex in Mono, and it
>>> almost works. It builds fine, but *looks* like there is a bug that
>>> prevents Mono from evaluating some statements (like "import sys"). The
>>> stack trace from inside my c# code is below. If you think it is
>>> something
>>> else, please let me know.
>>>
>>> I'd also be interested in other options to using IP2B2 (other than
>>> retreating to an earlier IP). I fairly new to all of this, so maybe I
>>> am
>>> missing something obvious.
>>>
>>> -Doug
>>>
>>> System.Reflection.TargetInvocationException: Exception has been thrown
>>> by
>>> the target of an invocation. ---> System.ArgumentException: The method
>>> should be static.
>>> Parameter name: method
>>>  at System.Delegate.CreateDelegate (System.Type type,
>>> System.Reflection.MethodInfo method, Boolean throwOnBindFailure)
>>> [0x00000]
>>>  at System.Delegate.CreateDelegate (System.Type type,
>>> System.Reflection.MethodInfo method) [0x00000]
>>>  at
>>>
>>> Microsoft.Scripting.Utils.InvokeHelper`3[Microsoft.Scripting.Actions.CallSite`1[Microsoft.Scripting.Actions.DynamicSiteTarget`6[System.Object,System.String,Microsoft.Scripting.IAttributesCollection,Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.PythonTuple,System.Object]],Microsoft.Scripting.Actions.DynamicSiteTarget`6[System.Object,System.String,Microsoft.Scripting.IAttributesCollection,Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.PythonTuple,System.Object],Microsoft.Scripting.Actions.CallSite`1[Microsoft.Scripting.Actions.DynamicSiteTarget`6[System.Object,System.String,Microsoft.Scripting.IAttributesCollection,Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.PythonTuple,System.Object]]]..ctor
>>> (System.Reflection.MethodInfo ) [0x00000]
>>>  at <0x00000> <unknown method>
>>>  at (wrapper managed-to-native)
>>> System.Reflection.MonoCMethod:InternalInvoke (object,object[])
>>>  at System.Reflection.MonoCMethod.Invoke (System.Object obj,
>>> BindingFlags
>>> invokeAttr, System.Reflection.Binder binder, System.Object[]
>>> parameters,
>>> System.Globalization.CultureInfo culture) [0x00000] --- End of inner
>>> exception stack trace ---
>>>
>>>  at System.Reflection.MonoCMethod.Invoke (System.Object obj,
>>> BindingFlags
>>> invokeAttr, System.Reflection.Binder binder, System.Object[]
>>> parameters,
>>> System.Globalization.CultureInfo culture) [0x00000]
>>>  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr,
>>> System.Reflection.Binder binder, System.Object[] parameters,
>>> System.Globalization.CultureInfo culture) [0x00000]
>>>  at System.Activator.CreateInstance (System.Type type, BindingFlags
>>> bindingAttr, System.Reflection.Binder binder, System.Object[] args,
>>> System.Globalization.CultureInfo culture, System.Object[]
>>> activationAttributes) [0x00000]
>>>  at System.Activator.CreateInstance (System.Type type, System.Object[]
>>> args, System.Object[] activationAttributes) [0x00000]
>>>  at System.Activator.CreateInstance (System.Type type, System.Object[]
>>> args) [0x00000]
>>>  at Microsoft.Scripting.Utils.ReflectedCaller.SlowCreate
>>> (System.Reflection.MethodInfo info, System.Reflection.ParameterInfo[]
>>> pis) [0x00000]
>>>  at Microsoft.Scripting.Utils.ReflectedCaller.FastCreate
>>> (System.Reflection.MethodInfo target, System.Reflection.ParameterInfo[]
>>> pi) [0x00000]
>>>  at Microsoft.Scripting.Utils.ReflectedCaller.Create
>>> (System.Reflection.MethodInfo info) [0x00000]
>>>>
>>>> On Fri, May 9, 2008 at 8:25 PM, Douglas S. Blank <dblank at brynmawr.edu>
>>>> wrote:
>>>>
>>>>> Does anyone have an example of IronPython2 Beta2 Hosting in C#
>>>>> working
>>>>> with Mono 1.9? I think I have all of the pieces in place, but get an
>>>>> error
>>>>> that ScriptRuntime can not be found on build.
>>>>>
>>>>> Any pointers appreciated!
>>>>>
>>>>> -Doug
>>>>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>


-- 
Douglas S. Blank
Associate Professor, Bryn Mawr College
http://cs.brynmawr.edu/~dblank/
Office: 610 526 6501




More information about the Ironpython-users mailing list