[m-dev.] Mercury on .NET 2 and Mono

Jonathan Morgan jonmmorgan at gmail.com
Sat May 20 21:54:41 AEST 2006


I tried adding the mercury assembly built by .NET 1.1 to the Mono path
on Windows.  This made it get a little bit further, but after
compiling a few C# files it failed on dir__csharp_code.cs.  Its
failure is due to perceived problems with mercury.io.res_0.

I have also finally got around to testing Mercury with .NET 2 on
Cygwin.  It comes up with similar problems (ie. complaints that you
need to reference the assembly that you are in the process of
building).  This suggests that, rather than sending in bug reports to
Mono, we need to actually find the cause of the problem, and possibly
a fix or work-around.  I suspect that the main problem is the fact
that we are trying to use more than one language in one assembly.  I
think only the standard library relies on incremental building of an
assembly, so it might be easiest to just add special rules to build
the standard library.  I intend to play around with this in the next
couple of months and see what can be done to fix it.  On the other
hand, .NET 1.1 will still build Mercury fine, but it won't run it.
I'm looking into that too.

Jon

PS: For those that are interested, below is a selection of the error
messages under Mono and .NET 2.0.

Mono output:

dir.m(1411,3): error CS1502: The best overloaded method match for
`mercury.dir.mercury_code.ML_dir_read_first_entry(System.Collections.IEnumerator,
ref mercury.io.result_1)' has some invalid arguments

dir.m(1411,3): error CS1503: Argument 2: Cannot convert from `ref
mercury.io.result_1' to `ref mercury.io.result_1'

dir.m(1414,3): error CS1502: The best overloaded method match for
`mercury.dir.mercury_code.ML_make_dir_open_result_error(System.Exception,
ref mercury.io.result_1)' has some invalid arguments

dir.m(1414,3): error CS1503: Argument 2: Cannot convert from `ref
mercury.io.result_1' to `ref mercury.io.result_1'

dir.m(970,3): error CS1502: The best overloaded method match for
`mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(970,3): error CS1503: Argument 2: Cannot convert from `ref
mercury.io.res_0' to `ref mercury.io.res_0'

dir.m(980,4): error CS1502: The best overloaded method match for
`mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(980,4): error CS1503: Argument 2: Cannot convert from `ref
mercury.io.res_0' to `ref mercury.io.res_0'

dir.m(985,4): error CS1502: The best overloaded method match for
`mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(985,4): error CS1503: Argument 2: Cannot convert from `ref
mercury.io.res_0' to `ref mercury.io.res_0'

dir.m(990,4): error CS1502: The best overloaded method match for
`mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(990,4): error CS1503: Argument 2: Cannot convert from `ref
mercury.io.res_0' to `ref mercury.io.res_0'

dir.m(996,4): error CS0029: Cannot implicitly convert type
`mercury.io.res_0' to `mercury.io.res_0'

dir.m(996,4): The type res_0 has two conflicting definitions, one
comes from mercury, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=228c167d12aa0b0b and the other from dir__csharp_code,
Version=0.0.0.0, Culture=neutralerror

(This must be wrong.  The two definitions must be the same, since I
have tested this using exactly the same version of the Mercury
compiler and exactly the same ilasm, Microsoft's).


.NET 2 output:
dir.m(1411,3): error CS0012: The type 'mercury.io.result_1' is defined
in an assembly that is not referenced. You must add a reference to
assembly 'mercury, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=228c167d12aa0b0b'.

dir.dll: (Location of symbol related to previous error)

dir.m(1411,3): error CS1502: The best overloaded method match for
'mercury.dir.mercury_code.ML_dir_read_first_entry(System.Collections.IEnumerator,
ref mercury.io.result_1)' has some invalid arguments

dir.m(1412,8): error CS1503: Argument '2': cannot convert from 'ref
mercury.io.result_1
[c:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\io.dll]'
to 'ref mercury.io.result_1 []'

dir.m(1414,3): error CS1502: The best overloaded method match for
'mercury.dir.mercury_code.ML_make_dir_open_result_error(System.Exception,
ref mercury.io.result_1)' has some invalid arguments

dir.m(1415,8): error CS1503: Argument '2': cannot convert from 'ref
mercury.io.result_1
[c:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\io.dll]'
to 'ref mercury.io.result_1 []'

dir.m(970,3): error CS0012: The type 'mercury.io.res_0' is defined in
an assembly that is not referenced. You must add a reference to
assembly 'mercury, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=228c167d12aa0b0b'.

dir.dll: (Location of symbol related to previous error)

dir.m(970,3): error CS1502: The best overloaded method match for
'mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(973,9): error CS1503: Argument '2': cannot convert from 'ref
mercury.io.res_0
[c:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\io.dll]'
to 'ref mercury.io.res_0 []'

dir.m(980,4): error CS1502: The best overloaded method match for
'mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(983,9): error CS1503: Argument '2': cannot convert from 'ref
mercury.io.res_0
[c:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\io.dll]'
to 'ref mercury.io.res_0 []'

dir.m(985,4): error CS1502: The best overloaded method match for
'mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(988,9): error CS1503: Argument '2': cannot convert from 'ref
mercury.io.res_0
[c:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\io.dll]'
to 'ref mercury.io.res_0 []'

dir.m(990,4): error CS1502: The best overloaded method match for
'mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(993,9): error CS1503: Argument '2': cannot convert from 'ref
mercury.io.res_0
[c:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\io.dll]'
to 'ref mercury.io.res_0 []'

dir.m(997,5): error CS0029: Cannot implicitly convert type
'mercury.io.res_0 []' to 'mercury.io.res_0
[c:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\io.dll]'

dir.m(1001,2): error CS1502: The best overloaded method match for
'mercury.dir.mercury_code.ML_make_mkdir_res_error(System.Exception,
ref mercury.io.res_0)' has some invalid arguments

dir.m(1001,58): error CS1503: Argument '2': cannot convert from 'ref
mercury.io.res_0
[c:\cygwin\installs\mercury-compiler-0.12.2\tmp_dir\library\io.dll]'
to 'ref mercury.io.res_0 []'

I don't know where the res_0 [] is coming from.  It doesn't look to me
like that's its type.

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list