Skip to content

Commit

Permalink
Revert "Allow parallel project analysis with an environment variable"
Browse files Browse the repository at this point in the history
This reverts commit c62e89c
  • Loading branch information
safesparrow committed Sep 3, 2022
1 parent ad5d138 commit 57ca46b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
16 changes: 1 addition & 15 deletions src/Compiler/Driver/CompilerImports.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2141,20 +2141,6 @@ and [<Sealed>] TcImports
node {
CheckDisposed()

// TODO inject top-down from FSharpChecker
let runInParallel =
Environment.GetEnvironmentVariable("FCS_PARALLEL_PROJECTS_ANALYSIS")
|> bool.TryParse
|> function
| true, runInParallel -> runInParallel
| false, _ -> false

let runMethod =
if runInParallel then
NodeCode.Parallel
else
NodeCode.Sequential

let! results =
nms
|> List.map (fun nm ->
Expand All @@ -2165,7 +2151,7 @@ and [<Sealed>] TcImports
errorR (Error(FSComp.SR.buildProblemReadingAssembly (nm.resolvedPath, e.Message), nm.originalReference.Range))
return None
})
|> runMethod
|> NodeCode.Sequential

let dllinfos, phase2s = results |> Array.choose id |> List.ofArray |> List.unzip
fixupOrphanCcus ()
Expand Down
8 changes: 1 addition & 7 deletions src/Compiler/Facilities/BuildGraph.fs
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@ type NodeCode private () =

return results.ToArray()
}

static member Parallel (computations: NodeCode<'T> seq) =
computations
|> Seq.map (fun (Node x) -> x)
|> Async.Parallel
|> Node

type private AgentMessage<'T> = GetValue of AsyncReplyChannel<Result<'T, Exception>> * callerCancellationToken: CancellationToken

Expand Down Expand Up @@ -349,7 +343,7 @@ type GraphNode<'T>(retryCompute: bool, computation: NodeCode<'T>) =
// occur, making sure we are under the protection of the 'try'.
// For example, NodeCode's 'try/finally' (TryFinally) uses async.TryFinally which does
// implicit cancellation checks even before the try is entered, as do the
// de-sugaring of 'do!' and other NodeCode constructs.
// de-sugaring of 'do!' and other CodeCode constructs.
let mutable taken = false

try
Expand Down
2 changes: 0 additions & 2 deletions src/Compiler/Facilities/BuildGraph.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ type NodeCode =

static member Sequential: computations: NodeCode<'T> seq -> NodeCode<'T[]>

static member Parallel: computations: (NodeCode<'T> seq) -> NodeCode<'T[]>

/// Execute the cancellable computation synchronously using the ambient cancellation token of
/// the NodeCode.
static member FromCancellable: computation: Cancellable<'T> -> NodeCode<'T>
Expand Down

0 comments on commit 57ca46b

Please sign in to comment.