Need help building IronRuby on Mono 2 + OS X

Hey guys,

I’m running on OS X 10.5.5 with Mono 2.0 (installed via Ports). I ran

rake compile mono=1

I do have pathname2 installed and am using IronRuby trunk revision 180.

I get the following error:
~/Work/ruby/ironruby$ rake compile mono=1 --trace
(in /Users/schonira/Work/ruby/ironruby)
rake aborted!
no such file to load –
/Users/schonira/Work/ruby/ironruby/rake\test.rake
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1598:in load' /Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1598:in load’
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:2413:in
load_imports' /Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:2356:in raw_load_rakefile’
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1985:in
load_rakefile' /Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in standard_exception_handling’
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1984:in
load_rakefile' /Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1969:in run’
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exception_handling' /Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in run’
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load’
/usr/bin/rake:19

Can someone help me out please?

Thanks!
Sidu.

Hello Sidu,

quick fix to open Rakefile then change ‘rake\xxx’ to ‘rake/xxx’.

however, you will get another error.

Macintosh-2:ironruby-r180 Jirapong$ rake compile mono=2.0
(in /Users/Jirapong/ironruby-r180)

dlr_core


dlr_core

Exception caught by the compiler while compiling:
Block that caused the problem begin at: ast/
LambdaExpression.cs(121,38):
Block being compiled: [ast/
LambdaExpression.cs(121,72):,ast/LambdaExpression.cs(123,9):]
System.NullReferenceException: Object reference not set to an instance
of an object
Internal compiler error at ast/LambdaExpression.cs(121,38):: exception
caught while emitting MethodBuilder [Expression`1::Accept]

Unhandled Exception: System.NullReferenceException: Object reference
not set to an instance of an object
at Mono.CSharp.TypeInferenceContext.FixIndependentTypeArguments
(ParameterData methodParameters, System.Boolean& fixed_any) [0x00000]
at Mono.CSharp.TypeInferenceV3.InferInPhases
(Mono.CSharp.EmitContext ec, Mono.CSharp.TypeInferenceContext tic,
ParameterData methodParameters) [0x00000]

Hope this helps,
-Jirapong

That would be a mistake on my part it looks like. If you switch the “”
in the Rakefile imports with “/”, does it work? If so, I’ll make the
change and push it out tonight or tomorrow.

JD

There are some bugs in mono 2.0 that will prevent you from compiling
IronRuby, your best bet is to use the SVN trunk, though I believe 2.2
works
as well. Also, my github linux branch includes various fixes for linux
that
may be necessairy for OSX as well.

On Tue, Dec 30, 2008 at 1:11 AM, [email protected] <

Hi JD,
yes. but follow error was throw.

Macintosh-2:ironruby Jirapong$ rake compile mono=1 --trace
(in /Users/Jirapong/ironruby)
** Invoke compile (first_time)
** Invoke happy (first_time)
** Execute happy
** Invoke clean_build (first_time)
** Invoke happy
** Execute clean_build
** Invoke compile_dlr (first_time)
** Invoke compile_extension_attributes (first_time)
** Invoke clean_build
** Execute compile_extension_attributes

dlr_core

** Execute compile_dlr

dlr_core

Exception caught by the compiler while compiling:
Block that caused the problem begin at: ast/
LambdaExpression.cs(121,38):
Block being compiled: [ast/
LambdaExpression.cs(121,72):,ast/LambdaExpression.cs(123,9):]
System.NullReferenceException: Object reference not set to an instance
of an object
Internal compiler error at ast/LambdaExpression.cs(121,38):: exception
caught while emitting MethodBuilder [Expression`1::Accept]

Unhandled Exception: System.NullReferenceException: Object reference
not set to an instance of an object
at Mono.CSharp.TypeInferenceContext.FixIndependentTypeArguments
(ParameterData methodParameters, System.Boolean& fixed_any) [0x00000]
at Mono.CSharp.TypeInferenceV3.InferInPhases
(Mono.CSharp.EmitContext ec, Mono.CSharp.TypeInferenceContext tic,
ParameterData methodParameters) [0x00000]
at Mono.CSharp.TypeInferenceV3.InferMethodArguments
(Mono.CSharp.EmitContext ec, System.Reflection.MethodBase method)
[0x00000]
at Mono.CSharp.TypeManager.InferTypeArguments
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList arguments,
System.Reflection.MethodBase& method) [0x00000]
at Mono.CSharp.MethodGroupExpr.IsApplicable
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList arguments,
Int32 arg_count, System.Reflection.MethodBase& method, System.Boolean&
params_expanded_form) [0x00000]
at Mono.CSharp.MethodGroupExpr.OverloadResolve
(Mono.CSharp.EmitContext ec, System.Collections.ArrayList& Arguments,
Boolean may_fail, Location loc) [0x00000]
at Mono.CSharp.Invocation.DoResolveOverload
(Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec,
ResolveFlags flags) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.Return.DoResolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.ExitStatement.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block,
Mono.CSharp.Parameters ip, IMethodData md, System.Boolean&
unreachable) [0x00000]
rake aborted!
Command failed with status (1): [gmcs /noconfig @/var/folders/yx/yx-
i1r2PFU…]

Thank you,
-Jirapong

as an aside, I noticed that you put 2.0 in the mono variable, the
actually
value of the mono env variable is immaterial, it just needs to be not
nil :slight_smile:

On Tue, Dec 30, 2008 at 12:30 AM, [email protected] <

Yes, I install mono by MacPort. going to get mono source to try out.

Thank you,
-Jirapong

I’ve tried to build from source on OSX too… with the latest trunk from
mono
but it won’t compile I get the same error.

to make the Rakefile work I had to make 2 minor changes.
In Rakefile I had to change the paths to the other rake files from \ to
/
In rake/misc.rake I had to change line 107 to: commands += (!mono? ?
[‘svn.exe’] : [‘svn’] ) if IronRuby.is_merlin?

» rake compile mono=1 --trace
(in /Users/ivan/src/ironruby/merlin/main/Languages/Ruby)
** Invoke compile (first_time)
** Invoke happy (first_time)
** Execute happy
** Invoke clean_build (first_time)
** Invoke happy
** Execute clean_build
** Invoke compile_dlr (first_time)
** Invoke compile_extension_attributes (first_time)
** Invoke clean_build
** Execute compile_extension_attributes

dlr_core

** Execute compile_dlr

dlr_core

Exception caught by the compiler while compiling:
Block that caused the problem begin at:
Ast/LambdaExpression.cs(121,38):
Block being compiled:
[Ast/LambdaExpression.cs(121,72):,Ast/LambdaExpression.cs(123,9):]
System.NullReferenceException: Object reference not set to an instance
of an
object
Internal compiler error at Ast/LambdaExpression.cs(121,38):: exception
caught while emitting MethodBuilder [Expression`1::Accept]

Unhandled Exception: System.NullReferenceException: Object reference not
set
to an instance of an object
at Mono.CSharp.TypeInferenceContext.FixIndependentTypeArguments
(System.Type[] methodParameters, System.Boolean& fixed_any) [0x00000]
at Mono.CSharp.TypeInferenceV3.InferInPhases (Mono.CSharp.EmitContext
ec,
Mono.CSharp.TypeInferenceContext tic, Mono.CSharp.AParametersCollection
methodParameters) [0x00000]
at Mono.CSharp.TypeInferenceV3.InferMethodArguments
(Mono.CSharp.EmitContext ec, System.Reflection.MethodBase method)
[0x00000]
at Mono.CSharp.TypeManager.InferTypeArguments (Mono.CSharp.EmitContext
ec,
System.Collections.ArrayList arguments, System.Reflection.MethodBase&
method) [0x00000]
at Mono.CSharp.MethodGroupExpr.IsApplicable (Mono.CSharp.EmitContext
ec,
System.Collections.ArrayList arguments, Int32 arg_count,
System.Reflection.MethodBase& method, System.Boolean&
params_expanded_form)
[0x00000]
at Mono.CSharp.MethodGroupExpr.OverloadResolve
(Mono.CSharp.EmitContext
ec, System.Collections.ArrayList& Arguments, Boolean may_fail, Location
loc)
[0x00000]
at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.EmitContext
ec)
[0x00000]
at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec)
[0x00000]

at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec,
ResolveFlags flags) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.Return.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.ExitStatement.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block,
Mono.CSharp.Parameters ip, IMethodData md, System.Boolean& unreachable)
[0x00000]
rake aborted!
Command failed with status (1): [gmcs /noconfig
@/var/folders/-x/-xQjxc2kHg…]
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:971:in sh' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:984:incall’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:984:in sh' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1072:insh’
./context.rb:256:in exec' ./context.rb:554:incompile’
./context.rb:531:in chdir' ./context.rb:531:incompile’
/Users/ivan/src/ironruby/merlin/main/Languages/Ruby/rake/compile.rake:35
./context.rb:711:in instance_eval' ./context.rb:711:insource_context’
/Users/ivan/src/ironruby/merlin/main/Languages/Ruby/rake/compile.rake:34
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in call' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:inexecute’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:inexecute’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in
invoke_with_call_chain' /opt/local/lib/ruby/1.8/monitor.rb:242:insynchronize’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_chain' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:ininvoke_prerequisites’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:ininvoke_prerequisites’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in
invoke_with_call_chain' /opt/local/lib/ruby/1.8/monitor.rb:242:insynchronize’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
invoke_with_call_chain' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:ininvoke’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in
invoke_task' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:intop_level’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:intop_level’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
standard_exception_handling' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:intop_level’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in run' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:instandard_exception_handling’
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in run' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31 /opt/local/bin/rake:19:inload’
/opt/local/bin/rake:19

On Tue, Dec 30, 2008 at 7:21 AM, Michael L. <

Ok now that I know what that error message means i went ahead and forked
ironruby also.
I created a branch called mono and it builds successfully on my mac with
mono.

I basically applied many of the fixes from seo’s patch but for the git
layout and with the sources from 18/12/2008.

I think you also have to set the MERLIN_ROOT environment variable if
you’re
using the git layout.
I use a .bashrc file and there I added the line
export MERLIN_ROOT=’/Users/ivan/src/ironruby/merlin/main’

To get ironruby from my fork and compile it:

git clone git://github.com/casualjim/ironruby.git
cd ironruby
git checkout -b mono
git pull origin mono
cd merlin/main/Languages/Ruby
rake compile mono=1

I tried using Michael’s branch but it didn’t want to work for me.

Thanks Seo, Michael :slight_smile:

What error did you get with my branch? It’s currently building under
Linux
so I’m curious what the differences might be with OSX.

2008/12/30 Ivan Porto C. [email protected]:

I’ve tried to build from source on OSX too… with the latest trunk from mono
but it won’t compile I get the same error.

Try the latest patch on
http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/

(Or equivalently, Michael L.'s git tree on github)

try out but get another error.

(in /Users/Jirapong/ironruby-jim/merlin/main/Languages/Ruby)

dlr_core


dlr_core

Actions/DynamicObject.cs(411,32): error CS0121: The call is ambiguous
between the following methods or properties:
System.Linq.Expressions.Expression.Block(params System.Linq.Expressions.Expression[])' and
System
.Linq
.Expressions
.Expression
.Block
(System
.Collections
.Generic.IEnumerable<System.Linq.Expressions.ParameterExpression>,
params System.Linq.Expressions.Expression[])’
Ast/BlockExpression.cs(568,39): (Location of the symbol related to
previous error)
Ast/BlockExpression.cs(588,39): (Location of the symbol related to
previous error)
Actions/DynamicObject.cs(463,32): error CS0121: The call is ambiguous
between the following methods or properties:
System.Linq.Expressions.Expression.Block(params System.Linq.Expressions.Expression[])' and
System
.Linq
.Expressions
.Expression
.Block
(System
.Collections
.Generic.IEnumerable<System.Linq.Expressions.ParameterExpression>,
params System.Linq.Expressions.Expression[])’
Ast/BlockExpression.cs(568,39): (Location of the symbol related to
previous error)
Ast/BlockExpression.cs(588,39): (Location of the symbol related to
previous error)
Compilation failed: 2 error(s), 0 warnings
rake aborted!
Command failed with status (1): [gmcs /noconfig @/var/folders/yx/yx-
i1r2PFU…]

The error was my own fault… just tried it again and it does work now.

On Tue, Dec 30, 2008 at 5:44 PM, Michael L. <

Are you using mono from macports?
Maybe it’s better to build it from trunk

On Tue, Dec 30, 2008 at 5:58 PM, [email protected] <

Ok, I switched to building Mono from source instead of through ports -
ran into some trouble building mono itself, but I’ll get that sorted out
and then try building Ivan’s fork and let you guys know how that goes.

And a big thank you to all for helping out so much - it really pushes
someone new to IronRuby like me to actually get things working and not
simply give up :slight_smile:

Thanks again and here’s wishing all of you a very happy new year.
Best,
Sidu.

Just FYI, MERLIN_ROOT will only be needed for a couple more weeks at
most. I’m almost finished with some internal repo changes that will
allow the git integration stuff to work. Once the git stuff works, we
can get rid of all of the SVN stuff, then MERLIN_ROOT won’t be a
trigger.

JD

From: [email protected]
[mailto:[email protected]] On Behalf Of Ivan Porto
Carrero
Sent: Tuesday, December 30, 2008 9:07 AM
To: [email protected]
Subject: Re: [Ironruby-core] Need help building IronRuby on Mono 2 + OS
X

The error was my own fault… just tried it again and it does work now.

On Tue, Dec 30, 2008 at 5:44 PM, Michael L.
<[email protected]mailto:[email protected]> wrote:
What error did you get with my branch? It’s currently building under
Linux so I’m curious what the differences might be with OSX.

On Tue, Dec 30, 2008 at 8:27 AM, Ivan Porto C.
<[email protected]mailto:[email protected]> wrote:
Ok now that I know what that error message means i went ahead and forked
ironruby also.
I created a branch called mono and it builds successfully on my mac with
mono.

I basically applied many of the fixes from seo’s patch but for the git
layout and with the sources from 18/12/2008.

I think you also have to set the MERLIN_ROOT environment variable if
you’re using the git layout.
I use a .bashrc file and there I added the line
export MERLIN_ROOT=‘/Users/ivan/src/ironruby/merlin/main’

To get ironruby from my fork and compile it:

git clone
git://github.com/casualjim/ironruby.githttp://github.com/casualjim/ironruby.git
cd ironruby
git checkout -b mono
git pull origin mono
cd merlin/main/Languages/Ruby
rake compile mono=1

I tried using Michael’s branch but it didn’t want to work for me.

Thanks Seo, Michael :slight_smile:

On Tue, Dec 30, 2008 at 1:04 PM, Seo S.
<[email protected]mailto:[email protected]> wrote:
2008/12/30 Ivan Porto C.
<[email protected]mailto:[email protected]>:

I’ve tried to build from source on OSX too… with the latest trunk from mono
but it won’t compile I get the same error.
Try the latest patch on
http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/

(Or equivalently, Michael L.'s git tree on github)


Seo S.


Ironruby-core mailing list
[email protected]mailto:[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


Ironruby-core mailing list
[email protected]mailto:[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


Michael L.
[Polymath Prokrammer]
http://blog.prokrams.com


Ironruby-core mailing list
[email protected]mailto:[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core

I was able to build with Ivan’s instruction base on mono 2.2 RC1. You
can get an installer from
http://mono.ximian.com/monobuild/preview/archive/2.2/macos-10-universal/4/MonoFramework-2.2_4.macos10.novell.universal.dmg

Hope this helps,
-Jirapong