diff --git a/src/fsharp/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs b/src/fsharp/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs index e16dacc71f6..a79a10a95f7 100644 --- a/src/fsharp/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs +++ b/src/fsharp/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs @@ -209,10 +209,10 @@ module internal Utilities = let succeeded, stdOut, stdErr = if not (isRunningOnCoreClr) then // The Desktop build uses "msbuild" to build - executeBuild msbuildExePath (arguments "") workingDir + executeBuild msbuildExePath (arguments "-v:quiet") workingDir else // The coreclr uses "dotnet msbuild" to build - executeBuild dotnetHostPath (arguments "msbuild") workingDir + executeBuild dotnetHostPath (arguments "msbuild -v:quiet") workingDir let outputFile = projectPath + ".resolvedReferences.paths" let resultOutFile = if succeeded && File.Exists(outputFile) then Some outputFile else None diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 8bbf592c3f5..0ef2834ac2b 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -2290,6 +2290,16 @@ type internal FsiInteractionProcessor | EndOfFile -> istate,defaultArg lastResult (Completed None) (* drop nextAction on EOF *) | CtrlC -> istate,CtrlC (* drop nextAction on CtrlC *) + /// Execute a single parsed interaction which may contain multiple items to be executed + /// independently + let executeParsedInteractions (ctok, tcConfig, istate, action, errorLogger: ErrorLogger, lastResult:option, cancellationToken: CancellationToken) = + let istate, completed = execParsedInteractions (ctok, tcConfig, istate, action, errorLogger, lastResult, cancellationToken) + match completed with + | Completed _ -> + let istate = fsiDynamicCompiler.CommitDependencyManagerText(ctok, istate, lexResourceManager, errorLogger) + istate, completed + | _ -> istate, completed + /// Execute a single parsed interaction on the parser/execute thread. let mainThreadProcessAction ctok action istate = try @@ -2314,7 +2324,7 @@ type internal FsiInteractionProcessor let mainThreadProcessParsedInteractions ctok errorLogger (action, istate) cancellationToken = istate |> mainThreadProcessAction ctok (fun ctok tcConfig istate -> - execParsedInteractions (ctok, tcConfig, istate, action, errorLogger, None, cancellationToken)) + executeParsedInteractions (ctok, tcConfig, istate, action, errorLogger, None, cancellationToken)) let parseExpression (tokenizer:LexFilter.LexFilter) = reusingLexbufForParsing tokenizer.LexBuffer (fun () -> diff --git a/src/fsharp/fsi/fsi.fsproj b/src/fsharp/fsi/fsi.fsproj index 32591e18d2e..bb2bcc73b25 100644 --- a/src/fsharp/fsi/fsi.fsproj +++ b/src/fsharp/fsi/fsi.fsproj @@ -10,7 +10,7 @@ .exe $(NoWarn);45;55;62;75;1204 true - $(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1 + --warnon:1182 --maxerrors:20 --extraoptimizationloops:1 fsi.res true diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs index 386f9de9ecd..a437b95283d 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs @@ -168,12 +168,39 @@ printfn ""%A"" result [] member __.``Eval script with package manager invalid key``() = - use script = new FSharpScript() + use script = new FSharpScript(additionalArgs=[|"/langversion:preview"|]) let result, _errors = script.Eval(@"#r ""nugt:FSharp.Data""") match result with | Ok(_) -> Assert.Fail("expected a failure") | Error(ex) -> Assert.IsInstanceOf(ex) + [] + member __.``Eval script with invalid PackageName should fail immediately``() = + use output = new RedirectConsoleOutput() + use script = new FSharpScript(additionalArgs=[|"/langversion:preview"|]) + let mutable found = 0 + let outp = System.Collections.Generic.List() + output.OutputProduced.Add( + fun line -> + if line.Contains("error NU1101:") && line.Contains("FSharp.Really.Not.A.Package") then + found <- found + 1 + outp.Add(line)) + let _result, _errors = script.Eval("""#r "nuget:FSharp.Really.Not.A.Package" """) + Assert.True( (found = 1), "Expected to see output contains 'error NU1101:' and 'FSharp.Really.Not.A.Package'") + + [] + member __.``Eval script with invalid PackageName should fail immediately and resolve one time only``() = + use output = new RedirectConsoleOutput() + use script = new FSharpScript(additionalArgs=[|"/langversion:preview"|]) + let mutable foundResolve = 0 + output.OutputProduced.Add (fun line -> if line.Contains("Microsoft (R) Build Engine version") then foundResolve <- foundResolve + 1) + let _result, _errors = + script.Eval(""" +#r "nuget:FSharp.Really.Not.A.Package" +#r "nuget:FSharp.Really.Not.Another.Package" + """) + Assert.True( (foundResolve = 1), (sprintf "Expected to see 'Microsoft (R) Build Engine version' only once actually resolved %d times" foundResolve)) + [] member __.``ML - use assembly with ref dependencies``() = let code = @"