@@ -170,8 +170,13 @@ module FSharpResidentCompiler =
170170:?> FSharpCompilationServer
171171
172172static member TryCompileUsingServer ( fscServerExe , argv ) =
173+ // Enable these lines to write a log file, e.g. when running under xbuild
174+ //let os = System.IO.File.CreateText "/tmp/fsc-client-log"
175+ //let printfn fmt = Printf.kfprintf (fun () -> fprintfn os ""; os.Flush()) os fmt
176+ progress:= ! progress|| condition" FSHARP_SERVER_PROGRESS"
173177let pwd = System.Environment.CurrentDirectory
174178let clientOpt =
179+ if ! progressthen printfn" client: creating client"
175180// Detect the absence of the channel via the exception. Probably not the best way.
176181// Different exceptions get thrown here on Mono and Windows.
177182let client = FSharpCompilationServer.ConnectToServer()
@@ -181,23 +186,19 @@ module FSharpResidentCompiler =
181186if ! progressthen printfn" client: connected to existing service"
182187 Some client
183188with _ ->
189+ if ! progressthen printfn" client: error while creating client, starting client instead"
184190let procInfo =
185191if runningOnMonothen
186192let shellName , useShellExecute =
187193match System.Environment.GetEnvironmentVariable( " FSC_MONO" ) with
188194| null ->
189195if onWindowsthen
196+ // e.g. "C:\Program Files\Mono-2.6.1\lib\mono\2.0\mscorlib.dll" --> "C:\Program Files\Mono-2.6.1\bin\mono.exe"
190197 Path.Combine( Path.GetDirectoryName( typeof< Object>. Assembly.Location), @" ..\..\..\bin\mono.exe" ), false
191198else
192- // create some garbage
193- for iin 0 .. 1000 do [ 0 .. i] |> ignore
194- // test if we're using mono-sgen
195- let notUsingMonoSGEN = ( System.GC.CollectionCount( 0 ) = System.GC.CollectionCount( 1 ))
196- let target = if notUsingMonoSGENthen " mono" else " mono-sgen"
197- target, true
198- | path-> path, false
199+ " mono-sgen" , true
200+ | path-> path, true
199201
200- // e.g. "C:\Program Files\Mono-2.6.1\lib\mono20\mscorlib.dll" --> "C:\Program Files\Mono-2.6.1\bin\mono.exe"
201202 ProcessStartInfo( FileName= shellName,
202203 Arguments= fscServerExe+ " /server" ,
203204 CreateNoWindow= true ,
@@ -218,6 +219,7 @@ module FSharpResidentCompiler =
218219
219220// Create the client proxy and attempt to connect to the server
220221let rec tryAcccesServer nRemaining =
222+ if ! progressthen printfn" client: trying to access server, nRemaining = '%d '" nRemaining
221223if nRemaining= 0 then
222224// Failed to connect to server, give up
223225 None