[Mono-dev] [PATCH] mcs.exe rsp file support

Peter Dennis Bartok peter at novonyx.com
Tue Aug 30 20:36:55 EDT 2005


Hello,

Microsoft's csc.exe automatically adds everything contained in a csc.rsp 
file as commandline switches whenever csc is called, unless /noconfig is 
explicitly specified.

Mono's mcs.exe does not do that, which often causes confusion, especially 
for people coming from a Microsoft background and it also makes mcs 
incompatible in behaviour with csc.exe.

Attached is a patch for mcs that allows mcs to read command line options out 
of a mcs.rsp file. The rsp file will be read from the same directory that 
contains the Mono machine.config. (usually /etc/mono/1.0 or 
/usr/local/etc/mono/1.0)

The most obvious advantage is to not have to specify /r: on the command-line 
for every referenced assembly, assuming the mcs.rsp file contains the 
references, but the rsp file can contain other command-line switches as 
well, which a user might want set by default.

Since performance worries seem to be the main reason this feature has not 
yet been put into mcs before, I did some performance measurements with the 
following code and the attached mcs.rsp file:

  using System.Windows.Forms;
  class TV  : Form   {
     public static void Main()     {
     }
  }

Compile time went up 0.01s at the most (often less, in multiple runs) for 
the above code, when all assemblies were referenced, compared to just 
/r:System.Windows.Forms.dll specified on the command line.

Maybe someone can also test this with a slower machine, since I've only had 
a 2Ghz P4 for testing, to see what the impact would be with the patch and 
mcs.rsp. I know there's people with slower hardware, and it takes enough 
time as it is to compile mcs, but if the impact of the patch is not 
significant, it'd be great to get this patch in.

Cheers,
  Peter 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcs.rsp
Type: application/octet-stream
Size: 519 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050830/3e606854/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcs.rsp.patch
Type: application/octet-stream
Size: 1466 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050830/3e606854/attachment-0001.obj 


More information about the Mono-devel-list mailing list