Compiling on Mono?

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 nameTextContentProvider’ 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 nameTextContentProvider’ 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?

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
[email protected] wrote:

missing a using directive or an assembly reference?
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


Michael L.
IronRuby MVP
http://blog.prokrams.com

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).

You may have to compile some of the dependency libraries WITHOUT the
MONO constant…

On Sun, Oct 24, 2010 at 7:10 PM, Alistair B. [email protected]
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 L.
IronRuby MVP
http://blog.prokrams.com

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 L. <

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 :slight_smile:

On Mon, Oct 25, 2010 at 11:23 AM, Alistair B. [email protected]
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 :slight_smile:

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.

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/msg/ba5e2bd42ecb83e3

Date: Mon, 25 Oct 2010 12:31:08 +0200
From: [email protected]
To: [email protected]
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 11:23 AM, Alistair B. [email protected]
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 :slight_smile:
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.

On Mon, Oct 25, 2010 at 2:51 PM, Joe S. [email protected]
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/msg/ba5e2bd42ecb83e3

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

possible to include a reference only when mono is used?
_______________________________________________ Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


Ironruby-core mailing list
[email protected]
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?

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: [email protected]
[mailto:[email protected]] On Behalf Of Andrius
Bentkus
Sent: Monday, October 25, 2010 3:31 AM
To: [email protected]
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 11:23 AM, Alistair B.
<[email protected]mailto:[email protected]> 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 :slight_smile:

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.

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 M.
[email protected] 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
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


Michael L.
IronRuby MVP
http://blog.prokrams.com

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

On Mon, Oct 25, 2010 at 9:09 PM, Michael L.
[email protected] 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

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: [email protected]
[mailto:[email protected]] On Behalf Of Andrius
Bentkus
Sent: Monday, October 25, 2010 10:12 AM
To: [email protected]
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 2:51 PM, Joe S.
<[email protected]mailto:[email protected]> 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/msg/ba5e2bd42ecb83e3

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


Date: Mon, 25 Oct 2010 12:31:08 +0200
From:
[email protected]mailto:[email protected]
To: [email protected]mailto:[email protected]
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 11:23 AM, Alistair B.
<[email protected]mailto:[email protected]> 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 :slight_smile:

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 [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

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?

Hey,

On Mon, Oct 25, 2010 at 7:30 PM, Tomas M.
[email protected] 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

On Mon, Oct 25, 2010 at 1:09 PM, Michael L. <
[email protected]> wrote:

Unless we target Mono… >.>

+1

Well, some of us don’t need the CI server as we’re programming against
mono already :wink:

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 M.
[email protected] 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?

[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


Michael L.
IronRuby MVP
http://blog.prokrams.com

On Mon, Oct 25, 2010 at 10:18 PM, Tomas M. <
[email protected]> 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.

By “target” I meant “do primary development against” :slight_smile:

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 M.
[email protected] wrote:

From: [email protected]


Michael L.
IronRuby MVP
http://blog.prokrams.com

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: [email protected]
[mailto:[email protected]] On Behalf Of Mike M.
Sent: Monday, October 25, 2010 1:39 PM
To: [email protected]
Subject: Re: [Ironruby-core] Compiling on Mono?

On Mon, Oct 25, 2010 at 1:09 PM, Michael L.
<[email protected]mailto:[email protected]> wrote:
Unless we target Mono… >.>

+1