[patch] Issue in DLR.CommandLine with new lines

Hey,

I spent some time investigating why on Mono ir.exe (last git revision)
doesn’t print the result of evaluations.

The issue lies in the processing of new lines in
Microsoft.Scripting.Core.Hosting.Shell.CommandLine.

The code is appending \n as terminating new lines, but checks for the
presence of Environment.NewLine inside the evaluated string. Obviously
it works only if Environment.NewLine is \r\n, and not \n.

Attached is a suggested patch, addressing the issue.

Great i’ll add those to the mono branch :slight_smile:

Great i’ll add those to the mono branch :slight_smile:

Sorry for the obvious question: where is the mono branch ?

I think I reached a point where I need to build it myself (and I want
to stay on Mac for the moment :-).

– Thibaut

http://github.com/mletterle/ironruby

cd src

git clone
git://github.com/mletterle/ironruby.githttp://github.com/casualjim/ironruby.git
cd ironruby
git checkout -b linux
git pull origin linux

./build (you may have to chmod +x that build file first) or sh build

if you put ~/bin in your PATH variable it will build, package and deploy
an
ironruby version. I’m still updating the build though at the moment. If
you
join the IRC channel you can see my check in coming through. I’ll also
send
a mail to this mailinglist when I’m done :).

On Tue, Mar 3, 2009 at 3:34 PM, Thibaut Barrère

Hey Ivan,

On 3/3/09, Ivan Porto C. [email protected] wrote:

Great i’ll add those to the mono branch :slight_smile:

Do you keep a log of what goes into this branch? Does the branch
contain any workaround for a Mono issue that has not been solved, or
reported?

Cool :slight_smile: I went ahead and added the bit about the build script, also
removed
the instruction with the patch file as that is not necessary anymore.

I have updated the instructions at
http://wiki.github.com/ironruby/ironruby#wiki_building-mono. Except for
the build step. The wiki says to use “rake compile mono=1”. Feel free to
update the wiki if there is a better way to do the build.

From: [email protected]
[mailto:[email protected]] On Behalf Of Ivan Porto
Carrero
Sent: Tuesday, March 03, 2009 6:47 AM
To: [email protected]
Subject: Re: [Ironruby-core] [patch] Issue in DLR.CommandLine with new
lines

http://github.com/mletterle/ironruby

cd src

git clone
git://github.com/mletterle/ironruby.githttp://github.com/casualjim/ironruby.git
cd ironruby
git checkout -b linux
git pull origin linux

./build (you may have to chmod +x that build file first) or sh build

if you put ~/bin in your PATH variable it will build, package and deploy
an ironruby version. I’m still updating the build though at the moment.
If you join the IRC channel you can see my check in coming through. I’ll
also send a mail to this mailinglist when I’m done :).

On Tue, Mar 3, 2009 at 3:34 PM, Thibaut Barrère
<[email protected]mailto:[email protected]> wrote:

Great i’ll add those to the mono branch :slight_smile:
Sorry for the obvious question: where is the mono branch ?

I think I reached a point where I need to build it myself (and I want
to stay on Mac for the moment :-).

– Thibaut


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

Perhaps…
Most of the fixes in that branch have to do with type inference and
missing
parameterless constructors.

public class MyType{
}

Compiles on MS.NET but not on Mono.

public class MyType{
public MyType(){
}
}

There is an issue though around delegates but this has to do with
generic
type parameter inference again.

And the reason I still didn’t check in today is because gmcs is
complaining
about a file being defined twice but I can’t find it anywhere :(.
Interpreter is the name of the file, when I look at the class
descriptions
most of them have been defined as partial classes and it does build on
windows :slight_smile:
I had a merge conflict on Microsoft.Scripting.Build.csproj but i thought
that had to do with line endings as I couldn’t spot the conflict
anywhere in
the file and when I threw the 2 files in a file comparer line endings
were
the only differences.

I’ll try to chase up that one problem with delegates

http://github.com/casualjim/ironruby/commit/1d06f3dead4de74f3529c8c028a655e0fc94a7a4#diff-4

Mono didn’t want to cast the Expression to a LambdaExpression :slight_smile:
On that page you can find most of the code fixes I made to make IR
compile
on mono.
I’ve just repeated those in Michaels branch and just have to delete my
fork
at some stage :slight_smile:

Hey,

On 3/3/09, Ivan Porto C. [email protected] wrote:

On that page you can find most of the code fixes I made to make IR compile
on mono.

Very nice, thanks!

Hey,

On 3/3/09, Ivan Porto C. [email protected] wrote:

public class MyType{
}

Compiles on MS.NET but not on Mono.

Huh? It does compile on Mono. It must be a different issue.

There is an issue though around delegates but this has to do with generic
type parameter inference again.

Have you filed a bug or extracted a test case?

Anyway, I’ll make sure IronRuby compiles fine with gmcs.

I have updated the instructions at
http://wiki.github.com/ironruby/ironruby#wiki_building-mono. Except for the
build step. The wiki says to use “rake compile mono=1”. Feel free to update
the wiki if there is a better way to do the build.

Ivan, Shri, thanks for the build info and updating the wiki. Building
it on mono right now.

cheers

– Thibaut

Ok I just checked in the latest git push from Jim into the linux branch.
I
also applied your patches JB.
As it turns out it was a merge conflict in
Microsoft.Scripting.Build.csproj,
but git found it unnecessary to mark it as a conflict and just kept the
older version of the file.

It looks like Runtime/LegacyScriptCode.cs (ironic as IR hasn’t even hit
1.0
yet :)) got added and 2 files in the Interpreter couldn’t be found
because
they didn’t exist anymore.

Ok I just checked in the latest git push from Jim into the linux branch. I
also applied your patches JB.
As it turns out it was a merge conflict in Microsoft.Scripting.Build.csproj,
but git found it unnecessary to mark it as a conflict and just kept the
older version of the file.

It looks like Runtime/LegacyScriptCode.cs (ironic as IR hasn’t even hit 1.0
yet :)) got added and 2 files in the Interpreter couldn’t be found because
they didn’t exist anymore.

Seems I have a compile issue (pulled the linux branch) - I’m using the
chmod’ed +x build:

Exception caught by the compiler while compiling:
Block that caused the problem begin at:
Runtime/LegacyScriptCode.cs(58,35):
Block being compiled:
[Runtime/LegacyScriptCode.cs(59,34):,Runtime/LegacyScriptCode.cs(67,13):]
System.NullReferenceException: Object reference not set to an instance
of an object
Internal compiler error at Runtime/LegacyScriptCode.cs(58,35)::
exception caught while emitting MethodBuilder
[LegacyScriptCode::EnsureTarget]

Do you meet this as well ? I’m using Mono 2.4.

– Thibaut

For me it builds but I’m on mono trunk

On the build server it builds as well:
http://ironruby.colliertech.org/integrity/ironruby/builds/45599d7a3f2f769fc5f658ea2f8eaec1e2eb666a

I can publish a packaged version automatically when I build if you want.
That would typically be 1-2 days behind on Jim’s pushes.

I’ll set up a git repo with mono builds and publish the url here and on
the
wiki

On Tue, Mar 3, 2009 at 9:38 PM, Thibaut Barrère

Hi Ivan,

I can publish a packaged version automatically when I build if you want.
That would typically be 1-2 days behind on Jim’s pushes.

I’ll set up a git repo with mono builds and publish the url here and on the
wiki

that will be useful, thanks!

– Thibaut

You can find the binaries @
http://github.com/casualjim/ironruby-mono-builds

On Tue, Mar 3, 2009 at 10:25 PM, Thibaut Barrère

You can find the binaries @
http://github.com/casualjim/ironruby-mono-builds

Lovely - cloning it right now.

thanks!

– Thibaut

In case that’s useful to someone else, I had to:
ln -s ~/git/ironruby-mono-builds/lib/ ~/lib
ln -s ~/git/ironruby-mono-builds/bin/ ~/bin

thanks again Ivan!

– Thibaut

On Tue, Mar 3, 2009 at 10:53 PM, Thibaut Barrère

Hi,

It worked, after some wrestling with the paths. Thanks.

Cheers,
Rafael
www.rafaelrosafu.com