[Mono-dev] Standard name for mcs

Russell Wallace russell.wallace at gmail.com
Sun Jun 27 13:03:55 EDT 2010


Presumably someday I will start distributing new versions of my
program that require C#4, but that's a separate issue; the issue I'm
discussing here, I'm perhaps not explaining very well, I'll try again.

The problem I'm trying to solve is the standard problem of maintaining
backward compatibility for software that has already been distributed.
Once I distribute version X of my program, that's out there in the
field, and the makefile that shipped with it is whatever it is,
regardless of what different makefile I might in the future ship with
version X+1.

The backward compatibility problem, then, is that of making sure that
existing distributions of version X, continue to work when Mono
upgrades from C#3 to 4 to 5 and whatever other versions come in the
future. The usual way to solve this problem (afaik, all other
programming languages solve it this way, though I'm open to correction
on that) is to have a standard name for the compiler -- whatever the
latest/currently installed version thereof is -- so that whatever new
versions of the compiler come along, the same makefile will still
refer to them. It seems to me that would be the best solution for Mono
also. Is there another solution I'm not aware of? Obviously this is
going to be a general issue for any open source C# software
distributed on Unix, so presumably other people will have run across
this; what has been done about it heretofore?

On Sun, Jun 27, 2010 at 5:46 PM, Mark de Bruijn | Dykam
<kramieb at gmail.com> wrote:
> Once your code requires C#4, you change the makefile to C#4. Simple as that.
> Detecting what version your code requires is hard, and I think you've
> guidelines about what C# version you currently use for the project. When you
> update that, you update the makefile.
> --
> Mark
>
>
> On Sun, Jun 27, 2010 at 6:43 PM, Russell Wallace <russell.wallace at gmail.com>
> wrote:
>>
>> The issue is backward compatibility. At the moment, I would like to
>> use C#4 features but I can't because it's not generally available, so
>> I'll stick to C#3; fair enough. But then, having done that, my program
>> should continue to work even when later versions of Mono that support
>> 4 (which is a superset of 3) start appearing in the field. But if I
>> write my makefile to call gmcs, it will start failing as soon as dmcs
>> becomes the default compiler, even though dmcs would presumably be
>> able to compile the code just fine.
>>
>>
>> On Sun, Jun 27, 2010 at 5:38 PM, Mark de Bruijn | Dykam
>> <kramieb at gmail.com> wrote:
>> > Isn't it you deciding what platform your source targets? That is also
>> > the
>> > decision of compiler. Once you get to use eg C#4 features, you want dmcs
>> > to
>> > be the compiler.
>> > --
>> > Mark
>> >
>> >
>> > On Sun, Jun 27, 2010 at 6:37 PM, Russell Wallace
>> > <russell.wallace at gmail.com>
>> > wrote:
>> >>
>> >> I'm trying to distribute a C# program in both binary and source form
>> >> so that the user can optionally recompile it.
>> >>
>> >> According to http://www.mono-project.com/CSharp_Compiler
>> >>
>> >> "You have to pick one of:
>> >>
>> >> mcs: compiler to target 1.1 runtime (to be deprecated with Mono 2.8).
>> >> gmcs: compiler to target the 2.0 runtime.
>> >> smcs: compiler to target the 2.1 runtime, to build Moonlight
>> >> applications.
>> >> dmcs: Starting with Mono 2.6 this command is the C# 4.0 compiler, and
>> >> references the 4.0 runtime."
>> >>
>> >> And indeed on my Ubuntu 10.04 VM, 'gmcs' works but 'mcs' gives an
>> >> error message. (dmcs would be nice to have, presumably it just hasn't
>> >> made it through the pipeline yet -- the Ubuntu version of Mono is
>> >> 2.4.4 -- which is fair enough.)
>> >>
>> >> The problem I'm trying to solve is how to write a reliable makefile. I
>> >> can have the makefile call gmcs, but then presumably this will start
>> >> failing as soon as dmcs becomes the standard version.
>> >>
>> >> Would it be possible to define a command to run whatever the
>> >> latest/currently installed C# compiler is? It seems to me that command
>> >> should be mcs, but it doesn't really matter what it is, as long as it
>> >> works reliably on all systems.
>> >> _______________________________________________
>> >> Mono-devel-list mailing list
>> >> Mono-devel-list at lists.ximian.com
>> >> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>> >
>> >
>
>


More information about the Mono-devel-list mailing list