Forum: IronRuby Compiling on Mono?

9f7229220b13ec7922f6d826ef16ee2d?d=identicon&s=25 Andrius Bentkus (Guest)
on 2010-10-24 22:52
(Received via mailing list)
Hello,
I know there is a special outdated branch provided by casualjim which
lets
you compile ironruby on mono/linux, but what about the current version?
Can
I compile it with mono? I tried using the 2.8 release of mono to compile
ironruby 1.1.1, but it would result in an error:

        Runtime/SavableScriptCode.cs(40,47): error CS0246: The type or
namespace name `ScriptCode' could not be found. Are you missing a using
directive or an assembly reference?
        Runtime/LanguageBoundTextContentProvider.cs(26,62): error
CS0246:
The type or namespace name `TextContentProvider' could not be found. Are
you
missing a using directive or an assembly reference?
        Runtime/SourceStringContentProvider.cs(25,57): error CS0246: The
type or namespace name `TextContentProvider' could not be found. Are you
missing a using directive or an assembly reference?
        Runtime/NullTextContentProvider.cs(24,51): error CS0246: The
type or
namespace name `TextContentProvider' could not be found. Are you missing
a
using directive or an assembly reference?
        SourceFileContentProvider.cs(27,55): error CS0246: The type or
namespace name `StreamContentProvider' could not be found. Are you
missing a
using directive or an assembly reference?
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2010-10-24 23:51
(Received via mailing list)
I have this branch successfully compiling on Mono:
http://github.com/mletterle/ironruby/tree/linux

compile with xbuild /property:TreatWarningsAsErrors=false
/property:DefineConstants="DEBUG MONO" Ruby.csproj

On Sun, Oct 24, 2010 at 3:23 PM, Andrius Bentkus
<Andrius.Bentkus@rwth-aachen.de> wrote:
> missing a using directive or an assembly reference?
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>



--
Michael Letterle
IronRuby MVP
http://blog.prokrams.com
48bf247037f46e594599b6a2c9532b66?d=identicon&s=25 Alistair Bush (Guest)
on 2010-10-25 01:44
(Received via mailing list)
> I have this branch successfully compiling on Mono:
> http://github.com/mletterle/ironruby/tree/linux
>
> compile with xbuild /property:TreatWarningsAsErrors=false
> /property:DefineConstants="DEBUG MONO" Ruby.csproj

The interesting part is how did you get the other projects that
Ruby,csproj
depends on to build.....

MemoryMapping.V2.cs(16,12): error CS0234: The type or namespace name
`Unix'
does not exist in the namespace `Mono'. Are you missing an assembly
reference?
                                        Task "Csc" execution -- FAILED
                                        Done building target
"CoreCompile" in
project "~/gentoo/dotnet/mono/ironruby-
mletterle/Runtime/Microsoft.Scripting.Metadata/Microsoft.Scripting.Metadata.csproj".--
FAILED

and

dotnet/mono/ironruby-
mletterle/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj
(default
targets) ->
/usr/lib64/mono/4.0/Microsoft.CSharp.targets (CoreCompile target) ->

        Hosting/ScriptScope.cs(229,21): error CS0030: Cannot convert
type
`System.Collections.Generic.KeyValuePair<string,dynamic>' to
`System.Collections.Generic.KeyValuePair<string,object>'

and

dotnet/mono/ironruby-
mletterle/Runtime/Microsoft.Scripting.Metadata/Microsoft.Scripting.Metadata.csproj
(default targets) ->
/usr/lib64/mono/4.0/Microsoft.CSharp.targets (CoreCompile target) ->

        MemoryMapping.V2.cs(16,12): error CS0234: The type or namespace
name
`Unix' does not exist in the namespace `Mono'. Are you missing an
assembly
reference?

         1 Warning(s)
         2 Error(s)

Looking at the Microsoft.Scripting.* projects so no reference to Mono
specific
libraries  (aka Mono.Posix).
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2010-10-25 04:05
(Received via mailing list)
You may have to compile some of the dependency libraries WITHOUT the
MONO constant...

On Sun, Oct 24, 2010 at 7:10 PM, Alistair Bush <ali_bush@gentoo.org>
wrote:
> does not exist in the namespace `Mono'. Are you missing an assembly reference?
> targets) ->
> (default targets) ->
> libraries (aka Mono.Posix).
>> >     Runtime/SavableScriptCode.cs(40,47): error CS0246: The type or
>> > missing a using directive or an assembly reference?
> http://rubyforge.org/mailman/listinfo/ironruby-core
>



--
Michael Letterle
IronRuby MVP
http://blog.prokrams.com
9f7229220b13ec7922f6d826ef16ee2d?d=identicon&s=25 Andrius Bentkus (Guest)
on 2010-10-25 09:55
(Received via mailing list)
I got it compiling, there is a missing reference for Mono.Posix, one bad
cast and you need to use CCI in the constants. Does someone know what
CCI
should be?

On Mon, Oct 25, 2010 at 1:49 AM, Michael Letterle <
48bf247037f46e594599b6a2c9532b66?d=identicon&s=25 Alistair Bush (Guest)
on 2010-10-25 11:47
(Received via mailing list)
> I got it compiling, there is a missing reference for Mono.Posix, one bad
> cast and you need to use CCI in the constants. Does someone know what CCI
> should be?

patches would be nice :)
9f7229220b13ec7922f6d826ef16ee2d?d=identicon&s=25 Andrius Bentkus (Guest)
on 2010-10-25 14:13
(Received via mailing list)
Attachment: 0001-Fix-build-on-mono.patch (2 KB)
On Mon, Oct 25, 2010 at 11:23 AM, Alistair Bush <ali_bush@gentoo.org>
wrote:

> > I got it compiling, there is a missing reference for Mono.Posix, one bad
> > cast and you need to use CCI in the constants. Does someone know what CCI
> > should be?
>
> patches would be nice :)


I can't patch the csproj with the missing reference because it would
break
building on windows. Creating another set of csproj for the a mono build
would be madness. Do csproj'ects support something like ifdef or is it
possible to include a reference only when mono is used?

And the other change I made was a one liner, I don't think that
attaching an
entire patch is is really necessary for it. Just run xbuild with CCI:
xbuild
/property:TreatWarningsAsErrors=false /property:DefineConstants="DEBUG
MONO"
Ruby.csproj
and look at the warning outputs... O for god sake, I'll just attach it.
I used this branch: http://github.com/mletterle/ironruby/tree/linux as
the
base.
76be76f8a8f828821b9299023b3ed22e?d=identicon&s=25 Joe Scott (Guest)
on 2010-10-25 16:19
(Received via mailing list)
Doing a google search I found this.I have not had a chance to try it out
maybe this would
work.http://groups.google.com/group/DotNetDevelopment/m...

Date: Mon, 25 Oct 2010 12:31:08 +0200
From: Andrius.Bentkus@rwth-aachen.de
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 11:23 AM, Alistair Bush <ali_bush@gentoo.org>
wrote:

> I got it compiling, there is a missing reference for Mono.Posix, one bad

> cast and you need to use CCI in the constants. Does someone know what CCI

> should be?



patches would be nice :)
I can't patch the csproj with the missing reference because it would
break building on windows. Creating another set of csproj for the a mono
build would be madness. Do csproj'ects support something like ifdef or
is it possible to include a reference only when mono is used?

And the other change I made was a one liner, I don't think that
attaching an entire patch is is really necessary for it. Just run xbuild
with CCI: xbuild /property:TreatWarningsAsErrors=false
/property:DefineConstants="DEBUG MONO" Ruby.csproj
and look at the warning outputs... O for god sake, I'll just attach it.
I used this branch: http://github.com/mletterle/ironruby/tree/linux as
the base.
F983f0c990cba2fe743ef62a975ec99c?d=identicon&s=25 Curt Hagenlocher (Guest)
on 2010-10-25 17:22
(Received via mailing list)
References in project files can be conditional. I don't have an example
handy, but unless things have changed in the last year :), the project
files should already have a conditional dependency on the Silverlight
assemblies.

From: ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Andrius
Bentkus
Sent: Monday, October 25, 2010 3:31 AM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 11:23 AM, Alistair Bush
<ali_bush@gentoo.org<mailto:ali_bush@gentoo.org>> wrote:
> I got it compiling, there is a missing reference for Mono.Posix, one bad
> cast and you need to use CCI in the constants. Does someone know what CCI
> should be?
patches would be nice :)

I can't patch the csproj with the missing reference because it would
break building on windows. Creating another set of csproj for the a mono
build would be madness. Do csproj'ects support something like ifdef or
is it possible to include a reference only when mono is used?

And the other change I made was a one liner, I don't think that
attaching an entire patch is is really necessary for it. Just run xbuild
with CCI: xbuild /property:TreatWarningsAsErrors=false
/property:DefineConstants="DEBUG MONO" Ruby.csproj
and look at the warning outputs... O for god sake, I'll just attach it.
I used this branch: http://github.com/mletterle/ironruby/tree/linux as
the base.
9f7229220b13ec7922f6d826ef16ee2d?d=identicon&s=25 Andrius Bentkus (Guest)
on 2010-10-25 19:22
(Received via mailing list)
On Mon, Oct 25, 2010 at 2:51 PM, Joe Scott <joseph_scott123@msn.com>
wrote:

>  Doing a google search I found this.
> I have not had a chance to try it out maybe this would work.
> http://groups.google.com/group/DotNetDevelopment/m...
>

It is really possible, I guess I was too lazy to do the search myself,
thanks for googling :)


>
> possible to include a reference only when mono is used?
> _______________________________________________ Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
There is just another question, maybe one of the former developers will
know, why are there 2 build systems now? Why is there a *.build.csproj
for
every *.csproj? Isn't that redudant like the suggested rakefiles?
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2010-10-25 20:57
(Received via mailing list)
I think we should not have any #if MONO conditionals. That would mean
we'd need a different set of binaries for Mono, Moonlight, etc. almost
doubling the number of flavors we have today (desktop CLR, Silverlight
4, Silverlight 3).
Now that Mono 2.8 is released we can use memory mapped files (it wasn't
available when I wrote this code). We don't need to use P/Invokes
anymore.  I have the V4 implementation somewhere almost working so I
might be able to check it in soon.

Tomas

From: ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Andrius
Bentkus
Sent: Monday, October 25, 2010 10:12 AM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] Compiling on Mono?


On Mon, Oct 25, 2010 at 2:51 PM, Joe Scott
<joseph_scott123@msn.com<mailto:joseph_scott123@msn.com>> wrote:
Doing a google search I found this.
I have not had a chance to try it out maybe this would work.
http://groups.google.com/group/DotNetDevelopment/m...

It is really possible, I guess I was too lazy to do the search myself,
thanks for googling :)


________________________________
Date: Mon, 25 Oct 2010 12:31:08 +0200
From:
Andrius.Bentkus@rwth-aachen.de<mailto:Andrius.Bentkus@rwth-aachen.de>
To: ironruby-core@rubyforge.org<mailto:ironruby-core@rubyforge.org>
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 11:23 AM, Alistair Bush
<ali_bush@gentoo.org<mailto:ali_bush@gentoo.org>> wrote:
> I got it compiling, there is a missing reference for Mono.Posix, one bad
> cast and you need to use CCI in the constants. Does someone know what CCI
> should be?
patches would be nice :)

I can't patch the csproj with the missing reference because it would
break building on windows. Creating another set of csproj for the a mono
build would be madness. Do csproj'ects support something like ifdef or
is it possible to include a reference only when mono is used?

And the other change I made was a one liner, I don't think that
attaching an entire patch is is really necessary for it. Just run xbuild
with CCI: xbuild /property:TreatWarningsAsErrors=false
/property:DefineConstants="DEBUG MONO" Ruby.csproj
and look at the warning outputs... O for god sake, I'll just attach it.
I used this branch: http://github.com/mletterle/ironruby/tree/linux as
the base.

_______________________________________________ Ironruby-core mailing
list Ironruby-core@rubyforge.org<mailto:Ironruby-core@rubyforge.org>
http://rubyforge.org/mailman/listinfo/ironruby-core

_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org<mailto:Ironruby-core@rubyforge.org>
http://rubyforge.org/mailman/listinfo/ironruby-core

There is just another question, maybe one of the former developers will
know, why are there 2 build systems now? Why is there a *.build.csproj
for every *.csproj? Isn't that redudant like the suggested rakefiles?
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2010-10-25 22:11
(Received via mailing list)
How do we want to handle things that CAN be worked around in Mono
before they're patched then?

I agree that the same binaries should run in either location, but Mono
necessarily is always playing catchup.

Unless we target Mono.... >.>

On Mon, Oct 25, 2010 at 1:30 PM, Tomas Matousek
<Tomas.Matousek@microsoft.com> wrote:
>
> Subject: Re: [Ironruby-core] Compiling on Mono?
>
>
>
> would be madness. Do csproj'ects support something like ifdef or is it
>
>
> There is just another question, maybe one of the former developers will
> know, why are there 2 build systems now? Why is there a *.build.csproj for
> every *.csproj? Isn't that redudant like the suggestedrakefiles?
>
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>



--
Michael Letterle
IronRuby MVP
http://blog.prokrams.com
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2010-10-25 22:41
(Received via mailing list)
Once we'll have CI server test against Mono we'll discover the problem
right away and don't check in anything that would be broken on Mono.
I suggest we implement the workaround, file bugs into Mono and IronRuby
bug trackers, and add a comment to the code with explanation and a link
to the filed IronRuby bug. When the bug is fixed in Mono we go and
remove the workaround to keep the code base clean.

Tomas
868cfafe762b3a534710098b0caa98e5?d=identicon&s=25 Jb Evain (Guest)
on 2010-10-25 23:33
(Received via mailing list)
On Mon, Oct 25, 2010 at 9:09 PM, Michael Letterle
<michael.letterle@gmail.com> wrote:
> How do we want to handle things that CAN be worked around in Mono
> before they're patched then?

Then it some cases, I think it might make sense to avoid using a
feature in IR which is not yet available in the current stable release
of Mono.

Jb
D91500918a07bfae5b38b8943fd42fbe?d=identicon&s=25 Mike Moore (Guest)
on 2010-10-25 23:34
(Received via mailing list)
On Mon, Oct 25, 2010 at 1:09 PM, Michael Letterle <
michael.letterle@gmail.com> wrote:

> Unless we target Mono.... >.>
>

+1
868cfafe762b3a534710098b0caa98e5?d=identicon&s=25 Jb Evain (Guest)
on 2010-10-25 23:51
(Received via mailing list)
Hey,

On Mon, Oct 25, 2010 at 7:30 PM, Tomas Matousek
<Tomas.Matousek@microsoft.com> wrote:
> I think we should not have any #if MONO conditionals. That would mean we’d
> need a different set of binaries for Mono, Moonlight, etc. almost doubling
> the number of flavors we have today (desktop CLR, Silverlight 4, Silverlight
> 3).
>
> Now that Mono 2.8 is released we can use memory mapped files (it wasn’t
> available when I wrote this code). We don’t need to use P/Invokes anymore.
>  I have the V4 implementation somewhere almost working so I might be able to
> check it in soon.

I completely agree.

Everytime I worked on making IronRuby working on Mono (IronRuby is
constantly kicking Mono's tires, which is very good), I used the
following workflow:

* Avoid any specific Mono branch.
* Fix any path/casing issue directly in the build files (csproj, ...)
* If the code compiles with .net's csc, and doesn't with Mono, file a
bug in Mono, and use a code form that works for both, if possible.
* If the code doesn't compile because of a Mono feature (better unused
local variable/field detection), fix directly in the source.

It also may happen that IronRuby triggers a bug in Mono, and thus,
requires Mono from master to compile/work.

Jb
9f7229220b13ec7922f6d826ef16ee2d?d=identicon&s=25 Andrius Bentkus (Guest)
on 2010-10-26 00:06
(Received via mailing list)
On Mon, Oct 25, 2010 at 10:18 PM, Tomas Matousek <
Tomas.Matousek@microsoft.com> wrote:

> Once we'll have CI server test against Mono we'll discover the problem
> right away and don't check in anything that would be broken on Mono.
> I suggest we implement the workaround, file bugs into Mono and IronRuby bug
> trackers, and add a comment to the code with explanation and a link to the
> filed IronRuby bug. When the bug is fixed in Mono we go and remove the
> workaround to keep the code base clean.
>
>
Tracking and removing again would be overhead but I guess there is no
other
way to do it.
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2010-10-26 01:15
(Received via mailing list)
Well, some of us don't need the CI server as we're programming against
mono already ;)

FWIW, I'm looking into getting the linux CI server back up and running
with CJ's help.

But agreed. I can back out the ifdef I made and just use the work
around.

Also, should we be targeting a specific version of mono, or just
trunk?  Something else to think about.... historically I always used
trunk to allow mono to "catch up" as far as possible since the
majority of work was done against .NET... it seems this might be a
good chance to change that disconnect.

On Mon, Oct 25, 2010 at 4:18 PM, Tomas Matousek
<Tomas.Matousek@microsoft.com> wrote:
>
>> 4, Silverlight 3).
>>
>>
>>
>> Date: Mon, 25 Oct 2010 12:31:08 +0200
>>> what CCI should be?
>> And the other change I made was a one liner, I don't think that
>> _______________________________________________ Ironruby-core mailing
>> *.build.csproj for every *.csproj? Isn't that redudant like the
suggestedrakefiles?
> --
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>



--
Michael Letterle
IronRuby MVP
http://blog.prokrams.com
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2010-10-26 02:45
(Received via mailing list)
We have actually always targeted Mono and IronRuby mostly works on it.
Of course we found a bunch of Mono bugs for which we either implemented
a workaround or filed a bug if the workaround would be too convoluted.

Tomas

From: ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Mike Moore
Sent: Monday, October 25, 2010 1:39 PM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 1:09 PM, Michael Letterle
<michael.letterle@gmail.com<mailto:michael.letterle@gmail.com>> wrote:
Unless we target Mono.... >.>

+1
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2010-10-26 03:37
(Received via mailing list)
By "target" I meant "do primary development against" ^_^

BTW my branch is updated, I reset to the current master/HEAD so it
should be a lot cleaner, also undid the mono ifdef, commented out the
original calls explaining that Mono doesn't support it yet.  Need to
work on some repos/patches/bug filing for mono now.

On Mon, Oct 25, 2010 at 5:50 PM, Tomas Matousek
<Tomas.Matousek@microsoft.com> wrote:
> From: ironruby-core-bounces@rubyforge.org
>
>
>



--
Michael Letterle
IronRuby MVP
http://blog.prokrams.com
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2010-10-27 02:56
(Received via mailing list)
The following two bugs have been filed against mono, there are current
work arounds  implemented on my linux branch to account for them:

https://bugzilla.novell.com/show_bug.cgi?id=649159
System.Threading.Monitor does not contain TryEnter(*, ref bool) methods

https://bugzilla.novell.com/show_bug.cgi?id=649448
REGRESSION: labels inside of delegates defined as a method argument
cannot be resolved

On Mon, Oct 25, 2010 at 9:17 PM, Michael Letterle
<michael.letterle@gmail.com> wrote:
>> course we found a bunch of Mono bugs for which we either implemented a
>> Sent: Monday, October 25, 2010 1:39 PM
>>
>
>
>
> --
> Michael Letterle
> IronRuby MVP
> http://blog.prokrams.com
>



--
Michael Letterle
IronRuby MVP
http://blog.prokrams.com
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2010-10-27 21:23
(Received via mailing list)
I'm seeing much funkiness on mono.. for instance neither system shell
strings nor regex's appear to be working...

On Tue, Oct 26, 2010 at 7:52 PM, Michael Letterle
<michael.letterle@gmail.com> wrote:
> On Mon, Oct 25, 2010 at 9:17 PM, Michael Letterle
>>> We have actually always targeted Mono and IronRuby mostly works on it. Of
>>> [mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Mike Moore
>>> Unless we target Mono.... >.>
>>>
>
> --
> Michael Letterle
> IronRuby MVP
> http://blog.prokrams.com
>



--
Michael Letterle
IronRuby MVP
http://blog.prokrams.com
This topic is locked and can not be replied to.