Skip to content

Commit d6690eb

Browse files
committed
2 parents 83f671c + dd7b1ea commit d6690eb

8 files changed

Lines changed: 81 additions & 69 deletions

File tree

tests/ParallelTypeCheckingTests/Code/DependencyResolution.fs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,20 +232,16 @@ module internal DependencyResolution =
232232
// Force .fsi files to depend on all other (previous) .fsi files - avoids the issue of TcEnv being overriden
233233
let additionalFsiDeps =
234234
if node.File.Name.EndsWith ".fsi" then
235-
fsiFiles
235+
nodes
236236
else
237237
[||]
238238

239239
// Collect files from all reachable TrieNodes
240240
let deps =
241241
reachable
242242
|> Seq.collect (fun node -> node.Files)
243-
// TODO Temporary - Add all nodes
244-
// |> Seq.append nodes
245-
// If not, then the below is not necessary.
246-
// Assume that this file depends on all files that have any module abbreviations
243+
// Assume that this file depends on all files that have any module abbreviations - this is probably unnecessary.
247244
// TODO Handle module abbreviations in a better way
248-
// For starters: can module abbreviations affect other files?
249245
|> Seq.append filesWithModuleAbbreviations
250246
|> Seq.append additionalFsiDeps
251247
|> Seq.append fsiDep

tests/ParallelTypeCheckingTests/Code/FileInfoGathering.fs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ let internal gatherBackingInfo (files : SourceFiles) : Files =
2929

3030
type ExtractedData =
3131
{
32-
/// Order of the file in the project. Files with lower number cannot depend on files with higher number
3332
Tops : SimpleId[]
3433
Abbreviations : Abbreviation[]
3534
/// All partial module references found in this file's AST

tests/ParallelTypeCheckingTests/Code/Graph.fs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@
33
#nowarn "40"
44

55
open System.Collections.Generic
6+
open System.IO
7+
open Newtonsoft.Json
68
open ParallelTypeCheckingTests.Utils
79

810
/// <summary> DAG of files </summary>
911
type Graph<'Node> = IReadOnlyDictionary<'Node, 'Node[]>
1012

1113
module Graph =
1214

15+
let make (nodeDeps : ('Node * 'Node[]) seq) =
16+
nodeDeps
17+
|> readOnlyDict
18+
19+
let map (f : 'a -> 'b) (graph : Graph<'a>) : Graph<'b> =
20+
graph
21+
|> Seq.map (fun (KeyValue(node, deps)) -> f node, deps |> Array.map f)
22+
|> make
23+
1324
let collectEdges<'Node when 'Node : equality> (graph : Graph<'Node>) : ('Node * 'Node)[] =
1425
let graph : IReadOnlyDictionary<'Node, 'Node[]> = graph
1526
graph
@@ -78,4 +89,8 @@ module Graph =
7889
|> Seq.iter (fun (KeyValue(file, deps)) -> printfn $"{file} -> {deps |> Array.map printer |> join}")
7990

8091
let print (graph : Graph<'Node>) : unit = printCustom graph (fun node -> node.ToString())
81-
92+
93+
let serialiseToJson (path : string) (graph : Graph<'Node>) : unit =
94+
let json = JsonConvert.SerializeObject(graph, Formatting.Indented)
95+
printfn $"Serialising graph as JSON in {path}"
96+
File.WriteAllText(path, json)

tests/ParallelTypeCheckingTests/Code/ParallelTypeChecking.fs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#nowarn "1182"
33
open System.Collections.Concurrent
44
open System.Collections.Generic
5+
open System.IO
56
open System.Threading
67
open FSharp.Compiler
78
open FSharp.Compiler.CheckBasics
@@ -22,7 +23,6 @@ open FSharp.Compiler.Text
2223
open FSharp.Compiler.TypedTree
2324
open Internal.Utilities.Library
2425
open Internal.Utilities.Library.Extras
25-
open Newtonsoft.Json
2626

2727
type FileGraph = Graph<File>
2828

@@ -118,12 +118,14 @@ let CheckMultipleInputsInParallel
118118
} : DepsResult
119119
else
120120
graph
121+
121122
graph.Graph |> Graph.print
122123

123-
let graphJson = graph.Graph |> Seq.map (fun (KeyValue(file, deps)) -> file.Name, deps |> Array.map (fun d -> d.Name)) |> dict
124-
let json = JsonConvert.SerializeObject(graphJson, Formatting.Indented)
125-
let path = $"c:/projekty/fsharp/heuristic/FCS.deps.json"
126-
System.IO.File.WriteAllText(path, json)
124+
let graphDumpPath =
125+
let graphDumpName = tcConfig.outputFile |> Option.map Path.GetFileName |> Option.defaultValue "project"
126+
$"{graphDumpName}.deps.json"
127+
graph.Graph
128+
|> Graph.serialiseToJson graphDumpPath
127129

128130
let _ = ctok // TODO Use
129131
let diagnosticsLogger = DiagnosticsThreadStatics.DiagnosticsLogger

tests/ParallelTypeCheckingTests/Tests/ComponentTests.args.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
-o:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.dll
1+
-o:..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.dll
22
-g
33
--debug:portable
4-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\buildproperties.fs
5-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.AssemblyInfo.fs
6-
--sourcelink:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.sourcelink.json
4+
--embed:..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\buildproperties.fs
5+
--embed:..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.AssemblyInfo.fs
6+
--sourcelink:..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.sourcelink.json
77
--langversion:Preview
88
--noframework
99
--define:TRACE
@@ -25,18 +25,18 @@
2525
--define:NETCOREAPP2_2_OR_GREATER
2626
--define:NETCOREAPP3_0_OR_GREATER
2727
--define:NETCOREAPP3_1_OR_GREATER
28-
--doc:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.xml
28+
--doc:..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.xml
2929
--keyfile:$PACKAGES$\microsoft.dotnet.arcade.sdk\8.0.0-beta.22552.1\tools\snk/MSFT.snk
3030
--publicsign+
3131
--optimize-
3232
--tailcalls-
3333
-r:$PACKAGES$\fluentassertions\5.10.3\lib\netcoreapp2.1\FluentAssertions.dll
34-
-r:$CODE_ROOT$\artifacts\bin\FSharp.Build\Debug\netstandard2.0\FSharp.Build.dll
35-
-r:$CODE_ROOT$\artifacts\bin\FSharp.Compiler.Interactive.Settings\Debug\netstandard2.0\FSharp.Compiler.Interactive.Settings.dll
36-
-r:$CODE_ROOT$\artifacts\bin\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.dll
37-
-r:$CODE_ROOT$\artifacts\bin\FSharp.Core\Debug\netstandard2.1\FSharp.Core.dll
38-
-r:$CODE_ROOT$\artifacts\bin\FSharp.DependencyManager.Nuget\Debug\netstandard2.0\FSharp.DependencyManager.Nuget.dll
39-
-r:$CODE_ROOT$\artifacts\obj\FSharp.Test.Utilities\Debug\net7.0\ref\FSharp.Test.Utilities.dll
34+
-r:..\..\artifacts\bin\FSharp.Build\Debug\netstandard2.0\FSharp.Build.dll
35+
-r:..\..\artifacts\bin\FSharp.Compiler.Interactive.Settings\Debug\netstandard2.0\FSharp.Compiler.Interactive.Settings.dll
36+
-r:..\..\artifacts\bin\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.dll
37+
-r:..\..\artifacts\bin\FSharp.Core\Debug\netstandard2.1\FSharp.Core.dll
38+
-r:..\..\artifacts\bin\FSharp.DependencyManager.Nuget\Debug\netstandard2.0\FSharp.DependencyManager.Nuget.dll
39+
-r:..\..\artifacts\obj\FSharp.Test.Utilities\Debug\net7.0\ref\FSharp.Test.Utilities.dll
4040
-r:$PACKAGES$\microsoft.build.framework\17.4.0-preview-22469-04\ref\net7.0\Microsoft.Build.Framework.dll
4141
-r:$PACKAGES$\microsoft.build.tasks.core\17.4.0-preview-22469-04\ref\net7.0\Microsoft.Build.Tasks.Core.dll
4242
-r:$PACKAGES$\microsoft.build.utilities.core\17.4.0-preview-22469-04\ref\net7.0\Microsoft.Build.Utilities.Core.dll
@@ -249,10 +249,10 @@
249249
--nowarn:75
250250
--warnon:1182
251251
--simpleresolution
252-
--refout:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\refint\FSharp.Compiler.ComponentTests.dll
253-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\buildproperties.fs
254-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\.NETCoreApp,Version=v7.0.AssemblyAttributes.fs
255-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.AssemblyInfo.fs
252+
--refout:..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\refint\FSharp.Compiler.ComponentTests.dll
253+
..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\buildproperties.fs
254+
..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\.NETCoreApp,Version=v7.0.AssemblyAttributes.fs
255+
..\..\artifacts\obj\FSharp.Compiler.ComponentTests\Debug\net7.0\FSharp.Compiler.ComponentTests.AssemblyInfo.fs
256256
..\service\FsUnit.fs
257257
Conformance\BasicGrammarElements\OperatorNames\OperatorNames.fs
258258
Conformance\BasicGrammarElements\PrecedenceAndOperators\PrecedenceAndOperators.fs

tests/ParallelTypeCheckingTests/Tests/FCS.args.txt

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
-o:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.dll
1+
-o:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.dll
22
-g
33
--debug:embedded
4-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSComp.fs
5-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSIstrings.fs
6-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\UtilsStrings.fs
7-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\buildproperties.fs
8-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.AssemblyInfo.fs
9-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\illex.fs
10-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pplex.fs
11-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\lex.fs
12-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\ilpars.fs
13-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pppars.fs
14-
--embed:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pars.fs
15-
--sourcelink:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.sourcelink.json
4+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSComp.fs
5+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSIstrings.fs
6+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\UtilsStrings.fs
7+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\buildproperties.fs
8+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.AssemblyInfo.fs
9+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\illex.fs
10+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pplex.fs
11+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\lex.fs
12+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\ilpars.fs
13+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pppars.fs
14+
--embed:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pars.fs
15+
--sourcelink:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.sourcelink.json
1616
--noframework
1717
--define:TRACE
1818
--define:COMPILER
@@ -30,16 +30,16 @@
3030
--define:NETSTANDARD1_5_OR_GREATER
3131
--define:NETSTANDARD1_6_OR_GREATER
3232
--define:NETSTANDARD2_0_OR_GREATER
33-
--doc:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.xml
33+
--doc:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.xml
3434
--keyfile:$PACKAGES$\microsoft.dotnet.arcade.sdk\8.0.0-beta.22552.1\tools\snk/MSFT.snk
3535
--publicsign+
3636
--optimize-
37-
--resource:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSComp.resources
38-
--resource:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSIstrings.resources
39-
--resource:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\UtilsStrings.resources
40-
--resource:$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSStrings.resources
41-
-r:$CODE_ROOT$\artifacts\bin\FSharp.Core\Debug\netstandard2.0\FSharp.Core.dll
42-
-r:$CODE_ROOT$\artifacts\bin\FSharp.DependencyManager.Nuget\Debug\netstandard2.0\FSharp.DependencyManager.Nuget.dll
37+
--resource:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSComp.resources
38+
--resource:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSIstrings.resources
39+
--resource:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\UtilsStrings.resources
40+
--resource:..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSStrings.resources
41+
-r:..\..\artifacts\bin\FSharp.Core\Debug\netstandard2.0\FSharp.Core.dll
42+
-r:..\..\artifacts\bin\FSharp.DependencyManager.Nuget\Debug\netstandard2.0\FSharp.DependencyManager.Nuget.dll
4343
-r:$PACKAGES$\microsoft.build.framework\17.4.0-preview-22469-04\ref\netstandard2.0\Microsoft.Build.Framework.dll
4444
-r:$PACKAGES$\microsoft.build.tasks.core\17.4.0-preview-22469-04\ref\netstandard2.0\Microsoft.Build.Tasks.Core.dll
4545
-r:$PACKAGES$\microsoft.build.utilities.core\17.4.0-preview-22469-04\ref\netstandard2.0\Microsoft.Build.Utilities.Core.dll
@@ -198,13 +198,13 @@
198198
--warnon:3218
199199
--warnon:3390
200200
--simpleresolution
201-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSComp.fs
202-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSIstrings.fs
203-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\UtilsStrings.fs
204-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\buildproperties.fs
205-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.InternalsVisibleTo.fs
206-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\.NETStandard,Version=v2.0.AssemblyAttributes.fs
207-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.AssemblyInfo.fs
201+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSComp.fs
202+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSIstrings.fs
203+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\UtilsStrings.fs
204+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\buildproperties.fs
205+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.InternalsVisibleTo.fs
206+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\.NETStandard,Version=v2.0.AssemblyAttributes.fs
207+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.AssemblyInfo.fs
208208
Utilities\sformat.fsi
209209
Utilities\sformat.fs
210210
Utilities\sr.fsi
@@ -274,8 +274,8 @@ AbstractIL\ilx.fsi
274274
AbstractIL\ilx.fs
275275
AbstractIL\ilascii.fsi
276276
AbstractIL\ilascii.fs
277-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\ilpars.fs
278-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\illex.fs
277+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\ilpars.fs
278+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\illex.fs
279279
AbstractIL\ilprint.fsi
280280
AbstractIL\ilprint.fs
281281
AbstractIL\ilmorph.fsi
@@ -310,12 +310,12 @@ SyntaxTree\SyntaxTreeOps.fsi
310310
SyntaxTree\SyntaxTreeOps.fs
311311
SyntaxTree\ParseHelpers.fsi
312312
SyntaxTree\ParseHelpers.fs
313-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pppars.fs
314-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pars.fs
313+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pppars.fs
314+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pars.fs
315315
SyntaxTree\LexHelpers.fsi
316316
SyntaxTree\LexHelpers.fs
317-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pplex.fs
318-
$CODE_ROOT$\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\\lex.fs
317+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\pplex.fs
318+
..\..\artifacts\obj\FSharp.Compiler.Service\Debug\netstandard2.0\\lex.fs
319319
SyntaxTree\LexFilter.fsi
320320
SyntaxTree\LexFilter.fs
321321
TypedTree\tainted.fsi

tests/ParallelTypeCheckingTests/Tests/TestDependencyResolution.fs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,19 +275,16 @@ let ``Analyse whole projects and print statistics`` (projectFile : string) =
275275
log $"{N} files read and parsed"
276276

277277
let graph = DependencyResolution.detectFileDependencies files
278-
log "Deps detected"
278+
log "Dependency graph calculated"
279279

280280
let totalDeps = graph.Graph |> Seq.sumBy (fun (KeyValue(_file, deps)) -> deps.Length)
281281
let maxPossibleDeps = (N * (N-1)) / 2
282282

283-
let graphJson = graph.Graph |> Seq.map (fun (KeyValue(file, deps)) -> file.Name, deps |> Array.map (fun _d -> file.Name)) |> dict
284-
let json = JsonConvert.SerializeObject(graphJson, Formatting.Indented)
285-
let path = $"{System.IO.Path.GetFileName(projectFile)}.deps.json"
286-
System.IO.File.WriteAllText(path, json)
283+
let path = $"{Path.GetFileName(projectFile)}.deps.json"
284+
graph.Graph
285+
|> Graph.serialiseToJson path
287286

288287
log $"Analysed {N} files, detected {totalDeps}/{maxPossibleDeps} file dependencies (%.1f{100.0 * double(totalDeps) / double(maxPossibleDeps)}%%)."
289-
log $"Wrote graph in {path}"
290-
291288
analyseEfficiency graph
292289

293290
let totalDeps = graph.Graph |> Seq.sumBy (fun (KeyValue(_k, v)) -> v.Length)

tests/ParallelTypeCheckingTests/Tests/Utils.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ let CodeRoot =
1515
@$"{__SOURCE_DIRECTORY__}\.checkouts\fcs"
1616
let replaceCodeRoot (s : string) = s.Replace("$CODE_ROOT$", CodeRoot)
1717
let packages =
18-
let pathWithEnv = @"%USERPROFILE%\.nuget\packages"
18+
// Here we assume that the NuGet packages are located in a certain user folder,
19+
// and that the projects being compiled use that global package cache
20+
let userprofile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
21+
let pathWithEnv = $@"{userprofile}\.nuget\packages"
1922
Environment.ExpandEnvironmentVariables(pathWithEnv);
2023
let replacePaths (s : string) =
2124
s

0 commit comments

Comments
 (0)