Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit25abff1

Browse files
committed
Always use mono-sgen for /resident background process
This ensures mono-sgen is used even if fsc.exe is invoked by xbuild.Aso add tracing diagnostics to /resident startup
1 parentada4cc0 commit25abff1

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

‎src/fsharp/fscmain.fs‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,13 @@ module FSharpResidentCompiler =
170170
:?> FSharpCompilationServer
171171

172172
static memberTryCompileUsingServer(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"
173177
letpwd= System.Environment.CurrentDirectory
174178
letclientOpt=
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.
177182
letclient= FSharpCompilationServer.ConnectToServer()
@@ -181,23 +186,19 @@ module FSharpResidentCompiler =
181186
if!progressthen printfn"client: connected to existing service"
182187
Some client
183188
with_->
189+
if!progressthen printfn"client: error while creating client, starting client instead"
184190
letprocInfo=
185191
if runningOnMonothen
186192
letshellName,useShellExecute=
187193
match System.Environment.GetEnvironmentVariable("FSC_MONO")with
188194
|null->
189195
if 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
191198
else
192-
// create some garbage
193-
for iin0..1000do[0.. i]|> ignore
194-
// test if we're using mono-sgen
195-
letnotUsingMonoSGEN=(System.GC.CollectionCount(0)= System.GC.CollectionCount(1))
196-
lettarget=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
220221
let rectryAcccesServer nRemaining=
222+
if!progressthen printfn"client: trying to access server, nRemaining = '%d'" nRemaining
221223
if nRemaining=0then
222224
// Failed to connect to server, give up
223225
None

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp