2024-10-11 20:21 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000463mercuryBugpublic2018-07-20 16:51
Reporterkeri 
Assigned Tojuliensf 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSLinuxOS Version
Product Version 
Target VersionFixed in Version 
Summary0000463: build failure on Linux when mono 5 is installed
DescriptionMono 5 installs both csc and mcs binaries. If the mercury configure script is invoked *without* --with-csharp-compiler=/path/to/mcs, then csc is selected as the C# compiler:

$ ./configure
<snip>
checking for mono... /usr/bin/mono
checking for a C sharp compiler...
checking for csc... /usr/bin/csc
checking version of .NET libraries... 4.0.0.0

This leads to an eventual build failure:

mmc --generate-dependencies --grade reg.gc --mercury-linkage shared --flags LIB_FLAGS --flags INTER_FLAGS -R/usr/lib64/mercury/lib/reg.gc -R/usr/lib64/mercury/lib --no-warn-nothing-exported --no-warn-unused-imports mer_std
mercury_compile: `--host-env-type posix` is incompatible with
  `--csharp-compiler-type microsoft'.
Mercury Compiler, version 14.01.1, configured for x86_64-pc-linux-gnu
Copyright (C) 1993-2014 The University of Melbourne
Usage: mmc [<options>] <arguments>
Use `mmc --help' for more information.
gmake[2]: *** [/var/tmp/portage/dev-lang/mercury-14.01.1/temp/mmake.ypfgqB:1500: mer_std.depend] Error 1


This looks to be a different flavour of an older bug (see bug 0000255) where the Chicken Scheme Compiler (csc) would be selected as the C# compiler. However this time, the csc binary does pass the 'grep "^Microsoft"' configure check:

$ csc
Microsoft (R) Visual C# Compiler version 2.6.0.62309 (d3f6b8e7)
Copyright (C) Microsoft Corporation. All rights reserved.
warning CS2008: No source files specified.
error CS1562: Outputs without source must have the /out option specified


The version of mono installed is 5.12:
$ mono --version
Mono JIT compiler version 5.12.0.226
Steps To Reproduceafter installing mono 5:

$ ./configure
$ make
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0001001

juliensf (administrator)

The basic problem is that Mercury's current detection and recognition of
C# compilers predates the inclusion of the Roslyn C# compiler in Mono.
In particular, Mercury requires (as mentioned in the error message), that
if you are using a MS C# compiler then it needs to be running on Windows.
(This is mainly so that it set up the command lines used to invoke the C#
compiler appropriately, e.g. use Windows style paths etc.)

~0001002

juliensf (administrator)

Fixed by commit c323cc2.
+Notes

-Issue History
Date Modified Username Field Change
2018-07-17 19:54 keri New Issue
2018-07-18 16:24 juliensf Note Added: 0001001
2018-07-18 16:24 juliensf Assigned To => juliensf
2018-07-18 16:24 juliensf Status new => assigned
2018-07-20 16:51 juliensf Status assigned => resolved
2018-07-20 16:51 juliensf Resolution open => fixed
2018-07-20 16:51 juliensf Note Added: 0001002
+Issue History