Skip to content

Commit 94247d7

Browse files
committed
Set and replace "GOPATH" in the environment, because .Add-ing it there crashes if it's already there.
Under Windows, Go's stdout seems to be swallowed up unless CreateNoWindow is set to false in the ProcessStartInfo. Regrettably, when Dafny is run under lit, Go's output is still swallowed up somewhere. go figure!
1 parent 189635c commit 94247d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/Dafny/Compiler-go.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3453,13 +3453,13 @@ private bool SendToNewGoProcess(string dafnyProgramName, string targetFilename,
34533453

34543454
var args = string.Format("{0} \"{1}\"", verb, targetFilename);
34553455
var psi = new ProcessStartInfo("go", args) {
3456-
CreateNoWindow = true,
3456+
CreateNoWindow = Environment.OSVersion.Platform != PlatformID.Win32NT,
34573457
UseShellExecute = false,
34583458
RedirectStandardInput = false,
34593459
RedirectStandardOutput = false,
34603460
RedirectStandardError = false,
34613461
};
3462-
psi.EnvironmentVariables.Add("GOPATH", GoPath(targetFilename));
3462+
psi.EnvironmentVariables["GOPATH"] = GoPath(targetFilename);
34633463

34643464
try {
34653465
using (var process = Process.Start(psi)) {

0 commit comments

Comments
 (0)