Bugzilla – Bug 314378
[PATCH] mcs does not pre-load same assemblies than csc
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by gert.driesen@pandora.be 2004-04-12 05:16:10 MST ---- mcs currently does not preload the same assemblies that csc does, as a result some code that compiles on csc without additional assembly references will fail on Mono. Is this the behaviour that we want ? I attached a patch that "corrects" this. ---- Additional Comments From gert.driesen@pandora.be 2004-04-12 05:19:21 MST ---- Created an attachment (id=165875) patch for preloading same assemblies than csc ---- Additional Comments From gonzalo@ximian.com 2004-04-12 05:30:04 MST ---- Btw, csc uses a file called csc.rsp with a set of command line options that are loaded for every compilation unless /noconfig is specified. ---- Additional Comments From bmaurer@users.sf.net 2004-04-12 08:17:17 MST ---- How does this affect bootstrap time? I wonder what this means wrt performance of loading. How about for a `hello world' program, what is the effect there. Also, should we really include an assembly like "System.Configuration.Install", which is 100% stubs? Maybe we should only include assembies which are supported for the 1.0 timeframe. ---- Additional Comments From miguel@ximian.com 2004-04-12 23:20:40 MST ---- The reason we do not preload the same assemblies is bootstrap time, it is more expensive in our compiler to do this than in CSC. With the new patch that fetches namespaces with an unmanaged routine things might be slightly better, but I rather not apply this change. ---- Additional Comments From gert.driesen@pandora.be 2004-04-13 01:58:36 MST ---- Isn't compatibility with CSC more important than pure compile performance. I agree that RUNTIME performance is important, but I'd think compatibility (and improved code quality, eg. #51310) is more important than raw compile performance. But then again, this is just my opinion ... ---- Additional Comments From gert.driesen@pandora.be 2004-04-13 11:33:44 MST ---- For cases where compile performance is crucial, you can always specify the /noconfig option for mcs, and explicitly pass the list of reference assemblies. Miguel, can you please reconsider applying this patch ? ---- Additional Comments From gonzalo@ximian.com 2004-04-13 11:53:24 MST ---- Btw, I wouldn't reapply the patch, but use a mcs.rsp file in /etc/mono and unless /noconfig is passed, inject a @/etc/mono/mcs.rsp before all other parameters. ---- Additional Comments From bmaurer@users.sf.net 2004-04-13 12:39:49 MST ---- Miguel, I think I agree with Gert here: being compatible is *MUCH* more important. One solution we can do is to give MCS a list of the namespaces exposed by the BCL. If, with the default set that we currently has, it can not find an item, it will start loading the other assemblies. However, if the assembly has no relevant classes, it would not load them. Example: If you have: using System.Web; and mcs cant find a class, it would load System.Web.dll and S.W.Services.dll, because those assemblies expose System.Web classes. However, System.Data.dll would *NOT* be loaded, because it does not expose any such classes. IN fact, we could extend this concept even more and not load System.Dll or System.Xml.dll unless they are used. This should make compiling hello world faster. Also, a developer who not want to pay the price of loading the assemblies can modify their rsp file. I do something like this on my windows box today. I really hate having the 5 lines of header, so in my rsp file, I added /nologo. You can just as well delete assemblies. ---- Additional Comments From miguel@ximian.com 2004-04-14 02:02:27 MST ---- Guys, Visual Studio does not add a bunch of predefined assemblies either: you have to manually add the assemblies to the list, one by one. The other factor to keep in mind is that plenty of the assemblies that we would preload are not even part of 1.0, so we are encouraging the use of unsupported libraries. And given the big startup impact this has on the compiler, am really not interested in adding it. Imported an attachment (id=165875) Unknown operating system unknown. Setting to default OS "Other".