Skip to content

Commit 7aaacc5

Browse files
committed
Fix EnC CDI cross-validation test process launch on Desktop and bare CI images
The Roslyn cross-validation test shells out to dotnet build to produce a real Roslyn PDB. The process launch had two problems. It computed the host path by hand from __SOURCE_DIRECTORY__, which misses on CI images that carry no repo-local .dotnet at that depth, failing with Win32Exception before the build starts. It also left UseShellExecute at its default, which is true on net472 and rejects redirected streams, so every Desktop test leg failed deterministically with InvalidOperationException. Resolve the host like the rest of the test framework via TestFramework.initialConfig.DotNetExe, which prefers the repo-local .dotnet and falls back to PATH, and set UseShellExecute to false explicitly. Verified: FSharp.Compiler.ComponentTests builds clean; EncMethodDebugInformationTests 17 passed, 0 failed (net10.0); fantomas clean on the touched file.
1 parent 66a1412 commit 7aaacc5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/FSharp.Compiler.ComponentTests/CompilerService/EncMethodDebugInformationTests.fs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,15 @@ let private buildCSharpScratchPdb () =
300300
)
301301

302302
let psi = System.Diagnostics.ProcessStartInfo()
303-
psi.FileName <- Path.Combine(__SOURCE_DIRECTORY__, "..", "..", "..", ".dotnet", "dotnet")
303+
// Resolve the dotnet host like the rest of the test framework: repo-local .dotnet
304+
// first, PATH fallback otherwise (the hand-rolled path misses on some CI images).
305+
psi.FileName <- TestFramework.initialConfig.DotNetExe
304306
// ProcessStartInfo.ArgumentList does not exist on net472, so build the quoted argument
305307
// string by hand (projPath is the only argument that can contain spaces).
306308
psi.Arguments <- $"build \"{projPath}\" -c Debug -p:DebugType=portable -v m"
309+
// net472 defaults UseShellExecute to true, which is incompatible with stream
310+
// redirection; set it explicitly so the Desktop test legs can start the process.
311+
psi.UseShellExecute <- false
307312
psi.RedirectStandardOutput <- true
308313
psi.RedirectStandardError <- true
309314
psi.WorkingDirectory <- workDir

0 commit comments

Comments
 (0)